48cd08c5cc34abd392a0bc6262831e39c34cd602
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #if defined(_WIN32)
39 #   if defined(__GNUC__) || defined(__TINYC__)
40 #      define ecere_stdcall __attribute__((__stdcall__))
41 #      define ecere_gcc_struct __attribute__((gcc_struct))
42 #   else
43 #      define ecere_stdcall __stdcall
44 #      define ecere_gcc_struct
45 #   endif
46 #else
47 #   define ecere_stdcall
48 #   define ecere_gcc_struct
49 #endif
50 #include <stdint.h>
51 #include <sys/types.h>
52 enum yytokentype
53 {
54 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372, WIDE_STRING_LITERAL = 373, BUILTIN_OFFSETOF = 374
55 };
56
57 extern int returnCode;
58
59 extern unsigned int yydebug;
60
61 extern unsigned int echoOn;
62
63 void resetScanner();
64
65 int propWatcherID;
66
67 int expression_yyparse();
68
69 static char * thisNameSpace;
70
71 unsigned int thisClassParams = 1;
72
73 unsigned int internalValueCounter;
74
75 extern unsigned int outputLineNumbers;
76
77 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isInf;
78
79 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_signBit;
80
81 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isNan;
82
83 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isInf;
84
85 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_signBit;
86
87 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isNan;
88
89 extern int targetBits;
90
91 extern unsigned int inCompiler;
92
93 extern unsigned int inPreCompiler;
94
95 extern unsigned int inDebugger;
96
97 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
98
99 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
100
101 int UnescapeString(char * d, char * s, int len)
102 {
103 int j = 0, k = 0;
104 char ch;
105
106 while(j < len && (ch = s[j]))
107 {
108 switch(ch)
109 {
110 case '\\':
111 switch((ch = s[++j]))
112 {
113 case 'n':
114 d[k] = '\n';
115 break;
116 case 't':
117 d[k] = '\t';
118 break;
119 case 'a':
120 d[k] = '\a';
121 break;
122 case 'b':
123 d[k] = '\b';
124 break;
125 case 'f':
126 d[k] = '\f';
127 break;
128 case 'r':
129 d[k] = '\r';
130 break;
131 case 'v':
132 d[k] = '\v';
133 break;
134 case '\\':
135 d[k] = '\\';
136 break;
137 case '\"':
138 d[k] = '\"';
139 break;
140 case '\'':
141 d[k] = '\'';
142 break;
143 default:
144 d[k] = '\\';
145 d[k] = ch;
146 }
147 break;
148 default:
149 d[k] = ch;
150 }
151 j++, k++;
152 }
153 d[k] = '\0';
154 return k;
155 }
156
157 char * OffsetEscapedString(char * s, int len, int offset)
158 {
159 char ch;
160 int j = 0, k = 0;
161
162 while(j < len && k < offset && (ch = s[j]))
163 {
164 if(ch == '\\')
165 ++j;
166 j++, k++;
167 }
168 return (k == offset) ? s + j : (((void *)0));
169 }
170
171 extern int __ecereVMethodID_class_OnGetString;
172
173 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
174
175 extern unsigned int parseError;
176
177 static int definedExpStackPos;
178
179 static void * definedExpStack[512];
180
181 extern const char *  sourceFile;
182
183 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
184
185 unsigned int reachedPass15;
186
187 extern unsigned int memoryGuard;
188
189 struct __ecereNameSpace__ecere__sys__OldList
190 {
191 void *  first;
192 void *  last;
193 int count;
194 unsigned int offset;
195 unsigned int circ;
196 } ecere_gcc_struct;
197
198 struct __ecereNameSpace__ecere__com__DataValue
199 {
200 union
201 {
202 char c;
203 unsigned char uc;
204 short s;
205 unsigned short us;
206 int i;
207 unsigned int ui;
208 void *  p;
209 float f;
210 double d;
211 long long i64;
212 uint64 ui64;
213 } ecere_gcc_struct __anon1;
214 } ecere_gcc_struct;
215
216 struct __ecereNameSpace__ecere__com__SerialBuffer
217 {
218 unsigned char *  _buffer;
219 unsigned int count;
220 unsigned int _size;
221 unsigned int pos;
222 } ecere_gcc_struct;
223
224 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
225
226 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
227
228 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
229
230 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
231
232 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
233
234 struct Pointer;
235
236 struct Attrib;
237
238 struct Attribute;
239
240 struct TemplateArgument;
241
242 struct DBTableEntry;
243
244 struct DBIndexItem;
245
246 struct DBTableDef;
247
248 struct CodePosition
249 {
250 int line;
251 int charPos;
252 int pos;
253 int included;
254 } ecere_gcc_struct;
255
256 extern size_t strlen(const char * );
257
258 extern int strcmp(const char * , const char * );
259
260 extern int sprintf(char * , const char * , ...);
261
262 extern char *  strcat(char * , const char * );
263
264 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
265
266 extern int isprint(int c);
267
268 extern char *  strcpy(char * , const char * );
269
270 extern void Compiler_Error(const char *  format, ...);
271
272 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
273
274 struct __ecereNameSpace__ecere__com__LinkList
275 {
276 void * first;
277 void * last;
278 int count;
279 } ecere_gcc_struct;
280
281 extern char *  strchr(const char * , int);
282
283 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
284
285 extern void *  memcpy(void * , const void * , size_t size);
286
287 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
288
289 extern void Compiler_Warning(const char *  format, ...);
290
291 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
292
293 extern long long strtoll(const char *  nptr, char * *  endptr, int base);
294
295 extern uint64 strtoull(const char *  nptr, char * *  endptr, int base);
296
297 extern int strtol(const char * , char * * , int base);
298
299 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
300
301 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
302
303 extern double strtod(const char * , char * * );
304
305 extern int strncmp(const char * , const char * , size_t n);
306
307 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
308
309 extern char *  QMkString(const char *  source);
310
311 extern char *  strncpy(char * , const char * , size_t n);
312
313 extern int printf(const char * , ...);
314
315 extern char *  strstr(const char * , const char * );
316
317 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
318
319 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
320
321 extern int (* __ecereProp_float_Get_signBit)(float this);
322
323 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
324
325 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
326
327 extern int (* __ecereProp_double_Get_signBit)(double this);
328
329 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
330
331 extern float (* __ecereMethod_float_inf)(void);
332
333 extern float (* __ecereMethod_float_nan)(void);
334
335 extern double (* __ecereMethod_double_inf)(void);
336
337 extern double (* __ecereMethod_double_nan)(void);
338
339 int __ecereVMethodID_class_OnGetString;
340
341 void SetYydebug(unsigned int b)
342 {
343 yydebug = b;
344 }
345
346 unsigned int GetParseError()
347 {
348 return parseError;
349 }
350
351 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
352
353 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
354
355 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
356
357 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
358
359 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
360
361 struct __ecereNameSpace__ecere__com__EnumClassData
362 {
363 struct __ecereNameSpace__ecere__sys__OldList values;
364 long long largest;
365 } ecere_gcc_struct;
366
367 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
368
369 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
370
371 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
372
373 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
374
375 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
376
377 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
378
379 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
380
381 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
382
383 struct Location
384 {
385 struct CodePosition start;
386 struct CodePosition end;
387 } ecere_gcc_struct;
388
389 void ReadString(char * output, char * string)
390 {
391 int len = strlen(string);
392 int c, d = 0;
393 unsigned int quoted = 0, escaped = 0;
394
395 for(c = 0; c < len; c++)
396 {
397 char ch = string[c];
398
399 if(escaped)
400 {
401 switch(ch)
402 {
403 case 'n':
404 output[d] = '\n';
405 break;
406 case 't':
407 output[d] = '\t';
408 break;
409 case 'a':
410 output[d] = '\a';
411 break;
412 case 'b':
413 output[d] = '\b';
414 break;
415 case 'f':
416 output[d] = '\f';
417 break;
418 case 'r':
419 output[d] = '\r';
420 break;
421 case 'v':
422 output[d] = '\v';
423 break;
424 case '\\':
425 output[d] = '\\';
426 break;
427 case '\"':
428 output[d] = '\"';
429 break;
430 case '\'':
431 output[d] = '\'';
432 break;
433 default:
434 output[d] = ch;
435 }
436 d++;
437 escaped = 0;
438 }
439 else
440 {
441 if(ch == '\"')
442 quoted ^= 1;
443 else if(quoted)
444 {
445 if(ch == '\\')
446 escaped = 1;
447 else
448 output[d++] = ch;
449 }
450 }
451 }
452 output[d] = '\0';
453 }
454
455 char * PrintInt(long long result)
456 {
457 char temp[100];
458
459 if(result > (((int)0x7fffffff)))
460 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
461 else
462 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
463 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
464 strcat(temp, "LL");
465 return __ecereNameSpace__ecere__sys__CopyString(temp);
466 }
467
468 char * PrintUInt(uint64 result)
469 {
470 char temp[100];
471
472 if(result > (0xffffffff))
473 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
474 else if(result > (((int)0x7fffffff)))
475 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
476 else
477 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
478 return __ecereNameSpace__ecere__sys__CopyString(temp);
479 }
480
481 char * PrintInt64(long long result)
482 {
483 char temp[100];
484
485 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
486 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
487 else
488 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
489 return __ecereNameSpace__ecere__sys__CopyString(temp);
490 }
491
492 char * PrintUInt64(uint64 result)
493 {
494 char temp[100];
495
496 if(result > (0xffffffff))
497 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
498 else if(result > (((int)0x7fffffff)))
499 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
500 else
501 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
502 return __ecereNameSpace__ecere__sys__CopyString(temp);
503 }
504
505 char * PrintHexUInt(uint64 result)
506 {
507 char temp[100];
508
509 if(result > (0xffffffff))
510 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
511 else
512 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
513 if(result > (0xffffffff))
514 strcat(temp, "LL");
515 return __ecereNameSpace__ecere__sys__CopyString(temp);
516 }
517
518 char * PrintHexUInt64(uint64 result)
519 {
520 char temp[100];
521
522 if(result > (0xffffffff))
523 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
524 else
525 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
526 return __ecereNameSpace__ecere__sys__CopyString(temp);
527 }
528
529 char * PrintShort(short result)
530 {
531 char temp[100];
532
533 sprintf(temp, "%d", (unsigned short)result);
534 return __ecereNameSpace__ecere__sys__CopyString(temp);
535 }
536
537 char * PrintUShort(unsigned short result)
538 {
539 char temp[100];
540
541 if(result > 32767)
542 sprintf(temp, "0x%X", (int)result);
543 else
544 sprintf(temp, "%d", (int)result);
545 return __ecereNameSpace__ecere__sys__CopyString(temp);
546 }
547
548 char * PrintUChar(unsigned char result)
549 {
550 char temp[100];
551
552 sprintf(temp, "0x%X", result);
553 return __ecereNameSpace__ecere__sys__CopyString(temp);
554 }
555
556 char * PrintChar(char result)
557 {
558 char temp[100];
559
560 if(result > 0 && isprint(result))
561 sprintf(temp, "'%c'", result);
562 else if(result < 0)
563 sprintf(temp, "%d", (int)result);
564 else
565 sprintf(temp, "0x%X", (unsigned char)result);
566 return __ecereNameSpace__ecere__sys__CopyString(temp);
567 }
568
569 char * PrintFloat(float result)
570 {
571 char temp[350];
572
573 if(__ecereProp_float_Get_isInf(result))
574 {
575 if(__ecereProp_float_Get_signBit(result))
576 strcpy(temp, "-inf");
577 else
578 strcpy(temp, "inf");
579 }
580 else if(__ecereProp_float_Get_isNan(result))
581 {
582 if(__ecereProp_float_Get_signBit(result))
583 strcpy(temp, "-nan");
584 else
585 strcpy(temp, "nan");
586 }
587 else
588 sprintf(temp, "%.16ff", result);
589 return __ecereNameSpace__ecere__sys__CopyString(temp);
590 }
591
592 char * PrintDouble(double result)
593 {
594 char temp[350];
595
596 if(__ecereProp_double_Get_isInf(result))
597 {
598 if(__ecereProp_double_Get_signBit(result))
599 strcpy(temp, "-inf");
600 else
601 strcpy(temp, "inf");
602 }
603 else if(__ecereProp_double_Get_isNan(result))
604 {
605 if(__ecereProp_double_Get_signBit(result))
606 strcpy(temp, "-nan");
607 else
608 strcpy(temp, "nan");
609 }
610 else
611 sprintf(temp, "%.16f", result);
612 return __ecereNameSpace__ecere__sys__CopyString(temp);
613 }
614
615 extern struct Location yylloc;
616
617 struct ExtDecl
618 {
619 struct Location loc;
620 int type;
621 union
622 {
623 char * s;
624 struct Attrib * attr;
625 } ecere_gcc_struct __anon1;
626 } ecere_gcc_struct;
627
628 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
629
630 struct Expression;
631
632 extern struct Expression * parsedExpression;
633
634 extern struct Expression * QMkExpId(const char *  id);
635
636 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
637
638 void ComputeExpression(struct Expression * exp);
639
640 extern struct Expression * MkExpConstant(const char *  string);
641
642 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
643
644 extern void FreeExpression(struct Expression * exp);
645
646 extern void FreeExpContents(struct Expression * exp);
647
648 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
649
650 extern struct Expression * CopyExpression(struct Expression * exp);
651
652 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
653
654 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
655
656 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
657
658 extern struct Expression * MoveExpContents(struct Expression * exp);
659
660 extern struct Expression * QBrackets(struct Expression * exp);
661
662 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
663
664 struct Statement;
665
666 static struct Statement * curCompound;
667
668 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
669
670 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
671
672 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
673
674 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
675
676 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
677
678 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
679
680 struct External;
681
682 struct External * curExternal, * afterExternal;
683
684 extern void FreeExternal(struct External * external);
685
686 struct Type;
687
688 static struct Type * curSwitchType;
689
690 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
691
692 extern void FreeType(struct Type * type);
693
694 extern struct Type * MkClassType(const char *  name);
695
696 extern void CopyTypeInto(struct Type * type, struct Type * src);
697
698 struct __ecereNameSpace__ecere__com__Class;
699
700 struct __ecereNameSpace__ecere__com__Instance
701 {
702 void * *  _vTbl;
703 struct __ecereNameSpace__ecere__com__Class * _class;
704 int _refCount;
705 } ecere_gcc_struct;
706
707 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
708
709 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
710
711 static struct __ecereNameSpace__ecere__com__Class * currentClass;
712
713 struct __ecereNameSpace__ecere__com__Class * thisClass;
714
715 struct __ecereNameSpace__ecere__com__Class * containerClass;
716
717 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
718
719 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
720
721 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
722
723 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
724
725 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
726
727 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
728
729 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
730
731 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
732
733 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
734
735 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
736
737 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
738
739 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
740 {
741 thisClass = c;
742 }
743
744 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
745 {
746 return thisClass;
747 }
748
749 struct Context;
750
751 extern struct Context * curContext;
752
753 extern struct Context * topContext;
754
755 extern struct Context * PushContext(void);
756
757 extern void PopContext(struct Context * ctx);
758
759 extern void FreeContext(struct Context * context);
760
761 extern struct Context * globalContext;
762
763 struct ModuleImport;
764
765 extern struct ModuleImport * mainModule;
766
767 struct ModuleImport
768 {
769 struct ModuleImport * prev;
770 struct ModuleImport * next;
771 char *  name;
772 struct __ecereNameSpace__ecere__sys__OldList classes;
773 struct __ecereNameSpace__ecere__sys__OldList functions;
774 int importType;
775 int importAccess;
776 } ecere_gcc_struct;
777
778 struct __ecereNameSpace__ecere__com__NameSpace;
779
780 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
781
782 struct FunctionDefinition;
783
784 static struct FunctionDefinition * curFunction;
785
786 struct __ecereNameSpace__ecere__sys__BTNode;
787
788 struct __ecereNameSpace__ecere__sys__BTNode
789 {
790 uintptr_t key;
791 struct __ecereNameSpace__ecere__sys__BTNode * parent;
792 struct __ecereNameSpace__ecere__sys__BTNode * left;
793 struct __ecereNameSpace__ecere__sys__BTNode * right;
794 int depth;
795 } ecere_gcc_struct;
796
797 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
798
799 struct __ecereNameSpace__ecere__com__Property;
800
801 struct __ecereNameSpace__ecere__com__Property
802 {
803 struct __ecereNameSpace__ecere__com__Property * prev;
804 struct __ecereNameSpace__ecere__com__Property * next;
805 const char *  name;
806 unsigned int isProperty;
807 int memberAccess;
808 int id;
809 struct __ecereNameSpace__ecere__com__Class * _class;
810 const char *  dataTypeString;
811 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
812 struct Type * dataType;
813 void (*  Set)(void * , int);
814 int (*  Get)(void * );
815 unsigned int (*  IsSet)(void * );
816 void *  data;
817 void *  symbol;
818 int vid;
819 unsigned int conversion;
820 unsigned int watcherOffset;
821 const char *  category;
822 unsigned int compiled;
823 unsigned int selfWatchable;
824 unsigned int isWatchable;
825 } ecere_gcc_struct;
826
827 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
828
829 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
830
831 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
832
833 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
834
835 struct Identifier;
836
837 extern void FreeIdentifier(struct Identifier * id);
838
839 extern struct Identifier * MkIdentifier(const char *  string);
840
841 extern struct Expression * MkExpIdentifier(struct Identifier * id);
842
843 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
844
845 extern struct Identifier * CopyIdentifier(struct Identifier * id);
846
847 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
848
849 struct __ecereNameSpace__ecere__sys__OldLink;
850
851 struct __ecereNameSpace__ecere__sys__OldLink
852 {
853 struct __ecereNameSpace__ecere__sys__OldLink * prev;
854 struct __ecereNameSpace__ecere__sys__OldLink * next;
855 void *  data;
856 } ecere_gcc_struct;
857
858 struct Declaration;
859
860 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
861
862 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
863
864 struct Specifier;
865
866 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
867
868 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
869
870 extern struct Specifier * MkSpecifier(int specifier);
871
872 extern struct Specifier * MkSpecifierName(const char *  name);
873
874 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
875
876 extern void FreeSpecifier(struct Specifier * spec);
877
878 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
879
880 struct Statement
881 {
882 struct Statement * prev;
883 struct Statement * next;
884 struct Location loc;
885 int type;
886 union
887 {
888 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
889 struct
890 {
891 struct Identifier * id;
892 struct Statement * stmt;
893 } ecere_gcc_struct labeled;
894 struct
895 {
896 struct Expression * exp;
897 struct Statement * stmt;
898 } ecere_gcc_struct caseStmt;
899 struct
900 {
901 struct __ecereNameSpace__ecere__sys__OldList * declarations;
902 struct __ecereNameSpace__ecere__sys__OldList * statements;
903 struct Context * context;
904 unsigned int isSwitch;
905 } ecere_gcc_struct compound;
906 struct
907 {
908 struct __ecereNameSpace__ecere__sys__OldList * exp;
909 struct Statement * stmt;
910 struct Statement * elseStmt;
911 } ecere_gcc_struct ifStmt;
912 struct
913 {
914 struct __ecereNameSpace__ecere__sys__OldList * exp;
915 struct Statement * stmt;
916 } ecere_gcc_struct switchStmt;
917 struct
918 {
919 struct __ecereNameSpace__ecere__sys__OldList * exp;
920 struct Statement * stmt;
921 } ecere_gcc_struct whileStmt;
922 struct
923 {
924 struct __ecereNameSpace__ecere__sys__OldList * exp;
925 struct Statement * stmt;
926 } ecere_gcc_struct doWhile;
927 struct
928 {
929 struct Statement * init;
930 struct Statement * check;
931 struct __ecereNameSpace__ecere__sys__OldList * increment;
932 struct Statement * stmt;
933 } ecere_gcc_struct forStmt;
934 struct
935 {
936 struct Identifier * id;
937 } ecere_gcc_struct gotoStmt;
938 struct
939 {
940 struct Specifier * spec;
941 char * statements;
942 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
943 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
944 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
945 } ecere_gcc_struct asmStmt;
946 struct
947 {
948 struct Expression * watcher;
949 struct Expression * object;
950 struct __ecereNameSpace__ecere__sys__OldList * watches;
951 } ecere_gcc_struct _watch;
952 struct
953 {
954 struct Identifier * id;
955 struct __ecereNameSpace__ecere__sys__OldList * exp;
956 struct __ecereNameSpace__ecere__sys__OldList * filter;
957 struct Statement * stmt;
958 } ecere_gcc_struct forEachStmt;
959 struct Declaration * decl;
960 } ecere_gcc_struct __anon1;
961 } ecere_gcc_struct;
962
963 extern struct Specifier * CopySpecifier(struct Specifier * spec);
964
965 extern struct Expression * MkExpClassSize(struct Specifier * _class);
966
967 struct Symbol;
968
969 struct Identifier
970 {
971 struct Identifier * prev;
972 struct Identifier * next;
973 struct Location loc;
974 struct Symbol * classSym;
975 struct Specifier * _class;
976 char *  string;
977 struct Identifier * badID;
978 } ecere_gcc_struct;
979
980 extern struct Symbol * FindStruct(struct Context * ctx, const char *  name);
981
982 extern struct Symbol * FindClass(const char *  name);
983
984 extern void DeclareClass(struct External * neededFor, struct Symbol * classSym, const char *  className);
985
986 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
987
988 extern void FreeSymbol(struct Symbol * symbol);
989
990 struct ClassDef;
991
992 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
993
994 extern void FreeClassDef(struct ClassDef * def);
995
996 struct Declarator;
997
998 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
999
1000 struct TemplateDatatype
1001 {
1002 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1003 struct Declarator * decl;
1004 } ecere_gcc_struct;
1005
1006 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1007
1008 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1009
1010 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1011
1012 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
1013
1014 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
1015
1016 struct Declarator
1017 {
1018 struct Declarator * prev;
1019 struct Declarator * next;
1020 struct Location loc;
1021 int type;
1022 struct Symbol * symbol;
1023 struct Declarator * declarator;
1024 union
1025 {
1026 struct Identifier * identifier;
1027 struct
1028 {
1029 struct Expression * exp;
1030 struct Expression * posExp;
1031 struct Attrib * attrib;
1032 } ecere_gcc_struct structDecl;
1033 struct
1034 {
1035 struct Expression * exp;
1036 struct Specifier * enumClass;
1037 } ecere_gcc_struct array;
1038 struct
1039 {
1040 struct __ecereNameSpace__ecere__sys__OldList * parameters;
1041 } ecere_gcc_struct function;
1042 struct
1043 {
1044 struct Pointer * pointer;
1045 } ecere_gcc_struct pointer;
1046 struct
1047 {
1048 struct ExtDecl * extended;
1049 } ecere_gcc_struct extended;
1050 } ecere_gcc_struct __anon1;
1051 } ecere_gcc_struct;
1052
1053 extern struct Identifier * GetDeclId(struct Declarator * decl);
1054
1055 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
1056
1057 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1058
1059 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1060
1061 extern void FreeDeclarator(struct Declarator * decl);
1062
1063 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1064
1065 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
1066
1067 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1068
1069 struct FunctionDefinition
1070 {
1071 struct FunctionDefinition * prev;
1072 struct FunctionDefinition * next;
1073 struct Location loc;
1074 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1075 struct Declarator * declarator;
1076 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1077 struct Statement * body;
1078 struct __ecereNameSpace__ecere__com__Class * _class;
1079 struct __ecereNameSpace__ecere__sys__OldList attached;
1080 int declMode;
1081 struct Type * type;
1082 struct Symbol * propSet;
1083 int tempCount;
1084 unsigned int propertyNoThis;
1085 } ecere_gcc_struct;
1086
1087 extern struct Declarator * QMkPtrDecl(const char *  id);
1088
1089 struct ClassFunction;
1090
1091 struct ClassFunction
1092 {
1093 struct ClassFunction * prev;
1094 struct ClassFunction * next;
1095 struct Location loc;
1096 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1097 struct Declarator * declarator;
1098 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1099 struct Statement * body;
1100 struct __ecereNameSpace__ecere__com__Class * _class;
1101 struct __ecereNameSpace__ecere__sys__OldList attached;
1102 int declMode;
1103 struct Type * type;
1104 struct Symbol * propSet;
1105 unsigned int isVirtual;
1106 unsigned int isConstructor;
1107 unsigned int isDestructor;
1108 unsigned int dontMangle;
1109 int id;
1110 int idCode;
1111 } ecere_gcc_struct;
1112
1113 extern struct External * ProcessClassFunction(struct __ecereNameSpace__ecere__com__Class * owningClass, struct ClassFunction * func, struct __ecereNameSpace__ecere__sys__OldList * defs, struct External * after, unsigned int makeStatic);
1114
1115 extern void FreeClassFunction(struct ClassFunction * func);
1116
1117 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1118
1119 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1120
1121 struct TypeName;
1122
1123 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1124
1125 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1126
1127 struct TypeName
1128 {
1129 struct TypeName * prev;
1130 struct TypeName * next;
1131 struct Location loc;
1132 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
1133 struct Declarator * declarator;
1134 int classObjectType;
1135 struct Expression * bitCount;
1136 } ecere_gcc_struct;
1137
1138 extern void FreeTypeName(struct TypeName * typeName);
1139
1140 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
1141
1142 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
1143
1144 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
1145
1146 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
1147
1148 struct __ecereNameSpace__ecere__com__BTNamedLink;
1149
1150 struct __ecereNameSpace__ecere__com__BTNamedLink
1151 {
1152 const char *  name;
1153 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1154 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1155 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1156 int depth;
1157 void *  data;
1158 } ecere_gcc_struct;
1159
1160 struct __ecereNameSpace__ecere__sys__NamedLink64;
1161
1162 struct __ecereNameSpace__ecere__sys__NamedLink64
1163 {
1164 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
1165 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
1166 char *  name;
1167 long long data;
1168 } ecere_gcc_struct;
1169
1170 struct Instantiation;
1171
1172 struct Declaration
1173 {
1174 struct Declaration * prev;
1175 struct Declaration * next;
1176 struct Location loc;
1177 int type;
1178 union
1179 {
1180 struct
1181 {
1182 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1183 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1184 } ecere_gcc_struct __anon1;
1185 struct Instantiation * inst;
1186 struct
1187 {
1188 struct Identifier * id;
1189 struct Expression * exp;
1190 } ecere_gcc_struct __anon2;
1191 } ecere_gcc_struct __anon1;
1192 struct Specifier * extStorage;
1193 struct Symbol * symbol;
1194 int declMode;
1195 } ecere_gcc_struct;
1196
1197 struct Instantiation
1198 {
1199 struct Instantiation * prev;
1200 struct Instantiation * next;
1201 struct Location loc;
1202 struct Specifier * _class;
1203 struct Expression * exp;
1204 struct __ecereNameSpace__ecere__sys__OldList *  members;
1205 struct Symbol * symbol;
1206 unsigned int fullSet;
1207 unsigned int isConstant;
1208 unsigned char *  data;
1209 struct Location nameLoc;
1210 struct Location insideLoc;
1211 unsigned int built;
1212 } ecere_gcc_struct;
1213
1214 extern void FreeInstance(struct Instantiation * inst);
1215
1216 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
1217
1218 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
1219
1220 struct InitDeclarator;
1221
1222 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1223
1224 struct PropertyWatch;
1225
1226 struct PropertyWatch
1227 {
1228 struct PropertyWatch * prev;
1229 struct PropertyWatch * next;
1230 struct Location loc;
1231 struct Statement * compound;
1232 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1233 unsigned int deleteWatch;
1234 } ecere_gcc_struct;
1235
1236 extern void FreePropertyWatch(struct PropertyWatch * watcher);
1237
1238 struct PropertyImport;
1239
1240 struct PropertyImport
1241 {
1242 struct PropertyImport * prev;
1243 struct PropertyImport * next;
1244 char *  name;
1245 unsigned int isVirtual;
1246 unsigned int hasSet;
1247 unsigned int hasGet;
1248 } ecere_gcc_struct;
1249
1250 struct MethodImport;
1251
1252 struct MethodImport
1253 {
1254 struct MethodImport * prev;
1255 struct MethodImport * next;
1256 char *  name;
1257 unsigned int isVirtual;
1258 } ecere_gcc_struct;
1259
1260 struct FunctionImport;
1261
1262 struct FunctionImport
1263 {
1264 struct FunctionImport * prev;
1265 struct FunctionImport * next;
1266 char *  name;
1267 } ecere_gcc_struct;
1268
1269 struct ClassImport;
1270
1271 struct ClassImport
1272 {
1273 struct ClassImport * prev;
1274 struct ClassImport * next;
1275 char *  name;
1276 struct __ecereNameSpace__ecere__sys__OldList methods;
1277 struct __ecereNameSpace__ecere__sys__OldList properties;
1278 unsigned int itself;
1279 int isRemote;
1280 } ecere_gcc_struct;
1281
1282 struct Initializer;
1283
1284 struct Expression
1285 {
1286 struct Expression * prev;
1287 struct Expression * next;
1288 struct Location loc;
1289 int type;
1290 union
1291 {
1292 struct
1293 {
1294 char *  constant;
1295 struct Identifier * identifier;
1296 } ecere_gcc_struct __anon1;
1297 struct Statement * compound;
1298 struct Instantiation * instance;
1299 struct
1300 {
1301 char *  string;
1302 unsigned int intlString;
1303 unsigned int wideString;
1304 } ecere_gcc_struct __anon2;
1305 struct __ecereNameSpace__ecere__sys__OldList *  list;
1306 struct
1307 {
1308 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1309 struct Declarator * decl;
1310 } ecere_gcc_struct _classExp;
1311 struct
1312 {
1313 struct Identifier * id;
1314 } ecere_gcc_struct classData;
1315 struct
1316 {
1317 struct Expression * exp;
1318 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1319 struct Location argLoc;
1320 } ecere_gcc_struct call;
1321 struct
1322 {
1323 struct Expression * exp;
1324 struct __ecereNameSpace__ecere__sys__OldList * index;
1325 } ecere_gcc_struct index;
1326 struct
1327 {
1328 struct Expression * exp;
1329 struct Identifier * member;
1330 int memberType;
1331 unsigned int thisPtr;
1332 } ecere_gcc_struct member;
1333 struct
1334 {
1335 int op;
1336 struct Expression * exp1;
1337 struct Expression * exp2;
1338 } ecere_gcc_struct op;
1339 struct TypeName * typeName;
1340 struct Specifier * _class;
1341 struct
1342 {
1343 struct TypeName * typeName;
1344 struct Expression * exp;
1345 } ecere_gcc_struct cast;
1346 struct
1347 {
1348 struct Expression * cond;
1349 struct __ecereNameSpace__ecere__sys__OldList * exp;
1350 struct Expression * elseExp;
1351 } ecere_gcc_struct cond;
1352 struct
1353 {
1354 struct TypeName * typeName;
1355 struct Expression * size;
1356 } ecere_gcc_struct _new;
1357 struct
1358 {
1359 struct TypeName * typeName;
1360 struct Expression * size;
1361 struct Expression * exp;
1362 } ecere_gcc_struct _renew;
1363 struct
1364 {
1365 char * table;
1366 struct Identifier * id;
1367 } ecere_gcc_struct db;
1368 struct
1369 {
1370 struct Expression * ds;
1371 struct Expression * name;
1372 } ecere_gcc_struct dbopen;
1373 struct
1374 {
1375 struct TypeName * typeName;
1376 struct Initializer * initializer;
1377 } ecere_gcc_struct initializer;
1378 struct
1379 {
1380 struct Expression * exp;
1381 struct TypeName * typeName;
1382 } ecere_gcc_struct vaArg;
1383 struct
1384 {
1385 struct TypeName * typeName;
1386 struct Identifier * id;
1387 } ecere_gcc_struct offset;
1388 } ecere_gcc_struct __anon1;
1389 unsigned int debugValue;
1390 struct __ecereNameSpace__ecere__com__DataValue val;
1391 uint64 address;
1392 unsigned int hasAddress;
1393 struct Type * expType;
1394 struct Type * destType;
1395 unsigned int usage;
1396 int tempCount;
1397 unsigned int byReference;
1398 unsigned int isConstant;
1399 unsigned int addedThis;
1400 unsigned int needCast;
1401 unsigned int thisPtr;
1402 unsigned int opDestType;
1403 unsigned int needTemplateCast;
1404 } ecere_gcc_struct;
1405
1406 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1407
1408 struct Initializer
1409 {
1410 struct Initializer * prev;
1411 struct Initializer * next;
1412 struct Location loc;
1413 int type;
1414 union
1415 {
1416 struct Expression * exp;
1417 struct __ecereNameSpace__ecere__sys__OldList *  list;
1418 } ecere_gcc_struct __anon1;
1419 unsigned int isConstant;
1420 struct Identifier * id;
1421 } ecere_gcc_struct;
1422
1423 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1424
1425 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
1426
1427 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
1428
1429 struct InitDeclarator
1430 {
1431 struct InitDeclarator * prev;
1432 struct InitDeclarator * next;
1433 struct Location loc;
1434 struct Declarator * declarator;
1435 struct Initializer * initializer;
1436 } ecere_gcc_struct;
1437
1438 void ApplyLocation(struct Expression * exp, struct Location * loc)
1439 {
1440 exp->loc = *loc;
1441 switch(exp->type)
1442 {
1443 case 4:
1444 if(exp->__anon1.op.exp1)
1445 ApplyLocation(exp->__anon1.op.exp1, loc);
1446 if(exp->__anon1.op.exp2)
1447 ApplyLocation(exp->__anon1.op.exp2, loc);
1448 break;
1449 case 5:
1450 if(exp->__anon1.list)
1451 {
1452 struct Expression * e;
1453
1454 for(e = (*exp->__anon1.list).first; e; e = e->next)
1455 ApplyLocation(e, loc);
1456 }
1457 break;
1458 case 6:
1459 if(exp->__anon1.index.index)
1460 {
1461 struct Expression * e;
1462
1463 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1464 ApplyLocation(e, loc);
1465 }
1466 if(exp->__anon1.index.exp)
1467 ApplyLocation(exp->__anon1.index.exp, loc);
1468 break;
1469 case 7:
1470 if(exp->__anon1.call.arguments)
1471 {
1472 struct Expression * arg;
1473
1474 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1475 ApplyLocation(arg, loc);
1476 }
1477 if(exp->__anon1.call.exp)
1478 ApplyLocation(exp->__anon1.call.exp, loc);
1479 break;
1480 case 8:
1481 case 9:
1482 if(exp->__anon1.member.exp)
1483 ApplyLocation(exp->__anon1.member.exp, loc);
1484 break;
1485 case 11:
1486 if(exp->__anon1.cast.exp)
1487 ApplyLocation(exp->__anon1.cast.exp, loc);
1488 break;
1489 case 12:
1490 if(exp->__anon1.cond.exp)
1491 {
1492 struct Expression * e;
1493
1494 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1495 ApplyLocation(e, loc);
1496 }
1497 if(exp->__anon1.cond.cond)
1498 ApplyLocation(exp->__anon1.cond.cond, loc);
1499 if(exp->__anon1.cond.elseExp)
1500 ApplyLocation(exp->__anon1.cond.elseExp, loc);
1501 break;
1502 case 34:
1503 if(exp->__anon1.vaArg.exp)
1504 ApplyLocation(exp->__anon1.vaArg.exp, loc);
1505 break;
1506 default:
1507 break;
1508 }
1509 }
1510
1511 void __ecereMethod_Expression_Clear();
1512
1513 struct MembersInit;
1514
1515 struct MembersInit
1516 {
1517 struct MembersInit * prev;
1518 struct MembersInit * next;
1519 struct Location loc;
1520 int type;
1521 union
1522 {
1523 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1524 struct ClassFunction * function;
1525 } ecere_gcc_struct __anon1;
1526 } ecere_gcc_struct;
1527
1528 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
1529
1530 struct Operand;
1531
1532 struct OpTable
1533 {
1534 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1535 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1536 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1537 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1538 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1539 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1540 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1541 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1542 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1543 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1544 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1545 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1546 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1547 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1548 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1549 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1550 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1551 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1552 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1553 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1554 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1555 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1556 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1557 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1558 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1559 unsigned int (*  Not)(struct Expression *, struct Operand *);
1560 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1561 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1562 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1563 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1564 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1565 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1566 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1567 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1568 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1569 } ecere_gcc_struct;
1570
1571 struct Operand
1572 {
1573 int kind;
1574 struct Type * type;
1575 unsigned int ptrSize;
1576 union
1577 {
1578 char c;
1579 unsigned char uc;
1580 short s;
1581 unsigned short us;
1582 int i;
1583 unsigned int ui;
1584 float f;
1585 double d;
1586 long long i64;
1587 uint64 ui64;
1588 } ecere_gcc_struct __anon1;
1589 struct OpTable ops;
1590 } ecere_gcc_struct;
1591
1592 struct External *  _DeclareStruct(struct External *  neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl);
1593
1594 struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference)
1595 {
1596 return _DeclareStruct(neededBy, name, skipNoHead, needDereference, 0);
1597 }
1598
1599 static void _DeclareType(struct External *  neededFor, struct Type *  type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl);
1600
1601 void DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1602 {
1603 _DeclareType(neededFor, type, needDereference, forFunctionDef, 0);
1604 }
1605
1606 void DeclareTypeForwardDeclare(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1607 {
1608 _DeclareType(neededFor, type, needDereference, forFunctionDef, 1);
1609 }
1610
1611 static void _PrintType(struct Type *  type, char *  string, unsigned int printName, unsigned int fullName, unsigned int printConst);
1612
1613 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1614 {
1615 _PrintType(type, string, printName, fullName, 1);
1616 }
1617
1618 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1619 {
1620 _PrintType(type, string, printName, fullName, 0);
1621 }
1622
1623 struct __ecereNameSpace__ecere__com__Method;
1624
1625 struct __ecereNameSpace__ecere__com__Method
1626 {
1627 const char *  name;
1628 struct __ecereNameSpace__ecere__com__Method * parent;
1629 struct __ecereNameSpace__ecere__com__Method * left;
1630 struct __ecereNameSpace__ecere__com__Method * right;
1631 int depth;
1632 int (*  function)();
1633 int vid;
1634 int type;
1635 struct __ecereNameSpace__ecere__com__Class * _class;
1636 void *  symbol;
1637 const char *  dataTypeString;
1638 struct Type * dataType;
1639 int memberAccess;
1640 } ecere_gcc_struct;
1641
1642 struct Symbol
1643 {
1644 char *  string;
1645 struct Symbol * parent;
1646 struct Symbol * left;
1647 struct Symbol * right;
1648 int depth;
1649 struct Type * type;
1650 union
1651 {
1652 struct __ecereNameSpace__ecere__com__Method * method;
1653 struct __ecereNameSpace__ecere__com__Property * _property;
1654 struct __ecereNameSpace__ecere__com__Class * registered;
1655 } ecere_gcc_struct __anon1;
1656 unsigned int notYetDeclared;
1657 union
1658 {
1659 struct
1660 {
1661 struct External * pointerExternal;
1662 struct External * structExternal;
1663 } ecere_gcc_struct __anon1;
1664 struct
1665 {
1666 struct External * externalGet;
1667 struct External * externalSet;
1668 struct External * externalPtr;
1669 struct External * externalIsSet;
1670 } ecere_gcc_struct __anon2;
1671 struct
1672 {
1673 struct External * methodExternal;
1674 struct External * methodCodeExternal;
1675 } ecere_gcc_struct __anon3;
1676 } ecere_gcc_struct __anon2;
1677 unsigned int imported;
1678 unsigned int declaredStructSym;
1679 struct __ecereNameSpace__ecere__com__Class * _class;
1680 unsigned int declaredStruct;
1681 unsigned int needConstructor;
1682 unsigned int needDestructor;
1683 char *  constructorName;
1684 char *  structName;
1685 char *  className;
1686 char *  destructorName;
1687 struct ModuleImport * module;
1688 struct ClassImport * _import;
1689 struct Location nameLoc;
1690 unsigned int isParam;
1691 unsigned int isRemote;
1692 unsigned int isStruct;
1693 unsigned int fireWatchersDone;
1694 int declaring;
1695 unsigned int classData;
1696 unsigned int isStatic;
1697 char *  shortName;
1698 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
1699 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
1700 struct Context * ctx;
1701 int isIterator;
1702 struct Expression * propCategory;
1703 unsigned int mustRegister;
1704 } ecere_gcc_struct;
1705
1706 struct __ecereNameSpace__ecere__com__ClassProperty;
1707
1708 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1709
1710 struct __ecereNameSpace__ecere__com__ClassProperty
1711 {
1712 const char *  name;
1713 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1714 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1715 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1716 int depth;
1717 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1718 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1719 const char *  dataTypeString;
1720 struct Type * dataType;
1721 unsigned int constant;
1722 } ecere_gcc_struct;
1723
1724 struct __ecereNameSpace__ecere__com__BitMember;
1725
1726 struct __ecereNameSpace__ecere__com__BitMember
1727 {
1728 struct __ecereNameSpace__ecere__com__BitMember * prev;
1729 struct __ecereNameSpace__ecere__com__BitMember * next;
1730 const char *  name;
1731 unsigned int isProperty;
1732 int memberAccess;
1733 int id;
1734 struct __ecereNameSpace__ecere__com__Class * _class;
1735 const char *  dataTypeString;
1736 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1737 struct Type * dataType;
1738 int type;
1739 int size;
1740 int pos;
1741 uint64 mask;
1742 } ecere_gcc_struct;
1743
1744 struct __ecereNameSpace__ecere__com__DataMember;
1745
1746 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1747 {
1748 union
1749 {
1750 struct
1751 {
1752 const char *  dataTypeString;
1753 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1754 } ecere_gcc_struct __anon1;
1755 struct __ecereNameSpace__ecere__com__DataValue expression;
1756 struct
1757 {
1758 const char *  memberString;
1759 union
1760 {
1761 struct __ecereNameSpace__ecere__com__DataMember * member;
1762 struct __ecereNameSpace__ecere__com__Property * prop;
1763 struct __ecereNameSpace__ecere__com__Method * method;
1764 } ecere_gcc_struct __anon1;
1765 } ecere_gcc_struct __anon2;
1766 } ecere_gcc_struct __anon1;
1767 } ecere_gcc_struct;
1768
1769 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);
1770
1771 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);
1772
1773 struct TemplateParameter;
1774
1775 struct TemplateParameter
1776 {
1777 struct TemplateParameter * prev;
1778 struct TemplateParameter * next;
1779 struct Location loc;
1780 int type;
1781 struct Identifier * identifier;
1782 union
1783 {
1784 struct TemplateDatatype * dataType;
1785 int memberType;
1786 } ecere_gcc_struct __anon1;
1787 struct TemplateArgument * defaultArgument;
1788 const char *  dataTypeString;
1789 struct Type * baseType;
1790 } ecere_gcc_struct;
1791
1792 struct Type
1793 {
1794 struct Type * prev;
1795 struct Type * next;
1796 int refCount;
1797 union
1798 {
1799 struct Symbol * _class;
1800 struct
1801 {
1802 struct __ecereNameSpace__ecere__sys__OldList members;
1803 char *  enumName;
1804 } ecere_gcc_struct __anon1;
1805 struct
1806 {
1807 struct Type * returnType;
1808 struct __ecereNameSpace__ecere__sys__OldList params;
1809 struct Symbol * thisClass;
1810 unsigned int staticMethod;
1811 struct TemplateParameter * thisClassTemplate;
1812 } ecere_gcc_struct __anon2;
1813 struct
1814 {
1815 struct __ecereNameSpace__ecere__com__Method * method;
1816 struct __ecereNameSpace__ecere__com__Class * methodClass;
1817 struct __ecereNameSpace__ecere__com__Class * usedClass;
1818 } ecere_gcc_struct __anon3;
1819 struct
1820 {
1821 struct Type * arrayType;
1822 int arraySize;
1823 struct Expression * arraySizeExp;
1824 unsigned int freeExp;
1825 struct Symbol * enumClass;
1826 } ecere_gcc_struct __anon4;
1827 struct Type * type;
1828 struct TemplateParameter * templateParameter;
1829 } ecere_gcc_struct __anon1;
1830 int kind;
1831 unsigned int size;
1832 char *  name;
1833 char *  typeName;
1834 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1835 int promotedFrom;
1836 int classObjectType;
1837 int alignment;
1838 unsigned int offset;
1839 int bitFieldCount;
1840 int count;
1841 int bitMemberSize;
1842 unsigned int isSigned : 1;
1843 unsigned int constant : 1;
1844 unsigned int truth : 1;
1845 unsigned int byReference : 1;
1846 unsigned int extraParam : 1;
1847 unsigned int directClassAccess : 1;
1848 unsigned int computing : 1;
1849 unsigned int keepCast : 1;
1850 unsigned int passAsTemplate : 1;
1851 unsigned int dllExport : 1;
1852 unsigned int attrStdcall : 1;
1853 unsigned int declaredWithStruct : 1;
1854 unsigned int typedByReference : 1;
1855 unsigned int casted : 1;
1856 unsigned int pointerAlignment : 1;
1857 unsigned int isLong : 1;
1858 unsigned int signedBeforePromotion : 1;
1859 } ecere_gcc_struct;
1860
1861 struct Specifier
1862 {
1863 struct Specifier * prev;
1864 struct Specifier * next;
1865 struct Location loc;
1866 int type;
1867 union
1868 {
1869 int specifier;
1870 struct
1871 {
1872 struct ExtDecl * extDecl;
1873 char *  name;
1874 struct Symbol * symbol;
1875 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
1876 struct Specifier * nsSpec;
1877 } ecere_gcc_struct __anon1;
1878 struct
1879 {
1880 struct Identifier * id;
1881 struct __ecereNameSpace__ecere__sys__OldList *  list;
1882 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
1883 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
1884 unsigned int addNameSpace;
1885 struct Context * ctx;
1886 struct ExtDecl * extDeclStruct;
1887 } ecere_gcc_struct __anon2;
1888 struct Expression * expression;
1889 struct Specifier * _class;
1890 struct TemplateParameter * templateParameter;
1891 } ecere_gcc_struct __anon1;
1892 } ecere_gcc_struct;
1893
1894 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
1895
1896 struct TemplatedType
1897 {
1898 uintptr_t key;
1899 struct __ecereNameSpace__ecere__sys__BTNode * parent;
1900 struct __ecereNameSpace__ecere__sys__BTNode * left;
1901 struct __ecereNameSpace__ecere__sys__BTNode * right;
1902 int depth;
1903 struct TemplateParameter * param;
1904 } ecere_gcc_struct;
1905
1906 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1907 {
1908 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1909 {
1910 if(!param->baseType)
1911 {
1912 if(param->dataTypeString)
1913 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1914 else
1915 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1916 }
1917 return param->baseType;
1918 }
1919 return (((void *)0));
1920 }
1921
1922 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1923 {
1924 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1925 return 1;
1926 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1927 {
1928 return 0;
1929 }
1930 if(type1->kind == type2->kind && type1->isLong == type2->isLong)
1931 {
1932 switch(type1->kind)
1933 {
1934 case 24:
1935 case 1:
1936 case 2:
1937 case 3:
1938 case 4:
1939 case 22:
1940 case 23:
1941 if(type1->passAsTemplate && !type2->passAsTemplate)
1942 return 1;
1943 return type1->isSigned != type2->isSigned;
1944 case 8:
1945 return type1->__anon1._class != type2->__anon1._class;
1946 case 13:
1947 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1948 default:
1949 return 1;
1950 }
1951 }
1952 return 1;
1953 }
1954
1955 unsigned int GetOpInt(struct Operand * op2, int * value2)
1956 {
1957 if(op2->kind == 3 && op2->type->isSigned)
1958 *value2 = op2->__anon1.i;
1959 else if(op2->kind == 3)
1960 *value2 = (int)op2->__anon1.ui;
1961 else if(op2->kind == 4 && op2->type->isSigned)
1962 *value2 = (int)op2->__anon1.i64;
1963 else if(op2->kind == 4)
1964 *value2 = (int)op2->__anon1.ui64;
1965 else if(op2->kind == 23 && op2->type->isSigned)
1966 *value2 = (int)op2->__anon1.i64;
1967 else if(op2->kind == 23)
1968 *value2 = (int)op2->__anon1.ui64;
1969 else if(op2->kind == 22 && op2->type->isSigned)
1970 *value2 = (int)op2->__anon1.i64;
1971 else if(op2->kind == 22)
1972 *value2 = (int)op2->__anon1.ui64;
1973 else if(op2->kind == 2 && op2->type->isSigned)
1974 *value2 = (int)op2->__anon1.s;
1975 else if(op2->kind == 2)
1976 *value2 = (int)op2->__anon1.us;
1977 else if(op2->kind == 1 && op2->type->isSigned)
1978 *value2 = (int)op2->__anon1.c;
1979 else if(op2->kind == 24 || op2->kind == 1)
1980 *value2 = (int)op2->__anon1.uc;
1981 else if(op2->kind == 6)
1982 *value2 = (int)op2->__anon1.f;
1983 else if(op2->kind == 7)
1984 *value2 = (int)op2->__anon1.d;
1985 else if(op2->kind == 13)
1986 *value2 = (int)op2->__anon1.ui64;
1987 else
1988 return 0;
1989 return 1;
1990 }
1991
1992 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1993 {
1994 if(op2->kind == 3 && op2->type->isSigned)
1995 *value2 = (unsigned int)op2->__anon1.i;
1996 else if(op2->kind == 3)
1997 *value2 = op2->__anon1.ui;
1998 else if(op2->kind == 4 && op2->type->isSigned)
1999 *value2 = (unsigned int)op2->__anon1.i64;
2000 else if(op2->kind == 4)
2001 *value2 = (unsigned int)op2->__anon1.ui64;
2002 else if(op2->kind == 23 && op2->type->isSigned)
2003 *value2 = (unsigned int)op2->__anon1.i64;
2004 else if(op2->kind == 23)
2005 *value2 = (unsigned int)op2->__anon1.ui64;
2006 else if(op2->kind == 22 && op2->type->isSigned)
2007 *value2 = (unsigned int)op2->__anon1.i64;
2008 else if(op2->kind == 22)
2009 *value2 = (unsigned int)op2->__anon1.ui64;
2010 else if(op2->kind == 2 && op2->type->isSigned)
2011 *value2 = (unsigned int)op2->__anon1.s;
2012 else if(op2->kind == 2)
2013 *value2 = (unsigned int)op2->__anon1.us;
2014 else if(op2->kind == 1 && op2->type->isSigned)
2015 *value2 = (unsigned int)op2->__anon1.c;
2016 else if(op2->kind == 24 || op2->kind == 1)
2017 *value2 = (unsigned int)op2->__anon1.uc;
2018 else if(op2->kind == 6)
2019 *value2 = (unsigned int)op2->__anon1.f;
2020 else if(op2->kind == 7)
2021 *value2 = (unsigned int)op2->__anon1.d;
2022 else if(op2->kind == 13)
2023 *value2 = (unsigned int)op2->__anon1.ui64;
2024 else
2025 return 0;
2026 return 1;
2027 }
2028
2029 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
2030 {
2031 if(op2->kind == 3 && op2->type->isSigned)
2032 *value2 = (long long)op2->__anon1.i;
2033 else if(op2->kind == 3)
2034 *value2 = (long long)op2->__anon1.ui;
2035 else if(op2->kind == 4 && op2->type->isSigned)
2036 *value2 = op2->__anon1.i64;
2037 else if(op2->kind == 4)
2038 *value2 = (long long)op2->__anon1.ui64;
2039 else if(op2->kind == 23 && op2->type->isSigned)
2040 *value2 = op2->__anon1.i64;
2041 else if(op2->kind == 23)
2042 *value2 = (long long)op2->__anon1.ui64;
2043 else if(op2->kind == 22 && op2->type->isSigned)
2044 *value2 = op2->__anon1.i64;
2045 else if(op2->kind == 22)
2046 *value2 = (long long)op2->__anon1.ui64;
2047 else if(op2->kind == 2 && op2->type->isSigned)
2048 *value2 = (long long)op2->__anon1.s;
2049 else if(op2->kind == 2)
2050 *value2 = (long long)op2->__anon1.us;
2051 else if(op2->kind == 1 && op2->type->isSigned)
2052 *value2 = (long long)op2->__anon1.c;
2053 else if(op2->kind == 24 || op2->kind == 1)
2054 *value2 = (long long)op2->__anon1.uc;
2055 else if(op2->kind == 6)
2056 *value2 = (long long)op2->__anon1.f;
2057 else if(op2->kind == 7)
2058 *value2 = (long long)op2->__anon1.d;
2059 else if(op2->kind == 13)
2060 *value2 = (long long)op2->__anon1.ui64;
2061 else
2062 return 0;
2063 return 1;
2064 }
2065
2066 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
2067 {
2068 if(op2->kind == 3 && op2->type->isSigned)
2069 *value2 = (uint64)op2->__anon1.i;
2070 else if(op2->kind == 3)
2071 *value2 = (uint64)op2->__anon1.ui;
2072 else if(op2->kind == 4 && op2->type->isSigned)
2073 *value2 = (uint64)op2->__anon1.i64;
2074 else if(op2->kind == 4)
2075 *value2 = op2->__anon1.ui64;
2076 else if(op2->kind == 23 && op2->type->isSigned)
2077 *value2 = (uint64)op2->__anon1.i64;
2078 else if(op2->kind == 23)
2079 *value2 = op2->__anon1.ui64;
2080 else if(op2->kind == 22 && op2->type->isSigned)
2081 *value2 = (uint64)op2->__anon1.i64;
2082 else if(op2->kind == 22)
2083 *value2 = op2->__anon1.ui64;
2084 else if(op2->kind == 2 && op2->type->isSigned)
2085 *value2 = (uint64)op2->__anon1.s;
2086 else if(op2->kind == 2)
2087 *value2 = (uint64)op2->__anon1.us;
2088 else if(op2->kind == 1 && op2->type->isSigned)
2089 *value2 = (uint64)op2->__anon1.c;
2090 else if(op2->kind == 24 || op2->kind == 1)
2091 *value2 = (uint64)op2->__anon1.uc;
2092 else if(op2->kind == 6)
2093 *value2 = (uint64)op2->__anon1.f;
2094 else if(op2->kind == 7)
2095 *value2 = (uint64)op2->__anon1.d;
2096 else if(op2->kind == 13)
2097 *value2 = op2->__anon1.ui64;
2098 else
2099 return 0;
2100 return 1;
2101 }
2102
2103 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
2104 {
2105 if(op2->kind == 3 && op2->type->isSigned)
2106 *value2 = (intptr_t)op2->__anon1.i;
2107 else if(op2->kind == 3)
2108 *value2 = (intptr_t)op2->__anon1.ui;
2109 else if(op2->kind == 4 && op2->type->isSigned)
2110 *value2 = (intptr_t)op2->__anon1.i64;
2111 else if(op2->kind == 4)
2112 *value2 = (intptr_t)op2->__anon1.ui64;
2113 else if(op2->kind == 23 && op2->type->isSigned)
2114 *value2 = (intptr_t)op2->__anon1.i64;
2115 else if(op2->kind == 23)
2116 *value2 = (intptr_t)op2->__anon1.ui64;
2117 else if(op2->kind == 22 && op2->type->isSigned)
2118 *value2 = (intptr_t)op2->__anon1.i64;
2119 else if(op2->kind == 22)
2120 *value2 = (intptr_t)op2->__anon1.ui64;
2121 else if(op2->kind == 2 && op2->type->isSigned)
2122 *value2 = (intptr_t)op2->__anon1.s;
2123 else if(op2->kind == 2)
2124 *value2 = (intptr_t)op2->__anon1.us;
2125 else if(op2->kind == 1 && op2->type->isSigned)
2126 *value2 = (intptr_t)op2->__anon1.c;
2127 else if(op2->kind == 24 || op2->kind == 1)
2128 *value2 = (intptr_t)op2->__anon1.uc;
2129 else if(op2->kind == 6)
2130 *value2 = (intptr_t)op2->__anon1.f;
2131 else if(op2->kind == 7)
2132 *value2 = (intptr_t)op2->__anon1.d;
2133 else if(op2->kind == 13)
2134 *value2 = (intptr_t)op2->__anon1.ui64;
2135 else
2136 return 0;
2137 return 1;
2138 }
2139
2140 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
2141 {
2142 if(op2->kind == 3 && op2->type->isSigned)
2143 *value2 = (uintptr_t)op2->__anon1.i;
2144 else if(op2->kind == 3)
2145 *value2 = (uintptr_t)op2->__anon1.ui;
2146 else if(op2->kind == 4 && op2->type->isSigned)
2147 *value2 = (uintptr_t)op2->__anon1.i64;
2148 else if(op2->kind == 4)
2149 *value2 = (uintptr_t)op2->__anon1.ui64;
2150 else if(op2->kind == 23 && op2->type->isSigned)
2151 *value2 = (uintptr_t)op2->__anon1.i64;
2152 else if(op2->kind == 23)
2153 *value2 = (uintptr_t)op2->__anon1.ui64;
2154 else if(op2->kind == 22 && op2->type->isSigned)
2155 *value2 = (uintptr_t)op2->__anon1.i64;
2156 else if(op2->kind == 22)
2157 *value2 = (uintptr_t)op2->__anon1.ui64;
2158 else if(op2->kind == 2 && op2->type->isSigned)
2159 *value2 = (uintptr_t)op2->__anon1.s;
2160 else if(op2->kind == 2)
2161 *value2 = (uintptr_t)op2->__anon1.us;
2162 else if(op2->kind == 1 && op2->type->isSigned)
2163 *value2 = (uintptr_t)op2->__anon1.c;
2164 else if(op2->kind == 24 || op2->kind == 1)
2165 *value2 = (uintptr_t)op2->__anon1.uc;
2166 else if(op2->kind == 6)
2167 *value2 = (uintptr_t)op2->__anon1.f;
2168 else if(op2->kind == 7)
2169 *value2 = (uintptr_t)op2->__anon1.d;
2170 else if(op2->kind == 13)
2171 *value2 = (uintptr_t)op2->__anon1.ui64;
2172 else
2173 return 0;
2174 return 1;
2175 }
2176
2177 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2178 {
2179 if(op2->kind == 3 && op2->type->isSigned)
2180 *value2 = (ssize_t)op2->__anon1.i;
2181 else if(op2->kind == 3)
2182 *value2 = (ssize_t)op2->__anon1.ui;
2183 else if(op2->kind == 4 && op2->type->isSigned)
2184 *value2 = (ssize_t)op2->__anon1.i64;
2185 else if(op2->kind == 4)
2186 *value2 = (ssize_t)op2->__anon1.ui64;
2187 else if(op2->kind == 23 && op2->type->isSigned)
2188 *value2 = (ssize_t)op2->__anon1.i64;
2189 else if(op2->kind == 23)
2190 *value2 = (ssize_t)op2->__anon1.ui64;
2191 else if(op2->kind == 22 && op2->type->isSigned)
2192 *value2 = (ssize_t)op2->__anon1.i64;
2193 else if(op2->kind == 22)
2194 *value2 = (ssize_t)op2->__anon1.ui64;
2195 else if(op2->kind == 2 && op2->type->isSigned)
2196 *value2 = (ssize_t)op2->__anon1.s;
2197 else if(op2->kind == 2)
2198 *value2 = (ssize_t)op2->__anon1.us;
2199 else if(op2->kind == 1 && op2->type->isSigned)
2200 *value2 = (ssize_t)op2->__anon1.c;
2201 else if(op2->kind == 24 || op2->kind == 1)
2202 *value2 = (ssize_t)op2->__anon1.uc;
2203 else if(op2->kind == 6)
2204 *value2 = (ssize_t)op2->__anon1.f;
2205 else if(op2->kind == 7)
2206 *value2 = (ssize_t)op2->__anon1.d;
2207 else if(op2->kind == 13)
2208 *value2 = (ssize_t)op2->__anon1.ui64;
2209 else
2210 return 0;
2211 return 1;
2212 }
2213
2214 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2215 {
2216 if(op2->kind == 3 && op2->type->isSigned)
2217 *value2 = (size_t)op2->__anon1.i;
2218 else if(op2->kind == 3)
2219 *value2 = (size_t)op2->__anon1.ui;
2220 else if(op2->kind == 4 && op2->type->isSigned)
2221 *value2 = (size_t)op2->__anon1.i64;
2222 else if(op2->kind == 4)
2223 *value2 = (size_t)op2->__anon1.ui64;
2224 else if(op2->kind == 23 && op2->type->isSigned)
2225 *value2 = (size_t)op2->__anon1.i64;
2226 else if(op2->kind == 23)
2227 *value2 = (size_t)op2->__anon1.ui64;
2228 else if(op2->kind == 22 && op2->type->isSigned)
2229 *value2 = (size_t)op2->__anon1.i64;
2230 else if(op2->kind == 22)
2231 *value2 = (size_t)op2->__anon1.ui64;
2232 else if(op2->kind == 2 && op2->type->isSigned)
2233 *value2 = (size_t)op2->__anon1.s;
2234 else if(op2->kind == 2)
2235 *value2 = (size_t)op2->__anon1.us;
2236 else if(op2->kind == 1 && op2->type->isSigned)
2237 *value2 = (size_t)op2->__anon1.c;
2238 else if(op2->kind == 24 || op2->kind == 1)
2239 *value2 = (size_t)op2->__anon1.uc;
2240 else if(op2->kind == 6)
2241 *value2 = (size_t)op2->__anon1.f;
2242 else if(op2->kind == 7)
2243 *value2 = (size_t)op2->__anon1.d;
2244 else if(op2->kind == 13)
2245 *value2 = (size_t)op2->__anon1.ui64;
2246 else
2247 return 0;
2248 return 1;
2249 }
2250
2251 unsigned int GetOpShort(struct Operand * op2, short * value2)
2252 {
2253 if(op2->kind == 3 && op2->type->isSigned)
2254 *value2 = (short)op2->__anon1.i;
2255 else if(op2->kind == 3)
2256 *value2 = (short)op2->__anon1.ui;
2257 else if(op2->kind == 4 && op2->type->isSigned)
2258 *value2 = (short)op2->__anon1.i64;
2259 else if(op2->kind == 4)
2260 *value2 = (short)op2->__anon1.ui64;
2261 else if(op2->kind == 23 && op2->type->isSigned)
2262 *value2 = (short)op2->__anon1.i64;
2263 else if(op2->kind == 23)
2264 *value2 = (short)op2->__anon1.ui64;
2265 else if(op2->kind == 22 && op2->type->isSigned)
2266 *value2 = (short)op2->__anon1.i64;
2267 else if(op2->kind == 22)
2268 *value2 = (short)op2->__anon1.ui64;
2269 else if(op2->kind == 2 && op2->type->isSigned)
2270 *value2 = op2->__anon1.s;
2271 else if(op2->kind == 2)
2272 *value2 = (short)op2->__anon1.us;
2273 else if(op2->kind == 1 && op2->type->isSigned)
2274 *value2 = (short)op2->__anon1.c;
2275 else if(op2->kind == 24 || op2->kind == 1)
2276 *value2 = (short)op2->__anon1.uc;
2277 else if(op2->kind == 6)
2278 *value2 = (short)op2->__anon1.f;
2279 else if(op2->kind == 7)
2280 *value2 = (short)op2->__anon1.d;
2281 else if(op2->kind == 13)
2282 *value2 = (short)op2->__anon1.ui64;
2283 else
2284 return 0;
2285 return 1;
2286 }
2287
2288 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2289 {
2290 if(op2->kind == 3 && op2->type->isSigned)
2291 *value2 = (unsigned short)op2->__anon1.i;
2292 else if(op2->kind == 3)
2293 *value2 = (unsigned short)op2->__anon1.ui;
2294 else if(op2->kind == 4 && op2->type->isSigned)
2295 *value2 = (unsigned short)op2->__anon1.i64;
2296 else if(op2->kind == 4)
2297 *value2 = (unsigned short)op2->__anon1.ui64;
2298 else if(op2->kind == 23 && op2->type->isSigned)
2299 *value2 = (unsigned short)op2->__anon1.i64;
2300 else if(op2->kind == 23)
2301 *value2 = (unsigned short)op2->__anon1.ui64;
2302 else if(op2->kind == 22 && op2->type->isSigned)
2303 *value2 = (unsigned short)op2->__anon1.i64;
2304 else if(op2->kind == 22)
2305 *value2 = (unsigned short)op2->__anon1.ui64;
2306 else if(op2->kind == 2 && op2->type->isSigned)
2307 *value2 = (unsigned short)op2->__anon1.s;
2308 else if(op2->kind == 2)
2309 *value2 = op2->__anon1.us;
2310 else if(op2->kind == 1 && op2->type->isSigned)
2311 *value2 = (unsigned short)op2->__anon1.c;
2312 else if(op2->kind == 24 || op2->kind == 1)
2313 *value2 = (unsigned short)op2->__anon1.uc;
2314 else if(op2->kind == 6)
2315 *value2 = (unsigned short)op2->__anon1.f;
2316 else if(op2->kind == 7)
2317 *value2 = (unsigned short)op2->__anon1.d;
2318 else if(op2->kind == 13)
2319 *value2 = (unsigned short)op2->__anon1.ui64;
2320 else
2321 return 0;
2322 return 1;
2323 }
2324
2325 unsigned int GetOpChar(struct Operand * op2, char * value2)
2326 {
2327 if(op2->kind == 3 && op2->type->isSigned)
2328 *value2 = (char)op2->__anon1.i;
2329 else if(op2->kind == 3)
2330 *value2 = (char)op2->__anon1.ui;
2331 else if(op2->kind == 4 && op2->type->isSigned)
2332 *value2 = (char)op2->__anon1.i64;
2333 else if(op2->kind == 4)
2334 *value2 = (char)op2->__anon1.ui64;
2335 else if(op2->kind == 23 && op2->type->isSigned)
2336 *value2 = (char)op2->__anon1.i64;
2337 else if(op2->kind == 23)
2338 *value2 = (char)op2->__anon1.ui64;
2339 else if(op2->kind == 22 && op2->type->isSigned)
2340 *value2 = (char)op2->__anon1.i64;
2341 else if(op2->kind == 22)
2342 *value2 = (char)op2->__anon1.ui64;
2343 else if(op2->kind == 2 && op2->type->isSigned)
2344 *value2 = (char)op2->__anon1.s;
2345 else if(op2->kind == 2)
2346 *value2 = (char)op2->__anon1.us;
2347 else if(op2->kind == 1 && op2->type->isSigned)
2348 *value2 = op2->__anon1.c;
2349 else if(op2->kind == 24 || op2->kind == 1)
2350 *value2 = (char)op2->__anon1.uc;
2351 else if(op2->kind == 6)
2352 *value2 = (char)op2->__anon1.f;
2353 else if(op2->kind == 7)
2354 *value2 = (char)op2->__anon1.d;
2355 else if(op2->kind == 13)
2356 *value2 = (char)op2->__anon1.ui64;
2357 else
2358 return 0;
2359 return 1;
2360 }
2361
2362 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2363 {
2364 if(op2->kind == 3 && op2->type->isSigned)
2365 *value2 = (unsigned char)op2->__anon1.i;
2366 else if(op2->kind == 3)
2367 *value2 = (unsigned char)op2->__anon1.ui;
2368 else if(op2->kind == 4 && op2->type->isSigned)
2369 *value2 = (unsigned char)op2->__anon1.i64;
2370 else if(op2->kind == 4)
2371 *value2 = (unsigned char)op2->__anon1.ui64;
2372 else if(op2->kind == 23 && op2->type->isSigned)
2373 *value2 = (unsigned char)op2->__anon1.i64;
2374 else if(op2->kind == 23)
2375 *value2 = (unsigned char)op2->__anon1.ui64;
2376 else if(op2->kind == 22 && op2->type->isSigned)
2377 *value2 = (unsigned char)op2->__anon1.i64;
2378 else if(op2->kind == 22)
2379 *value2 = (unsigned char)op2->__anon1.ui64;
2380 else if(op2->kind == 2 && op2->type->isSigned)
2381 *value2 = (unsigned char)op2->__anon1.s;
2382 else if(op2->kind == 2)
2383 *value2 = (unsigned char)op2->__anon1.us;
2384 else if(op2->kind == 1 && op2->type->isSigned)
2385 *value2 = (unsigned char)op2->__anon1.c;
2386 else if(op2->kind == 24 || op2->kind == 1)
2387 *value2 = op2->__anon1.uc;
2388 else if(op2->kind == 6)
2389 *value2 = (unsigned char)op2->__anon1.f;
2390 else if(op2->kind == 7)
2391 *value2 = (unsigned char)op2->__anon1.d;
2392 else if(op2->kind == 13)
2393 *value2 = (unsigned char)op2->__anon1.ui64;
2394 else
2395 return 0;
2396 return 1;
2397 }
2398
2399 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2400 {
2401 if(op2->kind == 3 && op2->type->isSigned)
2402 *value2 = (float)(float)op2->__anon1.i;
2403 else if(op2->kind == 3)
2404 *value2 = (float)(float)op2->__anon1.ui;
2405 else if(op2->kind == 4 && op2->type->isSigned)
2406 *value2 = (float)(float)op2->__anon1.i64;
2407 else if(op2->kind == 4)
2408 *value2 = (float)(float)op2->__anon1.ui64;
2409 else if(op2->kind == 23 && op2->type->isSigned)
2410 *value2 = (float)(float)op2->__anon1.i64;
2411 else if(op2->kind == 23)
2412 *value2 = (float)(float)op2->__anon1.ui64;
2413 else if(op2->kind == 22 && op2->type->isSigned)
2414 *value2 = (float)(float)op2->__anon1.i64;
2415 else if(op2->kind == 22)
2416 *value2 = (float)(float)op2->__anon1.ui64;
2417 else if(op2->kind == 2 && op2->type->isSigned)
2418 *value2 = (float)(float)op2->__anon1.s;
2419 else if(op2->kind == 2)
2420 *value2 = (float)(float)op2->__anon1.us;
2421 else if(op2->kind == 1 && op2->type->isSigned)
2422 *value2 = (float)(float)op2->__anon1.c;
2423 else if(op2->kind == 24 || op2->kind == 1)
2424 *value2 = (float)(float)op2->__anon1.uc;
2425 else if(op2->kind == 6)
2426 *value2 = (float)op2->__anon1.f;
2427 else if(op2->kind == 7)
2428 *value2 = (float)op2->__anon1.d;
2429 else if(op2->kind == 13)
2430 *value2 = (float)(float)op2->__anon1.ui64;
2431 else
2432 return 0;
2433 return 1;
2434 }
2435
2436 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2437 {
2438 if(op2->kind == 3 && op2->type->isSigned)
2439 *value2 = (double)(double)op2->__anon1.i;
2440 else if(op2->kind == 3)
2441 *value2 = (double)(double)op2->__anon1.ui;
2442 else if(op2->kind == 4 && op2->type->isSigned)
2443 *value2 = (double)(double)op2->__anon1.i64;
2444 else if(op2->kind == 4)
2445 *value2 = (double)(double)op2->__anon1.ui64;
2446 else if(op2->kind == 23 && op2->type->isSigned)
2447 *value2 = (double)(double)op2->__anon1.i64;
2448 else if(op2->kind == 23)
2449 *value2 = (double)(double)op2->__anon1.ui64;
2450 else if(op2->kind == 22 && op2->type->isSigned)
2451 *value2 = (double)(double)op2->__anon1.i64;
2452 else if(op2->kind == 22)
2453 *value2 = (double)(double)op2->__anon1.ui64;
2454 else if(op2->kind == 2 && op2->type->isSigned)
2455 *value2 = (double)(double)op2->__anon1.s;
2456 else if(op2->kind == 2)
2457 *value2 = (double)(double)op2->__anon1.us;
2458 else if(op2->kind == 1 && op2->type->isSigned)
2459 *value2 = (double)(double)op2->__anon1.c;
2460 else if(op2->kind == 24 || op2->kind == 1)
2461 *value2 = (double)(double)op2->__anon1.uc;
2462 else if(op2->kind == 6)
2463 *value2 = (double)op2->__anon1.f;
2464 else if(op2->kind == 7)
2465 *value2 = (double)op2->__anon1.d;
2466 else if(op2->kind == 13)
2467 *value2 = (double)(double)op2->__anon1.ui64;
2468 else
2469 return 0;
2470 return 1;
2471 }
2472
2473 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2474 {
2475 int value2 = op2->__anon1.i;
2476
2477 exp->type = 2;
2478 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
2479 if(!exp->expType)
2480 {
2481 exp->expType = op1->type;
2482 if(op1->type)
2483 op1->type->refCount++;
2484 }
2485 return 1;
2486 }
2487
2488 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2489 {
2490 unsigned int value2 = op2->__anon1.ui;
2491
2492 exp->type = 2;
2493 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
2494 if(!exp->expType)
2495 {
2496 exp->expType = op1->type;
2497 if(op1->type)
2498 op1->type->refCount++;
2499 }
2500 return 1;
2501 }
2502
2503 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2504 {
2505 long long value2 = op2->__anon1.i64;
2506
2507 exp->type = 2;
2508 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
2509 if(!exp->expType)
2510 {
2511 exp->expType = op1->type;
2512 if(op1->type)
2513 op1->type->refCount++;
2514 }
2515 return 1;
2516 }
2517
2518 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2519 {
2520 uint64 value2 = op2->__anon1.ui64;
2521
2522 exp->type = 2;
2523 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
2524 if(!exp->expType)
2525 {
2526 exp->expType = op1->type;
2527 if(op1->type)
2528 op1->type->refCount++;
2529 }
2530 return 1;
2531 }
2532
2533 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2534 {
2535 short value2 = op2->__anon1.s;
2536
2537 exp->type = 2;
2538 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s + value2));
2539 if(!exp->expType)
2540 {
2541 exp->expType = op1->type;
2542 if(op1->type)
2543 op1->type->refCount++;
2544 }
2545 return 1;
2546 }
2547
2548 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2549 {
2550 unsigned short value2 = op2->__anon1.us;
2551
2552 exp->type = 2;
2553 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us + value2));
2554 if(!exp->expType)
2555 {
2556 exp->expType = op1->type;
2557 if(op1->type)
2558 op1->type->refCount++;
2559 }
2560 return 1;
2561 }
2562
2563 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2564 {
2565 char value2 = op2->__anon1.c;
2566
2567 exp->type = 2;
2568 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c + value2));
2569 if(!exp->expType)
2570 {
2571 exp->expType = op1->type;
2572 if(op1->type)
2573 op1->type->refCount++;
2574 }
2575 return 1;
2576 }
2577
2578 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2579 {
2580 unsigned char value2 = op2->__anon1.uc;
2581
2582 exp->type = 2;
2583 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc + value2));
2584 if(!exp->expType)
2585 {
2586 exp->expType = op1->type;
2587 if(op1->type)
2588 op1->type->refCount++;
2589 }
2590 return 1;
2591 }
2592
2593 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2594 {
2595 float value2 = op2->__anon1.f;
2596
2597 exp->type = 2;
2598 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
2599 if(!exp->expType)
2600 {
2601 exp->expType = op1->type;
2602 if(op1->type)
2603 op1->type->refCount++;
2604 }
2605 return 1;
2606 }
2607
2608 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2609 {
2610 double value2 = op2->__anon1.d;
2611
2612 exp->type = 2;
2613 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
2614 if(!exp->expType)
2615 {
2616 exp->expType = op1->type;
2617 if(op1->type)
2618 op1->type->refCount++;
2619 }
2620 return 1;
2621 }
2622
2623 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2624 {
2625 int value2 = op2->__anon1.i;
2626
2627 exp->type = 2;
2628 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
2629 if(!exp->expType)
2630 {
2631 exp->expType = op1->type;
2632 if(op1->type)
2633 op1->type->refCount++;
2634 }
2635 return 1;
2636 }
2637
2638 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2639 {
2640 unsigned int value2 = op2->__anon1.ui;
2641
2642 exp->type = 2;
2643 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
2644 if(!exp->expType)
2645 {
2646 exp->expType = op1->type;
2647 if(op1->type)
2648 op1->type->refCount++;
2649 }
2650 return 1;
2651 }
2652
2653 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2654 {
2655 long long value2 = op2->__anon1.i64;
2656
2657 exp->type = 2;
2658 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
2659 if(!exp->expType)
2660 {
2661 exp->expType = op1->type;
2662 if(op1->type)
2663 op1->type->refCount++;
2664 }
2665 return 1;
2666 }
2667
2668 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2669 {
2670 uint64 value2 = op2->__anon1.ui64;
2671
2672 exp->type = 2;
2673 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
2674 if(!exp->expType)
2675 {
2676 exp->expType = op1->type;
2677 if(op1->type)
2678 op1->type->refCount++;
2679 }
2680 return 1;
2681 }
2682
2683 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2684 {
2685 short value2 = op2->__anon1.s;
2686
2687 exp->type = 2;
2688 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s - value2));
2689 if(!exp->expType)
2690 {
2691 exp->expType = op1->type;
2692 if(op1->type)
2693 op1->type->refCount++;
2694 }
2695 return 1;
2696 }
2697
2698 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2699 {
2700 unsigned short value2 = op2->__anon1.us;
2701
2702 exp->type = 2;
2703 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us - value2));
2704 if(!exp->expType)
2705 {
2706 exp->expType = op1->type;
2707 if(op1->type)
2708 op1->type->refCount++;
2709 }
2710 return 1;
2711 }
2712
2713 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2714 {
2715 char value2 = op2->__anon1.c;
2716
2717 exp->type = 2;
2718 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c - value2));
2719 if(!exp->expType)
2720 {
2721 exp->expType = op1->type;
2722 if(op1->type)
2723 op1->type->refCount++;
2724 }
2725 return 1;
2726 }
2727
2728 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2729 {
2730 unsigned char value2 = op2->__anon1.uc;
2731
2732 exp->type = 2;
2733 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc - value2));
2734 if(!exp->expType)
2735 {
2736 exp->expType = op1->type;
2737 if(op1->type)
2738 op1->type->refCount++;
2739 }
2740 return 1;
2741 }
2742
2743 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2744 {
2745 float value2 = op2->__anon1.f;
2746
2747 exp->type = 2;
2748 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
2749 if(!exp->expType)
2750 {
2751 exp->expType = op1->type;
2752 if(op1->type)
2753 op1->type->refCount++;
2754 }
2755 return 1;
2756 }
2757
2758 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2759 {
2760 double value2 = op2->__anon1.d;
2761
2762 exp->type = 2;
2763 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
2764 if(!exp->expType)
2765 {
2766 exp->expType = op1->type;
2767 if(op1->type)
2768 op1->type->refCount++;
2769 }
2770 return 1;
2771 }
2772
2773 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2774 {
2775 int value2 = op2->__anon1.i;
2776
2777 exp->type = 2;
2778 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
2779 if(!exp->expType)
2780 {
2781 exp->expType = op1->type;
2782 if(op1->type)
2783 op1->type->refCount++;
2784 }
2785 return 1;
2786 }
2787
2788 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2789 {
2790 unsigned int value2 = op2->__anon1.ui;
2791
2792 exp->type = 2;
2793 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
2794 if(!exp->expType)
2795 {
2796 exp->expType = op1->type;
2797 if(op1->type)
2798 op1->type->refCount++;
2799 }
2800 return 1;
2801 }
2802
2803 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2804 {
2805 long long value2 = op2->__anon1.i64;
2806
2807 exp->type = 2;
2808 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
2809 if(!exp->expType)
2810 {
2811 exp->expType = op1->type;
2812 if(op1->type)
2813 op1->type->refCount++;
2814 }
2815 return 1;
2816 }
2817
2818 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2819 {
2820 uint64 value2 = op2->__anon1.ui64;
2821
2822 exp->type = 2;
2823 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
2824 if(!exp->expType)
2825 {
2826 exp->expType = op1->type;
2827 if(op1->type)
2828 op1->type->refCount++;
2829 }
2830 return 1;
2831 }
2832
2833 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2834 {
2835 short value2 = op2->__anon1.s;
2836
2837 exp->type = 2;
2838 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s * value2));
2839 if(!exp->expType)
2840 {
2841 exp->expType = op1->type;
2842 if(op1->type)
2843 op1->type->refCount++;
2844 }
2845 return 1;
2846 }
2847
2848 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2849 {
2850 unsigned short value2 = op2->__anon1.us;
2851
2852 exp->type = 2;
2853 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us * value2));
2854 if(!exp->expType)
2855 {
2856 exp->expType = op1->type;
2857 if(op1->type)
2858 op1->type->refCount++;
2859 }
2860 return 1;
2861 }
2862
2863 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2864 {
2865 char value2 = op2->__anon1.c;
2866
2867 exp->type = 2;
2868 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c * value2));
2869 if(!exp->expType)
2870 {
2871 exp->expType = op1->type;
2872 if(op1->type)
2873 op1->type->refCount++;
2874 }
2875 return 1;
2876 }
2877
2878 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2879 {
2880 unsigned char value2 = op2->__anon1.uc;
2881
2882 exp->type = 2;
2883 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc * value2));
2884 if(!exp->expType)
2885 {
2886 exp->expType = op1->type;
2887 if(op1->type)
2888 op1->type->refCount++;
2889 }
2890 return 1;
2891 }
2892
2893 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2894 {
2895 float value2 = op2->__anon1.f;
2896
2897 exp->type = 2;
2898 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
2899 if(!exp->expType)
2900 {
2901 exp->expType = op1->type;
2902 if(op1->type)
2903 op1->type->refCount++;
2904 }
2905 return 1;
2906 }
2907
2908 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2909 {
2910 double value2 = op2->__anon1.d;
2911
2912 exp->type = 2;
2913 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
2914 if(!exp->expType)
2915 {
2916 exp->expType = op1->type;
2917 if(op1->type)
2918 op1->type->refCount++;
2919 }
2920 return 1;
2921 }
2922
2923 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2924 {
2925 int value2 = op2->__anon1.i;
2926
2927 exp->type = 2;
2928 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i / value2)) : 0);
2929 if(!exp->expType)
2930 {
2931 exp->expType = op1->type;
2932 if(op1->type)
2933 op1->type->refCount++;
2934 }
2935 return 1;
2936 }
2937
2938 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2939 {
2940 unsigned int value2 = op2->__anon1.ui;
2941
2942 exp->type = 2;
2943 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui / value2)) : 0);
2944 if(!exp->expType)
2945 {
2946 exp->expType = op1->type;
2947 if(op1->type)
2948 op1->type->refCount++;
2949 }
2950 return 1;
2951 }
2952
2953 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2954 {
2955 long long value2 = op2->__anon1.i64;
2956
2957 exp->type = 2;
2958 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 / value2)) : 0);
2959 if(!exp->expType)
2960 {
2961 exp->expType = op1->type;
2962 if(op1->type)
2963 op1->type->refCount++;
2964 }
2965 return 1;
2966 }
2967
2968 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2969 {
2970 uint64 value2 = op2->__anon1.ui64;
2971
2972 exp->type = 2;
2973 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 / value2)) : 0);
2974 if(!exp->expType)
2975 {
2976 exp->expType = op1->type;
2977 if(op1->type)
2978 op1->type->refCount++;
2979 }
2980 return 1;
2981 }
2982
2983 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2984 {
2985 short value2 = op2->__anon1.s;
2986
2987 exp->type = 2;
2988 exp->__anon1.__anon2.string = PrintShort(value2 ? ((short)(op1->__anon1.s / value2)) : 0);
2989 if(!exp->expType)
2990 {
2991 exp->expType = op1->type;
2992 if(op1->type)
2993 op1->type->refCount++;
2994 }
2995 return 1;
2996 }
2997
2998 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2999 {
3000 unsigned short value2 = op2->__anon1.us;
3001
3002 exp->type = 2;
3003 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((unsigned short)(op1->__anon1.us / value2)) : 0);
3004 if(!exp->expType)
3005 {
3006 exp->expType = op1->type;
3007 if(op1->type)
3008 op1->type->refCount++;
3009 }
3010 return 1;
3011 }
3012
3013 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3014 {
3015 char value2 = op2->__anon1.c;
3016
3017 exp->type = 2;
3018 exp->__anon1.__anon2.string = PrintChar(value2 ? ((char)(op1->__anon1.c / value2)) : 0);
3019 if(!exp->expType)
3020 {
3021 exp->expType = op1->type;
3022 if(op1->type)
3023 op1->type->refCount++;
3024 }
3025 return 1;
3026 }
3027
3028 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3029 {
3030 unsigned char value2 = op2->__anon1.uc;
3031
3032 exp->type = 2;
3033 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((unsigned char)(op1->__anon1.uc / value2)) : 0);
3034 if(!exp->expType)
3035 {
3036 exp->expType = op1->type;
3037 if(op1->type)
3038 op1->type->refCount++;
3039 }
3040 return 1;
3041 }
3042
3043 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3044 {
3045 float value2 = op2->__anon1.f;
3046
3047 exp->type = 2;
3048 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f / value2));
3049 if(!exp->expType)
3050 {
3051 exp->expType = op1->type;
3052 if(op1->type)
3053 op1->type->refCount++;
3054 }
3055 return 1;
3056 }
3057
3058 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3059 {
3060 double value2 = op2->__anon1.d;
3061
3062 exp->type = 2;
3063 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d / value2));
3064 if(!exp->expType)
3065 {
3066 exp->expType = op1->type;
3067 if(op1->type)
3068 op1->type->refCount++;
3069 }
3070 return 1;
3071 }
3072
3073 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3074 {
3075 int value2 = op2->__anon1.i;
3076
3077 exp->type = 2;
3078 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i % value2)) : 0);
3079 if(!exp->expType)
3080 {
3081 exp->expType = op1->type;
3082 if(op1->type)
3083 op1->type->refCount++;
3084 }
3085 return 1;
3086 }
3087
3088 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3089 {
3090 unsigned int value2 = op2->__anon1.ui;
3091
3092 exp->type = 2;
3093 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui % value2)) : 0);
3094 if(!exp->expType)
3095 {
3096 exp->expType = op1->type;
3097 if(op1->type)
3098 op1->type->refCount++;
3099 }
3100 return 1;
3101 }
3102
3103 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3104 {
3105 long long value2 = op2->__anon1.i64;
3106
3107 exp->type = 2;
3108 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 % value2)) : 0);
3109 if(!exp->expType)
3110 {
3111 exp->expType = op1->type;
3112 if(op1->type)
3113 op1->type->refCount++;
3114 }
3115 return 1;
3116 }
3117
3118 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3119 {
3120 uint64 value2 = op2->__anon1.ui64;
3121
3122 exp->type = 2;
3123 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 % value2)) : 0);
3124 if(!exp->expType)
3125 {
3126 exp->expType = op1->type;
3127 if(op1->type)
3128 op1->type->refCount++;
3129 }
3130 return 1;
3131 }
3132
3133 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3134 {
3135 short value2 = op2->__anon1.s;
3136
3137 exp->type = 2;
3138 exp->__anon1.__anon2.string = PrintShort(value2 ? ((short)(op1->__anon1.s % value2)) : 0);
3139 if(!exp->expType)
3140 {
3141 exp->expType = op1->type;
3142 if(op1->type)
3143 op1->type->refCount++;
3144 }
3145 return 1;
3146 }
3147
3148 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3149 {
3150 unsigned short value2 = op2->__anon1.us;
3151
3152 exp->type = 2;
3153 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((unsigned short)(op1->__anon1.us % value2)) : 0);
3154 if(!exp->expType)
3155 {
3156 exp->expType = op1->type;
3157 if(op1->type)
3158 op1->type->refCount++;
3159 }
3160 return 1;
3161 }
3162
3163 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3164 {
3165 char value2 = op2->__anon1.c;
3166
3167 exp->type = 2;
3168 exp->__anon1.__anon2.string = PrintChar(value2 ? ((char)(op1->__anon1.c % value2)) : 0);
3169 if(!exp->expType)
3170 {
3171 exp->expType = op1->type;
3172 if(op1->type)
3173 op1->type->refCount++;
3174 }
3175 return 1;
3176 }
3177
3178 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3179 {
3180 unsigned char value2 = op2->__anon1.uc;
3181
3182 exp->type = 2;
3183 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((unsigned char)(op1->__anon1.uc % value2)) : 0);
3184 if(!exp->expType)
3185 {
3186 exp->expType = op1->type;
3187 if(op1->type)
3188 op1->type->refCount++;
3189 }
3190 return 1;
3191 }
3192
3193 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
3194 {
3195 exp->type = 2;
3196 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
3197 if(!exp->expType)
3198 {
3199 exp->expType = op1->type;
3200 if(op1->type)
3201 op1->type->refCount++;
3202 }
3203 return 1;
3204 }
3205
3206 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
3207 {
3208 exp->type = 2;
3209 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
3210 if(!exp->expType)
3211 {
3212 exp->expType = op1->type;
3213 if(op1->type)
3214 op1->type->refCount++;
3215 }
3216 return 1;
3217 }
3218
3219 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
3220 {
3221 exp->type = 2;
3222 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
3223 if(!exp->expType)
3224 {
3225 exp->expType = op1->type;
3226 if(op1->type)
3227 op1->type->refCount++;
3228 }
3229 return 1;
3230 }
3231
3232 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
3233 {
3234 exp->type = 2;
3235 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
3236 if(!exp->expType)
3237 {
3238 exp->expType = op1->type;
3239 if(op1->type)
3240 op1->type->refCount++;
3241 }
3242 return 1;
3243 }
3244
3245 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
3246 {
3247 exp->type = 2;
3248 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
3249 if(!exp->expType)
3250 {
3251 exp->expType = op1->type;
3252 if(op1->type)
3253 op1->type->refCount++;
3254 }
3255 return 1;
3256 }
3257
3258 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
3259 {
3260 exp->type = 2;
3261 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
3262 if(!exp->expType)
3263 {
3264 exp->expType = op1->type;
3265 if(op1->type)
3266 op1->type->refCount++;
3267 }
3268 return 1;
3269 }
3270
3271 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
3272 {
3273 exp->type = 2;
3274 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
3275 if(!exp->expType)
3276 {
3277 exp->expType = op1->type;
3278 if(op1->type)
3279 op1->type->refCount++;
3280 }
3281 return 1;
3282 }
3283
3284 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
3285 {
3286 exp->type = 2;
3287 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
3288 if(!exp->expType)
3289 {
3290 exp->expType = op1->type;
3291 if(op1->type)
3292 op1->type->refCount++;
3293 }
3294 return 1;
3295 }
3296
3297 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
3298 {
3299 exp->type = 2;
3300 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
3301 if(!exp->expType)
3302 {
3303 exp->expType = op1->type;
3304 if(op1->type)
3305 op1->type->refCount++;
3306 }
3307 return 1;
3308 }
3309
3310 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
3311 {
3312 exp->type = 2;
3313 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
3314 if(!exp->expType)
3315 {
3316 exp->expType = op1->type;
3317 if(op1->type)
3318 op1->type->refCount++;
3319 }
3320 return 1;
3321 }
3322
3323 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
3324 {
3325 exp->type = 2;
3326 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
3327 if(!exp->expType)
3328 {
3329 exp->expType = op1->type;
3330 if(op1->type)
3331 op1->type->refCount++;
3332 }
3333 return 1;
3334 }
3335
3336 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
3337 {
3338 exp->type = 2;
3339 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
3340 if(!exp->expType)
3341 {
3342 exp->expType = op1->type;
3343 if(op1->type)
3344 op1->type->refCount++;
3345 }
3346 return 1;
3347 }
3348
3349 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
3350 {
3351 exp->type = 2;
3352 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
3353 if(!exp->expType)
3354 {
3355 exp->expType = op1->type;
3356 if(op1->type)
3357 op1->type->refCount++;
3358 }
3359 return 1;
3360 }
3361
3362 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
3363 {
3364 exp->type = 2;
3365 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
3366 if(!exp->expType)
3367 {
3368 exp->expType = op1->type;
3369 if(op1->type)
3370 op1->type->refCount++;
3371 }
3372 return 1;
3373 }
3374
3375 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
3376 {
3377 exp->type = 2;
3378 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
3379 if(!exp->expType)
3380 {
3381 exp->expType = op1->type;
3382 if(op1->type)
3383 op1->type->refCount++;
3384 }
3385 return 1;
3386 }
3387
3388 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
3389 {
3390 exp->type = 2;
3391 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
3392 if(!exp->expType)
3393 {
3394 exp->expType = op1->type;
3395 if(op1->type)
3396 op1->type->refCount++;
3397 }
3398 return 1;
3399 }
3400
3401 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
3402 {
3403 exp->type = 2;
3404 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
3405 if(!exp->expType)
3406 {
3407 exp->expType = op1->type;
3408 if(op1->type)
3409 op1->type->refCount++;
3410 }
3411 return 1;
3412 }
3413
3414 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
3415 {
3416 exp->type = 2;
3417 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
3418 if(!exp->expType)
3419 {
3420 exp->expType = op1->type;
3421 if(op1->type)
3422 op1->type->refCount++;
3423 }
3424 return 1;
3425 }
3426
3427 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
3428 {
3429 exp->type = 2;
3430 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
3431 if(!exp->expType)
3432 {
3433 exp->expType = op1->type;
3434 if(op1->type)
3435 op1->type->refCount++;
3436 }
3437 return 1;
3438 }
3439
3440 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
3441 {
3442 exp->type = 2;
3443 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
3444 if(!exp->expType)
3445 {
3446 exp->expType = op1->type;
3447 if(op1->type)
3448 op1->type->refCount++;
3449 }
3450 return 1;
3451 }
3452
3453 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
3454 {
3455 exp->type = 2;
3456 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
3457 if(!exp->expType)
3458 {
3459 exp->expType = op1->type;
3460 if(op1->type)
3461 op1->type->refCount++;
3462 }
3463 return 1;
3464 }
3465
3466 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
3467 {
3468 exp->type = 2;
3469 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
3470 if(!exp->expType)
3471 {
3472 exp->expType = op1->type;
3473 if(op1->type)
3474 op1->type->refCount++;
3475 }
3476 return 1;
3477 }
3478
3479 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
3480 {
3481 exp->type = 2;
3482 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
3483 if(!exp->expType)
3484 {
3485 exp->expType = op1->type;
3486 if(op1->type)
3487 op1->type->refCount++;
3488 }
3489 return 1;
3490 }
3491
3492 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
3493 {
3494 exp->type = 2;
3495 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
3496 if(!exp->expType)
3497 {
3498 exp->expType = op1->type;
3499 if(op1->type)
3500 op1->type->refCount++;
3501 }
3502 return 1;
3503 }
3504
3505 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
3506 {
3507 exp->type = 2;
3508 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
3509 if(!exp->expType)
3510 {
3511 exp->expType = op1->type;
3512 if(op1->type)
3513 op1->type->refCount++;
3514 }
3515 return 1;
3516 }
3517
3518 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
3519 {
3520 exp->type = 2;
3521 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
3522 if(!exp->expType)
3523 {
3524 exp->expType = op1->type;
3525 if(op1->type)
3526 op1->type->refCount++;
3527 }
3528 return 1;
3529 }
3530
3531 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
3532 {
3533 exp->type = 2;
3534 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
3535 if(!exp->expType)
3536 {
3537 exp->expType = op1->type;
3538 if(op1->type)
3539 op1->type->refCount++;
3540 }
3541 return 1;
3542 }
3543
3544 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
3545 {
3546 exp->type = 2;
3547 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
3548 if(!exp->expType)
3549 {
3550 exp->expType = op1->type;
3551 if(op1->type)
3552 op1->type->refCount++;
3553 }
3554 return 1;
3555 }
3556
3557 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
3558 {
3559 exp->type = 2;
3560 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
3561 if(!exp->expType)
3562 {
3563 exp->expType = op1->type;
3564 if(op1->type)
3565 op1->type->refCount++;
3566 }
3567 return 1;
3568 }
3569
3570 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
3571 {
3572 exp->type = 2;
3573 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
3574 if(!exp->expType)
3575 {
3576 exp->expType = op1->type;
3577 if(op1->type)
3578 op1->type->refCount++;
3579 }
3580 return 1;
3581 }
3582
3583 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3584 {
3585 int value2 = op2->__anon1.i;
3586
3587 exp->type = 2;
3588 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
3589 if(!exp->expType)
3590 {
3591 exp->expType = op1->type;
3592 if(op1->type)
3593 op1->type->refCount++;
3594 }
3595 return 1;
3596 }
3597
3598 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3599 {
3600 unsigned int value2 = op2->__anon1.ui;
3601
3602 exp->type = 2;
3603 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
3604 if(!exp->expType)
3605 {
3606 exp->expType = op1->type;
3607 if(op1->type)
3608 op1->type->refCount++;
3609 }
3610 return 1;
3611 }
3612
3613 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3614 {
3615 long long value2 = op2->__anon1.i64;
3616
3617 exp->type = 2;
3618 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
3619 if(!exp->expType)
3620 {
3621 exp->expType = op1->type;
3622 if(op1->type)
3623 op1->type->refCount++;
3624 }
3625 return 1;
3626 }
3627
3628 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3629 {
3630 uint64 value2 = op2->__anon1.ui64;
3631
3632 exp->type = 2;
3633 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
3634 if(!exp->expType)
3635 {
3636 exp->expType = op1->type;
3637 if(op1->type)
3638 op1->type->refCount++;
3639 }
3640 return 1;
3641 }
3642
3643 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3644 {
3645 short value2 = op2->__anon1.s;
3646
3647 exp->type = 2;
3648 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
3649 if(!exp->expType)
3650 {
3651 exp->expType = op1->type;
3652 if(op1->type)
3653 op1->type->refCount++;
3654 }
3655 return 1;
3656 }
3657
3658 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3659 {
3660 unsigned short value2 = op2->__anon1.us;
3661
3662 exp->type = 2;
3663 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
3664 if(!exp->expType)
3665 {
3666 exp->expType = op1->type;
3667 if(op1->type)
3668 op1->type->refCount++;
3669 }
3670 return 1;
3671 }
3672
3673 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3674 {
3675 char value2 = op2->__anon1.c;
3676
3677 exp->type = 2;
3678 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
3679 if(!exp->expType)
3680 {
3681 exp->expType = op1->type;
3682 if(op1->type)
3683 op1->type->refCount++;
3684 }
3685 return 1;
3686 }
3687
3688 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3689 {
3690 unsigned char value2 = op2->__anon1.uc;
3691
3692 exp->type = 2;
3693 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
3694 if(!exp->expType)
3695 {
3696 exp->expType = op1->type;
3697 if(op1->type)
3698 op1->type->refCount++;
3699 }
3700 return 1;
3701 }
3702
3703 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3704 {
3705 float value2 = op2->__anon1.f;
3706
3707 exp->type = 2;
3708 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
3709 if(!exp->expType)
3710 {
3711 exp->expType = op1->type;
3712 if(op1->type)
3713 op1->type->refCount++;
3714 }
3715 return 1;
3716 }
3717
3718 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3719 {
3720 double value2 = op2->__anon1.d;
3721
3722 exp->type = 2;
3723 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
3724 if(!exp->expType)
3725 {
3726 exp->expType = op1->type;
3727 if(op1->type)
3728 op1->type->refCount++;
3729 }
3730 return 1;
3731 }
3732
3733 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3734 {
3735 int value2 = op2->__anon1.i;
3736
3737 exp->type = 2;
3738 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
3739 if(!exp->expType)
3740 {
3741 exp->expType = op1->type;
3742 if(op1->type)
3743 op1->type->refCount++;
3744 }
3745 return 1;
3746 }
3747
3748 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3749 {
3750 unsigned int value2 = op2->__anon1.ui;
3751
3752 exp->type = 2;
3753 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
3754 if(!exp->expType)
3755 {
3756 exp->expType = op1->type;
3757 if(op1->type)
3758 op1->type->refCount++;
3759 }
3760 return 1;
3761 }
3762
3763 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3764 {
3765 long long value2 = op2->__anon1.i64;
3766
3767 exp->type = 2;
3768 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
3769 if(!exp->expType)
3770 {
3771 exp->expType = op1->type;
3772 if(op1->type)
3773 op1->type->refCount++;
3774 }
3775 return 1;
3776 }
3777
3778 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3779 {
3780 uint64 value2 = op2->__anon1.ui64;
3781
3782 exp->type = 2;
3783 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
3784 if(!exp->expType)
3785 {
3786 exp->expType = op1->type;
3787 if(op1->type)
3788 op1->type->refCount++;
3789 }
3790 return 1;
3791 }
3792
3793 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3794 {
3795 short value2 = op2->__anon1.s;
3796
3797 exp->type = 2;
3798 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
3799 if(!exp->expType)
3800 {
3801 exp->expType = op1->type;
3802 if(op1->type)
3803 op1->type->refCount++;
3804 }
3805 return 1;
3806 }
3807
3808 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3809 {
3810 unsigned short value2 = op2->__anon1.us;
3811
3812 exp->type = 2;
3813 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
3814 if(!exp->expType)
3815 {
3816 exp->expType = op1->type;
3817 if(op1->type)
3818 op1->type->refCount++;
3819 }
3820 return 1;
3821 }
3822
3823 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3824 {
3825 char value2 = op2->__anon1.c;
3826
3827 exp->type = 2;
3828 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
3829 if(!exp->expType)
3830 {
3831 exp->expType = op1->type;
3832 if(op1->type)
3833 op1->type->refCount++;
3834 }
3835 return 1;
3836 }
3837
3838 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3839 {
3840 unsigned char value2 = op2->__anon1.uc;
3841
3842 exp->type = 2;
3843 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
3844 if(!exp->expType)
3845 {
3846 exp->expType = op1->type;
3847 if(op1->type)
3848 op1->type->refCount++;
3849 }
3850 return 1;
3851 }
3852
3853 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3854 {
3855 float value2 = op2->__anon1.f;
3856
3857 exp->type = 2;
3858 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
3859 if(!exp->expType)
3860 {
3861 exp->expType = op1->type;
3862 if(op1->type)
3863 op1->type->refCount++;
3864 }
3865 return 1;
3866 }
3867
3868 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3869 {
3870 double value2 = op2->__anon1.d;
3871
3872 exp->type = 2;
3873 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
3874 if(!exp->expType)
3875 {
3876 exp->expType = op1->type;
3877 if(op1->type)
3878 op1->type->refCount++;
3879 }
3880 return 1;
3881 }
3882
3883 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3884 {
3885 int value2 = op2->__anon1.i;
3886
3887 exp->type = 2;
3888 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
3889 if(!exp->expType)
3890 {
3891 exp->expType = op1->type;
3892 if(op1->type)
3893 op1->type->refCount++;
3894 }
3895 return 1;
3896 }
3897
3898 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3899 {
3900 unsigned int value2 = op2->__anon1.ui;
3901
3902 exp->type = 2;
3903 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
3904 if(!exp->expType)
3905 {
3906 exp->expType = op1->type;
3907 if(op1->type)
3908 op1->type->refCount++;
3909 }
3910 return 1;
3911 }
3912
3913 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3914 {
3915 long long value2 = op2->__anon1.i64;
3916
3917 exp->type = 2;
3918 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
3919 if(!exp->expType)
3920 {
3921 exp->expType = op1->type;
3922 if(op1->type)
3923 op1->type->refCount++;
3924 }
3925 return 1;
3926 }
3927
3928 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3929 {
3930 uint64 value2 = op2->__anon1.ui64;
3931
3932 exp->type = 2;
3933 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
3934 if(!exp->expType)
3935 {
3936 exp->expType = op1->type;
3937 if(op1->type)
3938 op1->type->refCount++;
3939 }
3940 return 1;
3941 }
3942
3943 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3944 {
3945 short value2 = op2->__anon1.s;
3946
3947 exp->type = 2;
3948 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
3949 if(!exp->expType)
3950 {
3951 exp->expType = op1->type;
3952 if(op1->type)
3953 op1->type->refCount++;
3954 }
3955 return 1;
3956 }
3957
3958 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3959 {
3960 unsigned short value2 = op2->__anon1.us;
3961
3962 exp->type = 2;
3963 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
3964 if(!exp->expType)
3965 {
3966 exp->expType = op1->type;
3967 if(op1->type)
3968 op1->type->refCount++;
3969 }
3970 return 1;
3971 }
3972
3973 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3974 {
3975 char value2 = op2->__anon1.c;
3976
3977 exp->type = 2;
3978 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
3979 if(!exp->expType)
3980 {
3981 exp->expType = op1->type;
3982 if(op1->type)
3983 op1->type->refCount++;
3984 }
3985 return 1;
3986 }
3987
3988 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3989 {
3990 unsigned char value2 = op2->__anon1.uc;
3991
3992 exp->type = 2;
3993 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
3994 if(!exp->expType)
3995 {
3996 exp->expType = op1->type;
3997 if(op1->type)
3998 op1->type->refCount++;
3999 }
4000 return 1;
4001 }
4002
4003 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4004 {
4005 float value2 = op2->__anon1.f;
4006
4007 exp->type = 2;
4008 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
4009 if(!exp->expType)
4010 {
4011 exp->expType = op1->type;
4012 if(op1->type)
4013 op1->type->refCount++;
4014 }
4015 return 1;
4016 }
4017
4018 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4019 {
4020 double value2 = op2->__anon1.d;
4021
4022 exp->type = 2;
4023 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
4024 if(!exp->expType)
4025 {
4026 exp->expType = op1->type;
4027 if(op1->type)
4028 op1->type->refCount++;
4029 }
4030 return 1;
4031 }
4032
4033 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4034 {
4035 int value2 = op2->__anon1.i;
4036
4037 exp->type = 2;
4038 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
4039 if(!exp->expType)
4040 {
4041 exp->expType = op1->type;
4042 if(op1->type)
4043 op1->type->refCount++;
4044 }
4045 return 1;
4046 }
4047
4048 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4049 {
4050 unsigned int value2 = op2->__anon1.ui;
4051
4052 exp->type = 2;
4053 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
4054 if(!exp->expType)
4055 {
4056 exp->expType = op1->type;
4057 if(op1->type)
4058 op1->type->refCount++;
4059 }
4060 return 1;
4061 }
4062
4063 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4064 {
4065 long long value2 = op2->__anon1.i64;
4066
4067 exp->type = 2;
4068 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
4069 if(!exp->expType)
4070 {
4071 exp->expType = op1->type;
4072 if(op1->type)
4073 op1->type->refCount++;
4074 }
4075 return 1;
4076 }
4077
4078 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4079 {
4080 uint64 value2 = op2->__anon1.ui64;
4081
4082 exp->type = 2;
4083 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
4084 if(!exp->expType)
4085 {
4086 exp->expType = op1->type;
4087 if(op1->type)
4088 op1->type->refCount++;
4089 }
4090 return 1;
4091 }
4092
4093 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4094 {
4095 short value2 = op2->__anon1.s;
4096
4097 exp->type = 2;
4098 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
4099 if(!exp->expType)
4100 {
4101 exp->expType = op1->type;
4102 if(op1->type)
4103 op1->type->refCount++;
4104 }
4105 return 1;
4106 }
4107
4108 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4109 {
4110 unsigned short value2 = op2->__anon1.us;
4111
4112 exp->type = 2;
4113 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
4114 if(!exp->expType)
4115 {
4116 exp->expType = op1->type;
4117 if(op1->type)
4118 op1->type->refCount++;
4119 }
4120 return 1;
4121 }
4122
4123 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4124 {
4125 char value2 = op2->__anon1.c;
4126
4127 exp->type = 2;
4128 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
4129 if(!exp->expType)
4130 {
4131 exp->expType = op1->type;
4132 if(op1->type)
4133 op1->type->refCount++;
4134 }
4135 return 1;
4136 }
4137
4138 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4139 {
4140 unsigned char value2 = op2->__anon1.uc;
4141
4142 exp->type = 2;
4143 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
4144 if(!exp->expType)
4145 {
4146 exp->expType = op1->type;
4147 if(op1->type)
4148 op1->type->refCount++;
4149 }
4150 return 1;
4151 }
4152
4153 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4154 {
4155 float value2 = op2->__anon1.f;
4156
4157 exp->type = 2;
4158 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
4159 if(!exp->expType)
4160 {
4161 exp->expType = op1->type;
4162 if(op1->type)
4163 op1->type->refCount++;
4164 }
4165 return 1;
4166 }
4167
4168 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4169 {
4170 double value2 = op2->__anon1.d;
4171
4172 exp->type = 2;
4173 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
4174 if(!exp->expType)
4175 {
4176 exp->expType = op1->type;
4177 if(op1->type)
4178 op1->type->refCount++;
4179 }
4180 return 1;
4181 }
4182
4183 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4184 {
4185 int value2 = op2->__anon1.i;
4186
4187 exp->type = 2;
4188 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i /= value2)) : 0);
4189 if(!exp->expType)
4190 {
4191 exp->expType = op1->type;
4192 if(op1->type)
4193 op1->type->refCount++;
4194 }
4195 return 1;
4196 }
4197
4198 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4199 {
4200 unsigned int value2 = op2->__anon1.ui;
4201
4202 exp->type = 2;
4203 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui /= value2)) : 0);
4204 if(!exp->expType)
4205 {
4206 exp->expType = op1->type;
4207 if(op1->type)
4208 op1->type->refCount++;
4209 }
4210 return 1;
4211 }
4212
4213 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4214 {
4215 long long value2 = op2->__anon1.i64;
4216
4217 exp->type = 2;
4218 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 /= value2)) : 0);
4219 if(!exp->expType)
4220 {
4221 exp->expType = op1->type;
4222 if(op1->type)
4223 op1->type->refCount++;
4224 }
4225 return 1;
4226 }
4227
4228 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4229 {
4230 uint64 value2 = op2->__anon1.ui64;
4231
4232 exp->type = 2;
4233 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 /= value2)) : 0);
4234 if(!exp->expType)
4235 {
4236 exp->expType = op1->type;
4237 if(op1->type)
4238 op1->type->refCount++;
4239 }
4240 return 1;
4241 }
4242
4243 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4244 {
4245 short value2 = op2->__anon1.s;
4246
4247 exp->type = 2;
4248 exp->__anon1.__anon2.string = PrintShort(value2 ? ((op1->__anon1.s /= value2)) : 0);
4249 if(!exp->expType)
4250 {
4251 exp->expType = op1->type;
4252 if(op1->type)
4253 op1->type->refCount++;
4254 }
4255 return 1;
4256 }
4257
4258 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4259 {
4260 unsigned short value2 = op2->__anon1.us;
4261
4262 exp->type = 2;
4263 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((op1->__anon1.us /= value2)) : 0);
4264 if(!exp->expType)
4265 {
4266 exp->expType = op1->type;
4267 if(op1->type)
4268 op1->type->refCount++;
4269 }
4270 return 1;
4271 }
4272
4273 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4274 {
4275 char value2 = op2->__anon1.c;
4276
4277 exp->type = 2;
4278 exp->__anon1.__anon2.string = PrintChar(value2 ? ((op1->__anon1.c /= value2)) : 0);
4279 if(!exp->expType)
4280 {
4281 exp->expType = op1->type;
4282 if(op1->type)
4283 op1->type->refCount++;
4284 }
4285 return 1;
4286 }
4287
4288 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4289 {
4290 unsigned char value2 = op2->__anon1.uc;
4291
4292 exp->type = 2;
4293 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((op1->__anon1.uc /= value2)) : 0);
4294 if(!exp->expType)
4295 {
4296 exp->expType = op1->type;
4297 if(op1->type)
4298 op1->type->refCount++;
4299 }
4300 return 1;
4301 }
4302
4303 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4304 {
4305 float value2 = op2->__anon1.f;
4306
4307 exp->type = 2;
4308 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f /= value2));
4309 if(!exp->expType)
4310 {
4311 exp->expType = op1->type;
4312 if(op1->type)
4313 op1->type->refCount++;
4314 }
4315 return 1;
4316 }
4317
4318 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4319 {
4320 double value2 = op2->__anon1.d;
4321
4322 exp->type = 2;
4323 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d /= value2));
4324 if(!exp->expType)
4325 {
4326 exp->expType = op1->type;
4327 if(op1->type)
4328 op1->type->refCount++;
4329 }
4330 return 1;
4331 }
4332
4333 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4334 {
4335 int value2 = op2->__anon1.i;
4336
4337 exp->type = 2;
4338 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i %= value2)) : 0);
4339 if(!exp->expType)
4340 {
4341 exp->expType = op1->type;
4342 if(op1->type)
4343 op1->type->refCount++;
4344 }
4345 return 1;
4346 }
4347
4348 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4349 {
4350 unsigned int value2 = op2->__anon1.ui;
4351
4352 exp->type = 2;
4353 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui %= value2)) : 0);
4354 if(!exp->expType)
4355 {
4356 exp->expType = op1->type;
4357 if(op1->type)
4358 op1->type->refCount++;
4359 }
4360 return 1;
4361 }
4362
4363 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4364 {
4365 long long value2 = op2->__anon1.i64;
4366
4367 exp->type = 2;
4368 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 %= value2)) : 0);
4369 if(!exp->expType)
4370 {
4371 exp->expType = op1->type;
4372 if(op1->type)
4373 op1->type->refCount++;
4374 }
4375 return 1;
4376 }
4377
4378 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4379 {
4380 uint64 value2 = op2->__anon1.ui64;
4381
4382 exp->type = 2;
4383 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 %= value2)) : 0);
4384 if(!exp->expType)
4385 {
4386 exp->expType = op1->type;
4387 if(op1->type)
4388 op1->type->refCount++;
4389 }
4390 return 1;
4391 }
4392
4393 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4394 {
4395 short value2 = op2->__anon1.s;
4396
4397 exp->type = 2;
4398 exp->__anon1.__anon2.string = PrintShort(value2 ? ((op1->__anon1.s %= value2)) : 0);
4399 if(!exp->expType)
4400 {
4401 exp->expType = op1->type;
4402 if(op1->type)
4403 op1->type->refCount++;
4404 }
4405 return 1;
4406 }
4407
4408 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4409 {
4410 unsigned short value2 = op2->__anon1.us;
4411
4412 exp->type = 2;
4413 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((op1->__anon1.us %= value2)) : 0);
4414 if(!exp->expType)
4415 {
4416 exp->expType = op1->type;
4417 if(op1->type)
4418 op1->type->refCount++;
4419 }
4420 return 1;
4421 }
4422
4423 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4424 {
4425 char value2 = op2->__anon1.c;
4426
4427 exp->type = 2;
4428 exp->__anon1.__anon2.string = PrintChar(value2 ? ((op1->__anon1.c %= value2)) : 0);
4429 if(!exp->expType)
4430 {
4431 exp->expType = op1->type;
4432 if(op1->type)
4433 op1->type->refCount++;
4434 }
4435 return 1;
4436 }
4437
4438 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4439 {
4440 unsigned char value2 = op2->__anon1.uc;
4441
4442 exp->type = 2;
4443 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((op1->__anon1.uc %= value2)) : 0);
4444 if(!exp->expType)
4445 {
4446 exp->expType = op1->type;
4447 if(op1->type)
4448 op1->type->refCount++;
4449 }
4450 return 1;
4451 }
4452
4453 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4454 {
4455 int value2 = op2->__anon1.i;
4456
4457 exp->type = 2;
4458 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
4459 if(!exp->expType)
4460 {
4461 exp->expType = op1->type;
4462 if(op1->type)
4463 op1->type->refCount++;
4464 }
4465 return 1;
4466 }
4467
4468 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4469 {
4470 unsigned int value2 = op2->__anon1.ui;
4471
4472 exp->type = 2;
4473 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
4474 if(!exp->expType)
4475 {
4476 exp->expType = op1->type;
4477 if(op1->type)
4478 op1->type->refCount++;
4479 }
4480 return 1;
4481 }
4482
4483 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4484 {
4485 long long value2 = op2->__anon1.i64;
4486
4487 exp->type = 2;
4488 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
4489 if(!exp->expType)
4490 {
4491 exp->expType = op1->type;
4492 if(op1->type)
4493 op1->type->refCount++;
4494 }
4495 return 1;
4496 }
4497
4498 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4499 {
4500 uint64 value2 = op2->__anon1.ui64;
4501
4502 exp->type = 2;
4503 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
4504 if(!exp->expType)
4505 {
4506 exp->expType = op1->type;
4507 if(op1->type)
4508 op1->type->refCount++;
4509 }
4510 return 1;
4511 }
4512
4513 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4514 {
4515 short value2 = op2->__anon1.s;
4516
4517 exp->type = 2;
4518 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s & value2));
4519 if(!exp->expType)
4520 {
4521 exp->expType = op1->type;
4522 if(op1->type)
4523 op1->type->refCount++;
4524 }
4525 return 1;
4526 }
4527
4528 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4529 {
4530 unsigned short value2 = op2->__anon1.us;
4531
4532 exp->type = 2;
4533 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us & value2));
4534 if(!exp->expType)
4535 {
4536 exp->expType = op1->type;
4537 if(op1->type)
4538 op1->type->refCount++;
4539 }
4540 return 1;
4541 }
4542
4543 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4544 {
4545 char value2 = op2->__anon1.c;
4546
4547 exp->type = 2;
4548 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c & value2));
4549 if(!exp->expType)
4550 {
4551 exp->expType = op1->type;
4552 if(op1->type)
4553 op1->type->refCount++;
4554 }
4555 return 1;
4556 }
4557
4558 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4559 {
4560 unsigned char value2 = op2->__anon1.uc;
4561
4562 exp->type = 2;
4563 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc & value2));
4564 if(!exp->expType)
4565 {
4566 exp->expType = op1->type;
4567 if(op1->type)
4568 op1->type->refCount++;
4569 }
4570 return 1;
4571 }
4572
4573 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4574 {
4575 int value2 = op2->__anon1.i;
4576
4577 exp->type = 2;
4578 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
4579 if(!exp->expType)
4580 {
4581 exp->expType = op1->type;
4582 if(op1->type)
4583 op1->type->refCount++;
4584 }
4585 return 1;
4586 }
4587
4588 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4589 {
4590 unsigned int value2 = op2->__anon1.ui;
4591
4592 exp->type = 2;
4593 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
4594 if(!exp->expType)
4595 {
4596 exp->expType = op1->type;
4597 if(op1->type)
4598 op1->type->refCount++;
4599 }
4600 return 1;
4601 }
4602
4603 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4604 {
4605 long long value2 = op2->__anon1.i64;
4606
4607 exp->type = 2;
4608 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
4609 if(!exp->expType)
4610 {
4611 exp->expType = op1->type;
4612 if(op1->type)
4613 op1->type->refCount++;
4614 }
4615 return 1;
4616 }
4617
4618 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4619 {
4620 uint64 value2 = op2->__anon1.ui64;
4621
4622 exp->type = 2;
4623 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
4624 if(!exp->expType)
4625 {
4626 exp->expType = op1->type;
4627 if(op1->type)
4628 op1->type->refCount++;
4629 }
4630 return 1;
4631 }
4632
4633 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4634 {
4635 short value2 = op2->__anon1.s;
4636
4637 exp->type = 2;
4638 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s | value2));
4639 if(!exp->expType)
4640 {
4641 exp->expType = op1->type;
4642 if(op1->type)
4643 op1->type->refCount++;
4644 }
4645 return 1;
4646 }
4647
4648 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4649 {
4650 unsigned short value2 = op2->__anon1.us;
4651
4652 exp->type = 2;
4653 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us | value2));
4654 if(!exp->expType)
4655 {
4656 exp->expType = op1->type;
4657 if(op1->type)
4658 op1->type->refCount++;
4659 }
4660 return 1;
4661 }
4662
4663 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4664 {
4665 char value2 = op2->__anon1.c;
4666
4667 exp->type = 2;
4668 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c | value2));
4669 if(!exp->expType)
4670 {
4671 exp->expType = op1->type;
4672 if(op1->type)
4673 op1->type->refCount++;
4674 }
4675 return 1;
4676 }
4677
4678 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4679 {
4680 unsigned char value2 = op2->__anon1.uc;
4681
4682 exp->type = 2;
4683 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc | value2));
4684 if(!exp->expType)
4685 {
4686 exp->expType = op1->type;
4687 if(op1->type)
4688 op1->type->refCount++;
4689 }
4690 return 1;
4691 }
4692
4693 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4694 {
4695 int value2 = op2->__anon1.i;
4696
4697 exp->type = 2;
4698 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
4699 if(!exp->expType)
4700 {
4701 exp->expType = op1->type;
4702 if(op1->type)
4703 op1->type->refCount++;
4704 }
4705 return 1;
4706 }
4707
4708 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4709 {
4710 unsigned int value2 = op2->__anon1.ui;
4711
4712 exp->type = 2;
4713 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
4714 if(!exp->expType)
4715 {
4716 exp->expType = op1->type;
4717 if(op1->type)
4718 op1->type->refCount++;
4719 }
4720 return 1;
4721 }
4722
4723 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4724 {
4725 long long value2 = op2->__anon1.i64;
4726
4727 exp->type = 2;
4728 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
4729 if(!exp->expType)
4730 {
4731 exp->expType = op1->type;
4732 if(op1->type)
4733 op1->type->refCount++;
4734 }
4735 return 1;
4736 }
4737
4738 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4739 {
4740 uint64 value2 = op2->__anon1.ui64;
4741
4742 exp->type = 2;
4743 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
4744 if(!exp->expType)
4745 {
4746 exp->expType = op1->type;
4747 if(op1->type)
4748 op1->type->refCount++;
4749 }
4750 return 1;
4751 }
4752
4753 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4754 {
4755 short value2 = op2->__anon1.s;
4756
4757 exp->type = 2;
4758 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s ^ value2));
4759 if(!exp->expType)
4760 {
4761 exp->expType = op1->type;
4762 if(op1->type)
4763 op1->type->refCount++;
4764 }
4765 return 1;
4766 }
4767
4768 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4769 {
4770 unsigned short value2 = op2->__anon1.us;
4771
4772 exp->type = 2;
4773 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us ^ value2));
4774 if(!exp->expType)
4775 {
4776 exp->expType = op1->type;
4777 if(op1->type)
4778 op1->type->refCount++;
4779 }
4780 return 1;
4781 }
4782
4783 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4784 {
4785 char value2 = op2->__anon1.c;
4786
4787 exp->type = 2;
4788 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c ^ value2));
4789 if(!exp->expType)
4790 {
4791 exp->expType = op1->type;
4792 if(op1->type)
4793 op1->type->refCount++;
4794 }
4795 return 1;
4796 }
4797
4798 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4799 {
4800 unsigned char value2 = op2->__anon1.uc;
4801
4802 exp->type = 2;
4803 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc ^ value2));
4804 if(!exp->expType)
4805 {
4806 exp->expType = op1->type;
4807 if(op1->type)
4808 op1->type->refCount++;
4809 }
4810 return 1;
4811 }
4812
4813 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4814 {
4815 int value2 = op2->__anon1.i;
4816
4817 exp->type = 2;
4818 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
4819 if(!exp->expType)
4820 {
4821 exp->expType = op1->type;
4822 if(op1->type)
4823 op1->type->refCount++;
4824 }
4825 return 1;
4826 }
4827
4828 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4829 {
4830 unsigned int value2 = op2->__anon1.ui;
4831
4832 exp->type = 2;
4833 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
4834 if(!exp->expType)
4835 {
4836 exp->expType = op1->type;
4837 if(op1->type)
4838 op1->type->refCount++;
4839 }
4840 return 1;
4841 }
4842
4843 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4844 {
4845 long long value2 = op2->__anon1.i64;
4846
4847 exp->type = 2;
4848 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
4849 if(!exp->expType)
4850 {
4851 exp->expType = op1->type;
4852 if(op1->type)
4853 op1->type->refCount++;
4854 }
4855 return 1;
4856 }
4857
4858 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4859 {
4860 uint64 value2 = op2->__anon1.ui64;
4861
4862 exp->type = 2;
4863 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
4864 if(!exp->expType)
4865 {
4866 exp->expType = op1->type;
4867 if(op1->type)
4868 op1->type->refCount++;
4869 }
4870 return 1;
4871 }
4872
4873 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4874 {
4875 short value2 = op2->__anon1.s;
4876
4877 exp->type = 2;
4878 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s << value2));
4879 if(!exp->expType)
4880 {
4881 exp->expType = op1->type;
4882 if(op1->type)
4883 op1->type->refCount++;
4884 }
4885 return 1;
4886 }
4887
4888 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4889 {
4890 unsigned short value2 = op2->__anon1.us;
4891
4892 exp->type = 2;
4893 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us << value2));
4894 if(!exp->expType)
4895 {
4896 exp->expType = op1->type;
4897 if(op1->type)
4898 op1->type->refCount++;
4899 }
4900 return 1;
4901 }
4902
4903 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4904 {
4905 char value2 = op2->__anon1.c;
4906
4907 exp->type = 2;
4908 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c << value2));
4909 if(!exp->expType)
4910 {
4911 exp->expType = op1->type;
4912 if(op1->type)
4913 op1->type->refCount++;
4914 }
4915 return 1;
4916 }
4917
4918 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4919 {
4920 unsigned char value2 = op2->__anon1.uc;
4921
4922 exp->type = 2;
4923 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc << value2));
4924 if(!exp->expType)
4925 {
4926 exp->expType = op1->type;
4927 if(op1->type)
4928 op1->type->refCount++;
4929 }
4930 return 1;
4931 }
4932
4933 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4934 {
4935 int value2 = op2->__anon1.i;
4936
4937 exp->type = 2;
4938 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
4939 if(!exp->expType)
4940 {
4941 exp->expType = op1->type;
4942 if(op1->type)
4943 op1->type->refCount++;
4944 }
4945 return 1;
4946 }
4947
4948 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4949 {
4950 unsigned int value2 = op2->__anon1.ui;
4951
4952 exp->type = 2;
4953 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
4954 if(!exp->expType)
4955 {
4956 exp->expType = op1->type;
4957 if(op1->type)
4958 op1->type->refCount++;
4959 }
4960 return 1;
4961 }
4962
4963 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4964 {
4965 long long value2 = op2->__anon1.i64;
4966
4967 exp->type = 2;
4968 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
4969 if(!exp->expType)
4970 {
4971 exp->expType = op1->type;
4972 if(op1->type)
4973 op1->type->refCount++;
4974 }
4975 return 1;
4976 }
4977
4978 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4979 {
4980 uint64 value2 = op2->__anon1.ui64;
4981
4982 exp->type = 2;
4983 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
4984 if(!exp->expType)
4985 {
4986 exp->expType = op1->type;
4987 if(op1->type)
4988 op1->type->refCount++;
4989 }
4990 return 1;
4991 }
4992
4993 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4994 {
4995 short value2 = op2->__anon1.s;
4996
4997 exp->type = 2;
4998 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >> value2));
4999 if(!exp->expType)
5000 {
5001 exp->expType = op1->type;
5002 if(op1->type)
5003 op1->type->refCount++;
5004 }
5005 return 1;
5006 }
5007
5008 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5009 {
5010 unsigned short value2 = op2->__anon1.us;
5011
5012 exp->type = 2;
5013 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >> value2));
5014 if(!exp->expType)
5015 {
5016 exp->expType = op1->type;
5017 if(op1->type)
5018 op1->type->refCount++;
5019 }
5020 return 1;
5021 }
5022
5023 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5024 {
5025 char value2 = op2->__anon1.c;
5026
5027 exp->type = 2;
5028 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >> value2));
5029 if(!exp->expType)
5030 {
5031 exp->expType = op1->type;
5032 if(op1->type)
5033 op1->type->refCount++;
5034 }
5035 return 1;
5036 }
5037
5038 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5039 {
5040 unsigned char value2 = op2->__anon1.uc;
5041
5042 exp->type = 2;
5043 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >> value2));
5044 if(!exp->expType)
5045 {
5046 exp->expType = op1->type;
5047 if(op1->type)
5048 op1->type->refCount++;
5049 }
5050 return 1;
5051 }
5052
5053 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
5054 {
5055 exp->type = 2;
5056 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
5057 if(!exp->expType)
5058 {
5059 exp->expType = op1->type;
5060 if(op1->type)
5061 op1->type->refCount++;
5062 }
5063 return 1;
5064 }
5065
5066 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
5067 {
5068 exp->type = 2;
5069 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
5070 if(!exp->expType)
5071 {
5072 exp->expType = op1->type;
5073 if(op1->type)
5074 op1->type->refCount++;
5075 }
5076 return 1;
5077 }
5078
5079 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
5080 {
5081 exp->type = 2;
5082 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
5083 if(!exp->expType)
5084 {
5085 exp->expType = op1->type;
5086 if(op1->type)
5087 op1->type->refCount++;
5088 }
5089 return 1;
5090 }
5091
5092 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
5093 {
5094 exp->type = 2;
5095 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
5096 if(!exp->expType)
5097 {
5098 exp->expType = op1->type;
5099 if(op1->type)
5100 op1->type->refCount++;
5101 }
5102 return 1;
5103 }
5104
5105 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
5106 {
5107 exp->type = 2;
5108 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
5109 if(!exp->expType)
5110 {
5111 exp->expType = op1->type;
5112 if(op1->type)
5113 op1->type->refCount++;
5114 }
5115 return 1;
5116 }
5117
5118 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
5119 {
5120 exp->type = 2;
5121 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
5122 if(!exp->expType)
5123 {
5124 exp->expType = op1->type;
5125 if(op1->type)
5126 op1->type->refCount++;
5127 }
5128 return 1;
5129 }
5130
5131 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
5132 {
5133 exp->type = 2;
5134 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
5135 if(!exp->expType)
5136 {
5137 exp->expType = op1->type;
5138 if(op1->type)
5139 op1->type->refCount++;
5140 }
5141 return 1;
5142 }
5143
5144 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
5145 {
5146 exp->type = 2;
5147 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
5148 if(!exp->expType)
5149 {
5150 exp->expType = op1->type;
5151 if(op1->type)
5152 op1->type->refCount++;
5153 }
5154 return 1;
5155 }
5156
5157 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5158 {
5159 int value2 = op2->__anon1.i;
5160
5161 exp->type = 2;
5162 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
5163 if(!exp->expType)
5164 {
5165 exp->expType = op1->type;
5166 if(op1->type)
5167 op1->type->refCount++;
5168 }
5169 return 1;
5170 }
5171
5172 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5173 {
5174 unsigned int value2 = op2->__anon1.ui;
5175
5176 exp->type = 2;
5177 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
5178 if(!exp->expType)
5179 {
5180 exp->expType = op1->type;
5181 if(op1->type)
5182 op1->type->refCount++;
5183 }
5184 return 1;
5185 }
5186
5187 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5188 {
5189 long long value2 = op2->__anon1.i64;
5190
5191 exp->type = 2;
5192 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
5193 if(!exp->expType)
5194 {
5195 exp->expType = op1->type;
5196 if(op1->type)
5197 op1->type->refCount++;
5198 }
5199 return 1;
5200 }
5201
5202 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5203 {
5204 uint64 value2 = op2->__anon1.ui64;
5205
5206 exp->type = 2;
5207 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
5208 if(!exp->expType)
5209 {
5210 exp->expType = op1->type;
5211 if(op1->type)
5212 op1->type->refCount++;
5213 }
5214 return 1;
5215 }
5216
5217 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5218 {
5219 short value2 = op2->__anon1.s;
5220
5221 exp->type = 2;
5222 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
5223 if(!exp->expType)
5224 {
5225 exp->expType = op1->type;
5226 if(op1->type)
5227 op1->type->refCount++;
5228 }
5229 return 1;
5230 }
5231
5232 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5233 {
5234 unsigned short value2 = op2->__anon1.us;
5235
5236 exp->type = 2;
5237 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
5238 if(!exp->expType)
5239 {
5240 exp->expType = op1->type;
5241 if(op1->type)
5242 op1->type->refCount++;
5243 }
5244 return 1;
5245 }
5246
5247 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5248 {
5249 char value2 = op2->__anon1.c;
5250
5251 exp->type = 2;
5252 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
5253 if(!exp->expType)
5254 {
5255 exp->expType = op1->type;
5256 if(op1->type)
5257 op1->type->refCount++;
5258 }
5259 return 1;
5260 }
5261
5262 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5263 {
5264 unsigned char value2 = op2->__anon1.uc;
5265
5266 exp->type = 2;
5267 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
5268 if(!exp->expType)
5269 {
5270 exp->expType = op1->type;
5271 if(op1->type)
5272 op1->type->refCount++;
5273 }
5274 return 1;
5275 }
5276
5277 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5278 {
5279 int value2 = op2->__anon1.i;
5280
5281 exp->type = 2;
5282 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
5283 if(!exp->expType)
5284 {
5285 exp->expType = op1->type;
5286 if(op1->type)
5287 op1->type->refCount++;
5288 }
5289 return 1;
5290 }
5291
5292 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5293 {
5294 unsigned int value2 = op2->__anon1.ui;
5295
5296 exp->type = 2;
5297 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
5298 if(!exp->expType)
5299 {
5300 exp->expType = op1->type;
5301 if(op1->type)
5302 op1->type->refCount++;
5303 }
5304 return 1;
5305 }
5306
5307 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5308 {
5309 long long value2 = op2->__anon1.i64;
5310
5311 exp->type = 2;
5312 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
5313 if(!exp->expType)
5314 {
5315 exp->expType = op1->type;
5316 if(op1->type)
5317 op1->type->refCount++;
5318 }
5319 return 1;
5320 }
5321
5322 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5323 {
5324 uint64 value2 = op2->__anon1.ui64;
5325
5326 exp->type = 2;
5327 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
5328 if(!exp->expType)
5329 {
5330 exp->expType = op1->type;
5331 if(op1->type)
5332 op1->type->refCount++;
5333 }
5334 return 1;
5335 }
5336
5337 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5338 {
5339 short value2 = op2->__anon1.s;
5340
5341 exp->type = 2;
5342 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
5343 if(!exp->expType)
5344 {
5345 exp->expType = op1->type;
5346 if(op1->type)
5347 op1->type->refCount++;
5348 }
5349 return 1;
5350 }
5351
5352 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5353 {
5354 unsigned short value2 = op2->__anon1.us;
5355
5356 exp->type = 2;
5357 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
5358 if(!exp->expType)
5359 {
5360 exp->expType = op1->type;
5361 if(op1->type)
5362 op1->type->refCount++;
5363 }
5364 return 1;
5365 }
5366
5367 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5368 {
5369 char value2 = op2->__anon1.c;
5370
5371 exp->type = 2;
5372 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
5373 if(!exp->expType)
5374 {
5375 exp->expType = op1->type;
5376 if(op1->type)
5377 op1->type->refCount++;
5378 }
5379 return 1;
5380 }
5381
5382 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5383 {
5384 unsigned char value2 = op2->__anon1.uc;
5385
5386 exp->type = 2;
5387 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
5388 if(!exp->expType)
5389 {
5390 exp->expType = op1->type;
5391 if(op1->type)
5392 op1->type->refCount++;
5393 }
5394 return 1;
5395 }
5396
5397 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5398 {
5399 int value2 = op2->__anon1.i;
5400
5401 exp->type = 2;
5402 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
5403 if(!exp->expType)
5404 {
5405 exp->expType = op1->type;
5406 if(op1->type)
5407 op1->type->refCount++;
5408 }
5409 return 1;
5410 }
5411
5412 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5413 {
5414 unsigned int value2 = op2->__anon1.ui;
5415
5416 exp->type = 2;
5417 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
5418 if(!exp->expType)
5419 {
5420 exp->expType = op1->type;
5421 if(op1->type)
5422 op1->type->refCount++;
5423 }
5424 return 1;
5425 }
5426
5427 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5428 {
5429 long long value2 = op2->__anon1.i64;
5430
5431 exp->type = 2;
5432 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
5433 if(!exp->expType)
5434 {
5435 exp->expType = op1->type;
5436 if(op1->type)
5437 op1->type->refCount++;
5438 }
5439 return 1;
5440 }
5441
5442 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5443 {
5444 uint64 value2 = op2->__anon1.ui64;
5445
5446 exp->type = 2;
5447 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
5448 if(!exp->expType)
5449 {
5450 exp->expType = op1->type;
5451 if(op1->type)
5452 op1->type->refCount++;
5453 }
5454 return 1;
5455 }
5456
5457 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5458 {
5459 short value2 = op2->__anon1.s;
5460
5461 exp->type = 2;
5462 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
5463 if(!exp->expType)
5464 {
5465 exp->expType = op1->type;
5466 if(op1->type)
5467 op1->type->refCount++;
5468 }
5469 return 1;
5470 }
5471
5472 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5473 {
5474 unsigned short value2 = op2->__anon1.us;
5475
5476 exp->type = 2;
5477 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
5478 if(!exp->expType)
5479 {
5480 exp->expType = op1->type;
5481 if(op1->type)
5482 op1->type->refCount++;
5483 }
5484 return 1;
5485 }
5486
5487 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5488 {
5489 char value2 = op2->__anon1.c;
5490
5491 exp->type = 2;
5492 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
5493 if(!exp->expType)
5494 {
5495 exp->expType = op1->type;
5496 if(op1->type)
5497 op1->type->refCount++;
5498 }
5499 return 1;
5500 }
5501
5502 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5503 {
5504 unsigned char value2 = op2->__anon1.uc;
5505
5506 exp->type = 2;
5507 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
5508 if(!exp->expType)
5509 {
5510 exp->expType = op1->type;
5511 if(op1->type)
5512 op1->type->refCount++;
5513 }
5514 return 1;
5515 }
5516
5517 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5518 {
5519 int value2 = op2->__anon1.i;
5520
5521 exp->type = 2;
5522 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
5523 if(!exp->expType)
5524 {
5525 exp->expType = op1->type;
5526 if(op1->type)
5527 op1->type->refCount++;
5528 }
5529 return 1;
5530 }
5531
5532 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5533 {
5534 unsigned int value2 = op2->__anon1.ui;
5535
5536 exp->type = 2;
5537 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
5538 if(!exp->expType)
5539 {
5540 exp->expType = op1->type;
5541 if(op1->type)
5542 op1->type->refCount++;
5543 }
5544 return 1;
5545 }
5546
5547 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5548 {
5549 long long value2 = op2->__anon1.i64;
5550
5551 exp->type = 2;
5552 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
5553 if(!exp->expType)
5554 {
5555 exp->expType = op1->type;
5556 if(op1->type)
5557 op1->type->refCount++;
5558 }
5559 return 1;
5560 }
5561
5562 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5563 {
5564 uint64 value2 = op2->__anon1.ui64;
5565
5566 exp->type = 2;
5567 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
5568 if(!exp->expType)
5569 {
5570 exp->expType = op1->type;
5571 if(op1->type)
5572 op1->type->refCount++;
5573 }
5574 return 1;
5575 }
5576
5577 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5578 {
5579 short value2 = op2->__anon1.s;
5580
5581 exp->type = 2;
5582 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
5583 if(!exp->expType)
5584 {
5585 exp->expType = op1->type;
5586 if(op1->type)
5587 op1->type->refCount++;
5588 }
5589 return 1;
5590 }
5591
5592 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5593 {
5594 unsigned short value2 = op2->__anon1.us;
5595
5596 exp->type = 2;
5597 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
5598 if(!exp->expType)
5599 {
5600 exp->expType = op1->type;
5601 if(op1->type)
5602 op1->type->refCount++;
5603 }
5604 return 1;
5605 }
5606
5607 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5608 {
5609 char value2 = op2->__anon1.c;
5610
5611 exp->type = 2;
5612 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
5613 if(!exp->expType)
5614 {
5615 exp->expType = op1->type;
5616 if(op1->type)
5617 op1->type->refCount++;
5618 }
5619 return 1;
5620 }
5621
5622 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5623 {
5624 unsigned char value2 = op2->__anon1.uc;
5625
5626 exp->type = 2;
5627 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
5628 if(!exp->expType)
5629 {
5630 exp->expType = op1->type;
5631 if(op1->type)
5632 op1->type->refCount++;
5633 }
5634 return 1;
5635 }
5636
5637 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5638 {
5639 int value2 = op2->__anon1.i;
5640
5641 exp->type = 2;
5642 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
5643 if(!exp->expType)
5644 {
5645 exp->expType = op1->type;
5646 if(op1->type)
5647 op1->type->refCount++;
5648 }
5649 return 1;
5650 }
5651
5652 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5653 {
5654 unsigned int value2 = op2->__anon1.ui;
5655
5656 exp->type = 2;
5657 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
5658 if(!exp->expType)
5659 {
5660 exp->expType = op1->type;
5661 if(op1->type)
5662 op1->type->refCount++;
5663 }
5664 return 1;
5665 }
5666
5667 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5668 {
5669 long long value2 = op2->__anon1.i64;
5670
5671 exp->type = 2;
5672 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
5673 if(!exp->expType)
5674 {
5675 exp->expType = op1->type;
5676 if(op1->type)
5677 op1->type->refCount++;
5678 }
5679 return 1;
5680 }
5681
5682 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5683 {
5684 uint64 value2 = op2->__anon1.ui64;
5685
5686 exp->type = 2;
5687 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
5688 if(!exp->expType)
5689 {
5690 exp->expType = op1->type;
5691 if(op1->type)
5692 op1->type->refCount++;
5693 }
5694 return 1;
5695 }
5696
5697 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5698 {
5699 short value2 = op2->__anon1.s;
5700
5701 exp->type = 2;
5702 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
5703 if(!exp->expType)
5704 {
5705 exp->expType = op1->type;
5706 if(op1->type)
5707 op1->type->refCount++;
5708 }
5709 return 1;
5710 }
5711
5712 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5713 {
5714 unsigned short value2 = op2->__anon1.us;
5715
5716 exp->type = 2;
5717 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
5718 if(!exp->expType)
5719 {
5720 exp->expType = op1->type;
5721 if(op1->type)
5722 op1->type->refCount++;
5723 }
5724 return 1;
5725 }
5726
5727 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5728 {
5729 char value2 = op2->__anon1.c;
5730
5731 exp->type = 2;
5732 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
5733 if(!exp->expType)
5734 {
5735 exp->expType = op1->type;
5736 if(op1->type)
5737 op1->type->refCount++;
5738 }
5739 return 1;
5740 }
5741
5742 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5743 {
5744 unsigned char value2 = op2->__anon1.uc;
5745
5746 exp->type = 2;
5747 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
5748 if(!exp->expType)
5749 {
5750 exp->expType = op1->type;
5751 if(op1->type)
5752 op1->type->refCount++;
5753 }
5754 return 1;
5755 }
5756
5757 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
5758 {
5759 exp->type = 2;
5760 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
5761 if(!exp->expType)
5762 {
5763 exp->expType = op1->type;
5764 if(op1->type)
5765 op1->type->refCount++;
5766 }
5767 return 1;
5768 }
5769
5770 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
5771 {
5772 exp->type = 2;
5773 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
5774 if(!exp->expType)
5775 {
5776 exp->expType = op1->type;
5777 if(op1->type)
5778 op1->type->refCount++;
5779 }
5780 return 1;
5781 }
5782
5783 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
5784 {
5785 exp->type = 2;
5786 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
5787 if(!exp->expType)
5788 {
5789 exp->expType = op1->type;
5790 if(op1->type)
5791 op1->type->refCount++;
5792 }
5793 return 1;
5794 }
5795
5796 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
5797 {
5798 exp->type = 2;
5799 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
5800 if(!exp->expType)
5801 {
5802 exp->expType = op1->type;
5803 if(op1->type)
5804 op1->type->refCount++;
5805 }
5806 return 1;
5807 }
5808
5809 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
5810 {
5811 exp->type = 2;
5812 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
5813 if(!exp->expType)
5814 {
5815 exp->expType = op1->type;
5816 if(op1->type)
5817 op1->type->refCount++;
5818 }
5819 return 1;
5820 }
5821
5822 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
5823 {
5824 exp->type = 2;
5825 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
5826 if(!exp->expType)
5827 {
5828 exp->expType = op1->type;
5829 if(op1->type)
5830 op1->type->refCount++;
5831 }
5832 return 1;
5833 }
5834
5835 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
5836 {
5837 exp->type = 2;
5838 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
5839 if(!exp->expType)
5840 {
5841 exp->expType = op1->type;
5842 if(op1->type)
5843 op1->type->refCount++;
5844 }
5845 return 1;
5846 }
5847
5848 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
5849 {
5850 exp->type = 2;
5851 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
5852 if(!exp->expType)
5853 {
5854 exp->expType = op1->type;
5855 if(op1->type)
5856 op1->type->refCount++;
5857 }
5858 return 1;
5859 }
5860
5861 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5862 {
5863 int value2 = op2->__anon1.i;
5864
5865 exp->type = 2;
5866 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
5867 if(!exp->expType)
5868 {
5869 exp->expType = op1->type;
5870 if(op1->type)
5871 op1->type->refCount++;
5872 }
5873 return 1;
5874 }
5875
5876 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5877 {
5878 unsigned int value2 = op2->__anon1.ui;
5879
5880 exp->type = 2;
5881 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
5882 if(!exp->expType)
5883 {
5884 exp->expType = op1->type;
5885 if(op1->type)
5886 op1->type->refCount++;
5887 }
5888 return 1;
5889 }
5890
5891 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5892 {
5893 long long value2 = op2->__anon1.i64;
5894
5895 exp->type = 2;
5896 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
5897 if(!exp->expType)
5898 {
5899 exp->expType = op1->type;
5900 if(op1->type)
5901 op1->type->refCount++;
5902 }
5903 return 1;
5904 }
5905
5906 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5907 {
5908 uint64 value2 = op2->__anon1.ui64;
5909
5910 exp->type = 2;
5911 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
5912 if(!exp->expType)
5913 {
5914 exp->expType = op1->type;
5915 if(op1->type)
5916 op1->type->refCount++;
5917 }
5918 return 1;
5919 }
5920
5921 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5922 {
5923 short value2 = op2->__anon1.s;
5924
5925 exp->type = 2;
5926 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
5927 if(!exp->expType)
5928 {
5929 exp->expType = op1->type;
5930 if(op1->type)
5931 op1->type->refCount++;
5932 }
5933 return 1;
5934 }
5935
5936 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5937 {
5938 unsigned short value2 = op2->__anon1.us;
5939
5940 exp->type = 2;
5941 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
5942 if(!exp->expType)
5943 {
5944 exp->expType = op1->type;
5945 if(op1->type)
5946 op1->type->refCount++;
5947 }
5948 return 1;
5949 }
5950
5951 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5952 {
5953 char value2 = op2->__anon1.c;
5954
5955 exp->type = 2;
5956 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
5957 if(!exp->expType)
5958 {
5959 exp->expType = op1->type;
5960 if(op1->type)
5961 op1->type->refCount++;
5962 }
5963 return 1;
5964 }
5965
5966 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5967 {
5968 unsigned char value2 = op2->__anon1.uc;
5969
5970 exp->type = 2;
5971 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
5972 if(!exp->expType)
5973 {
5974 exp->expType = op1->type;
5975 if(op1->type)
5976 op1->type->refCount++;
5977 }
5978 return 1;
5979 }
5980
5981 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5982 {
5983 float value2 = op2->__anon1.f;
5984
5985 exp->type = 2;
5986 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
5987 if(!exp->expType)
5988 {
5989 exp->expType = op1->type;
5990 if(op1->type)
5991 op1->type->refCount++;
5992 }
5993 return 1;
5994 }
5995
5996 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5997 {
5998 double value2 = op2->__anon1.d;
5999
6000 exp->type = 2;
6001 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
6002 if(!exp->expType)
6003 {
6004 exp->expType = op1->type;
6005 if(op1->type)
6006 op1->type->refCount++;
6007 }
6008 return 1;
6009 }
6010
6011 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6012 {
6013 int value2 = op2->__anon1.i;
6014
6015 exp->type = 2;
6016 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
6017 if(!exp->expType)
6018 {
6019 exp->expType = op1->type;
6020 if(op1->type)
6021 op1->type->refCount++;
6022 }
6023 return 1;
6024 }
6025
6026 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6027 {
6028 unsigned int value2 = op2->__anon1.ui;
6029
6030 exp->type = 2;
6031 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
6032 if(!exp->expType)
6033 {
6034 exp->expType = op1->type;
6035 if(op1->type)
6036 op1->type->refCount++;
6037 }
6038 return 1;
6039 }
6040
6041 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6042 {
6043 long long value2 = op2->__anon1.i64;
6044
6045 exp->type = 2;
6046 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
6047 if(!exp->expType)
6048 {
6049 exp->expType = op1->type;
6050 if(op1->type)
6051 op1->type->refCount++;
6052 }
6053 return 1;
6054 }
6055
6056 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6057 {
6058 uint64 value2 = op2->__anon1.ui64;
6059
6060 exp->type = 2;
6061 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
6062 if(!exp->expType)
6063 {
6064 exp->expType = op1->type;
6065 if(op1->type)
6066 op1->type->refCount++;
6067 }
6068 return 1;
6069 }
6070
6071 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6072 {
6073 short value2 = op2->__anon1.s;
6074
6075 exp->type = 2;
6076 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
6077 if(!exp->expType)
6078 {
6079 exp->expType = op1->type;
6080 if(op1->type)
6081 op1->type->refCount++;
6082 }
6083 return 1;
6084 }
6085
6086 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6087 {
6088 unsigned short value2 = op2->__anon1.us;
6089
6090 exp->type = 2;
6091 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
6092 if(!exp->expType)
6093 {
6094 exp->expType = op1->type;
6095 if(op1->type)
6096 op1->type->refCount++;
6097 }
6098 return 1;
6099 }
6100
6101 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6102 {
6103 char value2 = op2->__anon1.c;
6104
6105 exp->type = 2;
6106 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
6107 if(!exp->expType)
6108 {
6109 exp->expType = op1->type;
6110 if(op1->type)
6111 op1->type->refCount++;
6112 }
6113 return 1;
6114 }
6115
6116 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6117 {
6118 unsigned char value2 = op2->__anon1.uc;
6119
6120 exp->type = 2;
6121 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
6122 if(!exp->expType)
6123 {
6124 exp->expType = op1->type;
6125 if(op1->type)
6126 op1->type->refCount++;
6127 }
6128 return 1;
6129 }
6130
6131 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6132 {
6133 float value2 = op2->__anon1.f;
6134
6135 exp->type = 2;
6136 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
6137 if(!exp->expType)
6138 {
6139 exp->expType = op1->type;
6140 if(op1->type)
6141 op1->type->refCount++;
6142 }
6143 return 1;
6144 }
6145
6146 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6147 {
6148 double value2 = op2->__anon1.d;
6149
6150 exp->type = 2;
6151 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
6152 if(!exp->expType)
6153 {
6154 exp->expType = op1->type;
6155 if(op1->type)
6156 op1->type->refCount++;
6157 }
6158 return 1;
6159 }
6160
6161 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6162 {
6163 int value2 = op2->__anon1.i;
6164
6165 exp->type = 2;
6166 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
6167 if(!exp->expType)
6168 {
6169 exp->expType = op1->type;
6170 if(op1->type)
6171 op1->type->refCount++;
6172 }
6173 return 1;
6174 }
6175
6176 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6177 {
6178 unsigned int value2 = op2->__anon1.ui;
6179
6180 exp->type = 2;
6181 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
6182 if(!exp->expType)
6183 {
6184 exp->expType = op1->type;
6185 if(op1->type)
6186 op1->type->refCount++;
6187 }
6188 return 1;
6189 }
6190
6191 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6192 {
6193 long long value2 = op2->__anon1.i64;
6194
6195 exp->type = 2;
6196 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
6197 if(!exp->expType)
6198 {
6199 exp->expType = op1->type;
6200 if(op1->type)
6201 op1->type->refCount++;
6202 }
6203 return 1;
6204 }
6205
6206 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6207 {
6208 uint64 value2 = op2->__anon1.ui64;
6209
6210 exp->type = 2;
6211 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
6212 if(!exp->expType)
6213 {
6214 exp->expType = op1->type;
6215 if(op1->type)
6216 op1->type->refCount++;
6217 }
6218 return 1;
6219 }
6220
6221 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6222 {
6223 short value2 = op2->__anon1.s;
6224
6225 exp->type = 2;
6226 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
6227 if(!exp->expType)
6228 {
6229 exp->expType = op1->type;
6230 if(op1->type)
6231 op1->type->refCount++;
6232 }
6233 return 1;
6234 }
6235
6236 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6237 {
6238 unsigned short value2 = op2->__anon1.us;
6239
6240 exp->type = 2;
6241 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
6242 if(!exp->expType)
6243 {
6244 exp->expType = op1->type;
6245 if(op1->type)
6246 op1->type->refCount++;
6247 }
6248 return 1;
6249 }
6250
6251 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6252 {
6253 char value2 = op2->__anon1.c;
6254
6255 exp->type = 2;
6256 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
6257 if(!exp->expType)
6258 {
6259 exp->expType = op1->type;
6260 if(op1->type)
6261 op1->type->refCount++;
6262 }
6263 return 1;
6264 }
6265
6266 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6267 {
6268 unsigned char value2 = op2->__anon1.uc;
6269
6270 exp->type = 2;
6271 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
6272 if(!exp->expType)
6273 {
6274 exp->expType = op1->type;
6275 if(op1->type)
6276 op1->type->refCount++;
6277 }
6278 return 1;
6279 }
6280
6281 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6282 {
6283 float value2 = op2->__anon1.f;
6284
6285 exp->type = 2;
6286 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
6287 if(!exp->expType)
6288 {
6289 exp->expType = op1->type;
6290 if(op1->type)
6291 op1->type->refCount++;
6292 }
6293 return 1;
6294 }
6295
6296 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6297 {
6298 double value2 = op2->__anon1.d;
6299
6300 exp->type = 2;
6301 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
6302 if(!exp->expType)
6303 {
6304 exp->expType = op1->type;
6305 if(op1->type)
6306 op1->type->refCount++;
6307 }
6308 return 1;
6309 }
6310
6311 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6312 {
6313 int value2 = op2->__anon1.i;
6314
6315 exp->type = 2;
6316 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
6317 if(!exp->expType)
6318 {
6319 exp->expType = op1->type;
6320 if(op1->type)
6321 op1->type->refCount++;
6322 }
6323 return 1;
6324 }
6325
6326 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6327 {
6328 unsigned int value2 = op2->__anon1.ui;
6329
6330 exp->type = 2;
6331 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
6332 if(!exp->expType)
6333 {
6334 exp->expType = op1->type;
6335 if(op1->type)
6336 op1->type->refCount++;
6337 }
6338 return 1;
6339 }
6340
6341 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6342 {
6343 long long value2 = op2->__anon1.i64;
6344
6345 exp->type = 2;
6346 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
6347 if(!exp->expType)
6348 {
6349 exp->expType = op1->type;
6350 if(op1->type)
6351 op1->type->refCount++;
6352 }
6353 return 1;
6354 }
6355
6356 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6357 {
6358 uint64 value2 = op2->__anon1.ui64;
6359
6360 exp->type = 2;
6361 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
6362 if(!exp->expType)
6363 {
6364 exp->expType = op1->type;
6365 if(op1->type)
6366 op1->type->refCount++;
6367 }
6368 return 1;
6369 }
6370
6371 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6372 {
6373 short value2 = op2->__anon1.s;
6374
6375 exp->type = 2;
6376 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
6377 if(!exp->expType)
6378 {
6379 exp->expType = op1->type;
6380 if(op1->type)
6381 op1->type->refCount++;
6382 }
6383 return 1;
6384 }
6385
6386 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6387 {
6388 unsigned short value2 = op2->__anon1.us;
6389
6390 exp->type = 2;
6391 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
6392 if(!exp->expType)
6393 {
6394 exp->expType = op1->type;
6395 if(op1->type)
6396 op1->type->refCount++;
6397 }
6398 return 1;
6399 }
6400
6401 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6402 {
6403 char value2 = op2->__anon1.c;
6404
6405 exp->type = 2;
6406 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
6407 if(!exp->expType)
6408 {
6409 exp->expType = op1->type;
6410 if(op1->type)
6411 op1->type->refCount++;
6412 }
6413 return 1;
6414 }
6415
6416 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6417 {
6418 unsigned char value2 = op2->__anon1.uc;
6419
6420 exp->type = 2;
6421 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
6422 if(!exp->expType)
6423 {
6424 exp->expType = op1->type;
6425 if(op1->type)
6426 op1->type->refCount++;
6427 }
6428 return 1;
6429 }
6430
6431 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6432 {
6433 float value2 = op2->__anon1.f;
6434
6435 exp->type = 2;
6436 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
6437 if(!exp->expType)
6438 {
6439 exp->expType = op1->type;
6440 if(op1->type)
6441 op1->type->refCount++;
6442 }
6443 return 1;
6444 }
6445
6446 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6447 {
6448 double value2 = op2->__anon1.d;
6449
6450 exp->type = 2;
6451 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
6452 if(!exp->expType)
6453 {
6454 exp->expType = op1->type;
6455 if(op1->type)
6456 op1->type->refCount++;
6457 }
6458 return 1;
6459 }
6460
6461 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6462 {
6463 int value2 = op2->__anon1.i;
6464
6465 exp->type = 2;
6466 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
6467 if(!exp->expType)
6468 {
6469 exp->expType = op1->type;
6470 if(op1->type)
6471 op1->type->refCount++;
6472 }
6473 return 1;
6474 }
6475
6476 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6477 {
6478 unsigned int value2 = op2->__anon1.ui;
6479
6480 exp->type = 2;
6481 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
6482 if(!exp->expType)
6483 {
6484 exp->expType = op1->type;
6485 if(op1->type)
6486 op1->type->refCount++;
6487 }
6488 return 1;
6489 }
6490
6491 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6492 {
6493 long long value2 = op2->__anon1.i64;
6494
6495 exp->type = 2;
6496 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
6497 if(!exp->expType)
6498 {
6499 exp->expType = op1->type;
6500 if(op1->type)
6501 op1->type->refCount++;
6502 }
6503 return 1;
6504 }
6505
6506 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6507 {
6508 uint64 value2 = op2->__anon1.ui64;
6509
6510 exp->type = 2;
6511 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
6512 if(!exp->expType)
6513 {
6514 exp->expType = op1->type;
6515 if(op1->type)
6516 op1->type->refCount++;
6517 }
6518 return 1;
6519 }
6520
6521 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6522 {
6523 short value2 = op2->__anon1.s;
6524
6525 exp->type = 2;
6526 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
6527 if(!exp->expType)
6528 {
6529 exp->expType = op1->type;
6530 if(op1->type)
6531 op1->type->refCount++;
6532 }
6533 return 1;
6534 }
6535
6536 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6537 {
6538 unsigned short value2 = op2->__anon1.us;
6539
6540 exp->type = 2;
6541 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
6542 if(!exp->expType)
6543 {
6544 exp->expType = op1->type;
6545 if(op1->type)
6546 op1->type->refCount++;
6547 }
6548 return 1;
6549 }
6550
6551 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6552 {
6553 char value2 = op2->__anon1.c;
6554
6555 exp->type = 2;
6556 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
6557 if(!exp->expType)
6558 {
6559 exp->expType = op1->type;
6560 if(op1->type)
6561 op1->type->refCount++;
6562 }
6563 return 1;
6564 }
6565
6566 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6567 {
6568 unsigned char value2 = op2->__anon1.uc;
6569
6570 exp->type = 2;
6571 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
6572 if(!exp->expType)
6573 {
6574 exp->expType = op1->type;
6575 if(op1->type)
6576 op1->type->refCount++;
6577 }
6578 return 1;
6579 }
6580
6581 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6582 {
6583 float value2 = op2->__anon1.f;
6584
6585 exp->type = 2;
6586 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
6587 if(!exp->expType)
6588 {
6589 exp->expType = op1->type;
6590 if(op1->type)
6591 op1->type->refCount++;
6592 }
6593 return 1;
6594 }
6595
6596 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6597 {
6598 double value2 = op2->__anon1.d;
6599
6600 exp->type = 2;
6601 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
6602 if(!exp->expType)
6603 {
6604 exp->expType = op1->type;
6605 if(op1->type)
6606 op1->type->refCount++;
6607 }
6608 return 1;
6609 }
6610
6611 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6612 {
6613 int value2 = op2->__anon1.i;
6614
6615 exp->type = 2;
6616 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
6617 if(!exp->expType)
6618 {
6619 exp->expType = op1->type;
6620 if(op1->type)
6621 op1->type->refCount++;
6622 }
6623 return 1;
6624 }
6625
6626 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6627 {
6628 unsigned int value2 = op2->__anon1.ui;
6629
6630 exp->type = 2;
6631 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
6632 if(!exp->expType)
6633 {
6634 exp->expType = op1->type;
6635 if(op1->type)
6636 op1->type->refCount++;
6637 }
6638 return 1;
6639 }
6640
6641 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6642 {
6643 long long value2 = op2->__anon1.i64;
6644
6645 exp->type = 2;
6646 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
6647 if(!exp->expType)
6648 {
6649 exp->expType = op1->type;
6650 if(op1->type)
6651 op1->type->refCount++;
6652 }
6653 return 1;
6654 }
6655
6656 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6657 {
6658 uint64 value2 = op2->__anon1.ui64;
6659
6660 exp->type = 2;
6661 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
6662 if(!exp->expType)
6663 {
6664 exp->expType = op1->type;
6665 if(op1->type)
6666 op1->type->refCount++;
6667 }
6668 return 1;
6669 }
6670
6671 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6672 {
6673 short value2 = op2->__anon1.s;
6674
6675 exp->type = 2;
6676 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
6677 if(!exp->expType)
6678 {
6679 exp->expType = op1->type;
6680 if(op1->type)
6681 op1->type->refCount++;
6682 }
6683 return 1;
6684 }
6685
6686 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6687 {
6688 unsigned short value2 = op2->__anon1.us;
6689
6690 exp->type = 2;
6691 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
6692 if(!exp->expType)
6693 {
6694 exp->expType = op1->type;
6695 if(op1->type)
6696 op1->type->refCount++;
6697 }
6698 return 1;
6699 }
6700
6701 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6702 {
6703 char value2 = op2->__anon1.c;
6704
6705 exp->type = 2;
6706 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
6707 if(!exp->expType)
6708 {
6709 exp->expType = op1->type;
6710 if(op1->type)
6711 op1->type->refCount++;
6712 }
6713 return 1;
6714 }
6715
6716 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6717 {
6718 unsigned char value2 = op2->__anon1.uc;
6719
6720 exp->type = 2;
6721 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
6722 if(!exp->expType)
6723 {
6724 exp->expType = op1->type;
6725 if(op1->type)
6726 op1->type->refCount++;
6727 }
6728 return 1;
6729 }
6730
6731 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6732 {
6733 float value2 = op2->__anon1.f;
6734
6735 exp->type = 2;
6736 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
6737 if(!exp->expType)
6738 {
6739 exp->expType = op1->type;
6740 if(op1->type)
6741 op1->type->refCount++;
6742 }
6743 return 1;
6744 }
6745
6746 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6747 {
6748 double value2 = op2->__anon1.d;
6749
6750 exp->type = 2;
6751 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
6752 if(!exp->expType)
6753 {
6754 exp->expType = op1->type;
6755 if(op1->type)
6756 op1->type->refCount++;
6757 }
6758 return 1;
6759 }
6760
6761 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6762 {
6763 int value2 = op2->__anon1.i;
6764
6765 exp->type = 2;
6766 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
6767 if(!exp->expType)
6768 {
6769 exp->expType = op1->type;
6770 if(op1->type)
6771 op1->type->refCount++;
6772 }
6773 return 1;
6774 }
6775
6776 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6777 {
6778 unsigned int value2 = op2->__anon1.ui;
6779
6780 exp->type = 2;
6781 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
6782 if(!exp->expType)
6783 {
6784 exp->expType = op1->type;
6785 if(op1->type)
6786 op1->type->refCount++;
6787 }
6788 return 1;
6789 }
6790
6791 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6792 {
6793 long long value2 = op2->__anon1.i64;
6794
6795 exp->type = 2;
6796 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
6797 if(!exp->expType)
6798 {
6799 exp->expType = op1->type;
6800 if(op1->type)
6801 op1->type->refCount++;
6802 }
6803 return 1;
6804 }
6805
6806 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6807 {
6808 uint64 value2 = op2->__anon1.ui64;
6809
6810 exp->type = 2;
6811 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
6812 if(!exp->expType)
6813 {
6814 exp->expType = op1->type;
6815 if(op1->type)
6816 op1->type->refCount++;
6817 }
6818 return 1;
6819 }
6820
6821 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6822 {
6823 short value2 = op2->__anon1.s;
6824
6825 exp->type = 2;
6826 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
6827 if(!exp->expType)
6828 {
6829 exp->expType = op1->type;
6830 if(op1->type)
6831 op1->type->refCount++;
6832 }
6833 return 1;
6834 }
6835
6836 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6837 {
6838 unsigned short value2 = op2->__anon1.us;
6839
6840 exp->type = 2;
6841 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
6842 if(!exp->expType)
6843 {
6844 exp->expType = op1->type;
6845 if(op1->type)
6846 op1->type->refCount++;
6847 }
6848 return 1;
6849 }
6850
6851 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6852 {
6853 char value2 = op2->__anon1.c;
6854
6855 exp->type = 2;
6856 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
6857 if(!exp->expType)
6858 {
6859 exp->expType = op1->type;
6860 if(op1->type)
6861 op1->type->refCount++;
6862 }
6863 return 1;
6864 }
6865
6866 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6867 {
6868 unsigned char value2 = op2->__anon1.uc;
6869
6870 exp->type = 2;
6871 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
6872 if(!exp->expType)
6873 {
6874 exp->expType = op1->type;
6875 if(op1->type)
6876 op1->type->refCount++;
6877 }
6878 return 1;
6879 }
6880
6881 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6882 {
6883 float value2 = op2->__anon1.f;
6884
6885 exp->type = 2;
6886 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
6887 if(!exp->expType)
6888 {
6889 exp->expType = op1->type;
6890 if(op1->type)
6891 op1->type->refCount++;
6892 }
6893 return 1;
6894 }
6895
6896 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6897 {
6898 double value2 = op2->__anon1.d;
6899
6900 exp->type = 2;
6901 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
6902 if(!exp->expType)
6903 {
6904 exp->expType = op1->type;
6905 if(op1->type)
6906 op1->type->refCount++;
6907 }
6908 return 1;
6909 }
6910
6911 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6912 {
6913 int value2 = op2->__anon1.i;
6914
6915 exp->type = 2;
6916 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
6917 if(!exp->expType)
6918 {
6919 exp->expType = op1->type;
6920 if(op1->type)
6921 op1->type->refCount++;
6922 }
6923 return 1;
6924 }
6925
6926 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6927 {
6928 unsigned int value2 = op2->__anon1.ui;
6929
6930 exp->type = 2;
6931 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
6932 if(!exp->expType)
6933 {
6934 exp->expType = op1->type;
6935 if(op1->type)
6936 op1->type->refCount++;
6937 }
6938 return 1;
6939 }
6940
6941 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6942 {
6943 long long value2 = op2->__anon1.i64;
6944
6945 exp->type = 2;
6946 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
6947 if(!exp->expType)
6948 {
6949 exp->expType = op1->type;
6950 if(op1->type)
6951 op1->type->refCount++;
6952 }
6953 return 1;
6954 }
6955
6956 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6957 {
6958 uint64 value2 = op2->__anon1.ui64;
6959
6960 exp->type = 2;
6961 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
6962 if(!exp->expType)
6963 {
6964 exp->expType = op1->type;
6965 if(op1->type)
6966 op1->type->refCount++;
6967 }
6968 return 1;
6969 }
6970
6971 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6972 {
6973 short value2 = op2->__anon1.s;
6974
6975 exp->type = 2;
6976 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
6977 if(!exp->expType)
6978 {
6979 exp->expType = op1->type;
6980 if(op1->type)
6981 op1->type->refCount++;
6982 }
6983 return 1;
6984 }
6985
6986 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6987 {
6988 unsigned short value2 = op2->__anon1.us;
6989
6990 exp->type = 2;
6991 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
6992 if(!exp->expType)
6993 {
6994 exp->expType = op1->type;
6995 if(op1->type)
6996 op1->type->refCount++;
6997 }
6998 return 1;
6999 }
7000
7001 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7002 {
7003 char value2 = op2->__anon1.c;
7004
7005 exp->type = 2;
7006 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
7007 if(!exp->expType)
7008 {
7009 exp->expType = op1->type;
7010 if(op1->type)
7011 op1->type->refCount++;
7012 }
7013 return 1;
7014 }
7015
7016 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7017 {
7018 unsigned char value2 = op2->__anon1.uc;
7019
7020 exp->type = 2;
7021 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
7022 if(!exp->expType)
7023 {
7024 exp->expType = op1->type;
7025 if(op1->type)
7026 op1->type->refCount++;
7027 }
7028 return 1;
7029 }
7030
7031 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7032 {
7033 float value2 = op2->__anon1.f;
7034
7035 exp->type = 2;
7036 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
7037 if(!exp->expType)
7038 {
7039 exp->expType = op1->type;
7040 if(op1->type)
7041 op1->type->refCount++;
7042 }
7043 return 1;
7044 }
7045
7046 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7047 {
7048 double value2 = op2->__anon1.d;
7049
7050 exp->type = 2;
7051 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
7052 if(!exp->expType)
7053 {
7054 exp->expType = op1->type;
7055 if(op1->type)
7056 op1->type->refCount++;
7057 }
7058 return 1;
7059 }
7060
7061 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7062 {
7063 exp->type = 2;
7064 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
7065 if(!exp->expType)
7066 {
7067 exp->expType = op1->type;
7068 if(op1->type)
7069 op1->type->refCount++;
7070 }
7071 return 1;
7072 }
7073
7074 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7075 {
7076 exp->type = 2;
7077 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
7078 if(!exp->expType)
7079 {
7080 exp->expType = op1->type;
7081 if(op1->type)
7082 op1->type->refCount++;
7083 }
7084 return 1;
7085 }
7086
7087 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7088 {
7089 exp->type = 2;
7090 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
7091 if(!exp->expType)
7092 {
7093 exp->expType = op1->type;
7094 if(op1->type)
7095 op1->type->refCount++;
7096 }
7097 return 1;
7098 }
7099
7100 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7101 {
7102 exp->type = 2;
7103 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
7104 if(!exp->expType)
7105 {
7106 exp->expType = op1->type;
7107 if(op1->type)
7108 op1->type->refCount++;
7109 }
7110 return 1;
7111 }
7112
7113 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7114 {
7115 exp->type = 2;
7116 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
7117 if(!exp->expType)
7118 {
7119 exp->expType = op1->type;
7120 if(op1->type)
7121 op1->type->refCount++;
7122 }
7123 return 1;
7124 }
7125
7126 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7127 {
7128 exp->type = 2;
7129 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
7130 if(!exp->expType)
7131 {
7132 exp->expType = op1->type;
7133 if(op1->type)
7134 op1->type->refCount++;
7135 }
7136 return 1;
7137 }
7138
7139 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7140 {
7141 exp->type = 2;
7142 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
7143 if(!exp->expType)
7144 {
7145 exp->expType = op1->type;
7146 if(op1->type)
7147 op1->type->refCount++;
7148 }
7149 return 1;
7150 }
7151
7152 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7153 {
7154 exp->type = 2;
7155 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
7156 if(!exp->expType)
7157 {
7158 exp->expType = op1->type;
7159 if(op1->type)
7160 op1->type->refCount++;
7161 }
7162 return 1;
7163 }
7164
7165 static void PrintName(struct Type * type, char * string, unsigned int fullName)
7166 {
7167 if(type->name && type->name[0])
7168 {
7169 if(fullName)
7170 strcat(string, type->name);
7171 else
7172 {
7173 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
7174
7175 if(name)
7176 name += 2;
7177 else
7178 name = type->name;
7179 strcat(string, name);
7180 }
7181 }
7182 }
7183
7184 static void PrintAttribs(struct Type * type, char * string)
7185 {
7186 if(type)
7187 {
7188 if(type->dllExport)
7189 strcat(string, "dllexport ");
7190 if(type->attrStdcall)
7191 strcat(string, "stdcall ");
7192 }
7193 }
7194
7195 static struct Type * FindMember(struct Type * type, char * string)
7196 {
7197 struct Type * memberType;
7198
7199 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7200 {
7201 if(!memberType->name)
7202 {
7203 struct Type * subType = FindMember(memberType, string);
7204
7205 if(subType)
7206 return subType;
7207 }
7208 else if(!strcmp(memberType->name, string))
7209 return memberType;
7210 }
7211 return (((void *)0));
7212 }
7213
7214 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
7215
7216 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
7217
7218 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
7219 {
7220 unsigned int result = 0;
7221
7222 switch(kind)
7223 {
7224 case 2:
7225 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
7226 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
7227 break;
7228 case 3:
7229 case 5:
7230 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
7231 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7232 break;
7233 case 4:
7234 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)
7235 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7236 break;
7237 case 6:
7238 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)
7239 result = GetOpFloat(op, &op->__anon1.f);
7240 break;
7241 case 7:
7242 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)
7243 result = GetOpDouble(op, &op->__anon1.d);
7244 break;
7245 case 13:
7246 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)
7247 result = GetOpUInt64(op, &op->__anon1.ui64);
7248 break;
7249 case 15:
7250 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
7251 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7252 break;
7253 case 22:
7254 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7255 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7256 break;
7257 case 23:
7258 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7259 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7260 break;
7261 }
7262 return result;
7263 }
7264
7265 struct OpTable floatOps =
7266 {
7267 (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)
7268 };
7269
7270 struct OpTable doubleOps =
7271 {
7272 (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)
7273 };
7274
7275 struct OpTable intOps =
7276 {
7277 (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)
7278 };
7279
7280 struct OpTable uintOps =
7281 {
7282 (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)
7283 };
7284
7285 struct OpTable int64Ops =
7286 {
7287 (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)
7288 };
7289
7290 struct OpTable uint64Ops =
7291 {
7292 (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)
7293 };
7294
7295 struct OpTable shortOps =
7296 {
7297 (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)
7298 };
7299
7300 struct OpTable ushortOps =
7301 {
7302 (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)
7303 };
7304
7305 struct OpTable charOps =
7306 {
7307 (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)
7308 };
7309
7310 struct OpTable ucharOps =
7311 {
7312 (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)
7313 };
7314
7315 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
7316 {
7317 struct Type * memberType;
7318
7319 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7320 {
7321 if(!memberType->name)
7322 {
7323 struct Type * subType = FindMember(memberType, string);
7324
7325 if(subType)
7326 {
7327 *offset += memberType->offset;
7328 return subType;
7329 }
7330 }
7331 else if(!strcmp(memberType->name, string))
7332 {
7333 *offset += memberType->offset;
7334 return memberType;
7335 }
7336 }
7337 return (((void *)0));
7338 }
7339
7340 struct __ecereNameSpace__ecere__com__Module;
7341
7342 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);
7343
7344 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
7345
7346 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);
7347
7348 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);
7349
7350 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
7351
7352 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7353
7354 struct GlobalData
7355 {
7356 uintptr_t key;
7357 struct __ecereNameSpace__ecere__sys__BTNode * parent;
7358 struct __ecereNameSpace__ecere__sys__BTNode * left;
7359 struct __ecereNameSpace__ecere__sys__BTNode * right;
7360 int depth;
7361 struct __ecereNameSpace__ecere__com__Instance * module;
7362 char *  dataTypeString;
7363 struct Type * dataType;
7364 void *  symbol;
7365 char *  fullName;
7366 } ecere_gcc_struct;
7367
7368 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);
7369
7370 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
7371
7372 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);
7373
7374 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
7375
7376 struct __ecereNameSpace__ecere__com__DefinedExpression;
7377
7378 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7379
7380 struct __ecereNameSpace__ecere__com__DefinedExpression
7381 {
7382 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
7383 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
7384 const char *  name;
7385 const char *  value;
7386 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7387 } ecere_gcc_struct;
7388
7389 struct __ecereNameSpace__ecere__sys__BinaryTree;
7390
7391 struct __ecereNameSpace__ecere__sys__BinaryTree
7392 {
7393 struct __ecereNameSpace__ecere__sys__BTNode * root;
7394 int count;
7395 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
7396 void (*  FreeKey)(void *  key);
7397 } ecere_gcc_struct;
7398
7399 struct __ecereNameSpace__ecere__com__Class
7400 {
7401 struct __ecereNameSpace__ecere__com__Class * prev;
7402 struct __ecereNameSpace__ecere__com__Class * next;
7403 const char *  name;
7404 int offset;
7405 int structSize;
7406 void * *  _vTbl;
7407 int vTblSize;
7408 unsigned int (*  Constructor)(void * );
7409 void (*  Destructor)(void * );
7410 int offsetClass;
7411 int sizeClass;
7412 struct __ecereNameSpace__ecere__com__Class * base;
7413 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
7414 struct __ecereNameSpace__ecere__sys__BinaryTree members;
7415 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
7416 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
7417 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
7418 struct __ecereNameSpace__ecere__sys__OldList derivatives;
7419 int memberID;
7420 int startMemberID;
7421 int type;
7422 struct __ecereNameSpace__ecere__com__Instance * module;
7423 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7424 const char *  dataTypeString;
7425 struct Type * dataType;
7426 int typeSize;
7427 int defaultAlignment;
7428 void (*  Initialize)();
7429 int memberOffset;
7430 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
7431 const char *  designerClass;
7432 unsigned int noExpansion;
7433 const char *  defaultProperty;
7434 unsigned int comRedefinition;
7435 int count;
7436 int isRemote;
7437 unsigned int internalDecl;
7438 void *  data;
7439 unsigned int computeSize;
7440 short structAlignment;
7441 short pointerAlignment;
7442 int destructionWatchOffset;
7443 unsigned int fixed;
7444 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
7445 int inheritanceAccess;
7446 const char *  fullName;
7447 void *  symbol;
7448 struct __ecereNameSpace__ecere__sys__OldList conversions;
7449 struct __ecereNameSpace__ecere__sys__OldList templateParams;
7450 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
7451 struct __ecereNameSpace__ecere__com__Class * templateClass;
7452 struct __ecereNameSpace__ecere__sys__OldList templatized;
7453 int numParams;
7454 unsigned int isInstanceClass;
7455 unsigned int byValueSystemClass;
7456 } ecere_gcc_struct;
7457
7458 struct __ecereNameSpace__ecere__com__NameSpace
7459 {
7460 const char *  name;
7461 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
7462 struct __ecereNameSpace__ecere__com__NameSpace *  left;
7463 struct __ecereNameSpace__ecere__com__NameSpace *  right;
7464 int depth;
7465 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
7466 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
7467 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
7468 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
7469 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
7470 } ecere_gcc_struct;
7471
7472 struct __ecereNameSpace__ecere__com__DataMember
7473 {
7474 struct __ecereNameSpace__ecere__com__DataMember * prev;
7475 struct __ecereNameSpace__ecere__com__DataMember * next;
7476 const char *  name;
7477 unsigned int isProperty;
7478 int memberAccess;
7479 int id;
7480 struct __ecereNameSpace__ecere__com__Class * _class;
7481 const char *  dataTypeString;
7482 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
7483 struct Type * dataType;
7484 int type;
7485 int offset;
7486 int memberID;
7487 struct __ecereNameSpace__ecere__sys__OldList members;
7488 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
7489 int memberOffset;
7490 short structAlignment;
7491 short pointerAlignment;
7492 } ecere_gcc_struct;
7493
7494 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7495
7496 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7497
7498 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
7499
7500 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7501
7502 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7503
7504 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
7505
7506 static void _DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl)
7507 {
7508 if(inCompiler)
7509 {
7510 if(type->kind == 11)
7511 {
7512 struct Type * param;
7513
7514 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
7515 _DeclareType(neededFor, param, forFunctionDef, 0, fwdDecl);
7516 _DeclareType(neededFor, type->__anon1.__anon2.returnType, forFunctionDef, 0, fwdDecl);
7517 }
7518 else if(type->kind == 13)
7519 _DeclareType(neededFor, type->__anon1.type, 0, 0, fwdDecl);
7520 else if(type->kind == 8)
7521 {
7522 struct __ecereNameSpace__ecere__com__Class * c = type->__anon1._class->__anon1.registered;
7523
7524 _DeclareStruct(neededFor, c ? c->fullName : "ecere::com::Instance", c ? c->type == 5 : 0, needDereference && c && c->type == 1, fwdDecl);
7525 }
7526 else if(type->kind == 9 || type->kind == 10)
7527 {
7528 struct Type * member;
7529
7530 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7531 _DeclareType(neededFor, member, needDereference, forFunctionDef, fwdDecl);
7532 }
7533 else if(type->kind == 12)
7534 _DeclareType(neededFor, type->__anon1.__anon4.arrayType, 1, 0, fwdDecl);
7535 }
7536 }
7537
7538 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
7539 {
7540 unsigned int status = 1;
7541
7542 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))
7543 {
7544 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
7545 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
7546
7547 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
7548 {
7549 struct Type * sourceType = source, * destType = dest;
7550
7551 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
7552 sourceType = sourceType->__anon1.type;
7553 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
7554 destType = destType->__anon1.type;
7555 if(!destType->constant && sourceType->constant)
7556 {
7557 status = 0;
7558 if(warn)
7559 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
7560 }
7561 }
7562 }
7563 return status;
7564 }
7565
7566 struct Operand GetOperand(struct Expression * exp)
7567 {
7568 struct Operand op =
7569 {
7570 0, 0, 0,
7571 .__anon1 = {
7572 .c = 0
7573 },
7574 {
7575 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7576 }
7577 };
7578 struct Type * type = exp->expType;
7579
7580 if(type)
7581 {
7582 while(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 2 || type->__anon1._class->__anon1.registered->type == 3 || type->__anon1._class->__anon1.registered->type == 4))
7583 {
7584 if(!type->__anon1._class->__anon1.registered->dataType)
7585 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7586 type = type->__anon1._class->__anon1.registered->dataType;
7587 }
7588 if(exp->type == 3 && op.kind == 13)
7589 {
7590 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
7591 op.kind = 13;
7592 op.ops = uint64Ops;
7593 }
7594 else if(exp->isConstant && exp->type == 2)
7595 {
7596 op.kind = type->kind;
7597 op.type = type;
7598 switch(op.kind)
7599 {
7600 case 24:
7601 case 1:
7602 {
7603 if(exp->__anon1.__anon1.constant[0] == '\'')
7604 {
7605 op.__anon1.c = exp->__anon1.__anon1.constant[1];
7606 op.ops = charOps;
7607 }
7608 else if(type->isSigned)
7609 {
7610 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7611 op.ops = charOps;
7612 }
7613 else
7614 {
7615 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7616 op.ops = ucharOps;
7617 }
7618 break;
7619 }
7620 case 2:
7621 if(exp->__anon1.__anon1.constant[0] == '\'')
7622 {
7623 op.__anon1.s = exp->__anon1.__anon1.constant[1];
7624 op.ops = shortOps;
7625 }
7626 else if(type->isSigned)
7627 {
7628 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7629 op.ops = shortOps;
7630 }
7631 else
7632 {
7633 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7634 op.ops = ushortOps;
7635 }
7636 break;
7637 case 3:
7638 case 5:
7639 if(exp->__anon1.__anon1.constant[0] == '\'')
7640 {
7641 op.__anon1.i = exp->__anon1.__anon1.constant[1];
7642 op.ops = intOps;
7643 }
7644 else if(type->isSigned)
7645 {
7646 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7647 op.ops = intOps;
7648 }
7649 else
7650 {
7651 op.__anon1.ui = (unsigned int)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7652 op.ops = uintOps;
7653 }
7654 op.kind = 3;
7655 break;
7656 case 4:
7657 if(type->isSigned)
7658 {
7659 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7660 op.ops = int64Ops;
7661 }
7662 else
7663 {
7664 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7665 op.ops = uint64Ops;
7666 }
7667 op.kind = 4;
7668 break;
7669 case 22:
7670 if(type->isSigned)
7671 {
7672 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7673 op.ops = int64Ops;
7674 }
7675 else
7676 {
7677 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7678 op.ops = uint64Ops;
7679 }
7680 op.kind = 4;
7681 break;
7682 case 23:
7683 if(type->isSigned)
7684 {
7685 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7686 op.ops = int64Ops;
7687 }
7688 else
7689 {
7690 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7691 op.ops = uint64Ops;
7692 }
7693 op.kind = 4;
7694 break;
7695 case 6:
7696 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7697 op.__anon1.f = __ecereMethod_float_inf();
7698 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7699 op.__anon1.f = -__ecereMethod_float_inf();
7700 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7701 op.__anon1.f = __ecereMethod_float_nan();
7702 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7703 op.__anon1.f = -__ecereMethod_float_nan();
7704 else
7705 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7706 op.ops = floatOps;
7707 break;
7708 case 7:
7709 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7710 op.__anon1.d = __ecereMethod_double_inf();
7711 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7712 op.__anon1.d = -__ecereMethod_double_inf();
7713 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7714 op.__anon1.d = __ecereMethod_double_nan();
7715 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7716 op.__anon1.d = -__ecereMethod_double_nan();
7717 else
7718 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7719 op.ops = doubleOps;
7720 break;
7721 case 12:
7722 case 13:
7723 case 8:
7724 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7725 op.kind = 13;
7726 op.ops = uint64Ops;
7727 break;
7728 }
7729 }
7730 }
7731 return op;
7732 }
7733
7734 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
7735 {
7736 long long v = 0;
7737
7738 switch(_class->typeSize)
7739 {
7740 case 8:
7741 if(!strcmp(_class->dataTypeString, "uint64"))
7742 v = (long long)*(uint64 *)ptr;
7743 else
7744 v = *(long long *)ptr;
7745 break;
7746 case 4:
7747 if(!strcmp(_class->dataTypeString, "uint"))
7748 v = (long long)*(unsigned int *)ptr;
7749 else
7750 v = (long long)*(int *)ptr;
7751 break;
7752 case 2:
7753 if(!strcmp(_class->dataTypeString, "uint16"))
7754 v = (long long)*(unsigned short *)ptr;
7755 else
7756 v = (long long)*(short *)ptr;
7757 break;
7758 case 1:
7759 if(!strcmp(_class->dataTypeString, "byte"))
7760 v = (long long)*(unsigned char *)ptr;
7761 else
7762 v = (long long)*(char *)ptr;
7763 break;
7764 }
7765 return v;
7766 }
7767
7768 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
7769 {
7770 if(!type->isSigned && type->kind != 22 && type->kind != 23)
7771 ListAdd(specs, MkSpecifier(UNSIGNED));
7772 switch(type->kind)
7773 {
7774 case 8:
7775 {
7776 if(type->__anon1._class->__anon1.registered)
7777 {
7778 if(!type->__anon1._class->__anon1.registered->dataType)
7779 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7780 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
7781 }
7782 break;
7783 }
7784 case 7:
7785 ListAdd(specs, MkSpecifier(DOUBLE));
7786 break;
7787 case 6:
7788 ListAdd(specs, MkSpecifier(FLOAT));
7789 break;
7790 case 1:
7791 ListAdd(specs, MkSpecifier(CHAR));
7792 break;
7793 case 24:
7794 ListAdd(specs, MkSpecifier(_BOOL));
7795 break;
7796 case 2:
7797 ListAdd(specs, MkSpecifier(SHORT));
7798 break;
7799 case 4:
7800 ListAdd(specs, MkSpecifier(INT64));
7801 break;
7802 case 22:
7803 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
7804 break;
7805 case 23:
7806 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
7807 break;
7808 case 3:
7809 default:
7810 ListAdd(specs, MkSpecifier(INT));
7811 break;
7812 }
7813 }
7814
7815 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
7816 {
7817 if(type)
7818 {
7819 if(printConst && type->constant)
7820 strcat(string, "const ");
7821 switch(type->kind)
7822 {
7823 case 8:
7824 {
7825 struct Symbol * c = type->__anon1._class;
7826 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
7827
7828 if(type->classObjectType == 2 && isObjectBaseClass)
7829 strcat(string, "typed_object");
7830 else if(type->classObjectType == 3 && isObjectBaseClass)
7831 strcat(string, "any_object");
7832 else
7833 {
7834 if(c && c->string)
7835 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
7836 }
7837 if(type->byReference)
7838 strcat(string, " &");
7839 break;
7840 }
7841 case 0:
7842 strcat(string, "void");
7843 break;
7844 case 3:
7845 strcat(string, type->isSigned ? "int" : "uint");
7846 break;
7847 case 4:
7848 strcat(string, type->isSigned ? "int64" : "uint64");
7849 break;
7850 case 22:
7851 strcat(string, type->isSigned ? "intptr" : "uintptr");
7852 break;
7853 case 23:
7854 strcat(string, type->isSigned ? "intsize" : "uintsize");
7855 break;
7856 case 1:
7857 strcat(string, type->isSigned ? "char" : "byte");
7858 break;
7859 case 24:
7860 strcat(string, "_Bool");
7861 break;
7862 case 2:
7863 strcat(string, type->isSigned ? "short" : "uint16");
7864 break;
7865 case 6:
7866 strcat(string, "float");
7867 break;
7868 case 7:
7869 strcat(string, "double");
7870 break;
7871 case 9:
7872 if(type->__anon1.__anon1.enumName)
7873 {
7874 strcat(string, "struct ");
7875 strcat(string, type->__anon1.__anon1.enumName);
7876 }
7877 else if(type->typeName)
7878 strcat(string, type->typeName);
7879 else
7880 {
7881 struct Type * member;
7882
7883 strcat(string, "struct { ");
7884 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7885 {
7886 PrintType(member, string, 1, fullName);
7887 strcat(string, "; ");
7888 }
7889 strcat(string, "}");
7890 }
7891 break;
7892 case 10:
7893 if(type->__anon1.__anon1.enumName)
7894 {
7895 strcat(string, "union ");
7896 strcat(string, type->__anon1.__anon1.enumName);
7897 }
7898 else if(type->typeName)
7899 strcat(string, type->typeName);
7900 else
7901 {
7902 strcat(string, "union ");
7903 strcat(string, "(unnamed)");
7904 }
7905 break;
7906 case 15:
7907 if(type->__anon1.__anon1.enumName)
7908 {
7909 strcat(string, "enum ");
7910 strcat(string, type->__anon1.__anon1.enumName);
7911 }
7912 else if(type->typeName)
7913 strcat(string, type->typeName);
7914 else
7915 strcat(string, "int");
7916 break;
7917 case 14:
7918 strcat(string, "...");
7919 break;
7920 case 19:
7921 strcat(string, "subclass(");
7922 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
7923 strcat(string, ")");
7924 break;
7925 case 20:
7926 strcat(string, type->__anon1.templateParameter->identifier->string);
7927 break;
7928 case 21:
7929 strcat(string, "thisclass");
7930 break;
7931 case 17:
7932 strcat(string, "__builtin_va_list");
7933 break;
7934 }
7935 }
7936 }
7937
7938 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
7939
7940 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
7941
7942 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
7943
7944 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
7945
7946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
7947
7948 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
7949
7950 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
7951
7952 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
7953
7954 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
7955
7956 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
7957
7958 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
7959
7960 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
7961
7962 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
7963
7964 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
7965
7966 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
7967
7968 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
7969
7970 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
7971
7972 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
7973
7974 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
7975
7976 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
7977
7978 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
7979
7980 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
7981
7982 struct __ecereNameSpace__ecere__com__Application
7983 {
7984 int argc;
7985 const char * *  argv;
7986 int exitCode;
7987 unsigned int isGUIApp;
7988 struct __ecereNameSpace__ecere__sys__OldList allModules;
7989 char *  parsedCommand;
7990 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
7991 } ecere_gcc_struct;
7992
7993 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)
7994 {
7995 if(*curMember)
7996 {
7997 *curMember = (*curMember)->next;
7998 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
7999 {
8000 *curMember = subMemberStack[--(*subMemberStackPos)];
8001 *curMember = (*curMember)->next;
8002 }
8003 while((*curMember) && (*curMember)->isProperty)
8004 *curMember = (*curMember)->next;
8005 if(subMemberStackPos)
8006 {
8007 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8008 {
8009 subMemberStack[(*subMemberStackPos)++] = *curMember;
8010 *curMember = (*curMember)->members.first;
8011 while(*curMember && (*curMember)->isProperty)
8012 *curMember = (*curMember)->next;
8013 }
8014 }
8015 }
8016 while(!*curMember)
8017 {
8018 if(!*curMember)
8019 {
8020 if(subMemberStackPos && *subMemberStackPos)
8021 {
8022 *curMember = subMemberStack[--(*subMemberStackPos)];
8023 *curMember = (*curMember)->next;
8024 }
8025 else
8026 {
8027 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
8028
8029 if(*curClass == _class)
8030 break;
8031 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
8032 ;
8033 *curMember = (*curClass)->membersAndProperties.first;
8034 }
8035 while((*curMember) && (*curMember)->isProperty)
8036 *curMember = (*curMember)->next;
8037 if(subMemberStackPos)
8038 {
8039 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8040 {
8041 subMemberStack[(*subMemberStackPos)++] = *curMember;
8042 *curMember = (*curMember)->members.first;
8043 while(*curMember && (*curMember)->isProperty)
8044 *curMember = (*curMember)->next;
8045 }
8046 }
8047 }
8048 }
8049 }
8050
8051 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
8052 {
8053 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
8054 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
8055 struct __ecereNameSpace__ecere__com__NameSpace * child;
8056
8057 if(!data)
8058 {
8059 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)))
8060 {
8061 data = ScanGlobalData(child, name);
8062 if(data)
8063 break;
8064 }
8065 }
8066 return data;
8067 }
8068
8069 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
8070 {
8071 int nsLen = strlen(nameSpace);
8072 struct Symbol * symbol;
8073
8074 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)))
8075 {
8076 char * s = symbol->string;
8077
8078 if(!strncmp(s, nameSpace, nsLen))
8079 {
8080 int c;
8081 char * namePart;
8082
8083 for(c = strlen(s) - 1; c >= 0; c--)
8084 if(s[c] == ':')
8085 break;
8086 namePart = s + c + 1;
8087 if(!strcmp(namePart, name))
8088 {
8089 return symbol;
8090 }
8091 }
8092 else
8093 break;
8094 }
8095 return (((void *)0));
8096 }
8097
8098 unsigned int GetInt(struct Expression * exp, int * value2)
8099 {
8100 struct Operand op2 = GetOperand(exp);
8101
8102 return GetOpInt(&op2, value2);
8103 }
8104
8105 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
8106 {
8107 struct Operand op2 = GetOperand(exp);
8108
8109 return GetOpUInt(&op2, value2);
8110 }
8111
8112 unsigned int GetInt64(struct Expression * exp, long long * value2)
8113 {
8114 struct Operand op2 = GetOperand(exp);
8115
8116 return GetOpInt64(&op2, value2);
8117 }
8118
8119 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
8120 {
8121 struct Operand op2 = GetOperand(exp);
8122
8123 return GetOpUInt64(&op2, value2);
8124 }
8125
8126 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
8127 {
8128 struct Operand op2 = GetOperand(exp);
8129
8130 return GetOpIntPtr(&op2, value2);
8131 }
8132
8133 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
8134 {
8135 struct Operand op2 = GetOperand(exp);
8136
8137 return GetOpUIntPtr(&op2, value2);
8138 }
8139
8140 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
8141 {
8142 struct Operand op2 = GetOperand(exp);
8143
8144 return GetOpIntSize(&op2, value2);
8145 }
8146
8147 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
8148 {
8149 struct Operand op2 = GetOperand(exp);
8150
8151 return GetOpUIntSize(&op2, value2);
8152 }
8153
8154 unsigned int GetShort(struct Expression * exp, short * value2)
8155 {
8156 struct Operand op2 = GetOperand(exp);
8157
8158 return GetOpShort(&op2, value2);
8159 }
8160
8161 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
8162 {
8163 struct Operand op2 = GetOperand(exp);
8164
8165 return GetOpUShort(&op2, value2);
8166 }
8167
8168 unsigned int GetChar(struct Expression * exp, char * value2)
8169 {
8170 struct Operand op2 = GetOperand(exp);
8171
8172 return GetOpChar(&op2, value2);
8173 }
8174
8175 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
8176 {
8177 struct Operand op2 = GetOperand(exp);
8178
8179 return GetOpUChar(&op2, value2);
8180 }
8181
8182 unsigned int GetFloat(struct Expression * exp, float * value2)
8183 {
8184 struct Operand op2 = GetOperand(exp);
8185
8186 return GetOpFloat(&op2, value2);
8187 }
8188
8189 unsigned int GetDouble(struct Expression * exp, double * value2)
8190 {
8191 struct Operand op2 = GetOperand(exp);
8192
8193 return GetOpDouble(&op2, value2);
8194 }
8195
8196 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
8197 {
8198 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8199 {
8200 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
8201 PrintAttribs(type, string);
8202 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
8203 strcat(string, " const");
8204 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
8205 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8206 strcat(string, " (");
8207 if(type->kind == 13)
8208 {
8209 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
8210 PrintAttribs(type->__anon1.type, string);
8211 }
8212 if(type->kind == 13)
8213 {
8214 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
8215 strcat(string, "*");
8216 else
8217 strcat(string, " *");
8218 }
8219 if(printConst && type->constant && type->kind == 13)
8220 strcat(string, " const");
8221 }
8222 else
8223 PrintTypeSpecs(type, string, fullName, printConst);
8224 }
8225
8226 void PrintExpression(struct Expression * exp, char * string)
8227 {
8228 {
8229 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8230 int count;
8231 unsigned int backOutputLineNumbers = outputLineNumbers;
8232
8233 outputLineNumbers = 0;
8234 if(exp)
8235 OutputExpression(exp, f);
8236 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8237 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8238
8239 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8240 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
8241 count = strlen(string);
8242 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8243 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8244
8245 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8246 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
8247 string[count] = '\0';
8248 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
8249 outputLineNumbers = backOutputLineNumbers;
8250 }
8251 }
8252
8253 struct Type * Dereference(struct Type * source)
8254 {
8255 struct Type * type = (((void *)0));
8256
8257 if(source)
8258 {
8259 if(source->kind == 13 || source->kind == 12)
8260 {
8261 type = source->__anon1.type;
8262 source->__anon1.type->refCount++;
8263 }
8264 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
8265 {
8266 type = __extension__ ({
8267 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8268
8269 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
8270 });
8271 }
8272 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
8273 {
8274 type = source;
8275 source->refCount++;
8276 }
8277 else
8278 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
8279 }
8280 return type;
8281 }
8282
8283 static struct Type * Reference(struct Type * source)
8284 {
8285 struct Type * type = (((void *)0));
8286
8287 if(source)
8288 {
8289 type = __extension__ ({
8290 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8291
8292 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
8293 });
8294 source->refCount++;
8295 }
8296 return type;
8297 }
8298
8299 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
8300 {
8301 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
8302
8303 FreeExpContents(checkedExp);
8304 FreeType(checkedExp->expType);
8305 FreeType(checkedExp->destType);
8306 *checkedExp = *newExp;
8307 ((newExp ? __extension__ ({
8308 void * __ecerePtrToDelete = (newExp);
8309
8310 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
8311 }) : 0), newExp = 0);
8312 checkedExp->prev = prev;
8313 checkedExp->next = next;
8314 }
8315
8316 void FinishTemplatesContext(struct Context * context)
8317 {
8318 PopContext(context);
8319 FreeContext(context);
8320 ((context ? __extension__ ({
8321 void * __ecerePtrToDelete = (context);
8322
8323 __ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
8324 }) : 0), context = 0);
8325 }
8326
8327 static __attribute__((unused)) void UnusedFunction()
8328 {
8329 int a;
8330
8331 ((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);
8332 }
8333
8334 struct Expression * ParseExpressionString(char * expression)
8335 {
8336 parseError = 0;
8337 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8338 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8339 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8340
8341 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8342 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
8343 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8344 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8345
8346 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8347 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
8348 echoOn = 0;
8349 parsedExpression = (((void *)0));
8350 resetScanner();
8351 expression_yyparse();
8352 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
8353 return parsedExpression;
8354 }
8355
8356 struct __ecereNameSpace__ecere__com__Module
8357 {
8358 struct __ecereNameSpace__ecere__com__Instance * application;
8359 struct __ecereNameSpace__ecere__sys__OldList classes;
8360 struct __ecereNameSpace__ecere__sys__OldList defines;
8361 struct __ecereNameSpace__ecere__sys__OldList functions;
8362 struct __ecereNameSpace__ecere__sys__OldList modules;
8363 struct __ecereNameSpace__ecere__com__Instance * prev;
8364 struct __ecereNameSpace__ecere__com__Instance * next;
8365 const char *  name;
8366 void *  library;
8367 void *  Unload;
8368 int importType;
8369 int origImportType;
8370 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
8371 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
8372 } ecere_gcc_struct;
8373
8374 static struct GlobalData * FindGlobalData(char * name)
8375 {
8376 int start = 0, c;
8377 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
8378
8379 nameSpace = globalData;
8380 for(c = 0; name[c]; c++)
8381 {
8382 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
8383 {
8384 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
8385 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
8386
8387 strncpy(spaceName, name + start, c - start);
8388 spaceName[c - start] = '\0';
8389 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
8390 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
8391 if(!newSpace)
8392 return (((void *)0));
8393 nameSpace = newSpace;
8394 if(name[c] == ':')
8395 c++;
8396 start = c + 1;
8397 }
8398 }
8399 if(c - start)
8400 {
8401 return ScanGlobalData(nameSpace, name + start);
8402 }
8403 return (((void *)0));
8404 }
8405
8406 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
8407 {
8408 int c;
8409 char nameSpace[1024];
8410 const char * namePart;
8411 unsigned int gotColon = 0;
8412
8413 nameSpace[0] = '\0';
8414 for(c = strlen(name) - 1; c >= 0; c--)
8415 if(name[c] == ':')
8416 {
8417 gotColon = 1;
8418 break;
8419 }
8420 namePart = name + c + 1;
8421 while(c >= 0 && name[c] == ':')
8422 c--;
8423 if(c >= 0)
8424 {
8425 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
8426
8427 if(symbol)
8428 return symbol;
8429 memcpy(nameSpace, name, c + 1);
8430 nameSpace[c + 1] = 0;
8431 return ScanWithNameSpace(tree, nameSpace, namePart);
8432 }
8433 else if(gotColon)
8434 {
8435 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8436
8437 return symbol;
8438 }
8439 else
8440 {
8441 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8442
8443 if(symbol)
8444 return symbol;
8445 return ScanWithNameSpace(tree, "", namePart);
8446 }
8447 return (((void *)0));
8448 }
8449
8450 static void PrintArraySize(struct Type * arrayType, char * string)
8451 {
8452 char size[256];
8453
8454 size[0] = '\0';
8455 strcat(size, "[");
8456 if(arrayType->__anon1.__anon4.enumClass)
8457 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
8458 else if(arrayType->__anon1.__anon4.arraySizeExp)
8459 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
8460 strcat(size, "]");
8461 strcat(string, size);
8462 }
8463
8464 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
8465 {
8466
8467 }
8468
8469 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
8470 {
8471 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8472 strcat(string, ")");
8473 if(type->kind == 12)
8474 PrintArraySize(type, string);
8475 else if(type->kind == 11)
8476 {
8477 struct Type * param;
8478
8479 strcat(string, "(");
8480 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
8481 {
8482 PrintType(param, string, 1, fullName);
8483 if(param->next)
8484 strcat(string, ", ");
8485 }
8486 strcat(string, ")");
8487 }
8488 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8489 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
8490 }
8491
8492 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
8493 {
8494 PrePrintType(type, string, fullName, (((void *)0)), printConst);
8495 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
8496 strcat(string, " ");
8497 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
8498 {
8499 struct Symbol * _class = type->__anon1.__anon2.thisClass;
8500
8501 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
8502 {
8503 if(type->classObjectType == 1)
8504 strcat(string, "class");
8505 else
8506 strcat(string, type->byReference ? "typed_object&" : "typed_object");
8507 }
8508 else if(_class && _class->string)
8509 {
8510 char * s = _class->string;
8511
8512 if(fullName)
8513 strcat(string, s);
8514 else
8515 {
8516 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
8517
8518 if(name)
8519 name += 2;
8520 else
8521 name = s;
8522 strcat(string, name);
8523 }
8524 }
8525 strcat(string, "::");
8526 }
8527 if(printName && type->name)
8528 PrintName(type, string, fullName);
8529 PostPrintType(type, string, fullName);
8530 if(type->bitFieldCount)
8531 {
8532 char count[100];
8533
8534 sprintf(count, ":%d", type->bitFieldCount);
8535 strcat(string, count);
8536 }
8537 }
8538
8539 struct Conversion;
8540
8541 struct Conversion
8542 {
8543 struct Conversion * prev, * next;
8544 struct __ecereNameSpace__ecere__com__Property * convert;
8545 unsigned int isGet;
8546 struct Type * resultType;
8547 } ecere_gcc_struct;
8548
8549 static void FreeConvert(struct Conversion * convert)
8550 {
8551 if(convert->resultType)
8552 FreeType(convert->resultType);
8553 }
8554
8555 struct Enumerator;
8556
8557 struct Enumerator
8558 {
8559 struct Enumerator * prev;
8560 struct Enumerator * next;
8561 struct Location loc;
8562 struct Identifier * id;
8563 struct Expression * exp;
8564 } ecere_gcc_struct;
8565
8566 struct AsmField;
8567
8568 struct AsmField
8569 {
8570 struct AsmField * prev;
8571 struct AsmField * next;
8572 struct Location loc;
8573 char *  command;
8574 struct Expression * expression;
8575 struct Identifier * symbolic;
8576 } ecere_gcc_struct;
8577
8578 struct ClassDefinition;
8579
8580 struct Context
8581 {
8582 struct Context * parent;
8583 struct __ecereNameSpace__ecere__sys__BinaryTree types;
8584 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
8585 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
8586 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
8587 int nextID;
8588 int simpleID;
8589 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
8590 struct ClassDefinition * classDef;
8591 unsigned int templateTypesOnly;
8592 unsigned int hasNameSpace;
8593 } ecere_gcc_struct;
8594
8595 struct External
8596 {
8597 struct External * prev;
8598 struct External * next;
8599 struct Location loc;
8600 int type;
8601 struct Symbol * symbol;
8602 union
8603 {
8604 struct FunctionDefinition * function;
8605 struct ClassDefinition * _class;
8606 struct Declaration * declaration;
8607 char *  importString;
8608 struct Identifier * id;
8609 struct DBTableDef * table;
8610 } ecere_gcc_struct __anon1;
8611 int importType;
8612 struct External * fwdDecl;
8613 struct __ecereNameSpace__ecere__com__Instance * outgoing;
8614 struct __ecereNameSpace__ecere__com__Instance * incoming;
8615 int nonBreakableIncoming;
8616 } ecere_gcc_struct;
8617
8618 struct ClassDefinition
8619 {
8620 struct ClassDefinition * prev;
8621 struct ClassDefinition * next;
8622 struct Location loc;
8623 struct Specifier * _class;
8624 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
8625 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
8626 struct Symbol * symbol;
8627 struct Location blockStart;
8628 struct Location nameLoc;
8629 int declMode;
8630 unsigned int deleteWatchable;
8631 } ecere_gcc_struct;
8632
8633 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
8634
8635 void __ecereMethod_External_CreateEdge(struct External * this, struct External * from, unsigned int soft);
8636
8637 void DeclareGlobalData(struct External * neededFor, struct GlobalData * data)
8638 {
8639 struct Symbol * symbol = data->symbol;
8640
8641 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
8642 {
8643 if(inCompiler)
8644 {
8645 if(!symbol)
8646 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
8647 }
8648 if(!data->dataType)
8649 data->dataType = ProcessTypeString(data->dataTypeString, 0);
8650 if(inCompiler)
8651 {
8652 struct Declaration * decl;
8653 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
8654 struct Declarator * d;
8655 struct External * external;
8656
8657 specifiers = MkList();
8658 declarators = MkList();
8659 ListAdd(specifiers, MkSpecifier(EXTERN));
8660 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
8661 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
8662 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
8663 decl = MkDeclaration(specifiers, declarators);
8664 external = MkExternalDeclaration(decl);
8665 if(curExternal)
8666 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
8667 external->symbol = symbol;
8668 symbol->__anon2.__anon1.pointerExternal = external;
8669 DeclareType(external, data->dataType, 1, 1);
8670 }
8671 }
8672 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
8673 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, 0);
8674 }
8675
8676 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
8677 {
8678 struct Context * ctx;
8679 struct Symbol * symbol = (((void *)0));
8680
8681 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
8682 {
8683 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
8684 {
8685 symbol = (((void *)0));
8686 if(thisNameSpace)
8687 {
8688 char curName[1024];
8689
8690 strcpy(curName, thisNameSpace);
8691 strcat(curName, "::");
8692 strcat(curName, name);
8693 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
8694 }
8695 if(!symbol)
8696 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
8697 }
8698 else
8699 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
8700 if(symbol || ctx == endContext)
8701 break;
8702 }
8703 if(inCompiler && symbol && ctx == globalContext && symbol->__anon2.__anon1.pointerExternal && curExternal && symbol->__anon2.__anon1.pointerExternal != curExternal)
8704 __ecereMethod_External_CreateUniqueEdge(curExternal, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
8705 return symbol;
8706 }
8707
8708 struct PropertyDef;
8709
8710 struct ClassDef
8711 {
8712 struct ClassDef * prev;
8713 struct ClassDef * next;
8714 struct Location loc;
8715 int type;
8716 union
8717 {
8718 struct Declaration * decl;
8719 struct ClassFunction * function;
8720 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
8721 struct PropertyDef * propertyDef;
8722 struct PropertyWatch * propertyWatch;
8723 char *  designer;
8724 struct Identifier * defaultProperty;
8725 struct
8726 {
8727 struct Identifier * id;
8728 struct Initializer * initializer;
8729 } ecere_gcc_struct __anon1;
8730 } ecere_gcc_struct __anon1;
8731 int memberAccess;
8732 void *  object;
8733 } ecere_gcc_struct;
8734
8735 struct PropertyDef
8736 {
8737 struct PropertyDef * prev;
8738 struct PropertyDef * next;
8739 struct Location loc;
8740 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
8741 struct Declarator * declarator;
8742 struct Identifier * id;
8743 struct Statement * getStmt;
8744 struct Statement * setStmt;
8745 struct Statement * issetStmt;
8746 struct Symbol * symbol;
8747 struct Expression * category;
8748 struct
8749 {
8750 unsigned int conversion : 1;
8751 unsigned int isWatchable : 1;
8752 unsigned int isDBProp : 1;
8753 } ecere_gcc_struct __anon1;
8754 } ecere_gcc_struct;
8755
8756 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
8757 {
8758 struct ClassDef * def;
8759 int anonID = 1;
8760
8761 for(def = (*definitions).first; def; def = def->next)
8762 {
8763 if(def->type == 2)
8764 {
8765 struct Declaration * decl = def->__anon1.decl;
8766
8767 if(decl && decl->__anon1.__anon1.specifiers)
8768 {
8769 struct Specifier * spec;
8770 unsigned int isStruct = 0;
8771
8772 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
8773 {
8774 if(spec->type == 3 || spec->type == 4)
8775 {
8776 if(spec->__anon1.__anon2.definitions)
8777 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
8778 isStruct = 1;
8779 }
8780 }
8781 if(isStruct)
8782 {
8783 struct Declarator * d = (((void *)0));
8784
8785 if(decl->__anon1.__anon1.declarators)
8786 {
8787 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
8788 {
8789 struct Identifier * idDecl = GetDeclId(d);
8790
8791 if(idDecl)
8792 break;
8793 }
8794 }
8795 if(!d)
8796 {
8797 char id[100];
8798
8799 sprintf(id, "__anon%d", anonID++);
8800 if(!decl->__anon1.__anon1.declarators)
8801 decl->__anon1.__anon1.declarators = MkList();
8802 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
8803 }
8804 }
8805 }
8806 }
8807 }
8808 }
8809
8810 struct MemberInit;
8811
8812 typedef union YYSTYPE
8813 {
8814 int specifierType;
8815 int i;
8816 int declMode;
8817 struct Identifier * id;
8818 struct Expression * exp;
8819 struct Specifier * specifier;
8820 struct __ecereNameSpace__ecere__sys__OldList * list;
8821 struct Enumerator * enumerator;
8822 struct Declarator * declarator;
8823 struct Pointer * pointer;
8824 struct Initializer * initializer;
8825 struct InitDeclarator * initDeclarator;
8826 struct TypeName * typeName;
8827 struct Declaration * declaration;
8828 struct Statement * stmt;
8829 struct FunctionDefinition * function;
8830 struct External * external;
8831 struct Context * context;
8832 struct AsmField * asmField;
8833 struct Attrib * attrib;
8834 struct ExtDecl * extDecl;
8835 struct Attribute * attribute;
8836 struct Instantiation * instance;
8837 struct MembersInit * membersInit;
8838 struct MemberInit * memberInit;
8839 struct ClassFunction * classFunction;
8840 struct ClassDefinition * _class;
8841 struct ClassDef * classDef;
8842 struct PropertyDef * prop;
8843 char * string;
8844 struct Symbol * symbol;
8845 struct PropertyWatch * propertyWatch;
8846 struct TemplateParameter * templateParameter;
8847 struct TemplateArgument * templateArgument;
8848 struct TemplateDatatype * templateDatatype;
8849 struct DBTableEntry * dbtableEntry;
8850 struct DBIndexItem * dbindexItem;
8851 struct DBTableDef * dbtableDef;
8852 } ecere_gcc_struct YYSTYPE;
8853
8854 extern YYSTYPE yylval;
8855
8856 struct MemberInit
8857 {
8858 struct MemberInit * prev;
8859 struct MemberInit * next;
8860 struct Location loc;
8861 struct Location realLoc;
8862 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
8863 struct Initializer * initializer;
8864 unsigned int used;
8865 unsigned int variable;
8866 unsigned int takeOutExp;
8867 } ecere_gcc_struct;
8868
8869 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
8870
8871 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
8872
8873 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
8874 {
8875 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
8876 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
8877 const char *  name;
8878 int type;
8879 union
8880 {
8881 const char *  dataTypeString;
8882 int memberType;
8883 } ecere_gcc_struct __anon1;
8884 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
8885 void *  param;
8886 } ecere_gcc_struct;
8887
8888 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
8889 {
8890 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
8891 int id = 0;
8892 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
8893 struct __ecereNameSpace__ecere__com__Class * sClass;
8894
8895 for(sClass = _class; sClass; sClass = sClass->base)
8896 {
8897 id = 0;
8898 if(sClass->templateClass)
8899 sClass = sClass->templateClass;
8900 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
8901 {
8902 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
8903 {
8904 for(sClass = sClass->base; sClass; sClass = sClass->base)
8905 {
8906 if(sClass->templateClass)
8907 sClass = sClass->templateClass;
8908 id += sClass->templateParams.count;
8909 }
8910 break;
8911 }
8912 id++;
8913 }
8914 if(curParam)
8915 break;
8916 }
8917 if(curParam)
8918 {
8919 arg = &_class->templateArgs[id];
8920 if(arg && param->type == 0)
8921 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
8922 }
8923 return arg;
8924 }
8925
8926 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
8927 {
8928 struct Context * context = PushContext();
8929
8930 context->templateTypesOnly = 1;
8931 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
8932 {
8933 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
8934
8935 for(; param; param = param->next)
8936 {
8937 if(param->type == 0 && param->identifier)
8938 {
8939 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
8940
8941 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8942 }
8943 }
8944 }
8945 else if(_class)
8946 {
8947 struct __ecereNameSpace__ecere__com__Class * sClass;
8948
8949 for(sClass = _class; sClass; sClass = sClass->base)
8950 {
8951 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
8952
8953 for(p = sClass->templateParams.first; p; p = p->next)
8954 {
8955 if(p->type == 0)
8956 {
8957 struct TemplateParameter * param = p->param;
8958 struct TemplatedType * type;
8959
8960 if(!param)
8961 {
8962 p->param = param = __extension__ ({
8963 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
8964
8965 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
8966 });
8967 }
8968 type = __extension__ ({
8969 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
8970
8971 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
8972 });
8973 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8974 }
8975 }
8976 }
8977 }
8978 return context;
8979 }
8980
8981 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
8982 {
8983 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8984 {
8985 unsigned int first = 1;
8986 int p = 0;
8987 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8988 int lastParam = -1;
8989 char className[1024];
8990
8991 strcpy(className, _class->fullName);
8992 for(param = _class->templateParams.first; param; param = param->next)
8993 {
8994 {
8995 if(first)
8996 strcat(className, "<");
8997 if(!first)
8998 strcat(className, ", ");
8999 if(lastParam + 1 != p)
9000 {
9001 strcat(className, param->name);
9002 strcat(className, " = ");
9003 }
9004 strcat(className, param->name);
9005 first = 0;
9006 lastParam = p;
9007 }
9008 p++;
9009 }
9010 if(!first)
9011 {
9012 int len = strlen(className);
9013
9014 if(className[len - 1] == '>')
9015 className[len++] = ' ';
9016 className[len++] = '>';
9017 className[len++] = '\0';
9018 }
9019 return __ecereNameSpace__ecere__sys__CopyString(className);
9020 }
9021 else
9022 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
9023 }
9024
9025 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
9026 {
9027 struct Type * type;
9028
9029 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
9030 {
9031 unsigned int first = 1;
9032 int p = 0;
9033 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9034 int lastParam = -1;
9035 char className[1024];
9036
9037 strcpy(className, _class->fullName);
9038 for(param = _class->templateParams.first; param; param = param->next)
9039 {
9040 {
9041 if(first)
9042 strcat(className, "<");
9043 if(!first)
9044 strcat(className, ", ");
9045 if(lastParam + 1 != p)
9046 {
9047 strcat(className, param->name);
9048 strcat(className, " = ");
9049 }
9050 strcat(className, param->name);
9051 first = 0;
9052 lastParam = p;
9053 }
9054 p++;
9055 }
9056 if(!first)
9057 {
9058 int len = strlen(className);
9059
9060 if(className[len - 1] == '>')
9061 className[len++] = ' ';
9062 className[len++] = '>';
9063 className[len++] = '\0';
9064 }
9065 type = MkClassType(className);
9066 }
9067 else
9068 {
9069 type = MkClassType(_class->fullName);
9070 }
9071 return type;
9072 }
9073
9074 static int DeclareMembers(struct External * neededBy, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9075 {
9076 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9077 struct __ecereNameSpace__ecere__com__DataMember * member;
9078 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9079
9080 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
9081 DeclareMembers(neededBy, _class->base, 0);
9082 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
9083 {
9084 if(!member->isProperty)
9085 {
9086 switch(member->type)
9087 {
9088 case 0:
9089 {
9090 if(!member->dataType && member->dataTypeString)
9091 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9092 if(member->dataType)
9093 DeclareType(neededBy, member->dataType, 1, 0);
9094 break;
9095 }
9096 case 1:
9097 case 2:
9098 {
9099 DeclareMembers(neededBy, (struct __ecereNameSpace__ecere__com__Class *)member, 1);
9100 break;
9101 }
9102 }
9103 }
9104 }
9105 if(context)
9106 FinishTemplatesContext(context);
9107 return topMember ? topMember->memberID : _class->memberID;
9108 }
9109
9110 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
9111 {
9112 if(!method->dataType)
9113 {
9114 struct Context * context = SetupTemplatesContext(method->_class);
9115
9116 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9117 FinishTemplatesContext(context);
9118 if(method->type != 1 && method->dataType)
9119 {
9120 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
9121 {
9122 if(!method->_class->symbol)
9123 method->_class->symbol = FindClass(method->_class->fullName);
9124 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
9125 }
9126 }
9127 }
9128 }
9129
9130 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
9131 {
9132 if(!prop->dataType)
9133 {
9134 struct Context * context = SetupTemplatesContext(prop->_class);
9135
9136 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
9137 FinishTemplatesContext(context);
9138 }
9139 }
9140
9141 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
9142 {
9143 if(specs != (((void *)0)) && _class)
9144 {
9145 struct Specifier * spec;
9146
9147 for(spec = specs->first; spec; spec = spec->next)
9148 {
9149 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
9150 {
9151 spec->type = 1;
9152 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
9153 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
9154 }
9155 }
9156 }
9157 }
9158
9159 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
9160 {
9161 struct Identifier * id = exp->__anon1.__anon1.identifier;
9162 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9163 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9164 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9165 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9166
9167 if(_class && _class->type == 4)
9168 {
9169 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
9170 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9171
9172 if(enumClass)
9173 {
9174 struct __ecereNameSpace__ecere__com__Class * baseClass;
9175
9176 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
9177 {
9178 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
9179
9180 for(value = e->values.first; value; value = value->next)
9181 {
9182 if(!strcmp(value->name, id->string))
9183 break;
9184 }
9185 if(value)
9186 {
9187 exp->isConstant = 1;
9188 if(inCompiler || inPreCompiler || inDebugger)
9189 {
9190 char constant[256];
9191
9192 FreeExpContents(exp);
9193 exp->type = 2;
9194 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
9195 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
9196 else
9197 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
9198 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9199 }
9200 exp->expType = MkClassType(baseClass->fullName);
9201 break;
9202 }
9203 }
9204 }
9205 if(value)
9206 return 1;
9207 }
9208 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
9209 {
9210 ProcessMethodType(method);
9211 exp->expType = __extension__ ({
9212 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
9213
9214 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
9215 });
9216 return 1;
9217 }
9218 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
9219 {
9220 if(!prop->dataType)
9221 ProcessPropertyType(prop);
9222 exp->expType = prop->dataType;
9223 if(prop->dataType)
9224 prop->dataType->refCount++;
9225 return 1;
9226 }
9227 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
9228 {
9229 if(!member->dataType)
9230 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9231 exp->expType = member->dataType;
9232 if(member->dataType)
9233 member->dataType->refCount++;
9234 return 1;
9235 }
9236 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
9237 {
9238 if(!classProp->dataType)
9239 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
9240 if(classProp->constant)
9241 {
9242 FreeExpContents(exp);
9243 exp->isConstant = 1;
9244 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
9245 {
9246 exp->type = 3;
9247 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
9248 }
9249 else
9250 {
9251 char constant[256];
9252
9253 exp->type = 2;
9254 sprintf(constant, "%d", (int)classProp->Get(_class));
9255 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9256 }
9257 }
9258 else
9259 {
9260 }
9261 exp->expType = classProp->dataType;
9262 if(classProp->dataType)
9263 classProp->dataType->refCount++;
9264 return 1;
9265 }
9266 return 0;
9267 }
9268
9269 void DeclareProperty(struct External * neededBy, struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
9270 {
9271 struct Symbol * symbol = prop->symbol;
9272 unsigned int imported = 0;
9273 unsigned int dllImport = 0;
9274 struct External * structExternal = (((void *)0));
9275 struct External * instExternal = (((void *)0));
9276
9277 strcpy(setName, "__ecereProp_");
9278 FullClassNameCat(setName, prop->_class->fullName, 0);
9279 strcat(setName, "_Set_");
9280 FullClassNameCat(setName, prop->name, 1);
9281 strcpy(getName, "__ecereProp_");
9282 FullClassNameCat(getName, prop->_class->fullName, 0);
9283 strcat(getName, "_Get_");
9284 FullClassNameCat(getName, prop->name, 1);
9285 if(!symbol || symbol->_import)
9286 {
9287 if(!symbol)
9288 {
9289 struct Symbol * classSym;
9290
9291 if(!prop->_class->symbol)
9292 prop->_class->symbol = FindClass(prop->_class->fullName);
9293 classSym = prop->_class->symbol;
9294 if(classSym && !classSym->_import)
9295 {
9296 struct ModuleImport * module;
9297
9298 if(prop->_class->module)
9299 module = FindModule(prop->_class->module);
9300 else
9301 module = mainModule;
9302 classSym->_import = __extension__ ({
9303 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9304
9305 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
9306 });
9307 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9308 }
9309 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9310 symbol->_import = (struct ClassImport *)__extension__ ({
9311 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
9312
9313 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
9314 });
9315 if(classSym)
9316 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
9317 }
9318 imported = 1;
9319 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)
9320 dllImport = 1;
9321 }
9322 if(!symbol->type)
9323 {
9324 struct Context * context = SetupTemplatesContext(prop->_class);
9325
9326 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
9327 FinishTemplatesContext(context);
9328 }
9329 if((prop->Get && !symbol->__anon2.__anon2.externalGet) || (prop->Set && !symbol->__anon2.__anon2.externalSet))
9330 {
9331 if(prop->_class->type == 0 && prop->_class->structSize)
9332 instExternal = DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
9333 structExternal = DeclareStruct((((void *)0)), prop->_class->fullName, prop->_class->type != 1, 0);
9334 }
9335 if(prop->Get && !symbol->__anon2.__anon2.externalGet)
9336 {
9337 struct Declaration * decl;
9338 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9339 struct Declarator * d;
9340 struct __ecereNameSpace__ecere__sys__OldList * params;
9341 struct Specifier * spec = (((void *)0));
9342 struct External * external;
9343 struct Declarator * typeDecl;
9344 unsigned int simple = 0;
9345 unsigned int needReference;
9346
9347 specifiers = MkList();
9348 declarators = MkList();
9349 params = MkList();
9350 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9351 d = MkDeclaratorIdentifier(MkIdentifier(getName));
9352 if(dllImport)
9353 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9354 {
9355 struct Context * context = SetupTemplatesContext(prop->_class);
9356
9357 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
9358 FinishTemplatesContext(context);
9359 }
9360 needReference = !typeDecl || typeDecl->type == 1;
9361 for(spec = (*specifiers).first; spec; spec = spec->next)
9362 {
9363 if(spec->type == 1)
9364 {
9365 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9366
9367 if(needReference)
9368 {
9369 symbol->_class = classSym->__anon1.registered;
9370 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
9371 simple = 1;
9372 }
9373 break;
9374 }
9375 }
9376 if(!simple)
9377 d = PlugDeclarator(typeDecl, d);
9378 else
9379 {
9380 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
9381 specifiers = MkList();
9382 }
9383 d = MkDeclaratorFunction(d, params);
9384 if(dllImport)
9385 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9386 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9387 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9388 if(simple)
9389 ListAdd(specifiers, MkSpecifier(VOID));
9390 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9391 decl = MkDeclaration(specifiers, declarators);
9392 external = MkExternalDeclaration(decl);
9393 if(structExternal)
9394 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9395 if(instExternal)
9396 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9397 if(spec)
9398 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9399 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9400 external->symbol = symbol;
9401 symbol->__anon2.__anon2.externalGet = external;
9402 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9403 if(typeDecl)
9404 FreeDeclarator(typeDecl);
9405 }
9406 if(prop->Set && !symbol->__anon2.__anon2.externalSet)
9407 {
9408 struct Declaration * decl;
9409 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9410 struct Declarator * d;
9411 struct __ecereNameSpace__ecere__sys__OldList * params;
9412 struct Specifier * spec = (((void *)0));
9413 struct External * external;
9414 struct Declarator * typeDecl;
9415 unsigned int needReference;
9416
9417 declarators = MkList();
9418 params = MkList();
9419 if(!prop->conversion || prop->_class->type == 1)
9420 {
9421 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9422 }
9423 specifiers = MkList();
9424 {
9425 struct Context * context = SetupTemplatesContext(prop->_class);
9426
9427 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
9428 FinishTemplatesContext(context);
9429 }
9430 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
9431 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
9432 ListAdd(params, MkTypeName(specifiers, d));
9433 d = MkDeclaratorIdentifier(MkIdentifier(setName));
9434 if(dllImport)
9435 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9436 d = MkDeclaratorFunction(d, params);
9437 needReference = !typeDecl || typeDecl->type == 1;
9438 for(spec = (*specifiers).first; spec; spec = spec->next)
9439 {
9440 if(spec->type == 1)
9441 {
9442 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9443
9444 if(needReference)
9445 symbol->_class = classSym->__anon1.registered;
9446 break;
9447 }
9448 }
9449 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9450 specifiers = MkList();
9451 if(dllImport)
9452 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9453 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9454 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9455 if(!prop->conversion || prop->_class->type == 1)
9456 ListAdd(specifiers, MkSpecifier(VOID));
9457 else
9458 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
9459 decl = MkDeclaration(specifiers, declarators);
9460 external = MkExternalDeclaration(decl);
9461 if(structExternal)
9462 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9463 if(instExternal)
9464 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9465 if(spec)
9466 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9467 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9468 external->symbol = symbol;
9469 symbol->__anon2.__anon2.externalSet = external;
9470 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9471 }
9472 if(!symbol->__anon2.__anon2.externalPtr)
9473 {
9474 struct Declaration * decl;
9475 struct External * external;
9476 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
9477 char propName[1024];
9478
9479 if(imported)
9480 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9481 else
9482 {
9483 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9484 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
9485 }
9486 ListAdd(specifiers, MkSpecifierName("Property"));
9487 strcpy(propName, "__ecereProp_");
9488 FullClassNameCat(propName, prop->_class->fullName, 0);
9489 strcat(propName, "_");
9490 FullClassNameCat(propName, prop->name, 1);
9491 {
9492 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
9493
9494 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9495 if(!imported)
9496 {
9497 strcpy(propName, "__ecerePropM_");
9498 FullClassNameCat(propName, prop->_class->fullName, 0);
9499 strcat(propName, "_");
9500 FullClassNameCat(propName, prop->name, 1);
9501 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9502 }
9503 decl = MkDeclaration(specifiers, list);
9504 }
9505 external = MkExternalDeclaration(decl);
9506 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
9507 external->symbol = symbol;
9508 symbol->__anon2.__anon2.externalPtr = external;
9509 }
9510 if(inCompiler && neededBy)
9511 {
9512 if(symbol->__anon2.__anon2.externalPtr)
9513 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalPtr, 0);
9514 if(symbol->__anon2.__anon2.externalGet)
9515 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalGet, symbol->__anon2.__anon2.externalGet->type == 0);
9516 if(symbol->__anon2.__anon2.externalSet)
9517 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalSet, symbol->__anon2.__anon2.externalSet->type == 0);
9518 }
9519 }
9520
9521 static void ProcessDeclarator(struct Declarator *  decl, unsigned int isFunction);
9522
9523 void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char * name)
9524 {
9525 struct Symbol * symbol = method->symbol;
9526
9527 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && (!symbol->__anon2.__anon3.methodCodeExternal || method->type == 1)))
9528 {
9529 unsigned int dllImport = 0;
9530
9531 if(!method->dataType)
9532 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9533 {
9534 if(!symbol || method->type == 1)
9535 {
9536 struct Symbol * classSym;
9537
9538 if(!method->_class->symbol)
9539 method->_class->symbol = FindClass(method->_class->fullName);
9540 classSym = method->_class->symbol;
9541 if(!classSym->_import)
9542 {
9543 struct ModuleImport * module;
9544
9545 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->name)
9546 module = FindModule(method->_class->module);
9547 else
9548 module = mainModule;
9549 classSym->_import = __extension__ ({
9550 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9551
9552 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
9553 });
9554 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9555 }
9556 if(!symbol)
9557 {
9558 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9559 }
9560 if(!symbol->_import)
9561 {
9562 symbol->_import = (struct ClassImport *)__extension__ ({
9563 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
9564
9565 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
9566 });
9567 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
9568 }
9569 if(!symbol)
9570 {
9571 symbol->type = method->dataType;
9572 if(symbol->type)
9573 symbol->type->refCount++;
9574 }
9575 }
9576 if(!method->dataType->dllExport)
9577 {
9578 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)
9579 dllImport = 1;
9580 }
9581 }
9582 if(inCompiler)
9583 {
9584 struct Declaration * decl;
9585 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9586 struct Declarator * d;
9587 struct Declarator * funcDecl;
9588 struct External * external;
9589
9590 specifiers = MkList();
9591 declarators = MkList();
9592 if(dllImport)
9593 ListAdd(specifiers, MkSpecifier(EXTERN));
9594 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
9595 ListAdd(specifiers, MkSpecifier(STATIC));
9596 if(method->type == 1)
9597 {
9598 ListAdd(specifiers, MkSpecifier(INT));
9599 d = MkDeclaratorIdentifier(MkIdentifier(name));
9600 }
9601 else
9602 {
9603 d = MkDeclaratorIdentifier(MkIdentifier(name));
9604 if(dllImport)
9605 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9606 {
9607 struct Context * context = SetupTemplatesContext(method->_class);
9608
9609 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
9610 FinishTemplatesContext(context);
9611 }
9612 funcDecl = GetFuncDecl(d);
9613 if(dllImport)
9614 {
9615 struct Specifier * spec, * next;
9616
9617 for(spec = (*specifiers).first; spec; spec = next)
9618 {
9619 next = spec->next;
9620 if(spec->type == 5)
9621 {
9622 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9623 FreeSpecifier(spec);
9624 }
9625 }
9626 }
9627 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
9628 {
9629 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
9630 {
9631 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
9632 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")));
9633 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
9634 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
9635
9636 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
9637 {
9638 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
9639
9640 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
9641 FreeTypeName(param);
9642 }
9643 if(!funcDecl->__anon1.function.parameters)
9644 funcDecl->__anon1.function.parameters = MkList();
9645 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
9646 }
9647 }
9648 }
9649 ProcessDeclarator(d, 1);
9650 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9651 decl = MkDeclaration(specifiers, declarators);
9652 ReplaceThisClassSpecifiers(specifiers, method->_class);
9653 external = MkExternalDeclaration(decl);
9654 external->symbol = symbol;
9655 symbol->__anon2.__anon1.pointerExternal = external;
9656 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9657 DeclareStruct(external, method->_class->fullName, 1, 1);
9658 if(method->dataType)
9659 DeclareType(external, method->dataType, 1, 1);
9660 }
9661 }
9662 if(inCompiler && neededFor)
9663 {
9664 struct External * external = symbol->__anon2.__anon1.pointerExternal ? symbol->__anon2.__anon1.pointerExternal : symbol->__anon2.__anon3.methodCodeExternal;
9665
9666 __ecereMethod_External_CreateUniqueEdge(neededFor, external, external->type == 0);
9667 }
9668 }
9669
9670 struct __ecereNameSpace__ecere__com__GlobalFunction;
9671
9672 struct __ecereNameSpace__ecere__com__GlobalFunction
9673 {
9674 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
9675 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
9676 const char *  name;
9677 int (*  function)();
9678 struct __ecereNameSpace__ecere__com__Instance * module;
9679 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
9680 const char *  dataTypeString;
9681 struct Type * dataType;
9682 void *  symbol;
9683 } ecere_gcc_struct;
9684
9685 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
9686
9687 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);
9688
9689 unsigned int DeclareFunction(struct External * neededFor, struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
9690 {
9691 struct Symbol * symbol = function->symbol;
9692
9693 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
9694 {
9695 unsigned int imported = 0;
9696 unsigned int dllImport = 0;
9697
9698 if(!function->dataType)
9699 {
9700 function->dataType = ProcessTypeString(function->dataTypeString, 0);
9701 if(!function->dataType->__anon1.__anon2.thisClass)
9702 function->dataType->__anon1.__anon2.staticMethod = 1;
9703 }
9704 if(inCompiler)
9705 {
9706 if(!symbol)
9707 {
9708 struct ModuleImport * module = FindModule(function->module);
9709
9710 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9711 if(module->name)
9712 {
9713 if(!function->dataType->dllExport)
9714 {
9715 symbol->_import = (struct ClassImport *)__extension__ ({
9716 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
9717
9718 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
9719 });
9720 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
9721 }
9722 }
9723 {
9724 symbol->type = ProcessTypeString(function->dataTypeString, 0);
9725 if(!symbol->type->__anon1.__anon2.thisClass)
9726 symbol->type->__anon1.__anon2.staticMethod = 1;
9727 }
9728 }
9729 imported = symbol->_import ? 1 : 0;
9730 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9731 dllImport = 1;
9732 }
9733 if(inCompiler)
9734 {
9735 {
9736 struct Declaration * decl;
9737 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9738 struct Declarator * d;
9739 struct Declarator * funcDecl;
9740 struct External * external;
9741
9742 specifiers = MkList();
9743 declarators = MkList();
9744 ListAdd(specifiers, MkSpecifier(EXTERN));
9745 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
9746 if(dllImport)
9747 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9748 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
9749 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType == 1)
9750 {
9751 struct Specifier * spec;
9752
9753 for(spec = (*specifiers).first; spec; spec = spec->next)
9754 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
9755 {
9756 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9757 FreeSpecifier(spec);
9758 break;
9759 }
9760 }
9761 funcDecl = GetFuncDecl(d);
9762 if(funcDecl && !funcDecl->__anon1.function.parameters)
9763 {
9764 funcDecl->__anon1.function.parameters = MkList();
9765 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
9766 }
9767 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9768 {
9769 struct Context * oldCtx = curContext;
9770
9771 curContext = globalContext;
9772 decl = MkDeclaration(specifiers, declarators);
9773 curContext = oldCtx;
9774 }
9775 external = MkExternalDeclaration(decl);
9776 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9777 external->symbol = symbol;
9778 symbol->__anon2.__anon1.pointerExternal = external;
9779 DeclareType(external, function->dataType, 1, 1);
9780 }
9781 }
9782 }
9783 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
9784 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
9785 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;
9786 }
9787
9788 void DeclareFunctionUtil(struct External * neededBy, const char * s)
9789 {
9790 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
9791
9792 if(function)
9793 {
9794 char name[1024];
9795
9796 name[0] = 0;
9797 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
9798 strcpy(name, "__ecereFunction_");
9799 FullClassNameCat(name, s, 0);
9800 DeclareFunction(neededBy, function, name);
9801 }
9802 else if(neededBy)
9803 FindSymbol(s, globalContext, globalContext, 0, 0);
9804 }
9805
9806 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
9807 {
9808 char propName[1024], propNameM[1024];
9809 char getName[1024], setName[1024];
9810 struct __ecereNameSpace__ecere__sys__OldList * args;
9811
9812 DeclareProperty(curExternal, prop, setName, getName);
9813 strcpy(propName, "__ecereProp_");
9814 FullClassNameCat(propName, prop->_class->fullName, 0);
9815 strcat(propName, "_");
9816 FullClassNameCat(propName, prop->name, 1);
9817 strcpy(propNameM, "__ecerePropM_");
9818 FullClassNameCat(propNameM, prop->_class->fullName, 0);
9819 strcat(propNameM, "_");
9820 FullClassNameCat(propNameM, prop->name, 1);
9821 if(prop->isWatchable)
9822 {
9823 args = MkList();
9824 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9825 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9826 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9827 args = MkList();
9828 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9829 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9830 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9831 DeclareFunctionUtil(curExternal, "eInstance_FireWatchers");
9832 }
9833 {
9834 args = MkList();
9835 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9836 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9837 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9838 args = MkList();
9839 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9840 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9841 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9842 DeclareFunctionUtil(curExternal, "eInstance_FireSelfWatchers");
9843 }
9844 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
9845 curFunction->propSet->fireWatchersDone = 1;
9846 }
9847
9848 struct __ecereNameSpace__ecere__com__SubModule;
9849
9850 struct __ecereNameSpace__ecere__com__SubModule
9851 {
9852 struct __ecereNameSpace__ecere__com__SubModule * prev;
9853 struct __ecereNameSpace__ecere__com__SubModule * next;
9854 struct __ecereNameSpace__ecere__com__Instance * module;
9855 int importMode;
9856 } ecere_gcc_struct;
9857
9858 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
9859 {
9860 struct __ecereNameSpace__ecere__com__SubModule * subModule;
9861
9862 if(searchFor == searchIn)
9863 return 1;
9864 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
9865 {
9866 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
9867 {
9868 if(ModuleVisibility(subModule->module, searchFor))
9869 return 1;
9870 }
9871 }
9872 return 0;
9873 }
9874
9875 void ProcessExpressionType(struct Expression *  exp);
9876
9877 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
9878 {
9879 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
9880 {
9881 struct Identifier * id = exp->__anon1.__anon1.identifier;
9882 struct Context * ctx;
9883 struct Symbol * symbol = (((void *)0));
9884
9885 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
9886 {
9887 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
9888 {
9889 if(!ctx)
9890 break;
9891 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
9892 if(symbol)
9893 break;
9894 }
9895 }
9896 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))))
9897 {
9898 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
9899 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9900 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9901 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9902
9903 if(!prop)
9904 {
9905 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
9906 }
9907 if(!prop && !method)
9908 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
9909 if(!prop && !method && !member)
9910 {
9911 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
9912 }
9913 if(prop || method || member || classProp)
9914 {
9915 exp->type = 8;
9916 exp->__anon1.member.member = id;
9917 exp->__anon1.member.memberType = 0;
9918 exp->__anon1.member.exp = QMkExpId("this");
9919 exp->addedThis = 1;
9920 }
9921 else if(_class && _class->templateParams.first)
9922 {
9923 struct __ecereNameSpace__ecere__com__Class * sClass;
9924
9925 for(sClass = _class; sClass; sClass = sClass->base)
9926 {
9927 if(sClass->templateParams.first)
9928 {
9929 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9930
9931 for(param = sClass->templateParams.first; param; param = param->next)
9932 {
9933 if(param->type == 2 && !strcmp(param->name, id->string))
9934 {
9935 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
9936
9937 if(argExp)
9938 {
9939 struct Declarator * decl;
9940 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
9941
9942 FreeIdentifier(exp->__anon1.member.member);
9943 ProcessExpressionType(argExp);
9944 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
9945 exp->expType = ProcessType(specs, decl);
9946 exp->type = 5;
9947 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
9948 }
9949 }
9950 }
9951 }
9952 }
9953 }
9954 }
9955 }
9956 }
9957
9958 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9959 {
9960 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9961
9962 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9963 {
9964 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9965 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9966 else
9967 {
9968 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9969 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9970 struct Type * type;
9971 void * ptr = inst->data + dataMember->offset + offset;
9972 char * result = (((void *)0));
9973
9974 exp->loc = member->loc = inst->loc;
9975 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9976 if(!dataMember->dataType)
9977 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
9978 type = dataMember->dataType;
9979 if(type->kind == 8)
9980 {
9981 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
9982
9983 if(_class->type == 4)
9984 {
9985 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9986
9987 if(enumClass)
9988 {
9989 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9990 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
9991
9992 for(item = e->values.first; item; item = item->next)
9993 {
9994 if(item->data == GetEnumValue(_class, ptr))
9995 {
9996 result = item->name;
9997 break;
9998 }
9999 }
10000 if(result)
10001 {
10002 exp->__anon1.__anon1.identifier = MkIdentifier(result);
10003 exp->type = 0;
10004 exp->destType = MkClassType(_class->fullName);
10005 ProcessExpressionType(exp);
10006 }
10007 }
10008 }
10009 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10010 {
10011 if(!_class->dataType)
10012 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
10013 type = _class->dataType;
10014 }
10015 }
10016 if(!result)
10017 {
10018 switch(type->kind)
10019 {
10020 case 6:
10021 {
10022 FreeExpContents(exp);
10023 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10024 exp->type = 2;
10025 break;
10026 }
10027 case 7:
10028 {
10029 FreeExpContents(exp);
10030 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10031 exp->type = 2;
10032 break;
10033 }
10034 case 3:
10035 {
10036 FreeExpContents(exp);
10037 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10038 exp->type = 2;
10039 break;
10040 }
10041 case 4:
10042 {
10043 FreeExpContents(exp);
10044 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10045 exp->type = 2;
10046 break;
10047 }
10048 case 22:
10049 {
10050 FreeExpContents(exp);
10051 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10052 exp->type = 2;
10053 break;
10054 }
10055 case 23:
10056 {
10057 FreeExpContents(exp);
10058 exp->__anon1.__anon1.constant = PrintInt64((long long)*(ssize_t *)ptr);
10059 exp->type = 2;
10060 break;
10061 }
10062 default:
10063 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10064 }
10065 }
10066 ListAdd(memberList, member);
10067 }
10068 if(parentDataMember->type == 1)
10069 break;
10070 }
10071 }
10072
10073 void CheckTemplateTypes(struct Expression * exp)
10074 {
10075 struct Expression * nbExp = GetNonBracketsExp(exp);
10076
10077 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
10078 {
10079 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10080 struct Context * context;
10081 int kind = exp->expType->kind;
10082
10083 *newExp = *exp;
10084 if(exp->destType)
10085 exp->destType->refCount++;
10086 if(exp->expType)
10087 exp->expType->refCount++;
10088 newExp->prev = (((void *)0));
10089 newExp->next = (((void *)0));
10090 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10091 {
10092 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10093
10094 if(c->type == 2 || c->type == 4 || c->type == 3)
10095 {
10096 if(!c->dataType)
10097 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10098 kind = c->dataType->kind;
10099 }
10100 }
10101 switch(kind)
10102 {
10103 case 7:
10104 if(exp->destType->classObjectType)
10105 {
10106 if(exp->destType)
10107 exp->destType->refCount--;
10108 if(exp->expType)
10109 exp->expType->refCount--;
10110 ((newExp ? __extension__ ({
10111 void * __ecerePtrToDelete = (newExp);
10112
10113 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
10114 }) : 0), newExp = 0);
10115 }
10116 else
10117 {
10118 struct __ecereNameSpace__ecere__sys__OldList * specs;
10119 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10120 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10121
10122 context = PushContext();
10123 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10124 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10125 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10126 exp->type = 23;
10127 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10128 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10129 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10130 exp->__anon1.compound->__anon1.compound.context = context;
10131 PopContext(context);
10132 }
10133 break;
10134 default:
10135 exp->type = 11;
10136 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10137 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))
10138 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
10139 else
10140 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10141 exp->needCast = 1;
10142 break;
10143 }
10144 }
10145 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10146 {
10147 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10148 struct Context * context;
10149 int kind = exp->expType->kind;
10150
10151 *newExp = *exp;
10152 if(exp->destType)
10153 exp->destType->refCount++;
10154 if(exp->expType)
10155 exp->expType->refCount++;
10156 newExp->prev = (((void *)0));
10157 newExp->next = (((void *)0));
10158 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10159 {
10160 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10161
10162 if(c->type == 2 || c->type == 4 || c->type == 3)
10163 {
10164 if(!c->dataType)
10165 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10166 kind = c->dataType->kind;
10167 }
10168 }
10169 switch(kind)
10170 {
10171 case 7:
10172 if(exp->destType->classObjectType)
10173 {
10174 if(exp->destType)
10175 exp->destType->refCount--;
10176 if(exp->expType)
10177 exp->expType->refCount--;
10178 ((newExp ? __extension__ ({
10179 void * __ecerePtrToDelete = (newExp);
10180
10181 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
10182 }) : 0), newExp = 0);
10183 }
10184 else
10185 {
10186 struct __ecereNameSpace__ecere__sys__OldList * specs;
10187 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10188 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10189
10190 context = PushContext();
10191 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10192 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10193 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10194 exp->type = 23;
10195 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10196 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10197 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10198 exp->__anon1.compound->__anon1.compound.context = context;
10199 PopContext(context);
10200 }
10201 break;
10202 case 8:
10203 {
10204 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
10205 {
10206 exp->type = 5;
10207 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10208 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)));
10209 ProcessExpressionType((*exp->__anon1.list).first);
10210 break;
10211 }
10212 else
10213 {
10214 exp->type = 5;
10215 if(__ecereProp_Type_Get_isPointerType(exp->expType))
10216 {
10217 exp->needTemplateCast = 2;
10218 newExp->needCast = 1;
10219 newExp->needTemplateCast = 2;
10220 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10221 }
10222 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
10223 exp->needTemplateCast = 2;
10224 newExp->needCast = 1;
10225 newExp->needTemplateCast = 2;
10226 ProcessExpressionType((*exp->__anon1.list).first);
10227 break;
10228 }
10229 }
10230 default:
10231 {
10232 if(exp->expType->kind == 20)
10233 {
10234 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
10235
10236 if(type)
10237 {
10238 FreeType(exp->destType);
10239 FreeType(exp->expType);
10240 ((newExp ? __extension__ ({
10241 void * __ecerePtrToDelete = (newExp);
10242
10243 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
10244 }) : 0), newExp = 0);
10245 break;
10246 }
10247 }
10248 {
10249 char typeString[1024];
10250 struct Declarator * decl;
10251 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10252
10253 typeString[0] = '\0';
10254 PrintType(exp->expType, typeString, 0, 0);
10255 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10256 exp->type = 11;
10257 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
10258 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10259 exp->__anon1.cast.exp->needCast = 1;
10260 exp->needTemplateCast = 2;
10261 newExp->needTemplateCast = 2;
10262 }
10263 break;
10264 }
10265 }
10266 }
10267 }
10268
10269 static void ProcessInitializer(struct Initializer * init, struct Type * type)
10270 {
10271 switch(init->type)
10272 {
10273 case 0:
10274 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
10275 {
10276 if(init->__anon1.exp && !init->__anon1.exp->destType)
10277 {
10278 FreeType(init->__anon1.exp->destType);
10279 init->__anon1.exp->destType = type;
10280 if(type)
10281 type->refCount++;
10282 }
10283 if(init->__anon1.exp)
10284 {
10285 ProcessExpressionType(init->__anon1.exp);
10286 init->isConstant = init->__anon1.exp->isConstant;
10287 }
10288 break;
10289 }
10290 else
10291 {
10292 struct Expression * exp = init->__anon1.exp;
10293 struct Instantiation * inst = exp->__anon1.instance;
10294 struct MembersInit * members;
10295
10296 init->type = 1;
10297 init->__anon1.list = MkList();
10298 if(inst->members)
10299 {
10300 for(members = (*inst->members).first; members; members = members->next)
10301 {
10302 if(members->type == 0)
10303 {
10304 struct MemberInit * member;
10305
10306 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
10307 {
10308 ListAdd(init->__anon1.list, member->initializer);
10309 member->initializer = (((void *)0));
10310 }
10311 }
10312 }
10313 }
10314 FreeExpression(exp);
10315 }
10316 case 1:
10317 {
10318 struct Initializer * i;
10319 struct Type * initializerType = (((void *)0));
10320 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10321 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10322 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10323 int subMemberStackPos = 0;
10324
10325 if(type && type->kind == 12)
10326 initializerType = Dereference(type);
10327 else if(type && (type->kind == 9 || type->kind == 10))
10328 initializerType = type->__anon1.__anon1.members.first;
10329 for(i = (*init->__anon1.list).first; i; i = i->next)
10330 {
10331 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
10332 {
10333 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10334 if(curMember)
10335 {
10336 if(!curMember->dataType)
10337 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
10338 initializerType = curMember->dataType;
10339 }
10340 }
10341 ProcessInitializer(i, initializerType);
10342 if(initializerType && type && (type->kind == 9 || type->kind == 10))
10343 initializerType = initializerType->next;
10344 if(!i->isConstant)
10345 init->isConstant = 0;
10346 }
10347 if(type && type->kind == 12)
10348 FreeType(initializerType);
10349 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))
10350 {
10351 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
10352 }
10353 break;
10354 }
10355 }
10356 }
10357
10358 void PopulateInstance(struct Instantiation * inst)
10359 {
10360 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
10361 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
10362 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10363 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10364
10365 if(!inst->members)
10366 inst->members = MkListOne(MkMembersInitList(memberList));
10367 else
10368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10369 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10370 {
10371 if(!dataMember->isProperty)
10372 {
10373 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10374 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10375 else
10376 {
10377 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10378 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10379 struct Type * type;
10380 void * ptr = inst->data + dataMember->offset;
10381 char * result = (((void *)0));
10382
10383 exp->loc = member->loc = inst->loc;
10384 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10385 if(!dataMember->dataType)
10386 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10387 type = dataMember->dataType;
10388 if(type->kind == 8)
10389 {
10390 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
10391
10392 if(_class->type == 4)
10393 {
10394 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10395
10396 if(enumClass)
10397 {
10398 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10399 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
10400
10401 for(item = e->values.first; item; item = item->next)
10402 {
10403 if(item->data == GetEnumValue(_class, ptr))
10404 {
10405 result = item->name;
10406 break;
10407 }
10408 }
10409 }
10410 if(result)
10411 {
10412 exp->__anon1.__anon1.identifier = MkIdentifier(result);
10413 exp->type = 0;
10414 exp->destType = MkClassType(_class->fullName);
10415 ProcessExpressionType(exp);
10416 }
10417 }
10418 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10419 {
10420 if(!_class->dataType)
10421 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
10422 type = _class->dataType;
10423 }
10424 }
10425 if(!result)
10426 {
10427 switch(type->kind)
10428 {
10429 case 6:
10430 {
10431 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10432 exp->type = 2;
10433 break;
10434 }
10435 case 7:
10436 {
10437 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10438 exp->type = 2;
10439 break;
10440 }
10441 case 3:
10442 {
10443 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10444 exp->type = 2;
10445 break;
10446 }
10447 case 4:
10448 {
10449 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10450 exp->type = 2;
10451 break;
10452 }
10453 case 22:
10454 {
10455 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10456 exp->type = 2;
10457 break;
10458 }
10459 default:
10460 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10461 }
10462 }
10463 ListAdd(memberList, member);
10464 }
10465 }
10466 }
10467 }
10468
10469 int ComputeTypeSize(struct Type *  type);
10470
10471 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
10472 {
10473 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10474 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10475
10476 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))
10477 {
10478 int unionMemberOffset = 0;
10479 int bitFields = 0;
10480
10481 if(member)
10482 {
10483 member->memberOffset = 0;
10484 if(targetBits < sizeof(void *) * 8)
10485 member->structAlignment = 0;
10486 }
10487 else if(targetBits < sizeof(void *) * 8)
10488 _class->structAlignment = 0;
10489 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
10490 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
10491 if(!member && _class->destructionWatchOffset)
10492 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10493 {
10494 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10495
10496 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10497 {
10498 if(!dataMember->isProperty)
10499 {
10500 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
10501 {
10502 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10503 }
10504 }
10505 }
10506 }
10507 {
10508 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10509
10510 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10511 {
10512 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
10513 {
10514 if(!isMember && _class->type == 2 && dataMember->dataType)
10515 {
10516 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10517 uint64 mask = 0;
10518 int d;
10519
10520 ComputeTypeSize(dataMember->dataType);
10521 if(bitMember->pos == -1)
10522 bitMember->pos = _class->memberOffset;
10523 if(!bitMember->size)
10524 bitMember->size = dataMember->dataType->size * 8;
10525 _class->memberOffset = bitMember->pos + bitMember->size;
10526 for(d = 0; d < bitMember->size; d++)
10527 {
10528 if(d)
10529 mask <<= 1;
10530 mask |= 1;
10531 }
10532 bitMember->mask = mask << bitMember->pos;
10533 }
10534 else if(dataMember->type == 0 && dataMember->dataType)
10535 {
10536 int size;
10537 int alignment = 0;
10538
10539 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)))
10540 ComputeTypeSize(dataMember->dataType);
10541 if(dataMember->dataType->bitFieldCount)
10542 {
10543 bitFields += dataMember->dataType->bitFieldCount;
10544 size = 0;
10545 }
10546 else
10547 {
10548 if(bitFields)
10549 {
10550 int size = (bitFields + 7) / 8;
10551
10552 if(isMember)
10553 {
10554 int __simpleStruct0;
10555
10556 if(alignment)
10557 {
10558 short __simpleStruct0;
10559
10560 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10561 if(member->memberOffset % alignment)
10562 member->memberOffset += alignment - (member->memberOffset % alignment);
10563 }
10564 dataMember->offset = member->memberOffset;
10565 if(member->type == 1)
10566 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10567 else
10568 {
10569 member->memberOffset += size;
10570 }
10571 }
10572 else
10573 {
10574 if(alignment)
10575 {
10576 short __simpleStruct0;
10577
10578 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10579 if(_class->memberOffset % alignment)
10580 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10581 }
10582 dataMember->offset = _class->memberOffset;
10583 _class->memberOffset += size;
10584 }
10585 bitFields = 0;
10586 }
10587 size = dataMember->dataType->size;
10588 alignment = dataMember->dataType->alignment;
10589 }
10590 if(isMember)
10591 {
10592 int __simpleStruct0;
10593
10594 if(alignment)
10595 {
10596 short __simpleStruct0;
10597
10598 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10599 if(member->memberOffset % alignment)
10600 member->memberOffset += alignment - (member->memberOffset % alignment);
10601 }
10602 dataMember->offset = member->memberOffset;
10603 if(member->type == 1)
10604 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10605 else
10606 {
10607 member->memberOffset += size;
10608 }
10609 }
10610 else
10611 {
10612 if(alignment)
10613 {
10614 short __simpleStruct0;
10615
10616 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10617 if(_class->memberOffset % alignment)
10618 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10619 }
10620 dataMember->offset = _class->memberOffset;
10621 _class->memberOffset += size;
10622 }
10623 }
10624 else
10625 {
10626 int alignment;
10627
10628 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
10629 alignment = dataMember->structAlignment;
10630 if(isMember)
10631 {
10632 int __simpleStruct0;
10633
10634 if(alignment)
10635 {
10636 short __simpleStruct0;
10637
10638 if(member->memberOffset % alignment)
10639 member->memberOffset += alignment - (member->memberOffset % alignment);
10640 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10641 }
10642 dataMember->offset = member->memberOffset;
10643 if(member->type == 1)
10644 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10645 else
10646 member->memberOffset += dataMember->memberOffset;
10647 }
10648 else
10649 {
10650 if(alignment)
10651 {
10652 short __simpleStruct0;
10653
10654 if(_class->memberOffset % alignment)
10655 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10656 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10657 }
10658 dataMember->offset = _class->memberOffset;
10659 _class->memberOffset += dataMember->memberOffset;
10660 }
10661 }
10662 }
10663 }
10664 if(bitFields)
10665 {
10666 int alignment = 0;
10667 int size = (bitFields + 7) / 8;
10668
10669 if(isMember)
10670 {
10671 int __simpleStruct0;
10672
10673 if(alignment)
10674 {
10675 short __simpleStruct0;
10676
10677 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10678 if(member->memberOffset % alignment)
10679 member->memberOffset += alignment - (member->memberOffset % alignment);
10680 }
10681 if(member->type == 1)
10682 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10683 else
10684 {
10685 member->memberOffset += size;
10686 }
10687 }
10688 else
10689 {
10690 if(alignment)
10691 {
10692 short __simpleStruct0;
10693
10694 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10695 if(_class->memberOffset % alignment)
10696 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10697 }
10698 _class->memberOffset += size;
10699 }
10700 bitFields = 0;
10701 }
10702 }
10703 if(member && member->type == 1)
10704 {
10705 member->memberOffset = unionMemberOffset;
10706 }
10707 if(!isMember)
10708 {
10709 if(_class->type != 2)
10710 {
10711 int extra = 0;
10712
10713 if(_class->structAlignment)
10714 {
10715 if(_class->memberOffset % _class->structAlignment)
10716 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
10717 }
10718 _class->structSize = (_class->base ? (_class->base->templateClass ? (_class->base->type == 5 ? _class->base->templateClass->memberOffset : _class->base->templateClass->structSize) : (_class->base->type == 5 ? _class->base->memberOffset : _class->base->structSize)) : 0) + _class->memberOffset + extra;
10719 if(!member)
10720 {
10721 struct __ecereNameSpace__ecere__com__Property * prop;
10722
10723 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
10724 {
10725 if(prop->isProperty && prop->isWatchable)
10726 {
10727 prop->watcherOffset = _class->structSize;
10728 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10729 }
10730 }
10731 }
10732 {
10733 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
10734
10735 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
10736 {
10737 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
10738
10739 if(deriv->computeSize)
10740 {
10741 deriv->offset = (_class->type == 5 ? _class->memberOffset : _class->structSize);
10742 deriv->memberOffset = 0;
10743 deriv->structSize = deriv->offset;
10744 ComputeClassMembers(deriv, 0);
10745 }
10746 }
10747 }
10748 }
10749 }
10750 }
10751 if(context)
10752 FinishTemplatesContext(context);
10753 }
10754
10755 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)
10756 {
10757 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10758 unsigned int totalSize = 0;
10759 unsigned int maxSize = 0;
10760 int alignment;
10761 unsigned int size;
10762 struct __ecereNameSpace__ecere__com__DataMember * member;
10763 int anonID = 1;
10764 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10765
10766 if(addedPadding)
10767 *addedPadding = 0;
10768 if(!isMember && _class->base)
10769 {
10770 maxSize = _class->structSize;
10771 {
10772 if(_class->type == 1 || _class->type == 5)
10773 AddMembers(neededBy, declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
10774 else
10775 {
10776 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
10777
10778 if(maxSize > baseSize)
10779 maxSize -= baseSize;
10780 else
10781 maxSize = 0;
10782 }
10783 }
10784 }
10785 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
10786 {
10787 if(!member->isProperty)
10788 {
10789 switch(member->type)
10790 {
10791 case 0:
10792 {
10793 if(member->dataTypeString)
10794 {
10795 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
10796 struct Declarator * decl;
10797
10798 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
10799 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
10800 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
10801 if(!member->dataType)
10802 member->dataType = ProcessType(specs, decl);
10803 ReplaceThisClassSpecifiers(specs, topClass);
10804 {
10805 struct Type * type = ProcessType(specs, decl);
10806
10807 DeclareType(neededBy, member->dataType, 1, 0);
10808 FreeType(type);
10809 }
10810 ComputeTypeSize(member->dataType);
10811 size = member->dataType->size;
10812 alignment = member->dataType->alignment;
10813 if(alignment)
10814 {
10815 if(totalSize % alignment)
10816 totalSize += alignment - (totalSize % alignment);
10817 }
10818 totalSize += size;
10819 }
10820 break;
10821 }
10822 case 1:
10823 case 2:
10824 {
10825 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
10826 char id[100];
10827
10828 sprintf(id, "__anon%d", anonID++);
10829 size = 0;
10830 AddMembers(neededBy, list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
10831 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
10832 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
10833 alignment = member->structAlignment;
10834 if(alignment)
10835 {
10836 if(totalSize % alignment)
10837 totalSize += alignment - (totalSize % alignment);
10838 }
10839 totalSize += size;
10840 break;
10841 }
10842 }
10843 }
10844 }
10845 if(retSize)
10846 {
10847 unsigned int __simpleStruct0;
10848
10849 if(topMember && topMember->type == 1)
10850 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
10851 else
10852 *retSize += totalSize;
10853 }
10854 else if(totalSize < maxSize && _class->type != 1000)
10855 {
10856 int autoPadding = 0;
10857
10858 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
10859 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
10860 if(totalSize + autoPadding < maxSize)
10861 {
10862 char sizeString[50];
10863
10864 sprintf(sizeString, "%d", maxSize - totalSize);
10865 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
10866 if(addedPadding)
10867 *addedPadding = 1;
10868 }
10869 }
10870 if(context)
10871 FinishTemplatesContext(context);
10872 return topMember ? topMember->memberID : _class->memberID;
10873 }
10874
10875 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)
10876 {
10877 if(source && dest)
10878 {
10879 if(warnConst)
10880 CheckConstCompatibility(source, dest, 1);
10881 if(source->kind == 20 && dest->kind != 20)
10882 {
10883 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
10884
10885 if(type)
10886 source = type;
10887 }
10888 if(dest->kind == 20 && source->kind != 20)
10889 {
10890 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
10891
10892 if(type)
10893 dest = type;
10894 }
10895 if(dest->classObjectType == 2 && dest->kind != 11)
10896 {
10897 if(source->classObjectType != 3)
10898 return 1;
10899 else
10900 {
10901 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
10902 {
10903 return 1;
10904 }
10905 }
10906 }
10907 else
10908 {
10909 if(source->kind != 11 && source->classObjectType == 3)
10910 return 1;
10911 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
10912 return 1;
10913 }
10914 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
10915 {
10916 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))
10917 return 1;
10918 }
10919 if(dest->kind == 14 && source->kind != 0)
10920 return 1;
10921 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))
10922 return 1;
10923 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))
10924 return 1;
10925 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
10926 {
10927 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
10928 {
10929 if(conversions != (((void *)0)))
10930 {
10931 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
10932 return 1;
10933 }
10934 else
10935 {
10936 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
10937
10938 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
10939 ;
10940 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
10941 ;
10942 if(sourceBase == destBase)
10943 return 1;
10944 }
10945 }
10946 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))
10947 return 1;
10948 else
10949 {
10950 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && source->__anon1._class && source->__anon1._class->__anon1.registered && (dest->casted || (enumBaseType && dest->__anon1._class->__anon1.registered->type == 4 && (source->kind == 8 || source->__anon1._class->__anon1.registered->type != 4))))
10951 {
10952 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
10953 {
10954 return 1;
10955 }
10956 }
10957 }
10958 }
10959 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
10960 return 1;
10961 if(doConversion)
10962 {
10963 if(source->kind == 8)
10964 {
10965 struct __ecereNameSpace__ecere__com__Class * _class;
10966
10967 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10968 {
10969 struct __ecereNameSpace__ecere__com__Property * convert;
10970
10971 for(convert = _class->conversions.first; convert; convert = convert->next)
10972 {
10973 if(convert->memberAccess == 1 || _class->module == privateModule)
10974 {
10975 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10976
10977 if(!convert->dataType)
10978 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10979 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))
10980 {
10981 if(!conversions && !convert->Get)
10982 return 1;
10983 else if(conversions != (((void *)0)))
10984 {
10985 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))
10986 return 1;
10987 else
10988 {
10989 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10990
10991 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10992 return 1;
10993 }
10994 }
10995 }
10996 }
10997 }
10998 }
10999 }
11000 if(dest->kind == 8)
11001 {
11002 struct __ecereNameSpace__ecere__com__Class * _class;
11003
11004 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
11005 {
11006 struct __ecereNameSpace__ecere__com__Property * convert;
11007
11008 for(convert = _class->conversions.first; convert; convert = convert->next)
11009 {
11010 if(convert->memberAccess == 1 || _class->module == privateModule)
11011 {
11012 struct Type * constType = (((void *)0));
11013 unsigned int success = 0;
11014
11015 if(!convert->dataType)
11016 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
11017 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
11018 {
11019 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11020
11021 constType = __extension__ ({
11022 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11023
11024 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
11025 });
11026 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
11027 ptrType->constant = 1;
11028 }
11029 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
11030 {
11031 if(!conversions && !convert->Set)
11032 success = 1;
11033 else if(conversions != (((void *)0)))
11034 {
11035 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))
11036 success = 1;
11037 else
11038 {
11039 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
11040
11041 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
11042 success = 1;
11043 }
11044 }
11045 }
11046 if(constType)
11047 FreeType(constType);
11048 if(success)
11049 return 1;
11050 }
11051 }
11052 }
11053 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
11054 {
11055 if(!dest->__anon1._class->__anon1.registered->dataType)
11056 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
11057 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
11058 {
11059 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))
11060 {
11061 return 1;
11062 }
11063 }
11064 }
11065 }
11066 if(source->kind == 8)
11067 {
11068 struct __ecereNameSpace__ecere__com__Class * _class;
11069
11070 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
11071 {
11072 struct __ecereNameSpace__ecere__com__Property * convert;
11073
11074 for(convert = _class->conversions.first; convert; convert = convert->next)
11075 {
11076 if(convert->memberAccess == 1 || _class->module == privateModule)
11077 {
11078 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
11079
11080 if(!convert->dataType)
11081 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
11082 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))
11083 {
11084 if(!conversions && !convert->Get)
11085 return 1;
11086 else if(conversions != (((void *)0)))
11087 {
11088 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))
11089 return 1;
11090 else
11091 {
11092 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
11093
11094 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
11095 return 1;
11096 }
11097 }
11098 }
11099 }
11100 }
11101 }
11102 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
11103 {
11104 if(!source->__anon1._class->__anon1.registered->dataType)
11105 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
11106 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
11107 {
11108 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))
11109 return 1;
11110 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
11111 return 1;
11112 }
11113 }
11114 }
11115 }
11116 if(source->kind == 8 || source->kind == 19)
11117 ;
11118 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
11119 return 1;
11120 else if(dest->kind == 7 && source->kind == 6)
11121 return 1;
11122 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
11123 return 1;
11124 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
11125 return 1;
11126 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
11127 return 1;
11128 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
11129 return 1;
11130 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
11131 return 1;
11132 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))
11133 return 1;
11134 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))
11135 return 1;
11136 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)))
11137 {
11138 struct Type * paramSource, * paramDest;
11139
11140 if(dest->kind == 16)
11141 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
11142 if(source->kind == 16)
11143 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
11144 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
11145 dest = dest->__anon1.type;
11146 if(source->kind == 13 && source->__anon1.type->kind == 11)
11147 source = source->__anon1.type;
11148 if(dest->kind == 16)
11149 dest = dest->__anon1.__anon3.method->dataType;
11150 if(source->kind == 16)
11151 source = source->__anon1.__anon3.method->dataType;
11152 paramSource = source->__anon1.__anon2.params.first;
11153 if(paramSource && paramSource->kind == 0)
11154 paramSource = (((void *)0));
11155 paramDest = dest->__anon1.__anon2.params.first;
11156 if(paramDest && paramDest->kind == 0)
11157 paramDest = (((void *)0));
11158 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11159 {
11160 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))))
11161 {
11162 if(paramDest && paramDest->kind == 8)
11163 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
11164 else
11165 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
11166 return 0;
11167 }
11168 paramDest = paramDest->next;
11169 }
11170 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
11171 {
11172 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11173 {
11174 if(dest->__anon1.__anon2.thisClass)
11175 {
11176 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
11177 {
11178 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11179 return 0;
11180 }
11181 }
11182 else
11183 {
11184 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
11185 {
11186 if(owningClassDest)
11187 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
11188 else
11189 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
11190 return 0;
11191 }
11192 }
11193 paramSource = paramSource->next;
11194 }
11195 else
11196 {
11197 if(dest->__anon1.__anon2.thisClass)
11198 {
11199 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
11200 {
11201 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11202 return 0;
11203 }
11204 }
11205 else
11206 {
11207 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
11208 {
11209 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
11210 return 0;
11211 }
11212 }
11213 }
11214 }
11215 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
11216 {
11217 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
11218 return 0;
11219 }
11220 else
11221 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
11222 for(; paramDest; paramDest = paramDest->next)
11223 {
11224 if(!paramSource)
11225 {
11226 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
11227 return 0;
11228 }
11229 {
11230 struct Type * paramDestType = paramDest;
11231 struct Type * paramSourceType = paramSource;
11232 struct Type * type = paramDestType;
11233
11234 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
11235 {
11236 int id = 0;
11237 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
11238 struct __ecereNameSpace__ecere__com__Class * sClass;
11239
11240 for(sClass = owningClassSource; sClass; sClass = sClass->base)
11241 {
11242 id = 0;
11243 if(sClass->templateClass)
11244 sClass = sClass->templateClass;
11245 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
11246 {
11247 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
11248 {
11249 for(sClass = sClass->base; sClass; sClass = sClass->base)
11250 {
11251 if(sClass->templateClass)
11252 sClass = sClass->templateClass;
11253 id += sClass->templateParams.count;
11254 }
11255 break;
11256 }
11257 id++;
11258 }
11259 if(curParam)
11260 break;
11261 }
11262 if(curParam)
11263 {
11264 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
11265
11266 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
11267 }
11268 }
11269 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)))
11270 {
11271 char type[1024];
11272
11273 type[0] = 0;
11274 PrintType(paramDest, type, 0, 1);
11275 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
11276 if(paramDestType != paramDest)
11277 FreeType(paramDestType);
11278 return 0;
11279 }
11280 if(paramDestType != paramDest)
11281 FreeType(paramDestType);
11282 }
11283 paramSource = paramSource->next;
11284 }
11285 if(paramSource)
11286 {
11287 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
11288 return 0;
11289 }
11290 return 1;
11291 }
11292 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
11293 {
11294 return 1;
11295 }
11296 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
11297 {
11298 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))
11299 {
11300 ComputeTypeSize(source->__anon1.type);
11301 ComputeTypeSize(dest->__anon1.type);
11302 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))
11303 return 1;
11304 }
11305 }
11306 }
11307 return 0;
11308 }
11309
11310 void ComputeInstantiation(struct Expression * exp)
11311 {
11312 struct Instantiation * inst = exp->__anon1.instance;
11313 struct MembersInit * members;
11314 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11315 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11316 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11317 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11318 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11319 int subMemberStackPos = 0;
11320 uint64 bits = 0;
11321
11322 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11323 {
11324 if(inst->data)
11325 return ;
11326 if(_class->type == 0 || _class->type == 5)
11327 {
11328 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11329 if(_class->type == 0)
11330 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11331 }
11332 else
11333 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11334 }
11335 if(inst->members)
11336 {
11337 for(members = (*inst->members).first; members; members = members->next)
11338 {
11339 switch(members->type)
11340 {
11341 case 0:
11342 {
11343 if(members->__anon1.dataMembers)
11344 {
11345 struct MemberInit * member;
11346
11347 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11348 {
11349 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11350 unsigned int found = 0;
11351 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11352 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11353 unsigned int dataMemberOffset;
11354
11355 if(!ident)
11356 {
11357 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11358 if(curMember)
11359 {
11360 if(curMember->isProperty)
11361 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11362 else
11363 {
11364 dataMember = curMember;
11365 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11366 if(_class->type == 0)
11367 dataMemberOffset += _class->base->structSize;
11368 }
11369 found = 1;
11370 }
11371 }
11372 else
11373 {
11374 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11375 if(prop)
11376 {
11377 found = 1;
11378 if(prop->memberAccess == 1)
11379 {
11380 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11381 curClass = prop->_class;
11382 }
11383 }
11384 else
11385 {
11386 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11387 int _subMemberStackPos = 0;
11388
11389 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11390 if(dataMember)
11391 {
11392 found = 1;
11393 if(dataMember->memberAccess == 1)
11394 {
11395 curMember = dataMember;
11396 curClass = dataMember->_class;
11397 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11398 subMemberStackPos = _subMemberStackPos;
11399 }
11400 }
11401 }
11402 }
11403 if(found && member->initializer && member->initializer->type == 0)
11404 {
11405 struct Expression * value = member->initializer->__anon1.exp;
11406 struct Type * type = (((void *)0));
11407 unsigned int deepMember = 0;
11408
11409 if(prop)
11410 {
11411 type = prop->dataType;
11412 }
11413 else if(dataMember)
11414 {
11415 if(!dataMember->dataType)
11416 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11417 type = dataMember->dataType;
11418 }
11419 if(ident && ident->next)
11420 {
11421 deepMember = 1;
11422 for(ident = ident->next; ident && type; ident = ident->next)
11423 {
11424 if(type->kind == 8)
11425 {
11426 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11427 if(prop)
11428 type = prop->dataType;
11429 else
11430 {
11431 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11432 if(dataMember)
11433 type = dataMember->dataType;
11434 }
11435 }
11436 else if(type->kind == 9 || type->kind == 10)
11437 {
11438 struct Type * memberType;
11439
11440 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11441 {
11442 if(!strcmp(memberType->name, ident->string))
11443 {
11444 type = memberType;
11445 break;
11446 }
11447 }
11448 }
11449 }
11450 }
11451 if(value)
11452 {
11453 FreeType(value->destType);
11454 value->destType = type;
11455 if(type)
11456 type->refCount++;
11457 ComputeExpression(value);
11458 }
11459 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11460 {
11461 if(type->kind == 8)
11462 {
11463 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11464
11465 if(_class && (_class->type == 2 || _class->type == 3 || _class->type == 4))
11466 {
11467 if(!_class->dataType)
11468 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11469 type = _class->dataType;
11470 }
11471 }
11472 if(dataMember)
11473 {
11474 void * ptr = inst->data + dataMemberOffset;
11475
11476 if(value->type == 2)
11477 {
11478 switch(type->kind)
11479 {
11480 case 3:
11481 {
11482 GetInt(value, (int *)ptr);
11483 break;
11484 }
11485 case 4:
11486 {
11487 GetInt64(value, (long long *)ptr);
11488 break;
11489 }
11490 case 22:
11491 {
11492 GetIntPtr(value, (intptr_t *)ptr);
11493 break;
11494 }
11495 case 23:
11496 {
11497 GetIntSize(value, (ssize_t *)ptr);
11498 break;
11499 }
11500 case 6:
11501 {
11502 GetFloat(value, (float *)ptr);
11503 break;
11504 }
11505 case 7:
11506 {
11507 GetDouble(value, (double *)ptr);
11508 break;
11509 }
11510 }
11511 }
11512 else if(value->type == 1)
11513 {
11514 if(type->kind == 8)
11515 {
11516 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11517
11518 if(_class->type == 1)
11519 {
11520 ComputeTypeSize(type);
11521 if(value->__anon1.instance->data)
11522 memcpy(ptr, value->__anon1.instance->data, type->size);
11523 }
11524 }
11525 }
11526 }
11527 else if(prop && prop->Set != (void *)(intptr_t)1)
11528 {
11529 if(value->type == 1 && value->__anon1.instance->data)
11530 {
11531 if(type->kind == 8)
11532 {
11533 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11534
11535 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)))
11536 {
11537 void (* Set)(void *, void *) = (void *)prop->Set;
11538
11539 Set(inst->data, value->__anon1.instance->data);
11540 PopulateInstance(inst);
11541 }
11542 }
11543 }
11544 else if(value->type == 2)
11545 {
11546 switch(type->kind)
11547 {
11548 case 7:
11549 {
11550 void (* Set)(void *, double) = (void *)prop->Set;
11551
11552 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11553 break;
11554 }
11555 case 6:
11556 {
11557 void (* Set)(void *, float) = (void *)prop->Set;
11558
11559 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11560 break;
11561 }
11562 case 3:
11563 {
11564 void (* Set)(void *, int) = (void *)prop->Set;
11565
11566 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11567 break;
11568 }
11569 case 4:
11570 {
11571 void (* Set)(void *, long long) = (void *)prop->Set;
11572
11573 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11574 break;
11575 }
11576 case 22:
11577 {
11578 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11579
11580 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11581 break;
11582 }
11583 case 23:
11584 {
11585 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11586
11587 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11588 break;
11589 }
11590 }
11591 }
11592 else if(value->type == 3)
11593 {
11594 char temp[1024];
11595
11596 ReadString(temp, value->__anon1.__anon2.string);
11597 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11598 }
11599 }
11600 }
11601 else if(!deepMember && type && _class->type == 3)
11602 {
11603 if(prop)
11604 {
11605 if(value->type == 2)
11606 {
11607 if(type->kind == 8)
11608 {
11609 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11610
11611 if(_class->type == 3)
11612 {
11613 if(!_class->dataType)
11614 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11615 type = _class->dataType;
11616 }
11617 }
11618 switch(type->kind)
11619 {
11620 case 6:
11621 {
11622 float fValue;
11623 float (* Set)(float) = (void *)prop->Set;
11624
11625 GetFloat(member->initializer->__anon1.exp, &fValue);
11626 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11627 exp->type = 2;
11628 break;
11629 }
11630 case 7:
11631 {
11632 double dValue;
11633 double (* Set)(double) = (void *)prop->Set;
11634
11635 GetDouble(member->initializer->__anon1.exp, &dValue);
11636 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11637 exp->type = 2;
11638 break;
11639 }
11640 }
11641 }
11642 }
11643 }
11644 else if(!deepMember && type && _class->type == 2)
11645 {
11646 if(prop)
11647 {
11648 if(value->type == 1 && value->__anon1.instance->data)
11649 {
11650 unsigned int (* Set)(void *) = (void *)prop->Set;
11651
11652 bits = Set(value->__anon1.instance->data);
11653 }
11654 else if(value->type == 2)
11655 {
11656 }
11657 }
11658 else if(dataMember)
11659 {
11660 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11661 struct Type * type;
11662 uint64 part = 0;
11663
11664 bits = (bits & ~bitMember->mask);
11665 if(!bitMember->dataType)
11666 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11667 type = bitMember->dataType;
11668 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11669 {
11670 if(!type->__anon1._class->__anon1.registered->dataType)
11671 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11672 type = type->__anon1._class->__anon1.registered->dataType;
11673 }
11674 switch(type->kind)
11675 {
11676 case 24:
11677 case 1:
11678 {
11679 unsigned char v;
11680
11681 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11682 part = (uint64)v;
11683 break;
11684 }
11685 case 2:
11686 {
11687 unsigned short v;
11688
11689 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11690 part = (uint64)v;
11691 break;
11692 }
11693 case 3:
11694 case 5:
11695 {
11696 unsigned int v;
11697
11698 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11699 part = (uint64)v;
11700 break;
11701 }
11702 case 4:
11703 {
11704 uint64 v;
11705
11706 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11707 part = v;
11708 break;
11709 }
11710 case 22:
11711 {
11712 uintptr_t v;
11713
11714 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11715 part = (uint64)v;
11716 break;
11717 }
11718 case 23:
11719 {
11720 size_t v;
11721
11722 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11723 part = (uint64)v;
11724 break;
11725 }
11726 }
11727 bits |= part << bitMember->pos;
11728 }
11729 }
11730 }
11731 else
11732 {
11733 if(_class && _class->type == 3)
11734 {
11735 ComputeExpression(member->initializer->__anon1.exp);
11736 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11737 exp->type = 2;
11738 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11739 }
11740 }
11741 }
11742 }
11743 break;
11744 }
11745 }
11746 }
11747 }
11748 if(_class && _class->type == 2)
11749 {
11750 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11751 exp->type = 2;
11752 }
11753 if(exp->type != 1)
11754 {
11755 FreeInstance(inst);
11756 }
11757 }
11758
11759 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11760 {
11761 if(exp->__anon1.op.op == SIZEOF)
11762 {
11763 FreeExpContents(exp);
11764 exp->type = 2;
11765 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11766 }
11767 else
11768 {
11769 if(!exp->__anon1.op.exp1)
11770 {
11771 switch(exp->__anon1.op.op)
11772 {
11773 case '+':
11774 {
11775 struct Expression * exp2 = exp->__anon1.op.exp2;
11776
11777 exp->__anon1.op.exp2 = (((void *)0));
11778 FreeExpContents(exp);
11779 FreeType(exp->expType);
11780 FreeType(exp->destType);
11781 *exp = *exp2;
11782 ((exp2 ? __extension__ ({
11783 void * __ecerePtrToDelete = (exp2);
11784
11785 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
11786 }) : 0), exp2 = 0);
11787 break;
11788 }
11789 case '-':
11790 if(op1->ops.Neg)
11791 {
11792 FreeExpContents(exp);
11793 op1->ops.Neg(exp, op1);
11794 }
11795 break;
11796 case '~':
11797 if(op1->ops.BitNot)
11798 {
11799 FreeExpContents(exp);
11800 op1->ops.BitNot(exp, op1);
11801 }
11802 break;
11803 case '!':
11804 if(op1->ops.Not)
11805 {
11806 FreeExpContents(exp);
11807 op1->ops.Not(exp, op1);
11808 }
11809 break;
11810 }
11811 }
11812 else
11813 {
11814 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11815 {
11816 if(Promote(op2, op1->kind, op1->type->isSigned))
11817 op2->kind = op1->kind, op2->ops = op1->ops;
11818 else if(Promote(op1, op2->kind, op2->type->isSigned))
11819 op1->kind = op2->kind, op1->ops = op2->ops;
11820 }
11821 switch(exp->__anon1.op.op)
11822 {
11823 case '+':
11824 if(op1->ops.Add)
11825 {
11826 FreeExpContents(exp);
11827 op1->ops.Add(exp, op1, op2);
11828 }
11829 break;
11830 case '-':
11831 if(op1->ops.Sub)
11832 {
11833 FreeExpContents(exp);
11834 op1->ops.Sub(exp, op1, op2);
11835 }
11836 break;
11837 case '*':
11838 if(op1->ops.Mul)
11839 {
11840 FreeExpContents(exp);
11841 op1->ops.Mul(exp, op1, op2);
11842 }
11843 break;
11844 case '/':
11845 if(op1->ops.Div)
11846 {
11847 FreeExpContents(exp);
11848 op1->ops.Div(exp, op1, op2);
11849 }
11850 break;
11851 case '%':
11852 if(op1->ops.Mod)
11853 {
11854 FreeExpContents(exp);
11855 op1->ops.Mod(exp, op1, op2);
11856 }
11857 break;
11858 case '&':
11859 if(exp->__anon1.op.exp2)
11860 {
11861 if(op1->ops.BitAnd)
11862 {
11863 FreeExpContents(exp);
11864 op1->ops.BitAnd(exp, op1, op2);
11865 }
11866 }
11867 break;
11868 case '|':
11869 if(op1->ops.BitOr)
11870 {
11871 FreeExpContents(exp);
11872 op1->ops.BitOr(exp, op1, op2);
11873 }
11874 break;
11875 case '^':
11876 if(op1->ops.BitXor)
11877 {
11878 FreeExpContents(exp);
11879 op1->ops.BitXor(exp, op1, op2);
11880 }
11881 break;
11882 case LEFT_OP:
11883 if(op1->ops.LShift)
11884 {
11885 FreeExpContents(exp);
11886 op1->ops.LShift(exp, op1, op2);
11887 }
11888 break;
11889 case RIGHT_OP:
11890 if(op1->ops.RShift)
11891 {
11892 FreeExpContents(exp);
11893 op1->ops.RShift(exp, op1, op2);
11894 }
11895 break;
11896 case EQ_OP:
11897 if(op1->ops.Equ)
11898 {
11899 FreeExpContents(exp);
11900 op1->ops.Equ(exp, op1, op2);
11901 }
11902 break;
11903 case NE_OP:
11904 if(op1->ops.Nqu)
11905 {
11906 FreeExpContents(exp);
11907 op1->ops.Nqu(exp, op1, op2);
11908 }
11909 break;
11910 case AND_OP:
11911 if(op1->ops.And)
11912 {
11913 FreeExpContents(exp);
11914 op1->ops.And(exp, op1, op2);
11915 }
11916 break;
11917 case OR_OP:
11918 if(op1->ops.Or)
11919 {
11920 FreeExpContents(exp);
11921 op1->ops.Or(exp, op1, op2);
11922 }
11923 break;
11924 case '>':
11925 if(op1->ops.Grt)
11926 {
11927 FreeExpContents(exp);
11928 op1->ops.Grt(exp, op1, op2);
11929 }
11930 break;
11931 case '<':
11932 if(op1->ops.Sma)
11933 {
11934 FreeExpContents(exp);
11935 op1->ops.Sma(exp, op1, op2);
11936 }
11937 break;
11938 case GE_OP:
11939 if(op1->ops.GrtEqu)
11940 {
11941 FreeExpContents(exp);
11942 op1->ops.GrtEqu(exp, op1, op2);
11943 }
11944 break;
11945 case LE_OP:
11946 if(op1->ops.SmaEqu)
11947 {
11948 FreeExpContents(exp);
11949 op1->ops.SmaEqu(exp, op1, op2);
11950 }
11951 break;
11952 }
11953 }
11954 }
11955 }
11956
11957 void ApplyAnyObjectLogic(struct Expression * e)
11958 {
11959 struct Type * destType = e->destType;
11960
11961 if(destType && (destType->classObjectType == 3))
11962 {
11963 if(e && e->expType)
11964 {
11965 struct Type * type = e->expType;
11966 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11967
11968 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11969 {
11970 _class = type->__anon1._class->__anon1.registered;
11971 }
11972 else if(type->kind == 19)
11973 {
11974 _class = FindClass("ecere::com::Class")->__anon1.registered;
11975 }
11976 else
11977 {
11978 char string[1024] = "";
11979 struct Symbol * classSym;
11980
11981 PrintTypeNoConst(type, string, 0, 1);
11982 classSym = FindClass(string);
11983 if(classSym)
11984 _class = classSym->__anon1.registered;
11985 }
11986 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)))
11987 {
11988 if(!_class || strcmp(_class->fullName, "char *"))
11989 {
11990 struct Expression * checkedExp = e, * newExp;
11991
11992 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11993 {
11994 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11995 {
11996 if(checkedExp->type == 23)
11997 {
11998 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11999 }
12000 else
12001 checkedExp = (*checkedExp->__anon1.list).last;
12002 }
12003 else if(checkedExp->type == 11)
12004 checkedExp = checkedExp->__anon1.cast.exp;
12005 }
12006 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
12007 {
12008 newExp = checkedExp->__anon1.op.exp2;
12009 checkedExp->__anon1.op.exp2 = (((void *)0));
12010 FreeExpContents(checkedExp);
12011 if(e->expType && e->expType->passAsTemplate)
12012 {
12013 char size[100];
12014
12015 ComputeTypeSize(e->expType);
12016 sprintf(size, "%d", e->expType->size);
12017 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))))));
12018 }
12019 ReplaceExpContents(checkedExp, newExp);
12020 e->byReference = 1;
12021 }
12022 else if(!e->byReference || (_class && _class->type == 5))
12023 {
12024 struct Expression * checkedExp;
12025
12026 {
12027 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;
12028
12029 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
12030 {
12031 struct Context * context = PushContext();
12032 struct Declarator * decl;
12033 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12034 char typeString[1024];
12035 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12036
12037 typeString[0] = '\0';
12038 *newExp = *e;
12039 newExp->prev = (((void *)0));
12040 newExp->next = (((void *)0));
12041 newExp->expType = (((void *)0));
12042 PrintTypeNoConst(e->expType, typeString, 0, 1);
12043 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12044 newExp->destType = ProcessType(specs, decl);
12045 curContext = context;
12046 if(curCompound)
12047 {
12048 char name[100];
12049 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12050
12051 e->type = 23;
12052 sprintf(name, "__internalValue%03X", internalValueCounter++);
12053 if(!curCompound->__anon1.compound.declarations)
12054 curCompound->__anon1.compound.declarations = MkList();
12055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12056 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12057 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12058 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
12059 }
12060 else
12061 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12062 {
12063 struct Type * type = e->destType;
12064
12065 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12066 CopyTypeInto(e->destType, type);
12067 e->destType->refCount = 1;
12068 e->destType->classObjectType = 0;
12069 FreeType(type);
12070 }
12071 e->__anon1.compound->__anon1.compound.context = context;
12072 PopContext(context);
12073 curContext = context->parent;
12074 }
12075 }
12076 checkedExp = e;
12077 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
12078 {
12079 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
12080 {
12081 if(checkedExp->type == 23)
12082 {
12083 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12084 }
12085 else
12086 checkedExp = (*checkedExp->__anon1.list).last;
12087 }
12088 else if(checkedExp->type == 11)
12089 checkedExp = checkedExp->__anon1.cast.exp;
12090 }
12091 {
12092 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12093
12094 *operand = *checkedExp;
12095 __ecereMethod_Expression_Clear(checkedExp);
12096 checkedExp->destType = ProcessTypeString("void *", 0);
12097 checkedExp->expType = checkedExp->destType;
12098 checkedExp->destType->refCount++;
12099 checkedExp->type = 4;
12100 checkedExp->__anon1.op.op = '&';
12101 checkedExp->__anon1.op.exp1 = (((void *)0));
12102 checkedExp->__anon1.op.exp2 = operand;
12103 }
12104 }
12105 }
12106 }
12107 }
12108 }
12109 {
12110 }
12111 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))))
12112 {
12113 if(e->expType->classObjectType && destType && destType->classObjectType)
12114 {
12115 return ;
12116 }
12117 else
12118 {
12119 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12120
12121 *thisExp = *e;
12122 thisExp->prev = (((void *)0));
12123 thisExp->next = (((void *)0));
12124 __ecereMethod_Expression_Clear(e);
12125 e->type = 5;
12126 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12127 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
12128 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
12129 {
12130 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12131 CopyTypeInto(e->expType, thisExp->expType);
12132 e->expType->byReference = 0;
12133 e->expType->refCount = 1;
12134 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))
12135 {
12136 e->expType->classObjectType = 0;
12137 }
12138 }
12139 }
12140 }
12141 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12142 {
12143 if(destType->kind == 14)
12144 {
12145 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
12146 }
12147 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))
12148 {
12149 unsigned int byReference = e->expType->byReference;
12150 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12151 struct Declarator * decl;
12152 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12153 char typeString[1024];
12154 struct Type * type;
12155 int backupClassObjectType;
12156 unsigned int backupByReference;
12157
12158 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
12159 type = e->expType;
12160 else
12161 type = destType;
12162 backupClassObjectType = type->classObjectType;
12163 backupByReference = type->byReference;
12164 type->classObjectType = 0;
12165 type->byReference = 0;
12166 typeString[0] = '\0';
12167 PrintType(type, typeString, 0, 1);
12168 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12169 type->classObjectType = backupClassObjectType;
12170 type->byReference = backupByReference;
12171 *thisExp = *e;
12172 thisExp->prev = (((void *)0));
12173 thisExp->next = (((void *)0));
12174 __ecereMethod_Expression_Clear(e);
12175 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)))
12176 {
12177 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
12178 struct Type * t;
12179
12180 destType->refCount++;
12181 e->type = 4;
12182 e->__anon1.op.op = '*';
12183 e->__anon1.op.exp1 = (((void *)0));
12184 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12185 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12186 CopyTypeInto(t, thisExp->destType);
12187 t->passAsTemplate = 0;
12188 FreeType(thisExp->destType);
12189 thisExp->destType = t;
12190 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12191 CopyTypeInto(t, destType);
12192 t->passAsTemplate = passAsTemplate;
12193 FreeType(destType);
12194 destType = t;
12195 destType->refCount = 0;
12196 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12197 CopyTypeInto(e->expType, type);
12198 if(type->passAsTemplate)
12199 {
12200 e->expType->classObjectType = 0;
12201 e->expType->passAsTemplate = 0;
12202 }
12203 e->expType->byReference = 0;
12204 e->expType->refCount = 1;
12205 }
12206 else
12207 {
12208 e->type = 11;
12209 e->__anon1.cast.typeName = MkTypeName(specs, decl);
12210 e->__anon1.cast.exp = thisExp;
12211 e->byReference = 1;
12212 e->expType = type;
12213 type->refCount++;
12214 }
12215 if(e->destType)
12216 FreeType(e->destType);
12217 e->destType = destType;
12218 destType->refCount++;
12219 }
12220 }
12221 }
12222
12223 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
12224 {
12225 struct __ecereNameSpace__ecere__com__Class * _class;
12226 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
12227
12228 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
12229 ComputeModuleClasses(subModule->data);
12230 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->classes.first; _class; _class = _class->next)
12231 ComputeClassMembers(_class, 0);
12232 }
12233
12234 int ComputeTypeSize(struct Type * type)
12235 {
12236 unsigned int size = type ? type->size : 0;
12237
12238 if(!size && type && !type->computing)
12239 {
12240 type->computing = 1;
12241 switch(type->kind)
12242 {
12243 case 24:
12244 type->alignment = size = sizeof(char);
12245 break;
12246 case 1:
12247 type->alignment = size = sizeof(char);
12248 break;
12249 case 3:
12250 type->alignment = size = sizeof(int);
12251 break;
12252 case 4:
12253 type->alignment = size = sizeof(long long);
12254 break;
12255 case 22:
12256 type->alignment = size = targetBits / 8;
12257 type->pointerAlignment = 1;
12258 break;
12259 case 23:
12260 type->alignment = size = targetBits / 8;
12261 type->pointerAlignment = 1;
12262 break;
12263 case 5:
12264 type->alignment = size = sizeof(long);
12265 break;
12266 case 2:
12267 type->alignment = size = sizeof(short);
12268 break;
12269 case 6:
12270 type->alignment = size = sizeof(float);
12271 break;
12272 case 7:
12273 type->alignment = size = sizeof(double);
12274 break;
12275 case 8:
12276 {
12277 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
12278
12279 if(_class && _class->type == 1)
12280 {
12281 ComputeClassMembers(_class, 0);
12282 type->alignment = _class->structAlignment;
12283 type->pointerAlignment = (unsigned int)_class->pointerAlignment;
12284 size = _class->structSize;
12285 if(type->alignment && size % type->alignment)
12286 size += type->alignment - (size % type->alignment);
12287 }
12288 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
12289 {
12290 if(!_class->dataType)
12291 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12292 size = type->alignment = ComputeTypeSize(_class->dataType);
12293 }
12294 else
12295 {
12296 size = type->alignment = targetBits / 8;
12297 type->pointerAlignment = 1;
12298 }
12299 break;
12300 }
12301 case 13:
12302 case 19:
12303 size = type->alignment = targetBits / 8;
12304 type->pointerAlignment = 1;
12305 break;
12306 case 12:
12307 if(type->__anon1.__anon4.arraySizeExp)
12308 {
12309 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
12310 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
12311 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)))
12312 {
12313 struct Location oldLoc = yylloc;
12314 char expression[10240];
12315
12316 expression[0] = '\0';
12317 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
12318 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
12319 if(inCompiler)
12320 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
12321 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
12322 yylloc = oldLoc;
12323 }
12324 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
12325 }
12326 else if(type->__anon1.__anon4.enumClass)
12327 {
12328 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
12329 {
12330 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
12331 }
12332 else
12333 type->__anon1.__anon4.arraySize = 0;
12334 }
12335 else
12336 {
12337 type->__anon1.__anon4.arraySize = 0;
12338 }
12339 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
12340 if(type->__anon1.type)
12341 {
12342 type->alignment = type->__anon1.type->alignment;
12343 type->pointerAlignment = type->__anon1.type->pointerAlignment;
12344 }
12345 break;
12346 case 9:
12347 {
12348 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12349 {
12350 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12351
12352 if(symbol && symbol->type)
12353 {
12354 ComputeTypeSize(symbol->type);
12355 size = symbol->type->size;
12356 }
12357 }
12358 else
12359 {
12360 struct Type * member;
12361
12362 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12363 {
12364 int __simpleStruct0, __simpleStruct1;
12365 unsigned int addSize = ComputeTypeSize(member);
12366
12367 member->offset = size;
12368 if(member->alignment && size % member->alignment)
12369 member->offset += member->alignment - (size % member->alignment);
12370 size = member->offset;
12371 if(member->pointerAlignment && type->size <= 4)
12372 type->pointerAlignment = 1;
12373 else if(!member->pointerAlignment && member->alignment >= 8)
12374 type->pointerAlignment = 0;
12375 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12376 size += addSize;
12377 }
12378 if(type->alignment && size % type->alignment)
12379 size += type->alignment - (size % type->alignment);
12380 }
12381 break;
12382 }
12383 case 10:
12384 {
12385 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12386 {
12387 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12388
12389 if(symbol && symbol->type)
12390 {
12391 ComputeTypeSize(symbol->type);
12392 size = symbol->type->size;
12393 type->alignment = symbol->type->alignment;
12394 }
12395 }
12396 else
12397 {
12398 struct Type * member;
12399
12400 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12401 {
12402 int __simpleStruct0, __simpleStruct1;
12403 unsigned int addSize = ComputeTypeSize(member);
12404
12405 member->offset = size;
12406 if(member->alignment && size % member->alignment)
12407 member->offset += member->alignment - (size % member->alignment);
12408 size = member->offset;
12409 if(member->pointerAlignment && type->size <= 4)
12410 type->pointerAlignment = 1;
12411 else if(!member->pointerAlignment && member->alignment >= 8)
12412 type->pointerAlignment = 0;
12413 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12414 size = ((size > addSize) ? size : addSize);
12415 }
12416 if(type->alignment && size % type->alignment)
12417 size += type->alignment - (size % type->alignment);
12418 }
12419 break;
12420 }
12421 case 20:
12422 {
12423 struct TemplateParameter * param = type->__anon1.templateParameter;
12424 struct Type * baseType = ProcessTemplateParameterType(param);
12425
12426 if(baseType)
12427 {
12428 size = ComputeTypeSize(baseType);
12429 type->alignment = baseType->alignment;
12430 type->pointerAlignment = baseType->pointerAlignment;
12431 }
12432 else
12433 type->alignment = size = sizeof(uint64);
12434 break;
12435 }
12436 case 15:
12437 {
12438 type->alignment = size = sizeof(enum
12439 {
12440 test
12441 });
12442 break;
12443 }
12444 case 21:
12445 {
12446 type->alignment = size = targetBits / 8;
12447 type->pointerAlignment = 1;
12448 break;
12449 }
12450 }
12451 type->size = size;
12452 type->computing = 0;
12453 }
12454 return size;
12455 }
12456
12457 struct External * _DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl)
12458 {
12459 struct External * external = (((void *)0));
12460 struct Symbol * classSym = FindClass(name);
12461 struct __ecereNameSpace__ecere__sys__OldList * curDeclarations = (((void *)0));
12462
12463 if(!inCompiler || !classSym)
12464 return (((void *)0));
12465 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
12466 return (((void *)0));
12467 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
12468 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
12469 external = classSym->__anon2.__anon1.structExternal;
12470 if(external && external->__anon1.declaration)
12471 {
12472 struct Specifier * spec;
12473
12474 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12475 if(spec->type == 3 || spec->type == 4)
12476 {
12477 curDeclarations = spec->__anon1.__anon2.definitions;
12478 break;
12479 }
12480 }
12481 if(classSym->__anon1.registered && !classSym->declaring && classSym->imported && (!classSym->declaredStructSym || (classSym->__anon1.registered->type == 5 && !skipNoHead && external && !curDeclarations)))
12482 {
12483 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12484 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
12485 char structName[1024];
12486 unsigned int addedPadding = 0;
12487 struct Specifier * curSpec = (((void *)0));
12488
12489 classSym->declaring++;
12490 if(strchr(classSym->string, '<'))
12491 {
12492 if(classSym->__anon1.registered->templateClass)
12493 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
12494 classSym->declaring--;
12495 return external;
12496 }
12497 structName[0] = 0;
12498 FullClassNameCat(structName, name, 0);
12499 classSym->declaredStructSym = 1;
12500 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
12501 {
12502 unsigned int add = 0;
12503
12504 if(!external)
12505 {
12506 external = MkExternalDeclaration((((void *)0)));
12507 classSym->__anon2.__anon1.structExternal = external;
12508 external->symbol = classSym;
12509 add = 1;
12510 }
12511 if(!skipNoHead)
12512 {
12513 declarations = MkList();
12514 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
12515 }
12516 if(external->__anon1.declaration)
12517 {
12518 struct Specifier * spec;
12519
12520 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12521 if(spec->type == 3 || spec->type == 4)
12522 {
12523 curSpec = spec;
12524 curDeclarations = spec->__anon1.__anon2.definitions;
12525 break;
12526 }
12527 }
12528 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
12529 {
12530 FreeList(declarations, (void *)(FreeClassDef));
12531 declarations = (((void *)0));
12532 }
12533 if(classSym->__anon1.registered->type != 5 && !declarations)
12534 {
12535 FreeExternal(external);
12536 external = (((void *)0));
12537 classSym->__anon2.__anon1.structExternal = (((void *)0));
12538 }
12539 else
12540 {
12541 if(curSpec)
12542 curSpec->__anon1.__anon2.definitions = declarations;
12543 else
12544 {
12545 specifiers = MkList();
12546 declarators = MkList();
12547 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
12548 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12549 }
12550 if(add)
12551 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12552 }
12553 }
12554 classSym->declaring--;
12555 }
12556 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
12557 {
12558 classSym->declaredStructSym = 1;
12559 if(classSym->__anon1.registered)
12560 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
12561 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
12562 {
12563 struct Specifier * spec;
12564
12565 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
12566 {
12567 if(spec->__anon1.__anon2.definitions)
12568 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
12569 }
12570 }
12571 }
12572 if(inCompiler && neededBy && (external || !classSym->imported))
12573 {
12574 if(!external)
12575 {
12576 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
12577 external->symbol = classSym;
12578 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12579 }
12580 if(reachedPass15 && !external->__anon1.declaration && classSym->__anon1.registered && classSym->__anon1.registered->type == 5)
12581 {
12582 char structName[1024];
12583 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12584
12585 structName[0] = 0;
12586 FullClassNameCat(structName, name, 0);
12587 specifiers = MkList();
12588 declarators = MkList();
12589 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))));
12590 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12591 }
12592 if(fwdDecl)
12593 {
12594 struct External * e = external->fwdDecl ? external->fwdDecl : external;
12595
12596 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
12597 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
12598 }
12599 else
12600 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
12601 }
12602 return external;
12603 }
12604
12605 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)
12606 {
12607 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
12608 unsigned int found = 0;
12609 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
12610 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12611 unsigned int freeType = 0;
12612
12613 yylloc = member->loc;
12614 if(!ident)
12615 {
12616 if(curMember)
12617 {
12618 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
12619 if(*curMember)
12620 {
12621 found = 1;
12622 dataMember = *curMember;
12623 }
12624 }
12625 }
12626 else
12627 {
12628 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
12629 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
12630 int _subMemberStackPos = 0;
12631
12632 if(!thisMember)
12633 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
12634 if(thisMember)
12635 {
12636 dataMember = thisMember;
12637 if(curMember && thisMember->memberAccess == 1)
12638 {
12639 *curMember = thisMember;
12640 *curClass = thisMember->_class;
12641 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
12642 *subMemberStackPos = _subMemberStackPos;
12643 }
12644 found = 1;
12645 }
12646 else
12647 {
12648 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
12649 if(method && method->type == 1)
12650 found = 1;
12651 else
12652 method = (((void *)0));
12653 }
12654 }
12655 if(found)
12656 {
12657 struct Type * type = (((void *)0));
12658
12659 if(dataMember)
12660 {
12661 if(!dataMember->dataType && dataMember->dataTypeString)
12662 {
12663 struct Context * context = SetupTemplatesContext(_class);
12664
12665 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12666 FinishTemplatesContext(context);
12667 }
12668 type = dataMember->dataType;
12669 }
12670 else if(method)
12671 {
12672 if(!method->dataType)
12673 ProcessMethodType(method);
12674 type = method->dataType;
12675 }
12676 if(ident && ident->next)
12677 {
12678 for(ident = ident->next; ident && type; ident = ident->next)
12679 {
12680 if(type->kind == 8)
12681 {
12682 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
12683 if(!dataMember)
12684 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
12685 if(dataMember)
12686 type = dataMember->dataType;
12687 }
12688 else if(type->kind == 9 || type->kind == 10)
12689 {
12690 struct Type * memberType;
12691
12692 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
12693 {
12694 if(!strcmp(memberType->name, ident->string))
12695 {
12696 type = memberType;
12697 break;
12698 }
12699 }
12700 }
12701 }
12702 }
12703 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
12704 {
12705 int id = 0;
12706 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
12707 struct __ecereNameSpace__ecere__com__Class * sClass;
12708
12709 for(sClass = _class; sClass; sClass = sClass->base)
12710 {
12711 id = 0;
12712 if(sClass->templateClass)
12713 sClass = sClass->templateClass;
12714 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
12715 {
12716 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
12717 {
12718 for(sClass = sClass->base; sClass; sClass = sClass->base)
12719 {
12720 if(sClass->templateClass)
12721 sClass = sClass->templateClass;
12722 id += sClass->templateParams.count;
12723 }
12724 break;
12725 }
12726 id++;
12727 }
12728 if(curParam)
12729 break;
12730 }
12731 if(curParam)
12732 {
12733 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
12734
12735 if(arg.__anon1.__anon1.dataTypeString)
12736 {
12737 unsigned int constant = type->constant;
12738
12739 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
12740 if(type->kind == 8 && constant)
12741 type->constant = 1;
12742 else if(type->kind == 13)
12743 {
12744 struct Type * t = type->__anon1.type;
12745
12746 while(t->kind == 13)
12747 t = t->__anon1.type;
12748 if(constant)
12749 t->constant = constant;
12750 }
12751 freeType = 1;
12752 if(type && _class->templateClass)
12753 type->passAsTemplate = 1;
12754 if(type)
12755 {
12756 }
12757 }
12758 }
12759 }
12760 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
12761 {
12762 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
12763 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
12764 int paramCount = 0;
12765 int lastParam = -1;
12766 char templateString[1024];
12767 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
12768
12769 sprintf(templateString, "%s<", expClass->templateClass->fullName);
12770 for(cClass = expClass; cClass; cClass = cClass->base)
12771 {
12772 int p = 0;
12773
12774 if(cClass->templateClass)
12775 cClass = cClass->templateClass;
12776 for(param = cClass->templateParams.first; param; param = param->next)
12777 {
12778 int id = p;
12779 struct __ecereNameSpace__ecere__com__Class * sClass;
12780 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
12781
12782 for(sClass = cClass->base; sClass; sClass = sClass->base)
12783 {
12784 if(sClass->templateClass)
12785 sClass = sClass->templateClass;
12786 id += sClass->templateParams.count;
12787 }
12788 arg = expClass->templateArgs[id];
12789 for(sClass = _class; sClass; sClass = sClass->base)
12790 {
12791 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
12792 int p = 0;
12793 struct __ecereNameSpace__ecere__com__Class * nextClass;
12794
12795 if(sClass->templateClass)
12796 sClass = sClass->templateClass;
12797 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
12798 {
12799 if(nextClass->templateClass)
12800 nextClass = nextClass->templateClass;
12801 p += nextClass->templateParams.count;
12802 }
12803 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
12804 {
12805 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
12806 {
12807 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12808 {
12809 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
12810 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
12811 break;
12812 }
12813 }
12814 }
12815 }
12816 {
12817 char argument[256];
12818
12819 argument[0] = '\0';
12820 switch(param->type)
12821 {
12822 case 2:
12823 {
12824 char expString[1024];
12825 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12826 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
12827 struct Expression * exp;
12828 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
12829
12830 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
12831 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
12832 ProcessExpressionType(exp);
12833 ComputeExpression(exp);
12834 expString[0] = '\0';
12835 PrintExpression(exp, expString);
12836 strcat(argument, expString);
12837 FreeExpression(exp);
12838 break;
12839 }
12840 case 1:
12841 {
12842 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
12843 break;
12844 }
12845 case 0:
12846 {
12847 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12848 strcat(argument, arg.__anon1.__anon1.dataTypeString);
12849 break;
12850 }
12851 }
12852 if(argument[0])
12853 {
12854 if(paramCount)
12855 strcat(templateString, ", ");
12856 if(lastParam != p - 1)
12857 {
12858 strcat(templateString, param->name);
12859 strcat(templateString, " = ");
12860 }
12861 strcat(templateString, argument);
12862 paramCount++;
12863 lastParam = p;
12864 }
12865 p++;
12866 }
12867 }
12868 }
12869 {
12870 int len = strlen(templateString);
12871
12872 if(templateString[len - 1] == '<')
12873 len--;
12874 else
12875 {
12876 if(templateString[len - 1] == '>')
12877 templateString[len++] = ' ';
12878 templateString[len++] = '>';
12879 }
12880 templateString[len++] = '\0';
12881 }
12882 {
12883 struct Context * context = SetupTemplatesContext(_class);
12884
12885 if(freeType)
12886 FreeType(type);
12887 type = ProcessTypeString(templateString, 0);
12888 freeType = 1;
12889 FinishTemplatesContext(context);
12890 }
12891 }
12892 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
12893 {
12894 ProcessExpressionType(member->initializer->__anon1.exp);
12895 if(!member->initializer->__anon1.exp->expType)
12896 {
12897 if(inCompiler)
12898 {
12899 char expString[10240];
12900
12901 expString[0] = '\0';
12902 PrintExpression(member->initializer->__anon1.exp, expString);
12903 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12904 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
12905 }
12906 }
12907 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
12908 {
12909 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
12910 }
12911 }
12912 else if(member->initializer)
12913 {
12914 ProcessInitializer(member->initializer, type);
12915 }
12916 if(freeType)
12917 FreeType(type);
12918 }
12919 else
12920 {
12921 if(_class && _class->type == 3)
12922 {
12923 if(member->initializer)
12924 {
12925 struct Type * type = MkClassType(_class->fullName);
12926
12927 ProcessInitializer(member->initializer, type);
12928 FreeType(type);
12929 }
12930 }
12931 else
12932 {
12933 if(member->initializer)
12934 {
12935 ProcessInitializer(member->initializer, (((void *)0)));
12936 }
12937 if(ident)
12938 {
12939 if(method)
12940 {
12941 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12942 }
12943 else if(_class)
12944 {
12945 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12946 if(inCompiler)
12947 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
12948 }
12949 }
12950 else if(_class)
12951 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
12952 }
12953 }
12954 }
12955
12956 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
12957 {
12958 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
12959
12960 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)))
12961 {
12962 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
12963
12964 if(_class->type == 4)
12965 {
12966 struct __ecereNameSpace__ecere__sys__OldList converts =
12967 {
12968 0, 0, 0, 0, 0
12969 };
12970 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12971
12972 type->kind = 8;
12973 if(!_class->symbol)
12974 _class->symbol = FindClass(_class->fullName);
12975 type->__anon1._class = _class->symbol;
12976 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))
12977 {
12978 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12979 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12980
12981 if(enumClass)
12982 {
12983 struct __ecereNameSpace__ecere__com__Class * baseClass;
12984
12985 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12986 {
12987 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12988
12989 for(value = e->values.first; value; value = value->next)
12990 {
12991 if(!strcmp(value->name, string))
12992 break;
12993 }
12994 if(value)
12995 {
12996 FreeType(sourceExp->expType);
12997 sourceExp->isConstant = 1;
12998 sourceExp->expType = MkClassType(baseClass->fullName);
12999 if(inCompiler || inPreCompiler || inDebugger)
13000 {
13001 char constant[256];
13002
13003 FreeExpContents(sourceExp);
13004 sourceExp->type = 2;
13005 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
13006 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
13007 else
13008 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
13009 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13010 }
13011 while(converts.first)
13012 {
13013 struct Conversion * convert = converts.first;
13014
13015 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
13016 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
13017 }
13018 ((type ? __extension__ ({
13019 void * __ecerePtrToDelete = (type);
13020
13021 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
13022 }) : 0), type = 0);
13023 return 1;
13024 }
13025 }
13026 }
13027 }
13028 if(converts.first)
13029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
13030 ((type ? __extension__ ({
13031 void * __ecerePtrToDelete = (type);
13032
13033 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
13034 }) : 0), type = 0);
13035 }
13036 }
13037 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)))
13038 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
13039 return 1;
13040 return 0;
13041 }
13042
13043 void ComputeExpression(struct Expression * exp)
13044 {
13045 switch(exp->type)
13046 {
13047 case 0:
13048 {
13049 struct Identifier * id = exp->__anon1.__anon1.identifier;
13050
13051 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
13052 {
13053 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
13054
13055 if(c && c->type == 4)
13056 {
13057 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13058
13059 if(enumClass)
13060 {
13061 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
13062 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
13063
13064 for(value = e->values.first; value; value = value->next)
13065 {
13066 if(!strcmp(value->name, id->string))
13067 break;
13068 }
13069 if(value)
13070 {
13071 const char * dts = c->dataTypeString;
13072
13073 FreeExpContents(exp);
13074 exp->type = 2;
13075 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
13076 }
13077 }
13078 }
13079 }
13080 break;
13081 }
13082 case 1:
13083 {
13084 ComputeInstantiation(exp);
13085 break;
13086 }
13087 case 4:
13088 {
13089 struct Expression * exp1, * exp2 = (((void *)0));
13090 struct Operand op1 =
13091 {
13092 0, 0, 0,
13093 .__anon1 = {
13094 .c = 0
13095 },
13096 {
13097 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13098 }
13099 };
13100 struct Operand op2 =
13101 {
13102 0, 0, 0,
13103 .__anon1 = {
13104 .c = 0
13105 },
13106 {
13107 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13108 }
13109 };
13110
13111 if(exp->__anon1.op.exp2)
13112 {
13113 struct Expression * e = exp->__anon1.op.exp2;
13114
13115 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13116 {
13117 if(e->type == 5 || e->type == 32 || e->type == 23)
13118 {
13119 if(e->type == 23)
13120 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13121 else
13122 e = (*e->__anon1.list).last;
13123 }
13124 }
13125 if(exp->__anon1.op.op == 261 && e && e->expType)
13126 {
13127 if(e->type == 3 && e->__anon1.__anon2.string)
13128 {
13129 char * string = e->__anon1.__anon2.string;
13130 int len = strlen(string);
13131 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13132
13133 len = UnescapeString(tmp, string + 1, len - 2);
13134 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13135 FreeExpContents(exp);
13136 exp->type = 2;
13137 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13138 }
13139 else
13140 {
13141 struct Type * type = e->expType;
13142
13143 type->refCount++;
13144 FreeExpContents(exp);
13145 exp->type = 2;
13146 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13147 FreeType(type);
13148 }
13149 break;
13150 }
13151 else
13152 ComputeExpression(exp->__anon1.op.exp2);
13153 }
13154 if(exp->__anon1.op.exp1)
13155 {
13156 ComputeExpression(exp->__anon1.op.exp1);
13157 exp1 = exp->__anon1.op.exp1;
13158 exp2 = exp->__anon1.op.exp2;
13159 op1 = GetOperand(exp1);
13160 if(op1.type)
13161 op1.type->refCount++;
13162 if(exp2)
13163 {
13164 op2 = GetOperand(exp2);
13165 if(op2.type)
13166 op2.type->refCount++;
13167 }
13168 }
13169 else
13170 {
13171 exp1 = exp->__anon1.op.exp2;
13172 op1 = GetOperand(exp1);
13173 if(op1.type)
13174 op1.type->refCount++;
13175 }
13176 CallOperator(exp, exp1, exp2, &op1, &op2);
13177 if(op1.type)
13178 FreeType(op1.type);
13179 if(op2.type)
13180 FreeType(op2.type);
13181 break;
13182 }
13183 case 5:
13184 case 32:
13185 {
13186 struct Expression * e, * n;
13187
13188 for(e = (*exp->__anon1.list).first; e; e = n)
13189 {
13190 n = e->next;
13191 if(!n)
13192 {
13193 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13194 struct Expression * prev = exp->prev;
13195 struct Expression * next = exp->next;
13196
13197 ComputeExpression(e);
13198 FreeType(exp->expType);
13199 FreeType(exp->destType);
13200 *exp = *e;
13201 exp->prev = prev;
13202 exp->next = next;
13203 ((e ? __extension__ ({
13204 void * __ecerePtrToDelete = (e);
13205
13206 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
13207 }) : 0), e = 0);
13208 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13209 }
13210 else
13211 {
13212 FreeExpression(e);
13213 }
13214 }
13215 break;
13216 }
13217 case 8:
13218 {
13219 struct Expression * memberExp = exp->__anon1.member.exp;
13220 struct Identifier * memberID = exp->__anon1.member.member;
13221 struct Type * type;
13222
13223 ComputeExpression(exp->__anon1.member.exp);
13224 type = exp->__anon1.member.exp->expType;
13225 if(type)
13226 {
13227 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)));
13228 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13229 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13230 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
13231
13232 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
13233 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13234 if(!_class)
13235 {
13236 char string[256];
13237 struct Symbol * classSym;
13238
13239 string[0] = '\0';
13240 PrintTypeNoConst(type, string, 0, 1);
13241 classSym = FindClass(string);
13242 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13243 }
13244 if(exp->__anon1.member.member)
13245 {
13246 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
13247 if(!prop)
13248 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
13249 }
13250 if(!prop && !member && _class && exp->__anon1.member.member)
13251 {
13252 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
13253
13254 convertTo = _class;
13255 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13256 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
13257 }
13258 if(prop)
13259 {
13260 if(prop->compiled)
13261 {
13262 struct Type * type = prop->dataType;
13263
13264 if(_class->type == 3)
13265 {
13266 if(type->kind == 8)
13267 {
13268 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13269
13270 if(_class->type == 3)
13271 {
13272 if(!_class->dataType)
13273 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13274 type = _class->dataType;
13275 }
13276 }
13277 switch(type->kind)
13278 {
13279 case 6:
13280 {
13281 float value;
13282 float (* Get)(float) = (void *)prop->Get;
13283
13284 GetFloat(exp->__anon1.member.exp, &value);
13285 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
13286 exp->type = 2;
13287 break;
13288 }
13289 case 7:
13290 {
13291 double value;
13292 double (* Get)(double);
13293
13294 GetDouble(exp->__anon1.member.exp, &value);
13295 if(convertTo)
13296 Get = (void *)prop->Set;
13297 else
13298 Get = (void *)prop->Get;
13299 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
13300 exp->type = 2;
13301 break;
13302 }
13303 }
13304 }
13305 else
13306 {
13307 if(convertTo)
13308 {
13309 struct Expression * value = exp->__anon1.member.exp;
13310 struct Type * type;
13311
13312 if(!prop->dataType)
13313 ProcessPropertyType(prop);
13314 type = prop->dataType;
13315 if(!type)
13316 {
13317 }
13318 else if(_class->type == 1)
13319 {
13320 switch(type->kind)
13321 {
13322 case 8:
13323 {
13324 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13325
13326 if(propertyClass->type == 1 && value->type == 1)
13327 {
13328 void (* Set)(void *, void *) = (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 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
13336 PopulateInstance(exp->__anon1.instance);
13337 }
13338 break;
13339 }
13340 case 3:
13341 {
13342 int intValue;
13343 void (* Set)(void *, int) = (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 GetInt(value, &intValue);
13351 Set(exp->__anon1.instance->data, intValue);
13352 PopulateInstance(exp->__anon1.instance);
13353 break;
13354 }
13355 case 4:
13356 {
13357 long long intValue;
13358 void (* Set)(void *, long long) = (void *)prop->Set;
13359
13360 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13361 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13362 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13363 exp->__anon1.instance->loc = exp->loc;
13364 exp->type = 1;
13365 GetInt64(value, &intValue);
13366 Set(exp->__anon1.instance->data, intValue);
13367 PopulateInstance(exp->__anon1.instance);
13368 break;
13369 }
13370 case 22:
13371 {
13372 intptr_t intValue;
13373 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13374
13375 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13376 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13377 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13378 exp->__anon1.instance->loc = exp->loc;
13379 exp->type = 1;
13380 GetIntPtr(value, &intValue);
13381 Set(exp->__anon1.instance->data, intValue);
13382 PopulateInstance(exp->__anon1.instance);
13383 break;
13384 }
13385 case 23:
13386 {
13387 ssize_t intValue;
13388 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13389
13390 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13391 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13392 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13393 exp->__anon1.instance->loc = exp->loc;
13394 exp->type = 1;
13395 GetIntSize(value, &intValue);
13396 Set(exp->__anon1.instance->data, intValue);
13397 PopulateInstance(exp->__anon1.instance);
13398 break;
13399 }
13400 case 6:
13401 {
13402 float floatValue;
13403 void (* Set)(void *, float) = (void *)prop->Set;
13404
13405 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13406 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13407 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13408 exp->__anon1.instance->loc = exp->loc;
13409 exp->type = 1;
13410 GetFloat(value, &floatValue);
13411 Set(exp->__anon1.instance->data, floatValue);
13412 PopulateInstance(exp->__anon1.instance);
13413 break;
13414 }
13415 case 7:
13416 {
13417 double doubleValue;
13418 void (* Set)(void *, double) = (void *)prop->Set;
13419
13420 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13421 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13422 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13423 exp->__anon1.instance->loc = exp->loc;
13424 exp->type = 1;
13425 GetDouble(value, &doubleValue);
13426 Set(exp->__anon1.instance->data, doubleValue);
13427 PopulateInstance(exp->__anon1.instance);
13428 break;
13429 }
13430 }
13431 }
13432 else if(_class->type == 2)
13433 {
13434 switch(type->kind)
13435 {
13436 case 8:
13437 {
13438 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13439
13440 if(propertyClass->type == 1 && value->__anon1.instance->data)
13441 {
13442 unsigned int (* Set)(void *) = (void *)prop->Set;
13443 unsigned int bits = Set(value->__anon1.instance->data);
13444
13445 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13446 exp->type = 2;
13447 break;
13448 }
13449 else if(_class->type == 2)
13450 {
13451 unsigned int value;
13452 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
13453 unsigned int bits;
13454
13455 GetUInt(exp->__anon1.member.exp, &value);
13456 bits = Set(value);
13457 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13458 exp->type = 2;
13459 }
13460 }
13461 }
13462 }
13463 }
13464 else
13465 {
13466 if(_class->type == 2)
13467 {
13468 unsigned int value;
13469
13470 GetUInt(exp->__anon1.member.exp, &value);
13471 switch(type->kind)
13472 {
13473 case 8:
13474 {
13475 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13476
13477 if(_class->type == 1)
13478 {
13479 void (* Get)(unsigned int, void *) = (void *)prop->Get;
13480
13481 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13482 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13483 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13484 exp->__anon1.instance->loc = exp->loc;
13485 exp->type = 1;
13486 Get(value, exp->__anon1.instance->data);
13487 PopulateInstance(exp->__anon1.instance);
13488 }
13489 else if(_class->type == 2)
13490 {
13491 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
13492 uint64 bits = Get(value);
13493
13494 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
13495 exp->type = 2;
13496 }
13497 break;
13498 }
13499 }
13500 }
13501 else if(_class->type == 1)
13502 {
13503 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
13504
13505 switch(type->kind)
13506 {
13507 case 8:
13508 {
13509 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13510
13511 if(_class->type == 1 && value)
13512 {
13513 void (* Get)(void *, void *) = (void *)prop->Get;
13514
13515 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13516 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13517 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13518 exp->__anon1.instance->loc = exp->loc;
13519 exp->type = 1;
13520 Get(value, exp->__anon1.instance->data);
13521 PopulateInstance(exp->__anon1.instance);
13522 }
13523 break;
13524 }
13525 }
13526 }
13527 }
13528 }
13529 }
13530 else
13531 {
13532 exp->isConstant = 0;
13533 }
13534 }
13535 else if(member)
13536 {
13537 }
13538 }
13539 if(exp->type != 8)
13540 {
13541 FreeExpression(memberExp);
13542 FreeIdentifier(memberID);
13543 }
13544 break;
13545 }
13546 case 10:
13547 {
13548 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
13549
13550 FreeExpContents(exp);
13551 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13552 exp->type = 2;
13553 FreeType(type);
13554 break;
13555 }
13556 case 15:
13557 {
13558 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
13559
13560 if(classSym && classSym->__anon1.registered)
13561 {
13562 if(classSym->__anon1.registered->fixed)
13563 {
13564 FreeSpecifier(exp->__anon1._class);
13565 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
13566 exp->type = 2;
13567 }
13568 else
13569 {
13570 char className[1024];
13571
13572 strcpy(className, "__ecereClass_");
13573 FullClassNameCat(className, classSym->string, 1);
13574 DeclareClass(curExternal, classSym, className);
13575 FreeExpContents(exp);
13576 exp->type = 9;
13577 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
13578 exp->__anon1.member.member = MkIdentifier("structSize");
13579 }
13580 }
13581 break;
13582 }
13583 case 11:
13584 {
13585 struct Type * type;
13586 struct Expression * e = exp;
13587
13588 if(exp->type == 11)
13589 {
13590 if(exp->__anon1.cast.exp)
13591 ComputeExpression(exp->__anon1.cast.exp);
13592 e = exp->__anon1.cast.exp;
13593 }
13594 if(e && exp->expType)
13595 {
13596 type = exp->expType;
13597 if(type->kind == 8)
13598 {
13599 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13600
13601 if(_class && (_class->type == 3 || _class->type == 2))
13602 {
13603 if(!_class->dataType)
13604 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13605 type = _class->dataType;
13606 }
13607 }
13608 switch(type->kind)
13609 {
13610 case 24:
13611 case 1:
13612 if(type->isSigned)
13613 {
13614 char value = 0;
13615
13616 if(GetChar(e, &value))
13617 {
13618 FreeExpContents(exp);
13619 exp->__anon1.__anon1.constant = PrintChar(value);
13620 exp->type = 2;
13621 }
13622 }
13623 else
13624 {
13625 unsigned char value = 0;
13626
13627 if(GetUChar(e, &value))
13628 {
13629 FreeExpContents(exp);
13630 exp->__anon1.__anon1.constant = PrintUChar(value);
13631 exp->type = 2;
13632 }
13633 }
13634 break;
13635 case 2:
13636 if(type->isSigned)
13637 {
13638 short value = 0;
13639
13640 if(GetShort(e, &value))
13641 {
13642 FreeExpContents(exp);
13643 exp->__anon1.__anon1.constant = PrintShort(value);
13644 exp->type = 2;
13645 }
13646 }
13647 else
13648 {
13649 unsigned short value = 0;
13650
13651 if(GetUShort(e, &value))
13652 {
13653 FreeExpContents(exp);
13654 exp->__anon1.__anon1.constant = PrintUShort(value);
13655 exp->type = 2;
13656 }
13657 }
13658 break;
13659 case 3:
13660 if(type->isSigned)
13661 {
13662 int value = 0;
13663
13664 if(GetInt(e, &value))
13665 {
13666 FreeExpContents(exp);
13667 exp->__anon1.__anon1.constant = PrintInt(value);
13668 exp->type = 2;
13669 }
13670 }
13671 else
13672 {
13673 unsigned int value = 0;
13674
13675 if(GetUInt(e, &value))
13676 {
13677 FreeExpContents(exp);
13678 exp->__anon1.__anon1.constant = PrintUInt(value);
13679 exp->type = 2;
13680 }
13681 }
13682 break;
13683 case 4:
13684 if(type->isSigned)
13685 {
13686 long long value = 0;
13687
13688 if(GetInt64(e, &value))
13689 {
13690 FreeExpContents(exp);
13691 exp->__anon1.__anon1.constant = PrintInt64(value);
13692 exp->type = 2;
13693 }
13694 }
13695 else
13696 {
13697 uint64 value = 0;
13698
13699 if(GetUInt64(e, &value))
13700 {
13701 FreeExpContents(exp);
13702 exp->__anon1.__anon1.constant = PrintUInt64(value);
13703 exp->type = 2;
13704 }
13705 }
13706 break;
13707 case 22:
13708 if(type->isSigned)
13709 {
13710 intptr_t value = 0;
13711
13712 if(GetIntPtr(e, &value))
13713 {
13714 FreeExpContents(exp);
13715 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13716 exp->type = 2;
13717 }
13718 }
13719 else
13720 {
13721 uintptr_t value = 0;
13722
13723 if(GetUIntPtr(e, &value))
13724 {
13725 FreeExpContents(exp);
13726 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13727 exp->type = 2;
13728 }
13729 }
13730 break;
13731 case 23:
13732 if(type->isSigned)
13733 {
13734 ssize_t value = 0;
13735
13736 if(GetIntSize(e, &value))
13737 {
13738 FreeExpContents(exp);
13739 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13740 exp->type = 2;
13741 }
13742 }
13743 else
13744 {
13745 size_t value = 0;
13746
13747 if(GetUIntSize(e, &value))
13748 {
13749 FreeExpContents(exp);
13750 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13751 exp->type = 2;
13752 }
13753 }
13754 break;
13755 case 6:
13756 {
13757 float value = 0;
13758
13759 if(GetFloat(e, &value))
13760 {
13761 FreeExpContents(exp);
13762 exp->__anon1.__anon1.constant = PrintFloat(value);
13763 exp->type = 2;
13764 }
13765 break;
13766 }
13767 case 7:
13768 {
13769 double value = 0;
13770
13771 if(GetDouble(e, &value))
13772 {
13773 FreeExpContents(exp);
13774 exp->__anon1.__anon1.constant = PrintDouble(value);
13775 exp->type = 2;
13776 }
13777 break;
13778 }
13779 }
13780 }
13781 break;
13782 }
13783 case 12:
13784 {
13785 struct Operand op1 =
13786 {
13787 0, 0, 0,
13788 .__anon1 = {
13789 .c = 0
13790 },
13791 {
13792 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13793 }
13794 };
13795 struct Operand op2 =
13796 {
13797 0, 0, 0,
13798 .__anon1 = {
13799 .c = 0
13800 },
13801 {
13802 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13803 }
13804 };
13805 struct Operand op3 =
13806 {
13807 0, 0, 0,
13808 .__anon1 = {
13809 .c = 0
13810 },
13811 {
13812 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13813 }
13814 };
13815
13816 if(exp->__anon1.cond.exp)
13817 ComputeExpression((*exp->__anon1.cond.exp).last);
13818 if(exp->__anon1.cond.elseExp)
13819 ComputeExpression(exp->__anon1.cond.elseExp);
13820 if(exp->__anon1.cond.cond)
13821 ComputeExpression(exp->__anon1.cond.cond);
13822 op1 = GetOperand(exp->__anon1.cond.cond);
13823 if(op1.type)
13824 op1.type->refCount++;
13825 op2 = GetOperand((*exp->__anon1.cond.exp).last);
13826 if(op2.type)
13827 op2.type->refCount++;
13828 op3 = GetOperand(exp->__anon1.cond.elseExp);
13829 if(op3.type)
13830 op3.type->refCount++;
13831 if(op1.ops.Cond)
13832 {
13833 FreeExpContents(exp);
13834 op1.ops.Cond(exp, &op1, &op2, &op3);
13835 }
13836 if(op1.type)
13837 FreeType(op1.type);
13838 if(op2.type)
13839 FreeType(op2.type);
13840 if(op3.type)
13841 FreeType(op3.type);
13842 break;
13843 }
13844 }
13845 }
13846
13847 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
13848 {
13849 struct __ecereNameSpace__ecere__com__Instance * module;
13850
13851 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))
13852 return 1;
13853 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))
13854 return 1;
13855 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))
13856 return 1;
13857 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)
13858 {
13859 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
13860 return 1;
13861 }
13862 return 0;
13863 }
13864
13865 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
13866 {
13867 struct Type * source;
13868 struct Type * realDest = dest;
13869 struct Type * backupSourceExpType = (((void *)0));
13870 struct Expression * nbExp = GetNonBracketsExp(sourceExp);
13871 struct Expression * computedExp = nbExp;
13872
13873 dest->refCount++;
13874 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)
13875 {
13876 computedExp = CopyExpression(nbExp);
13877 ComputeExpression(computedExp);
13878 }
13879 source = sourceExp->expType;
13880 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
13881 {
13882 if(computedExp != nbExp)
13883 {
13884 FreeExpression(computedExp);
13885 computedExp = nbExp;
13886 }
13887 FreeType(dest);
13888 return 1;
13889 }
13890 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
13891 {
13892 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
13893 {
13894 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
13895
13896 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
13897 ;
13898 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
13899 ;
13900 if(sourceBase == destBase)
13901 {
13902 if(computedExp != nbExp)
13903 {
13904 FreeExpression(computedExp);
13905 computedExp = nbExp;
13906 }
13907 FreeType(dest);
13908 return 1;
13909 }
13910 }
13911 }
13912 if(source)
13913 {
13914 struct __ecereNameSpace__ecere__sys__OldList * specs;
13915 unsigned int flag = 0;
13916 long long value = (((int)0x7fffffff));
13917
13918 source->refCount++;
13919 if(computedExp->type == 2)
13920 {
13921 if(source->isSigned)
13922 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13923 else
13924 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13925 }
13926 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
13927 {
13928 if(source->isSigned)
13929 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13930 else
13931 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13932 }
13933 if(computedExp != nbExp)
13934 {
13935 FreeExpression(computedExp);
13936 computedExp = nbExp;
13937 }
13938 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
13939 {
13940 FreeType(source);
13941 source = __extension__ ({
13942 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13943
13944 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
13945 });
13946 }
13947 if(dest->kind == 8)
13948 {
13949 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13950
13951 if(_class && _class->type == 3)
13952 {
13953 if(source->kind != 8)
13954 {
13955 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13956 struct Type * tempDest, * tempSource;
13957
13958 for(; _class->base->type != 1000; _class = _class->base)
13959 ;
13960 tempSource = dest;
13961 tempDest = tempType;
13962 tempType->kind = 8;
13963 if(!_class->symbol)
13964 _class->symbol = FindClass(_class->fullName);
13965 tempType->__anon1._class = _class->symbol;
13966 tempType->truth = dest->truth;
13967 if(tempType->__anon1._class)
13968 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13969 backupSourceExpType = sourceExp->expType;
13970 if(dest->passAsTemplate)
13971 {
13972 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13973 CopyTypeInto(sourceExp->expType, dest);
13974 sourceExp->expType->passAsTemplate = 0;
13975 }
13976 else
13977 {
13978 sourceExp->expType = dest;
13979 dest->refCount++;
13980 }
13981 flag = 1;
13982 ((tempType ? __extension__ ({
13983 void * __ecerePtrToDelete = (tempType);
13984
13985 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
13986 }) : 0), tempType = 0);
13987 }
13988 }
13989 if(_class && _class->type == 2 && source->kind != 8)
13990 {
13991 if(!dest->__anon1._class->__anon1.registered->dataType)
13992 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
13993 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13994 {
13995 FreeType(source);
13996 FreeType(sourceExp->expType);
13997 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
13998 source->refCount++;
13999 }
14000 }
14001 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
14002 {
14003 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14004 struct Declarator * decl;
14005 char string[1024];
14006
14007 ReadString(string, sourceExp->__anon1.__anon2.string);
14008 decl = SpecDeclFromString(string, specs, (((void *)0)));
14009 FreeExpContents(sourceExp);
14010 FreeType(sourceExp->expType);
14011 sourceExp->type = 24;
14012 sourceExp->__anon1._classExp.specifiers = specs;
14013 sourceExp->__anon1._classExp.decl = decl;
14014 sourceExp->expType = dest;
14015 dest->refCount++;
14016 FreeType(source);
14017 FreeType(dest);
14018 if(backupSourceExpType)
14019 FreeType(backupSourceExpType);
14020 return 1;
14021 }
14022 }
14023 else if(source->kind == 8)
14024 {
14025 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
14026
14027 if(_class && (_class->type == 3 || _class->type == 2))
14028 {
14029 if(dest->kind != 8)
14030 {
14031 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14032 struct Type * tempDest, * tempSource;
14033
14034 if(!source->__anon1._class->__anon1.registered->dataType)
14035 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
14036 for(; _class->base->type != 1000; _class = _class->base)
14037 ;
14038 tempDest = source;
14039 tempSource = tempType;
14040 tempType->kind = 8;
14041 tempType->__anon1._class = FindClass(_class->fullName);
14042 tempType->truth = source->truth;
14043 tempType->classObjectType = source->classObjectType;
14044 if(tempType->__anon1._class)
14045 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14046 if(conversions && conversions->last)
14047 {
14048 ((struct Conversion *)conversions->last)->resultType = dest;
14049 dest->refCount++;
14050 }
14051 FreeType(sourceExp->expType);
14052 sourceExp->expType = MkClassType(_class->fullName);
14053 sourceExp->expType->truth = source->truth;
14054 sourceExp->expType->classObjectType = source->classObjectType;
14055 if(!sourceExp->destType)
14056 {
14057 FreeType(sourceExp->destType);
14058 sourceExp->destType = sourceExp->expType;
14059 if(sourceExp->expType)
14060 sourceExp->expType->refCount++;
14061 }
14062 if(!_class->dataType)
14063 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14064 FreeType(dest);
14065 dest = MkClassType(source->__anon1._class->string);
14066 dest->truth = source->truth;
14067 dest->classObjectType = source->classObjectType;
14068 FreeType(source);
14069 source = _class->dataType;
14070 source->refCount++;
14071 ((tempType ? __extension__ ({
14072 void * __ecerePtrToDelete = (tempType);
14073
14074 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
14075 }) : 0), tempType = 0);
14076 }
14077 }
14078 }
14079 if(!flag)
14080 {
14081 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
14082 {
14083 FreeType(source);
14084 FreeType(dest);
14085 return 1;
14086 }
14087 }
14088 if(dest->kind == 8)
14089 {
14090 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
14091 unsigned int fittingValue = 0;
14092
14093 if(_class && _class->type == 4)
14094 {
14095 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14096 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14097
14098 if(c && value >= 0 && value <= c->largest)
14099 fittingValue = 1;
14100 }
14101 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
14102 {
14103 if(_class->type == 0 || _class->type == 5)
14104 {
14105 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14106
14107 *newExp = *sourceExp;
14108 if(sourceExp->destType)
14109 sourceExp->destType->refCount++;
14110 if(sourceExp->expType)
14111 sourceExp->expType->refCount++;
14112 sourceExp->type = 11;
14113 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
14114 sourceExp->__anon1.cast.exp = newExp;
14115 FreeType(sourceExp->expType);
14116 sourceExp->expType = (((void *)0));
14117 ProcessExpressionType(sourceExp);
14118 if(!inCompiler)
14119 {
14120 FreeType(sourceExp->expType);
14121 sourceExp->expType = dest;
14122 }
14123 FreeType(source);
14124 if(inCompiler)
14125 FreeType(dest);
14126 if(backupSourceExpType)
14127 FreeType(backupSourceExpType);
14128 return 1;
14129 }
14130 if(!_class->dataType)
14131 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14132 FreeType(dest);
14133 dest = _class->dataType;
14134 dest->refCount++;
14135 }
14136 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))
14137 {
14138 specs = MkListOne(MkSpecifier(DOUBLE));
14139 }
14140 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))
14141 {
14142 specs = MkListOne(MkSpecifier(FLOAT));
14143 }
14144 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))
14145 {
14146 specs = MkList();
14147 if(!dest->isSigned)
14148 ListAdd(specs, MkSpecifier(UNSIGNED));
14149 ListAdd(specs, MkSpecifier(INT64));
14150 }
14151 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
14152 {
14153 specs = MkList();
14154 if(!dest->isSigned)
14155 ListAdd(specs, MkSpecifier(UNSIGNED));
14156 ListAdd(specs, MkSpecifier(INT));
14157 }
14158 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14159 {
14160 specs = MkList();
14161 if(!dest->isSigned)
14162 ListAdd(specs, MkSpecifier(UNSIGNED));
14163 ListAdd(specs, MkSpecifier(SHORT));
14164 }
14165 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14166 {
14167 specs = MkList();
14168 if(!dest->isSigned)
14169 ListAdd(specs, MkSpecifier(UNSIGNED));
14170 ListAdd(specs, MkSpecifier(CHAR));
14171 }
14172 else
14173 {
14174 FreeType(source);
14175 FreeType(dest);
14176 if(backupSourceExpType)
14177 {
14178 if(sourceExp->expType)
14179 FreeType(sourceExp->expType);
14180 sourceExp->expType = backupSourceExpType;
14181 }
14182 return 0;
14183 }
14184 }
14185 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))
14186 {
14187 specs = MkListOne(MkSpecifier(DOUBLE));
14188 }
14189 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))
14190 {
14191 specs = MkListOne(MkSpecifier(FLOAT));
14192 }
14193 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
14194 {
14195 specs = MkList();
14196 ListAdd(specs, MkSpecifier(BOOL));
14197 }
14198 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)))
14199 {
14200 if(source->kind == 3)
14201 {
14202 FreeType(dest);
14203 FreeType(source);
14204 if(backupSourceExpType)
14205 FreeType(backupSourceExpType);
14206 return 1;
14207 }
14208 else
14209 {
14210 specs = MkList();
14211 if(!dest->isSigned)
14212 ListAdd(specs, MkSpecifier(UNSIGNED));
14213 ListAdd(specs, MkSpecifier(CHAR));
14214 }
14215 }
14216 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)))))
14217 {
14218 if(source->kind == 3)
14219 {
14220 FreeType(dest);
14221 FreeType(source);
14222 if(backupSourceExpType)
14223 FreeType(backupSourceExpType);
14224 return 1;
14225 }
14226 else
14227 {
14228 specs = MkList();
14229 if(!dest->isSigned)
14230 ListAdd(specs, MkSpecifier(UNSIGNED));
14231 ListAdd(specs, MkSpecifier(SHORT));
14232 }
14233 }
14234 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
14235 {
14236 specs = MkList();
14237 if(!dest->isSigned)
14238 ListAdd(specs, MkSpecifier(UNSIGNED));
14239 ListAdd(specs, MkSpecifier(INT));
14240 }
14241 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
14242 {
14243 specs = MkList();
14244 if(!dest->isSigned)
14245 ListAdd(specs, MkSpecifier(UNSIGNED));
14246 ListAdd(specs, MkSpecifier(INT64));
14247 }
14248 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
14249 {
14250 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
14251 }
14252 else
14253 {
14254 FreeType(source);
14255 FreeType(dest);
14256 if(backupSourceExpType)
14257 {
14258 if(sourceExp->expType)
14259 FreeType(sourceExp->expType);
14260 sourceExp->expType = backupSourceExpType;
14261 }
14262 return 0;
14263 }
14264 if(!flag && !sourceExp->opDestType)
14265 {
14266 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14267
14268 *newExp = *sourceExp;
14269 newExp->prev = (((void *)0));
14270 newExp->next = (((void *)0));
14271 if(sourceExp->destType)
14272 sourceExp->destType->refCount++;
14273 if(sourceExp->expType)
14274 sourceExp->expType->refCount++;
14275 sourceExp->type = 11;
14276 if(realDest->kind == 8)
14277 {
14278 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
14279 FreeList(specs, (void *)(FreeSpecifier));
14280 }
14281 else
14282 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
14283 if(newExp->type == 4)
14284 {
14285 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
14286 }
14287 else
14288 sourceExp->__anon1.cast.exp = newExp;
14289 FreeType(sourceExp->expType);
14290 sourceExp->expType = (((void *)0));
14291 ProcessExpressionType(sourceExp);
14292 }
14293 else
14294 FreeList(specs, (void *)(FreeSpecifier));
14295 FreeType(dest);
14296 FreeType(source);
14297 if(backupSourceExpType)
14298 FreeType(backupSourceExpType);
14299 return 1;
14300 }
14301 else
14302 {
14303 if(computedExp != nbExp)
14304 {
14305 FreeExpression(computedExp);
14306 computedExp = nbExp;
14307 }
14308 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
14309 sourceExp = (*sourceExp->__anon1.list).last;
14310 if(sourceExp->type == 0)
14311 {
14312 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
14313
14314 if(dest->kind == 8)
14315 {
14316 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
14317 {
14318 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
14319 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14320
14321 if(enumClass)
14322 {
14323 for(; _class && _class->type == 4; _class = _class->base)
14324 {
14325 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
14326 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14327
14328 for(value = e->values.first; value; value = value->next)
14329 {
14330 if(!strcmp(value->name, id->string))
14331 break;
14332 }
14333 if(value)
14334 {
14335 FreeType(sourceExp->expType);
14336 sourceExp->isConstant = 1;
14337 sourceExp->expType = MkClassType(_class->fullName);
14338 if(inCompiler || inPreCompiler || inDebugger)
14339 {
14340 FreeExpContents(sourceExp);
14341 sourceExp->type = 2;
14342 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
14343 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
14344 else
14345 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
14346 }
14347 FreeType(dest);
14348 return 1;
14349 }
14350 }
14351 }
14352 }
14353 }
14354 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
14355 {
14356 FreeType(dest);
14357 return 1;
14358 }
14359 }
14360 FreeType(dest);
14361 }
14362 return 0;
14363 }
14364
14365 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
14366 {
14367 unsigned int result = 1;
14368
14369 if(destType)
14370 {
14371 struct __ecereNameSpace__ecere__sys__OldList converts =
14372 {
14373 0, 0, 0, 0, 0
14374 };
14375 struct Conversion * convert;
14376
14377 if(destType->kind == 0)
14378 return 0;
14379 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
14380 result = 0;
14381 if(converts.count)
14382 {
14383 for(convert = converts.first; convert; convert = convert->next)
14384 {
14385 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
14386
14387 if(!empty)
14388 {
14389 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14390 int objectType = exp->expType ? exp->expType->classObjectType : 0;
14391
14392 *newExp = *exp;
14393 newExp->prev = (((void *)0));
14394 newExp->next = (((void *)0));
14395 newExp->destType = (((void *)0));
14396 if(convert->isGet)
14397 {
14398 exp->type = 8;
14399 exp->addedThis = 1;
14400 exp->__anon1.member.exp = newExp;
14401 FreeType(exp->__anon1.member.exp->expType);
14402 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
14403 exp->__anon1.member.exp->expType->classObjectType = objectType;
14404 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
14405 exp->__anon1.member.memberType = 1;
14406 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14407 exp->needCast = 1;
14408 if(exp->expType)
14409 exp->expType->refCount++;
14410 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14411 }
14412 else
14413 {
14414 {
14415 exp->type = 8;
14416 exp->addedThis = 1;
14417 exp->__anon1.member.exp = newExp;
14418 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)
14419 {
14420 newExp->byReference = 1;
14421 }
14422 FreeType(exp->__anon1.member.exp->expType);
14423 exp->__anon1.member.exp->expType = (((void *)0));
14424 if(convert->convert->dataType)
14425 {
14426 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14427 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
14428 exp->__anon1.member.exp->expType->refCount = 1;
14429 exp->__anon1.member.exp->expType->classObjectType = objectType;
14430 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14431 }
14432 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
14433 exp->__anon1.member.memberType = 4;
14434 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14435 exp->needCast = 1;
14436 if(convert->resultType)
14437 convert->resultType->refCount++;
14438 }
14439 }
14440 }
14441 else
14442 {
14443 FreeType(exp->expType);
14444 if(convert->isGet)
14445 {
14446 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14447 if(exp->destType->casted)
14448 exp->needCast = 1;
14449 if(exp->expType)
14450 exp->expType->refCount++;
14451 }
14452 else
14453 {
14454 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14455 if(exp->destType->casted)
14456 exp->needCast = 1;
14457 if(convert->resultType)
14458 convert->resultType->refCount++;
14459 }
14460 }
14461 }
14462 if(exp->isConstant && inCompiler)
14463 ComputeExpression(exp);
14464 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
14465 }
14466 if(!result && exp->expType && converts.count)
14467 {
14468 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14469 }
14470 if(!result && exp->expType && exp->destType)
14471 {
14472 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))
14473 result = 1;
14474 }
14475 }
14476 return result;
14477 }
14478
14479 static void ProcessFunction(struct FunctionDefinition *  function);
14480
14481 void ProcessInstantiationType(struct Instantiation * inst)
14482 {
14483 yylloc = inst->loc;
14484 if(inst->_class)
14485 {
14486 struct MembersInit * members;
14487 struct Symbol * classSym;
14488 struct __ecereNameSpace__ecere__com__Class * _class;
14489
14490 classSym = inst->_class->__anon1.__anon1.symbol;
14491 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14492 if(!_class || _class->type != 5)
14493 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14494 afterExternal = afterExternal ? afterExternal : curExternal;
14495 if(inst->exp)
14496 ProcessExpressionType(inst->exp);
14497 inst->isConstant = 1;
14498 if(inst->members)
14499 {
14500 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14501 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14502 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14503 int subMemberStackPos = 0;
14504
14505 for(members = (*inst->members).first; members; members = members->next)
14506 {
14507 switch(members->type)
14508 {
14509 case 1:
14510 {
14511 char name[1024];
14512 static unsigned int instMethodID = 0;
14513 struct External * external = curExternal;
14514 struct Context * context = curContext;
14515 struct Declarator * declarator = members->__anon1.function->declarator;
14516 struct Identifier * nameID = GetDeclId(declarator);
14517 char * unmangled = nameID ? nameID->string : (((void *)0));
14518 struct Expression * exp;
14519 struct External * createdExternal = (((void *)0));
14520
14521 if(inCompiler)
14522 {
14523 char number[16];
14524
14525 strcpy(name, "__ecereInstMeth_");
14526 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14527 strcat(name, "_");
14528 strcat(name, nameID->string);
14529 strcat(name, "_");
14530 sprintf(number, "_%08d", instMethodID++);
14531 strcat(name, number);
14532 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14533 }
14534 if(declarator)
14535 {
14536 struct Symbol * symbol = declarator->symbol;
14537 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14538
14539 if(method && method->type == 1)
14540 {
14541 symbol->__anon1.method = method;
14542 ProcessMethodType(method);
14543 if(!symbol->type->__anon1.__anon2.thisClass)
14544 {
14545 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14546 {
14547 if(!currentClass->symbol)
14548 currentClass->symbol = FindClass(currentClass->fullName);
14549 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14550 }
14551 else
14552 {
14553 if(!_class->symbol)
14554 _class->symbol = FindClass(_class->fullName);
14555 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14556 }
14557 }
14558 DeclareType(curExternal, symbol->type, 1, 1);
14559 }
14560 else if(classSym)
14561 {
14562 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14563 }
14564 }
14565 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14566 if(nameID)
14567 {
14568 FreeSpecifier(nameID->_class);
14569 nameID->_class = (((void *)0));
14570 }
14571 curExternal = createdExternal;
14572 if(inCompiler)
14573 {
14574 if(createdExternal->__anon1.function)
14575 ProcessFunction(createdExternal->__anon1.function);
14576 }
14577 else if(declarator)
14578 {
14579 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14580 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14581 }
14582 curExternal = external;
14583 curContext = context;
14584 if(inCompiler)
14585 {
14586 FreeClassFunction(members->__anon1.function);
14587 exp = QMkExpId(name);
14588 members->type = 0;
14589 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14590 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14591 }
14592 break;
14593 }
14594 case 0:
14595 {
14596 if(members->__anon1.dataMembers && classSym)
14597 {
14598 struct MemberInit * member;
14599 struct Location oldyyloc = yylloc;
14600
14601 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14602 {
14603 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14604 if(member->initializer && !member->initializer->isConstant)
14605 inst->isConstant = 0;
14606 }
14607 yylloc = oldyyloc;
14608 }
14609 break;
14610 }
14611 }
14612 }
14613 }
14614 }
14615 }
14616
14617 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14618
14619 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14620 {
14621 switch(spec->type)
14622 {
14623 case 0:
14624 {
14625 if(spec->__anon1.specifier == THISCLASS)
14626 {
14627 if(thisClass)
14628 {
14629 spec->type = 1;
14630 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14631 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14632 ProcessSpecifier(spec, declareStruct, 0);
14633 }
14634 }
14635 break;
14636 }
14637 case 1:
14638 {
14639 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14640
14641 if(symbol)
14642 DeclareType(curExternal, symbol->type, 1, 1);
14643 else if(spec->__anon1.__anon1.symbol)
14644 {
14645 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14646
14647 if(warnClasses && !c)
14648 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14649 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14650 }
14651 break;
14652 }
14653 case 2:
14654 {
14655 struct Enumerator * e;
14656
14657 if(spec->__anon1.__anon2.list)
14658 {
14659 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14660 {
14661 if(e->exp)
14662 ProcessExpressionType(e->exp);
14663 }
14664 }
14665 if(inCompiler)
14666 break;
14667 }
14668 case 3:
14669 case 4:
14670 {
14671 if(spec->__anon1.__anon2.definitions)
14672 {
14673 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14674
14675 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14676 }
14677 break;
14678 }
14679 }
14680 }
14681
14682 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14683 {
14684 switch(decl->type)
14685 {
14686 case 1:
14687 if(decl->__anon1.identifier->classSym)
14688 {
14689 FreeSpecifier(decl->__anon1.identifier->_class);
14690 decl->__anon1.identifier->_class = (((void *)0));
14691 }
14692 break;
14693 case 3:
14694 if(decl->__anon1.array.exp)
14695 ProcessExpressionType(decl->__anon1.array.exp);
14696 case 0:
14697 case 2:
14698 case 4:
14699 case 5:
14700 case 6:
14701 case 7:
14702 {
14703 struct Identifier * id = (((void *)0));
14704 struct Specifier * classSpec = (((void *)0));
14705
14706 if(decl->type == 4)
14707 {
14708 id = GetDeclId(decl);
14709 if(id && id->_class)
14710 {
14711 classSpec = id->_class;
14712 id->_class = (((void *)0));
14713 }
14714 }
14715 if(decl->declarator)
14716 ProcessDeclarator(decl->declarator, isFunction);
14717 if(decl->type == 4)
14718 {
14719 if(classSpec)
14720 {
14721 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14722
14723 if(!decl->__anon1.function.parameters)
14724 decl->__anon1.function.parameters = MkList();
14725 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14726 }
14727 if(decl->__anon1.function.parameters)
14728 {
14729 struct TypeName * param;
14730
14731 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14732 {
14733 if(param->qualifiers)
14734 {
14735 struct Specifier * spec;
14736
14737 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14738 {
14739 if(spec->type == 0)
14740 {
14741 if(spec->__anon1.specifier == TYPED_OBJECT)
14742 {
14743 struct Declarator * d = param->declarator;
14744 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);
14745
14746 if(!d || d->type != 5)
14747 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14748 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14749 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14750 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14751 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14752 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14753 param = newParam;
14754 break;
14755 }
14756 else if(spec->__anon1.specifier == ANY_OBJECT)
14757 {
14758 struct Declarator * d = param->declarator;
14759
14760 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14761 param->qualifiers = MkListOne(MkSpecifier(VOID));
14762 if(!d || d->type != 5)
14763 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14764 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14765 break;
14766 }
14767 else if(spec->__anon1.specifier == THISCLASS)
14768 {
14769 if(thisClass)
14770 {
14771 spec->type = 1;
14772 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14773 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14774 ProcessSpecifier(spec, 0, 0);
14775 }
14776 break;
14777 }
14778 }
14779 else if(spec->type == 1)
14780 {
14781 ProcessSpecifier(spec, isFunction, 1);
14782 }
14783 else if((spec->type == 3 || spec->type == 4) && !spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id && spec->__anon1.__anon2.id->string)
14784 {
14785 struct Declarator * d = param->declarator;
14786
14787 if(!d || d->type != 5)
14788 DeclareStruct(curExternal, spec->__anon1.__anon2.id->string, 0, 1);
14789 }
14790 }
14791 }
14792 if(param->declarator)
14793 ProcessDeclarator(param->declarator, 0);
14794 }
14795 }
14796 }
14797 break;
14798 }
14799 }
14800 }
14801
14802 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14803 {
14804 yylloc = decl->loc;
14805 switch(decl->type)
14806 {
14807 case 1:
14808 {
14809 unsigned int declareStruct = 0;
14810
14811 if(decl->__anon1.__anon1.declarators)
14812 {
14813 struct InitDeclarator * d;
14814
14815 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14816 {
14817 struct Type * type, * subType;
14818
14819 ProcessDeclarator(d->declarator, 0);
14820 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14821 if(d->initializer)
14822 {
14823 ProcessInitializer(d->initializer, type);
14824 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14825 {
14826 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14827 {
14828 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14829
14830 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14831 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14832 if(decl->__anon1.__anon1.specifiers)
14833 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14834 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14835 d = (((void *)0));
14836 decl->type = 2;
14837 decl->__anon1.inst = inst;
14838 }
14839 }
14840 }
14841 for(subType = type; subType; )
14842 {
14843 if(subType->kind == 8)
14844 {
14845 declareStruct = 1;
14846 break;
14847 }
14848 else if(subType->kind == 13)
14849 break;
14850 else if(subType->kind == 12)
14851 subType = subType->__anon1.__anon4.arrayType;
14852 else
14853 break;
14854 }
14855 FreeType(type);
14856 if(!d)
14857 break;
14858 }
14859 }
14860 if(decl->__anon1.__anon1.specifiers)
14861 {
14862 struct Specifier * s;
14863
14864 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
14865 {
14866 ProcessSpecifier(s, declareStruct, 1);
14867 }
14868 }
14869 break;
14870 }
14871 case 2:
14872 {
14873 ProcessInstantiationType(decl->__anon1.inst);
14874 break;
14875 }
14876 case 0:
14877 {
14878 struct Specifier * spec;
14879 struct Declarator * d;
14880 unsigned int declareStruct = 0;
14881
14882 if(decl->__anon1.__anon1.declarators)
14883 {
14884 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14885 {
14886 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14887 struct Type * subType;
14888
14889 ProcessDeclarator(d, 0);
14890 for(subType = type; subType; )
14891 {
14892 if(subType->kind == 8)
14893 {
14894 declareStruct = 1;
14895 break;
14896 }
14897 else if(subType->kind == 13)
14898 break;
14899 else if(subType->kind == 12)
14900 subType = subType->__anon1.__anon4.arrayType;
14901 else
14902 break;
14903 }
14904 FreeType(type);
14905 }
14906 }
14907 if(decl->__anon1.__anon1.specifiers)
14908 {
14909 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
14910 ProcessSpecifier(spec, declareStruct, warnClasses);
14911 }
14912 break;
14913 }
14914 }
14915 }
14916
14917 static void ProcessStatement(struct Statement * stmt)
14918 {
14919 yylloc = stmt->loc;
14920 switch(stmt->type)
14921 {
14922 case 0:
14923 ProcessStatement(stmt->__anon1.labeled.stmt);
14924 break;
14925 case 1:
14926 if(stmt->__anon1.caseStmt.exp)
14927 {
14928 FreeType(stmt->__anon1.caseStmt.exp->destType);
14929 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
14930 if(curSwitchType)
14931 curSwitchType->refCount++;
14932 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
14933 ComputeExpression(stmt->__anon1.caseStmt.exp);
14934 }
14935 if(stmt->__anon1.caseStmt.stmt)
14936 ProcessStatement(stmt->__anon1.caseStmt.stmt);
14937 break;
14938 case 2:
14939 {
14940 if(stmt->__anon1.compound.context)
14941 {
14942 struct Declaration * decl;
14943 struct Statement * s;
14944 struct Statement * prevCompound = curCompound;
14945 struct Context * prevContext = curContext;
14946
14947 if(!stmt->__anon1.compound.isSwitch)
14948 curCompound = stmt;
14949 curContext = stmt->__anon1.compound.context;
14950 if(stmt->__anon1.compound.declarations)
14951 {
14952 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
14953 ProcessDeclaration(decl, 1);
14954 }
14955 if(stmt->__anon1.compound.statements)
14956 {
14957 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
14958 ProcessStatement(s);
14959 }
14960 curContext = prevContext;
14961 curCompound = prevCompound;
14962 }
14963 break;
14964 }
14965 case 3:
14966 {
14967 struct Expression * exp;
14968
14969 if(stmt->__anon1.expressions)
14970 {
14971 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14972 ProcessExpressionType(exp);
14973 }
14974 break;
14975 }
14976 case 4:
14977 {
14978 struct Expression * exp;
14979
14980 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
14981 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
14982 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
14983 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
14984 {
14985 ProcessExpressionType(exp);
14986 }
14987 if(stmt->__anon1.ifStmt.stmt)
14988 ProcessStatement(stmt->__anon1.ifStmt.stmt);
14989 if(stmt->__anon1.ifStmt.elseStmt)
14990 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
14991 break;
14992 }
14993 case 5:
14994 {
14995 struct Type * oldSwitchType = curSwitchType;
14996
14997 if(stmt->__anon1.switchStmt.exp)
14998 {
14999 struct Expression * exp;
15000
15001 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
15002 {
15003 if(!exp->next)
15004 {
15005 ProcessExpressionType(exp);
15006 }
15007 if(!exp->next)
15008 curSwitchType = exp->expType;
15009 }
15010 }
15011 ProcessStatement(stmt->__anon1.switchStmt.stmt);
15012 curSwitchType = oldSwitchType;
15013 break;
15014 }
15015 case 6:
15016 {
15017 if(stmt->__anon1.whileStmt.exp)
15018 {
15019 struct Expression * exp;
15020
15021 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
15022 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
15023 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
15024 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
15025 {
15026 ProcessExpressionType(exp);
15027 }
15028 }
15029 if(stmt->__anon1.whileStmt.stmt)
15030 ProcessStatement(stmt->__anon1.whileStmt.stmt);
15031 break;
15032 }
15033 case 7:
15034 {
15035 if(stmt->__anon1.doWhile.exp)
15036 {
15037 struct Expression * exp;
15038
15039 if((*stmt->__anon1.doWhile.exp).last)
15040 {
15041 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
15042 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
15043 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
15044 }
15045 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
15046 {
15047 ProcessExpressionType(exp);
15048 }
15049 }
15050 if(stmt->__anon1.doWhile.stmt)
15051 ProcessStatement(stmt->__anon1.doWhile.stmt);
15052 break;
15053 }
15054 case 8:
15055 {
15056 struct Expression * exp;
15057
15058 if(stmt->__anon1.forStmt.init)
15059 ProcessStatement(stmt->__anon1.forStmt.init);
15060 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
15061 {
15062 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
15063 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
15064 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
15065 }
15066 if(stmt->__anon1.forStmt.check)
15067 ProcessStatement(stmt->__anon1.forStmt.check);
15068 if(stmt->__anon1.forStmt.increment)
15069 {
15070 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
15071 ProcessExpressionType(exp);
15072 }
15073 if(stmt->__anon1.forStmt.stmt)
15074 ProcessStatement(stmt->__anon1.forStmt.stmt);
15075 break;
15076 }
15077 case 18:
15078 {
15079 struct Identifier * id = stmt->__anon1.forEachStmt.id;
15080 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
15081 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
15082 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
15083 char iteratorType[1024];
15084 struct Type * source;
15085 struct Expression * e;
15086 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));
15087 struct Expression * arrayExp;
15088 const char * typeString = (((void *)0));
15089 int builtinCount = 0;
15090
15091 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15092 {
15093 if(!e->next)
15094 {
15095 FreeType(e->destType);
15096 e->destType = ProcessTypeString("Container", 0);
15097 }
15098 if(!isBuiltin || e->next)
15099 ProcessExpressionType(e);
15100 }
15101 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15102 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)))
15103 {
15104 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
15105 struct Symbol * symbol;
15106 struct Expression * expIt = (((void *)0));
15107 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
15108 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15109 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15110 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15111
15112 if(inCompiler)
15113 {
15114 stmt->type = 2;
15115 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15116 stmt->__anon1.compound.context->parent = curContext;
15117 curContext = stmt->__anon1.compound.context;
15118 }
15119 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
15120 {
15121 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15122
15123 isCustomAVLTree = 1;
15124 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
15125 isMap = 1;
15126 }
15127 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15128 isArray = 1;
15129 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15130 {
15131 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15132
15133 isLinkList = 1;
15134 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15135 }
15136 if(inCompiler && isArray)
15137 {
15138 struct Declarator * decl;
15139 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15140
15141 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15142 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15143 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15144 }
15145 else if(isBuiltin)
15146 {
15147 struct Type * type = (((void *)0));
15148 char typeStringBuf[1024];
15149
15150 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15151 if(((struct Expression *)(*exp).last)->type == 11)
15152 {
15153 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15154
15155 if(typeName)
15156 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15157 }
15158 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)
15159 {
15160 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15161
15162 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15163 }
15164 else if(arrayExp->__anon1.list)
15165 {
15166 struct Expression * e;
15167
15168 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15169 {
15170 ProcessExpressionType(e);
15171 if(e->expType)
15172 {
15173 if(!type)
15174 {
15175 type = e->expType;
15176 type->refCount++;
15177 }
15178 else
15179 {
15180 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15181 {
15182 FreeType(type);
15183 type = e->expType;
15184 e->expType = (((void *)0));
15185 e = (*arrayExp->__anon1.list).first;
15186 ProcessExpressionType(e);
15187 if(e->expType)
15188 {
15189 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15190 {
15191 FreeType(e->expType);
15192 e->expType = (((void *)0));
15193 FreeType(type);
15194 type = (((void *)0));
15195 break;
15196 }
15197 }
15198 }
15199 }
15200 if(e->expType)
15201 {
15202 FreeType(e->expType);
15203 e->expType = (((void *)0));
15204 }
15205 }
15206 }
15207 if(type)
15208 {
15209 typeStringBuf[0] = '\0';
15210 PrintType(type, typeStringBuf, 0, 1);
15211 typeString = typeStringBuf;
15212 FreeType(type);
15213 }
15214 }
15215 if(typeString)
15216 {
15217 if(inCompiler)
15218 {
15219 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15220 struct Declarator * decl;
15221 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15222
15223 if(arrayExp->__anon1.list)
15224 {
15225 struct Expression * e;
15226
15227 builtinCount = (*arrayExp->__anon1.list).count;
15228 type = ProcessTypeString(typeString, 0);
15229 while((e = (*arrayExp->__anon1.list).first))
15230 {
15231 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15232 e->destType = type;
15233 type->refCount++;
15234 ProcessExpressionType(e);
15235 if(inCompiler)
15236 ListAdd(initializers, MkInitializerAssignment(e));
15237 }
15238 FreeType(type);
15239 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15240 }
15241 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15242 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15243 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15244 FreeList(exp, (void *)(FreeExpression));
15245 }
15246 else if(arrayExp->__anon1.list)
15247 {
15248 struct Expression * e;
15249
15250 type = ProcessTypeString(typeString, 0);
15251 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15252 {
15253 e->destType = type;
15254 type->refCount++;
15255 ProcessExpressionType(e);
15256 }
15257 FreeType(type);
15258 }
15259 }
15260 else
15261 {
15262 arrayExp->expType = ProcessTypeString("Container", 0);
15263 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15264 }
15265 }
15266 else if(inCompiler && isLinkList && !isList)
15267 {
15268 struct Declarator * decl;
15269 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15270
15271 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15272 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15273 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15274 }
15275 else if(inCompiler && _class->templateArgs)
15276 {
15277 if(isMap)
15278 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15279 else
15280 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15281 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)))))))));
15282 }
15283 if(inCompiler)
15284 {
15285 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15286 if(block)
15287 {
15288 switch(block->type)
15289 {
15290 case 2:
15291 if(block->__anon1.compound.context)
15292 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15293 break;
15294 case 4:
15295 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15296 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15297 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15298 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15299 break;
15300 case 5:
15301 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15302 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15303 break;
15304 case 6:
15305 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15306 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15307 break;
15308 case 7:
15309 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15310 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15311 break;
15312 case 8:
15313 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15314 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15315 break;
15316 case 18:
15317 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15318 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15319 break;
15320 }
15321 }
15322 if(filter)
15323 {
15324 block = MkIfStmt(filter, block, (((void *)0)));
15325 }
15326 if(isArray)
15327 {
15328 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));
15329 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15330 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15331 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15332 }
15333 else if(isBuiltin)
15334 {
15335 char count[128];
15336
15337 sprintf(count, "%d", builtinCount);
15338 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));
15339 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15340 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15341 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15342 }
15343 else if(isLinkList && !isList)
15344 {
15345 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15346 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15347
15348 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15349 {
15350 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));
15351 }
15352 else
15353 {
15354 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15355 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15356
15357 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));
15358 }
15359 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15360 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15361 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15362 }
15363 else
15364 {
15365 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15366 }
15367 ProcessExpressionType(expIt);
15368 if((*stmt->__anon1.compound.declarations).first)
15369 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15370 if(symbol)
15371 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15372 ProcessStatement(stmt);
15373 }
15374 else
15375 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15376 if(inCompiler)
15377 curContext = stmt->__anon1.compound.context->parent;
15378 break;
15379 }
15380 else
15381 {
15382 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15383 }
15384 break;
15385 }
15386 case 9:
15387 break;
15388 case 10:
15389 break;
15390 case 11:
15391 break;
15392 case 12:
15393 {
15394 struct Expression * exp;
15395
15396 if(stmt->__anon1.expressions)
15397 {
15398 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15399 {
15400 if(!exp->next)
15401 {
15402 if(curFunction && !curFunction->type)
15403 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15404 FreeType(exp->destType);
15405 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15406 if(exp->destType)
15407 exp->destType->refCount++;
15408 }
15409 ProcessExpressionType(exp);
15410 }
15411 }
15412 break;
15413 }
15414 case 14:
15415 {
15416 ProcessDeclaration(stmt->__anon1.decl, 1);
15417 break;
15418 }
15419 case 13:
15420 {
15421 struct AsmField * field;
15422
15423 if(stmt->__anon1.asmStmt.inputFields)
15424 {
15425 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15426 if(field->expression)
15427 ProcessExpressionType(field->expression);
15428 }
15429 if(stmt->__anon1.asmStmt.outputFields)
15430 {
15431 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15432 if(field->expression)
15433 ProcessExpressionType(field->expression);
15434 }
15435 if(stmt->__anon1.asmStmt.clobberedFields)
15436 {
15437 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15438 {
15439 if(field->expression)
15440 ProcessExpressionType(field->expression);
15441 }
15442 }
15443 break;
15444 }
15445 case 17:
15446 {
15447 struct PropertyWatch * propWatch;
15448 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15449 struct Expression * object = stmt->__anon1._watch.object;
15450 struct Expression * watcher = stmt->__anon1._watch.watcher;
15451
15452 if(watcher)
15453 ProcessExpressionType(watcher);
15454 if(object)
15455 ProcessExpressionType(object);
15456 if(inCompiler)
15457 {
15458 if(watcher || thisClass)
15459 {
15460 struct External * external = curExternal;
15461 struct Context * context = curContext;
15462
15463 stmt->type = 3;
15464 stmt->__anon1.expressions = MkList();
15465 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15466 {
15467 struct ClassFunction * func;
15468 char watcherName[1024];
15469 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;
15470 struct External * createdExternal;
15471
15472 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15473 if(propWatch->deleteWatch)
15474 strcat(watcherName, "_delete");
15475 else
15476 {
15477 struct Identifier * propID;
15478
15479 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15480 {
15481 strcat(watcherName, "_");
15482 strcat(watcherName, propID->string);
15483 }
15484 }
15485 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15486 {
15487 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)));
15488 ProcessClassFunctionBody(func, propWatch->compound);
15489 propWatch->compound = (((void *)0));
15490 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15491 FreeClassFunction(func);
15492 curExternal = createdExternal;
15493 ProcessFunction(createdExternal->__anon1.function);
15494 if(propWatch->deleteWatch)
15495 {
15496 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15497
15498 ListAdd(args, CopyExpression(object));
15499 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15500 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15501 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15502 }
15503 else
15504 {
15505 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15506 struct Identifier * propID;
15507
15508 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15509 {
15510 char propName[1024];
15511 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15512
15513 if(prop)
15514 {
15515 char getName[1024], setName[1024];
15516 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15517
15518 DeclareProperty(createdExternal, prop, setName, getName);
15519 strcpy(propName, "__ecereProp_");
15520 FullClassNameCat(propName, prop->_class->fullName, 0);
15521 strcat(propName, "_");
15522 FullClassNameCat(propName, prop->name, 1);
15523 ListAdd(args, CopyExpression(object));
15524 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15525 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15526 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15527 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15528 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15529 }
15530 else
15531 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15532 }
15533 }
15534 }
15535 else
15536 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15537 }
15538 curExternal = external;
15539 curContext = context;
15540 if(watcher)
15541 FreeExpression(watcher);
15542 if(object)
15543 FreeExpression(object);
15544 FreeList(watches, (void *)(FreePropertyWatch));
15545 }
15546 else
15547 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15548 }
15549 else
15550 {
15551 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15552 {
15553 ProcessStatement(propWatch->compound);
15554 }
15555 }
15556 break;
15557 }
15558 case 15:
15559 {
15560 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15561 struct Expression * object = stmt->__anon1._watch.object;
15562 struct __ecereNameSpace__ecere__com__Class * _class;
15563
15564 if(object)
15565 ProcessExpressionType(object);
15566 if(inCompiler)
15567 {
15568 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15569 if(_class)
15570 {
15571 struct Identifier * propID;
15572
15573 stmt->type = 3;
15574 stmt->__anon1.expressions = MkList();
15575 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15576 {
15577 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15578 }
15579 else if(!watches)
15580 {
15581 }
15582 if(watches)
15583 {
15584 for(propID = (*watches).first; propID; propID = propID->next)
15585 {
15586 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15587
15588 if(prop)
15589 {
15590 CreateFireWatcher(prop, object, stmt);
15591 }
15592 else
15593 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15594 }
15595 }
15596 else
15597 {
15598 struct __ecereNameSpace__ecere__com__Property * prop;
15599 struct __ecereNameSpace__ecere__com__Class * base;
15600
15601 for(base = _class; base; base = base->base)
15602 {
15603 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15604 {
15605 if(prop->isProperty && prop->isWatchable)
15606 {
15607 CreateFireWatcher(prop, object, stmt);
15608 }
15609 }
15610 }
15611 }
15612 if(object)
15613 FreeExpression(object);
15614 FreeList(watches, (void *)(FreeIdentifier));
15615 }
15616 else
15617 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15618 }
15619 break;
15620 }
15621 case 16:
15622 {
15623 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15624 struct Expression * object = stmt->__anon1._watch.object;
15625 struct Expression * watcher = stmt->__anon1._watch.watcher;
15626 struct __ecereNameSpace__ecere__com__Class * _class;
15627
15628 if(object)
15629 ProcessExpressionType(object);
15630 if(watcher)
15631 ProcessExpressionType(watcher);
15632 if(inCompiler)
15633 {
15634 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15635 if(watcher || thisClass)
15636 {
15637 if(_class)
15638 {
15639 struct Identifier * propID;
15640
15641 stmt->type = 3;
15642 stmt->__anon1.expressions = MkList();
15643 if(!watches)
15644 {
15645 struct __ecereNameSpace__ecere__sys__OldList * args;
15646
15647 args = MkList();
15648 ListAdd(args, CopyExpression(object));
15649 ListAdd(args, MkExpConstant("0"));
15650 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15651 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15652 }
15653 else
15654 {
15655 for(propID = (*watches).first; propID; propID = propID->next)
15656 {
15657 char propName[1024];
15658 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15659
15660 if(prop)
15661 {
15662 char getName[1024], setName[1024];
15663 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15664
15665 DeclareProperty(curExternal, prop, setName, getName);
15666 strcpy(propName, "__ecereProp_");
15667 FullClassNameCat(propName, prop->_class->fullName, 0);
15668 strcat(propName, "_");
15669 FullClassNameCat(propName, prop->name, 1);
15670 ListAdd(args, CopyExpression(object));
15671 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15672 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15673 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15674 }
15675 else
15676 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15677 }
15678 }
15679 if(object)
15680 FreeExpression(object);
15681 if(watcher)
15682 FreeExpression(watcher);
15683 FreeList(watches, (void *)(FreeIdentifier));
15684 }
15685 else
15686 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15687 }
15688 else
15689 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15690 }
15691 break;
15692 }
15693 }
15694 }
15695
15696 void ComputeDataTypes()
15697 {
15698 struct External * external;
15699
15700 currentClass = (((void *)0));
15701 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15702 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15703 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15704 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15705 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15706 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15707 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15708 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15709 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15710 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15711 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15712 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15713 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15714 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15715 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15716 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15717 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15718 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15719 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15720 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15721 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15722 reachedPass15 = 1;
15723 for(external = (*ast).first; external; external = external->next)
15724 {
15725 afterExternal = curExternal = external;
15726 if(external->type == 0)
15727 {
15728 if(memoryGuard)
15729 {
15730 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15731 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15732 }
15733 currentClass = external->__anon1.function->_class;
15734 ProcessFunction(external->__anon1.function);
15735 }
15736 else if(external->type == 1)
15737 {
15738 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15739 {
15740 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15741 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15742 }
15743 currentClass = (((void *)0));
15744 if(external->__anon1.declaration)
15745 ProcessDeclaration(external->__anon1.declaration, 1);
15746 }
15747 else if(external->type == 2)
15748 {
15749 struct ClassDefinition * _class = external->__anon1._class;
15750
15751 currentClass = external->symbol->__anon1.registered;
15752 if(memoryGuard)
15753 {
15754 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15755 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15756 }
15757 if(_class->definitions)
15758 {
15759 ProcessClass(_class->definitions, _class->symbol);
15760 }
15761 if(inCompiler)
15762 {
15763 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15764 ((external ? __extension__ ({
15765 void * __ecerePtrToDelete = (external);
15766
15767 __ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
15768 }) : 0), external = 0);
15769 }
15770 }
15771 else if(external->type == 4)
15772 {
15773 thisNameSpace = external->__anon1.id->string;
15774 }
15775 }
15776 currentClass = (((void *)0));
15777 thisNameSpace = (((void *)0));
15778 curExternal = (((void *)0));
15779 }
15780
15781 void ProcessExpressionType(struct Expression * exp)
15782 {
15783 unsigned int unresolved = 0;
15784 struct Location oldyylloc = yylloc;
15785 unsigned int notByReference = 0;
15786
15787 if(!exp || exp->expType)
15788 return ;
15789 yylloc = exp->loc;
15790 switch(exp->type)
15791 {
15792 case 0:
15793 {
15794 struct Identifier * id = exp->__anon1.__anon1.identifier;
15795
15796 if(!id || !topContext)
15797 return ;
15798 if(id->_class && id->_class->__anon1.__anon1.name)
15799 {
15800 id->classSym = id->_class->__anon1.__anon1.symbol;
15801 }
15802 if(!strcmp(id->string, "__runtimePlatform"))
15803 {
15804 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15805 break;
15806 }
15807 else if(strstr(id->string, "__ecereClass") == id->string)
15808 {
15809 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15810 break;
15811 }
15812 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15813 {
15814 ReplaceClassMembers(exp, thisClass);
15815 if(exp->type != 0)
15816 {
15817 ProcessExpressionType(exp);
15818 break;
15819 }
15820 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15821 break;
15822 }
15823 else
15824 {
15825 struct Symbol * symbol = (((void *)0));
15826 unsigned int findInGlobal = 0;
15827
15828 if(!topContext->parent && exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && exp->destType->__anon1._class->__anon1.registered->type == 4)
15829 findInGlobal = 1;
15830 else
15831 symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15832 if(!symbol)
15833 {
15834 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15835 break;
15836 else
15837 {
15838 if(thisClass)
15839 {
15840 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15841 if(exp->type != 0)
15842 {
15843 ProcessExpressionType(exp);
15844 break;
15845 }
15846 }
15847 else if(currentClass && !id->_class)
15848 {
15849 if(ResolveIdWithClass(exp, currentClass, 1))
15850 break;
15851 }
15852 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15853 }
15854 }
15855 if(findInGlobal)
15856 symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15857 if(symbol)
15858 {
15859 struct Type * type = symbol->type;
15860 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15861
15862 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15863 {
15864 struct Context * context = SetupTemplatesContext(_class);
15865
15866 type = ReplaceThisClassType(_class);
15867 FinishTemplatesContext(context);
15868 if(type)
15869 type->refCount = 0;
15870 }
15871 FreeSpecifier(id->_class);
15872 id->_class = (((void *)0));
15873 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15874 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
15875 id->classSym = (((void *)0));
15876 exp->expType = type;
15877 if(type)
15878 type->refCount++;
15879 if(type && (type->kind == 15))
15880 exp->isConstant = 1;
15881 if(symbol->isParam || !strcmp(id->string, "this"))
15882 {
15883 if(_class && _class->type == 1 && !type->declaredWithStruct)
15884 exp->byReference = 1;
15885 }
15886 if(symbol->isIterator)
15887 {
15888 if(symbol->isIterator == 3)
15889 {
15890 exp->type = 5;
15891 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
15892 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
15893 exp->expType = (((void *)0));
15894 ProcessExpressionType(exp);
15895 }
15896 else if(symbol->isIterator != 4)
15897 {
15898 exp->type = 8;
15899 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
15900 exp->__anon1.member.exp->expType = exp->expType;
15901 exp->__anon1.member.member = MkIdentifier("data");
15902 exp->expType = (((void *)0));
15903 ProcessExpressionType(exp);
15904 }
15905 }
15906 break;
15907 }
15908 else
15909 {
15910 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
15911
15912 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15913 {
15914 char name[1024];
15915
15916 strcpy(name, thisNameSpace);
15917 strcat(name, "::");
15918 strcat(name, id->string);
15919 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
15920 }
15921 if(!definedExp)
15922 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
15923 if(definedExp)
15924 {
15925 int c;
15926
15927 for(c = 0; c < definedExpStackPos; c++)
15928 if(definedExpStack[c] == definedExp)
15929 break;
15930 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
15931 {
15932 struct Location backupYylloc = yylloc;
15933 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
15934
15935 definedExpStack[definedExpStackPos++] = definedExp;
15936 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
15937 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
15938 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15939
15940 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15941 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
15942 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
15943 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15944
15945 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15946 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
15947 echoOn = 0;
15948 parsedExpression = (((void *)0));
15949 resetScanner();
15950 expression_yyparse();
15951 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
15952 if(backInput)
15953 fileInput = backInput;
15954 yylloc = backupYylloc;
15955 if(parsedExpression)
15956 {
15957 FreeIdentifier(id);
15958 exp->type = 5;
15959 exp->__anon1.list = MkListOne(parsedExpression);
15960 ApplyLocation(parsedExpression, &yylloc);
15961 ProcessExpressionType(exp);
15962 definedExpStackPos--;
15963 return ;
15964 }
15965 definedExpStackPos--;
15966 }
15967 else
15968 {
15969 if(inCompiler)
15970 {
15971 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
15972 }
15973 }
15974 }
15975 else
15976 {
15977 struct GlobalData * data = (((void *)0));
15978
15979 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15980 {
15981 char name[1024];
15982
15983 strcpy(name, thisNameSpace);
15984 strcat(name, "::");
15985 strcat(name, id->string);
15986 data = FindGlobalData(name);
15987 }
15988 if(!data)
15989 data = FindGlobalData(id->string);
15990 if(data)
15991 {
15992 DeclareGlobalData(curExternal, data);
15993 exp->expType = data->dataType;
15994 if(data->dataType)
15995 data->dataType->refCount++;
15996 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15997 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
15998 FreeSpecifier(id->_class);
15999 id->_class = (((void *)0));
16000 break;
16001 }
16002 else
16003 {
16004 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
16005
16006 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
16007 {
16008 char name[1024];
16009
16010 strcpy(name, thisNameSpace);
16011 strcat(name, "::");
16012 strcat(name, id->string);
16013 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
16014 }
16015 if(!function)
16016 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
16017 if(function)
16018 {
16019 char name[1024];
16020
16021 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
16022 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
16023 name[0] = 0;
16024 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16025 strcpy(name, "__ecereFunction_");
16026 FullClassNameCat(name, id->string, 0);
16027 if(DeclareFunction(curExternal, function, name))
16028 {
16029 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
16030 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
16031 }
16032 exp->expType = function->dataType;
16033 if(function->dataType)
16034 function->dataType->refCount++;
16035 FreeSpecifier(id->_class);
16036 id->_class = (((void *)0));
16037 break;
16038 }
16039 }
16040 }
16041 }
16042 }
16043 unresolved = 1;
16044 break;
16045 }
16046 case 1:
16047 {
16048 if(!exp->__anon1.instance->_class)
16049 {
16050 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
16051 {
16052 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
16053 }
16054 }
16055 ProcessInstantiationType(exp->__anon1.instance);
16056 exp->isConstant = exp->__anon1.instance->isConstant;
16057 if(exp->__anon1.instance->_class)
16058 {
16059 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
16060 }
16061 break;
16062 }
16063 case 2:
16064 {
16065 if(!exp->expType)
16066 {
16067 char * constant = exp->__anon1.__anon1.constant;
16068 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
16069
16070 exp->expType = type;
16071 if(constant[0] == '\'')
16072 {
16073 if((int)((unsigned char *)constant)[1] > 127)
16074 {
16075 int nb;
16076 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
16077
16078 if(nb < 2)
16079 ch = constant[1];
16080 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
16081 exp->__anon1.__anon1.constant = PrintUInt(ch);
16082 type->kind = 8;
16083 type->__anon1._class = FindClass("unichar");
16084 type->isSigned = 0;
16085 }
16086 else
16087 {
16088 type->kind = 1;
16089 type->isSigned = 1;
16090 }
16091 }
16092 else
16093 {
16094 char * dot = strchr(constant, '.');
16095 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
16096 char * exponent;
16097
16098 if(isHex)
16099 {
16100 exponent = strchr(constant, 'p');
16101 if(!exponent)
16102 exponent = strchr(constant, 'P');
16103 }
16104 else
16105 {
16106 exponent = strchr(constant, 'e');
16107 if(!exponent)
16108 exponent = strchr(constant, 'E');
16109 }
16110 if(dot || exponent)
16111 {
16112 if(strchr(constant, 'f') || strchr(constant, 'F'))
16113 type->kind = 6;
16114 else
16115 type->kind = 7;
16116 type->isSigned = 1;
16117 }
16118 else
16119 {
16120 unsigned int isSigned = constant[0] == '-';
16121 char * endP = (((void *)0));
16122 long long i64 = strtoll(constant, &endP, 0);
16123 uint64 ui64 = strtoull(constant, &endP, 0);
16124 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16125 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16126
16127 if(isSigned)
16128 {
16129 if(i64 < (((int)0x80000000)))
16130 is64Bit = 1;
16131 }
16132 else
16133 {
16134 if(ui64 > (((int)0x7fffffff)))
16135 {
16136 if(ui64 > (0xffffffff))
16137 {
16138 is64Bit = 1;
16139 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16140 isSigned = 1;
16141 }
16142 }
16143 else if(constant[0] != '0' || !constant[1])
16144 isSigned = 1;
16145 }
16146 if(forceUnsigned)
16147 isSigned = 0;
16148 type->kind = is64Bit ? 4 : 3;
16149 type->isSigned = isSigned;
16150 }
16151 }
16152 exp->isConstant = 1;
16153 if(exp->destType && exp->destType->kind == 7)
16154 type->kind = 7;
16155 else if(exp->destType && exp->destType->kind == 6)
16156 type->kind = 6;
16157 else if(exp->destType && exp->destType->kind == 4)
16158 type->kind = 4;
16159 }
16160 break;
16161 }
16162 case 3:
16163 {
16164 exp->isConstant = 1;
16165 exp->expType = __extension__ ({
16166 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16167
16168 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16169 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16170
16171 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16172 }), __ecereInstance2;
16173 });
16174 break;
16175 }
16176 case 13:
16177 case 26:
16178 ProcessExpressionType(exp->__anon1._new.size);
16179 exp->expType = __extension__ ({
16180 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16181
16182 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16183 });
16184 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16185 break;
16186 case 14:
16187 case 27:
16188 ProcessExpressionType(exp->__anon1._renew.size);
16189 ProcessExpressionType(exp->__anon1._renew.exp);
16190 exp->expType = __extension__ ({
16191 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16192
16193 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16194 });
16195 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16196 break;
16197 case 4:
16198 {
16199 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16200 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16201 unsigned int useDestType = 0, useSideType = 0;
16202 struct Location oldyylloc = yylloc;
16203 unsigned int useSideUnit = 0;
16204 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16205 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16206
16207 switch(exp->__anon1.op.op)
16208 {
16209 case '=':
16210 case MUL_ASSIGN:
16211 case DIV_ASSIGN:
16212 case MOD_ASSIGN:
16213 case ADD_ASSIGN:
16214 case SUB_ASSIGN:
16215 case LEFT_ASSIGN:
16216 case RIGHT_ASSIGN:
16217 case AND_ASSIGN:
16218 case XOR_ASSIGN:
16219 case OR_ASSIGN:
16220 assign = 1;
16221 break;
16222 case '!':
16223 break;
16224 case AND_OP:
16225 case OR_OP:
16226 boolOps = 1;
16227 boolResult = 1;
16228 break;
16229 case EQ_OP:
16230 case '<':
16231 case '>':
16232 case LE_OP:
16233 case GE_OP:
16234 case NE_OP:
16235 boolResult = 1;
16236 useSideType = 1;
16237 break;
16238 case '+':
16239 case '-':
16240 useSideUnit = 1;
16241 useSideType = 1;
16242 useDestType = 1;
16243 break;
16244 case LEFT_OP:
16245 case RIGHT_OP:
16246 break;
16247 case '|':
16248 case '^':
16249 useSideType = 1;
16250 useDestType = 1;
16251 break;
16252 case '/':
16253 case '%':
16254 useSideType = 1;
16255 useDestType = 1;
16256 break;
16257 case '&':
16258 case '*':
16259 if(exp->__anon1.op.exp1)
16260 {
16261 useSideType = 1;
16262 useDestType = 1;
16263 }
16264 break;
16265 }
16266 if(exp->__anon1.op.op == '&')
16267 {
16268 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16269 {
16270 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16271 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16272
16273 if(symbol && symbol->isIterator == 2)
16274 {
16275 exp->type = 8;
16276 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16277 exp->__anon1.member.member = MkIdentifier("key");
16278 exp->expType = (((void *)0));
16279 exp->__anon1.op.exp2->expType = symbol->type;
16280 symbol->type->refCount++;
16281 ProcessExpressionType(exp);
16282 FreeType(dummy);
16283 break;
16284 }
16285 }
16286 }
16287 if(exp->__anon1.op.exp1)
16288 {
16289 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16290 useDestType = 0;
16291 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16292 {
16293 if(exp->__anon1.op.exp1->destType)
16294 FreeType(exp->__anon1.op.exp1->destType);
16295 exp->__anon1.op.exp1->destType = exp->destType;
16296 exp->__anon1.op.exp1->opDestType = 1;
16297 if(exp->destType)
16298 exp->destType->refCount++;
16299 }
16300 else if(!assign)
16301 {
16302 if(exp->__anon1.op.exp1->destType)
16303 FreeType(exp->__anon1.op.exp1->destType);
16304 exp->__anon1.op.exp1->destType = dummy;
16305 dummy->refCount++;
16306 }
16307 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16308 exp->__anon1.op.exp1->destType->count++;
16309 ProcessExpressionType(exp->__anon1.op.exp1);
16310 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16311 exp->__anon1.op.exp1->destType->count--;
16312 exp->__anon1.op.exp1->opDestType = 0;
16313 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)
16314 {
16315 exp->__anon1.op.exp2 = MkExpConstant("1");
16316 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16317 assign = 1;
16318 }
16319 if(exp->__anon1.op.exp1->destType == dummy)
16320 {
16321 FreeType(dummy);
16322 exp->__anon1.op.exp1->destType = (((void *)0));
16323 }
16324 if(exp->__anon1.op.exp2)
16325 {
16326 if(!assign && exp->__anon1.op.exp1->expType && (exp->__anon1.op.exp1->expType->kind == 1 || exp->__anon1.op.exp1->expType->kind == 2))
16327 {
16328 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->kind = 3, type->isSigned = 1, type->refCount = 1, type->signedBeforePromotion = exp->__anon1.op.exp1->expType->isSigned, type->bitMemberSize = exp->__anon1.op.exp1->expType->bitMemberSize, type->promotedFrom = exp->__anon1.op.exp1->expType->kind, type);
16329
16330 FreeType(exp->__anon1.op.exp1->expType);
16331 exp->__anon1.op.exp1->expType = type;
16332 }
16333 }
16334 type1 = exp->__anon1.op.exp1->expType;
16335 }
16336 if(exp->__anon1.op.exp2)
16337 {
16338 char expString[10240];
16339
16340 expString[0] = '\0';
16341 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16342 {
16343 if(exp->__anon1.op.exp1)
16344 {
16345 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16346 if(exp->__anon1.op.exp1->expType)
16347 exp->__anon1.op.exp1->expType->refCount++;
16348 }
16349 else
16350 {
16351 exp->__anon1.op.exp2->destType = exp->destType;
16352 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16353 exp->__anon1.op.exp2->opDestType = 1;
16354 if(exp->destType)
16355 exp->destType->refCount++;
16356 }
16357 if(type1)
16358 type1->refCount++;
16359 exp->expType = type1;
16360 }
16361 else if(assign)
16362 {
16363 if(inCompiler)
16364 PrintExpression(exp->__anon1.op.exp2, expString);
16365 if(type1 && type1->kind == 13)
16366 {
16367 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)
16368 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16369 else if(exp->__anon1.op.op == '=')
16370 {
16371 if(exp->__anon1.op.exp2->destType)
16372 FreeType(exp->__anon1.op.exp2->destType);
16373 exp->__anon1.op.exp2->destType = type1;
16374 if(type1)
16375 type1->refCount++;
16376 }
16377 }
16378 else
16379 {
16380 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)
16381 ;
16382 else
16383 {
16384 if(exp->__anon1.op.exp2->destType)
16385 FreeType(exp->__anon1.op.exp2->destType);
16386 exp->__anon1.op.exp2->destType = type1;
16387 if(type1)
16388 type1->refCount++;
16389 }
16390 }
16391 if(type1)
16392 type1->refCount++;
16393 exp->expType = type1;
16394 }
16395 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16396 {
16397 if(exp->__anon1.op.exp2->destType)
16398 FreeType(exp->__anon1.op.exp2->destType);
16399 exp->__anon1.op.exp2->destType = exp->destType;
16400 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16401 exp->__anon1.op.exp2->opDestType = 1;
16402 if(exp->destType)
16403 exp->destType->refCount++;
16404 }
16405 else
16406 {
16407 if(exp->__anon1.op.exp2->destType)
16408 FreeType(exp->__anon1.op.exp2->destType);
16409 exp->__anon1.op.exp2->destType = dummy;
16410 dummy->refCount++;
16411 }
16412 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))
16413 {
16414 FreeType(exp->__anon1.op.exp2->destType);
16415 exp->__anon1.op.exp2->destType = type1;
16416 type1->refCount++;
16417 }
16418 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16419 exp->__anon1.op.exp2->destType->count++;
16420 if(exp->__anon1.op.op == SIZEOF)
16421 {
16422 struct Expression * e = exp->__anon1.op.exp2;
16423
16424 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16425 {
16426 if(e->type == 5 || e->type == 32 || e->type == 23)
16427 {
16428 if(e->type == 23)
16429 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16430 else
16431 e = (*e->__anon1.list).last;
16432 }
16433 }
16434 if(e->type == 11 && e->__anon1.cast.exp)
16435 e->__anon1.cast.exp->needCast = 1;
16436 }
16437 ProcessExpressionType(exp->__anon1.op.exp2);
16438 exp->__anon1.op.exp2->opDestType = 0;
16439 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16440 exp->__anon1.op.exp2->destType->count--;
16441 if(!assign && (exp->__anon1.op.exp1 || exp->__anon1.op.op == '~'))
16442 {
16443 if(exp->__anon1.op.exp2->expType && (exp->__anon1.op.exp2->expType->kind == 1 || exp->__anon1.op.exp2->expType->kind == 2))
16444 {
16445 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->kind = 3, type->isSigned = 1, type->refCount = 1, type->signedBeforePromotion = exp->__anon1.op.exp2->expType->isSigned, type->bitMemberSize = exp->__anon1.op.exp2->expType->bitMemberSize, type->promotedFrom = exp->__anon1.op.exp2->expType->kind, type);
16446
16447 FreeType(exp->__anon1.op.exp2->expType);
16448 exp->__anon1.op.exp2->expType = type;
16449 }
16450 }
16451 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16452 {
16453 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)
16454 {
16455 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16456 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16457 }
16458 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)))
16459 {
16460 if(exp->__anon1.op.op == ADD_ASSIGN)
16461 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16462 }
16463 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))
16464 {
16465 if(exp->__anon1.op.op == ADD_ASSIGN)
16466 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16467 }
16468 else if(inCompiler)
16469 {
16470 char type1String[1024];
16471 char type2String[1024];
16472
16473 type1String[0] = '\0';
16474 type2String[0] = '\0';
16475 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16476 PrintType(type1, type2String, 0, 1);
16477 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16478 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16479 }
16480 }
16481 if(exp->__anon1.op.exp2->destType == dummy)
16482 {
16483 FreeType(dummy);
16484 exp->__anon1.op.exp2->destType = (((void *)0));
16485 }
16486 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16487 {
16488 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16489 type2->refCount = 1;
16490 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16491 type2->isSigned = 1;
16492 }
16493 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))
16494 {
16495 type2 = __extension__ ({
16496 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16497
16498 __ecereInstance1->kind = 3, __ecereInstance1;
16499 });
16500 type2->refCount = 1;
16501 type2->isSigned = 1;
16502 }
16503 else
16504 {
16505 type2 = exp->__anon1.op.exp2->expType;
16506 if(type2)
16507 type2->refCount++;
16508 }
16509 }
16510 dummy->kind = 0;
16511 if(exp->__anon1.op.op == SIZEOF)
16512 {
16513 exp->expType = __extension__ ({
16514 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16515
16516 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16517 });
16518 exp->isConstant = 1;
16519 }
16520 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16521 {
16522 exp->expType = Dereference(type2);
16523 if(type2 && type2->kind == 8)
16524 notByReference = 1;
16525 }
16526 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16527 exp->expType = Reference(type2);
16528 else if(exp->__anon1.op.op == LEFT_OP || exp->__anon1.op.op == RIGHT_OP)
16529 {
16530 if(exp->__anon1.op.exp1->expType)
16531 {
16532 exp->expType = exp->__anon1.op.exp1->expType;
16533 exp->expType->refCount++;
16534 }
16535 }
16536 else if(!assign)
16537 {
16538 if(boolOps)
16539 {
16540 if(exp->__anon1.op.exp1)
16541 {
16542 if(exp->__anon1.op.exp1->destType)
16543 FreeType(exp->__anon1.op.exp1->destType);
16544 exp->__anon1.op.exp1->destType = MkClassType("bool");
16545 exp->__anon1.op.exp1->destType->truth = 1;
16546 if(!exp->__anon1.op.exp1->expType)
16547 ProcessExpressionType(exp->__anon1.op.exp1);
16548 else
16549 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16550 FreeType(exp->__anon1.op.exp1->expType);
16551 exp->__anon1.op.exp1->expType = MkClassType("bool");
16552 exp->__anon1.op.exp1->expType->truth = 1;
16553 }
16554 if(exp->__anon1.op.exp2)
16555 {
16556 if(exp->__anon1.op.exp2->destType)
16557 FreeType(exp->__anon1.op.exp2->destType);
16558 exp->__anon1.op.exp2->destType = MkClassType("bool");
16559 exp->__anon1.op.exp2->destType->truth = 1;
16560 if(!exp->__anon1.op.exp2->expType)
16561 ProcessExpressionType(exp->__anon1.op.exp2);
16562 else
16563 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16564 FreeType(exp->__anon1.op.exp2->expType);
16565 exp->__anon1.op.exp2->expType = MkClassType("bool");
16566 exp->__anon1.op.exp2->expType->truth = 1;
16567 }
16568 }
16569 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")))))
16570 {
16571 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"))))
16572 {
16573 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)))
16574 {
16575 struct Type * intType;
16576
16577 if(!type1->__anon1._class->__anon1.registered->dataType)
16578 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16579 if(!type2->__anon1._class->__anon1.registered->dataType)
16580 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16581 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
16582 if(exp->__anon1.op.exp1->destType)
16583 FreeType(exp->__anon1.op.exp1->destType);
16584 if(exp->__anon1.op.exp2->destType)
16585 FreeType(exp->__anon1.op.exp2->destType);
16586 exp->__anon1.op.exp1->destType = intType;
16587 exp->__anon1.op.exp2->destType = intType;
16588 intType->refCount++;
16589 }
16590 else
16591 {
16592 if(exp->__anon1.op.exp2->destType)
16593 FreeType(exp->__anon1.op.exp2->destType);
16594 exp->__anon1.op.exp2->destType = type1;
16595 type1->refCount++;
16596 if(exp->__anon1.op.exp1->destType)
16597 FreeType(exp->__anon1.op.exp1->destType);
16598 exp->__anon1.op.exp1->destType = type2;
16599 type2->refCount++;
16600 }
16601 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)
16602 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);
16603 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16604 {
16605 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16606
16607 if(argExp)
16608 {
16609 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16610
16611 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16612 ProcessExpressionType(exp->__anon1.op.exp1);
16613 if(type2->kind != 13)
16614 {
16615 ProcessExpressionType(classExp);
16616 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16617 if(!exp->__anon1.op.exp2->expType)
16618 {
16619 if(type2)
16620 FreeType(type2);
16621 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16622 type2->refCount++;
16623 }
16624 ProcessExpressionType(exp->__anon1.op.exp2);
16625 }
16626 }
16627 }
16628 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)))
16629 {
16630 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16631 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16632 exp->expType = type1;
16633 if(type1)
16634 type1->refCount++;
16635 }
16636 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)))
16637 {
16638 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16639 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16640 exp->expType = type2;
16641 if(type2)
16642 type2->refCount++;
16643 }
16644 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))
16645 {
16646 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16647 }
16648 else
16649 {
16650 unsigned int success = 0;
16651
16652 if(type1->kind == 13 && type2->kind == 13)
16653 {
16654 if(exp->__anon1.op.op == '+')
16655 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16656 else if(exp->__anon1.op.op == '-')
16657 {
16658 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16659 {
16660 exp->expType = __extension__ ({
16661 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16662
16663 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16664 });
16665 success = 1;
16666 if(type1->__anon1.type->kind == 20)
16667 {
16668 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16669
16670 if(argExp)
16671 {
16672 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16673
16674 ProcessExpressionType(classExp);
16675 exp->type = 5;
16676 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"))));
16677 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16678 FreeType(dummy);
16679 return ;
16680 }
16681 }
16682 }
16683 }
16684 }
16685 if(!success && exp->__anon1.op.exp1->type == 2)
16686 {
16687 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16688 {
16689 if(exp->expType)
16690 FreeType(exp->expType);
16691 exp->expType = exp->__anon1.op.exp1->destType;
16692 if(exp->__anon1.op.exp1->destType)
16693 exp->__anon1.op.exp1->destType->refCount++;
16694 success = 1;
16695 }
16696 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16697 {
16698 if(exp->expType)
16699 FreeType(exp->expType);
16700 exp->expType = exp->__anon1.op.exp2->destType;
16701 if(exp->__anon1.op.exp2->destType)
16702 exp->__anon1.op.exp2->destType->refCount++;
16703 success = 1;
16704 }
16705 }
16706 else if(!success)
16707 {
16708 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16709 {
16710 if(exp->expType)
16711 FreeType(exp->expType);
16712 exp->expType = exp->__anon1.op.exp2->destType;
16713 if(exp->__anon1.op.exp2->destType)
16714 exp->__anon1.op.exp2->destType->refCount++;
16715 success = 1;
16716 }
16717 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16718 {
16719 if(exp->expType)
16720 FreeType(exp->expType);
16721 exp->expType = exp->__anon1.op.exp1->destType;
16722 if(exp->__anon1.op.exp1->destType)
16723 exp->__anon1.op.exp1->destType->refCount++;
16724 success = 1;
16725 }
16726 }
16727 if(!success)
16728 {
16729 char expString1[10240];
16730 char expString2[10240];
16731 char type1[1024];
16732 char type2[1024];
16733
16734 expString1[0] = '\0';
16735 expString2[0] = '\0';
16736 type1[0] = '\0';
16737 type2[0] = '\0';
16738 if(inCompiler)
16739 {
16740 PrintExpression(exp->__anon1.op.exp1, expString1);
16741 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16742 PrintExpression(exp->__anon1.op.exp2, expString2);
16743 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16744 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16745 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16746 }
16747 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16748 }
16749 }
16750 }
16751 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)
16752 {
16753 if(exp->__anon1.op.exp1->destType)
16754 FreeType(exp->__anon1.op.exp1->destType);
16755 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16756 if(type2->__anon1._class->__anon1.registered->dataType)
16757 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16758 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16759 exp->expType = type2;
16760 if(type2)
16761 type2->refCount++;
16762 }
16763 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)
16764 {
16765 if(exp->__anon1.op.exp2->destType)
16766 FreeType(exp->__anon1.op.exp2->destType);
16767 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16768 if(type1->__anon1._class->__anon1.registered->dataType)
16769 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16770 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16771 exp->expType = type1;
16772 if(type1)
16773 type1->refCount++;
16774 }
16775 else if(type1)
16776 {
16777 unsigned int valid = 0;
16778
16779 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
16780 {
16781 if(exp->__anon1.op.exp2->destType)
16782 FreeType(exp->__anon1.op.exp2->destType);
16783 if(!type1->__anon1._class->__anon1.registered->dataType)
16784 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16785 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16786 exp->__anon1.op.exp2->destType->refCount++;
16787 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16788 if(type2)
16789 FreeType(type2);
16790 type2 = exp->__anon1.op.exp2->destType;
16791 if(type2)
16792 type2->refCount++;
16793 exp->expType = type2;
16794 type2->refCount++;
16795 }
16796 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
16797 {
16798 if(exp->__anon1.op.exp1->destType)
16799 FreeType(exp->__anon1.op.exp1->destType);
16800 if(!type2->__anon1._class->__anon1.registered->dataType)
16801 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16802 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16803 exp->__anon1.op.exp1->destType->refCount++;
16804 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16805 type1 = exp->__anon1.op.exp1->destType;
16806 exp->expType = type1;
16807 type1->refCount++;
16808 }
16809 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
16810 {
16811 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
16812 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
16813
16814 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
16815 {
16816 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16817 {
16818 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16819 {
16820 if(exp->expType)
16821 FreeType(exp->expType);
16822 exp->expType = exp->__anon1.op.exp2->expType;
16823 if(exp->__anon1.op.exp2->expType)
16824 exp->__anon1.op.exp2->expType->refCount++;
16825 valid = 1;
16826 }
16827 }
16828 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16829 {
16830 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16831 {
16832 if(exp->expType)
16833 FreeType(exp->expType);
16834 exp->expType = exp->__anon1.op.exp1->expType;
16835 if(exp->__anon1.op.exp1->expType)
16836 exp->__anon1.op.exp1->expType->refCount++;
16837 valid = 1;
16838 }
16839 }
16840 }
16841 else
16842 {
16843 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16844 {
16845 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16846 {
16847 if(exp->expType)
16848 FreeType(exp->expType);
16849 exp->expType = exp->__anon1.op.exp1->expType;
16850 if(exp->__anon1.op.exp1->expType)
16851 exp->__anon1.op.exp1->expType->refCount++;
16852 valid = 1;
16853 }
16854 }
16855 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16856 {
16857 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16858 {
16859 if(exp->expType)
16860 FreeType(exp->expType);
16861 exp->expType = exp->__anon1.op.exp2->expType;
16862 if(exp->__anon1.op.exp2->expType)
16863 exp->__anon1.op.exp2->expType->refCount++;
16864 valid = 1;
16865 }
16866 }
16867 }
16868 }
16869 if(!valid)
16870 {
16871 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))
16872 {
16873 if(exp->__anon1.op.exp1->destType)
16874 FreeType(exp->__anon1.op.exp1->destType);
16875 exp->__anon1.op.exp1->destType = type2;
16876 type2->refCount++;
16877 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16878 {
16879 if(exp->expType)
16880 FreeType(exp->expType);
16881 exp->expType = exp->__anon1.op.exp1->destType;
16882 if(exp->__anon1.op.exp1->destType)
16883 exp->__anon1.op.exp1->destType->refCount++;
16884 }
16885 }
16886 else
16887 {
16888 if(exp->__anon1.op.exp2->destType)
16889 FreeType(exp->__anon1.op.exp2->destType);
16890 exp->__anon1.op.exp2->destType = type1;
16891 type1->refCount++;
16892 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16893 {
16894 if(exp->expType)
16895 FreeType(exp->expType);
16896 exp->expType = exp->__anon1.op.exp2->destType;
16897 if(exp->__anon1.op.exp2->destType)
16898 exp->__anon1.op.exp2->destType->refCount++;
16899 }
16900 else if(type1 && type2)
16901 {
16902 char expString1[10240];
16903 char expString2[10240];
16904 char type1String[1024];
16905 char type2String[1024];
16906
16907 expString1[0] = '\0';
16908 expString2[0] = '\0';
16909 type1String[0] = '\0';
16910 type2String[0] = '\0';
16911 if(inCompiler)
16912 {
16913 PrintExpression(exp->__anon1.op.exp1, expString1);
16914 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16915 PrintExpression(exp->__anon1.op.exp2, expString2);
16916 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16917 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
16918 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
16919 }
16920 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
16921 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
16922 {
16923 exp->expType = exp->__anon1.op.exp1->expType;
16924 if(exp->__anon1.op.exp1->expType)
16925 exp->__anon1.op.exp1->expType->refCount++;
16926 }
16927 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16928 {
16929 exp->expType = exp->__anon1.op.exp2->expType;
16930 if(exp->__anon1.op.exp2->expType)
16931 exp->__anon1.op.exp2->expType->refCount++;
16932 }
16933 }
16934 }
16935 }
16936 }
16937 else if(type2)
16938 {
16939 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16940 {
16941 struct Type * oldType = exp->__anon1.op.exp1->expType;
16942
16943 exp->__anon1.op.exp1->expType = (((void *)0));
16944 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16945 FreeType(oldType);
16946 else
16947 exp->__anon1.op.exp1->expType = oldType;
16948 }
16949 if(exp->__anon1.op.exp1->destType)
16950 FreeType(exp->__anon1.op.exp1->destType);
16951 exp->__anon1.op.exp1->destType = type2;
16952 type2->refCount++;
16953 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16954 {
16955 if(exp->expType)
16956 FreeType(exp->expType);
16957 exp->expType = exp->__anon1.op.exp1->destType;
16958 if(exp->__anon1.op.exp1->destType)
16959 exp->__anon1.op.exp1->destType->refCount++;
16960 }
16961 }
16962 }
16963 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
16964 {
16965 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16966 {
16967 if(exp->__anon1.op.exp1->destType)
16968 FreeType(exp->__anon1.op.exp1->destType);
16969 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16970 if(type2->__anon1._class->__anon1.registered->dataType)
16971 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16972 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16973 }
16974 if(exp->__anon1.op.op == '!')
16975 {
16976 exp->expType = MkClassType("bool");
16977 exp->expType->truth = 1;
16978 }
16979 else
16980 {
16981 exp->expType = type2;
16982 if(type2)
16983 type2->refCount++;
16984 }
16985 }
16986 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
16987 {
16988 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16989 {
16990 if(exp->__anon1.op.exp2->destType)
16991 FreeType(exp->__anon1.op.exp2->destType);
16992 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16993 if(type1->__anon1._class->__anon1.registered->dataType)
16994 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16995 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16996 }
16997 exp->expType = type1;
16998 if(type1)
16999 type1->refCount++;
17000 }
17001 }
17002 yylloc = exp->loc;
17003 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
17004 {
17005 char expString[10000];
17006
17007 expString[0] = '\0';
17008 if(inCompiler)
17009 {
17010 PrintExpression(exp->__anon1.op.exp1, expString);
17011 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17012 }
17013 if(expString[0])
17014 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17015 }
17016 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
17017 {
17018 char expString[10240];
17019
17020 expString[0] = '\0';
17021 if(inCompiler)
17022 {
17023 PrintExpression(exp->__anon1.op.exp2, expString);
17024 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17025 }
17026 if(expString[0])
17027 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17028 }
17029 if(boolResult)
17030 {
17031 FreeType(exp->expType);
17032 exp->expType = MkClassType("bool");
17033 exp->expType->truth = 1;
17034 }
17035 if(exp->__anon1.op.op != SIZEOF)
17036 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
17037 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
17038 {
17039 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
17040 }
17041 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
17042 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
17043 yylloc = oldyylloc;
17044 FreeType(dummy);
17045 if(type2)
17046 FreeType(type2);
17047 break;
17048 }
17049 case 5:
17050 case 32:
17051 {
17052 struct Expression * e;
17053
17054 exp->isConstant = 1;
17055 for(e = (*exp->__anon1.list).first; e; e = e->next)
17056 {
17057 if(!e->next)
17058 {
17059 FreeType(e->destType);
17060 e->opDestType = exp->opDestType;
17061 e->destType = exp->destType;
17062 if(e->destType)
17063 {
17064 exp->destType->refCount++;
17065 }
17066 }
17067 ProcessExpressionType(e);
17068 if(!exp->expType && !e->next)
17069 {
17070 exp->expType = e->expType;
17071 if(e->expType)
17072 e->expType->refCount++;
17073 }
17074 if(!e->isConstant)
17075 exp->isConstant = 0;
17076 }
17077 e = (*exp->__anon1.list).first;
17078 if(!e->next && e->type == 8)
17079 {
17080 struct Expression * next = exp->next, * prev = exp->prev;
17081
17082 FreeType(exp->expType);
17083 FreeType(exp->destType);
17084 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17085 *exp = *e;
17086 exp->prev = prev;
17087 exp->next = next;
17088 ((e ? __extension__ ({
17089 void * __ecerePtrToDelete = (e);
17090
17091 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
17092 }) : 0), e = 0);
17093 ProcessExpressionType(exp);
17094 }
17095 break;
17096 }
17097 case 6:
17098 {
17099 struct Expression * e;
17100
17101 exp->isConstant = 1;
17102 ProcessExpressionType(exp->__anon1.index.exp);
17103 if(!exp->__anon1.index.exp->isConstant)
17104 exp->isConstant = 0;
17105 if(exp->__anon1.index.exp->expType)
17106 {
17107 struct Type * source = exp->__anon1.index.exp->expType;
17108
17109 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
17110 {
17111 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
17112 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
17113
17114 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
17115 {
17116 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
17117 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
17118 {
17119 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
17120
17121 if(type->kind == 8)
17122 type->constant = 1;
17123 else if(type->kind == 13)
17124 {
17125 struct Type * t = type;
17126
17127 while(t->kind == 13)
17128 t = t->__anon1.type;
17129 t->constant = 1;
17130 }
17131 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
17132 }
17133 }
17134 }
17135 }
17136 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
17137 {
17138 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
17139 {
17140 if(e->destType)
17141 FreeType(e->destType);
17142 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
17143 }
17144 ProcessExpressionType(e);
17145 if(!e->next)
17146 {
17147 }
17148 if(!e->isConstant)
17149 exp->isConstant = 0;
17150 }
17151 if(!exp->expType)
17152 exp->expType = Dereference(exp->__anon1.index.exp->expType);
17153 if(exp->expType)
17154 DeclareType(curExternal, exp->expType, 1, 0);
17155 break;
17156 }
17157 case 7:
17158 {
17159 struct Expression * e;
17160 struct Type * functionType;
17161 struct Type * methodType = (((void *)0));
17162 char name[1024];
17163
17164 name[0] = '\0';
17165 if(inCompiler)
17166 {
17167 PrintExpression(exp->__anon1.call.exp, name);
17168 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17169 {
17170 PrintExpression(exp->__anon1.call.exp, name);
17171 }
17172 }
17173 if(exp->__anon1.call.exp->type == 0)
17174 {
17175 struct Expression * idExp = exp->__anon1.call.exp;
17176 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17177
17178 if(!strcmp(id->string, "__builtin_frame_address"))
17179 {
17180 exp->expType = ProcessTypeString("void *", 1);
17181 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17182 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17183 break;
17184 }
17185 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17186 {
17187 exp->expType = ProcessTypeString("int", 1);
17188 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17189 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17190 break;
17191 }
17192 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17193 {
17194 struct Expression * a = (((void *)0));
17195 struct Expression * b = (((void *)0));
17196 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17197
17198 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17199 {
17200 a = (*exp->__anon1.call.arguments).first;
17201 b = (*exp->__anon1.call.arguments).last;
17202 tempExp1 = a;
17203 tempExp2 = b;
17204 }
17205 else if((*exp->__anon1.call.arguments).count == 1)
17206 {
17207 a = (*exp->__anon1.call.arguments).first;
17208 tempExp1 = a;
17209 }
17210 if(a)
17211 {
17212 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17213 idExp->__anon1.__anon1.identifier = (((void *)0));
17214 FreeExpContents(exp);
17215 ProcessExpressionType(a);
17216 if(b)
17217 ProcessExpressionType(b);
17218 exp->type = 5;
17219 exp->__anon1.list = MkList();
17220 if(a->expType && (!b || b->expType))
17221 {
17222 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17223 {
17224 if(inCompiler)
17225 {
17226 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17227 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17228 struct Declaration * decl;
17229 char temp1[1024], temp2[1024];
17230
17231 GetTypeSpecs(a->expType, specs);
17232 if(a && !a->isConstant && a->type != 0)
17233 {
17234 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17235 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17236 tempExp1 = QMkExpId(temp1);
17237 tempExp1->expType = a->expType;
17238 if(a->expType)
17239 a->expType->refCount++;
17240 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17241 }
17242 if(b && !b->isConstant && b->type != 0)
17243 {
17244 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17245 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17246 tempExp2 = QMkExpId(temp2);
17247 tempExp2->expType = b->expType;
17248 if(b->expType)
17249 b->expType->refCount++;
17250 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17251 }
17252 decl = MkDeclaration(specs, decls);
17253 if(!curCompound->__anon1.compound.declarations)
17254 curCompound->__anon1.compound.declarations = MkList();
17255 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17256 }
17257 }
17258 }
17259 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17260 {
17261 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17262
17263 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17264 exp->expType = a->expType;
17265 if(a->expType)
17266 a->expType->refCount++;
17267 }
17268 else if(!strcmp(id->string, "Abs"))
17269 {
17270 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17271 exp->expType = a->expType;
17272 if(a->expType)
17273 a->expType->refCount++;
17274 }
17275 else if(!strcmp(id->string, "Sgn"))
17276 {
17277 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"))))));
17278 exp->expType = ProcessTypeString("int", 0);
17279 }
17280 FreeExpression(tempExp1);
17281 if(tempExp2)
17282 FreeExpression(tempExp2);
17283 FreeIdentifier(id);
17284 break;
17285 }
17286 }
17287 }
17288 {
17289 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17290
17291 if(!exp->__anon1.call.exp->destType)
17292 {
17293 exp->__anon1.call.exp->destType = dummy;
17294 dummy->refCount++;
17295 }
17296 ProcessExpressionType(exp->__anon1.call.exp);
17297 if(exp->__anon1.call.exp->destType == dummy)
17298 {
17299 FreeType(dummy);
17300 exp->__anon1.call.exp->destType = (((void *)0));
17301 }
17302 FreeType(dummy);
17303 }
17304 functionType = exp->__anon1.call.exp->expType;
17305 if(functionType && functionType->kind == 16)
17306 {
17307 methodType = functionType;
17308 functionType = methodType->__anon1.__anon3.method->dataType;
17309 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17310 {
17311 char typeString[1024];
17312
17313 typeString[0] = '\0';
17314 {
17315 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17316
17317 functionType->__anon1.__anon2.thisClass = (((void *)0));
17318 PrintType(functionType, typeString, 1, 1);
17319 functionType->__anon1.__anon2.thisClass = back;
17320 }
17321 if(strstr(typeString, "thisclass"))
17322 {
17323 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17324 struct Declarator * decl;
17325
17326 {
17327 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17328
17329 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17330 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))
17331 thisClassParams = 0;
17332 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17333 {
17334 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17335
17336 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17337 ProcessDeclarator(decl, 1);
17338 thisClass = backupThisClass;
17339 }
17340 thisClassParams = 1;
17341 functionType = ProcessType(specs, decl);
17342 functionType->refCount = 0;
17343 FinishTemplatesContext(context);
17344 {
17345 struct Type * p, * op;
17346
17347 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)
17348 {
17349 if(op->kind == 21)
17350 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17351 }
17352 }
17353 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17354 {
17355 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17356 }
17357 }
17358 FreeList(specs, (void *)(FreeSpecifier));
17359 FreeDeclarator(decl);
17360 }
17361 }
17362 }
17363 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17364 {
17365 struct Type * type = functionType->__anon1.type;
17366
17367 if(!functionType->refCount)
17368 {
17369 functionType->__anon1.type = (((void *)0));
17370 FreeType(functionType);
17371 }
17372 functionType = type;
17373 }
17374 if(functionType && functionType->kind != 11)
17375 {
17376 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17377 }
17378 else if(functionType)
17379 {
17380 unsigned int emptyParams = 0, noParams = 0;
17381 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17382 struct Type * type = functionType->__anon1.__anon2.params.first;
17383 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17384 int extra = 0;
17385 struct Location oldyylloc = yylloc;
17386
17387 if(!type)
17388 emptyParams = 1;
17389 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17390 {
17391 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17392 e = e->next;
17393 }
17394 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17395 {
17396 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)
17397 {
17398 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17399 if(e)
17400 {
17401 e->destType = type;
17402 e = e->next;
17403 type = functionType->__anon1.__anon2.params.first;
17404 }
17405 else
17406 type->refCount = 0;
17407 }
17408 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17409 {
17410 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17411 type->byReference = functionType->byReference;
17412 type->typedByReference = functionType->typedByReference;
17413 if(e)
17414 {
17415 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17416 e = e->next;
17417 e->destType = type;
17418 e = e->next;
17419 type = functionType->__anon1.__anon2.params.first;
17420 }
17421 else
17422 type->refCount = 0;
17423 }
17424 }
17425 if(type && type->kind == 0)
17426 {
17427 noParams = 1;
17428 if(!type->refCount)
17429 FreeType(type);
17430 type = (((void *)0));
17431 }
17432 for(; e; e = e->next)
17433 {
17434 if(!type && !emptyParams)
17435 {
17436 yylloc = e->loc;
17437 if(methodType && methodType->__anon1.__anon3.methodClass)
17438 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);
17439 else
17440 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);
17441 break;
17442 }
17443 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17444 {
17445 struct Type * templatedType = (((void *)0));
17446 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17447 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17448 int id = 0;
17449
17450 if(_class && _class->templateArgs)
17451 {
17452 struct __ecereNameSpace__ecere__com__Class * sClass;
17453
17454 for(sClass = _class; sClass; sClass = sClass->base)
17455 {
17456 if(sClass->templateClass)
17457 sClass = sClass->templateClass;
17458 id = 0;
17459 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17460 {
17461 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17462 {
17463 struct __ecereNameSpace__ecere__com__Class * nextClass;
17464
17465 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17466 {
17467 if(nextClass->templateClass)
17468 nextClass = nextClass->templateClass;
17469 id += nextClass->templateParams.count;
17470 }
17471 break;
17472 }
17473 id++;
17474 }
17475 if(curParam)
17476 break;
17477 }
17478 }
17479 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17480 {
17481 unsigned int constant = type->constant;
17482 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17483
17484 {
17485 struct Context * context = SetupTemplatesContext(_class);
17486
17487 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17488 FinishTemplatesContext(context);
17489 }
17490 if(templatedType->kind == 8 && constant)
17491 templatedType->constant = 1;
17492 else if(templatedType->kind == 13)
17493 {
17494 struct Type * t = templatedType->__anon1.type;
17495
17496 while(t->kind == 13)
17497 t = t->__anon1.type;
17498 if(constant)
17499 t->constant = constant;
17500 }
17501 e->destType = templatedType;
17502 if(templatedType)
17503 {
17504 templatedType->passAsTemplate = 1;
17505 }
17506 }
17507 else
17508 {
17509 e->destType = type;
17510 if(type)
17511 type->refCount++;
17512 }
17513 }
17514 else
17515 {
17516 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17517 {
17518 e->destType = type->prev;
17519 e->destType->refCount++;
17520 }
17521 else
17522 {
17523 e->destType = type;
17524 if(type)
17525 type->refCount++;
17526 }
17527 }
17528 if(type && type->kind != 14)
17529 {
17530 struct Type * next = type->next;
17531
17532 if(!type->refCount)
17533 FreeType(type);
17534 type = next;
17535 }
17536 }
17537 if(type && type->kind != 14)
17538 {
17539 if(methodType && methodType->__anon1.__anon3.methodClass)
17540 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);
17541 else
17542 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);
17543 }
17544 yylloc = oldyylloc;
17545 if(type && !type->refCount)
17546 FreeType(type);
17547 }
17548 else
17549 {
17550 functionType = __extension__ ({
17551 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17552
17553 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17554 });
17555 if(exp->__anon1.call.exp->type == 0)
17556 {
17557 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17558
17559 if(inCompiler)
17560 {
17561 struct Symbol * symbol;
17562 struct Location oldyylloc = yylloc;
17563
17564 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17565 if(strstr(string, "__builtin_") == string)
17566 {
17567 if(exp->destType)
17568 {
17569 functionType->__anon1.__anon2.returnType = exp->destType;
17570 exp->destType->refCount++;
17571 }
17572 }
17573 else
17574 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17575 symbol = __extension__ ({
17576 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17577
17578 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17579 });
17580 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17581 if(strstr(symbol->string, "::"))
17582 globalContext->hasNameSpace = 1;
17583 yylloc = oldyylloc;
17584 }
17585 }
17586 else if(exp->__anon1.call.exp->type == 8)
17587 {
17588 }
17589 else
17590 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17591 if(!functionType->__anon1.__anon2.returnType)
17592 {
17593 functionType->__anon1.__anon2.returnType = __extension__ ({
17594 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17595
17596 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17597 });
17598 }
17599 }
17600 if(functionType && functionType->kind == 11)
17601 {
17602 exp->expType = functionType->__anon1.__anon2.returnType;
17603 if(functionType->__anon1.__anon2.returnType)
17604 functionType->__anon1.__anon2.returnType->refCount++;
17605 if(!functionType->refCount)
17606 FreeType(functionType);
17607 }
17608 if(exp->__anon1.call.arguments)
17609 {
17610 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17611 ProcessExpressionType(e);
17612 }
17613 break;
17614 }
17615 case 8:
17616 {
17617 struct Type * type;
17618 struct Location oldyylloc = yylloc;
17619 unsigned int thisPtr;
17620 struct Expression * checkExp = exp->__anon1.member.exp;
17621
17622 while(checkExp)
17623 {
17624 if(checkExp->type == 11)
17625 checkExp = checkExp->__anon1.cast.exp;
17626 else if(checkExp->type == 5)
17627 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17628 else
17629 break;
17630 }
17631 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17632 exp->thisPtr = thisPtr;
17633 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17634 {
17635 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17636 }
17637 ProcessExpressionType(exp->__anon1.member.exp);
17638 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)
17639 {
17640 exp->isConstant = 0;
17641 }
17642 else
17643 exp->isConstant = exp->__anon1.member.exp->isConstant;
17644 type = exp->__anon1.member.exp->expType;
17645 yylloc = exp->loc;
17646 if(type && (type->kind == 20))
17647 {
17648 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17649 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17650
17651 if(_class)
17652 {
17653 for(param = _class->templateParams.first; param; param = param->next)
17654 {
17655 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17656 break;
17657 }
17658 }
17659 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17660 {
17661 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17662
17663 if(argExp)
17664 {
17665 struct Expression * expMember = exp->__anon1.member.exp;
17666 struct Declarator * decl;
17667 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17668 char thisClassTypeString[1024];
17669
17670 FreeIdentifier(exp->__anon1.member.member);
17671 ProcessExpressionType(argExp);
17672 {
17673 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17674
17675 if(colon)
17676 {
17677 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17678 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17679 }
17680 else
17681 strcpy(thisClassTypeString, _class->fullName);
17682 }
17683 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17684 exp->expType = ProcessType(specs, decl);
17685 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17686 {
17687 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17688 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17689 int paramCount = 0;
17690 int lastParam = -1;
17691 char templateString[1024];
17692 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17693
17694 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17695 for(cClass = expClass; cClass; cClass = cClass->base)
17696 {
17697 int p = 0;
17698
17699 for(param = cClass->templateParams.first; param; param = param->next)
17700 {
17701 int id = p;
17702 struct __ecereNameSpace__ecere__com__Class * sClass;
17703 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17704
17705 for(sClass = cClass->base; sClass; sClass = sClass->base)
17706 id += sClass->templateParams.count;
17707 arg = expClass->templateArgs[id];
17708 for(sClass = _class; sClass; sClass = sClass->base)
17709 {
17710 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17711 int p = 0;
17712 struct __ecereNameSpace__ecere__com__Class * nextClass;
17713
17714 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17715 p += nextClass->templateParams.count;
17716 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17717 {
17718 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17719 {
17720 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17721 {
17722 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17723 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17724 break;
17725 }
17726 }
17727 }
17728 }
17729 {
17730 char argument[256];
17731
17732 argument[0] = '\0';
17733 switch(param->type)
17734 {
17735 case 2:
17736 {
17737 char expString[1024];
17738 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17739 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17740 struct Expression * exp;
17741 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17742
17743 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17744 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17745 ProcessExpressionType(exp);
17746 ComputeExpression(exp);
17747 expString[0] = '\0';
17748 PrintExpression(exp, expString);
17749 strcat(argument, expString);
17750 FreeExpression(exp);
17751 break;
17752 }
17753 case 1:
17754 {
17755 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17756 break;
17757 }
17758 case 0:
17759 {
17760 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17761 {
17762 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17763 strcat(argument, thisClassTypeString);
17764 else
17765 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17766 }
17767 break;
17768 }
17769 }
17770 if(argument[0])
17771 {
17772 if(paramCount)
17773 strcat(templateString, ", ");
17774 if(lastParam != p - 1)
17775 {
17776 strcat(templateString, param->name);
17777 strcat(templateString, " = ");
17778 }
17779 strcat(templateString, argument);
17780 paramCount++;
17781 lastParam = p;
17782 }
17783 p++;
17784 }
17785 }
17786 }
17787 {
17788 int len = strlen(templateString);
17789
17790 if(templateString[len - 1] == '>')
17791 templateString[len++] = ' ';
17792 templateString[len++] = '>';
17793 templateString[len++] = '\0';
17794 }
17795 {
17796 struct Context * context = SetupTemplatesContext(_class);
17797
17798 FreeType(exp->expType);
17799 exp->expType = ProcessTypeString(templateString, 0);
17800 FinishTemplatesContext(context);
17801 }
17802 }
17803 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
17804 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
17805 exp->type = 5;
17806 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")))))))));
17807 }
17808 }
17809 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
17810 {
17811 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
17812 }
17813 }
17814 if(type && (type->kind == 20))
17815 ;
17816 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)))
17817 {
17818 struct Identifier * id = exp->__anon1.member.member;
17819 int typeKind = type->kind;
17820 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));
17821
17822 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
17823 {
17824 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
17825 typeKind = 8;
17826 }
17827 if(id)
17828 {
17829 if(typeKind == 3 || typeKind == 15)
17830 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
17831 else if(!_class)
17832 {
17833 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17834 {
17835 _class = type->__anon1._class->__anon1.registered;
17836 }
17837 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
17838 {
17839 _class = FindClass("char *")->__anon1.registered;
17840 }
17841 else if(type->kind == 13)
17842 {
17843 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
17844 FreeType(exp->expType);
17845 exp->expType = ProcessTypeString("uintptr", 0);
17846 exp->byReference = 1;
17847 }
17848 else
17849 {
17850 char string[1024] = "";
17851 struct Symbol * classSym;
17852
17853 PrintTypeNoConst(type, string, 0, 1);
17854 classSym = FindClass(string);
17855 if(classSym)
17856 _class = classSym->__anon1.registered;
17857 }
17858 }
17859 }
17860 if(_class && id)
17861 {
17862 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
17863 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
17864 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17865 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
17866 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
17867
17868 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
17869 exp->__anon1.member.memberType = 1;
17870 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
17871 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
17872 if(typeKind != 19)
17873 {
17874 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
17875 {
17876 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17877 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
17878 {
17879 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17880 if(prop)
17881 member = (((void *)0));
17882 }
17883 if(!member && !prop)
17884 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17885 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
17886 exp->__anon1.member.thisPtr = 1;
17887 }
17888 else
17889 {
17890 unsigned int useMemberForNonConst = 0;
17891
17892 if(!id->classSym)
17893 {
17894 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
17895 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);
17896 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17897 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
17898 }
17899 if((!prop || useMemberForNonConst) && !member)
17900 {
17901 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
17902 if(!method)
17903 {
17904 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17905 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);
17906 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17907 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17908 }
17909 }
17910 if(member && prop)
17911 {
17912 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
17913 prop = (((void *)0));
17914 else
17915 member = (((void *)0));
17916 }
17917 }
17918 }
17919 if(!prop && !member && !method)
17920 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
17921 if(!prop && !member && !method)
17922 {
17923 if(typeKind == 19)
17924 {
17925 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
17926 if(classProp)
17927 {
17928 exp->__anon1.member.memberType = 5;
17929 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
17930 }
17931 else
17932 {
17933 char structName[1024];
17934 struct Identifier * id = exp->__anon1.member.member;
17935 struct Expression * classExp = exp->__anon1.member.exp;
17936
17937 type->refCount++;
17938 FreeType(classExp->expType);
17939 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
17940 strcpy(structName, "__ecereClassData_");
17941 FullClassNameCat(structName, type->__anon1._class->string, 0);
17942 exp->type = 9;
17943 exp->__anon1.member.member = id;
17944 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"))))))));
17945 FreeType(type);
17946 ProcessExpressionType(exp);
17947 return ;
17948 }
17949 }
17950 else
17951 {
17952 struct Symbol * classSym = FindClass(id->string);
17953
17954 if(classSym)
17955 {
17956 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
17957
17958 if(convertClass)
17959 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
17960 }
17961 }
17962 }
17963 if(exp->__anon1.member.exp->destType)
17964 FreeType(exp->__anon1.member.exp->destType);
17965 {
17966 if(method && !method->_class->symbol)
17967 method->_class->symbol = FindClass(method->_class->fullName);
17968 if(prop && !prop->_class->symbol)
17969 prop->_class->symbol = FindClass(prop->_class->fullName);
17970 exp->__anon1.member.exp->destType = __extension__ ({
17971 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17972
17973 __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;
17974 });
17975 }
17976 if(prop)
17977 {
17978 exp->__anon1.member.memberType = 1;
17979 if(!prop->dataType)
17980 ProcessPropertyType(prop);
17981 exp->expType = prop->dataType;
17982 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
17983 {
17984 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17985
17986 CopyTypeInto(type, exp->expType);
17987 type->refCount = 1;
17988 type->constant = 1;
17989 exp->expType = type;
17990 }
17991 else if(prop->dataType)
17992 prop->dataType->refCount++;
17993 }
17994 else if(member)
17995 {
17996 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17997 {
17998 FreeExpContents(exp);
17999 exp->type = 0;
18000 exp->__anon1.__anon1.identifier = MkIdentifier("class");
18001 ProcessExpressionType(exp);
18002 return ;
18003 }
18004 exp->__anon1.member.memberType = 3;
18005 DeclareStruct(curExternal, _class->fullName, 0, 1);
18006 if(member->_class != _class)
18007 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
18008 if(!member->dataType)
18009 {
18010 struct Context * context = SetupTemplatesContext(_class);
18011
18012 member->dataType = ProcessTypeString(member->dataTypeString, 0);
18013 FinishTemplatesContext(context);
18014 }
18015 if(exp->__anon1.member.exp->expType->kind == 8 && exp->__anon1.member.exp->expType->__anon1._class && exp->__anon1.member.exp->expType->__anon1._class->__anon1.registered && exp->__anon1.member.exp->expType->__anon1._class->__anon1.registered->type == 2)
18016 member->dataType->bitMemberSize = ((struct __ecereNameSpace__ecere__com__BitMember *)member)->size;
18017 exp->expType = member->dataType;
18018 if(member->dataType)
18019 member->dataType->refCount++;
18020 }
18021 else if(revConvert)
18022 {
18023 exp->__anon1.member.memberType = 4;
18024 exp->expType = MkClassType(revConvert->_class->fullName);
18025 }
18026 else if(method)
18027 {
18028 {
18029 exp->__anon1.member.memberType = 2;
18030 }
18031 if(!method->dataType)
18032 ProcessMethodType(method);
18033 exp->expType = __extension__ ({
18034 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18035
18036 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
18037 });
18038 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
18039 exp->expType->__anon1.__anon3.usedClass = _class;
18040 }
18041 else if(!classProp)
18042 {
18043 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
18044 {
18045 FreeExpContents(exp);
18046 exp->type = 0;
18047 exp->__anon1.__anon1.identifier = MkIdentifier("class");
18048 FreeType(exp->expType);
18049 exp->expType = MkClassType("ecere::com::Class");
18050 return ;
18051 }
18052 yylloc = exp->__anon1.member.member->loc;
18053 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
18054 if(inCompiler)
18055 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
18056 }
18057 if(_class && exp->expType)
18058 {
18059 struct __ecereNameSpace__ecere__com__Class * tClass;
18060
18061 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
18062 while(tClass && !tClass->templateClass)
18063 tClass = tClass->base;
18064 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
18065 {
18066 int id = 0;
18067 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
18068 struct __ecereNameSpace__ecere__com__Class * sClass;
18069
18070 for(sClass = tClass; sClass; sClass = sClass->base)
18071 {
18072 id = 0;
18073 if(sClass->templateClass)
18074 sClass = sClass->templateClass;
18075 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18076 {
18077 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
18078 {
18079 for(sClass = sClass->base; sClass; sClass = sClass->base)
18080 id += sClass->templateParams.count;
18081 break;
18082 }
18083 id++;
18084 }
18085 if(curParam)
18086 break;
18087 }
18088 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
18089 {
18090 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18091 struct Context * context = SetupTemplatesContext(tClass);
18092 unsigned int constant = exp->expType->constant;
18093 unsigned int passAsTemplate = 0;
18094 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
18095 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
18096
18097 if(t && t->kind == 8 && t->__anon1._class)
18098 thisClassFrom = t->__anon1._class->__anon1.registered;
18099 else
18100 thisClassFrom = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "class");
18101 FreeType(t);
18102 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
18103 FreeType(exp->expType);
18104 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18105 exp->expType->thisClassFrom = thisClassFrom;
18106 if(exp->expType->kind == 8 && constant)
18107 exp->expType->constant = 1;
18108 else if(exp->expType->kind == 13)
18109 {
18110 struct Type * t = exp->expType->__anon1.type;
18111
18112 while(t->kind == 13)
18113 t = t->__anon1.type;
18114 if(constant)
18115 t->constant = constant;
18116 }
18117 if(exp->expType)
18118 {
18119 if(exp->expType->kind == 21)
18120 {
18121 FreeType(exp->expType);
18122 exp->expType = ReplaceThisClassType(_class);
18123 }
18124 if(passAsTemplate)
18125 exp->expType->passAsTemplate = 1;
18126 if(!exp->destType)
18127 {
18128 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18129 if(exp->destType->kind == 8 && constant)
18130 exp->destType->constant = 1;
18131 else if(exp->destType->kind == 13)
18132 {
18133 struct Type * t = exp->destType->__anon1.type;
18134
18135 while(t->kind == 13)
18136 t = t->__anon1.type;
18137 if(constant)
18138 t->constant = constant;
18139 }
18140 if(exp->destType->kind == 21)
18141 {
18142 FreeType(exp->destType);
18143 exp->destType = ReplaceThisClassType(_class);
18144 }
18145 }
18146 }
18147 FinishTemplatesContext(context);
18148 }
18149 }
18150 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)
18151 {
18152 int id = 0;
18153 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
18154 struct __ecereNameSpace__ecere__com__Class * sClass;
18155
18156 for(sClass = tClass; sClass; sClass = sClass->base)
18157 {
18158 id = 0;
18159 if(sClass->templateClass)
18160 sClass = sClass->templateClass;
18161 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18162 {
18163 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
18164 {
18165 for(sClass = sClass->base; sClass; sClass = sClass->base)
18166 id += sClass->templateParams.count;
18167 break;
18168 }
18169 id++;
18170 }
18171 if(curParam)
18172 break;
18173 }
18174 if(curParam)
18175 {
18176 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18177 struct Context * context = SetupTemplatesContext(tClass);
18178 struct Type * basicType;
18179
18180 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18181 if(basicType)
18182 {
18183 if(basicType->kind == 21)
18184 {
18185 FreeType(basicType);
18186 basicType = ReplaceThisClassType(_class);
18187 }
18188 FreeType(exp->expType);
18189 exp->expType = __extension__ ({
18190 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18191
18192 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18193 });
18194 if(!exp->destType)
18195 {
18196 exp->destType = exp->expType;
18197 exp->destType->refCount++;
18198 }
18199 {
18200 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18201 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18202 struct Declarator * decl;
18203
18204 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18205 *newExp = *exp;
18206 if(exp->destType)
18207 exp->destType->refCount++;
18208 if(exp->expType)
18209 exp->expType->refCount++;
18210 exp->type = 11;
18211 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18212 exp->__anon1.cast.exp = newExp;
18213 }
18214 }
18215 FinishTemplatesContext(context);
18216 }
18217 }
18218 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18219 {
18220 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18221
18222 if(expClass)
18223 {
18224 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18225 int p = 0;
18226 int paramCount = 0;
18227 int lastParam = -1;
18228 char templateString[1024];
18229 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18230
18231 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18232 while(cClass != expClass)
18233 {
18234 struct __ecereNameSpace__ecere__com__Class * sClass;
18235
18236 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18237 ;
18238 cClass = sClass;
18239 for(param = cClass->templateParams.first; param; param = param->next)
18240 {
18241 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18242 int cp = 0;
18243 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18244 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18245
18246 while(cClassCur != tClass && !paramCur)
18247 {
18248 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18249
18250 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18251 ;
18252 cClassCur = sClassCur;
18253 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18254 {
18255 if(!strcmp(paramCur->name, param->name))
18256 {
18257 break;
18258 }
18259 cp++;
18260 }
18261 }
18262 if(paramCur && paramCur->type == 0)
18263 arg = tClass->templateArgs[cp];
18264 else
18265 arg = expClass->templateArgs[p];
18266 {
18267 char argument[256];
18268
18269 argument[0] = '\0';
18270 switch(param->type)
18271 {
18272 case 2:
18273 {
18274 char expString[1024];
18275 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18276 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18277 struct Expression * exp;
18278 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18279
18280 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18281 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18282 ProcessExpressionType(exp);
18283 ComputeExpression(exp);
18284 expString[0] = '\0';
18285 PrintExpression(exp, expString);
18286 strcat(argument, expString);
18287 FreeExpression(exp);
18288 break;
18289 }
18290 case 1:
18291 {
18292 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18293 break;
18294 }
18295 case 0:
18296 {
18297 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18298 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18299 break;
18300 }
18301 }
18302 if(argument[0])
18303 {
18304 if(paramCount)
18305 strcat(templateString, ", ");
18306 if(lastParam != p - 1)
18307 {
18308 strcat(templateString, param->name);
18309 strcat(templateString, " = ");
18310 }
18311 strcat(templateString, argument);
18312 paramCount++;
18313 lastParam = p;
18314 }
18315 }
18316 p++;
18317 }
18318 }
18319 {
18320 int len = strlen(templateString);
18321
18322 if(templateString[len - 1] == '>')
18323 templateString[len++] = ' ';
18324 templateString[len++] = '>';
18325 templateString[len++] = '\0';
18326 }
18327 FreeType(exp->expType);
18328 {
18329 struct Context * context = SetupTemplatesContext(tClass);
18330
18331 exp->expType = ProcessTypeString(templateString, 0);
18332 FinishTemplatesContext(context);
18333 }
18334 }
18335 }
18336 }
18337 }
18338 else
18339 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)");
18340 }
18341 else if(type && (type->kind == 9 || type->kind == 10))
18342 {
18343 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18344
18345 if(memberType)
18346 {
18347 exp->expType = memberType;
18348 if(memberType)
18349 memberType->refCount++;
18350 }
18351 }
18352 else
18353 {
18354 char expString[10240];
18355
18356 expString[0] = '\0';
18357 if(inCompiler)
18358 {
18359 PrintExpression(exp, expString);
18360 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18361 }
18362 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18363 }
18364 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18365 {
18366 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18367 {
18368 struct Identifier * id = exp->__anon1.member.member;
18369 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));
18370
18371 if(_class)
18372 {
18373 FreeType(exp->expType);
18374 exp->expType = ReplaceThisClassType(_class);
18375 }
18376 }
18377 }
18378 yylloc = oldyylloc;
18379 break;
18380 }
18381 case 9:
18382 {
18383 struct Type * destType = exp->destType;
18384
18385 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18386 {
18387 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18388 }
18389 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18390 exp->type = 8;
18391 if(destType)
18392 destType->count++;
18393 ProcessExpressionType(exp);
18394 if(destType)
18395 destType->count--;
18396 break;
18397 }
18398 case 15:
18399 {
18400 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18401
18402 if(classSym && classSym->__anon1.registered)
18403 {
18404 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18405 {
18406 char name[1024];
18407 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18408
18409 name[0] = '\0';
18410 DeclareStruct(curExternal, classSym->string, 0, 1);
18411 FreeSpecifier(exp->__anon1._class);
18412 FullClassNameCat(name, classSym->string, 0);
18413 if(b->offset == 0)
18414 {
18415 exp->type = 10;
18416 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18417 }
18418 else
18419 {
18420 struct Expression * e;
18421
18422 exp->type = 4;
18423 if(b->structSize == b->offset)
18424 exp->__anon1.op.exp1 = MkExpConstant("0");
18425 else
18426 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18427 exp->__anon1.op.op = '+';
18428 e = exp;
18429 while(b->offset != 0)
18430 {
18431 struct Symbol * sym;
18432 struct Expression * typeSize;
18433
18434 b = b->base;
18435 sym = FindClass(b->fullName);
18436 name[0] = '\0';
18437 DeclareStruct(curExternal, sym->string, 0, 1);
18438 FullClassNameCat(name, sym->string, 0);
18439 if(b->structSize == b->offset)
18440 typeSize = MkExpConstant("0");
18441 else
18442 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18443 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18444 e = e->__anon1.op.exp2;
18445 }
18446 }
18447 }
18448 else
18449 {
18450 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18451 {
18452 FreeSpecifier(exp->__anon1._class);
18453 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18454 exp->type = 2;
18455 }
18456 else
18457 {
18458 char className[1024];
18459
18460 strcpy(className, "__ecereClass_");
18461 FullClassNameCat(className, classSym->string, 1);
18462 DeclareClass(curExternal, classSym, className);
18463 FreeExpContents(exp);
18464 exp->type = 9;
18465 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18466 exp->__anon1.member.member = MkIdentifier("structSize");
18467 }
18468 }
18469 }
18470 exp->expType = __extension__ ({
18471 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18472
18473 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18474 });
18475 break;
18476 }
18477 case 10:
18478 {
18479 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
18480
18481 exp->expType = __extension__ ({
18482 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18483
18484 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18485 });
18486 exp->isConstant = 1;
18487 DeclareType(curExternal, type, 1, 0);
18488 FreeType(type);
18489 break;
18490 }
18491 case 11:
18492 {
18493 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18494
18495 type->count = 1;
18496 FreeType(exp->__anon1.cast.exp->destType);
18497 exp->__anon1.cast.exp->destType = type;
18498 type->refCount++;
18499 type->casted = 1;
18500 ProcessExpressionType(exp->__anon1.cast.exp);
18501 type->casted = 0;
18502 type->count = 0;
18503 exp->expType = type;
18504 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18505 {
18506 void * prev = exp->prev, * next = exp->next;
18507 struct Type * expType = exp->__anon1.cast.exp->destType;
18508 struct Expression * castExp = exp->__anon1.cast.exp;
18509 struct Type * destType = exp->destType;
18510
18511 if(expType)
18512 expType->refCount++;
18513 FreeType(exp->expType);
18514 FreeTypeName(exp->__anon1.cast.typeName);
18515 *exp = *castExp;
18516 FreeType(exp->expType);
18517 FreeType(exp->destType);
18518 exp->expType = expType;
18519 exp->destType = destType;
18520 ((castExp ? __extension__ ({
18521 void * __ecerePtrToDelete = (castExp);
18522
18523 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
18524 }) : 0), castExp = 0);
18525 exp->prev = prev;
18526 exp->next = next;
18527 }
18528 else
18529 {
18530 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18531 }
18532 break;
18533 }
18534 case 33:
18535 {
18536 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18537
18538 exp->expType = type;
18539 break;
18540 }
18541 case 34:
18542 {
18543 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18544
18545 ProcessExpressionType(exp->__anon1.vaArg.exp);
18546 exp->expType = type;
18547 break;
18548 }
18549 case 12:
18550 {
18551 struct Expression * e;
18552 struct Type * t = exp->destType;
18553
18554 if(t && !exp->destType->casted)
18555 {
18556 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18557 CopyTypeInto(t, exp->destType);
18558 t->count = 0;
18559 }
18560 else if(t)
18561 t->refCount++;
18562 exp->isConstant = 1;
18563 FreeType(exp->__anon1.cond.cond->destType);
18564 exp->__anon1.cond.cond->destType = MkClassType("bool");
18565 exp->__anon1.cond.cond->destType->truth = 1;
18566 ProcessExpressionType(exp->__anon1.cond.cond);
18567 if(!exp->__anon1.cond.cond->isConstant)
18568 exp->isConstant = 0;
18569 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18570 {
18571 if(!e->next)
18572 {
18573 FreeType(e->destType);
18574 e->destType = t;
18575 if(e->destType)
18576 e->destType->refCount++;
18577 }
18578 ProcessExpressionType(e);
18579 if(!e->next)
18580 {
18581 exp->expType = e->expType;
18582 if(e->expType)
18583 e->expType->refCount++;
18584 }
18585 if(!e->isConstant)
18586 exp->isConstant = 0;
18587 }
18588 FreeType(exp->__anon1.cond.elseExp->destType);
18589 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18590 if(exp->__anon1.cond.elseExp->destType)
18591 exp->__anon1.cond.elseExp->destType->refCount++;
18592 ProcessExpressionType(exp->__anon1.cond.elseExp);
18593 if(!exp->__anon1.cond.elseExp->isConstant)
18594 exp->isConstant = 0;
18595 FreeType(t);
18596 break;
18597 }
18598 case 23:
18599 {
18600 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18601 {
18602 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18603
18604 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18605 {
18606 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18607 if(exp->destType)
18608 exp->destType->refCount++;
18609 }
18610 ProcessStatement(exp->__anon1.compound);
18611 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18612 if(exp->expType)
18613 exp->expType->refCount++;
18614 }
18615 break;
18616 }
18617 case 24:
18618 {
18619 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18620
18621 if(spec && spec->type == 1)
18622 {
18623 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18624 exp->expType->kind = 19;
18625 exp->byReference = 1;
18626 }
18627 else
18628 {
18629 exp->expType = MkClassType("ecere::com::Class");
18630 exp->byReference = 1;
18631 }
18632 break;
18633 }
18634 case 25:
18635 {
18636 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18637
18638 if(_class)
18639 {
18640 struct Identifier * id = exp->__anon1.classData.id;
18641 char structName[1024];
18642 struct Expression * classExp;
18643
18644 strcpy(structName, "__ecereClassData_");
18645 FullClassNameCat(structName, _class->fullName, 0);
18646 exp->type = 9;
18647 exp->__anon1.member.member = id;
18648 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18649 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18650 else
18651 classExp = MkExpIdentifier(MkIdentifier("class"));
18652 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"))))))));
18653 ProcessExpressionType(exp);
18654 return ;
18655 }
18656 break;
18657 }
18658 case 35:
18659 {
18660 struct Type * type = (((void *)0));
18661 const char * typeString = (((void *)0));
18662 char typeStringBuf[1024];
18663
18664 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))
18665 {
18666 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18667
18668 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18669 }
18670 else if(exp->__anon1.list)
18671 {
18672 struct Expression * e;
18673
18674 for(e = (*exp->__anon1.list).first; e; e = e->next)
18675 {
18676 ProcessExpressionType(e);
18677 if(e->expType)
18678 {
18679 if(!type)
18680 {
18681 type = e->expType;
18682 type->refCount++;
18683 }
18684 else
18685 {
18686 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18687 {
18688 FreeType(type);
18689 type = e->expType;
18690 e->expType = (((void *)0));
18691 e = (*exp->__anon1.list).first;
18692 ProcessExpressionType(e);
18693 if(e->expType)
18694 {
18695 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18696 {
18697 FreeType(e->expType);
18698 e->expType = (((void *)0));
18699 FreeType(type);
18700 type = (((void *)0));
18701 break;
18702 }
18703 }
18704 }
18705 }
18706 if(e->expType)
18707 {
18708 FreeType(e->expType);
18709 e->expType = (((void *)0));
18710 }
18711 }
18712 }
18713 if(type)
18714 {
18715 typeStringBuf[0] = '\0';
18716 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18717 typeString = typeStringBuf;
18718 FreeType(type);
18719 type = (((void *)0));
18720 }
18721 }
18722 if(typeString)
18723 {
18724 char templateString[1024];
18725 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18726 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18727 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18728 struct Expression * expExt;
18729 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18730
18731 sprintf(templateString, "Container<%s>", typeString);
18732 if(exp->__anon1.list)
18733 {
18734 struct Expression * e;
18735
18736 type = ProcessTypeString(typeString, 0);
18737 while((e = (*exp->__anon1.list).first))
18738 {
18739 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18740 e->destType = type;
18741 type->refCount++;
18742 ProcessExpressionType(e);
18743 ListAdd(initializers, MkInitializerAssignment(e));
18744 }
18745 FreeType(type);
18746 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18747 }
18748 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18749 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18750 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18751 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18752 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18753 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18754 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18755 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18756 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18757 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18758 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18759
18760 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18761 })));
18762 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18763 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18764 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18765 exp->expType = ProcessTypeString(templateString, 0);
18766 exp->type = 5;
18767 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18768 ProcessExpressionType(expExt);
18769 }
18770 else
18771 {
18772 exp->expType = ProcessTypeString("Container", 0);
18773 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18774 }
18775 break;
18776 }
18777 }
18778 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18779 {
18780 FreeType(exp->expType);
18781 exp->expType = ReplaceThisClassType(thisClass);
18782 }
18783 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)
18784 {
18785 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
18786
18787 if(symbol)
18788 {
18789 if(exp->expType->kind != 15)
18790 {
18791 struct Type * member;
18792 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
18793
18794 FreeType(exp->expType);
18795 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18796 exp->expType->kind = symbol->type->kind;
18797 exp->expType->refCount++;
18798 exp->expType->__anon1.__anon1.enumName = enumName;
18799 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
18800 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18801 member->refCount++;
18802 }
18803 else
18804 {
18805 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
18806
18807 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18808 {
18809 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);
18810
18811 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
18812 }
18813 }
18814 }
18815 }
18816 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)))
18817 {
18818 exp->byReference = 1;
18819 }
18820 yylloc = exp->loc;
18821 if(exp->destType && (exp->destType->kind == 18))
18822 ;
18823 else if(exp->destType && !exp->destType->keepCast)
18824 {
18825 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
18826 exp->needTemplateCast = 1;
18827 if(exp->destType->kind == 0)
18828 ;
18829 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
18830 {
18831 unsigned int invalidCast = 0;
18832
18833 if(inCompiler && exp->destType->count && exp->expType)
18834 {
18835 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
18836 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
18837
18838 if(c1 && c1->type != 1)
18839 c1 = (((void *)0));
18840 if(c2 && c2->type != 1)
18841 c2 = (((void *)0));
18842 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
18843 invalidCast = 1;
18844 }
18845 if(!exp->destType->count || unresolved || invalidCast)
18846 {
18847 if(!exp->expType)
18848 {
18849 yylloc = exp->loc;
18850 if(exp->destType->kind != 14)
18851 {
18852 char type2[1024];
18853
18854 type2[0] = '\0';
18855 if(inCompiler)
18856 {
18857 char expString[10240];
18858
18859 expString[0] = '\0';
18860 PrintType(exp->destType, type2, 0, 1);
18861 if(inCompiler)
18862 {
18863 PrintExpression(exp, expString);
18864 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18865 }
18866 if(unresolved)
18867 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
18868 else if(exp->type != 16)
18869 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
18870 }
18871 }
18872 else
18873 {
18874 char expString[10240];
18875
18876 expString[0] = '\0';
18877 if(inCompiler)
18878 {
18879 PrintExpression(exp, expString);
18880 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18881 }
18882 if(unresolved)
18883 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
18884 else if(exp->type != 16)
18885 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18886 }
18887 }
18888 else
18889 {
18890 char type1[1024];
18891 char type2[1024];
18892
18893 type1[0] = '\0';
18894 type2[0] = '\0';
18895 if(inCompiler)
18896 {
18897 PrintType(exp->expType, type1, 0, 1);
18898 PrintType(exp->destType, type2, 0, 1);
18899 }
18900 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)))
18901 ;
18902 else
18903 {
18904 struct Expression * nbExp = GetNonBracketsExp(exp);
18905 unsigned int skipWarning = 0;
18906 int kind = exp->destType->kind;
18907
18908 if(nbExp->type == 12 && nbExp->destType && !nbExp->destType->casted && nbExp->destType->kind == exp->destType->kind)
18909 skipWarning = 1;
18910 if((kind == 1 || kind == 2) && exp->destType->isSigned == exp->expType->signedBeforePromotion && nbExp->type == 4 && nbExp->__anon1.op.exp1 && nbExp->__anon1.op.exp2)
18911 {
18912 int op = nbExp->__anon1.op.op;
18913 struct Expression * nbExp1, * nbExp2;
18914 int from;
18915
18916 switch(op)
18917 {
18918 case '%':
18919 case '/':
18920 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18921 from = nbExp1->expType->promotedFrom;
18922 if(from == 1 || (kind == 2 && from == 2))
18923 skipWarning = 1;
18924 break;
18925 case LEFT_OP:
18926 case RIGHT_OP:
18927 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18928 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18929 from = nbExp1->expType->promotedFrom;
18930 if(op == RIGHT_OP && (from == 1 || (kind == 2 && from == 2)))
18931 skipWarning = 1;
18932 else if(nbExp2->isConstant && nbExp2->type == 2 && (nbExp->__anon1.op.op == RIGHT_OP || nbExp1->expType->bitMemberSize))
18933 {
18934 int n = strtol(nbExp2->__anon1.__anon1.constant, (((void *)0)), 0);
18935 int s = from == 1 ? 8 : 16;
18936
18937 if(nbExp1->expType->bitMemberSize && nbExp1->expType->bitMemberSize < s)
18938 s = nbExp1->expType->bitMemberSize;
18939 if(nbExp->__anon1.op.op == RIGHT_OP)
18940 s -= n;
18941 else
18942 s += n;
18943 if(s <= (kind == 1 ? 8 : 16))
18944 skipWarning = 1;
18945 }
18946 break;
18947 case '-':
18948 if(!exp->destType->isSigned)
18949 {
18950 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18951 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18952 from = nbExp2->expType->promotedFrom;
18953 if((from == 1 || from == 2) && nbExp1->isConstant && nbExp1->type == 2)
18954 {
18955 int n = strtol(nbExp1->__anon1.__anon1.constant, (((void *)0)), 0);
18956
18957 if(n == (from == 1 ? 255 : 65535))
18958 skipWarning = 1;
18959 }
18960 }
18961 break;
18962 case '|':
18963 {
18964 int kind1, kind2;
18965
18966 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18967 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18968 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
18969 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
18970 if(((kind1 == 1 || (kind1 == 2 && kind == 2)) || MatchTypeExpression(nbExp1, exp->destType, (((void *)0)), 0, 0)) && ((kind2 == 1 || (kind2 == 2 && kind == 2)) || MatchTypeExpression(nbExp2, exp->destType, (((void *)0)), 0, 0)))
18971 skipWarning = 1;
18972 break;
18973 }
18974 case '&':
18975 {
18976 int kind1, kind2;
18977
18978 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18979 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18980 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
18981 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
18982 if(((kind1 == 1 || (kind1 == 2 && kind == 2)) || MatchTypeExpression(nbExp1, exp->destType, (((void *)0)), 0, 0)) || ((kind2 == 1 || (kind2 == 2 && kind == 2)) || MatchTypeExpression(nbExp2, exp->destType, (((void *)0)), 0, 0)))
18983 skipWarning = 1;
18984 break;
18985 }
18986 }
18987 }
18988 if(!skipWarning)
18989 {
18990 char expString[10240];
18991
18992 expString[0] = '\0';
18993 if(inCompiler)
18994 {
18995 PrintExpression(exp, expString);
18996 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18997 }
18998 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")))
18999 {
19000 if(invalidCast)
19001 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
19002 else
19003 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
19004 }
19005 }
19006 if(!inCompiler)
19007 {
19008 FreeType(exp->expType);
19009 exp->destType->refCount++;
19010 exp->expType = exp->destType;
19011 }
19012 }
19013 }
19014 }
19015 }
19016 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))
19017 {
19018 struct Expression * nbExp = GetNonBracketsExp(exp);
19019
19020 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
19021 {
19022 struct Expression * e = MoveExpContents(exp);
19023
19024 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
19025 exp->type = 11;
19026 exp->__anon1.cast.exp->destType = exp->destType;
19027 if(exp->destType)
19028 exp->destType->refCount++;
19029 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
19030 }
19031 }
19032 }
19033 else if(unresolved)
19034 {
19035 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
19036 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);
19037 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
19038 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
19039 }
19040 else if(!exp->expType && exp->type != 16)
19041 {
19042 char expString[10240];
19043
19044 expString[0] = '\0';
19045 if(inCompiler)
19046 {
19047 PrintExpression(exp, expString);
19048 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
19049 }
19050 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
19051 }
19052 if(inCompiler)
19053 ApplyAnyObjectLogic(exp);
19054 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)))
19055 {
19056 exp->byReference = 1;
19057 }
19058 yylloc = oldyylloc;
19059 }
19060
19061 static void ProcessFunction(struct FunctionDefinition * function)
19062 {
19063 struct Identifier * id = GetDeclId(function->declarator);
19064 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
19065 struct Type * type = symbol ? symbol->type : (((void *)0));
19066 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
19067 struct Context * oldTopContext = topContext;
19068
19069 yylloc = function->loc;
19070 if(type && type->__anon1.__anon2.thisClass)
19071 {
19072 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
19073 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
19074 char className[1024];
19075 char structName[1024];
19076 struct Declarator * funcDecl;
19077 struct Symbol * thisSymbol;
19078 unsigned int typedObject = 0;
19079
19080 if(_class && !_class->base)
19081 {
19082 _class = currentClass;
19083 if(_class && !_class->symbol)
19084 _class->symbol = FindClass(_class->fullName);
19085 classSym = _class ? _class->symbol : (((void *)0));
19086 typedObject = 1;
19087 }
19088 thisClass = _class;
19089 if(inCompiler && _class)
19090 {
19091 if(type->kind == 11)
19092 {
19093 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
19094 {
19095 struct Type * param = symbol->type->__anon1.__anon2.params.first;
19096
19097 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
19098 FreeType(param);
19099 }
19100 if(type->classObjectType != 1)
19101 {
19102 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
19103 symbol->type->__anon1.__anon2.staticMethod = 1;
19104 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
19105 symbol->type->extraParam = 0;
19106 }
19107 }
19108 strcpy(className, "__ecereClass_");
19109 FullClassNameCat(className, _class->fullName, 1);
19110 structName[0] = 0;
19111 FullClassNameCat(structName, _class->fullName, 0);
19112 funcDecl = GetFuncDecl(function->declarator);
19113 if(funcDecl)
19114 {
19115 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19116 {
19117 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19118
19119 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19120 {
19121 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19122 FreeTypeName(param);
19123 }
19124 }
19125 if(!function->propertyNoThis)
19126 {
19127 struct TypeName * thisParam = (((void *)0));
19128
19129 if(type->classObjectType != 1)
19130 {
19131 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19132 if(!funcDecl->__anon1.function.parameters)
19133 funcDecl->__anon1.function.parameters = MkList();
19134 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19135 }
19136 if(typedObject)
19137 {
19138 if(type->classObjectType != 1)
19139 {
19140 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
19141 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
19142 }
19143 thisParam = __extension__ ({
19144 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
19145
19146 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
19147 });
19148 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
19149 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19150 }
19151 }
19152 }
19153 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19154 {
19155 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19156
19157 funcDecl = GetFuncDecl(initDecl->declarator);
19158 if(funcDecl)
19159 {
19160 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19161 {
19162 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19163
19164 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19165 {
19166 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19167 FreeTypeName(param);
19168 }
19169 }
19170 if(type->classObjectType != 1)
19171 {
19172 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
19173 {
19174 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19175
19176 if(!funcDecl->__anon1.function.parameters)
19177 funcDecl->__anon1.function.parameters = MkList();
19178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19179 }
19180 }
19181 }
19182 }
19183 }
19184 if(function->body)
19185 {
19186 if(type->classObjectType != 1)
19187 {
19188 thisSymbol = __extension__ ({
19189 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
19190
19191 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
19192 });
19193 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19194 if(typedObject && thisSymbol->type)
19195 {
19196 thisSymbol->type->classObjectType = 2;
19197 thisSymbol->type->byReference = type->byReference;
19198 thisSymbol->type->typedByReference = type->byReference;
19199 }
19200 }
19201 }
19202 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
19203 {
19204 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
19205
19206 {
19207 struct __ecereNameSpace__ecere__com__Class * base;
19208
19209 for(base = _class; base && base->type != 1000; base = base->next)
19210 {
19211 for(member = base->membersAndProperties.first; member; member = member->next)
19212 if(!member->isProperty)
19213 break;
19214 if(member)
19215 break;
19216 }
19217 }
19218 for(member = _class->membersAndProperties.first; member; member = member->next)
19219 if(!member->isProperty)
19220 break;
19221 if(member)
19222 {
19223 char pointerName[1024];
19224 struct Declaration * decl;
19225 struct Initializer * initializer;
19226 struct Expression * exp, * bytePtr;
19227
19228 strcpy(pointerName, "__ecerePointer_");
19229 FullClassNameCat(pointerName, _class->fullName, 0);
19230 {
19231 char className[1024];
19232
19233 strcpy(className, "__ecereClass_");
19234 FullClassNameCat(className, classSym->string, 1);
19235 DeclareClass(curExternal, classSym, className);
19236 }
19237 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
19238 if(_class->fixed)
19239 {
19240 struct Expression * e;
19241
19242 if(_class->offset && _class->offset == (_class->base->type == 5 ? _class->base->memberOffset : _class->base->structSize))
19243 {
19244 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
19245 ProcessExpressionType(e);
19246 }
19247 else
19248 {
19249 char string[256];
19250
19251 sprintf(string, "%d", _class->offset);
19252 e = MkExpConstant(string);
19253 }
19254 exp = QBrackets(MkExpOp(bytePtr, '+', e));
19255 }
19256 else
19257 {
19258 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
19259 }
19260 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
19261 exp->expType = __extension__ ({
19262 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19263
19264 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
19265 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19266
19267 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19268 }), __ecereInstance2;
19269 });
19270 if(function->body)
19271 {
19272 yylloc = function->body->loc;
19273 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19274 {
19275 struct Context * prevContext = curContext;
19276 struct __ecereNameSpace__ecere__sys__OldList * list;
19277
19278 curContext = function->body->__anon1.compound.context;
19279 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19280 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19281 curContext = prevContext;
19282 }
19283 decl->symbol = (((void *)0));
19284 if(!function->body->__anon1.compound.declarations)
19285 function->body->__anon1.compound.declarations = MkList();
19286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19287 }
19288 }
19289 }
19290 }
19291 else
19292 thisClass = (((void *)0));
19293 if(id)
19294 {
19295 FreeSpecifier(id->_class);
19296 id->_class = (((void *)0));
19297 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19298 {
19299 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19300
19301 id = GetDeclId(initDecl->declarator);
19302 FreeSpecifier(id->_class);
19303 id->_class = (((void *)0));
19304 }
19305 }
19306 if(function->body)
19307 topContext = function->body->__anon1.compound.context;
19308 {
19309 struct FunctionDefinition * oldFunction = curFunction;
19310
19311 curFunction = function;
19312 if(function->body)
19313 ProcessStatement(function->body);
19314 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19315 {
19316 struct Statement * prevCompound = curCompound;
19317 struct Context * prevContext = curContext;
19318 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19319
19320 if(!function->body->__anon1.compound.statements)
19321 function->body->__anon1.compound.statements = MkList();
19322 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19323 curCompound = function->body;
19324 curContext = function->body->__anon1.compound.context;
19325 ProcessStatement(fireWatchers);
19326 curContext = prevContext;
19327 curCompound = prevCompound;
19328 }
19329 curFunction = oldFunction;
19330 }
19331 if(function->declarator)
19332 {
19333 ProcessDeclarator(function->declarator, 1);
19334 }
19335 topContext = oldTopContext;
19336 thisClass = oldThisClass;
19337 }
19338
19339 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19340 {
19341 struct ClassDef * def;
19342 struct External * external = curExternal;
19343 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19344
19345 for(def = definitions->first; def; def = def->next)
19346 {
19347 if(def->type == 0)
19348 {
19349 if(def->__anon1.function->declarator)
19350 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19351 else
19352 curExternal = external;
19353 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19354 }
19355 else if(def->type == 2)
19356 {
19357 if(def->__anon1.decl->type == 2)
19358 {
19359 thisClass = regClass;
19360 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19361 thisClass = (((void *)0));
19362 }
19363 else
19364 {
19365 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19366
19367 if(regClass)
19368 thisClass = regClass;
19369 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19370 thisClass = backThisClass;
19371 }
19372 }
19373 else if(def->type == 1 && def->__anon1.defProperties)
19374 {
19375 struct MemberInit * defProperty;
19376 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);
19377
19378 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19379 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19380 {
19381 thisClass = regClass;
19382 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19383 thisClass = (((void *)0));
19384 }
19385 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19386 FreeSymbol(thisSymbol);
19387 }
19388 else if(def->type == 3 && def->__anon1.propertyDef)
19389 {
19390 struct PropertyDef * prop = def->__anon1.propertyDef;
19391
19392 thisClass = regClass;
19393 if(prop->setStmt)
19394 {
19395 if(regClass)
19396 {
19397 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19398
19399 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19400 }
19401 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19402 ProcessStatement(prop->setStmt);
19403 }
19404 if(prop->getStmt)
19405 {
19406 if(regClass)
19407 {
19408 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19409
19410 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19411 }
19412 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19413 ProcessStatement(prop->getStmt);
19414 }
19415 if(prop->issetStmt)
19416 {
19417 if(regClass)
19418 {
19419 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19420
19421 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19422 }
19423 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19424 ProcessStatement(prop->issetStmt);
19425 }
19426 thisClass = (((void *)0));
19427 }
19428 else if(def->type == 4 && def->__anon1.propertyWatch)
19429 {
19430 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19431
19432 thisClass = regClass;
19433 if(propertyWatch->compound)
19434 {
19435 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);
19436
19437 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19438 curExternal = (((void *)0));
19439 ProcessStatement(propertyWatch->compound);
19440 }
19441 thisClass = (((void *)0));
19442 }
19443 }
19444 }
19445
19446 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19447 {
19448 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19449
19450 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19451 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19452 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19453 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19454 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19455 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19456 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19457 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19458 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19459 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19460 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19461 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19462 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19463 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19464 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19465 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19466 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19467 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19468 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19469 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19470 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19471 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19472 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19473 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19474 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19475 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19476 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19477 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19478 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19479 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19480 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19481 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19482 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19483 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19484 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19485 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19486 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19487 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19488 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19489 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19490 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19491 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19492 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19493 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19494 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19495 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19496 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19497 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19498 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19499 __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);
19500 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19501 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19502 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19503 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19504 __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);
19505 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19506 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19507 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19508 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19509 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19510 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19511 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19512 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19513 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19514 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19515 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19516 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19517 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19518 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19519 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19520 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)
19521 __ecereClass_Conversion = class;
19522 __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);
19523 __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);
19524 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19525 __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);
19526 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19527 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19528 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19529 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19530 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19531 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19532 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19533 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19534 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19535 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19536 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19537 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19538 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19539 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19540 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19541 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19542 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19543 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19544 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19545 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19546 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19547 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19548 }
19549