compiler/libec: Fixed reference issue with conversion properties
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #if defined(_WIN32)
39 #   if defined(__GNUC__) || defined(__TINYC__)
40 #      define ecere_stdcall __attribute__((__stdcall__))
41 #      define ecere_gcc_struct __attribute__((gcc_struct))
42 #   else
43 #      define ecere_stdcall __stdcall
44 #      define ecere_gcc_struct
45 #   endif
46 #else
47 #   define ecere_stdcall
48 #   define ecere_gcc_struct
49 #endif
50 #include <stdint.h>
51 #include <sys/types.h>
52 enum yytokentype
53 {
54 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372, WIDE_STRING_LITERAL = 373
55 };
56
57 extern int returnCode;
58
59 extern unsigned int yydebug;
60
61 extern unsigned int echoOn;
62
63 void resetScanner();
64
65 int propWatcherID;
66
67 int expression_yyparse();
68
69 static char * thisNameSpace;
70
71 unsigned int thisClassParams = 1;
72
73 unsigned int internalValueCounter;
74
75 extern unsigned int outputLineNumbers;
76
77 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isInf;
78
79 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_signBit;
80
81 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isNan;
82
83 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isInf;
84
85 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_signBit;
86
87 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isNan;
88
89 extern int targetBits;
90
91 extern unsigned int inCompiler;
92
93 extern unsigned int inPreCompiler;
94
95 extern unsigned int inDebugger;
96
97 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
98
99 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
100
101 int UnescapeString(char * d, char * s, int len)
102 {
103 int j = 0, k = 0;
104 char ch;
105
106 while(j < len && (ch = s[j]))
107 {
108 switch(ch)
109 {
110 case '\\':
111 switch((ch = s[++j]))
112 {
113 case 'n':
114 d[k] = '\n';
115 break;
116 case 't':
117 d[k] = '\t';
118 break;
119 case 'a':
120 d[k] = '\a';
121 break;
122 case 'b':
123 d[k] = '\b';
124 break;
125 case 'f':
126 d[k] = '\f';
127 break;
128 case 'r':
129 d[k] = '\r';
130 break;
131 case 'v':
132 d[k] = '\v';
133 break;
134 case '\\':
135 d[k] = '\\';
136 break;
137 case '\"':
138 d[k] = '\"';
139 break;
140 case '\'':
141 d[k] = '\'';
142 break;
143 default:
144 d[k] = '\\';
145 d[k] = ch;
146 }
147 break;
148 default:
149 d[k] = ch;
150 }
151 j++, k++;
152 }
153 d[k] = '\0';
154 return k;
155 }
156
157 char * OffsetEscapedString(char * s, int len, int offset)
158 {
159 char ch;
160 int j = 0, k = 0;
161
162 while(j < len && k < offset && (ch = s[j]))
163 {
164 if(ch == '\\')
165 ++j;
166 j++, k++;
167 }
168 return (k == offset) ? s + j : (((void *)0));
169 }
170
171 extern int __ecereVMethodID_class_OnGetString;
172
173 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
174
175 extern unsigned int parseError;
176
177 static int definedExpStackPos;
178
179 static void * definedExpStack[512];
180
181 extern const char *  sourceFile;
182
183 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
184
185 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 } ecere_gcc_struct __anon1;
1384 unsigned int debugValue;
1385 struct __ecereNameSpace__ecere__com__DataValue val;
1386 uint64 address;
1387 unsigned int hasAddress;
1388 struct Type * expType;
1389 struct Type * destType;
1390 unsigned int usage;
1391 int tempCount;
1392 unsigned int byReference;
1393 unsigned int isConstant;
1394 unsigned int addedThis;
1395 unsigned int needCast;
1396 unsigned int thisPtr;
1397 unsigned int opDestType;
1398 unsigned int needTemplateCast;
1399 } ecere_gcc_struct;
1400
1401 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1402
1403 struct Initializer
1404 {
1405 struct Initializer * prev;
1406 struct Initializer * next;
1407 struct Location loc;
1408 int type;
1409 union
1410 {
1411 struct Expression * exp;
1412 struct __ecereNameSpace__ecere__sys__OldList *  list;
1413 } ecere_gcc_struct __anon1;
1414 unsigned int isConstant;
1415 struct Identifier * id;
1416 } ecere_gcc_struct;
1417
1418 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1419
1420 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
1421
1422 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
1423
1424 struct InitDeclarator
1425 {
1426 struct InitDeclarator * prev;
1427 struct InitDeclarator * next;
1428 struct Location loc;
1429 struct Declarator * declarator;
1430 struct Initializer * initializer;
1431 } ecere_gcc_struct;
1432
1433 void ApplyLocation(struct Expression * exp, struct Location * loc)
1434 {
1435 exp->loc = *loc;
1436 switch(exp->type)
1437 {
1438 case 4:
1439 if(exp->__anon1.op.exp1)
1440 ApplyLocation(exp->__anon1.op.exp1, loc);
1441 if(exp->__anon1.op.exp2)
1442 ApplyLocation(exp->__anon1.op.exp2, loc);
1443 break;
1444 case 5:
1445 if(exp->__anon1.list)
1446 {
1447 struct Expression * e;
1448
1449 for(e = (*exp->__anon1.list).first; e; e = e->next)
1450 ApplyLocation(e, loc);
1451 }
1452 break;
1453 case 6:
1454 if(exp->__anon1.index.index)
1455 {
1456 struct Expression * e;
1457
1458 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1459 ApplyLocation(e, loc);
1460 }
1461 if(exp->__anon1.index.exp)
1462 ApplyLocation(exp->__anon1.index.exp, loc);
1463 break;
1464 case 7:
1465 if(exp->__anon1.call.arguments)
1466 {
1467 struct Expression * arg;
1468
1469 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1470 ApplyLocation(arg, loc);
1471 }
1472 if(exp->__anon1.call.exp)
1473 ApplyLocation(exp->__anon1.call.exp, loc);
1474 break;
1475 case 8:
1476 case 9:
1477 if(exp->__anon1.member.exp)
1478 ApplyLocation(exp->__anon1.member.exp, loc);
1479 break;
1480 case 11:
1481 if(exp->__anon1.cast.exp)
1482 ApplyLocation(exp->__anon1.cast.exp, loc);
1483 break;
1484 case 12:
1485 if(exp->__anon1.cond.exp)
1486 {
1487 struct Expression * e;
1488
1489 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1490 ApplyLocation(e, loc);
1491 }
1492 if(exp->__anon1.cond.cond)
1493 ApplyLocation(exp->__anon1.cond.cond, loc);
1494 if(exp->__anon1.cond.elseExp)
1495 ApplyLocation(exp->__anon1.cond.elseExp, loc);
1496 break;
1497 case 34:
1498 if(exp->__anon1.vaArg.exp)
1499 ApplyLocation(exp->__anon1.vaArg.exp, loc);
1500 break;
1501 default:
1502 break;
1503 }
1504 }
1505
1506 void __ecereMethod_Expression_Clear();
1507
1508 struct MembersInit;
1509
1510 struct MembersInit
1511 {
1512 struct MembersInit * prev;
1513 struct MembersInit * next;
1514 struct Location loc;
1515 int type;
1516 union
1517 {
1518 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1519 struct ClassFunction * function;
1520 } ecere_gcc_struct __anon1;
1521 } ecere_gcc_struct;
1522
1523 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
1524
1525 struct Operand;
1526
1527 struct OpTable
1528 {
1529 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1530 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1531 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1532 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1533 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1534 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1535 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1536 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1537 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1538 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1539 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1540 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1541 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1542 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1543 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1544 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1545 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1546 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1547 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1548 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1549 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1550 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1551 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1552 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1553 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1554 unsigned int (*  Not)(struct Expression *, struct Operand *);
1555 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1556 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1557 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1558 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1559 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1560 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1561 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1562 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1563 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1564 } ecere_gcc_struct;
1565
1566 struct Operand
1567 {
1568 int kind;
1569 struct Type * type;
1570 unsigned int ptrSize;
1571 union
1572 {
1573 char c;
1574 unsigned char uc;
1575 short s;
1576 unsigned short us;
1577 int i;
1578 unsigned int ui;
1579 float f;
1580 double d;
1581 long long i64;
1582 uint64 ui64;
1583 } ecere_gcc_struct __anon1;
1584 struct OpTable ops;
1585 } ecere_gcc_struct;
1586
1587 struct External *  _DeclareStruct(struct External *  neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl);
1588
1589 struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference)
1590 {
1591 return _DeclareStruct(neededBy, name, skipNoHead, needDereference, 0);
1592 }
1593
1594 static void _DeclareType(struct External *  neededFor, struct Type *  type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl);
1595
1596 void DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1597 {
1598 _DeclareType(neededFor, type, needDereference, forFunctionDef, 0);
1599 }
1600
1601 void DeclareTypeForwardDeclare(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1602 {
1603 _DeclareType(neededFor, type, needDereference, forFunctionDef, 1);
1604 }
1605
1606 static void _PrintType(struct Type *  type, char *  string, unsigned int printName, unsigned int fullName, unsigned int printConst);
1607
1608 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1609 {
1610 _PrintType(type, string, printName, fullName, 1);
1611 }
1612
1613 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1614 {
1615 _PrintType(type, string, printName, fullName, 0);
1616 }
1617
1618 struct __ecereNameSpace__ecere__com__Method;
1619
1620 struct __ecereNameSpace__ecere__com__Method
1621 {
1622 const char *  name;
1623 struct __ecereNameSpace__ecere__com__Method * parent;
1624 struct __ecereNameSpace__ecere__com__Method * left;
1625 struct __ecereNameSpace__ecere__com__Method * right;
1626 int depth;
1627 int (*  function)();
1628 int vid;
1629 int type;
1630 struct __ecereNameSpace__ecere__com__Class * _class;
1631 void *  symbol;
1632 const char *  dataTypeString;
1633 struct Type * dataType;
1634 int memberAccess;
1635 } ecere_gcc_struct;
1636
1637 struct Symbol
1638 {
1639 char *  string;
1640 struct Symbol * parent;
1641 struct Symbol * left;
1642 struct Symbol * right;
1643 int depth;
1644 struct Type * type;
1645 union
1646 {
1647 struct __ecereNameSpace__ecere__com__Method * method;
1648 struct __ecereNameSpace__ecere__com__Property * _property;
1649 struct __ecereNameSpace__ecere__com__Class * registered;
1650 } ecere_gcc_struct __anon1;
1651 unsigned int notYetDeclared;
1652 union
1653 {
1654 struct
1655 {
1656 struct External * pointerExternal;
1657 struct External * structExternal;
1658 } ecere_gcc_struct __anon1;
1659 struct
1660 {
1661 struct External * externalGet;
1662 struct External * externalSet;
1663 struct External * externalPtr;
1664 struct External * externalIsSet;
1665 } ecere_gcc_struct __anon2;
1666 struct
1667 {
1668 struct External * methodExternal;
1669 struct External * methodCodeExternal;
1670 } ecere_gcc_struct __anon3;
1671 } ecere_gcc_struct __anon2;
1672 unsigned int imported;
1673 unsigned int declaredStructSym;
1674 struct __ecereNameSpace__ecere__com__Class * _class;
1675 unsigned int declaredStruct;
1676 unsigned int needConstructor;
1677 unsigned int needDestructor;
1678 char *  constructorName;
1679 char *  structName;
1680 char *  className;
1681 char *  destructorName;
1682 struct ModuleImport * module;
1683 struct ClassImport * _import;
1684 struct Location nameLoc;
1685 unsigned int isParam;
1686 unsigned int isRemote;
1687 unsigned int isStruct;
1688 unsigned int fireWatchersDone;
1689 int declaring;
1690 unsigned int classData;
1691 unsigned int isStatic;
1692 char *  shortName;
1693 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
1694 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
1695 struct Context * ctx;
1696 int isIterator;
1697 struct Expression * propCategory;
1698 unsigned int mustRegister;
1699 } ecere_gcc_struct;
1700
1701 struct __ecereNameSpace__ecere__com__ClassProperty;
1702
1703 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1704
1705 struct __ecereNameSpace__ecere__com__ClassProperty
1706 {
1707 const char *  name;
1708 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1709 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1710 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1711 int depth;
1712 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1713 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1714 const char *  dataTypeString;
1715 struct Type * dataType;
1716 unsigned int constant;
1717 } ecere_gcc_struct;
1718
1719 struct __ecereNameSpace__ecere__com__BitMember;
1720
1721 struct __ecereNameSpace__ecere__com__BitMember
1722 {
1723 struct __ecereNameSpace__ecere__com__BitMember * prev;
1724 struct __ecereNameSpace__ecere__com__BitMember * next;
1725 const char *  name;
1726 unsigned int isProperty;
1727 int memberAccess;
1728 int id;
1729 struct __ecereNameSpace__ecere__com__Class * _class;
1730 const char *  dataTypeString;
1731 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1732 struct Type * dataType;
1733 int type;
1734 int size;
1735 int pos;
1736 uint64 mask;
1737 } ecere_gcc_struct;
1738
1739 struct __ecereNameSpace__ecere__com__DataMember;
1740
1741 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1742 {
1743 union
1744 {
1745 struct
1746 {
1747 const char *  dataTypeString;
1748 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1749 } ecere_gcc_struct __anon1;
1750 struct __ecereNameSpace__ecere__com__DataValue expression;
1751 struct
1752 {
1753 const char *  memberString;
1754 union
1755 {
1756 struct __ecereNameSpace__ecere__com__DataMember * member;
1757 struct __ecereNameSpace__ecere__com__Property * prop;
1758 struct __ecereNameSpace__ecere__com__Method * method;
1759 } ecere_gcc_struct __anon1;
1760 } ecere_gcc_struct __anon2;
1761 } ecere_gcc_struct __anon1;
1762 } ecere_gcc_struct;
1763
1764 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);
1765
1766 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);
1767
1768 struct TemplateParameter;
1769
1770 struct TemplateParameter
1771 {
1772 struct TemplateParameter * prev;
1773 struct TemplateParameter * next;
1774 struct Location loc;
1775 int type;
1776 struct Identifier * identifier;
1777 union
1778 {
1779 struct TemplateDatatype * dataType;
1780 int memberType;
1781 } ecere_gcc_struct __anon1;
1782 struct TemplateArgument * defaultArgument;
1783 const char *  dataTypeString;
1784 struct Type * baseType;
1785 } ecere_gcc_struct;
1786
1787 struct Type
1788 {
1789 struct Type * prev;
1790 struct Type * next;
1791 int refCount;
1792 union
1793 {
1794 struct Symbol * _class;
1795 struct
1796 {
1797 struct __ecereNameSpace__ecere__sys__OldList members;
1798 char *  enumName;
1799 } ecere_gcc_struct __anon1;
1800 struct
1801 {
1802 struct Type * returnType;
1803 struct __ecereNameSpace__ecere__sys__OldList params;
1804 struct Symbol * thisClass;
1805 unsigned int staticMethod;
1806 struct TemplateParameter * thisClassTemplate;
1807 } ecere_gcc_struct __anon2;
1808 struct
1809 {
1810 struct __ecereNameSpace__ecere__com__Method * method;
1811 struct __ecereNameSpace__ecere__com__Class * methodClass;
1812 struct __ecereNameSpace__ecere__com__Class * usedClass;
1813 } ecere_gcc_struct __anon3;
1814 struct
1815 {
1816 struct Type * arrayType;
1817 int arraySize;
1818 struct Expression * arraySizeExp;
1819 unsigned int freeExp;
1820 struct Symbol * enumClass;
1821 } ecere_gcc_struct __anon4;
1822 struct Type * type;
1823 struct TemplateParameter * templateParameter;
1824 } ecere_gcc_struct __anon1;
1825 int kind;
1826 unsigned int size;
1827 char *  name;
1828 char *  typeName;
1829 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1830 int promotedFrom;
1831 int classObjectType;
1832 int alignment;
1833 unsigned int offset;
1834 int bitFieldCount;
1835 int count;
1836 int bitMemberSize;
1837 unsigned int isSigned : 1;
1838 unsigned int constant : 1;
1839 unsigned int truth : 1;
1840 unsigned int byReference : 1;
1841 unsigned int extraParam : 1;
1842 unsigned int directClassAccess : 1;
1843 unsigned int computing : 1;
1844 unsigned int keepCast : 1;
1845 unsigned int passAsTemplate : 1;
1846 unsigned int dllExport : 1;
1847 unsigned int attrStdcall : 1;
1848 unsigned int declaredWithStruct : 1;
1849 unsigned int typedByReference : 1;
1850 unsigned int casted : 1;
1851 unsigned int pointerAlignment : 1;
1852 unsigned int isLong : 1;
1853 unsigned int signedBeforePromotion : 1;
1854 } ecere_gcc_struct;
1855
1856 struct Specifier
1857 {
1858 struct Specifier * prev;
1859 struct Specifier * next;
1860 struct Location loc;
1861 int type;
1862 union
1863 {
1864 int specifier;
1865 struct
1866 {
1867 struct ExtDecl * extDecl;
1868 char *  name;
1869 struct Symbol * symbol;
1870 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
1871 struct Specifier * nsSpec;
1872 } ecere_gcc_struct __anon1;
1873 struct
1874 {
1875 struct Identifier * id;
1876 struct __ecereNameSpace__ecere__sys__OldList *  list;
1877 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
1878 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
1879 unsigned int addNameSpace;
1880 struct Context * ctx;
1881 struct ExtDecl * extDeclStruct;
1882 } ecere_gcc_struct __anon2;
1883 struct Expression * expression;
1884 struct Specifier * _class;
1885 struct TemplateParameter * templateParameter;
1886 } ecere_gcc_struct __anon1;
1887 } ecere_gcc_struct;
1888
1889 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
1890
1891 struct TemplatedType
1892 {
1893 uintptr_t key;
1894 struct __ecereNameSpace__ecere__sys__BTNode * parent;
1895 struct __ecereNameSpace__ecere__sys__BTNode * left;
1896 struct __ecereNameSpace__ecere__sys__BTNode * right;
1897 int depth;
1898 struct TemplateParameter * param;
1899 } ecere_gcc_struct;
1900
1901 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1902 {
1903 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1904 {
1905 if(!param->baseType)
1906 {
1907 if(param->dataTypeString)
1908 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1909 else
1910 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1911 }
1912 return param->baseType;
1913 }
1914 return (((void *)0));
1915 }
1916
1917 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1918 {
1919 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1920 return 1;
1921 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1922 {
1923 return 0;
1924 }
1925 if(type1->kind == type2->kind && type1->isLong == type2->isLong)
1926 {
1927 switch(type1->kind)
1928 {
1929 case 24:
1930 case 1:
1931 case 2:
1932 case 3:
1933 case 4:
1934 case 22:
1935 case 23:
1936 if(type1->passAsTemplate && !type2->passAsTemplate)
1937 return 1;
1938 return type1->isSigned != type2->isSigned;
1939 case 8:
1940 return type1->__anon1._class != type2->__anon1._class;
1941 case 13:
1942 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1943 default:
1944 return 1;
1945 }
1946 }
1947 return 1;
1948 }
1949
1950 unsigned int GetOpInt(struct Operand * op2, int * value2)
1951 {
1952 if(op2->kind == 3 && op2->type->isSigned)
1953 *value2 = op2->__anon1.i;
1954 else if(op2->kind == 3)
1955 *value2 = (int)op2->__anon1.ui;
1956 else if(op2->kind == 4 && op2->type->isSigned)
1957 *value2 = (int)op2->__anon1.i64;
1958 else if(op2->kind == 4)
1959 *value2 = (int)op2->__anon1.ui64;
1960 else if(op2->kind == 23 && op2->type->isSigned)
1961 *value2 = (int)op2->__anon1.i64;
1962 else if(op2->kind == 23)
1963 *value2 = (int)op2->__anon1.ui64;
1964 else if(op2->kind == 22 && op2->type->isSigned)
1965 *value2 = (int)op2->__anon1.i64;
1966 else if(op2->kind == 22)
1967 *value2 = (int)op2->__anon1.ui64;
1968 else if(op2->kind == 2 && op2->type->isSigned)
1969 *value2 = (int)op2->__anon1.s;
1970 else if(op2->kind == 2)
1971 *value2 = (int)op2->__anon1.us;
1972 else if(op2->kind == 1 && op2->type->isSigned)
1973 *value2 = (int)op2->__anon1.c;
1974 else if(op2->kind == 24 || op2->kind == 1)
1975 *value2 = (int)op2->__anon1.uc;
1976 else if(op2->kind == 6)
1977 *value2 = (int)op2->__anon1.f;
1978 else if(op2->kind == 7)
1979 *value2 = (int)op2->__anon1.d;
1980 else if(op2->kind == 13)
1981 *value2 = (int)op2->__anon1.ui64;
1982 else
1983 return 0;
1984 return 1;
1985 }
1986
1987 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1988 {
1989 if(op2->kind == 3 && op2->type->isSigned)
1990 *value2 = (unsigned int)op2->__anon1.i;
1991 else if(op2->kind == 3)
1992 *value2 = op2->__anon1.ui;
1993 else if(op2->kind == 4 && op2->type->isSigned)
1994 *value2 = (unsigned int)op2->__anon1.i64;
1995 else if(op2->kind == 4)
1996 *value2 = (unsigned int)op2->__anon1.ui64;
1997 else if(op2->kind == 23 && op2->type->isSigned)
1998 *value2 = (unsigned int)op2->__anon1.i64;
1999 else if(op2->kind == 23)
2000 *value2 = (unsigned int)op2->__anon1.ui64;
2001 else if(op2->kind == 22 && op2->type->isSigned)
2002 *value2 = (unsigned int)op2->__anon1.i64;
2003 else if(op2->kind == 22)
2004 *value2 = (unsigned int)op2->__anon1.ui64;
2005 else if(op2->kind == 2 && op2->type->isSigned)
2006 *value2 = (unsigned int)op2->__anon1.s;
2007 else if(op2->kind == 2)
2008 *value2 = (unsigned int)op2->__anon1.us;
2009 else if(op2->kind == 1 && op2->type->isSigned)
2010 *value2 = (unsigned int)op2->__anon1.c;
2011 else if(op2->kind == 24 || op2->kind == 1)
2012 *value2 = (unsigned int)op2->__anon1.uc;
2013 else if(op2->kind == 6)
2014 *value2 = (unsigned int)op2->__anon1.f;
2015 else if(op2->kind == 7)
2016 *value2 = (unsigned int)op2->__anon1.d;
2017 else if(op2->kind == 13)
2018 *value2 = (unsigned int)op2->__anon1.ui64;
2019 else
2020 return 0;
2021 return 1;
2022 }
2023
2024 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
2025 {
2026 if(op2->kind == 3 && op2->type->isSigned)
2027 *value2 = (long long)op2->__anon1.i;
2028 else if(op2->kind == 3)
2029 *value2 = (long long)op2->__anon1.ui;
2030 else if(op2->kind == 4 && op2->type->isSigned)
2031 *value2 = op2->__anon1.i64;
2032 else if(op2->kind == 4)
2033 *value2 = (long long)op2->__anon1.ui64;
2034 else if(op2->kind == 23 && op2->type->isSigned)
2035 *value2 = op2->__anon1.i64;
2036 else if(op2->kind == 23)
2037 *value2 = (long long)op2->__anon1.ui64;
2038 else if(op2->kind == 22 && op2->type->isSigned)
2039 *value2 = op2->__anon1.i64;
2040 else if(op2->kind == 22)
2041 *value2 = (long long)op2->__anon1.ui64;
2042 else if(op2->kind == 2 && op2->type->isSigned)
2043 *value2 = (long long)op2->__anon1.s;
2044 else if(op2->kind == 2)
2045 *value2 = (long long)op2->__anon1.us;
2046 else if(op2->kind == 1 && op2->type->isSigned)
2047 *value2 = (long long)op2->__anon1.c;
2048 else if(op2->kind == 24 || op2->kind == 1)
2049 *value2 = (long long)op2->__anon1.uc;
2050 else if(op2->kind == 6)
2051 *value2 = (long long)op2->__anon1.f;
2052 else if(op2->kind == 7)
2053 *value2 = (long long)op2->__anon1.d;
2054 else if(op2->kind == 13)
2055 *value2 = (long long)op2->__anon1.ui64;
2056 else
2057 return 0;
2058 return 1;
2059 }
2060
2061 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
2062 {
2063 if(op2->kind == 3 && op2->type->isSigned)
2064 *value2 = (uint64)op2->__anon1.i;
2065 else if(op2->kind == 3)
2066 *value2 = (uint64)op2->__anon1.ui;
2067 else if(op2->kind == 4 && op2->type->isSigned)
2068 *value2 = (uint64)op2->__anon1.i64;
2069 else if(op2->kind == 4)
2070 *value2 = op2->__anon1.ui64;
2071 else if(op2->kind == 23 && op2->type->isSigned)
2072 *value2 = (uint64)op2->__anon1.i64;
2073 else if(op2->kind == 23)
2074 *value2 = op2->__anon1.ui64;
2075 else if(op2->kind == 22 && op2->type->isSigned)
2076 *value2 = (uint64)op2->__anon1.i64;
2077 else if(op2->kind == 22)
2078 *value2 = op2->__anon1.ui64;
2079 else if(op2->kind == 2 && op2->type->isSigned)
2080 *value2 = (uint64)op2->__anon1.s;
2081 else if(op2->kind == 2)
2082 *value2 = (uint64)op2->__anon1.us;
2083 else if(op2->kind == 1 && op2->type->isSigned)
2084 *value2 = (uint64)op2->__anon1.c;
2085 else if(op2->kind == 24 || op2->kind == 1)
2086 *value2 = (uint64)op2->__anon1.uc;
2087 else if(op2->kind == 6)
2088 *value2 = (uint64)op2->__anon1.f;
2089 else if(op2->kind == 7)
2090 *value2 = (uint64)op2->__anon1.d;
2091 else if(op2->kind == 13)
2092 *value2 = op2->__anon1.ui64;
2093 else
2094 return 0;
2095 return 1;
2096 }
2097
2098 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
2099 {
2100 if(op2->kind == 3 && op2->type->isSigned)
2101 *value2 = (intptr_t)op2->__anon1.i;
2102 else if(op2->kind == 3)
2103 *value2 = (intptr_t)op2->__anon1.ui;
2104 else if(op2->kind == 4 && op2->type->isSigned)
2105 *value2 = (intptr_t)op2->__anon1.i64;
2106 else if(op2->kind == 4)
2107 *value2 = (intptr_t)op2->__anon1.ui64;
2108 else if(op2->kind == 23 && op2->type->isSigned)
2109 *value2 = (intptr_t)op2->__anon1.i64;
2110 else if(op2->kind == 23)
2111 *value2 = (intptr_t)op2->__anon1.ui64;
2112 else if(op2->kind == 22 && op2->type->isSigned)
2113 *value2 = (intptr_t)op2->__anon1.i64;
2114 else if(op2->kind == 22)
2115 *value2 = (intptr_t)op2->__anon1.ui64;
2116 else if(op2->kind == 2 && op2->type->isSigned)
2117 *value2 = (intptr_t)op2->__anon1.s;
2118 else if(op2->kind == 2)
2119 *value2 = (intptr_t)op2->__anon1.us;
2120 else if(op2->kind == 1 && op2->type->isSigned)
2121 *value2 = (intptr_t)op2->__anon1.c;
2122 else if(op2->kind == 24 || op2->kind == 1)
2123 *value2 = (intptr_t)op2->__anon1.uc;
2124 else if(op2->kind == 6)
2125 *value2 = (intptr_t)op2->__anon1.f;
2126 else if(op2->kind == 7)
2127 *value2 = (intptr_t)op2->__anon1.d;
2128 else if(op2->kind == 13)
2129 *value2 = (intptr_t)op2->__anon1.ui64;
2130 else
2131 return 0;
2132 return 1;
2133 }
2134
2135 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
2136 {
2137 if(op2->kind == 3 && op2->type->isSigned)
2138 *value2 = (uintptr_t)op2->__anon1.i;
2139 else if(op2->kind == 3)
2140 *value2 = (uintptr_t)op2->__anon1.ui;
2141 else if(op2->kind == 4 && op2->type->isSigned)
2142 *value2 = (uintptr_t)op2->__anon1.i64;
2143 else if(op2->kind == 4)
2144 *value2 = (uintptr_t)op2->__anon1.ui64;
2145 else if(op2->kind == 23 && op2->type->isSigned)
2146 *value2 = (uintptr_t)op2->__anon1.i64;
2147 else if(op2->kind == 23)
2148 *value2 = (uintptr_t)op2->__anon1.ui64;
2149 else if(op2->kind == 22 && op2->type->isSigned)
2150 *value2 = (uintptr_t)op2->__anon1.i64;
2151 else if(op2->kind == 22)
2152 *value2 = (uintptr_t)op2->__anon1.ui64;
2153 else if(op2->kind == 2 && op2->type->isSigned)
2154 *value2 = (uintptr_t)op2->__anon1.s;
2155 else if(op2->kind == 2)
2156 *value2 = (uintptr_t)op2->__anon1.us;
2157 else if(op2->kind == 1 && op2->type->isSigned)
2158 *value2 = (uintptr_t)op2->__anon1.c;
2159 else if(op2->kind == 24 || op2->kind == 1)
2160 *value2 = (uintptr_t)op2->__anon1.uc;
2161 else if(op2->kind == 6)
2162 *value2 = (uintptr_t)op2->__anon1.f;
2163 else if(op2->kind == 7)
2164 *value2 = (uintptr_t)op2->__anon1.d;
2165 else if(op2->kind == 13)
2166 *value2 = (uintptr_t)op2->__anon1.ui64;
2167 else
2168 return 0;
2169 return 1;
2170 }
2171
2172 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2173 {
2174 if(op2->kind == 3 && op2->type->isSigned)
2175 *value2 = (ssize_t)op2->__anon1.i;
2176 else if(op2->kind == 3)
2177 *value2 = (ssize_t)op2->__anon1.ui;
2178 else if(op2->kind == 4 && op2->type->isSigned)
2179 *value2 = (ssize_t)op2->__anon1.i64;
2180 else if(op2->kind == 4)
2181 *value2 = (ssize_t)op2->__anon1.ui64;
2182 else if(op2->kind == 23 && op2->type->isSigned)
2183 *value2 = (ssize_t)op2->__anon1.i64;
2184 else if(op2->kind == 23)
2185 *value2 = (ssize_t)op2->__anon1.ui64;
2186 else if(op2->kind == 22 && op2->type->isSigned)
2187 *value2 = (ssize_t)op2->__anon1.i64;
2188 else if(op2->kind == 22)
2189 *value2 = (ssize_t)op2->__anon1.ui64;
2190 else if(op2->kind == 2 && op2->type->isSigned)
2191 *value2 = (ssize_t)op2->__anon1.s;
2192 else if(op2->kind == 2)
2193 *value2 = (ssize_t)op2->__anon1.us;
2194 else if(op2->kind == 1 && op2->type->isSigned)
2195 *value2 = (ssize_t)op2->__anon1.c;
2196 else if(op2->kind == 24 || op2->kind == 1)
2197 *value2 = (ssize_t)op2->__anon1.uc;
2198 else if(op2->kind == 6)
2199 *value2 = (ssize_t)op2->__anon1.f;
2200 else if(op2->kind == 7)
2201 *value2 = (ssize_t)op2->__anon1.d;
2202 else if(op2->kind == 13)
2203 *value2 = (ssize_t)op2->__anon1.ui64;
2204 else
2205 return 0;
2206 return 1;
2207 }
2208
2209 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2210 {
2211 if(op2->kind == 3 && op2->type->isSigned)
2212 *value2 = (size_t)op2->__anon1.i;
2213 else if(op2->kind == 3)
2214 *value2 = (size_t)op2->__anon1.ui;
2215 else if(op2->kind == 4 && op2->type->isSigned)
2216 *value2 = (size_t)op2->__anon1.i64;
2217 else if(op2->kind == 4)
2218 *value2 = (size_t)op2->__anon1.ui64;
2219 else if(op2->kind == 23 && op2->type->isSigned)
2220 *value2 = (size_t)op2->__anon1.i64;
2221 else if(op2->kind == 23)
2222 *value2 = (size_t)op2->__anon1.ui64;
2223 else if(op2->kind == 22 && op2->type->isSigned)
2224 *value2 = (size_t)op2->__anon1.i64;
2225 else if(op2->kind == 22)
2226 *value2 = (size_t)op2->__anon1.ui64;
2227 else if(op2->kind == 2 && op2->type->isSigned)
2228 *value2 = (size_t)op2->__anon1.s;
2229 else if(op2->kind == 2)
2230 *value2 = (size_t)op2->__anon1.us;
2231 else if(op2->kind == 1 && op2->type->isSigned)
2232 *value2 = (size_t)op2->__anon1.c;
2233 else if(op2->kind == 24 || op2->kind == 1)
2234 *value2 = (size_t)op2->__anon1.uc;
2235 else if(op2->kind == 6)
2236 *value2 = (size_t)op2->__anon1.f;
2237 else if(op2->kind == 7)
2238 *value2 = (size_t)op2->__anon1.d;
2239 else if(op2->kind == 13)
2240 *value2 = (size_t)op2->__anon1.ui64;
2241 else
2242 return 0;
2243 return 1;
2244 }
2245
2246 unsigned int GetOpShort(struct Operand * op2, short * value2)
2247 {
2248 if(op2->kind == 3 && op2->type->isSigned)
2249 *value2 = (short)op2->__anon1.i;
2250 else if(op2->kind == 3)
2251 *value2 = (short)op2->__anon1.ui;
2252 else if(op2->kind == 4 && op2->type->isSigned)
2253 *value2 = (short)op2->__anon1.i64;
2254 else if(op2->kind == 4)
2255 *value2 = (short)op2->__anon1.ui64;
2256 else if(op2->kind == 23 && op2->type->isSigned)
2257 *value2 = (short)op2->__anon1.i64;
2258 else if(op2->kind == 23)
2259 *value2 = (short)op2->__anon1.ui64;
2260 else if(op2->kind == 22 && op2->type->isSigned)
2261 *value2 = (short)op2->__anon1.i64;
2262 else if(op2->kind == 22)
2263 *value2 = (short)op2->__anon1.ui64;
2264 else if(op2->kind == 2 && op2->type->isSigned)
2265 *value2 = op2->__anon1.s;
2266 else if(op2->kind == 2)
2267 *value2 = (short)op2->__anon1.us;
2268 else if(op2->kind == 1 && op2->type->isSigned)
2269 *value2 = (short)op2->__anon1.c;
2270 else if(op2->kind == 24 || op2->kind == 1)
2271 *value2 = (short)op2->__anon1.uc;
2272 else if(op2->kind == 6)
2273 *value2 = (short)op2->__anon1.f;
2274 else if(op2->kind == 7)
2275 *value2 = (short)op2->__anon1.d;
2276 else if(op2->kind == 13)
2277 *value2 = (short)op2->__anon1.ui64;
2278 else
2279 return 0;
2280 return 1;
2281 }
2282
2283 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2284 {
2285 if(op2->kind == 3 && op2->type->isSigned)
2286 *value2 = (unsigned short)op2->__anon1.i;
2287 else if(op2->kind == 3)
2288 *value2 = (unsigned short)op2->__anon1.ui;
2289 else if(op2->kind == 4 && op2->type->isSigned)
2290 *value2 = (unsigned short)op2->__anon1.i64;
2291 else if(op2->kind == 4)
2292 *value2 = (unsigned short)op2->__anon1.ui64;
2293 else if(op2->kind == 23 && op2->type->isSigned)
2294 *value2 = (unsigned short)op2->__anon1.i64;
2295 else if(op2->kind == 23)
2296 *value2 = (unsigned short)op2->__anon1.ui64;
2297 else if(op2->kind == 22 && op2->type->isSigned)
2298 *value2 = (unsigned short)op2->__anon1.i64;
2299 else if(op2->kind == 22)
2300 *value2 = (unsigned short)op2->__anon1.ui64;
2301 else if(op2->kind == 2 && op2->type->isSigned)
2302 *value2 = (unsigned short)op2->__anon1.s;
2303 else if(op2->kind == 2)
2304 *value2 = op2->__anon1.us;
2305 else if(op2->kind == 1 && op2->type->isSigned)
2306 *value2 = (unsigned short)op2->__anon1.c;
2307 else if(op2->kind == 24 || op2->kind == 1)
2308 *value2 = (unsigned short)op2->__anon1.uc;
2309 else if(op2->kind == 6)
2310 *value2 = (unsigned short)op2->__anon1.f;
2311 else if(op2->kind == 7)
2312 *value2 = (unsigned short)op2->__anon1.d;
2313 else if(op2->kind == 13)
2314 *value2 = (unsigned short)op2->__anon1.ui64;
2315 else
2316 return 0;
2317 return 1;
2318 }
2319
2320 unsigned int GetOpChar(struct Operand * op2, char * value2)
2321 {
2322 if(op2->kind == 3 && op2->type->isSigned)
2323 *value2 = (char)op2->__anon1.i;
2324 else if(op2->kind == 3)
2325 *value2 = (char)op2->__anon1.ui;
2326 else if(op2->kind == 4 && op2->type->isSigned)
2327 *value2 = (char)op2->__anon1.i64;
2328 else if(op2->kind == 4)
2329 *value2 = (char)op2->__anon1.ui64;
2330 else if(op2->kind == 23 && op2->type->isSigned)
2331 *value2 = (char)op2->__anon1.i64;
2332 else if(op2->kind == 23)
2333 *value2 = (char)op2->__anon1.ui64;
2334 else if(op2->kind == 22 && op2->type->isSigned)
2335 *value2 = (char)op2->__anon1.i64;
2336 else if(op2->kind == 22)
2337 *value2 = (char)op2->__anon1.ui64;
2338 else if(op2->kind == 2 && op2->type->isSigned)
2339 *value2 = (char)op2->__anon1.s;
2340 else if(op2->kind == 2)
2341 *value2 = (char)op2->__anon1.us;
2342 else if(op2->kind == 1 && op2->type->isSigned)
2343 *value2 = op2->__anon1.c;
2344 else if(op2->kind == 24 || op2->kind == 1)
2345 *value2 = (char)op2->__anon1.uc;
2346 else if(op2->kind == 6)
2347 *value2 = (char)op2->__anon1.f;
2348 else if(op2->kind == 7)
2349 *value2 = (char)op2->__anon1.d;
2350 else if(op2->kind == 13)
2351 *value2 = (char)op2->__anon1.ui64;
2352 else
2353 return 0;
2354 return 1;
2355 }
2356
2357 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2358 {
2359 if(op2->kind == 3 && op2->type->isSigned)
2360 *value2 = (unsigned char)op2->__anon1.i;
2361 else if(op2->kind == 3)
2362 *value2 = (unsigned char)op2->__anon1.ui;
2363 else if(op2->kind == 4 && op2->type->isSigned)
2364 *value2 = (unsigned char)op2->__anon1.i64;
2365 else if(op2->kind == 4)
2366 *value2 = (unsigned char)op2->__anon1.ui64;
2367 else if(op2->kind == 23 && op2->type->isSigned)
2368 *value2 = (unsigned char)op2->__anon1.i64;
2369 else if(op2->kind == 23)
2370 *value2 = (unsigned char)op2->__anon1.ui64;
2371 else if(op2->kind == 22 && op2->type->isSigned)
2372 *value2 = (unsigned char)op2->__anon1.i64;
2373 else if(op2->kind == 22)
2374 *value2 = (unsigned char)op2->__anon1.ui64;
2375 else if(op2->kind == 2 && op2->type->isSigned)
2376 *value2 = (unsigned char)op2->__anon1.s;
2377 else if(op2->kind == 2)
2378 *value2 = (unsigned char)op2->__anon1.us;
2379 else if(op2->kind == 1 && op2->type->isSigned)
2380 *value2 = (unsigned char)op2->__anon1.c;
2381 else if(op2->kind == 24 || op2->kind == 1)
2382 *value2 = op2->__anon1.uc;
2383 else if(op2->kind == 6)
2384 *value2 = (unsigned char)op2->__anon1.f;
2385 else if(op2->kind == 7)
2386 *value2 = (unsigned char)op2->__anon1.d;
2387 else if(op2->kind == 13)
2388 *value2 = (unsigned char)op2->__anon1.ui64;
2389 else
2390 return 0;
2391 return 1;
2392 }
2393
2394 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2395 {
2396 if(op2->kind == 3 && op2->type->isSigned)
2397 *value2 = (float)(float)op2->__anon1.i;
2398 else if(op2->kind == 3)
2399 *value2 = (float)(float)op2->__anon1.ui;
2400 else if(op2->kind == 4 && op2->type->isSigned)
2401 *value2 = (float)(float)op2->__anon1.i64;
2402 else if(op2->kind == 4)
2403 *value2 = (float)(float)op2->__anon1.ui64;
2404 else if(op2->kind == 23 && op2->type->isSigned)
2405 *value2 = (float)(float)op2->__anon1.i64;
2406 else if(op2->kind == 23)
2407 *value2 = (float)(float)op2->__anon1.ui64;
2408 else if(op2->kind == 22 && op2->type->isSigned)
2409 *value2 = (float)(float)op2->__anon1.i64;
2410 else if(op2->kind == 22)
2411 *value2 = (float)(float)op2->__anon1.ui64;
2412 else if(op2->kind == 2 && op2->type->isSigned)
2413 *value2 = (float)(float)op2->__anon1.s;
2414 else if(op2->kind == 2)
2415 *value2 = (float)(float)op2->__anon1.us;
2416 else if(op2->kind == 1 && op2->type->isSigned)
2417 *value2 = (float)(float)op2->__anon1.c;
2418 else if(op2->kind == 24 || op2->kind == 1)
2419 *value2 = (float)(float)op2->__anon1.uc;
2420 else if(op2->kind == 6)
2421 *value2 = (float)op2->__anon1.f;
2422 else if(op2->kind == 7)
2423 *value2 = (float)op2->__anon1.d;
2424 else if(op2->kind == 13)
2425 *value2 = (float)(float)op2->__anon1.ui64;
2426 else
2427 return 0;
2428 return 1;
2429 }
2430
2431 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2432 {
2433 if(op2->kind == 3 && op2->type->isSigned)
2434 *value2 = (double)(double)op2->__anon1.i;
2435 else if(op2->kind == 3)
2436 *value2 = (double)(double)op2->__anon1.ui;
2437 else if(op2->kind == 4 && op2->type->isSigned)
2438 *value2 = (double)(double)op2->__anon1.i64;
2439 else if(op2->kind == 4)
2440 *value2 = (double)(double)op2->__anon1.ui64;
2441 else if(op2->kind == 23 && op2->type->isSigned)
2442 *value2 = (double)(double)op2->__anon1.i64;
2443 else if(op2->kind == 23)
2444 *value2 = (double)(double)op2->__anon1.ui64;
2445 else if(op2->kind == 22 && op2->type->isSigned)
2446 *value2 = (double)(double)op2->__anon1.i64;
2447 else if(op2->kind == 22)
2448 *value2 = (double)(double)op2->__anon1.ui64;
2449 else if(op2->kind == 2 && op2->type->isSigned)
2450 *value2 = (double)(double)op2->__anon1.s;
2451 else if(op2->kind == 2)
2452 *value2 = (double)(double)op2->__anon1.us;
2453 else if(op2->kind == 1 && op2->type->isSigned)
2454 *value2 = (double)(double)op2->__anon1.c;
2455 else if(op2->kind == 24 || op2->kind == 1)
2456 *value2 = (double)(double)op2->__anon1.uc;
2457 else if(op2->kind == 6)
2458 *value2 = (double)op2->__anon1.f;
2459 else if(op2->kind == 7)
2460 *value2 = (double)op2->__anon1.d;
2461 else if(op2->kind == 13)
2462 *value2 = (double)(double)op2->__anon1.ui64;
2463 else
2464 return 0;
2465 return 1;
2466 }
2467
2468 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2469 {
2470 int value2 = op2->__anon1.i;
2471
2472 exp->type = 2;
2473 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
2474 if(!exp->expType)
2475 {
2476 exp->expType = op1->type;
2477 if(op1->type)
2478 op1->type->refCount++;
2479 }
2480 return 1;
2481 }
2482
2483 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2484 {
2485 unsigned int value2 = op2->__anon1.ui;
2486
2487 exp->type = 2;
2488 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
2489 if(!exp->expType)
2490 {
2491 exp->expType = op1->type;
2492 if(op1->type)
2493 op1->type->refCount++;
2494 }
2495 return 1;
2496 }
2497
2498 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2499 {
2500 long long value2 = op2->__anon1.i64;
2501
2502 exp->type = 2;
2503 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
2504 if(!exp->expType)
2505 {
2506 exp->expType = op1->type;
2507 if(op1->type)
2508 op1->type->refCount++;
2509 }
2510 return 1;
2511 }
2512
2513 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2514 {
2515 uint64 value2 = op2->__anon1.ui64;
2516
2517 exp->type = 2;
2518 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
2519 if(!exp->expType)
2520 {
2521 exp->expType = op1->type;
2522 if(op1->type)
2523 op1->type->refCount++;
2524 }
2525 return 1;
2526 }
2527
2528 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2529 {
2530 short value2 = op2->__anon1.s;
2531
2532 exp->type = 2;
2533 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s + value2));
2534 if(!exp->expType)
2535 {
2536 exp->expType = op1->type;
2537 if(op1->type)
2538 op1->type->refCount++;
2539 }
2540 return 1;
2541 }
2542
2543 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2544 {
2545 unsigned short value2 = op2->__anon1.us;
2546
2547 exp->type = 2;
2548 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us + value2));
2549 if(!exp->expType)
2550 {
2551 exp->expType = op1->type;
2552 if(op1->type)
2553 op1->type->refCount++;
2554 }
2555 return 1;
2556 }
2557
2558 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2559 {
2560 char value2 = op2->__anon1.c;
2561
2562 exp->type = 2;
2563 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c + value2));
2564 if(!exp->expType)
2565 {
2566 exp->expType = op1->type;
2567 if(op1->type)
2568 op1->type->refCount++;
2569 }
2570 return 1;
2571 }
2572
2573 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2574 {
2575 unsigned char value2 = op2->__anon1.uc;
2576
2577 exp->type = 2;
2578 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc + value2));
2579 if(!exp->expType)
2580 {
2581 exp->expType = op1->type;
2582 if(op1->type)
2583 op1->type->refCount++;
2584 }
2585 return 1;
2586 }
2587
2588 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2589 {
2590 float value2 = op2->__anon1.f;
2591
2592 exp->type = 2;
2593 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
2594 if(!exp->expType)
2595 {
2596 exp->expType = op1->type;
2597 if(op1->type)
2598 op1->type->refCount++;
2599 }
2600 return 1;
2601 }
2602
2603 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2604 {
2605 double value2 = op2->__anon1.d;
2606
2607 exp->type = 2;
2608 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
2609 if(!exp->expType)
2610 {
2611 exp->expType = op1->type;
2612 if(op1->type)
2613 op1->type->refCount++;
2614 }
2615 return 1;
2616 }
2617
2618 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2619 {
2620 int value2 = op2->__anon1.i;
2621
2622 exp->type = 2;
2623 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
2624 if(!exp->expType)
2625 {
2626 exp->expType = op1->type;
2627 if(op1->type)
2628 op1->type->refCount++;
2629 }
2630 return 1;
2631 }
2632
2633 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2634 {
2635 unsigned int value2 = op2->__anon1.ui;
2636
2637 exp->type = 2;
2638 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
2639 if(!exp->expType)
2640 {
2641 exp->expType = op1->type;
2642 if(op1->type)
2643 op1->type->refCount++;
2644 }
2645 return 1;
2646 }
2647
2648 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2649 {
2650 long long value2 = op2->__anon1.i64;
2651
2652 exp->type = 2;
2653 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
2654 if(!exp->expType)
2655 {
2656 exp->expType = op1->type;
2657 if(op1->type)
2658 op1->type->refCount++;
2659 }
2660 return 1;
2661 }
2662
2663 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2664 {
2665 uint64 value2 = op2->__anon1.ui64;
2666
2667 exp->type = 2;
2668 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
2669 if(!exp->expType)
2670 {
2671 exp->expType = op1->type;
2672 if(op1->type)
2673 op1->type->refCount++;
2674 }
2675 return 1;
2676 }
2677
2678 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2679 {
2680 short value2 = op2->__anon1.s;
2681
2682 exp->type = 2;
2683 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s - value2));
2684 if(!exp->expType)
2685 {
2686 exp->expType = op1->type;
2687 if(op1->type)
2688 op1->type->refCount++;
2689 }
2690 return 1;
2691 }
2692
2693 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2694 {
2695 unsigned short value2 = op2->__anon1.us;
2696
2697 exp->type = 2;
2698 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us - value2));
2699 if(!exp->expType)
2700 {
2701 exp->expType = op1->type;
2702 if(op1->type)
2703 op1->type->refCount++;
2704 }
2705 return 1;
2706 }
2707
2708 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2709 {
2710 char value2 = op2->__anon1.c;
2711
2712 exp->type = 2;
2713 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c - value2));
2714 if(!exp->expType)
2715 {
2716 exp->expType = op1->type;
2717 if(op1->type)
2718 op1->type->refCount++;
2719 }
2720 return 1;
2721 }
2722
2723 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2724 {
2725 unsigned char value2 = op2->__anon1.uc;
2726
2727 exp->type = 2;
2728 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc - value2));
2729 if(!exp->expType)
2730 {
2731 exp->expType = op1->type;
2732 if(op1->type)
2733 op1->type->refCount++;
2734 }
2735 return 1;
2736 }
2737
2738 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2739 {
2740 float value2 = op2->__anon1.f;
2741
2742 exp->type = 2;
2743 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
2744 if(!exp->expType)
2745 {
2746 exp->expType = op1->type;
2747 if(op1->type)
2748 op1->type->refCount++;
2749 }
2750 return 1;
2751 }
2752
2753 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2754 {
2755 double value2 = op2->__anon1.d;
2756
2757 exp->type = 2;
2758 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
2759 if(!exp->expType)
2760 {
2761 exp->expType = op1->type;
2762 if(op1->type)
2763 op1->type->refCount++;
2764 }
2765 return 1;
2766 }
2767
2768 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2769 {
2770 int value2 = op2->__anon1.i;
2771
2772 exp->type = 2;
2773 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
2774 if(!exp->expType)
2775 {
2776 exp->expType = op1->type;
2777 if(op1->type)
2778 op1->type->refCount++;
2779 }
2780 return 1;
2781 }
2782
2783 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2784 {
2785 unsigned int value2 = op2->__anon1.ui;
2786
2787 exp->type = 2;
2788 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
2789 if(!exp->expType)
2790 {
2791 exp->expType = op1->type;
2792 if(op1->type)
2793 op1->type->refCount++;
2794 }
2795 return 1;
2796 }
2797
2798 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2799 {
2800 long long value2 = op2->__anon1.i64;
2801
2802 exp->type = 2;
2803 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
2804 if(!exp->expType)
2805 {
2806 exp->expType = op1->type;
2807 if(op1->type)
2808 op1->type->refCount++;
2809 }
2810 return 1;
2811 }
2812
2813 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2814 {
2815 uint64 value2 = op2->__anon1.ui64;
2816
2817 exp->type = 2;
2818 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
2819 if(!exp->expType)
2820 {
2821 exp->expType = op1->type;
2822 if(op1->type)
2823 op1->type->refCount++;
2824 }
2825 return 1;
2826 }
2827
2828 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2829 {
2830 short value2 = op2->__anon1.s;
2831
2832 exp->type = 2;
2833 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s * value2));
2834 if(!exp->expType)
2835 {
2836 exp->expType = op1->type;
2837 if(op1->type)
2838 op1->type->refCount++;
2839 }
2840 return 1;
2841 }
2842
2843 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2844 {
2845 unsigned short value2 = op2->__anon1.us;
2846
2847 exp->type = 2;
2848 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us * value2));
2849 if(!exp->expType)
2850 {
2851 exp->expType = op1->type;
2852 if(op1->type)
2853 op1->type->refCount++;
2854 }
2855 return 1;
2856 }
2857
2858 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2859 {
2860 char value2 = op2->__anon1.c;
2861
2862 exp->type = 2;
2863 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c * value2));
2864 if(!exp->expType)
2865 {
2866 exp->expType = op1->type;
2867 if(op1->type)
2868 op1->type->refCount++;
2869 }
2870 return 1;
2871 }
2872
2873 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2874 {
2875 unsigned char value2 = op2->__anon1.uc;
2876
2877 exp->type = 2;
2878 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc * value2));
2879 if(!exp->expType)
2880 {
2881 exp->expType = op1->type;
2882 if(op1->type)
2883 op1->type->refCount++;
2884 }
2885 return 1;
2886 }
2887
2888 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2889 {
2890 float value2 = op2->__anon1.f;
2891
2892 exp->type = 2;
2893 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
2894 if(!exp->expType)
2895 {
2896 exp->expType = op1->type;
2897 if(op1->type)
2898 op1->type->refCount++;
2899 }
2900 return 1;
2901 }
2902
2903 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2904 {
2905 double value2 = op2->__anon1.d;
2906
2907 exp->type = 2;
2908 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
2909 if(!exp->expType)
2910 {
2911 exp->expType = op1->type;
2912 if(op1->type)
2913 op1->type->refCount++;
2914 }
2915 return 1;
2916 }
2917
2918 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2919 {
2920 int value2 = op2->__anon1.i;
2921
2922 exp->type = 2;
2923 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i / value2)) : 0);
2924 if(!exp->expType)
2925 {
2926 exp->expType = op1->type;
2927 if(op1->type)
2928 op1->type->refCount++;
2929 }
2930 return 1;
2931 }
2932
2933 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2934 {
2935 unsigned int value2 = op2->__anon1.ui;
2936
2937 exp->type = 2;
2938 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui / value2)) : 0);
2939 if(!exp->expType)
2940 {
2941 exp->expType = op1->type;
2942 if(op1->type)
2943 op1->type->refCount++;
2944 }
2945 return 1;
2946 }
2947
2948 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2949 {
2950 long long value2 = op2->__anon1.i64;
2951
2952 exp->type = 2;
2953 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 / value2)) : 0);
2954 if(!exp->expType)
2955 {
2956 exp->expType = op1->type;
2957 if(op1->type)
2958 op1->type->refCount++;
2959 }
2960 return 1;
2961 }
2962
2963 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2964 {
2965 uint64 value2 = op2->__anon1.ui64;
2966
2967 exp->type = 2;
2968 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 / value2)) : 0);
2969 if(!exp->expType)
2970 {
2971 exp->expType = op1->type;
2972 if(op1->type)
2973 op1->type->refCount++;
2974 }
2975 return 1;
2976 }
2977
2978 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2979 {
2980 short value2 = op2->__anon1.s;
2981
2982 exp->type = 2;
2983 exp->__anon1.__anon2.string = PrintShort(value2 ? ((short)(op1->__anon1.s / value2)) : 0);
2984 if(!exp->expType)
2985 {
2986 exp->expType = op1->type;
2987 if(op1->type)
2988 op1->type->refCount++;
2989 }
2990 return 1;
2991 }
2992
2993 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2994 {
2995 unsigned short value2 = op2->__anon1.us;
2996
2997 exp->type = 2;
2998 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((unsigned short)(op1->__anon1.us / value2)) : 0);
2999 if(!exp->expType)
3000 {
3001 exp->expType = op1->type;
3002 if(op1->type)
3003 op1->type->refCount++;
3004 }
3005 return 1;
3006 }
3007
3008 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3009 {
3010 char value2 = op2->__anon1.c;
3011
3012 exp->type = 2;
3013 exp->__anon1.__anon2.string = PrintChar(value2 ? ((char)(op1->__anon1.c / value2)) : 0);
3014 if(!exp->expType)
3015 {
3016 exp->expType = op1->type;
3017 if(op1->type)
3018 op1->type->refCount++;
3019 }
3020 return 1;
3021 }
3022
3023 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3024 {
3025 unsigned char value2 = op2->__anon1.uc;
3026
3027 exp->type = 2;
3028 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((unsigned char)(op1->__anon1.uc / value2)) : 0);
3029 if(!exp->expType)
3030 {
3031 exp->expType = op1->type;
3032 if(op1->type)
3033 op1->type->refCount++;
3034 }
3035 return 1;
3036 }
3037
3038 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3039 {
3040 float value2 = op2->__anon1.f;
3041
3042 exp->type = 2;
3043 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f / value2));
3044 if(!exp->expType)
3045 {
3046 exp->expType = op1->type;
3047 if(op1->type)
3048 op1->type->refCount++;
3049 }
3050 return 1;
3051 }
3052
3053 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3054 {
3055 double value2 = op2->__anon1.d;
3056
3057 exp->type = 2;
3058 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d / value2));
3059 if(!exp->expType)
3060 {
3061 exp->expType = op1->type;
3062 if(op1->type)
3063 op1->type->refCount++;
3064 }
3065 return 1;
3066 }
3067
3068 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3069 {
3070 int value2 = op2->__anon1.i;
3071
3072 exp->type = 2;
3073 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i % value2)) : 0);
3074 if(!exp->expType)
3075 {
3076 exp->expType = op1->type;
3077 if(op1->type)
3078 op1->type->refCount++;
3079 }
3080 return 1;
3081 }
3082
3083 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3084 {
3085 unsigned int value2 = op2->__anon1.ui;
3086
3087 exp->type = 2;
3088 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui % value2)) : 0);
3089 if(!exp->expType)
3090 {
3091 exp->expType = op1->type;
3092 if(op1->type)
3093 op1->type->refCount++;
3094 }
3095 return 1;
3096 }
3097
3098 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3099 {
3100 long long value2 = op2->__anon1.i64;
3101
3102 exp->type = 2;
3103 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 % value2)) : 0);
3104 if(!exp->expType)
3105 {
3106 exp->expType = op1->type;
3107 if(op1->type)
3108 op1->type->refCount++;
3109 }
3110 return 1;
3111 }
3112
3113 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3114 {
3115 uint64 value2 = op2->__anon1.ui64;
3116
3117 exp->type = 2;
3118 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 % value2)) : 0);
3119 if(!exp->expType)
3120 {
3121 exp->expType = op1->type;
3122 if(op1->type)
3123 op1->type->refCount++;
3124 }
3125 return 1;
3126 }
3127
3128 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3129 {
3130 short value2 = op2->__anon1.s;
3131
3132 exp->type = 2;
3133 exp->__anon1.__anon2.string = PrintShort(value2 ? ((short)(op1->__anon1.s % value2)) : 0);
3134 if(!exp->expType)
3135 {
3136 exp->expType = op1->type;
3137 if(op1->type)
3138 op1->type->refCount++;
3139 }
3140 return 1;
3141 }
3142
3143 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3144 {
3145 unsigned short value2 = op2->__anon1.us;
3146
3147 exp->type = 2;
3148 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((unsigned short)(op1->__anon1.us % value2)) : 0);
3149 if(!exp->expType)
3150 {
3151 exp->expType = op1->type;
3152 if(op1->type)
3153 op1->type->refCount++;
3154 }
3155 return 1;
3156 }
3157
3158 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3159 {
3160 char value2 = op2->__anon1.c;
3161
3162 exp->type = 2;
3163 exp->__anon1.__anon2.string = PrintChar(value2 ? ((char)(op1->__anon1.c % value2)) : 0);
3164 if(!exp->expType)
3165 {
3166 exp->expType = op1->type;
3167 if(op1->type)
3168 op1->type->refCount++;
3169 }
3170 return 1;
3171 }
3172
3173 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3174 {
3175 unsigned char value2 = op2->__anon1.uc;
3176
3177 exp->type = 2;
3178 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((unsigned char)(op1->__anon1.uc % value2)) : 0);
3179 if(!exp->expType)
3180 {
3181 exp->expType = op1->type;
3182 if(op1->type)
3183 op1->type->refCount++;
3184 }
3185 return 1;
3186 }
3187
3188 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
3189 {
3190 exp->type = 2;
3191 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
3192 if(!exp->expType)
3193 {
3194 exp->expType = op1->type;
3195 if(op1->type)
3196 op1->type->refCount++;
3197 }
3198 return 1;
3199 }
3200
3201 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
3202 {
3203 exp->type = 2;
3204 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
3205 if(!exp->expType)
3206 {
3207 exp->expType = op1->type;
3208 if(op1->type)
3209 op1->type->refCount++;
3210 }
3211 return 1;
3212 }
3213
3214 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
3215 {
3216 exp->type = 2;
3217 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
3218 if(!exp->expType)
3219 {
3220 exp->expType = op1->type;
3221 if(op1->type)
3222 op1->type->refCount++;
3223 }
3224 return 1;
3225 }
3226
3227 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
3228 {
3229 exp->type = 2;
3230 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
3231 if(!exp->expType)
3232 {
3233 exp->expType = op1->type;
3234 if(op1->type)
3235 op1->type->refCount++;
3236 }
3237 return 1;
3238 }
3239
3240 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
3241 {
3242 exp->type = 2;
3243 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
3244 if(!exp->expType)
3245 {
3246 exp->expType = op1->type;
3247 if(op1->type)
3248 op1->type->refCount++;
3249 }
3250 return 1;
3251 }
3252
3253 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
3254 {
3255 exp->type = 2;
3256 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
3257 if(!exp->expType)
3258 {
3259 exp->expType = op1->type;
3260 if(op1->type)
3261 op1->type->refCount++;
3262 }
3263 return 1;
3264 }
3265
3266 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
3267 {
3268 exp->type = 2;
3269 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
3270 if(!exp->expType)
3271 {
3272 exp->expType = op1->type;
3273 if(op1->type)
3274 op1->type->refCount++;
3275 }
3276 return 1;
3277 }
3278
3279 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
3280 {
3281 exp->type = 2;
3282 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
3283 if(!exp->expType)
3284 {
3285 exp->expType = op1->type;
3286 if(op1->type)
3287 op1->type->refCount++;
3288 }
3289 return 1;
3290 }
3291
3292 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
3293 {
3294 exp->type = 2;
3295 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
3296 if(!exp->expType)
3297 {
3298 exp->expType = op1->type;
3299 if(op1->type)
3300 op1->type->refCount++;
3301 }
3302 return 1;
3303 }
3304
3305 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
3306 {
3307 exp->type = 2;
3308 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
3309 if(!exp->expType)
3310 {
3311 exp->expType = op1->type;
3312 if(op1->type)
3313 op1->type->refCount++;
3314 }
3315 return 1;
3316 }
3317
3318 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
3319 {
3320 exp->type = 2;
3321 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
3322 if(!exp->expType)
3323 {
3324 exp->expType = op1->type;
3325 if(op1->type)
3326 op1->type->refCount++;
3327 }
3328 return 1;
3329 }
3330
3331 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
3332 {
3333 exp->type = 2;
3334 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
3335 if(!exp->expType)
3336 {
3337 exp->expType = op1->type;
3338 if(op1->type)
3339 op1->type->refCount++;
3340 }
3341 return 1;
3342 }
3343
3344 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
3345 {
3346 exp->type = 2;
3347 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
3348 if(!exp->expType)
3349 {
3350 exp->expType = op1->type;
3351 if(op1->type)
3352 op1->type->refCount++;
3353 }
3354 return 1;
3355 }
3356
3357 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
3358 {
3359 exp->type = 2;
3360 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
3361 if(!exp->expType)
3362 {
3363 exp->expType = op1->type;
3364 if(op1->type)
3365 op1->type->refCount++;
3366 }
3367 return 1;
3368 }
3369
3370 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
3371 {
3372 exp->type = 2;
3373 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
3374 if(!exp->expType)
3375 {
3376 exp->expType = op1->type;
3377 if(op1->type)
3378 op1->type->refCount++;
3379 }
3380 return 1;
3381 }
3382
3383 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
3384 {
3385 exp->type = 2;
3386 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
3387 if(!exp->expType)
3388 {
3389 exp->expType = op1->type;
3390 if(op1->type)
3391 op1->type->refCount++;
3392 }
3393 return 1;
3394 }
3395
3396 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
3397 {
3398 exp->type = 2;
3399 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
3400 if(!exp->expType)
3401 {
3402 exp->expType = op1->type;
3403 if(op1->type)
3404 op1->type->refCount++;
3405 }
3406 return 1;
3407 }
3408
3409 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
3410 {
3411 exp->type = 2;
3412 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
3413 if(!exp->expType)
3414 {
3415 exp->expType = op1->type;
3416 if(op1->type)
3417 op1->type->refCount++;
3418 }
3419 return 1;
3420 }
3421
3422 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
3423 {
3424 exp->type = 2;
3425 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
3426 if(!exp->expType)
3427 {
3428 exp->expType = op1->type;
3429 if(op1->type)
3430 op1->type->refCount++;
3431 }
3432 return 1;
3433 }
3434
3435 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
3436 {
3437 exp->type = 2;
3438 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
3439 if(!exp->expType)
3440 {
3441 exp->expType = op1->type;
3442 if(op1->type)
3443 op1->type->refCount++;
3444 }
3445 return 1;
3446 }
3447
3448 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
3449 {
3450 exp->type = 2;
3451 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
3452 if(!exp->expType)
3453 {
3454 exp->expType = op1->type;
3455 if(op1->type)
3456 op1->type->refCount++;
3457 }
3458 return 1;
3459 }
3460
3461 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
3462 {
3463 exp->type = 2;
3464 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
3465 if(!exp->expType)
3466 {
3467 exp->expType = op1->type;
3468 if(op1->type)
3469 op1->type->refCount++;
3470 }
3471 return 1;
3472 }
3473
3474 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
3475 {
3476 exp->type = 2;
3477 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
3478 if(!exp->expType)
3479 {
3480 exp->expType = op1->type;
3481 if(op1->type)
3482 op1->type->refCount++;
3483 }
3484 return 1;
3485 }
3486
3487 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
3488 {
3489 exp->type = 2;
3490 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
3491 if(!exp->expType)
3492 {
3493 exp->expType = op1->type;
3494 if(op1->type)
3495 op1->type->refCount++;
3496 }
3497 return 1;
3498 }
3499
3500 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
3501 {
3502 exp->type = 2;
3503 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
3504 if(!exp->expType)
3505 {
3506 exp->expType = op1->type;
3507 if(op1->type)
3508 op1->type->refCount++;
3509 }
3510 return 1;
3511 }
3512
3513 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
3514 {
3515 exp->type = 2;
3516 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
3517 if(!exp->expType)
3518 {
3519 exp->expType = op1->type;
3520 if(op1->type)
3521 op1->type->refCount++;
3522 }
3523 return 1;
3524 }
3525
3526 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
3527 {
3528 exp->type = 2;
3529 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
3530 if(!exp->expType)
3531 {
3532 exp->expType = op1->type;
3533 if(op1->type)
3534 op1->type->refCount++;
3535 }
3536 return 1;
3537 }
3538
3539 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
3540 {
3541 exp->type = 2;
3542 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
3543 if(!exp->expType)
3544 {
3545 exp->expType = op1->type;
3546 if(op1->type)
3547 op1->type->refCount++;
3548 }
3549 return 1;
3550 }
3551
3552 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
3553 {
3554 exp->type = 2;
3555 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
3556 if(!exp->expType)
3557 {
3558 exp->expType = op1->type;
3559 if(op1->type)
3560 op1->type->refCount++;
3561 }
3562 return 1;
3563 }
3564
3565 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
3566 {
3567 exp->type = 2;
3568 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
3569 if(!exp->expType)
3570 {
3571 exp->expType = op1->type;
3572 if(op1->type)
3573 op1->type->refCount++;
3574 }
3575 return 1;
3576 }
3577
3578 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3579 {
3580 int value2 = op2->__anon1.i;
3581
3582 exp->type = 2;
3583 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
3584 if(!exp->expType)
3585 {
3586 exp->expType = op1->type;
3587 if(op1->type)
3588 op1->type->refCount++;
3589 }
3590 return 1;
3591 }
3592
3593 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3594 {
3595 unsigned int value2 = op2->__anon1.ui;
3596
3597 exp->type = 2;
3598 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
3599 if(!exp->expType)
3600 {
3601 exp->expType = op1->type;
3602 if(op1->type)
3603 op1->type->refCount++;
3604 }
3605 return 1;
3606 }
3607
3608 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3609 {
3610 long long value2 = op2->__anon1.i64;
3611
3612 exp->type = 2;
3613 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
3614 if(!exp->expType)
3615 {
3616 exp->expType = op1->type;
3617 if(op1->type)
3618 op1->type->refCount++;
3619 }
3620 return 1;
3621 }
3622
3623 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3624 {
3625 uint64 value2 = op2->__anon1.ui64;
3626
3627 exp->type = 2;
3628 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
3629 if(!exp->expType)
3630 {
3631 exp->expType = op1->type;
3632 if(op1->type)
3633 op1->type->refCount++;
3634 }
3635 return 1;
3636 }
3637
3638 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3639 {
3640 short value2 = op2->__anon1.s;
3641
3642 exp->type = 2;
3643 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
3644 if(!exp->expType)
3645 {
3646 exp->expType = op1->type;
3647 if(op1->type)
3648 op1->type->refCount++;
3649 }
3650 return 1;
3651 }
3652
3653 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3654 {
3655 unsigned short value2 = op2->__anon1.us;
3656
3657 exp->type = 2;
3658 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
3659 if(!exp->expType)
3660 {
3661 exp->expType = op1->type;
3662 if(op1->type)
3663 op1->type->refCount++;
3664 }
3665 return 1;
3666 }
3667
3668 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3669 {
3670 char value2 = op2->__anon1.c;
3671
3672 exp->type = 2;
3673 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
3674 if(!exp->expType)
3675 {
3676 exp->expType = op1->type;
3677 if(op1->type)
3678 op1->type->refCount++;
3679 }
3680 return 1;
3681 }
3682
3683 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3684 {
3685 unsigned char value2 = op2->__anon1.uc;
3686
3687 exp->type = 2;
3688 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
3689 if(!exp->expType)
3690 {
3691 exp->expType = op1->type;
3692 if(op1->type)
3693 op1->type->refCount++;
3694 }
3695 return 1;
3696 }
3697
3698 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3699 {
3700 float value2 = op2->__anon1.f;
3701
3702 exp->type = 2;
3703 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
3704 if(!exp->expType)
3705 {
3706 exp->expType = op1->type;
3707 if(op1->type)
3708 op1->type->refCount++;
3709 }
3710 return 1;
3711 }
3712
3713 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3714 {
3715 double value2 = op2->__anon1.d;
3716
3717 exp->type = 2;
3718 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
3719 if(!exp->expType)
3720 {
3721 exp->expType = op1->type;
3722 if(op1->type)
3723 op1->type->refCount++;
3724 }
3725 return 1;
3726 }
3727
3728 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3729 {
3730 int value2 = op2->__anon1.i;
3731
3732 exp->type = 2;
3733 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
3734 if(!exp->expType)
3735 {
3736 exp->expType = op1->type;
3737 if(op1->type)
3738 op1->type->refCount++;
3739 }
3740 return 1;
3741 }
3742
3743 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3744 {
3745 unsigned int value2 = op2->__anon1.ui;
3746
3747 exp->type = 2;
3748 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
3749 if(!exp->expType)
3750 {
3751 exp->expType = op1->type;
3752 if(op1->type)
3753 op1->type->refCount++;
3754 }
3755 return 1;
3756 }
3757
3758 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3759 {
3760 long long value2 = op2->__anon1.i64;
3761
3762 exp->type = 2;
3763 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
3764 if(!exp->expType)
3765 {
3766 exp->expType = op1->type;
3767 if(op1->type)
3768 op1->type->refCount++;
3769 }
3770 return 1;
3771 }
3772
3773 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3774 {
3775 uint64 value2 = op2->__anon1.ui64;
3776
3777 exp->type = 2;
3778 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
3779 if(!exp->expType)
3780 {
3781 exp->expType = op1->type;
3782 if(op1->type)
3783 op1->type->refCount++;
3784 }
3785 return 1;
3786 }
3787
3788 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3789 {
3790 short value2 = op2->__anon1.s;
3791
3792 exp->type = 2;
3793 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
3794 if(!exp->expType)
3795 {
3796 exp->expType = op1->type;
3797 if(op1->type)
3798 op1->type->refCount++;
3799 }
3800 return 1;
3801 }
3802
3803 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3804 {
3805 unsigned short value2 = op2->__anon1.us;
3806
3807 exp->type = 2;
3808 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
3809 if(!exp->expType)
3810 {
3811 exp->expType = op1->type;
3812 if(op1->type)
3813 op1->type->refCount++;
3814 }
3815 return 1;
3816 }
3817
3818 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3819 {
3820 char value2 = op2->__anon1.c;
3821
3822 exp->type = 2;
3823 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
3824 if(!exp->expType)
3825 {
3826 exp->expType = op1->type;
3827 if(op1->type)
3828 op1->type->refCount++;
3829 }
3830 return 1;
3831 }
3832
3833 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3834 {
3835 unsigned char value2 = op2->__anon1.uc;
3836
3837 exp->type = 2;
3838 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
3839 if(!exp->expType)
3840 {
3841 exp->expType = op1->type;
3842 if(op1->type)
3843 op1->type->refCount++;
3844 }
3845 return 1;
3846 }
3847
3848 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3849 {
3850 float value2 = op2->__anon1.f;
3851
3852 exp->type = 2;
3853 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
3854 if(!exp->expType)
3855 {
3856 exp->expType = op1->type;
3857 if(op1->type)
3858 op1->type->refCount++;
3859 }
3860 return 1;
3861 }
3862
3863 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3864 {
3865 double value2 = op2->__anon1.d;
3866
3867 exp->type = 2;
3868 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
3869 if(!exp->expType)
3870 {
3871 exp->expType = op1->type;
3872 if(op1->type)
3873 op1->type->refCount++;
3874 }
3875 return 1;
3876 }
3877
3878 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3879 {
3880 int value2 = op2->__anon1.i;
3881
3882 exp->type = 2;
3883 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
3884 if(!exp->expType)
3885 {
3886 exp->expType = op1->type;
3887 if(op1->type)
3888 op1->type->refCount++;
3889 }
3890 return 1;
3891 }
3892
3893 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3894 {
3895 unsigned int value2 = op2->__anon1.ui;
3896
3897 exp->type = 2;
3898 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
3899 if(!exp->expType)
3900 {
3901 exp->expType = op1->type;
3902 if(op1->type)
3903 op1->type->refCount++;
3904 }
3905 return 1;
3906 }
3907
3908 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3909 {
3910 long long value2 = op2->__anon1.i64;
3911
3912 exp->type = 2;
3913 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
3914 if(!exp->expType)
3915 {
3916 exp->expType = op1->type;
3917 if(op1->type)
3918 op1->type->refCount++;
3919 }
3920 return 1;
3921 }
3922
3923 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3924 {
3925 uint64 value2 = op2->__anon1.ui64;
3926
3927 exp->type = 2;
3928 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
3929 if(!exp->expType)
3930 {
3931 exp->expType = op1->type;
3932 if(op1->type)
3933 op1->type->refCount++;
3934 }
3935 return 1;
3936 }
3937
3938 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3939 {
3940 short value2 = op2->__anon1.s;
3941
3942 exp->type = 2;
3943 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
3944 if(!exp->expType)
3945 {
3946 exp->expType = op1->type;
3947 if(op1->type)
3948 op1->type->refCount++;
3949 }
3950 return 1;
3951 }
3952
3953 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3954 {
3955 unsigned short value2 = op2->__anon1.us;
3956
3957 exp->type = 2;
3958 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
3959 if(!exp->expType)
3960 {
3961 exp->expType = op1->type;
3962 if(op1->type)
3963 op1->type->refCount++;
3964 }
3965 return 1;
3966 }
3967
3968 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3969 {
3970 char value2 = op2->__anon1.c;
3971
3972 exp->type = 2;
3973 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
3974 if(!exp->expType)
3975 {
3976 exp->expType = op1->type;
3977 if(op1->type)
3978 op1->type->refCount++;
3979 }
3980 return 1;
3981 }
3982
3983 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3984 {
3985 unsigned char value2 = op2->__anon1.uc;
3986
3987 exp->type = 2;
3988 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
3989 if(!exp->expType)
3990 {
3991 exp->expType = op1->type;
3992 if(op1->type)
3993 op1->type->refCount++;
3994 }
3995 return 1;
3996 }
3997
3998 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3999 {
4000 float value2 = op2->__anon1.f;
4001
4002 exp->type = 2;
4003 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
4004 if(!exp->expType)
4005 {
4006 exp->expType = op1->type;
4007 if(op1->type)
4008 op1->type->refCount++;
4009 }
4010 return 1;
4011 }
4012
4013 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4014 {
4015 double value2 = op2->__anon1.d;
4016
4017 exp->type = 2;
4018 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
4019 if(!exp->expType)
4020 {
4021 exp->expType = op1->type;
4022 if(op1->type)
4023 op1->type->refCount++;
4024 }
4025 return 1;
4026 }
4027
4028 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4029 {
4030 int value2 = op2->__anon1.i;
4031
4032 exp->type = 2;
4033 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
4034 if(!exp->expType)
4035 {
4036 exp->expType = op1->type;
4037 if(op1->type)
4038 op1->type->refCount++;
4039 }
4040 return 1;
4041 }
4042
4043 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4044 {
4045 unsigned int value2 = op2->__anon1.ui;
4046
4047 exp->type = 2;
4048 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
4049 if(!exp->expType)
4050 {
4051 exp->expType = op1->type;
4052 if(op1->type)
4053 op1->type->refCount++;
4054 }
4055 return 1;
4056 }
4057
4058 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4059 {
4060 long long value2 = op2->__anon1.i64;
4061
4062 exp->type = 2;
4063 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
4064 if(!exp->expType)
4065 {
4066 exp->expType = op1->type;
4067 if(op1->type)
4068 op1->type->refCount++;
4069 }
4070 return 1;
4071 }
4072
4073 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4074 {
4075 uint64 value2 = op2->__anon1.ui64;
4076
4077 exp->type = 2;
4078 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
4079 if(!exp->expType)
4080 {
4081 exp->expType = op1->type;
4082 if(op1->type)
4083 op1->type->refCount++;
4084 }
4085 return 1;
4086 }
4087
4088 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4089 {
4090 short value2 = op2->__anon1.s;
4091
4092 exp->type = 2;
4093 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
4094 if(!exp->expType)
4095 {
4096 exp->expType = op1->type;
4097 if(op1->type)
4098 op1->type->refCount++;
4099 }
4100 return 1;
4101 }
4102
4103 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4104 {
4105 unsigned short value2 = op2->__anon1.us;
4106
4107 exp->type = 2;
4108 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
4109 if(!exp->expType)
4110 {
4111 exp->expType = op1->type;
4112 if(op1->type)
4113 op1->type->refCount++;
4114 }
4115 return 1;
4116 }
4117
4118 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4119 {
4120 char value2 = op2->__anon1.c;
4121
4122 exp->type = 2;
4123 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
4124 if(!exp->expType)
4125 {
4126 exp->expType = op1->type;
4127 if(op1->type)
4128 op1->type->refCount++;
4129 }
4130 return 1;
4131 }
4132
4133 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4134 {
4135 unsigned char value2 = op2->__anon1.uc;
4136
4137 exp->type = 2;
4138 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
4139 if(!exp->expType)
4140 {
4141 exp->expType = op1->type;
4142 if(op1->type)
4143 op1->type->refCount++;
4144 }
4145 return 1;
4146 }
4147
4148 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4149 {
4150 float value2 = op2->__anon1.f;
4151
4152 exp->type = 2;
4153 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
4154 if(!exp->expType)
4155 {
4156 exp->expType = op1->type;
4157 if(op1->type)
4158 op1->type->refCount++;
4159 }
4160 return 1;
4161 }
4162
4163 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4164 {
4165 double value2 = op2->__anon1.d;
4166
4167 exp->type = 2;
4168 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
4169 if(!exp->expType)
4170 {
4171 exp->expType = op1->type;
4172 if(op1->type)
4173 op1->type->refCount++;
4174 }
4175 return 1;
4176 }
4177
4178 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4179 {
4180 int value2 = op2->__anon1.i;
4181
4182 exp->type = 2;
4183 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i /= value2)) : 0);
4184 if(!exp->expType)
4185 {
4186 exp->expType = op1->type;
4187 if(op1->type)
4188 op1->type->refCount++;
4189 }
4190 return 1;
4191 }
4192
4193 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4194 {
4195 unsigned int value2 = op2->__anon1.ui;
4196
4197 exp->type = 2;
4198 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui /= value2)) : 0);
4199 if(!exp->expType)
4200 {
4201 exp->expType = op1->type;
4202 if(op1->type)
4203 op1->type->refCount++;
4204 }
4205 return 1;
4206 }
4207
4208 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4209 {
4210 long long value2 = op2->__anon1.i64;
4211
4212 exp->type = 2;
4213 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 /= value2)) : 0);
4214 if(!exp->expType)
4215 {
4216 exp->expType = op1->type;
4217 if(op1->type)
4218 op1->type->refCount++;
4219 }
4220 return 1;
4221 }
4222
4223 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4224 {
4225 uint64 value2 = op2->__anon1.ui64;
4226
4227 exp->type = 2;
4228 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 /= value2)) : 0);
4229 if(!exp->expType)
4230 {
4231 exp->expType = op1->type;
4232 if(op1->type)
4233 op1->type->refCount++;
4234 }
4235 return 1;
4236 }
4237
4238 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4239 {
4240 short value2 = op2->__anon1.s;
4241
4242 exp->type = 2;
4243 exp->__anon1.__anon2.string = PrintShort(value2 ? ((op1->__anon1.s /= value2)) : 0);
4244 if(!exp->expType)
4245 {
4246 exp->expType = op1->type;
4247 if(op1->type)
4248 op1->type->refCount++;
4249 }
4250 return 1;
4251 }
4252
4253 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4254 {
4255 unsigned short value2 = op2->__anon1.us;
4256
4257 exp->type = 2;
4258 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((op1->__anon1.us /= value2)) : 0);
4259 if(!exp->expType)
4260 {
4261 exp->expType = op1->type;
4262 if(op1->type)
4263 op1->type->refCount++;
4264 }
4265 return 1;
4266 }
4267
4268 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4269 {
4270 char value2 = op2->__anon1.c;
4271
4272 exp->type = 2;
4273 exp->__anon1.__anon2.string = PrintChar(value2 ? ((op1->__anon1.c /= value2)) : 0);
4274 if(!exp->expType)
4275 {
4276 exp->expType = op1->type;
4277 if(op1->type)
4278 op1->type->refCount++;
4279 }
4280 return 1;
4281 }
4282
4283 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4284 {
4285 unsigned char value2 = op2->__anon1.uc;
4286
4287 exp->type = 2;
4288 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((op1->__anon1.uc /= value2)) : 0);
4289 if(!exp->expType)
4290 {
4291 exp->expType = op1->type;
4292 if(op1->type)
4293 op1->type->refCount++;
4294 }
4295 return 1;
4296 }
4297
4298 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4299 {
4300 float value2 = op2->__anon1.f;
4301
4302 exp->type = 2;
4303 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f /= value2));
4304 if(!exp->expType)
4305 {
4306 exp->expType = op1->type;
4307 if(op1->type)
4308 op1->type->refCount++;
4309 }
4310 return 1;
4311 }
4312
4313 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4314 {
4315 double value2 = op2->__anon1.d;
4316
4317 exp->type = 2;
4318 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d /= value2));
4319 if(!exp->expType)
4320 {
4321 exp->expType = op1->type;
4322 if(op1->type)
4323 op1->type->refCount++;
4324 }
4325 return 1;
4326 }
4327
4328 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4329 {
4330 int value2 = op2->__anon1.i;
4331
4332 exp->type = 2;
4333 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i %= value2)) : 0);
4334 if(!exp->expType)
4335 {
4336 exp->expType = op1->type;
4337 if(op1->type)
4338 op1->type->refCount++;
4339 }
4340 return 1;
4341 }
4342
4343 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4344 {
4345 unsigned int value2 = op2->__anon1.ui;
4346
4347 exp->type = 2;
4348 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui %= value2)) : 0);
4349 if(!exp->expType)
4350 {
4351 exp->expType = op1->type;
4352 if(op1->type)
4353 op1->type->refCount++;
4354 }
4355 return 1;
4356 }
4357
4358 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4359 {
4360 long long value2 = op2->__anon1.i64;
4361
4362 exp->type = 2;
4363 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 %= value2)) : 0);
4364 if(!exp->expType)
4365 {
4366 exp->expType = op1->type;
4367 if(op1->type)
4368 op1->type->refCount++;
4369 }
4370 return 1;
4371 }
4372
4373 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4374 {
4375 uint64 value2 = op2->__anon1.ui64;
4376
4377 exp->type = 2;
4378 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 %= value2)) : 0);
4379 if(!exp->expType)
4380 {
4381 exp->expType = op1->type;
4382 if(op1->type)
4383 op1->type->refCount++;
4384 }
4385 return 1;
4386 }
4387
4388 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4389 {
4390 short value2 = op2->__anon1.s;
4391
4392 exp->type = 2;
4393 exp->__anon1.__anon2.string = PrintShort(value2 ? ((op1->__anon1.s %= value2)) : 0);
4394 if(!exp->expType)
4395 {
4396 exp->expType = op1->type;
4397 if(op1->type)
4398 op1->type->refCount++;
4399 }
4400 return 1;
4401 }
4402
4403 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4404 {
4405 unsigned short value2 = op2->__anon1.us;
4406
4407 exp->type = 2;
4408 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((op1->__anon1.us %= value2)) : 0);
4409 if(!exp->expType)
4410 {
4411 exp->expType = op1->type;
4412 if(op1->type)
4413 op1->type->refCount++;
4414 }
4415 return 1;
4416 }
4417
4418 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4419 {
4420 char value2 = op2->__anon1.c;
4421
4422 exp->type = 2;
4423 exp->__anon1.__anon2.string = PrintChar(value2 ? ((op1->__anon1.c %= value2)) : 0);
4424 if(!exp->expType)
4425 {
4426 exp->expType = op1->type;
4427 if(op1->type)
4428 op1->type->refCount++;
4429 }
4430 return 1;
4431 }
4432
4433 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4434 {
4435 unsigned char value2 = op2->__anon1.uc;
4436
4437 exp->type = 2;
4438 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((op1->__anon1.uc %= value2)) : 0);
4439 if(!exp->expType)
4440 {
4441 exp->expType = op1->type;
4442 if(op1->type)
4443 op1->type->refCount++;
4444 }
4445 return 1;
4446 }
4447
4448 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4449 {
4450 int value2 = op2->__anon1.i;
4451
4452 exp->type = 2;
4453 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
4454 if(!exp->expType)
4455 {
4456 exp->expType = op1->type;
4457 if(op1->type)
4458 op1->type->refCount++;
4459 }
4460 return 1;
4461 }
4462
4463 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4464 {
4465 unsigned int value2 = op2->__anon1.ui;
4466
4467 exp->type = 2;
4468 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
4469 if(!exp->expType)
4470 {
4471 exp->expType = op1->type;
4472 if(op1->type)
4473 op1->type->refCount++;
4474 }
4475 return 1;
4476 }
4477
4478 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4479 {
4480 long long value2 = op2->__anon1.i64;
4481
4482 exp->type = 2;
4483 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
4484 if(!exp->expType)
4485 {
4486 exp->expType = op1->type;
4487 if(op1->type)
4488 op1->type->refCount++;
4489 }
4490 return 1;
4491 }
4492
4493 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4494 {
4495 uint64 value2 = op2->__anon1.ui64;
4496
4497 exp->type = 2;
4498 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
4499 if(!exp->expType)
4500 {
4501 exp->expType = op1->type;
4502 if(op1->type)
4503 op1->type->refCount++;
4504 }
4505 return 1;
4506 }
4507
4508 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4509 {
4510 short value2 = op2->__anon1.s;
4511
4512 exp->type = 2;
4513 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s & value2));
4514 if(!exp->expType)
4515 {
4516 exp->expType = op1->type;
4517 if(op1->type)
4518 op1->type->refCount++;
4519 }
4520 return 1;
4521 }
4522
4523 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4524 {
4525 unsigned short value2 = op2->__anon1.us;
4526
4527 exp->type = 2;
4528 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us & value2));
4529 if(!exp->expType)
4530 {
4531 exp->expType = op1->type;
4532 if(op1->type)
4533 op1->type->refCount++;
4534 }
4535 return 1;
4536 }
4537
4538 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4539 {
4540 char value2 = op2->__anon1.c;
4541
4542 exp->type = 2;
4543 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c & value2));
4544 if(!exp->expType)
4545 {
4546 exp->expType = op1->type;
4547 if(op1->type)
4548 op1->type->refCount++;
4549 }
4550 return 1;
4551 }
4552
4553 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4554 {
4555 unsigned char value2 = op2->__anon1.uc;
4556
4557 exp->type = 2;
4558 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc & value2));
4559 if(!exp->expType)
4560 {
4561 exp->expType = op1->type;
4562 if(op1->type)
4563 op1->type->refCount++;
4564 }
4565 return 1;
4566 }
4567
4568 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4569 {
4570 int value2 = op2->__anon1.i;
4571
4572 exp->type = 2;
4573 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
4574 if(!exp->expType)
4575 {
4576 exp->expType = op1->type;
4577 if(op1->type)
4578 op1->type->refCount++;
4579 }
4580 return 1;
4581 }
4582
4583 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4584 {
4585 unsigned int value2 = op2->__anon1.ui;
4586
4587 exp->type = 2;
4588 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
4589 if(!exp->expType)
4590 {
4591 exp->expType = op1->type;
4592 if(op1->type)
4593 op1->type->refCount++;
4594 }
4595 return 1;
4596 }
4597
4598 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4599 {
4600 long long value2 = op2->__anon1.i64;
4601
4602 exp->type = 2;
4603 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
4604 if(!exp->expType)
4605 {
4606 exp->expType = op1->type;
4607 if(op1->type)
4608 op1->type->refCount++;
4609 }
4610 return 1;
4611 }
4612
4613 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4614 {
4615 uint64 value2 = op2->__anon1.ui64;
4616
4617 exp->type = 2;
4618 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
4619 if(!exp->expType)
4620 {
4621 exp->expType = op1->type;
4622 if(op1->type)
4623 op1->type->refCount++;
4624 }
4625 return 1;
4626 }
4627
4628 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4629 {
4630 short value2 = op2->__anon1.s;
4631
4632 exp->type = 2;
4633 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s | value2));
4634 if(!exp->expType)
4635 {
4636 exp->expType = op1->type;
4637 if(op1->type)
4638 op1->type->refCount++;
4639 }
4640 return 1;
4641 }
4642
4643 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4644 {
4645 unsigned short value2 = op2->__anon1.us;
4646
4647 exp->type = 2;
4648 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us | value2));
4649 if(!exp->expType)
4650 {
4651 exp->expType = op1->type;
4652 if(op1->type)
4653 op1->type->refCount++;
4654 }
4655 return 1;
4656 }
4657
4658 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4659 {
4660 char value2 = op2->__anon1.c;
4661
4662 exp->type = 2;
4663 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c | value2));
4664 if(!exp->expType)
4665 {
4666 exp->expType = op1->type;
4667 if(op1->type)
4668 op1->type->refCount++;
4669 }
4670 return 1;
4671 }
4672
4673 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4674 {
4675 unsigned char value2 = op2->__anon1.uc;
4676
4677 exp->type = 2;
4678 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc | value2));
4679 if(!exp->expType)
4680 {
4681 exp->expType = op1->type;
4682 if(op1->type)
4683 op1->type->refCount++;
4684 }
4685 return 1;
4686 }
4687
4688 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4689 {
4690 int value2 = op2->__anon1.i;
4691
4692 exp->type = 2;
4693 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
4694 if(!exp->expType)
4695 {
4696 exp->expType = op1->type;
4697 if(op1->type)
4698 op1->type->refCount++;
4699 }
4700 return 1;
4701 }
4702
4703 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4704 {
4705 unsigned int value2 = op2->__anon1.ui;
4706
4707 exp->type = 2;
4708 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
4709 if(!exp->expType)
4710 {
4711 exp->expType = op1->type;
4712 if(op1->type)
4713 op1->type->refCount++;
4714 }
4715 return 1;
4716 }
4717
4718 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4719 {
4720 long long value2 = op2->__anon1.i64;
4721
4722 exp->type = 2;
4723 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
4724 if(!exp->expType)
4725 {
4726 exp->expType = op1->type;
4727 if(op1->type)
4728 op1->type->refCount++;
4729 }
4730 return 1;
4731 }
4732
4733 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4734 {
4735 uint64 value2 = op2->__anon1.ui64;
4736
4737 exp->type = 2;
4738 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
4739 if(!exp->expType)
4740 {
4741 exp->expType = op1->type;
4742 if(op1->type)
4743 op1->type->refCount++;
4744 }
4745 return 1;
4746 }
4747
4748 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4749 {
4750 short value2 = op2->__anon1.s;
4751
4752 exp->type = 2;
4753 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s ^ value2));
4754 if(!exp->expType)
4755 {
4756 exp->expType = op1->type;
4757 if(op1->type)
4758 op1->type->refCount++;
4759 }
4760 return 1;
4761 }
4762
4763 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4764 {
4765 unsigned short value2 = op2->__anon1.us;
4766
4767 exp->type = 2;
4768 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us ^ value2));
4769 if(!exp->expType)
4770 {
4771 exp->expType = op1->type;
4772 if(op1->type)
4773 op1->type->refCount++;
4774 }
4775 return 1;
4776 }
4777
4778 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4779 {
4780 char value2 = op2->__anon1.c;
4781
4782 exp->type = 2;
4783 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c ^ value2));
4784 if(!exp->expType)
4785 {
4786 exp->expType = op1->type;
4787 if(op1->type)
4788 op1->type->refCount++;
4789 }
4790 return 1;
4791 }
4792
4793 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4794 {
4795 unsigned char value2 = op2->__anon1.uc;
4796
4797 exp->type = 2;
4798 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc ^ value2));
4799 if(!exp->expType)
4800 {
4801 exp->expType = op1->type;
4802 if(op1->type)
4803 op1->type->refCount++;
4804 }
4805 return 1;
4806 }
4807
4808 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4809 {
4810 int value2 = op2->__anon1.i;
4811
4812 exp->type = 2;
4813 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
4814 if(!exp->expType)
4815 {
4816 exp->expType = op1->type;
4817 if(op1->type)
4818 op1->type->refCount++;
4819 }
4820 return 1;
4821 }
4822
4823 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4824 {
4825 unsigned int value2 = op2->__anon1.ui;
4826
4827 exp->type = 2;
4828 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
4829 if(!exp->expType)
4830 {
4831 exp->expType = op1->type;
4832 if(op1->type)
4833 op1->type->refCount++;
4834 }
4835 return 1;
4836 }
4837
4838 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4839 {
4840 long long value2 = op2->__anon1.i64;
4841
4842 exp->type = 2;
4843 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
4844 if(!exp->expType)
4845 {
4846 exp->expType = op1->type;
4847 if(op1->type)
4848 op1->type->refCount++;
4849 }
4850 return 1;
4851 }
4852
4853 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4854 {
4855 uint64 value2 = op2->__anon1.ui64;
4856
4857 exp->type = 2;
4858 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
4859 if(!exp->expType)
4860 {
4861 exp->expType = op1->type;
4862 if(op1->type)
4863 op1->type->refCount++;
4864 }
4865 return 1;
4866 }
4867
4868 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4869 {
4870 short value2 = op2->__anon1.s;
4871
4872 exp->type = 2;
4873 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s << value2));
4874 if(!exp->expType)
4875 {
4876 exp->expType = op1->type;
4877 if(op1->type)
4878 op1->type->refCount++;
4879 }
4880 return 1;
4881 }
4882
4883 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4884 {
4885 unsigned short value2 = op2->__anon1.us;
4886
4887 exp->type = 2;
4888 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us << value2));
4889 if(!exp->expType)
4890 {
4891 exp->expType = op1->type;
4892 if(op1->type)
4893 op1->type->refCount++;
4894 }
4895 return 1;
4896 }
4897
4898 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4899 {
4900 char value2 = op2->__anon1.c;
4901
4902 exp->type = 2;
4903 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c << value2));
4904 if(!exp->expType)
4905 {
4906 exp->expType = op1->type;
4907 if(op1->type)
4908 op1->type->refCount++;
4909 }
4910 return 1;
4911 }
4912
4913 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4914 {
4915 unsigned char value2 = op2->__anon1.uc;
4916
4917 exp->type = 2;
4918 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc << value2));
4919 if(!exp->expType)
4920 {
4921 exp->expType = op1->type;
4922 if(op1->type)
4923 op1->type->refCount++;
4924 }
4925 return 1;
4926 }
4927
4928 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4929 {
4930 int value2 = op2->__anon1.i;
4931
4932 exp->type = 2;
4933 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
4934 if(!exp->expType)
4935 {
4936 exp->expType = op1->type;
4937 if(op1->type)
4938 op1->type->refCount++;
4939 }
4940 return 1;
4941 }
4942
4943 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4944 {
4945 unsigned int value2 = op2->__anon1.ui;
4946
4947 exp->type = 2;
4948 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
4949 if(!exp->expType)
4950 {
4951 exp->expType = op1->type;
4952 if(op1->type)
4953 op1->type->refCount++;
4954 }
4955 return 1;
4956 }
4957
4958 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4959 {
4960 long long value2 = op2->__anon1.i64;
4961
4962 exp->type = 2;
4963 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
4964 if(!exp->expType)
4965 {
4966 exp->expType = op1->type;
4967 if(op1->type)
4968 op1->type->refCount++;
4969 }
4970 return 1;
4971 }
4972
4973 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4974 {
4975 uint64 value2 = op2->__anon1.ui64;
4976
4977 exp->type = 2;
4978 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
4979 if(!exp->expType)
4980 {
4981 exp->expType = op1->type;
4982 if(op1->type)
4983 op1->type->refCount++;
4984 }
4985 return 1;
4986 }
4987
4988 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4989 {
4990 short value2 = op2->__anon1.s;
4991
4992 exp->type = 2;
4993 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >> value2));
4994 if(!exp->expType)
4995 {
4996 exp->expType = op1->type;
4997 if(op1->type)
4998 op1->type->refCount++;
4999 }
5000 return 1;
5001 }
5002
5003 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5004 {
5005 unsigned short value2 = op2->__anon1.us;
5006
5007 exp->type = 2;
5008 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >> value2));
5009 if(!exp->expType)
5010 {
5011 exp->expType = op1->type;
5012 if(op1->type)
5013 op1->type->refCount++;
5014 }
5015 return 1;
5016 }
5017
5018 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5019 {
5020 char value2 = op2->__anon1.c;
5021
5022 exp->type = 2;
5023 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >> value2));
5024 if(!exp->expType)
5025 {
5026 exp->expType = op1->type;
5027 if(op1->type)
5028 op1->type->refCount++;
5029 }
5030 return 1;
5031 }
5032
5033 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5034 {
5035 unsigned char value2 = op2->__anon1.uc;
5036
5037 exp->type = 2;
5038 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >> value2));
5039 if(!exp->expType)
5040 {
5041 exp->expType = op1->type;
5042 if(op1->type)
5043 op1->type->refCount++;
5044 }
5045 return 1;
5046 }
5047
5048 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
5049 {
5050 exp->type = 2;
5051 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
5052 if(!exp->expType)
5053 {
5054 exp->expType = op1->type;
5055 if(op1->type)
5056 op1->type->refCount++;
5057 }
5058 return 1;
5059 }
5060
5061 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
5062 {
5063 exp->type = 2;
5064 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
5065 if(!exp->expType)
5066 {
5067 exp->expType = op1->type;
5068 if(op1->type)
5069 op1->type->refCount++;
5070 }
5071 return 1;
5072 }
5073
5074 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
5075 {
5076 exp->type = 2;
5077 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
5078 if(!exp->expType)
5079 {
5080 exp->expType = op1->type;
5081 if(op1->type)
5082 op1->type->refCount++;
5083 }
5084 return 1;
5085 }
5086
5087 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
5088 {
5089 exp->type = 2;
5090 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
5091 if(!exp->expType)
5092 {
5093 exp->expType = op1->type;
5094 if(op1->type)
5095 op1->type->refCount++;
5096 }
5097 return 1;
5098 }
5099
5100 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
5101 {
5102 exp->type = 2;
5103 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
5104 if(!exp->expType)
5105 {
5106 exp->expType = op1->type;
5107 if(op1->type)
5108 op1->type->refCount++;
5109 }
5110 return 1;
5111 }
5112
5113 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
5114 {
5115 exp->type = 2;
5116 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
5117 if(!exp->expType)
5118 {
5119 exp->expType = op1->type;
5120 if(op1->type)
5121 op1->type->refCount++;
5122 }
5123 return 1;
5124 }
5125
5126 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
5127 {
5128 exp->type = 2;
5129 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
5130 if(!exp->expType)
5131 {
5132 exp->expType = op1->type;
5133 if(op1->type)
5134 op1->type->refCount++;
5135 }
5136 return 1;
5137 }
5138
5139 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
5140 {
5141 exp->type = 2;
5142 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
5143 if(!exp->expType)
5144 {
5145 exp->expType = op1->type;
5146 if(op1->type)
5147 op1->type->refCount++;
5148 }
5149 return 1;
5150 }
5151
5152 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5153 {
5154 int value2 = op2->__anon1.i;
5155
5156 exp->type = 2;
5157 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
5158 if(!exp->expType)
5159 {
5160 exp->expType = op1->type;
5161 if(op1->type)
5162 op1->type->refCount++;
5163 }
5164 return 1;
5165 }
5166
5167 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5168 {
5169 unsigned int value2 = op2->__anon1.ui;
5170
5171 exp->type = 2;
5172 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
5173 if(!exp->expType)
5174 {
5175 exp->expType = op1->type;
5176 if(op1->type)
5177 op1->type->refCount++;
5178 }
5179 return 1;
5180 }
5181
5182 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5183 {
5184 long long value2 = op2->__anon1.i64;
5185
5186 exp->type = 2;
5187 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
5188 if(!exp->expType)
5189 {
5190 exp->expType = op1->type;
5191 if(op1->type)
5192 op1->type->refCount++;
5193 }
5194 return 1;
5195 }
5196
5197 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5198 {
5199 uint64 value2 = op2->__anon1.ui64;
5200
5201 exp->type = 2;
5202 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
5203 if(!exp->expType)
5204 {
5205 exp->expType = op1->type;
5206 if(op1->type)
5207 op1->type->refCount++;
5208 }
5209 return 1;
5210 }
5211
5212 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5213 {
5214 short value2 = op2->__anon1.s;
5215
5216 exp->type = 2;
5217 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
5218 if(!exp->expType)
5219 {
5220 exp->expType = op1->type;
5221 if(op1->type)
5222 op1->type->refCount++;
5223 }
5224 return 1;
5225 }
5226
5227 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5228 {
5229 unsigned short value2 = op2->__anon1.us;
5230
5231 exp->type = 2;
5232 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
5233 if(!exp->expType)
5234 {
5235 exp->expType = op1->type;
5236 if(op1->type)
5237 op1->type->refCount++;
5238 }
5239 return 1;
5240 }
5241
5242 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5243 {
5244 char value2 = op2->__anon1.c;
5245
5246 exp->type = 2;
5247 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
5248 if(!exp->expType)
5249 {
5250 exp->expType = op1->type;
5251 if(op1->type)
5252 op1->type->refCount++;
5253 }
5254 return 1;
5255 }
5256
5257 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5258 {
5259 unsigned char value2 = op2->__anon1.uc;
5260
5261 exp->type = 2;
5262 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
5263 if(!exp->expType)
5264 {
5265 exp->expType = op1->type;
5266 if(op1->type)
5267 op1->type->refCount++;
5268 }
5269 return 1;
5270 }
5271
5272 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5273 {
5274 int value2 = op2->__anon1.i;
5275
5276 exp->type = 2;
5277 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
5278 if(!exp->expType)
5279 {
5280 exp->expType = op1->type;
5281 if(op1->type)
5282 op1->type->refCount++;
5283 }
5284 return 1;
5285 }
5286
5287 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5288 {
5289 unsigned int value2 = op2->__anon1.ui;
5290
5291 exp->type = 2;
5292 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
5293 if(!exp->expType)
5294 {
5295 exp->expType = op1->type;
5296 if(op1->type)
5297 op1->type->refCount++;
5298 }
5299 return 1;
5300 }
5301
5302 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5303 {
5304 long long value2 = op2->__anon1.i64;
5305
5306 exp->type = 2;
5307 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
5308 if(!exp->expType)
5309 {
5310 exp->expType = op1->type;
5311 if(op1->type)
5312 op1->type->refCount++;
5313 }
5314 return 1;
5315 }
5316
5317 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5318 {
5319 uint64 value2 = op2->__anon1.ui64;
5320
5321 exp->type = 2;
5322 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
5323 if(!exp->expType)
5324 {
5325 exp->expType = op1->type;
5326 if(op1->type)
5327 op1->type->refCount++;
5328 }
5329 return 1;
5330 }
5331
5332 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5333 {
5334 short value2 = op2->__anon1.s;
5335
5336 exp->type = 2;
5337 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
5338 if(!exp->expType)
5339 {
5340 exp->expType = op1->type;
5341 if(op1->type)
5342 op1->type->refCount++;
5343 }
5344 return 1;
5345 }
5346
5347 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5348 {
5349 unsigned short value2 = op2->__anon1.us;
5350
5351 exp->type = 2;
5352 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
5353 if(!exp->expType)
5354 {
5355 exp->expType = op1->type;
5356 if(op1->type)
5357 op1->type->refCount++;
5358 }
5359 return 1;
5360 }
5361
5362 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5363 {
5364 char value2 = op2->__anon1.c;
5365
5366 exp->type = 2;
5367 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
5368 if(!exp->expType)
5369 {
5370 exp->expType = op1->type;
5371 if(op1->type)
5372 op1->type->refCount++;
5373 }
5374 return 1;
5375 }
5376
5377 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5378 {
5379 unsigned char value2 = op2->__anon1.uc;
5380
5381 exp->type = 2;
5382 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
5383 if(!exp->expType)
5384 {
5385 exp->expType = op1->type;
5386 if(op1->type)
5387 op1->type->refCount++;
5388 }
5389 return 1;
5390 }
5391
5392 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5393 {
5394 int value2 = op2->__anon1.i;
5395
5396 exp->type = 2;
5397 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
5398 if(!exp->expType)
5399 {
5400 exp->expType = op1->type;
5401 if(op1->type)
5402 op1->type->refCount++;
5403 }
5404 return 1;
5405 }
5406
5407 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5408 {
5409 unsigned int value2 = op2->__anon1.ui;
5410
5411 exp->type = 2;
5412 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
5413 if(!exp->expType)
5414 {
5415 exp->expType = op1->type;
5416 if(op1->type)
5417 op1->type->refCount++;
5418 }
5419 return 1;
5420 }
5421
5422 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5423 {
5424 long long value2 = op2->__anon1.i64;
5425
5426 exp->type = 2;
5427 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
5428 if(!exp->expType)
5429 {
5430 exp->expType = op1->type;
5431 if(op1->type)
5432 op1->type->refCount++;
5433 }
5434 return 1;
5435 }
5436
5437 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5438 {
5439 uint64 value2 = op2->__anon1.ui64;
5440
5441 exp->type = 2;
5442 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
5443 if(!exp->expType)
5444 {
5445 exp->expType = op1->type;
5446 if(op1->type)
5447 op1->type->refCount++;
5448 }
5449 return 1;
5450 }
5451
5452 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5453 {
5454 short value2 = op2->__anon1.s;
5455
5456 exp->type = 2;
5457 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
5458 if(!exp->expType)
5459 {
5460 exp->expType = op1->type;
5461 if(op1->type)
5462 op1->type->refCount++;
5463 }
5464 return 1;
5465 }
5466
5467 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5468 {
5469 unsigned short value2 = op2->__anon1.us;
5470
5471 exp->type = 2;
5472 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
5473 if(!exp->expType)
5474 {
5475 exp->expType = op1->type;
5476 if(op1->type)
5477 op1->type->refCount++;
5478 }
5479 return 1;
5480 }
5481
5482 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5483 {
5484 char value2 = op2->__anon1.c;
5485
5486 exp->type = 2;
5487 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
5488 if(!exp->expType)
5489 {
5490 exp->expType = op1->type;
5491 if(op1->type)
5492 op1->type->refCount++;
5493 }
5494 return 1;
5495 }
5496
5497 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5498 {
5499 unsigned char value2 = op2->__anon1.uc;
5500
5501 exp->type = 2;
5502 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
5503 if(!exp->expType)
5504 {
5505 exp->expType = op1->type;
5506 if(op1->type)
5507 op1->type->refCount++;
5508 }
5509 return 1;
5510 }
5511
5512 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5513 {
5514 int value2 = op2->__anon1.i;
5515
5516 exp->type = 2;
5517 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
5518 if(!exp->expType)
5519 {
5520 exp->expType = op1->type;
5521 if(op1->type)
5522 op1->type->refCount++;
5523 }
5524 return 1;
5525 }
5526
5527 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5528 {
5529 unsigned int value2 = op2->__anon1.ui;
5530
5531 exp->type = 2;
5532 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
5533 if(!exp->expType)
5534 {
5535 exp->expType = op1->type;
5536 if(op1->type)
5537 op1->type->refCount++;
5538 }
5539 return 1;
5540 }
5541
5542 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5543 {
5544 long long value2 = op2->__anon1.i64;
5545
5546 exp->type = 2;
5547 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
5548 if(!exp->expType)
5549 {
5550 exp->expType = op1->type;
5551 if(op1->type)
5552 op1->type->refCount++;
5553 }
5554 return 1;
5555 }
5556
5557 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5558 {
5559 uint64 value2 = op2->__anon1.ui64;
5560
5561 exp->type = 2;
5562 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
5563 if(!exp->expType)
5564 {
5565 exp->expType = op1->type;
5566 if(op1->type)
5567 op1->type->refCount++;
5568 }
5569 return 1;
5570 }
5571
5572 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5573 {
5574 short value2 = op2->__anon1.s;
5575
5576 exp->type = 2;
5577 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
5578 if(!exp->expType)
5579 {
5580 exp->expType = op1->type;
5581 if(op1->type)
5582 op1->type->refCount++;
5583 }
5584 return 1;
5585 }
5586
5587 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5588 {
5589 unsigned short value2 = op2->__anon1.us;
5590
5591 exp->type = 2;
5592 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
5593 if(!exp->expType)
5594 {
5595 exp->expType = op1->type;
5596 if(op1->type)
5597 op1->type->refCount++;
5598 }
5599 return 1;
5600 }
5601
5602 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5603 {
5604 char value2 = op2->__anon1.c;
5605
5606 exp->type = 2;
5607 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
5608 if(!exp->expType)
5609 {
5610 exp->expType = op1->type;
5611 if(op1->type)
5612 op1->type->refCount++;
5613 }
5614 return 1;
5615 }
5616
5617 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5618 {
5619 unsigned char value2 = op2->__anon1.uc;
5620
5621 exp->type = 2;
5622 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
5623 if(!exp->expType)
5624 {
5625 exp->expType = op1->type;
5626 if(op1->type)
5627 op1->type->refCount++;
5628 }
5629 return 1;
5630 }
5631
5632 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5633 {
5634 int value2 = op2->__anon1.i;
5635
5636 exp->type = 2;
5637 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
5638 if(!exp->expType)
5639 {
5640 exp->expType = op1->type;
5641 if(op1->type)
5642 op1->type->refCount++;
5643 }
5644 return 1;
5645 }
5646
5647 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5648 {
5649 unsigned int value2 = op2->__anon1.ui;
5650
5651 exp->type = 2;
5652 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
5653 if(!exp->expType)
5654 {
5655 exp->expType = op1->type;
5656 if(op1->type)
5657 op1->type->refCount++;
5658 }
5659 return 1;
5660 }
5661
5662 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5663 {
5664 long long value2 = op2->__anon1.i64;
5665
5666 exp->type = 2;
5667 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
5668 if(!exp->expType)
5669 {
5670 exp->expType = op1->type;
5671 if(op1->type)
5672 op1->type->refCount++;
5673 }
5674 return 1;
5675 }
5676
5677 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5678 {
5679 uint64 value2 = op2->__anon1.ui64;
5680
5681 exp->type = 2;
5682 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
5683 if(!exp->expType)
5684 {
5685 exp->expType = op1->type;
5686 if(op1->type)
5687 op1->type->refCount++;
5688 }
5689 return 1;
5690 }
5691
5692 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5693 {
5694 short value2 = op2->__anon1.s;
5695
5696 exp->type = 2;
5697 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
5698 if(!exp->expType)
5699 {
5700 exp->expType = op1->type;
5701 if(op1->type)
5702 op1->type->refCount++;
5703 }
5704 return 1;
5705 }
5706
5707 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5708 {
5709 unsigned short value2 = op2->__anon1.us;
5710
5711 exp->type = 2;
5712 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
5713 if(!exp->expType)
5714 {
5715 exp->expType = op1->type;
5716 if(op1->type)
5717 op1->type->refCount++;
5718 }
5719 return 1;
5720 }
5721
5722 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5723 {
5724 char value2 = op2->__anon1.c;
5725
5726 exp->type = 2;
5727 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
5728 if(!exp->expType)
5729 {
5730 exp->expType = op1->type;
5731 if(op1->type)
5732 op1->type->refCount++;
5733 }
5734 return 1;
5735 }
5736
5737 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5738 {
5739 unsigned char value2 = op2->__anon1.uc;
5740
5741 exp->type = 2;
5742 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
5743 if(!exp->expType)
5744 {
5745 exp->expType = op1->type;
5746 if(op1->type)
5747 op1->type->refCount++;
5748 }
5749 return 1;
5750 }
5751
5752 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
5753 {
5754 exp->type = 2;
5755 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
5756 if(!exp->expType)
5757 {
5758 exp->expType = op1->type;
5759 if(op1->type)
5760 op1->type->refCount++;
5761 }
5762 return 1;
5763 }
5764
5765 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
5766 {
5767 exp->type = 2;
5768 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
5769 if(!exp->expType)
5770 {
5771 exp->expType = op1->type;
5772 if(op1->type)
5773 op1->type->refCount++;
5774 }
5775 return 1;
5776 }
5777
5778 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
5779 {
5780 exp->type = 2;
5781 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
5782 if(!exp->expType)
5783 {
5784 exp->expType = op1->type;
5785 if(op1->type)
5786 op1->type->refCount++;
5787 }
5788 return 1;
5789 }
5790
5791 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
5792 {
5793 exp->type = 2;
5794 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
5795 if(!exp->expType)
5796 {
5797 exp->expType = op1->type;
5798 if(op1->type)
5799 op1->type->refCount++;
5800 }
5801 return 1;
5802 }
5803
5804 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
5805 {
5806 exp->type = 2;
5807 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
5808 if(!exp->expType)
5809 {
5810 exp->expType = op1->type;
5811 if(op1->type)
5812 op1->type->refCount++;
5813 }
5814 return 1;
5815 }
5816
5817 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
5818 {
5819 exp->type = 2;
5820 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
5821 if(!exp->expType)
5822 {
5823 exp->expType = op1->type;
5824 if(op1->type)
5825 op1->type->refCount++;
5826 }
5827 return 1;
5828 }
5829
5830 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
5831 {
5832 exp->type = 2;
5833 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
5834 if(!exp->expType)
5835 {
5836 exp->expType = op1->type;
5837 if(op1->type)
5838 op1->type->refCount++;
5839 }
5840 return 1;
5841 }
5842
5843 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
5844 {
5845 exp->type = 2;
5846 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
5847 if(!exp->expType)
5848 {
5849 exp->expType = op1->type;
5850 if(op1->type)
5851 op1->type->refCount++;
5852 }
5853 return 1;
5854 }
5855
5856 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5857 {
5858 int value2 = op2->__anon1.i;
5859
5860 exp->type = 2;
5861 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
5862 if(!exp->expType)
5863 {
5864 exp->expType = op1->type;
5865 if(op1->type)
5866 op1->type->refCount++;
5867 }
5868 return 1;
5869 }
5870
5871 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5872 {
5873 unsigned int value2 = op2->__anon1.ui;
5874
5875 exp->type = 2;
5876 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
5877 if(!exp->expType)
5878 {
5879 exp->expType = op1->type;
5880 if(op1->type)
5881 op1->type->refCount++;
5882 }
5883 return 1;
5884 }
5885
5886 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5887 {
5888 long long value2 = op2->__anon1.i64;
5889
5890 exp->type = 2;
5891 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
5892 if(!exp->expType)
5893 {
5894 exp->expType = op1->type;
5895 if(op1->type)
5896 op1->type->refCount++;
5897 }
5898 return 1;
5899 }
5900
5901 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5902 {
5903 uint64 value2 = op2->__anon1.ui64;
5904
5905 exp->type = 2;
5906 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
5907 if(!exp->expType)
5908 {
5909 exp->expType = op1->type;
5910 if(op1->type)
5911 op1->type->refCount++;
5912 }
5913 return 1;
5914 }
5915
5916 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5917 {
5918 short value2 = op2->__anon1.s;
5919
5920 exp->type = 2;
5921 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
5922 if(!exp->expType)
5923 {
5924 exp->expType = op1->type;
5925 if(op1->type)
5926 op1->type->refCount++;
5927 }
5928 return 1;
5929 }
5930
5931 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5932 {
5933 unsigned short value2 = op2->__anon1.us;
5934
5935 exp->type = 2;
5936 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
5937 if(!exp->expType)
5938 {
5939 exp->expType = op1->type;
5940 if(op1->type)
5941 op1->type->refCount++;
5942 }
5943 return 1;
5944 }
5945
5946 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5947 {
5948 char value2 = op2->__anon1.c;
5949
5950 exp->type = 2;
5951 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
5952 if(!exp->expType)
5953 {
5954 exp->expType = op1->type;
5955 if(op1->type)
5956 op1->type->refCount++;
5957 }
5958 return 1;
5959 }
5960
5961 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5962 {
5963 unsigned char value2 = op2->__anon1.uc;
5964
5965 exp->type = 2;
5966 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
5967 if(!exp->expType)
5968 {
5969 exp->expType = op1->type;
5970 if(op1->type)
5971 op1->type->refCount++;
5972 }
5973 return 1;
5974 }
5975
5976 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5977 {
5978 float value2 = op2->__anon1.f;
5979
5980 exp->type = 2;
5981 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
5982 if(!exp->expType)
5983 {
5984 exp->expType = op1->type;
5985 if(op1->type)
5986 op1->type->refCount++;
5987 }
5988 return 1;
5989 }
5990
5991 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5992 {
5993 double value2 = op2->__anon1.d;
5994
5995 exp->type = 2;
5996 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
5997 if(!exp->expType)
5998 {
5999 exp->expType = op1->type;
6000 if(op1->type)
6001 op1->type->refCount++;
6002 }
6003 return 1;
6004 }
6005
6006 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6007 {
6008 int value2 = op2->__anon1.i;
6009
6010 exp->type = 2;
6011 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
6012 if(!exp->expType)
6013 {
6014 exp->expType = op1->type;
6015 if(op1->type)
6016 op1->type->refCount++;
6017 }
6018 return 1;
6019 }
6020
6021 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6022 {
6023 unsigned int value2 = op2->__anon1.ui;
6024
6025 exp->type = 2;
6026 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
6027 if(!exp->expType)
6028 {
6029 exp->expType = op1->type;
6030 if(op1->type)
6031 op1->type->refCount++;
6032 }
6033 return 1;
6034 }
6035
6036 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6037 {
6038 long long value2 = op2->__anon1.i64;
6039
6040 exp->type = 2;
6041 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
6042 if(!exp->expType)
6043 {
6044 exp->expType = op1->type;
6045 if(op1->type)
6046 op1->type->refCount++;
6047 }
6048 return 1;
6049 }
6050
6051 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6052 {
6053 uint64 value2 = op2->__anon1.ui64;
6054
6055 exp->type = 2;
6056 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
6057 if(!exp->expType)
6058 {
6059 exp->expType = op1->type;
6060 if(op1->type)
6061 op1->type->refCount++;
6062 }
6063 return 1;
6064 }
6065
6066 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6067 {
6068 short value2 = op2->__anon1.s;
6069
6070 exp->type = 2;
6071 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
6072 if(!exp->expType)
6073 {
6074 exp->expType = op1->type;
6075 if(op1->type)
6076 op1->type->refCount++;
6077 }
6078 return 1;
6079 }
6080
6081 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6082 {
6083 unsigned short value2 = op2->__anon1.us;
6084
6085 exp->type = 2;
6086 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
6087 if(!exp->expType)
6088 {
6089 exp->expType = op1->type;
6090 if(op1->type)
6091 op1->type->refCount++;
6092 }
6093 return 1;
6094 }
6095
6096 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6097 {
6098 char value2 = op2->__anon1.c;
6099
6100 exp->type = 2;
6101 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
6102 if(!exp->expType)
6103 {
6104 exp->expType = op1->type;
6105 if(op1->type)
6106 op1->type->refCount++;
6107 }
6108 return 1;
6109 }
6110
6111 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6112 {
6113 unsigned char value2 = op2->__anon1.uc;
6114
6115 exp->type = 2;
6116 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
6117 if(!exp->expType)
6118 {
6119 exp->expType = op1->type;
6120 if(op1->type)
6121 op1->type->refCount++;
6122 }
6123 return 1;
6124 }
6125
6126 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6127 {
6128 float value2 = op2->__anon1.f;
6129
6130 exp->type = 2;
6131 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
6132 if(!exp->expType)
6133 {
6134 exp->expType = op1->type;
6135 if(op1->type)
6136 op1->type->refCount++;
6137 }
6138 return 1;
6139 }
6140
6141 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6142 {
6143 double value2 = op2->__anon1.d;
6144
6145 exp->type = 2;
6146 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
6147 if(!exp->expType)
6148 {
6149 exp->expType = op1->type;
6150 if(op1->type)
6151 op1->type->refCount++;
6152 }
6153 return 1;
6154 }
6155
6156 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6157 {
6158 int value2 = op2->__anon1.i;
6159
6160 exp->type = 2;
6161 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
6162 if(!exp->expType)
6163 {
6164 exp->expType = op1->type;
6165 if(op1->type)
6166 op1->type->refCount++;
6167 }
6168 return 1;
6169 }
6170
6171 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6172 {
6173 unsigned int value2 = op2->__anon1.ui;
6174
6175 exp->type = 2;
6176 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
6177 if(!exp->expType)
6178 {
6179 exp->expType = op1->type;
6180 if(op1->type)
6181 op1->type->refCount++;
6182 }
6183 return 1;
6184 }
6185
6186 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6187 {
6188 long long value2 = op2->__anon1.i64;
6189
6190 exp->type = 2;
6191 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
6192 if(!exp->expType)
6193 {
6194 exp->expType = op1->type;
6195 if(op1->type)
6196 op1->type->refCount++;
6197 }
6198 return 1;
6199 }
6200
6201 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6202 {
6203 uint64 value2 = op2->__anon1.ui64;
6204
6205 exp->type = 2;
6206 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
6207 if(!exp->expType)
6208 {
6209 exp->expType = op1->type;
6210 if(op1->type)
6211 op1->type->refCount++;
6212 }
6213 return 1;
6214 }
6215
6216 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6217 {
6218 short value2 = op2->__anon1.s;
6219
6220 exp->type = 2;
6221 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
6222 if(!exp->expType)
6223 {
6224 exp->expType = op1->type;
6225 if(op1->type)
6226 op1->type->refCount++;
6227 }
6228 return 1;
6229 }
6230
6231 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6232 {
6233 unsigned short value2 = op2->__anon1.us;
6234
6235 exp->type = 2;
6236 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
6237 if(!exp->expType)
6238 {
6239 exp->expType = op1->type;
6240 if(op1->type)
6241 op1->type->refCount++;
6242 }
6243 return 1;
6244 }
6245
6246 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6247 {
6248 char value2 = op2->__anon1.c;
6249
6250 exp->type = 2;
6251 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
6252 if(!exp->expType)
6253 {
6254 exp->expType = op1->type;
6255 if(op1->type)
6256 op1->type->refCount++;
6257 }
6258 return 1;
6259 }
6260
6261 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6262 {
6263 unsigned char value2 = op2->__anon1.uc;
6264
6265 exp->type = 2;
6266 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
6267 if(!exp->expType)
6268 {
6269 exp->expType = op1->type;
6270 if(op1->type)
6271 op1->type->refCount++;
6272 }
6273 return 1;
6274 }
6275
6276 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6277 {
6278 float value2 = op2->__anon1.f;
6279
6280 exp->type = 2;
6281 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
6282 if(!exp->expType)
6283 {
6284 exp->expType = op1->type;
6285 if(op1->type)
6286 op1->type->refCount++;
6287 }
6288 return 1;
6289 }
6290
6291 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6292 {
6293 double value2 = op2->__anon1.d;
6294
6295 exp->type = 2;
6296 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
6297 if(!exp->expType)
6298 {
6299 exp->expType = op1->type;
6300 if(op1->type)
6301 op1->type->refCount++;
6302 }
6303 return 1;
6304 }
6305
6306 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6307 {
6308 int value2 = op2->__anon1.i;
6309
6310 exp->type = 2;
6311 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
6312 if(!exp->expType)
6313 {
6314 exp->expType = op1->type;
6315 if(op1->type)
6316 op1->type->refCount++;
6317 }
6318 return 1;
6319 }
6320
6321 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6322 {
6323 unsigned int value2 = op2->__anon1.ui;
6324
6325 exp->type = 2;
6326 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
6327 if(!exp->expType)
6328 {
6329 exp->expType = op1->type;
6330 if(op1->type)
6331 op1->type->refCount++;
6332 }
6333 return 1;
6334 }
6335
6336 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6337 {
6338 long long value2 = op2->__anon1.i64;
6339
6340 exp->type = 2;
6341 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
6342 if(!exp->expType)
6343 {
6344 exp->expType = op1->type;
6345 if(op1->type)
6346 op1->type->refCount++;
6347 }
6348 return 1;
6349 }
6350
6351 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6352 {
6353 uint64 value2 = op2->__anon1.ui64;
6354
6355 exp->type = 2;
6356 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
6357 if(!exp->expType)
6358 {
6359 exp->expType = op1->type;
6360 if(op1->type)
6361 op1->type->refCount++;
6362 }
6363 return 1;
6364 }
6365
6366 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6367 {
6368 short value2 = op2->__anon1.s;
6369
6370 exp->type = 2;
6371 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
6372 if(!exp->expType)
6373 {
6374 exp->expType = op1->type;
6375 if(op1->type)
6376 op1->type->refCount++;
6377 }
6378 return 1;
6379 }
6380
6381 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6382 {
6383 unsigned short value2 = op2->__anon1.us;
6384
6385 exp->type = 2;
6386 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
6387 if(!exp->expType)
6388 {
6389 exp->expType = op1->type;
6390 if(op1->type)
6391 op1->type->refCount++;
6392 }
6393 return 1;
6394 }
6395
6396 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6397 {
6398 char value2 = op2->__anon1.c;
6399
6400 exp->type = 2;
6401 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
6402 if(!exp->expType)
6403 {
6404 exp->expType = op1->type;
6405 if(op1->type)
6406 op1->type->refCount++;
6407 }
6408 return 1;
6409 }
6410
6411 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6412 {
6413 unsigned char value2 = op2->__anon1.uc;
6414
6415 exp->type = 2;
6416 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
6417 if(!exp->expType)
6418 {
6419 exp->expType = op1->type;
6420 if(op1->type)
6421 op1->type->refCount++;
6422 }
6423 return 1;
6424 }
6425
6426 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6427 {
6428 float value2 = op2->__anon1.f;
6429
6430 exp->type = 2;
6431 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
6432 if(!exp->expType)
6433 {
6434 exp->expType = op1->type;
6435 if(op1->type)
6436 op1->type->refCount++;
6437 }
6438 return 1;
6439 }
6440
6441 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6442 {
6443 double value2 = op2->__anon1.d;
6444
6445 exp->type = 2;
6446 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
6447 if(!exp->expType)
6448 {
6449 exp->expType = op1->type;
6450 if(op1->type)
6451 op1->type->refCount++;
6452 }
6453 return 1;
6454 }
6455
6456 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6457 {
6458 int value2 = op2->__anon1.i;
6459
6460 exp->type = 2;
6461 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
6462 if(!exp->expType)
6463 {
6464 exp->expType = op1->type;
6465 if(op1->type)
6466 op1->type->refCount++;
6467 }
6468 return 1;
6469 }
6470
6471 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6472 {
6473 unsigned int value2 = op2->__anon1.ui;
6474
6475 exp->type = 2;
6476 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
6477 if(!exp->expType)
6478 {
6479 exp->expType = op1->type;
6480 if(op1->type)
6481 op1->type->refCount++;
6482 }
6483 return 1;
6484 }
6485
6486 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6487 {
6488 long long value2 = op2->__anon1.i64;
6489
6490 exp->type = 2;
6491 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
6492 if(!exp->expType)
6493 {
6494 exp->expType = op1->type;
6495 if(op1->type)
6496 op1->type->refCount++;
6497 }
6498 return 1;
6499 }
6500
6501 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6502 {
6503 uint64 value2 = op2->__anon1.ui64;
6504
6505 exp->type = 2;
6506 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
6507 if(!exp->expType)
6508 {
6509 exp->expType = op1->type;
6510 if(op1->type)
6511 op1->type->refCount++;
6512 }
6513 return 1;
6514 }
6515
6516 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6517 {
6518 short value2 = op2->__anon1.s;
6519
6520 exp->type = 2;
6521 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
6522 if(!exp->expType)
6523 {
6524 exp->expType = op1->type;
6525 if(op1->type)
6526 op1->type->refCount++;
6527 }
6528 return 1;
6529 }
6530
6531 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6532 {
6533 unsigned short value2 = op2->__anon1.us;
6534
6535 exp->type = 2;
6536 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
6537 if(!exp->expType)
6538 {
6539 exp->expType = op1->type;
6540 if(op1->type)
6541 op1->type->refCount++;
6542 }
6543 return 1;
6544 }
6545
6546 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6547 {
6548 char value2 = op2->__anon1.c;
6549
6550 exp->type = 2;
6551 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
6552 if(!exp->expType)
6553 {
6554 exp->expType = op1->type;
6555 if(op1->type)
6556 op1->type->refCount++;
6557 }
6558 return 1;
6559 }
6560
6561 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6562 {
6563 unsigned char value2 = op2->__anon1.uc;
6564
6565 exp->type = 2;
6566 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
6567 if(!exp->expType)
6568 {
6569 exp->expType = op1->type;
6570 if(op1->type)
6571 op1->type->refCount++;
6572 }
6573 return 1;
6574 }
6575
6576 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6577 {
6578 float value2 = op2->__anon1.f;
6579
6580 exp->type = 2;
6581 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
6582 if(!exp->expType)
6583 {
6584 exp->expType = op1->type;
6585 if(op1->type)
6586 op1->type->refCount++;
6587 }
6588 return 1;
6589 }
6590
6591 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6592 {
6593 double value2 = op2->__anon1.d;
6594
6595 exp->type = 2;
6596 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
6597 if(!exp->expType)
6598 {
6599 exp->expType = op1->type;
6600 if(op1->type)
6601 op1->type->refCount++;
6602 }
6603 return 1;
6604 }
6605
6606 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6607 {
6608 int value2 = op2->__anon1.i;
6609
6610 exp->type = 2;
6611 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
6612 if(!exp->expType)
6613 {
6614 exp->expType = op1->type;
6615 if(op1->type)
6616 op1->type->refCount++;
6617 }
6618 return 1;
6619 }
6620
6621 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6622 {
6623 unsigned int value2 = op2->__anon1.ui;
6624
6625 exp->type = 2;
6626 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
6627 if(!exp->expType)
6628 {
6629 exp->expType = op1->type;
6630 if(op1->type)
6631 op1->type->refCount++;
6632 }
6633 return 1;
6634 }
6635
6636 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6637 {
6638 long long value2 = op2->__anon1.i64;
6639
6640 exp->type = 2;
6641 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
6642 if(!exp->expType)
6643 {
6644 exp->expType = op1->type;
6645 if(op1->type)
6646 op1->type->refCount++;
6647 }
6648 return 1;
6649 }
6650
6651 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6652 {
6653 uint64 value2 = op2->__anon1.ui64;
6654
6655 exp->type = 2;
6656 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
6657 if(!exp->expType)
6658 {
6659 exp->expType = op1->type;
6660 if(op1->type)
6661 op1->type->refCount++;
6662 }
6663 return 1;
6664 }
6665
6666 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6667 {
6668 short value2 = op2->__anon1.s;
6669
6670 exp->type = 2;
6671 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
6672 if(!exp->expType)
6673 {
6674 exp->expType = op1->type;
6675 if(op1->type)
6676 op1->type->refCount++;
6677 }
6678 return 1;
6679 }
6680
6681 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6682 {
6683 unsigned short value2 = op2->__anon1.us;
6684
6685 exp->type = 2;
6686 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
6687 if(!exp->expType)
6688 {
6689 exp->expType = op1->type;
6690 if(op1->type)
6691 op1->type->refCount++;
6692 }
6693 return 1;
6694 }
6695
6696 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6697 {
6698 char value2 = op2->__anon1.c;
6699
6700 exp->type = 2;
6701 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
6702 if(!exp->expType)
6703 {
6704 exp->expType = op1->type;
6705 if(op1->type)
6706 op1->type->refCount++;
6707 }
6708 return 1;
6709 }
6710
6711 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6712 {
6713 unsigned char value2 = op2->__anon1.uc;
6714
6715 exp->type = 2;
6716 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
6717 if(!exp->expType)
6718 {
6719 exp->expType = op1->type;
6720 if(op1->type)
6721 op1->type->refCount++;
6722 }
6723 return 1;
6724 }
6725
6726 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6727 {
6728 float value2 = op2->__anon1.f;
6729
6730 exp->type = 2;
6731 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
6732 if(!exp->expType)
6733 {
6734 exp->expType = op1->type;
6735 if(op1->type)
6736 op1->type->refCount++;
6737 }
6738 return 1;
6739 }
6740
6741 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6742 {
6743 double value2 = op2->__anon1.d;
6744
6745 exp->type = 2;
6746 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
6747 if(!exp->expType)
6748 {
6749 exp->expType = op1->type;
6750 if(op1->type)
6751 op1->type->refCount++;
6752 }
6753 return 1;
6754 }
6755
6756 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6757 {
6758 int value2 = op2->__anon1.i;
6759
6760 exp->type = 2;
6761 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
6762 if(!exp->expType)
6763 {
6764 exp->expType = op1->type;
6765 if(op1->type)
6766 op1->type->refCount++;
6767 }
6768 return 1;
6769 }
6770
6771 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6772 {
6773 unsigned int value2 = op2->__anon1.ui;
6774
6775 exp->type = 2;
6776 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
6777 if(!exp->expType)
6778 {
6779 exp->expType = op1->type;
6780 if(op1->type)
6781 op1->type->refCount++;
6782 }
6783 return 1;
6784 }
6785
6786 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6787 {
6788 long long value2 = op2->__anon1.i64;
6789
6790 exp->type = 2;
6791 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
6792 if(!exp->expType)
6793 {
6794 exp->expType = op1->type;
6795 if(op1->type)
6796 op1->type->refCount++;
6797 }
6798 return 1;
6799 }
6800
6801 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6802 {
6803 uint64 value2 = op2->__anon1.ui64;
6804
6805 exp->type = 2;
6806 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
6807 if(!exp->expType)
6808 {
6809 exp->expType = op1->type;
6810 if(op1->type)
6811 op1->type->refCount++;
6812 }
6813 return 1;
6814 }
6815
6816 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6817 {
6818 short value2 = op2->__anon1.s;
6819
6820 exp->type = 2;
6821 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
6822 if(!exp->expType)
6823 {
6824 exp->expType = op1->type;
6825 if(op1->type)
6826 op1->type->refCount++;
6827 }
6828 return 1;
6829 }
6830
6831 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6832 {
6833 unsigned short value2 = op2->__anon1.us;
6834
6835 exp->type = 2;
6836 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
6837 if(!exp->expType)
6838 {
6839 exp->expType = op1->type;
6840 if(op1->type)
6841 op1->type->refCount++;
6842 }
6843 return 1;
6844 }
6845
6846 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6847 {
6848 char value2 = op2->__anon1.c;
6849
6850 exp->type = 2;
6851 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
6852 if(!exp->expType)
6853 {
6854 exp->expType = op1->type;
6855 if(op1->type)
6856 op1->type->refCount++;
6857 }
6858 return 1;
6859 }
6860
6861 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6862 {
6863 unsigned char value2 = op2->__anon1.uc;
6864
6865 exp->type = 2;
6866 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
6867 if(!exp->expType)
6868 {
6869 exp->expType = op1->type;
6870 if(op1->type)
6871 op1->type->refCount++;
6872 }
6873 return 1;
6874 }
6875
6876 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6877 {
6878 float value2 = op2->__anon1.f;
6879
6880 exp->type = 2;
6881 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
6882 if(!exp->expType)
6883 {
6884 exp->expType = op1->type;
6885 if(op1->type)
6886 op1->type->refCount++;
6887 }
6888 return 1;
6889 }
6890
6891 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6892 {
6893 double value2 = op2->__anon1.d;
6894
6895 exp->type = 2;
6896 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
6897 if(!exp->expType)
6898 {
6899 exp->expType = op1->type;
6900 if(op1->type)
6901 op1->type->refCount++;
6902 }
6903 return 1;
6904 }
6905
6906 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6907 {
6908 int value2 = op2->__anon1.i;
6909
6910 exp->type = 2;
6911 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
6912 if(!exp->expType)
6913 {
6914 exp->expType = op1->type;
6915 if(op1->type)
6916 op1->type->refCount++;
6917 }
6918 return 1;
6919 }
6920
6921 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6922 {
6923 unsigned int value2 = op2->__anon1.ui;
6924
6925 exp->type = 2;
6926 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
6927 if(!exp->expType)
6928 {
6929 exp->expType = op1->type;
6930 if(op1->type)
6931 op1->type->refCount++;
6932 }
6933 return 1;
6934 }
6935
6936 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6937 {
6938 long long value2 = op2->__anon1.i64;
6939
6940 exp->type = 2;
6941 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
6942 if(!exp->expType)
6943 {
6944 exp->expType = op1->type;
6945 if(op1->type)
6946 op1->type->refCount++;
6947 }
6948 return 1;
6949 }
6950
6951 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6952 {
6953 uint64 value2 = op2->__anon1.ui64;
6954
6955 exp->type = 2;
6956 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
6957 if(!exp->expType)
6958 {
6959 exp->expType = op1->type;
6960 if(op1->type)
6961 op1->type->refCount++;
6962 }
6963 return 1;
6964 }
6965
6966 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6967 {
6968 short value2 = op2->__anon1.s;
6969
6970 exp->type = 2;
6971 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
6972 if(!exp->expType)
6973 {
6974 exp->expType = op1->type;
6975 if(op1->type)
6976 op1->type->refCount++;
6977 }
6978 return 1;
6979 }
6980
6981 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6982 {
6983 unsigned short value2 = op2->__anon1.us;
6984
6985 exp->type = 2;
6986 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
6987 if(!exp->expType)
6988 {
6989 exp->expType = op1->type;
6990 if(op1->type)
6991 op1->type->refCount++;
6992 }
6993 return 1;
6994 }
6995
6996 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6997 {
6998 char value2 = op2->__anon1.c;
6999
7000 exp->type = 2;
7001 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
7002 if(!exp->expType)
7003 {
7004 exp->expType = op1->type;
7005 if(op1->type)
7006 op1->type->refCount++;
7007 }
7008 return 1;
7009 }
7010
7011 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7012 {
7013 unsigned char value2 = op2->__anon1.uc;
7014
7015 exp->type = 2;
7016 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
7017 if(!exp->expType)
7018 {
7019 exp->expType = op1->type;
7020 if(op1->type)
7021 op1->type->refCount++;
7022 }
7023 return 1;
7024 }
7025
7026 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7027 {
7028 float value2 = op2->__anon1.f;
7029
7030 exp->type = 2;
7031 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
7032 if(!exp->expType)
7033 {
7034 exp->expType = op1->type;
7035 if(op1->type)
7036 op1->type->refCount++;
7037 }
7038 return 1;
7039 }
7040
7041 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7042 {
7043 double value2 = op2->__anon1.d;
7044
7045 exp->type = 2;
7046 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
7047 if(!exp->expType)
7048 {
7049 exp->expType = op1->type;
7050 if(op1->type)
7051 op1->type->refCount++;
7052 }
7053 return 1;
7054 }
7055
7056 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7057 {
7058 exp->type = 2;
7059 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
7060 if(!exp->expType)
7061 {
7062 exp->expType = op1->type;
7063 if(op1->type)
7064 op1->type->refCount++;
7065 }
7066 return 1;
7067 }
7068
7069 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7070 {
7071 exp->type = 2;
7072 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
7073 if(!exp->expType)
7074 {
7075 exp->expType = op1->type;
7076 if(op1->type)
7077 op1->type->refCount++;
7078 }
7079 return 1;
7080 }
7081
7082 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7083 {
7084 exp->type = 2;
7085 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
7086 if(!exp->expType)
7087 {
7088 exp->expType = op1->type;
7089 if(op1->type)
7090 op1->type->refCount++;
7091 }
7092 return 1;
7093 }
7094
7095 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7096 {
7097 exp->type = 2;
7098 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
7099 if(!exp->expType)
7100 {
7101 exp->expType = op1->type;
7102 if(op1->type)
7103 op1->type->refCount++;
7104 }
7105 return 1;
7106 }
7107
7108 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7109 {
7110 exp->type = 2;
7111 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
7112 if(!exp->expType)
7113 {
7114 exp->expType = op1->type;
7115 if(op1->type)
7116 op1->type->refCount++;
7117 }
7118 return 1;
7119 }
7120
7121 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7122 {
7123 exp->type = 2;
7124 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
7125 if(!exp->expType)
7126 {
7127 exp->expType = op1->type;
7128 if(op1->type)
7129 op1->type->refCount++;
7130 }
7131 return 1;
7132 }
7133
7134 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7135 {
7136 exp->type = 2;
7137 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
7138 if(!exp->expType)
7139 {
7140 exp->expType = op1->type;
7141 if(op1->type)
7142 op1->type->refCount++;
7143 }
7144 return 1;
7145 }
7146
7147 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7148 {
7149 exp->type = 2;
7150 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
7151 if(!exp->expType)
7152 {
7153 exp->expType = op1->type;
7154 if(op1->type)
7155 op1->type->refCount++;
7156 }
7157 return 1;
7158 }
7159
7160 static void PrintName(struct Type * type, char * string, unsigned int fullName)
7161 {
7162 if(type->name && type->name[0])
7163 {
7164 if(fullName)
7165 strcat(string, type->name);
7166 else
7167 {
7168 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
7169
7170 if(name)
7171 name += 2;
7172 else
7173 name = type->name;
7174 strcat(string, name);
7175 }
7176 }
7177 }
7178
7179 static void PrintAttribs(struct Type * type, char * string)
7180 {
7181 if(type)
7182 {
7183 if(type->dllExport)
7184 strcat(string, "dllexport ");
7185 if(type->attrStdcall)
7186 strcat(string, "stdcall ");
7187 }
7188 }
7189
7190 static struct Type * FindMember(struct Type * type, char * string)
7191 {
7192 struct Type * memberType;
7193
7194 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7195 {
7196 if(!memberType->name)
7197 {
7198 struct Type * subType = FindMember(memberType, string);
7199
7200 if(subType)
7201 return subType;
7202 }
7203 else if(!strcmp(memberType->name, string))
7204 return memberType;
7205 }
7206 return (((void *)0));
7207 }
7208
7209 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
7210
7211 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
7212
7213 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
7214 {
7215 unsigned int result = 0;
7216
7217 switch(kind)
7218 {
7219 case 2:
7220 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
7221 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
7222 break;
7223 case 3:
7224 case 5:
7225 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
7226 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7227 break;
7228 case 4:
7229 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)
7230 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7231 break;
7232 case 6:
7233 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)
7234 result = GetOpFloat(op, &op->__anon1.f);
7235 break;
7236 case 7:
7237 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)
7238 result = GetOpDouble(op, &op->__anon1.d);
7239 break;
7240 case 13:
7241 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)
7242 result = GetOpUInt64(op, &op->__anon1.ui64);
7243 break;
7244 case 15:
7245 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)
7246 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7247 break;
7248 case 22:
7249 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7250 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7251 break;
7252 case 23:
7253 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7254 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7255 break;
7256 }
7257 return result;
7258 }
7259
7260 struct OpTable floatOps =
7261 {
7262 (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)
7263 };
7264
7265 struct OpTable doubleOps =
7266 {
7267 (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)
7268 };
7269
7270 struct OpTable intOps =
7271 {
7272 (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)
7273 };
7274
7275 struct OpTable uintOps =
7276 {
7277 (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)
7278 };
7279
7280 struct OpTable int64Ops =
7281 {
7282 (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)
7283 };
7284
7285 struct OpTable uint64Ops =
7286 {
7287 (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)
7288 };
7289
7290 struct OpTable shortOps =
7291 {
7292 (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)
7293 };
7294
7295 struct OpTable ushortOps =
7296 {
7297 (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)
7298 };
7299
7300 struct OpTable charOps =
7301 {
7302 (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)
7303 };
7304
7305 struct OpTable ucharOps =
7306 {
7307 (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)
7308 };
7309
7310 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
7311 {
7312 struct Type * memberType;
7313
7314 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7315 {
7316 if(!memberType->name)
7317 {
7318 struct Type * subType = FindMember(memberType, string);
7319
7320 if(subType)
7321 {
7322 *offset += memberType->offset;
7323 return subType;
7324 }
7325 }
7326 else if(!strcmp(memberType->name, string))
7327 {
7328 *offset += memberType->offset;
7329 return memberType;
7330 }
7331 }
7332 return (((void *)0));
7333 }
7334
7335 struct __ecereNameSpace__ecere__com__Module;
7336
7337 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);
7338
7339 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
7340
7341 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);
7342
7343 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);
7344
7345 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
7346
7347 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7348
7349 struct GlobalData
7350 {
7351 uintptr_t key;
7352 struct __ecereNameSpace__ecere__sys__BTNode * parent;
7353 struct __ecereNameSpace__ecere__sys__BTNode * left;
7354 struct __ecereNameSpace__ecere__sys__BTNode * right;
7355 int depth;
7356 struct __ecereNameSpace__ecere__com__Instance * module;
7357 char *  dataTypeString;
7358 struct Type * dataType;
7359 void *  symbol;
7360 char *  fullName;
7361 } ecere_gcc_struct;
7362
7363 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);
7364
7365 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
7366
7367 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);
7368
7369 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
7370
7371 struct __ecereNameSpace__ecere__com__DefinedExpression;
7372
7373 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7374
7375 struct __ecereNameSpace__ecere__com__DefinedExpression
7376 {
7377 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
7378 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
7379 const char *  name;
7380 const char *  value;
7381 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7382 } ecere_gcc_struct;
7383
7384 struct __ecereNameSpace__ecere__sys__BinaryTree;
7385
7386 struct __ecereNameSpace__ecere__sys__BinaryTree
7387 {
7388 struct __ecereNameSpace__ecere__sys__BTNode * root;
7389 int count;
7390 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
7391 void (*  FreeKey)(void *  key);
7392 } ecere_gcc_struct;
7393
7394 struct __ecereNameSpace__ecere__com__Class
7395 {
7396 struct __ecereNameSpace__ecere__com__Class * prev;
7397 struct __ecereNameSpace__ecere__com__Class * next;
7398 const char *  name;
7399 int offset;
7400 int structSize;
7401 void * *  _vTbl;
7402 int vTblSize;
7403 unsigned int (*  Constructor)(void * );
7404 void (*  Destructor)(void * );
7405 int offsetClass;
7406 int sizeClass;
7407 struct __ecereNameSpace__ecere__com__Class * base;
7408 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
7409 struct __ecereNameSpace__ecere__sys__BinaryTree members;
7410 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
7411 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
7412 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
7413 struct __ecereNameSpace__ecere__sys__OldList derivatives;
7414 int memberID;
7415 int startMemberID;
7416 int type;
7417 struct __ecereNameSpace__ecere__com__Instance * module;
7418 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7419 const char *  dataTypeString;
7420 struct Type * dataType;
7421 int typeSize;
7422 int defaultAlignment;
7423 void (*  Initialize)();
7424 int memberOffset;
7425 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
7426 const char *  designerClass;
7427 unsigned int noExpansion;
7428 const char *  defaultProperty;
7429 unsigned int comRedefinition;
7430 int count;
7431 int isRemote;
7432 unsigned int internalDecl;
7433 void *  data;
7434 unsigned int computeSize;
7435 short structAlignment;
7436 short pointerAlignment;
7437 int destructionWatchOffset;
7438 unsigned int fixed;
7439 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
7440 int inheritanceAccess;
7441 const char *  fullName;
7442 void *  symbol;
7443 struct __ecereNameSpace__ecere__sys__OldList conversions;
7444 struct __ecereNameSpace__ecere__sys__OldList templateParams;
7445 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
7446 struct __ecereNameSpace__ecere__com__Class * templateClass;
7447 struct __ecereNameSpace__ecere__sys__OldList templatized;
7448 int numParams;
7449 unsigned int isInstanceClass;
7450 unsigned int byValueSystemClass;
7451 } ecere_gcc_struct;
7452
7453 struct __ecereNameSpace__ecere__com__NameSpace
7454 {
7455 const char *  name;
7456 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
7457 struct __ecereNameSpace__ecere__com__NameSpace *  left;
7458 struct __ecereNameSpace__ecere__com__NameSpace *  right;
7459 int depth;
7460 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
7461 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
7462 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
7463 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
7464 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
7465 } ecere_gcc_struct;
7466
7467 struct __ecereNameSpace__ecere__com__DataMember
7468 {
7469 struct __ecereNameSpace__ecere__com__DataMember * prev;
7470 struct __ecereNameSpace__ecere__com__DataMember * next;
7471 const char *  name;
7472 unsigned int isProperty;
7473 int memberAccess;
7474 int id;
7475 struct __ecereNameSpace__ecere__com__Class * _class;
7476 const char *  dataTypeString;
7477 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
7478 struct Type * dataType;
7479 int type;
7480 int offset;
7481 int memberID;
7482 struct __ecereNameSpace__ecere__sys__OldList members;
7483 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
7484 int memberOffset;
7485 short structAlignment;
7486 short pointerAlignment;
7487 } ecere_gcc_struct;
7488
7489 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7490
7491 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7492
7493 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
7494
7495 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7496
7497 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7498
7499 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
7500
7501 static void _DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl)
7502 {
7503 if(inCompiler)
7504 {
7505 if(type->kind == 11)
7506 {
7507 struct Type * param;
7508
7509 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
7510 _DeclareType(neededFor, param, forFunctionDef, 0, fwdDecl);
7511 _DeclareType(neededFor, type->__anon1.__anon2.returnType, forFunctionDef, 0, fwdDecl);
7512 }
7513 else if(type->kind == 13)
7514 _DeclareType(neededFor, type->__anon1.type, 0, 0, fwdDecl);
7515 else if(type->kind == 8)
7516 {
7517 struct __ecereNameSpace__ecere__com__Class * c = type->__anon1._class->__anon1.registered;
7518
7519 _DeclareStruct(neededFor, c ? c->fullName : "ecere::com::Instance", c ? c->type == 5 : 0, needDereference && c && c->type == 1, fwdDecl);
7520 }
7521 else if(type->kind == 9 || type->kind == 10)
7522 {
7523 struct Type * member;
7524
7525 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7526 _DeclareType(neededFor, member, needDereference, forFunctionDef, fwdDecl);
7527 }
7528 else if(type->kind == 12)
7529 _DeclareType(neededFor, type->__anon1.__anon4.arrayType, 1, 0, fwdDecl);
7530 }
7531 }
7532
7533 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
7534 {
7535 unsigned int status = 1;
7536
7537 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))
7538 {
7539 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
7540 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
7541
7542 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
7543 {
7544 struct Type * sourceType = source, * destType = dest;
7545
7546 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
7547 sourceType = sourceType->__anon1.type;
7548 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
7549 destType = destType->__anon1.type;
7550 if(!destType->constant && sourceType->constant)
7551 {
7552 status = 0;
7553 if(warn)
7554 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
7555 }
7556 }
7557 }
7558 return status;
7559 }
7560
7561 struct Operand GetOperand(struct Expression * exp)
7562 {
7563 struct Operand op =
7564 {
7565 0, 0, 0,
7566 .__anon1 = {
7567 .c = 0
7568 },
7569 {
7570 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7571 }
7572 };
7573 struct Type * type = exp->expType;
7574
7575 if(type)
7576 {
7577 while(type->kind == 8 && type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 2 || type->__anon1._class->__anon1.registered->type == 3 || type->__anon1._class->__anon1.registered->type == 4))
7578 {
7579 if(!type->__anon1._class->__anon1.registered->dataType)
7580 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7581 type = type->__anon1._class->__anon1.registered->dataType;
7582 }
7583 if(exp->type == 3 && op.kind == 13)
7584 {
7585 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
7586 op.kind = 13;
7587 op.ops = uint64Ops;
7588 }
7589 else if(exp->isConstant && exp->type == 2)
7590 {
7591 op.kind = type->kind;
7592 op.type = type;
7593 switch(op.kind)
7594 {
7595 case 24:
7596 case 1:
7597 {
7598 if(exp->__anon1.__anon1.constant[0] == '\'')
7599 {
7600 op.__anon1.c = exp->__anon1.__anon1.constant[1];
7601 op.ops = charOps;
7602 }
7603 else if(type->isSigned)
7604 {
7605 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7606 op.ops = charOps;
7607 }
7608 else
7609 {
7610 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7611 op.ops = ucharOps;
7612 }
7613 break;
7614 }
7615 case 2:
7616 if(exp->__anon1.__anon1.constant[0] == '\'')
7617 {
7618 op.__anon1.s = exp->__anon1.__anon1.constant[1];
7619 op.ops = shortOps;
7620 }
7621 else if(type->isSigned)
7622 {
7623 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7624 op.ops = shortOps;
7625 }
7626 else
7627 {
7628 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7629 op.ops = ushortOps;
7630 }
7631 break;
7632 case 3:
7633 case 5:
7634 if(exp->__anon1.__anon1.constant[0] == '\'')
7635 {
7636 op.__anon1.i = exp->__anon1.__anon1.constant[1];
7637 op.ops = intOps;
7638 }
7639 else if(type->isSigned)
7640 {
7641 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7642 op.ops = intOps;
7643 }
7644 else
7645 {
7646 op.__anon1.ui = (unsigned int)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7647 op.ops = uintOps;
7648 }
7649 op.kind = 3;
7650 break;
7651 case 4:
7652 if(type->isSigned)
7653 {
7654 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7655 op.ops = int64Ops;
7656 }
7657 else
7658 {
7659 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7660 op.ops = uint64Ops;
7661 }
7662 op.kind = 4;
7663 break;
7664 case 22:
7665 if(type->isSigned)
7666 {
7667 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7668 op.ops = int64Ops;
7669 }
7670 else
7671 {
7672 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7673 op.ops = uint64Ops;
7674 }
7675 op.kind = 4;
7676 break;
7677 case 23:
7678 if(type->isSigned)
7679 {
7680 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7681 op.ops = int64Ops;
7682 }
7683 else
7684 {
7685 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7686 op.ops = uint64Ops;
7687 }
7688 op.kind = 4;
7689 break;
7690 case 6:
7691 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7692 op.__anon1.f = __ecereMethod_float_inf();
7693 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7694 op.__anon1.f = -__ecereMethod_float_inf();
7695 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7696 op.__anon1.f = __ecereMethod_float_nan();
7697 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7698 op.__anon1.f = -__ecereMethod_float_nan();
7699 else
7700 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7701 op.ops = floatOps;
7702 break;
7703 case 7:
7704 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7705 op.__anon1.d = __ecereMethod_double_inf();
7706 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7707 op.__anon1.d = -__ecereMethod_double_inf();
7708 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7709 op.__anon1.d = __ecereMethod_double_nan();
7710 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7711 op.__anon1.d = -__ecereMethod_double_nan();
7712 else
7713 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7714 op.ops = doubleOps;
7715 break;
7716 case 12:
7717 case 13:
7718 case 8:
7719 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7720 op.kind = 13;
7721 op.ops = uint64Ops;
7722 break;
7723 }
7724 }
7725 }
7726 return op;
7727 }
7728
7729 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
7730 {
7731 long long v = 0;
7732
7733 switch(_class->typeSize)
7734 {
7735 case 8:
7736 if(!strcmp(_class->dataTypeString, "uint64"))
7737 v = (long long)*(uint64 *)ptr;
7738 else
7739 v = *(long long *)ptr;
7740 break;
7741 case 4:
7742 if(!strcmp(_class->dataTypeString, "uint"))
7743 v = (long long)*(unsigned int *)ptr;
7744 else
7745 v = (long long)*(int *)ptr;
7746 break;
7747 case 2:
7748 if(!strcmp(_class->dataTypeString, "uint16"))
7749 v = (long long)*(unsigned short *)ptr;
7750 else
7751 v = (long long)*(short *)ptr;
7752 break;
7753 case 1:
7754 if(!strcmp(_class->dataTypeString, "byte"))
7755 v = (long long)*(unsigned char *)ptr;
7756 else
7757 v = (long long)*(char *)ptr;
7758 break;
7759 }
7760 return v;
7761 }
7762
7763 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
7764 {
7765 if(!type->isSigned && type->kind != 22 && type->kind != 23)
7766 ListAdd(specs, MkSpecifier(UNSIGNED));
7767 switch(type->kind)
7768 {
7769 case 8:
7770 {
7771 if(type->__anon1._class->__anon1.registered)
7772 {
7773 if(!type->__anon1._class->__anon1.registered->dataType)
7774 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7775 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
7776 }
7777 break;
7778 }
7779 case 7:
7780 ListAdd(specs, MkSpecifier(DOUBLE));
7781 break;
7782 case 6:
7783 ListAdd(specs, MkSpecifier(FLOAT));
7784 break;
7785 case 1:
7786 ListAdd(specs, MkSpecifier(CHAR));
7787 break;
7788 case 24:
7789 ListAdd(specs, MkSpecifier(_BOOL));
7790 break;
7791 case 2:
7792 ListAdd(specs, MkSpecifier(SHORT));
7793 break;
7794 case 4:
7795 ListAdd(specs, MkSpecifier(INT64));
7796 break;
7797 case 22:
7798 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
7799 break;
7800 case 23:
7801 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
7802 break;
7803 case 3:
7804 default:
7805 ListAdd(specs, MkSpecifier(INT));
7806 break;
7807 }
7808 }
7809
7810 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
7811 {
7812 if(type)
7813 {
7814 if(printConst && type->constant)
7815 strcat(string, "const ");
7816 switch(type->kind)
7817 {
7818 case 8:
7819 {
7820 struct Symbol * c = type->__anon1._class;
7821 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
7822
7823 if(type->classObjectType == 2 && isObjectBaseClass)
7824 strcat(string, "typed_object");
7825 else if(type->classObjectType == 3 && isObjectBaseClass)
7826 strcat(string, "any_object");
7827 else
7828 {
7829 if(c && c->string)
7830 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
7831 }
7832 if(type->byReference)
7833 strcat(string, " &");
7834 break;
7835 }
7836 case 0:
7837 strcat(string, "void");
7838 break;
7839 case 3:
7840 strcat(string, type->isSigned ? "int" : "uint");
7841 break;
7842 case 4:
7843 strcat(string, type->isSigned ? "int64" : "uint64");
7844 break;
7845 case 22:
7846 strcat(string, type->isSigned ? "intptr" : "uintptr");
7847 break;
7848 case 23:
7849 strcat(string, type->isSigned ? "intsize" : "uintsize");
7850 break;
7851 case 1:
7852 strcat(string, type->isSigned ? "char" : "byte");
7853 break;
7854 case 24:
7855 strcat(string, "_Bool");
7856 break;
7857 case 2:
7858 strcat(string, type->isSigned ? "short" : "uint16");
7859 break;
7860 case 6:
7861 strcat(string, "float");
7862 break;
7863 case 7:
7864 strcat(string, "double");
7865 break;
7866 case 9:
7867 if(type->__anon1.__anon1.enumName)
7868 {
7869 strcat(string, "struct ");
7870 strcat(string, type->__anon1.__anon1.enumName);
7871 }
7872 else if(type->typeName)
7873 strcat(string, type->typeName);
7874 else
7875 {
7876 struct Type * member;
7877
7878 strcat(string, "struct { ");
7879 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7880 {
7881 PrintType(member, string, 1, fullName);
7882 strcat(string, "; ");
7883 }
7884 strcat(string, "}");
7885 }
7886 break;
7887 case 10:
7888 if(type->__anon1.__anon1.enumName)
7889 {
7890 strcat(string, "union ");
7891 strcat(string, type->__anon1.__anon1.enumName);
7892 }
7893 else if(type->typeName)
7894 strcat(string, type->typeName);
7895 else
7896 {
7897 strcat(string, "union ");
7898 strcat(string, "(unnamed)");
7899 }
7900 break;
7901 case 15:
7902 if(type->__anon1.__anon1.enumName)
7903 {
7904 strcat(string, "enum ");
7905 strcat(string, type->__anon1.__anon1.enumName);
7906 }
7907 else if(type->typeName)
7908 strcat(string, type->typeName);
7909 else
7910 strcat(string, "int");
7911 break;
7912 case 14:
7913 strcat(string, "...");
7914 break;
7915 case 19:
7916 strcat(string, "subclass(");
7917 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
7918 strcat(string, ")");
7919 break;
7920 case 20:
7921 strcat(string, type->__anon1.templateParameter->identifier->string);
7922 break;
7923 case 21:
7924 strcat(string, "thisclass");
7925 break;
7926 case 17:
7927 strcat(string, "__builtin_va_list");
7928 break;
7929 }
7930 }
7931 }
7932
7933 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
7934
7935 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
7936
7937 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
7938
7939 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
7940
7941 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
7942
7943 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
7944
7945 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
7946
7947 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
7948
7949 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
7950
7951 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
7952
7953 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
7954
7955 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
7956
7957 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
7958
7959 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
7960
7961 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
7962
7963 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
7964
7965 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
7966
7967 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
7968
7969 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
7970
7971 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
7972
7973 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
7974
7975 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
7976
7977 struct __ecereNameSpace__ecere__com__Application
7978 {
7979 int argc;
7980 const char * *  argv;
7981 int exitCode;
7982 unsigned int isGUIApp;
7983 struct __ecereNameSpace__ecere__sys__OldList allModules;
7984 char *  parsedCommand;
7985 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
7986 } ecere_gcc_struct;
7987
7988 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)
7989 {
7990 if(*curMember)
7991 {
7992 *curMember = (*curMember)->next;
7993 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
7994 {
7995 *curMember = subMemberStack[--(*subMemberStackPos)];
7996 *curMember = (*curMember)->next;
7997 }
7998 while((*curMember) && (*curMember)->isProperty)
7999 *curMember = (*curMember)->next;
8000 if(subMemberStackPos)
8001 {
8002 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8003 {
8004 subMemberStack[(*subMemberStackPos)++] = *curMember;
8005 *curMember = (*curMember)->members.first;
8006 while(*curMember && (*curMember)->isProperty)
8007 *curMember = (*curMember)->next;
8008 }
8009 }
8010 }
8011 while(!*curMember)
8012 {
8013 if(!*curMember)
8014 {
8015 if(subMemberStackPos && *subMemberStackPos)
8016 {
8017 *curMember = subMemberStack[--(*subMemberStackPos)];
8018 *curMember = (*curMember)->next;
8019 }
8020 else
8021 {
8022 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
8023
8024 if(*curClass == _class)
8025 break;
8026 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
8027 ;
8028 *curMember = (*curClass)->membersAndProperties.first;
8029 }
8030 while((*curMember) && (*curMember)->isProperty)
8031 *curMember = (*curMember)->next;
8032 if(subMemberStackPos)
8033 {
8034 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8035 {
8036 subMemberStack[(*subMemberStackPos)++] = *curMember;
8037 *curMember = (*curMember)->members.first;
8038 while(*curMember && (*curMember)->isProperty)
8039 *curMember = (*curMember)->next;
8040 }
8041 }
8042 }
8043 }
8044 }
8045
8046 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
8047 {
8048 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
8049 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
8050 struct __ecereNameSpace__ecere__com__NameSpace * child;
8051
8052 if(!data)
8053 {
8054 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)))
8055 {
8056 data = ScanGlobalData(child, name);
8057 if(data)
8058 break;
8059 }
8060 }
8061 return data;
8062 }
8063
8064 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
8065 {
8066 int nsLen = strlen(nameSpace);
8067 struct Symbol * symbol;
8068
8069 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)))
8070 {
8071 char * s = symbol->string;
8072
8073 if(!strncmp(s, nameSpace, nsLen))
8074 {
8075 int c;
8076 char * namePart;
8077
8078 for(c = strlen(s) - 1; c >= 0; c--)
8079 if(s[c] == ':')
8080 break;
8081 namePart = s + c + 1;
8082 if(!strcmp(namePart, name))
8083 {
8084 return symbol;
8085 }
8086 }
8087 else
8088 break;
8089 }
8090 return (((void *)0));
8091 }
8092
8093 unsigned int GetInt(struct Expression * exp, int * value2)
8094 {
8095 struct Operand op2 = GetOperand(exp);
8096
8097 return GetOpInt(&op2, value2);
8098 }
8099
8100 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
8101 {
8102 struct Operand op2 = GetOperand(exp);
8103
8104 return GetOpUInt(&op2, value2);
8105 }
8106
8107 unsigned int GetInt64(struct Expression * exp, long long * value2)
8108 {
8109 struct Operand op2 = GetOperand(exp);
8110
8111 return GetOpInt64(&op2, value2);
8112 }
8113
8114 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
8115 {
8116 struct Operand op2 = GetOperand(exp);
8117
8118 return GetOpUInt64(&op2, value2);
8119 }
8120
8121 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
8122 {
8123 struct Operand op2 = GetOperand(exp);
8124
8125 return GetOpIntPtr(&op2, value2);
8126 }
8127
8128 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
8129 {
8130 struct Operand op2 = GetOperand(exp);
8131
8132 return GetOpUIntPtr(&op2, value2);
8133 }
8134
8135 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
8136 {
8137 struct Operand op2 = GetOperand(exp);
8138
8139 return GetOpIntSize(&op2, value2);
8140 }
8141
8142 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
8143 {
8144 struct Operand op2 = GetOperand(exp);
8145
8146 return GetOpUIntSize(&op2, value2);
8147 }
8148
8149 unsigned int GetShort(struct Expression * exp, short * value2)
8150 {
8151 struct Operand op2 = GetOperand(exp);
8152
8153 return GetOpShort(&op2, value2);
8154 }
8155
8156 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
8157 {
8158 struct Operand op2 = GetOperand(exp);
8159
8160 return GetOpUShort(&op2, value2);
8161 }
8162
8163 unsigned int GetChar(struct Expression * exp, char * value2)
8164 {
8165 struct Operand op2 = GetOperand(exp);
8166
8167 return GetOpChar(&op2, value2);
8168 }
8169
8170 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
8171 {
8172 struct Operand op2 = GetOperand(exp);
8173
8174 return GetOpUChar(&op2, value2);
8175 }
8176
8177 unsigned int GetFloat(struct Expression * exp, float * value2)
8178 {
8179 struct Operand op2 = GetOperand(exp);
8180
8181 return GetOpFloat(&op2, value2);
8182 }
8183
8184 unsigned int GetDouble(struct Expression * exp, double * value2)
8185 {
8186 struct Operand op2 = GetOperand(exp);
8187
8188 return GetOpDouble(&op2, value2);
8189 }
8190
8191 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
8192 {
8193 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8194 {
8195 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
8196 PrintAttribs(type, string);
8197 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
8198 strcat(string, " const");
8199 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
8200 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8201 strcat(string, " (");
8202 if(type->kind == 13)
8203 {
8204 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
8205 PrintAttribs(type->__anon1.type, string);
8206 }
8207 if(type->kind == 13)
8208 {
8209 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
8210 strcat(string, "*");
8211 else
8212 strcat(string, " *");
8213 }
8214 if(printConst && type->constant && type->kind == 13)
8215 strcat(string, " const");
8216 }
8217 else
8218 PrintTypeSpecs(type, string, fullName, printConst);
8219 }
8220
8221 void PrintExpression(struct Expression * exp, char * string)
8222 {
8223 {
8224 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8225 int count;
8226 unsigned int backOutputLineNumbers = outputLineNumbers;
8227
8228 outputLineNumbers = 0;
8229 if(exp)
8230 OutputExpression(exp, f);
8231 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8232 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8233
8234 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8235 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
8236 count = strlen(string);
8237 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8238 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8239
8240 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8241 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
8242 string[count] = '\0';
8243 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
8244 outputLineNumbers = backOutputLineNumbers;
8245 }
8246 }
8247
8248 struct Type * Dereference(struct Type * source)
8249 {
8250 struct Type * type = (((void *)0));
8251
8252 if(source)
8253 {
8254 if(source->kind == 13 || source->kind == 12)
8255 {
8256 type = source->__anon1.type;
8257 source->__anon1.type->refCount++;
8258 }
8259 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
8260 {
8261 type = __extension__ ({
8262 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8263
8264 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
8265 });
8266 }
8267 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
8268 {
8269 type = source;
8270 source->refCount++;
8271 }
8272 else
8273 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
8274 }
8275 return type;
8276 }
8277
8278 static struct Type * Reference(struct Type * source)
8279 {
8280 struct Type * type = (((void *)0));
8281
8282 if(source)
8283 {
8284 type = __extension__ ({
8285 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8286
8287 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
8288 });
8289 source->refCount++;
8290 }
8291 return type;
8292 }
8293
8294 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
8295 {
8296 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
8297
8298 FreeExpContents(checkedExp);
8299 FreeType(checkedExp->expType);
8300 FreeType(checkedExp->destType);
8301 *checkedExp = *newExp;
8302 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
8303 checkedExp->prev = prev;
8304 checkedExp->next = next;
8305 }
8306
8307 void FinishTemplatesContext(struct Context * context)
8308 {
8309 PopContext(context);
8310 FreeContext(context);
8311 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
8312 }
8313
8314 static __attribute__((unused)) void UnusedFunction()
8315 {
8316 int a;
8317
8318 ((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);
8319 }
8320
8321 struct Expression * ParseExpressionString(char * expression)
8322 {
8323 parseError = 0;
8324 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8325 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8326 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8327
8328 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8329 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
8330 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8331 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8332
8333 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8334 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
8335 echoOn = 0;
8336 parsedExpression = (((void *)0));
8337 resetScanner();
8338 expression_yyparse();
8339 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
8340 return parsedExpression;
8341 }
8342
8343 struct __ecereNameSpace__ecere__com__Module
8344 {
8345 struct __ecereNameSpace__ecere__com__Instance * application;
8346 struct __ecereNameSpace__ecere__sys__OldList classes;
8347 struct __ecereNameSpace__ecere__sys__OldList defines;
8348 struct __ecereNameSpace__ecere__sys__OldList functions;
8349 struct __ecereNameSpace__ecere__sys__OldList modules;
8350 struct __ecereNameSpace__ecere__com__Instance * prev;
8351 struct __ecereNameSpace__ecere__com__Instance * next;
8352 const char *  name;
8353 void *  library;
8354 void *  Unload;
8355 int importType;
8356 int origImportType;
8357 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
8358 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
8359 } ecere_gcc_struct;
8360
8361 static struct GlobalData * FindGlobalData(char * name)
8362 {
8363 int start = 0, c;
8364 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
8365
8366 nameSpace = globalData;
8367 for(c = 0; name[c]; c++)
8368 {
8369 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
8370 {
8371 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
8372 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
8373
8374 strncpy(spaceName, name + start, c - start);
8375 spaceName[c - start] = '\0';
8376 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
8377 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
8378 if(!newSpace)
8379 return (((void *)0));
8380 nameSpace = newSpace;
8381 if(name[c] == ':')
8382 c++;
8383 start = c + 1;
8384 }
8385 }
8386 if(c - start)
8387 {
8388 return ScanGlobalData(nameSpace, name + start);
8389 }
8390 return (((void *)0));
8391 }
8392
8393 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
8394 {
8395 int c;
8396 char nameSpace[1024];
8397 const char * namePart;
8398 unsigned int gotColon = 0;
8399
8400 nameSpace[0] = '\0';
8401 for(c = strlen(name) - 1; c >= 0; c--)
8402 if(name[c] == ':')
8403 {
8404 gotColon = 1;
8405 break;
8406 }
8407 namePart = name + c + 1;
8408 while(c >= 0 && name[c] == ':')
8409 c--;
8410 if(c >= 0)
8411 {
8412 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
8413
8414 if(symbol)
8415 return symbol;
8416 memcpy(nameSpace, name, c + 1);
8417 nameSpace[c + 1] = 0;
8418 return ScanWithNameSpace(tree, nameSpace, namePart);
8419 }
8420 else if(gotColon)
8421 {
8422 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8423
8424 return symbol;
8425 }
8426 else
8427 {
8428 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8429
8430 if(symbol)
8431 return symbol;
8432 return ScanWithNameSpace(tree, "", namePart);
8433 }
8434 return (((void *)0));
8435 }
8436
8437 static void PrintArraySize(struct Type * arrayType, char * string)
8438 {
8439 char size[256];
8440
8441 size[0] = '\0';
8442 strcat(size, "[");
8443 if(arrayType->__anon1.__anon4.enumClass)
8444 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
8445 else if(arrayType->__anon1.__anon4.arraySizeExp)
8446 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
8447 strcat(size, "]");
8448 strcat(string, size);
8449 }
8450
8451 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
8452 {
8453
8454 }
8455
8456 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
8457 {
8458 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8459 strcat(string, ")");
8460 if(type->kind == 12)
8461 PrintArraySize(type, string);
8462 else if(type->kind == 11)
8463 {
8464 struct Type * param;
8465
8466 strcat(string, "(");
8467 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
8468 {
8469 PrintType(param, string, 1, fullName);
8470 if(param->next)
8471 strcat(string, ", ");
8472 }
8473 strcat(string, ")");
8474 }
8475 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8476 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
8477 }
8478
8479 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
8480 {
8481 PrePrintType(type, string, fullName, (((void *)0)), printConst);
8482 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
8483 strcat(string, " ");
8484 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
8485 {
8486 struct Symbol * _class = type->__anon1.__anon2.thisClass;
8487
8488 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
8489 {
8490 if(type->classObjectType == 1)
8491 strcat(string, "class");
8492 else
8493 strcat(string, type->byReference ? "typed_object&" : "typed_object");
8494 }
8495 else if(_class && _class->string)
8496 {
8497 char * s = _class->string;
8498
8499 if(fullName)
8500 strcat(string, s);
8501 else
8502 {
8503 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
8504
8505 if(name)
8506 name += 2;
8507 else
8508 name = s;
8509 strcat(string, name);
8510 }
8511 }
8512 strcat(string, "::");
8513 }
8514 if(printName && type->name)
8515 PrintName(type, string, fullName);
8516 PostPrintType(type, string, fullName);
8517 if(type->bitFieldCount)
8518 {
8519 char count[100];
8520
8521 sprintf(count, ":%d", type->bitFieldCount);
8522 strcat(string, count);
8523 }
8524 }
8525
8526 struct Conversion;
8527
8528 struct Conversion
8529 {
8530 struct Conversion * prev, * next;
8531 struct __ecereNameSpace__ecere__com__Property * convert;
8532 unsigned int isGet;
8533 struct Type * resultType;
8534 } ecere_gcc_struct;
8535
8536 static void FreeConvert(struct Conversion * convert)
8537 {
8538 if(convert->resultType)
8539 FreeType(convert->resultType);
8540 }
8541
8542 struct Enumerator;
8543
8544 struct Enumerator
8545 {
8546 struct Enumerator * prev;
8547 struct Enumerator * next;
8548 struct Location loc;
8549 struct Identifier * id;
8550 struct Expression * exp;
8551 } ecere_gcc_struct;
8552
8553 struct AsmField;
8554
8555 struct AsmField
8556 {
8557 struct AsmField * prev;
8558 struct AsmField * next;
8559 struct Location loc;
8560 char *  command;
8561 struct Expression * expression;
8562 struct Identifier * symbolic;
8563 } ecere_gcc_struct;
8564
8565 struct ClassDefinition;
8566
8567 struct Context
8568 {
8569 struct Context * parent;
8570 struct __ecereNameSpace__ecere__sys__BinaryTree types;
8571 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
8572 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
8573 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
8574 int nextID;
8575 int simpleID;
8576 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
8577 struct ClassDefinition * classDef;
8578 unsigned int templateTypesOnly;
8579 unsigned int hasNameSpace;
8580 } ecere_gcc_struct;
8581
8582 struct External
8583 {
8584 struct External * prev;
8585 struct External * next;
8586 struct Location loc;
8587 int type;
8588 struct Symbol * symbol;
8589 union
8590 {
8591 struct FunctionDefinition * function;
8592 struct ClassDefinition * _class;
8593 struct Declaration * declaration;
8594 char *  importString;
8595 struct Identifier * id;
8596 struct DBTableDef * table;
8597 } ecere_gcc_struct __anon1;
8598 int importType;
8599 struct External * fwdDecl;
8600 struct __ecereNameSpace__ecere__com__Instance * outgoing;
8601 struct __ecereNameSpace__ecere__com__Instance * incoming;
8602 int nonBreakableIncoming;
8603 } ecere_gcc_struct;
8604
8605 struct ClassDefinition
8606 {
8607 struct ClassDefinition * prev;
8608 struct ClassDefinition * next;
8609 struct Location loc;
8610 struct Specifier * _class;
8611 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
8612 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
8613 struct Symbol * symbol;
8614 struct Location blockStart;
8615 struct Location nameLoc;
8616 int declMode;
8617 unsigned int deleteWatchable;
8618 } ecere_gcc_struct;
8619
8620 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
8621
8622 void __ecereMethod_External_CreateEdge(struct External * this, struct External * from, unsigned int soft);
8623
8624 void DeclareGlobalData(struct External * neededFor, struct GlobalData * data)
8625 {
8626 struct Symbol * symbol = data->symbol;
8627
8628 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
8629 {
8630 if(inCompiler)
8631 {
8632 if(!symbol)
8633 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
8634 }
8635 if(!data->dataType)
8636 data->dataType = ProcessTypeString(data->dataTypeString, 0);
8637 if(inCompiler)
8638 {
8639 struct Declaration * decl;
8640 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
8641 struct Declarator * d;
8642 struct External * external;
8643
8644 specifiers = MkList();
8645 declarators = MkList();
8646 ListAdd(specifiers, MkSpecifier(EXTERN));
8647 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
8648 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
8649 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
8650 decl = MkDeclaration(specifiers, declarators);
8651 external = MkExternalDeclaration(decl);
8652 if(curExternal)
8653 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
8654 external->symbol = symbol;
8655 symbol->__anon2.__anon1.pointerExternal = external;
8656 DeclareType(external, data->dataType, 1, 1);
8657 }
8658 }
8659 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
8660 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, 0);
8661 }
8662
8663 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
8664 {
8665 struct Context * ctx;
8666 struct Symbol * symbol = (((void *)0));
8667
8668 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
8669 {
8670 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
8671 {
8672 symbol = (((void *)0));
8673 if(thisNameSpace)
8674 {
8675 char curName[1024];
8676
8677 strcpy(curName, thisNameSpace);
8678 strcat(curName, "::");
8679 strcat(curName, name);
8680 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
8681 }
8682 if(!symbol)
8683 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
8684 }
8685 else
8686 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
8687 if(symbol || ctx == endContext)
8688 break;
8689 }
8690 if(inCompiler && symbol && ctx == globalContext && symbol->__anon2.__anon1.pointerExternal && curExternal && symbol->__anon2.__anon1.pointerExternal != curExternal)
8691 __ecereMethod_External_CreateUniqueEdge(curExternal, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
8692 return symbol;
8693 }
8694
8695 struct PropertyDef;
8696
8697 struct ClassDef
8698 {
8699 struct ClassDef * prev;
8700 struct ClassDef * next;
8701 struct Location loc;
8702 int type;
8703 union
8704 {
8705 struct Declaration * decl;
8706 struct ClassFunction * function;
8707 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
8708 struct PropertyDef * propertyDef;
8709 struct PropertyWatch * propertyWatch;
8710 char *  designer;
8711 struct Identifier * defaultProperty;
8712 struct
8713 {
8714 struct Identifier * id;
8715 struct Initializer * initializer;
8716 } ecere_gcc_struct __anon1;
8717 } ecere_gcc_struct __anon1;
8718 int memberAccess;
8719 void *  object;
8720 } ecere_gcc_struct;
8721
8722 struct PropertyDef
8723 {
8724 struct PropertyDef * prev;
8725 struct PropertyDef * next;
8726 struct Location loc;
8727 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
8728 struct Declarator * declarator;
8729 struct Identifier * id;
8730 struct Statement * getStmt;
8731 struct Statement * setStmt;
8732 struct Statement * issetStmt;
8733 struct Symbol * symbol;
8734 struct Expression * category;
8735 struct
8736 {
8737 unsigned int conversion : 1;
8738 unsigned int isWatchable : 1;
8739 unsigned int isDBProp : 1;
8740 } ecere_gcc_struct __anon1;
8741 } ecere_gcc_struct;
8742
8743 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
8744 {
8745 struct ClassDef * def;
8746 int anonID = 1;
8747
8748 for(def = (*definitions).first; def; def = def->next)
8749 {
8750 if(def->type == 2)
8751 {
8752 struct Declaration * decl = def->__anon1.decl;
8753
8754 if(decl && decl->__anon1.__anon1.specifiers)
8755 {
8756 struct Specifier * spec;
8757 unsigned int isStruct = 0;
8758
8759 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
8760 {
8761 if(spec->type == 3 || spec->type == 4)
8762 {
8763 if(spec->__anon1.__anon2.definitions)
8764 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
8765 isStruct = 1;
8766 }
8767 }
8768 if(isStruct)
8769 {
8770 struct Declarator * d = (((void *)0));
8771
8772 if(decl->__anon1.__anon1.declarators)
8773 {
8774 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
8775 {
8776 struct Identifier * idDecl = GetDeclId(d);
8777
8778 if(idDecl)
8779 break;
8780 }
8781 }
8782 if(!d)
8783 {
8784 char id[100];
8785
8786 sprintf(id, "__anon%d", anonID++);
8787 if(!decl->__anon1.__anon1.declarators)
8788 decl->__anon1.__anon1.declarators = MkList();
8789 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
8790 }
8791 }
8792 }
8793 }
8794 }
8795 }
8796
8797 struct MemberInit;
8798
8799 typedef union YYSTYPE
8800 {
8801 int specifierType;
8802 int i;
8803 int declMode;
8804 struct Identifier * id;
8805 struct Expression * exp;
8806 struct Specifier * specifier;
8807 struct __ecereNameSpace__ecere__sys__OldList * list;
8808 struct Enumerator * enumerator;
8809 struct Declarator * declarator;
8810 struct Pointer * pointer;
8811 struct Initializer * initializer;
8812 struct InitDeclarator * initDeclarator;
8813 struct TypeName * typeName;
8814 struct Declaration * declaration;
8815 struct Statement * stmt;
8816 struct FunctionDefinition * function;
8817 struct External * external;
8818 struct Context * context;
8819 struct AsmField * asmField;
8820 struct Attrib * attrib;
8821 struct ExtDecl * extDecl;
8822 struct Attribute * attribute;
8823 struct Instantiation * instance;
8824 struct MembersInit * membersInit;
8825 struct MemberInit * memberInit;
8826 struct ClassFunction * classFunction;
8827 struct ClassDefinition * _class;
8828 struct ClassDef * classDef;
8829 struct PropertyDef * prop;
8830 char * string;
8831 struct Symbol * symbol;
8832 struct PropertyWatch * propertyWatch;
8833 struct TemplateParameter * templateParameter;
8834 struct TemplateArgument * templateArgument;
8835 struct TemplateDatatype * templateDatatype;
8836 struct DBTableEntry * dbtableEntry;
8837 struct DBIndexItem * dbindexItem;
8838 struct DBTableDef * dbtableDef;
8839 } ecere_gcc_struct YYSTYPE;
8840
8841 extern YYSTYPE yylval;
8842
8843 struct MemberInit
8844 {
8845 struct MemberInit * prev;
8846 struct MemberInit * next;
8847 struct Location loc;
8848 struct Location realLoc;
8849 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
8850 struct Initializer * initializer;
8851 unsigned int used;
8852 unsigned int variable;
8853 unsigned int takeOutExp;
8854 } ecere_gcc_struct;
8855
8856 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
8857
8858 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
8859
8860 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
8861 {
8862 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
8863 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
8864 const char *  name;
8865 int type;
8866 union
8867 {
8868 const char *  dataTypeString;
8869 int memberType;
8870 } ecere_gcc_struct __anon1;
8871 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
8872 void *  param;
8873 } ecere_gcc_struct;
8874
8875 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
8876 {
8877 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
8878 int id = 0;
8879 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
8880 struct __ecereNameSpace__ecere__com__Class * sClass;
8881
8882 for(sClass = _class; sClass; sClass = sClass->base)
8883 {
8884 id = 0;
8885 if(sClass->templateClass)
8886 sClass = sClass->templateClass;
8887 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
8888 {
8889 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
8890 {
8891 for(sClass = sClass->base; sClass; sClass = sClass->base)
8892 {
8893 if(sClass->templateClass)
8894 sClass = sClass->templateClass;
8895 id += sClass->templateParams.count;
8896 }
8897 break;
8898 }
8899 id++;
8900 }
8901 if(curParam)
8902 break;
8903 }
8904 if(curParam)
8905 {
8906 arg = &_class->templateArgs[id];
8907 if(arg && param->type == 0)
8908 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
8909 }
8910 return arg;
8911 }
8912
8913 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
8914 {
8915 struct Context * context = PushContext();
8916
8917 context->templateTypesOnly = 1;
8918 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
8919 {
8920 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
8921
8922 for(; param; param = param->next)
8923 {
8924 if(param->type == 0 && param->identifier)
8925 {
8926 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
8927
8928 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8929 }
8930 }
8931 }
8932 else if(_class)
8933 {
8934 struct __ecereNameSpace__ecere__com__Class * sClass;
8935
8936 for(sClass = _class; sClass; sClass = sClass->base)
8937 {
8938 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
8939
8940 for(p = sClass->templateParams.first; p; p = p->next)
8941 {
8942 if(p->type == 0)
8943 {
8944 struct TemplateParameter * param = p->param;
8945 struct TemplatedType * type;
8946
8947 if(!param)
8948 {
8949 p->param = param = __extension__ ({
8950 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
8951
8952 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
8953 });
8954 }
8955 type = __extension__ ({
8956 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
8957
8958 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
8959 });
8960 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8961 }
8962 }
8963 }
8964 }
8965 return context;
8966 }
8967
8968 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
8969 {
8970 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8971 {
8972 unsigned int first = 1;
8973 int p = 0;
8974 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8975 int lastParam = -1;
8976 char className[1024];
8977
8978 strcpy(className, _class->fullName);
8979 for(param = _class->templateParams.first; param; param = param->next)
8980 {
8981 {
8982 if(first)
8983 strcat(className, "<");
8984 if(!first)
8985 strcat(className, ", ");
8986 if(lastParam + 1 != p)
8987 {
8988 strcat(className, param->name);
8989 strcat(className, " = ");
8990 }
8991 strcat(className, param->name);
8992 first = 0;
8993 lastParam = p;
8994 }
8995 p++;
8996 }
8997 if(!first)
8998 {
8999 int len = strlen(className);
9000
9001 if(className[len - 1] == '>')
9002 className[len++] = ' ';
9003 className[len++] = '>';
9004 className[len++] = '\0';
9005 }
9006 return __ecereNameSpace__ecere__sys__CopyString(className);
9007 }
9008 else
9009 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
9010 }
9011
9012 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
9013 {
9014 struct Type * type;
9015
9016 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
9017 {
9018 unsigned int first = 1;
9019 int p = 0;
9020 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9021 int lastParam = -1;
9022 char className[1024];
9023
9024 strcpy(className, _class->fullName);
9025 for(param = _class->templateParams.first; param; param = param->next)
9026 {
9027 {
9028 if(first)
9029 strcat(className, "<");
9030 if(!first)
9031 strcat(className, ", ");
9032 if(lastParam + 1 != p)
9033 {
9034 strcat(className, param->name);
9035 strcat(className, " = ");
9036 }
9037 strcat(className, param->name);
9038 first = 0;
9039 lastParam = p;
9040 }
9041 p++;
9042 }
9043 if(!first)
9044 {
9045 int len = strlen(className);
9046
9047 if(className[len - 1] == '>')
9048 className[len++] = ' ';
9049 className[len++] = '>';
9050 className[len++] = '\0';
9051 }
9052 type = MkClassType(className);
9053 }
9054 else
9055 {
9056 type = MkClassType(_class->fullName);
9057 }
9058 return type;
9059 }
9060
9061 static int DeclareMembers(struct External * neededBy, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9062 {
9063 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9064 struct __ecereNameSpace__ecere__com__DataMember * member;
9065 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9066
9067 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
9068 DeclareMembers(neededBy, _class->base, 0);
9069 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
9070 {
9071 if(!member->isProperty)
9072 {
9073 switch(member->type)
9074 {
9075 case 0:
9076 {
9077 if(!member->dataType && member->dataTypeString)
9078 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9079 if(member->dataType)
9080 DeclareType(neededBy, member->dataType, 1, 0);
9081 break;
9082 }
9083 case 1:
9084 case 2:
9085 {
9086 DeclareMembers(neededBy, (struct __ecereNameSpace__ecere__com__Class *)member, 1);
9087 break;
9088 }
9089 }
9090 }
9091 }
9092 if(context)
9093 FinishTemplatesContext(context);
9094 return topMember ? topMember->memberID : _class->memberID;
9095 }
9096
9097 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
9098 {
9099 if(!method->dataType)
9100 {
9101 struct Context * context = SetupTemplatesContext(method->_class);
9102
9103 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9104 FinishTemplatesContext(context);
9105 if(method->type != 1 && method->dataType)
9106 {
9107 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
9108 {
9109 if(!method->_class->symbol)
9110 method->_class->symbol = FindClass(method->_class->fullName);
9111 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
9112 }
9113 }
9114 }
9115 }
9116
9117 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
9118 {
9119 if(!prop->dataType)
9120 {
9121 struct Context * context = SetupTemplatesContext(prop->_class);
9122
9123 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
9124 FinishTemplatesContext(context);
9125 }
9126 }
9127
9128 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
9129 {
9130 if(specs != (((void *)0)) && _class)
9131 {
9132 struct Specifier * spec;
9133
9134 for(spec = specs->first; spec; spec = spec->next)
9135 {
9136 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
9137 {
9138 spec->type = 1;
9139 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
9140 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
9141 }
9142 }
9143 }
9144 }
9145
9146 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
9147 {
9148 struct Identifier * id = exp->__anon1.__anon1.identifier;
9149 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9150 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9151 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9152 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9153
9154 if(_class && _class->type == 4)
9155 {
9156 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
9157 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9158
9159 if(enumClass)
9160 {
9161 struct __ecereNameSpace__ecere__com__Class * baseClass;
9162
9163 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
9164 {
9165 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
9166
9167 for(value = e->values.first; value; value = value->next)
9168 {
9169 if(!strcmp(value->name, id->string))
9170 break;
9171 }
9172 if(value)
9173 {
9174 exp->isConstant = 1;
9175 if(inCompiler || inPreCompiler || inDebugger)
9176 {
9177 char constant[256];
9178
9179 FreeExpContents(exp);
9180 exp->type = 2;
9181 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
9182 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
9183 else
9184 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
9185 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9186 }
9187 exp->expType = MkClassType(baseClass->fullName);
9188 break;
9189 }
9190 }
9191 }
9192 if(value)
9193 return 1;
9194 }
9195 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
9196 {
9197 ProcessMethodType(method);
9198 exp->expType = __extension__ ({
9199 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
9200
9201 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
9202 });
9203 return 1;
9204 }
9205 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
9206 {
9207 if(!prop->dataType)
9208 ProcessPropertyType(prop);
9209 exp->expType = prop->dataType;
9210 if(prop->dataType)
9211 prop->dataType->refCount++;
9212 return 1;
9213 }
9214 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
9215 {
9216 if(!member->dataType)
9217 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9218 exp->expType = member->dataType;
9219 if(member->dataType)
9220 member->dataType->refCount++;
9221 return 1;
9222 }
9223 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
9224 {
9225 if(!classProp->dataType)
9226 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
9227 if(classProp->constant)
9228 {
9229 FreeExpContents(exp);
9230 exp->isConstant = 1;
9231 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
9232 {
9233 exp->type = 3;
9234 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
9235 }
9236 else
9237 {
9238 char constant[256];
9239
9240 exp->type = 2;
9241 sprintf(constant, "%d", (int)classProp->Get(_class));
9242 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9243 }
9244 }
9245 else
9246 {
9247 }
9248 exp->expType = classProp->dataType;
9249 if(classProp->dataType)
9250 classProp->dataType->refCount++;
9251 return 1;
9252 }
9253 return 0;
9254 }
9255
9256 void DeclareProperty(struct External * neededBy, struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
9257 {
9258 struct Symbol * symbol = prop->symbol;
9259 unsigned int imported = 0;
9260 unsigned int dllImport = 0;
9261 struct External * structExternal = (((void *)0));
9262 struct External * instExternal = (((void *)0));
9263
9264 strcpy(setName, "__ecereProp_");
9265 FullClassNameCat(setName, prop->_class->fullName, 0);
9266 strcat(setName, "_Set_");
9267 FullClassNameCat(setName, prop->name, 1);
9268 strcpy(getName, "__ecereProp_");
9269 FullClassNameCat(getName, prop->_class->fullName, 0);
9270 strcat(getName, "_Get_");
9271 FullClassNameCat(getName, prop->name, 1);
9272 if(!symbol || symbol->_import)
9273 {
9274 if(!symbol)
9275 {
9276 struct Symbol * classSym;
9277
9278 if(!prop->_class->symbol)
9279 prop->_class->symbol = FindClass(prop->_class->fullName);
9280 classSym = prop->_class->symbol;
9281 if(classSym && !classSym->_import)
9282 {
9283 struct ModuleImport * module;
9284
9285 if(prop->_class->module)
9286 module = FindModule(prop->_class->module);
9287 else
9288 module = mainModule;
9289 classSym->_import = __extension__ ({
9290 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9291
9292 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
9293 });
9294 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9295 }
9296 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9297 symbol->_import = (struct ClassImport *)__extension__ ({
9298 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
9299
9300 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
9301 });
9302 if(classSym)
9303 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
9304 }
9305 imported = 1;
9306 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)
9307 dllImport = 1;
9308 }
9309 if(!symbol->type)
9310 {
9311 struct Context * context = SetupTemplatesContext(prop->_class);
9312
9313 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
9314 FinishTemplatesContext(context);
9315 }
9316 if((prop->Get && !symbol->__anon2.__anon2.externalGet) || (prop->Set && !symbol->__anon2.__anon2.externalSet))
9317 {
9318 if(prop->_class->type == 0 && prop->_class->structSize)
9319 instExternal = DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
9320 structExternal = DeclareStruct((((void *)0)), prop->_class->fullName, prop->_class->type != 1, 0);
9321 }
9322 if(prop->Get && !symbol->__anon2.__anon2.externalGet)
9323 {
9324 struct Declaration * decl;
9325 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9326 struct Declarator * d;
9327 struct __ecereNameSpace__ecere__sys__OldList * params;
9328 struct Specifier * spec = (((void *)0));
9329 struct External * external;
9330 struct Declarator * typeDecl;
9331 unsigned int simple = 0;
9332 unsigned int needReference;
9333
9334 specifiers = MkList();
9335 declarators = MkList();
9336 params = MkList();
9337 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9338 d = MkDeclaratorIdentifier(MkIdentifier(getName));
9339 if(dllImport)
9340 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9341 {
9342 struct Context * context = SetupTemplatesContext(prop->_class);
9343
9344 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
9345 FinishTemplatesContext(context);
9346 }
9347 needReference = !typeDecl || typeDecl->type == 1;
9348 for(spec = (*specifiers).first; spec; spec = spec->next)
9349 {
9350 if(spec->type == 1)
9351 {
9352 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9353
9354 if(needReference)
9355 {
9356 symbol->_class = classSym->__anon1.registered;
9357 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
9358 simple = 1;
9359 }
9360 break;
9361 }
9362 }
9363 if(!simple)
9364 d = PlugDeclarator(typeDecl, d);
9365 else
9366 {
9367 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
9368 specifiers = MkList();
9369 }
9370 d = MkDeclaratorFunction(d, params);
9371 if(dllImport)
9372 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9373 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9374 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9375 if(simple)
9376 ListAdd(specifiers, MkSpecifier(VOID));
9377 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9378 decl = MkDeclaration(specifiers, declarators);
9379 external = MkExternalDeclaration(decl);
9380 if(structExternal)
9381 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9382 if(instExternal)
9383 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9384 if(spec)
9385 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9386 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9387 external->symbol = symbol;
9388 symbol->__anon2.__anon2.externalGet = external;
9389 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9390 if(typeDecl)
9391 FreeDeclarator(typeDecl);
9392 }
9393 if(prop->Set && !symbol->__anon2.__anon2.externalSet)
9394 {
9395 struct Declaration * decl;
9396 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9397 struct Declarator * d;
9398 struct __ecereNameSpace__ecere__sys__OldList * params;
9399 struct Specifier * spec = (((void *)0));
9400 struct External * external;
9401 struct Declarator * typeDecl;
9402 unsigned int needReference;
9403
9404 declarators = MkList();
9405 params = MkList();
9406 if(!prop->conversion || prop->_class->type == 1)
9407 {
9408 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9409 }
9410 specifiers = MkList();
9411 {
9412 struct Context * context = SetupTemplatesContext(prop->_class);
9413
9414 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
9415 FinishTemplatesContext(context);
9416 }
9417 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
9418 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
9419 ListAdd(params, MkTypeName(specifiers, d));
9420 d = MkDeclaratorIdentifier(MkIdentifier(setName));
9421 if(dllImport)
9422 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9423 d = MkDeclaratorFunction(d, params);
9424 needReference = !typeDecl || typeDecl->type == 1;
9425 for(spec = (*specifiers).first; spec; spec = spec->next)
9426 {
9427 if(spec->type == 1)
9428 {
9429 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9430
9431 if(needReference)
9432 symbol->_class = classSym->__anon1.registered;
9433 break;
9434 }
9435 }
9436 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9437 specifiers = MkList();
9438 if(dllImport)
9439 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9440 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9441 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9442 if(!prop->conversion || prop->_class->type == 1)
9443 ListAdd(specifiers, MkSpecifier(VOID));
9444 else
9445 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
9446 decl = MkDeclaration(specifiers, declarators);
9447 external = MkExternalDeclaration(decl);
9448 if(structExternal)
9449 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9450 if(instExternal)
9451 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9452 if(spec)
9453 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9454 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9455 external->symbol = symbol;
9456 symbol->__anon2.__anon2.externalSet = external;
9457 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9458 }
9459 if(!symbol->__anon2.__anon2.externalPtr)
9460 {
9461 struct Declaration * decl;
9462 struct External * external;
9463 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
9464 char propName[1024];
9465
9466 if(imported)
9467 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9468 else
9469 {
9470 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9471 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
9472 }
9473 ListAdd(specifiers, MkSpecifierName("Property"));
9474 strcpy(propName, "__ecereProp_");
9475 FullClassNameCat(propName, prop->_class->fullName, 0);
9476 strcat(propName, "_");
9477 FullClassNameCat(propName, prop->name, 1);
9478 {
9479 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
9480
9481 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9482 if(!imported)
9483 {
9484 strcpy(propName, "__ecerePropM_");
9485 FullClassNameCat(propName, prop->_class->fullName, 0);
9486 strcat(propName, "_");
9487 FullClassNameCat(propName, prop->name, 1);
9488 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9489 }
9490 decl = MkDeclaration(specifiers, list);
9491 }
9492 external = MkExternalDeclaration(decl);
9493 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
9494 external->symbol = symbol;
9495 symbol->__anon2.__anon2.externalPtr = external;
9496 }
9497 if(inCompiler && neededBy)
9498 {
9499 if(symbol->__anon2.__anon2.externalPtr)
9500 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalPtr, 0);
9501 if(symbol->__anon2.__anon2.externalGet)
9502 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalGet, symbol->__anon2.__anon2.externalGet->type == 0);
9503 if(symbol->__anon2.__anon2.externalSet)
9504 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalSet, symbol->__anon2.__anon2.externalSet->type == 0);
9505 }
9506 }
9507
9508 static void ProcessDeclarator(struct Declarator *  decl, unsigned int isFunction);
9509
9510 void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char * name)
9511 {
9512 struct Symbol * symbol = method->symbol;
9513
9514 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && (!symbol->__anon2.__anon3.methodCodeExternal || method->type == 1)))
9515 {
9516 unsigned int dllImport = 0;
9517
9518 if(!method->dataType)
9519 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9520 {
9521 if(!symbol || method->type == 1)
9522 {
9523 struct Symbol * classSym;
9524
9525 if(!method->_class->symbol)
9526 method->_class->symbol = FindClass(method->_class->fullName);
9527 classSym = method->_class->symbol;
9528 if(!classSym->_import)
9529 {
9530 struct ModuleImport * module;
9531
9532 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->name)
9533 module = FindModule(method->_class->module);
9534 else
9535 module = mainModule;
9536 classSym->_import = __extension__ ({
9537 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9538
9539 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
9540 });
9541 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9542 }
9543 if(!symbol)
9544 {
9545 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9546 }
9547 if(!symbol->_import)
9548 {
9549 symbol->_import = (struct ClassImport *)__extension__ ({
9550 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
9551
9552 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
9553 });
9554 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
9555 }
9556 if(!symbol)
9557 {
9558 symbol->type = method->dataType;
9559 if(symbol->type)
9560 symbol->type->refCount++;
9561 }
9562 }
9563 if(!method->dataType->dllExport)
9564 {
9565 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)
9566 dllImport = 1;
9567 }
9568 }
9569 if(inCompiler)
9570 {
9571 struct Declaration * decl;
9572 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9573 struct Declarator * d;
9574 struct Declarator * funcDecl;
9575 struct External * external;
9576
9577 specifiers = MkList();
9578 declarators = MkList();
9579 if(dllImport)
9580 ListAdd(specifiers, MkSpecifier(EXTERN));
9581 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
9582 ListAdd(specifiers, MkSpecifier(STATIC));
9583 if(method->type == 1)
9584 {
9585 ListAdd(specifiers, MkSpecifier(INT));
9586 d = MkDeclaratorIdentifier(MkIdentifier(name));
9587 }
9588 else
9589 {
9590 d = MkDeclaratorIdentifier(MkIdentifier(name));
9591 if(dllImport)
9592 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9593 {
9594 struct Context * context = SetupTemplatesContext(method->_class);
9595
9596 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
9597 FinishTemplatesContext(context);
9598 }
9599 funcDecl = GetFuncDecl(d);
9600 if(dllImport)
9601 {
9602 struct Specifier * spec, * next;
9603
9604 for(spec = (*specifiers).first; spec; spec = next)
9605 {
9606 next = spec->next;
9607 if(spec->type == 5)
9608 {
9609 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9610 FreeSpecifier(spec);
9611 }
9612 }
9613 }
9614 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
9615 {
9616 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
9617 {
9618 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
9619 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")));
9620 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
9621 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
9622
9623 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
9624 {
9625 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
9626
9627 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
9628 FreeTypeName(param);
9629 }
9630 if(!funcDecl->__anon1.function.parameters)
9631 funcDecl->__anon1.function.parameters = MkList();
9632 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
9633 }
9634 }
9635 }
9636 ProcessDeclarator(d, 1);
9637 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9638 decl = MkDeclaration(specifiers, declarators);
9639 ReplaceThisClassSpecifiers(specifiers, method->_class);
9640 external = MkExternalDeclaration(decl);
9641 external->symbol = symbol;
9642 symbol->__anon2.__anon1.pointerExternal = external;
9643 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9644 DeclareStruct(external, method->_class->fullName, 1, 1);
9645 if(method->dataType)
9646 DeclareType(external, method->dataType, 1, 1);
9647 }
9648 }
9649 if(inCompiler && neededFor)
9650 {
9651 struct External * external = symbol->__anon2.__anon1.pointerExternal ? symbol->__anon2.__anon1.pointerExternal : symbol->__anon2.__anon3.methodCodeExternal;
9652
9653 __ecereMethod_External_CreateUniqueEdge(neededFor, external, external->type == 0);
9654 }
9655 }
9656
9657 struct __ecereNameSpace__ecere__com__GlobalFunction;
9658
9659 struct __ecereNameSpace__ecere__com__GlobalFunction
9660 {
9661 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
9662 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
9663 const char *  name;
9664 int (*  function)();
9665 struct __ecereNameSpace__ecere__com__Instance * module;
9666 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
9667 const char *  dataTypeString;
9668 struct Type * dataType;
9669 void *  symbol;
9670 } ecere_gcc_struct;
9671
9672 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
9673
9674 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);
9675
9676 unsigned int DeclareFunction(struct External * neededFor, struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
9677 {
9678 struct Symbol * symbol = function->symbol;
9679
9680 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
9681 {
9682 unsigned int imported = 0;
9683 unsigned int dllImport = 0;
9684
9685 if(!function->dataType)
9686 {
9687 function->dataType = ProcessTypeString(function->dataTypeString, 0);
9688 if(!function->dataType->__anon1.__anon2.thisClass)
9689 function->dataType->__anon1.__anon2.staticMethod = 1;
9690 }
9691 if(inCompiler)
9692 {
9693 if(!symbol)
9694 {
9695 struct ModuleImport * module = FindModule(function->module);
9696
9697 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9698 if(module->name)
9699 {
9700 if(!function->dataType->dllExport)
9701 {
9702 symbol->_import = (struct ClassImport *)__extension__ ({
9703 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
9704
9705 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
9706 });
9707 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
9708 }
9709 }
9710 {
9711 symbol->type = ProcessTypeString(function->dataTypeString, 0);
9712 if(!symbol->type->__anon1.__anon2.thisClass)
9713 symbol->type->__anon1.__anon2.staticMethod = 1;
9714 }
9715 }
9716 imported = symbol->_import ? 1 : 0;
9717 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9718 dllImport = 1;
9719 }
9720 if(inCompiler)
9721 {
9722 {
9723 struct Declaration * decl;
9724 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9725 struct Declarator * d;
9726 struct Declarator * funcDecl;
9727 struct External * external;
9728
9729 specifiers = MkList();
9730 declarators = MkList();
9731 ListAdd(specifiers, MkSpecifier(EXTERN));
9732 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
9733 if(dllImport)
9734 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9735 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
9736 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType == 1)
9737 {
9738 struct Specifier * spec;
9739
9740 for(spec = (*specifiers).first; spec; spec = spec->next)
9741 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
9742 {
9743 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9744 FreeSpecifier(spec);
9745 break;
9746 }
9747 }
9748 funcDecl = GetFuncDecl(d);
9749 if(funcDecl && !funcDecl->__anon1.function.parameters)
9750 {
9751 funcDecl->__anon1.function.parameters = MkList();
9752 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
9753 }
9754 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9755 {
9756 struct Context * oldCtx = curContext;
9757
9758 curContext = globalContext;
9759 decl = MkDeclaration(specifiers, declarators);
9760 curContext = oldCtx;
9761 }
9762 external = MkExternalDeclaration(decl);
9763 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9764 external->symbol = symbol;
9765 symbol->__anon2.__anon1.pointerExternal = external;
9766 DeclareType(external, function->dataType, 1, 1);
9767 }
9768 }
9769 }
9770 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
9771 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
9772 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;
9773 }
9774
9775 void DeclareFunctionUtil(struct External * neededBy, const char * s)
9776 {
9777 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
9778
9779 if(function)
9780 {
9781 char name[1024];
9782
9783 name[0] = 0;
9784 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
9785 strcpy(name, "__ecereFunction_");
9786 FullClassNameCat(name, s, 0);
9787 DeclareFunction(neededBy, function, name);
9788 }
9789 else if(neededBy)
9790 FindSymbol(s, globalContext, globalContext, 0, 0);
9791 }
9792
9793 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
9794 {
9795 char propName[1024], propNameM[1024];
9796 char getName[1024], setName[1024];
9797 struct __ecereNameSpace__ecere__sys__OldList * args;
9798
9799 DeclareProperty(curExternal, prop, setName, getName);
9800 strcpy(propName, "__ecereProp_");
9801 FullClassNameCat(propName, prop->_class->fullName, 0);
9802 strcat(propName, "_");
9803 FullClassNameCat(propName, prop->name, 1);
9804 strcpy(propNameM, "__ecerePropM_");
9805 FullClassNameCat(propNameM, prop->_class->fullName, 0);
9806 strcat(propNameM, "_");
9807 FullClassNameCat(propNameM, prop->name, 1);
9808 if(prop->isWatchable)
9809 {
9810 args = MkList();
9811 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9812 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9813 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9814 args = MkList();
9815 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9816 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9817 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9818 DeclareFunctionUtil(curExternal, "eInstance_FireWatchers");
9819 }
9820 {
9821 args = MkList();
9822 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9823 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9824 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9825 args = MkList();
9826 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9827 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9828 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9829 DeclareFunctionUtil(curExternal, "eInstance_FireSelfWatchers");
9830 }
9831 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
9832 curFunction->propSet->fireWatchersDone = 1;
9833 }
9834
9835 struct __ecereNameSpace__ecere__com__SubModule;
9836
9837 struct __ecereNameSpace__ecere__com__SubModule
9838 {
9839 struct __ecereNameSpace__ecere__com__SubModule * prev;
9840 struct __ecereNameSpace__ecere__com__SubModule * next;
9841 struct __ecereNameSpace__ecere__com__Instance * module;
9842 int importMode;
9843 } ecere_gcc_struct;
9844
9845 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
9846 {
9847 struct __ecereNameSpace__ecere__com__SubModule * subModule;
9848
9849 if(searchFor == searchIn)
9850 return 1;
9851 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
9852 {
9853 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
9854 {
9855 if(ModuleVisibility(subModule->module, searchFor))
9856 return 1;
9857 }
9858 }
9859 return 0;
9860 }
9861
9862 void ProcessExpressionType(struct Expression *  exp);
9863
9864 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
9865 {
9866 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
9867 {
9868 struct Identifier * id = exp->__anon1.__anon1.identifier;
9869 struct Context * ctx;
9870 struct Symbol * symbol = (((void *)0));
9871
9872 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
9873 {
9874 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
9875 {
9876 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
9877 if(symbol)
9878 break;
9879 }
9880 }
9881 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))))
9882 {
9883 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
9884 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9885 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9886 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9887
9888 if(!prop)
9889 {
9890 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
9891 }
9892 if(!prop && !method)
9893 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
9894 if(!prop && !method && !member)
9895 {
9896 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
9897 }
9898 if(prop || method || member || classProp)
9899 {
9900 exp->type = 8;
9901 exp->__anon1.member.member = id;
9902 exp->__anon1.member.memberType = 0;
9903 exp->__anon1.member.exp = QMkExpId("this");
9904 exp->addedThis = 1;
9905 }
9906 else if(_class && _class->templateParams.first)
9907 {
9908 struct __ecereNameSpace__ecere__com__Class * sClass;
9909
9910 for(sClass = _class; sClass; sClass = sClass->base)
9911 {
9912 if(sClass->templateParams.first)
9913 {
9914 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9915
9916 for(param = sClass->templateParams.first; param; param = param->next)
9917 {
9918 if(param->type == 2 && !strcmp(param->name, id->string))
9919 {
9920 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
9921
9922 if(argExp)
9923 {
9924 struct Declarator * decl;
9925 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
9926
9927 FreeIdentifier(exp->__anon1.member.member);
9928 ProcessExpressionType(argExp);
9929 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
9930 exp->expType = ProcessType(specs, decl);
9931 exp->type = 5;
9932 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
9933 }
9934 }
9935 }
9936 }
9937 }
9938 }
9939 }
9940 }
9941 }
9942
9943 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9944 {
9945 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9946
9947 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9948 {
9949 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9950 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9951 else
9952 {
9953 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9954 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9955 struct Type * type;
9956 void * ptr = inst->data + dataMember->offset + offset;
9957 char * result = (((void *)0));
9958
9959 exp->loc = member->loc = inst->loc;
9960 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9961 if(!dataMember->dataType)
9962 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
9963 type = dataMember->dataType;
9964 if(type->kind == 8)
9965 {
9966 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
9967
9968 if(_class->type == 4)
9969 {
9970 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9971
9972 if(enumClass)
9973 {
9974 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9975 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
9976
9977 for(item = e->values.first; item; item = item->next)
9978 {
9979 if(item->data == GetEnumValue(_class, ptr))
9980 {
9981 result = item->name;
9982 break;
9983 }
9984 }
9985 if(result)
9986 {
9987 exp->__anon1.__anon1.identifier = MkIdentifier(result);
9988 exp->type = 0;
9989 exp->destType = MkClassType(_class->fullName);
9990 ProcessExpressionType(exp);
9991 }
9992 }
9993 }
9994 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9995 {
9996 if(!_class->dataType)
9997 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
9998 type = _class->dataType;
9999 }
10000 }
10001 if(!result)
10002 {
10003 switch(type->kind)
10004 {
10005 case 6:
10006 {
10007 FreeExpContents(exp);
10008 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10009 exp->type = 2;
10010 break;
10011 }
10012 case 7:
10013 {
10014 FreeExpContents(exp);
10015 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10016 exp->type = 2;
10017 break;
10018 }
10019 case 3:
10020 {
10021 FreeExpContents(exp);
10022 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10023 exp->type = 2;
10024 break;
10025 }
10026 case 4:
10027 {
10028 FreeExpContents(exp);
10029 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10030 exp->type = 2;
10031 break;
10032 }
10033 case 22:
10034 {
10035 FreeExpContents(exp);
10036 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10037 exp->type = 2;
10038 break;
10039 }
10040 case 23:
10041 {
10042 FreeExpContents(exp);
10043 exp->__anon1.__anon1.constant = PrintInt64((long long)*(ssize_t *)ptr);
10044 exp->type = 2;
10045 break;
10046 }
10047 default:
10048 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10049 }
10050 }
10051 ListAdd(memberList, member);
10052 }
10053 if(parentDataMember->type == 1)
10054 break;
10055 }
10056 }
10057
10058 void CheckTemplateTypes(struct Expression * exp)
10059 {
10060 struct Expression * nbExp = GetNonBracketsExp(exp);
10061
10062 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
10063 {
10064 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10065 struct Context * context;
10066 int kind = exp->expType->kind;
10067
10068 *newExp = *exp;
10069 if(exp->destType)
10070 exp->destType->refCount++;
10071 if(exp->expType)
10072 exp->expType->refCount++;
10073 newExp->prev = (((void *)0));
10074 newExp->next = (((void *)0));
10075 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10076 {
10077 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10078
10079 if(c->type == 2 || c->type == 4 || c->type == 3)
10080 {
10081 if(!c->dataType)
10082 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10083 kind = c->dataType->kind;
10084 }
10085 }
10086 switch(kind)
10087 {
10088 case 7:
10089 if(exp->destType->classObjectType)
10090 {
10091 if(exp->destType)
10092 exp->destType->refCount--;
10093 if(exp->expType)
10094 exp->expType->refCount--;
10095 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10096 }
10097 else
10098 {
10099 struct __ecereNameSpace__ecere__sys__OldList * specs;
10100 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10101 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10102
10103 context = PushContext();
10104 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10105 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10106 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10107 exp->type = 23;
10108 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10109 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10110 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10111 exp->__anon1.compound->__anon1.compound.context = context;
10112 PopContext(context);
10113 }
10114 break;
10115 default:
10116 exp->type = 11;
10117 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10118 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))
10119 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
10120 else
10121 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10122 exp->needCast = 1;
10123 break;
10124 }
10125 }
10126 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10127 {
10128 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10129 struct Context * context;
10130 int kind = exp->expType->kind;
10131
10132 *newExp = *exp;
10133 if(exp->destType)
10134 exp->destType->refCount++;
10135 if(exp->expType)
10136 exp->expType->refCount++;
10137 newExp->prev = (((void *)0));
10138 newExp->next = (((void *)0));
10139 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10140 {
10141 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10142
10143 if(c->type == 2 || c->type == 4 || c->type == 3)
10144 {
10145 if(!c->dataType)
10146 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10147 kind = c->dataType->kind;
10148 }
10149 }
10150 switch(kind)
10151 {
10152 case 7:
10153 if(exp->destType->classObjectType)
10154 {
10155 if(exp->destType)
10156 exp->destType->refCount--;
10157 if(exp->expType)
10158 exp->expType->refCount--;
10159 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10160 }
10161 else
10162 {
10163 struct __ecereNameSpace__ecere__sys__OldList * specs;
10164 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10165 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10166
10167 context = PushContext();
10168 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10169 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10170 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10171 exp->type = 23;
10172 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10173 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10174 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10175 exp->__anon1.compound->__anon1.compound.context = context;
10176 PopContext(context);
10177 }
10178 break;
10179 case 8:
10180 {
10181 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
10182 {
10183 exp->type = 5;
10184 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10185 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)));
10186 ProcessExpressionType((*exp->__anon1.list).first);
10187 break;
10188 }
10189 else
10190 {
10191 exp->type = 5;
10192 if(__ecereProp_Type_Get_isPointerType(exp->expType))
10193 {
10194 exp->needTemplateCast = 2;
10195 newExp->needCast = 1;
10196 newExp->needTemplateCast = 2;
10197 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10198 }
10199 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
10200 exp->needTemplateCast = 2;
10201 newExp->needCast = 1;
10202 newExp->needTemplateCast = 2;
10203 ProcessExpressionType((*exp->__anon1.list).first);
10204 break;
10205 }
10206 }
10207 default:
10208 {
10209 if(exp->expType->kind == 20)
10210 {
10211 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
10212
10213 if(type)
10214 {
10215 FreeType(exp->destType);
10216 FreeType(exp->expType);
10217 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10218 break;
10219 }
10220 }
10221 {
10222 char typeString[1024];
10223 struct Declarator * decl;
10224 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10225
10226 typeString[0] = '\0';
10227 PrintType(exp->expType, typeString, 0, 0);
10228 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10229 exp->type = 11;
10230 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
10231 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10232 exp->__anon1.cast.exp->needCast = 1;
10233 exp->needTemplateCast = 2;
10234 newExp->needTemplateCast = 2;
10235 }
10236 break;
10237 }
10238 }
10239 }
10240 }
10241
10242 static void ProcessInitializer(struct Initializer * init, struct Type * type)
10243 {
10244 switch(init->type)
10245 {
10246 case 0:
10247 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
10248 {
10249 if(init->__anon1.exp && !init->__anon1.exp->destType)
10250 {
10251 FreeType(init->__anon1.exp->destType);
10252 init->__anon1.exp->destType = type;
10253 if(type)
10254 type->refCount++;
10255 }
10256 if(init->__anon1.exp)
10257 {
10258 ProcessExpressionType(init->__anon1.exp);
10259 init->isConstant = init->__anon1.exp->isConstant;
10260 }
10261 break;
10262 }
10263 else
10264 {
10265 struct Expression * exp = init->__anon1.exp;
10266 struct Instantiation * inst = exp->__anon1.instance;
10267 struct MembersInit * members;
10268
10269 init->type = 1;
10270 init->__anon1.list = MkList();
10271 if(inst->members)
10272 {
10273 for(members = (*inst->members).first; members; members = members->next)
10274 {
10275 if(members->type == 0)
10276 {
10277 struct MemberInit * member;
10278
10279 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
10280 {
10281 ListAdd(init->__anon1.list, member->initializer);
10282 member->initializer = (((void *)0));
10283 }
10284 }
10285 }
10286 }
10287 FreeExpression(exp);
10288 }
10289 case 1:
10290 {
10291 struct Initializer * i;
10292 struct Type * initializerType = (((void *)0));
10293 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10294 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10295 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10296 int subMemberStackPos = 0;
10297
10298 if(type && type->kind == 12)
10299 initializerType = Dereference(type);
10300 else if(type && (type->kind == 9 || type->kind == 10))
10301 initializerType = type->__anon1.__anon1.members.first;
10302 for(i = (*init->__anon1.list).first; i; i = i->next)
10303 {
10304 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
10305 {
10306 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10307 if(curMember)
10308 {
10309 if(!curMember->dataType)
10310 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
10311 initializerType = curMember->dataType;
10312 }
10313 }
10314 ProcessInitializer(i, initializerType);
10315 if(initializerType && type && (type->kind == 9 || type->kind == 10))
10316 initializerType = initializerType->next;
10317 if(!i->isConstant)
10318 init->isConstant = 0;
10319 }
10320 if(type && type->kind == 12)
10321 FreeType(initializerType);
10322 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))
10323 {
10324 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
10325 }
10326 break;
10327 }
10328 }
10329 }
10330
10331 void PopulateInstance(struct Instantiation * inst)
10332 {
10333 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
10334 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
10335 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10336 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10337
10338 if(!inst->members)
10339 inst->members = MkListOne(MkMembersInitList(memberList));
10340 else
10341 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10342 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10343 {
10344 if(!dataMember->isProperty)
10345 {
10346 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10347 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10348 else
10349 {
10350 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10351 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10352 struct Type * type;
10353 void * ptr = inst->data + dataMember->offset;
10354 char * result = (((void *)0));
10355
10356 exp->loc = member->loc = inst->loc;
10357 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10358 if(!dataMember->dataType)
10359 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10360 type = dataMember->dataType;
10361 if(type->kind == 8)
10362 {
10363 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
10364
10365 if(_class->type == 4)
10366 {
10367 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10368
10369 if(enumClass)
10370 {
10371 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10372 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
10373
10374 for(item = e->values.first; item; item = item->next)
10375 {
10376 if(item->data == GetEnumValue(_class, ptr))
10377 {
10378 result = item->name;
10379 break;
10380 }
10381 }
10382 }
10383 if(result)
10384 {
10385 exp->__anon1.__anon1.identifier = MkIdentifier(result);
10386 exp->type = 0;
10387 exp->destType = MkClassType(_class->fullName);
10388 ProcessExpressionType(exp);
10389 }
10390 }
10391 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10392 {
10393 if(!_class->dataType)
10394 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
10395 type = _class->dataType;
10396 }
10397 }
10398 if(!result)
10399 {
10400 switch(type->kind)
10401 {
10402 case 6:
10403 {
10404 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10405 exp->type = 2;
10406 break;
10407 }
10408 case 7:
10409 {
10410 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10411 exp->type = 2;
10412 break;
10413 }
10414 case 3:
10415 {
10416 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10417 exp->type = 2;
10418 break;
10419 }
10420 case 4:
10421 {
10422 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10423 exp->type = 2;
10424 break;
10425 }
10426 case 22:
10427 {
10428 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10429 exp->type = 2;
10430 break;
10431 }
10432 default:
10433 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10434 }
10435 }
10436 ListAdd(memberList, member);
10437 }
10438 }
10439 }
10440 }
10441
10442 int ComputeTypeSize(struct Type *  type);
10443
10444 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
10445 {
10446 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10447 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10448
10449 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))
10450 {
10451 int unionMemberOffset = 0;
10452 int bitFields = 0;
10453
10454 if(member)
10455 {
10456 member->memberOffset = 0;
10457 if(targetBits < sizeof(void *) * 8)
10458 member->structAlignment = 0;
10459 }
10460 else if(targetBits < sizeof(void *) * 8)
10461 _class->structAlignment = 0;
10462 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
10463 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
10464 if(!member && _class->destructionWatchOffset)
10465 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10466 {
10467 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10468
10469 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10470 {
10471 if(!dataMember->isProperty)
10472 {
10473 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
10474 {
10475 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10476 }
10477 }
10478 }
10479 }
10480 {
10481 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10482
10483 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10484 {
10485 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
10486 {
10487 if(!isMember && _class->type == 2 && dataMember->dataType)
10488 {
10489 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10490 uint64 mask = 0;
10491 int d;
10492
10493 ComputeTypeSize(dataMember->dataType);
10494 if(bitMember->pos == -1)
10495 bitMember->pos = _class->memberOffset;
10496 if(!bitMember->size)
10497 bitMember->size = dataMember->dataType->size * 8;
10498 _class->memberOffset = bitMember->pos + bitMember->size;
10499 for(d = 0; d < bitMember->size; d++)
10500 {
10501 if(d)
10502 mask <<= 1;
10503 mask |= 1;
10504 }
10505 bitMember->mask = mask << bitMember->pos;
10506 }
10507 else if(dataMember->type == 0 && dataMember->dataType)
10508 {
10509 int size;
10510 int alignment = 0;
10511
10512 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)))
10513 ComputeTypeSize(dataMember->dataType);
10514 if(dataMember->dataType->bitFieldCount)
10515 {
10516 bitFields += dataMember->dataType->bitFieldCount;
10517 size = 0;
10518 }
10519 else
10520 {
10521 if(bitFields)
10522 {
10523 int size = (bitFields + 7) / 8;
10524
10525 if(isMember)
10526 {
10527 int __simpleStruct0;
10528
10529 if(alignment)
10530 {
10531 short __simpleStruct0;
10532
10533 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10534 if(member->memberOffset % alignment)
10535 member->memberOffset += alignment - (member->memberOffset % alignment);
10536 }
10537 dataMember->offset = member->memberOffset;
10538 if(member->type == 1)
10539 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10540 else
10541 {
10542 member->memberOffset += size;
10543 }
10544 }
10545 else
10546 {
10547 if(alignment)
10548 {
10549 short __simpleStruct0;
10550
10551 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10552 if(_class->memberOffset % alignment)
10553 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10554 }
10555 dataMember->offset = _class->memberOffset;
10556 _class->memberOffset += size;
10557 }
10558 bitFields = 0;
10559 }
10560 size = dataMember->dataType->size;
10561 alignment = dataMember->dataType->alignment;
10562 }
10563 if(isMember)
10564 {
10565 int __simpleStruct0;
10566
10567 if(alignment)
10568 {
10569 short __simpleStruct0;
10570
10571 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10572 if(member->memberOffset % alignment)
10573 member->memberOffset += alignment - (member->memberOffset % alignment);
10574 }
10575 dataMember->offset = member->memberOffset;
10576 if(member->type == 1)
10577 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10578 else
10579 {
10580 member->memberOffset += size;
10581 }
10582 }
10583 else
10584 {
10585 if(alignment)
10586 {
10587 short __simpleStruct0;
10588
10589 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10590 if(_class->memberOffset % alignment)
10591 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10592 }
10593 dataMember->offset = _class->memberOffset;
10594 _class->memberOffset += size;
10595 }
10596 }
10597 else
10598 {
10599 int alignment;
10600
10601 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
10602 alignment = dataMember->structAlignment;
10603 if(isMember)
10604 {
10605 int __simpleStruct0;
10606
10607 if(alignment)
10608 {
10609 short __simpleStruct0;
10610
10611 if(member->memberOffset % alignment)
10612 member->memberOffset += alignment - (member->memberOffset % alignment);
10613 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10614 }
10615 dataMember->offset = member->memberOffset;
10616 if(member->type == 1)
10617 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10618 else
10619 member->memberOffset += dataMember->memberOffset;
10620 }
10621 else
10622 {
10623 if(alignment)
10624 {
10625 short __simpleStruct0;
10626
10627 if(_class->memberOffset % alignment)
10628 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10629 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10630 }
10631 dataMember->offset = _class->memberOffset;
10632 _class->memberOffset += dataMember->memberOffset;
10633 }
10634 }
10635 }
10636 }
10637 if(bitFields)
10638 {
10639 int alignment = 0;
10640 int size = (bitFields + 7) / 8;
10641
10642 if(isMember)
10643 {
10644 int __simpleStruct0;
10645
10646 if(alignment)
10647 {
10648 short __simpleStruct0;
10649
10650 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10651 if(member->memberOffset % alignment)
10652 member->memberOffset += alignment - (member->memberOffset % alignment);
10653 }
10654 if(member->type == 1)
10655 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10656 else
10657 {
10658 member->memberOffset += size;
10659 }
10660 }
10661 else
10662 {
10663 if(alignment)
10664 {
10665 short __simpleStruct0;
10666
10667 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10668 if(_class->memberOffset % alignment)
10669 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10670 }
10671 _class->memberOffset += size;
10672 }
10673 bitFields = 0;
10674 }
10675 }
10676 if(member && member->type == 1)
10677 {
10678 member->memberOffset = unionMemberOffset;
10679 }
10680 if(!isMember)
10681 {
10682 if(_class->type != 2)
10683 {
10684 int extra = 0;
10685
10686 if(_class->structAlignment)
10687 {
10688 if(_class->memberOffset % _class->structAlignment)
10689 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
10690 }
10691 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
10692 if(!member)
10693 {
10694 struct __ecereNameSpace__ecere__com__Property * prop;
10695
10696 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
10697 {
10698 if(prop->isProperty && prop->isWatchable)
10699 {
10700 prop->watcherOffset = _class->structSize;
10701 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10702 }
10703 }
10704 }
10705 {
10706 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
10707
10708 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
10709 {
10710 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
10711
10712 if(deriv->computeSize)
10713 {
10714 deriv->offset = _class->structSize;
10715 deriv->memberOffset = 0;
10716 deriv->structSize = deriv->offset;
10717 ComputeClassMembers(deriv, 0);
10718 }
10719 }
10720 }
10721 }
10722 }
10723 }
10724 if(context)
10725 FinishTemplatesContext(context);
10726 }
10727
10728 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)
10729 {
10730 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10731 unsigned int totalSize = 0;
10732 unsigned int maxSize = 0;
10733 int alignment;
10734 unsigned int size;
10735 struct __ecereNameSpace__ecere__com__DataMember * member;
10736 int anonID = 1;
10737 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10738
10739 if(addedPadding)
10740 *addedPadding = 0;
10741 if(!isMember && _class->base)
10742 {
10743 maxSize = _class->structSize;
10744 {
10745 if(_class->type == 1 || _class->type == 5)
10746 AddMembers(neededBy, declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
10747 else
10748 {
10749 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
10750
10751 if(maxSize > baseSize)
10752 maxSize -= baseSize;
10753 else
10754 maxSize = 0;
10755 }
10756 }
10757 }
10758 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
10759 {
10760 if(!member->isProperty)
10761 {
10762 switch(member->type)
10763 {
10764 case 0:
10765 {
10766 if(member->dataTypeString)
10767 {
10768 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
10769 struct Declarator * decl;
10770
10771 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
10772 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
10773 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
10774 if(!member->dataType)
10775 member->dataType = ProcessType(specs, decl);
10776 ReplaceThisClassSpecifiers(specs, topClass);
10777 {
10778 struct Type * type = ProcessType(specs, decl);
10779
10780 DeclareType(neededBy, member->dataType, 1, 0);
10781 FreeType(type);
10782 }
10783 ComputeTypeSize(member->dataType);
10784 size = member->dataType->size;
10785 alignment = member->dataType->alignment;
10786 if(alignment)
10787 {
10788 if(totalSize % alignment)
10789 totalSize += alignment - (totalSize % alignment);
10790 }
10791 totalSize += size;
10792 }
10793 break;
10794 }
10795 case 1:
10796 case 2:
10797 {
10798 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
10799 char id[100];
10800
10801 sprintf(id, "__anon%d", anonID++);
10802 size = 0;
10803 AddMembers(neededBy, list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
10804 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
10805 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
10806 alignment = member->structAlignment;
10807 if(alignment)
10808 {
10809 if(totalSize % alignment)
10810 totalSize += alignment - (totalSize % alignment);
10811 }
10812 totalSize += size;
10813 break;
10814 }
10815 }
10816 }
10817 }
10818 if(retSize)
10819 {
10820 unsigned int __simpleStruct0;
10821
10822 if(topMember && topMember->type == 1)
10823 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
10824 else
10825 *retSize += totalSize;
10826 }
10827 else if(totalSize < maxSize && _class->type != 1000)
10828 {
10829 int autoPadding = 0;
10830
10831 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
10832 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
10833 if(totalSize + autoPadding < maxSize)
10834 {
10835 char sizeString[50];
10836
10837 sprintf(sizeString, "%d", maxSize - totalSize);
10838 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
10839 if(addedPadding)
10840 *addedPadding = 1;
10841 }
10842 }
10843 if(context)
10844 FinishTemplatesContext(context);
10845 return topMember ? topMember->memberID : _class->memberID;
10846 }
10847
10848 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)
10849 {
10850 if(source && dest)
10851 {
10852 if(warnConst)
10853 CheckConstCompatibility(source, dest, 1);
10854 if(source->kind == 20 && dest->kind != 20)
10855 {
10856 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
10857
10858 if(type)
10859 source = type;
10860 }
10861 if(dest->kind == 20 && source->kind != 20)
10862 {
10863 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
10864
10865 if(type)
10866 dest = type;
10867 }
10868 if(dest->classObjectType == 2 && dest->kind != 11)
10869 {
10870 if(source->classObjectType != 3)
10871 return 1;
10872 else
10873 {
10874 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
10875 {
10876 return 1;
10877 }
10878 }
10879 }
10880 else
10881 {
10882 if(source->kind != 11 && source->classObjectType == 3)
10883 return 1;
10884 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
10885 return 1;
10886 }
10887 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
10888 {
10889 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))
10890 return 1;
10891 }
10892 if(dest->kind == 14 && source->kind != 0)
10893 return 1;
10894 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))
10895 return 1;
10896 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))
10897 return 1;
10898 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
10899 {
10900 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
10901 {
10902 if(conversions != (((void *)0)))
10903 {
10904 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
10905 return 1;
10906 }
10907 else
10908 {
10909 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
10910
10911 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
10912 ;
10913 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
10914 ;
10915 if(sourceBase == destBase)
10916 return 1;
10917 }
10918 }
10919 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))
10920 return 1;
10921 else
10922 {
10923 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4 && ((source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type != 4) || source->kind == 8))
10924 {
10925 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
10926 {
10927 return 1;
10928 }
10929 }
10930 }
10931 }
10932 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
10933 return 1;
10934 if(doConversion)
10935 {
10936 if(source->kind == 8)
10937 {
10938 struct __ecereNameSpace__ecere__com__Class * _class;
10939
10940 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10941 {
10942 struct __ecereNameSpace__ecere__com__Property * convert;
10943
10944 for(convert = _class->conversions.first; convert; convert = convert->next)
10945 {
10946 if(convert->memberAccess == 1 || _class->module == privateModule)
10947 {
10948 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10949
10950 if(!convert->dataType)
10951 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10952 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))
10953 {
10954 if(!conversions && !convert->Get)
10955 return 1;
10956 else if(conversions != (((void *)0)))
10957 {
10958 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))
10959 return 1;
10960 else
10961 {
10962 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10963
10964 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10965 return 1;
10966 }
10967 }
10968 }
10969 }
10970 }
10971 }
10972 }
10973 if(dest->kind == 8)
10974 {
10975 struct __ecereNameSpace__ecere__com__Class * _class;
10976
10977 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10978 {
10979 struct __ecereNameSpace__ecere__com__Property * convert;
10980
10981 for(convert = _class->conversions.first; convert; convert = convert->next)
10982 {
10983 if(convert->memberAccess == 1 || _class->module == privateModule)
10984 {
10985 struct Type * constType = (((void *)0));
10986 unsigned int success = 0;
10987
10988 if(!convert->dataType)
10989 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10990 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
10991 {
10992 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10993
10994 constType = __extension__ ({
10995 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10996
10997 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
10998 });
10999 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
11000 ptrType->constant = 1;
11001 }
11002 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
11003 {
11004 if(!conversions && !convert->Set)
11005 success = 1;
11006 else if(conversions != (((void *)0)))
11007 {
11008 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))
11009 success = 1;
11010 else
11011 {
11012 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
11013
11014 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
11015 success = 1;
11016 }
11017 }
11018 }
11019 if(constType)
11020 FreeType(constType);
11021 if(success)
11022 return 1;
11023 }
11024 }
11025 }
11026 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
11027 {
11028 if(!dest->__anon1._class->__anon1.registered->dataType)
11029 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
11030 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
11031 {
11032 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))
11033 {
11034 return 1;
11035 }
11036 }
11037 }
11038 }
11039 if(source->kind == 8)
11040 {
11041 struct __ecereNameSpace__ecere__com__Class * _class;
11042
11043 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
11044 {
11045 struct __ecereNameSpace__ecere__com__Property * convert;
11046
11047 for(convert = _class->conversions.first; convert; convert = convert->next)
11048 {
11049 if(convert->memberAccess == 1 || _class->module == privateModule)
11050 {
11051 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
11052
11053 if(!convert->dataType)
11054 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
11055 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))
11056 {
11057 if(!conversions && !convert->Get)
11058 return 1;
11059 else if(conversions != (((void *)0)))
11060 {
11061 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))
11062 return 1;
11063 else
11064 {
11065 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
11066
11067 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
11068 return 1;
11069 }
11070 }
11071 }
11072 }
11073 }
11074 }
11075 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
11076 {
11077 if(!source->__anon1._class->__anon1.registered->dataType)
11078 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
11079 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
11080 {
11081 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))
11082 return 1;
11083 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
11084 return 1;
11085 }
11086 }
11087 }
11088 }
11089 if(source->kind == 8 || source->kind == 19)
11090 ;
11091 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
11092 return 1;
11093 else if(dest->kind == 7 && source->kind == 6)
11094 return 1;
11095 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
11096 return 1;
11097 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
11098 return 1;
11099 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
11100 return 1;
11101 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
11102 return 1;
11103 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
11104 return 1;
11105 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))
11106 return 1;
11107 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))
11108 return 1;
11109 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)))
11110 {
11111 struct Type * paramSource, * paramDest;
11112
11113 if(dest->kind == 16)
11114 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
11115 if(source->kind == 16)
11116 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
11117 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
11118 dest = dest->__anon1.type;
11119 if(source->kind == 13 && source->__anon1.type->kind == 11)
11120 source = source->__anon1.type;
11121 if(dest->kind == 16)
11122 dest = dest->__anon1.__anon3.method->dataType;
11123 if(source->kind == 16)
11124 source = source->__anon1.__anon3.method->dataType;
11125 paramSource = source->__anon1.__anon2.params.first;
11126 if(paramSource && paramSource->kind == 0)
11127 paramSource = (((void *)0));
11128 paramDest = dest->__anon1.__anon2.params.first;
11129 if(paramDest && paramDest->kind == 0)
11130 paramDest = (((void *)0));
11131 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11132 {
11133 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))))
11134 {
11135 if(paramDest && paramDest->kind == 8)
11136 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
11137 else
11138 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
11139 return 0;
11140 }
11141 paramDest = paramDest->next;
11142 }
11143 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
11144 {
11145 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11146 {
11147 if(dest->__anon1.__anon2.thisClass)
11148 {
11149 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
11150 {
11151 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11152 return 0;
11153 }
11154 }
11155 else
11156 {
11157 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
11158 {
11159 if(owningClassDest)
11160 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
11161 else
11162 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
11163 return 0;
11164 }
11165 }
11166 paramSource = paramSource->next;
11167 }
11168 else
11169 {
11170 if(dest->__anon1.__anon2.thisClass)
11171 {
11172 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
11173 {
11174 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11175 return 0;
11176 }
11177 }
11178 else
11179 {
11180 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
11181 {
11182 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
11183 return 0;
11184 }
11185 }
11186 }
11187 }
11188 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
11189 {
11190 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
11191 return 0;
11192 }
11193 else
11194 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
11195 for(; paramDest; paramDest = paramDest->next)
11196 {
11197 if(!paramSource)
11198 {
11199 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
11200 return 0;
11201 }
11202 {
11203 struct Type * paramDestType = paramDest;
11204 struct Type * paramSourceType = paramSource;
11205 struct Type * type = paramDestType;
11206
11207 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
11208 {
11209 int id = 0;
11210 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
11211 struct __ecereNameSpace__ecere__com__Class * sClass;
11212
11213 for(sClass = owningClassSource; sClass; sClass = sClass->base)
11214 {
11215 id = 0;
11216 if(sClass->templateClass)
11217 sClass = sClass->templateClass;
11218 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
11219 {
11220 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
11221 {
11222 for(sClass = sClass->base; sClass; sClass = sClass->base)
11223 {
11224 if(sClass->templateClass)
11225 sClass = sClass->templateClass;
11226 id += sClass->templateParams.count;
11227 }
11228 break;
11229 }
11230 id++;
11231 }
11232 if(curParam)
11233 break;
11234 }
11235 if(curParam)
11236 {
11237 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
11238
11239 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
11240 }
11241 }
11242 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)))
11243 {
11244 char type[1024];
11245
11246 type[0] = 0;
11247 PrintType(paramDest, type, 0, 1);
11248 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
11249 if(paramDestType != paramDest)
11250 FreeType(paramDestType);
11251 return 0;
11252 }
11253 if(paramDestType != paramDest)
11254 FreeType(paramDestType);
11255 }
11256 paramSource = paramSource->next;
11257 }
11258 if(paramSource)
11259 {
11260 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
11261 return 0;
11262 }
11263 return 1;
11264 }
11265 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
11266 {
11267 return 1;
11268 }
11269 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
11270 {
11271 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))
11272 {
11273 ComputeTypeSize(source->__anon1.type);
11274 ComputeTypeSize(dest->__anon1.type);
11275 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))
11276 return 1;
11277 }
11278 }
11279 }
11280 return 0;
11281 }
11282
11283 void ComputeInstantiation(struct Expression * exp)
11284 {
11285 struct Instantiation * inst = exp->__anon1.instance;
11286 struct MembersInit * members;
11287 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11288 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11289 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11290 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11291 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11292 int subMemberStackPos = 0;
11293 uint64 bits = 0;
11294
11295 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11296 {
11297 if(inst->data)
11298 return ;
11299 if(_class->type == 0 || _class->type == 5)
11300 {
11301 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11302 if(_class->type == 0)
11303 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11304 }
11305 else
11306 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11307 }
11308 if(inst->members)
11309 {
11310 for(members = (*inst->members).first; members; members = members->next)
11311 {
11312 switch(members->type)
11313 {
11314 case 0:
11315 {
11316 if(members->__anon1.dataMembers)
11317 {
11318 struct MemberInit * member;
11319
11320 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11321 {
11322 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11323 unsigned int found = 0;
11324 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11325 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11326 unsigned int dataMemberOffset;
11327
11328 if(!ident)
11329 {
11330 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11331 if(curMember)
11332 {
11333 if(curMember->isProperty)
11334 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11335 else
11336 {
11337 dataMember = curMember;
11338 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11339 if(_class->type == 0)
11340 dataMemberOffset += _class->base->structSize;
11341 }
11342 found = 1;
11343 }
11344 }
11345 else
11346 {
11347 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11348 if(prop)
11349 {
11350 found = 1;
11351 if(prop->memberAccess == 1)
11352 {
11353 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11354 curClass = prop->_class;
11355 }
11356 }
11357 else
11358 {
11359 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11360 int _subMemberStackPos = 0;
11361
11362 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11363 if(dataMember)
11364 {
11365 found = 1;
11366 if(dataMember->memberAccess == 1)
11367 {
11368 curMember = dataMember;
11369 curClass = dataMember->_class;
11370 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11371 subMemberStackPos = _subMemberStackPos;
11372 }
11373 }
11374 }
11375 }
11376 if(found && member->initializer && member->initializer->type == 0)
11377 {
11378 struct Expression * value = member->initializer->__anon1.exp;
11379 struct Type * type = (((void *)0));
11380 unsigned int deepMember = 0;
11381
11382 if(prop)
11383 {
11384 type = prop->dataType;
11385 }
11386 else if(dataMember)
11387 {
11388 if(!dataMember->dataType)
11389 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11390 type = dataMember->dataType;
11391 }
11392 if(ident && ident->next)
11393 {
11394 deepMember = 1;
11395 for(ident = ident->next; ident && type; ident = ident->next)
11396 {
11397 if(type->kind == 8)
11398 {
11399 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11400 if(prop)
11401 type = prop->dataType;
11402 else
11403 {
11404 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11405 if(dataMember)
11406 type = dataMember->dataType;
11407 }
11408 }
11409 else if(type->kind == 9 || type->kind == 10)
11410 {
11411 struct Type * memberType;
11412
11413 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11414 {
11415 if(!strcmp(memberType->name, ident->string))
11416 {
11417 type = memberType;
11418 break;
11419 }
11420 }
11421 }
11422 }
11423 }
11424 if(value)
11425 {
11426 FreeType(value->destType);
11427 value->destType = type;
11428 if(type)
11429 type->refCount++;
11430 ComputeExpression(value);
11431 }
11432 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11433 {
11434 if(type->kind == 8)
11435 {
11436 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11437
11438 if(_class && (_class->type == 2 || _class->type == 3 || _class->type == 4))
11439 {
11440 if(!_class->dataType)
11441 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11442 type = _class->dataType;
11443 }
11444 }
11445 if(dataMember)
11446 {
11447 void * ptr = inst->data + dataMemberOffset;
11448
11449 if(value->type == 2)
11450 {
11451 switch(type->kind)
11452 {
11453 case 3:
11454 {
11455 GetInt(value, (int *)ptr);
11456 break;
11457 }
11458 case 4:
11459 {
11460 GetInt64(value, (long long *)ptr);
11461 break;
11462 }
11463 case 22:
11464 {
11465 GetIntPtr(value, (intptr_t *)ptr);
11466 break;
11467 }
11468 case 23:
11469 {
11470 GetIntSize(value, (ssize_t *)ptr);
11471 break;
11472 }
11473 case 6:
11474 {
11475 GetFloat(value, (float *)ptr);
11476 break;
11477 }
11478 case 7:
11479 {
11480 GetDouble(value, (double *)ptr);
11481 break;
11482 }
11483 }
11484 }
11485 else if(value->type == 1)
11486 {
11487 if(type->kind == 8)
11488 {
11489 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11490
11491 if(_class->type == 1)
11492 {
11493 ComputeTypeSize(type);
11494 if(value->__anon1.instance->data)
11495 memcpy(ptr, value->__anon1.instance->data, type->size);
11496 }
11497 }
11498 }
11499 }
11500 else if(prop && prop->Set != (void *)(intptr_t)1)
11501 {
11502 if(value->type == 1 && value->__anon1.instance->data)
11503 {
11504 if(type->kind == 8)
11505 {
11506 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11507
11508 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)))
11509 {
11510 void (* Set)(void *, void *) = (void *)prop->Set;
11511
11512 Set(inst->data, value->__anon1.instance->data);
11513 PopulateInstance(inst);
11514 }
11515 }
11516 }
11517 else if(value->type == 2)
11518 {
11519 switch(type->kind)
11520 {
11521 case 7:
11522 {
11523 void (* Set)(void *, double) = (void *)prop->Set;
11524
11525 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11526 break;
11527 }
11528 case 6:
11529 {
11530 void (* Set)(void *, float) = (void *)prop->Set;
11531
11532 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11533 break;
11534 }
11535 case 3:
11536 {
11537 void (* Set)(void *, int) = (void *)prop->Set;
11538
11539 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11540 break;
11541 }
11542 case 4:
11543 {
11544 void (* Set)(void *, long long) = (void *)prop->Set;
11545
11546 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11547 break;
11548 }
11549 case 22:
11550 {
11551 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11552
11553 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11554 break;
11555 }
11556 case 23:
11557 {
11558 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11559
11560 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11561 break;
11562 }
11563 }
11564 }
11565 else if(value->type == 3)
11566 {
11567 char temp[1024];
11568
11569 ReadString(temp, value->__anon1.__anon2.string);
11570 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11571 }
11572 }
11573 }
11574 else if(!deepMember && type && _class->type == 3)
11575 {
11576 if(prop)
11577 {
11578 if(value->type == 2)
11579 {
11580 if(type->kind == 8)
11581 {
11582 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11583
11584 if(_class->type == 3)
11585 {
11586 if(!_class->dataType)
11587 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11588 type = _class->dataType;
11589 }
11590 }
11591 switch(type->kind)
11592 {
11593 case 6:
11594 {
11595 float fValue;
11596 float (* Set)(float) = (void *)prop->Set;
11597
11598 GetFloat(member->initializer->__anon1.exp, &fValue);
11599 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11600 exp->type = 2;
11601 break;
11602 }
11603 case 7:
11604 {
11605 double dValue;
11606 double (* Set)(double) = (void *)prop->Set;
11607
11608 GetDouble(member->initializer->__anon1.exp, &dValue);
11609 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11610 exp->type = 2;
11611 break;
11612 }
11613 }
11614 }
11615 }
11616 }
11617 else if(!deepMember && type && _class->type == 2)
11618 {
11619 if(prop)
11620 {
11621 if(value->type == 1 && value->__anon1.instance->data)
11622 {
11623 unsigned int (* Set)(void *) = (void *)prop->Set;
11624
11625 bits = Set(value->__anon1.instance->data);
11626 }
11627 else if(value->type == 2)
11628 {
11629 }
11630 }
11631 else if(dataMember)
11632 {
11633 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11634 struct Type * type;
11635 uint64 part = 0;
11636
11637 bits = (bits & ~bitMember->mask);
11638 if(!bitMember->dataType)
11639 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11640 type = bitMember->dataType;
11641 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11642 {
11643 if(!type->__anon1._class->__anon1.registered->dataType)
11644 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11645 type = type->__anon1._class->__anon1.registered->dataType;
11646 }
11647 switch(type->kind)
11648 {
11649 case 24:
11650 case 1:
11651 {
11652 unsigned char v;
11653
11654 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11655 part = (uint64)v;
11656 break;
11657 }
11658 case 2:
11659 {
11660 unsigned short v;
11661
11662 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11663 part = (uint64)v;
11664 break;
11665 }
11666 case 3:
11667 case 5:
11668 {
11669 unsigned int v;
11670
11671 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11672 part = (uint64)v;
11673 break;
11674 }
11675 case 4:
11676 {
11677 uint64 v;
11678
11679 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11680 part = v;
11681 break;
11682 }
11683 case 22:
11684 {
11685 uintptr_t v;
11686
11687 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11688 part = (uint64)v;
11689 break;
11690 }
11691 case 23:
11692 {
11693 size_t v;
11694
11695 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11696 part = (uint64)v;
11697 break;
11698 }
11699 }
11700 bits |= part << bitMember->pos;
11701 }
11702 }
11703 }
11704 else
11705 {
11706 if(_class && _class->type == 3)
11707 {
11708 ComputeExpression(member->initializer->__anon1.exp);
11709 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11710 exp->type = 2;
11711 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11712 }
11713 }
11714 }
11715 }
11716 break;
11717 }
11718 }
11719 }
11720 }
11721 if(_class && _class->type == 2)
11722 {
11723 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11724 exp->type = 2;
11725 }
11726 if(exp->type != 1)
11727 {
11728 FreeInstance(inst);
11729 }
11730 }
11731
11732 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11733 {
11734 if(exp->__anon1.op.op == SIZEOF)
11735 {
11736 FreeExpContents(exp);
11737 exp->type = 2;
11738 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11739 }
11740 else
11741 {
11742 if(!exp->__anon1.op.exp1)
11743 {
11744 switch(exp->__anon1.op.op)
11745 {
11746 case '+':
11747 {
11748 struct Expression * exp2 = exp->__anon1.op.exp2;
11749
11750 exp->__anon1.op.exp2 = (((void *)0));
11751 FreeExpContents(exp);
11752 FreeType(exp->expType);
11753 FreeType(exp->destType);
11754 *exp = *exp2;
11755 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11756 break;
11757 }
11758 case '-':
11759 if(op1->ops.Neg)
11760 {
11761 FreeExpContents(exp);
11762 op1->ops.Neg(exp, op1);
11763 }
11764 break;
11765 case '~':
11766 if(op1->ops.BitNot)
11767 {
11768 FreeExpContents(exp);
11769 op1->ops.BitNot(exp, op1);
11770 }
11771 break;
11772 case '!':
11773 if(op1->ops.Not)
11774 {
11775 FreeExpContents(exp);
11776 op1->ops.Not(exp, op1);
11777 }
11778 break;
11779 }
11780 }
11781 else
11782 {
11783 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11784 {
11785 if(Promote(op2, op1->kind, op1->type->isSigned))
11786 op2->kind = op1->kind, op2->ops = op1->ops;
11787 else if(Promote(op1, op2->kind, op2->type->isSigned))
11788 op1->kind = op2->kind, op1->ops = op2->ops;
11789 }
11790 switch(exp->__anon1.op.op)
11791 {
11792 case '+':
11793 if(op1->ops.Add)
11794 {
11795 FreeExpContents(exp);
11796 op1->ops.Add(exp, op1, op2);
11797 }
11798 break;
11799 case '-':
11800 if(op1->ops.Sub)
11801 {
11802 FreeExpContents(exp);
11803 op1->ops.Sub(exp, op1, op2);
11804 }
11805 break;
11806 case '*':
11807 if(op1->ops.Mul)
11808 {
11809 FreeExpContents(exp);
11810 op1->ops.Mul(exp, op1, op2);
11811 }
11812 break;
11813 case '/':
11814 if(op1->ops.Div)
11815 {
11816 FreeExpContents(exp);
11817 op1->ops.Div(exp, op1, op2);
11818 }
11819 break;
11820 case '%':
11821 if(op1->ops.Mod)
11822 {
11823 FreeExpContents(exp);
11824 op1->ops.Mod(exp, op1, op2);
11825 }
11826 break;
11827 case '&':
11828 if(exp->__anon1.op.exp2)
11829 {
11830 if(op1->ops.BitAnd)
11831 {
11832 FreeExpContents(exp);
11833 op1->ops.BitAnd(exp, op1, op2);
11834 }
11835 }
11836 break;
11837 case '|':
11838 if(op1->ops.BitOr)
11839 {
11840 FreeExpContents(exp);
11841 op1->ops.BitOr(exp, op1, op2);
11842 }
11843 break;
11844 case '^':
11845 if(op1->ops.BitXor)
11846 {
11847 FreeExpContents(exp);
11848 op1->ops.BitXor(exp, op1, op2);
11849 }
11850 break;
11851 case LEFT_OP:
11852 if(op1->ops.LShift)
11853 {
11854 FreeExpContents(exp);
11855 op1->ops.LShift(exp, op1, op2);
11856 }
11857 break;
11858 case RIGHT_OP:
11859 if(op1->ops.RShift)
11860 {
11861 FreeExpContents(exp);
11862 op1->ops.RShift(exp, op1, op2);
11863 }
11864 break;
11865 case EQ_OP:
11866 if(op1->ops.Equ)
11867 {
11868 FreeExpContents(exp);
11869 op1->ops.Equ(exp, op1, op2);
11870 }
11871 break;
11872 case NE_OP:
11873 if(op1->ops.Nqu)
11874 {
11875 FreeExpContents(exp);
11876 op1->ops.Nqu(exp, op1, op2);
11877 }
11878 break;
11879 case AND_OP:
11880 if(op1->ops.And)
11881 {
11882 FreeExpContents(exp);
11883 op1->ops.And(exp, op1, op2);
11884 }
11885 break;
11886 case OR_OP:
11887 if(op1->ops.Or)
11888 {
11889 FreeExpContents(exp);
11890 op1->ops.Or(exp, op1, op2);
11891 }
11892 break;
11893 case '>':
11894 if(op1->ops.Grt)
11895 {
11896 FreeExpContents(exp);
11897 op1->ops.Grt(exp, op1, op2);
11898 }
11899 break;
11900 case '<':
11901 if(op1->ops.Sma)
11902 {
11903 FreeExpContents(exp);
11904 op1->ops.Sma(exp, op1, op2);
11905 }
11906 break;
11907 case GE_OP:
11908 if(op1->ops.GrtEqu)
11909 {
11910 FreeExpContents(exp);
11911 op1->ops.GrtEqu(exp, op1, op2);
11912 }
11913 break;
11914 case LE_OP:
11915 if(op1->ops.SmaEqu)
11916 {
11917 FreeExpContents(exp);
11918 op1->ops.SmaEqu(exp, op1, op2);
11919 }
11920 break;
11921 }
11922 }
11923 }
11924 }
11925
11926 void ApplyAnyObjectLogic(struct Expression * e)
11927 {
11928 struct Type * destType = e->destType;
11929
11930 if(destType && (destType->classObjectType == 3))
11931 {
11932 if(e && e->expType)
11933 {
11934 struct Type * type = e->expType;
11935 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11936
11937 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11938 {
11939 _class = type->__anon1._class->__anon1.registered;
11940 }
11941 else if(type->kind == 19)
11942 {
11943 _class = FindClass("ecere::com::Class")->__anon1.registered;
11944 }
11945 else
11946 {
11947 char string[1024] = "";
11948 struct Symbol * classSym;
11949
11950 PrintTypeNoConst(type, string, 0, 1);
11951 classSym = FindClass(string);
11952 if(classSym)
11953 _class = classSym->__anon1.registered;
11954 }
11955 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)))
11956 {
11957 if(!_class || strcmp(_class->fullName, "char *"))
11958 {
11959 struct Expression * checkedExp = e, * newExp;
11960
11961 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11962 {
11963 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11964 {
11965 if(checkedExp->type == 23)
11966 {
11967 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11968 }
11969 else
11970 checkedExp = (*checkedExp->__anon1.list).last;
11971 }
11972 else if(checkedExp->type == 11)
11973 checkedExp = checkedExp->__anon1.cast.exp;
11974 }
11975 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
11976 {
11977 newExp = checkedExp->__anon1.op.exp2;
11978 checkedExp->__anon1.op.exp2 = (((void *)0));
11979 FreeExpContents(checkedExp);
11980 if(e->expType && e->expType->passAsTemplate)
11981 {
11982 char size[100];
11983
11984 ComputeTypeSize(e->expType);
11985 sprintf(size, "%d", e->expType->size);
11986 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))))));
11987 }
11988 ReplaceExpContents(checkedExp, newExp);
11989 e->byReference = 1;
11990 }
11991 else if(!e->byReference || (_class && _class->type == 5))
11992 {
11993 struct Expression * checkedExp;
11994
11995 {
11996 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;
11997
11998 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11999 {
12000 struct Context * context = PushContext();
12001 struct Declarator * decl;
12002 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12003 char typeString[1024];
12004 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12005
12006 typeString[0] = '\0';
12007 *newExp = *e;
12008 newExp->prev = (((void *)0));
12009 newExp->next = (((void *)0));
12010 newExp->expType = (((void *)0));
12011 PrintTypeNoConst(e->expType, typeString, 0, 1);
12012 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12013 newExp->destType = ProcessType(specs, decl);
12014 curContext = context;
12015 if(curCompound)
12016 {
12017 char name[100];
12018 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12019
12020 e->type = 23;
12021 sprintf(name, "__internalValue%03X", internalValueCounter++);
12022 if(!curCompound->__anon1.compound.declarations)
12023 curCompound->__anon1.compound.declarations = MkList();
12024 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12025 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12026 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12027 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
12028 }
12029 else
12030 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12031 {
12032 struct Type * type = e->destType;
12033
12034 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12035 CopyTypeInto(e->destType, type);
12036 e->destType->refCount = 1;
12037 e->destType->classObjectType = 0;
12038 FreeType(type);
12039 }
12040 e->__anon1.compound->__anon1.compound.context = context;
12041 PopContext(context);
12042 curContext = context->parent;
12043 }
12044 }
12045 checkedExp = e;
12046 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
12047 {
12048 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
12049 {
12050 if(checkedExp->type == 23)
12051 {
12052 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12053 }
12054 else
12055 checkedExp = (*checkedExp->__anon1.list).last;
12056 }
12057 else if(checkedExp->type == 11)
12058 checkedExp = checkedExp->__anon1.cast.exp;
12059 }
12060 {
12061 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12062
12063 *operand = *checkedExp;
12064 __ecereMethod_Expression_Clear(checkedExp);
12065 checkedExp->destType = ProcessTypeString("void *", 0);
12066 checkedExp->expType = checkedExp->destType;
12067 checkedExp->destType->refCount++;
12068 checkedExp->type = 4;
12069 checkedExp->__anon1.op.op = '&';
12070 checkedExp->__anon1.op.exp1 = (((void *)0));
12071 checkedExp->__anon1.op.exp2 = operand;
12072 }
12073 }
12074 }
12075 }
12076 }
12077 }
12078 {
12079 }
12080 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))))
12081 {
12082 if(e->expType->classObjectType && destType && destType->classObjectType)
12083 {
12084 return ;
12085 }
12086 else
12087 {
12088 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12089
12090 *thisExp = *e;
12091 thisExp->prev = (((void *)0));
12092 thisExp->next = (((void *)0));
12093 __ecereMethod_Expression_Clear(e);
12094 e->type = 5;
12095 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12096 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
12097 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
12098 {
12099 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12100 CopyTypeInto(e->expType, thisExp->expType);
12101 e->expType->byReference = 0;
12102 e->expType->refCount = 1;
12103 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))
12104 {
12105 e->expType->classObjectType = 0;
12106 }
12107 }
12108 }
12109 }
12110 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12111 {
12112 if(destType->kind == 14)
12113 {
12114 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
12115 }
12116 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))
12117 {
12118 unsigned int byReference = e->expType->byReference;
12119 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12120 struct Declarator * decl;
12121 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12122 char typeString[1024];
12123 struct Type * type;
12124 int backupClassObjectType;
12125 unsigned int backupByReference;
12126
12127 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
12128 type = e->expType;
12129 else
12130 type = destType;
12131 backupClassObjectType = type->classObjectType;
12132 backupByReference = type->byReference;
12133 type->classObjectType = 0;
12134 type->byReference = 0;
12135 typeString[0] = '\0';
12136 PrintType(type, typeString, 0, 1);
12137 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12138 type->classObjectType = backupClassObjectType;
12139 type->byReference = backupByReference;
12140 *thisExp = *e;
12141 thisExp->prev = (((void *)0));
12142 thisExp->next = (((void *)0));
12143 __ecereMethod_Expression_Clear(e);
12144 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)))
12145 {
12146 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
12147 struct Type * t;
12148
12149 destType->refCount++;
12150 e->type = 4;
12151 e->__anon1.op.op = '*';
12152 e->__anon1.op.exp1 = (((void *)0));
12153 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12154 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12155 CopyTypeInto(t, thisExp->destType);
12156 t->passAsTemplate = 0;
12157 FreeType(thisExp->destType);
12158 thisExp->destType = t;
12159 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12160 CopyTypeInto(t, destType);
12161 t->passAsTemplate = passAsTemplate;
12162 FreeType(destType);
12163 destType = t;
12164 destType->refCount = 0;
12165 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12166 CopyTypeInto(e->expType, type);
12167 if(type->passAsTemplate)
12168 {
12169 e->expType->classObjectType = 0;
12170 e->expType->passAsTemplate = 0;
12171 }
12172 e->expType->byReference = 0;
12173 e->expType->refCount = 1;
12174 }
12175 else
12176 {
12177 e->type = 11;
12178 e->__anon1.cast.typeName = MkTypeName(specs, decl);
12179 e->__anon1.cast.exp = thisExp;
12180 e->byReference = 1;
12181 e->expType = type;
12182 type->refCount++;
12183 }
12184 if(e->destType)
12185 FreeType(e->destType);
12186 e->destType = destType;
12187 destType->refCount++;
12188 }
12189 }
12190 }
12191
12192 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
12193 {
12194 struct __ecereNameSpace__ecere__com__Class * _class;
12195 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
12196
12197 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
12198 ComputeModuleClasses(subModule->data);
12199 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->classes.first; _class; _class = _class->next)
12200 ComputeClassMembers(_class, 0);
12201 }
12202
12203 int ComputeTypeSize(struct Type * type)
12204 {
12205 unsigned int size = type ? type->size : 0;
12206
12207 if(!size && type && !type->computing)
12208 {
12209 type->computing = 1;
12210 switch(type->kind)
12211 {
12212 case 24:
12213 type->alignment = size = sizeof(char);
12214 break;
12215 case 1:
12216 type->alignment = size = sizeof(char);
12217 break;
12218 case 3:
12219 type->alignment = size = sizeof(int);
12220 break;
12221 case 4:
12222 type->alignment = size = sizeof(long long);
12223 break;
12224 case 22:
12225 type->alignment = size = targetBits / 8;
12226 type->pointerAlignment = 1;
12227 break;
12228 case 23:
12229 type->alignment = size = targetBits / 8;
12230 type->pointerAlignment = 1;
12231 break;
12232 case 5:
12233 type->alignment = size = sizeof(long);
12234 break;
12235 case 2:
12236 type->alignment = size = sizeof(short);
12237 break;
12238 case 6:
12239 type->alignment = size = sizeof(float);
12240 break;
12241 case 7:
12242 type->alignment = size = sizeof(double);
12243 break;
12244 case 8:
12245 {
12246 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
12247
12248 if(_class && _class->type == 1)
12249 {
12250 ComputeClassMembers(_class, 0);
12251 type->alignment = _class->structAlignment;
12252 type->pointerAlignment = (unsigned int)_class->pointerAlignment;
12253 size = _class->structSize;
12254 if(type->alignment && size % type->alignment)
12255 size += type->alignment - (size % type->alignment);
12256 }
12257 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
12258 {
12259 if(!_class->dataType)
12260 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12261 size = type->alignment = ComputeTypeSize(_class->dataType);
12262 }
12263 else
12264 {
12265 size = type->alignment = targetBits / 8;
12266 type->pointerAlignment = 1;
12267 }
12268 break;
12269 }
12270 case 13:
12271 case 19:
12272 size = type->alignment = targetBits / 8;
12273 type->pointerAlignment = 1;
12274 break;
12275 case 12:
12276 if(type->__anon1.__anon4.arraySizeExp)
12277 {
12278 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
12279 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
12280 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)))
12281 {
12282 struct Location oldLoc = yylloc;
12283 char expression[10240];
12284
12285 expression[0] = '\0';
12286 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
12287 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
12288 if(inCompiler)
12289 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
12290 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
12291 yylloc = oldLoc;
12292 }
12293 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
12294 }
12295 else if(type->__anon1.__anon4.enumClass)
12296 {
12297 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
12298 {
12299 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
12300 }
12301 else
12302 type->__anon1.__anon4.arraySize = 0;
12303 }
12304 else
12305 {
12306 type->__anon1.__anon4.arraySize = 0;
12307 }
12308 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
12309 if(type->__anon1.type)
12310 {
12311 type->alignment = type->__anon1.type->alignment;
12312 type->pointerAlignment = type->__anon1.type->pointerAlignment;
12313 }
12314 break;
12315 case 9:
12316 {
12317 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12318 {
12319 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12320
12321 if(symbol && symbol->type)
12322 {
12323 ComputeTypeSize(symbol->type);
12324 size = symbol->type->size;
12325 }
12326 }
12327 else
12328 {
12329 struct Type * member;
12330
12331 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12332 {
12333 int __simpleStruct0, __simpleStruct1;
12334 unsigned int addSize = ComputeTypeSize(member);
12335
12336 member->offset = size;
12337 if(member->alignment && size % member->alignment)
12338 member->offset += member->alignment - (size % member->alignment);
12339 size = member->offset;
12340 if(member->pointerAlignment && type->size <= 4)
12341 type->pointerAlignment = 1;
12342 else if(!member->pointerAlignment && member->alignment >= 8)
12343 type->pointerAlignment = 0;
12344 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12345 size += addSize;
12346 }
12347 if(type->alignment && size % type->alignment)
12348 size += type->alignment - (size % type->alignment);
12349 }
12350 break;
12351 }
12352 case 10:
12353 {
12354 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12355 {
12356 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12357
12358 if(symbol && symbol->type)
12359 {
12360 ComputeTypeSize(symbol->type);
12361 size = symbol->type->size;
12362 type->alignment = symbol->type->alignment;
12363 }
12364 }
12365 else
12366 {
12367 struct Type * member;
12368
12369 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12370 {
12371 int __simpleStruct0, __simpleStruct1;
12372 unsigned int addSize = ComputeTypeSize(member);
12373
12374 member->offset = size;
12375 if(member->alignment && size % member->alignment)
12376 member->offset += member->alignment - (size % member->alignment);
12377 size = member->offset;
12378 if(member->pointerAlignment && type->size <= 4)
12379 type->pointerAlignment = 1;
12380 else if(!member->pointerAlignment && member->alignment >= 8)
12381 type->pointerAlignment = 0;
12382 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12383 size = ((size > addSize) ? size : addSize);
12384 }
12385 if(type->alignment && size % type->alignment)
12386 size += type->alignment - (size % type->alignment);
12387 }
12388 break;
12389 }
12390 case 20:
12391 {
12392 struct TemplateParameter * param = type->__anon1.templateParameter;
12393 struct Type * baseType = ProcessTemplateParameterType(param);
12394
12395 if(baseType)
12396 {
12397 size = ComputeTypeSize(baseType);
12398 type->alignment = baseType->alignment;
12399 type->pointerAlignment = baseType->pointerAlignment;
12400 }
12401 else
12402 type->alignment = size = sizeof(uint64);
12403 break;
12404 }
12405 case 15:
12406 {
12407 type->alignment = size = sizeof(enum
12408 {
12409 test
12410 });
12411 break;
12412 }
12413 case 21:
12414 {
12415 type->alignment = size = targetBits / 8;
12416 type->pointerAlignment = 1;
12417 break;
12418 }
12419 }
12420 type->size = size;
12421 type->computing = 0;
12422 }
12423 return size;
12424 }
12425
12426 struct External * _DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl)
12427 {
12428 struct External * external = (((void *)0));
12429 struct Symbol * classSym = FindClass(name);
12430 struct __ecereNameSpace__ecere__sys__OldList * curDeclarations = (((void *)0));
12431 struct Specifier * curSpec = (((void *)0));
12432
12433 if(!inCompiler || !classSym)
12434 return (((void *)0));
12435 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
12436 return (((void *)0));
12437 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
12438 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
12439 external = classSym->__anon2.__anon1.structExternal;
12440 if(external && external->__anon1.declaration)
12441 {
12442 struct Specifier * spec;
12443
12444 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12445 if(spec->type == 3 || spec->type == 4)
12446 {
12447 curSpec = spec;
12448 curDeclarations = spec->__anon1.__anon2.definitions;
12449 break;
12450 }
12451 }
12452 if(classSym->__anon1.registered && !classSym->declaring && classSym->imported && (!classSym->declaredStructSym || (classSym->__anon1.registered->type == 5 && !skipNoHead && external && !curDeclarations)))
12453 {
12454 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12455 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
12456 char structName[1024];
12457 unsigned int addedPadding = 0;
12458
12459 classSym->declaring++;
12460 if(strchr(classSym->string, '<'))
12461 {
12462 if(classSym->__anon1.registered->templateClass)
12463 {
12464 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
12465 classSym->declaring--;
12466 }
12467 return external;
12468 }
12469 structName[0] = 0;
12470 FullClassNameCat(structName, name, 0);
12471 classSym->declaredStructSym = 1;
12472 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
12473 {
12474 unsigned int add = 0;
12475
12476 if(!external)
12477 {
12478 external = MkExternalDeclaration((((void *)0)));
12479 classSym->__anon2.__anon1.structExternal = external;
12480 external->symbol = classSym;
12481 add = 1;
12482 }
12483 if(!skipNoHead)
12484 {
12485 declarations = MkList();
12486 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
12487 }
12488 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
12489 {
12490 FreeList(declarations, (void *)(FreeClassDef));
12491 declarations = (((void *)0));
12492 }
12493 if(classSym->__anon1.registered->type != 5 && !declarations)
12494 {
12495 FreeExternal(external);
12496 external = (((void *)0));
12497 classSym->__anon2.__anon1.structExternal = (((void *)0));
12498 }
12499 else
12500 {
12501 if(curSpec)
12502 curSpec->__anon1.__anon2.definitions = declarations;
12503 else
12504 {
12505 specifiers = MkList();
12506 declarators = MkList();
12507 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
12508 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12509 }
12510 if(add)
12511 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12512 }
12513 }
12514 classSym->declaring--;
12515 }
12516 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
12517 {
12518 classSym->declaredStructSym = 1;
12519 if(classSym->__anon1.registered)
12520 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
12521 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
12522 {
12523 struct Specifier * spec;
12524
12525 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
12526 {
12527 if(spec->__anon1.__anon2.definitions)
12528 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
12529 }
12530 }
12531 }
12532 if(inCompiler && neededBy && (external || !classSym->imported))
12533 {
12534 if(!external)
12535 {
12536 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
12537 external->symbol = classSym;
12538 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12539 }
12540 if(reachedPass15 && !external->__anon1.declaration && classSym->__anon1.registered && classSym->__anon1.registered->type == 5)
12541 {
12542 char structName[1024];
12543 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12544
12545 structName[0] = 0;
12546 FullClassNameCat(structName, name, 0);
12547 specifiers = MkList();
12548 declarators = MkList();
12549 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))));
12550 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12551 }
12552 if(fwdDecl)
12553 {
12554 struct External * e = external->fwdDecl ? external->fwdDecl : external;
12555
12556 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
12557 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
12558 }
12559 else
12560 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
12561 }
12562 return external;
12563 }
12564
12565 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)
12566 {
12567 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
12568 unsigned int found = 0;
12569 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
12570 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12571 unsigned int freeType = 0;
12572
12573 yylloc = member->loc;
12574 if(!ident)
12575 {
12576 if(curMember)
12577 {
12578 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
12579 if(*curMember)
12580 {
12581 found = 1;
12582 dataMember = *curMember;
12583 }
12584 }
12585 }
12586 else
12587 {
12588 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
12589 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
12590 int _subMemberStackPos = 0;
12591
12592 if(!thisMember)
12593 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
12594 if(thisMember)
12595 {
12596 dataMember = thisMember;
12597 if(curMember && thisMember->memberAccess == 1)
12598 {
12599 *curMember = thisMember;
12600 *curClass = thisMember->_class;
12601 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
12602 *subMemberStackPos = _subMemberStackPos;
12603 }
12604 found = 1;
12605 }
12606 else
12607 {
12608 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
12609 if(method && method->type == 1)
12610 found = 1;
12611 else
12612 method = (((void *)0));
12613 }
12614 }
12615 if(found)
12616 {
12617 struct Type * type = (((void *)0));
12618
12619 if(dataMember)
12620 {
12621 if(!dataMember->dataType && dataMember->dataTypeString)
12622 {
12623 struct Context * context = SetupTemplatesContext(_class);
12624
12625 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12626 FinishTemplatesContext(context);
12627 }
12628 type = dataMember->dataType;
12629 }
12630 else if(method)
12631 {
12632 if(!method->dataType)
12633 ProcessMethodType(method);
12634 type = method->dataType;
12635 }
12636 if(ident && ident->next)
12637 {
12638 for(ident = ident->next; ident && type; ident = ident->next)
12639 {
12640 if(type->kind == 8)
12641 {
12642 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
12643 if(!dataMember)
12644 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
12645 if(dataMember)
12646 type = dataMember->dataType;
12647 }
12648 else if(type->kind == 9 || type->kind == 10)
12649 {
12650 struct Type * memberType;
12651
12652 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
12653 {
12654 if(!strcmp(memberType->name, ident->string))
12655 {
12656 type = memberType;
12657 break;
12658 }
12659 }
12660 }
12661 }
12662 }
12663 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
12664 {
12665 int id = 0;
12666 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
12667 struct __ecereNameSpace__ecere__com__Class * sClass;
12668
12669 for(sClass = _class; sClass; sClass = sClass->base)
12670 {
12671 id = 0;
12672 if(sClass->templateClass)
12673 sClass = sClass->templateClass;
12674 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
12675 {
12676 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
12677 {
12678 for(sClass = sClass->base; sClass; sClass = sClass->base)
12679 {
12680 if(sClass->templateClass)
12681 sClass = sClass->templateClass;
12682 id += sClass->templateParams.count;
12683 }
12684 break;
12685 }
12686 id++;
12687 }
12688 if(curParam)
12689 break;
12690 }
12691 if(curParam)
12692 {
12693 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
12694
12695 if(arg.__anon1.__anon1.dataTypeString)
12696 {
12697 unsigned int constant = type->constant;
12698
12699 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
12700 if(type->kind == 8 && constant)
12701 type->constant = 1;
12702 else if(type->kind == 13)
12703 {
12704 struct Type * t = type->__anon1.type;
12705
12706 while(t->kind == 13)
12707 t = t->__anon1.type;
12708 if(constant)
12709 t->constant = constant;
12710 }
12711 freeType = 1;
12712 if(type && _class->templateClass)
12713 type->passAsTemplate = 1;
12714 if(type)
12715 {
12716 }
12717 }
12718 }
12719 }
12720 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
12721 {
12722 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
12723 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
12724 int paramCount = 0;
12725 int lastParam = -1;
12726 char templateString[1024];
12727 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
12728
12729 sprintf(templateString, "%s<", expClass->templateClass->fullName);
12730 for(cClass = expClass; cClass; cClass = cClass->base)
12731 {
12732 int p = 0;
12733
12734 if(cClass->templateClass)
12735 cClass = cClass->templateClass;
12736 for(param = cClass->templateParams.first; param; param = param->next)
12737 {
12738 int id = p;
12739 struct __ecereNameSpace__ecere__com__Class * sClass;
12740 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
12741
12742 for(sClass = cClass->base; sClass; sClass = sClass->base)
12743 {
12744 if(sClass->templateClass)
12745 sClass = sClass->templateClass;
12746 id += sClass->templateParams.count;
12747 }
12748 arg = expClass->templateArgs[id];
12749 for(sClass = _class; sClass; sClass = sClass->base)
12750 {
12751 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
12752 int p = 0;
12753 struct __ecereNameSpace__ecere__com__Class * nextClass;
12754
12755 if(sClass->templateClass)
12756 sClass = sClass->templateClass;
12757 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
12758 {
12759 if(nextClass->templateClass)
12760 nextClass = nextClass->templateClass;
12761 p += nextClass->templateParams.count;
12762 }
12763 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
12764 {
12765 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
12766 {
12767 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12768 {
12769 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
12770 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
12771 break;
12772 }
12773 }
12774 }
12775 }
12776 {
12777 char argument[256];
12778
12779 argument[0] = '\0';
12780 switch(param->type)
12781 {
12782 case 2:
12783 {
12784 char expString[1024];
12785 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12786 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
12787 struct Expression * exp;
12788 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
12789
12790 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
12791 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
12792 ProcessExpressionType(exp);
12793 ComputeExpression(exp);
12794 expString[0] = '\0';
12795 PrintExpression(exp, expString);
12796 strcat(argument, expString);
12797 FreeExpression(exp);
12798 break;
12799 }
12800 case 1:
12801 {
12802 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
12803 break;
12804 }
12805 case 0:
12806 {
12807 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12808 strcat(argument, arg.__anon1.__anon1.dataTypeString);
12809 break;
12810 }
12811 }
12812 if(argument[0])
12813 {
12814 if(paramCount)
12815 strcat(templateString, ", ");
12816 if(lastParam != p - 1)
12817 {
12818 strcat(templateString, param->name);
12819 strcat(templateString, " = ");
12820 }
12821 strcat(templateString, argument);
12822 paramCount++;
12823 lastParam = p;
12824 }
12825 p++;
12826 }
12827 }
12828 }
12829 {
12830 int len = strlen(templateString);
12831
12832 if(templateString[len - 1] == '<')
12833 len--;
12834 else
12835 {
12836 if(templateString[len - 1] == '>')
12837 templateString[len++] = ' ';
12838 templateString[len++] = '>';
12839 }
12840 templateString[len++] = '\0';
12841 }
12842 {
12843 struct Context * context = SetupTemplatesContext(_class);
12844
12845 if(freeType)
12846 FreeType(type);
12847 type = ProcessTypeString(templateString, 0);
12848 freeType = 1;
12849 FinishTemplatesContext(context);
12850 }
12851 }
12852 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
12853 {
12854 ProcessExpressionType(member->initializer->__anon1.exp);
12855 if(!member->initializer->__anon1.exp->expType)
12856 {
12857 if(inCompiler)
12858 {
12859 char expString[10240];
12860
12861 expString[0] = '\0';
12862 PrintExpression(member->initializer->__anon1.exp, expString);
12863 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12864 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
12865 }
12866 }
12867 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
12868 {
12869 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
12870 }
12871 }
12872 else if(member->initializer)
12873 {
12874 ProcessInitializer(member->initializer, type);
12875 }
12876 if(freeType)
12877 FreeType(type);
12878 }
12879 else
12880 {
12881 if(_class && _class->type == 3)
12882 {
12883 if(member->initializer)
12884 {
12885 struct Type * type = MkClassType(_class->fullName);
12886
12887 ProcessInitializer(member->initializer, type);
12888 FreeType(type);
12889 }
12890 }
12891 else
12892 {
12893 if(member->initializer)
12894 {
12895 ProcessInitializer(member->initializer, (((void *)0)));
12896 }
12897 if(ident)
12898 {
12899 if(method)
12900 {
12901 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12902 }
12903 else if(_class)
12904 {
12905 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12906 if(inCompiler)
12907 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
12908 }
12909 }
12910 else if(_class)
12911 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
12912 }
12913 }
12914 }
12915
12916 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
12917 {
12918 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
12919
12920 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)))
12921 {
12922 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
12923
12924 if(_class->type == 4)
12925 {
12926 struct __ecereNameSpace__ecere__sys__OldList converts =
12927 {
12928 0, 0, 0, 0, 0
12929 };
12930 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12931
12932 type->kind = 8;
12933 if(!_class->symbol)
12934 _class->symbol = FindClass(_class->fullName);
12935 type->__anon1._class = _class->symbol;
12936 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))
12937 {
12938 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12939 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12940
12941 if(enumClass)
12942 {
12943 struct __ecereNameSpace__ecere__com__Class * baseClass;
12944
12945 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12946 {
12947 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12948
12949 for(value = e->values.first; value; value = value->next)
12950 {
12951 if(!strcmp(value->name, string))
12952 break;
12953 }
12954 if(value)
12955 {
12956 FreeType(sourceExp->expType);
12957 sourceExp->isConstant = 1;
12958 sourceExp->expType = MkClassType(baseClass->fullName);
12959 if(inCompiler || inPreCompiler || inDebugger)
12960 {
12961 char constant[256];
12962
12963 FreeExpContents(sourceExp);
12964 sourceExp->type = 2;
12965 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
12966 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
12967 else
12968 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
12969 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12970 }
12971 while(converts.first)
12972 {
12973 struct Conversion * convert = converts.first;
12974
12975 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
12976 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
12977 }
12978 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12979 return 1;
12980 }
12981 }
12982 }
12983 }
12984 if(converts.first)
12985 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12986 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12987 }
12988 }
12989 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)))
12990 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
12991 return 1;
12992 return 0;
12993 }
12994
12995 void ComputeExpression(struct Expression * exp)
12996 {
12997 switch(exp->type)
12998 {
12999 case 0:
13000 {
13001 struct Identifier * id = exp->__anon1.__anon1.identifier;
13002
13003 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
13004 {
13005 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
13006
13007 if(c && c->type == 4)
13008 {
13009 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13010
13011 if(enumClass)
13012 {
13013 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
13014 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
13015
13016 for(value = e->values.first; value; value = value->next)
13017 {
13018 if(!strcmp(value->name, id->string))
13019 break;
13020 }
13021 if(value)
13022 {
13023 const char * dts = c->dataTypeString;
13024
13025 FreeExpContents(exp);
13026 exp->type = 2;
13027 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
13028 }
13029 }
13030 }
13031 }
13032 break;
13033 }
13034 case 1:
13035 {
13036 ComputeInstantiation(exp);
13037 break;
13038 }
13039 case 4:
13040 {
13041 struct Expression * exp1, * exp2 = (((void *)0));
13042 struct Operand op1 =
13043 {
13044 0, 0, 0,
13045 .__anon1 = {
13046 .c = 0
13047 },
13048 {
13049 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13050 }
13051 };
13052 struct Operand op2 =
13053 {
13054 0, 0, 0,
13055 .__anon1 = {
13056 .c = 0
13057 },
13058 {
13059 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13060 }
13061 };
13062
13063 if(exp->__anon1.op.exp2)
13064 {
13065 struct Expression * e = exp->__anon1.op.exp2;
13066
13067 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13068 {
13069 if(e->type == 5 || e->type == 32 || e->type == 23)
13070 {
13071 if(e->type == 23)
13072 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13073 else
13074 e = (*e->__anon1.list).last;
13075 }
13076 }
13077 if(exp->__anon1.op.op == 261 && e && e->expType)
13078 {
13079 if(e->type == 3 && e->__anon1.__anon2.string)
13080 {
13081 char * string = e->__anon1.__anon2.string;
13082 int len = strlen(string);
13083 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13084
13085 len = UnescapeString(tmp, string + 1, len - 2);
13086 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13087 FreeExpContents(exp);
13088 exp->type = 2;
13089 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13090 }
13091 else
13092 {
13093 struct Type * type = e->expType;
13094
13095 type->refCount++;
13096 FreeExpContents(exp);
13097 exp->type = 2;
13098 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13099 FreeType(type);
13100 }
13101 break;
13102 }
13103 else
13104 ComputeExpression(exp->__anon1.op.exp2);
13105 }
13106 if(exp->__anon1.op.exp1)
13107 {
13108 ComputeExpression(exp->__anon1.op.exp1);
13109 exp1 = exp->__anon1.op.exp1;
13110 exp2 = exp->__anon1.op.exp2;
13111 op1 = GetOperand(exp1);
13112 if(op1.type)
13113 op1.type->refCount++;
13114 if(exp2)
13115 {
13116 op2 = GetOperand(exp2);
13117 if(op2.type)
13118 op2.type->refCount++;
13119 }
13120 }
13121 else
13122 {
13123 exp1 = exp->__anon1.op.exp2;
13124 op1 = GetOperand(exp1);
13125 if(op1.type)
13126 op1.type->refCount++;
13127 }
13128 CallOperator(exp, exp1, exp2, &op1, &op2);
13129 if(op1.type)
13130 FreeType(op1.type);
13131 if(op2.type)
13132 FreeType(op2.type);
13133 break;
13134 }
13135 case 5:
13136 case 32:
13137 {
13138 struct Expression * e, * n;
13139
13140 for(e = (*exp->__anon1.list).first; e; e = n)
13141 {
13142 n = e->next;
13143 if(!n)
13144 {
13145 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13146 struct Expression * prev = exp->prev;
13147 struct Expression * next = exp->next;
13148
13149 ComputeExpression(e);
13150 FreeType(exp->expType);
13151 FreeType(exp->destType);
13152 *exp = *e;
13153 exp->prev = prev;
13154 exp->next = next;
13155 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13156 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13157 }
13158 else
13159 {
13160 FreeExpression(e);
13161 }
13162 }
13163 break;
13164 }
13165 case 8:
13166 {
13167 struct Expression * memberExp = exp->__anon1.member.exp;
13168 struct Identifier * memberID = exp->__anon1.member.member;
13169 struct Type * type;
13170
13171 ComputeExpression(exp->__anon1.member.exp);
13172 type = exp->__anon1.member.exp->expType;
13173 if(type)
13174 {
13175 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)));
13176 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13177 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13178 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
13179
13180 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
13181 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13182 if(!_class)
13183 {
13184 char string[256];
13185 struct Symbol * classSym;
13186
13187 string[0] = '\0';
13188 PrintTypeNoConst(type, string, 0, 1);
13189 classSym = FindClass(string);
13190 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13191 }
13192 if(exp->__anon1.member.member)
13193 {
13194 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
13195 if(!prop)
13196 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
13197 }
13198 if(!prop && !member && _class && exp->__anon1.member.member)
13199 {
13200 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
13201
13202 convertTo = _class;
13203 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13204 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
13205 }
13206 if(prop)
13207 {
13208 if(prop->compiled)
13209 {
13210 struct Type * type = prop->dataType;
13211
13212 if(_class->type == 3)
13213 {
13214 if(type->kind == 8)
13215 {
13216 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13217
13218 if(_class->type == 3)
13219 {
13220 if(!_class->dataType)
13221 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13222 type = _class->dataType;
13223 }
13224 }
13225 switch(type->kind)
13226 {
13227 case 6:
13228 {
13229 float value;
13230 float (* Get)(float) = (void *)prop->Get;
13231
13232 GetFloat(exp->__anon1.member.exp, &value);
13233 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
13234 exp->type = 2;
13235 break;
13236 }
13237 case 7:
13238 {
13239 double value;
13240 double (* Get)(double);
13241
13242 GetDouble(exp->__anon1.member.exp, &value);
13243 if(convertTo)
13244 Get = (void *)prop->Set;
13245 else
13246 Get = (void *)prop->Get;
13247 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
13248 exp->type = 2;
13249 break;
13250 }
13251 }
13252 }
13253 else
13254 {
13255 if(convertTo)
13256 {
13257 struct Expression * value = exp->__anon1.member.exp;
13258 struct Type * type;
13259
13260 if(!prop->dataType)
13261 ProcessPropertyType(prop);
13262 type = prop->dataType;
13263 if(!type)
13264 {
13265 }
13266 else if(_class->type == 1)
13267 {
13268 switch(type->kind)
13269 {
13270 case 8:
13271 {
13272 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13273
13274 if(propertyClass->type == 1 && value->type == 1)
13275 {
13276 void (* Set)(void *, void *) = (void *)prop->Set;
13277
13278 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13279 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13280 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13281 exp->__anon1.instance->loc = exp->loc;
13282 exp->type = 1;
13283 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
13284 PopulateInstance(exp->__anon1.instance);
13285 }
13286 break;
13287 }
13288 case 3:
13289 {
13290 int intValue;
13291 void (* Set)(void *, int) = (void *)prop->Set;
13292
13293 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13294 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13295 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13296 exp->__anon1.instance->loc = exp->loc;
13297 exp->type = 1;
13298 GetInt(value, &intValue);
13299 Set(exp->__anon1.instance->data, intValue);
13300 PopulateInstance(exp->__anon1.instance);
13301 break;
13302 }
13303 case 4:
13304 {
13305 long long intValue;
13306 void (* Set)(void *, long long) = (void *)prop->Set;
13307
13308 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13309 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13310 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13311 exp->__anon1.instance->loc = exp->loc;
13312 exp->type = 1;
13313 GetInt64(value, &intValue);
13314 Set(exp->__anon1.instance->data, intValue);
13315 PopulateInstance(exp->__anon1.instance);
13316 break;
13317 }
13318 case 22:
13319 {
13320 intptr_t intValue;
13321 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13322
13323 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13324 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13325 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13326 exp->__anon1.instance->loc = exp->loc;
13327 exp->type = 1;
13328 GetIntPtr(value, &intValue);
13329 Set(exp->__anon1.instance->data, intValue);
13330 PopulateInstance(exp->__anon1.instance);
13331 break;
13332 }
13333 case 23:
13334 {
13335 ssize_t intValue;
13336 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13337
13338 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13339 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13340 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13341 exp->__anon1.instance->loc = exp->loc;
13342 exp->type = 1;
13343 GetIntSize(value, &intValue);
13344 Set(exp->__anon1.instance->data, intValue);
13345 PopulateInstance(exp->__anon1.instance);
13346 break;
13347 }
13348 case 6:
13349 {
13350 float floatValue;
13351 void (* Set)(void *, float) = (void *)prop->Set;
13352
13353 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13354 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13355 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13356 exp->__anon1.instance->loc = exp->loc;
13357 exp->type = 1;
13358 GetFloat(value, &floatValue);
13359 Set(exp->__anon1.instance->data, floatValue);
13360 PopulateInstance(exp->__anon1.instance);
13361 break;
13362 }
13363 case 7:
13364 {
13365 double doubleValue;
13366 void (* Set)(void *, double) = (void *)prop->Set;
13367
13368 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13369 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13370 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13371 exp->__anon1.instance->loc = exp->loc;
13372 exp->type = 1;
13373 GetDouble(value, &doubleValue);
13374 Set(exp->__anon1.instance->data, doubleValue);
13375 PopulateInstance(exp->__anon1.instance);
13376 break;
13377 }
13378 }
13379 }
13380 else if(_class->type == 2)
13381 {
13382 switch(type->kind)
13383 {
13384 case 8:
13385 {
13386 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13387
13388 if(propertyClass->type == 1 && value->__anon1.instance->data)
13389 {
13390 unsigned int (* Set)(void *) = (void *)prop->Set;
13391 unsigned int bits = Set(value->__anon1.instance->data);
13392
13393 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13394 exp->type = 2;
13395 break;
13396 }
13397 else if(_class->type == 2)
13398 {
13399 unsigned int value;
13400 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
13401 unsigned int bits;
13402
13403 GetUInt(exp->__anon1.member.exp, &value);
13404 bits = Set(value);
13405 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13406 exp->type = 2;
13407 }
13408 }
13409 }
13410 }
13411 }
13412 else
13413 {
13414 if(_class->type == 2)
13415 {
13416 unsigned int value;
13417
13418 GetUInt(exp->__anon1.member.exp, &value);
13419 switch(type->kind)
13420 {
13421 case 8:
13422 {
13423 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13424
13425 if(_class->type == 1)
13426 {
13427 void (* Get)(unsigned int, void *) = (void *)prop->Get;
13428
13429 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13430 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13431 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13432 exp->__anon1.instance->loc = exp->loc;
13433 exp->type = 1;
13434 Get(value, exp->__anon1.instance->data);
13435 PopulateInstance(exp->__anon1.instance);
13436 }
13437 else if(_class->type == 2)
13438 {
13439 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
13440 uint64 bits = Get(value);
13441
13442 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
13443 exp->type = 2;
13444 }
13445 break;
13446 }
13447 }
13448 }
13449 else if(_class->type == 1)
13450 {
13451 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
13452
13453 switch(type->kind)
13454 {
13455 case 8:
13456 {
13457 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13458
13459 if(_class->type == 1 && value)
13460 {
13461 void (* Get)(void *, void *) = (void *)prop->Get;
13462
13463 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13464 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13465 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13466 exp->__anon1.instance->loc = exp->loc;
13467 exp->type = 1;
13468 Get(value, exp->__anon1.instance->data);
13469 PopulateInstance(exp->__anon1.instance);
13470 }
13471 break;
13472 }
13473 }
13474 }
13475 }
13476 }
13477 }
13478 else
13479 {
13480 exp->isConstant = 0;
13481 }
13482 }
13483 else if(member)
13484 {
13485 }
13486 }
13487 if(exp->type != 8)
13488 {
13489 FreeExpression(memberExp);
13490 FreeIdentifier(memberID);
13491 }
13492 break;
13493 }
13494 case 10:
13495 {
13496 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
13497
13498 FreeExpContents(exp);
13499 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13500 exp->type = 2;
13501 FreeType(type);
13502 break;
13503 }
13504 case 15:
13505 {
13506 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
13507
13508 if(classSym && classSym->__anon1.registered)
13509 {
13510 if(classSym->__anon1.registered->fixed)
13511 {
13512 FreeSpecifier(exp->__anon1._class);
13513 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
13514 exp->type = 2;
13515 }
13516 else
13517 {
13518 char className[1024];
13519
13520 strcpy(className, "__ecereClass_");
13521 FullClassNameCat(className, classSym->string, 1);
13522 DeclareClass(curExternal, classSym, className);
13523 FreeExpContents(exp);
13524 exp->type = 9;
13525 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
13526 exp->__anon1.member.member = MkIdentifier("structSize");
13527 }
13528 }
13529 break;
13530 }
13531 case 11:
13532 {
13533 struct Type * type;
13534 struct Expression * e = exp;
13535
13536 if(exp->type == 11)
13537 {
13538 if(exp->__anon1.cast.exp)
13539 ComputeExpression(exp->__anon1.cast.exp);
13540 e = exp->__anon1.cast.exp;
13541 }
13542 if(e && exp->expType)
13543 {
13544 type = exp->expType;
13545 if(type->kind == 8)
13546 {
13547 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13548
13549 if(_class && (_class->type == 3 || _class->type == 2))
13550 {
13551 if(!_class->dataType)
13552 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13553 type = _class->dataType;
13554 }
13555 }
13556 switch(type->kind)
13557 {
13558 case 24:
13559 case 1:
13560 if(type->isSigned)
13561 {
13562 char value = 0;
13563
13564 if(GetChar(e, &value))
13565 {
13566 FreeExpContents(exp);
13567 exp->__anon1.__anon1.constant = PrintChar(value);
13568 exp->type = 2;
13569 }
13570 }
13571 else
13572 {
13573 unsigned char value = 0;
13574
13575 if(GetUChar(e, &value))
13576 {
13577 FreeExpContents(exp);
13578 exp->__anon1.__anon1.constant = PrintUChar(value);
13579 exp->type = 2;
13580 }
13581 }
13582 break;
13583 case 2:
13584 if(type->isSigned)
13585 {
13586 short value = 0;
13587
13588 if(GetShort(e, &value))
13589 {
13590 FreeExpContents(exp);
13591 exp->__anon1.__anon1.constant = PrintShort(value);
13592 exp->type = 2;
13593 }
13594 }
13595 else
13596 {
13597 unsigned short value = 0;
13598
13599 if(GetUShort(e, &value))
13600 {
13601 FreeExpContents(exp);
13602 exp->__anon1.__anon1.constant = PrintUShort(value);
13603 exp->type = 2;
13604 }
13605 }
13606 break;
13607 case 3:
13608 if(type->isSigned)
13609 {
13610 int value = 0;
13611
13612 if(GetInt(e, &value))
13613 {
13614 FreeExpContents(exp);
13615 exp->__anon1.__anon1.constant = PrintInt(value);
13616 exp->type = 2;
13617 }
13618 }
13619 else
13620 {
13621 unsigned int value = 0;
13622
13623 if(GetUInt(e, &value))
13624 {
13625 FreeExpContents(exp);
13626 exp->__anon1.__anon1.constant = PrintUInt(value);
13627 exp->type = 2;
13628 }
13629 }
13630 break;
13631 case 4:
13632 if(type->isSigned)
13633 {
13634 long long value = 0;
13635
13636 if(GetInt64(e, &value))
13637 {
13638 FreeExpContents(exp);
13639 exp->__anon1.__anon1.constant = PrintInt64(value);
13640 exp->type = 2;
13641 }
13642 }
13643 else
13644 {
13645 uint64 value = 0;
13646
13647 if(GetUInt64(e, &value))
13648 {
13649 FreeExpContents(exp);
13650 exp->__anon1.__anon1.constant = PrintUInt64(value);
13651 exp->type = 2;
13652 }
13653 }
13654 break;
13655 case 22:
13656 if(type->isSigned)
13657 {
13658 intptr_t value = 0;
13659
13660 if(GetIntPtr(e, &value))
13661 {
13662 FreeExpContents(exp);
13663 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13664 exp->type = 2;
13665 }
13666 }
13667 else
13668 {
13669 uintptr_t value = 0;
13670
13671 if(GetUIntPtr(e, &value))
13672 {
13673 FreeExpContents(exp);
13674 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13675 exp->type = 2;
13676 }
13677 }
13678 break;
13679 case 23:
13680 if(type->isSigned)
13681 {
13682 ssize_t value = 0;
13683
13684 if(GetIntSize(e, &value))
13685 {
13686 FreeExpContents(exp);
13687 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13688 exp->type = 2;
13689 }
13690 }
13691 else
13692 {
13693 size_t value = 0;
13694
13695 if(GetUIntSize(e, &value))
13696 {
13697 FreeExpContents(exp);
13698 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13699 exp->type = 2;
13700 }
13701 }
13702 break;
13703 case 6:
13704 {
13705 float value = 0;
13706
13707 if(GetFloat(e, &value))
13708 {
13709 FreeExpContents(exp);
13710 exp->__anon1.__anon1.constant = PrintFloat(value);
13711 exp->type = 2;
13712 }
13713 break;
13714 }
13715 case 7:
13716 {
13717 double value = 0;
13718
13719 if(GetDouble(e, &value))
13720 {
13721 FreeExpContents(exp);
13722 exp->__anon1.__anon1.constant = PrintDouble(value);
13723 exp->type = 2;
13724 }
13725 break;
13726 }
13727 }
13728 }
13729 break;
13730 }
13731 case 12:
13732 {
13733 struct Operand op1 =
13734 {
13735 0, 0, 0,
13736 .__anon1 = {
13737 .c = 0
13738 },
13739 {
13740 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13741 }
13742 };
13743 struct Operand op2 =
13744 {
13745 0, 0, 0,
13746 .__anon1 = {
13747 .c = 0
13748 },
13749 {
13750 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13751 }
13752 };
13753 struct Operand op3 =
13754 {
13755 0, 0, 0,
13756 .__anon1 = {
13757 .c = 0
13758 },
13759 {
13760 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13761 }
13762 };
13763
13764 if(exp->__anon1.cond.exp)
13765 ComputeExpression((*exp->__anon1.cond.exp).last);
13766 if(exp->__anon1.cond.elseExp)
13767 ComputeExpression(exp->__anon1.cond.elseExp);
13768 if(exp->__anon1.cond.cond)
13769 ComputeExpression(exp->__anon1.cond.cond);
13770 op1 = GetOperand(exp->__anon1.cond.cond);
13771 if(op1.type)
13772 op1.type->refCount++;
13773 op2 = GetOperand((*exp->__anon1.cond.exp).last);
13774 if(op2.type)
13775 op2.type->refCount++;
13776 op3 = GetOperand(exp->__anon1.cond.elseExp);
13777 if(op3.type)
13778 op3.type->refCount++;
13779 if(op1.ops.Cond)
13780 {
13781 FreeExpContents(exp);
13782 op1.ops.Cond(exp, &op1, &op2, &op3);
13783 }
13784 if(op1.type)
13785 FreeType(op1.type);
13786 if(op2.type)
13787 FreeType(op2.type);
13788 if(op3.type)
13789 FreeType(op3.type);
13790 break;
13791 }
13792 }
13793 }
13794
13795 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
13796 {
13797 struct __ecereNameSpace__ecere__com__Instance * module;
13798
13799 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))
13800 return 1;
13801 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))
13802 return 1;
13803 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))
13804 return 1;
13805 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)
13806 {
13807 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
13808 return 1;
13809 }
13810 return 0;
13811 }
13812
13813 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
13814 {
13815 struct Type * source;
13816 struct Type * realDest = dest;
13817 struct Type * backupSourceExpType = (((void *)0));
13818 struct Expression * nbExp = GetNonBracketsExp(sourceExp);
13819 struct Expression * computedExp = nbExp;
13820
13821 dest->refCount++;
13822 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)
13823 {
13824 computedExp = CopyExpression(nbExp);
13825 ComputeExpression(computedExp);
13826 }
13827 source = sourceExp->expType;
13828 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
13829 {
13830 if(computedExp != nbExp)
13831 {
13832 FreeExpression(computedExp);
13833 computedExp = nbExp;
13834 }
13835 FreeType(dest);
13836 return 1;
13837 }
13838 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
13839 {
13840 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
13841 {
13842 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
13843
13844 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
13845 ;
13846 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
13847 ;
13848 if(sourceBase == destBase)
13849 {
13850 if(computedExp != nbExp)
13851 {
13852 FreeExpression(computedExp);
13853 computedExp = nbExp;
13854 }
13855 FreeType(dest);
13856 return 1;
13857 }
13858 }
13859 }
13860 if(source)
13861 {
13862 struct __ecereNameSpace__ecere__sys__OldList * specs;
13863 unsigned int flag = 0;
13864 long long value = (((int)0x7fffffff));
13865
13866 source->refCount++;
13867 if(computedExp->type == 2)
13868 {
13869 if(source->isSigned)
13870 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13871 else
13872 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13873 }
13874 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
13875 {
13876 if(source->isSigned)
13877 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13878 else
13879 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13880 }
13881 if(computedExp != nbExp)
13882 {
13883 FreeExpression(computedExp);
13884 computedExp = nbExp;
13885 }
13886 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
13887 {
13888 FreeType(source);
13889 source = __extension__ ({
13890 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13891
13892 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
13893 });
13894 }
13895 if(dest->kind == 8)
13896 {
13897 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13898
13899 if(_class && _class->type == 3)
13900 {
13901 if(source->kind != 8)
13902 {
13903 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13904 struct Type * tempDest, * tempSource;
13905
13906 for(; _class->base->type != 1000; _class = _class->base)
13907 ;
13908 tempSource = dest;
13909 tempDest = tempType;
13910 tempType->kind = 8;
13911 if(!_class->symbol)
13912 _class->symbol = FindClass(_class->fullName);
13913 tempType->__anon1._class = _class->symbol;
13914 tempType->truth = dest->truth;
13915 if(tempType->__anon1._class)
13916 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13917 backupSourceExpType = sourceExp->expType;
13918 if(dest->passAsTemplate)
13919 {
13920 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13921 CopyTypeInto(sourceExp->expType, dest);
13922 sourceExp->expType->passAsTemplate = 0;
13923 }
13924 else
13925 {
13926 sourceExp->expType = dest;
13927 dest->refCount++;
13928 }
13929 flag = 1;
13930 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13931 }
13932 }
13933 if(_class && _class->type == 2 && source->kind != 8)
13934 {
13935 if(!dest->__anon1._class->__anon1.registered->dataType)
13936 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
13937 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13938 {
13939 FreeType(source);
13940 FreeType(sourceExp->expType);
13941 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
13942 source->refCount++;
13943 }
13944 }
13945 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
13946 {
13947 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13948 struct Declarator * decl;
13949 char string[1024];
13950
13951 ReadString(string, sourceExp->__anon1.__anon2.string);
13952 decl = SpecDeclFromString(string, specs, (((void *)0)));
13953 FreeExpContents(sourceExp);
13954 FreeType(sourceExp->expType);
13955 sourceExp->type = 24;
13956 sourceExp->__anon1._classExp.specifiers = specs;
13957 sourceExp->__anon1._classExp.decl = decl;
13958 sourceExp->expType = dest;
13959 dest->refCount++;
13960 FreeType(source);
13961 FreeType(dest);
13962 if(backupSourceExpType)
13963 FreeType(backupSourceExpType);
13964 return 1;
13965 }
13966 }
13967 else if(source->kind == 8)
13968 {
13969 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
13970
13971 if(_class && (_class->type == 3 || _class->type == 2))
13972 {
13973 if(dest->kind != 8)
13974 {
13975 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13976 struct Type * tempDest, * tempSource;
13977
13978 if(!source->__anon1._class->__anon1.registered->dataType)
13979 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
13980 for(; _class->base->type != 1000; _class = _class->base)
13981 ;
13982 tempDest = source;
13983 tempSource = tempType;
13984 tempType->kind = 8;
13985 tempType->__anon1._class = FindClass(_class->fullName);
13986 tempType->truth = source->truth;
13987 tempType->classObjectType = source->classObjectType;
13988 if(tempType->__anon1._class)
13989 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13990 if(conversions && conversions->last)
13991 {
13992 ((struct Conversion *)conversions->last)->resultType = dest;
13993 dest->refCount++;
13994 }
13995 FreeType(sourceExp->expType);
13996 sourceExp->expType = MkClassType(_class->fullName);
13997 sourceExp->expType->truth = source->truth;
13998 sourceExp->expType->classObjectType = source->classObjectType;
13999 if(!sourceExp->destType)
14000 {
14001 FreeType(sourceExp->destType);
14002 sourceExp->destType = sourceExp->expType;
14003 if(sourceExp->expType)
14004 sourceExp->expType->refCount++;
14005 }
14006 if(!_class->dataType)
14007 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14008 FreeType(dest);
14009 dest = MkClassType(source->__anon1._class->string);
14010 dest->truth = source->truth;
14011 dest->classObjectType = source->classObjectType;
14012 FreeType(source);
14013 source = _class->dataType;
14014 source->refCount++;
14015 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
14016 }
14017 }
14018 }
14019 if(!flag)
14020 {
14021 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
14022 {
14023 FreeType(source);
14024 FreeType(dest);
14025 return 1;
14026 }
14027 }
14028 if(dest->kind == 8)
14029 {
14030 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
14031 unsigned int fittingValue = 0;
14032
14033 if(_class && _class->type == 4)
14034 {
14035 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14036 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14037
14038 if(c && value >= 0 && value <= c->largest)
14039 fittingValue = 1;
14040 }
14041 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
14042 {
14043 if(_class->type == 0 || _class->type == 5)
14044 {
14045 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14046
14047 *newExp = *sourceExp;
14048 if(sourceExp->destType)
14049 sourceExp->destType->refCount++;
14050 if(sourceExp->expType)
14051 sourceExp->expType->refCount++;
14052 sourceExp->type = 11;
14053 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
14054 sourceExp->__anon1.cast.exp = newExp;
14055 FreeType(sourceExp->expType);
14056 sourceExp->expType = (((void *)0));
14057 ProcessExpressionType(sourceExp);
14058 if(!inCompiler)
14059 {
14060 FreeType(sourceExp->expType);
14061 sourceExp->expType = dest;
14062 }
14063 FreeType(source);
14064 if(inCompiler)
14065 FreeType(dest);
14066 if(backupSourceExpType)
14067 FreeType(backupSourceExpType);
14068 return 1;
14069 }
14070 if(!_class->dataType)
14071 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14072 FreeType(dest);
14073 dest = _class->dataType;
14074 dest->refCount++;
14075 }
14076 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))
14077 {
14078 specs = MkListOne(MkSpecifier(DOUBLE));
14079 }
14080 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))
14081 {
14082 specs = MkListOne(MkSpecifier(FLOAT));
14083 }
14084 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))
14085 {
14086 specs = MkList();
14087 if(!dest->isSigned)
14088 ListAdd(specs, MkSpecifier(UNSIGNED));
14089 ListAdd(specs, MkSpecifier(INT64));
14090 }
14091 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
14092 {
14093 specs = MkList();
14094 if(!dest->isSigned)
14095 ListAdd(specs, MkSpecifier(UNSIGNED));
14096 ListAdd(specs, MkSpecifier(INT));
14097 }
14098 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14099 {
14100 specs = MkList();
14101 if(!dest->isSigned)
14102 ListAdd(specs, MkSpecifier(UNSIGNED));
14103 ListAdd(specs, MkSpecifier(SHORT));
14104 }
14105 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14106 {
14107 specs = MkList();
14108 if(!dest->isSigned)
14109 ListAdd(specs, MkSpecifier(UNSIGNED));
14110 ListAdd(specs, MkSpecifier(CHAR));
14111 }
14112 else
14113 {
14114 FreeType(source);
14115 FreeType(dest);
14116 if(backupSourceExpType)
14117 {
14118 if(sourceExp->expType)
14119 FreeType(sourceExp->expType);
14120 sourceExp->expType = backupSourceExpType;
14121 }
14122 return 0;
14123 }
14124 }
14125 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))
14126 {
14127 specs = MkListOne(MkSpecifier(DOUBLE));
14128 }
14129 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))
14130 {
14131 specs = MkListOne(MkSpecifier(FLOAT));
14132 }
14133 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
14134 {
14135 specs = MkList();
14136 ListAdd(specs, MkSpecifier(BOOL));
14137 }
14138 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)))
14139 {
14140 if(source->kind == 3)
14141 return 1;
14142 else
14143 {
14144 specs = MkList();
14145 if(!dest->isSigned)
14146 ListAdd(specs, MkSpecifier(UNSIGNED));
14147 ListAdd(specs, MkSpecifier(CHAR));
14148 }
14149 }
14150 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)))))
14151 {
14152 if(source->kind == 3)
14153 return 1;
14154 else
14155 {
14156 specs = MkList();
14157 if(!dest->isSigned)
14158 ListAdd(specs, MkSpecifier(UNSIGNED));
14159 ListAdd(specs, MkSpecifier(SHORT));
14160 }
14161 }
14162 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
14163 {
14164 specs = MkList();
14165 if(!dest->isSigned)
14166 ListAdd(specs, MkSpecifier(UNSIGNED));
14167 ListAdd(specs, MkSpecifier(INT));
14168 }
14169 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
14170 {
14171 specs = MkList();
14172 if(!dest->isSigned)
14173 ListAdd(specs, MkSpecifier(UNSIGNED));
14174 ListAdd(specs, MkSpecifier(INT64));
14175 }
14176 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
14177 {
14178 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
14179 }
14180 else
14181 {
14182 FreeType(source);
14183 FreeType(dest);
14184 if(backupSourceExpType)
14185 {
14186 if(sourceExp->expType)
14187 FreeType(sourceExp->expType);
14188 sourceExp->expType = backupSourceExpType;
14189 }
14190 return 0;
14191 }
14192 if(!flag && !sourceExp->opDestType)
14193 {
14194 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14195
14196 *newExp = *sourceExp;
14197 newExp->prev = (((void *)0));
14198 newExp->next = (((void *)0));
14199 if(sourceExp->destType)
14200 sourceExp->destType->refCount++;
14201 if(sourceExp->expType)
14202 sourceExp->expType->refCount++;
14203 sourceExp->type = 11;
14204 if(realDest->kind == 8)
14205 {
14206 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
14207 FreeList(specs, (void *)(FreeSpecifier));
14208 }
14209 else
14210 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
14211 if(newExp->type == 4)
14212 {
14213 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
14214 }
14215 else
14216 sourceExp->__anon1.cast.exp = newExp;
14217 FreeType(sourceExp->expType);
14218 sourceExp->expType = (((void *)0));
14219 ProcessExpressionType(sourceExp);
14220 }
14221 else
14222 FreeList(specs, (void *)(FreeSpecifier));
14223 FreeType(dest);
14224 FreeType(source);
14225 if(backupSourceExpType)
14226 FreeType(backupSourceExpType);
14227 return 1;
14228 }
14229 else
14230 {
14231 if(computedExp != nbExp)
14232 {
14233 FreeExpression(computedExp);
14234 computedExp = nbExp;
14235 }
14236 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
14237 sourceExp = (*sourceExp->__anon1.list).last;
14238 if(sourceExp->type == 0)
14239 {
14240 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
14241
14242 if(dest->kind == 8)
14243 {
14244 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
14245 {
14246 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
14247 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14248
14249 if(enumClass)
14250 {
14251 for(; _class && _class->type == 4; _class = _class->base)
14252 {
14253 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
14254 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14255
14256 for(value = e->values.first; value; value = value->next)
14257 {
14258 if(!strcmp(value->name, id->string))
14259 break;
14260 }
14261 if(value)
14262 {
14263 FreeType(sourceExp->expType);
14264 sourceExp->isConstant = 1;
14265 sourceExp->expType = MkClassType(_class->fullName);
14266 if(inCompiler || inPreCompiler || inDebugger)
14267 {
14268 FreeExpContents(sourceExp);
14269 sourceExp->type = 2;
14270 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
14271 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
14272 else
14273 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
14274 }
14275 FreeType(dest);
14276 return 1;
14277 }
14278 }
14279 }
14280 }
14281 }
14282 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
14283 {
14284 FreeType(dest);
14285 return 1;
14286 }
14287 }
14288 FreeType(dest);
14289 }
14290 return 0;
14291 }
14292
14293 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
14294 {
14295 unsigned int result = 1;
14296
14297 if(destType)
14298 {
14299 struct __ecereNameSpace__ecere__sys__OldList converts =
14300 {
14301 0, 0, 0, 0, 0
14302 };
14303 struct Conversion * convert;
14304
14305 if(destType->kind == 0)
14306 return 0;
14307 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
14308 result = 0;
14309 if(converts.count)
14310 {
14311 for(convert = converts.first; convert; convert = convert->next)
14312 {
14313 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
14314
14315 if(!empty)
14316 {
14317 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14318 int objectType = exp->expType ? exp->expType->classObjectType : 0;
14319
14320 *newExp = *exp;
14321 newExp->prev = (((void *)0));
14322 newExp->next = (((void *)0));
14323 newExp->destType = (((void *)0));
14324 if(convert->isGet)
14325 {
14326 exp->type = 8;
14327 exp->addedThis = 1;
14328 exp->__anon1.member.exp = newExp;
14329 FreeType(exp->__anon1.member.exp->expType);
14330 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
14331 exp->__anon1.member.exp->expType->classObjectType = objectType;
14332 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
14333 exp->__anon1.member.memberType = 1;
14334 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14335 exp->needCast = 1;
14336 if(exp->expType)
14337 exp->expType->refCount++;
14338 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14339 }
14340 else
14341 {
14342 {
14343 exp->type = 8;
14344 exp->addedThis = 1;
14345 exp->__anon1.member.exp = newExp;
14346 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)
14347 {
14348 newExp->byReference = 1;
14349 }
14350 FreeType(exp->__anon1.member.exp->expType);
14351 exp->__anon1.member.exp->expType = (((void *)0));
14352 if(convert->convert->dataType)
14353 {
14354 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14355 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
14356 exp->__anon1.member.exp->expType->refCount = 1;
14357 exp->__anon1.member.exp->expType->classObjectType = objectType;
14358 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14359 }
14360 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
14361 exp->__anon1.member.memberType = 4;
14362 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14363 exp->needCast = 1;
14364 if(convert->resultType)
14365 convert->resultType->refCount++;
14366 }
14367 }
14368 }
14369 else
14370 {
14371 FreeType(exp->expType);
14372 if(convert->isGet)
14373 {
14374 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14375 if(exp->destType->casted)
14376 exp->needCast = 1;
14377 if(exp->expType)
14378 exp->expType->refCount++;
14379 }
14380 else
14381 {
14382 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14383 if(exp->destType->casted)
14384 exp->needCast = 1;
14385 if(convert->resultType)
14386 convert->resultType->refCount++;
14387 }
14388 }
14389 }
14390 if(exp->isConstant && inCompiler)
14391 ComputeExpression(exp);
14392 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
14393 }
14394 if(!result && exp->expType && converts.count)
14395 {
14396 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14397 }
14398 if(!result && exp->expType && exp->destType)
14399 {
14400 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))
14401 result = 1;
14402 }
14403 }
14404 return result;
14405 }
14406
14407 static void ProcessFunction(struct FunctionDefinition *  function);
14408
14409 void ProcessInstantiationType(struct Instantiation * inst)
14410 {
14411 yylloc = inst->loc;
14412 if(inst->_class)
14413 {
14414 struct MembersInit * members;
14415 struct Symbol * classSym;
14416 struct __ecereNameSpace__ecere__com__Class * _class;
14417
14418 classSym = inst->_class->__anon1.__anon1.symbol;
14419 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14420 if(!_class || _class->type != 5)
14421 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14422 afterExternal = afterExternal ? afterExternal : curExternal;
14423 if(inst->exp)
14424 ProcessExpressionType(inst->exp);
14425 inst->isConstant = 1;
14426 if(inst->members)
14427 {
14428 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14429 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14430 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14431 int subMemberStackPos = 0;
14432
14433 for(members = (*inst->members).first; members; members = members->next)
14434 {
14435 switch(members->type)
14436 {
14437 case 1:
14438 {
14439 char name[1024];
14440 static unsigned int instMethodID = 0;
14441 struct External * external = curExternal;
14442 struct Context * context = curContext;
14443 struct Declarator * declarator = members->__anon1.function->declarator;
14444 struct Identifier * nameID = GetDeclId(declarator);
14445 char * unmangled = nameID ? nameID->string : (((void *)0));
14446 struct Expression * exp;
14447 struct External * createdExternal = (((void *)0));
14448
14449 if(inCompiler)
14450 {
14451 char number[16];
14452
14453 strcpy(name, "__ecereInstMeth_");
14454 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14455 strcat(name, "_");
14456 strcat(name, nameID->string);
14457 strcat(name, "_");
14458 sprintf(number, "_%08d", instMethodID++);
14459 strcat(name, number);
14460 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14461 }
14462 if(declarator)
14463 {
14464 struct Symbol * symbol = declarator->symbol;
14465 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14466
14467 if(method && method->type == 1)
14468 {
14469 symbol->__anon1.method = method;
14470 ProcessMethodType(method);
14471 if(!symbol->type->__anon1.__anon2.thisClass)
14472 {
14473 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14474 {
14475 if(!currentClass->symbol)
14476 currentClass->symbol = FindClass(currentClass->fullName);
14477 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14478 }
14479 else
14480 {
14481 if(!_class->symbol)
14482 _class->symbol = FindClass(_class->fullName);
14483 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14484 }
14485 }
14486 DeclareType(curExternal, symbol->type, 1, 1);
14487 }
14488 else if(classSym)
14489 {
14490 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14491 }
14492 }
14493 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14494 if(nameID)
14495 {
14496 FreeSpecifier(nameID->_class);
14497 nameID->_class = (((void *)0));
14498 }
14499 curExternal = createdExternal;
14500 if(inCompiler)
14501 {
14502 if(createdExternal->__anon1.function)
14503 ProcessFunction(createdExternal->__anon1.function);
14504 }
14505 else if(declarator)
14506 {
14507 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14508 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14509 }
14510 curExternal = external;
14511 curContext = context;
14512 if(inCompiler)
14513 {
14514 FreeClassFunction(members->__anon1.function);
14515 exp = QMkExpId(name);
14516 members->type = 0;
14517 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14518 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14519 }
14520 break;
14521 }
14522 case 0:
14523 {
14524 if(members->__anon1.dataMembers && classSym)
14525 {
14526 struct MemberInit * member;
14527 struct Location oldyyloc = yylloc;
14528
14529 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14530 {
14531 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14532 if(member->initializer && !member->initializer->isConstant)
14533 inst->isConstant = 0;
14534 }
14535 yylloc = oldyyloc;
14536 }
14537 break;
14538 }
14539 }
14540 }
14541 }
14542 }
14543 }
14544
14545 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14546
14547 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14548 {
14549 switch(spec->type)
14550 {
14551 case 0:
14552 {
14553 if(spec->__anon1.specifier == THISCLASS)
14554 {
14555 if(thisClass)
14556 {
14557 spec->type = 1;
14558 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14559 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14560 ProcessSpecifier(spec, declareStruct, 0);
14561 }
14562 }
14563 break;
14564 }
14565 case 1:
14566 {
14567 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14568
14569 if(symbol)
14570 DeclareType(curExternal, symbol->type, 1, 1);
14571 else if(spec->__anon1.__anon1.symbol)
14572 {
14573 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14574
14575 if(warnClasses && !c)
14576 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14577 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14578 }
14579 break;
14580 }
14581 case 2:
14582 {
14583 struct Enumerator * e;
14584
14585 if(spec->__anon1.__anon2.list)
14586 {
14587 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14588 {
14589 if(e->exp)
14590 ProcessExpressionType(e->exp);
14591 }
14592 }
14593 if(inCompiler)
14594 break;
14595 }
14596 case 3:
14597 case 4:
14598 {
14599 if(spec->__anon1.__anon2.definitions)
14600 {
14601 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14602
14603 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14604 }
14605 break;
14606 }
14607 }
14608 }
14609
14610 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14611 {
14612 switch(decl->type)
14613 {
14614 case 1:
14615 if(decl->__anon1.identifier->classSym)
14616 {
14617 FreeSpecifier(decl->__anon1.identifier->_class);
14618 decl->__anon1.identifier->_class = (((void *)0));
14619 }
14620 break;
14621 case 3:
14622 if(decl->__anon1.array.exp)
14623 ProcessExpressionType(decl->__anon1.array.exp);
14624 case 0:
14625 case 2:
14626 case 4:
14627 case 5:
14628 case 6:
14629 case 7:
14630 {
14631 struct Identifier * id = (((void *)0));
14632 struct Specifier * classSpec = (((void *)0));
14633
14634 if(decl->type == 4)
14635 {
14636 id = GetDeclId(decl);
14637 if(id && id->_class)
14638 {
14639 classSpec = id->_class;
14640 id->_class = (((void *)0));
14641 }
14642 }
14643 if(decl->declarator)
14644 ProcessDeclarator(decl->declarator, isFunction);
14645 if(decl->type == 4)
14646 {
14647 if(classSpec)
14648 {
14649 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14650
14651 if(!decl->__anon1.function.parameters)
14652 decl->__anon1.function.parameters = MkList();
14653 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14654 }
14655 if(decl->__anon1.function.parameters)
14656 {
14657 struct TypeName * param;
14658
14659 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14660 {
14661 if(param->qualifiers)
14662 {
14663 struct Specifier * spec;
14664
14665 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14666 {
14667 if(spec->type == 0)
14668 {
14669 if(spec->__anon1.specifier == TYPED_OBJECT)
14670 {
14671 struct Declarator * d = param->declarator;
14672 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);
14673
14674 if(d->type != 5)
14675 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14676 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14677 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14678 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14679 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14680 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14681 param = newParam;
14682 break;
14683 }
14684 else if(spec->__anon1.specifier == ANY_OBJECT)
14685 {
14686 struct Declarator * d = param->declarator;
14687
14688 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14689 param->qualifiers = MkListOne(MkSpecifier(VOID));
14690 if(d->type != 5)
14691 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14692 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14693 break;
14694 }
14695 else if(spec->__anon1.specifier == THISCLASS)
14696 {
14697 if(thisClass)
14698 {
14699 spec->type = 1;
14700 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14701 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14702 ProcessSpecifier(spec, 0, 0);
14703 }
14704 break;
14705 }
14706 }
14707 else if(spec->type == 1)
14708 {
14709 ProcessSpecifier(spec, isFunction, 1);
14710 }
14711 }
14712 }
14713 if(param->declarator)
14714 ProcessDeclarator(param->declarator, 0);
14715 }
14716 }
14717 }
14718 break;
14719 }
14720 }
14721 }
14722
14723 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14724 {
14725 yylloc = decl->loc;
14726 switch(decl->type)
14727 {
14728 case 1:
14729 {
14730 unsigned int declareStruct = 0;
14731
14732 if(decl->__anon1.__anon1.declarators)
14733 {
14734 struct InitDeclarator * d;
14735
14736 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14737 {
14738 struct Type * type, * subType;
14739
14740 ProcessDeclarator(d->declarator, 0);
14741 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14742 if(d->initializer)
14743 {
14744 ProcessInitializer(d->initializer, type);
14745 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14746 {
14747 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14748 {
14749 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14750
14751 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14752 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14753 if(decl->__anon1.__anon1.specifiers)
14754 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14755 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14756 d = (((void *)0));
14757 decl->type = 2;
14758 decl->__anon1.inst = inst;
14759 }
14760 }
14761 }
14762 for(subType = type; subType; )
14763 {
14764 if(subType->kind == 8)
14765 {
14766 declareStruct = 1;
14767 break;
14768 }
14769 else if(subType->kind == 13)
14770 break;
14771 else if(subType->kind == 12)
14772 subType = subType->__anon1.__anon4.arrayType;
14773 else
14774 break;
14775 }
14776 FreeType(type);
14777 if(!d)
14778 break;
14779 }
14780 }
14781 if(decl->__anon1.__anon1.specifiers)
14782 {
14783 struct Specifier * s;
14784
14785 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
14786 {
14787 ProcessSpecifier(s, declareStruct, 1);
14788 }
14789 }
14790 break;
14791 }
14792 case 2:
14793 {
14794 ProcessInstantiationType(decl->__anon1.inst);
14795 break;
14796 }
14797 case 0:
14798 {
14799 struct Specifier * spec;
14800 struct Declarator * d;
14801 unsigned int declareStruct = 0;
14802
14803 if(decl->__anon1.__anon1.declarators)
14804 {
14805 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14806 {
14807 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14808 struct Type * subType;
14809
14810 ProcessDeclarator(d, 0);
14811 for(subType = type; subType; )
14812 {
14813 if(subType->kind == 8)
14814 {
14815 declareStruct = 1;
14816 break;
14817 }
14818 else if(subType->kind == 13)
14819 break;
14820 else if(subType->kind == 12)
14821 subType = subType->__anon1.__anon4.arrayType;
14822 else
14823 break;
14824 }
14825 FreeType(type);
14826 }
14827 }
14828 if(decl->__anon1.__anon1.specifiers)
14829 {
14830 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
14831 ProcessSpecifier(spec, declareStruct, warnClasses);
14832 }
14833 break;
14834 }
14835 }
14836 }
14837
14838 static void ProcessStatement(struct Statement * stmt)
14839 {
14840 yylloc = stmt->loc;
14841 switch(stmt->type)
14842 {
14843 case 0:
14844 ProcessStatement(stmt->__anon1.labeled.stmt);
14845 break;
14846 case 1:
14847 if(stmt->__anon1.caseStmt.exp)
14848 {
14849 FreeType(stmt->__anon1.caseStmt.exp->destType);
14850 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
14851 if(curSwitchType)
14852 curSwitchType->refCount++;
14853 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
14854 ComputeExpression(stmt->__anon1.caseStmt.exp);
14855 }
14856 if(stmt->__anon1.caseStmt.stmt)
14857 ProcessStatement(stmt->__anon1.caseStmt.stmt);
14858 break;
14859 case 2:
14860 {
14861 if(stmt->__anon1.compound.context)
14862 {
14863 struct Declaration * decl;
14864 struct Statement * s;
14865 struct Statement * prevCompound = curCompound;
14866 struct Context * prevContext = curContext;
14867
14868 if(!stmt->__anon1.compound.isSwitch)
14869 curCompound = stmt;
14870 curContext = stmt->__anon1.compound.context;
14871 if(stmt->__anon1.compound.declarations)
14872 {
14873 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
14874 ProcessDeclaration(decl, 1);
14875 }
14876 if(stmt->__anon1.compound.statements)
14877 {
14878 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
14879 ProcessStatement(s);
14880 }
14881 curContext = prevContext;
14882 curCompound = prevCompound;
14883 }
14884 break;
14885 }
14886 case 3:
14887 {
14888 struct Expression * exp;
14889
14890 if(stmt->__anon1.expressions)
14891 {
14892 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14893 ProcessExpressionType(exp);
14894 }
14895 break;
14896 }
14897 case 4:
14898 {
14899 struct Expression * exp;
14900
14901 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
14902 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
14903 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
14904 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
14905 {
14906 ProcessExpressionType(exp);
14907 }
14908 if(stmt->__anon1.ifStmt.stmt)
14909 ProcessStatement(stmt->__anon1.ifStmt.stmt);
14910 if(stmt->__anon1.ifStmt.elseStmt)
14911 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
14912 break;
14913 }
14914 case 5:
14915 {
14916 struct Type * oldSwitchType = curSwitchType;
14917
14918 if(stmt->__anon1.switchStmt.exp)
14919 {
14920 struct Expression * exp;
14921
14922 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
14923 {
14924 if(!exp->next)
14925 {
14926 ProcessExpressionType(exp);
14927 }
14928 if(!exp->next)
14929 curSwitchType = exp->expType;
14930 }
14931 }
14932 ProcessStatement(stmt->__anon1.switchStmt.stmt);
14933 curSwitchType = oldSwitchType;
14934 break;
14935 }
14936 case 6:
14937 {
14938 if(stmt->__anon1.whileStmt.exp)
14939 {
14940 struct Expression * exp;
14941
14942 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
14943 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
14944 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
14945 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
14946 {
14947 ProcessExpressionType(exp);
14948 }
14949 }
14950 if(stmt->__anon1.whileStmt.stmt)
14951 ProcessStatement(stmt->__anon1.whileStmt.stmt);
14952 break;
14953 }
14954 case 7:
14955 {
14956 if(stmt->__anon1.doWhile.exp)
14957 {
14958 struct Expression * exp;
14959
14960 if((*stmt->__anon1.doWhile.exp).last)
14961 {
14962 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
14963 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
14964 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
14965 }
14966 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
14967 {
14968 ProcessExpressionType(exp);
14969 }
14970 }
14971 if(stmt->__anon1.doWhile.stmt)
14972 ProcessStatement(stmt->__anon1.doWhile.stmt);
14973 break;
14974 }
14975 case 8:
14976 {
14977 struct Expression * exp;
14978
14979 if(stmt->__anon1.forStmt.init)
14980 ProcessStatement(stmt->__anon1.forStmt.init);
14981 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
14982 {
14983 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
14984 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
14985 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
14986 }
14987 if(stmt->__anon1.forStmt.check)
14988 ProcessStatement(stmt->__anon1.forStmt.check);
14989 if(stmt->__anon1.forStmt.increment)
14990 {
14991 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
14992 ProcessExpressionType(exp);
14993 }
14994 if(stmt->__anon1.forStmt.stmt)
14995 ProcessStatement(stmt->__anon1.forStmt.stmt);
14996 break;
14997 }
14998 case 18:
14999 {
15000 struct Identifier * id = stmt->__anon1.forEachStmt.id;
15001 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
15002 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
15003 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
15004 char iteratorType[1024];
15005 struct Type * source;
15006 struct Expression * e;
15007 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));
15008 struct Expression * arrayExp;
15009 const char * typeString = (((void *)0));
15010 int builtinCount = 0;
15011
15012 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15013 {
15014 if(!e->next)
15015 {
15016 FreeType(e->destType);
15017 e->destType = ProcessTypeString("Container", 0);
15018 }
15019 if(!isBuiltin || e->next)
15020 ProcessExpressionType(e);
15021 }
15022 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15023 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)))
15024 {
15025 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
15026 struct Symbol * symbol;
15027 struct Expression * expIt = (((void *)0));
15028 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
15029 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15030 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15031 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15032
15033 if(inCompiler)
15034 {
15035 stmt->type = 2;
15036 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15037 stmt->__anon1.compound.context->parent = curContext;
15038 curContext = stmt->__anon1.compound.context;
15039 }
15040 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
15041 {
15042 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15043
15044 isCustomAVLTree = 1;
15045 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
15046 isMap = 1;
15047 }
15048 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15049 isArray = 1;
15050 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15051 {
15052 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15053
15054 isLinkList = 1;
15055 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15056 }
15057 if(inCompiler && isArray)
15058 {
15059 struct Declarator * decl;
15060 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15061
15062 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15063 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15064 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15065 }
15066 else if(isBuiltin)
15067 {
15068 struct Type * type = (((void *)0));
15069 char typeStringBuf[1024];
15070
15071 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15072 if(((struct Expression *)(*exp).last)->type == 11)
15073 {
15074 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15075
15076 if(typeName)
15077 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15078 }
15079 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)
15080 {
15081 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15082
15083 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15084 }
15085 else if(arrayExp->__anon1.list)
15086 {
15087 struct Expression * e;
15088
15089 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15090 {
15091 ProcessExpressionType(e);
15092 if(e->expType)
15093 {
15094 if(!type)
15095 {
15096 type = e->expType;
15097 type->refCount++;
15098 }
15099 else
15100 {
15101 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15102 {
15103 FreeType(type);
15104 type = e->expType;
15105 e->expType = (((void *)0));
15106 e = (*arrayExp->__anon1.list).first;
15107 ProcessExpressionType(e);
15108 if(e->expType)
15109 {
15110 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15111 {
15112 FreeType(e->expType);
15113 e->expType = (((void *)0));
15114 FreeType(type);
15115 type = (((void *)0));
15116 break;
15117 }
15118 }
15119 }
15120 }
15121 if(e->expType)
15122 {
15123 FreeType(e->expType);
15124 e->expType = (((void *)0));
15125 }
15126 }
15127 }
15128 if(type)
15129 {
15130 typeStringBuf[0] = '\0';
15131 PrintType(type, typeStringBuf, 0, 1);
15132 typeString = typeStringBuf;
15133 FreeType(type);
15134 }
15135 }
15136 if(typeString)
15137 {
15138 if(inCompiler)
15139 {
15140 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15141 struct Declarator * decl;
15142 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15143
15144 if(arrayExp->__anon1.list)
15145 {
15146 struct Expression * e;
15147
15148 builtinCount = (*arrayExp->__anon1.list).count;
15149 type = ProcessTypeString(typeString, 0);
15150 while((e = (*arrayExp->__anon1.list).first))
15151 {
15152 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15153 e->destType = type;
15154 type->refCount++;
15155 ProcessExpressionType(e);
15156 if(inCompiler)
15157 ListAdd(initializers, MkInitializerAssignment(e));
15158 }
15159 FreeType(type);
15160 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15161 }
15162 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15163 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15164 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15165 FreeList(exp, (void *)(FreeExpression));
15166 }
15167 else if(arrayExp->__anon1.list)
15168 {
15169 struct Expression * e;
15170
15171 type = ProcessTypeString(typeString, 0);
15172 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15173 {
15174 e->destType = type;
15175 type->refCount++;
15176 ProcessExpressionType(e);
15177 }
15178 FreeType(type);
15179 }
15180 }
15181 else
15182 {
15183 arrayExp->expType = ProcessTypeString("Container", 0);
15184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15185 }
15186 }
15187 else if(inCompiler && isLinkList && !isList)
15188 {
15189 struct Declarator * decl;
15190 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15191
15192 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15193 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15194 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15195 }
15196 else if(inCompiler && _class->templateArgs)
15197 {
15198 if(isMap)
15199 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15200 else
15201 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15202 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)))))))));
15203 }
15204 if(inCompiler)
15205 {
15206 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15207 if(block)
15208 {
15209 switch(block->type)
15210 {
15211 case 2:
15212 if(block->__anon1.compound.context)
15213 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15214 break;
15215 case 4:
15216 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15217 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15218 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15219 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15220 break;
15221 case 5:
15222 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15223 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15224 break;
15225 case 6:
15226 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15227 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15228 break;
15229 case 7:
15230 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15231 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15232 break;
15233 case 8:
15234 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15235 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15236 break;
15237 case 18:
15238 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15239 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15240 break;
15241 }
15242 }
15243 if(filter)
15244 {
15245 block = MkIfStmt(filter, block, (((void *)0)));
15246 }
15247 if(isArray)
15248 {
15249 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));
15250 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15251 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15252 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15253 }
15254 else if(isBuiltin)
15255 {
15256 char count[128];
15257
15258 sprintf(count, "%d", builtinCount);
15259 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));
15260 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15261 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15262 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15263 }
15264 else if(isLinkList && !isList)
15265 {
15266 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15267 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15268
15269 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15270 {
15271 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));
15272 }
15273 else
15274 {
15275 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15276 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15277
15278 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));
15279 }
15280 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15281 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15282 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15283 }
15284 else
15285 {
15286 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15287 }
15288 ProcessExpressionType(expIt);
15289 if((*stmt->__anon1.compound.declarations).first)
15290 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15291 if(symbol)
15292 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15293 ProcessStatement(stmt);
15294 }
15295 else
15296 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15297 if(inCompiler)
15298 curContext = stmt->__anon1.compound.context->parent;
15299 break;
15300 }
15301 else
15302 {
15303 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15304 }
15305 break;
15306 }
15307 case 9:
15308 break;
15309 case 10:
15310 break;
15311 case 11:
15312 break;
15313 case 12:
15314 {
15315 struct Expression * exp;
15316
15317 if(stmt->__anon1.expressions)
15318 {
15319 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15320 {
15321 if(!exp->next)
15322 {
15323 if(curFunction && !curFunction->type)
15324 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15325 FreeType(exp->destType);
15326 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15327 if(exp->destType)
15328 exp->destType->refCount++;
15329 }
15330 ProcessExpressionType(exp);
15331 }
15332 }
15333 break;
15334 }
15335 case 14:
15336 {
15337 ProcessDeclaration(stmt->__anon1.decl, 1);
15338 break;
15339 }
15340 case 13:
15341 {
15342 struct AsmField * field;
15343
15344 if(stmt->__anon1.asmStmt.inputFields)
15345 {
15346 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15347 if(field->expression)
15348 ProcessExpressionType(field->expression);
15349 }
15350 if(stmt->__anon1.asmStmt.outputFields)
15351 {
15352 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15353 if(field->expression)
15354 ProcessExpressionType(field->expression);
15355 }
15356 if(stmt->__anon1.asmStmt.clobberedFields)
15357 {
15358 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15359 {
15360 if(field->expression)
15361 ProcessExpressionType(field->expression);
15362 }
15363 }
15364 break;
15365 }
15366 case 17:
15367 {
15368 struct PropertyWatch * propWatch;
15369 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15370 struct Expression * object = stmt->__anon1._watch.object;
15371 struct Expression * watcher = stmt->__anon1._watch.watcher;
15372
15373 if(watcher)
15374 ProcessExpressionType(watcher);
15375 if(object)
15376 ProcessExpressionType(object);
15377 if(inCompiler)
15378 {
15379 if(watcher || thisClass)
15380 {
15381 struct External * external = curExternal;
15382 struct Context * context = curContext;
15383
15384 stmt->type = 3;
15385 stmt->__anon1.expressions = MkList();
15386 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15387 {
15388 struct ClassFunction * func;
15389 char watcherName[1024];
15390 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;
15391 struct External * createdExternal;
15392
15393 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15394 if(propWatch->deleteWatch)
15395 strcat(watcherName, "_delete");
15396 else
15397 {
15398 struct Identifier * propID;
15399
15400 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15401 {
15402 strcat(watcherName, "_");
15403 strcat(watcherName, propID->string);
15404 }
15405 }
15406 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15407 {
15408 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)));
15409 ProcessClassFunctionBody(func, propWatch->compound);
15410 propWatch->compound = (((void *)0));
15411 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15412 FreeClassFunction(func);
15413 curExternal = createdExternal;
15414 ProcessFunction(createdExternal->__anon1.function);
15415 if(propWatch->deleteWatch)
15416 {
15417 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15418
15419 ListAdd(args, CopyExpression(object));
15420 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15421 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15422 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15423 }
15424 else
15425 {
15426 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15427 struct Identifier * propID;
15428
15429 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15430 {
15431 char propName[1024];
15432 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15433
15434 if(prop)
15435 {
15436 char getName[1024], setName[1024];
15437 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15438
15439 DeclareProperty(createdExternal, prop, setName, getName);
15440 strcpy(propName, "__ecereProp_");
15441 FullClassNameCat(propName, prop->_class->fullName, 0);
15442 strcat(propName, "_");
15443 FullClassNameCat(propName, prop->name, 1);
15444 ListAdd(args, CopyExpression(object));
15445 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15446 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15447 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15448 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15449 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15450 }
15451 else
15452 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15453 }
15454 }
15455 }
15456 else
15457 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15458 }
15459 curExternal = external;
15460 curContext = context;
15461 if(watcher)
15462 FreeExpression(watcher);
15463 if(object)
15464 FreeExpression(object);
15465 FreeList(watches, (void *)(FreePropertyWatch));
15466 }
15467 else
15468 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15469 }
15470 else
15471 {
15472 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15473 {
15474 ProcessStatement(propWatch->compound);
15475 }
15476 }
15477 break;
15478 }
15479 case 15:
15480 {
15481 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15482 struct Expression * object = stmt->__anon1._watch.object;
15483 struct __ecereNameSpace__ecere__com__Class * _class;
15484
15485 if(object)
15486 ProcessExpressionType(object);
15487 if(inCompiler)
15488 {
15489 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15490 if(_class)
15491 {
15492 struct Identifier * propID;
15493
15494 stmt->type = 3;
15495 stmt->__anon1.expressions = MkList();
15496 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15497 {
15498 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15499 }
15500 else if(!watches)
15501 {
15502 }
15503 if(watches)
15504 {
15505 for(propID = (*watches).first; propID; propID = propID->next)
15506 {
15507 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15508
15509 if(prop)
15510 {
15511 CreateFireWatcher(prop, object, stmt);
15512 }
15513 else
15514 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15515 }
15516 }
15517 else
15518 {
15519 struct __ecereNameSpace__ecere__com__Property * prop;
15520 struct __ecereNameSpace__ecere__com__Class * base;
15521
15522 for(base = _class; base; base = base->base)
15523 {
15524 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15525 {
15526 if(prop->isProperty && prop->isWatchable)
15527 {
15528 CreateFireWatcher(prop, object, stmt);
15529 }
15530 }
15531 }
15532 }
15533 if(object)
15534 FreeExpression(object);
15535 FreeList(watches, (void *)(FreeIdentifier));
15536 }
15537 else
15538 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15539 }
15540 break;
15541 }
15542 case 16:
15543 {
15544 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15545 struct Expression * object = stmt->__anon1._watch.object;
15546 struct Expression * watcher = stmt->__anon1._watch.watcher;
15547 struct __ecereNameSpace__ecere__com__Class * _class;
15548
15549 if(object)
15550 ProcessExpressionType(object);
15551 if(watcher)
15552 ProcessExpressionType(watcher);
15553 if(inCompiler)
15554 {
15555 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15556 if(watcher || thisClass)
15557 {
15558 if(_class)
15559 {
15560 struct Identifier * propID;
15561
15562 stmt->type = 3;
15563 stmt->__anon1.expressions = MkList();
15564 if(!watches)
15565 {
15566 struct __ecereNameSpace__ecere__sys__OldList * args;
15567
15568 args = MkList();
15569 ListAdd(args, CopyExpression(object));
15570 ListAdd(args, MkExpConstant("0"));
15571 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15572 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15573 }
15574 else
15575 {
15576 for(propID = (*watches).first; propID; propID = propID->next)
15577 {
15578 char propName[1024];
15579 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15580
15581 if(prop)
15582 {
15583 char getName[1024], setName[1024];
15584 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15585
15586 DeclareProperty(curExternal, prop, setName, getName);
15587 strcpy(propName, "__ecereProp_");
15588 FullClassNameCat(propName, prop->_class->fullName, 0);
15589 strcat(propName, "_");
15590 FullClassNameCat(propName, prop->name, 1);
15591 ListAdd(args, CopyExpression(object));
15592 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15593 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15594 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15595 }
15596 else
15597 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15598 }
15599 }
15600 if(object)
15601 FreeExpression(object);
15602 if(watcher)
15603 FreeExpression(watcher);
15604 FreeList(watches, (void *)(FreeIdentifier));
15605 }
15606 else
15607 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15608 }
15609 else
15610 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15611 }
15612 break;
15613 }
15614 }
15615 }
15616
15617 void ComputeDataTypes()
15618 {
15619 struct External * external;
15620
15621 currentClass = (((void *)0));
15622 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15623 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15624 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15625 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15626 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15627 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15628 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15629 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15630 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15631 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15632 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15633 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15634 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15635 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15636 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15637 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15638 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15639 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15640 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15641 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15642 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15643 reachedPass15 = 1;
15644 for(external = (*ast).first; external; external = external->next)
15645 {
15646 afterExternal = curExternal = external;
15647 if(external->type == 0)
15648 {
15649 if(memoryGuard)
15650 {
15651 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15652 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15653 }
15654 currentClass = external->__anon1.function->_class;
15655 ProcessFunction(external->__anon1.function);
15656 }
15657 else if(external->type == 1)
15658 {
15659 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15660 {
15661 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15662 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15663 }
15664 currentClass = (((void *)0));
15665 if(external->__anon1.declaration)
15666 ProcessDeclaration(external->__anon1.declaration, 1);
15667 }
15668 else if(external->type == 2)
15669 {
15670 struct ClassDefinition * _class = external->__anon1._class;
15671
15672 currentClass = external->symbol->__anon1.registered;
15673 if(memoryGuard)
15674 {
15675 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15676 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15677 }
15678 if(_class->definitions)
15679 {
15680 ProcessClass(_class->definitions, _class->symbol);
15681 }
15682 if(inCompiler)
15683 {
15684 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15685 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
15686 }
15687 }
15688 else if(external->type == 4)
15689 {
15690 thisNameSpace = external->__anon1.id->string;
15691 }
15692 }
15693 currentClass = (((void *)0));
15694 thisNameSpace = (((void *)0));
15695 curExternal = (((void *)0));
15696 }
15697
15698 void ProcessExpressionType(struct Expression * exp)
15699 {
15700 unsigned int unresolved = 0;
15701 struct Location oldyylloc = yylloc;
15702 unsigned int notByReference = 0;
15703
15704 if(!exp || exp->expType)
15705 return ;
15706 yylloc = exp->loc;
15707 switch(exp->type)
15708 {
15709 case 0:
15710 {
15711 struct Identifier * id = exp->__anon1.__anon1.identifier;
15712
15713 if(!id || !topContext)
15714 return ;
15715 if(id->_class && id->_class->__anon1.__anon1.name)
15716 {
15717 id->classSym = id->_class->__anon1.__anon1.symbol;
15718 }
15719 if(!strcmp(id->string, "__runtimePlatform"))
15720 {
15721 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15722 break;
15723 }
15724 else if(strstr(id->string, "__ecereClass") == id->string)
15725 {
15726 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15727 break;
15728 }
15729 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15730 {
15731 ReplaceClassMembers(exp, thisClass);
15732 if(exp->type != 0)
15733 {
15734 ProcessExpressionType(exp);
15735 break;
15736 }
15737 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15738 break;
15739 }
15740 else
15741 {
15742 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15743
15744 if(!symbol)
15745 {
15746 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15747 break;
15748 else
15749 {
15750 if(thisClass)
15751 {
15752 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15753 if(exp->type != 0)
15754 {
15755 ProcessExpressionType(exp);
15756 break;
15757 }
15758 }
15759 else if(currentClass && !id->_class)
15760 {
15761 if(ResolveIdWithClass(exp, currentClass, 1))
15762 break;
15763 }
15764 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15765 }
15766 }
15767 if(symbol)
15768 {
15769 struct Type * type = symbol->type;
15770 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15771
15772 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15773 {
15774 struct Context * context = SetupTemplatesContext(_class);
15775
15776 type = ReplaceThisClassType(_class);
15777 FinishTemplatesContext(context);
15778 if(type)
15779 type->refCount = 0;
15780 }
15781 FreeSpecifier(id->_class);
15782 id->_class = (((void *)0));
15783 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15784 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
15785 id->classSym = (((void *)0));
15786 exp->expType = type;
15787 if(type)
15788 type->refCount++;
15789 if(type && (type->kind == 15))
15790 exp->isConstant = 1;
15791 if(symbol->isParam || !strcmp(id->string, "this"))
15792 {
15793 if(_class && _class->type == 1 && !type->declaredWithStruct)
15794 exp->byReference = 1;
15795 }
15796 if(symbol->isIterator)
15797 {
15798 if(symbol->isIterator == 3)
15799 {
15800 exp->type = 5;
15801 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
15802 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
15803 exp->expType = (((void *)0));
15804 ProcessExpressionType(exp);
15805 }
15806 else if(symbol->isIterator != 4)
15807 {
15808 exp->type = 8;
15809 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
15810 exp->__anon1.member.exp->expType = exp->expType;
15811 exp->__anon1.member.member = MkIdentifier("data");
15812 exp->expType = (((void *)0));
15813 ProcessExpressionType(exp);
15814 }
15815 }
15816 break;
15817 }
15818 else
15819 {
15820 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
15821
15822 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15823 {
15824 char name[1024];
15825
15826 strcpy(name, thisNameSpace);
15827 strcat(name, "::");
15828 strcat(name, id->string);
15829 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
15830 }
15831 if(!definedExp)
15832 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
15833 if(definedExp)
15834 {
15835 int c;
15836
15837 for(c = 0; c < definedExpStackPos; c++)
15838 if(definedExpStack[c] == definedExp)
15839 break;
15840 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
15841 {
15842 struct Location backupYylloc = yylloc;
15843 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
15844
15845 definedExpStack[definedExpStackPos++] = definedExp;
15846 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
15847 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
15848 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15849
15850 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15851 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
15852 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
15853 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15854
15855 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15856 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
15857 echoOn = 0;
15858 parsedExpression = (((void *)0));
15859 resetScanner();
15860 expression_yyparse();
15861 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
15862 if(backInput)
15863 fileInput = backInput;
15864 yylloc = backupYylloc;
15865 if(parsedExpression)
15866 {
15867 FreeIdentifier(id);
15868 exp->type = 5;
15869 exp->__anon1.list = MkListOne(parsedExpression);
15870 ApplyLocation(parsedExpression, &yylloc);
15871 ProcessExpressionType(exp);
15872 definedExpStackPos--;
15873 return ;
15874 }
15875 definedExpStackPos--;
15876 }
15877 else
15878 {
15879 if(inCompiler)
15880 {
15881 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
15882 }
15883 }
15884 }
15885 else
15886 {
15887 struct GlobalData * data = (((void *)0));
15888
15889 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15890 {
15891 char name[1024];
15892
15893 strcpy(name, thisNameSpace);
15894 strcat(name, "::");
15895 strcat(name, id->string);
15896 data = FindGlobalData(name);
15897 }
15898 if(!data)
15899 data = FindGlobalData(id->string);
15900 if(data)
15901 {
15902 DeclareGlobalData(curExternal, data);
15903 exp->expType = data->dataType;
15904 if(data->dataType)
15905 data->dataType->refCount++;
15906 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15907 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
15908 FreeSpecifier(id->_class);
15909 id->_class = (((void *)0));
15910 break;
15911 }
15912 else
15913 {
15914 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
15915
15916 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15917 {
15918 char name[1024];
15919
15920 strcpy(name, thisNameSpace);
15921 strcat(name, "::");
15922 strcat(name, id->string);
15923 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
15924 }
15925 if(!function)
15926 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
15927 if(function)
15928 {
15929 char name[1024];
15930
15931 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15932 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
15933 name[0] = 0;
15934 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
15935 strcpy(name, "__ecereFunction_");
15936 FullClassNameCat(name, id->string, 0);
15937 if(DeclareFunction(curExternal, function, name))
15938 {
15939 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15940 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
15941 }
15942 exp->expType = function->dataType;
15943 if(function->dataType)
15944 function->dataType->refCount++;
15945 FreeSpecifier(id->_class);
15946 id->_class = (((void *)0));
15947 break;
15948 }
15949 }
15950 }
15951 }
15952 }
15953 unresolved = 1;
15954 break;
15955 }
15956 case 1:
15957 {
15958 if(!exp->__anon1.instance->_class)
15959 {
15960 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
15961 {
15962 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
15963 }
15964 }
15965 ProcessInstantiationType(exp->__anon1.instance);
15966 exp->isConstant = exp->__anon1.instance->isConstant;
15967 if(exp->__anon1.instance->_class)
15968 {
15969 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
15970 }
15971 break;
15972 }
15973 case 2:
15974 {
15975 if(!exp->expType)
15976 {
15977 char * constant = exp->__anon1.__anon1.constant;
15978 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
15979
15980 exp->expType = type;
15981 if(constant[0] == '\'')
15982 {
15983 if((int)((unsigned char *)constant)[1] > 127)
15984 {
15985 int nb;
15986 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
15987
15988 if(nb < 2)
15989 ch = constant[1];
15990 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
15991 exp->__anon1.__anon1.constant = PrintUInt(ch);
15992 type->kind = 8;
15993 type->__anon1._class = FindClass("unichar");
15994 type->isSigned = 0;
15995 }
15996 else
15997 {
15998 type->kind = 1;
15999 type->isSigned = 1;
16000 }
16001 }
16002 else
16003 {
16004 char * dot = strchr(constant, '.');
16005 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
16006 char * exponent;
16007
16008 if(isHex)
16009 {
16010 exponent = strchr(constant, 'p');
16011 if(!exponent)
16012 exponent = strchr(constant, 'P');
16013 }
16014 else
16015 {
16016 exponent = strchr(constant, 'e');
16017 if(!exponent)
16018 exponent = strchr(constant, 'E');
16019 }
16020 if(dot || exponent)
16021 {
16022 if(strchr(constant, 'f') || strchr(constant, 'F'))
16023 type->kind = 6;
16024 else
16025 type->kind = 7;
16026 type->isSigned = 1;
16027 }
16028 else
16029 {
16030 unsigned int isSigned = constant[0] == '-';
16031 char * endP = (((void *)0));
16032 long long i64 = strtoll(constant, &endP, 0);
16033 uint64 ui64 = strtoull(constant, &endP, 0);
16034 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16035 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16036
16037 if(isSigned)
16038 {
16039 if(i64 < (((int)0x80000000)))
16040 is64Bit = 1;
16041 }
16042 else
16043 {
16044 if(ui64 > (((int)0x7fffffff)))
16045 {
16046 if(ui64 > (0xffffffff))
16047 {
16048 is64Bit = 1;
16049 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16050 isSigned = 1;
16051 }
16052 }
16053 else if(constant[0] != '0' || !constant[1])
16054 isSigned = 1;
16055 }
16056 if(forceUnsigned)
16057 isSigned = 0;
16058 type->kind = is64Bit ? 4 : 3;
16059 type->isSigned = isSigned;
16060 }
16061 }
16062 exp->isConstant = 1;
16063 if(exp->destType && exp->destType->kind == 7)
16064 type->kind = 7;
16065 else if(exp->destType && exp->destType->kind == 6)
16066 type->kind = 6;
16067 else if(exp->destType && exp->destType->kind == 4)
16068 type->kind = 4;
16069 }
16070 break;
16071 }
16072 case 3:
16073 {
16074 exp->isConstant = 1;
16075 exp->expType = __extension__ ({
16076 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16077
16078 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16079 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16080
16081 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16082 }), __ecereInstance2;
16083 });
16084 break;
16085 }
16086 case 13:
16087 case 26:
16088 ProcessExpressionType(exp->__anon1._new.size);
16089 exp->expType = __extension__ ({
16090 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16091
16092 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16093 });
16094 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16095 break;
16096 case 14:
16097 case 27:
16098 ProcessExpressionType(exp->__anon1._renew.size);
16099 ProcessExpressionType(exp->__anon1._renew.exp);
16100 exp->expType = __extension__ ({
16101 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16102
16103 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16104 });
16105 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16106 break;
16107 case 4:
16108 {
16109 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16110 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16111 unsigned int useDestType = 0, useSideType = 0;
16112 struct Location oldyylloc = yylloc;
16113 unsigned int useSideUnit = 0;
16114 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16115 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16116
16117 switch(exp->__anon1.op.op)
16118 {
16119 case '=':
16120 case MUL_ASSIGN:
16121 case DIV_ASSIGN:
16122 case MOD_ASSIGN:
16123 case ADD_ASSIGN:
16124 case SUB_ASSIGN:
16125 case LEFT_ASSIGN:
16126 case RIGHT_ASSIGN:
16127 case AND_ASSIGN:
16128 case XOR_ASSIGN:
16129 case OR_ASSIGN:
16130 assign = 1;
16131 break;
16132 case '!':
16133 break;
16134 case AND_OP:
16135 case OR_OP:
16136 boolOps = 1;
16137 boolResult = 1;
16138 break;
16139 case EQ_OP:
16140 case '<':
16141 case '>':
16142 case LE_OP:
16143 case GE_OP:
16144 case NE_OP:
16145 boolResult = 1;
16146 useSideType = 1;
16147 break;
16148 case '+':
16149 case '-':
16150 useSideUnit = 1;
16151 useSideType = 1;
16152 useDestType = 1;
16153 break;
16154 case LEFT_OP:
16155 case RIGHT_OP:
16156 break;
16157 case '|':
16158 case '^':
16159 useSideType = 1;
16160 useDestType = 1;
16161 break;
16162 case '/':
16163 case '%':
16164 useSideType = 1;
16165 useDestType = 1;
16166 break;
16167 case '&':
16168 case '*':
16169 if(exp->__anon1.op.exp1)
16170 {
16171 useSideType = 1;
16172 useDestType = 1;
16173 }
16174 break;
16175 }
16176 if(exp->__anon1.op.op == '&')
16177 {
16178 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16179 {
16180 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16181 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16182
16183 if(symbol && symbol->isIterator == 2)
16184 {
16185 exp->type = 8;
16186 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16187 exp->__anon1.member.member = MkIdentifier("key");
16188 exp->expType = (((void *)0));
16189 exp->__anon1.op.exp2->expType = symbol->type;
16190 symbol->type->refCount++;
16191 ProcessExpressionType(exp);
16192 FreeType(dummy);
16193 break;
16194 }
16195 }
16196 }
16197 if(exp->__anon1.op.exp1)
16198 {
16199 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16200 useDestType = 0;
16201 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16202 {
16203 if(exp->__anon1.op.exp1->destType)
16204 FreeType(exp->__anon1.op.exp1->destType);
16205 exp->__anon1.op.exp1->destType = exp->destType;
16206 exp->__anon1.op.exp1->opDestType = 1;
16207 if(exp->destType)
16208 exp->destType->refCount++;
16209 }
16210 else if(!assign)
16211 {
16212 if(exp->__anon1.op.exp1->destType)
16213 FreeType(exp->__anon1.op.exp1->destType);
16214 exp->__anon1.op.exp1->destType = dummy;
16215 dummy->refCount++;
16216 }
16217 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16218 exp->__anon1.op.exp1->destType->count++;
16219 ProcessExpressionType(exp->__anon1.op.exp1);
16220 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16221 exp->__anon1.op.exp1->destType->count--;
16222 exp->__anon1.op.exp1->opDestType = 0;
16223 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)
16224 {
16225 exp->__anon1.op.exp2 = MkExpConstant("1");
16226 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16227 assign = 1;
16228 }
16229 if(exp->__anon1.op.exp1->destType == dummy)
16230 {
16231 FreeType(dummy);
16232 exp->__anon1.op.exp1->destType = (((void *)0));
16233 }
16234 if(exp->__anon1.op.exp2)
16235 {
16236 if(!assign && exp->__anon1.op.exp1->expType && (exp->__anon1.op.exp1->expType->kind == 1 || exp->__anon1.op.exp1->expType->kind == 2))
16237 {
16238 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);
16239
16240 FreeType(exp->__anon1.op.exp1->expType);
16241 exp->__anon1.op.exp1->expType = type;
16242 }
16243 }
16244 type1 = exp->__anon1.op.exp1->expType;
16245 }
16246 if(exp->__anon1.op.exp2)
16247 {
16248 char expString[10240];
16249
16250 expString[0] = '\0';
16251 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16252 {
16253 if(exp->__anon1.op.exp1)
16254 {
16255 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16256 if(exp->__anon1.op.exp1->expType)
16257 exp->__anon1.op.exp1->expType->refCount++;
16258 }
16259 else
16260 {
16261 exp->__anon1.op.exp2->destType = exp->destType;
16262 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16263 exp->__anon1.op.exp2->opDestType = 1;
16264 if(exp->destType)
16265 exp->destType->refCount++;
16266 }
16267 if(type1)
16268 type1->refCount++;
16269 exp->expType = type1;
16270 }
16271 else if(assign)
16272 {
16273 if(inCompiler)
16274 PrintExpression(exp->__anon1.op.exp2, expString);
16275 if(type1 && type1->kind == 13)
16276 {
16277 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)
16278 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16279 else if(exp->__anon1.op.op == '=')
16280 {
16281 if(exp->__anon1.op.exp2->destType)
16282 FreeType(exp->__anon1.op.exp2->destType);
16283 exp->__anon1.op.exp2->destType = type1;
16284 if(type1)
16285 type1->refCount++;
16286 }
16287 }
16288 else
16289 {
16290 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)
16291 ;
16292 else
16293 {
16294 if(exp->__anon1.op.exp2->destType)
16295 FreeType(exp->__anon1.op.exp2->destType);
16296 exp->__anon1.op.exp2->destType = type1;
16297 if(type1)
16298 type1->refCount++;
16299 }
16300 }
16301 if(type1)
16302 type1->refCount++;
16303 exp->expType = type1;
16304 }
16305 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16306 {
16307 if(exp->__anon1.op.exp2->destType)
16308 FreeType(exp->__anon1.op.exp2->destType);
16309 exp->__anon1.op.exp2->destType = exp->destType;
16310 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16311 exp->__anon1.op.exp2->opDestType = 1;
16312 if(exp->destType)
16313 exp->destType->refCount++;
16314 }
16315 else
16316 {
16317 if(exp->__anon1.op.exp2->destType)
16318 FreeType(exp->__anon1.op.exp2->destType);
16319 exp->__anon1.op.exp2->destType = dummy;
16320 dummy->refCount++;
16321 }
16322 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))
16323 {
16324 FreeType(exp->__anon1.op.exp2->destType);
16325 exp->__anon1.op.exp2->destType = type1;
16326 type1->refCount++;
16327 }
16328 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16329 exp->__anon1.op.exp2->destType->count++;
16330 if(exp->__anon1.op.op == SIZEOF)
16331 {
16332 struct Expression * e = exp->__anon1.op.exp2;
16333
16334 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16335 {
16336 if(e->type == 5 || e->type == 32 || e->type == 23)
16337 {
16338 if(e->type == 23)
16339 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16340 else
16341 e = (*e->__anon1.list).last;
16342 }
16343 }
16344 if(e->type == 11 && e->__anon1.cast.exp)
16345 e->__anon1.cast.exp->needCast = 1;
16346 }
16347 ProcessExpressionType(exp->__anon1.op.exp2);
16348 exp->__anon1.op.exp2->opDestType = 0;
16349 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16350 exp->__anon1.op.exp2->destType->count--;
16351 if(!assign && (exp->__anon1.op.exp1 || exp->__anon1.op.op == '~'))
16352 {
16353 if(exp->__anon1.op.exp2->expType && (exp->__anon1.op.exp2->expType->kind == 1 || exp->__anon1.op.exp2->expType->kind == 2))
16354 {
16355 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);
16356
16357 FreeType(exp->__anon1.op.exp2->expType);
16358 exp->__anon1.op.exp2->expType = type;
16359 }
16360 }
16361 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16362 {
16363 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)
16364 {
16365 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16366 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16367 }
16368 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)))
16369 {
16370 if(exp->__anon1.op.op == ADD_ASSIGN)
16371 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16372 }
16373 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))
16374 {
16375 if(exp->__anon1.op.op == ADD_ASSIGN)
16376 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16377 }
16378 else if(inCompiler)
16379 {
16380 char type1String[1024];
16381 char type2String[1024];
16382
16383 type1String[0] = '\0';
16384 type2String[0] = '\0';
16385 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16386 PrintType(type1, type2String, 0, 1);
16387 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16388 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16389 }
16390 }
16391 if(exp->__anon1.op.exp2->destType == dummy)
16392 {
16393 FreeType(dummy);
16394 exp->__anon1.op.exp2->destType = (((void *)0));
16395 }
16396 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16397 {
16398 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16399 type2->refCount = 1;
16400 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16401 type2->isSigned = 1;
16402 }
16403 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))
16404 {
16405 type2 = __extension__ ({
16406 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16407
16408 __ecereInstance1->kind = 3, __ecereInstance1;
16409 });
16410 type2->refCount = 1;
16411 type2->isSigned = 1;
16412 }
16413 else
16414 {
16415 type2 = exp->__anon1.op.exp2->expType;
16416 if(type2)
16417 type2->refCount++;
16418 }
16419 }
16420 dummy->kind = 0;
16421 if(exp->__anon1.op.op == SIZEOF)
16422 {
16423 exp->expType = __extension__ ({
16424 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16425
16426 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16427 });
16428 exp->isConstant = 1;
16429 }
16430 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16431 {
16432 exp->expType = Dereference(type2);
16433 if(type2 && type2->kind == 8)
16434 notByReference = 1;
16435 }
16436 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16437 exp->expType = Reference(type2);
16438 else if(exp->__anon1.op.op == LEFT_OP || exp->__anon1.op.op == RIGHT_OP)
16439 {
16440 if(exp->__anon1.op.exp1->expType)
16441 {
16442 exp->expType = exp->__anon1.op.exp1->expType;
16443 exp->expType->refCount++;
16444 }
16445 }
16446 else if(!assign)
16447 {
16448 if(boolOps)
16449 {
16450 if(exp->__anon1.op.exp1)
16451 {
16452 if(exp->__anon1.op.exp1->destType)
16453 FreeType(exp->__anon1.op.exp1->destType);
16454 exp->__anon1.op.exp1->destType = MkClassType("bool");
16455 exp->__anon1.op.exp1->destType->truth = 1;
16456 if(!exp->__anon1.op.exp1->expType)
16457 ProcessExpressionType(exp->__anon1.op.exp1);
16458 else
16459 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16460 FreeType(exp->__anon1.op.exp1->expType);
16461 exp->__anon1.op.exp1->expType = MkClassType("bool");
16462 exp->__anon1.op.exp1->expType->truth = 1;
16463 }
16464 if(exp->__anon1.op.exp2)
16465 {
16466 if(exp->__anon1.op.exp2->destType)
16467 FreeType(exp->__anon1.op.exp2->destType);
16468 exp->__anon1.op.exp2->destType = MkClassType("bool");
16469 exp->__anon1.op.exp2->destType->truth = 1;
16470 if(!exp->__anon1.op.exp2->expType)
16471 ProcessExpressionType(exp->__anon1.op.exp2);
16472 else
16473 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16474 FreeType(exp->__anon1.op.exp2->expType);
16475 exp->__anon1.op.exp2->expType = MkClassType("bool");
16476 exp->__anon1.op.exp2->expType->truth = 1;
16477 }
16478 }
16479 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")))))
16480 {
16481 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"))))
16482 {
16483 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)))
16484 {
16485 struct Type * intType;
16486
16487 if(!type1->__anon1._class->__anon1.registered->dataType)
16488 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16489 if(!type2->__anon1._class->__anon1.registered->dataType)
16490 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16491 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
16492 if(exp->__anon1.op.exp1->destType)
16493 FreeType(exp->__anon1.op.exp1->destType);
16494 if(exp->__anon1.op.exp2->destType)
16495 FreeType(exp->__anon1.op.exp2->destType);
16496 exp->__anon1.op.exp1->destType = intType;
16497 exp->__anon1.op.exp2->destType = intType;
16498 intType->refCount++;
16499 }
16500 else
16501 {
16502 if(exp->__anon1.op.exp2->destType)
16503 FreeType(exp->__anon1.op.exp2->destType);
16504 exp->__anon1.op.exp2->destType = type1;
16505 type1->refCount++;
16506 if(exp->__anon1.op.exp1->destType)
16507 FreeType(exp->__anon1.op.exp1->destType);
16508 exp->__anon1.op.exp1->destType = type2;
16509 type2->refCount++;
16510 }
16511 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)
16512 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);
16513 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16514 {
16515 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16516
16517 if(argExp)
16518 {
16519 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16520
16521 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16522 ProcessExpressionType(exp->__anon1.op.exp1);
16523 if(type2->kind != 13)
16524 {
16525 ProcessExpressionType(classExp);
16526 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16527 if(!exp->__anon1.op.exp2->expType)
16528 {
16529 if(type2)
16530 FreeType(type2);
16531 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16532 type2->refCount++;
16533 }
16534 ProcessExpressionType(exp->__anon1.op.exp2);
16535 }
16536 }
16537 }
16538 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)))
16539 {
16540 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16541 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16542 exp->expType = type1;
16543 if(type1)
16544 type1->refCount++;
16545 }
16546 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)))
16547 {
16548 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16549 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16550 exp->expType = type2;
16551 if(type2)
16552 type2->refCount++;
16553 }
16554 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))
16555 {
16556 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16557 }
16558 else
16559 {
16560 unsigned int success = 0;
16561
16562 if(type1->kind == 13 && type2->kind == 13)
16563 {
16564 if(exp->__anon1.op.op == '+')
16565 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16566 else if(exp->__anon1.op.op == '-')
16567 {
16568 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16569 {
16570 exp->expType = __extension__ ({
16571 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16572
16573 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16574 });
16575 success = 1;
16576 if(type1->__anon1.type->kind == 20)
16577 {
16578 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16579
16580 if(argExp)
16581 {
16582 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16583
16584 ProcessExpressionType(classExp);
16585 exp->type = 5;
16586 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"))));
16587 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16588 FreeType(dummy);
16589 return ;
16590 }
16591 }
16592 }
16593 }
16594 }
16595 if(!success && exp->__anon1.op.exp1->type == 2)
16596 {
16597 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16598 {
16599 if(exp->expType)
16600 FreeType(exp->expType);
16601 exp->expType = exp->__anon1.op.exp1->destType;
16602 if(exp->__anon1.op.exp1->destType)
16603 exp->__anon1.op.exp1->destType->refCount++;
16604 success = 1;
16605 }
16606 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16607 {
16608 if(exp->expType)
16609 FreeType(exp->expType);
16610 exp->expType = exp->__anon1.op.exp2->destType;
16611 if(exp->__anon1.op.exp2->destType)
16612 exp->__anon1.op.exp2->destType->refCount++;
16613 success = 1;
16614 }
16615 }
16616 else if(!success)
16617 {
16618 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16619 {
16620 if(exp->expType)
16621 FreeType(exp->expType);
16622 exp->expType = exp->__anon1.op.exp2->destType;
16623 if(exp->__anon1.op.exp2->destType)
16624 exp->__anon1.op.exp2->destType->refCount++;
16625 success = 1;
16626 }
16627 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16628 {
16629 if(exp->expType)
16630 FreeType(exp->expType);
16631 exp->expType = exp->__anon1.op.exp1->destType;
16632 if(exp->__anon1.op.exp1->destType)
16633 exp->__anon1.op.exp1->destType->refCount++;
16634 success = 1;
16635 }
16636 }
16637 if(!success)
16638 {
16639 char expString1[10240];
16640 char expString2[10240];
16641 char type1[1024];
16642 char type2[1024];
16643
16644 expString1[0] = '\0';
16645 expString2[0] = '\0';
16646 type1[0] = '\0';
16647 type2[0] = '\0';
16648 if(inCompiler)
16649 {
16650 PrintExpression(exp->__anon1.op.exp1, expString1);
16651 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16652 PrintExpression(exp->__anon1.op.exp2, expString2);
16653 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16654 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16655 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16656 }
16657 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16658 }
16659 }
16660 }
16661 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)
16662 {
16663 if(exp->__anon1.op.exp1->destType)
16664 FreeType(exp->__anon1.op.exp1->destType);
16665 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16666 if(type2->__anon1._class->__anon1.registered->dataType)
16667 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16668 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16669 exp->expType = type2;
16670 if(type2)
16671 type2->refCount++;
16672 }
16673 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)
16674 {
16675 if(exp->__anon1.op.exp2->destType)
16676 FreeType(exp->__anon1.op.exp2->destType);
16677 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16678 if(type1->__anon1._class->__anon1.registered->dataType)
16679 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16680 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16681 exp->expType = type1;
16682 if(type1)
16683 type1->refCount++;
16684 }
16685 else if(type1)
16686 {
16687 unsigned int valid = 0;
16688
16689 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
16690 {
16691 if(exp->__anon1.op.exp2->destType)
16692 FreeType(exp->__anon1.op.exp2->destType);
16693 if(!type1->__anon1._class->__anon1.registered->dataType)
16694 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16695 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16696 exp->__anon1.op.exp2->destType->refCount++;
16697 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16698 if(type2)
16699 FreeType(type2);
16700 type2 = exp->__anon1.op.exp2->destType;
16701 if(type2)
16702 type2->refCount++;
16703 exp->expType = type2;
16704 type2->refCount++;
16705 }
16706 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
16707 {
16708 if(exp->__anon1.op.exp1->destType)
16709 FreeType(exp->__anon1.op.exp1->destType);
16710 if(!type2->__anon1._class->__anon1.registered->dataType)
16711 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16712 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16713 exp->__anon1.op.exp1->destType->refCount++;
16714 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16715 type1 = exp->__anon1.op.exp1->destType;
16716 exp->expType = type1;
16717 type1->refCount++;
16718 }
16719 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
16720 {
16721 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
16722 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
16723
16724 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
16725 {
16726 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16727 {
16728 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16729 {
16730 if(exp->expType)
16731 FreeType(exp->expType);
16732 exp->expType = exp->__anon1.op.exp2->expType;
16733 if(exp->__anon1.op.exp2->expType)
16734 exp->__anon1.op.exp2->expType->refCount++;
16735 valid = 1;
16736 }
16737 }
16738 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16739 {
16740 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16741 {
16742 if(exp->expType)
16743 FreeType(exp->expType);
16744 exp->expType = exp->__anon1.op.exp1->expType;
16745 if(exp->__anon1.op.exp1->expType)
16746 exp->__anon1.op.exp1->expType->refCount++;
16747 valid = 1;
16748 }
16749 }
16750 }
16751 else
16752 {
16753 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16754 {
16755 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16756 {
16757 if(exp->expType)
16758 FreeType(exp->expType);
16759 exp->expType = exp->__anon1.op.exp1->expType;
16760 if(exp->__anon1.op.exp1->expType)
16761 exp->__anon1.op.exp1->expType->refCount++;
16762 valid = 1;
16763 }
16764 }
16765 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16766 {
16767 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16768 {
16769 if(exp->expType)
16770 FreeType(exp->expType);
16771 exp->expType = exp->__anon1.op.exp2->expType;
16772 if(exp->__anon1.op.exp2->expType)
16773 exp->__anon1.op.exp2->expType->refCount++;
16774 valid = 1;
16775 }
16776 }
16777 }
16778 }
16779 if(!valid)
16780 {
16781 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))
16782 {
16783 if(exp->__anon1.op.exp1->destType)
16784 FreeType(exp->__anon1.op.exp1->destType);
16785 exp->__anon1.op.exp1->destType = type2;
16786 type2->refCount++;
16787 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16788 {
16789 if(exp->expType)
16790 FreeType(exp->expType);
16791 exp->expType = exp->__anon1.op.exp1->destType;
16792 if(exp->__anon1.op.exp1->destType)
16793 exp->__anon1.op.exp1->destType->refCount++;
16794 }
16795 }
16796 else
16797 {
16798 if(exp->__anon1.op.exp2->destType)
16799 FreeType(exp->__anon1.op.exp2->destType);
16800 exp->__anon1.op.exp2->destType = type1;
16801 type1->refCount++;
16802 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16803 {
16804 if(exp->expType)
16805 FreeType(exp->expType);
16806 exp->expType = exp->__anon1.op.exp2->destType;
16807 if(exp->__anon1.op.exp2->destType)
16808 exp->__anon1.op.exp2->destType->refCount++;
16809 }
16810 else if(type1 && type2)
16811 {
16812 char expString1[10240];
16813 char expString2[10240];
16814 char type1String[1024];
16815 char type2String[1024];
16816
16817 expString1[0] = '\0';
16818 expString2[0] = '\0';
16819 type1String[0] = '\0';
16820 type2String[0] = '\0';
16821 if(inCompiler)
16822 {
16823 PrintExpression(exp->__anon1.op.exp1, expString1);
16824 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16825 PrintExpression(exp->__anon1.op.exp2, expString2);
16826 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16827 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
16828 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
16829 }
16830 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
16831 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
16832 {
16833 exp->expType = exp->__anon1.op.exp1->expType;
16834 if(exp->__anon1.op.exp1->expType)
16835 exp->__anon1.op.exp1->expType->refCount++;
16836 }
16837 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16838 {
16839 exp->expType = exp->__anon1.op.exp2->expType;
16840 if(exp->__anon1.op.exp2->expType)
16841 exp->__anon1.op.exp2->expType->refCount++;
16842 }
16843 }
16844 }
16845 }
16846 }
16847 else if(type2)
16848 {
16849 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16850 {
16851 struct Type * oldType = exp->__anon1.op.exp1->expType;
16852
16853 exp->__anon1.op.exp1->expType = (((void *)0));
16854 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16855 FreeType(oldType);
16856 else
16857 exp->__anon1.op.exp1->expType = oldType;
16858 }
16859 if(exp->__anon1.op.exp1->destType)
16860 FreeType(exp->__anon1.op.exp1->destType);
16861 exp->__anon1.op.exp1->destType = type2;
16862 type2->refCount++;
16863 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16864 {
16865 if(exp->expType)
16866 FreeType(exp->expType);
16867 exp->expType = exp->__anon1.op.exp1->destType;
16868 if(exp->__anon1.op.exp1->destType)
16869 exp->__anon1.op.exp1->destType->refCount++;
16870 }
16871 }
16872 }
16873 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
16874 {
16875 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16876 {
16877 if(exp->__anon1.op.exp1->destType)
16878 FreeType(exp->__anon1.op.exp1->destType);
16879 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16880 if(type2->__anon1._class->__anon1.registered->dataType)
16881 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16882 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16883 }
16884 if(exp->__anon1.op.op == '!')
16885 {
16886 exp->expType = MkClassType("bool");
16887 exp->expType->truth = 1;
16888 }
16889 else
16890 {
16891 exp->expType = type2;
16892 if(type2)
16893 type2->refCount++;
16894 }
16895 }
16896 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
16897 {
16898 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16899 {
16900 if(exp->__anon1.op.exp2->destType)
16901 FreeType(exp->__anon1.op.exp2->destType);
16902 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16903 if(type1->__anon1._class->__anon1.registered->dataType)
16904 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16905 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16906 }
16907 exp->expType = type1;
16908 if(type1)
16909 type1->refCount++;
16910 }
16911 }
16912 yylloc = exp->loc;
16913 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
16914 {
16915 char expString[10000];
16916
16917 expString[0] = '\0';
16918 if(inCompiler)
16919 {
16920 PrintExpression(exp->__anon1.op.exp1, expString);
16921 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16922 }
16923 if(expString[0])
16924 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16925 }
16926 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
16927 {
16928 char expString[10240];
16929
16930 expString[0] = '\0';
16931 if(inCompiler)
16932 {
16933 PrintExpression(exp->__anon1.op.exp2, expString);
16934 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16935 }
16936 if(expString[0])
16937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16938 }
16939 if(boolResult)
16940 {
16941 FreeType(exp->expType);
16942 exp->expType = MkClassType("bool");
16943 exp->expType->truth = 1;
16944 }
16945 if(exp->__anon1.op.op != SIZEOF)
16946 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
16947 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
16948 {
16949 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
16950 }
16951 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
16952 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
16953 yylloc = oldyylloc;
16954 FreeType(dummy);
16955 if(type2)
16956 FreeType(type2);
16957 break;
16958 }
16959 case 5:
16960 case 32:
16961 {
16962 struct Expression * e;
16963
16964 exp->isConstant = 1;
16965 for(e = (*exp->__anon1.list).first; e; e = e->next)
16966 {
16967 if(!e->next)
16968 {
16969 FreeType(e->destType);
16970 e->opDestType = exp->opDestType;
16971 e->destType = exp->destType;
16972 if(e->destType)
16973 {
16974 exp->destType->refCount++;
16975 }
16976 }
16977 ProcessExpressionType(e);
16978 if(!exp->expType && !e->next)
16979 {
16980 exp->expType = e->expType;
16981 if(e->expType)
16982 e->expType->refCount++;
16983 }
16984 if(!e->isConstant)
16985 exp->isConstant = 0;
16986 }
16987 e = (*exp->__anon1.list).first;
16988 if(!e->next && e->type == 8)
16989 {
16990 struct Expression * next = exp->next, * prev = exp->prev;
16991
16992 FreeType(exp->expType);
16993 FreeType(exp->destType);
16994 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16995 *exp = *e;
16996 exp->prev = prev;
16997 exp->next = next;
16998 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
16999 ProcessExpressionType(exp);
17000 }
17001 break;
17002 }
17003 case 6:
17004 {
17005 struct Expression * e;
17006
17007 exp->isConstant = 1;
17008 ProcessExpressionType(exp->__anon1.index.exp);
17009 if(!exp->__anon1.index.exp->isConstant)
17010 exp->isConstant = 0;
17011 if(exp->__anon1.index.exp->expType)
17012 {
17013 struct Type * source = exp->__anon1.index.exp->expType;
17014
17015 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
17016 {
17017 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
17018 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
17019
17020 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
17021 {
17022 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
17023 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
17024 {
17025 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
17026
17027 if(type->kind == 8)
17028 type->constant = 1;
17029 else if(type->kind == 13)
17030 {
17031 struct Type * t = type;
17032
17033 while(t->kind == 13)
17034 t = t->__anon1.type;
17035 t->constant = 1;
17036 }
17037 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
17038 }
17039 }
17040 }
17041 }
17042 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
17043 {
17044 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
17045 {
17046 if(e->destType)
17047 FreeType(e->destType);
17048 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
17049 }
17050 ProcessExpressionType(e);
17051 if(!e->next)
17052 {
17053 }
17054 if(!e->isConstant)
17055 exp->isConstant = 0;
17056 }
17057 if(!exp->expType)
17058 exp->expType = Dereference(exp->__anon1.index.exp->expType);
17059 if(exp->expType)
17060 DeclareType(curExternal, exp->expType, 1, 0);
17061 break;
17062 }
17063 case 7:
17064 {
17065 struct Expression * e;
17066 struct Type * functionType;
17067 struct Type * methodType = (((void *)0));
17068 char name[1024];
17069
17070 name[0] = '\0';
17071 if(inCompiler)
17072 {
17073 PrintExpression(exp->__anon1.call.exp, name);
17074 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17075 {
17076 PrintExpression(exp->__anon1.call.exp, name);
17077 }
17078 }
17079 if(exp->__anon1.call.exp->type == 0)
17080 {
17081 struct Expression * idExp = exp->__anon1.call.exp;
17082 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17083
17084 if(!strcmp(id->string, "__builtin_frame_address"))
17085 {
17086 exp->expType = ProcessTypeString("void *", 1);
17087 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17088 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17089 break;
17090 }
17091 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17092 {
17093 exp->expType = ProcessTypeString("int", 1);
17094 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17095 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17096 break;
17097 }
17098 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17099 {
17100 struct Expression * a = (((void *)0));
17101 struct Expression * b = (((void *)0));
17102 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17103
17104 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17105 {
17106 a = (*exp->__anon1.call.arguments).first;
17107 b = (*exp->__anon1.call.arguments).last;
17108 tempExp1 = a;
17109 tempExp2 = b;
17110 }
17111 else if((*exp->__anon1.call.arguments).count == 1)
17112 {
17113 a = (*exp->__anon1.call.arguments).first;
17114 tempExp1 = a;
17115 }
17116 if(a)
17117 {
17118 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17119 idExp->__anon1.__anon1.identifier = (((void *)0));
17120 FreeExpContents(exp);
17121 ProcessExpressionType(a);
17122 if(b)
17123 ProcessExpressionType(b);
17124 exp->type = 5;
17125 exp->__anon1.list = MkList();
17126 if(a->expType && (!b || b->expType))
17127 {
17128 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17129 {
17130 if(inCompiler)
17131 {
17132 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17133 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17134 struct Declaration * decl;
17135 char temp1[1024], temp2[1024];
17136
17137 GetTypeSpecs(a->expType, specs);
17138 if(a && !a->isConstant && a->type != 0)
17139 {
17140 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17141 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17142 tempExp1 = QMkExpId(temp1);
17143 tempExp1->expType = a->expType;
17144 if(a->expType)
17145 a->expType->refCount++;
17146 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17147 }
17148 if(b && !b->isConstant && b->type != 0)
17149 {
17150 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17151 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17152 tempExp2 = QMkExpId(temp2);
17153 tempExp2->expType = b->expType;
17154 if(b->expType)
17155 b->expType->refCount++;
17156 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17157 }
17158 decl = MkDeclaration(specs, decls);
17159 if(!curCompound->__anon1.compound.declarations)
17160 curCompound->__anon1.compound.declarations = MkList();
17161 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17162 }
17163 }
17164 }
17165 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17166 {
17167 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17168
17169 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17170 exp->expType = a->expType;
17171 if(a->expType)
17172 a->expType->refCount++;
17173 }
17174 else if(!strcmp(id->string, "Abs"))
17175 {
17176 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17177 exp->expType = a->expType;
17178 if(a->expType)
17179 a->expType->refCount++;
17180 }
17181 else if(!strcmp(id->string, "Sgn"))
17182 {
17183 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"))))));
17184 exp->expType = ProcessTypeString("int", 0);
17185 }
17186 FreeExpression(tempExp1);
17187 if(tempExp2)
17188 FreeExpression(tempExp2);
17189 FreeIdentifier(id);
17190 break;
17191 }
17192 }
17193 }
17194 {
17195 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17196
17197 if(!exp->__anon1.call.exp->destType)
17198 {
17199 exp->__anon1.call.exp->destType = dummy;
17200 dummy->refCount++;
17201 }
17202 ProcessExpressionType(exp->__anon1.call.exp);
17203 if(exp->__anon1.call.exp->destType == dummy)
17204 {
17205 FreeType(dummy);
17206 exp->__anon1.call.exp->destType = (((void *)0));
17207 }
17208 FreeType(dummy);
17209 }
17210 functionType = exp->__anon1.call.exp->expType;
17211 if(functionType && functionType->kind == 16)
17212 {
17213 methodType = functionType;
17214 functionType = methodType->__anon1.__anon3.method->dataType;
17215 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17216 {
17217 char typeString[1024];
17218
17219 typeString[0] = '\0';
17220 {
17221 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17222
17223 functionType->__anon1.__anon2.thisClass = (((void *)0));
17224 PrintType(functionType, typeString, 1, 1);
17225 functionType->__anon1.__anon2.thisClass = back;
17226 }
17227 if(strstr(typeString, "thisclass"))
17228 {
17229 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17230 struct Declarator * decl;
17231
17232 {
17233 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17234
17235 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17236 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))
17237 thisClassParams = 0;
17238 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17239 {
17240 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17241
17242 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17243 ProcessDeclarator(decl, 1);
17244 thisClass = backupThisClass;
17245 }
17246 thisClassParams = 1;
17247 functionType = ProcessType(specs, decl);
17248 functionType->refCount = 0;
17249 FinishTemplatesContext(context);
17250 {
17251 struct Type * p, * op;
17252
17253 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)
17254 {
17255 if(op->kind == 21)
17256 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17257 }
17258 }
17259 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17260 {
17261 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17262 }
17263 }
17264 FreeList(specs, (void *)(FreeSpecifier));
17265 FreeDeclarator(decl);
17266 }
17267 }
17268 }
17269 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17270 {
17271 struct Type * type = functionType->__anon1.type;
17272
17273 if(!functionType->refCount)
17274 {
17275 functionType->__anon1.type = (((void *)0));
17276 FreeType(functionType);
17277 }
17278 functionType = type;
17279 }
17280 if(functionType && functionType->kind != 11)
17281 {
17282 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17283 }
17284 else if(functionType)
17285 {
17286 unsigned int emptyParams = 0, noParams = 0;
17287 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17288 struct Type * type = functionType->__anon1.__anon2.params.first;
17289 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17290 int extra = 0;
17291 struct Location oldyylloc = yylloc;
17292
17293 if(!type)
17294 emptyParams = 1;
17295 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17296 {
17297 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17298 e = e->next;
17299 }
17300 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17301 {
17302 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)
17303 {
17304 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17305 if(e)
17306 {
17307 e->destType = type;
17308 e = e->next;
17309 type = functionType->__anon1.__anon2.params.first;
17310 }
17311 else
17312 type->refCount = 0;
17313 }
17314 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17315 {
17316 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17317 type->byReference = functionType->byReference;
17318 type->typedByReference = functionType->typedByReference;
17319 if(e)
17320 {
17321 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17322 e = e->next;
17323 e->destType = type;
17324 e = e->next;
17325 type = functionType->__anon1.__anon2.params.first;
17326 }
17327 else
17328 type->refCount = 0;
17329 }
17330 }
17331 if(type && type->kind == 0)
17332 {
17333 noParams = 1;
17334 if(!type->refCount)
17335 FreeType(type);
17336 type = (((void *)0));
17337 }
17338 for(; e; e = e->next)
17339 {
17340 if(!type && !emptyParams)
17341 {
17342 yylloc = e->loc;
17343 if(methodType && methodType->__anon1.__anon3.methodClass)
17344 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);
17345 else
17346 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);
17347 break;
17348 }
17349 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17350 {
17351 struct Type * templatedType = (((void *)0));
17352 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17353 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17354 int id = 0;
17355
17356 if(_class && _class->templateArgs)
17357 {
17358 struct __ecereNameSpace__ecere__com__Class * sClass;
17359
17360 for(sClass = _class; sClass; sClass = sClass->base)
17361 {
17362 if(sClass->templateClass)
17363 sClass = sClass->templateClass;
17364 id = 0;
17365 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17366 {
17367 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17368 {
17369 struct __ecereNameSpace__ecere__com__Class * nextClass;
17370
17371 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17372 {
17373 if(nextClass->templateClass)
17374 nextClass = nextClass->templateClass;
17375 id += nextClass->templateParams.count;
17376 }
17377 break;
17378 }
17379 id++;
17380 }
17381 if(curParam)
17382 break;
17383 }
17384 }
17385 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17386 {
17387 unsigned int constant = type->constant;
17388 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17389
17390 {
17391 struct Context * context = SetupTemplatesContext(_class);
17392
17393 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17394 FinishTemplatesContext(context);
17395 }
17396 if(templatedType->kind == 8 && constant)
17397 templatedType->constant = 1;
17398 else if(templatedType->kind == 13)
17399 {
17400 struct Type * t = templatedType->__anon1.type;
17401
17402 while(t->kind == 13)
17403 t = t->__anon1.type;
17404 if(constant)
17405 t->constant = constant;
17406 }
17407 e->destType = templatedType;
17408 if(templatedType)
17409 {
17410 templatedType->passAsTemplate = 1;
17411 }
17412 }
17413 else
17414 {
17415 e->destType = type;
17416 if(type)
17417 type->refCount++;
17418 }
17419 }
17420 else
17421 {
17422 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17423 {
17424 e->destType = type->prev;
17425 e->destType->refCount++;
17426 }
17427 else
17428 {
17429 e->destType = type;
17430 if(type)
17431 type->refCount++;
17432 }
17433 }
17434 if(type && type->kind != 14)
17435 {
17436 struct Type * next = type->next;
17437
17438 if(!type->refCount)
17439 FreeType(type);
17440 type = next;
17441 }
17442 }
17443 if(type && type->kind != 14)
17444 {
17445 if(methodType && methodType->__anon1.__anon3.methodClass)
17446 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);
17447 else
17448 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);
17449 }
17450 yylloc = oldyylloc;
17451 if(type && !type->refCount)
17452 FreeType(type);
17453 }
17454 else
17455 {
17456 functionType = __extension__ ({
17457 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17458
17459 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17460 });
17461 if(exp->__anon1.call.exp->type == 0)
17462 {
17463 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17464
17465 if(inCompiler)
17466 {
17467 struct Symbol * symbol;
17468 struct Location oldyylloc = yylloc;
17469
17470 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17471 if(strstr(string, "__builtin_") == string)
17472 {
17473 if(exp->destType)
17474 {
17475 functionType->__anon1.__anon2.returnType = exp->destType;
17476 exp->destType->refCount++;
17477 }
17478 }
17479 else
17480 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17481 symbol = __extension__ ({
17482 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17483
17484 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17485 });
17486 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17487 if(strstr(symbol->string, "::"))
17488 globalContext->hasNameSpace = 1;
17489 yylloc = oldyylloc;
17490 }
17491 }
17492 else if(exp->__anon1.call.exp->type == 8)
17493 {
17494 }
17495 else
17496 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17497 if(!functionType->__anon1.__anon2.returnType)
17498 {
17499 functionType->__anon1.__anon2.returnType = __extension__ ({
17500 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17501
17502 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17503 });
17504 }
17505 }
17506 if(functionType && functionType->kind == 11)
17507 {
17508 exp->expType = functionType->__anon1.__anon2.returnType;
17509 if(functionType->__anon1.__anon2.returnType)
17510 functionType->__anon1.__anon2.returnType->refCount++;
17511 if(!functionType->refCount)
17512 FreeType(functionType);
17513 }
17514 if(exp->__anon1.call.arguments)
17515 {
17516 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17517 ProcessExpressionType(e);
17518 }
17519 break;
17520 }
17521 case 8:
17522 {
17523 struct Type * type;
17524 struct Location oldyylloc = yylloc;
17525 unsigned int thisPtr;
17526 struct Expression * checkExp = exp->__anon1.member.exp;
17527
17528 while(checkExp)
17529 {
17530 if(checkExp->type == 11)
17531 checkExp = checkExp->__anon1.cast.exp;
17532 else if(checkExp->type == 5)
17533 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17534 else
17535 break;
17536 }
17537 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17538 exp->thisPtr = thisPtr;
17539 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17540 {
17541 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17542 }
17543 ProcessExpressionType(exp->__anon1.member.exp);
17544 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)
17545 {
17546 exp->isConstant = 0;
17547 }
17548 else
17549 exp->isConstant = exp->__anon1.member.exp->isConstant;
17550 type = exp->__anon1.member.exp->expType;
17551 yylloc = exp->loc;
17552 if(type && (type->kind == 20))
17553 {
17554 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17555 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17556
17557 if(_class)
17558 {
17559 for(param = _class->templateParams.first; param; param = param->next)
17560 {
17561 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17562 break;
17563 }
17564 }
17565 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17566 {
17567 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17568
17569 if(argExp)
17570 {
17571 struct Expression * expMember = exp->__anon1.member.exp;
17572 struct Declarator * decl;
17573 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17574 char thisClassTypeString[1024];
17575
17576 FreeIdentifier(exp->__anon1.member.member);
17577 ProcessExpressionType(argExp);
17578 {
17579 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17580
17581 if(colon)
17582 {
17583 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17584 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17585 }
17586 else
17587 strcpy(thisClassTypeString, _class->fullName);
17588 }
17589 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17590 exp->expType = ProcessType(specs, decl);
17591 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17592 {
17593 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17594 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17595 int paramCount = 0;
17596 int lastParam = -1;
17597 char templateString[1024];
17598 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17599
17600 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17601 for(cClass = expClass; cClass; cClass = cClass->base)
17602 {
17603 int p = 0;
17604
17605 for(param = cClass->templateParams.first; param; param = param->next)
17606 {
17607 int id = p;
17608 struct __ecereNameSpace__ecere__com__Class * sClass;
17609 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17610
17611 for(sClass = cClass->base; sClass; sClass = sClass->base)
17612 id += sClass->templateParams.count;
17613 arg = expClass->templateArgs[id];
17614 for(sClass = _class; sClass; sClass = sClass->base)
17615 {
17616 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17617 int p = 0;
17618 struct __ecereNameSpace__ecere__com__Class * nextClass;
17619
17620 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17621 p += nextClass->templateParams.count;
17622 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17623 {
17624 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17625 {
17626 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17627 {
17628 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17629 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17630 break;
17631 }
17632 }
17633 }
17634 }
17635 {
17636 char argument[256];
17637
17638 argument[0] = '\0';
17639 switch(param->type)
17640 {
17641 case 2:
17642 {
17643 char expString[1024];
17644 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17645 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17646 struct Expression * exp;
17647 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17648
17649 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17650 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17651 ProcessExpressionType(exp);
17652 ComputeExpression(exp);
17653 expString[0] = '\0';
17654 PrintExpression(exp, expString);
17655 strcat(argument, expString);
17656 FreeExpression(exp);
17657 break;
17658 }
17659 case 1:
17660 {
17661 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17662 break;
17663 }
17664 case 0:
17665 {
17666 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17667 {
17668 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17669 strcat(argument, thisClassTypeString);
17670 else
17671 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17672 }
17673 break;
17674 }
17675 }
17676 if(argument[0])
17677 {
17678 if(paramCount)
17679 strcat(templateString, ", ");
17680 if(lastParam != p - 1)
17681 {
17682 strcat(templateString, param->name);
17683 strcat(templateString, " = ");
17684 }
17685 strcat(templateString, argument);
17686 paramCount++;
17687 lastParam = p;
17688 }
17689 p++;
17690 }
17691 }
17692 }
17693 {
17694 int len = strlen(templateString);
17695
17696 if(templateString[len - 1] == '>')
17697 templateString[len++] = ' ';
17698 templateString[len++] = '>';
17699 templateString[len++] = '\0';
17700 }
17701 {
17702 struct Context * context = SetupTemplatesContext(_class);
17703
17704 FreeType(exp->expType);
17705 exp->expType = ProcessTypeString(templateString, 0);
17706 FinishTemplatesContext(context);
17707 }
17708 }
17709 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
17710 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
17711 exp->type = 5;
17712 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")))))))));
17713 }
17714 }
17715 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
17716 {
17717 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
17718 }
17719 }
17720 if(type && (type->kind == 20))
17721 ;
17722 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)))
17723 {
17724 struct Identifier * id = exp->__anon1.member.member;
17725 int typeKind = type->kind;
17726 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));
17727
17728 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
17729 {
17730 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
17731 typeKind = 8;
17732 }
17733 if(id)
17734 {
17735 if(typeKind == 3 || typeKind == 15)
17736 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
17737 else if(!_class)
17738 {
17739 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17740 {
17741 _class = type->__anon1._class->__anon1.registered;
17742 }
17743 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
17744 {
17745 _class = FindClass("char *")->__anon1.registered;
17746 }
17747 else if(type->kind == 13)
17748 {
17749 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
17750 FreeType(exp->expType);
17751 exp->expType = ProcessTypeString("uintptr", 0);
17752 exp->byReference = 1;
17753 }
17754 else
17755 {
17756 char string[1024] = "";
17757 struct Symbol * classSym;
17758
17759 PrintTypeNoConst(type, string, 0, 1);
17760 classSym = FindClass(string);
17761 if(classSym)
17762 _class = classSym->__anon1.registered;
17763 }
17764 }
17765 }
17766 if(_class && id)
17767 {
17768 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
17769 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
17770 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17771 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
17772 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
17773
17774 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
17775 exp->__anon1.member.memberType = 1;
17776 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
17777 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
17778 if(typeKind != 19)
17779 {
17780 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
17781 {
17782 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17783 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
17784 {
17785 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17786 if(prop)
17787 member = (((void *)0));
17788 }
17789 if(!member && !prop)
17790 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17791 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
17792 exp->__anon1.member.thisPtr = 1;
17793 }
17794 else
17795 {
17796 unsigned int useMemberForNonConst = 0;
17797
17798 if(!id->classSym)
17799 {
17800 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
17801 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);
17802 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17803 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
17804 }
17805 if((!prop || useMemberForNonConst) && !member)
17806 {
17807 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
17808 if(!method)
17809 {
17810 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17811 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);
17812 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17813 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17814 }
17815 }
17816 if(member && prop)
17817 {
17818 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
17819 prop = (((void *)0));
17820 else
17821 member = (((void *)0));
17822 }
17823 }
17824 }
17825 if(!prop && !member && !method)
17826 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
17827 if(!prop && !member && !method)
17828 {
17829 if(typeKind == 19)
17830 {
17831 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
17832 if(classProp)
17833 {
17834 exp->__anon1.member.memberType = 5;
17835 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
17836 }
17837 else
17838 {
17839 char structName[1024];
17840 struct Identifier * id = exp->__anon1.member.member;
17841 struct Expression * classExp = exp->__anon1.member.exp;
17842
17843 type->refCount++;
17844 FreeType(classExp->expType);
17845 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
17846 strcpy(structName, "__ecereClassData_");
17847 FullClassNameCat(structName, type->__anon1._class->string, 0);
17848 exp->type = 9;
17849 exp->__anon1.member.member = id;
17850 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"))))))));
17851 FreeType(type);
17852 ProcessExpressionType(exp);
17853 return ;
17854 }
17855 }
17856 else
17857 {
17858 struct Symbol * classSym = FindClass(id->string);
17859
17860 if(classSym)
17861 {
17862 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
17863
17864 if(convertClass)
17865 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
17866 }
17867 }
17868 }
17869 if(exp->__anon1.member.exp->destType)
17870 FreeType(exp->__anon1.member.exp->destType);
17871 {
17872 if(method && !method->_class->symbol)
17873 method->_class->symbol = FindClass(method->_class->fullName);
17874 if(prop && !prop->_class->symbol)
17875 prop->_class->symbol = FindClass(prop->_class->fullName);
17876 exp->__anon1.member.exp->destType = __extension__ ({
17877 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17878
17879 __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;
17880 });
17881 }
17882 if(prop)
17883 {
17884 exp->__anon1.member.memberType = 1;
17885 if(!prop->dataType)
17886 ProcessPropertyType(prop);
17887 exp->expType = prop->dataType;
17888 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
17889 {
17890 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17891
17892 CopyTypeInto(type, exp->expType);
17893 type->refCount = 1;
17894 type->constant = 1;
17895 exp->expType = type;
17896 }
17897 else if(prop->dataType)
17898 prop->dataType->refCount++;
17899 }
17900 else if(member)
17901 {
17902 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17903 {
17904 FreeExpContents(exp);
17905 exp->type = 0;
17906 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17907 ProcessExpressionType(exp);
17908 return ;
17909 }
17910 exp->__anon1.member.memberType = 3;
17911 DeclareStruct(curExternal, _class->fullName, 0, 1);
17912 if(member->_class != _class)
17913 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
17914 if(!member->dataType)
17915 {
17916 struct Context * context = SetupTemplatesContext(_class);
17917
17918 member->dataType = ProcessTypeString(member->dataTypeString, 0);
17919 FinishTemplatesContext(context);
17920 }
17921 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)
17922 member->dataType->bitMemberSize = ((struct __ecereNameSpace__ecere__com__BitMember *)member)->size;
17923 exp->expType = member->dataType;
17924 if(member->dataType)
17925 member->dataType->refCount++;
17926 }
17927 else if(revConvert)
17928 {
17929 exp->__anon1.member.memberType = 4;
17930 exp->expType = MkClassType(revConvert->_class->fullName);
17931 }
17932 else if(method)
17933 {
17934 {
17935 exp->__anon1.member.memberType = 2;
17936 }
17937 if(!method->dataType)
17938 ProcessMethodType(method);
17939 exp->expType = __extension__ ({
17940 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17941
17942 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
17943 });
17944 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
17945 exp->expType->__anon1.__anon3.usedClass = _class;
17946 }
17947 else if(!classProp)
17948 {
17949 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17950 {
17951 FreeExpContents(exp);
17952 exp->type = 0;
17953 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17954 FreeType(exp->expType);
17955 exp->expType = MkClassType("ecere::com::Class");
17956 return ;
17957 }
17958 yylloc = exp->__anon1.member.member->loc;
17959 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
17960 if(inCompiler)
17961 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
17962 }
17963 if(_class && exp->expType)
17964 {
17965 struct __ecereNameSpace__ecere__com__Class * tClass;
17966
17967 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
17968 while(tClass && !tClass->templateClass)
17969 tClass = tClass->base;
17970 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
17971 {
17972 int id = 0;
17973 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17974 struct __ecereNameSpace__ecere__com__Class * sClass;
17975
17976 for(sClass = tClass; sClass; sClass = sClass->base)
17977 {
17978 id = 0;
17979 if(sClass->templateClass)
17980 sClass = sClass->templateClass;
17981 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17982 {
17983 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
17984 {
17985 for(sClass = sClass->base; sClass; sClass = sClass->base)
17986 id += sClass->templateParams.count;
17987 break;
17988 }
17989 id++;
17990 }
17991 if(curParam)
17992 break;
17993 }
17994 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
17995 {
17996 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
17997 struct Context * context = SetupTemplatesContext(tClass);
17998 unsigned int constant = exp->expType->constant;
17999 unsigned int passAsTemplate = 0;
18000 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
18001 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
18002
18003 if(t && t->kind == 8 && t->__anon1._class)
18004 thisClassFrom = t->__anon1._class->__anon1.registered;
18005 else
18006 thisClassFrom = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "class");
18007 FreeType(t);
18008 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
18009 FreeType(exp->expType);
18010 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18011 exp->expType->thisClassFrom = thisClassFrom;
18012 if(exp->expType->kind == 8 && constant)
18013 exp->expType->constant = 1;
18014 else if(exp->expType->kind == 13)
18015 {
18016 struct Type * t = exp->expType->__anon1.type;
18017
18018 while(t->kind == 13)
18019 t = t->__anon1.type;
18020 if(constant)
18021 t->constant = constant;
18022 }
18023 if(exp->expType)
18024 {
18025 if(exp->expType->kind == 21)
18026 {
18027 FreeType(exp->expType);
18028 exp->expType = ReplaceThisClassType(_class);
18029 }
18030 if(passAsTemplate)
18031 exp->expType->passAsTemplate = 1;
18032 if(!exp->destType)
18033 {
18034 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18035 if(exp->destType->kind == 8 && constant)
18036 exp->destType->constant = 1;
18037 else if(exp->destType->kind == 13)
18038 {
18039 struct Type * t = exp->destType->__anon1.type;
18040
18041 while(t->kind == 13)
18042 t = t->__anon1.type;
18043 if(constant)
18044 t->constant = constant;
18045 }
18046 if(exp->destType->kind == 21)
18047 {
18048 FreeType(exp->destType);
18049 exp->destType = ReplaceThisClassType(_class);
18050 }
18051 }
18052 }
18053 FinishTemplatesContext(context);
18054 }
18055 }
18056 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)
18057 {
18058 int id = 0;
18059 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
18060 struct __ecereNameSpace__ecere__com__Class * sClass;
18061
18062 for(sClass = tClass; sClass; sClass = sClass->base)
18063 {
18064 id = 0;
18065 if(sClass->templateClass)
18066 sClass = sClass->templateClass;
18067 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18068 {
18069 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
18070 {
18071 for(sClass = sClass->base; sClass; sClass = sClass->base)
18072 id += sClass->templateParams.count;
18073 break;
18074 }
18075 id++;
18076 }
18077 if(curParam)
18078 break;
18079 }
18080 if(curParam)
18081 {
18082 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18083 struct Context * context = SetupTemplatesContext(tClass);
18084 struct Type * basicType;
18085
18086 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18087 if(basicType)
18088 {
18089 if(basicType->kind == 21)
18090 {
18091 FreeType(basicType);
18092 basicType = ReplaceThisClassType(_class);
18093 }
18094 FreeType(exp->expType);
18095 exp->expType = __extension__ ({
18096 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18097
18098 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18099 });
18100 if(!exp->destType)
18101 {
18102 exp->destType = exp->expType;
18103 exp->destType->refCount++;
18104 }
18105 {
18106 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18107 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18108 struct Declarator * decl;
18109
18110 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18111 *newExp = *exp;
18112 if(exp->destType)
18113 exp->destType->refCount++;
18114 if(exp->expType)
18115 exp->expType->refCount++;
18116 exp->type = 11;
18117 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18118 exp->__anon1.cast.exp = newExp;
18119 }
18120 }
18121 FinishTemplatesContext(context);
18122 }
18123 }
18124 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18125 {
18126 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18127
18128 if(expClass)
18129 {
18130 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18131 int p = 0;
18132 int paramCount = 0;
18133 int lastParam = -1;
18134 char templateString[1024];
18135 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18136
18137 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18138 while(cClass != expClass)
18139 {
18140 struct __ecereNameSpace__ecere__com__Class * sClass;
18141
18142 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18143 ;
18144 cClass = sClass;
18145 for(param = cClass->templateParams.first; param; param = param->next)
18146 {
18147 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18148 int cp = 0;
18149 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18150 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18151
18152 while(cClassCur != tClass && !paramCur)
18153 {
18154 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18155
18156 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18157 ;
18158 cClassCur = sClassCur;
18159 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18160 {
18161 if(!strcmp(paramCur->name, param->name))
18162 {
18163 break;
18164 }
18165 cp++;
18166 }
18167 }
18168 if(paramCur && paramCur->type == 0)
18169 arg = tClass->templateArgs[cp];
18170 else
18171 arg = expClass->templateArgs[p];
18172 {
18173 char argument[256];
18174
18175 argument[0] = '\0';
18176 switch(param->type)
18177 {
18178 case 2:
18179 {
18180 char expString[1024];
18181 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18182 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18183 struct Expression * exp;
18184 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18185
18186 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18187 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18188 ProcessExpressionType(exp);
18189 ComputeExpression(exp);
18190 expString[0] = '\0';
18191 PrintExpression(exp, expString);
18192 strcat(argument, expString);
18193 FreeExpression(exp);
18194 break;
18195 }
18196 case 1:
18197 {
18198 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18199 break;
18200 }
18201 case 0:
18202 {
18203 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18204 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18205 break;
18206 }
18207 }
18208 if(argument[0])
18209 {
18210 if(paramCount)
18211 strcat(templateString, ", ");
18212 if(lastParam != p - 1)
18213 {
18214 strcat(templateString, param->name);
18215 strcat(templateString, " = ");
18216 }
18217 strcat(templateString, argument);
18218 paramCount++;
18219 lastParam = p;
18220 }
18221 }
18222 p++;
18223 }
18224 }
18225 {
18226 int len = strlen(templateString);
18227
18228 if(templateString[len - 1] == '>')
18229 templateString[len++] = ' ';
18230 templateString[len++] = '>';
18231 templateString[len++] = '\0';
18232 }
18233 FreeType(exp->expType);
18234 {
18235 struct Context * context = SetupTemplatesContext(tClass);
18236
18237 exp->expType = ProcessTypeString(templateString, 0);
18238 FinishTemplatesContext(context);
18239 }
18240 }
18241 }
18242 }
18243 }
18244 else
18245 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)");
18246 }
18247 else if(type && (type->kind == 9 || type->kind == 10))
18248 {
18249 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18250
18251 if(memberType)
18252 {
18253 exp->expType = memberType;
18254 if(memberType)
18255 memberType->refCount++;
18256 }
18257 }
18258 else
18259 {
18260 char expString[10240];
18261
18262 expString[0] = '\0';
18263 if(inCompiler)
18264 {
18265 PrintExpression(exp, expString);
18266 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18267 }
18268 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18269 }
18270 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18271 {
18272 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18273 {
18274 struct Identifier * id = exp->__anon1.member.member;
18275 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));
18276
18277 if(_class)
18278 {
18279 FreeType(exp->expType);
18280 exp->expType = ReplaceThisClassType(_class);
18281 }
18282 }
18283 }
18284 yylloc = oldyylloc;
18285 break;
18286 }
18287 case 9:
18288 {
18289 struct Type * destType = exp->destType;
18290
18291 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18292 {
18293 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18294 }
18295 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18296 exp->type = 8;
18297 if(destType)
18298 destType->count++;
18299 ProcessExpressionType(exp);
18300 if(destType)
18301 destType->count--;
18302 break;
18303 }
18304 case 15:
18305 {
18306 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18307
18308 if(classSym && classSym->__anon1.registered)
18309 {
18310 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18311 {
18312 char name[1024];
18313 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18314
18315 name[0] = '\0';
18316 DeclareStruct(curExternal, classSym->string, 0, 1);
18317 FreeSpecifier(exp->__anon1._class);
18318 FullClassNameCat(name, classSym->string, 0);
18319 if(b->offset == 0)
18320 {
18321 exp->type = 10;
18322 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18323 }
18324 else
18325 {
18326 struct Expression * e;
18327
18328 exp->type = 4;
18329 if(b->structSize == b->offset)
18330 exp->__anon1.op.exp1 = MkExpConstant("0");
18331 else
18332 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18333 exp->__anon1.op.op = '+';
18334 e = exp;
18335 while(b->offset != 0)
18336 {
18337 struct Symbol * sym;
18338 struct Expression * typeSize;
18339
18340 b = b->base;
18341 sym = FindClass(b->fullName);
18342 name[0] = '\0';
18343 DeclareStruct(curExternal, sym->string, 0, 1);
18344 FullClassNameCat(name, sym->string, 0);
18345 if(b->structSize == b->offset)
18346 typeSize = MkExpConstant("0");
18347 else
18348 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18349 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18350 e = e->__anon1.op.exp2;
18351 }
18352 }
18353 }
18354 else
18355 {
18356 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18357 {
18358 FreeSpecifier(exp->__anon1._class);
18359 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18360 exp->type = 2;
18361 }
18362 else
18363 {
18364 char className[1024];
18365
18366 strcpy(className, "__ecereClass_");
18367 FullClassNameCat(className, classSym->string, 1);
18368 DeclareClass(curExternal, classSym, className);
18369 FreeExpContents(exp);
18370 exp->type = 9;
18371 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18372 exp->__anon1.member.member = MkIdentifier("structSize");
18373 }
18374 }
18375 }
18376 exp->expType = __extension__ ({
18377 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18378
18379 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18380 });
18381 break;
18382 }
18383 case 10:
18384 {
18385 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
18386
18387 exp->expType = __extension__ ({
18388 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18389
18390 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18391 });
18392 exp->isConstant = 1;
18393 DeclareType(curExternal, type, 1, 0);
18394 FreeType(type);
18395 break;
18396 }
18397 case 11:
18398 {
18399 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18400
18401 type->count = 1;
18402 FreeType(exp->__anon1.cast.exp->destType);
18403 exp->__anon1.cast.exp->destType = type;
18404 type->refCount++;
18405 type->casted = 1;
18406 ProcessExpressionType(exp->__anon1.cast.exp);
18407 type->casted = 0;
18408 type->count = 0;
18409 exp->expType = type;
18410 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18411 {
18412 void * prev = exp->prev, * next = exp->next;
18413 struct Type * expType = exp->__anon1.cast.exp->destType;
18414 struct Expression * castExp = exp->__anon1.cast.exp;
18415 struct Type * destType = exp->destType;
18416
18417 if(expType)
18418 expType->refCount++;
18419 FreeType(exp->expType);
18420 FreeTypeName(exp->__anon1.cast.typeName);
18421 *exp = *castExp;
18422 FreeType(exp->expType);
18423 FreeType(exp->destType);
18424 exp->expType = expType;
18425 exp->destType = destType;
18426 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
18427 exp->prev = prev;
18428 exp->next = next;
18429 }
18430 else
18431 {
18432 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18433 }
18434 break;
18435 }
18436 case 33:
18437 {
18438 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18439
18440 exp->expType = type;
18441 break;
18442 }
18443 case 34:
18444 {
18445 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18446
18447 ProcessExpressionType(exp->__anon1.vaArg.exp);
18448 exp->expType = type;
18449 break;
18450 }
18451 case 12:
18452 {
18453 struct Expression * e;
18454 struct Type * t = exp->destType;
18455
18456 if(t && !exp->destType->casted)
18457 {
18458 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18459 CopyTypeInto(t, exp->destType);
18460 t->count = 0;
18461 }
18462 else if(t)
18463 t->refCount++;
18464 exp->isConstant = 1;
18465 FreeType(exp->__anon1.cond.cond->destType);
18466 exp->__anon1.cond.cond->destType = MkClassType("bool");
18467 exp->__anon1.cond.cond->destType->truth = 1;
18468 ProcessExpressionType(exp->__anon1.cond.cond);
18469 if(!exp->__anon1.cond.cond->isConstant)
18470 exp->isConstant = 0;
18471 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18472 {
18473 if(!e->next)
18474 {
18475 FreeType(e->destType);
18476 e->destType = t;
18477 if(e->destType)
18478 e->destType->refCount++;
18479 }
18480 ProcessExpressionType(e);
18481 if(!e->next)
18482 {
18483 exp->expType = e->expType;
18484 if(e->expType)
18485 e->expType->refCount++;
18486 }
18487 if(!e->isConstant)
18488 exp->isConstant = 0;
18489 }
18490 FreeType(exp->__anon1.cond.elseExp->destType);
18491 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18492 if(exp->__anon1.cond.elseExp->destType)
18493 exp->__anon1.cond.elseExp->destType->refCount++;
18494 ProcessExpressionType(exp->__anon1.cond.elseExp);
18495 if(!exp->__anon1.cond.elseExp->isConstant)
18496 exp->isConstant = 0;
18497 FreeType(t);
18498 break;
18499 }
18500 case 23:
18501 {
18502 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18503 {
18504 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18505
18506 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18507 {
18508 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18509 if(exp->destType)
18510 exp->destType->refCount++;
18511 }
18512 ProcessStatement(exp->__anon1.compound);
18513 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18514 if(exp->expType)
18515 exp->expType->refCount++;
18516 }
18517 break;
18518 }
18519 case 24:
18520 {
18521 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18522
18523 if(spec && spec->type == 1)
18524 {
18525 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18526 exp->expType->kind = 19;
18527 exp->byReference = 1;
18528 }
18529 else
18530 {
18531 exp->expType = MkClassType("ecere::com::Class");
18532 exp->byReference = 1;
18533 }
18534 break;
18535 }
18536 case 25:
18537 {
18538 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18539
18540 if(_class)
18541 {
18542 struct Identifier * id = exp->__anon1.classData.id;
18543 char structName[1024];
18544 struct Expression * classExp;
18545
18546 strcpy(structName, "__ecereClassData_");
18547 FullClassNameCat(structName, _class->fullName, 0);
18548 exp->type = 9;
18549 exp->__anon1.member.member = id;
18550 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18551 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18552 else
18553 classExp = MkExpIdentifier(MkIdentifier("class"));
18554 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"))))))));
18555 ProcessExpressionType(exp);
18556 return ;
18557 }
18558 break;
18559 }
18560 case 35:
18561 {
18562 struct Type * type = (((void *)0));
18563 const char * typeString = (((void *)0));
18564 char typeStringBuf[1024];
18565
18566 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))
18567 {
18568 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18569
18570 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18571 }
18572 else if(exp->__anon1.list)
18573 {
18574 struct Expression * e;
18575
18576 for(e = (*exp->__anon1.list).first; e; e = e->next)
18577 {
18578 ProcessExpressionType(e);
18579 if(e->expType)
18580 {
18581 if(!type)
18582 {
18583 type = e->expType;
18584 type->refCount++;
18585 }
18586 else
18587 {
18588 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18589 {
18590 FreeType(type);
18591 type = e->expType;
18592 e->expType = (((void *)0));
18593 e = (*exp->__anon1.list).first;
18594 ProcessExpressionType(e);
18595 if(e->expType)
18596 {
18597 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18598 {
18599 FreeType(e->expType);
18600 e->expType = (((void *)0));
18601 FreeType(type);
18602 type = (((void *)0));
18603 break;
18604 }
18605 }
18606 }
18607 }
18608 if(e->expType)
18609 {
18610 FreeType(e->expType);
18611 e->expType = (((void *)0));
18612 }
18613 }
18614 }
18615 if(type)
18616 {
18617 typeStringBuf[0] = '\0';
18618 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18619 typeString = typeStringBuf;
18620 FreeType(type);
18621 type = (((void *)0));
18622 }
18623 }
18624 if(typeString)
18625 {
18626 char templateString[1024];
18627 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18628 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18629 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18630 struct Expression * expExt;
18631 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18632
18633 sprintf(templateString, "Container<%s>", typeString);
18634 if(exp->__anon1.list)
18635 {
18636 struct Expression * e;
18637
18638 type = ProcessTypeString(typeString, 0);
18639 while((e = (*exp->__anon1.list).first))
18640 {
18641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18642 e->destType = type;
18643 type->refCount++;
18644 ProcessExpressionType(e);
18645 ListAdd(initializers, MkInitializerAssignment(e));
18646 }
18647 FreeType(type);
18648 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18649 }
18650 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18651 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18652 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18653 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18654 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18655 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18656 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18657 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18658 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18659 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18660 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18661
18662 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18663 })));
18664 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18665 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18666 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18667 exp->expType = ProcessTypeString(templateString, 0);
18668 exp->type = 5;
18669 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18670 ProcessExpressionType(expExt);
18671 }
18672 else
18673 {
18674 exp->expType = ProcessTypeString("Container", 0);
18675 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18676 }
18677 break;
18678 }
18679 }
18680 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18681 {
18682 FreeType(exp->expType);
18683 exp->expType = ReplaceThisClassType(thisClass);
18684 }
18685 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)
18686 {
18687 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
18688
18689 if(symbol)
18690 {
18691 if(exp->expType->kind != 15)
18692 {
18693 struct Type * member;
18694 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
18695
18696 FreeType(exp->expType);
18697 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18698 exp->expType->kind = symbol->type->kind;
18699 exp->expType->refCount++;
18700 exp->expType->__anon1.__anon1.enumName = enumName;
18701 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
18702 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18703 member->refCount++;
18704 }
18705 else
18706 {
18707 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
18708
18709 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18710 {
18711 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);
18712
18713 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
18714 }
18715 }
18716 }
18717 }
18718 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)))
18719 {
18720 exp->byReference = 1;
18721 }
18722 yylloc = exp->loc;
18723 if(exp->destType && (exp->destType->kind == 18))
18724 ;
18725 else if(exp->destType && !exp->destType->keepCast)
18726 {
18727 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
18728 exp->needTemplateCast = 1;
18729 if(exp->destType->kind == 0)
18730 ;
18731 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
18732 {
18733 unsigned int invalidCast = 0;
18734
18735 if(inCompiler && exp->destType->count && exp->expType)
18736 {
18737 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
18738 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
18739
18740 if(c1 && c1->type != 1)
18741 c1 = (((void *)0));
18742 if(c2 && c2->type != 1)
18743 c2 = (((void *)0));
18744 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
18745 invalidCast = 1;
18746 }
18747 if(!exp->destType->count || unresolved || invalidCast)
18748 {
18749 if(!exp->expType)
18750 {
18751 yylloc = exp->loc;
18752 if(exp->destType->kind != 14)
18753 {
18754 char type2[1024];
18755
18756 type2[0] = '\0';
18757 if(inCompiler)
18758 {
18759 char expString[10240];
18760
18761 expString[0] = '\0';
18762 PrintType(exp->destType, type2, 0, 1);
18763 if(inCompiler)
18764 {
18765 PrintExpression(exp, expString);
18766 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18767 }
18768 if(unresolved)
18769 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
18770 else if(exp->type != 16)
18771 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
18772 }
18773 }
18774 else
18775 {
18776 char expString[10240];
18777
18778 expString[0] = '\0';
18779 if(inCompiler)
18780 {
18781 PrintExpression(exp, expString);
18782 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18783 }
18784 if(unresolved)
18785 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
18786 else if(exp->type != 16)
18787 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18788 }
18789 }
18790 else
18791 {
18792 char type1[1024];
18793 char type2[1024];
18794
18795 type1[0] = '\0';
18796 type2[0] = '\0';
18797 if(inCompiler)
18798 {
18799 PrintType(exp->expType, type1, 0, 1);
18800 PrintType(exp->destType, type2, 0, 1);
18801 }
18802 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)))
18803 ;
18804 else
18805 {
18806 struct Expression * nbExp = GetNonBracketsExp(exp);
18807 unsigned int skipWarning = 0;
18808 int kind = exp->destType->kind;
18809
18810 if(nbExp->type == 12 && !nbExp->destType->casted && nbExp->destType->kind == exp->destType->kind)
18811 skipWarning = 1;
18812 if((kind == 1 || kind == 2) && exp->destType->isSigned == exp->expType->signedBeforePromotion && nbExp->type == 4 && nbExp->__anon1.op.exp1 && nbExp->__anon1.op.exp2)
18813 {
18814 int op = nbExp->__anon1.op.op;
18815 struct Expression * nbExp1, * nbExp2;
18816 int from;
18817
18818 switch(op)
18819 {
18820 case '%':
18821 case '/':
18822 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18823 from = nbExp1->expType->promotedFrom;
18824 if(from == 1 || (kind == 2 && from == 2))
18825 skipWarning = 1;
18826 break;
18827 case LEFT_OP:
18828 case RIGHT_OP:
18829 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18830 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18831 from = nbExp1->expType->promotedFrom;
18832 if(op == RIGHT_OP && (from == 1 || (kind == 2 && from == 2)))
18833 skipWarning = 1;
18834 else if(nbExp2->isConstant && nbExp2->type == 2 && (nbExp->__anon1.op.op == RIGHT_OP || nbExp1->expType->bitMemberSize))
18835 {
18836 int n = strtol(nbExp2->__anon1.__anon1.constant, (((void *)0)), 0);
18837 int s = from == 1 ? 8 : 16;
18838
18839 if(nbExp1->expType->bitMemberSize && nbExp1->expType->bitMemberSize < s)
18840 s = nbExp1->expType->bitMemberSize;
18841 if(nbExp->__anon1.op.op == RIGHT_OP)
18842 s -= n;
18843 else
18844 s += n;
18845 if(s <= (kind == 1 ? 8 : 16))
18846 skipWarning = 1;
18847 }
18848 break;
18849 case '-':
18850 if(!exp->destType->isSigned)
18851 {
18852 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18853 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18854 from = nbExp2->expType->promotedFrom;
18855 if((from == 1 || from == 2) && nbExp1->isConstant && nbExp1->type == 2)
18856 {
18857 int n = strtol(nbExp1->__anon1.__anon1.constant, (((void *)0)), 0);
18858
18859 if(n == (from == 1 ? 255 : 65535))
18860 skipWarning = 1;
18861 }
18862 }
18863 break;
18864 case '|':
18865 {
18866 int kind1, kind2;
18867
18868 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18869 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18870 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
18871 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
18872 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)))
18873 skipWarning = 1;
18874 break;
18875 }
18876 case '&':
18877 {
18878 int kind1, kind2;
18879
18880 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18881 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18882 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
18883 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
18884 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)))
18885 skipWarning = 1;
18886 break;
18887 }
18888 }
18889 }
18890 if(!skipWarning)
18891 {
18892 char expString[10240];
18893
18894 expString[0] = '\0';
18895 if(inCompiler)
18896 {
18897 PrintExpression(exp, expString);
18898 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18899 }
18900 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")))
18901 {
18902 if(invalidCast)
18903 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18904 else
18905 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18906 }
18907 }
18908 if(!inCompiler)
18909 {
18910 FreeType(exp->expType);
18911 exp->destType->refCount++;
18912 exp->expType = exp->destType;
18913 }
18914 }
18915 }
18916 }
18917 }
18918 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))
18919 {
18920 struct Expression * nbExp = GetNonBracketsExp(exp);
18921
18922 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
18923 {
18924 struct Expression * e = MoveExpContents(exp);
18925
18926 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
18927 exp->type = 11;
18928 exp->__anon1.cast.exp->destType = exp->destType;
18929 if(exp->destType)
18930 exp->destType->refCount++;
18931 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
18932 }
18933 }
18934 }
18935 else if(unresolved)
18936 {
18937 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
18938 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);
18939 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
18940 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
18941 }
18942 else if(!exp->expType && exp->type != 16)
18943 {
18944 char expString[10240];
18945
18946 expString[0] = '\0';
18947 if(inCompiler)
18948 {
18949 PrintExpression(exp, expString);
18950 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18951 }
18952 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18953 }
18954 if(inCompiler)
18955 ApplyAnyObjectLogic(exp);
18956 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)))
18957 {
18958 exp->byReference = 1;
18959 }
18960 yylloc = oldyylloc;
18961 }
18962
18963 static void ProcessFunction(struct FunctionDefinition * function)
18964 {
18965 struct Identifier * id = GetDeclId(function->declarator);
18966 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18967 struct Type * type = symbol ? symbol->type : (((void *)0));
18968 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18969 struct Context * oldTopContext = topContext;
18970
18971 yylloc = function->loc;
18972 if(type && type->__anon1.__anon2.thisClass)
18973 {
18974 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18975 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18976 char className[1024];
18977 char structName[1024];
18978 struct Declarator * funcDecl;
18979 struct Symbol * thisSymbol;
18980 unsigned int typedObject = 0;
18981
18982 if(_class && !_class->base)
18983 {
18984 _class = currentClass;
18985 if(_class && !_class->symbol)
18986 _class->symbol = FindClass(_class->fullName);
18987 classSym = _class ? _class->symbol : (((void *)0));
18988 typedObject = 1;
18989 }
18990 thisClass = _class;
18991 if(inCompiler && _class)
18992 {
18993 if(type->kind == 11)
18994 {
18995 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18996 {
18997 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18998
18999 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
19000 FreeType(param);
19001 }
19002 if(type->classObjectType != 1)
19003 {
19004 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
19005 symbol->type->__anon1.__anon2.staticMethod = 1;
19006 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
19007 symbol->type->extraParam = 0;
19008 }
19009 }
19010 strcpy(className, "__ecereClass_");
19011 FullClassNameCat(className, _class->fullName, 1);
19012 structName[0] = 0;
19013 FullClassNameCat(structName, _class->fullName, 0);
19014 funcDecl = GetFuncDecl(function->declarator);
19015 if(funcDecl)
19016 {
19017 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19018 {
19019 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19020
19021 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19022 {
19023 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19024 FreeTypeName(param);
19025 }
19026 }
19027 if(!function->propertyNoThis)
19028 {
19029 struct TypeName * thisParam = (((void *)0));
19030
19031 if(type->classObjectType != 1)
19032 {
19033 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19034 if(!funcDecl->__anon1.function.parameters)
19035 funcDecl->__anon1.function.parameters = MkList();
19036 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19037 }
19038 if(typedObject)
19039 {
19040 if(type->classObjectType != 1)
19041 {
19042 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
19043 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
19044 }
19045 thisParam = __extension__ ({
19046 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
19047
19048 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
19049 });
19050 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
19051 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19052 }
19053 }
19054 }
19055 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19056 {
19057 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19058
19059 funcDecl = GetFuncDecl(initDecl->declarator);
19060 if(funcDecl)
19061 {
19062 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19063 {
19064 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19065
19066 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19067 {
19068 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19069 FreeTypeName(param);
19070 }
19071 }
19072 if(type->classObjectType != 1)
19073 {
19074 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
19075 {
19076 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19077
19078 if(!funcDecl->__anon1.function.parameters)
19079 funcDecl->__anon1.function.parameters = MkList();
19080 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19081 }
19082 }
19083 }
19084 }
19085 }
19086 if(function->body)
19087 {
19088 if(type->classObjectType != 1)
19089 {
19090 thisSymbol = __extension__ ({
19091 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
19092
19093 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
19094 });
19095 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19096 if(typedObject && thisSymbol->type)
19097 {
19098 thisSymbol->type->classObjectType = 2;
19099 thisSymbol->type->byReference = type->byReference;
19100 thisSymbol->type->typedByReference = type->byReference;
19101 }
19102 }
19103 }
19104 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
19105 {
19106 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
19107
19108 {
19109 struct __ecereNameSpace__ecere__com__Class * base;
19110
19111 for(base = _class; base && base->type != 1000; base = base->next)
19112 {
19113 for(member = base->membersAndProperties.first; member; member = member->next)
19114 if(!member->isProperty)
19115 break;
19116 if(member)
19117 break;
19118 }
19119 }
19120 for(member = _class->membersAndProperties.first; member; member = member->next)
19121 if(!member->isProperty)
19122 break;
19123 if(member)
19124 {
19125 char pointerName[1024];
19126 struct Declaration * decl;
19127 struct Initializer * initializer;
19128 struct Expression * exp, * bytePtr;
19129
19130 strcpy(pointerName, "__ecerePointer_");
19131 FullClassNameCat(pointerName, _class->fullName, 0);
19132 {
19133 char className[1024];
19134
19135 strcpy(className, "__ecereClass_");
19136 FullClassNameCat(className, classSym->string, 1);
19137 DeclareClass(curExternal, classSym, className);
19138 }
19139 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
19140 if(_class->fixed)
19141 {
19142 struct Expression * e;
19143
19144 if(_class->offset && _class->offset == _class->base->structSize)
19145 {
19146 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
19147 ProcessExpressionType(e);
19148 }
19149 else
19150 {
19151 char string[256];
19152
19153 sprintf(string, "%d", _class->offset);
19154 e = MkExpConstant(string);
19155 }
19156 exp = QBrackets(MkExpOp(bytePtr, '+', e));
19157 }
19158 else
19159 {
19160 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
19161 }
19162 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
19163 exp->expType = __extension__ ({
19164 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19165
19166 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
19167 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19168
19169 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19170 }), __ecereInstance2;
19171 });
19172 if(function->body)
19173 {
19174 yylloc = function->body->loc;
19175 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19176 {
19177 struct Context * prevContext = curContext;
19178 struct __ecereNameSpace__ecere__sys__OldList * list;
19179
19180 curContext = function->body->__anon1.compound.context;
19181 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19182 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19183 curContext = prevContext;
19184 }
19185 decl->symbol = (((void *)0));
19186 if(!function->body->__anon1.compound.declarations)
19187 function->body->__anon1.compound.declarations = MkList();
19188 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19189 }
19190 }
19191 }
19192 }
19193 else
19194 thisClass = (((void *)0));
19195 if(id)
19196 {
19197 FreeSpecifier(id->_class);
19198 id->_class = (((void *)0));
19199 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19200 {
19201 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19202
19203 id = GetDeclId(initDecl->declarator);
19204 FreeSpecifier(id->_class);
19205 id->_class = (((void *)0));
19206 }
19207 }
19208 if(function->body)
19209 topContext = function->body->__anon1.compound.context;
19210 {
19211 struct FunctionDefinition * oldFunction = curFunction;
19212
19213 curFunction = function;
19214 if(function->body)
19215 ProcessStatement(function->body);
19216 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19217 {
19218 struct Statement * prevCompound = curCompound;
19219 struct Context * prevContext = curContext;
19220 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19221
19222 if(!function->body->__anon1.compound.statements)
19223 function->body->__anon1.compound.statements = MkList();
19224 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19225 curCompound = function->body;
19226 curContext = function->body->__anon1.compound.context;
19227 ProcessStatement(fireWatchers);
19228 curContext = prevContext;
19229 curCompound = prevCompound;
19230 }
19231 curFunction = oldFunction;
19232 }
19233 if(function->declarator)
19234 {
19235 ProcessDeclarator(function->declarator, 1);
19236 }
19237 topContext = oldTopContext;
19238 thisClass = oldThisClass;
19239 }
19240
19241 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19242 {
19243 struct ClassDef * def;
19244 struct External * external = curExternal;
19245 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19246
19247 for(def = definitions->first; def; def = def->next)
19248 {
19249 if(def->type == 0)
19250 {
19251 if(def->__anon1.function->declarator)
19252 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19253 else
19254 curExternal = external;
19255 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19256 }
19257 else if(def->type == 2)
19258 {
19259 if(def->__anon1.decl->type == 2)
19260 {
19261 thisClass = regClass;
19262 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19263 thisClass = (((void *)0));
19264 }
19265 else
19266 {
19267 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19268
19269 if(regClass)
19270 thisClass = regClass;
19271 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19272 thisClass = backThisClass;
19273 }
19274 }
19275 else if(def->type == 1 && def->__anon1.defProperties)
19276 {
19277 struct MemberInit * defProperty;
19278 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);
19279
19280 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19281 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19282 {
19283 thisClass = regClass;
19284 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19285 thisClass = (((void *)0));
19286 }
19287 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19288 FreeSymbol(thisSymbol);
19289 }
19290 else if(def->type == 3 && def->__anon1.propertyDef)
19291 {
19292 struct PropertyDef * prop = def->__anon1.propertyDef;
19293
19294 thisClass = regClass;
19295 if(prop->setStmt)
19296 {
19297 if(regClass)
19298 {
19299 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19300
19301 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19302 }
19303 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19304 ProcessStatement(prop->setStmt);
19305 }
19306 if(prop->getStmt)
19307 {
19308 if(regClass)
19309 {
19310 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19311
19312 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19313 }
19314 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19315 ProcessStatement(prop->getStmt);
19316 }
19317 if(prop->issetStmt)
19318 {
19319 if(regClass)
19320 {
19321 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19322
19323 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19324 }
19325 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19326 ProcessStatement(prop->issetStmt);
19327 }
19328 thisClass = (((void *)0));
19329 }
19330 else if(def->type == 4 && def->__anon1.propertyWatch)
19331 {
19332 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19333
19334 thisClass = regClass;
19335 if(propertyWatch->compound)
19336 {
19337 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);
19338
19339 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19340 curExternal = (((void *)0));
19341 ProcessStatement(propertyWatch->compound);
19342 }
19343 thisClass = (((void *)0));
19344 }
19345 }
19346 }
19347
19348 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19349 {
19350 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19351
19352 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19354 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19355 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19356 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19357 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19359 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19360 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19364 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19365 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19401 __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);
19402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19406 __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);
19407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19421 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19422 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)
19423 __ecereClass_Conversion = class;
19424 __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);
19425 __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);
19426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19427 __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);
19428 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19429 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19430 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19431 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19432 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19433 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19434 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19443 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19444 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19445 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19450 }
19451