compiler/libec: Fixed new memory leaks
[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
12432 if(!inCompiler || !classSym)
12433 return (((void *)0));
12434 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
12435 return (((void *)0));
12436 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
12437 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
12438 external = classSym->__anon2.__anon1.structExternal;
12439 if(external && external->__anon1.declaration)
12440 {
12441 struct Specifier * spec;
12442
12443 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12444 if(spec->type == 3 || spec->type == 4)
12445 {
12446 curDeclarations = spec->__anon1.__anon2.definitions;
12447 break;
12448 }
12449 }
12450 if(classSym->__anon1.registered && !classSym->declaring && classSym->imported && (!classSym->declaredStructSym || (classSym->__anon1.registered->type == 5 && !skipNoHead && external && !curDeclarations)))
12451 {
12452 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12453 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
12454 char structName[1024];
12455 unsigned int addedPadding = 0;
12456 struct Specifier * curSpec = (((void *)0));
12457
12458 classSym->declaring++;
12459 if(strchr(classSym->string, '<'))
12460 {
12461 if(classSym->__anon1.registered->templateClass)
12462 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
12463 classSym->declaring--;
12464 return external;
12465 }
12466 structName[0] = 0;
12467 FullClassNameCat(structName, name, 0);
12468 classSym->declaredStructSym = 1;
12469 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
12470 {
12471 unsigned int add = 0;
12472
12473 if(!external)
12474 {
12475 external = MkExternalDeclaration((((void *)0)));
12476 classSym->__anon2.__anon1.structExternal = external;
12477 external->symbol = classSym;
12478 add = 1;
12479 }
12480 if(!skipNoHead)
12481 {
12482 declarations = MkList();
12483 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
12484 }
12485 if(external->__anon1.declaration)
12486 {
12487 struct Specifier * spec;
12488
12489 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12490 if(spec->type == 3 || spec->type == 4)
12491 {
12492 curSpec = spec;
12493 curDeclarations = spec->__anon1.__anon2.definitions;
12494 break;
12495 }
12496 }
12497 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
12498 {
12499 FreeList(declarations, (void *)(FreeClassDef));
12500 declarations = (((void *)0));
12501 }
12502 if(classSym->__anon1.registered->type != 5 && !declarations)
12503 {
12504 FreeExternal(external);
12505 external = (((void *)0));
12506 classSym->__anon2.__anon1.structExternal = (((void *)0));
12507 }
12508 else
12509 {
12510 if(curSpec)
12511 curSpec->__anon1.__anon2.definitions = declarations;
12512 else
12513 {
12514 specifiers = MkList();
12515 declarators = MkList();
12516 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
12517 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12518 }
12519 if(add)
12520 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12521 }
12522 }
12523 classSym->declaring--;
12524 }
12525 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
12526 {
12527 classSym->declaredStructSym = 1;
12528 if(classSym->__anon1.registered)
12529 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
12530 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
12531 {
12532 struct Specifier * spec;
12533
12534 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
12535 {
12536 if(spec->__anon1.__anon2.definitions)
12537 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
12538 }
12539 }
12540 }
12541 if(inCompiler && neededBy && (external || !classSym->imported))
12542 {
12543 if(!external)
12544 {
12545 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
12546 external->symbol = classSym;
12547 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12548 }
12549 if(reachedPass15 && !external->__anon1.declaration && classSym->__anon1.registered && classSym->__anon1.registered->type == 5)
12550 {
12551 char structName[1024];
12552 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12553
12554 structName[0] = 0;
12555 FullClassNameCat(structName, name, 0);
12556 specifiers = MkList();
12557 declarators = MkList();
12558 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))));
12559 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12560 }
12561 if(fwdDecl)
12562 {
12563 struct External * e = external->fwdDecl ? external->fwdDecl : external;
12564
12565 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
12566 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
12567 }
12568 else
12569 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
12570 }
12571 return external;
12572 }
12573
12574 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)
12575 {
12576 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
12577 unsigned int found = 0;
12578 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
12579 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12580 unsigned int freeType = 0;
12581
12582 yylloc = member->loc;
12583 if(!ident)
12584 {
12585 if(curMember)
12586 {
12587 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
12588 if(*curMember)
12589 {
12590 found = 1;
12591 dataMember = *curMember;
12592 }
12593 }
12594 }
12595 else
12596 {
12597 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
12598 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
12599 int _subMemberStackPos = 0;
12600
12601 if(!thisMember)
12602 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
12603 if(thisMember)
12604 {
12605 dataMember = thisMember;
12606 if(curMember && thisMember->memberAccess == 1)
12607 {
12608 *curMember = thisMember;
12609 *curClass = thisMember->_class;
12610 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
12611 *subMemberStackPos = _subMemberStackPos;
12612 }
12613 found = 1;
12614 }
12615 else
12616 {
12617 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
12618 if(method && method->type == 1)
12619 found = 1;
12620 else
12621 method = (((void *)0));
12622 }
12623 }
12624 if(found)
12625 {
12626 struct Type * type = (((void *)0));
12627
12628 if(dataMember)
12629 {
12630 if(!dataMember->dataType && dataMember->dataTypeString)
12631 {
12632 struct Context * context = SetupTemplatesContext(_class);
12633
12634 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12635 FinishTemplatesContext(context);
12636 }
12637 type = dataMember->dataType;
12638 }
12639 else if(method)
12640 {
12641 if(!method->dataType)
12642 ProcessMethodType(method);
12643 type = method->dataType;
12644 }
12645 if(ident && ident->next)
12646 {
12647 for(ident = ident->next; ident && type; ident = ident->next)
12648 {
12649 if(type->kind == 8)
12650 {
12651 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
12652 if(!dataMember)
12653 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
12654 if(dataMember)
12655 type = dataMember->dataType;
12656 }
12657 else if(type->kind == 9 || type->kind == 10)
12658 {
12659 struct Type * memberType;
12660
12661 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
12662 {
12663 if(!strcmp(memberType->name, ident->string))
12664 {
12665 type = memberType;
12666 break;
12667 }
12668 }
12669 }
12670 }
12671 }
12672 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
12673 {
12674 int id = 0;
12675 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
12676 struct __ecereNameSpace__ecere__com__Class * sClass;
12677
12678 for(sClass = _class; sClass; sClass = sClass->base)
12679 {
12680 id = 0;
12681 if(sClass->templateClass)
12682 sClass = sClass->templateClass;
12683 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
12684 {
12685 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
12686 {
12687 for(sClass = sClass->base; sClass; sClass = sClass->base)
12688 {
12689 if(sClass->templateClass)
12690 sClass = sClass->templateClass;
12691 id += sClass->templateParams.count;
12692 }
12693 break;
12694 }
12695 id++;
12696 }
12697 if(curParam)
12698 break;
12699 }
12700 if(curParam)
12701 {
12702 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
12703
12704 if(arg.__anon1.__anon1.dataTypeString)
12705 {
12706 unsigned int constant = type->constant;
12707
12708 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
12709 if(type->kind == 8 && constant)
12710 type->constant = 1;
12711 else if(type->kind == 13)
12712 {
12713 struct Type * t = type->__anon1.type;
12714
12715 while(t->kind == 13)
12716 t = t->__anon1.type;
12717 if(constant)
12718 t->constant = constant;
12719 }
12720 freeType = 1;
12721 if(type && _class->templateClass)
12722 type->passAsTemplate = 1;
12723 if(type)
12724 {
12725 }
12726 }
12727 }
12728 }
12729 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
12730 {
12731 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
12732 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
12733 int paramCount = 0;
12734 int lastParam = -1;
12735 char templateString[1024];
12736 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
12737
12738 sprintf(templateString, "%s<", expClass->templateClass->fullName);
12739 for(cClass = expClass; cClass; cClass = cClass->base)
12740 {
12741 int p = 0;
12742
12743 if(cClass->templateClass)
12744 cClass = cClass->templateClass;
12745 for(param = cClass->templateParams.first; param; param = param->next)
12746 {
12747 int id = p;
12748 struct __ecereNameSpace__ecere__com__Class * sClass;
12749 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
12750
12751 for(sClass = cClass->base; sClass; sClass = sClass->base)
12752 {
12753 if(sClass->templateClass)
12754 sClass = sClass->templateClass;
12755 id += sClass->templateParams.count;
12756 }
12757 arg = expClass->templateArgs[id];
12758 for(sClass = _class; sClass; sClass = sClass->base)
12759 {
12760 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
12761 int p = 0;
12762 struct __ecereNameSpace__ecere__com__Class * nextClass;
12763
12764 if(sClass->templateClass)
12765 sClass = sClass->templateClass;
12766 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
12767 {
12768 if(nextClass->templateClass)
12769 nextClass = nextClass->templateClass;
12770 p += nextClass->templateParams.count;
12771 }
12772 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
12773 {
12774 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
12775 {
12776 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12777 {
12778 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
12779 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
12780 break;
12781 }
12782 }
12783 }
12784 }
12785 {
12786 char argument[256];
12787
12788 argument[0] = '\0';
12789 switch(param->type)
12790 {
12791 case 2:
12792 {
12793 char expString[1024];
12794 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12795 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
12796 struct Expression * exp;
12797 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
12798
12799 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
12800 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
12801 ProcessExpressionType(exp);
12802 ComputeExpression(exp);
12803 expString[0] = '\0';
12804 PrintExpression(exp, expString);
12805 strcat(argument, expString);
12806 FreeExpression(exp);
12807 break;
12808 }
12809 case 1:
12810 {
12811 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
12812 break;
12813 }
12814 case 0:
12815 {
12816 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12817 strcat(argument, arg.__anon1.__anon1.dataTypeString);
12818 break;
12819 }
12820 }
12821 if(argument[0])
12822 {
12823 if(paramCount)
12824 strcat(templateString, ", ");
12825 if(lastParam != p - 1)
12826 {
12827 strcat(templateString, param->name);
12828 strcat(templateString, " = ");
12829 }
12830 strcat(templateString, argument);
12831 paramCount++;
12832 lastParam = p;
12833 }
12834 p++;
12835 }
12836 }
12837 }
12838 {
12839 int len = strlen(templateString);
12840
12841 if(templateString[len - 1] == '<')
12842 len--;
12843 else
12844 {
12845 if(templateString[len - 1] == '>')
12846 templateString[len++] = ' ';
12847 templateString[len++] = '>';
12848 }
12849 templateString[len++] = '\0';
12850 }
12851 {
12852 struct Context * context = SetupTemplatesContext(_class);
12853
12854 if(freeType)
12855 FreeType(type);
12856 type = ProcessTypeString(templateString, 0);
12857 freeType = 1;
12858 FinishTemplatesContext(context);
12859 }
12860 }
12861 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
12862 {
12863 ProcessExpressionType(member->initializer->__anon1.exp);
12864 if(!member->initializer->__anon1.exp->expType)
12865 {
12866 if(inCompiler)
12867 {
12868 char expString[10240];
12869
12870 expString[0] = '\0';
12871 PrintExpression(member->initializer->__anon1.exp, expString);
12872 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12873 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
12874 }
12875 }
12876 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
12877 {
12878 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
12879 }
12880 }
12881 else if(member->initializer)
12882 {
12883 ProcessInitializer(member->initializer, type);
12884 }
12885 if(freeType)
12886 FreeType(type);
12887 }
12888 else
12889 {
12890 if(_class && _class->type == 3)
12891 {
12892 if(member->initializer)
12893 {
12894 struct Type * type = MkClassType(_class->fullName);
12895
12896 ProcessInitializer(member->initializer, type);
12897 FreeType(type);
12898 }
12899 }
12900 else
12901 {
12902 if(member->initializer)
12903 {
12904 ProcessInitializer(member->initializer, (((void *)0)));
12905 }
12906 if(ident)
12907 {
12908 if(method)
12909 {
12910 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12911 }
12912 else if(_class)
12913 {
12914 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12915 if(inCompiler)
12916 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
12917 }
12918 }
12919 else if(_class)
12920 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
12921 }
12922 }
12923 }
12924
12925 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
12926 {
12927 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
12928
12929 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)))
12930 {
12931 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
12932
12933 if(_class->type == 4)
12934 {
12935 struct __ecereNameSpace__ecere__sys__OldList converts =
12936 {
12937 0, 0, 0, 0, 0
12938 };
12939 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12940
12941 type->kind = 8;
12942 if(!_class->symbol)
12943 _class->symbol = FindClass(_class->fullName);
12944 type->__anon1._class = _class->symbol;
12945 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))
12946 {
12947 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12948 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12949
12950 if(enumClass)
12951 {
12952 struct __ecereNameSpace__ecere__com__Class * baseClass;
12953
12954 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12955 {
12956 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12957
12958 for(value = e->values.first; value; value = value->next)
12959 {
12960 if(!strcmp(value->name, string))
12961 break;
12962 }
12963 if(value)
12964 {
12965 FreeType(sourceExp->expType);
12966 sourceExp->isConstant = 1;
12967 sourceExp->expType = MkClassType(baseClass->fullName);
12968 if(inCompiler || inPreCompiler || inDebugger)
12969 {
12970 char constant[256];
12971
12972 FreeExpContents(sourceExp);
12973 sourceExp->type = 2;
12974 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
12975 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
12976 else
12977 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
12978 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12979 }
12980 while(converts.first)
12981 {
12982 struct Conversion * convert = converts.first;
12983
12984 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
12985 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
12986 }
12987 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12988 return 1;
12989 }
12990 }
12991 }
12992 }
12993 if(converts.first)
12994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12995 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12996 }
12997 }
12998 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)))
12999 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
13000 return 1;
13001 return 0;
13002 }
13003
13004 void ComputeExpression(struct Expression * exp)
13005 {
13006 switch(exp->type)
13007 {
13008 case 0:
13009 {
13010 struct Identifier * id = exp->__anon1.__anon1.identifier;
13011
13012 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
13013 {
13014 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
13015
13016 if(c && c->type == 4)
13017 {
13018 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13019
13020 if(enumClass)
13021 {
13022 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
13023 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
13024
13025 for(value = e->values.first; value; value = value->next)
13026 {
13027 if(!strcmp(value->name, id->string))
13028 break;
13029 }
13030 if(value)
13031 {
13032 const char * dts = c->dataTypeString;
13033
13034 FreeExpContents(exp);
13035 exp->type = 2;
13036 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
13037 }
13038 }
13039 }
13040 }
13041 break;
13042 }
13043 case 1:
13044 {
13045 ComputeInstantiation(exp);
13046 break;
13047 }
13048 case 4:
13049 {
13050 struct Expression * exp1, * exp2 = (((void *)0));
13051 struct Operand op1 =
13052 {
13053 0, 0, 0,
13054 .__anon1 = {
13055 .c = 0
13056 },
13057 {
13058 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13059 }
13060 };
13061 struct Operand op2 =
13062 {
13063 0, 0, 0,
13064 .__anon1 = {
13065 .c = 0
13066 },
13067 {
13068 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13069 }
13070 };
13071
13072 if(exp->__anon1.op.exp2)
13073 {
13074 struct Expression * e = exp->__anon1.op.exp2;
13075
13076 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13077 {
13078 if(e->type == 5 || e->type == 32 || e->type == 23)
13079 {
13080 if(e->type == 23)
13081 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13082 else
13083 e = (*e->__anon1.list).last;
13084 }
13085 }
13086 if(exp->__anon1.op.op == 261 && e && e->expType)
13087 {
13088 if(e->type == 3 && e->__anon1.__anon2.string)
13089 {
13090 char * string = e->__anon1.__anon2.string;
13091 int len = strlen(string);
13092 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13093
13094 len = UnescapeString(tmp, string + 1, len - 2);
13095 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13096 FreeExpContents(exp);
13097 exp->type = 2;
13098 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13099 }
13100 else
13101 {
13102 struct Type * type = e->expType;
13103
13104 type->refCount++;
13105 FreeExpContents(exp);
13106 exp->type = 2;
13107 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13108 FreeType(type);
13109 }
13110 break;
13111 }
13112 else
13113 ComputeExpression(exp->__anon1.op.exp2);
13114 }
13115 if(exp->__anon1.op.exp1)
13116 {
13117 ComputeExpression(exp->__anon1.op.exp1);
13118 exp1 = exp->__anon1.op.exp1;
13119 exp2 = exp->__anon1.op.exp2;
13120 op1 = GetOperand(exp1);
13121 if(op1.type)
13122 op1.type->refCount++;
13123 if(exp2)
13124 {
13125 op2 = GetOperand(exp2);
13126 if(op2.type)
13127 op2.type->refCount++;
13128 }
13129 }
13130 else
13131 {
13132 exp1 = exp->__anon1.op.exp2;
13133 op1 = GetOperand(exp1);
13134 if(op1.type)
13135 op1.type->refCount++;
13136 }
13137 CallOperator(exp, exp1, exp2, &op1, &op2);
13138 if(op1.type)
13139 FreeType(op1.type);
13140 if(op2.type)
13141 FreeType(op2.type);
13142 break;
13143 }
13144 case 5:
13145 case 32:
13146 {
13147 struct Expression * e, * n;
13148
13149 for(e = (*exp->__anon1.list).first; e; e = n)
13150 {
13151 n = e->next;
13152 if(!n)
13153 {
13154 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13155 struct Expression * prev = exp->prev;
13156 struct Expression * next = exp->next;
13157
13158 ComputeExpression(e);
13159 FreeType(exp->expType);
13160 FreeType(exp->destType);
13161 *exp = *e;
13162 exp->prev = prev;
13163 exp->next = next;
13164 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13165 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13166 }
13167 else
13168 {
13169 FreeExpression(e);
13170 }
13171 }
13172 break;
13173 }
13174 case 8:
13175 {
13176 struct Expression * memberExp = exp->__anon1.member.exp;
13177 struct Identifier * memberID = exp->__anon1.member.member;
13178 struct Type * type;
13179
13180 ComputeExpression(exp->__anon1.member.exp);
13181 type = exp->__anon1.member.exp->expType;
13182 if(type)
13183 {
13184 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)));
13185 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13186 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13187 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
13188
13189 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
13190 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13191 if(!_class)
13192 {
13193 char string[256];
13194 struct Symbol * classSym;
13195
13196 string[0] = '\0';
13197 PrintTypeNoConst(type, string, 0, 1);
13198 classSym = FindClass(string);
13199 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13200 }
13201 if(exp->__anon1.member.member)
13202 {
13203 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
13204 if(!prop)
13205 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
13206 }
13207 if(!prop && !member && _class && exp->__anon1.member.member)
13208 {
13209 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
13210
13211 convertTo = _class;
13212 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13213 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
13214 }
13215 if(prop)
13216 {
13217 if(prop->compiled)
13218 {
13219 struct Type * type = prop->dataType;
13220
13221 if(_class->type == 3)
13222 {
13223 if(type->kind == 8)
13224 {
13225 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13226
13227 if(_class->type == 3)
13228 {
13229 if(!_class->dataType)
13230 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13231 type = _class->dataType;
13232 }
13233 }
13234 switch(type->kind)
13235 {
13236 case 6:
13237 {
13238 float value;
13239 float (* Get)(float) = (void *)prop->Get;
13240
13241 GetFloat(exp->__anon1.member.exp, &value);
13242 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
13243 exp->type = 2;
13244 break;
13245 }
13246 case 7:
13247 {
13248 double value;
13249 double (* Get)(double);
13250
13251 GetDouble(exp->__anon1.member.exp, &value);
13252 if(convertTo)
13253 Get = (void *)prop->Set;
13254 else
13255 Get = (void *)prop->Get;
13256 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
13257 exp->type = 2;
13258 break;
13259 }
13260 }
13261 }
13262 else
13263 {
13264 if(convertTo)
13265 {
13266 struct Expression * value = exp->__anon1.member.exp;
13267 struct Type * type;
13268
13269 if(!prop->dataType)
13270 ProcessPropertyType(prop);
13271 type = prop->dataType;
13272 if(!type)
13273 {
13274 }
13275 else if(_class->type == 1)
13276 {
13277 switch(type->kind)
13278 {
13279 case 8:
13280 {
13281 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13282
13283 if(propertyClass->type == 1 && value->type == 1)
13284 {
13285 void (* Set)(void *, void *) = (void *)prop->Set;
13286
13287 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13288 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13289 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13290 exp->__anon1.instance->loc = exp->loc;
13291 exp->type = 1;
13292 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
13293 PopulateInstance(exp->__anon1.instance);
13294 }
13295 break;
13296 }
13297 case 3:
13298 {
13299 int intValue;
13300 void (* Set)(void *, int) = (void *)prop->Set;
13301
13302 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13303 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13304 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13305 exp->__anon1.instance->loc = exp->loc;
13306 exp->type = 1;
13307 GetInt(value, &intValue);
13308 Set(exp->__anon1.instance->data, intValue);
13309 PopulateInstance(exp->__anon1.instance);
13310 break;
13311 }
13312 case 4:
13313 {
13314 long long intValue;
13315 void (* Set)(void *, long long) = (void *)prop->Set;
13316
13317 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13318 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13319 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13320 exp->__anon1.instance->loc = exp->loc;
13321 exp->type = 1;
13322 GetInt64(value, &intValue);
13323 Set(exp->__anon1.instance->data, intValue);
13324 PopulateInstance(exp->__anon1.instance);
13325 break;
13326 }
13327 case 22:
13328 {
13329 intptr_t intValue;
13330 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13331
13332 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13333 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13334 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13335 exp->__anon1.instance->loc = exp->loc;
13336 exp->type = 1;
13337 GetIntPtr(value, &intValue);
13338 Set(exp->__anon1.instance->data, intValue);
13339 PopulateInstance(exp->__anon1.instance);
13340 break;
13341 }
13342 case 23:
13343 {
13344 ssize_t intValue;
13345 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13346
13347 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13348 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13349 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13350 exp->__anon1.instance->loc = exp->loc;
13351 exp->type = 1;
13352 GetIntSize(value, &intValue);
13353 Set(exp->__anon1.instance->data, intValue);
13354 PopulateInstance(exp->__anon1.instance);
13355 break;
13356 }
13357 case 6:
13358 {
13359 float floatValue;
13360 void (* Set)(void *, float) = (void *)prop->Set;
13361
13362 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13363 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13364 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13365 exp->__anon1.instance->loc = exp->loc;
13366 exp->type = 1;
13367 GetFloat(value, &floatValue);
13368 Set(exp->__anon1.instance->data, floatValue);
13369 PopulateInstance(exp->__anon1.instance);
13370 break;
13371 }
13372 case 7:
13373 {
13374 double doubleValue;
13375 void (* Set)(void *, double) = (void *)prop->Set;
13376
13377 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13378 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13379 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13380 exp->__anon1.instance->loc = exp->loc;
13381 exp->type = 1;
13382 GetDouble(value, &doubleValue);
13383 Set(exp->__anon1.instance->data, doubleValue);
13384 PopulateInstance(exp->__anon1.instance);
13385 break;
13386 }
13387 }
13388 }
13389 else if(_class->type == 2)
13390 {
13391 switch(type->kind)
13392 {
13393 case 8:
13394 {
13395 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13396
13397 if(propertyClass->type == 1 && value->__anon1.instance->data)
13398 {
13399 unsigned int (* Set)(void *) = (void *)prop->Set;
13400 unsigned int bits = Set(value->__anon1.instance->data);
13401
13402 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13403 exp->type = 2;
13404 break;
13405 }
13406 else if(_class->type == 2)
13407 {
13408 unsigned int value;
13409 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
13410 unsigned int bits;
13411
13412 GetUInt(exp->__anon1.member.exp, &value);
13413 bits = Set(value);
13414 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13415 exp->type = 2;
13416 }
13417 }
13418 }
13419 }
13420 }
13421 else
13422 {
13423 if(_class->type == 2)
13424 {
13425 unsigned int value;
13426
13427 GetUInt(exp->__anon1.member.exp, &value);
13428 switch(type->kind)
13429 {
13430 case 8:
13431 {
13432 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13433
13434 if(_class->type == 1)
13435 {
13436 void (* Get)(unsigned int, void *) = (void *)prop->Get;
13437
13438 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13439 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13440 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13441 exp->__anon1.instance->loc = exp->loc;
13442 exp->type = 1;
13443 Get(value, exp->__anon1.instance->data);
13444 PopulateInstance(exp->__anon1.instance);
13445 }
13446 else if(_class->type == 2)
13447 {
13448 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
13449 uint64 bits = Get(value);
13450
13451 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
13452 exp->type = 2;
13453 }
13454 break;
13455 }
13456 }
13457 }
13458 else if(_class->type == 1)
13459 {
13460 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
13461
13462 switch(type->kind)
13463 {
13464 case 8:
13465 {
13466 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13467
13468 if(_class->type == 1 && value)
13469 {
13470 void (* Get)(void *, void *) = (void *)prop->Get;
13471
13472 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13473 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13474 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13475 exp->__anon1.instance->loc = exp->loc;
13476 exp->type = 1;
13477 Get(value, exp->__anon1.instance->data);
13478 PopulateInstance(exp->__anon1.instance);
13479 }
13480 break;
13481 }
13482 }
13483 }
13484 }
13485 }
13486 }
13487 else
13488 {
13489 exp->isConstant = 0;
13490 }
13491 }
13492 else if(member)
13493 {
13494 }
13495 }
13496 if(exp->type != 8)
13497 {
13498 FreeExpression(memberExp);
13499 FreeIdentifier(memberID);
13500 }
13501 break;
13502 }
13503 case 10:
13504 {
13505 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
13506
13507 FreeExpContents(exp);
13508 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13509 exp->type = 2;
13510 FreeType(type);
13511 break;
13512 }
13513 case 15:
13514 {
13515 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
13516
13517 if(classSym && classSym->__anon1.registered)
13518 {
13519 if(classSym->__anon1.registered->fixed)
13520 {
13521 FreeSpecifier(exp->__anon1._class);
13522 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
13523 exp->type = 2;
13524 }
13525 else
13526 {
13527 char className[1024];
13528
13529 strcpy(className, "__ecereClass_");
13530 FullClassNameCat(className, classSym->string, 1);
13531 DeclareClass(curExternal, classSym, className);
13532 FreeExpContents(exp);
13533 exp->type = 9;
13534 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
13535 exp->__anon1.member.member = MkIdentifier("structSize");
13536 }
13537 }
13538 break;
13539 }
13540 case 11:
13541 {
13542 struct Type * type;
13543 struct Expression * e = exp;
13544
13545 if(exp->type == 11)
13546 {
13547 if(exp->__anon1.cast.exp)
13548 ComputeExpression(exp->__anon1.cast.exp);
13549 e = exp->__anon1.cast.exp;
13550 }
13551 if(e && exp->expType)
13552 {
13553 type = exp->expType;
13554 if(type->kind == 8)
13555 {
13556 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13557
13558 if(_class && (_class->type == 3 || _class->type == 2))
13559 {
13560 if(!_class->dataType)
13561 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13562 type = _class->dataType;
13563 }
13564 }
13565 switch(type->kind)
13566 {
13567 case 24:
13568 case 1:
13569 if(type->isSigned)
13570 {
13571 char value = 0;
13572
13573 if(GetChar(e, &value))
13574 {
13575 FreeExpContents(exp);
13576 exp->__anon1.__anon1.constant = PrintChar(value);
13577 exp->type = 2;
13578 }
13579 }
13580 else
13581 {
13582 unsigned char value = 0;
13583
13584 if(GetUChar(e, &value))
13585 {
13586 FreeExpContents(exp);
13587 exp->__anon1.__anon1.constant = PrintUChar(value);
13588 exp->type = 2;
13589 }
13590 }
13591 break;
13592 case 2:
13593 if(type->isSigned)
13594 {
13595 short value = 0;
13596
13597 if(GetShort(e, &value))
13598 {
13599 FreeExpContents(exp);
13600 exp->__anon1.__anon1.constant = PrintShort(value);
13601 exp->type = 2;
13602 }
13603 }
13604 else
13605 {
13606 unsigned short value = 0;
13607
13608 if(GetUShort(e, &value))
13609 {
13610 FreeExpContents(exp);
13611 exp->__anon1.__anon1.constant = PrintUShort(value);
13612 exp->type = 2;
13613 }
13614 }
13615 break;
13616 case 3:
13617 if(type->isSigned)
13618 {
13619 int value = 0;
13620
13621 if(GetInt(e, &value))
13622 {
13623 FreeExpContents(exp);
13624 exp->__anon1.__anon1.constant = PrintInt(value);
13625 exp->type = 2;
13626 }
13627 }
13628 else
13629 {
13630 unsigned int value = 0;
13631
13632 if(GetUInt(e, &value))
13633 {
13634 FreeExpContents(exp);
13635 exp->__anon1.__anon1.constant = PrintUInt(value);
13636 exp->type = 2;
13637 }
13638 }
13639 break;
13640 case 4:
13641 if(type->isSigned)
13642 {
13643 long long value = 0;
13644
13645 if(GetInt64(e, &value))
13646 {
13647 FreeExpContents(exp);
13648 exp->__anon1.__anon1.constant = PrintInt64(value);
13649 exp->type = 2;
13650 }
13651 }
13652 else
13653 {
13654 uint64 value = 0;
13655
13656 if(GetUInt64(e, &value))
13657 {
13658 FreeExpContents(exp);
13659 exp->__anon1.__anon1.constant = PrintUInt64(value);
13660 exp->type = 2;
13661 }
13662 }
13663 break;
13664 case 22:
13665 if(type->isSigned)
13666 {
13667 intptr_t value = 0;
13668
13669 if(GetIntPtr(e, &value))
13670 {
13671 FreeExpContents(exp);
13672 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13673 exp->type = 2;
13674 }
13675 }
13676 else
13677 {
13678 uintptr_t value = 0;
13679
13680 if(GetUIntPtr(e, &value))
13681 {
13682 FreeExpContents(exp);
13683 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13684 exp->type = 2;
13685 }
13686 }
13687 break;
13688 case 23:
13689 if(type->isSigned)
13690 {
13691 ssize_t value = 0;
13692
13693 if(GetIntSize(e, &value))
13694 {
13695 FreeExpContents(exp);
13696 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13697 exp->type = 2;
13698 }
13699 }
13700 else
13701 {
13702 size_t value = 0;
13703
13704 if(GetUIntSize(e, &value))
13705 {
13706 FreeExpContents(exp);
13707 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13708 exp->type = 2;
13709 }
13710 }
13711 break;
13712 case 6:
13713 {
13714 float value = 0;
13715
13716 if(GetFloat(e, &value))
13717 {
13718 FreeExpContents(exp);
13719 exp->__anon1.__anon1.constant = PrintFloat(value);
13720 exp->type = 2;
13721 }
13722 break;
13723 }
13724 case 7:
13725 {
13726 double value = 0;
13727
13728 if(GetDouble(e, &value))
13729 {
13730 FreeExpContents(exp);
13731 exp->__anon1.__anon1.constant = PrintDouble(value);
13732 exp->type = 2;
13733 }
13734 break;
13735 }
13736 }
13737 }
13738 break;
13739 }
13740 case 12:
13741 {
13742 struct Operand op1 =
13743 {
13744 0, 0, 0,
13745 .__anon1 = {
13746 .c = 0
13747 },
13748 {
13749 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13750 }
13751 };
13752 struct Operand op2 =
13753 {
13754 0, 0, 0,
13755 .__anon1 = {
13756 .c = 0
13757 },
13758 {
13759 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13760 }
13761 };
13762 struct Operand op3 =
13763 {
13764 0, 0, 0,
13765 .__anon1 = {
13766 .c = 0
13767 },
13768 {
13769 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13770 }
13771 };
13772
13773 if(exp->__anon1.cond.exp)
13774 ComputeExpression((*exp->__anon1.cond.exp).last);
13775 if(exp->__anon1.cond.elseExp)
13776 ComputeExpression(exp->__anon1.cond.elseExp);
13777 if(exp->__anon1.cond.cond)
13778 ComputeExpression(exp->__anon1.cond.cond);
13779 op1 = GetOperand(exp->__anon1.cond.cond);
13780 if(op1.type)
13781 op1.type->refCount++;
13782 op2 = GetOperand((*exp->__anon1.cond.exp).last);
13783 if(op2.type)
13784 op2.type->refCount++;
13785 op3 = GetOperand(exp->__anon1.cond.elseExp);
13786 if(op3.type)
13787 op3.type->refCount++;
13788 if(op1.ops.Cond)
13789 {
13790 FreeExpContents(exp);
13791 op1.ops.Cond(exp, &op1, &op2, &op3);
13792 }
13793 if(op1.type)
13794 FreeType(op1.type);
13795 if(op2.type)
13796 FreeType(op2.type);
13797 if(op3.type)
13798 FreeType(op3.type);
13799 break;
13800 }
13801 }
13802 }
13803
13804 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
13805 {
13806 struct __ecereNameSpace__ecere__com__Instance * module;
13807
13808 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))
13809 return 1;
13810 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))
13811 return 1;
13812 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))
13813 return 1;
13814 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)
13815 {
13816 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
13817 return 1;
13818 }
13819 return 0;
13820 }
13821
13822 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
13823 {
13824 struct Type * source;
13825 struct Type * realDest = dest;
13826 struct Type * backupSourceExpType = (((void *)0));
13827 struct Expression * nbExp = GetNonBracketsExp(sourceExp);
13828 struct Expression * computedExp = nbExp;
13829
13830 dest->refCount++;
13831 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)
13832 {
13833 computedExp = CopyExpression(nbExp);
13834 ComputeExpression(computedExp);
13835 }
13836 source = sourceExp->expType;
13837 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
13838 {
13839 if(computedExp != nbExp)
13840 {
13841 FreeExpression(computedExp);
13842 computedExp = nbExp;
13843 }
13844 FreeType(dest);
13845 return 1;
13846 }
13847 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
13848 {
13849 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
13850 {
13851 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
13852
13853 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
13854 ;
13855 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
13856 ;
13857 if(sourceBase == destBase)
13858 {
13859 if(computedExp != nbExp)
13860 {
13861 FreeExpression(computedExp);
13862 computedExp = nbExp;
13863 }
13864 FreeType(dest);
13865 return 1;
13866 }
13867 }
13868 }
13869 if(source)
13870 {
13871 struct __ecereNameSpace__ecere__sys__OldList * specs;
13872 unsigned int flag = 0;
13873 long long value = (((int)0x7fffffff));
13874
13875 source->refCount++;
13876 if(computedExp->type == 2)
13877 {
13878 if(source->isSigned)
13879 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13880 else
13881 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13882 }
13883 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
13884 {
13885 if(source->isSigned)
13886 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13887 else
13888 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13889 }
13890 if(computedExp != nbExp)
13891 {
13892 FreeExpression(computedExp);
13893 computedExp = nbExp;
13894 }
13895 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
13896 {
13897 FreeType(source);
13898 source = __extension__ ({
13899 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13900
13901 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
13902 });
13903 }
13904 if(dest->kind == 8)
13905 {
13906 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13907
13908 if(_class && _class->type == 3)
13909 {
13910 if(source->kind != 8)
13911 {
13912 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13913 struct Type * tempDest, * tempSource;
13914
13915 for(; _class->base->type != 1000; _class = _class->base)
13916 ;
13917 tempSource = dest;
13918 tempDest = tempType;
13919 tempType->kind = 8;
13920 if(!_class->symbol)
13921 _class->symbol = FindClass(_class->fullName);
13922 tempType->__anon1._class = _class->symbol;
13923 tempType->truth = dest->truth;
13924 if(tempType->__anon1._class)
13925 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13926 backupSourceExpType = sourceExp->expType;
13927 if(dest->passAsTemplate)
13928 {
13929 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13930 CopyTypeInto(sourceExp->expType, dest);
13931 sourceExp->expType->passAsTemplate = 0;
13932 }
13933 else
13934 {
13935 sourceExp->expType = dest;
13936 dest->refCount++;
13937 }
13938 flag = 1;
13939 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13940 }
13941 }
13942 if(_class && _class->type == 2 && source->kind != 8)
13943 {
13944 if(!dest->__anon1._class->__anon1.registered->dataType)
13945 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
13946 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13947 {
13948 FreeType(source);
13949 FreeType(sourceExp->expType);
13950 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
13951 source->refCount++;
13952 }
13953 }
13954 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
13955 {
13956 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13957 struct Declarator * decl;
13958 char string[1024];
13959
13960 ReadString(string, sourceExp->__anon1.__anon2.string);
13961 decl = SpecDeclFromString(string, specs, (((void *)0)));
13962 FreeExpContents(sourceExp);
13963 FreeType(sourceExp->expType);
13964 sourceExp->type = 24;
13965 sourceExp->__anon1._classExp.specifiers = specs;
13966 sourceExp->__anon1._classExp.decl = decl;
13967 sourceExp->expType = dest;
13968 dest->refCount++;
13969 FreeType(source);
13970 FreeType(dest);
13971 if(backupSourceExpType)
13972 FreeType(backupSourceExpType);
13973 return 1;
13974 }
13975 }
13976 else if(source->kind == 8)
13977 {
13978 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
13979
13980 if(_class && (_class->type == 3 || _class->type == 2))
13981 {
13982 if(dest->kind != 8)
13983 {
13984 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13985 struct Type * tempDest, * tempSource;
13986
13987 if(!source->__anon1._class->__anon1.registered->dataType)
13988 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
13989 for(; _class->base->type != 1000; _class = _class->base)
13990 ;
13991 tempDest = source;
13992 tempSource = tempType;
13993 tempType->kind = 8;
13994 tempType->__anon1._class = FindClass(_class->fullName);
13995 tempType->truth = source->truth;
13996 tempType->classObjectType = source->classObjectType;
13997 if(tempType->__anon1._class)
13998 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13999 if(conversions && conversions->last)
14000 {
14001 ((struct Conversion *)conversions->last)->resultType = dest;
14002 dest->refCount++;
14003 }
14004 FreeType(sourceExp->expType);
14005 sourceExp->expType = MkClassType(_class->fullName);
14006 sourceExp->expType->truth = source->truth;
14007 sourceExp->expType->classObjectType = source->classObjectType;
14008 if(!sourceExp->destType)
14009 {
14010 FreeType(sourceExp->destType);
14011 sourceExp->destType = sourceExp->expType;
14012 if(sourceExp->expType)
14013 sourceExp->expType->refCount++;
14014 }
14015 if(!_class->dataType)
14016 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14017 FreeType(dest);
14018 dest = MkClassType(source->__anon1._class->string);
14019 dest->truth = source->truth;
14020 dest->classObjectType = source->classObjectType;
14021 FreeType(source);
14022 source = _class->dataType;
14023 source->refCount++;
14024 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
14025 }
14026 }
14027 }
14028 if(!flag)
14029 {
14030 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
14031 {
14032 FreeType(source);
14033 FreeType(dest);
14034 return 1;
14035 }
14036 }
14037 if(dest->kind == 8)
14038 {
14039 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
14040 unsigned int fittingValue = 0;
14041
14042 if(_class && _class->type == 4)
14043 {
14044 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14045 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14046
14047 if(c && value >= 0 && value <= c->largest)
14048 fittingValue = 1;
14049 }
14050 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
14051 {
14052 if(_class->type == 0 || _class->type == 5)
14053 {
14054 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14055
14056 *newExp = *sourceExp;
14057 if(sourceExp->destType)
14058 sourceExp->destType->refCount++;
14059 if(sourceExp->expType)
14060 sourceExp->expType->refCount++;
14061 sourceExp->type = 11;
14062 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
14063 sourceExp->__anon1.cast.exp = newExp;
14064 FreeType(sourceExp->expType);
14065 sourceExp->expType = (((void *)0));
14066 ProcessExpressionType(sourceExp);
14067 if(!inCompiler)
14068 {
14069 FreeType(sourceExp->expType);
14070 sourceExp->expType = dest;
14071 }
14072 FreeType(source);
14073 if(inCompiler)
14074 FreeType(dest);
14075 if(backupSourceExpType)
14076 FreeType(backupSourceExpType);
14077 return 1;
14078 }
14079 if(!_class->dataType)
14080 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14081 FreeType(dest);
14082 dest = _class->dataType;
14083 dest->refCount++;
14084 }
14085 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))
14086 {
14087 specs = MkListOne(MkSpecifier(DOUBLE));
14088 }
14089 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))
14090 {
14091 specs = MkListOne(MkSpecifier(FLOAT));
14092 }
14093 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))
14094 {
14095 specs = MkList();
14096 if(!dest->isSigned)
14097 ListAdd(specs, MkSpecifier(UNSIGNED));
14098 ListAdd(specs, MkSpecifier(INT64));
14099 }
14100 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
14101 {
14102 specs = MkList();
14103 if(!dest->isSigned)
14104 ListAdd(specs, MkSpecifier(UNSIGNED));
14105 ListAdd(specs, MkSpecifier(INT));
14106 }
14107 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14108 {
14109 specs = MkList();
14110 if(!dest->isSigned)
14111 ListAdd(specs, MkSpecifier(UNSIGNED));
14112 ListAdd(specs, MkSpecifier(SHORT));
14113 }
14114 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14115 {
14116 specs = MkList();
14117 if(!dest->isSigned)
14118 ListAdd(specs, MkSpecifier(UNSIGNED));
14119 ListAdd(specs, MkSpecifier(CHAR));
14120 }
14121 else
14122 {
14123 FreeType(source);
14124 FreeType(dest);
14125 if(backupSourceExpType)
14126 {
14127 if(sourceExp->expType)
14128 FreeType(sourceExp->expType);
14129 sourceExp->expType = backupSourceExpType;
14130 }
14131 return 0;
14132 }
14133 }
14134 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))
14135 {
14136 specs = MkListOne(MkSpecifier(DOUBLE));
14137 }
14138 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))
14139 {
14140 specs = MkListOne(MkSpecifier(FLOAT));
14141 }
14142 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
14143 {
14144 specs = MkList();
14145 ListAdd(specs, MkSpecifier(BOOL));
14146 }
14147 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)))
14148 {
14149 if(source->kind == 3)
14150 {
14151 FreeType(dest);
14152 FreeType(source);
14153 if(backupSourceExpType)
14154 FreeType(backupSourceExpType);
14155 return 1;
14156 }
14157 else
14158 {
14159 specs = MkList();
14160 if(!dest->isSigned)
14161 ListAdd(specs, MkSpecifier(UNSIGNED));
14162 ListAdd(specs, MkSpecifier(CHAR));
14163 }
14164 }
14165 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)))))
14166 {
14167 if(source->kind == 3)
14168 {
14169 FreeType(dest);
14170 FreeType(source);
14171 if(backupSourceExpType)
14172 FreeType(backupSourceExpType);
14173 return 1;
14174 }
14175 else
14176 {
14177 specs = MkList();
14178 if(!dest->isSigned)
14179 ListAdd(specs, MkSpecifier(UNSIGNED));
14180 ListAdd(specs, MkSpecifier(SHORT));
14181 }
14182 }
14183 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
14184 {
14185 specs = MkList();
14186 if(!dest->isSigned)
14187 ListAdd(specs, MkSpecifier(UNSIGNED));
14188 ListAdd(specs, MkSpecifier(INT));
14189 }
14190 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
14191 {
14192 specs = MkList();
14193 if(!dest->isSigned)
14194 ListAdd(specs, MkSpecifier(UNSIGNED));
14195 ListAdd(specs, MkSpecifier(INT64));
14196 }
14197 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
14198 {
14199 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
14200 }
14201 else
14202 {
14203 FreeType(source);
14204 FreeType(dest);
14205 if(backupSourceExpType)
14206 {
14207 if(sourceExp->expType)
14208 FreeType(sourceExp->expType);
14209 sourceExp->expType = backupSourceExpType;
14210 }
14211 return 0;
14212 }
14213 if(!flag && !sourceExp->opDestType)
14214 {
14215 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14216
14217 *newExp = *sourceExp;
14218 newExp->prev = (((void *)0));
14219 newExp->next = (((void *)0));
14220 if(sourceExp->destType)
14221 sourceExp->destType->refCount++;
14222 if(sourceExp->expType)
14223 sourceExp->expType->refCount++;
14224 sourceExp->type = 11;
14225 if(realDest->kind == 8)
14226 {
14227 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
14228 FreeList(specs, (void *)(FreeSpecifier));
14229 }
14230 else
14231 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
14232 if(newExp->type == 4)
14233 {
14234 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
14235 }
14236 else
14237 sourceExp->__anon1.cast.exp = newExp;
14238 FreeType(sourceExp->expType);
14239 sourceExp->expType = (((void *)0));
14240 ProcessExpressionType(sourceExp);
14241 }
14242 else
14243 FreeList(specs, (void *)(FreeSpecifier));
14244 FreeType(dest);
14245 FreeType(source);
14246 if(backupSourceExpType)
14247 FreeType(backupSourceExpType);
14248 return 1;
14249 }
14250 else
14251 {
14252 if(computedExp != nbExp)
14253 {
14254 FreeExpression(computedExp);
14255 computedExp = nbExp;
14256 }
14257 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
14258 sourceExp = (*sourceExp->__anon1.list).last;
14259 if(sourceExp->type == 0)
14260 {
14261 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
14262
14263 if(dest->kind == 8)
14264 {
14265 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
14266 {
14267 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
14268 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14269
14270 if(enumClass)
14271 {
14272 for(; _class && _class->type == 4; _class = _class->base)
14273 {
14274 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
14275 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14276
14277 for(value = e->values.first; value; value = value->next)
14278 {
14279 if(!strcmp(value->name, id->string))
14280 break;
14281 }
14282 if(value)
14283 {
14284 FreeType(sourceExp->expType);
14285 sourceExp->isConstant = 1;
14286 sourceExp->expType = MkClassType(_class->fullName);
14287 if(inCompiler || inPreCompiler || inDebugger)
14288 {
14289 FreeExpContents(sourceExp);
14290 sourceExp->type = 2;
14291 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
14292 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
14293 else
14294 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
14295 }
14296 FreeType(dest);
14297 return 1;
14298 }
14299 }
14300 }
14301 }
14302 }
14303 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
14304 {
14305 FreeType(dest);
14306 return 1;
14307 }
14308 }
14309 FreeType(dest);
14310 }
14311 return 0;
14312 }
14313
14314 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
14315 {
14316 unsigned int result = 1;
14317
14318 if(destType)
14319 {
14320 struct __ecereNameSpace__ecere__sys__OldList converts =
14321 {
14322 0, 0, 0, 0, 0
14323 };
14324 struct Conversion * convert;
14325
14326 if(destType->kind == 0)
14327 return 0;
14328 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
14329 result = 0;
14330 if(converts.count)
14331 {
14332 for(convert = converts.first; convert; convert = convert->next)
14333 {
14334 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
14335
14336 if(!empty)
14337 {
14338 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14339 int objectType = exp->expType ? exp->expType->classObjectType : 0;
14340
14341 *newExp = *exp;
14342 newExp->prev = (((void *)0));
14343 newExp->next = (((void *)0));
14344 newExp->destType = (((void *)0));
14345 if(convert->isGet)
14346 {
14347 exp->type = 8;
14348 exp->addedThis = 1;
14349 exp->__anon1.member.exp = newExp;
14350 FreeType(exp->__anon1.member.exp->expType);
14351 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
14352 exp->__anon1.member.exp->expType->classObjectType = objectType;
14353 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
14354 exp->__anon1.member.memberType = 1;
14355 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14356 exp->needCast = 1;
14357 if(exp->expType)
14358 exp->expType->refCount++;
14359 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14360 }
14361 else
14362 {
14363 {
14364 exp->type = 8;
14365 exp->addedThis = 1;
14366 exp->__anon1.member.exp = newExp;
14367 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)
14368 {
14369 newExp->byReference = 1;
14370 }
14371 FreeType(exp->__anon1.member.exp->expType);
14372 exp->__anon1.member.exp->expType = (((void *)0));
14373 if(convert->convert->dataType)
14374 {
14375 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14376 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
14377 exp->__anon1.member.exp->expType->refCount = 1;
14378 exp->__anon1.member.exp->expType->classObjectType = objectType;
14379 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14380 }
14381 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
14382 exp->__anon1.member.memberType = 4;
14383 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14384 exp->needCast = 1;
14385 if(convert->resultType)
14386 convert->resultType->refCount++;
14387 }
14388 }
14389 }
14390 else
14391 {
14392 FreeType(exp->expType);
14393 if(convert->isGet)
14394 {
14395 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14396 if(exp->destType->casted)
14397 exp->needCast = 1;
14398 if(exp->expType)
14399 exp->expType->refCount++;
14400 }
14401 else
14402 {
14403 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14404 if(exp->destType->casted)
14405 exp->needCast = 1;
14406 if(convert->resultType)
14407 convert->resultType->refCount++;
14408 }
14409 }
14410 }
14411 if(exp->isConstant && inCompiler)
14412 ComputeExpression(exp);
14413 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
14414 }
14415 if(!result && exp->expType && converts.count)
14416 {
14417 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14418 }
14419 if(!result && exp->expType && exp->destType)
14420 {
14421 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))
14422 result = 1;
14423 }
14424 }
14425 return result;
14426 }
14427
14428 static void ProcessFunction(struct FunctionDefinition *  function);
14429
14430 void ProcessInstantiationType(struct Instantiation * inst)
14431 {
14432 yylloc = inst->loc;
14433 if(inst->_class)
14434 {
14435 struct MembersInit * members;
14436 struct Symbol * classSym;
14437 struct __ecereNameSpace__ecere__com__Class * _class;
14438
14439 classSym = inst->_class->__anon1.__anon1.symbol;
14440 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14441 if(!_class || _class->type != 5)
14442 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14443 afterExternal = afterExternal ? afterExternal : curExternal;
14444 if(inst->exp)
14445 ProcessExpressionType(inst->exp);
14446 inst->isConstant = 1;
14447 if(inst->members)
14448 {
14449 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14450 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14451 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14452 int subMemberStackPos = 0;
14453
14454 for(members = (*inst->members).first; members; members = members->next)
14455 {
14456 switch(members->type)
14457 {
14458 case 1:
14459 {
14460 char name[1024];
14461 static unsigned int instMethodID = 0;
14462 struct External * external = curExternal;
14463 struct Context * context = curContext;
14464 struct Declarator * declarator = members->__anon1.function->declarator;
14465 struct Identifier * nameID = GetDeclId(declarator);
14466 char * unmangled = nameID ? nameID->string : (((void *)0));
14467 struct Expression * exp;
14468 struct External * createdExternal = (((void *)0));
14469
14470 if(inCompiler)
14471 {
14472 char number[16];
14473
14474 strcpy(name, "__ecereInstMeth_");
14475 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14476 strcat(name, "_");
14477 strcat(name, nameID->string);
14478 strcat(name, "_");
14479 sprintf(number, "_%08d", instMethodID++);
14480 strcat(name, number);
14481 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14482 }
14483 if(declarator)
14484 {
14485 struct Symbol * symbol = declarator->symbol;
14486 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14487
14488 if(method && method->type == 1)
14489 {
14490 symbol->__anon1.method = method;
14491 ProcessMethodType(method);
14492 if(!symbol->type->__anon1.__anon2.thisClass)
14493 {
14494 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14495 {
14496 if(!currentClass->symbol)
14497 currentClass->symbol = FindClass(currentClass->fullName);
14498 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14499 }
14500 else
14501 {
14502 if(!_class->symbol)
14503 _class->symbol = FindClass(_class->fullName);
14504 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14505 }
14506 }
14507 DeclareType(curExternal, symbol->type, 1, 1);
14508 }
14509 else if(classSym)
14510 {
14511 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14512 }
14513 }
14514 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14515 if(nameID)
14516 {
14517 FreeSpecifier(nameID->_class);
14518 nameID->_class = (((void *)0));
14519 }
14520 curExternal = createdExternal;
14521 if(inCompiler)
14522 {
14523 if(createdExternal->__anon1.function)
14524 ProcessFunction(createdExternal->__anon1.function);
14525 }
14526 else if(declarator)
14527 {
14528 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14529 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14530 }
14531 curExternal = external;
14532 curContext = context;
14533 if(inCompiler)
14534 {
14535 FreeClassFunction(members->__anon1.function);
14536 exp = QMkExpId(name);
14537 members->type = 0;
14538 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14539 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14540 }
14541 break;
14542 }
14543 case 0:
14544 {
14545 if(members->__anon1.dataMembers && classSym)
14546 {
14547 struct MemberInit * member;
14548 struct Location oldyyloc = yylloc;
14549
14550 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14551 {
14552 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14553 if(member->initializer && !member->initializer->isConstant)
14554 inst->isConstant = 0;
14555 }
14556 yylloc = oldyyloc;
14557 }
14558 break;
14559 }
14560 }
14561 }
14562 }
14563 }
14564 }
14565
14566 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14567
14568 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14569 {
14570 switch(spec->type)
14571 {
14572 case 0:
14573 {
14574 if(spec->__anon1.specifier == THISCLASS)
14575 {
14576 if(thisClass)
14577 {
14578 spec->type = 1;
14579 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14580 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14581 ProcessSpecifier(spec, declareStruct, 0);
14582 }
14583 }
14584 break;
14585 }
14586 case 1:
14587 {
14588 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14589
14590 if(symbol)
14591 DeclareType(curExternal, symbol->type, 1, 1);
14592 else if(spec->__anon1.__anon1.symbol)
14593 {
14594 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14595
14596 if(warnClasses && !c)
14597 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14598 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14599 }
14600 break;
14601 }
14602 case 2:
14603 {
14604 struct Enumerator * e;
14605
14606 if(spec->__anon1.__anon2.list)
14607 {
14608 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14609 {
14610 if(e->exp)
14611 ProcessExpressionType(e->exp);
14612 }
14613 }
14614 if(inCompiler)
14615 break;
14616 }
14617 case 3:
14618 case 4:
14619 {
14620 if(spec->__anon1.__anon2.definitions)
14621 {
14622 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14623
14624 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14625 }
14626 break;
14627 }
14628 }
14629 }
14630
14631 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14632 {
14633 switch(decl->type)
14634 {
14635 case 1:
14636 if(decl->__anon1.identifier->classSym)
14637 {
14638 FreeSpecifier(decl->__anon1.identifier->_class);
14639 decl->__anon1.identifier->_class = (((void *)0));
14640 }
14641 break;
14642 case 3:
14643 if(decl->__anon1.array.exp)
14644 ProcessExpressionType(decl->__anon1.array.exp);
14645 case 0:
14646 case 2:
14647 case 4:
14648 case 5:
14649 case 6:
14650 case 7:
14651 {
14652 struct Identifier * id = (((void *)0));
14653 struct Specifier * classSpec = (((void *)0));
14654
14655 if(decl->type == 4)
14656 {
14657 id = GetDeclId(decl);
14658 if(id && id->_class)
14659 {
14660 classSpec = id->_class;
14661 id->_class = (((void *)0));
14662 }
14663 }
14664 if(decl->declarator)
14665 ProcessDeclarator(decl->declarator, isFunction);
14666 if(decl->type == 4)
14667 {
14668 if(classSpec)
14669 {
14670 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14671
14672 if(!decl->__anon1.function.parameters)
14673 decl->__anon1.function.parameters = MkList();
14674 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14675 }
14676 if(decl->__anon1.function.parameters)
14677 {
14678 struct TypeName * param;
14679
14680 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14681 {
14682 if(param->qualifiers)
14683 {
14684 struct Specifier * spec;
14685
14686 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14687 {
14688 if(spec->type == 0)
14689 {
14690 if(spec->__anon1.specifier == TYPED_OBJECT)
14691 {
14692 struct Declarator * d = param->declarator;
14693 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);
14694
14695 if(d->type != 5)
14696 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14697 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14698 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14699 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14700 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14701 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14702 param = newParam;
14703 break;
14704 }
14705 else if(spec->__anon1.specifier == ANY_OBJECT)
14706 {
14707 struct Declarator * d = param->declarator;
14708
14709 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14710 param->qualifiers = MkListOne(MkSpecifier(VOID));
14711 if(d->type != 5)
14712 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14713 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14714 break;
14715 }
14716 else if(spec->__anon1.specifier == THISCLASS)
14717 {
14718 if(thisClass)
14719 {
14720 spec->type = 1;
14721 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14722 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14723 ProcessSpecifier(spec, 0, 0);
14724 }
14725 break;
14726 }
14727 }
14728 else if(spec->type == 1)
14729 {
14730 ProcessSpecifier(spec, isFunction, 1);
14731 }
14732 }
14733 }
14734 if(param->declarator)
14735 ProcessDeclarator(param->declarator, 0);
14736 }
14737 }
14738 }
14739 break;
14740 }
14741 }
14742 }
14743
14744 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14745 {
14746 yylloc = decl->loc;
14747 switch(decl->type)
14748 {
14749 case 1:
14750 {
14751 unsigned int declareStruct = 0;
14752
14753 if(decl->__anon1.__anon1.declarators)
14754 {
14755 struct InitDeclarator * d;
14756
14757 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14758 {
14759 struct Type * type, * subType;
14760
14761 ProcessDeclarator(d->declarator, 0);
14762 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14763 if(d->initializer)
14764 {
14765 ProcessInitializer(d->initializer, type);
14766 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14767 {
14768 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14769 {
14770 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14771
14772 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14773 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14774 if(decl->__anon1.__anon1.specifiers)
14775 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14776 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14777 d = (((void *)0));
14778 decl->type = 2;
14779 decl->__anon1.inst = inst;
14780 }
14781 }
14782 }
14783 for(subType = type; subType; )
14784 {
14785 if(subType->kind == 8)
14786 {
14787 declareStruct = 1;
14788 break;
14789 }
14790 else if(subType->kind == 13)
14791 break;
14792 else if(subType->kind == 12)
14793 subType = subType->__anon1.__anon4.arrayType;
14794 else
14795 break;
14796 }
14797 FreeType(type);
14798 if(!d)
14799 break;
14800 }
14801 }
14802 if(decl->__anon1.__anon1.specifiers)
14803 {
14804 struct Specifier * s;
14805
14806 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
14807 {
14808 ProcessSpecifier(s, declareStruct, 1);
14809 }
14810 }
14811 break;
14812 }
14813 case 2:
14814 {
14815 ProcessInstantiationType(decl->__anon1.inst);
14816 break;
14817 }
14818 case 0:
14819 {
14820 struct Specifier * spec;
14821 struct Declarator * d;
14822 unsigned int declareStruct = 0;
14823
14824 if(decl->__anon1.__anon1.declarators)
14825 {
14826 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14827 {
14828 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14829 struct Type * subType;
14830
14831 ProcessDeclarator(d, 0);
14832 for(subType = type; subType; )
14833 {
14834 if(subType->kind == 8)
14835 {
14836 declareStruct = 1;
14837 break;
14838 }
14839 else if(subType->kind == 13)
14840 break;
14841 else if(subType->kind == 12)
14842 subType = subType->__anon1.__anon4.arrayType;
14843 else
14844 break;
14845 }
14846 FreeType(type);
14847 }
14848 }
14849 if(decl->__anon1.__anon1.specifiers)
14850 {
14851 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
14852 ProcessSpecifier(spec, declareStruct, warnClasses);
14853 }
14854 break;
14855 }
14856 }
14857 }
14858
14859 static void ProcessStatement(struct Statement * stmt)
14860 {
14861 yylloc = stmt->loc;
14862 switch(stmt->type)
14863 {
14864 case 0:
14865 ProcessStatement(stmt->__anon1.labeled.stmt);
14866 break;
14867 case 1:
14868 if(stmt->__anon1.caseStmt.exp)
14869 {
14870 FreeType(stmt->__anon1.caseStmt.exp->destType);
14871 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
14872 if(curSwitchType)
14873 curSwitchType->refCount++;
14874 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
14875 ComputeExpression(stmt->__anon1.caseStmt.exp);
14876 }
14877 if(stmt->__anon1.caseStmt.stmt)
14878 ProcessStatement(stmt->__anon1.caseStmt.stmt);
14879 break;
14880 case 2:
14881 {
14882 if(stmt->__anon1.compound.context)
14883 {
14884 struct Declaration * decl;
14885 struct Statement * s;
14886 struct Statement * prevCompound = curCompound;
14887 struct Context * prevContext = curContext;
14888
14889 if(!stmt->__anon1.compound.isSwitch)
14890 curCompound = stmt;
14891 curContext = stmt->__anon1.compound.context;
14892 if(stmt->__anon1.compound.declarations)
14893 {
14894 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
14895 ProcessDeclaration(decl, 1);
14896 }
14897 if(stmt->__anon1.compound.statements)
14898 {
14899 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
14900 ProcessStatement(s);
14901 }
14902 curContext = prevContext;
14903 curCompound = prevCompound;
14904 }
14905 break;
14906 }
14907 case 3:
14908 {
14909 struct Expression * exp;
14910
14911 if(stmt->__anon1.expressions)
14912 {
14913 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14914 ProcessExpressionType(exp);
14915 }
14916 break;
14917 }
14918 case 4:
14919 {
14920 struct Expression * exp;
14921
14922 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
14923 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
14924 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
14925 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
14926 {
14927 ProcessExpressionType(exp);
14928 }
14929 if(stmt->__anon1.ifStmt.stmt)
14930 ProcessStatement(stmt->__anon1.ifStmt.stmt);
14931 if(stmt->__anon1.ifStmt.elseStmt)
14932 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
14933 break;
14934 }
14935 case 5:
14936 {
14937 struct Type * oldSwitchType = curSwitchType;
14938
14939 if(stmt->__anon1.switchStmt.exp)
14940 {
14941 struct Expression * exp;
14942
14943 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
14944 {
14945 if(!exp->next)
14946 {
14947 ProcessExpressionType(exp);
14948 }
14949 if(!exp->next)
14950 curSwitchType = exp->expType;
14951 }
14952 }
14953 ProcessStatement(stmt->__anon1.switchStmt.stmt);
14954 curSwitchType = oldSwitchType;
14955 break;
14956 }
14957 case 6:
14958 {
14959 if(stmt->__anon1.whileStmt.exp)
14960 {
14961 struct Expression * exp;
14962
14963 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
14964 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
14965 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
14966 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
14967 {
14968 ProcessExpressionType(exp);
14969 }
14970 }
14971 if(stmt->__anon1.whileStmt.stmt)
14972 ProcessStatement(stmt->__anon1.whileStmt.stmt);
14973 break;
14974 }
14975 case 7:
14976 {
14977 if(stmt->__anon1.doWhile.exp)
14978 {
14979 struct Expression * exp;
14980
14981 if((*stmt->__anon1.doWhile.exp).last)
14982 {
14983 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
14984 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
14985 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
14986 }
14987 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
14988 {
14989 ProcessExpressionType(exp);
14990 }
14991 }
14992 if(stmt->__anon1.doWhile.stmt)
14993 ProcessStatement(stmt->__anon1.doWhile.stmt);
14994 break;
14995 }
14996 case 8:
14997 {
14998 struct Expression * exp;
14999
15000 if(stmt->__anon1.forStmt.init)
15001 ProcessStatement(stmt->__anon1.forStmt.init);
15002 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
15003 {
15004 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
15005 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
15006 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
15007 }
15008 if(stmt->__anon1.forStmt.check)
15009 ProcessStatement(stmt->__anon1.forStmt.check);
15010 if(stmt->__anon1.forStmt.increment)
15011 {
15012 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
15013 ProcessExpressionType(exp);
15014 }
15015 if(stmt->__anon1.forStmt.stmt)
15016 ProcessStatement(stmt->__anon1.forStmt.stmt);
15017 break;
15018 }
15019 case 18:
15020 {
15021 struct Identifier * id = stmt->__anon1.forEachStmt.id;
15022 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
15023 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
15024 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
15025 char iteratorType[1024];
15026 struct Type * source;
15027 struct Expression * e;
15028 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));
15029 struct Expression * arrayExp;
15030 const char * typeString = (((void *)0));
15031 int builtinCount = 0;
15032
15033 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15034 {
15035 if(!e->next)
15036 {
15037 FreeType(e->destType);
15038 e->destType = ProcessTypeString("Container", 0);
15039 }
15040 if(!isBuiltin || e->next)
15041 ProcessExpressionType(e);
15042 }
15043 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15044 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)))
15045 {
15046 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
15047 struct Symbol * symbol;
15048 struct Expression * expIt = (((void *)0));
15049 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
15050 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15051 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15052 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15053
15054 if(inCompiler)
15055 {
15056 stmt->type = 2;
15057 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15058 stmt->__anon1.compound.context->parent = curContext;
15059 curContext = stmt->__anon1.compound.context;
15060 }
15061 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
15062 {
15063 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15064
15065 isCustomAVLTree = 1;
15066 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
15067 isMap = 1;
15068 }
15069 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15070 isArray = 1;
15071 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15072 {
15073 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15074
15075 isLinkList = 1;
15076 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15077 }
15078 if(inCompiler && isArray)
15079 {
15080 struct Declarator * decl;
15081 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15082
15083 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15084 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15085 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15086 }
15087 else if(isBuiltin)
15088 {
15089 struct Type * type = (((void *)0));
15090 char typeStringBuf[1024];
15091
15092 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15093 if(((struct Expression *)(*exp).last)->type == 11)
15094 {
15095 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15096
15097 if(typeName)
15098 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15099 }
15100 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)
15101 {
15102 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15103
15104 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15105 }
15106 else if(arrayExp->__anon1.list)
15107 {
15108 struct Expression * e;
15109
15110 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15111 {
15112 ProcessExpressionType(e);
15113 if(e->expType)
15114 {
15115 if(!type)
15116 {
15117 type = e->expType;
15118 type->refCount++;
15119 }
15120 else
15121 {
15122 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15123 {
15124 FreeType(type);
15125 type = e->expType;
15126 e->expType = (((void *)0));
15127 e = (*arrayExp->__anon1.list).first;
15128 ProcessExpressionType(e);
15129 if(e->expType)
15130 {
15131 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15132 {
15133 FreeType(e->expType);
15134 e->expType = (((void *)0));
15135 FreeType(type);
15136 type = (((void *)0));
15137 break;
15138 }
15139 }
15140 }
15141 }
15142 if(e->expType)
15143 {
15144 FreeType(e->expType);
15145 e->expType = (((void *)0));
15146 }
15147 }
15148 }
15149 if(type)
15150 {
15151 typeStringBuf[0] = '\0';
15152 PrintType(type, typeStringBuf, 0, 1);
15153 typeString = typeStringBuf;
15154 FreeType(type);
15155 }
15156 }
15157 if(typeString)
15158 {
15159 if(inCompiler)
15160 {
15161 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15162 struct Declarator * decl;
15163 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15164
15165 if(arrayExp->__anon1.list)
15166 {
15167 struct Expression * e;
15168
15169 builtinCount = (*arrayExp->__anon1.list).count;
15170 type = ProcessTypeString(typeString, 0);
15171 while((e = (*arrayExp->__anon1.list).first))
15172 {
15173 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15174 e->destType = type;
15175 type->refCount++;
15176 ProcessExpressionType(e);
15177 if(inCompiler)
15178 ListAdd(initializers, MkInitializerAssignment(e));
15179 }
15180 FreeType(type);
15181 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15182 }
15183 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15184 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15185 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15186 FreeList(exp, (void *)(FreeExpression));
15187 }
15188 else if(arrayExp->__anon1.list)
15189 {
15190 struct Expression * e;
15191
15192 type = ProcessTypeString(typeString, 0);
15193 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15194 {
15195 e->destType = type;
15196 type->refCount++;
15197 ProcessExpressionType(e);
15198 }
15199 FreeType(type);
15200 }
15201 }
15202 else
15203 {
15204 arrayExp->expType = ProcessTypeString("Container", 0);
15205 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15206 }
15207 }
15208 else if(inCompiler && isLinkList && !isList)
15209 {
15210 struct Declarator * decl;
15211 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15212
15213 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15214 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15215 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15216 }
15217 else if(inCompiler && _class->templateArgs)
15218 {
15219 if(isMap)
15220 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15221 else
15222 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15223 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)))))))));
15224 }
15225 if(inCompiler)
15226 {
15227 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15228 if(block)
15229 {
15230 switch(block->type)
15231 {
15232 case 2:
15233 if(block->__anon1.compound.context)
15234 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15235 break;
15236 case 4:
15237 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15238 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15239 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15240 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15241 break;
15242 case 5:
15243 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15244 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15245 break;
15246 case 6:
15247 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15248 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15249 break;
15250 case 7:
15251 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15252 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15253 break;
15254 case 8:
15255 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15256 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15257 break;
15258 case 18:
15259 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15260 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15261 break;
15262 }
15263 }
15264 if(filter)
15265 {
15266 block = MkIfStmt(filter, block, (((void *)0)));
15267 }
15268 if(isArray)
15269 {
15270 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));
15271 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15272 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15273 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15274 }
15275 else if(isBuiltin)
15276 {
15277 char count[128];
15278
15279 sprintf(count, "%d", builtinCount);
15280 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));
15281 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15282 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15283 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15284 }
15285 else if(isLinkList && !isList)
15286 {
15287 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15288 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15289
15290 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15291 {
15292 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));
15293 }
15294 else
15295 {
15296 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15297 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15298
15299 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));
15300 }
15301 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15302 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15303 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15304 }
15305 else
15306 {
15307 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15308 }
15309 ProcessExpressionType(expIt);
15310 if((*stmt->__anon1.compound.declarations).first)
15311 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15312 if(symbol)
15313 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15314 ProcessStatement(stmt);
15315 }
15316 else
15317 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15318 if(inCompiler)
15319 curContext = stmt->__anon1.compound.context->parent;
15320 break;
15321 }
15322 else
15323 {
15324 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15325 }
15326 break;
15327 }
15328 case 9:
15329 break;
15330 case 10:
15331 break;
15332 case 11:
15333 break;
15334 case 12:
15335 {
15336 struct Expression * exp;
15337
15338 if(stmt->__anon1.expressions)
15339 {
15340 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15341 {
15342 if(!exp->next)
15343 {
15344 if(curFunction && !curFunction->type)
15345 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15346 FreeType(exp->destType);
15347 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15348 if(exp->destType)
15349 exp->destType->refCount++;
15350 }
15351 ProcessExpressionType(exp);
15352 }
15353 }
15354 break;
15355 }
15356 case 14:
15357 {
15358 ProcessDeclaration(stmt->__anon1.decl, 1);
15359 break;
15360 }
15361 case 13:
15362 {
15363 struct AsmField * field;
15364
15365 if(stmt->__anon1.asmStmt.inputFields)
15366 {
15367 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15368 if(field->expression)
15369 ProcessExpressionType(field->expression);
15370 }
15371 if(stmt->__anon1.asmStmt.outputFields)
15372 {
15373 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15374 if(field->expression)
15375 ProcessExpressionType(field->expression);
15376 }
15377 if(stmt->__anon1.asmStmt.clobberedFields)
15378 {
15379 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15380 {
15381 if(field->expression)
15382 ProcessExpressionType(field->expression);
15383 }
15384 }
15385 break;
15386 }
15387 case 17:
15388 {
15389 struct PropertyWatch * propWatch;
15390 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15391 struct Expression * object = stmt->__anon1._watch.object;
15392 struct Expression * watcher = stmt->__anon1._watch.watcher;
15393
15394 if(watcher)
15395 ProcessExpressionType(watcher);
15396 if(object)
15397 ProcessExpressionType(object);
15398 if(inCompiler)
15399 {
15400 if(watcher || thisClass)
15401 {
15402 struct External * external = curExternal;
15403 struct Context * context = curContext;
15404
15405 stmt->type = 3;
15406 stmt->__anon1.expressions = MkList();
15407 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15408 {
15409 struct ClassFunction * func;
15410 char watcherName[1024];
15411 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;
15412 struct External * createdExternal;
15413
15414 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15415 if(propWatch->deleteWatch)
15416 strcat(watcherName, "_delete");
15417 else
15418 {
15419 struct Identifier * propID;
15420
15421 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15422 {
15423 strcat(watcherName, "_");
15424 strcat(watcherName, propID->string);
15425 }
15426 }
15427 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15428 {
15429 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)));
15430 ProcessClassFunctionBody(func, propWatch->compound);
15431 propWatch->compound = (((void *)0));
15432 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15433 FreeClassFunction(func);
15434 curExternal = createdExternal;
15435 ProcessFunction(createdExternal->__anon1.function);
15436 if(propWatch->deleteWatch)
15437 {
15438 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15439
15440 ListAdd(args, CopyExpression(object));
15441 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15442 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15443 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15444 }
15445 else
15446 {
15447 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15448 struct Identifier * propID;
15449
15450 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15451 {
15452 char propName[1024];
15453 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15454
15455 if(prop)
15456 {
15457 char getName[1024], setName[1024];
15458 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15459
15460 DeclareProperty(createdExternal, prop, setName, getName);
15461 strcpy(propName, "__ecereProp_");
15462 FullClassNameCat(propName, prop->_class->fullName, 0);
15463 strcat(propName, "_");
15464 FullClassNameCat(propName, prop->name, 1);
15465 ListAdd(args, CopyExpression(object));
15466 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15467 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15468 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15469 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15470 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15471 }
15472 else
15473 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15474 }
15475 }
15476 }
15477 else
15478 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15479 }
15480 curExternal = external;
15481 curContext = context;
15482 if(watcher)
15483 FreeExpression(watcher);
15484 if(object)
15485 FreeExpression(object);
15486 FreeList(watches, (void *)(FreePropertyWatch));
15487 }
15488 else
15489 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15490 }
15491 else
15492 {
15493 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15494 {
15495 ProcessStatement(propWatch->compound);
15496 }
15497 }
15498 break;
15499 }
15500 case 15:
15501 {
15502 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15503 struct Expression * object = stmt->__anon1._watch.object;
15504 struct __ecereNameSpace__ecere__com__Class * _class;
15505
15506 if(object)
15507 ProcessExpressionType(object);
15508 if(inCompiler)
15509 {
15510 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15511 if(_class)
15512 {
15513 struct Identifier * propID;
15514
15515 stmt->type = 3;
15516 stmt->__anon1.expressions = MkList();
15517 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15518 {
15519 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15520 }
15521 else if(!watches)
15522 {
15523 }
15524 if(watches)
15525 {
15526 for(propID = (*watches).first; propID; propID = propID->next)
15527 {
15528 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15529
15530 if(prop)
15531 {
15532 CreateFireWatcher(prop, object, stmt);
15533 }
15534 else
15535 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15536 }
15537 }
15538 else
15539 {
15540 struct __ecereNameSpace__ecere__com__Property * prop;
15541 struct __ecereNameSpace__ecere__com__Class * base;
15542
15543 for(base = _class; base; base = base->base)
15544 {
15545 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15546 {
15547 if(prop->isProperty && prop->isWatchable)
15548 {
15549 CreateFireWatcher(prop, object, stmt);
15550 }
15551 }
15552 }
15553 }
15554 if(object)
15555 FreeExpression(object);
15556 FreeList(watches, (void *)(FreeIdentifier));
15557 }
15558 else
15559 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15560 }
15561 break;
15562 }
15563 case 16:
15564 {
15565 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15566 struct Expression * object = stmt->__anon1._watch.object;
15567 struct Expression * watcher = stmt->__anon1._watch.watcher;
15568 struct __ecereNameSpace__ecere__com__Class * _class;
15569
15570 if(object)
15571 ProcessExpressionType(object);
15572 if(watcher)
15573 ProcessExpressionType(watcher);
15574 if(inCompiler)
15575 {
15576 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15577 if(watcher || thisClass)
15578 {
15579 if(_class)
15580 {
15581 struct Identifier * propID;
15582
15583 stmt->type = 3;
15584 stmt->__anon1.expressions = MkList();
15585 if(!watches)
15586 {
15587 struct __ecereNameSpace__ecere__sys__OldList * args;
15588
15589 args = MkList();
15590 ListAdd(args, CopyExpression(object));
15591 ListAdd(args, MkExpConstant("0"));
15592 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15593 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15594 }
15595 else
15596 {
15597 for(propID = (*watches).first; propID; propID = propID->next)
15598 {
15599 char propName[1024];
15600 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15601
15602 if(prop)
15603 {
15604 char getName[1024], setName[1024];
15605 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15606
15607 DeclareProperty(curExternal, prop, setName, getName);
15608 strcpy(propName, "__ecereProp_");
15609 FullClassNameCat(propName, prop->_class->fullName, 0);
15610 strcat(propName, "_");
15611 FullClassNameCat(propName, prop->name, 1);
15612 ListAdd(args, CopyExpression(object));
15613 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15614 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15615 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15616 }
15617 else
15618 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15619 }
15620 }
15621 if(object)
15622 FreeExpression(object);
15623 if(watcher)
15624 FreeExpression(watcher);
15625 FreeList(watches, (void *)(FreeIdentifier));
15626 }
15627 else
15628 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15629 }
15630 else
15631 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15632 }
15633 break;
15634 }
15635 }
15636 }
15637
15638 void ComputeDataTypes()
15639 {
15640 struct External * external;
15641
15642 currentClass = (((void *)0));
15643 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15644 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15645 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15646 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15647 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15648 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15649 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15650 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15651 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15652 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15653 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15654 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15655 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15656 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15657 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15658 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15659 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15660 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15661 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15662 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15663 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15664 reachedPass15 = 1;
15665 for(external = (*ast).first; external; external = external->next)
15666 {
15667 afterExternal = curExternal = external;
15668 if(external->type == 0)
15669 {
15670 if(memoryGuard)
15671 {
15672 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15673 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15674 }
15675 currentClass = external->__anon1.function->_class;
15676 ProcessFunction(external->__anon1.function);
15677 }
15678 else if(external->type == 1)
15679 {
15680 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15681 {
15682 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15683 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15684 }
15685 currentClass = (((void *)0));
15686 if(external->__anon1.declaration)
15687 ProcessDeclaration(external->__anon1.declaration, 1);
15688 }
15689 else if(external->type == 2)
15690 {
15691 struct ClassDefinition * _class = external->__anon1._class;
15692
15693 currentClass = external->symbol->__anon1.registered;
15694 if(memoryGuard)
15695 {
15696 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15697 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15698 }
15699 if(_class->definitions)
15700 {
15701 ProcessClass(_class->definitions, _class->symbol);
15702 }
15703 if(inCompiler)
15704 {
15705 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15706 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
15707 }
15708 }
15709 else if(external->type == 4)
15710 {
15711 thisNameSpace = external->__anon1.id->string;
15712 }
15713 }
15714 currentClass = (((void *)0));
15715 thisNameSpace = (((void *)0));
15716 curExternal = (((void *)0));
15717 }
15718
15719 void ProcessExpressionType(struct Expression * exp)
15720 {
15721 unsigned int unresolved = 0;
15722 struct Location oldyylloc = yylloc;
15723 unsigned int notByReference = 0;
15724
15725 if(!exp || exp->expType)
15726 return ;
15727 yylloc = exp->loc;
15728 switch(exp->type)
15729 {
15730 case 0:
15731 {
15732 struct Identifier * id = exp->__anon1.__anon1.identifier;
15733
15734 if(!id || !topContext)
15735 return ;
15736 if(id->_class && id->_class->__anon1.__anon1.name)
15737 {
15738 id->classSym = id->_class->__anon1.__anon1.symbol;
15739 }
15740 if(!strcmp(id->string, "__runtimePlatform"))
15741 {
15742 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15743 break;
15744 }
15745 else if(strstr(id->string, "__ecereClass") == id->string)
15746 {
15747 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15748 break;
15749 }
15750 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15751 {
15752 ReplaceClassMembers(exp, thisClass);
15753 if(exp->type != 0)
15754 {
15755 ProcessExpressionType(exp);
15756 break;
15757 }
15758 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15759 break;
15760 }
15761 else
15762 {
15763 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15764
15765 if(!symbol)
15766 {
15767 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15768 break;
15769 else
15770 {
15771 if(thisClass)
15772 {
15773 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15774 if(exp->type != 0)
15775 {
15776 ProcessExpressionType(exp);
15777 break;
15778 }
15779 }
15780 else if(currentClass && !id->_class)
15781 {
15782 if(ResolveIdWithClass(exp, currentClass, 1))
15783 break;
15784 }
15785 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15786 }
15787 }
15788 if(symbol)
15789 {
15790 struct Type * type = symbol->type;
15791 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15792
15793 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15794 {
15795 struct Context * context = SetupTemplatesContext(_class);
15796
15797 type = ReplaceThisClassType(_class);
15798 FinishTemplatesContext(context);
15799 if(type)
15800 type->refCount = 0;
15801 }
15802 FreeSpecifier(id->_class);
15803 id->_class = (((void *)0));
15804 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15805 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
15806 id->classSym = (((void *)0));
15807 exp->expType = type;
15808 if(type)
15809 type->refCount++;
15810 if(type && (type->kind == 15))
15811 exp->isConstant = 1;
15812 if(symbol->isParam || !strcmp(id->string, "this"))
15813 {
15814 if(_class && _class->type == 1 && !type->declaredWithStruct)
15815 exp->byReference = 1;
15816 }
15817 if(symbol->isIterator)
15818 {
15819 if(symbol->isIterator == 3)
15820 {
15821 exp->type = 5;
15822 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
15823 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
15824 exp->expType = (((void *)0));
15825 ProcessExpressionType(exp);
15826 }
15827 else if(symbol->isIterator != 4)
15828 {
15829 exp->type = 8;
15830 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
15831 exp->__anon1.member.exp->expType = exp->expType;
15832 exp->__anon1.member.member = MkIdentifier("data");
15833 exp->expType = (((void *)0));
15834 ProcessExpressionType(exp);
15835 }
15836 }
15837 break;
15838 }
15839 else
15840 {
15841 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
15842
15843 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15844 {
15845 char name[1024];
15846
15847 strcpy(name, thisNameSpace);
15848 strcat(name, "::");
15849 strcat(name, id->string);
15850 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
15851 }
15852 if(!definedExp)
15853 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
15854 if(definedExp)
15855 {
15856 int c;
15857
15858 for(c = 0; c < definedExpStackPos; c++)
15859 if(definedExpStack[c] == definedExp)
15860 break;
15861 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
15862 {
15863 struct Location backupYylloc = yylloc;
15864 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
15865
15866 definedExpStack[definedExpStackPos++] = definedExp;
15867 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
15868 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
15869 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15870
15871 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15872 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
15873 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
15874 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15875
15876 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15877 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
15878 echoOn = 0;
15879 parsedExpression = (((void *)0));
15880 resetScanner();
15881 expression_yyparse();
15882 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
15883 if(backInput)
15884 fileInput = backInput;
15885 yylloc = backupYylloc;
15886 if(parsedExpression)
15887 {
15888 FreeIdentifier(id);
15889 exp->type = 5;
15890 exp->__anon1.list = MkListOne(parsedExpression);
15891 ApplyLocation(parsedExpression, &yylloc);
15892 ProcessExpressionType(exp);
15893 definedExpStackPos--;
15894 return ;
15895 }
15896 definedExpStackPos--;
15897 }
15898 else
15899 {
15900 if(inCompiler)
15901 {
15902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
15903 }
15904 }
15905 }
15906 else
15907 {
15908 struct GlobalData * data = (((void *)0));
15909
15910 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15911 {
15912 char name[1024];
15913
15914 strcpy(name, thisNameSpace);
15915 strcat(name, "::");
15916 strcat(name, id->string);
15917 data = FindGlobalData(name);
15918 }
15919 if(!data)
15920 data = FindGlobalData(id->string);
15921 if(data)
15922 {
15923 DeclareGlobalData(curExternal, data);
15924 exp->expType = data->dataType;
15925 if(data->dataType)
15926 data->dataType->refCount++;
15927 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15928 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
15929 FreeSpecifier(id->_class);
15930 id->_class = (((void *)0));
15931 break;
15932 }
15933 else
15934 {
15935 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
15936
15937 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15938 {
15939 char name[1024];
15940
15941 strcpy(name, thisNameSpace);
15942 strcat(name, "::");
15943 strcat(name, id->string);
15944 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
15945 }
15946 if(!function)
15947 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
15948 if(function)
15949 {
15950 char name[1024];
15951
15952 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15953 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
15954 name[0] = 0;
15955 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
15956 strcpy(name, "__ecereFunction_");
15957 FullClassNameCat(name, id->string, 0);
15958 if(DeclareFunction(curExternal, function, name))
15959 {
15960 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15961 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
15962 }
15963 exp->expType = function->dataType;
15964 if(function->dataType)
15965 function->dataType->refCount++;
15966 FreeSpecifier(id->_class);
15967 id->_class = (((void *)0));
15968 break;
15969 }
15970 }
15971 }
15972 }
15973 }
15974 unresolved = 1;
15975 break;
15976 }
15977 case 1:
15978 {
15979 if(!exp->__anon1.instance->_class)
15980 {
15981 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
15982 {
15983 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
15984 }
15985 }
15986 ProcessInstantiationType(exp->__anon1.instance);
15987 exp->isConstant = exp->__anon1.instance->isConstant;
15988 if(exp->__anon1.instance->_class)
15989 {
15990 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
15991 }
15992 break;
15993 }
15994 case 2:
15995 {
15996 if(!exp->expType)
15997 {
15998 char * constant = exp->__anon1.__anon1.constant;
15999 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
16000
16001 exp->expType = type;
16002 if(constant[0] == '\'')
16003 {
16004 if((int)((unsigned char *)constant)[1] > 127)
16005 {
16006 int nb;
16007 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
16008
16009 if(nb < 2)
16010 ch = constant[1];
16011 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
16012 exp->__anon1.__anon1.constant = PrintUInt(ch);
16013 type->kind = 8;
16014 type->__anon1._class = FindClass("unichar");
16015 type->isSigned = 0;
16016 }
16017 else
16018 {
16019 type->kind = 1;
16020 type->isSigned = 1;
16021 }
16022 }
16023 else
16024 {
16025 char * dot = strchr(constant, '.');
16026 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
16027 char * exponent;
16028
16029 if(isHex)
16030 {
16031 exponent = strchr(constant, 'p');
16032 if(!exponent)
16033 exponent = strchr(constant, 'P');
16034 }
16035 else
16036 {
16037 exponent = strchr(constant, 'e');
16038 if(!exponent)
16039 exponent = strchr(constant, 'E');
16040 }
16041 if(dot || exponent)
16042 {
16043 if(strchr(constant, 'f') || strchr(constant, 'F'))
16044 type->kind = 6;
16045 else
16046 type->kind = 7;
16047 type->isSigned = 1;
16048 }
16049 else
16050 {
16051 unsigned int isSigned = constant[0] == '-';
16052 char * endP = (((void *)0));
16053 long long i64 = strtoll(constant, &endP, 0);
16054 uint64 ui64 = strtoull(constant, &endP, 0);
16055 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16056 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16057
16058 if(isSigned)
16059 {
16060 if(i64 < (((int)0x80000000)))
16061 is64Bit = 1;
16062 }
16063 else
16064 {
16065 if(ui64 > (((int)0x7fffffff)))
16066 {
16067 if(ui64 > (0xffffffff))
16068 {
16069 is64Bit = 1;
16070 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16071 isSigned = 1;
16072 }
16073 }
16074 else if(constant[0] != '0' || !constant[1])
16075 isSigned = 1;
16076 }
16077 if(forceUnsigned)
16078 isSigned = 0;
16079 type->kind = is64Bit ? 4 : 3;
16080 type->isSigned = isSigned;
16081 }
16082 }
16083 exp->isConstant = 1;
16084 if(exp->destType && exp->destType->kind == 7)
16085 type->kind = 7;
16086 else if(exp->destType && exp->destType->kind == 6)
16087 type->kind = 6;
16088 else if(exp->destType && exp->destType->kind == 4)
16089 type->kind = 4;
16090 }
16091 break;
16092 }
16093 case 3:
16094 {
16095 exp->isConstant = 1;
16096 exp->expType = __extension__ ({
16097 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16098
16099 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16100 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16101
16102 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16103 }), __ecereInstance2;
16104 });
16105 break;
16106 }
16107 case 13:
16108 case 26:
16109 ProcessExpressionType(exp->__anon1._new.size);
16110 exp->expType = __extension__ ({
16111 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16112
16113 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16114 });
16115 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16116 break;
16117 case 14:
16118 case 27:
16119 ProcessExpressionType(exp->__anon1._renew.size);
16120 ProcessExpressionType(exp->__anon1._renew.exp);
16121 exp->expType = __extension__ ({
16122 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16123
16124 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16125 });
16126 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16127 break;
16128 case 4:
16129 {
16130 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16131 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16132 unsigned int useDestType = 0, useSideType = 0;
16133 struct Location oldyylloc = yylloc;
16134 unsigned int useSideUnit = 0;
16135 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16136 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16137
16138 switch(exp->__anon1.op.op)
16139 {
16140 case '=':
16141 case MUL_ASSIGN:
16142 case DIV_ASSIGN:
16143 case MOD_ASSIGN:
16144 case ADD_ASSIGN:
16145 case SUB_ASSIGN:
16146 case LEFT_ASSIGN:
16147 case RIGHT_ASSIGN:
16148 case AND_ASSIGN:
16149 case XOR_ASSIGN:
16150 case OR_ASSIGN:
16151 assign = 1;
16152 break;
16153 case '!':
16154 break;
16155 case AND_OP:
16156 case OR_OP:
16157 boolOps = 1;
16158 boolResult = 1;
16159 break;
16160 case EQ_OP:
16161 case '<':
16162 case '>':
16163 case LE_OP:
16164 case GE_OP:
16165 case NE_OP:
16166 boolResult = 1;
16167 useSideType = 1;
16168 break;
16169 case '+':
16170 case '-':
16171 useSideUnit = 1;
16172 useSideType = 1;
16173 useDestType = 1;
16174 break;
16175 case LEFT_OP:
16176 case RIGHT_OP:
16177 break;
16178 case '|':
16179 case '^':
16180 useSideType = 1;
16181 useDestType = 1;
16182 break;
16183 case '/':
16184 case '%':
16185 useSideType = 1;
16186 useDestType = 1;
16187 break;
16188 case '&':
16189 case '*':
16190 if(exp->__anon1.op.exp1)
16191 {
16192 useSideType = 1;
16193 useDestType = 1;
16194 }
16195 break;
16196 }
16197 if(exp->__anon1.op.op == '&')
16198 {
16199 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16200 {
16201 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16202 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16203
16204 if(symbol && symbol->isIterator == 2)
16205 {
16206 exp->type = 8;
16207 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16208 exp->__anon1.member.member = MkIdentifier("key");
16209 exp->expType = (((void *)0));
16210 exp->__anon1.op.exp2->expType = symbol->type;
16211 symbol->type->refCount++;
16212 ProcessExpressionType(exp);
16213 FreeType(dummy);
16214 break;
16215 }
16216 }
16217 }
16218 if(exp->__anon1.op.exp1)
16219 {
16220 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16221 useDestType = 0;
16222 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16223 {
16224 if(exp->__anon1.op.exp1->destType)
16225 FreeType(exp->__anon1.op.exp1->destType);
16226 exp->__anon1.op.exp1->destType = exp->destType;
16227 exp->__anon1.op.exp1->opDestType = 1;
16228 if(exp->destType)
16229 exp->destType->refCount++;
16230 }
16231 else if(!assign)
16232 {
16233 if(exp->__anon1.op.exp1->destType)
16234 FreeType(exp->__anon1.op.exp1->destType);
16235 exp->__anon1.op.exp1->destType = dummy;
16236 dummy->refCount++;
16237 }
16238 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16239 exp->__anon1.op.exp1->destType->count++;
16240 ProcessExpressionType(exp->__anon1.op.exp1);
16241 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16242 exp->__anon1.op.exp1->destType->count--;
16243 exp->__anon1.op.exp1->opDestType = 0;
16244 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)
16245 {
16246 exp->__anon1.op.exp2 = MkExpConstant("1");
16247 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16248 assign = 1;
16249 }
16250 if(exp->__anon1.op.exp1->destType == dummy)
16251 {
16252 FreeType(dummy);
16253 exp->__anon1.op.exp1->destType = (((void *)0));
16254 }
16255 if(exp->__anon1.op.exp2)
16256 {
16257 if(!assign && exp->__anon1.op.exp1->expType && (exp->__anon1.op.exp1->expType->kind == 1 || exp->__anon1.op.exp1->expType->kind == 2))
16258 {
16259 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);
16260
16261 FreeType(exp->__anon1.op.exp1->expType);
16262 exp->__anon1.op.exp1->expType = type;
16263 }
16264 }
16265 type1 = exp->__anon1.op.exp1->expType;
16266 }
16267 if(exp->__anon1.op.exp2)
16268 {
16269 char expString[10240];
16270
16271 expString[0] = '\0';
16272 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16273 {
16274 if(exp->__anon1.op.exp1)
16275 {
16276 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16277 if(exp->__anon1.op.exp1->expType)
16278 exp->__anon1.op.exp1->expType->refCount++;
16279 }
16280 else
16281 {
16282 exp->__anon1.op.exp2->destType = exp->destType;
16283 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16284 exp->__anon1.op.exp2->opDestType = 1;
16285 if(exp->destType)
16286 exp->destType->refCount++;
16287 }
16288 if(type1)
16289 type1->refCount++;
16290 exp->expType = type1;
16291 }
16292 else if(assign)
16293 {
16294 if(inCompiler)
16295 PrintExpression(exp->__anon1.op.exp2, expString);
16296 if(type1 && type1->kind == 13)
16297 {
16298 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)
16299 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16300 else if(exp->__anon1.op.op == '=')
16301 {
16302 if(exp->__anon1.op.exp2->destType)
16303 FreeType(exp->__anon1.op.exp2->destType);
16304 exp->__anon1.op.exp2->destType = type1;
16305 if(type1)
16306 type1->refCount++;
16307 }
16308 }
16309 else
16310 {
16311 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)
16312 ;
16313 else
16314 {
16315 if(exp->__anon1.op.exp2->destType)
16316 FreeType(exp->__anon1.op.exp2->destType);
16317 exp->__anon1.op.exp2->destType = type1;
16318 if(type1)
16319 type1->refCount++;
16320 }
16321 }
16322 if(type1)
16323 type1->refCount++;
16324 exp->expType = type1;
16325 }
16326 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16327 {
16328 if(exp->__anon1.op.exp2->destType)
16329 FreeType(exp->__anon1.op.exp2->destType);
16330 exp->__anon1.op.exp2->destType = exp->destType;
16331 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16332 exp->__anon1.op.exp2->opDestType = 1;
16333 if(exp->destType)
16334 exp->destType->refCount++;
16335 }
16336 else
16337 {
16338 if(exp->__anon1.op.exp2->destType)
16339 FreeType(exp->__anon1.op.exp2->destType);
16340 exp->__anon1.op.exp2->destType = dummy;
16341 dummy->refCount++;
16342 }
16343 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))
16344 {
16345 FreeType(exp->__anon1.op.exp2->destType);
16346 exp->__anon1.op.exp2->destType = type1;
16347 type1->refCount++;
16348 }
16349 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16350 exp->__anon1.op.exp2->destType->count++;
16351 if(exp->__anon1.op.op == SIZEOF)
16352 {
16353 struct Expression * e = exp->__anon1.op.exp2;
16354
16355 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16356 {
16357 if(e->type == 5 || e->type == 32 || e->type == 23)
16358 {
16359 if(e->type == 23)
16360 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16361 else
16362 e = (*e->__anon1.list).last;
16363 }
16364 }
16365 if(e->type == 11 && e->__anon1.cast.exp)
16366 e->__anon1.cast.exp->needCast = 1;
16367 }
16368 ProcessExpressionType(exp->__anon1.op.exp2);
16369 exp->__anon1.op.exp2->opDestType = 0;
16370 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16371 exp->__anon1.op.exp2->destType->count--;
16372 if(!assign && (exp->__anon1.op.exp1 || exp->__anon1.op.op == '~'))
16373 {
16374 if(exp->__anon1.op.exp2->expType && (exp->__anon1.op.exp2->expType->kind == 1 || exp->__anon1.op.exp2->expType->kind == 2))
16375 {
16376 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);
16377
16378 FreeType(exp->__anon1.op.exp2->expType);
16379 exp->__anon1.op.exp2->expType = type;
16380 }
16381 }
16382 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16383 {
16384 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)
16385 {
16386 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16387 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16388 }
16389 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)))
16390 {
16391 if(exp->__anon1.op.op == ADD_ASSIGN)
16392 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16393 }
16394 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))
16395 {
16396 if(exp->__anon1.op.op == ADD_ASSIGN)
16397 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16398 }
16399 else if(inCompiler)
16400 {
16401 char type1String[1024];
16402 char type2String[1024];
16403
16404 type1String[0] = '\0';
16405 type2String[0] = '\0';
16406 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16407 PrintType(type1, type2String, 0, 1);
16408 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16409 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16410 }
16411 }
16412 if(exp->__anon1.op.exp2->destType == dummy)
16413 {
16414 FreeType(dummy);
16415 exp->__anon1.op.exp2->destType = (((void *)0));
16416 }
16417 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16418 {
16419 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16420 type2->refCount = 1;
16421 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16422 type2->isSigned = 1;
16423 }
16424 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))
16425 {
16426 type2 = __extension__ ({
16427 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16428
16429 __ecereInstance1->kind = 3, __ecereInstance1;
16430 });
16431 type2->refCount = 1;
16432 type2->isSigned = 1;
16433 }
16434 else
16435 {
16436 type2 = exp->__anon1.op.exp2->expType;
16437 if(type2)
16438 type2->refCount++;
16439 }
16440 }
16441 dummy->kind = 0;
16442 if(exp->__anon1.op.op == SIZEOF)
16443 {
16444 exp->expType = __extension__ ({
16445 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16446
16447 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16448 });
16449 exp->isConstant = 1;
16450 }
16451 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16452 {
16453 exp->expType = Dereference(type2);
16454 if(type2 && type2->kind == 8)
16455 notByReference = 1;
16456 }
16457 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16458 exp->expType = Reference(type2);
16459 else if(exp->__anon1.op.op == LEFT_OP || exp->__anon1.op.op == RIGHT_OP)
16460 {
16461 if(exp->__anon1.op.exp1->expType)
16462 {
16463 exp->expType = exp->__anon1.op.exp1->expType;
16464 exp->expType->refCount++;
16465 }
16466 }
16467 else if(!assign)
16468 {
16469 if(boolOps)
16470 {
16471 if(exp->__anon1.op.exp1)
16472 {
16473 if(exp->__anon1.op.exp1->destType)
16474 FreeType(exp->__anon1.op.exp1->destType);
16475 exp->__anon1.op.exp1->destType = MkClassType("bool");
16476 exp->__anon1.op.exp1->destType->truth = 1;
16477 if(!exp->__anon1.op.exp1->expType)
16478 ProcessExpressionType(exp->__anon1.op.exp1);
16479 else
16480 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16481 FreeType(exp->__anon1.op.exp1->expType);
16482 exp->__anon1.op.exp1->expType = MkClassType("bool");
16483 exp->__anon1.op.exp1->expType->truth = 1;
16484 }
16485 if(exp->__anon1.op.exp2)
16486 {
16487 if(exp->__anon1.op.exp2->destType)
16488 FreeType(exp->__anon1.op.exp2->destType);
16489 exp->__anon1.op.exp2->destType = MkClassType("bool");
16490 exp->__anon1.op.exp2->destType->truth = 1;
16491 if(!exp->__anon1.op.exp2->expType)
16492 ProcessExpressionType(exp->__anon1.op.exp2);
16493 else
16494 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16495 FreeType(exp->__anon1.op.exp2->expType);
16496 exp->__anon1.op.exp2->expType = MkClassType("bool");
16497 exp->__anon1.op.exp2->expType->truth = 1;
16498 }
16499 }
16500 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")))))
16501 {
16502 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"))))
16503 {
16504 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)))
16505 {
16506 struct Type * intType;
16507
16508 if(!type1->__anon1._class->__anon1.registered->dataType)
16509 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16510 if(!type2->__anon1._class->__anon1.registered->dataType)
16511 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16512 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
16513 if(exp->__anon1.op.exp1->destType)
16514 FreeType(exp->__anon1.op.exp1->destType);
16515 if(exp->__anon1.op.exp2->destType)
16516 FreeType(exp->__anon1.op.exp2->destType);
16517 exp->__anon1.op.exp1->destType = intType;
16518 exp->__anon1.op.exp2->destType = intType;
16519 intType->refCount++;
16520 }
16521 else
16522 {
16523 if(exp->__anon1.op.exp2->destType)
16524 FreeType(exp->__anon1.op.exp2->destType);
16525 exp->__anon1.op.exp2->destType = type1;
16526 type1->refCount++;
16527 if(exp->__anon1.op.exp1->destType)
16528 FreeType(exp->__anon1.op.exp1->destType);
16529 exp->__anon1.op.exp1->destType = type2;
16530 type2->refCount++;
16531 }
16532 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)
16533 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);
16534 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16535 {
16536 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16537
16538 if(argExp)
16539 {
16540 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16541
16542 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16543 ProcessExpressionType(exp->__anon1.op.exp1);
16544 if(type2->kind != 13)
16545 {
16546 ProcessExpressionType(classExp);
16547 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16548 if(!exp->__anon1.op.exp2->expType)
16549 {
16550 if(type2)
16551 FreeType(type2);
16552 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16553 type2->refCount++;
16554 }
16555 ProcessExpressionType(exp->__anon1.op.exp2);
16556 }
16557 }
16558 }
16559 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)))
16560 {
16561 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16562 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16563 exp->expType = type1;
16564 if(type1)
16565 type1->refCount++;
16566 }
16567 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)))
16568 {
16569 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16570 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16571 exp->expType = type2;
16572 if(type2)
16573 type2->refCount++;
16574 }
16575 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))
16576 {
16577 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16578 }
16579 else
16580 {
16581 unsigned int success = 0;
16582
16583 if(type1->kind == 13 && type2->kind == 13)
16584 {
16585 if(exp->__anon1.op.op == '+')
16586 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16587 else if(exp->__anon1.op.op == '-')
16588 {
16589 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16590 {
16591 exp->expType = __extension__ ({
16592 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16593
16594 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16595 });
16596 success = 1;
16597 if(type1->__anon1.type->kind == 20)
16598 {
16599 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16600
16601 if(argExp)
16602 {
16603 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16604
16605 ProcessExpressionType(classExp);
16606 exp->type = 5;
16607 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"))));
16608 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16609 FreeType(dummy);
16610 return ;
16611 }
16612 }
16613 }
16614 }
16615 }
16616 if(!success && exp->__anon1.op.exp1->type == 2)
16617 {
16618 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16619 {
16620 if(exp->expType)
16621 FreeType(exp->expType);
16622 exp->expType = exp->__anon1.op.exp1->destType;
16623 if(exp->__anon1.op.exp1->destType)
16624 exp->__anon1.op.exp1->destType->refCount++;
16625 success = 1;
16626 }
16627 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16628 {
16629 if(exp->expType)
16630 FreeType(exp->expType);
16631 exp->expType = exp->__anon1.op.exp2->destType;
16632 if(exp->__anon1.op.exp2->destType)
16633 exp->__anon1.op.exp2->destType->refCount++;
16634 success = 1;
16635 }
16636 }
16637 else if(!success)
16638 {
16639 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16640 {
16641 if(exp->expType)
16642 FreeType(exp->expType);
16643 exp->expType = exp->__anon1.op.exp2->destType;
16644 if(exp->__anon1.op.exp2->destType)
16645 exp->__anon1.op.exp2->destType->refCount++;
16646 success = 1;
16647 }
16648 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16649 {
16650 if(exp->expType)
16651 FreeType(exp->expType);
16652 exp->expType = exp->__anon1.op.exp1->destType;
16653 if(exp->__anon1.op.exp1->destType)
16654 exp->__anon1.op.exp1->destType->refCount++;
16655 success = 1;
16656 }
16657 }
16658 if(!success)
16659 {
16660 char expString1[10240];
16661 char expString2[10240];
16662 char type1[1024];
16663 char type2[1024];
16664
16665 expString1[0] = '\0';
16666 expString2[0] = '\0';
16667 type1[0] = '\0';
16668 type2[0] = '\0';
16669 if(inCompiler)
16670 {
16671 PrintExpression(exp->__anon1.op.exp1, expString1);
16672 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16673 PrintExpression(exp->__anon1.op.exp2, expString2);
16674 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16675 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16676 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16677 }
16678 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16679 }
16680 }
16681 }
16682 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)
16683 {
16684 if(exp->__anon1.op.exp1->destType)
16685 FreeType(exp->__anon1.op.exp1->destType);
16686 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16687 if(type2->__anon1._class->__anon1.registered->dataType)
16688 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16689 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16690 exp->expType = type2;
16691 if(type2)
16692 type2->refCount++;
16693 }
16694 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)
16695 {
16696 if(exp->__anon1.op.exp2->destType)
16697 FreeType(exp->__anon1.op.exp2->destType);
16698 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16699 if(type1->__anon1._class->__anon1.registered->dataType)
16700 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16701 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16702 exp->expType = type1;
16703 if(type1)
16704 type1->refCount++;
16705 }
16706 else if(type1)
16707 {
16708 unsigned int valid = 0;
16709
16710 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
16711 {
16712 if(exp->__anon1.op.exp2->destType)
16713 FreeType(exp->__anon1.op.exp2->destType);
16714 if(!type1->__anon1._class->__anon1.registered->dataType)
16715 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16716 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16717 exp->__anon1.op.exp2->destType->refCount++;
16718 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16719 if(type2)
16720 FreeType(type2);
16721 type2 = exp->__anon1.op.exp2->destType;
16722 if(type2)
16723 type2->refCount++;
16724 exp->expType = type2;
16725 type2->refCount++;
16726 }
16727 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
16728 {
16729 if(exp->__anon1.op.exp1->destType)
16730 FreeType(exp->__anon1.op.exp1->destType);
16731 if(!type2->__anon1._class->__anon1.registered->dataType)
16732 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16733 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16734 exp->__anon1.op.exp1->destType->refCount++;
16735 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16736 type1 = exp->__anon1.op.exp1->destType;
16737 exp->expType = type1;
16738 type1->refCount++;
16739 }
16740 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
16741 {
16742 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
16743 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
16744
16745 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
16746 {
16747 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16748 {
16749 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16750 {
16751 if(exp->expType)
16752 FreeType(exp->expType);
16753 exp->expType = exp->__anon1.op.exp2->expType;
16754 if(exp->__anon1.op.exp2->expType)
16755 exp->__anon1.op.exp2->expType->refCount++;
16756 valid = 1;
16757 }
16758 }
16759 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16760 {
16761 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16762 {
16763 if(exp->expType)
16764 FreeType(exp->expType);
16765 exp->expType = exp->__anon1.op.exp1->expType;
16766 if(exp->__anon1.op.exp1->expType)
16767 exp->__anon1.op.exp1->expType->refCount++;
16768 valid = 1;
16769 }
16770 }
16771 }
16772 else
16773 {
16774 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16775 {
16776 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16777 {
16778 if(exp->expType)
16779 FreeType(exp->expType);
16780 exp->expType = exp->__anon1.op.exp1->expType;
16781 if(exp->__anon1.op.exp1->expType)
16782 exp->__anon1.op.exp1->expType->refCount++;
16783 valid = 1;
16784 }
16785 }
16786 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16787 {
16788 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16789 {
16790 if(exp->expType)
16791 FreeType(exp->expType);
16792 exp->expType = exp->__anon1.op.exp2->expType;
16793 if(exp->__anon1.op.exp2->expType)
16794 exp->__anon1.op.exp2->expType->refCount++;
16795 valid = 1;
16796 }
16797 }
16798 }
16799 }
16800 if(!valid)
16801 {
16802 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))
16803 {
16804 if(exp->__anon1.op.exp1->destType)
16805 FreeType(exp->__anon1.op.exp1->destType);
16806 exp->__anon1.op.exp1->destType = type2;
16807 type2->refCount++;
16808 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16809 {
16810 if(exp->expType)
16811 FreeType(exp->expType);
16812 exp->expType = exp->__anon1.op.exp1->destType;
16813 if(exp->__anon1.op.exp1->destType)
16814 exp->__anon1.op.exp1->destType->refCount++;
16815 }
16816 }
16817 else
16818 {
16819 if(exp->__anon1.op.exp2->destType)
16820 FreeType(exp->__anon1.op.exp2->destType);
16821 exp->__anon1.op.exp2->destType = type1;
16822 type1->refCount++;
16823 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16824 {
16825 if(exp->expType)
16826 FreeType(exp->expType);
16827 exp->expType = exp->__anon1.op.exp2->destType;
16828 if(exp->__anon1.op.exp2->destType)
16829 exp->__anon1.op.exp2->destType->refCount++;
16830 }
16831 else if(type1 && type2)
16832 {
16833 char expString1[10240];
16834 char expString2[10240];
16835 char type1String[1024];
16836 char type2String[1024];
16837
16838 expString1[0] = '\0';
16839 expString2[0] = '\0';
16840 type1String[0] = '\0';
16841 type2String[0] = '\0';
16842 if(inCompiler)
16843 {
16844 PrintExpression(exp->__anon1.op.exp1, expString1);
16845 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16846 PrintExpression(exp->__anon1.op.exp2, expString2);
16847 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16848 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
16849 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
16850 }
16851 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
16852 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
16853 {
16854 exp->expType = exp->__anon1.op.exp1->expType;
16855 if(exp->__anon1.op.exp1->expType)
16856 exp->__anon1.op.exp1->expType->refCount++;
16857 }
16858 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16859 {
16860 exp->expType = exp->__anon1.op.exp2->expType;
16861 if(exp->__anon1.op.exp2->expType)
16862 exp->__anon1.op.exp2->expType->refCount++;
16863 }
16864 }
16865 }
16866 }
16867 }
16868 else if(type2)
16869 {
16870 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16871 {
16872 struct Type * oldType = exp->__anon1.op.exp1->expType;
16873
16874 exp->__anon1.op.exp1->expType = (((void *)0));
16875 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16876 FreeType(oldType);
16877 else
16878 exp->__anon1.op.exp1->expType = oldType;
16879 }
16880 if(exp->__anon1.op.exp1->destType)
16881 FreeType(exp->__anon1.op.exp1->destType);
16882 exp->__anon1.op.exp1->destType = type2;
16883 type2->refCount++;
16884 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16885 {
16886 if(exp->expType)
16887 FreeType(exp->expType);
16888 exp->expType = exp->__anon1.op.exp1->destType;
16889 if(exp->__anon1.op.exp1->destType)
16890 exp->__anon1.op.exp1->destType->refCount++;
16891 }
16892 }
16893 }
16894 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
16895 {
16896 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16897 {
16898 if(exp->__anon1.op.exp1->destType)
16899 FreeType(exp->__anon1.op.exp1->destType);
16900 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16901 if(type2->__anon1._class->__anon1.registered->dataType)
16902 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16903 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16904 }
16905 if(exp->__anon1.op.op == '!')
16906 {
16907 exp->expType = MkClassType("bool");
16908 exp->expType->truth = 1;
16909 }
16910 else
16911 {
16912 exp->expType = type2;
16913 if(type2)
16914 type2->refCount++;
16915 }
16916 }
16917 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
16918 {
16919 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16920 {
16921 if(exp->__anon1.op.exp2->destType)
16922 FreeType(exp->__anon1.op.exp2->destType);
16923 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16924 if(type1->__anon1._class->__anon1.registered->dataType)
16925 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16926 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16927 }
16928 exp->expType = type1;
16929 if(type1)
16930 type1->refCount++;
16931 }
16932 }
16933 yylloc = exp->loc;
16934 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
16935 {
16936 char expString[10000];
16937
16938 expString[0] = '\0';
16939 if(inCompiler)
16940 {
16941 PrintExpression(exp->__anon1.op.exp1, expString);
16942 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16943 }
16944 if(expString[0])
16945 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16946 }
16947 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
16948 {
16949 char expString[10240];
16950
16951 expString[0] = '\0';
16952 if(inCompiler)
16953 {
16954 PrintExpression(exp->__anon1.op.exp2, expString);
16955 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16956 }
16957 if(expString[0])
16958 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16959 }
16960 if(boolResult)
16961 {
16962 FreeType(exp->expType);
16963 exp->expType = MkClassType("bool");
16964 exp->expType->truth = 1;
16965 }
16966 if(exp->__anon1.op.op != SIZEOF)
16967 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
16968 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
16969 {
16970 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
16971 }
16972 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
16973 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
16974 yylloc = oldyylloc;
16975 FreeType(dummy);
16976 if(type2)
16977 FreeType(type2);
16978 break;
16979 }
16980 case 5:
16981 case 32:
16982 {
16983 struct Expression * e;
16984
16985 exp->isConstant = 1;
16986 for(e = (*exp->__anon1.list).first; e; e = e->next)
16987 {
16988 if(!e->next)
16989 {
16990 FreeType(e->destType);
16991 e->opDestType = exp->opDestType;
16992 e->destType = exp->destType;
16993 if(e->destType)
16994 {
16995 exp->destType->refCount++;
16996 }
16997 }
16998 ProcessExpressionType(e);
16999 if(!exp->expType && !e->next)
17000 {
17001 exp->expType = e->expType;
17002 if(e->expType)
17003 e->expType->refCount++;
17004 }
17005 if(!e->isConstant)
17006 exp->isConstant = 0;
17007 }
17008 e = (*exp->__anon1.list).first;
17009 if(!e->next && e->type == 8)
17010 {
17011 struct Expression * next = exp->next, * prev = exp->prev;
17012
17013 FreeType(exp->expType);
17014 FreeType(exp->destType);
17015 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17016 *exp = *e;
17017 exp->prev = prev;
17018 exp->next = next;
17019 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
17020 ProcessExpressionType(exp);
17021 }
17022 break;
17023 }
17024 case 6:
17025 {
17026 struct Expression * e;
17027
17028 exp->isConstant = 1;
17029 ProcessExpressionType(exp->__anon1.index.exp);
17030 if(!exp->__anon1.index.exp->isConstant)
17031 exp->isConstant = 0;
17032 if(exp->__anon1.index.exp->expType)
17033 {
17034 struct Type * source = exp->__anon1.index.exp->expType;
17035
17036 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
17037 {
17038 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
17039 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
17040
17041 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
17042 {
17043 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
17044 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
17045 {
17046 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
17047
17048 if(type->kind == 8)
17049 type->constant = 1;
17050 else if(type->kind == 13)
17051 {
17052 struct Type * t = type;
17053
17054 while(t->kind == 13)
17055 t = t->__anon1.type;
17056 t->constant = 1;
17057 }
17058 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
17059 }
17060 }
17061 }
17062 }
17063 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
17064 {
17065 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
17066 {
17067 if(e->destType)
17068 FreeType(e->destType);
17069 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
17070 }
17071 ProcessExpressionType(e);
17072 if(!e->next)
17073 {
17074 }
17075 if(!e->isConstant)
17076 exp->isConstant = 0;
17077 }
17078 if(!exp->expType)
17079 exp->expType = Dereference(exp->__anon1.index.exp->expType);
17080 if(exp->expType)
17081 DeclareType(curExternal, exp->expType, 1, 0);
17082 break;
17083 }
17084 case 7:
17085 {
17086 struct Expression * e;
17087 struct Type * functionType;
17088 struct Type * methodType = (((void *)0));
17089 char name[1024];
17090
17091 name[0] = '\0';
17092 if(inCompiler)
17093 {
17094 PrintExpression(exp->__anon1.call.exp, name);
17095 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17096 {
17097 PrintExpression(exp->__anon1.call.exp, name);
17098 }
17099 }
17100 if(exp->__anon1.call.exp->type == 0)
17101 {
17102 struct Expression * idExp = exp->__anon1.call.exp;
17103 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17104
17105 if(!strcmp(id->string, "__builtin_frame_address"))
17106 {
17107 exp->expType = ProcessTypeString("void *", 1);
17108 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17109 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17110 break;
17111 }
17112 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17113 {
17114 exp->expType = ProcessTypeString("int", 1);
17115 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17116 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17117 break;
17118 }
17119 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17120 {
17121 struct Expression * a = (((void *)0));
17122 struct Expression * b = (((void *)0));
17123 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17124
17125 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17126 {
17127 a = (*exp->__anon1.call.arguments).first;
17128 b = (*exp->__anon1.call.arguments).last;
17129 tempExp1 = a;
17130 tempExp2 = b;
17131 }
17132 else if((*exp->__anon1.call.arguments).count == 1)
17133 {
17134 a = (*exp->__anon1.call.arguments).first;
17135 tempExp1 = a;
17136 }
17137 if(a)
17138 {
17139 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17140 idExp->__anon1.__anon1.identifier = (((void *)0));
17141 FreeExpContents(exp);
17142 ProcessExpressionType(a);
17143 if(b)
17144 ProcessExpressionType(b);
17145 exp->type = 5;
17146 exp->__anon1.list = MkList();
17147 if(a->expType && (!b || b->expType))
17148 {
17149 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17150 {
17151 if(inCompiler)
17152 {
17153 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17154 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17155 struct Declaration * decl;
17156 char temp1[1024], temp2[1024];
17157
17158 GetTypeSpecs(a->expType, specs);
17159 if(a && !a->isConstant && a->type != 0)
17160 {
17161 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17162 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17163 tempExp1 = QMkExpId(temp1);
17164 tempExp1->expType = a->expType;
17165 if(a->expType)
17166 a->expType->refCount++;
17167 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17168 }
17169 if(b && !b->isConstant && b->type != 0)
17170 {
17171 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17172 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17173 tempExp2 = QMkExpId(temp2);
17174 tempExp2->expType = b->expType;
17175 if(b->expType)
17176 b->expType->refCount++;
17177 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17178 }
17179 decl = MkDeclaration(specs, decls);
17180 if(!curCompound->__anon1.compound.declarations)
17181 curCompound->__anon1.compound.declarations = MkList();
17182 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17183 }
17184 }
17185 }
17186 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17187 {
17188 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17189
17190 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17191 exp->expType = a->expType;
17192 if(a->expType)
17193 a->expType->refCount++;
17194 }
17195 else if(!strcmp(id->string, "Abs"))
17196 {
17197 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17198 exp->expType = a->expType;
17199 if(a->expType)
17200 a->expType->refCount++;
17201 }
17202 else if(!strcmp(id->string, "Sgn"))
17203 {
17204 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"))))));
17205 exp->expType = ProcessTypeString("int", 0);
17206 }
17207 FreeExpression(tempExp1);
17208 if(tempExp2)
17209 FreeExpression(tempExp2);
17210 FreeIdentifier(id);
17211 break;
17212 }
17213 }
17214 }
17215 {
17216 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17217
17218 if(!exp->__anon1.call.exp->destType)
17219 {
17220 exp->__anon1.call.exp->destType = dummy;
17221 dummy->refCount++;
17222 }
17223 ProcessExpressionType(exp->__anon1.call.exp);
17224 if(exp->__anon1.call.exp->destType == dummy)
17225 {
17226 FreeType(dummy);
17227 exp->__anon1.call.exp->destType = (((void *)0));
17228 }
17229 FreeType(dummy);
17230 }
17231 functionType = exp->__anon1.call.exp->expType;
17232 if(functionType && functionType->kind == 16)
17233 {
17234 methodType = functionType;
17235 functionType = methodType->__anon1.__anon3.method->dataType;
17236 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17237 {
17238 char typeString[1024];
17239
17240 typeString[0] = '\0';
17241 {
17242 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17243
17244 functionType->__anon1.__anon2.thisClass = (((void *)0));
17245 PrintType(functionType, typeString, 1, 1);
17246 functionType->__anon1.__anon2.thisClass = back;
17247 }
17248 if(strstr(typeString, "thisclass"))
17249 {
17250 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17251 struct Declarator * decl;
17252
17253 {
17254 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17255
17256 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17257 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))
17258 thisClassParams = 0;
17259 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17260 {
17261 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17262
17263 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17264 ProcessDeclarator(decl, 1);
17265 thisClass = backupThisClass;
17266 }
17267 thisClassParams = 1;
17268 functionType = ProcessType(specs, decl);
17269 functionType->refCount = 0;
17270 FinishTemplatesContext(context);
17271 {
17272 struct Type * p, * op;
17273
17274 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)
17275 {
17276 if(op->kind == 21)
17277 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17278 }
17279 }
17280 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17281 {
17282 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17283 }
17284 }
17285 FreeList(specs, (void *)(FreeSpecifier));
17286 FreeDeclarator(decl);
17287 }
17288 }
17289 }
17290 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17291 {
17292 struct Type * type = functionType->__anon1.type;
17293
17294 if(!functionType->refCount)
17295 {
17296 functionType->__anon1.type = (((void *)0));
17297 FreeType(functionType);
17298 }
17299 functionType = type;
17300 }
17301 if(functionType && functionType->kind != 11)
17302 {
17303 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17304 }
17305 else if(functionType)
17306 {
17307 unsigned int emptyParams = 0, noParams = 0;
17308 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17309 struct Type * type = functionType->__anon1.__anon2.params.first;
17310 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17311 int extra = 0;
17312 struct Location oldyylloc = yylloc;
17313
17314 if(!type)
17315 emptyParams = 1;
17316 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17317 {
17318 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17319 e = e->next;
17320 }
17321 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17322 {
17323 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)
17324 {
17325 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17326 if(e)
17327 {
17328 e->destType = type;
17329 e = e->next;
17330 type = functionType->__anon1.__anon2.params.first;
17331 }
17332 else
17333 type->refCount = 0;
17334 }
17335 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17336 {
17337 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17338 type->byReference = functionType->byReference;
17339 type->typedByReference = functionType->typedByReference;
17340 if(e)
17341 {
17342 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17343 e = e->next;
17344 e->destType = type;
17345 e = e->next;
17346 type = functionType->__anon1.__anon2.params.first;
17347 }
17348 else
17349 type->refCount = 0;
17350 }
17351 }
17352 if(type && type->kind == 0)
17353 {
17354 noParams = 1;
17355 if(!type->refCount)
17356 FreeType(type);
17357 type = (((void *)0));
17358 }
17359 for(; e; e = e->next)
17360 {
17361 if(!type && !emptyParams)
17362 {
17363 yylloc = e->loc;
17364 if(methodType && methodType->__anon1.__anon3.methodClass)
17365 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);
17366 else
17367 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);
17368 break;
17369 }
17370 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17371 {
17372 struct Type * templatedType = (((void *)0));
17373 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17374 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17375 int id = 0;
17376
17377 if(_class && _class->templateArgs)
17378 {
17379 struct __ecereNameSpace__ecere__com__Class * sClass;
17380
17381 for(sClass = _class; sClass; sClass = sClass->base)
17382 {
17383 if(sClass->templateClass)
17384 sClass = sClass->templateClass;
17385 id = 0;
17386 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17387 {
17388 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17389 {
17390 struct __ecereNameSpace__ecere__com__Class * nextClass;
17391
17392 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17393 {
17394 if(nextClass->templateClass)
17395 nextClass = nextClass->templateClass;
17396 id += nextClass->templateParams.count;
17397 }
17398 break;
17399 }
17400 id++;
17401 }
17402 if(curParam)
17403 break;
17404 }
17405 }
17406 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17407 {
17408 unsigned int constant = type->constant;
17409 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17410
17411 {
17412 struct Context * context = SetupTemplatesContext(_class);
17413
17414 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17415 FinishTemplatesContext(context);
17416 }
17417 if(templatedType->kind == 8 && constant)
17418 templatedType->constant = 1;
17419 else if(templatedType->kind == 13)
17420 {
17421 struct Type * t = templatedType->__anon1.type;
17422
17423 while(t->kind == 13)
17424 t = t->__anon1.type;
17425 if(constant)
17426 t->constant = constant;
17427 }
17428 e->destType = templatedType;
17429 if(templatedType)
17430 {
17431 templatedType->passAsTemplate = 1;
17432 }
17433 }
17434 else
17435 {
17436 e->destType = type;
17437 if(type)
17438 type->refCount++;
17439 }
17440 }
17441 else
17442 {
17443 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17444 {
17445 e->destType = type->prev;
17446 e->destType->refCount++;
17447 }
17448 else
17449 {
17450 e->destType = type;
17451 if(type)
17452 type->refCount++;
17453 }
17454 }
17455 if(type && type->kind != 14)
17456 {
17457 struct Type * next = type->next;
17458
17459 if(!type->refCount)
17460 FreeType(type);
17461 type = next;
17462 }
17463 }
17464 if(type && type->kind != 14)
17465 {
17466 if(methodType && methodType->__anon1.__anon3.methodClass)
17467 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);
17468 else
17469 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);
17470 }
17471 yylloc = oldyylloc;
17472 if(type && !type->refCount)
17473 FreeType(type);
17474 }
17475 else
17476 {
17477 functionType = __extension__ ({
17478 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17479
17480 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17481 });
17482 if(exp->__anon1.call.exp->type == 0)
17483 {
17484 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17485
17486 if(inCompiler)
17487 {
17488 struct Symbol * symbol;
17489 struct Location oldyylloc = yylloc;
17490
17491 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17492 if(strstr(string, "__builtin_") == string)
17493 {
17494 if(exp->destType)
17495 {
17496 functionType->__anon1.__anon2.returnType = exp->destType;
17497 exp->destType->refCount++;
17498 }
17499 }
17500 else
17501 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17502 symbol = __extension__ ({
17503 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17504
17505 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17506 });
17507 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17508 if(strstr(symbol->string, "::"))
17509 globalContext->hasNameSpace = 1;
17510 yylloc = oldyylloc;
17511 }
17512 }
17513 else if(exp->__anon1.call.exp->type == 8)
17514 {
17515 }
17516 else
17517 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17518 if(!functionType->__anon1.__anon2.returnType)
17519 {
17520 functionType->__anon1.__anon2.returnType = __extension__ ({
17521 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17522
17523 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17524 });
17525 }
17526 }
17527 if(functionType && functionType->kind == 11)
17528 {
17529 exp->expType = functionType->__anon1.__anon2.returnType;
17530 if(functionType->__anon1.__anon2.returnType)
17531 functionType->__anon1.__anon2.returnType->refCount++;
17532 if(!functionType->refCount)
17533 FreeType(functionType);
17534 }
17535 if(exp->__anon1.call.arguments)
17536 {
17537 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17538 ProcessExpressionType(e);
17539 }
17540 break;
17541 }
17542 case 8:
17543 {
17544 struct Type * type;
17545 struct Location oldyylloc = yylloc;
17546 unsigned int thisPtr;
17547 struct Expression * checkExp = exp->__anon1.member.exp;
17548
17549 while(checkExp)
17550 {
17551 if(checkExp->type == 11)
17552 checkExp = checkExp->__anon1.cast.exp;
17553 else if(checkExp->type == 5)
17554 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17555 else
17556 break;
17557 }
17558 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17559 exp->thisPtr = thisPtr;
17560 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17561 {
17562 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17563 }
17564 ProcessExpressionType(exp->__anon1.member.exp);
17565 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)
17566 {
17567 exp->isConstant = 0;
17568 }
17569 else
17570 exp->isConstant = exp->__anon1.member.exp->isConstant;
17571 type = exp->__anon1.member.exp->expType;
17572 yylloc = exp->loc;
17573 if(type && (type->kind == 20))
17574 {
17575 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17576 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17577
17578 if(_class)
17579 {
17580 for(param = _class->templateParams.first; param; param = param->next)
17581 {
17582 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17583 break;
17584 }
17585 }
17586 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17587 {
17588 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17589
17590 if(argExp)
17591 {
17592 struct Expression * expMember = exp->__anon1.member.exp;
17593 struct Declarator * decl;
17594 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17595 char thisClassTypeString[1024];
17596
17597 FreeIdentifier(exp->__anon1.member.member);
17598 ProcessExpressionType(argExp);
17599 {
17600 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17601
17602 if(colon)
17603 {
17604 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17605 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17606 }
17607 else
17608 strcpy(thisClassTypeString, _class->fullName);
17609 }
17610 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17611 exp->expType = ProcessType(specs, decl);
17612 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17613 {
17614 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17615 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17616 int paramCount = 0;
17617 int lastParam = -1;
17618 char templateString[1024];
17619 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17620
17621 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17622 for(cClass = expClass; cClass; cClass = cClass->base)
17623 {
17624 int p = 0;
17625
17626 for(param = cClass->templateParams.first; param; param = param->next)
17627 {
17628 int id = p;
17629 struct __ecereNameSpace__ecere__com__Class * sClass;
17630 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17631
17632 for(sClass = cClass->base; sClass; sClass = sClass->base)
17633 id += sClass->templateParams.count;
17634 arg = expClass->templateArgs[id];
17635 for(sClass = _class; sClass; sClass = sClass->base)
17636 {
17637 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17638 int p = 0;
17639 struct __ecereNameSpace__ecere__com__Class * nextClass;
17640
17641 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17642 p += nextClass->templateParams.count;
17643 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17644 {
17645 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17646 {
17647 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17648 {
17649 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17650 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17651 break;
17652 }
17653 }
17654 }
17655 }
17656 {
17657 char argument[256];
17658
17659 argument[0] = '\0';
17660 switch(param->type)
17661 {
17662 case 2:
17663 {
17664 char expString[1024];
17665 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17666 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17667 struct Expression * exp;
17668 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17669
17670 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17671 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17672 ProcessExpressionType(exp);
17673 ComputeExpression(exp);
17674 expString[0] = '\0';
17675 PrintExpression(exp, expString);
17676 strcat(argument, expString);
17677 FreeExpression(exp);
17678 break;
17679 }
17680 case 1:
17681 {
17682 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17683 break;
17684 }
17685 case 0:
17686 {
17687 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17688 {
17689 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17690 strcat(argument, thisClassTypeString);
17691 else
17692 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17693 }
17694 break;
17695 }
17696 }
17697 if(argument[0])
17698 {
17699 if(paramCount)
17700 strcat(templateString, ", ");
17701 if(lastParam != p - 1)
17702 {
17703 strcat(templateString, param->name);
17704 strcat(templateString, " = ");
17705 }
17706 strcat(templateString, argument);
17707 paramCount++;
17708 lastParam = p;
17709 }
17710 p++;
17711 }
17712 }
17713 }
17714 {
17715 int len = strlen(templateString);
17716
17717 if(templateString[len - 1] == '>')
17718 templateString[len++] = ' ';
17719 templateString[len++] = '>';
17720 templateString[len++] = '\0';
17721 }
17722 {
17723 struct Context * context = SetupTemplatesContext(_class);
17724
17725 FreeType(exp->expType);
17726 exp->expType = ProcessTypeString(templateString, 0);
17727 FinishTemplatesContext(context);
17728 }
17729 }
17730 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
17731 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
17732 exp->type = 5;
17733 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")))))))));
17734 }
17735 }
17736 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
17737 {
17738 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
17739 }
17740 }
17741 if(type && (type->kind == 20))
17742 ;
17743 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)))
17744 {
17745 struct Identifier * id = exp->__anon1.member.member;
17746 int typeKind = type->kind;
17747 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));
17748
17749 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
17750 {
17751 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
17752 typeKind = 8;
17753 }
17754 if(id)
17755 {
17756 if(typeKind == 3 || typeKind == 15)
17757 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
17758 else if(!_class)
17759 {
17760 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17761 {
17762 _class = type->__anon1._class->__anon1.registered;
17763 }
17764 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
17765 {
17766 _class = FindClass("char *")->__anon1.registered;
17767 }
17768 else if(type->kind == 13)
17769 {
17770 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
17771 FreeType(exp->expType);
17772 exp->expType = ProcessTypeString("uintptr", 0);
17773 exp->byReference = 1;
17774 }
17775 else
17776 {
17777 char string[1024] = "";
17778 struct Symbol * classSym;
17779
17780 PrintTypeNoConst(type, string, 0, 1);
17781 classSym = FindClass(string);
17782 if(classSym)
17783 _class = classSym->__anon1.registered;
17784 }
17785 }
17786 }
17787 if(_class && id)
17788 {
17789 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
17790 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
17791 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17792 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
17793 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
17794
17795 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
17796 exp->__anon1.member.memberType = 1;
17797 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
17798 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
17799 if(typeKind != 19)
17800 {
17801 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
17802 {
17803 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17804 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
17805 {
17806 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17807 if(prop)
17808 member = (((void *)0));
17809 }
17810 if(!member && !prop)
17811 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17812 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
17813 exp->__anon1.member.thisPtr = 1;
17814 }
17815 else
17816 {
17817 unsigned int useMemberForNonConst = 0;
17818
17819 if(!id->classSym)
17820 {
17821 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
17822 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);
17823 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17824 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
17825 }
17826 if((!prop || useMemberForNonConst) && !member)
17827 {
17828 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
17829 if(!method)
17830 {
17831 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17832 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);
17833 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17834 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17835 }
17836 }
17837 if(member && prop)
17838 {
17839 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
17840 prop = (((void *)0));
17841 else
17842 member = (((void *)0));
17843 }
17844 }
17845 }
17846 if(!prop && !member && !method)
17847 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
17848 if(!prop && !member && !method)
17849 {
17850 if(typeKind == 19)
17851 {
17852 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
17853 if(classProp)
17854 {
17855 exp->__anon1.member.memberType = 5;
17856 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
17857 }
17858 else
17859 {
17860 char structName[1024];
17861 struct Identifier * id = exp->__anon1.member.member;
17862 struct Expression * classExp = exp->__anon1.member.exp;
17863
17864 type->refCount++;
17865 FreeType(classExp->expType);
17866 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
17867 strcpy(structName, "__ecereClassData_");
17868 FullClassNameCat(structName, type->__anon1._class->string, 0);
17869 exp->type = 9;
17870 exp->__anon1.member.member = id;
17871 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"))))))));
17872 FreeType(type);
17873 ProcessExpressionType(exp);
17874 return ;
17875 }
17876 }
17877 else
17878 {
17879 struct Symbol * classSym = FindClass(id->string);
17880
17881 if(classSym)
17882 {
17883 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
17884
17885 if(convertClass)
17886 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
17887 }
17888 }
17889 }
17890 if(exp->__anon1.member.exp->destType)
17891 FreeType(exp->__anon1.member.exp->destType);
17892 {
17893 if(method && !method->_class->symbol)
17894 method->_class->symbol = FindClass(method->_class->fullName);
17895 if(prop && !prop->_class->symbol)
17896 prop->_class->symbol = FindClass(prop->_class->fullName);
17897 exp->__anon1.member.exp->destType = __extension__ ({
17898 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17899
17900 __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;
17901 });
17902 }
17903 if(prop)
17904 {
17905 exp->__anon1.member.memberType = 1;
17906 if(!prop->dataType)
17907 ProcessPropertyType(prop);
17908 exp->expType = prop->dataType;
17909 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
17910 {
17911 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17912
17913 CopyTypeInto(type, exp->expType);
17914 type->refCount = 1;
17915 type->constant = 1;
17916 exp->expType = type;
17917 }
17918 else if(prop->dataType)
17919 prop->dataType->refCount++;
17920 }
17921 else if(member)
17922 {
17923 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17924 {
17925 FreeExpContents(exp);
17926 exp->type = 0;
17927 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17928 ProcessExpressionType(exp);
17929 return ;
17930 }
17931 exp->__anon1.member.memberType = 3;
17932 DeclareStruct(curExternal, _class->fullName, 0, 1);
17933 if(member->_class != _class)
17934 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
17935 if(!member->dataType)
17936 {
17937 struct Context * context = SetupTemplatesContext(_class);
17938
17939 member->dataType = ProcessTypeString(member->dataTypeString, 0);
17940 FinishTemplatesContext(context);
17941 }
17942 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)
17943 member->dataType->bitMemberSize = ((struct __ecereNameSpace__ecere__com__BitMember *)member)->size;
17944 exp->expType = member->dataType;
17945 if(member->dataType)
17946 member->dataType->refCount++;
17947 }
17948 else if(revConvert)
17949 {
17950 exp->__anon1.member.memberType = 4;
17951 exp->expType = MkClassType(revConvert->_class->fullName);
17952 }
17953 else if(method)
17954 {
17955 {
17956 exp->__anon1.member.memberType = 2;
17957 }
17958 if(!method->dataType)
17959 ProcessMethodType(method);
17960 exp->expType = __extension__ ({
17961 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17962
17963 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
17964 });
17965 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
17966 exp->expType->__anon1.__anon3.usedClass = _class;
17967 }
17968 else if(!classProp)
17969 {
17970 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17971 {
17972 FreeExpContents(exp);
17973 exp->type = 0;
17974 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17975 FreeType(exp->expType);
17976 exp->expType = MkClassType("ecere::com::Class");
17977 return ;
17978 }
17979 yylloc = exp->__anon1.member.member->loc;
17980 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
17981 if(inCompiler)
17982 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
17983 }
17984 if(_class && exp->expType)
17985 {
17986 struct __ecereNameSpace__ecere__com__Class * tClass;
17987
17988 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
17989 while(tClass && !tClass->templateClass)
17990 tClass = tClass->base;
17991 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
17992 {
17993 int id = 0;
17994 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17995 struct __ecereNameSpace__ecere__com__Class * sClass;
17996
17997 for(sClass = tClass; sClass; sClass = sClass->base)
17998 {
17999 id = 0;
18000 if(sClass->templateClass)
18001 sClass = sClass->templateClass;
18002 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18003 {
18004 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
18005 {
18006 for(sClass = sClass->base; sClass; sClass = sClass->base)
18007 id += sClass->templateParams.count;
18008 break;
18009 }
18010 id++;
18011 }
18012 if(curParam)
18013 break;
18014 }
18015 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
18016 {
18017 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18018 struct Context * context = SetupTemplatesContext(tClass);
18019 unsigned int constant = exp->expType->constant;
18020 unsigned int passAsTemplate = 0;
18021 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
18022 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
18023
18024 if(t && t->kind == 8 && t->__anon1._class)
18025 thisClassFrom = t->__anon1._class->__anon1.registered;
18026 else
18027 thisClassFrom = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "class");
18028 FreeType(t);
18029 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
18030 FreeType(exp->expType);
18031 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18032 exp->expType->thisClassFrom = thisClassFrom;
18033 if(exp->expType->kind == 8 && constant)
18034 exp->expType->constant = 1;
18035 else if(exp->expType->kind == 13)
18036 {
18037 struct Type * t = exp->expType->__anon1.type;
18038
18039 while(t->kind == 13)
18040 t = t->__anon1.type;
18041 if(constant)
18042 t->constant = constant;
18043 }
18044 if(exp->expType)
18045 {
18046 if(exp->expType->kind == 21)
18047 {
18048 FreeType(exp->expType);
18049 exp->expType = ReplaceThisClassType(_class);
18050 }
18051 if(passAsTemplate)
18052 exp->expType->passAsTemplate = 1;
18053 if(!exp->destType)
18054 {
18055 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18056 if(exp->destType->kind == 8 && constant)
18057 exp->destType->constant = 1;
18058 else if(exp->destType->kind == 13)
18059 {
18060 struct Type * t = exp->destType->__anon1.type;
18061
18062 while(t->kind == 13)
18063 t = t->__anon1.type;
18064 if(constant)
18065 t->constant = constant;
18066 }
18067 if(exp->destType->kind == 21)
18068 {
18069 FreeType(exp->destType);
18070 exp->destType = ReplaceThisClassType(_class);
18071 }
18072 }
18073 }
18074 FinishTemplatesContext(context);
18075 }
18076 }
18077 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)
18078 {
18079 int id = 0;
18080 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
18081 struct __ecereNameSpace__ecere__com__Class * sClass;
18082
18083 for(sClass = tClass; sClass; sClass = sClass->base)
18084 {
18085 id = 0;
18086 if(sClass->templateClass)
18087 sClass = sClass->templateClass;
18088 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18089 {
18090 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
18091 {
18092 for(sClass = sClass->base; sClass; sClass = sClass->base)
18093 id += sClass->templateParams.count;
18094 break;
18095 }
18096 id++;
18097 }
18098 if(curParam)
18099 break;
18100 }
18101 if(curParam)
18102 {
18103 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18104 struct Context * context = SetupTemplatesContext(tClass);
18105 struct Type * basicType;
18106
18107 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18108 if(basicType)
18109 {
18110 if(basicType->kind == 21)
18111 {
18112 FreeType(basicType);
18113 basicType = ReplaceThisClassType(_class);
18114 }
18115 FreeType(exp->expType);
18116 exp->expType = __extension__ ({
18117 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18118
18119 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18120 });
18121 if(!exp->destType)
18122 {
18123 exp->destType = exp->expType;
18124 exp->destType->refCount++;
18125 }
18126 {
18127 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18128 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18129 struct Declarator * decl;
18130
18131 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18132 *newExp = *exp;
18133 if(exp->destType)
18134 exp->destType->refCount++;
18135 if(exp->expType)
18136 exp->expType->refCount++;
18137 exp->type = 11;
18138 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18139 exp->__anon1.cast.exp = newExp;
18140 }
18141 }
18142 FinishTemplatesContext(context);
18143 }
18144 }
18145 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18146 {
18147 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18148
18149 if(expClass)
18150 {
18151 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18152 int p = 0;
18153 int paramCount = 0;
18154 int lastParam = -1;
18155 char templateString[1024];
18156 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18157
18158 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18159 while(cClass != expClass)
18160 {
18161 struct __ecereNameSpace__ecere__com__Class * sClass;
18162
18163 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18164 ;
18165 cClass = sClass;
18166 for(param = cClass->templateParams.first; param; param = param->next)
18167 {
18168 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18169 int cp = 0;
18170 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18171 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18172
18173 while(cClassCur != tClass && !paramCur)
18174 {
18175 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18176
18177 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18178 ;
18179 cClassCur = sClassCur;
18180 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18181 {
18182 if(!strcmp(paramCur->name, param->name))
18183 {
18184 break;
18185 }
18186 cp++;
18187 }
18188 }
18189 if(paramCur && paramCur->type == 0)
18190 arg = tClass->templateArgs[cp];
18191 else
18192 arg = expClass->templateArgs[p];
18193 {
18194 char argument[256];
18195
18196 argument[0] = '\0';
18197 switch(param->type)
18198 {
18199 case 2:
18200 {
18201 char expString[1024];
18202 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18203 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18204 struct Expression * exp;
18205 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18206
18207 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18208 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18209 ProcessExpressionType(exp);
18210 ComputeExpression(exp);
18211 expString[0] = '\0';
18212 PrintExpression(exp, expString);
18213 strcat(argument, expString);
18214 FreeExpression(exp);
18215 break;
18216 }
18217 case 1:
18218 {
18219 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18220 break;
18221 }
18222 case 0:
18223 {
18224 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18225 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18226 break;
18227 }
18228 }
18229 if(argument[0])
18230 {
18231 if(paramCount)
18232 strcat(templateString, ", ");
18233 if(lastParam != p - 1)
18234 {
18235 strcat(templateString, param->name);
18236 strcat(templateString, " = ");
18237 }
18238 strcat(templateString, argument);
18239 paramCount++;
18240 lastParam = p;
18241 }
18242 }
18243 p++;
18244 }
18245 }
18246 {
18247 int len = strlen(templateString);
18248
18249 if(templateString[len - 1] == '>')
18250 templateString[len++] = ' ';
18251 templateString[len++] = '>';
18252 templateString[len++] = '\0';
18253 }
18254 FreeType(exp->expType);
18255 {
18256 struct Context * context = SetupTemplatesContext(tClass);
18257
18258 exp->expType = ProcessTypeString(templateString, 0);
18259 FinishTemplatesContext(context);
18260 }
18261 }
18262 }
18263 }
18264 }
18265 else
18266 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)");
18267 }
18268 else if(type && (type->kind == 9 || type->kind == 10))
18269 {
18270 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18271
18272 if(memberType)
18273 {
18274 exp->expType = memberType;
18275 if(memberType)
18276 memberType->refCount++;
18277 }
18278 }
18279 else
18280 {
18281 char expString[10240];
18282
18283 expString[0] = '\0';
18284 if(inCompiler)
18285 {
18286 PrintExpression(exp, expString);
18287 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18288 }
18289 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18290 }
18291 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18292 {
18293 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18294 {
18295 struct Identifier * id = exp->__anon1.member.member;
18296 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));
18297
18298 if(_class)
18299 {
18300 FreeType(exp->expType);
18301 exp->expType = ReplaceThisClassType(_class);
18302 }
18303 }
18304 }
18305 yylloc = oldyylloc;
18306 break;
18307 }
18308 case 9:
18309 {
18310 struct Type * destType = exp->destType;
18311
18312 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18313 {
18314 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18315 }
18316 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18317 exp->type = 8;
18318 if(destType)
18319 destType->count++;
18320 ProcessExpressionType(exp);
18321 if(destType)
18322 destType->count--;
18323 break;
18324 }
18325 case 15:
18326 {
18327 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18328
18329 if(classSym && classSym->__anon1.registered)
18330 {
18331 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18332 {
18333 char name[1024];
18334 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18335
18336 name[0] = '\0';
18337 DeclareStruct(curExternal, classSym->string, 0, 1);
18338 FreeSpecifier(exp->__anon1._class);
18339 FullClassNameCat(name, classSym->string, 0);
18340 if(b->offset == 0)
18341 {
18342 exp->type = 10;
18343 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18344 }
18345 else
18346 {
18347 struct Expression * e;
18348
18349 exp->type = 4;
18350 if(b->structSize == b->offset)
18351 exp->__anon1.op.exp1 = MkExpConstant("0");
18352 else
18353 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18354 exp->__anon1.op.op = '+';
18355 e = exp;
18356 while(b->offset != 0)
18357 {
18358 struct Symbol * sym;
18359 struct Expression * typeSize;
18360
18361 b = b->base;
18362 sym = FindClass(b->fullName);
18363 name[0] = '\0';
18364 DeclareStruct(curExternal, sym->string, 0, 1);
18365 FullClassNameCat(name, sym->string, 0);
18366 if(b->structSize == b->offset)
18367 typeSize = MkExpConstant("0");
18368 else
18369 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18370 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18371 e = e->__anon1.op.exp2;
18372 }
18373 }
18374 }
18375 else
18376 {
18377 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18378 {
18379 FreeSpecifier(exp->__anon1._class);
18380 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18381 exp->type = 2;
18382 }
18383 else
18384 {
18385 char className[1024];
18386
18387 strcpy(className, "__ecereClass_");
18388 FullClassNameCat(className, classSym->string, 1);
18389 DeclareClass(curExternal, classSym, className);
18390 FreeExpContents(exp);
18391 exp->type = 9;
18392 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18393 exp->__anon1.member.member = MkIdentifier("structSize");
18394 }
18395 }
18396 }
18397 exp->expType = __extension__ ({
18398 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18399
18400 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18401 });
18402 break;
18403 }
18404 case 10:
18405 {
18406 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
18407
18408 exp->expType = __extension__ ({
18409 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18410
18411 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18412 });
18413 exp->isConstant = 1;
18414 DeclareType(curExternal, type, 1, 0);
18415 FreeType(type);
18416 break;
18417 }
18418 case 11:
18419 {
18420 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18421
18422 type->count = 1;
18423 FreeType(exp->__anon1.cast.exp->destType);
18424 exp->__anon1.cast.exp->destType = type;
18425 type->refCount++;
18426 type->casted = 1;
18427 ProcessExpressionType(exp->__anon1.cast.exp);
18428 type->casted = 0;
18429 type->count = 0;
18430 exp->expType = type;
18431 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18432 {
18433 void * prev = exp->prev, * next = exp->next;
18434 struct Type * expType = exp->__anon1.cast.exp->destType;
18435 struct Expression * castExp = exp->__anon1.cast.exp;
18436 struct Type * destType = exp->destType;
18437
18438 if(expType)
18439 expType->refCount++;
18440 FreeType(exp->expType);
18441 FreeTypeName(exp->__anon1.cast.typeName);
18442 *exp = *castExp;
18443 FreeType(exp->expType);
18444 FreeType(exp->destType);
18445 exp->expType = expType;
18446 exp->destType = destType;
18447 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
18448 exp->prev = prev;
18449 exp->next = next;
18450 }
18451 else
18452 {
18453 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18454 }
18455 break;
18456 }
18457 case 33:
18458 {
18459 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18460
18461 exp->expType = type;
18462 break;
18463 }
18464 case 34:
18465 {
18466 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18467
18468 ProcessExpressionType(exp->__anon1.vaArg.exp);
18469 exp->expType = type;
18470 break;
18471 }
18472 case 12:
18473 {
18474 struct Expression * e;
18475 struct Type * t = exp->destType;
18476
18477 if(t && !exp->destType->casted)
18478 {
18479 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18480 CopyTypeInto(t, exp->destType);
18481 t->count = 0;
18482 }
18483 else if(t)
18484 t->refCount++;
18485 exp->isConstant = 1;
18486 FreeType(exp->__anon1.cond.cond->destType);
18487 exp->__anon1.cond.cond->destType = MkClassType("bool");
18488 exp->__anon1.cond.cond->destType->truth = 1;
18489 ProcessExpressionType(exp->__anon1.cond.cond);
18490 if(!exp->__anon1.cond.cond->isConstant)
18491 exp->isConstant = 0;
18492 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18493 {
18494 if(!e->next)
18495 {
18496 FreeType(e->destType);
18497 e->destType = t;
18498 if(e->destType)
18499 e->destType->refCount++;
18500 }
18501 ProcessExpressionType(e);
18502 if(!e->next)
18503 {
18504 exp->expType = e->expType;
18505 if(e->expType)
18506 e->expType->refCount++;
18507 }
18508 if(!e->isConstant)
18509 exp->isConstant = 0;
18510 }
18511 FreeType(exp->__anon1.cond.elseExp->destType);
18512 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18513 if(exp->__anon1.cond.elseExp->destType)
18514 exp->__anon1.cond.elseExp->destType->refCount++;
18515 ProcessExpressionType(exp->__anon1.cond.elseExp);
18516 if(!exp->__anon1.cond.elseExp->isConstant)
18517 exp->isConstant = 0;
18518 FreeType(t);
18519 break;
18520 }
18521 case 23:
18522 {
18523 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18524 {
18525 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18526
18527 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18528 {
18529 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18530 if(exp->destType)
18531 exp->destType->refCount++;
18532 }
18533 ProcessStatement(exp->__anon1.compound);
18534 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18535 if(exp->expType)
18536 exp->expType->refCount++;
18537 }
18538 break;
18539 }
18540 case 24:
18541 {
18542 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18543
18544 if(spec && spec->type == 1)
18545 {
18546 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18547 exp->expType->kind = 19;
18548 exp->byReference = 1;
18549 }
18550 else
18551 {
18552 exp->expType = MkClassType("ecere::com::Class");
18553 exp->byReference = 1;
18554 }
18555 break;
18556 }
18557 case 25:
18558 {
18559 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18560
18561 if(_class)
18562 {
18563 struct Identifier * id = exp->__anon1.classData.id;
18564 char structName[1024];
18565 struct Expression * classExp;
18566
18567 strcpy(structName, "__ecereClassData_");
18568 FullClassNameCat(structName, _class->fullName, 0);
18569 exp->type = 9;
18570 exp->__anon1.member.member = id;
18571 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18572 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18573 else
18574 classExp = MkExpIdentifier(MkIdentifier("class"));
18575 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"))))))));
18576 ProcessExpressionType(exp);
18577 return ;
18578 }
18579 break;
18580 }
18581 case 35:
18582 {
18583 struct Type * type = (((void *)0));
18584 const char * typeString = (((void *)0));
18585 char typeStringBuf[1024];
18586
18587 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))
18588 {
18589 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18590
18591 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18592 }
18593 else if(exp->__anon1.list)
18594 {
18595 struct Expression * e;
18596
18597 for(e = (*exp->__anon1.list).first; e; e = e->next)
18598 {
18599 ProcessExpressionType(e);
18600 if(e->expType)
18601 {
18602 if(!type)
18603 {
18604 type = e->expType;
18605 type->refCount++;
18606 }
18607 else
18608 {
18609 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18610 {
18611 FreeType(type);
18612 type = e->expType;
18613 e->expType = (((void *)0));
18614 e = (*exp->__anon1.list).first;
18615 ProcessExpressionType(e);
18616 if(e->expType)
18617 {
18618 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18619 {
18620 FreeType(e->expType);
18621 e->expType = (((void *)0));
18622 FreeType(type);
18623 type = (((void *)0));
18624 break;
18625 }
18626 }
18627 }
18628 }
18629 if(e->expType)
18630 {
18631 FreeType(e->expType);
18632 e->expType = (((void *)0));
18633 }
18634 }
18635 }
18636 if(type)
18637 {
18638 typeStringBuf[0] = '\0';
18639 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18640 typeString = typeStringBuf;
18641 FreeType(type);
18642 type = (((void *)0));
18643 }
18644 }
18645 if(typeString)
18646 {
18647 char templateString[1024];
18648 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18649 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18650 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18651 struct Expression * expExt;
18652 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18653
18654 sprintf(templateString, "Container<%s>", typeString);
18655 if(exp->__anon1.list)
18656 {
18657 struct Expression * e;
18658
18659 type = ProcessTypeString(typeString, 0);
18660 while((e = (*exp->__anon1.list).first))
18661 {
18662 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18663 e->destType = type;
18664 type->refCount++;
18665 ProcessExpressionType(e);
18666 ListAdd(initializers, MkInitializerAssignment(e));
18667 }
18668 FreeType(type);
18669 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18670 }
18671 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18672 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18673 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18674 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18675 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18676 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18677 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18678 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18679 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18680 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18681 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18682
18683 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18684 })));
18685 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18686 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18687 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18688 exp->expType = ProcessTypeString(templateString, 0);
18689 exp->type = 5;
18690 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18691 ProcessExpressionType(expExt);
18692 }
18693 else
18694 {
18695 exp->expType = ProcessTypeString("Container", 0);
18696 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18697 }
18698 break;
18699 }
18700 }
18701 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18702 {
18703 FreeType(exp->expType);
18704 exp->expType = ReplaceThisClassType(thisClass);
18705 }
18706 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)
18707 {
18708 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
18709
18710 if(symbol)
18711 {
18712 if(exp->expType->kind != 15)
18713 {
18714 struct Type * member;
18715 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
18716
18717 FreeType(exp->expType);
18718 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18719 exp->expType->kind = symbol->type->kind;
18720 exp->expType->refCount++;
18721 exp->expType->__anon1.__anon1.enumName = enumName;
18722 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
18723 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18724 member->refCount++;
18725 }
18726 else
18727 {
18728 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
18729
18730 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18731 {
18732 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);
18733
18734 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
18735 }
18736 }
18737 }
18738 }
18739 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)))
18740 {
18741 exp->byReference = 1;
18742 }
18743 yylloc = exp->loc;
18744 if(exp->destType && (exp->destType->kind == 18))
18745 ;
18746 else if(exp->destType && !exp->destType->keepCast)
18747 {
18748 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
18749 exp->needTemplateCast = 1;
18750 if(exp->destType->kind == 0)
18751 ;
18752 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
18753 {
18754 unsigned int invalidCast = 0;
18755
18756 if(inCompiler && exp->destType->count && exp->expType)
18757 {
18758 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
18759 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
18760
18761 if(c1 && c1->type != 1)
18762 c1 = (((void *)0));
18763 if(c2 && c2->type != 1)
18764 c2 = (((void *)0));
18765 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
18766 invalidCast = 1;
18767 }
18768 if(!exp->destType->count || unresolved || invalidCast)
18769 {
18770 if(!exp->expType)
18771 {
18772 yylloc = exp->loc;
18773 if(exp->destType->kind != 14)
18774 {
18775 char type2[1024];
18776
18777 type2[0] = '\0';
18778 if(inCompiler)
18779 {
18780 char expString[10240];
18781
18782 expString[0] = '\0';
18783 PrintType(exp->destType, type2, 0, 1);
18784 if(inCompiler)
18785 {
18786 PrintExpression(exp, expString);
18787 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18788 }
18789 if(unresolved)
18790 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
18791 else if(exp->type != 16)
18792 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
18793 }
18794 }
18795 else
18796 {
18797 char expString[10240];
18798
18799 expString[0] = '\0';
18800 if(inCompiler)
18801 {
18802 PrintExpression(exp, expString);
18803 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18804 }
18805 if(unresolved)
18806 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
18807 else if(exp->type != 16)
18808 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18809 }
18810 }
18811 else
18812 {
18813 char type1[1024];
18814 char type2[1024];
18815
18816 type1[0] = '\0';
18817 type2[0] = '\0';
18818 if(inCompiler)
18819 {
18820 PrintType(exp->expType, type1, 0, 1);
18821 PrintType(exp->destType, type2, 0, 1);
18822 }
18823 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)))
18824 ;
18825 else
18826 {
18827 struct Expression * nbExp = GetNonBracketsExp(exp);
18828 unsigned int skipWarning = 0;
18829 int kind = exp->destType->kind;
18830
18831 if(nbExp->type == 12 && !nbExp->destType->casted && nbExp->destType->kind == exp->destType->kind)
18832 skipWarning = 1;
18833 if((kind == 1 || kind == 2) && exp->destType->isSigned == exp->expType->signedBeforePromotion && nbExp->type == 4 && nbExp->__anon1.op.exp1 && nbExp->__anon1.op.exp2)
18834 {
18835 int op = nbExp->__anon1.op.op;
18836 struct Expression * nbExp1, * nbExp2;
18837 int from;
18838
18839 switch(op)
18840 {
18841 case '%':
18842 case '/':
18843 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18844 from = nbExp1->expType->promotedFrom;
18845 if(from == 1 || (kind == 2 && from == 2))
18846 skipWarning = 1;
18847 break;
18848 case LEFT_OP:
18849 case RIGHT_OP:
18850 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18851 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18852 from = nbExp1->expType->promotedFrom;
18853 if(op == RIGHT_OP && (from == 1 || (kind == 2 && from == 2)))
18854 skipWarning = 1;
18855 else if(nbExp2->isConstant && nbExp2->type == 2 && (nbExp->__anon1.op.op == RIGHT_OP || nbExp1->expType->bitMemberSize))
18856 {
18857 int n = strtol(nbExp2->__anon1.__anon1.constant, (((void *)0)), 0);
18858 int s = from == 1 ? 8 : 16;
18859
18860 if(nbExp1->expType->bitMemberSize && nbExp1->expType->bitMemberSize < s)
18861 s = nbExp1->expType->bitMemberSize;
18862 if(nbExp->__anon1.op.op == RIGHT_OP)
18863 s -= n;
18864 else
18865 s += n;
18866 if(s <= (kind == 1 ? 8 : 16))
18867 skipWarning = 1;
18868 }
18869 break;
18870 case '-':
18871 if(!exp->destType->isSigned)
18872 {
18873 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18874 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18875 from = nbExp2->expType->promotedFrom;
18876 if((from == 1 || from == 2) && nbExp1->isConstant && nbExp1->type == 2)
18877 {
18878 int n = strtol(nbExp1->__anon1.__anon1.constant, (((void *)0)), 0);
18879
18880 if(n == (from == 1 ? 255 : 65535))
18881 skipWarning = 1;
18882 }
18883 }
18884 break;
18885 case '|':
18886 {
18887 int kind1, kind2;
18888
18889 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18890 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18891 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
18892 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
18893 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)))
18894 skipWarning = 1;
18895 break;
18896 }
18897 case '&':
18898 {
18899 int kind1, kind2;
18900
18901 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18902 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18903 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
18904 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
18905 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)))
18906 skipWarning = 1;
18907 break;
18908 }
18909 }
18910 }
18911 if(!skipWarning)
18912 {
18913 char expString[10240];
18914
18915 expString[0] = '\0';
18916 if(inCompiler)
18917 {
18918 PrintExpression(exp, expString);
18919 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18920 }
18921 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")))
18922 {
18923 if(invalidCast)
18924 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18925 else
18926 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18927 }
18928 }
18929 if(!inCompiler)
18930 {
18931 FreeType(exp->expType);
18932 exp->destType->refCount++;
18933 exp->expType = exp->destType;
18934 }
18935 }
18936 }
18937 }
18938 }
18939 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))
18940 {
18941 struct Expression * nbExp = GetNonBracketsExp(exp);
18942
18943 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
18944 {
18945 struct Expression * e = MoveExpContents(exp);
18946
18947 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
18948 exp->type = 11;
18949 exp->__anon1.cast.exp->destType = exp->destType;
18950 if(exp->destType)
18951 exp->destType->refCount++;
18952 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
18953 }
18954 }
18955 }
18956 else if(unresolved)
18957 {
18958 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
18959 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);
18960 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
18961 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
18962 }
18963 else if(!exp->expType && exp->type != 16)
18964 {
18965 char expString[10240];
18966
18967 expString[0] = '\0';
18968 if(inCompiler)
18969 {
18970 PrintExpression(exp, expString);
18971 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18972 }
18973 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18974 }
18975 if(inCompiler)
18976 ApplyAnyObjectLogic(exp);
18977 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)))
18978 {
18979 exp->byReference = 1;
18980 }
18981 yylloc = oldyylloc;
18982 }
18983
18984 static void ProcessFunction(struct FunctionDefinition * function)
18985 {
18986 struct Identifier * id = GetDeclId(function->declarator);
18987 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18988 struct Type * type = symbol ? symbol->type : (((void *)0));
18989 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18990 struct Context * oldTopContext = topContext;
18991
18992 yylloc = function->loc;
18993 if(type && type->__anon1.__anon2.thisClass)
18994 {
18995 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18996 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18997 char className[1024];
18998 char structName[1024];
18999 struct Declarator * funcDecl;
19000 struct Symbol * thisSymbol;
19001 unsigned int typedObject = 0;
19002
19003 if(_class && !_class->base)
19004 {
19005 _class = currentClass;
19006 if(_class && !_class->symbol)
19007 _class->symbol = FindClass(_class->fullName);
19008 classSym = _class ? _class->symbol : (((void *)0));
19009 typedObject = 1;
19010 }
19011 thisClass = _class;
19012 if(inCompiler && _class)
19013 {
19014 if(type->kind == 11)
19015 {
19016 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
19017 {
19018 struct Type * param = symbol->type->__anon1.__anon2.params.first;
19019
19020 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
19021 FreeType(param);
19022 }
19023 if(type->classObjectType != 1)
19024 {
19025 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
19026 symbol->type->__anon1.__anon2.staticMethod = 1;
19027 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
19028 symbol->type->extraParam = 0;
19029 }
19030 }
19031 strcpy(className, "__ecereClass_");
19032 FullClassNameCat(className, _class->fullName, 1);
19033 structName[0] = 0;
19034 FullClassNameCat(structName, _class->fullName, 0);
19035 funcDecl = GetFuncDecl(function->declarator);
19036 if(funcDecl)
19037 {
19038 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19039 {
19040 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19041
19042 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19043 {
19044 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19045 FreeTypeName(param);
19046 }
19047 }
19048 if(!function->propertyNoThis)
19049 {
19050 struct TypeName * thisParam = (((void *)0));
19051
19052 if(type->classObjectType != 1)
19053 {
19054 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19055 if(!funcDecl->__anon1.function.parameters)
19056 funcDecl->__anon1.function.parameters = MkList();
19057 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19058 }
19059 if(typedObject)
19060 {
19061 if(type->classObjectType != 1)
19062 {
19063 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
19064 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
19065 }
19066 thisParam = __extension__ ({
19067 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
19068
19069 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
19070 });
19071 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
19072 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19073 }
19074 }
19075 }
19076 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19077 {
19078 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19079
19080 funcDecl = GetFuncDecl(initDecl->declarator);
19081 if(funcDecl)
19082 {
19083 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19084 {
19085 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19086
19087 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19088 {
19089 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19090 FreeTypeName(param);
19091 }
19092 }
19093 if(type->classObjectType != 1)
19094 {
19095 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
19096 {
19097 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19098
19099 if(!funcDecl->__anon1.function.parameters)
19100 funcDecl->__anon1.function.parameters = MkList();
19101 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19102 }
19103 }
19104 }
19105 }
19106 }
19107 if(function->body)
19108 {
19109 if(type->classObjectType != 1)
19110 {
19111 thisSymbol = __extension__ ({
19112 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
19113
19114 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
19115 });
19116 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19117 if(typedObject && thisSymbol->type)
19118 {
19119 thisSymbol->type->classObjectType = 2;
19120 thisSymbol->type->byReference = type->byReference;
19121 thisSymbol->type->typedByReference = type->byReference;
19122 }
19123 }
19124 }
19125 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
19126 {
19127 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
19128
19129 {
19130 struct __ecereNameSpace__ecere__com__Class * base;
19131
19132 for(base = _class; base && base->type != 1000; base = base->next)
19133 {
19134 for(member = base->membersAndProperties.first; member; member = member->next)
19135 if(!member->isProperty)
19136 break;
19137 if(member)
19138 break;
19139 }
19140 }
19141 for(member = _class->membersAndProperties.first; member; member = member->next)
19142 if(!member->isProperty)
19143 break;
19144 if(member)
19145 {
19146 char pointerName[1024];
19147 struct Declaration * decl;
19148 struct Initializer * initializer;
19149 struct Expression * exp, * bytePtr;
19150
19151 strcpy(pointerName, "__ecerePointer_");
19152 FullClassNameCat(pointerName, _class->fullName, 0);
19153 {
19154 char className[1024];
19155
19156 strcpy(className, "__ecereClass_");
19157 FullClassNameCat(className, classSym->string, 1);
19158 DeclareClass(curExternal, classSym, className);
19159 }
19160 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
19161 if(_class->fixed)
19162 {
19163 struct Expression * e;
19164
19165 if(_class->offset && _class->offset == _class->base->structSize)
19166 {
19167 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
19168 ProcessExpressionType(e);
19169 }
19170 else
19171 {
19172 char string[256];
19173
19174 sprintf(string, "%d", _class->offset);
19175 e = MkExpConstant(string);
19176 }
19177 exp = QBrackets(MkExpOp(bytePtr, '+', e));
19178 }
19179 else
19180 {
19181 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
19182 }
19183 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
19184 exp->expType = __extension__ ({
19185 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19186
19187 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
19188 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19189
19190 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19191 }), __ecereInstance2;
19192 });
19193 if(function->body)
19194 {
19195 yylloc = function->body->loc;
19196 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19197 {
19198 struct Context * prevContext = curContext;
19199 struct __ecereNameSpace__ecere__sys__OldList * list;
19200
19201 curContext = function->body->__anon1.compound.context;
19202 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19203 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19204 curContext = prevContext;
19205 }
19206 decl->symbol = (((void *)0));
19207 if(!function->body->__anon1.compound.declarations)
19208 function->body->__anon1.compound.declarations = MkList();
19209 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19210 }
19211 }
19212 }
19213 }
19214 else
19215 thisClass = (((void *)0));
19216 if(id)
19217 {
19218 FreeSpecifier(id->_class);
19219 id->_class = (((void *)0));
19220 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19221 {
19222 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19223
19224 id = GetDeclId(initDecl->declarator);
19225 FreeSpecifier(id->_class);
19226 id->_class = (((void *)0));
19227 }
19228 }
19229 if(function->body)
19230 topContext = function->body->__anon1.compound.context;
19231 {
19232 struct FunctionDefinition * oldFunction = curFunction;
19233
19234 curFunction = function;
19235 if(function->body)
19236 ProcessStatement(function->body);
19237 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19238 {
19239 struct Statement * prevCompound = curCompound;
19240 struct Context * prevContext = curContext;
19241 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19242
19243 if(!function->body->__anon1.compound.statements)
19244 function->body->__anon1.compound.statements = MkList();
19245 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19246 curCompound = function->body;
19247 curContext = function->body->__anon1.compound.context;
19248 ProcessStatement(fireWatchers);
19249 curContext = prevContext;
19250 curCompound = prevCompound;
19251 }
19252 curFunction = oldFunction;
19253 }
19254 if(function->declarator)
19255 {
19256 ProcessDeclarator(function->declarator, 1);
19257 }
19258 topContext = oldTopContext;
19259 thisClass = oldThisClass;
19260 }
19261
19262 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19263 {
19264 struct ClassDef * def;
19265 struct External * external = curExternal;
19266 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19267
19268 for(def = definitions->first; def; def = def->next)
19269 {
19270 if(def->type == 0)
19271 {
19272 if(def->__anon1.function->declarator)
19273 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19274 else
19275 curExternal = external;
19276 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19277 }
19278 else if(def->type == 2)
19279 {
19280 if(def->__anon1.decl->type == 2)
19281 {
19282 thisClass = regClass;
19283 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19284 thisClass = (((void *)0));
19285 }
19286 else
19287 {
19288 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19289
19290 if(regClass)
19291 thisClass = regClass;
19292 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19293 thisClass = backThisClass;
19294 }
19295 }
19296 else if(def->type == 1 && def->__anon1.defProperties)
19297 {
19298 struct MemberInit * defProperty;
19299 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);
19300
19301 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19302 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19303 {
19304 thisClass = regClass;
19305 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19306 thisClass = (((void *)0));
19307 }
19308 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19309 FreeSymbol(thisSymbol);
19310 }
19311 else if(def->type == 3 && def->__anon1.propertyDef)
19312 {
19313 struct PropertyDef * prop = def->__anon1.propertyDef;
19314
19315 thisClass = regClass;
19316 if(prop->setStmt)
19317 {
19318 if(regClass)
19319 {
19320 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19321
19322 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19323 }
19324 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19325 ProcessStatement(prop->setStmt);
19326 }
19327 if(prop->getStmt)
19328 {
19329 if(regClass)
19330 {
19331 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19332
19333 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19334 }
19335 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19336 ProcessStatement(prop->getStmt);
19337 }
19338 if(prop->issetStmt)
19339 {
19340 if(regClass)
19341 {
19342 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19343
19344 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19345 }
19346 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19347 ProcessStatement(prop->issetStmt);
19348 }
19349 thisClass = (((void *)0));
19350 }
19351 else if(def->type == 4 && def->__anon1.propertyWatch)
19352 {
19353 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19354
19355 thisClass = regClass;
19356 if(propertyWatch->compound)
19357 {
19358 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);
19359
19360 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19361 curExternal = (((void *)0));
19362 ProcessStatement(propertyWatch->compound);
19363 }
19364 thisClass = (((void *)0));
19365 }
19366 }
19367 }
19368
19369 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19370 {
19371 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19372
19373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19422 __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);
19423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19427 __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);
19428 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19429 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19430 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19431 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19432 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19433 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19434 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19442 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19443 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)
19444 __ecereClass_Conversion = class;
19445 __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);
19446 __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);
19447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19448 __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);
19449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19450 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19451 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19452 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19453 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19454 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19455 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19456 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19457 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19458 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19459 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19460 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19461 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19462 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19463 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19464 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19465 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19466 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19467 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19468 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19469 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19470 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19471 }
19472