e31aad5c188e39fc42eef7d96df7e5951cc5a47b
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #if defined(_WIN32)
39 #   if defined(__GNUC__) || defined(__TINYC__)
40 #      define ecere_stdcall __attribute__((__stdcall__))
41 #      define ecere_gcc_struct __attribute__((gcc_struct))
42 #   else
43 #      define ecere_stdcall __stdcall
44 #      define ecere_gcc_struct
45 #   endif
46 #else
47 #   define ecere_stdcall
48 #   define ecere_gcc_struct
49 #endif
50 #include <stdint.h>
51 #include <sys/types.h>
52 enum yytokentype
53 {
54 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372, WIDE_STRING_LITERAL = 373
55 };
56
57 extern int returnCode;
58
59 extern unsigned int yydebug;
60
61 extern unsigned int echoOn;
62
63 void resetScanner();
64
65 int propWatcherID;
66
67 int expression_yyparse();
68
69 static char * thisNameSpace;
70
71 unsigned int thisClassParams = 1;
72
73 unsigned int internalValueCounter;
74
75 extern unsigned int outputLineNumbers;
76
77 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isInf;
78
79 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_signBit;
80
81 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isNan;
82
83 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isInf;
84
85 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_signBit;
86
87 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isNan;
88
89 extern int targetBits;
90
91 extern unsigned int inCompiler;
92
93 extern unsigned int inPreCompiler;
94
95 extern unsigned int inDebugger;
96
97 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
98
99 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
100
101 int UnescapeString(char * d, char * s, int len)
102 {
103 int j = 0, k = 0;
104 char ch;
105
106 while(j < len && (ch = s[j]))
107 {
108 switch(ch)
109 {
110 case '\\':
111 switch((ch = s[++j]))
112 {
113 case 'n':
114 d[k] = '\n';
115 break;
116 case 't':
117 d[k] = '\t';
118 break;
119 case 'a':
120 d[k] = '\a';
121 break;
122 case 'b':
123 d[k] = '\b';
124 break;
125 case 'f':
126 d[k] = '\f';
127 break;
128 case 'r':
129 d[k] = '\r';
130 break;
131 case 'v':
132 d[k] = '\v';
133 break;
134 case '\\':
135 d[k] = '\\';
136 break;
137 case '\"':
138 d[k] = '\"';
139 break;
140 case '\'':
141 d[k] = '\'';
142 break;
143 default:
144 d[k] = '\\';
145 d[k] = ch;
146 }
147 break;
148 default:
149 d[k] = ch;
150 }
151 j++, k++;
152 }
153 d[k] = '\0';
154 return k;
155 }
156
157 char * OffsetEscapedString(char * s, int len, int offset)
158 {
159 char ch;
160 int j = 0, k = 0;
161
162 while(j < len && k < offset && (ch = s[j]))
163 {
164 if(ch == '\\')
165 ++j;
166 j++, k++;
167 }
168 return (k == offset) ? s + j : (((void *)0));
169 }
170
171 extern int __ecereVMethodID_class_OnGetString;
172
173 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
174
175 extern unsigned int parseError;
176
177 static int definedExpStackPos;
178
179 static void * definedExpStack[512];
180
181 extern const char *  sourceFile;
182
183 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
184
185 extern unsigned int memoryGuard;
186
187 struct __ecereNameSpace__ecere__sys__OldList
188 {
189 void *  first;
190 void *  last;
191 int count;
192 unsigned int offset;
193 unsigned int circ;
194 } ecere_gcc_struct;
195
196 struct __ecereNameSpace__ecere__com__DataValue
197 {
198 union
199 {
200 char c;
201 unsigned char uc;
202 short s;
203 unsigned short us;
204 int i;
205 unsigned int ui;
206 void *  p;
207 float f;
208 double d;
209 long long i64;
210 uint64 ui64;
211 } ecere_gcc_struct __anon1;
212 } ecere_gcc_struct;
213
214 struct __ecereNameSpace__ecere__com__SerialBuffer
215 {
216 unsigned char *  _buffer;
217 unsigned int count;
218 unsigned int _size;
219 unsigned int pos;
220 } ecere_gcc_struct;
221
222 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
223
224 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
225
226 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
227
228 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
229
230 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
231
232 struct Pointer;
233
234 struct Attrib;
235
236 struct Attribute;
237
238 struct TemplateArgument;
239
240 struct DBTableEntry;
241
242 struct DBIndexItem;
243
244 struct DBTableDef;
245
246 struct CodePosition
247 {
248 int line;
249 int charPos;
250 int pos;
251 int included;
252 } ecere_gcc_struct;
253
254 extern size_t strlen(const char * );
255
256 extern int strcmp(const char * , const char * );
257
258 extern int sprintf(char * , const char * , ...);
259
260 extern char *  strcat(char * , const char * );
261
262 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
263
264 extern int isprint(int c);
265
266 extern char *  strcpy(char * , const char * );
267
268 extern void Compiler_Error(const char *  format, ...);
269
270 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
271
272 struct __ecereNameSpace__ecere__com__LinkList
273 {
274 void * first;
275 void * last;
276 int count;
277 } ecere_gcc_struct;
278
279 extern char *  strchr(const char * , int);
280
281 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
282
283 extern void *  memcpy(void * , const void * , size_t size);
284
285 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
286
287 extern void Compiler_Warning(const char *  format, ...);
288
289 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
290
291 extern long long strtoll(const char *  nptr, char * *  endptr, int base);
292
293 extern uint64 strtoull(const char *  nptr, char * *  endptr, int base);
294
295 extern int strtol(const char * , char * * , int base);
296
297 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
298
299 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
300
301 extern double strtod(const char * , char * * );
302
303 extern int strncmp(const char * , const char * , size_t n);
304
305 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
306
307 extern char *  QMkString(const char *  source);
308
309 extern char *  strncpy(char * , const char * , size_t n);
310
311 extern int printf(const char * , ...);
312
313 extern char *  strstr(const char * , const char * );
314
315 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
316
317 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
318
319 extern int (* __ecereProp_float_Get_signBit)(float this);
320
321 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
322
323 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
324
325 extern int (* __ecereProp_double_Get_signBit)(double this);
326
327 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
328
329 extern float (* __ecereMethod_float_inf)(void);
330
331 extern float (* __ecereMethod_float_nan)(void);
332
333 extern double (* __ecereMethod_double_inf)(void);
334
335 extern double (* __ecereMethod_double_nan)(void);
336
337 int __ecereVMethodID_class_OnGetString;
338
339 void SetYydebug(unsigned int b)
340 {
341 yydebug = b;
342 }
343
344 unsigned int GetParseError()
345 {
346 return parseError;
347 }
348
349 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
350
351 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
352
353 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
354
355 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
356
357 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
358
359 struct __ecereNameSpace__ecere__com__EnumClassData
360 {
361 struct __ecereNameSpace__ecere__sys__OldList values;
362 long long largest;
363 } ecere_gcc_struct;
364
365 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
366
367 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
368
369 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
370
371 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
372
373 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
374
375 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
376
377 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
378
379 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
380
381 struct Location
382 {
383 struct CodePosition start;
384 struct CodePosition end;
385 } ecere_gcc_struct;
386
387 void ReadString(char * output, char * string)
388 {
389 int len = strlen(string);
390 int c, d = 0;
391 unsigned int quoted = 0, escaped = 0;
392
393 for(c = 0; c < len; c++)
394 {
395 char ch = string[c];
396
397 if(escaped)
398 {
399 switch(ch)
400 {
401 case 'n':
402 output[d] = '\n';
403 break;
404 case 't':
405 output[d] = '\t';
406 break;
407 case 'a':
408 output[d] = '\a';
409 break;
410 case 'b':
411 output[d] = '\b';
412 break;
413 case 'f':
414 output[d] = '\f';
415 break;
416 case 'r':
417 output[d] = '\r';
418 break;
419 case 'v':
420 output[d] = '\v';
421 break;
422 case '\\':
423 output[d] = '\\';
424 break;
425 case '\"':
426 output[d] = '\"';
427 break;
428 case '\'':
429 output[d] = '\'';
430 break;
431 default:
432 output[d] = ch;
433 }
434 d++;
435 escaped = 0;
436 }
437 else
438 {
439 if(ch == '\"')
440 quoted ^= 1;
441 else if(quoted)
442 {
443 if(ch == '\\')
444 escaped = 1;
445 else
446 output[d++] = ch;
447 }
448 }
449 }
450 output[d] = '\0';
451 }
452
453 char * PrintInt(long long result)
454 {
455 char temp[100];
456
457 if(result > (((int)0x7fffffff)))
458 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
459 else
460 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
461 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
462 strcat(temp, "LL");
463 return __ecereNameSpace__ecere__sys__CopyString(temp);
464 }
465
466 char * PrintUInt(uint64 result)
467 {
468 char temp[100];
469
470 if(result > (0xffffffff))
471 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
472 else if(result > (((int)0x7fffffff)))
473 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
474 else
475 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
476 return __ecereNameSpace__ecere__sys__CopyString(temp);
477 }
478
479 char * PrintInt64(long long result)
480 {
481 char temp[100];
482
483 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
484 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
485 else
486 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
487 return __ecereNameSpace__ecere__sys__CopyString(temp);
488 }
489
490 char * PrintUInt64(uint64 result)
491 {
492 char temp[100];
493
494 if(result > (0xffffffff))
495 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
496 else if(result > (((int)0x7fffffff)))
497 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
498 else
499 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
500 return __ecereNameSpace__ecere__sys__CopyString(temp);
501 }
502
503 char * PrintHexUInt(uint64 result)
504 {
505 char temp[100];
506
507 if(result > (0xffffffff))
508 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
509 else
510 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
511 if(result > (0xffffffff))
512 strcat(temp, "LL");
513 return __ecereNameSpace__ecere__sys__CopyString(temp);
514 }
515
516 char * PrintHexUInt64(uint64 result)
517 {
518 char temp[100];
519
520 if(result > (0xffffffff))
521 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
522 else
523 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
524 return __ecereNameSpace__ecere__sys__CopyString(temp);
525 }
526
527 char * PrintShort(short result)
528 {
529 char temp[100];
530
531 sprintf(temp, "%d", (unsigned short)result);
532 return __ecereNameSpace__ecere__sys__CopyString(temp);
533 }
534
535 char * PrintUShort(unsigned short result)
536 {
537 char temp[100];
538
539 if(result > 32767)
540 sprintf(temp, "0x%X", (int)result);
541 else
542 sprintf(temp, "%d", (int)result);
543 return __ecereNameSpace__ecere__sys__CopyString(temp);
544 }
545
546 char * PrintUChar(unsigned char result)
547 {
548 char temp[100];
549
550 sprintf(temp, "0x%X", result);
551 return __ecereNameSpace__ecere__sys__CopyString(temp);
552 }
553
554 char * PrintChar(char result)
555 {
556 char temp[100];
557
558 if(result > 0 && isprint(result))
559 sprintf(temp, "'%c'", result);
560 else if(result < 0)
561 sprintf(temp, "%d", (int)result);
562 else
563 sprintf(temp, "0x%X", (unsigned char)result);
564 return __ecereNameSpace__ecere__sys__CopyString(temp);
565 }
566
567 char * PrintFloat(float result)
568 {
569 char temp[350];
570
571 if(__ecereProp_float_Get_isInf(result))
572 {
573 if(__ecereProp_float_Get_signBit(result))
574 strcpy(temp, "-inf");
575 else
576 strcpy(temp, "inf");
577 }
578 else if(__ecereProp_float_Get_isNan(result))
579 {
580 if(__ecereProp_float_Get_signBit(result))
581 strcpy(temp, "-nan");
582 else
583 strcpy(temp, "nan");
584 }
585 else
586 sprintf(temp, "%.16ff", result);
587 return __ecereNameSpace__ecere__sys__CopyString(temp);
588 }
589
590 char * PrintDouble(double result)
591 {
592 char temp[350];
593
594 if(__ecereProp_double_Get_isInf(result))
595 {
596 if(__ecereProp_double_Get_signBit(result))
597 strcpy(temp, "-inf");
598 else
599 strcpy(temp, "inf");
600 }
601 else if(__ecereProp_double_Get_isNan(result))
602 {
603 if(__ecereProp_double_Get_signBit(result))
604 strcpy(temp, "-nan");
605 else
606 strcpy(temp, "nan");
607 }
608 else
609 sprintf(temp, "%.16f", result);
610 return __ecereNameSpace__ecere__sys__CopyString(temp);
611 }
612
613 extern struct Location yylloc;
614
615 struct ExtDecl
616 {
617 struct Location loc;
618 int type;
619 union
620 {
621 char * s;
622 struct Attrib * attr;
623 } ecere_gcc_struct __anon1;
624 } ecere_gcc_struct;
625
626 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
627
628 struct Expression;
629
630 extern struct Expression * parsedExpression;
631
632 extern struct Expression * QMkExpId(const char *  id);
633
634 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
635
636 void ComputeExpression(struct Expression * exp);
637
638 extern struct Expression * MkExpConstant(const char *  string);
639
640 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
641
642 extern void FreeExpression(struct Expression * exp);
643
644 extern void FreeExpContents(struct Expression * exp);
645
646 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
647
648 extern struct Expression * CopyExpression(struct Expression * exp);
649
650 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
651
652 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
653
654 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
655
656 extern struct Expression * MoveExpContents(struct Expression * exp);
657
658 extern struct Expression * QBrackets(struct Expression * exp);
659
660 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
661
662 struct Statement;
663
664 static struct Statement * curCompound;
665
666 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
667
668 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
669
670 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
671
672 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
673
674 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
675
676 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
677
678 struct External;
679
680 struct External * curExternal, * afterExternal;
681
682 extern void FreeExternal(struct External * external);
683
684 struct Type;
685
686 static struct Type * curSwitchType;
687
688 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
689
690 extern void FreeType(struct Type * type);
691
692 extern struct Type * MkClassType(const char *  name);
693
694 extern void CopyTypeInto(struct Type * type, struct Type * src);
695
696 struct __ecereNameSpace__ecere__com__Class;
697
698 struct __ecereNameSpace__ecere__com__Instance
699 {
700 void * *  _vTbl;
701 struct __ecereNameSpace__ecere__com__Class * _class;
702 int _refCount;
703 } ecere_gcc_struct;
704
705 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
706
707 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
708
709 static struct __ecereNameSpace__ecere__com__Class * currentClass;
710
711 struct __ecereNameSpace__ecere__com__Class * thisClass;
712
713 struct __ecereNameSpace__ecere__com__Class * containerClass;
714
715 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
716
717 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
718
719 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
720
721 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
722
723 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
724
725 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
726
727 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
728
729 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
730
731 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
732
733 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
734
735 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
736
737 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
738 {
739 thisClass = c;
740 }
741
742 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
743 {
744 return thisClass;
745 }
746
747 struct Context;
748
749 extern struct Context * curContext;
750
751 extern struct Context * topContext;
752
753 extern struct Context * PushContext(void);
754
755 extern void PopContext(struct Context * ctx);
756
757 extern void FreeContext(struct Context * context);
758
759 extern struct Context * globalContext;
760
761 struct ModuleImport;
762
763 extern struct ModuleImport * mainModule;
764
765 struct ModuleImport
766 {
767 struct ModuleImport * prev;
768 struct ModuleImport * next;
769 char *  name;
770 struct __ecereNameSpace__ecere__sys__OldList classes;
771 struct __ecereNameSpace__ecere__sys__OldList functions;
772 int importType;
773 int importAccess;
774 } ecere_gcc_struct;
775
776 struct __ecereNameSpace__ecere__com__NameSpace;
777
778 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
779
780 struct FunctionDefinition;
781
782 static struct FunctionDefinition * curFunction;
783
784 struct __ecereNameSpace__ecere__sys__BTNode;
785
786 struct __ecereNameSpace__ecere__sys__BTNode
787 {
788 uintptr_t key;
789 struct __ecereNameSpace__ecere__sys__BTNode * parent;
790 struct __ecereNameSpace__ecere__sys__BTNode * left;
791 struct __ecereNameSpace__ecere__sys__BTNode * right;
792 int depth;
793 } ecere_gcc_struct;
794
795 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
796
797 struct __ecereNameSpace__ecere__com__Property;
798
799 struct __ecereNameSpace__ecere__com__Property
800 {
801 struct __ecereNameSpace__ecere__com__Property * prev;
802 struct __ecereNameSpace__ecere__com__Property * next;
803 const char *  name;
804 unsigned int isProperty;
805 int memberAccess;
806 int id;
807 struct __ecereNameSpace__ecere__com__Class * _class;
808 const char *  dataTypeString;
809 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
810 struct Type * dataType;
811 void (*  Set)(void * , int);
812 int (*  Get)(void * );
813 unsigned int (*  IsSet)(void * );
814 void *  data;
815 void *  symbol;
816 int vid;
817 unsigned int conversion;
818 unsigned int watcherOffset;
819 const char *  category;
820 unsigned int compiled;
821 unsigned int selfWatchable;
822 unsigned int isWatchable;
823 } ecere_gcc_struct;
824
825 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
826
827 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
828
829 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
830
831 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
832
833 struct Identifier;
834
835 extern void FreeIdentifier(struct Identifier * id);
836
837 extern struct Identifier * MkIdentifier(const char *  string);
838
839 extern struct Expression * MkExpIdentifier(struct Identifier * id);
840
841 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
842
843 extern struct Identifier * CopyIdentifier(struct Identifier * id);
844
845 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
846
847 struct __ecereNameSpace__ecere__sys__OldLink;
848
849 struct __ecereNameSpace__ecere__sys__OldLink
850 {
851 struct __ecereNameSpace__ecere__sys__OldLink * prev;
852 struct __ecereNameSpace__ecere__sys__OldLink * next;
853 void *  data;
854 } ecere_gcc_struct;
855
856 struct Declaration;
857
858 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
859
860 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
861
862 struct Specifier;
863
864 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
865
866 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
867
868 extern struct Specifier * MkSpecifier(int specifier);
869
870 extern struct Specifier * MkSpecifierName(const char *  name);
871
872 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
873
874 extern void FreeSpecifier(struct Specifier * spec);
875
876 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
877
878 struct Statement
879 {
880 struct Statement * prev;
881 struct Statement * next;
882 struct Location loc;
883 int type;
884 union
885 {
886 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
887 struct
888 {
889 struct Identifier * id;
890 struct Statement * stmt;
891 } ecere_gcc_struct labeled;
892 struct
893 {
894 struct Expression * exp;
895 struct Statement * stmt;
896 } ecere_gcc_struct caseStmt;
897 struct
898 {
899 struct __ecereNameSpace__ecere__sys__OldList * declarations;
900 struct __ecereNameSpace__ecere__sys__OldList * statements;
901 struct Context * context;
902 unsigned int isSwitch;
903 } ecere_gcc_struct compound;
904 struct
905 {
906 struct __ecereNameSpace__ecere__sys__OldList * exp;
907 struct Statement * stmt;
908 struct Statement * elseStmt;
909 } ecere_gcc_struct ifStmt;
910 struct
911 {
912 struct __ecereNameSpace__ecere__sys__OldList * exp;
913 struct Statement * stmt;
914 } ecere_gcc_struct switchStmt;
915 struct
916 {
917 struct __ecereNameSpace__ecere__sys__OldList * exp;
918 struct Statement * stmt;
919 } ecere_gcc_struct whileStmt;
920 struct
921 {
922 struct __ecereNameSpace__ecere__sys__OldList * exp;
923 struct Statement * stmt;
924 } ecere_gcc_struct doWhile;
925 struct
926 {
927 struct Statement * init;
928 struct Statement * check;
929 struct __ecereNameSpace__ecere__sys__OldList * increment;
930 struct Statement * stmt;
931 } ecere_gcc_struct forStmt;
932 struct
933 {
934 struct Identifier * id;
935 } ecere_gcc_struct gotoStmt;
936 struct
937 {
938 struct Specifier * spec;
939 char * statements;
940 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
941 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
942 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
943 } ecere_gcc_struct asmStmt;
944 struct
945 {
946 struct Expression * watcher;
947 struct Expression * object;
948 struct __ecereNameSpace__ecere__sys__OldList * watches;
949 } ecere_gcc_struct _watch;
950 struct
951 {
952 struct Identifier * id;
953 struct __ecereNameSpace__ecere__sys__OldList * exp;
954 struct __ecereNameSpace__ecere__sys__OldList * filter;
955 struct Statement * stmt;
956 } ecere_gcc_struct forEachStmt;
957 struct Declaration * decl;
958 } ecere_gcc_struct __anon1;
959 } ecere_gcc_struct;
960
961 extern struct Specifier * CopySpecifier(struct Specifier * spec);
962
963 extern struct Expression * MkExpClassSize(struct Specifier * _class);
964
965 struct Symbol;
966
967 struct Identifier
968 {
969 struct Identifier * prev;
970 struct Identifier * next;
971 struct Location loc;
972 struct Symbol * classSym;
973 struct Specifier * _class;
974 char *  string;
975 struct Identifier * badID;
976 } ecere_gcc_struct;
977
978 extern struct Symbol * FindStruct(struct Context * ctx, const char *  name);
979
980 extern struct Symbol * FindClass(const char *  name);
981
982 extern void DeclareClass(struct External * neededFor, struct Symbol * classSym, const char *  className);
983
984 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
985
986 extern void FreeSymbol(struct Symbol * symbol);
987
988 struct ClassDef;
989
990 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
991
992 extern void FreeClassDef(struct ClassDef * def);
993
994 struct Declarator;
995
996 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
997
998 struct TemplateDatatype
999 {
1000 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1001 struct Declarator * decl;
1002 } ecere_gcc_struct;
1003
1004 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1005
1006 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1007
1008 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1009
1010 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
1011
1012 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
1013
1014 struct Declarator
1015 {
1016 struct Declarator * prev;
1017 struct Declarator * next;
1018 struct Location loc;
1019 int type;
1020 struct Symbol * symbol;
1021 struct Declarator * declarator;
1022 union
1023 {
1024 struct Identifier * identifier;
1025 struct
1026 {
1027 struct Expression * exp;
1028 struct Expression * posExp;
1029 struct Attrib * attrib;
1030 } ecere_gcc_struct structDecl;
1031 struct
1032 {
1033 struct Expression * exp;
1034 struct Specifier * enumClass;
1035 } ecere_gcc_struct array;
1036 struct
1037 {
1038 struct __ecereNameSpace__ecere__sys__OldList * parameters;
1039 } ecere_gcc_struct function;
1040 struct
1041 {
1042 struct Pointer * pointer;
1043 } ecere_gcc_struct pointer;
1044 struct
1045 {
1046 struct ExtDecl * extended;
1047 } ecere_gcc_struct extended;
1048 } ecere_gcc_struct __anon1;
1049 } ecere_gcc_struct;
1050
1051 extern struct Identifier * GetDeclId(struct Declarator * decl);
1052
1053 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
1054
1055 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1056
1057 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1058
1059 extern void FreeDeclarator(struct Declarator * decl);
1060
1061 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1062
1063 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
1064
1065 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1066
1067 struct FunctionDefinition
1068 {
1069 struct FunctionDefinition * prev;
1070 struct FunctionDefinition * next;
1071 struct Location loc;
1072 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1073 struct Declarator * declarator;
1074 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1075 struct Statement * body;
1076 struct __ecereNameSpace__ecere__com__Class * _class;
1077 struct __ecereNameSpace__ecere__sys__OldList attached;
1078 int declMode;
1079 struct Type * type;
1080 struct Symbol * propSet;
1081 int tempCount;
1082 unsigned int propertyNoThis;
1083 } ecere_gcc_struct;
1084
1085 extern struct Declarator * QMkPtrDecl(const char *  id);
1086
1087 struct ClassFunction;
1088
1089 struct ClassFunction
1090 {
1091 struct ClassFunction * prev;
1092 struct ClassFunction * next;
1093 struct Location loc;
1094 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1095 struct Declarator * declarator;
1096 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1097 struct Statement * body;
1098 struct __ecereNameSpace__ecere__com__Class * _class;
1099 struct __ecereNameSpace__ecere__sys__OldList attached;
1100 int declMode;
1101 struct Type * type;
1102 struct Symbol * propSet;
1103 unsigned int isVirtual;
1104 unsigned int isConstructor;
1105 unsigned int isDestructor;
1106 unsigned int dontMangle;
1107 int id;
1108 int idCode;
1109 } ecere_gcc_struct;
1110
1111 extern struct External * ProcessClassFunction(struct __ecereNameSpace__ecere__com__Class * owningClass, struct ClassFunction * func, struct __ecereNameSpace__ecere__sys__OldList * defs, struct External * after, unsigned int makeStatic);
1112
1113 extern void FreeClassFunction(struct ClassFunction * func);
1114
1115 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1116
1117 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1118
1119 struct TypeName;
1120
1121 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1122
1123 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1124
1125 struct TypeName
1126 {
1127 struct TypeName * prev;
1128 struct TypeName * next;
1129 struct Location loc;
1130 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
1131 struct Declarator * declarator;
1132 int classObjectType;
1133 struct Expression * bitCount;
1134 } ecere_gcc_struct;
1135
1136 extern void FreeTypeName(struct TypeName * typeName);
1137
1138 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
1139
1140 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
1141
1142 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
1143
1144 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
1145
1146 struct __ecereNameSpace__ecere__com__BTNamedLink;
1147
1148 struct __ecereNameSpace__ecere__com__BTNamedLink
1149 {
1150 const char *  name;
1151 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1152 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1153 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1154 int depth;
1155 void *  data;
1156 } ecere_gcc_struct;
1157
1158 struct __ecereNameSpace__ecere__sys__NamedLink64;
1159
1160 struct __ecereNameSpace__ecere__sys__NamedLink64
1161 {
1162 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
1163 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
1164 char *  name;
1165 long long data;
1166 } ecere_gcc_struct;
1167
1168 struct Instantiation;
1169
1170 struct Declaration
1171 {
1172 struct Declaration * prev;
1173 struct Declaration * next;
1174 struct Location loc;
1175 int type;
1176 union
1177 {
1178 struct
1179 {
1180 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1181 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1182 } ecere_gcc_struct __anon1;
1183 struct Instantiation * inst;
1184 struct
1185 {
1186 struct Identifier * id;
1187 struct Expression * exp;
1188 } ecere_gcc_struct __anon2;
1189 } ecere_gcc_struct __anon1;
1190 struct Specifier * extStorage;
1191 struct Symbol * symbol;
1192 int declMode;
1193 } ecere_gcc_struct;
1194
1195 struct Instantiation
1196 {
1197 struct Instantiation * prev;
1198 struct Instantiation * next;
1199 struct Location loc;
1200 struct Specifier * _class;
1201 struct Expression * exp;
1202 struct __ecereNameSpace__ecere__sys__OldList *  members;
1203 struct Symbol * symbol;
1204 unsigned int fullSet;
1205 unsigned int isConstant;
1206 unsigned char *  data;
1207 struct Location nameLoc;
1208 struct Location insideLoc;
1209 unsigned int built;
1210 } ecere_gcc_struct;
1211
1212 extern void FreeInstance(struct Instantiation * inst);
1213
1214 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
1215
1216 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
1217
1218 struct InitDeclarator;
1219
1220 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1221
1222 struct PropertyWatch;
1223
1224 struct PropertyWatch
1225 {
1226 struct PropertyWatch * prev;
1227 struct PropertyWatch * next;
1228 struct Location loc;
1229 struct Statement * compound;
1230 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1231 unsigned int deleteWatch;
1232 } ecere_gcc_struct;
1233
1234 extern void FreePropertyWatch(struct PropertyWatch * watcher);
1235
1236 struct PropertyImport;
1237
1238 struct PropertyImport
1239 {
1240 struct PropertyImport * prev;
1241 struct PropertyImport * next;
1242 char *  name;
1243 unsigned int isVirtual;
1244 unsigned int hasSet;
1245 unsigned int hasGet;
1246 } ecere_gcc_struct;
1247
1248 struct MethodImport;
1249
1250 struct MethodImport
1251 {
1252 struct MethodImport * prev;
1253 struct MethodImport * next;
1254 char *  name;
1255 unsigned int isVirtual;
1256 } ecere_gcc_struct;
1257
1258 struct FunctionImport;
1259
1260 struct FunctionImport
1261 {
1262 struct FunctionImport * prev;
1263 struct FunctionImport * next;
1264 char *  name;
1265 } ecere_gcc_struct;
1266
1267 struct ClassImport;
1268
1269 struct ClassImport
1270 {
1271 struct ClassImport * prev;
1272 struct ClassImport * next;
1273 char *  name;
1274 struct __ecereNameSpace__ecere__sys__OldList methods;
1275 struct __ecereNameSpace__ecere__sys__OldList properties;
1276 unsigned int itself;
1277 int isRemote;
1278 } ecere_gcc_struct;
1279
1280 struct Initializer;
1281
1282 struct Expression
1283 {
1284 struct Expression * prev;
1285 struct Expression * next;
1286 struct Location loc;
1287 int type;
1288 union
1289 {
1290 struct
1291 {
1292 char *  constant;
1293 struct Identifier * identifier;
1294 } ecere_gcc_struct __anon1;
1295 struct Statement * compound;
1296 struct Instantiation * instance;
1297 struct
1298 {
1299 char *  string;
1300 unsigned int intlString;
1301 unsigned int wideString;
1302 } ecere_gcc_struct __anon2;
1303 struct __ecereNameSpace__ecere__sys__OldList *  list;
1304 struct
1305 {
1306 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1307 struct Declarator * decl;
1308 } ecere_gcc_struct _classExp;
1309 struct
1310 {
1311 struct Identifier * id;
1312 } ecere_gcc_struct classData;
1313 struct
1314 {
1315 struct Expression * exp;
1316 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1317 struct Location argLoc;
1318 } ecere_gcc_struct call;
1319 struct
1320 {
1321 struct Expression * exp;
1322 struct __ecereNameSpace__ecere__sys__OldList * index;
1323 } ecere_gcc_struct index;
1324 struct
1325 {
1326 struct Expression * exp;
1327 struct Identifier * member;
1328 int memberType;
1329 unsigned int thisPtr;
1330 } ecere_gcc_struct member;
1331 struct
1332 {
1333 int op;
1334 struct Expression * exp1;
1335 struct Expression * exp2;
1336 } ecere_gcc_struct op;
1337 struct TypeName * typeName;
1338 struct Specifier * _class;
1339 struct
1340 {
1341 struct TypeName * typeName;
1342 struct Expression * exp;
1343 } ecere_gcc_struct cast;
1344 struct
1345 {
1346 struct Expression * cond;
1347 struct __ecereNameSpace__ecere__sys__OldList * exp;
1348 struct Expression * elseExp;
1349 } ecere_gcc_struct cond;
1350 struct
1351 {
1352 struct TypeName * typeName;
1353 struct Expression * size;
1354 } ecere_gcc_struct _new;
1355 struct
1356 {
1357 struct TypeName * typeName;
1358 struct Expression * size;
1359 struct Expression * exp;
1360 } ecere_gcc_struct _renew;
1361 struct
1362 {
1363 char * table;
1364 struct Identifier * id;
1365 } ecere_gcc_struct db;
1366 struct
1367 {
1368 struct Expression * ds;
1369 struct Expression * name;
1370 } ecere_gcc_struct dbopen;
1371 struct
1372 {
1373 struct TypeName * typeName;
1374 struct Initializer * initializer;
1375 } ecere_gcc_struct initializer;
1376 struct
1377 {
1378 struct Expression * exp;
1379 struct TypeName * typeName;
1380 } ecere_gcc_struct vaArg;
1381 } ecere_gcc_struct __anon1;
1382 unsigned int debugValue;
1383 struct __ecereNameSpace__ecere__com__DataValue val;
1384 uint64 address;
1385 unsigned int hasAddress;
1386 struct Type * expType;
1387 struct Type * destType;
1388 unsigned int usage;
1389 int tempCount;
1390 unsigned int byReference;
1391 unsigned int isConstant;
1392 unsigned int addedThis;
1393 unsigned int needCast;
1394 unsigned int thisPtr;
1395 unsigned int opDestType;
1396 unsigned int needTemplateCast;
1397 } ecere_gcc_struct;
1398
1399 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1400
1401 struct Initializer
1402 {
1403 struct Initializer * prev;
1404 struct Initializer * next;
1405 struct Location loc;
1406 int type;
1407 union
1408 {
1409 struct Expression * exp;
1410 struct __ecereNameSpace__ecere__sys__OldList *  list;
1411 } ecere_gcc_struct __anon1;
1412 unsigned int isConstant;
1413 struct Identifier * id;
1414 } ecere_gcc_struct;
1415
1416 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1417
1418 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
1419
1420 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
1421
1422 struct InitDeclarator
1423 {
1424 struct InitDeclarator * prev;
1425 struct InitDeclarator * next;
1426 struct Location loc;
1427 struct Declarator * declarator;
1428 struct Initializer * initializer;
1429 } ecere_gcc_struct;
1430
1431 void ApplyLocation(struct Expression * exp, struct Location * loc)
1432 {
1433 exp->loc = *loc;
1434 switch(exp->type)
1435 {
1436 case 4:
1437 if(exp->__anon1.op.exp1)
1438 ApplyLocation(exp->__anon1.op.exp1, loc);
1439 if(exp->__anon1.op.exp2)
1440 ApplyLocation(exp->__anon1.op.exp2, loc);
1441 break;
1442 case 5:
1443 if(exp->__anon1.list)
1444 {
1445 struct Expression * e;
1446
1447 for(e = (*exp->__anon1.list).first; e; e = e->next)
1448 ApplyLocation(e, loc);
1449 }
1450 break;
1451 case 6:
1452 if(exp->__anon1.index.index)
1453 {
1454 struct Expression * e;
1455
1456 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1457 ApplyLocation(e, loc);
1458 }
1459 if(exp->__anon1.index.exp)
1460 ApplyLocation(exp->__anon1.index.exp, loc);
1461 break;
1462 case 7:
1463 if(exp->__anon1.call.arguments)
1464 {
1465 struct Expression * arg;
1466
1467 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1468 ApplyLocation(arg, loc);
1469 }
1470 if(exp->__anon1.call.exp)
1471 ApplyLocation(exp->__anon1.call.exp, loc);
1472 break;
1473 case 8:
1474 case 9:
1475 if(exp->__anon1.member.exp)
1476 ApplyLocation(exp->__anon1.member.exp, loc);
1477 break;
1478 case 11:
1479 if(exp->__anon1.cast.exp)
1480 ApplyLocation(exp->__anon1.cast.exp, loc);
1481 break;
1482 case 12:
1483 if(exp->__anon1.cond.exp)
1484 {
1485 struct Expression * e;
1486
1487 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1488 ApplyLocation(e, loc);
1489 }
1490 if(exp->__anon1.cond.cond)
1491 ApplyLocation(exp->__anon1.cond.cond, loc);
1492 if(exp->__anon1.cond.elseExp)
1493 ApplyLocation(exp->__anon1.cond.elseExp, loc);
1494 break;
1495 case 34:
1496 if(exp->__anon1.vaArg.exp)
1497 ApplyLocation(exp->__anon1.vaArg.exp, loc);
1498 break;
1499 default:
1500 break;
1501 }
1502 }
1503
1504 void __ecereMethod_Expression_Clear();
1505
1506 struct MembersInit;
1507
1508 struct MembersInit
1509 {
1510 struct MembersInit * prev;
1511 struct MembersInit * next;
1512 struct Location loc;
1513 int type;
1514 union
1515 {
1516 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1517 struct ClassFunction * function;
1518 } ecere_gcc_struct __anon1;
1519 } ecere_gcc_struct;
1520
1521 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
1522
1523 struct Operand;
1524
1525 struct OpTable
1526 {
1527 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1528 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1529 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1530 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1531 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1532 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1533 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1534 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1535 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1536 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1537 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1538 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1539 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1540 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1541 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1542 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1543 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1544 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1545 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1546 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1547 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1548 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1549 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1550 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1551 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1552 unsigned int (*  Not)(struct Expression *, struct Operand *);
1553 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1554 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1555 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1556 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1557 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1558 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1559 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1560 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1561 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1562 } ecere_gcc_struct;
1563
1564 struct Operand
1565 {
1566 int kind;
1567 struct Type * type;
1568 unsigned int ptrSize;
1569 union
1570 {
1571 char c;
1572 unsigned char uc;
1573 short s;
1574 unsigned short us;
1575 int i;
1576 unsigned int ui;
1577 float f;
1578 double d;
1579 long long i64;
1580 uint64 ui64;
1581 } ecere_gcc_struct __anon1;
1582 struct OpTable ops;
1583 } ecere_gcc_struct;
1584
1585 struct External *  _DeclareStruct(struct External *  neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl);
1586
1587 struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference)
1588 {
1589 return _DeclareStruct(neededBy, name, skipNoHead, needDereference, 0);
1590 }
1591
1592 static void _DeclareType(struct External *  neededFor, struct Type *  type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl);
1593
1594 void DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1595 {
1596 _DeclareType(neededFor, type, needDereference, forFunctionDef, 0);
1597 }
1598
1599 void DeclareTypeForwardDeclare(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1600 {
1601 _DeclareType(neededFor, type, needDereference, forFunctionDef, 1);
1602 }
1603
1604 static void _PrintType(struct Type *  type, char *  string, unsigned int printName, unsigned int fullName, unsigned int printConst);
1605
1606 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1607 {
1608 _PrintType(type, string, printName, fullName, 1);
1609 }
1610
1611 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1612 {
1613 _PrintType(type, string, printName, fullName, 0);
1614 }
1615
1616 struct __ecereNameSpace__ecere__com__Method;
1617
1618 struct __ecereNameSpace__ecere__com__Method
1619 {
1620 const char *  name;
1621 struct __ecereNameSpace__ecere__com__Method * parent;
1622 struct __ecereNameSpace__ecere__com__Method * left;
1623 struct __ecereNameSpace__ecere__com__Method * right;
1624 int depth;
1625 int (*  function)();
1626 int vid;
1627 int type;
1628 struct __ecereNameSpace__ecere__com__Class * _class;
1629 void *  symbol;
1630 const char *  dataTypeString;
1631 struct Type * dataType;
1632 int memberAccess;
1633 } ecere_gcc_struct;
1634
1635 struct Symbol
1636 {
1637 char *  string;
1638 struct Symbol * parent;
1639 struct Symbol * left;
1640 struct Symbol * right;
1641 int depth;
1642 struct Type * type;
1643 union
1644 {
1645 struct __ecereNameSpace__ecere__com__Method * method;
1646 struct __ecereNameSpace__ecere__com__Property * _property;
1647 struct __ecereNameSpace__ecere__com__Class * registered;
1648 } ecere_gcc_struct __anon1;
1649 unsigned int notYetDeclared;
1650 union
1651 {
1652 struct
1653 {
1654 struct External * pointerExternal;
1655 struct External * structExternal;
1656 } ecere_gcc_struct __anon1;
1657 struct
1658 {
1659 struct External * externalGet;
1660 struct External * externalSet;
1661 struct External * externalPtr;
1662 struct External * externalIsSet;
1663 } ecere_gcc_struct __anon2;
1664 struct
1665 {
1666 struct External * methodExternal;
1667 struct External * methodCodeExternal;
1668 } ecere_gcc_struct __anon3;
1669 } ecere_gcc_struct __anon2;
1670 unsigned int imported;
1671 unsigned int declaredStructSym;
1672 struct __ecereNameSpace__ecere__com__Class * _class;
1673 unsigned int declaredStruct;
1674 unsigned int needConstructor;
1675 unsigned int needDestructor;
1676 char *  constructorName;
1677 char *  structName;
1678 char *  className;
1679 char *  destructorName;
1680 struct ModuleImport * module;
1681 struct ClassImport * _import;
1682 struct Location nameLoc;
1683 unsigned int isParam;
1684 unsigned int isRemote;
1685 unsigned int isStruct;
1686 unsigned int fireWatchersDone;
1687 int declaring;
1688 unsigned int classData;
1689 unsigned int isStatic;
1690 char *  shortName;
1691 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
1692 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
1693 struct Context * ctx;
1694 int isIterator;
1695 struct Expression * propCategory;
1696 unsigned int mustRegister;
1697 } ecere_gcc_struct;
1698
1699 struct __ecereNameSpace__ecere__com__ClassProperty;
1700
1701 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1702
1703 struct __ecereNameSpace__ecere__com__ClassProperty
1704 {
1705 const char *  name;
1706 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1707 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1708 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1709 int depth;
1710 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1711 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1712 const char *  dataTypeString;
1713 struct Type * dataType;
1714 unsigned int constant;
1715 } ecere_gcc_struct;
1716
1717 struct __ecereNameSpace__ecere__com__BitMember;
1718
1719 struct __ecereNameSpace__ecere__com__BitMember
1720 {
1721 struct __ecereNameSpace__ecere__com__BitMember * prev;
1722 struct __ecereNameSpace__ecere__com__BitMember * next;
1723 const char *  name;
1724 unsigned int isProperty;
1725 int memberAccess;
1726 int id;
1727 struct __ecereNameSpace__ecere__com__Class * _class;
1728 const char *  dataTypeString;
1729 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1730 struct Type * dataType;
1731 int type;
1732 int size;
1733 int pos;
1734 uint64 mask;
1735 } ecere_gcc_struct;
1736
1737 struct __ecereNameSpace__ecere__com__DataMember;
1738
1739 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1740 {
1741 union
1742 {
1743 struct
1744 {
1745 const char *  dataTypeString;
1746 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1747 } ecere_gcc_struct __anon1;
1748 struct __ecereNameSpace__ecere__com__DataValue expression;
1749 struct
1750 {
1751 const char *  memberString;
1752 union
1753 {
1754 struct __ecereNameSpace__ecere__com__DataMember * member;
1755 struct __ecereNameSpace__ecere__com__Property * prop;
1756 struct __ecereNameSpace__ecere__com__Method * method;
1757 } ecere_gcc_struct __anon1;
1758 } ecere_gcc_struct __anon2;
1759 } ecere_gcc_struct __anon1;
1760 } ecere_gcc_struct;
1761
1762 extern void __ecereNameSpace__ecere__com__eClass_FindNextMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class **  curClass, struct __ecereNameSpace__ecere__com__DataMember **  curMember, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
1763
1764 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, unsigned int size, unsigned int alignment, int declMode);
1765
1766 struct TemplateParameter;
1767
1768 struct TemplateParameter
1769 {
1770 struct TemplateParameter * prev;
1771 struct TemplateParameter * next;
1772 struct Location loc;
1773 int type;
1774 struct Identifier * identifier;
1775 union
1776 {
1777 struct TemplateDatatype * dataType;
1778 int memberType;
1779 } ecere_gcc_struct __anon1;
1780 struct TemplateArgument * defaultArgument;
1781 const char *  dataTypeString;
1782 struct Type * baseType;
1783 } ecere_gcc_struct;
1784
1785 struct Type
1786 {
1787 struct Type * prev;
1788 struct Type * next;
1789 int refCount;
1790 union
1791 {
1792 struct Symbol * _class;
1793 struct
1794 {
1795 struct __ecereNameSpace__ecere__sys__OldList members;
1796 char *  enumName;
1797 } ecere_gcc_struct __anon1;
1798 struct
1799 {
1800 struct Type * returnType;
1801 struct __ecereNameSpace__ecere__sys__OldList params;
1802 struct Symbol * thisClass;
1803 unsigned int staticMethod;
1804 struct TemplateParameter * thisClassTemplate;
1805 } ecere_gcc_struct __anon2;
1806 struct
1807 {
1808 struct __ecereNameSpace__ecere__com__Method * method;
1809 struct __ecereNameSpace__ecere__com__Class * methodClass;
1810 struct __ecereNameSpace__ecere__com__Class * usedClass;
1811 } ecere_gcc_struct __anon3;
1812 struct
1813 {
1814 struct Type * arrayType;
1815 int arraySize;
1816 struct Expression * arraySizeExp;
1817 unsigned int freeExp;
1818 struct Symbol * enumClass;
1819 } ecere_gcc_struct __anon4;
1820 struct Type * type;
1821 struct TemplateParameter * templateParameter;
1822 } ecere_gcc_struct __anon1;
1823 int kind;
1824 unsigned int size;
1825 char *  name;
1826 char *  typeName;
1827 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1828 int promotedFrom;
1829 int classObjectType;
1830 int alignment;
1831 unsigned int offset;
1832 int bitFieldCount;
1833 int count;
1834 int bitMemberSize;
1835 unsigned int isSigned : 1;
1836 unsigned int constant : 1;
1837 unsigned int truth : 1;
1838 unsigned int byReference : 1;
1839 unsigned int extraParam : 1;
1840 unsigned int directClassAccess : 1;
1841 unsigned int computing : 1;
1842 unsigned int keepCast : 1;
1843 unsigned int passAsTemplate : 1;
1844 unsigned int dllExport : 1;
1845 unsigned int attrStdcall : 1;
1846 unsigned int declaredWithStruct : 1;
1847 unsigned int typedByReference : 1;
1848 unsigned int casted : 1;
1849 unsigned int pointerAlignment : 1;
1850 unsigned int isLong : 1;
1851 unsigned int signedBeforePromotion : 1;
1852 } ecere_gcc_struct;
1853
1854 struct Specifier
1855 {
1856 struct Specifier * prev;
1857 struct Specifier * next;
1858 struct Location loc;
1859 int type;
1860 union
1861 {
1862 int specifier;
1863 struct
1864 {
1865 struct ExtDecl * extDecl;
1866 char *  name;
1867 struct Symbol * symbol;
1868 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
1869 struct Specifier * nsSpec;
1870 } ecere_gcc_struct __anon1;
1871 struct
1872 {
1873 struct Identifier * id;
1874 struct __ecereNameSpace__ecere__sys__OldList *  list;
1875 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
1876 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
1877 unsigned int addNameSpace;
1878 struct Context * ctx;
1879 struct ExtDecl * extDeclStruct;
1880 } ecere_gcc_struct __anon2;
1881 struct Expression * expression;
1882 struct Specifier * _class;
1883 struct TemplateParameter * templateParameter;
1884 } ecere_gcc_struct __anon1;
1885 } ecere_gcc_struct;
1886
1887 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
1888
1889 struct TemplatedType
1890 {
1891 uintptr_t key;
1892 struct __ecereNameSpace__ecere__sys__BTNode * parent;
1893 struct __ecereNameSpace__ecere__sys__BTNode * left;
1894 struct __ecereNameSpace__ecere__sys__BTNode * right;
1895 int depth;
1896 struct TemplateParameter * param;
1897 } ecere_gcc_struct;
1898
1899 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1900 {
1901 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1902 {
1903 if(!param->baseType)
1904 {
1905 if(param->dataTypeString)
1906 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1907 else
1908 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1909 }
1910 return param->baseType;
1911 }
1912 return (((void *)0));
1913 }
1914
1915 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1916 {
1917 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1918 return 1;
1919 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1920 {
1921 return 0;
1922 }
1923 if(type1->kind == type2->kind && type1->isLong == type2->isLong)
1924 {
1925 switch(type1->kind)
1926 {
1927 case 24:
1928 case 1:
1929 case 2:
1930 case 3:
1931 case 4:
1932 case 22:
1933 case 23:
1934 if(type1->passAsTemplate && !type2->passAsTemplate)
1935 return 1;
1936 return type1->isSigned != type2->isSigned;
1937 case 8:
1938 return type1->__anon1._class != type2->__anon1._class;
1939 case 13:
1940 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1941 default:
1942 return 1;
1943 }
1944 }
1945 return 1;
1946 }
1947
1948 unsigned int GetOpInt(struct Operand * op2, int * value2)
1949 {
1950 if(op2->kind == 3 && op2->type->isSigned)
1951 *value2 = op2->__anon1.i;
1952 else if(op2->kind == 3)
1953 *value2 = (int)op2->__anon1.ui;
1954 else if(op2->kind == 4 && op2->type->isSigned)
1955 *value2 = (int)op2->__anon1.i64;
1956 else if(op2->kind == 4)
1957 *value2 = (int)op2->__anon1.ui64;
1958 else if(op2->kind == 23 && op2->type->isSigned)
1959 *value2 = (int)op2->__anon1.i64;
1960 else if(op2->kind == 23)
1961 *value2 = (int)op2->__anon1.ui64;
1962 else if(op2->kind == 22 && op2->type->isSigned)
1963 *value2 = (int)op2->__anon1.i64;
1964 else if(op2->kind == 22)
1965 *value2 = (int)op2->__anon1.ui64;
1966 else if(op2->kind == 2 && op2->type->isSigned)
1967 *value2 = (int)op2->__anon1.s;
1968 else if(op2->kind == 2)
1969 *value2 = (int)op2->__anon1.us;
1970 else if(op2->kind == 1 && op2->type->isSigned)
1971 *value2 = (int)op2->__anon1.c;
1972 else if(op2->kind == 24 || op2->kind == 1)
1973 *value2 = (int)op2->__anon1.uc;
1974 else if(op2->kind == 6)
1975 *value2 = (int)op2->__anon1.f;
1976 else if(op2->kind == 7)
1977 *value2 = (int)op2->__anon1.d;
1978 else if(op2->kind == 13)
1979 *value2 = (int)op2->__anon1.ui64;
1980 else
1981 return 0;
1982 return 1;
1983 }
1984
1985 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1986 {
1987 if(op2->kind == 3 && op2->type->isSigned)
1988 *value2 = (unsigned int)op2->__anon1.i;
1989 else if(op2->kind == 3)
1990 *value2 = op2->__anon1.ui;
1991 else if(op2->kind == 4 && op2->type->isSigned)
1992 *value2 = (unsigned int)op2->__anon1.i64;
1993 else if(op2->kind == 4)
1994 *value2 = (unsigned int)op2->__anon1.ui64;
1995 else if(op2->kind == 23 && op2->type->isSigned)
1996 *value2 = (unsigned int)op2->__anon1.i64;
1997 else if(op2->kind == 23)
1998 *value2 = (unsigned int)op2->__anon1.ui64;
1999 else if(op2->kind == 22 && op2->type->isSigned)
2000 *value2 = (unsigned int)op2->__anon1.i64;
2001 else if(op2->kind == 22)
2002 *value2 = (unsigned int)op2->__anon1.ui64;
2003 else if(op2->kind == 2 && op2->type->isSigned)
2004 *value2 = (unsigned int)op2->__anon1.s;
2005 else if(op2->kind == 2)
2006 *value2 = (unsigned int)op2->__anon1.us;
2007 else if(op2->kind == 1 && op2->type->isSigned)
2008 *value2 = (unsigned int)op2->__anon1.c;
2009 else if(op2->kind == 24 || op2->kind == 1)
2010 *value2 = (unsigned int)op2->__anon1.uc;
2011 else if(op2->kind == 6)
2012 *value2 = (unsigned int)op2->__anon1.f;
2013 else if(op2->kind == 7)
2014 *value2 = (unsigned int)op2->__anon1.d;
2015 else if(op2->kind == 13)
2016 *value2 = (unsigned int)op2->__anon1.ui64;
2017 else
2018 return 0;
2019 return 1;
2020 }
2021
2022 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
2023 {
2024 if(op2->kind == 3 && op2->type->isSigned)
2025 *value2 = (long long)op2->__anon1.i;
2026 else if(op2->kind == 3)
2027 *value2 = (long long)op2->__anon1.ui;
2028 else if(op2->kind == 4 && op2->type->isSigned)
2029 *value2 = op2->__anon1.i64;
2030 else if(op2->kind == 4)
2031 *value2 = (long long)op2->__anon1.ui64;
2032 else if(op2->kind == 23 && op2->type->isSigned)
2033 *value2 = op2->__anon1.i64;
2034 else if(op2->kind == 23)
2035 *value2 = (long long)op2->__anon1.ui64;
2036 else if(op2->kind == 22 && op2->type->isSigned)
2037 *value2 = op2->__anon1.i64;
2038 else if(op2->kind == 22)
2039 *value2 = (long long)op2->__anon1.ui64;
2040 else if(op2->kind == 2 && op2->type->isSigned)
2041 *value2 = (long long)op2->__anon1.s;
2042 else if(op2->kind == 2)
2043 *value2 = (long long)op2->__anon1.us;
2044 else if(op2->kind == 1 && op2->type->isSigned)
2045 *value2 = (long long)op2->__anon1.c;
2046 else if(op2->kind == 24 || op2->kind == 1)
2047 *value2 = (long long)op2->__anon1.uc;
2048 else if(op2->kind == 6)
2049 *value2 = (long long)op2->__anon1.f;
2050 else if(op2->kind == 7)
2051 *value2 = (long long)op2->__anon1.d;
2052 else if(op2->kind == 13)
2053 *value2 = (long long)op2->__anon1.ui64;
2054 else
2055 return 0;
2056 return 1;
2057 }
2058
2059 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
2060 {
2061 if(op2->kind == 3 && op2->type->isSigned)
2062 *value2 = (uint64)op2->__anon1.i;
2063 else if(op2->kind == 3)
2064 *value2 = (uint64)op2->__anon1.ui;
2065 else if(op2->kind == 4 && op2->type->isSigned)
2066 *value2 = (uint64)op2->__anon1.i64;
2067 else if(op2->kind == 4)
2068 *value2 = op2->__anon1.ui64;
2069 else if(op2->kind == 23 && op2->type->isSigned)
2070 *value2 = (uint64)op2->__anon1.i64;
2071 else if(op2->kind == 23)
2072 *value2 = op2->__anon1.ui64;
2073 else if(op2->kind == 22 && op2->type->isSigned)
2074 *value2 = (uint64)op2->__anon1.i64;
2075 else if(op2->kind == 22)
2076 *value2 = op2->__anon1.ui64;
2077 else if(op2->kind == 2 && op2->type->isSigned)
2078 *value2 = (uint64)op2->__anon1.s;
2079 else if(op2->kind == 2)
2080 *value2 = (uint64)op2->__anon1.us;
2081 else if(op2->kind == 1 && op2->type->isSigned)
2082 *value2 = (uint64)op2->__anon1.c;
2083 else if(op2->kind == 24 || op2->kind == 1)
2084 *value2 = (uint64)op2->__anon1.uc;
2085 else if(op2->kind == 6)
2086 *value2 = (uint64)op2->__anon1.f;
2087 else if(op2->kind == 7)
2088 *value2 = (uint64)op2->__anon1.d;
2089 else if(op2->kind == 13)
2090 *value2 = op2->__anon1.ui64;
2091 else
2092 return 0;
2093 return 1;
2094 }
2095
2096 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
2097 {
2098 if(op2->kind == 3 && op2->type->isSigned)
2099 *value2 = (intptr_t)op2->__anon1.i;
2100 else if(op2->kind == 3)
2101 *value2 = (intptr_t)op2->__anon1.ui;
2102 else if(op2->kind == 4 && op2->type->isSigned)
2103 *value2 = (intptr_t)op2->__anon1.i64;
2104 else if(op2->kind == 4)
2105 *value2 = (intptr_t)op2->__anon1.ui64;
2106 else if(op2->kind == 23 && op2->type->isSigned)
2107 *value2 = (intptr_t)op2->__anon1.i64;
2108 else if(op2->kind == 23)
2109 *value2 = (intptr_t)op2->__anon1.ui64;
2110 else if(op2->kind == 22 && op2->type->isSigned)
2111 *value2 = (intptr_t)op2->__anon1.i64;
2112 else if(op2->kind == 22)
2113 *value2 = (intptr_t)op2->__anon1.ui64;
2114 else if(op2->kind == 2 && op2->type->isSigned)
2115 *value2 = (intptr_t)op2->__anon1.s;
2116 else if(op2->kind == 2)
2117 *value2 = (intptr_t)op2->__anon1.us;
2118 else if(op2->kind == 1 && op2->type->isSigned)
2119 *value2 = (intptr_t)op2->__anon1.c;
2120 else if(op2->kind == 24 || op2->kind == 1)
2121 *value2 = (intptr_t)op2->__anon1.uc;
2122 else if(op2->kind == 6)
2123 *value2 = (intptr_t)op2->__anon1.f;
2124 else if(op2->kind == 7)
2125 *value2 = (intptr_t)op2->__anon1.d;
2126 else if(op2->kind == 13)
2127 *value2 = (intptr_t)op2->__anon1.ui64;
2128 else
2129 return 0;
2130 return 1;
2131 }
2132
2133 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
2134 {
2135 if(op2->kind == 3 && op2->type->isSigned)
2136 *value2 = (uintptr_t)op2->__anon1.i;
2137 else if(op2->kind == 3)
2138 *value2 = (uintptr_t)op2->__anon1.ui;
2139 else if(op2->kind == 4 && op2->type->isSigned)
2140 *value2 = (uintptr_t)op2->__anon1.i64;
2141 else if(op2->kind == 4)
2142 *value2 = (uintptr_t)op2->__anon1.ui64;
2143 else if(op2->kind == 23 && op2->type->isSigned)
2144 *value2 = (uintptr_t)op2->__anon1.i64;
2145 else if(op2->kind == 23)
2146 *value2 = (uintptr_t)op2->__anon1.ui64;
2147 else if(op2->kind == 22 && op2->type->isSigned)
2148 *value2 = (uintptr_t)op2->__anon1.i64;
2149 else if(op2->kind == 22)
2150 *value2 = (uintptr_t)op2->__anon1.ui64;
2151 else if(op2->kind == 2 && op2->type->isSigned)
2152 *value2 = (uintptr_t)op2->__anon1.s;
2153 else if(op2->kind == 2)
2154 *value2 = (uintptr_t)op2->__anon1.us;
2155 else if(op2->kind == 1 && op2->type->isSigned)
2156 *value2 = (uintptr_t)op2->__anon1.c;
2157 else if(op2->kind == 24 || op2->kind == 1)
2158 *value2 = (uintptr_t)op2->__anon1.uc;
2159 else if(op2->kind == 6)
2160 *value2 = (uintptr_t)op2->__anon1.f;
2161 else if(op2->kind == 7)
2162 *value2 = (uintptr_t)op2->__anon1.d;
2163 else if(op2->kind == 13)
2164 *value2 = (uintptr_t)op2->__anon1.ui64;
2165 else
2166 return 0;
2167 return 1;
2168 }
2169
2170 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2171 {
2172 if(op2->kind == 3 && op2->type->isSigned)
2173 *value2 = (ssize_t)op2->__anon1.i;
2174 else if(op2->kind == 3)
2175 *value2 = (ssize_t)op2->__anon1.ui;
2176 else if(op2->kind == 4 && op2->type->isSigned)
2177 *value2 = (ssize_t)op2->__anon1.i64;
2178 else if(op2->kind == 4)
2179 *value2 = (ssize_t)op2->__anon1.ui64;
2180 else if(op2->kind == 23 && op2->type->isSigned)
2181 *value2 = (ssize_t)op2->__anon1.i64;
2182 else if(op2->kind == 23)
2183 *value2 = (ssize_t)op2->__anon1.ui64;
2184 else if(op2->kind == 22 && op2->type->isSigned)
2185 *value2 = (ssize_t)op2->__anon1.i64;
2186 else if(op2->kind == 22)
2187 *value2 = (ssize_t)op2->__anon1.ui64;
2188 else if(op2->kind == 2 && op2->type->isSigned)
2189 *value2 = (ssize_t)op2->__anon1.s;
2190 else if(op2->kind == 2)
2191 *value2 = (ssize_t)op2->__anon1.us;
2192 else if(op2->kind == 1 && op2->type->isSigned)
2193 *value2 = (ssize_t)op2->__anon1.c;
2194 else if(op2->kind == 24 || op2->kind == 1)
2195 *value2 = (ssize_t)op2->__anon1.uc;
2196 else if(op2->kind == 6)
2197 *value2 = (ssize_t)op2->__anon1.f;
2198 else if(op2->kind == 7)
2199 *value2 = (ssize_t)op2->__anon1.d;
2200 else if(op2->kind == 13)
2201 *value2 = (ssize_t)op2->__anon1.ui64;
2202 else
2203 return 0;
2204 return 1;
2205 }
2206
2207 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2208 {
2209 if(op2->kind == 3 && op2->type->isSigned)
2210 *value2 = (size_t)op2->__anon1.i;
2211 else if(op2->kind == 3)
2212 *value2 = (size_t)op2->__anon1.ui;
2213 else if(op2->kind == 4 && op2->type->isSigned)
2214 *value2 = (size_t)op2->__anon1.i64;
2215 else if(op2->kind == 4)
2216 *value2 = (size_t)op2->__anon1.ui64;
2217 else if(op2->kind == 23 && op2->type->isSigned)
2218 *value2 = (size_t)op2->__anon1.i64;
2219 else if(op2->kind == 23)
2220 *value2 = (size_t)op2->__anon1.ui64;
2221 else if(op2->kind == 22 && op2->type->isSigned)
2222 *value2 = (size_t)op2->__anon1.i64;
2223 else if(op2->kind == 22)
2224 *value2 = (size_t)op2->__anon1.ui64;
2225 else if(op2->kind == 2 && op2->type->isSigned)
2226 *value2 = (size_t)op2->__anon1.s;
2227 else if(op2->kind == 2)
2228 *value2 = (size_t)op2->__anon1.us;
2229 else if(op2->kind == 1 && op2->type->isSigned)
2230 *value2 = (size_t)op2->__anon1.c;
2231 else if(op2->kind == 24 || op2->kind == 1)
2232 *value2 = (size_t)op2->__anon1.uc;
2233 else if(op2->kind == 6)
2234 *value2 = (size_t)op2->__anon1.f;
2235 else if(op2->kind == 7)
2236 *value2 = (size_t)op2->__anon1.d;
2237 else if(op2->kind == 13)
2238 *value2 = (size_t)op2->__anon1.ui64;
2239 else
2240 return 0;
2241 return 1;
2242 }
2243
2244 unsigned int GetOpShort(struct Operand * op2, short * value2)
2245 {
2246 if(op2->kind == 3 && op2->type->isSigned)
2247 *value2 = (short)op2->__anon1.i;
2248 else if(op2->kind == 3)
2249 *value2 = (short)op2->__anon1.ui;
2250 else if(op2->kind == 4 && op2->type->isSigned)
2251 *value2 = (short)op2->__anon1.i64;
2252 else if(op2->kind == 4)
2253 *value2 = (short)op2->__anon1.ui64;
2254 else if(op2->kind == 23 && op2->type->isSigned)
2255 *value2 = (short)op2->__anon1.i64;
2256 else if(op2->kind == 23)
2257 *value2 = (short)op2->__anon1.ui64;
2258 else if(op2->kind == 22 && op2->type->isSigned)
2259 *value2 = (short)op2->__anon1.i64;
2260 else if(op2->kind == 22)
2261 *value2 = (short)op2->__anon1.ui64;
2262 else if(op2->kind == 2 && op2->type->isSigned)
2263 *value2 = op2->__anon1.s;
2264 else if(op2->kind == 2)
2265 *value2 = (short)op2->__anon1.us;
2266 else if(op2->kind == 1 && op2->type->isSigned)
2267 *value2 = (short)op2->__anon1.c;
2268 else if(op2->kind == 24 || op2->kind == 1)
2269 *value2 = (short)op2->__anon1.uc;
2270 else if(op2->kind == 6)
2271 *value2 = (short)op2->__anon1.f;
2272 else if(op2->kind == 7)
2273 *value2 = (short)op2->__anon1.d;
2274 else if(op2->kind == 13)
2275 *value2 = (short)op2->__anon1.ui64;
2276 else
2277 return 0;
2278 return 1;
2279 }
2280
2281 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2282 {
2283 if(op2->kind == 3 && op2->type->isSigned)
2284 *value2 = (unsigned short)op2->__anon1.i;
2285 else if(op2->kind == 3)
2286 *value2 = (unsigned short)op2->__anon1.ui;
2287 else if(op2->kind == 4 && op2->type->isSigned)
2288 *value2 = (unsigned short)op2->__anon1.i64;
2289 else if(op2->kind == 4)
2290 *value2 = (unsigned short)op2->__anon1.ui64;
2291 else if(op2->kind == 23 && op2->type->isSigned)
2292 *value2 = (unsigned short)op2->__anon1.i64;
2293 else if(op2->kind == 23)
2294 *value2 = (unsigned short)op2->__anon1.ui64;
2295 else if(op2->kind == 22 && op2->type->isSigned)
2296 *value2 = (unsigned short)op2->__anon1.i64;
2297 else if(op2->kind == 22)
2298 *value2 = (unsigned short)op2->__anon1.ui64;
2299 else if(op2->kind == 2 && op2->type->isSigned)
2300 *value2 = (unsigned short)op2->__anon1.s;
2301 else if(op2->kind == 2)
2302 *value2 = op2->__anon1.us;
2303 else if(op2->kind == 1 && op2->type->isSigned)
2304 *value2 = (unsigned short)op2->__anon1.c;
2305 else if(op2->kind == 24 || op2->kind == 1)
2306 *value2 = (unsigned short)op2->__anon1.uc;
2307 else if(op2->kind == 6)
2308 *value2 = (unsigned short)op2->__anon1.f;
2309 else if(op2->kind == 7)
2310 *value2 = (unsigned short)op2->__anon1.d;
2311 else if(op2->kind == 13)
2312 *value2 = (unsigned short)op2->__anon1.ui64;
2313 else
2314 return 0;
2315 return 1;
2316 }
2317
2318 unsigned int GetOpChar(struct Operand * op2, char * value2)
2319 {
2320 if(op2->kind == 3 && op2->type->isSigned)
2321 *value2 = (char)op2->__anon1.i;
2322 else if(op2->kind == 3)
2323 *value2 = (char)op2->__anon1.ui;
2324 else if(op2->kind == 4 && op2->type->isSigned)
2325 *value2 = (char)op2->__anon1.i64;
2326 else if(op2->kind == 4)
2327 *value2 = (char)op2->__anon1.ui64;
2328 else if(op2->kind == 23 && op2->type->isSigned)
2329 *value2 = (char)op2->__anon1.i64;
2330 else if(op2->kind == 23)
2331 *value2 = (char)op2->__anon1.ui64;
2332 else if(op2->kind == 22 && op2->type->isSigned)
2333 *value2 = (char)op2->__anon1.i64;
2334 else if(op2->kind == 22)
2335 *value2 = (char)op2->__anon1.ui64;
2336 else if(op2->kind == 2 && op2->type->isSigned)
2337 *value2 = (char)op2->__anon1.s;
2338 else if(op2->kind == 2)
2339 *value2 = (char)op2->__anon1.us;
2340 else if(op2->kind == 1 && op2->type->isSigned)
2341 *value2 = op2->__anon1.c;
2342 else if(op2->kind == 24 || op2->kind == 1)
2343 *value2 = (char)op2->__anon1.uc;
2344 else if(op2->kind == 6)
2345 *value2 = (char)op2->__anon1.f;
2346 else if(op2->kind == 7)
2347 *value2 = (char)op2->__anon1.d;
2348 else if(op2->kind == 13)
2349 *value2 = (char)op2->__anon1.ui64;
2350 else
2351 return 0;
2352 return 1;
2353 }
2354
2355 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2356 {
2357 if(op2->kind == 3 && op2->type->isSigned)
2358 *value2 = (unsigned char)op2->__anon1.i;
2359 else if(op2->kind == 3)
2360 *value2 = (unsigned char)op2->__anon1.ui;
2361 else if(op2->kind == 4 && op2->type->isSigned)
2362 *value2 = (unsigned char)op2->__anon1.i64;
2363 else if(op2->kind == 4)
2364 *value2 = (unsigned char)op2->__anon1.ui64;
2365 else if(op2->kind == 23 && op2->type->isSigned)
2366 *value2 = (unsigned char)op2->__anon1.i64;
2367 else if(op2->kind == 23)
2368 *value2 = (unsigned char)op2->__anon1.ui64;
2369 else if(op2->kind == 22 && op2->type->isSigned)
2370 *value2 = (unsigned char)op2->__anon1.i64;
2371 else if(op2->kind == 22)
2372 *value2 = (unsigned char)op2->__anon1.ui64;
2373 else if(op2->kind == 2 && op2->type->isSigned)
2374 *value2 = (unsigned char)op2->__anon1.s;
2375 else if(op2->kind == 2)
2376 *value2 = (unsigned char)op2->__anon1.us;
2377 else if(op2->kind == 1 && op2->type->isSigned)
2378 *value2 = (unsigned char)op2->__anon1.c;
2379 else if(op2->kind == 24 || op2->kind == 1)
2380 *value2 = op2->__anon1.uc;
2381 else if(op2->kind == 6)
2382 *value2 = (unsigned char)op2->__anon1.f;
2383 else if(op2->kind == 7)
2384 *value2 = (unsigned char)op2->__anon1.d;
2385 else if(op2->kind == 13)
2386 *value2 = (unsigned char)op2->__anon1.ui64;
2387 else
2388 return 0;
2389 return 1;
2390 }
2391
2392 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2393 {
2394 if(op2->kind == 3 && op2->type->isSigned)
2395 *value2 = (float)(float)op2->__anon1.i;
2396 else if(op2->kind == 3)
2397 *value2 = (float)(float)op2->__anon1.ui;
2398 else if(op2->kind == 4 && op2->type->isSigned)
2399 *value2 = (float)(float)op2->__anon1.i64;
2400 else if(op2->kind == 4)
2401 *value2 = (float)(float)op2->__anon1.ui64;
2402 else if(op2->kind == 23 && op2->type->isSigned)
2403 *value2 = (float)(float)op2->__anon1.i64;
2404 else if(op2->kind == 23)
2405 *value2 = (float)(float)op2->__anon1.ui64;
2406 else if(op2->kind == 22 && op2->type->isSigned)
2407 *value2 = (float)(float)op2->__anon1.i64;
2408 else if(op2->kind == 22)
2409 *value2 = (float)(float)op2->__anon1.ui64;
2410 else if(op2->kind == 2 && op2->type->isSigned)
2411 *value2 = (float)(float)op2->__anon1.s;
2412 else if(op2->kind == 2)
2413 *value2 = (float)(float)op2->__anon1.us;
2414 else if(op2->kind == 1 && op2->type->isSigned)
2415 *value2 = (float)(float)op2->__anon1.c;
2416 else if(op2->kind == 24 || op2->kind == 1)
2417 *value2 = (float)(float)op2->__anon1.uc;
2418 else if(op2->kind == 6)
2419 *value2 = (float)op2->__anon1.f;
2420 else if(op2->kind == 7)
2421 *value2 = (float)op2->__anon1.d;
2422 else if(op2->kind == 13)
2423 *value2 = (float)(float)op2->__anon1.ui64;
2424 else
2425 return 0;
2426 return 1;
2427 }
2428
2429 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2430 {
2431 if(op2->kind == 3 && op2->type->isSigned)
2432 *value2 = (double)(double)op2->__anon1.i;
2433 else if(op2->kind == 3)
2434 *value2 = (double)(double)op2->__anon1.ui;
2435 else if(op2->kind == 4 && op2->type->isSigned)
2436 *value2 = (double)(double)op2->__anon1.i64;
2437 else if(op2->kind == 4)
2438 *value2 = (double)(double)op2->__anon1.ui64;
2439 else if(op2->kind == 23 && op2->type->isSigned)
2440 *value2 = (double)(double)op2->__anon1.i64;
2441 else if(op2->kind == 23)
2442 *value2 = (double)(double)op2->__anon1.ui64;
2443 else if(op2->kind == 22 && op2->type->isSigned)
2444 *value2 = (double)(double)op2->__anon1.i64;
2445 else if(op2->kind == 22)
2446 *value2 = (double)(double)op2->__anon1.ui64;
2447 else if(op2->kind == 2 && op2->type->isSigned)
2448 *value2 = (double)(double)op2->__anon1.s;
2449 else if(op2->kind == 2)
2450 *value2 = (double)(double)op2->__anon1.us;
2451 else if(op2->kind == 1 && op2->type->isSigned)
2452 *value2 = (double)(double)op2->__anon1.c;
2453 else if(op2->kind == 24 || op2->kind == 1)
2454 *value2 = (double)(double)op2->__anon1.uc;
2455 else if(op2->kind == 6)
2456 *value2 = (double)op2->__anon1.f;
2457 else if(op2->kind == 7)
2458 *value2 = (double)op2->__anon1.d;
2459 else if(op2->kind == 13)
2460 *value2 = (double)(double)op2->__anon1.ui64;
2461 else
2462 return 0;
2463 return 1;
2464 }
2465
2466 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2467 {
2468 int value2 = op2->__anon1.i;
2469
2470 exp->type = 2;
2471 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
2472 if(!exp->expType)
2473 {
2474 exp->expType = op1->type;
2475 if(op1->type)
2476 op1->type->refCount++;
2477 }
2478 return 1;
2479 }
2480
2481 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2482 {
2483 unsigned int value2 = op2->__anon1.ui;
2484
2485 exp->type = 2;
2486 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
2487 if(!exp->expType)
2488 {
2489 exp->expType = op1->type;
2490 if(op1->type)
2491 op1->type->refCount++;
2492 }
2493 return 1;
2494 }
2495
2496 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2497 {
2498 long long value2 = op2->__anon1.i64;
2499
2500 exp->type = 2;
2501 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
2502 if(!exp->expType)
2503 {
2504 exp->expType = op1->type;
2505 if(op1->type)
2506 op1->type->refCount++;
2507 }
2508 return 1;
2509 }
2510
2511 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2512 {
2513 uint64 value2 = op2->__anon1.ui64;
2514
2515 exp->type = 2;
2516 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
2517 if(!exp->expType)
2518 {
2519 exp->expType = op1->type;
2520 if(op1->type)
2521 op1->type->refCount++;
2522 }
2523 return 1;
2524 }
2525
2526 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2527 {
2528 short value2 = op2->__anon1.s;
2529
2530 exp->type = 2;
2531 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s + value2));
2532 if(!exp->expType)
2533 {
2534 exp->expType = op1->type;
2535 if(op1->type)
2536 op1->type->refCount++;
2537 }
2538 return 1;
2539 }
2540
2541 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2542 {
2543 unsigned short value2 = op2->__anon1.us;
2544
2545 exp->type = 2;
2546 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us + value2));
2547 if(!exp->expType)
2548 {
2549 exp->expType = op1->type;
2550 if(op1->type)
2551 op1->type->refCount++;
2552 }
2553 return 1;
2554 }
2555
2556 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2557 {
2558 char value2 = op2->__anon1.c;
2559
2560 exp->type = 2;
2561 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c + value2));
2562 if(!exp->expType)
2563 {
2564 exp->expType = op1->type;
2565 if(op1->type)
2566 op1->type->refCount++;
2567 }
2568 return 1;
2569 }
2570
2571 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2572 {
2573 unsigned char value2 = op2->__anon1.uc;
2574
2575 exp->type = 2;
2576 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc + value2));
2577 if(!exp->expType)
2578 {
2579 exp->expType = op1->type;
2580 if(op1->type)
2581 op1->type->refCount++;
2582 }
2583 return 1;
2584 }
2585
2586 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2587 {
2588 float value2 = op2->__anon1.f;
2589
2590 exp->type = 2;
2591 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
2592 if(!exp->expType)
2593 {
2594 exp->expType = op1->type;
2595 if(op1->type)
2596 op1->type->refCount++;
2597 }
2598 return 1;
2599 }
2600
2601 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2602 {
2603 double value2 = op2->__anon1.d;
2604
2605 exp->type = 2;
2606 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
2607 if(!exp->expType)
2608 {
2609 exp->expType = op1->type;
2610 if(op1->type)
2611 op1->type->refCount++;
2612 }
2613 return 1;
2614 }
2615
2616 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2617 {
2618 int value2 = op2->__anon1.i;
2619
2620 exp->type = 2;
2621 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
2622 if(!exp->expType)
2623 {
2624 exp->expType = op1->type;
2625 if(op1->type)
2626 op1->type->refCount++;
2627 }
2628 return 1;
2629 }
2630
2631 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2632 {
2633 unsigned int value2 = op2->__anon1.ui;
2634
2635 exp->type = 2;
2636 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
2637 if(!exp->expType)
2638 {
2639 exp->expType = op1->type;
2640 if(op1->type)
2641 op1->type->refCount++;
2642 }
2643 return 1;
2644 }
2645
2646 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2647 {
2648 long long value2 = op2->__anon1.i64;
2649
2650 exp->type = 2;
2651 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
2652 if(!exp->expType)
2653 {
2654 exp->expType = op1->type;
2655 if(op1->type)
2656 op1->type->refCount++;
2657 }
2658 return 1;
2659 }
2660
2661 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2662 {
2663 uint64 value2 = op2->__anon1.ui64;
2664
2665 exp->type = 2;
2666 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
2667 if(!exp->expType)
2668 {
2669 exp->expType = op1->type;
2670 if(op1->type)
2671 op1->type->refCount++;
2672 }
2673 return 1;
2674 }
2675
2676 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2677 {
2678 short value2 = op2->__anon1.s;
2679
2680 exp->type = 2;
2681 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s - value2));
2682 if(!exp->expType)
2683 {
2684 exp->expType = op1->type;
2685 if(op1->type)
2686 op1->type->refCount++;
2687 }
2688 return 1;
2689 }
2690
2691 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2692 {
2693 unsigned short value2 = op2->__anon1.us;
2694
2695 exp->type = 2;
2696 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us - value2));
2697 if(!exp->expType)
2698 {
2699 exp->expType = op1->type;
2700 if(op1->type)
2701 op1->type->refCount++;
2702 }
2703 return 1;
2704 }
2705
2706 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2707 {
2708 char value2 = op2->__anon1.c;
2709
2710 exp->type = 2;
2711 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c - value2));
2712 if(!exp->expType)
2713 {
2714 exp->expType = op1->type;
2715 if(op1->type)
2716 op1->type->refCount++;
2717 }
2718 return 1;
2719 }
2720
2721 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2722 {
2723 unsigned char value2 = op2->__anon1.uc;
2724
2725 exp->type = 2;
2726 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc - value2));
2727 if(!exp->expType)
2728 {
2729 exp->expType = op1->type;
2730 if(op1->type)
2731 op1->type->refCount++;
2732 }
2733 return 1;
2734 }
2735
2736 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2737 {
2738 float value2 = op2->__anon1.f;
2739
2740 exp->type = 2;
2741 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
2742 if(!exp->expType)
2743 {
2744 exp->expType = op1->type;
2745 if(op1->type)
2746 op1->type->refCount++;
2747 }
2748 return 1;
2749 }
2750
2751 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2752 {
2753 double value2 = op2->__anon1.d;
2754
2755 exp->type = 2;
2756 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
2757 if(!exp->expType)
2758 {
2759 exp->expType = op1->type;
2760 if(op1->type)
2761 op1->type->refCount++;
2762 }
2763 return 1;
2764 }
2765
2766 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2767 {
2768 int value2 = op2->__anon1.i;
2769
2770 exp->type = 2;
2771 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
2772 if(!exp->expType)
2773 {
2774 exp->expType = op1->type;
2775 if(op1->type)
2776 op1->type->refCount++;
2777 }
2778 return 1;
2779 }
2780
2781 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2782 {
2783 unsigned int value2 = op2->__anon1.ui;
2784
2785 exp->type = 2;
2786 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
2787 if(!exp->expType)
2788 {
2789 exp->expType = op1->type;
2790 if(op1->type)
2791 op1->type->refCount++;
2792 }
2793 return 1;
2794 }
2795
2796 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2797 {
2798 long long value2 = op2->__anon1.i64;
2799
2800 exp->type = 2;
2801 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
2802 if(!exp->expType)
2803 {
2804 exp->expType = op1->type;
2805 if(op1->type)
2806 op1->type->refCount++;
2807 }
2808 return 1;
2809 }
2810
2811 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2812 {
2813 uint64 value2 = op2->__anon1.ui64;
2814
2815 exp->type = 2;
2816 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
2817 if(!exp->expType)
2818 {
2819 exp->expType = op1->type;
2820 if(op1->type)
2821 op1->type->refCount++;
2822 }
2823 return 1;
2824 }
2825
2826 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2827 {
2828 short value2 = op2->__anon1.s;
2829
2830 exp->type = 2;
2831 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s * value2));
2832 if(!exp->expType)
2833 {
2834 exp->expType = op1->type;
2835 if(op1->type)
2836 op1->type->refCount++;
2837 }
2838 return 1;
2839 }
2840
2841 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2842 {
2843 unsigned short value2 = op2->__anon1.us;
2844
2845 exp->type = 2;
2846 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us * value2));
2847 if(!exp->expType)
2848 {
2849 exp->expType = op1->type;
2850 if(op1->type)
2851 op1->type->refCount++;
2852 }
2853 return 1;
2854 }
2855
2856 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2857 {
2858 char value2 = op2->__anon1.c;
2859
2860 exp->type = 2;
2861 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c * value2));
2862 if(!exp->expType)
2863 {
2864 exp->expType = op1->type;
2865 if(op1->type)
2866 op1->type->refCount++;
2867 }
2868 return 1;
2869 }
2870
2871 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2872 {
2873 unsigned char value2 = op2->__anon1.uc;
2874
2875 exp->type = 2;
2876 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc * value2));
2877 if(!exp->expType)
2878 {
2879 exp->expType = op1->type;
2880 if(op1->type)
2881 op1->type->refCount++;
2882 }
2883 return 1;
2884 }
2885
2886 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2887 {
2888 float value2 = op2->__anon1.f;
2889
2890 exp->type = 2;
2891 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
2892 if(!exp->expType)
2893 {
2894 exp->expType = op1->type;
2895 if(op1->type)
2896 op1->type->refCount++;
2897 }
2898 return 1;
2899 }
2900
2901 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2902 {
2903 double value2 = op2->__anon1.d;
2904
2905 exp->type = 2;
2906 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
2907 if(!exp->expType)
2908 {
2909 exp->expType = op1->type;
2910 if(op1->type)
2911 op1->type->refCount++;
2912 }
2913 return 1;
2914 }
2915
2916 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2917 {
2918 int value2 = op2->__anon1.i;
2919
2920 exp->type = 2;
2921 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i / value2)) : 0);
2922 if(!exp->expType)
2923 {
2924 exp->expType = op1->type;
2925 if(op1->type)
2926 op1->type->refCount++;
2927 }
2928 return 1;
2929 }
2930
2931 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2932 {
2933 unsigned int value2 = op2->__anon1.ui;
2934
2935 exp->type = 2;
2936 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui / value2)) : 0);
2937 if(!exp->expType)
2938 {
2939 exp->expType = op1->type;
2940 if(op1->type)
2941 op1->type->refCount++;
2942 }
2943 return 1;
2944 }
2945
2946 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2947 {
2948 long long value2 = op2->__anon1.i64;
2949
2950 exp->type = 2;
2951 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 / value2)) : 0);
2952 if(!exp->expType)
2953 {
2954 exp->expType = op1->type;
2955 if(op1->type)
2956 op1->type->refCount++;
2957 }
2958 return 1;
2959 }
2960
2961 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2962 {
2963 uint64 value2 = op2->__anon1.ui64;
2964
2965 exp->type = 2;
2966 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 / value2)) : 0);
2967 if(!exp->expType)
2968 {
2969 exp->expType = op1->type;
2970 if(op1->type)
2971 op1->type->refCount++;
2972 }
2973 return 1;
2974 }
2975
2976 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2977 {
2978 short value2 = op2->__anon1.s;
2979
2980 exp->type = 2;
2981 exp->__anon1.__anon2.string = PrintShort(value2 ? ((short)(op1->__anon1.s / value2)) : 0);
2982 if(!exp->expType)
2983 {
2984 exp->expType = op1->type;
2985 if(op1->type)
2986 op1->type->refCount++;
2987 }
2988 return 1;
2989 }
2990
2991 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2992 {
2993 unsigned short value2 = op2->__anon1.us;
2994
2995 exp->type = 2;
2996 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((unsigned short)(op1->__anon1.us / value2)) : 0);
2997 if(!exp->expType)
2998 {
2999 exp->expType = op1->type;
3000 if(op1->type)
3001 op1->type->refCount++;
3002 }
3003 return 1;
3004 }
3005
3006 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3007 {
3008 char value2 = op2->__anon1.c;
3009
3010 exp->type = 2;
3011 exp->__anon1.__anon2.string = PrintChar(value2 ? ((char)(op1->__anon1.c / value2)) : 0);
3012 if(!exp->expType)
3013 {
3014 exp->expType = op1->type;
3015 if(op1->type)
3016 op1->type->refCount++;
3017 }
3018 return 1;
3019 }
3020
3021 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3022 {
3023 unsigned char value2 = op2->__anon1.uc;
3024
3025 exp->type = 2;
3026 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((unsigned char)(op1->__anon1.uc / value2)) : 0);
3027 if(!exp->expType)
3028 {
3029 exp->expType = op1->type;
3030 if(op1->type)
3031 op1->type->refCount++;
3032 }
3033 return 1;
3034 }
3035
3036 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3037 {
3038 float value2 = op2->__anon1.f;
3039
3040 exp->type = 2;
3041 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f / value2));
3042 if(!exp->expType)
3043 {
3044 exp->expType = op1->type;
3045 if(op1->type)
3046 op1->type->refCount++;
3047 }
3048 return 1;
3049 }
3050
3051 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3052 {
3053 double value2 = op2->__anon1.d;
3054
3055 exp->type = 2;
3056 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d / value2));
3057 if(!exp->expType)
3058 {
3059 exp->expType = op1->type;
3060 if(op1->type)
3061 op1->type->refCount++;
3062 }
3063 return 1;
3064 }
3065
3066 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3067 {
3068 int value2 = op2->__anon1.i;
3069
3070 exp->type = 2;
3071 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i % value2)) : 0);
3072 if(!exp->expType)
3073 {
3074 exp->expType = op1->type;
3075 if(op1->type)
3076 op1->type->refCount++;
3077 }
3078 return 1;
3079 }
3080
3081 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3082 {
3083 unsigned int value2 = op2->__anon1.ui;
3084
3085 exp->type = 2;
3086 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui % value2)) : 0);
3087 if(!exp->expType)
3088 {
3089 exp->expType = op1->type;
3090 if(op1->type)
3091 op1->type->refCount++;
3092 }
3093 return 1;
3094 }
3095
3096 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3097 {
3098 long long value2 = op2->__anon1.i64;
3099
3100 exp->type = 2;
3101 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 % value2)) : 0);
3102 if(!exp->expType)
3103 {
3104 exp->expType = op1->type;
3105 if(op1->type)
3106 op1->type->refCount++;
3107 }
3108 return 1;
3109 }
3110
3111 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3112 {
3113 uint64 value2 = op2->__anon1.ui64;
3114
3115 exp->type = 2;
3116 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 % value2)) : 0);
3117 if(!exp->expType)
3118 {
3119 exp->expType = op1->type;
3120 if(op1->type)
3121 op1->type->refCount++;
3122 }
3123 return 1;
3124 }
3125
3126 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3127 {
3128 short value2 = op2->__anon1.s;
3129
3130 exp->type = 2;
3131 exp->__anon1.__anon2.string = PrintShort(value2 ? ((short)(op1->__anon1.s % value2)) : 0);
3132 if(!exp->expType)
3133 {
3134 exp->expType = op1->type;
3135 if(op1->type)
3136 op1->type->refCount++;
3137 }
3138 return 1;
3139 }
3140
3141 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3142 {
3143 unsigned short value2 = op2->__anon1.us;
3144
3145 exp->type = 2;
3146 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((unsigned short)(op1->__anon1.us % value2)) : 0);
3147 if(!exp->expType)
3148 {
3149 exp->expType = op1->type;
3150 if(op1->type)
3151 op1->type->refCount++;
3152 }
3153 return 1;
3154 }
3155
3156 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3157 {
3158 char value2 = op2->__anon1.c;
3159
3160 exp->type = 2;
3161 exp->__anon1.__anon2.string = PrintChar(value2 ? ((char)(op1->__anon1.c % value2)) : 0);
3162 if(!exp->expType)
3163 {
3164 exp->expType = op1->type;
3165 if(op1->type)
3166 op1->type->refCount++;
3167 }
3168 return 1;
3169 }
3170
3171 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3172 {
3173 unsigned char value2 = op2->__anon1.uc;
3174
3175 exp->type = 2;
3176 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((unsigned char)(op1->__anon1.uc % value2)) : 0);
3177 if(!exp->expType)
3178 {
3179 exp->expType = op1->type;
3180 if(op1->type)
3181 op1->type->refCount++;
3182 }
3183 return 1;
3184 }
3185
3186 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
3187 {
3188 exp->type = 2;
3189 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
3190 if(!exp->expType)
3191 {
3192 exp->expType = op1->type;
3193 if(op1->type)
3194 op1->type->refCount++;
3195 }
3196 return 1;
3197 }
3198
3199 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
3200 {
3201 exp->type = 2;
3202 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
3203 if(!exp->expType)
3204 {
3205 exp->expType = op1->type;
3206 if(op1->type)
3207 op1->type->refCount++;
3208 }
3209 return 1;
3210 }
3211
3212 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
3213 {
3214 exp->type = 2;
3215 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
3216 if(!exp->expType)
3217 {
3218 exp->expType = op1->type;
3219 if(op1->type)
3220 op1->type->refCount++;
3221 }
3222 return 1;
3223 }
3224
3225 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
3226 {
3227 exp->type = 2;
3228 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
3229 if(!exp->expType)
3230 {
3231 exp->expType = op1->type;
3232 if(op1->type)
3233 op1->type->refCount++;
3234 }
3235 return 1;
3236 }
3237
3238 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
3239 {
3240 exp->type = 2;
3241 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
3242 if(!exp->expType)
3243 {
3244 exp->expType = op1->type;
3245 if(op1->type)
3246 op1->type->refCount++;
3247 }
3248 return 1;
3249 }
3250
3251 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
3252 {
3253 exp->type = 2;
3254 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
3255 if(!exp->expType)
3256 {
3257 exp->expType = op1->type;
3258 if(op1->type)
3259 op1->type->refCount++;
3260 }
3261 return 1;
3262 }
3263
3264 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
3265 {
3266 exp->type = 2;
3267 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
3268 if(!exp->expType)
3269 {
3270 exp->expType = op1->type;
3271 if(op1->type)
3272 op1->type->refCount++;
3273 }
3274 return 1;
3275 }
3276
3277 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
3278 {
3279 exp->type = 2;
3280 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
3281 if(!exp->expType)
3282 {
3283 exp->expType = op1->type;
3284 if(op1->type)
3285 op1->type->refCount++;
3286 }
3287 return 1;
3288 }
3289
3290 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
3291 {
3292 exp->type = 2;
3293 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
3294 if(!exp->expType)
3295 {
3296 exp->expType = op1->type;
3297 if(op1->type)
3298 op1->type->refCount++;
3299 }
3300 return 1;
3301 }
3302
3303 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
3304 {
3305 exp->type = 2;
3306 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
3307 if(!exp->expType)
3308 {
3309 exp->expType = op1->type;
3310 if(op1->type)
3311 op1->type->refCount++;
3312 }
3313 return 1;
3314 }
3315
3316 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
3317 {
3318 exp->type = 2;
3319 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
3320 if(!exp->expType)
3321 {
3322 exp->expType = op1->type;
3323 if(op1->type)
3324 op1->type->refCount++;
3325 }
3326 return 1;
3327 }
3328
3329 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
3330 {
3331 exp->type = 2;
3332 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
3333 if(!exp->expType)
3334 {
3335 exp->expType = op1->type;
3336 if(op1->type)
3337 op1->type->refCount++;
3338 }
3339 return 1;
3340 }
3341
3342 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
3343 {
3344 exp->type = 2;
3345 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
3346 if(!exp->expType)
3347 {
3348 exp->expType = op1->type;
3349 if(op1->type)
3350 op1->type->refCount++;
3351 }
3352 return 1;
3353 }
3354
3355 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
3356 {
3357 exp->type = 2;
3358 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
3359 if(!exp->expType)
3360 {
3361 exp->expType = op1->type;
3362 if(op1->type)
3363 op1->type->refCount++;
3364 }
3365 return 1;
3366 }
3367
3368 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
3369 {
3370 exp->type = 2;
3371 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
3372 if(!exp->expType)
3373 {
3374 exp->expType = op1->type;
3375 if(op1->type)
3376 op1->type->refCount++;
3377 }
3378 return 1;
3379 }
3380
3381 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
3382 {
3383 exp->type = 2;
3384 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
3385 if(!exp->expType)
3386 {
3387 exp->expType = op1->type;
3388 if(op1->type)
3389 op1->type->refCount++;
3390 }
3391 return 1;
3392 }
3393
3394 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
3395 {
3396 exp->type = 2;
3397 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
3398 if(!exp->expType)
3399 {
3400 exp->expType = op1->type;
3401 if(op1->type)
3402 op1->type->refCount++;
3403 }
3404 return 1;
3405 }
3406
3407 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
3408 {
3409 exp->type = 2;
3410 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
3411 if(!exp->expType)
3412 {
3413 exp->expType = op1->type;
3414 if(op1->type)
3415 op1->type->refCount++;
3416 }
3417 return 1;
3418 }
3419
3420 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
3421 {
3422 exp->type = 2;
3423 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
3424 if(!exp->expType)
3425 {
3426 exp->expType = op1->type;
3427 if(op1->type)
3428 op1->type->refCount++;
3429 }
3430 return 1;
3431 }
3432
3433 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
3434 {
3435 exp->type = 2;
3436 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
3437 if(!exp->expType)
3438 {
3439 exp->expType = op1->type;
3440 if(op1->type)
3441 op1->type->refCount++;
3442 }
3443 return 1;
3444 }
3445
3446 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
3447 {
3448 exp->type = 2;
3449 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
3450 if(!exp->expType)
3451 {
3452 exp->expType = op1->type;
3453 if(op1->type)
3454 op1->type->refCount++;
3455 }
3456 return 1;
3457 }
3458
3459 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
3460 {
3461 exp->type = 2;
3462 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
3463 if(!exp->expType)
3464 {
3465 exp->expType = op1->type;
3466 if(op1->type)
3467 op1->type->refCount++;
3468 }
3469 return 1;
3470 }
3471
3472 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
3473 {
3474 exp->type = 2;
3475 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
3476 if(!exp->expType)
3477 {
3478 exp->expType = op1->type;
3479 if(op1->type)
3480 op1->type->refCount++;
3481 }
3482 return 1;
3483 }
3484
3485 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
3486 {
3487 exp->type = 2;
3488 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
3489 if(!exp->expType)
3490 {
3491 exp->expType = op1->type;
3492 if(op1->type)
3493 op1->type->refCount++;
3494 }
3495 return 1;
3496 }
3497
3498 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
3499 {
3500 exp->type = 2;
3501 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
3502 if(!exp->expType)
3503 {
3504 exp->expType = op1->type;
3505 if(op1->type)
3506 op1->type->refCount++;
3507 }
3508 return 1;
3509 }
3510
3511 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
3512 {
3513 exp->type = 2;
3514 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
3515 if(!exp->expType)
3516 {
3517 exp->expType = op1->type;
3518 if(op1->type)
3519 op1->type->refCount++;
3520 }
3521 return 1;
3522 }
3523
3524 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
3525 {
3526 exp->type = 2;
3527 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
3528 if(!exp->expType)
3529 {
3530 exp->expType = op1->type;
3531 if(op1->type)
3532 op1->type->refCount++;
3533 }
3534 return 1;
3535 }
3536
3537 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
3538 {
3539 exp->type = 2;
3540 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
3541 if(!exp->expType)
3542 {
3543 exp->expType = op1->type;
3544 if(op1->type)
3545 op1->type->refCount++;
3546 }
3547 return 1;
3548 }
3549
3550 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
3551 {
3552 exp->type = 2;
3553 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
3554 if(!exp->expType)
3555 {
3556 exp->expType = op1->type;
3557 if(op1->type)
3558 op1->type->refCount++;
3559 }
3560 return 1;
3561 }
3562
3563 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
3564 {
3565 exp->type = 2;
3566 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
3567 if(!exp->expType)
3568 {
3569 exp->expType = op1->type;
3570 if(op1->type)
3571 op1->type->refCount++;
3572 }
3573 return 1;
3574 }
3575
3576 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3577 {
3578 int value2 = op2->__anon1.i;
3579
3580 exp->type = 2;
3581 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
3582 if(!exp->expType)
3583 {
3584 exp->expType = op1->type;
3585 if(op1->type)
3586 op1->type->refCount++;
3587 }
3588 return 1;
3589 }
3590
3591 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3592 {
3593 unsigned int value2 = op2->__anon1.ui;
3594
3595 exp->type = 2;
3596 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
3597 if(!exp->expType)
3598 {
3599 exp->expType = op1->type;
3600 if(op1->type)
3601 op1->type->refCount++;
3602 }
3603 return 1;
3604 }
3605
3606 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3607 {
3608 long long value2 = op2->__anon1.i64;
3609
3610 exp->type = 2;
3611 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
3612 if(!exp->expType)
3613 {
3614 exp->expType = op1->type;
3615 if(op1->type)
3616 op1->type->refCount++;
3617 }
3618 return 1;
3619 }
3620
3621 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3622 {
3623 uint64 value2 = op2->__anon1.ui64;
3624
3625 exp->type = 2;
3626 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
3627 if(!exp->expType)
3628 {
3629 exp->expType = op1->type;
3630 if(op1->type)
3631 op1->type->refCount++;
3632 }
3633 return 1;
3634 }
3635
3636 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3637 {
3638 short value2 = op2->__anon1.s;
3639
3640 exp->type = 2;
3641 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
3642 if(!exp->expType)
3643 {
3644 exp->expType = op1->type;
3645 if(op1->type)
3646 op1->type->refCount++;
3647 }
3648 return 1;
3649 }
3650
3651 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3652 {
3653 unsigned short value2 = op2->__anon1.us;
3654
3655 exp->type = 2;
3656 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
3657 if(!exp->expType)
3658 {
3659 exp->expType = op1->type;
3660 if(op1->type)
3661 op1->type->refCount++;
3662 }
3663 return 1;
3664 }
3665
3666 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3667 {
3668 char value2 = op2->__anon1.c;
3669
3670 exp->type = 2;
3671 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
3672 if(!exp->expType)
3673 {
3674 exp->expType = op1->type;
3675 if(op1->type)
3676 op1->type->refCount++;
3677 }
3678 return 1;
3679 }
3680
3681 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3682 {
3683 unsigned char value2 = op2->__anon1.uc;
3684
3685 exp->type = 2;
3686 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
3687 if(!exp->expType)
3688 {
3689 exp->expType = op1->type;
3690 if(op1->type)
3691 op1->type->refCount++;
3692 }
3693 return 1;
3694 }
3695
3696 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3697 {
3698 float value2 = op2->__anon1.f;
3699
3700 exp->type = 2;
3701 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
3702 if(!exp->expType)
3703 {
3704 exp->expType = op1->type;
3705 if(op1->type)
3706 op1->type->refCount++;
3707 }
3708 return 1;
3709 }
3710
3711 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3712 {
3713 double value2 = op2->__anon1.d;
3714
3715 exp->type = 2;
3716 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
3717 if(!exp->expType)
3718 {
3719 exp->expType = op1->type;
3720 if(op1->type)
3721 op1->type->refCount++;
3722 }
3723 return 1;
3724 }
3725
3726 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3727 {
3728 int value2 = op2->__anon1.i;
3729
3730 exp->type = 2;
3731 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
3732 if(!exp->expType)
3733 {
3734 exp->expType = op1->type;
3735 if(op1->type)
3736 op1->type->refCount++;
3737 }
3738 return 1;
3739 }
3740
3741 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3742 {
3743 unsigned int value2 = op2->__anon1.ui;
3744
3745 exp->type = 2;
3746 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
3747 if(!exp->expType)
3748 {
3749 exp->expType = op1->type;
3750 if(op1->type)
3751 op1->type->refCount++;
3752 }
3753 return 1;
3754 }
3755
3756 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3757 {
3758 long long value2 = op2->__anon1.i64;
3759
3760 exp->type = 2;
3761 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
3762 if(!exp->expType)
3763 {
3764 exp->expType = op1->type;
3765 if(op1->type)
3766 op1->type->refCount++;
3767 }
3768 return 1;
3769 }
3770
3771 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3772 {
3773 uint64 value2 = op2->__anon1.ui64;
3774
3775 exp->type = 2;
3776 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
3777 if(!exp->expType)
3778 {
3779 exp->expType = op1->type;
3780 if(op1->type)
3781 op1->type->refCount++;
3782 }
3783 return 1;
3784 }
3785
3786 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3787 {
3788 short value2 = op2->__anon1.s;
3789
3790 exp->type = 2;
3791 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
3792 if(!exp->expType)
3793 {
3794 exp->expType = op1->type;
3795 if(op1->type)
3796 op1->type->refCount++;
3797 }
3798 return 1;
3799 }
3800
3801 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3802 {
3803 unsigned short value2 = op2->__anon1.us;
3804
3805 exp->type = 2;
3806 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
3807 if(!exp->expType)
3808 {
3809 exp->expType = op1->type;
3810 if(op1->type)
3811 op1->type->refCount++;
3812 }
3813 return 1;
3814 }
3815
3816 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3817 {
3818 char value2 = op2->__anon1.c;
3819
3820 exp->type = 2;
3821 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
3822 if(!exp->expType)
3823 {
3824 exp->expType = op1->type;
3825 if(op1->type)
3826 op1->type->refCount++;
3827 }
3828 return 1;
3829 }
3830
3831 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3832 {
3833 unsigned char value2 = op2->__anon1.uc;
3834
3835 exp->type = 2;
3836 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
3837 if(!exp->expType)
3838 {
3839 exp->expType = op1->type;
3840 if(op1->type)
3841 op1->type->refCount++;
3842 }
3843 return 1;
3844 }
3845
3846 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3847 {
3848 float value2 = op2->__anon1.f;
3849
3850 exp->type = 2;
3851 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
3852 if(!exp->expType)
3853 {
3854 exp->expType = op1->type;
3855 if(op1->type)
3856 op1->type->refCount++;
3857 }
3858 return 1;
3859 }
3860
3861 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3862 {
3863 double value2 = op2->__anon1.d;
3864
3865 exp->type = 2;
3866 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
3867 if(!exp->expType)
3868 {
3869 exp->expType = op1->type;
3870 if(op1->type)
3871 op1->type->refCount++;
3872 }
3873 return 1;
3874 }
3875
3876 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3877 {
3878 int value2 = op2->__anon1.i;
3879
3880 exp->type = 2;
3881 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
3882 if(!exp->expType)
3883 {
3884 exp->expType = op1->type;
3885 if(op1->type)
3886 op1->type->refCount++;
3887 }
3888 return 1;
3889 }
3890
3891 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3892 {
3893 unsigned int value2 = op2->__anon1.ui;
3894
3895 exp->type = 2;
3896 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
3897 if(!exp->expType)
3898 {
3899 exp->expType = op1->type;
3900 if(op1->type)
3901 op1->type->refCount++;
3902 }
3903 return 1;
3904 }
3905
3906 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3907 {
3908 long long value2 = op2->__anon1.i64;
3909
3910 exp->type = 2;
3911 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
3912 if(!exp->expType)
3913 {
3914 exp->expType = op1->type;
3915 if(op1->type)
3916 op1->type->refCount++;
3917 }
3918 return 1;
3919 }
3920
3921 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3922 {
3923 uint64 value2 = op2->__anon1.ui64;
3924
3925 exp->type = 2;
3926 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
3927 if(!exp->expType)
3928 {
3929 exp->expType = op1->type;
3930 if(op1->type)
3931 op1->type->refCount++;
3932 }
3933 return 1;
3934 }
3935
3936 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3937 {
3938 short value2 = op2->__anon1.s;
3939
3940 exp->type = 2;
3941 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
3942 if(!exp->expType)
3943 {
3944 exp->expType = op1->type;
3945 if(op1->type)
3946 op1->type->refCount++;
3947 }
3948 return 1;
3949 }
3950
3951 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3952 {
3953 unsigned short value2 = op2->__anon1.us;
3954
3955 exp->type = 2;
3956 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
3957 if(!exp->expType)
3958 {
3959 exp->expType = op1->type;
3960 if(op1->type)
3961 op1->type->refCount++;
3962 }
3963 return 1;
3964 }
3965
3966 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3967 {
3968 char value2 = op2->__anon1.c;
3969
3970 exp->type = 2;
3971 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
3972 if(!exp->expType)
3973 {
3974 exp->expType = op1->type;
3975 if(op1->type)
3976 op1->type->refCount++;
3977 }
3978 return 1;
3979 }
3980
3981 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3982 {
3983 unsigned char value2 = op2->__anon1.uc;
3984
3985 exp->type = 2;
3986 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
3987 if(!exp->expType)
3988 {
3989 exp->expType = op1->type;
3990 if(op1->type)
3991 op1->type->refCount++;
3992 }
3993 return 1;
3994 }
3995
3996 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3997 {
3998 float value2 = op2->__anon1.f;
3999
4000 exp->type = 2;
4001 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
4002 if(!exp->expType)
4003 {
4004 exp->expType = op1->type;
4005 if(op1->type)
4006 op1->type->refCount++;
4007 }
4008 return 1;
4009 }
4010
4011 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4012 {
4013 double value2 = op2->__anon1.d;
4014
4015 exp->type = 2;
4016 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
4017 if(!exp->expType)
4018 {
4019 exp->expType = op1->type;
4020 if(op1->type)
4021 op1->type->refCount++;
4022 }
4023 return 1;
4024 }
4025
4026 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4027 {
4028 int value2 = op2->__anon1.i;
4029
4030 exp->type = 2;
4031 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
4032 if(!exp->expType)
4033 {
4034 exp->expType = op1->type;
4035 if(op1->type)
4036 op1->type->refCount++;
4037 }
4038 return 1;
4039 }
4040
4041 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4042 {
4043 unsigned int value2 = op2->__anon1.ui;
4044
4045 exp->type = 2;
4046 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
4047 if(!exp->expType)
4048 {
4049 exp->expType = op1->type;
4050 if(op1->type)
4051 op1->type->refCount++;
4052 }
4053 return 1;
4054 }
4055
4056 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4057 {
4058 long long value2 = op2->__anon1.i64;
4059
4060 exp->type = 2;
4061 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
4062 if(!exp->expType)
4063 {
4064 exp->expType = op1->type;
4065 if(op1->type)
4066 op1->type->refCount++;
4067 }
4068 return 1;
4069 }
4070
4071 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4072 {
4073 uint64 value2 = op2->__anon1.ui64;
4074
4075 exp->type = 2;
4076 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
4077 if(!exp->expType)
4078 {
4079 exp->expType = op1->type;
4080 if(op1->type)
4081 op1->type->refCount++;
4082 }
4083 return 1;
4084 }
4085
4086 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4087 {
4088 short value2 = op2->__anon1.s;
4089
4090 exp->type = 2;
4091 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
4092 if(!exp->expType)
4093 {
4094 exp->expType = op1->type;
4095 if(op1->type)
4096 op1->type->refCount++;
4097 }
4098 return 1;
4099 }
4100
4101 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4102 {
4103 unsigned short value2 = op2->__anon1.us;
4104
4105 exp->type = 2;
4106 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
4107 if(!exp->expType)
4108 {
4109 exp->expType = op1->type;
4110 if(op1->type)
4111 op1->type->refCount++;
4112 }
4113 return 1;
4114 }
4115
4116 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4117 {
4118 char value2 = op2->__anon1.c;
4119
4120 exp->type = 2;
4121 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
4122 if(!exp->expType)
4123 {
4124 exp->expType = op1->type;
4125 if(op1->type)
4126 op1->type->refCount++;
4127 }
4128 return 1;
4129 }
4130
4131 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4132 {
4133 unsigned char value2 = op2->__anon1.uc;
4134
4135 exp->type = 2;
4136 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
4137 if(!exp->expType)
4138 {
4139 exp->expType = op1->type;
4140 if(op1->type)
4141 op1->type->refCount++;
4142 }
4143 return 1;
4144 }
4145
4146 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4147 {
4148 float value2 = op2->__anon1.f;
4149
4150 exp->type = 2;
4151 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
4152 if(!exp->expType)
4153 {
4154 exp->expType = op1->type;
4155 if(op1->type)
4156 op1->type->refCount++;
4157 }
4158 return 1;
4159 }
4160
4161 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4162 {
4163 double value2 = op2->__anon1.d;
4164
4165 exp->type = 2;
4166 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
4167 if(!exp->expType)
4168 {
4169 exp->expType = op1->type;
4170 if(op1->type)
4171 op1->type->refCount++;
4172 }
4173 return 1;
4174 }
4175
4176 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4177 {
4178 int value2 = op2->__anon1.i;
4179
4180 exp->type = 2;
4181 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i /= value2)) : 0);
4182 if(!exp->expType)
4183 {
4184 exp->expType = op1->type;
4185 if(op1->type)
4186 op1->type->refCount++;
4187 }
4188 return 1;
4189 }
4190
4191 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4192 {
4193 unsigned int value2 = op2->__anon1.ui;
4194
4195 exp->type = 2;
4196 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui /= value2)) : 0);
4197 if(!exp->expType)
4198 {
4199 exp->expType = op1->type;
4200 if(op1->type)
4201 op1->type->refCount++;
4202 }
4203 return 1;
4204 }
4205
4206 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4207 {
4208 long long value2 = op2->__anon1.i64;
4209
4210 exp->type = 2;
4211 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 /= value2)) : 0);
4212 if(!exp->expType)
4213 {
4214 exp->expType = op1->type;
4215 if(op1->type)
4216 op1->type->refCount++;
4217 }
4218 return 1;
4219 }
4220
4221 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4222 {
4223 uint64 value2 = op2->__anon1.ui64;
4224
4225 exp->type = 2;
4226 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 /= value2)) : 0);
4227 if(!exp->expType)
4228 {
4229 exp->expType = op1->type;
4230 if(op1->type)
4231 op1->type->refCount++;
4232 }
4233 return 1;
4234 }
4235
4236 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4237 {
4238 short value2 = op2->__anon1.s;
4239
4240 exp->type = 2;
4241 exp->__anon1.__anon2.string = PrintShort(value2 ? ((op1->__anon1.s /= value2)) : 0);
4242 if(!exp->expType)
4243 {
4244 exp->expType = op1->type;
4245 if(op1->type)
4246 op1->type->refCount++;
4247 }
4248 return 1;
4249 }
4250
4251 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4252 {
4253 unsigned short value2 = op2->__anon1.us;
4254
4255 exp->type = 2;
4256 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((op1->__anon1.us /= value2)) : 0);
4257 if(!exp->expType)
4258 {
4259 exp->expType = op1->type;
4260 if(op1->type)
4261 op1->type->refCount++;
4262 }
4263 return 1;
4264 }
4265
4266 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4267 {
4268 char value2 = op2->__anon1.c;
4269
4270 exp->type = 2;
4271 exp->__anon1.__anon2.string = PrintChar(value2 ? ((op1->__anon1.c /= value2)) : 0);
4272 if(!exp->expType)
4273 {
4274 exp->expType = op1->type;
4275 if(op1->type)
4276 op1->type->refCount++;
4277 }
4278 return 1;
4279 }
4280
4281 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4282 {
4283 unsigned char value2 = op2->__anon1.uc;
4284
4285 exp->type = 2;
4286 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((op1->__anon1.uc /= value2)) : 0);
4287 if(!exp->expType)
4288 {
4289 exp->expType = op1->type;
4290 if(op1->type)
4291 op1->type->refCount++;
4292 }
4293 return 1;
4294 }
4295
4296 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4297 {
4298 float value2 = op2->__anon1.f;
4299
4300 exp->type = 2;
4301 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f /= value2));
4302 if(!exp->expType)
4303 {
4304 exp->expType = op1->type;
4305 if(op1->type)
4306 op1->type->refCount++;
4307 }
4308 return 1;
4309 }
4310
4311 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4312 {
4313 double value2 = op2->__anon1.d;
4314
4315 exp->type = 2;
4316 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d /= value2));
4317 if(!exp->expType)
4318 {
4319 exp->expType = op1->type;
4320 if(op1->type)
4321 op1->type->refCount++;
4322 }
4323 return 1;
4324 }
4325
4326 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4327 {
4328 int value2 = op2->__anon1.i;
4329
4330 exp->type = 2;
4331 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i %= value2)) : 0);
4332 if(!exp->expType)
4333 {
4334 exp->expType = op1->type;
4335 if(op1->type)
4336 op1->type->refCount++;
4337 }
4338 return 1;
4339 }
4340
4341 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4342 {
4343 unsigned int value2 = op2->__anon1.ui;
4344
4345 exp->type = 2;
4346 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui %= value2)) : 0);
4347 if(!exp->expType)
4348 {
4349 exp->expType = op1->type;
4350 if(op1->type)
4351 op1->type->refCount++;
4352 }
4353 return 1;
4354 }
4355
4356 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4357 {
4358 long long value2 = op2->__anon1.i64;
4359
4360 exp->type = 2;
4361 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 %= value2)) : 0);
4362 if(!exp->expType)
4363 {
4364 exp->expType = op1->type;
4365 if(op1->type)
4366 op1->type->refCount++;
4367 }
4368 return 1;
4369 }
4370
4371 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4372 {
4373 uint64 value2 = op2->__anon1.ui64;
4374
4375 exp->type = 2;
4376 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 %= value2)) : 0);
4377 if(!exp->expType)
4378 {
4379 exp->expType = op1->type;
4380 if(op1->type)
4381 op1->type->refCount++;
4382 }
4383 return 1;
4384 }
4385
4386 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4387 {
4388 short value2 = op2->__anon1.s;
4389
4390 exp->type = 2;
4391 exp->__anon1.__anon2.string = PrintShort(value2 ? ((op1->__anon1.s %= value2)) : 0);
4392 if(!exp->expType)
4393 {
4394 exp->expType = op1->type;
4395 if(op1->type)
4396 op1->type->refCount++;
4397 }
4398 return 1;
4399 }
4400
4401 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4402 {
4403 unsigned short value2 = op2->__anon1.us;
4404
4405 exp->type = 2;
4406 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((op1->__anon1.us %= value2)) : 0);
4407 if(!exp->expType)
4408 {
4409 exp->expType = op1->type;
4410 if(op1->type)
4411 op1->type->refCount++;
4412 }
4413 return 1;
4414 }
4415
4416 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4417 {
4418 char value2 = op2->__anon1.c;
4419
4420 exp->type = 2;
4421 exp->__anon1.__anon2.string = PrintChar(value2 ? ((op1->__anon1.c %= value2)) : 0);
4422 if(!exp->expType)
4423 {
4424 exp->expType = op1->type;
4425 if(op1->type)
4426 op1->type->refCount++;
4427 }
4428 return 1;
4429 }
4430
4431 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4432 {
4433 unsigned char value2 = op2->__anon1.uc;
4434
4435 exp->type = 2;
4436 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((op1->__anon1.uc %= value2)) : 0);
4437 if(!exp->expType)
4438 {
4439 exp->expType = op1->type;
4440 if(op1->type)
4441 op1->type->refCount++;
4442 }
4443 return 1;
4444 }
4445
4446 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4447 {
4448 int value2 = op2->__anon1.i;
4449
4450 exp->type = 2;
4451 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
4452 if(!exp->expType)
4453 {
4454 exp->expType = op1->type;
4455 if(op1->type)
4456 op1->type->refCount++;
4457 }
4458 return 1;
4459 }
4460
4461 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4462 {
4463 unsigned int value2 = op2->__anon1.ui;
4464
4465 exp->type = 2;
4466 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
4467 if(!exp->expType)
4468 {
4469 exp->expType = op1->type;
4470 if(op1->type)
4471 op1->type->refCount++;
4472 }
4473 return 1;
4474 }
4475
4476 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4477 {
4478 long long value2 = op2->__anon1.i64;
4479
4480 exp->type = 2;
4481 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
4482 if(!exp->expType)
4483 {
4484 exp->expType = op1->type;
4485 if(op1->type)
4486 op1->type->refCount++;
4487 }
4488 return 1;
4489 }
4490
4491 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4492 {
4493 uint64 value2 = op2->__anon1.ui64;
4494
4495 exp->type = 2;
4496 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
4497 if(!exp->expType)
4498 {
4499 exp->expType = op1->type;
4500 if(op1->type)
4501 op1->type->refCount++;
4502 }
4503 return 1;
4504 }
4505
4506 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4507 {
4508 short value2 = op2->__anon1.s;
4509
4510 exp->type = 2;
4511 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s & value2));
4512 if(!exp->expType)
4513 {
4514 exp->expType = op1->type;
4515 if(op1->type)
4516 op1->type->refCount++;
4517 }
4518 return 1;
4519 }
4520
4521 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4522 {
4523 unsigned short value2 = op2->__anon1.us;
4524
4525 exp->type = 2;
4526 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us & value2));
4527 if(!exp->expType)
4528 {
4529 exp->expType = op1->type;
4530 if(op1->type)
4531 op1->type->refCount++;
4532 }
4533 return 1;
4534 }
4535
4536 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4537 {
4538 char value2 = op2->__anon1.c;
4539
4540 exp->type = 2;
4541 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c & value2));
4542 if(!exp->expType)
4543 {
4544 exp->expType = op1->type;
4545 if(op1->type)
4546 op1->type->refCount++;
4547 }
4548 return 1;
4549 }
4550
4551 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4552 {
4553 unsigned char value2 = op2->__anon1.uc;
4554
4555 exp->type = 2;
4556 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc & value2));
4557 if(!exp->expType)
4558 {
4559 exp->expType = op1->type;
4560 if(op1->type)
4561 op1->type->refCount++;
4562 }
4563 return 1;
4564 }
4565
4566 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4567 {
4568 int value2 = op2->__anon1.i;
4569
4570 exp->type = 2;
4571 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
4572 if(!exp->expType)
4573 {
4574 exp->expType = op1->type;
4575 if(op1->type)
4576 op1->type->refCount++;
4577 }
4578 return 1;
4579 }
4580
4581 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4582 {
4583 unsigned int value2 = op2->__anon1.ui;
4584
4585 exp->type = 2;
4586 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
4587 if(!exp->expType)
4588 {
4589 exp->expType = op1->type;
4590 if(op1->type)
4591 op1->type->refCount++;
4592 }
4593 return 1;
4594 }
4595
4596 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4597 {
4598 long long value2 = op2->__anon1.i64;
4599
4600 exp->type = 2;
4601 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
4602 if(!exp->expType)
4603 {
4604 exp->expType = op1->type;
4605 if(op1->type)
4606 op1->type->refCount++;
4607 }
4608 return 1;
4609 }
4610
4611 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4612 {
4613 uint64 value2 = op2->__anon1.ui64;
4614
4615 exp->type = 2;
4616 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
4617 if(!exp->expType)
4618 {
4619 exp->expType = op1->type;
4620 if(op1->type)
4621 op1->type->refCount++;
4622 }
4623 return 1;
4624 }
4625
4626 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4627 {
4628 short value2 = op2->__anon1.s;
4629
4630 exp->type = 2;
4631 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s | value2));
4632 if(!exp->expType)
4633 {
4634 exp->expType = op1->type;
4635 if(op1->type)
4636 op1->type->refCount++;
4637 }
4638 return 1;
4639 }
4640
4641 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4642 {
4643 unsigned short value2 = op2->__anon1.us;
4644
4645 exp->type = 2;
4646 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us | value2));
4647 if(!exp->expType)
4648 {
4649 exp->expType = op1->type;
4650 if(op1->type)
4651 op1->type->refCount++;
4652 }
4653 return 1;
4654 }
4655
4656 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4657 {
4658 char value2 = op2->__anon1.c;
4659
4660 exp->type = 2;
4661 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c | value2));
4662 if(!exp->expType)
4663 {
4664 exp->expType = op1->type;
4665 if(op1->type)
4666 op1->type->refCount++;
4667 }
4668 return 1;
4669 }
4670
4671 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4672 {
4673 unsigned char value2 = op2->__anon1.uc;
4674
4675 exp->type = 2;
4676 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc | value2));
4677 if(!exp->expType)
4678 {
4679 exp->expType = op1->type;
4680 if(op1->type)
4681 op1->type->refCount++;
4682 }
4683 return 1;
4684 }
4685
4686 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4687 {
4688 int value2 = op2->__anon1.i;
4689
4690 exp->type = 2;
4691 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
4692 if(!exp->expType)
4693 {
4694 exp->expType = op1->type;
4695 if(op1->type)
4696 op1->type->refCount++;
4697 }
4698 return 1;
4699 }
4700
4701 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4702 {
4703 unsigned int value2 = op2->__anon1.ui;
4704
4705 exp->type = 2;
4706 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
4707 if(!exp->expType)
4708 {
4709 exp->expType = op1->type;
4710 if(op1->type)
4711 op1->type->refCount++;
4712 }
4713 return 1;
4714 }
4715
4716 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4717 {
4718 long long value2 = op2->__anon1.i64;
4719
4720 exp->type = 2;
4721 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
4722 if(!exp->expType)
4723 {
4724 exp->expType = op1->type;
4725 if(op1->type)
4726 op1->type->refCount++;
4727 }
4728 return 1;
4729 }
4730
4731 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4732 {
4733 uint64 value2 = op2->__anon1.ui64;
4734
4735 exp->type = 2;
4736 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
4737 if(!exp->expType)
4738 {
4739 exp->expType = op1->type;
4740 if(op1->type)
4741 op1->type->refCount++;
4742 }
4743 return 1;
4744 }
4745
4746 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4747 {
4748 short value2 = op2->__anon1.s;
4749
4750 exp->type = 2;
4751 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s ^ value2));
4752 if(!exp->expType)
4753 {
4754 exp->expType = op1->type;
4755 if(op1->type)
4756 op1->type->refCount++;
4757 }
4758 return 1;
4759 }
4760
4761 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4762 {
4763 unsigned short value2 = op2->__anon1.us;
4764
4765 exp->type = 2;
4766 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us ^ value2));
4767 if(!exp->expType)
4768 {
4769 exp->expType = op1->type;
4770 if(op1->type)
4771 op1->type->refCount++;
4772 }
4773 return 1;
4774 }
4775
4776 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4777 {
4778 char value2 = op2->__anon1.c;
4779
4780 exp->type = 2;
4781 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c ^ value2));
4782 if(!exp->expType)
4783 {
4784 exp->expType = op1->type;
4785 if(op1->type)
4786 op1->type->refCount++;
4787 }
4788 return 1;
4789 }
4790
4791 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4792 {
4793 unsigned char value2 = op2->__anon1.uc;
4794
4795 exp->type = 2;
4796 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc ^ value2));
4797 if(!exp->expType)
4798 {
4799 exp->expType = op1->type;
4800 if(op1->type)
4801 op1->type->refCount++;
4802 }
4803 return 1;
4804 }
4805
4806 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4807 {
4808 int value2 = op2->__anon1.i;
4809
4810 exp->type = 2;
4811 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
4812 if(!exp->expType)
4813 {
4814 exp->expType = op1->type;
4815 if(op1->type)
4816 op1->type->refCount++;
4817 }
4818 return 1;
4819 }
4820
4821 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4822 {
4823 unsigned int value2 = op2->__anon1.ui;
4824
4825 exp->type = 2;
4826 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
4827 if(!exp->expType)
4828 {
4829 exp->expType = op1->type;
4830 if(op1->type)
4831 op1->type->refCount++;
4832 }
4833 return 1;
4834 }
4835
4836 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4837 {
4838 long long value2 = op2->__anon1.i64;
4839
4840 exp->type = 2;
4841 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
4842 if(!exp->expType)
4843 {
4844 exp->expType = op1->type;
4845 if(op1->type)
4846 op1->type->refCount++;
4847 }
4848 return 1;
4849 }
4850
4851 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4852 {
4853 uint64 value2 = op2->__anon1.ui64;
4854
4855 exp->type = 2;
4856 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
4857 if(!exp->expType)
4858 {
4859 exp->expType = op1->type;
4860 if(op1->type)
4861 op1->type->refCount++;
4862 }
4863 return 1;
4864 }
4865
4866 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4867 {
4868 short value2 = op2->__anon1.s;
4869
4870 exp->type = 2;
4871 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s << value2));
4872 if(!exp->expType)
4873 {
4874 exp->expType = op1->type;
4875 if(op1->type)
4876 op1->type->refCount++;
4877 }
4878 return 1;
4879 }
4880
4881 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4882 {
4883 unsigned short value2 = op2->__anon1.us;
4884
4885 exp->type = 2;
4886 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us << value2));
4887 if(!exp->expType)
4888 {
4889 exp->expType = op1->type;
4890 if(op1->type)
4891 op1->type->refCount++;
4892 }
4893 return 1;
4894 }
4895
4896 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4897 {
4898 char value2 = op2->__anon1.c;
4899
4900 exp->type = 2;
4901 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c << value2));
4902 if(!exp->expType)
4903 {
4904 exp->expType = op1->type;
4905 if(op1->type)
4906 op1->type->refCount++;
4907 }
4908 return 1;
4909 }
4910
4911 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4912 {
4913 unsigned char value2 = op2->__anon1.uc;
4914
4915 exp->type = 2;
4916 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc << value2));
4917 if(!exp->expType)
4918 {
4919 exp->expType = op1->type;
4920 if(op1->type)
4921 op1->type->refCount++;
4922 }
4923 return 1;
4924 }
4925
4926 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4927 {
4928 int value2 = op2->__anon1.i;
4929
4930 exp->type = 2;
4931 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
4932 if(!exp->expType)
4933 {
4934 exp->expType = op1->type;
4935 if(op1->type)
4936 op1->type->refCount++;
4937 }
4938 return 1;
4939 }
4940
4941 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4942 {
4943 unsigned int value2 = op2->__anon1.ui;
4944
4945 exp->type = 2;
4946 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
4947 if(!exp->expType)
4948 {
4949 exp->expType = op1->type;
4950 if(op1->type)
4951 op1->type->refCount++;
4952 }
4953 return 1;
4954 }
4955
4956 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4957 {
4958 long long value2 = op2->__anon1.i64;
4959
4960 exp->type = 2;
4961 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
4962 if(!exp->expType)
4963 {
4964 exp->expType = op1->type;
4965 if(op1->type)
4966 op1->type->refCount++;
4967 }
4968 return 1;
4969 }
4970
4971 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4972 {
4973 uint64 value2 = op2->__anon1.ui64;
4974
4975 exp->type = 2;
4976 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
4977 if(!exp->expType)
4978 {
4979 exp->expType = op1->type;
4980 if(op1->type)
4981 op1->type->refCount++;
4982 }
4983 return 1;
4984 }
4985
4986 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4987 {
4988 short value2 = op2->__anon1.s;
4989
4990 exp->type = 2;
4991 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >> value2));
4992 if(!exp->expType)
4993 {
4994 exp->expType = op1->type;
4995 if(op1->type)
4996 op1->type->refCount++;
4997 }
4998 return 1;
4999 }
5000
5001 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5002 {
5003 unsigned short value2 = op2->__anon1.us;
5004
5005 exp->type = 2;
5006 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >> value2));
5007 if(!exp->expType)
5008 {
5009 exp->expType = op1->type;
5010 if(op1->type)
5011 op1->type->refCount++;
5012 }
5013 return 1;
5014 }
5015
5016 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5017 {
5018 char value2 = op2->__anon1.c;
5019
5020 exp->type = 2;
5021 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >> value2));
5022 if(!exp->expType)
5023 {
5024 exp->expType = op1->type;
5025 if(op1->type)
5026 op1->type->refCount++;
5027 }
5028 return 1;
5029 }
5030
5031 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5032 {
5033 unsigned char value2 = op2->__anon1.uc;
5034
5035 exp->type = 2;
5036 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >> value2));
5037 if(!exp->expType)
5038 {
5039 exp->expType = op1->type;
5040 if(op1->type)
5041 op1->type->refCount++;
5042 }
5043 return 1;
5044 }
5045
5046 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
5047 {
5048 exp->type = 2;
5049 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
5050 if(!exp->expType)
5051 {
5052 exp->expType = op1->type;
5053 if(op1->type)
5054 op1->type->refCount++;
5055 }
5056 return 1;
5057 }
5058
5059 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
5060 {
5061 exp->type = 2;
5062 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
5063 if(!exp->expType)
5064 {
5065 exp->expType = op1->type;
5066 if(op1->type)
5067 op1->type->refCount++;
5068 }
5069 return 1;
5070 }
5071
5072 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
5073 {
5074 exp->type = 2;
5075 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
5076 if(!exp->expType)
5077 {
5078 exp->expType = op1->type;
5079 if(op1->type)
5080 op1->type->refCount++;
5081 }
5082 return 1;
5083 }
5084
5085 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
5086 {
5087 exp->type = 2;
5088 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
5089 if(!exp->expType)
5090 {
5091 exp->expType = op1->type;
5092 if(op1->type)
5093 op1->type->refCount++;
5094 }
5095 return 1;
5096 }
5097
5098 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
5099 {
5100 exp->type = 2;
5101 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
5102 if(!exp->expType)
5103 {
5104 exp->expType = op1->type;
5105 if(op1->type)
5106 op1->type->refCount++;
5107 }
5108 return 1;
5109 }
5110
5111 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
5112 {
5113 exp->type = 2;
5114 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
5115 if(!exp->expType)
5116 {
5117 exp->expType = op1->type;
5118 if(op1->type)
5119 op1->type->refCount++;
5120 }
5121 return 1;
5122 }
5123
5124 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
5125 {
5126 exp->type = 2;
5127 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
5128 if(!exp->expType)
5129 {
5130 exp->expType = op1->type;
5131 if(op1->type)
5132 op1->type->refCount++;
5133 }
5134 return 1;
5135 }
5136
5137 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
5138 {
5139 exp->type = 2;
5140 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
5141 if(!exp->expType)
5142 {
5143 exp->expType = op1->type;
5144 if(op1->type)
5145 op1->type->refCount++;
5146 }
5147 return 1;
5148 }
5149
5150 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5151 {
5152 int value2 = op2->__anon1.i;
5153
5154 exp->type = 2;
5155 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
5156 if(!exp->expType)
5157 {
5158 exp->expType = op1->type;
5159 if(op1->type)
5160 op1->type->refCount++;
5161 }
5162 return 1;
5163 }
5164
5165 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5166 {
5167 unsigned int value2 = op2->__anon1.ui;
5168
5169 exp->type = 2;
5170 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
5171 if(!exp->expType)
5172 {
5173 exp->expType = op1->type;
5174 if(op1->type)
5175 op1->type->refCount++;
5176 }
5177 return 1;
5178 }
5179
5180 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5181 {
5182 long long value2 = op2->__anon1.i64;
5183
5184 exp->type = 2;
5185 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
5186 if(!exp->expType)
5187 {
5188 exp->expType = op1->type;
5189 if(op1->type)
5190 op1->type->refCount++;
5191 }
5192 return 1;
5193 }
5194
5195 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5196 {
5197 uint64 value2 = op2->__anon1.ui64;
5198
5199 exp->type = 2;
5200 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
5201 if(!exp->expType)
5202 {
5203 exp->expType = op1->type;
5204 if(op1->type)
5205 op1->type->refCount++;
5206 }
5207 return 1;
5208 }
5209
5210 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5211 {
5212 short value2 = op2->__anon1.s;
5213
5214 exp->type = 2;
5215 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
5216 if(!exp->expType)
5217 {
5218 exp->expType = op1->type;
5219 if(op1->type)
5220 op1->type->refCount++;
5221 }
5222 return 1;
5223 }
5224
5225 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5226 {
5227 unsigned short value2 = op2->__anon1.us;
5228
5229 exp->type = 2;
5230 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
5231 if(!exp->expType)
5232 {
5233 exp->expType = op1->type;
5234 if(op1->type)
5235 op1->type->refCount++;
5236 }
5237 return 1;
5238 }
5239
5240 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5241 {
5242 char value2 = op2->__anon1.c;
5243
5244 exp->type = 2;
5245 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
5246 if(!exp->expType)
5247 {
5248 exp->expType = op1->type;
5249 if(op1->type)
5250 op1->type->refCount++;
5251 }
5252 return 1;
5253 }
5254
5255 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5256 {
5257 unsigned char value2 = op2->__anon1.uc;
5258
5259 exp->type = 2;
5260 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
5261 if(!exp->expType)
5262 {
5263 exp->expType = op1->type;
5264 if(op1->type)
5265 op1->type->refCount++;
5266 }
5267 return 1;
5268 }
5269
5270 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5271 {
5272 int value2 = op2->__anon1.i;
5273
5274 exp->type = 2;
5275 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
5276 if(!exp->expType)
5277 {
5278 exp->expType = op1->type;
5279 if(op1->type)
5280 op1->type->refCount++;
5281 }
5282 return 1;
5283 }
5284
5285 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5286 {
5287 unsigned int value2 = op2->__anon1.ui;
5288
5289 exp->type = 2;
5290 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
5291 if(!exp->expType)
5292 {
5293 exp->expType = op1->type;
5294 if(op1->type)
5295 op1->type->refCount++;
5296 }
5297 return 1;
5298 }
5299
5300 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5301 {
5302 long long value2 = op2->__anon1.i64;
5303
5304 exp->type = 2;
5305 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
5306 if(!exp->expType)
5307 {
5308 exp->expType = op1->type;
5309 if(op1->type)
5310 op1->type->refCount++;
5311 }
5312 return 1;
5313 }
5314
5315 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5316 {
5317 uint64 value2 = op2->__anon1.ui64;
5318
5319 exp->type = 2;
5320 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
5321 if(!exp->expType)
5322 {
5323 exp->expType = op1->type;
5324 if(op1->type)
5325 op1->type->refCount++;
5326 }
5327 return 1;
5328 }
5329
5330 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5331 {
5332 short value2 = op2->__anon1.s;
5333
5334 exp->type = 2;
5335 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
5336 if(!exp->expType)
5337 {
5338 exp->expType = op1->type;
5339 if(op1->type)
5340 op1->type->refCount++;
5341 }
5342 return 1;
5343 }
5344
5345 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5346 {
5347 unsigned short value2 = op2->__anon1.us;
5348
5349 exp->type = 2;
5350 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
5351 if(!exp->expType)
5352 {
5353 exp->expType = op1->type;
5354 if(op1->type)
5355 op1->type->refCount++;
5356 }
5357 return 1;
5358 }
5359
5360 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5361 {
5362 char value2 = op2->__anon1.c;
5363
5364 exp->type = 2;
5365 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
5366 if(!exp->expType)
5367 {
5368 exp->expType = op1->type;
5369 if(op1->type)
5370 op1->type->refCount++;
5371 }
5372 return 1;
5373 }
5374
5375 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5376 {
5377 unsigned char value2 = op2->__anon1.uc;
5378
5379 exp->type = 2;
5380 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
5381 if(!exp->expType)
5382 {
5383 exp->expType = op1->type;
5384 if(op1->type)
5385 op1->type->refCount++;
5386 }
5387 return 1;
5388 }
5389
5390 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5391 {
5392 int value2 = op2->__anon1.i;
5393
5394 exp->type = 2;
5395 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
5396 if(!exp->expType)
5397 {
5398 exp->expType = op1->type;
5399 if(op1->type)
5400 op1->type->refCount++;
5401 }
5402 return 1;
5403 }
5404
5405 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5406 {
5407 unsigned int value2 = op2->__anon1.ui;
5408
5409 exp->type = 2;
5410 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
5411 if(!exp->expType)
5412 {
5413 exp->expType = op1->type;
5414 if(op1->type)
5415 op1->type->refCount++;
5416 }
5417 return 1;
5418 }
5419
5420 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5421 {
5422 long long value2 = op2->__anon1.i64;
5423
5424 exp->type = 2;
5425 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
5426 if(!exp->expType)
5427 {
5428 exp->expType = op1->type;
5429 if(op1->type)
5430 op1->type->refCount++;
5431 }
5432 return 1;
5433 }
5434
5435 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5436 {
5437 uint64 value2 = op2->__anon1.ui64;
5438
5439 exp->type = 2;
5440 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
5441 if(!exp->expType)
5442 {
5443 exp->expType = op1->type;
5444 if(op1->type)
5445 op1->type->refCount++;
5446 }
5447 return 1;
5448 }
5449
5450 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5451 {
5452 short value2 = op2->__anon1.s;
5453
5454 exp->type = 2;
5455 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
5456 if(!exp->expType)
5457 {
5458 exp->expType = op1->type;
5459 if(op1->type)
5460 op1->type->refCount++;
5461 }
5462 return 1;
5463 }
5464
5465 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5466 {
5467 unsigned short value2 = op2->__anon1.us;
5468
5469 exp->type = 2;
5470 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
5471 if(!exp->expType)
5472 {
5473 exp->expType = op1->type;
5474 if(op1->type)
5475 op1->type->refCount++;
5476 }
5477 return 1;
5478 }
5479
5480 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5481 {
5482 char value2 = op2->__anon1.c;
5483
5484 exp->type = 2;
5485 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
5486 if(!exp->expType)
5487 {
5488 exp->expType = op1->type;
5489 if(op1->type)
5490 op1->type->refCount++;
5491 }
5492 return 1;
5493 }
5494
5495 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5496 {
5497 unsigned char value2 = op2->__anon1.uc;
5498
5499 exp->type = 2;
5500 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
5501 if(!exp->expType)
5502 {
5503 exp->expType = op1->type;
5504 if(op1->type)
5505 op1->type->refCount++;
5506 }
5507 return 1;
5508 }
5509
5510 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5511 {
5512 int value2 = op2->__anon1.i;
5513
5514 exp->type = 2;
5515 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
5516 if(!exp->expType)
5517 {
5518 exp->expType = op1->type;
5519 if(op1->type)
5520 op1->type->refCount++;
5521 }
5522 return 1;
5523 }
5524
5525 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5526 {
5527 unsigned int value2 = op2->__anon1.ui;
5528
5529 exp->type = 2;
5530 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
5531 if(!exp->expType)
5532 {
5533 exp->expType = op1->type;
5534 if(op1->type)
5535 op1->type->refCount++;
5536 }
5537 return 1;
5538 }
5539
5540 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5541 {
5542 long long value2 = op2->__anon1.i64;
5543
5544 exp->type = 2;
5545 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
5546 if(!exp->expType)
5547 {
5548 exp->expType = op1->type;
5549 if(op1->type)
5550 op1->type->refCount++;
5551 }
5552 return 1;
5553 }
5554
5555 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5556 {
5557 uint64 value2 = op2->__anon1.ui64;
5558
5559 exp->type = 2;
5560 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
5561 if(!exp->expType)
5562 {
5563 exp->expType = op1->type;
5564 if(op1->type)
5565 op1->type->refCount++;
5566 }
5567 return 1;
5568 }
5569
5570 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5571 {
5572 short value2 = op2->__anon1.s;
5573
5574 exp->type = 2;
5575 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
5576 if(!exp->expType)
5577 {
5578 exp->expType = op1->type;
5579 if(op1->type)
5580 op1->type->refCount++;
5581 }
5582 return 1;
5583 }
5584
5585 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5586 {
5587 unsigned short value2 = op2->__anon1.us;
5588
5589 exp->type = 2;
5590 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
5591 if(!exp->expType)
5592 {
5593 exp->expType = op1->type;
5594 if(op1->type)
5595 op1->type->refCount++;
5596 }
5597 return 1;
5598 }
5599
5600 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5601 {
5602 char value2 = op2->__anon1.c;
5603
5604 exp->type = 2;
5605 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
5606 if(!exp->expType)
5607 {
5608 exp->expType = op1->type;
5609 if(op1->type)
5610 op1->type->refCount++;
5611 }
5612 return 1;
5613 }
5614
5615 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5616 {
5617 unsigned char value2 = op2->__anon1.uc;
5618
5619 exp->type = 2;
5620 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
5621 if(!exp->expType)
5622 {
5623 exp->expType = op1->type;
5624 if(op1->type)
5625 op1->type->refCount++;
5626 }
5627 return 1;
5628 }
5629
5630 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5631 {
5632 int value2 = op2->__anon1.i;
5633
5634 exp->type = 2;
5635 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
5636 if(!exp->expType)
5637 {
5638 exp->expType = op1->type;
5639 if(op1->type)
5640 op1->type->refCount++;
5641 }
5642 return 1;
5643 }
5644
5645 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5646 {
5647 unsigned int value2 = op2->__anon1.ui;
5648
5649 exp->type = 2;
5650 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
5651 if(!exp->expType)
5652 {
5653 exp->expType = op1->type;
5654 if(op1->type)
5655 op1->type->refCount++;
5656 }
5657 return 1;
5658 }
5659
5660 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5661 {
5662 long long value2 = op2->__anon1.i64;
5663
5664 exp->type = 2;
5665 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
5666 if(!exp->expType)
5667 {
5668 exp->expType = op1->type;
5669 if(op1->type)
5670 op1->type->refCount++;
5671 }
5672 return 1;
5673 }
5674
5675 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5676 {
5677 uint64 value2 = op2->__anon1.ui64;
5678
5679 exp->type = 2;
5680 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
5681 if(!exp->expType)
5682 {
5683 exp->expType = op1->type;
5684 if(op1->type)
5685 op1->type->refCount++;
5686 }
5687 return 1;
5688 }
5689
5690 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5691 {
5692 short value2 = op2->__anon1.s;
5693
5694 exp->type = 2;
5695 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
5696 if(!exp->expType)
5697 {
5698 exp->expType = op1->type;
5699 if(op1->type)
5700 op1->type->refCount++;
5701 }
5702 return 1;
5703 }
5704
5705 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5706 {
5707 unsigned short value2 = op2->__anon1.us;
5708
5709 exp->type = 2;
5710 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
5711 if(!exp->expType)
5712 {
5713 exp->expType = op1->type;
5714 if(op1->type)
5715 op1->type->refCount++;
5716 }
5717 return 1;
5718 }
5719
5720 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5721 {
5722 char value2 = op2->__anon1.c;
5723
5724 exp->type = 2;
5725 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
5726 if(!exp->expType)
5727 {
5728 exp->expType = op1->type;
5729 if(op1->type)
5730 op1->type->refCount++;
5731 }
5732 return 1;
5733 }
5734
5735 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5736 {
5737 unsigned char value2 = op2->__anon1.uc;
5738
5739 exp->type = 2;
5740 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
5741 if(!exp->expType)
5742 {
5743 exp->expType = op1->type;
5744 if(op1->type)
5745 op1->type->refCount++;
5746 }
5747 return 1;
5748 }
5749
5750 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
5751 {
5752 exp->type = 2;
5753 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
5754 if(!exp->expType)
5755 {
5756 exp->expType = op1->type;
5757 if(op1->type)
5758 op1->type->refCount++;
5759 }
5760 return 1;
5761 }
5762
5763 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
5764 {
5765 exp->type = 2;
5766 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
5767 if(!exp->expType)
5768 {
5769 exp->expType = op1->type;
5770 if(op1->type)
5771 op1->type->refCount++;
5772 }
5773 return 1;
5774 }
5775
5776 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
5777 {
5778 exp->type = 2;
5779 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
5780 if(!exp->expType)
5781 {
5782 exp->expType = op1->type;
5783 if(op1->type)
5784 op1->type->refCount++;
5785 }
5786 return 1;
5787 }
5788
5789 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
5790 {
5791 exp->type = 2;
5792 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
5793 if(!exp->expType)
5794 {
5795 exp->expType = op1->type;
5796 if(op1->type)
5797 op1->type->refCount++;
5798 }
5799 return 1;
5800 }
5801
5802 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
5803 {
5804 exp->type = 2;
5805 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
5806 if(!exp->expType)
5807 {
5808 exp->expType = op1->type;
5809 if(op1->type)
5810 op1->type->refCount++;
5811 }
5812 return 1;
5813 }
5814
5815 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
5816 {
5817 exp->type = 2;
5818 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
5819 if(!exp->expType)
5820 {
5821 exp->expType = op1->type;
5822 if(op1->type)
5823 op1->type->refCount++;
5824 }
5825 return 1;
5826 }
5827
5828 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
5829 {
5830 exp->type = 2;
5831 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
5832 if(!exp->expType)
5833 {
5834 exp->expType = op1->type;
5835 if(op1->type)
5836 op1->type->refCount++;
5837 }
5838 return 1;
5839 }
5840
5841 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
5842 {
5843 exp->type = 2;
5844 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
5845 if(!exp->expType)
5846 {
5847 exp->expType = op1->type;
5848 if(op1->type)
5849 op1->type->refCount++;
5850 }
5851 return 1;
5852 }
5853
5854 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5855 {
5856 int value2 = op2->__anon1.i;
5857
5858 exp->type = 2;
5859 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
5860 if(!exp->expType)
5861 {
5862 exp->expType = op1->type;
5863 if(op1->type)
5864 op1->type->refCount++;
5865 }
5866 return 1;
5867 }
5868
5869 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5870 {
5871 unsigned int value2 = op2->__anon1.ui;
5872
5873 exp->type = 2;
5874 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
5875 if(!exp->expType)
5876 {
5877 exp->expType = op1->type;
5878 if(op1->type)
5879 op1->type->refCount++;
5880 }
5881 return 1;
5882 }
5883
5884 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5885 {
5886 long long value2 = op2->__anon1.i64;
5887
5888 exp->type = 2;
5889 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
5890 if(!exp->expType)
5891 {
5892 exp->expType = op1->type;
5893 if(op1->type)
5894 op1->type->refCount++;
5895 }
5896 return 1;
5897 }
5898
5899 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5900 {
5901 uint64 value2 = op2->__anon1.ui64;
5902
5903 exp->type = 2;
5904 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
5905 if(!exp->expType)
5906 {
5907 exp->expType = op1->type;
5908 if(op1->type)
5909 op1->type->refCount++;
5910 }
5911 return 1;
5912 }
5913
5914 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5915 {
5916 short value2 = op2->__anon1.s;
5917
5918 exp->type = 2;
5919 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
5920 if(!exp->expType)
5921 {
5922 exp->expType = op1->type;
5923 if(op1->type)
5924 op1->type->refCount++;
5925 }
5926 return 1;
5927 }
5928
5929 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5930 {
5931 unsigned short value2 = op2->__anon1.us;
5932
5933 exp->type = 2;
5934 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
5935 if(!exp->expType)
5936 {
5937 exp->expType = op1->type;
5938 if(op1->type)
5939 op1->type->refCount++;
5940 }
5941 return 1;
5942 }
5943
5944 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5945 {
5946 char value2 = op2->__anon1.c;
5947
5948 exp->type = 2;
5949 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
5950 if(!exp->expType)
5951 {
5952 exp->expType = op1->type;
5953 if(op1->type)
5954 op1->type->refCount++;
5955 }
5956 return 1;
5957 }
5958
5959 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5960 {
5961 unsigned char value2 = op2->__anon1.uc;
5962
5963 exp->type = 2;
5964 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
5965 if(!exp->expType)
5966 {
5967 exp->expType = op1->type;
5968 if(op1->type)
5969 op1->type->refCount++;
5970 }
5971 return 1;
5972 }
5973
5974 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5975 {
5976 float value2 = op2->__anon1.f;
5977
5978 exp->type = 2;
5979 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
5980 if(!exp->expType)
5981 {
5982 exp->expType = op1->type;
5983 if(op1->type)
5984 op1->type->refCount++;
5985 }
5986 return 1;
5987 }
5988
5989 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5990 {
5991 double value2 = op2->__anon1.d;
5992
5993 exp->type = 2;
5994 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
5995 if(!exp->expType)
5996 {
5997 exp->expType = op1->type;
5998 if(op1->type)
5999 op1->type->refCount++;
6000 }
6001 return 1;
6002 }
6003
6004 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6005 {
6006 int value2 = op2->__anon1.i;
6007
6008 exp->type = 2;
6009 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
6010 if(!exp->expType)
6011 {
6012 exp->expType = op1->type;
6013 if(op1->type)
6014 op1->type->refCount++;
6015 }
6016 return 1;
6017 }
6018
6019 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6020 {
6021 unsigned int value2 = op2->__anon1.ui;
6022
6023 exp->type = 2;
6024 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
6025 if(!exp->expType)
6026 {
6027 exp->expType = op1->type;
6028 if(op1->type)
6029 op1->type->refCount++;
6030 }
6031 return 1;
6032 }
6033
6034 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6035 {
6036 long long value2 = op2->__anon1.i64;
6037
6038 exp->type = 2;
6039 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
6040 if(!exp->expType)
6041 {
6042 exp->expType = op1->type;
6043 if(op1->type)
6044 op1->type->refCount++;
6045 }
6046 return 1;
6047 }
6048
6049 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6050 {
6051 uint64 value2 = op2->__anon1.ui64;
6052
6053 exp->type = 2;
6054 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
6055 if(!exp->expType)
6056 {
6057 exp->expType = op1->type;
6058 if(op1->type)
6059 op1->type->refCount++;
6060 }
6061 return 1;
6062 }
6063
6064 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6065 {
6066 short value2 = op2->__anon1.s;
6067
6068 exp->type = 2;
6069 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
6070 if(!exp->expType)
6071 {
6072 exp->expType = op1->type;
6073 if(op1->type)
6074 op1->type->refCount++;
6075 }
6076 return 1;
6077 }
6078
6079 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6080 {
6081 unsigned short value2 = op2->__anon1.us;
6082
6083 exp->type = 2;
6084 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
6085 if(!exp->expType)
6086 {
6087 exp->expType = op1->type;
6088 if(op1->type)
6089 op1->type->refCount++;
6090 }
6091 return 1;
6092 }
6093
6094 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6095 {
6096 char value2 = op2->__anon1.c;
6097
6098 exp->type = 2;
6099 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
6100 if(!exp->expType)
6101 {
6102 exp->expType = op1->type;
6103 if(op1->type)
6104 op1->type->refCount++;
6105 }
6106 return 1;
6107 }
6108
6109 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6110 {
6111 unsigned char value2 = op2->__anon1.uc;
6112
6113 exp->type = 2;
6114 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
6115 if(!exp->expType)
6116 {
6117 exp->expType = op1->type;
6118 if(op1->type)
6119 op1->type->refCount++;
6120 }
6121 return 1;
6122 }
6123
6124 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6125 {
6126 float value2 = op2->__anon1.f;
6127
6128 exp->type = 2;
6129 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
6130 if(!exp->expType)
6131 {
6132 exp->expType = op1->type;
6133 if(op1->type)
6134 op1->type->refCount++;
6135 }
6136 return 1;
6137 }
6138
6139 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6140 {
6141 double value2 = op2->__anon1.d;
6142
6143 exp->type = 2;
6144 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
6145 if(!exp->expType)
6146 {
6147 exp->expType = op1->type;
6148 if(op1->type)
6149 op1->type->refCount++;
6150 }
6151 return 1;
6152 }
6153
6154 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6155 {
6156 int value2 = op2->__anon1.i;
6157
6158 exp->type = 2;
6159 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
6160 if(!exp->expType)
6161 {
6162 exp->expType = op1->type;
6163 if(op1->type)
6164 op1->type->refCount++;
6165 }
6166 return 1;
6167 }
6168
6169 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6170 {
6171 unsigned int value2 = op2->__anon1.ui;
6172
6173 exp->type = 2;
6174 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
6175 if(!exp->expType)
6176 {
6177 exp->expType = op1->type;
6178 if(op1->type)
6179 op1->type->refCount++;
6180 }
6181 return 1;
6182 }
6183
6184 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6185 {
6186 long long value2 = op2->__anon1.i64;
6187
6188 exp->type = 2;
6189 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
6190 if(!exp->expType)
6191 {
6192 exp->expType = op1->type;
6193 if(op1->type)
6194 op1->type->refCount++;
6195 }
6196 return 1;
6197 }
6198
6199 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6200 {
6201 uint64 value2 = op2->__anon1.ui64;
6202
6203 exp->type = 2;
6204 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
6205 if(!exp->expType)
6206 {
6207 exp->expType = op1->type;
6208 if(op1->type)
6209 op1->type->refCount++;
6210 }
6211 return 1;
6212 }
6213
6214 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6215 {
6216 short value2 = op2->__anon1.s;
6217
6218 exp->type = 2;
6219 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
6220 if(!exp->expType)
6221 {
6222 exp->expType = op1->type;
6223 if(op1->type)
6224 op1->type->refCount++;
6225 }
6226 return 1;
6227 }
6228
6229 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6230 {
6231 unsigned short value2 = op2->__anon1.us;
6232
6233 exp->type = 2;
6234 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
6235 if(!exp->expType)
6236 {
6237 exp->expType = op1->type;
6238 if(op1->type)
6239 op1->type->refCount++;
6240 }
6241 return 1;
6242 }
6243
6244 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6245 {
6246 char value2 = op2->__anon1.c;
6247
6248 exp->type = 2;
6249 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
6250 if(!exp->expType)
6251 {
6252 exp->expType = op1->type;
6253 if(op1->type)
6254 op1->type->refCount++;
6255 }
6256 return 1;
6257 }
6258
6259 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6260 {
6261 unsigned char value2 = op2->__anon1.uc;
6262
6263 exp->type = 2;
6264 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
6265 if(!exp->expType)
6266 {
6267 exp->expType = op1->type;
6268 if(op1->type)
6269 op1->type->refCount++;
6270 }
6271 return 1;
6272 }
6273
6274 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6275 {
6276 float value2 = op2->__anon1.f;
6277
6278 exp->type = 2;
6279 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
6280 if(!exp->expType)
6281 {
6282 exp->expType = op1->type;
6283 if(op1->type)
6284 op1->type->refCount++;
6285 }
6286 return 1;
6287 }
6288
6289 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6290 {
6291 double value2 = op2->__anon1.d;
6292
6293 exp->type = 2;
6294 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
6295 if(!exp->expType)
6296 {
6297 exp->expType = op1->type;
6298 if(op1->type)
6299 op1->type->refCount++;
6300 }
6301 return 1;
6302 }
6303
6304 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6305 {
6306 int value2 = op2->__anon1.i;
6307
6308 exp->type = 2;
6309 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
6310 if(!exp->expType)
6311 {
6312 exp->expType = op1->type;
6313 if(op1->type)
6314 op1->type->refCount++;
6315 }
6316 return 1;
6317 }
6318
6319 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6320 {
6321 unsigned int value2 = op2->__anon1.ui;
6322
6323 exp->type = 2;
6324 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
6325 if(!exp->expType)
6326 {
6327 exp->expType = op1->type;
6328 if(op1->type)
6329 op1->type->refCount++;
6330 }
6331 return 1;
6332 }
6333
6334 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6335 {
6336 long long value2 = op2->__anon1.i64;
6337
6338 exp->type = 2;
6339 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
6340 if(!exp->expType)
6341 {
6342 exp->expType = op1->type;
6343 if(op1->type)
6344 op1->type->refCount++;
6345 }
6346 return 1;
6347 }
6348
6349 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6350 {
6351 uint64 value2 = op2->__anon1.ui64;
6352
6353 exp->type = 2;
6354 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
6355 if(!exp->expType)
6356 {
6357 exp->expType = op1->type;
6358 if(op1->type)
6359 op1->type->refCount++;
6360 }
6361 return 1;
6362 }
6363
6364 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6365 {
6366 short value2 = op2->__anon1.s;
6367
6368 exp->type = 2;
6369 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
6370 if(!exp->expType)
6371 {
6372 exp->expType = op1->type;
6373 if(op1->type)
6374 op1->type->refCount++;
6375 }
6376 return 1;
6377 }
6378
6379 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6380 {
6381 unsigned short value2 = op2->__anon1.us;
6382
6383 exp->type = 2;
6384 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
6385 if(!exp->expType)
6386 {
6387 exp->expType = op1->type;
6388 if(op1->type)
6389 op1->type->refCount++;
6390 }
6391 return 1;
6392 }
6393
6394 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6395 {
6396 char value2 = op2->__anon1.c;
6397
6398 exp->type = 2;
6399 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
6400 if(!exp->expType)
6401 {
6402 exp->expType = op1->type;
6403 if(op1->type)
6404 op1->type->refCount++;
6405 }
6406 return 1;
6407 }
6408
6409 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6410 {
6411 unsigned char value2 = op2->__anon1.uc;
6412
6413 exp->type = 2;
6414 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
6415 if(!exp->expType)
6416 {
6417 exp->expType = op1->type;
6418 if(op1->type)
6419 op1->type->refCount++;
6420 }
6421 return 1;
6422 }
6423
6424 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6425 {
6426 float value2 = op2->__anon1.f;
6427
6428 exp->type = 2;
6429 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
6430 if(!exp->expType)
6431 {
6432 exp->expType = op1->type;
6433 if(op1->type)
6434 op1->type->refCount++;
6435 }
6436 return 1;
6437 }
6438
6439 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6440 {
6441 double value2 = op2->__anon1.d;
6442
6443 exp->type = 2;
6444 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
6445 if(!exp->expType)
6446 {
6447 exp->expType = op1->type;
6448 if(op1->type)
6449 op1->type->refCount++;
6450 }
6451 return 1;
6452 }
6453
6454 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6455 {
6456 int value2 = op2->__anon1.i;
6457
6458 exp->type = 2;
6459 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
6460 if(!exp->expType)
6461 {
6462 exp->expType = op1->type;
6463 if(op1->type)
6464 op1->type->refCount++;
6465 }
6466 return 1;
6467 }
6468
6469 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6470 {
6471 unsigned int value2 = op2->__anon1.ui;
6472
6473 exp->type = 2;
6474 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
6475 if(!exp->expType)
6476 {
6477 exp->expType = op1->type;
6478 if(op1->type)
6479 op1->type->refCount++;
6480 }
6481 return 1;
6482 }
6483
6484 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6485 {
6486 long long value2 = op2->__anon1.i64;
6487
6488 exp->type = 2;
6489 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
6490 if(!exp->expType)
6491 {
6492 exp->expType = op1->type;
6493 if(op1->type)
6494 op1->type->refCount++;
6495 }
6496 return 1;
6497 }
6498
6499 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6500 {
6501 uint64 value2 = op2->__anon1.ui64;
6502
6503 exp->type = 2;
6504 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
6505 if(!exp->expType)
6506 {
6507 exp->expType = op1->type;
6508 if(op1->type)
6509 op1->type->refCount++;
6510 }
6511 return 1;
6512 }
6513
6514 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6515 {
6516 short value2 = op2->__anon1.s;
6517
6518 exp->type = 2;
6519 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
6520 if(!exp->expType)
6521 {
6522 exp->expType = op1->type;
6523 if(op1->type)
6524 op1->type->refCount++;
6525 }
6526 return 1;
6527 }
6528
6529 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6530 {
6531 unsigned short value2 = op2->__anon1.us;
6532
6533 exp->type = 2;
6534 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
6535 if(!exp->expType)
6536 {
6537 exp->expType = op1->type;
6538 if(op1->type)
6539 op1->type->refCount++;
6540 }
6541 return 1;
6542 }
6543
6544 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6545 {
6546 char value2 = op2->__anon1.c;
6547
6548 exp->type = 2;
6549 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
6550 if(!exp->expType)
6551 {
6552 exp->expType = op1->type;
6553 if(op1->type)
6554 op1->type->refCount++;
6555 }
6556 return 1;
6557 }
6558
6559 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6560 {
6561 unsigned char value2 = op2->__anon1.uc;
6562
6563 exp->type = 2;
6564 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
6565 if(!exp->expType)
6566 {
6567 exp->expType = op1->type;
6568 if(op1->type)
6569 op1->type->refCount++;
6570 }
6571 return 1;
6572 }
6573
6574 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6575 {
6576 float value2 = op2->__anon1.f;
6577
6578 exp->type = 2;
6579 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
6580 if(!exp->expType)
6581 {
6582 exp->expType = op1->type;
6583 if(op1->type)
6584 op1->type->refCount++;
6585 }
6586 return 1;
6587 }
6588
6589 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6590 {
6591 double value2 = op2->__anon1.d;
6592
6593 exp->type = 2;
6594 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
6595 if(!exp->expType)
6596 {
6597 exp->expType = op1->type;
6598 if(op1->type)
6599 op1->type->refCount++;
6600 }
6601 return 1;
6602 }
6603
6604 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6605 {
6606 int value2 = op2->__anon1.i;
6607
6608 exp->type = 2;
6609 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
6610 if(!exp->expType)
6611 {
6612 exp->expType = op1->type;
6613 if(op1->type)
6614 op1->type->refCount++;
6615 }
6616 return 1;
6617 }
6618
6619 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6620 {
6621 unsigned int value2 = op2->__anon1.ui;
6622
6623 exp->type = 2;
6624 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
6625 if(!exp->expType)
6626 {
6627 exp->expType = op1->type;
6628 if(op1->type)
6629 op1->type->refCount++;
6630 }
6631 return 1;
6632 }
6633
6634 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6635 {
6636 long long value2 = op2->__anon1.i64;
6637
6638 exp->type = 2;
6639 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
6640 if(!exp->expType)
6641 {
6642 exp->expType = op1->type;
6643 if(op1->type)
6644 op1->type->refCount++;
6645 }
6646 return 1;
6647 }
6648
6649 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6650 {
6651 uint64 value2 = op2->__anon1.ui64;
6652
6653 exp->type = 2;
6654 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
6655 if(!exp->expType)
6656 {
6657 exp->expType = op1->type;
6658 if(op1->type)
6659 op1->type->refCount++;
6660 }
6661 return 1;
6662 }
6663
6664 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6665 {
6666 short value2 = op2->__anon1.s;
6667
6668 exp->type = 2;
6669 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
6670 if(!exp->expType)
6671 {
6672 exp->expType = op1->type;
6673 if(op1->type)
6674 op1->type->refCount++;
6675 }
6676 return 1;
6677 }
6678
6679 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6680 {
6681 unsigned short value2 = op2->__anon1.us;
6682
6683 exp->type = 2;
6684 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
6685 if(!exp->expType)
6686 {
6687 exp->expType = op1->type;
6688 if(op1->type)
6689 op1->type->refCount++;
6690 }
6691 return 1;
6692 }
6693
6694 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6695 {
6696 char value2 = op2->__anon1.c;
6697
6698 exp->type = 2;
6699 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
6700 if(!exp->expType)
6701 {
6702 exp->expType = op1->type;
6703 if(op1->type)
6704 op1->type->refCount++;
6705 }
6706 return 1;
6707 }
6708
6709 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6710 {
6711 unsigned char value2 = op2->__anon1.uc;
6712
6713 exp->type = 2;
6714 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
6715 if(!exp->expType)
6716 {
6717 exp->expType = op1->type;
6718 if(op1->type)
6719 op1->type->refCount++;
6720 }
6721 return 1;
6722 }
6723
6724 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6725 {
6726 float value2 = op2->__anon1.f;
6727
6728 exp->type = 2;
6729 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
6730 if(!exp->expType)
6731 {
6732 exp->expType = op1->type;
6733 if(op1->type)
6734 op1->type->refCount++;
6735 }
6736 return 1;
6737 }
6738
6739 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6740 {
6741 double value2 = op2->__anon1.d;
6742
6743 exp->type = 2;
6744 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
6745 if(!exp->expType)
6746 {
6747 exp->expType = op1->type;
6748 if(op1->type)
6749 op1->type->refCount++;
6750 }
6751 return 1;
6752 }
6753
6754 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6755 {
6756 int value2 = op2->__anon1.i;
6757
6758 exp->type = 2;
6759 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
6760 if(!exp->expType)
6761 {
6762 exp->expType = op1->type;
6763 if(op1->type)
6764 op1->type->refCount++;
6765 }
6766 return 1;
6767 }
6768
6769 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6770 {
6771 unsigned int value2 = op2->__anon1.ui;
6772
6773 exp->type = 2;
6774 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
6775 if(!exp->expType)
6776 {
6777 exp->expType = op1->type;
6778 if(op1->type)
6779 op1->type->refCount++;
6780 }
6781 return 1;
6782 }
6783
6784 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6785 {
6786 long long value2 = op2->__anon1.i64;
6787
6788 exp->type = 2;
6789 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
6790 if(!exp->expType)
6791 {
6792 exp->expType = op1->type;
6793 if(op1->type)
6794 op1->type->refCount++;
6795 }
6796 return 1;
6797 }
6798
6799 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6800 {
6801 uint64 value2 = op2->__anon1.ui64;
6802
6803 exp->type = 2;
6804 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
6805 if(!exp->expType)
6806 {
6807 exp->expType = op1->type;
6808 if(op1->type)
6809 op1->type->refCount++;
6810 }
6811 return 1;
6812 }
6813
6814 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6815 {
6816 short value2 = op2->__anon1.s;
6817
6818 exp->type = 2;
6819 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
6820 if(!exp->expType)
6821 {
6822 exp->expType = op1->type;
6823 if(op1->type)
6824 op1->type->refCount++;
6825 }
6826 return 1;
6827 }
6828
6829 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6830 {
6831 unsigned short value2 = op2->__anon1.us;
6832
6833 exp->type = 2;
6834 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
6835 if(!exp->expType)
6836 {
6837 exp->expType = op1->type;
6838 if(op1->type)
6839 op1->type->refCount++;
6840 }
6841 return 1;
6842 }
6843
6844 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6845 {
6846 char value2 = op2->__anon1.c;
6847
6848 exp->type = 2;
6849 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
6850 if(!exp->expType)
6851 {
6852 exp->expType = op1->type;
6853 if(op1->type)
6854 op1->type->refCount++;
6855 }
6856 return 1;
6857 }
6858
6859 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6860 {
6861 unsigned char value2 = op2->__anon1.uc;
6862
6863 exp->type = 2;
6864 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
6865 if(!exp->expType)
6866 {
6867 exp->expType = op1->type;
6868 if(op1->type)
6869 op1->type->refCount++;
6870 }
6871 return 1;
6872 }
6873
6874 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6875 {
6876 float value2 = op2->__anon1.f;
6877
6878 exp->type = 2;
6879 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
6880 if(!exp->expType)
6881 {
6882 exp->expType = op1->type;
6883 if(op1->type)
6884 op1->type->refCount++;
6885 }
6886 return 1;
6887 }
6888
6889 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6890 {
6891 double value2 = op2->__anon1.d;
6892
6893 exp->type = 2;
6894 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
6895 if(!exp->expType)
6896 {
6897 exp->expType = op1->type;
6898 if(op1->type)
6899 op1->type->refCount++;
6900 }
6901 return 1;
6902 }
6903
6904 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6905 {
6906 int value2 = op2->__anon1.i;
6907
6908 exp->type = 2;
6909 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
6910 if(!exp->expType)
6911 {
6912 exp->expType = op1->type;
6913 if(op1->type)
6914 op1->type->refCount++;
6915 }
6916 return 1;
6917 }
6918
6919 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6920 {
6921 unsigned int value2 = op2->__anon1.ui;
6922
6923 exp->type = 2;
6924 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
6925 if(!exp->expType)
6926 {
6927 exp->expType = op1->type;
6928 if(op1->type)
6929 op1->type->refCount++;
6930 }
6931 return 1;
6932 }
6933
6934 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6935 {
6936 long long value2 = op2->__anon1.i64;
6937
6938 exp->type = 2;
6939 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
6940 if(!exp->expType)
6941 {
6942 exp->expType = op1->type;
6943 if(op1->type)
6944 op1->type->refCount++;
6945 }
6946 return 1;
6947 }
6948
6949 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6950 {
6951 uint64 value2 = op2->__anon1.ui64;
6952
6953 exp->type = 2;
6954 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
6955 if(!exp->expType)
6956 {
6957 exp->expType = op1->type;
6958 if(op1->type)
6959 op1->type->refCount++;
6960 }
6961 return 1;
6962 }
6963
6964 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6965 {
6966 short value2 = op2->__anon1.s;
6967
6968 exp->type = 2;
6969 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
6970 if(!exp->expType)
6971 {
6972 exp->expType = op1->type;
6973 if(op1->type)
6974 op1->type->refCount++;
6975 }
6976 return 1;
6977 }
6978
6979 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6980 {
6981 unsigned short value2 = op2->__anon1.us;
6982
6983 exp->type = 2;
6984 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
6985 if(!exp->expType)
6986 {
6987 exp->expType = op1->type;
6988 if(op1->type)
6989 op1->type->refCount++;
6990 }
6991 return 1;
6992 }
6993
6994 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6995 {
6996 char value2 = op2->__anon1.c;
6997
6998 exp->type = 2;
6999 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
7000 if(!exp->expType)
7001 {
7002 exp->expType = op1->type;
7003 if(op1->type)
7004 op1->type->refCount++;
7005 }
7006 return 1;
7007 }
7008
7009 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7010 {
7011 unsigned char value2 = op2->__anon1.uc;
7012
7013 exp->type = 2;
7014 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
7015 if(!exp->expType)
7016 {
7017 exp->expType = op1->type;
7018 if(op1->type)
7019 op1->type->refCount++;
7020 }
7021 return 1;
7022 }
7023
7024 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7025 {
7026 float value2 = op2->__anon1.f;
7027
7028 exp->type = 2;
7029 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
7030 if(!exp->expType)
7031 {
7032 exp->expType = op1->type;
7033 if(op1->type)
7034 op1->type->refCount++;
7035 }
7036 return 1;
7037 }
7038
7039 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7040 {
7041 double value2 = op2->__anon1.d;
7042
7043 exp->type = 2;
7044 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
7045 if(!exp->expType)
7046 {
7047 exp->expType = op1->type;
7048 if(op1->type)
7049 op1->type->refCount++;
7050 }
7051 return 1;
7052 }
7053
7054 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7055 {
7056 exp->type = 2;
7057 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
7058 if(!exp->expType)
7059 {
7060 exp->expType = op1->type;
7061 if(op1->type)
7062 op1->type->refCount++;
7063 }
7064 return 1;
7065 }
7066
7067 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7068 {
7069 exp->type = 2;
7070 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
7071 if(!exp->expType)
7072 {
7073 exp->expType = op1->type;
7074 if(op1->type)
7075 op1->type->refCount++;
7076 }
7077 return 1;
7078 }
7079
7080 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7081 {
7082 exp->type = 2;
7083 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
7084 if(!exp->expType)
7085 {
7086 exp->expType = op1->type;
7087 if(op1->type)
7088 op1->type->refCount++;
7089 }
7090 return 1;
7091 }
7092
7093 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7094 {
7095 exp->type = 2;
7096 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
7097 if(!exp->expType)
7098 {
7099 exp->expType = op1->type;
7100 if(op1->type)
7101 op1->type->refCount++;
7102 }
7103 return 1;
7104 }
7105
7106 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7107 {
7108 exp->type = 2;
7109 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
7110 if(!exp->expType)
7111 {
7112 exp->expType = op1->type;
7113 if(op1->type)
7114 op1->type->refCount++;
7115 }
7116 return 1;
7117 }
7118
7119 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7120 {
7121 exp->type = 2;
7122 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
7123 if(!exp->expType)
7124 {
7125 exp->expType = op1->type;
7126 if(op1->type)
7127 op1->type->refCount++;
7128 }
7129 return 1;
7130 }
7131
7132 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7133 {
7134 exp->type = 2;
7135 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
7136 if(!exp->expType)
7137 {
7138 exp->expType = op1->type;
7139 if(op1->type)
7140 op1->type->refCount++;
7141 }
7142 return 1;
7143 }
7144
7145 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7146 {
7147 exp->type = 2;
7148 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
7149 if(!exp->expType)
7150 {
7151 exp->expType = op1->type;
7152 if(op1->type)
7153 op1->type->refCount++;
7154 }
7155 return 1;
7156 }
7157
7158 static void PrintName(struct Type * type, char * string, unsigned int fullName)
7159 {
7160 if(type->name && type->name[0])
7161 {
7162 if(fullName)
7163 strcat(string, type->name);
7164 else
7165 {
7166 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
7167
7168 if(name)
7169 name += 2;
7170 else
7171 name = type->name;
7172 strcat(string, name);
7173 }
7174 }
7175 }
7176
7177 static void PrintAttribs(struct Type * type, char * string)
7178 {
7179 if(type)
7180 {
7181 if(type->dllExport)
7182 strcat(string, "dllexport ");
7183 if(type->attrStdcall)
7184 strcat(string, "stdcall ");
7185 }
7186 }
7187
7188 static struct Type * FindMember(struct Type * type, char * string)
7189 {
7190 struct Type * memberType;
7191
7192 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7193 {
7194 if(!memberType->name)
7195 {
7196 struct Type * subType = FindMember(memberType, string);
7197
7198 if(subType)
7199 return subType;
7200 }
7201 else if(!strcmp(memberType->name, string))
7202 return memberType;
7203 }
7204 return (((void *)0));
7205 }
7206
7207 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
7208
7209 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
7210
7211 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
7212 {
7213 unsigned int result = 0;
7214
7215 switch(kind)
7216 {
7217 case 2:
7218 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
7219 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
7220 break;
7221 case 3:
7222 case 5:
7223 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
7224 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7225 break;
7226 case 4:
7227 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)
7228 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7229 break;
7230 case 6:
7231 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)
7232 result = GetOpFloat(op, &op->__anon1.f);
7233 break;
7234 case 7:
7235 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)
7236 result = GetOpDouble(op, &op->__anon1.d);
7237 break;
7238 case 13:
7239 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)
7240 result = GetOpUInt64(op, &op->__anon1.ui64);
7241 break;
7242 case 15:
7243 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)
7244 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7245 break;
7246 case 22:
7247 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7248 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7249 break;
7250 case 23:
7251 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7252 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7253 break;
7254 }
7255 return result;
7256 }
7257
7258 struct OpTable floatOps =
7259 {
7260 (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)
7261 };
7262
7263 struct OpTable doubleOps =
7264 {
7265 (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)
7266 };
7267
7268 struct OpTable intOps =
7269 {
7270 (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)
7271 };
7272
7273 struct OpTable uintOps =
7274 {
7275 (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)
7276 };
7277
7278 struct OpTable int64Ops =
7279 {
7280 (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)
7281 };
7282
7283 struct OpTable uint64Ops =
7284 {
7285 (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)
7286 };
7287
7288 struct OpTable shortOps =
7289 {
7290 (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)
7291 };
7292
7293 struct OpTable ushortOps =
7294 {
7295 (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)
7296 };
7297
7298 struct OpTable charOps =
7299 {
7300 (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)
7301 };
7302
7303 struct OpTable ucharOps =
7304 {
7305 (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)
7306 };
7307
7308 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
7309 {
7310 struct Type * memberType;
7311
7312 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7313 {
7314 if(!memberType->name)
7315 {
7316 struct Type * subType = FindMember(memberType, string);
7317
7318 if(subType)
7319 {
7320 *offset += memberType->offset;
7321 return subType;
7322 }
7323 }
7324 else if(!strcmp(memberType->name, string))
7325 {
7326 *offset += memberType->offset;
7327 return memberType;
7328 }
7329 }
7330 return (((void *)0));
7331 }
7332
7333 struct __ecereNameSpace__ecere__com__Module;
7334
7335 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);
7336
7337 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
7338
7339 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);
7340
7341 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);
7342
7343 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
7344
7345 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7346
7347 struct GlobalData
7348 {
7349 uintptr_t key;
7350 struct __ecereNameSpace__ecere__sys__BTNode * parent;
7351 struct __ecereNameSpace__ecere__sys__BTNode * left;
7352 struct __ecereNameSpace__ecere__sys__BTNode * right;
7353 int depth;
7354 struct __ecereNameSpace__ecere__com__Instance * module;
7355 char *  dataTypeString;
7356 struct Type * dataType;
7357 void *  symbol;
7358 char *  fullName;
7359 } ecere_gcc_struct;
7360
7361 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);
7362
7363 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
7364
7365 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);
7366
7367 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
7368
7369 struct __ecereNameSpace__ecere__com__DefinedExpression;
7370
7371 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7372
7373 struct __ecereNameSpace__ecere__com__DefinedExpression
7374 {
7375 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
7376 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
7377 const char *  name;
7378 const char *  value;
7379 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7380 } ecere_gcc_struct;
7381
7382 struct __ecereNameSpace__ecere__sys__BinaryTree;
7383
7384 struct __ecereNameSpace__ecere__sys__BinaryTree
7385 {
7386 struct __ecereNameSpace__ecere__sys__BTNode * root;
7387 int count;
7388 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
7389 void (*  FreeKey)(void *  key);
7390 } ecere_gcc_struct;
7391
7392 struct __ecereNameSpace__ecere__com__Class
7393 {
7394 struct __ecereNameSpace__ecere__com__Class * prev;
7395 struct __ecereNameSpace__ecere__com__Class * next;
7396 const char *  name;
7397 int offset;
7398 int structSize;
7399 void * *  _vTbl;
7400 int vTblSize;
7401 unsigned int (*  Constructor)(void * );
7402 void (*  Destructor)(void * );
7403 int offsetClass;
7404 int sizeClass;
7405 struct __ecereNameSpace__ecere__com__Class * base;
7406 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
7407 struct __ecereNameSpace__ecere__sys__BinaryTree members;
7408 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
7409 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
7410 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
7411 struct __ecereNameSpace__ecere__sys__OldList derivatives;
7412 int memberID;
7413 int startMemberID;
7414 int type;
7415 struct __ecereNameSpace__ecere__com__Instance * module;
7416 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7417 const char *  dataTypeString;
7418 struct Type * dataType;
7419 int typeSize;
7420 int defaultAlignment;
7421 void (*  Initialize)();
7422 int memberOffset;
7423 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
7424 const char *  designerClass;
7425 unsigned int noExpansion;
7426 const char *  defaultProperty;
7427 unsigned int comRedefinition;
7428 int count;
7429 int isRemote;
7430 unsigned int internalDecl;
7431 void *  data;
7432 unsigned int computeSize;
7433 short structAlignment;
7434 short pointerAlignment;
7435 int destructionWatchOffset;
7436 unsigned int fixed;
7437 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
7438 int inheritanceAccess;
7439 const char *  fullName;
7440 void *  symbol;
7441 struct __ecereNameSpace__ecere__sys__OldList conversions;
7442 struct __ecereNameSpace__ecere__sys__OldList templateParams;
7443 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
7444 struct __ecereNameSpace__ecere__com__Class * templateClass;
7445 struct __ecereNameSpace__ecere__sys__OldList templatized;
7446 int numParams;
7447 unsigned int isInstanceClass;
7448 unsigned int byValueSystemClass;
7449 } ecere_gcc_struct;
7450
7451 struct __ecereNameSpace__ecere__com__NameSpace
7452 {
7453 const char *  name;
7454 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
7455 struct __ecereNameSpace__ecere__com__NameSpace *  left;
7456 struct __ecereNameSpace__ecere__com__NameSpace *  right;
7457 int depth;
7458 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
7459 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
7460 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
7461 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
7462 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
7463 } ecere_gcc_struct;
7464
7465 struct __ecereNameSpace__ecere__com__DataMember
7466 {
7467 struct __ecereNameSpace__ecere__com__DataMember * prev;
7468 struct __ecereNameSpace__ecere__com__DataMember * next;
7469 const char *  name;
7470 unsigned int isProperty;
7471 int memberAccess;
7472 int id;
7473 struct __ecereNameSpace__ecere__com__Class * _class;
7474 const char *  dataTypeString;
7475 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
7476 struct Type * dataType;
7477 int type;
7478 int offset;
7479 int memberID;
7480 struct __ecereNameSpace__ecere__sys__OldList members;
7481 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
7482 int memberOffset;
7483 short structAlignment;
7484 short pointerAlignment;
7485 } ecere_gcc_struct;
7486
7487 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7488
7489 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7490
7491 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
7492
7493 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7494
7495 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7496
7497 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
7498
7499 static void _DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl)
7500 {
7501 if(inCompiler)
7502 {
7503 if(type->kind == 11)
7504 {
7505 struct Type * param;
7506
7507 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
7508 _DeclareType(neededFor, param, forFunctionDef, 0, fwdDecl);
7509 _DeclareType(neededFor, type->__anon1.__anon2.returnType, forFunctionDef, 0, fwdDecl);
7510 }
7511 else if(type->kind == 13)
7512 _DeclareType(neededFor, type->__anon1.type, 0, 0, fwdDecl);
7513 else if(type->kind == 8)
7514 {
7515 struct __ecereNameSpace__ecere__com__Class * c = type->__anon1._class->__anon1.registered;
7516
7517 _DeclareStruct(neededFor, c ? c->fullName : "ecere::com::Instance", c ? c->type == 5 : 0, needDereference && c && c->type == 1, fwdDecl);
7518 }
7519 else if(type->kind == 9 || type->kind == 10)
7520 {
7521 struct Type * member;
7522
7523 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7524 _DeclareType(neededFor, member, needDereference, forFunctionDef, fwdDecl);
7525 }
7526 else if(type->kind == 12)
7527 _DeclareType(neededFor, type->__anon1.__anon4.arrayType, 1, 0, fwdDecl);
7528 }
7529 }
7530
7531 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
7532 {
7533 unsigned int status = 1;
7534
7535 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))
7536 {
7537 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
7538 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
7539
7540 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
7541 {
7542 struct Type * sourceType = source, * destType = dest;
7543
7544 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
7545 sourceType = sourceType->__anon1.type;
7546 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
7547 destType = destType->__anon1.type;
7548 if(!destType->constant && sourceType->constant)
7549 {
7550 status = 0;
7551 if(warn)
7552 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
7553 }
7554 }
7555 }
7556 return status;
7557 }
7558
7559 struct Operand GetOperand(struct Expression * exp)
7560 {
7561 struct Operand op =
7562 {
7563 0, 0, 0,
7564 .__anon1 = {
7565 .c = 0
7566 },
7567 {
7568 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7569 }
7570 };
7571 struct Type * type = exp->expType;
7572
7573 if(type)
7574 {
7575 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))
7576 {
7577 if(!type->__anon1._class->__anon1.registered->dataType)
7578 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7579 type = type->__anon1._class->__anon1.registered->dataType;
7580 }
7581 if(exp->type == 3 && op.kind == 13)
7582 {
7583 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
7584 op.kind = 13;
7585 op.ops = uint64Ops;
7586 }
7587 else if(exp->isConstant && exp->type == 2)
7588 {
7589 op.kind = type->kind;
7590 op.type = type;
7591 switch(op.kind)
7592 {
7593 case 24:
7594 case 1:
7595 {
7596 if(exp->__anon1.__anon1.constant[0] == '\'')
7597 {
7598 op.__anon1.c = exp->__anon1.__anon1.constant[1];
7599 op.ops = charOps;
7600 }
7601 else if(type->isSigned)
7602 {
7603 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7604 op.ops = charOps;
7605 }
7606 else
7607 {
7608 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7609 op.ops = ucharOps;
7610 }
7611 break;
7612 }
7613 case 2:
7614 if(exp->__anon1.__anon1.constant[0] == '\'')
7615 {
7616 op.__anon1.s = exp->__anon1.__anon1.constant[1];
7617 op.ops = shortOps;
7618 }
7619 else if(type->isSigned)
7620 {
7621 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7622 op.ops = shortOps;
7623 }
7624 else
7625 {
7626 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7627 op.ops = ushortOps;
7628 }
7629 break;
7630 case 3:
7631 case 5:
7632 if(exp->__anon1.__anon1.constant[0] == '\'')
7633 {
7634 op.__anon1.i = exp->__anon1.__anon1.constant[1];
7635 op.ops = intOps;
7636 }
7637 else if(type->isSigned)
7638 {
7639 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7640 op.ops = intOps;
7641 }
7642 else
7643 {
7644 op.__anon1.ui = (unsigned int)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7645 op.ops = uintOps;
7646 }
7647 op.kind = 3;
7648 break;
7649 case 4:
7650 if(type->isSigned)
7651 {
7652 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7653 op.ops = int64Ops;
7654 }
7655 else
7656 {
7657 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7658 op.ops = uint64Ops;
7659 }
7660 op.kind = 4;
7661 break;
7662 case 22:
7663 if(type->isSigned)
7664 {
7665 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7666 op.ops = int64Ops;
7667 }
7668 else
7669 {
7670 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7671 op.ops = uint64Ops;
7672 }
7673 op.kind = 4;
7674 break;
7675 case 23:
7676 if(type->isSigned)
7677 {
7678 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7679 op.ops = int64Ops;
7680 }
7681 else
7682 {
7683 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7684 op.ops = uint64Ops;
7685 }
7686 op.kind = 4;
7687 break;
7688 case 6:
7689 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7690 op.__anon1.f = __ecereMethod_float_inf();
7691 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7692 op.__anon1.f = -__ecereMethod_float_inf();
7693 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7694 op.__anon1.f = __ecereMethod_float_nan();
7695 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7696 op.__anon1.f = -__ecereMethod_float_nan();
7697 else
7698 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7699 op.ops = floatOps;
7700 break;
7701 case 7:
7702 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7703 op.__anon1.d = __ecereMethod_double_inf();
7704 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7705 op.__anon1.d = -__ecereMethod_double_inf();
7706 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7707 op.__anon1.d = __ecereMethod_double_nan();
7708 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7709 op.__anon1.d = -__ecereMethod_double_nan();
7710 else
7711 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7712 op.ops = doubleOps;
7713 break;
7714 case 12:
7715 case 13:
7716 case 8:
7717 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7718 op.kind = 13;
7719 op.ops = uint64Ops;
7720 break;
7721 }
7722 }
7723 }
7724 return op;
7725 }
7726
7727 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
7728 {
7729 long long v = 0;
7730
7731 switch(_class->typeSize)
7732 {
7733 case 8:
7734 if(!strcmp(_class->dataTypeString, "uint64"))
7735 v = (long long)*(uint64 *)ptr;
7736 else
7737 v = *(long long *)ptr;
7738 break;
7739 case 4:
7740 if(!strcmp(_class->dataTypeString, "uint"))
7741 v = (long long)*(unsigned int *)ptr;
7742 else
7743 v = (long long)*(int *)ptr;
7744 break;
7745 case 2:
7746 if(!strcmp(_class->dataTypeString, "uint16"))
7747 v = (long long)*(unsigned short *)ptr;
7748 else
7749 v = (long long)*(short *)ptr;
7750 break;
7751 case 1:
7752 if(!strcmp(_class->dataTypeString, "byte"))
7753 v = (long long)*(unsigned char *)ptr;
7754 else
7755 v = (long long)*(char *)ptr;
7756 break;
7757 }
7758 return v;
7759 }
7760
7761 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
7762 {
7763 if(!type->isSigned && type->kind != 22 && type->kind != 23)
7764 ListAdd(specs, MkSpecifier(UNSIGNED));
7765 switch(type->kind)
7766 {
7767 case 8:
7768 {
7769 if(type->__anon1._class->__anon1.registered)
7770 {
7771 if(!type->__anon1._class->__anon1.registered->dataType)
7772 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7773 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
7774 }
7775 break;
7776 }
7777 case 7:
7778 ListAdd(specs, MkSpecifier(DOUBLE));
7779 break;
7780 case 6:
7781 ListAdd(specs, MkSpecifier(FLOAT));
7782 break;
7783 case 1:
7784 ListAdd(specs, MkSpecifier(CHAR));
7785 break;
7786 case 24:
7787 ListAdd(specs, MkSpecifier(_BOOL));
7788 break;
7789 case 2:
7790 ListAdd(specs, MkSpecifier(SHORT));
7791 break;
7792 case 4:
7793 ListAdd(specs, MkSpecifier(INT64));
7794 break;
7795 case 22:
7796 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
7797 break;
7798 case 23:
7799 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
7800 break;
7801 case 3:
7802 default:
7803 ListAdd(specs, MkSpecifier(INT));
7804 break;
7805 }
7806 }
7807
7808 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
7809 {
7810 if(type)
7811 {
7812 if(printConst && type->constant)
7813 strcat(string, "const ");
7814 switch(type->kind)
7815 {
7816 case 8:
7817 {
7818 struct Symbol * c = type->__anon1._class;
7819 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
7820
7821 if(type->classObjectType == 2 && isObjectBaseClass)
7822 strcat(string, "typed_object");
7823 else if(type->classObjectType == 3 && isObjectBaseClass)
7824 strcat(string, "any_object");
7825 else
7826 {
7827 if(c && c->string)
7828 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
7829 }
7830 if(type->byReference)
7831 strcat(string, " &");
7832 break;
7833 }
7834 case 0:
7835 strcat(string, "void");
7836 break;
7837 case 3:
7838 strcat(string, type->isSigned ? "int" : "uint");
7839 break;
7840 case 4:
7841 strcat(string, type->isSigned ? "int64" : "uint64");
7842 break;
7843 case 22:
7844 strcat(string, type->isSigned ? "intptr" : "uintptr");
7845 break;
7846 case 23:
7847 strcat(string, type->isSigned ? "intsize" : "uintsize");
7848 break;
7849 case 1:
7850 strcat(string, type->isSigned ? "char" : "byte");
7851 break;
7852 case 24:
7853 strcat(string, "_Bool");
7854 break;
7855 case 2:
7856 strcat(string, type->isSigned ? "short" : "uint16");
7857 break;
7858 case 6:
7859 strcat(string, "float");
7860 break;
7861 case 7:
7862 strcat(string, "double");
7863 break;
7864 case 9:
7865 if(type->__anon1.__anon1.enumName)
7866 {
7867 strcat(string, "struct ");
7868 strcat(string, type->__anon1.__anon1.enumName);
7869 }
7870 else if(type->typeName)
7871 strcat(string, type->typeName);
7872 else
7873 {
7874 struct Type * member;
7875
7876 strcat(string, "struct { ");
7877 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7878 {
7879 PrintType(member, string, 1, fullName);
7880 strcat(string, "; ");
7881 }
7882 strcat(string, "}");
7883 }
7884 break;
7885 case 10:
7886 if(type->__anon1.__anon1.enumName)
7887 {
7888 strcat(string, "union ");
7889 strcat(string, type->__anon1.__anon1.enumName);
7890 }
7891 else if(type->typeName)
7892 strcat(string, type->typeName);
7893 else
7894 {
7895 strcat(string, "union ");
7896 strcat(string, "(unnamed)");
7897 }
7898 break;
7899 case 15:
7900 if(type->__anon1.__anon1.enumName)
7901 {
7902 strcat(string, "enum ");
7903 strcat(string, type->__anon1.__anon1.enumName);
7904 }
7905 else if(type->typeName)
7906 strcat(string, type->typeName);
7907 else
7908 strcat(string, "int");
7909 break;
7910 case 14:
7911 strcat(string, "...");
7912 break;
7913 case 19:
7914 strcat(string, "subclass(");
7915 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
7916 strcat(string, ")");
7917 break;
7918 case 20:
7919 strcat(string, type->__anon1.templateParameter->identifier->string);
7920 break;
7921 case 21:
7922 strcat(string, "thisclass");
7923 break;
7924 case 17:
7925 strcat(string, "__builtin_va_list");
7926 break;
7927 }
7928 }
7929 }
7930
7931 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
7932
7933 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
7934
7935 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
7936
7937 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
7938
7939 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
7940
7941 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
7942
7943 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
7944
7945 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
7946
7947 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
7948
7949 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
7950
7951 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
7952
7953 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
7954
7955 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
7956
7957 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
7958
7959 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
7960
7961 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
7962
7963 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
7964
7965 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
7966
7967 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
7968
7969 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
7970
7971 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
7972
7973 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
7974
7975 struct __ecereNameSpace__ecere__com__Application
7976 {
7977 int argc;
7978 const char * *  argv;
7979 int exitCode;
7980 unsigned int isGUIApp;
7981 struct __ecereNameSpace__ecere__sys__OldList allModules;
7982 char *  parsedCommand;
7983 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
7984 } ecere_gcc_struct;
7985
7986 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)
7987 {
7988 if(*curMember)
7989 {
7990 *curMember = (*curMember)->next;
7991 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
7992 {
7993 *curMember = subMemberStack[--(*subMemberStackPos)];
7994 *curMember = (*curMember)->next;
7995 }
7996 while((*curMember) && (*curMember)->isProperty)
7997 *curMember = (*curMember)->next;
7998 if(subMemberStackPos)
7999 {
8000 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8001 {
8002 subMemberStack[(*subMemberStackPos)++] = *curMember;
8003 *curMember = (*curMember)->members.first;
8004 while(*curMember && (*curMember)->isProperty)
8005 *curMember = (*curMember)->next;
8006 }
8007 }
8008 }
8009 while(!*curMember)
8010 {
8011 if(!*curMember)
8012 {
8013 if(subMemberStackPos && *subMemberStackPos)
8014 {
8015 *curMember = subMemberStack[--(*subMemberStackPos)];
8016 *curMember = (*curMember)->next;
8017 }
8018 else
8019 {
8020 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
8021
8022 if(*curClass == _class)
8023 break;
8024 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
8025 ;
8026 *curMember = (*curClass)->membersAndProperties.first;
8027 }
8028 while((*curMember) && (*curMember)->isProperty)
8029 *curMember = (*curMember)->next;
8030 if(subMemberStackPos)
8031 {
8032 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8033 {
8034 subMemberStack[(*subMemberStackPos)++] = *curMember;
8035 *curMember = (*curMember)->members.first;
8036 while(*curMember && (*curMember)->isProperty)
8037 *curMember = (*curMember)->next;
8038 }
8039 }
8040 }
8041 }
8042 }
8043
8044 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
8045 {
8046 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
8047 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
8048 struct __ecereNameSpace__ecere__com__NameSpace * child;
8049
8050 if(!data)
8051 {
8052 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)))
8053 {
8054 data = ScanGlobalData(child, name);
8055 if(data)
8056 break;
8057 }
8058 }
8059 return data;
8060 }
8061
8062 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
8063 {
8064 int nsLen = strlen(nameSpace);
8065 struct Symbol * symbol;
8066
8067 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)))
8068 {
8069 char * s = symbol->string;
8070
8071 if(!strncmp(s, nameSpace, nsLen))
8072 {
8073 int c;
8074 char * namePart;
8075
8076 for(c = strlen(s) - 1; c >= 0; c--)
8077 if(s[c] == ':')
8078 break;
8079 namePart = s + c + 1;
8080 if(!strcmp(namePart, name))
8081 {
8082 return symbol;
8083 }
8084 }
8085 else
8086 break;
8087 }
8088 return (((void *)0));
8089 }
8090
8091 unsigned int GetInt(struct Expression * exp, int * value2)
8092 {
8093 struct Operand op2 = GetOperand(exp);
8094
8095 return GetOpInt(&op2, value2);
8096 }
8097
8098 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
8099 {
8100 struct Operand op2 = GetOperand(exp);
8101
8102 return GetOpUInt(&op2, value2);
8103 }
8104
8105 unsigned int GetInt64(struct Expression * exp, long long * value2)
8106 {
8107 struct Operand op2 = GetOperand(exp);
8108
8109 return GetOpInt64(&op2, value2);
8110 }
8111
8112 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
8113 {
8114 struct Operand op2 = GetOperand(exp);
8115
8116 return GetOpUInt64(&op2, value2);
8117 }
8118
8119 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
8120 {
8121 struct Operand op2 = GetOperand(exp);
8122
8123 return GetOpIntPtr(&op2, value2);
8124 }
8125
8126 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
8127 {
8128 struct Operand op2 = GetOperand(exp);
8129
8130 return GetOpUIntPtr(&op2, value2);
8131 }
8132
8133 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
8134 {
8135 struct Operand op2 = GetOperand(exp);
8136
8137 return GetOpIntSize(&op2, value2);
8138 }
8139
8140 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
8141 {
8142 struct Operand op2 = GetOperand(exp);
8143
8144 return GetOpUIntSize(&op2, value2);
8145 }
8146
8147 unsigned int GetShort(struct Expression * exp, short * value2)
8148 {
8149 struct Operand op2 = GetOperand(exp);
8150
8151 return GetOpShort(&op2, value2);
8152 }
8153
8154 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
8155 {
8156 struct Operand op2 = GetOperand(exp);
8157
8158 return GetOpUShort(&op2, value2);
8159 }
8160
8161 unsigned int GetChar(struct Expression * exp, char * value2)
8162 {
8163 struct Operand op2 = GetOperand(exp);
8164
8165 return GetOpChar(&op2, value2);
8166 }
8167
8168 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
8169 {
8170 struct Operand op2 = GetOperand(exp);
8171
8172 return GetOpUChar(&op2, value2);
8173 }
8174
8175 unsigned int GetFloat(struct Expression * exp, float * value2)
8176 {
8177 struct Operand op2 = GetOperand(exp);
8178
8179 return GetOpFloat(&op2, value2);
8180 }
8181
8182 unsigned int GetDouble(struct Expression * exp, double * value2)
8183 {
8184 struct Operand op2 = GetOperand(exp);
8185
8186 return GetOpDouble(&op2, value2);
8187 }
8188
8189 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
8190 {
8191 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8192 {
8193 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
8194 PrintAttribs(type, string);
8195 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
8196 strcat(string, " const");
8197 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
8198 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8199 strcat(string, " (");
8200 if(type->kind == 13)
8201 {
8202 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
8203 PrintAttribs(type->__anon1.type, string);
8204 }
8205 if(type->kind == 13)
8206 {
8207 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
8208 strcat(string, "*");
8209 else
8210 strcat(string, " *");
8211 }
8212 if(printConst && type->constant && type->kind == 13)
8213 strcat(string, " const");
8214 }
8215 else
8216 PrintTypeSpecs(type, string, fullName, printConst);
8217 }
8218
8219 void PrintExpression(struct Expression * exp, char * string)
8220 {
8221 {
8222 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8223 int count;
8224 unsigned int backOutputLineNumbers = outputLineNumbers;
8225
8226 outputLineNumbers = 0;
8227 if(exp)
8228 OutputExpression(exp, f);
8229 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8230 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8231
8232 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8233 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
8234 count = strlen(string);
8235 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8236 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8237
8238 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8239 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
8240 string[count] = '\0';
8241 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
8242 outputLineNumbers = backOutputLineNumbers;
8243 }
8244 }
8245
8246 struct Type * Dereference(struct Type * source)
8247 {
8248 struct Type * type = (((void *)0));
8249
8250 if(source)
8251 {
8252 if(source->kind == 13 || source->kind == 12)
8253 {
8254 type = source->__anon1.type;
8255 source->__anon1.type->refCount++;
8256 }
8257 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
8258 {
8259 type = __extension__ ({
8260 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8261
8262 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
8263 });
8264 }
8265 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
8266 {
8267 type = source;
8268 source->refCount++;
8269 }
8270 else
8271 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
8272 }
8273 return type;
8274 }
8275
8276 static struct Type * Reference(struct Type * source)
8277 {
8278 struct Type * type = (((void *)0));
8279
8280 if(source)
8281 {
8282 type = __extension__ ({
8283 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8284
8285 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
8286 });
8287 source->refCount++;
8288 }
8289 return type;
8290 }
8291
8292 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
8293 {
8294 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
8295
8296 FreeExpContents(checkedExp);
8297 FreeType(checkedExp->expType);
8298 FreeType(checkedExp->destType);
8299 *checkedExp = *newExp;
8300 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
8301 checkedExp->prev = prev;
8302 checkedExp->next = next;
8303 }
8304
8305 void FinishTemplatesContext(struct Context * context)
8306 {
8307 PopContext(context);
8308 FreeContext(context);
8309 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
8310 }
8311
8312 static __attribute__((unused)) void UnusedFunction()
8313 {
8314 int a;
8315
8316 ((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);
8317 }
8318
8319 struct Expression * ParseExpressionString(char * expression)
8320 {
8321 parseError = 0;
8322 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8323 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8324 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8325
8326 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8327 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
8328 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8329 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8330
8331 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8332 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
8333 echoOn = 0;
8334 parsedExpression = (((void *)0));
8335 resetScanner();
8336 expression_yyparse();
8337 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
8338 return parsedExpression;
8339 }
8340
8341 struct __ecereNameSpace__ecere__com__Module
8342 {
8343 struct __ecereNameSpace__ecere__com__Instance * application;
8344 struct __ecereNameSpace__ecere__sys__OldList classes;
8345 struct __ecereNameSpace__ecere__sys__OldList defines;
8346 struct __ecereNameSpace__ecere__sys__OldList functions;
8347 struct __ecereNameSpace__ecere__sys__OldList modules;
8348 struct __ecereNameSpace__ecere__com__Instance * prev;
8349 struct __ecereNameSpace__ecere__com__Instance * next;
8350 const char *  name;
8351 void *  library;
8352 void *  Unload;
8353 int importType;
8354 int origImportType;
8355 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
8356 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
8357 } ecere_gcc_struct;
8358
8359 static struct GlobalData * FindGlobalData(char * name)
8360 {
8361 int start = 0, c;
8362 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
8363
8364 nameSpace = globalData;
8365 for(c = 0; name[c]; c++)
8366 {
8367 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
8368 {
8369 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
8370 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
8371
8372 strncpy(spaceName, name + start, c - start);
8373 spaceName[c - start] = '\0';
8374 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
8375 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
8376 if(!newSpace)
8377 return (((void *)0));
8378 nameSpace = newSpace;
8379 if(name[c] == ':')
8380 c++;
8381 start = c + 1;
8382 }
8383 }
8384 if(c - start)
8385 {
8386 return ScanGlobalData(nameSpace, name + start);
8387 }
8388 return (((void *)0));
8389 }
8390
8391 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
8392 {
8393 int c;
8394 char nameSpace[1024];
8395 const char * namePart;
8396 unsigned int gotColon = 0;
8397
8398 nameSpace[0] = '\0';
8399 for(c = strlen(name) - 1; c >= 0; c--)
8400 if(name[c] == ':')
8401 {
8402 gotColon = 1;
8403 break;
8404 }
8405 namePart = name + c + 1;
8406 while(c >= 0 && name[c] == ':')
8407 c--;
8408 if(c >= 0)
8409 {
8410 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
8411
8412 if(symbol)
8413 return symbol;
8414 memcpy(nameSpace, name, c + 1);
8415 nameSpace[c + 1] = 0;
8416 return ScanWithNameSpace(tree, nameSpace, namePart);
8417 }
8418 else if(gotColon)
8419 {
8420 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8421
8422 return symbol;
8423 }
8424 else
8425 {
8426 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8427
8428 if(symbol)
8429 return symbol;
8430 return ScanWithNameSpace(tree, "", namePart);
8431 }
8432 return (((void *)0));
8433 }
8434
8435 static void PrintArraySize(struct Type * arrayType, char * string)
8436 {
8437 char size[256];
8438
8439 size[0] = '\0';
8440 strcat(size, "[");
8441 if(arrayType->__anon1.__anon4.enumClass)
8442 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
8443 else if(arrayType->__anon1.__anon4.arraySizeExp)
8444 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
8445 strcat(size, "]");
8446 strcat(string, size);
8447 }
8448
8449 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
8450 {
8451
8452 }
8453
8454 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
8455 {
8456 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8457 strcat(string, ")");
8458 if(type->kind == 12)
8459 PrintArraySize(type, string);
8460 else if(type->kind == 11)
8461 {
8462 struct Type * param;
8463
8464 strcat(string, "(");
8465 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
8466 {
8467 PrintType(param, string, 1, fullName);
8468 if(param->next)
8469 strcat(string, ", ");
8470 }
8471 strcat(string, ")");
8472 }
8473 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8474 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
8475 }
8476
8477 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
8478 {
8479 PrePrintType(type, string, fullName, (((void *)0)), printConst);
8480 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
8481 strcat(string, " ");
8482 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
8483 {
8484 struct Symbol * _class = type->__anon1.__anon2.thisClass;
8485
8486 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
8487 {
8488 if(type->classObjectType == 1)
8489 strcat(string, "class");
8490 else
8491 strcat(string, type->byReference ? "typed_object&" : "typed_object");
8492 }
8493 else if(_class && _class->string)
8494 {
8495 char * s = _class->string;
8496
8497 if(fullName)
8498 strcat(string, s);
8499 else
8500 {
8501 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
8502
8503 if(name)
8504 name += 2;
8505 else
8506 name = s;
8507 strcat(string, name);
8508 }
8509 }
8510 strcat(string, "::");
8511 }
8512 if(printName && type->name)
8513 PrintName(type, string, fullName);
8514 PostPrintType(type, string, fullName);
8515 if(type->bitFieldCount)
8516 {
8517 char count[100];
8518
8519 sprintf(count, ":%d", type->bitFieldCount);
8520 strcat(string, count);
8521 }
8522 }
8523
8524 struct Conversion;
8525
8526 struct Conversion
8527 {
8528 struct Conversion * prev, * next;
8529 struct __ecereNameSpace__ecere__com__Property * convert;
8530 unsigned int isGet;
8531 struct Type * resultType;
8532 } ecere_gcc_struct;
8533
8534 static void FreeConvert(struct Conversion * convert)
8535 {
8536 if(convert->resultType)
8537 FreeType(convert->resultType);
8538 }
8539
8540 struct Enumerator;
8541
8542 struct Enumerator
8543 {
8544 struct Enumerator * prev;
8545 struct Enumerator * next;
8546 struct Location loc;
8547 struct Identifier * id;
8548 struct Expression * exp;
8549 } ecere_gcc_struct;
8550
8551 struct AsmField;
8552
8553 struct AsmField
8554 {
8555 struct AsmField * prev;
8556 struct AsmField * next;
8557 struct Location loc;
8558 char *  command;
8559 struct Expression * expression;
8560 struct Identifier * symbolic;
8561 } ecere_gcc_struct;
8562
8563 struct ClassDefinition;
8564
8565 struct Context
8566 {
8567 struct Context * parent;
8568 struct __ecereNameSpace__ecere__sys__BinaryTree types;
8569 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
8570 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
8571 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
8572 int nextID;
8573 int simpleID;
8574 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
8575 struct ClassDefinition * classDef;
8576 unsigned int templateTypesOnly;
8577 unsigned int hasNameSpace;
8578 } ecere_gcc_struct;
8579
8580 struct External
8581 {
8582 struct External * prev;
8583 struct External * next;
8584 struct Location loc;
8585 int type;
8586 struct Symbol * symbol;
8587 union
8588 {
8589 struct FunctionDefinition * function;
8590 struct ClassDefinition * _class;
8591 struct Declaration * declaration;
8592 char *  importString;
8593 struct Identifier * id;
8594 struct DBTableDef * table;
8595 } ecere_gcc_struct __anon1;
8596 int importType;
8597 struct External * fwdDecl;
8598 struct __ecereNameSpace__ecere__com__Instance * outgoing;
8599 struct __ecereNameSpace__ecere__com__Instance * incoming;
8600 int nonBreakableIncoming;
8601 } ecere_gcc_struct;
8602
8603 struct ClassDefinition
8604 {
8605 struct ClassDefinition * prev;
8606 struct ClassDefinition * next;
8607 struct Location loc;
8608 struct Specifier * _class;
8609 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
8610 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
8611 struct Symbol * symbol;
8612 struct Location blockStart;
8613 struct Location nameLoc;
8614 int declMode;
8615 unsigned int deleteWatchable;
8616 } ecere_gcc_struct;
8617
8618 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
8619
8620 void __ecereMethod_External_CreateEdge(struct External * this, struct External * from, unsigned int soft);
8621
8622 void DeclareGlobalData(struct External * neededFor, struct GlobalData * data)
8623 {
8624 struct Symbol * symbol = data->symbol;
8625
8626 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
8627 {
8628 if(inCompiler)
8629 {
8630 if(!symbol)
8631 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
8632 }
8633 if(!data->dataType)
8634 data->dataType = ProcessTypeString(data->dataTypeString, 0);
8635 if(inCompiler)
8636 {
8637 struct Declaration * decl;
8638 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
8639 struct Declarator * d;
8640 struct External * external;
8641
8642 specifiers = MkList();
8643 declarators = MkList();
8644 ListAdd(specifiers, MkSpecifier(EXTERN));
8645 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
8646 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
8647 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
8648 decl = MkDeclaration(specifiers, declarators);
8649 external = MkExternalDeclaration(decl);
8650 if(curExternal)
8651 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
8652 external->symbol = symbol;
8653 symbol->__anon2.__anon1.pointerExternal = external;
8654 DeclareType(external, data->dataType, 1, 1);
8655 }
8656 }
8657 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
8658 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, 0);
8659 }
8660
8661 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
8662 {
8663 struct Context * ctx;
8664 struct Symbol * symbol = (((void *)0));
8665
8666 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
8667 {
8668 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
8669 {
8670 symbol = (((void *)0));
8671 if(thisNameSpace)
8672 {
8673 char curName[1024];
8674
8675 strcpy(curName, thisNameSpace);
8676 strcat(curName, "::");
8677 strcat(curName, name);
8678 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
8679 }
8680 if(!symbol)
8681 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
8682 }
8683 else
8684 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
8685 if(symbol || ctx == endContext)
8686 break;
8687 }
8688 if(inCompiler && symbol && ctx == globalContext && symbol->__anon2.__anon1.pointerExternal && curExternal && symbol->__anon2.__anon1.pointerExternal != curExternal)
8689 __ecereMethod_External_CreateUniqueEdge(curExternal, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
8690 return symbol;
8691 }
8692
8693 struct PropertyDef;
8694
8695 struct ClassDef
8696 {
8697 struct ClassDef * prev;
8698 struct ClassDef * next;
8699 struct Location loc;
8700 int type;
8701 union
8702 {
8703 struct Declaration * decl;
8704 struct ClassFunction * function;
8705 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
8706 struct PropertyDef * propertyDef;
8707 struct PropertyWatch * propertyWatch;
8708 char *  designer;
8709 struct Identifier * defaultProperty;
8710 struct
8711 {
8712 struct Identifier * id;
8713 struct Initializer * initializer;
8714 } ecere_gcc_struct __anon1;
8715 } ecere_gcc_struct __anon1;
8716 int memberAccess;
8717 void *  object;
8718 } ecere_gcc_struct;
8719
8720 struct PropertyDef
8721 {
8722 struct PropertyDef * prev;
8723 struct PropertyDef * next;
8724 struct Location loc;
8725 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
8726 struct Declarator * declarator;
8727 struct Identifier * id;
8728 struct Statement * getStmt;
8729 struct Statement * setStmt;
8730 struct Statement * issetStmt;
8731 struct Symbol * symbol;
8732 struct Expression * category;
8733 struct
8734 {
8735 unsigned int conversion : 1;
8736 unsigned int isWatchable : 1;
8737 unsigned int isDBProp : 1;
8738 } ecere_gcc_struct __anon1;
8739 } ecere_gcc_struct;
8740
8741 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
8742 {
8743 struct ClassDef * def;
8744 int anonID = 1;
8745
8746 for(def = (*definitions).first; def; def = def->next)
8747 {
8748 if(def->type == 2)
8749 {
8750 struct Declaration * decl = def->__anon1.decl;
8751
8752 if(decl && decl->__anon1.__anon1.specifiers)
8753 {
8754 struct Specifier * spec;
8755 unsigned int isStruct = 0;
8756
8757 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
8758 {
8759 if(spec->type == 3 || spec->type == 4)
8760 {
8761 if(spec->__anon1.__anon2.definitions)
8762 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
8763 isStruct = 1;
8764 }
8765 }
8766 if(isStruct)
8767 {
8768 struct Declarator * d = (((void *)0));
8769
8770 if(decl->__anon1.__anon1.declarators)
8771 {
8772 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
8773 {
8774 struct Identifier * idDecl = GetDeclId(d);
8775
8776 if(idDecl)
8777 break;
8778 }
8779 }
8780 if(!d)
8781 {
8782 char id[100];
8783
8784 sprintf(id, "__anon%d", anonID++);
8785 if(!decl->__anon1.__anon1.declarators)
8786 decl->__anon1.__anon1.declarators = MkList();
8787 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
8788 }
8789 }
8790 }
8791 }
8792 }
8793 }
8794
8795 struct MemberInit;
8796
8797 typedef union YYSTYPE
8798 {
8799 int specifierType;
8800 int i;
8801 int declMode;
8802 struct Identifier * id;
8803 struct Expression * exp;
8804 struct Specifier * specifier;
8805 struct __ecereNameSpace__ecere__sys__OldList * list;
8806 struct Enumerator * enumerator;
8807 struct Declarator * declarator;
8808 struct Pointer * pointer;
8809 struct Initializer * initializer;
8810 struct InitDeclarator * initDeclarator;
8811 struct TypeName * typeName;
8812 struct Declaration * declaration;
8813 struct Statement * stmt;
8814 struct FunctionDefinition * function;
8815 struct External * external;
8816 struct Context * context;
8817 struct AsmField * asmField;
8818 struct Attrib * attrib;
8819 struct ExtDecl * extDecl;
8820 struct Attribute * attribute;
8821 struct Instantiation * instance;
8822 struct MembersInit * membersInit;
8823 struct MemberInit * memberInit;
8824 struct ClassFunction * classFunction;
8825 struct ClassDefinition * _class;
8826 struct ClassDef * classDef;
8827 struct PropertyDef * prop;
8828 char * string;
8829 struct Symbol * symbol;
8830 struct PropertyWatch * propertyWatch;
8831 struct TemplateParameter * templateParameter;
8832 struct TemplateArgument * templateArgument;
8833 struct TemplateDatatype * templateDatatype;
8834 struct DBTableEntry * dbtableEntry;
8835 struct DBIndexItem * dbindexItem;
8836 struct DBTableDef * dbtableDef;
8837 } ecere_gcc_struct YYSTYPE;
8838
8839 extern YYSTYPE yylval;
8840
8841 struct MemberInit
8842 {
8843 struct MemberInit * prev;
8844 struct MemberInit * next;
8845 struct Location loc;
8846 struct Location realLoc;
8847 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
8848 struct Initializer * initializer;
8849 unsigned int used;
8850 unsigned int variable;
8851 unsigned int takeOutExp;
8852 } ecere_gcc_struct;
8853
8854 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
8855
8856 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
8857
8858 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
8859 {
8860 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
8861 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
8862 const char *  name;
8863 int type;
8864 union
8865 {
8866 const char *  dataTypeString;
8867 int memberType;
8868 } ecere_gcc_struct __anon1;
8869 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
8870 void *  param;
8871 } ecere_gcc_struct;
8872
8873 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
8874 {
8875 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
8876 int id = 0;
8877 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
8878 struct __ecereNameSpace__ecere__com__Class * sClass;
8879
8880 for(sClass = _class; sClass; sClass = sClass->base)
8881 {
8882 id = 0;
8883 if(sClass->templateClass)
8884 sClass = sClass->templateClass;
8885 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
8886 {
8887 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
8888 {
8889 for(sClass = sClass->base; sClass; sClass = sClass->base)
8890 {
8891 if(sClass->templateClass)
8892 sClass = sClass->templateClass;
8893 id += sClass->templateParams.count;
8894 }
8895 break;
8896 }
8897 id++;
8898 }
8899 if(curParam)
8900 break;
8901 }
8902 if(curParam)
8903 {
8904 arg = &_class->templateArgs[id];
8905 if(arg && param->type == 0)
8906 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
8907 }
8908 return arg;
8909 }
8910
8911 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
8912 {
8913 struct Context * context = PushContext();
8914
8915 context->templateTypesOnly = 1;
8916 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
8917 {
8918 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
8919
8920 for(; param; param = param->next)
8921 {
8922 if(param->type == 0 && param->identifier)
8923 {
8924 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
8925
8926 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8927 }
8928 }
8929 }
8930 else if(_class)
8931 {
8932 struct __ecereNameSpace__ecere__com__Class * sClass;
8933
8934 for(sClass = _class; sClass; sClass = sClass->base)
8935 {
8936 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
8937
8938 for(p = sClass->templateParams.first; p; p = p->next)
8939 {
8940 if(p->type == 0)
8941 {
8942 struct TemplateParameter * param = p->param;
8943 struct TemplatedType * type;
8944
8945 if(!param)
8946 {
8947 p->param = param = __extension__ ({
8948 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
8949
8950 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
8951 });
8952 }
8953 type = __extension__ ({
8954 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
8955
8956 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
8957 });
8958 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8959 }
8960 }
8961 }
8962 }
8963 return context;
8964 }
8965
8966 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
8967 {
8968 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8969 {
8970 unsigned int first = 1;
8971 int p = 0;
8972 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8973 int lastParam = -1;
8974 char className[1024];
8975
8976 strcpy(className, _class->fullName);
8977 for(param = _class->templateParams.first; param; param = param->next)
8978 {
8979 {
8980 if(first)
8981 strcat(className, "<");
8982 if(!first)
8983 strcat(className, ", ");
8984 if(lastParam + 1 != p)
8985 {
8986 strcat(className, param->name);
8987 strcat(className, " = ");
8988 }
8989 strcat(className, param->name);
8990 first = 0;
8991 lastParam = p;
8992 }
8993 p++;
8994 }
8995 if(!first)
8996 {
8997 int len = strlen(className);
8998
8999 if(className[len - 1] == '>')
9000 className[len++] = ' ';
9001 className[len++] = '>';
9002 className[len++] = '\0';
9003 }
9004 return __ecereNameSpace__ecere__sys__CopyString(className);
9005 }
9006 else
9007 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
9008 }
9009
9010 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
9011 {
9012 struct Type * type;
9013
9014 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
9015 {
9016 unsigned int first = 1;
9017 int p = 0;
9018 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9019 int lastParam = -1;
9020 char className[1024];
9021
9022 strcpy(className, _class->fullName);
9023 for(param = _class->templateParams.first; param; param = param->next)
9024 {
9025 {
9026 if(first)
9027 strcat(className, "<");
9028 if(!first)
9029 strcat(className, ", ");
9030 if(lastParam + 1 != p)
9031 {
9032 strcat(className, param->name);
9033 strcat(className, " = ");
9034 }
9035 strcat(className, param->name);
9036 first = 0;
9037 lastParam = p;
9038 }
9039 p++;
9040 }
9041 if(!first)
9042 {
9043 int len = strlen(className);
9044
9045 if(className[len - 1] == '>')
9046 className[len++] = ' ';
9047 className[len++] = '>';
9048 className[len++] = '\0';
9049 }
9050 type = MkClassType(className);
9051 }
9052 else
9053 {
9054 type = MkClassType(_class->fullName);
9055 }
9056 return type;
9057 }
9058
9059 static int DeclareMembers(struct External * neededBy, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9060 {
9061 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9062 struct __ecereNameSpace__ecere__com__DataMember * member;
9063 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9064
9065 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
9066 DeclareMembers(neededBy, _class->base, 0);
9067 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
9068 {
9069 if(!member->isProperty)
9070 {
9071 switch(member->type)
9072 {
9073 case 0:
9074 {
9075 if(!member->dataType && member->dataTypeString)
9076 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9077 if(member->dataType)
9078 DeclareType(neededBy, member->dataType, 1, 0);
9079 break;
9080 }
9081 case 1:
9082 case 2:
9083 {
9084 DeclareMembers(neededBy, (struct __ecereNameSpace__ecere__com__Class *)member, 1);
9085 break;
9086 }
9087 }
9088 }
9089 }
9090 if(context)
9091 FinishTemplatesContext(context);
9092 return topMember ? topMember->memberID : _class->memberID;
9093 }
9094
9095 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
9096 {
9097 if(!method->dataType)
9098 {
9099 struct Context * context = SetupTemplatesContext(method->_class);
9100
9101 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9102 FinishTemplatesContext(context);
9103 if(method->type != 1 && method->dataType)
9104 {
9105 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
9106 {
9107 if(!method->_class->symbol)
9108 method->_class->symbol = FindClass(method->_class->fullName);
9109 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
9110 }
9111 }
9112 }
9113 }
9114
9115 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
9116 {
9117 if(!prop->dataType)
9118 {
9119 struct Context * context = SetupTemplatesContext(prop->_class);
9120
9121 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
9122 FinishTemplatesContext(context);
9123 }
9124 }
9125
9126 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
9127 {
9128 if(specs != (((void *)0)) && _class)
9129 {
9130 struct Specifier * spec;
9131
9132 for(spec = specs->first; spec; spec = spec->next)
9133 {
9134 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
9135 {
9136 spec->type = 1;
9137 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
9138 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
9139 }
9140 }
9141 }
9142 }
9143
9144 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
9145 {
9146 struct Identifier * id = exp->__anon1.__anon1.identifier;
9147 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9148 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9149 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9150 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9151
9152 if(_class && _class->type == 4)
9153 {
9154 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
9155 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9156
9157 if(enumClass)
9158 {
9159 struct __ecereNameSpace__ecere__com__Class * baseClass;
9160
9161 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
9162 {
9163 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
9164
9165 for(value = e->values.first; value; value = value->next)
9166 {
9167 if(!strcmp(value->name, id->string))
9168 break;
9169 }
9170 if(value)
9171 {
9172 exp->isConstant = 1;
9173 if(inCompiler || inPreCompiler || inDebugger)
9174 {
9175 char constant[256];
9176
9177 FreeExpContents(exp);
9178 exp->type = 2;
9179 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
9180 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
9181 else
9182 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
9183 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9184 }
9185 exp->expType = MkClassType(baseClass->fullName);
9186 break;
9187 }
9188 }
9189 }
9190 if(value)
9191 return 1;
9192 }
9193 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
9194 {
9195 ProcessMethodType(method);
9196 exp->expType = __extension__ ({
9197 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
9198
9199 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
9200 });
9201 return 1;
9202 }
9203 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
9204 {
9205 if(!prop->dataType)
9206 ProcessPropertyType(prop);
9207 exp->expType = prop->dataType;
9208 if(prop->dataType)
9209 prop->dataType->refCount++;
9210 return 1;
9211 }
9212 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
9213 {
9214 if(!member->dataType)
9215 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9216 exp->expType = member->dataType;
9217 if(member->dataType)
9218 member->dataType->refCount++;
9219 return 1;
9220 }
9221 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
9222 {
9223 if(!classProp->dataType)
9224 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
9225 if(classProp->constant)
9226 {
9227 FreeExpContents(exp);
9228 exp->isConstant = 1;
9229 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
9230 {
9231 exp->type = 3;
9232 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
9233 }
9234 else
9235 {
9236 char constant[256];
9237
9238 exp->type = 2;
9239 sprintf(constant, "%d", (int)classProp->Get(_class));
9240 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9241 }
9242 }
9243 else
9244 {
9245 }
9246 exp->expType = classProp->dataType;
9247 if(classProp->dataType)
9248 classProp->dataType->refCount++;
9249 return 1;
9250 }
9251 return 0;
9252 }
9253
9254 void DeclareProperty(struct External * neededBy, struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
9255 {
9256 struct Symbol * symbol = prop->symbol;
9257 unsigned int imported = 0;
9258 unsigned int dllImport = 0;
9259 struct External * structExternal = (((void *)0));
9260 struct External * instExternal = (((void *)0));
9261
9262 strcpy(setName, "__ecereProp_");
9263 FullClassNameCat(setName, prop->_class->fullName, 0);
9264 strcat(setName, "_Set_");
9265 FullClassNameCat(setName, prop->name, 1);
9266 strcpy(getName, "__ecereProp_");
9267 FullClassNameCat(getName, prop->_class->fullName, 0);
9268 strcat(getName, "_Get_");
9269 FullClassNameCat(getName, prop->name, 1);
9270 if(!symbol || symbol->_import)
9271 {
9272 if(!symbol)
9273 {
9274 struct Symbol * classSym;
9275
9276 if(!prop->_class->symbol)
9277 prop->_class->symbol = FindClass(prop->_class->fullName);
9278 classSym = prop->_class->symbol;
9279 if(classSym && !classSym->_import)
9280 {
9281 struct ModuleImport * module;
9282
9283 if(prop->_class->module)
9284 module = FindModule(prop->_class->module);
9285 else
9286 module = mainModule;
9287 classSym->_import = __extension__ ({
9288 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9289
9290 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
9291 });
9292 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9293 }
9294 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9295 symbol->_import = (struct ClassImport *)__extension__ ({
9296 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
9297
9298 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
9299 });
9300 if(classSym)
9301 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
9302 }
9303 imported = 1;
9304 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)
9305 dllImport = 1;
9306 }
9307 if(!symbol->type)
9308 {
9309 struct Context * context = SetupTemplatesContext(prop->_class);
9310
9311 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
9312 FinishTemplatesContext(context);
9313 }
9314 if((prop->Get && !symbol->__anon2.__anon2.externalGet) || (prop->Set && !symbol->__anon2.__anon2.externalSet))
9315 {
9316 if(prop->_class->type == 0 && prop->_class->structSize)
9317 instExternal = DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
9318 structExternal = DeclareStruct((((void *)0)), prop->_class->fullName, prop->_class->type != 1, 0);
9319 }
9320 if(prop->Get && !symbol->__anon2.__anon2.externalGet)
9321 {
9322 struct Declaration * decl;
9323 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9324 struct Declarator * d;
9325 struct __ecereNameSpace__ecere__sys__OldList * params;
9326 struct Specifier * spec = (((void *)0));
9327 struct External * external;
9328 struct Declarator * typeDecl;
9329 unsigned int simple = 0;
9330 unsigned int needReference;
9331
9332 specifiers = MkList();
9333 declarators = MkList();
9334 params = MkList();
9335 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9336 d = MkDeclaratorIdentifier(MkIdentifier(getName));
9337 if(dllImport)
9338 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9339 {
9340 struct Context * context = SetupTemplatesContext(prop->_class);
9341
9342 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
9343 FinishTemplatesContext(context);
9344 }
9345 needReference = !typeDecl || typeDecl->type == 1;
9346 for(spec = (*specifiers).first; spec; spec = spec->next)
9347 {
9348 if(spec->type == 1)
9349 {
9350 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9351
9352 if(needReference)
9353 {
9354 symbol->_class = classSym->__anon1.registered;
9355 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
9356 simple = 1;
9357 }
9358 break;
9359 }
9360 }
9361 if(!simple)
9362 d = PlugDeclarator(typeDecl, d);
9363 else
9364 {
9365 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
9366 specifiers = MkList();
9367 }
9368 d = MkDeclaratorFunction(d, params);
9369 if(dllImport)
9370 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9371 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9372 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9373 if(simple)
9374 ListAdd(specifiers, MkSpecifier(VOID));
9375 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9376 decl = MkDeclaration(specifiers, declarators);
9377 external = MkExternalDeclaration(decl);
9378 if(structExternal)
9379 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9380 if(instExternal)
9381 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9382 if(spec)
9383 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9384 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9385 external->symbol = symbol;
9386 symbol->__anon2.__anon2.externalGet = external;
9387 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9388 if(typeDecl)
9389 FreeDeclarator(typeDecl);
9390 }
9391 if(prop->Set && !symbol->__anon2.__anon2.externalSet)
9392 {
9393 struct Declaration * decl;
9394 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9395 struct Declarator * d;
9396 struct __ecereNameSpace__ecere__sys__OldList * params;
9397 struct Specifier * spec = (((void *)0));
9398 struct External * external;
9399 struct Declarator * typeDecl;
9400 unsigned int needReference;
9401
9402 declarators = MkList();
9403 params = MkList();
9404 if(!prop->conversion || prop->_class->type == 1)
9405 {
9406 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9407 }
9408 specifiers = MkList();
9409 {
9410 struct Context * context = SetupTemplatesContext(prop->_class);
9411
9412 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
9413 FinishTemplatesContext(context);
9414 }
9415 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
9416 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
9417 ListAdd(params, MkTypeName(specifiers, d));
9418 d = MkDeclaratorIdentifier(MkIdentifier(setName));
9419 if(dllImport)
9420 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9421 d = MkDeclaratorFunction(d, params);
9422 needReference = !typeDecl || typeDecl->type == 1;
9423 for(spec = (*specifiers).first; spec; spec = spec->next)
9424 {
9425 if(spec->type == 1)
9426 {
9427 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9428
9429 if(needReference)
9430 symbol->_class = classSym->__anon1.registered;
9431 break;
9432 }
9433 }
9434 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9435 specifiers = MkList();
9436 if(dllImport)
9437 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9438 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9439 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9440 if(!prop->conversion || prop->_class->type == 1)
9441 ListAdd(specifiers, MkSpecifier(VOID));
9442 else
9443 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
9444 decl = MkDeclaration(specifiers, declarators);
9445 external = MkExternalDeclaration(decl);
9446 if(structExternal)
9447 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9448 if(instExternal)
9449 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9450 if(spec)
9451 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9452 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9453 external->symbol = symbol;
9454 symbol->__anon2.__anon2.externalSet = external;
9455 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9456 }
9457 if(!symbol->__anon2.__anon2.externalPtr)
9458 {
9459 struct Declaration * decl;
9460 struct External * external;
9461 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
9462 char propName[1024];
9463
9464 if(imported)
9465 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9466 else
9467 {
9468 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9469 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
9470 }
9471 ListAdd(specifiers, MkSpecifierName("Property"));
9472 strcpy(propName, "__ecereProp_");
9473 FullClassNameCat(propName, prop->_class->fullName, 0);
9474 strcat(propName, "_");
9475 FullClassNameCat(propName, prop->name, 1);
9476 {
9477 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
9478
9479 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9480 if(!imported)
9481 {
9482 strcpy(propName, "__ecerePropM_");
9483 FullClassNameCat(propName, prop->_class->fullName, 0);
9484 strcat(propName, "_");
9485 FullClassNameCat(propName, prop->name, 1);
9486 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9487 }
9488 decl = MkDeclaration(specifiers, list);
9489 }
9490 external = MkExternalDeclaration(decl);
9491 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
9492 external->symbol = symbol;
9493 symbol->__anon2.__anon2.externalPtr = external;
9494 }
9495 if(inCompiler && neededBy)
9496 {
9497 if(symbol->__anon2.__anon2.externalPtr)
9498 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalPtr, 0);
9499 if(symbol->__anon2.__anon2.externalGet)
9500 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalGet, symbol->__anon2.__anon2.externalGet->type == 0);
9501 if(symbol->__anon2.__anon2.externalSet)
9502 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalSet, symbol->__anon2.__anon2.externalSet->type == 0);
9503 }
9504 }
9505
9506 static void ProcessDeclarator(struct Declarator *  decl, unsigned int isFunction);
9507
9508 void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char * name)
9509 {
9510 struct Symbol * symbol = method->symbol;
9511
9512 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && (!symbol->__anon2.__anon3.methodCodeExternal || method->type == 1)))
9513 {
9514 unsigned int dllImport = 0;
9515
9516 if(!method->dataType)
9517 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9518 {
9519 if(!symbol || method->type == 1)
9520 {
9521 struct Symbol * classSym;
9522
9523 if(!method->_class->symbol)
9524 method->_class->symbol = FindClass(method->_class->fullName);
9525 classSym = method->_class->symbol;
9526 if(!classSym->_import)
9527 {
9528 struct ModuleImport * module;
9529
9530 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->name)
9531 module = FindModule(method->_class->module);
9532 else
9533 module = mainModule;
9534 classSym->_import = __extension__ ({
9535 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9536
9537 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
9538 });
9539 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9540 }
9541 if(!symbol)
9542 {
9543 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9544 }
9545 if(!symbol->_import)
9546 {
9547 symbol->_import = (struct ClassImport *)__extension__ ({
9548 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
9549
9550 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
9551 });
9552 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
9553 }
9554 if(!symbol)
9555 {
9556 symbol->type = method->dataType;
9557 if(symbol->type)
9558 symbol->type->refCount++;
9559 }
9560 }
9561 if(!method->dataType->dllExport)
9562 {
9563 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)
9564 dllImport = 1;
9565 }
9566 }
9567 if(inCompiler)
9568 {
9569 struct Declaration * decl;
9570 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9571 struct Declarator * d;
9572 struct Declarator * funcDecl;
9573 struct External * external;
9574
9575 specifiers = MkList();
9576 declarators = MkList();
9577 if(dllImport)
9578 ListAdd(specifiers, MkSpecifier(EXTERN));
9579 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
9580 ListAdd(specifiers, MkSpecifier(STATIC));
9581 if(method->type == 1)
9582 {
9583 ListAdd(specifiers, MkSpecifier(INT));
9584 d = MkDeclaratorIdentifier(MkIdentifier(name));
9585 }
9586 else
9587 {
9588 d = MkDeclaratorIdentifier(MkIdentifier(name));
9589 if(dllImport)
9590 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9591 {
9592 struct Context * context = SetupTemplatesContext(method->_class);
9593
9594 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
9595 FinishTemplatesContext(context);
9596 }
9597 funcDecl = GetFuncDecl(d);
9598 if(dllImport)
9599 {
9600 struct Specifier * spec, * next;
9601
9602 for(spec = (*specifiers).first; spec; spec = next)
9603 {
9604 next = spec->next;
9605 if(spec->type == 5)
9606 {
9607 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9608 FreeSpecifier(spec);
9609 }
9610 }
9611 }
9612 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
9613 {
9614 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
9615 {
9616 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
9617 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")));
9618 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
9619 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
9620
9621 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
9622 {
9623 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
9624
9625 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
9626 FreeTypeName(param);
9627 }
9628 if(!funcDecl->__anon1.function.parameters)
9629 funcDecl->__anon1.function.parameters = MkList();
9630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
9631 }
9632 }
9633 }
9634 ProcessDeclarator(d, 1);
9635 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9636 decl = MkDeclaration(specifiers, declarators);
9637 ReplaceThisClassSpecifiers(specifiers, method->_class);
9638 external = MkExternalDeclaration(decl);
9639 external->symbol = symbol;
9640 symbol->__anon2.__anon1.pointerExternal = external;
9641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9642 DeclareStruct(external, method->_class->fullName, 1, 1);
9643 if(method->dataType)
9644 DeclareType(external, method->dataType, 1, 1);
9645 }
9646 }
9647 if(inCompiler && neededFor)
9648 {
9649 struct External * external = symbol->__anon2.__anon1.pointerExternal ? symbol->__anon2.__anon1.pointerExternal : symbol->__anon2.__anon3.methodCodeExternal;
9650
9651 __ecereMethod_External_CreateUniqueEdge(neededFor, external, external->type == 0);
9652 }
9653 }
9654
9655 struct __ecereNameSpace__ecere__com__GlobalFunction;
9656
9657 struct __ecereNameSpace__ecere__com__GlobalFunction
9658 {
9659 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
9660 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
9661 const char *  name;
9662 int (*  function)();
9663 struct __ecereNameSpace__ecere__com__Instance * module;
9664 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
9665 const char *  dataTypeString;
9666 struct Type * dataType;
9667 void *  symbol;
9668 } ecere_gcc_struct;
9669
9670 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
9671
9672 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);
9673
9674 unsigned int DeclareFunction(struct External * neededFor, struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
9675 {
9676 struct Symbol * symbol = function->symbol;
9677
9678 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
9679 {
9680 unsigned int imported = 0;
9681 unsigned int dllImport = 0;
9682
9683 if(!function->dataType)
9684 {
9685 function->dataType = ProcessTypeString(function->dataTypeString, 0);
9686 if(!function->dataType->__anon1.__anon2.thisClass)
9687 function->dataType->__anon1.__anon2.staticMethod = 1;
9688 }
9689 if(inCompiler)
9690 {
9691 if(!symbol)
9692 {
9693 struct ModuleImport * module = FindModule(function->module);
9694
9695 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9696 if(module->name)
9697 {
9698 if(!function->dataType->dllExport)
9699 {
9700 symbol->_import = (struct ClassImport *)__extension__ ({
9701 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
9702
9703 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
9704 });
9705 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
9706 }
9707 }
9708 {
9709 symbol->type = ProcessTypeString(function->dataTypeString, 0);
9710 if(!symbol->type->__anon1.__anon2.thisClass)
9711 symbol->type->__anon1.__anon2.staticMethod = 1;
9712 }
9713 }
9714 imported = symbol->_import ? 1 : 0;
9715 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9716 dllImport = 1;
9717 }
9718 if(inCompiler)
9719 {
9720 {
9721 struct Declaration * decl;
9722 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9723 struct Declarator * d;
9724 struct Declarator * funcDecl;
9725 struct External * external;
9726
9727 specifiers = MkList();
9728 declarators = MkList();
9729 ListAdd(specifiers, MkSpecifier(EXTERN));
9730 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
9731 if(dllImport)
9732 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9733 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
9734 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType == 1)
9735 {
9736 struct Specifier * spec;
9737
9738 for(spec = (*specifiers).first; spec; spec = spec->next)
9739 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
9740 {
9741 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9742 FreeSpecifier(spec);
9743 break;
9744 }
9745 }
9746 funcDecl = GetFuncDecl(d);
9747 if(funcDecl && !funcDecl->__anon1.function.parameters)
9748 {
9749 funcDecl->__anon1.function.parameters = MkList();
9750 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
9751 }
9752 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9753 {
9754 struct Context * oldCtx = curContext;
9755
9756 curContext = globalContext;
9757 decl = MkDeclaration(specifiers, declarators);
9758 curContext = oldCtx;
9759 }
9760 external = MkExternalDeclaration(decl);
9761 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9762 external->symbol = symbol;
9763 symbol->__anon2.__anon1.pointerExternal = external;
9764 DeclareType(external, function->dataType, 1, 1);
9765 }
9766 }
9767 }
9768 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
9769 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
9770 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;
9771 }
9772
9773 void DeclareFunctionUtil(struct External * neededBy, const char * s)
9774 {
9775 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
9776
9777 if(function)
9778 {
9779 char name[1024];
9780
9781 name[0] = 0;
9782 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
9783 strcpy(name, "__ecereFunction_");
9784 FullClassNameCat(name, s, 0);
9785 DeclareFunction(neededBy, function, name);
9786 }
9787 else if(neededBy)
9788 FindSymbol(s, globalContext, globalContext, 0, 0);
9789 }
9790
9791 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
9792 {
9793 char propName[1024], propNameM[1024];
9794 char getName[1024], setName[1024];
9795 struct __ecereNameSpace__ecere__sys__OldList * args;
9796
9797 DeclareProperty(curExternal, prop, setName, getName);
9798 strcpy(propName, "__ecereProp_");
9799 FullClassNameCat(propName, prop->_class->fullName, 0);
9800 strcat(propName, "_");
9801 FullClassNameCat(propName, prop->name, 1);
9802 strcpy(propNameM, "__ecerePropM_");
9803 FullClassNameCat(propNameM, prop->_class->fullName, 0);
9804 strcat(propNameM, "_");
9805 FullClassNameCat(propNameM, prop->name, 1);
9806 if(prop->isWatchable)
9807 {
9808 args = MkList();
9809 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9810 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9811 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9812 args = MkList();
9813 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9814 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9815 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9816 DeclareFunctionUtil(curExternal, "eInstance_FireWatchers");
9817 }
9818 {
9819 args = MkList();
9820 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9821 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9822 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9823 args = MkList();
9824 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9825 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9826 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9827 DeclareFunctionUtil(curExternal, "eInstance_FireSelfWatchers");
9828 }
9829 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
9830 curFunction->propSet->fireWatchersDone = 1;
9831 }
9832
9833 struct __ecereNameSpace__ecere__com__SubModule;
9834
9835 struct __ecereNameSpace__ecere__com__SubModule
9836 {
9837 struct __ecereNameSpace__ecere__com__SubModule * prev;
9838 struct __ecereNameSpace__ecere__com__SubModule * next;
9839 struct __ecereNameSpace__ecere__com__Instance * module;
9840 int importMode;
9841 } ecere_gcc_struct;
9842
9843 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
9844 {
9845 struct __ecereNameSpace__ecere__com__SubModule * subModule;
9846
9847 if(searchFor == searchIn)
9848 return 1;
9849 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
9850 {
9851 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
9852 {
9853 if(ModuleVisibility(subModule->module, searchFor))
9854 return 1;
9855 }
9856 }
9857 return 0;
9858 }
9859
9860 void ProcessExpressionType(struct Expression *  exp);
9861
9862 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
9863 {
9864 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
9865 {
9866 struct Identifier * id = exp->__anon1.__anon1.identifier;
9867 struct Context * ctx;
9868 struct Symbol * symbol = (((void *)0));
9869
9870 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
9871 {
9872 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
9873 {
9874 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
9875 if(symbol)
9876 break;
9877 }
9878 }
9879 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))))
9880 {
9881 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
9882 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9883 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9884 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9885
9886 if(!prop)
9887 {
9888 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
9889 }
9890 if(!prop && !method)
9891 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
9892 if(!prop && !method && !member)
9893 {
9894 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
9895 }
9896 if(prop || method || member || classProp)
9897 {
9898 exp->type = 8;
9899 exp->__anon1.member.member = id;
9900 exp->__anon1.member.memberType = 0;
9901 exp->__anon1.member.exp = QMkExpId("this");
9902 exp->addedThis = 1;
9903 }
9904 else if(_class && _class->templateParams.first)
9905 {
9906 struct __ecereNameSpace__ecere__com__Class * sClass;
9907
9908 for(sClass = _class; sClass; sClass = sClass->base)
9909 {
9910 if(sClass->templateParams.first)
9911 {
9912 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9913
9914 for(param = sClass->templateParams.first; param; param = param->next)
9915 {
9916 if(param->type == 2 && !strcmp(param->name, id->string))
9917 {
9918 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
9919
9920 if(argExp)
9921 {
9922 struct Declarator * decl;
9923 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
9924
9925 FreeIdentifier(exp->__anon1.member.member);
9926 ProcessExpressionType(argExp);
9927 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
9928 exp->expType = ProcessType(specs, decl);
9929 exp->type = 5;
9930 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
9931 }
9932 }
9933 }
9934 }
9935 }
9936 }
9937 }
9938 }
9939 }
9940
9941 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9942 {
9943 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9944
9945 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9946 {
9947 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9948 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9949 else
9950 {
9951 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9952 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9953 struct Type * type;
9954 void * ptr = inst->data + dataMember->offset + offset;
9955 char * result = (((void *)0));
9956
9957 exp->loc = member->loc = inst->loc;
9958 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9959 if(!dataMember->dataType)
9960 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
9961 type = dataMember->dataType;
9962 if(type->kind == 8)
9963 {
9964 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
9965
9966 if(_class->type == 4)
9967 {
9968 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9969
9970 if(enumClass)
9971 {
9972 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9973 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
9974
9975 for(item = e->values.first; item; item = item->next)
9976 {
9977 if(item->data == GetEnumValue(_class, ptr))
9978 {
9979 result = item->name;
9980 break;
9981 }
9982 }
9983 if(result)
9984 {
9985 exp->__anon1.__anon1.identifier = MkIdentifier(result);
9986 exp->type = 0;
9987 exp->destType = MkClassType(_class->fullName);
9988 ProcessExpressionType(exp);
9989 }
9990 }
9991 }
9992 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9993 {
9994 if(!_class->dataType)
9995 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
9996 type = _class->dataType;
9997 }
9998 }
9999 if(!result)
10000 {
10001 switch(type->kind)
10002 {
10003 case 6:
10004 {
10005 FreeExpContents(exp);
10006 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10007 exp->type = 2;
10008 break;
10009 }
10010 case 7:
10011 {
10012 FreeExpContents(exp);
10013 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10014 exp->type = 2;
10015 break;
10016 }
10017 case 3:
10018 {
10019 FreeExpContents(exp);
10020 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10021 exp->type = 2;
10022 break;
10023 }
10024 case 4:
10025 {
10026 FreeExpContents(exp);
10027 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10028 exp->type = 2;
10029 break;
10030 }
10031 case 22:
10032 {
10033 FreeExpContents(exp);
10034 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10035 exp->type = 2;
10036 break;
10037 }
10038 case 23:
10039 {
10040 FreeExpContents(exp);
10041 exp->__anon1.__anon1.constant = PrintInt64((long long)*(ssize_t *)ptr);
10042 exp->type = 2;
10043 break;
10044 }
10045 default:
10046 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10047 }
10048 }
10049 ListAdd(memberList, member);
10050 }
10051 if(parentDataMember->type == 1)
10052 break;
10053 }
10054 }
10055
10056 void CheckTemplateTypes(struct Expression * exp)
10057 {
10058 struct Expression * nbExp = GetNonBracketsExp(exp);
10059
10060 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
10061 {
10062 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10063 struct Context * context;
10064 int kind = exp->expType->kind;
10065
10066 *newExp = *exp;
10067 if(exp->destType)
10068 exp->destType->refCount++;
10069 if(exp->expType)
10070 exp->expType->refCount++;
10071 newExp->prev = (((void *)0));
10072 newExp->next = (((void *)0));
10073 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10074 {
10075 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10076
10077 if(c->type == 2 || c->type == 4 || c->type == 3)
10078 {
10079 if(!c->dataType)
10080 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10081 kind = c->dataType->kind;
10082 }
10083 }
10084 switch(kind)
10085 {
10086 case 7:
10087 if(exp->destType->classObjectType)
10088 {
10089 if(exp->destType)
10090 exp->destType->refCount--;
10091 if(exp->expType)
10092 exp->expType->refCount--;
10093 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10094 }
10095 else
10096 {
10097 struct __ecereNameSpace__ecere__sys__OldList * specs;
10098 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10099 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10100
10101 context = PushContext();
10102 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10103 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10104 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10105 exp->type = 23;
10106 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10107 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10108 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10109 exp->__anon1.compound->__anon1.compound.context = context;
10110 PopContext(context);
10111 }
10112 break;
10113 default:
10114 exp->type = 11;
10115 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10116 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))
10117 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
10118 else
10119 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10120 exp->needCast = 1;
10121 break;
10122 }
10123 }
10124 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10125 {
10126 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10127 struct Context * context;
10128 int kind = exp->expType->kind;
10129
10130 *newExp = *exp;
10131 if(exp->destType)
10132 exp->destType->refCount++;
10133 if(exp->expType)
10134 exp->expType->refCount++;
10135 newExp->prev = (((void *)0));
10136 newExp->next = (((void *)0));
10137 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10138 {
10139 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10140
10141 if(c->type == 2 || c->type == 4 || c->type == 3)
10142 {
10143 if(!c->dataType)
10144 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10145 kind = c->dataType->kind;
10146 }
10147 }
10148 switch(kind)
10149 {
10150 case 7:
10151 if(exp->destType->classObjectType)
10152 {
10153 if(exp->destType)
10154 exp->destType->refCount--;
10155 if(exp->expType)
10156 exp->expType->refCount--;
10157 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10158 }
10159 else
10160 {
10161 struct __ecereNameSpace__ecere__sys__OldList * specs;
10162 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10163 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10164
10165 context = PushContext();
10166 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10167 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10168 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10169 exp->type = 23;
10170 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10171 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10172 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10173 exp->__anon1.compound->__anon1.compound.context = context;
10174 PopContext(context);
10175 }
10176 break;
10177 case 8:
10178 {
10179 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
10180 {
10181 exp->type = 5;
10182 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10183 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)));
10184 ProcessExpressionType((*exp->__anon1.list).first);
10185 break;
10186 }
10187 else
10188 {
10189 exp->type = 5;
10190 if(__ecereProp_Type_Get_isPointerType(exp->expType))
10191 {
10192 exp->needTemplateCast = 2;
10193 newExp->needCast = 1;
10194 newExp->needTemplateCast = 2;
10195 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10196 }
10197 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
10198 exp->needTemplateCast = 2;
10199 newExp->needCast = 1;
10200 newExp->needTemplateCast = 2;
10201 ProcessExpressionType((*exp->__anon1.list).first);
10202 break;
10203 }
10204 }
10205 default:
10206 {
10207 if(exp->expType->kind == 20)
10208 {
10209 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
10210
10211 if(type)
10212 {
10213 FreeType(exp->destType);
10214 FreeType(exp->expType);
10215 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10216 break;
10217 }
10218 }
10219 {
10220 char typeString[1024];
10221 struct Declarator * decl;
10222 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10223
10224 typeString[0] = '\0';
10225 PrintType(exp->expType, typeString, 0, 0);
10226 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10227 exp->type = 11;
10228 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
10229 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10230 exp->__anon1.cast.exp->needCast = 1;
10231 exp->needTemplateCast = 2;
10232 newExp->needTemplateCast = 2;
10233 }
10234 break;
10235 }
10236 }
10237 }
10238 }
10239
10240 static void ProcessInitializer(struct Initializer * init, struct Type * type)
10241 {
10242 switch(init->type)
10243 {
10244 case 0:
10245 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
10246 {
10247 if(init->__anon1.exp && !init->__anon1.exp->destType)
10248 {
10249 FreeType(init->__anon1.exp->destType);
10250 init->__anon1.exp->destType = type;
10251 if(type)
10252 type->refCount++;
10253 }
10254 if(init->__anon1.exp)
10255 {
10256 ProcessExpressionType(init->__anon1.exp);
10257 init->isConstant = init->__anon1.exp->isConstant;
10258 }
10259 break;
10260 }
10261 else
10262 {
10263 struct Expression * exp = init->__anon1.exp;
10264 struct Instantiation * inst = exp->__anon1.instance;
10265 struct MembersInit * members;
10266
10267 init->type = 1;
10268 init->__anon1.list = MkList();
10269 if(inst->members)
10270 {
10271 for(members = (*inst->members).first; members; members = members->next)
10272 {
10273 if(members->type == 0)
10274 {
10275 struct MemberInit * member;
10276
10277 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
10278 {
10279 ListAdd(init->__anon1.list, member->initializer);
10280 member->initializer = (((void *)0));
10281 }
10282 }
10283 }
10284 }
10285 FreeExpression(exp);
10286 }
10287 case 1:
10288 {
10289 struct Initializer * i;
10290 struct Type * initializerType = (((void *)0));
10291 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10292 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10293 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10294 int subMemberStackPos = 0;
10295
10296 if(type && type->kind == 12)
10297 initializerType = Dereference(type);
10298 else if(type && (type->kind == 9 || type->kind == 10))
10299 initializerType = type->__anon1.__anon1.members.first;
10300 for(i = (*init->__anon1.list).first; i; i = i->next)
10301 {
10302 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
10303 {
10304 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10305 if(curMember)
10306 {
10307 if(!curMember->dataType)
10308 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
10309 initializerType = curMember->dataType;
10310 }
10311 }
10312 ProcessInitializer(i, initializerType);
10313 if(initializerType && type && (type->kind == 9 || type->kind == 10))
10314 initializerType = initializerType->next;
10315 if(!i->isConstant)
10316 init->isConstant = 0;
10317 }
10318 if(type && type->kind == 12)
10319 FreeType(initializerType);
10320 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))
10321 {
10322 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
10323 }
10324 break;
10325 }
10326 }
10327 }
10328
10329 void PopulateInstance(struct Instantiation * inst)
10330 {
10331 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
10332 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
10333 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10334 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10335
10336 if(!inst->members)
10337 inst->members = MkListOne(MkMembersInitList(memberList));
10338 else
10339 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10340 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10341 {
10342 if(!dataMember->isProperty)
10343 {
10344 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10345 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10346 else
10347 {
10348 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10349 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10350 struct Type * type;
10351 void * ptr = inst->data + dataMember->offset;
10352 char * result = (((void *)0));
10353
10354 exp->loc = member->loc = inst->loc;
10355 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10356 if(!dataMember->dataType)
10357 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10358 type = dataMember->dataType;
10359 if(type->kind == 8)
10360 {
10361 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
10362
10363 if(_class->type == 4)
10364 {
10365 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10366
10367 if(enumClass)
10368 {
10369 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10370 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
10371
10372 for(item = e->values.first; item; item = item->next)
10373 {
10374 if(item->data == GetEnumValue(_class, ptr))
10375 {
10376 result = item->name;
10377 break;
10378 }
10379 }
10380 }
10381 if(result)
10382 {
10383 exp->__anon1.__anon1.identifier = MkIdentifier(result);
10384 exp->type = 0;
10385 exp->destType = MkClassType(_class->fullName);
10386 ProcessExpressionType(exp);
10387 }
10388 }
10389 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10390 {
10391 if(!_class->dataType)
10392 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
10393 type = _class->dataType;
10394 }
10395 }
10396 if(!result)
10397 {
10398 switch(type->kind)
10399 {
10400 case 6:
10401 {
10402 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10403 exp->type = 2;
10404 break;
10405 }
10406 case 7:
10407 {
10408 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10409 exp->type = 2;
10410 break;
10411 }
10412 case 3:
10413 {
10414 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10415 exp->type = 2;
10416 break;
10417 }
10418 case 4:
10419 {
10420 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10421 exp->type = 2;
10422 break;
10423 }
10424 case 22:
10425 {
10426 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10427 exp->type = 2;
10428 break;
10429 }
10430 default:
10431 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10432 }
10433 }
10434 ListAdd(memberList, member);
10435 }
10436 }
10437 }
10438 }
10439
10440 int ComputeTypeSize(struct Type *  type);
10441
10442 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
10443 {
10444 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10445 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10446
10447 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))
10448 {
10449 int unionMemberOffset = 0;
10450 int bitFields = 0;
10451
10452 if(member)
10453 {
10454 member->memberOffset = 0;
10455 if(targetBits < sizeof(void *) * 8)
10456 member->structAlignment = 0;
10457 }
10458 else if(targetBits < sizeof(void *) * 8)
10459 _class->structAlignment = 0;
10460 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
10461 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
10462 if(!member && _class->destructionWatchOffset)
10463 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10464 {
10465 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10466
10467 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10468 {
10469 if(!dataMember->isProperty)
10470 {
10471 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
10472 {
10473 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10474 }
10475 }
10476 }
10477 }
10478 {
10479 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10480
10481 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10482 {
10483 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
10484 {
10485 if(!isMember && _class->type == 2 && dataMember->dataType)
10486 {
10487 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10488 uint64 mask = 0;
10489 int d;
10490
10491 ComputeTypeSize(dataMember->dataType);
10492 if(bitMember->pos == -1)
10493 bitMember->pos = _class->memberOffset;
10494 if(!bitMember->size)
10495 bitMember->size = dataMember->dataType->size * 8;
10496 _class->memberOffset = bitMember->pos + bitMember->size;
10497 for(d = 0; d < bitMember->size; d++)
10498 {
10499 if(d)
10500 mask <<= 1;
10501 mask |= 1;
10502 }
10503 bitMember->mask = mask << bitMember->pos;
10504 }
10505 else if(dataMember->type == 0 && dataMember->dataType)
10506 {
10507 int size;
10508 int alignment = 0;
10509
10510 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)))
10511 ComputeTypeSize(dataMember->dataType);
10512 if(dataMember->dataType->bitFieldCount)
10513 {
10514 bitFields += dataMember->dataType->bitFieldCount;
10515 size = 0;
10516 }
10517 else
10518 {
10519 if(bitFields)
10520 {
10521 int size = (bitFields + 7) / 8;
10522
10523 if(isMember)
10524 {
10525 int __simpleStruct0;
10526
10527 if(alignment)
10528 {
10529 short __simpleStruct0;
10530
10531 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10532 if(member->memberOffset % alignment)
10533 member->memberOffset += alignment - (member->memberOffset % alignment);
10534 }
10535 dataMember->offset = member->memberOffset;
10536 if(member->type == 1)
10537 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10538 else
10539 {
10540 member->memberOffset += size;
10541 }
10542 }
10543 else
10544 {
10545 if(alignment)
10546 {
10547 short __simpleStruct0;
10548
10549 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10550 if(_class->memberOffset % alignment)
10551 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10552 }
10553 dataMember->offset = _class->memberOffset;
10554 _class->memberOffset += size;
10555 }
10556 bitFields = 0;
10557 }
10558 size = dataMember->dataType->size;
10559 alignment = dataMember->dataType->alignment;
10560 }
10561 if(isMember)
10562 {
10563 int __simpleStruct0;
10564
10565 if(alignment)
10566 {
10567 short __simpleStruct0;
10568
10569 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10570 if(member->memberOffset % alignment)
10571 member->memberOffset += alignment - (member->memberOffset % alignment);
10572 }
10573 dataMember->offset = member->memberOffset;
10574 if(member->type == 1)
10575 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10576 else
10577 {
10578 member->memberOffset += size;
10579 }
10580 }
10581 else
10582 {
10583 if(alignment)
10584 {
10585 short __simpleStruct0;
10586
10587 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10588 if(_class->memberOffset % alignment)
10589 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10590 }
10591 dataMember->offset = _class->memberOffset;
10592 _class->memberOffset += size;
10593 }
10594 }
10595 else
10596 {
10597 int alignment;
10598
10599 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
10600 alignment = dataMember->structAlignment;
10601 if(isMember)
10602 {
10603 int __simpleStruct0;
10604
10605 if(alignment)
10606 {
10607 short __simpleStruct0;
10608
10609 if(member->memberOffset % alignment)
10610 member->memberOffset += alignment - (member->memberOffset % alignment);
10611 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10612 }
10613 dataMember->offset = member->memberOffset;
10614 if(member->type == 1)
10615 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10616 else
10617 member->memberOffset += dataMember->memberOffset;
10618 }
10619 else
10620 {
10621 if(alignment)
10622 {
10623 short __simpleStruct0;
10624
10625 if(_class->memberOffset % alignment)
10626 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10627 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10628 }
10629 dataMember->offset = _class->memberOffset;
10630 _class->memberOffset += dataMember->memberOffset;
10631 }
10632 }
10633 }
10634 }
10635 if(bitFields)
10636 {
10637 int alignment = 0;
10638 int size = (bitFields + 7) / 8;
10639
10640 if(isMember)
10641 {
10642 int __simpleStruct0;
10643
10644 if(alignment)
10645 {
10646 short __simpleStruct0;
10647
10648 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10649 if(member->memberOffset % alignment)
10650 member->memberOffset += alignment - (member->memberOffset % alignment);
10651 }
10652 if(member->type == 1)
10653 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10654 else
10655 {
10656 member->memberOffset += size;
10657 }
10658 }
10659 else
10660 {
10661 if(alignment)
10662 {
10663 short __simpleStruct0;
10664
10665 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10666 if(_class->memberOffset % alignment)
10667 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10668 }
10669 _class->memberOffset += size;
10670 }
10671 bitFields = 0;
10672 }
10673 }
10674 if(member && member->type == 1)
10675 {
10676 member->memberOffset = unionMemberOffset;
10677 }
10678 if(!isMember)
10679 {
10680 if(_class->type != 2)
10681 {
10682 int extra = 0;
10683
10684 if(_class->structAlignment)
10685 {
10686 if(_class->memberOffset % _class->structAlignment)
10687 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
10688 }
10689 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
10690 if(!member)
10691 {
10692 struct __ecereNameSpace__ecere__com__Property * prop;
10693
10694 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
10695 {
10696 if(prop->isProperty && prop->isWatchable)
10697 {
10698 prop->watcherOffset = _class->structSize;
10699 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10700 }
10701 }
10702 }
10703 {
10704 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
10705
10706 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
10707 {
10708 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
10709
10710 if(deriv->computeSize)
10711 {
10712 deriv->offset = _class->structSize;
10713 deriv->memberOffset = 0;
10714 deriv->structSize = deriv->offset;
10715 ComputeClassMembers(deriv, 0);
10716 }
10717 }
10718 }
10719 }
10720 }
10721 }
10722 if(context)
10723 FinishTemplatesContext(context);
10724 }
10725
10726 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)
10727 {
10728 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10729 unsigned int totalSize = 0;
10730 unsigned int maxSize = 0;
10731 int alignment;
10732 unsigned int size;
10733 struct __ecereNameSpace__ecere__com__DataMember * member;
10734 int anonID = 1;
10735 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10736
10737 if(addedPadding)
10738 *addedPadding = 0;
10739 if(!isMember && _class->base)
10740 {
10741 maxSize = _class->structSize;
10742 {
10743 if(_class->type == 1 || _class->type == 5)
10744 AddMembers(neededBy, declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
10745 else
10746 {
10747 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
10748
10749 if(maxSize > baseSize)
10750 maxSize -= baseSize;
10751 else
10752 maxSize = 0;
10753 }
10754 }
10755 }
10756 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
10757 {
10758 if(!member->isProperty)
10759 {
10760 switch(member->type)
10761 {
10762 case 0:
10763 {
10764 if(member->dataTypeString)
10765 {
10766 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
10767 struct Declarator * decl;
10768
10769 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
10770 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
10771 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
10772 if(!member->dataType)
10773 member->dataType = ProcessType(specs, decl);
10774 ReplaceThisClassSpecifiers(specs, topClass);
10775 {
10776 struct Type * type = ProcessType(specs, decl);
10777
10778 DeclareType(neededBy, member->dataType, 1, 0);
10779 FreeType(type);
10780 }
10781 ComputeTypeSize(member->dataType);
10782 size = member->dataType->size;
10783 alignment = member->dataType->alignment;
10784 if(alignment)
10785 {
10786 if(totalSize % alignment)
10787 totalSize += alignment - (totalSize % alignment);
10788 }
10789 totalSize += size;
10790 }
10791 break;
10792 }
10793 case 1:
10794 case 2:
10795 {
10796 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
10797 char id[100];
10798
10799 sprintf(id, "__anon%d", anonID++);
10800 size = 0;
10801 AddMembers(neededBy, list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
10802 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
10803 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
10804 alignment = member->structAlignment;
10805 if(alignment)
10806 {
10807 if(totalSize % alignment)
10808 totalSize += alignment - (totalSize % alignment);
10809 }
10810 totalSize += size;
10811 break;
10812 }
10813 }
10814 }
10815 }
10816 if(retSize)
10817 {
10818 unsigned int __simpleStruct0;
10819
10820 if(topMember && topMember->type == 1)
10821 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
10822 else
10823 *retSize += totalSize;
10824 }
10825 else if(totalSize < maxSize && _class->type != 1000)
10826 {
10827 int autoPadding = 0;
10828
10829 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
10830 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
10831 if(totalSize + autoPadding < maxSize)
10832 {
10833 char sizeString[50];
10834
10835 sprintf(sizeString, "%d", maxSize - totalSize);
10836 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
10837 if(addedPadding)
10838 *addedPadding = 1;
10839 }
10840 }
10841 if(context)
10842 FinishTemplatesContext(context);
10843 return topMember ? topMember->memberID : _class->memberID;
10844 }
10845
10846 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)
10847 {
10848 if(source && dest)
10849 {
10850 if(warnConst)
10851 CheckConstCompatibility(source, dest, 1);
10852 if(source->kind == 20 && dest->kind != 20)
10853 {
10854 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
10855
10856 if(type)
10857 source = type;
10858 }
10859 if(dest->kind == 20 && source->kind != 20)
10860 {
10861 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
10862
10863 if(type)
10864 dest = type;
10865 }
10866 if(dest->classObjectType == 2 && dest->kind != 11)
10867 {
10868 if(source->classObjectType != 3)
10869 return 1;
10870 else
10871 {
10872 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
10873 {
10874 return 1;
10875 }
10876 }
10877 }
10878 else
10879 {
10880 if(source->kind != 11 && source->classObjectType == 3)
10881 return 1;
10882 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
10883 return 1;
10884 }
10885 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
10886 {
10887 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))
10888 return 1;
10889 }
10890 if(dest->kind == 14 && source->kind != 0)
10891 return 1;
10892 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))
10893 return 1;
10894 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))
10895 return 1;
10896 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
10897 {
10898 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
10899 {
10900 if(conversions != (((void *)0)))
10901 {
10902 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
10903 return 1;
10904 }
10905 else
10906 {
10907 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
10908
10909 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
10910 ;
10911 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
10912 ;
10913 if(sourceBase == destBase)
10914 return 1;
10915 }
10916 }
10917 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))
10918 return 1;
10919 else
10920 {
10921 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))
10922 {
10923 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
10924 {
10925 return 1;
10926 }
10927 }
10928 }
10929 }
10930 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
10931 return 1;
10932 if(doConversion)
10933 {
10934 if(source->kind == 8)
10935 {
10936 struct __ecereNameSpace__ecere__com__Class * _class;
10937
10938 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10939 {
10940 struct __ecereNameSpace__ecere__com__Property * convert;
10941
10942 for(convert = _class->conversions.first; convert; convert = convert->next)
10943 {
10944 if(convert->memberAccess == 1 || _class->module == privateModule)
10945 {
10946 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10947
10948 if(!convert->dataType)
10949 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10950 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))
10951 {
10952 if(!conversions && !convert->Get)
10953 return 1;
10954 else if(conversions != (((void *)0)))
10955 {
10956 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))
10957 return 1;
10958 else
10959 {
10960 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10961
10962 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10963 return 1;
10964 }
10965 }
10966 }
10967 }
10968 }
10969 }
10970 }
10971 if(dest->kind == 8)
10972 {
10973 struct __ecereNameSpace__ecere__com__Class * _class;
10974
10975 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10976 {
10977 struct __ecereNameSpace__ecere__com__Property * convert;
10978
10979 for(convert = _class->conversions.first; convert; convert = convert->next)
10980 {
10981 if(convert->memberAccess == 1 || _class->module == privateModule)
10982 {
10983 struct Type * constType = (((void *)0));
10984 unsigned int success = 0;
10985
10986 if(!convert->dataType)
10987 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10988 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
10989 {
10990 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10991
10992 constType = __extension__ ({
10993 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10994
10995 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
10996 });
10997 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
10998 ptrType->constant = 1;
10999 }
11000 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
11001 {
11002 if(!conversions && !convert->Set)
11003 success = 1;
11004 else if(conversions != (((void *)0)))
11005 {
11006 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))
11007 success = 1;
11008 else
11009 {
11010 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
11011
11012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
11013 success = 1;
11014 }
11015 }
11016 }
11017 if(constType)
11018 FreeType(constType);
11019 if(success)
11020 return 1;
11021 }
11022 }
11023 }
11024 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
11025 {
11026 if(!dest->__anon1._class->__anon1.registered->dataType)
11027 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
11028 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
11029 {
11030 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))
11031 {
11032 return 1;
11033 }
11034 }
11035 }
11036 }
11037 if(source->kind == 8)
11038 {
11039 struct __ecereNameSpace__ecere__com__Class * _class;
11040
11041 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
11042 {
11043 struct __ecereNameSpace__ecere__com__Property * convert;
11044
11045 for(convert = _class->conversions.first; convert; convert = convert->next)
11046 {
11047 if(convert->memberAccess == 1 || _class->module == privateModule)
11048 {
11049 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
11050
11051 if(!convert->dataType)
11052 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
11053 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))
11054 {
11055 if(!conversions && !convert->Get)
11056 return 1;
11057 else if(conversions != (((void *)0)))
11058 {
11059 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))
11060 return 1;
11061 else
11062 {
11063 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
11064
11065 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
11066 return 1;
11067 }
11068 }
11069 }
11070 }
11071 }
11072 }
11073 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
11074 {
11075 if(!source->__anon1._class->__anon1.registered->dataType)
11076 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
11077 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
11078 {
11079 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))
11080 return 1;
11081 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
11082 return 1;
11083 }
11084 }
11085 }
11086 }
11087 if(source->kind == 8 || source->kind == 19)
11088 ;
11089 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
11090 return 1;
11091 else if(dest->kind == 7 && source->kind == 6)
11092 return 1;
11093 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
11094 return 1;
11095 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
11096 return 1;
11097 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
11098 return 1;
11099 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
11100 return 1;
11101 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
11102 return 1;
11103 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))
11104 return 1;
11105 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))
11106 return 1;
11107 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)))
11108 {
11109 struct Type * paramSource, * paramDest;
11110
11111 if(dest->kind == 16)
11112 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
11113 if(source->kind == 16)
11114 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
11115 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
11116 dest = dest->__anon1.type;
11117 if(source->kind == 13 && source->__anon1.type->kind == 11)
11118 source = source->__anon1.type;
11119 if(dest->kind == 16)
11120 dest = dest->__anon1.__anon3.method->dataType;
11121 if(source->kind == 16)
11122 source = source->__anon1.__anon3.method->dataType;
11123 paramSource = source->__anon1.__anon2.params.first;
11124 if(paramSource && paramSource->kind == 0)
11125 paramSource = (((void *)0));
11126 paramDest = dest->__anon1.__anon2.params.first;
11127 if(paramDest && paramDest->kind == 0)
11128 paramDest = (((void *)0));
11129 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11130 {
11131 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))))
11132 {
11133 if(paramDest && paramDest->kind == 8)
11134 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
11135 else
11136 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
11137 return 0;
11138 }
11139 paramDest = paramDest->next;
11140 }
11141 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
11142 {
11143 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11144 {
11145 if(dest->__anon1.__anon2.thisClass)
11146 {
11147 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
11148 {
11149 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11150 return 0;
11151 }
11152 }
11153 else
11154 {
11155 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
11156 {
11157 if(owningClassDest)
11158 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
11159 else
11160 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
11161 return 0;
11162 }
11163 }
11164 paramSource = paramSource->next;
11165 }
11166 else
11167 {
11168 if(dest->__anon1.__anon2.thisClass)
11169 {
11170 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
11171 {
11172 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11173 return 0;
11174 }
11175 }
11176 else
11177 {
11178 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
11179 {
11180 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
11181 return 0;
11182 }
11183 }
11184 }
11185 }
11186 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
11187 {
11188 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
11189 return 0;
11190 }
11191 else
11192 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
11193 for(; paramDest; paramDest = paramDest->next)
11194 {
11195 if(!paramSource)
11196 {
11197 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
11198 return 0;
11199 }
11200 {
11201 struct Type * paramDestType = paramDest;
11202 struct Type * paramSourceType = paramSource;
11203 struct Type * type = paramDestType;
11204
11205 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
11206 {
11207 int id = 0;
11208 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
11209 struct __ecereNameSpace__ecere__com__Class * sClass;
11210
11211 for(sClass = owningClassSource; sClass; sClass = sClass->base)
11212 {
11213 id = 0;
11214 if(sClass->templateClass)
11215 sClass = sClass->templateClass;
11216 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
11217 {
11218 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
11219 {
11220 for(sClass = sClass->base; sClass; sClass = sClass->base)
11221 {
11222 if(sClass->templateClass)
11223 sClass = sClass->templateClass;
11224 id += sClass->templateParams.count;
11225 }
11226 break;
11227 }
11228 id++;
11229 }
11230 if(curParam)
11231 break;
11232 }
11233 if(curParam)
11234 {
11235 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
11236
11237 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
11238 }
11239 }
11240 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)))
11241 {
11242 char type[1024];
11243
11244 type[0] = 0;
11245 PrintType(paramDest, type, 0, 1);
11246 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
11247 if(paramDestType != paramDest)
11248 FreeType(paramDestType);
11249 return 0;
11250 }
11251 if(paramDestType != paramDest)
11252 FreeType(paramDestType);
11253 }
11254 paramSource = paramSource->next;
11255 }
11256 if(paramSource)
11257 {
11258 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
11259 return 0;
11260 }
11261 return 1;
11262 }
11263 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
11264 {
11265 return 1;
11266 }
11267 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
11268 {
11269 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))
11270 {
11271 ComputeTypeSize(source->__anon1.type);
11272 ComputeTypeSize(dest->__anon1.type);
11273 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))
11274 return 1;
11275 }
11276 }
11277 }
11278 return 0;
11279 }
11280
11281 void ComputeInstantiation(struct Expression * exp)
11282 {
11283 struct Instantiation * inst = exp->__anon1.instance;
11284 struct MembersInit * members;
11285 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11286 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11287 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11288 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11289 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11290 int subMemberStackPos = 0;
11291 uint64 bits = 0;
11292
11293 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11294 {
11295 if(inst->data)
11296 return ;
11297 if(_class->type == 0 || _class->type == 5)
11298 {
11299 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11300 if(_class->type == 0)
11301 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11302 }
11303 else
11304 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11305 }
11306 if(inst->members)
11307 {
11308 for(members = (*inst->members).first; members; members = members->next)
11309 {
11310 switch(members->type)
11311 {
11312 case 0:
11313 {
11314 if(members->__anon1.dataMembers)
11315 {
11316 struct MemberInit * member;
11317
11318 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11319 {
11320 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11321 unsigned int found = 0;
11322 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11323 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11324 unsigned int dataMemberOffset;
11325
11326 if(!ident)
11327 {
11328 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11329 if(curMember)
11330 {
11331 if(curMember->isProperty)
11332 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11333 else
11334 {
11335 dataMember = curMember;
11336 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11337 if(_class->type == 0)
11338 dataMemberOffset += _class->base->structSize;
11339 }
11340 found = 1;
11341 }
11342 }
11343 else
11344 {
11345 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11346 if(prop)
11347 {
11348 found = 1;
11349 if(prop->memberAccess == 1)
11350 {
11351 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11352 curClass = prop->_class;
11353 }
11354 }
11355 else
11356 {
11357 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11358 int _subMemberStackPos = 0;
11359
11360 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11361 if(dataMember)
11362 {
11363 found = 1;
11364 if(dataMember->memberAccess == 1)
11365 {
11366 curMember = dataMember;
11367 curClass = dataMember->_class;
11368 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11369 subMemberStackPos = _subMemberStackPos;
11370 }
11371 }
11372 }
11373 }
11374 if(found && member->initializer && member->initializer->type == 0)
11375 {
11376 struct Expression * value = member->initializer->__anon1.exp;
11377 struct Type * type = (((void *)0));
11378 unsigned int deepMember = 0;
11379
11380 if(prop)
11381 {
11382 type = prop->dataType;
11383 }
11384 else if(dataMember)
11385 {
11386 if(!dataMember->dataType)
11387 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11388 type = dataMember->dataType;
11389 }
11390 if(ident && ident->next)
11391 {
11392 deepMember = 1;
11393 for(ident = ident->next; ident && type; ident = ident->next)
11394 {
11395 if(type->kind == 8)
11396 {
11397 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11398 if(prop)
11399 type = prop->dataType;
11400 else
11401 {
11402 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11403 if(dataMember)
11404 type = dataMember->dataType;
11405 }
11406 }
11407 else if(type->kind == 9 || type->kind == 10)
11408 {
11409 struct Type * memberType;
11410
11411 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11412 {
11413 if(!strcmp(memberType->name, ident->string))
11414 {
11415 type = memberType;
11416 break;
11417 }
11418 }
11419 }
11420 }
11421 }
11422 if(value)
11423 {
11424 FreeType(value->destType);
11425 value->destType = type;
11426 if(type)
11427 type->refCount++;
11428 ComputeExpression(value);
11429 }
11430 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11431 {
11432 if(type->kind == 8)
11433 {
11434 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11435
11436 if(_class && (_class->type == 2 || _class->type == 3 || _class->type == 4))
11437 {
11438 if(!_class->dataType)
11439 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11440 type = _class->dataType;
11441 }
11442 }
11443 if(dataMember)
11444 {
11445 void * ptr = inst->data + dataMemberOffset;
11446
11447 if(value->type == 2)
11448 {
11449 switch(type->kind)
11450 {
11451 case 3:
11452 {
11453 GetInt(value, (int *)ptr);
11454 break;
11455 }
11456 case 4:
11457 {
11458 GetInt64(value, (long long *)ptr);
11459 break;
11460 }
11461 case 22:
11462 {
11463 GetIntPtr(value, (intptr_t *)ptr);
11464 break;
11465 }
11466 case 23:
11467 {
11468 GetIntSize(value, (ssize_t *)ptr);
11469 break;
11470 }
11471 case 6:
11472 {
11473 GetFloat(value, (float *)ptr);
11474 break;
11475 }
11476 case 7:
11477 {
11478 GetDouble(value, (double *)ptr);
11479 break;
11480 }
11481 }
11482 }
11483 else if(value->type == 1)
11484 {
11485 if(type->kind == 8)
11486 {
11487 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11488
11489 if(_class->type == 1)
11490 {
11491 ComputeTypeSize(type);
11492 if(value->__anon1.instance->data)
11493 memcpy(ptr, value->__anon1.instance->data, type->size);
11494 }
11495 }
11496 }
11497 }
11498 else if(prop && prop->Set != (void *)(intptr_t)1)
11499 {
11500 if(value->type == 1 && value->__anon1.instance->data)
11501 {
11502 if(type->kind == 8)
11503 {
11504 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11505
11506 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)))
11507 {
11508 void (* Set)(void *, void *) = (void *)prop->Set;
11509
11510 Set(inst->data, value->__anon1.instance->data);
11511 PopulateInstance(inst);
11512 }
11513 }
11514 }
11515 else if(value->type == 2)
11516 {
11517 switch(type->kind)
11518 {
11519 case 7:
11520 {
11521 void (* Set)(void *, double) = (void *)prop->Set;
11522
11523 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11524 break;
11525 }
11526 case 6:
11527 {
11528 void (* Set)(void *, float) = (void *)prop->Set;
11529
11530 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11531 break;
11532 }
11533 case 3:
11534 {
11535 void (* Set)(void *, int) = (void *)prop->Set;
11536
11537 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11538 break;
11539 }
11540 case 4:
11541 {
11542 void (* Set)(void *, long long) = (void *)prop->Set;
11543
11544 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11545 break;
11546 }
11547 case 22:
11548 {
11549 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11550
11551 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11552 break;
11553 }
11554 case 23:
11555 {
11556 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11557
11558 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11559 break;
11560 }
11561 }
11562 }
11563 else if(value->type == 3)
11564 {
11565 char temp[1024];
11566
11567 ReadString(temp, value->__anon1.__anon2.string);
11568 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11569 }
11570 }
11571 }
11572 else if(!deepMember && type && _class->type == 3)
11573 {
11574 if(prop)
11575 {
11576 if(value->type == 2)
11577 {
11578 if(type->kind == 8)
11579 {
11580 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11581
11582 if(_class->type == 3)
11583 {
11584 if(!_class->dataType)
11585 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11586 type = _class->dataType;
11587 }
11588 }
11589 switch(type->kind)
11590 {
11591 case 6:
11592 {
11593 float fValue;
11594 float (* Set)(float) = (void *)prop->Set;
11595
11596 GetFloat(member->initializer->__anon1.exp, &fValue);
11597 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11598 exp->type = 2;
11599 break;
11600 }
11601 case 7:
11602 {
11603 double dValue;
11604 double (* Set)(double) = (void *)prop->Set;
11605
11606 GetDouble(member->initializer->__anon1.exp, &dValue);
11607 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11608 exp->type = 2;
11609 break;
11610 }
11611 }
11612 }
11613 }
11614 }
11615 else if(!deepMember && type && _class->type == 2)
11616 {
11617 if(prop)
11618 {
11619 if(value->type == 1 && value->__anon1.instance->data)
11620 {
11621 unsigned int (* Set)(void *) = (void *)prop->Set;
11622
11623 bits = Set(value->__anon1.instance->data);
11624 }
11625 else if(value->type == 2)
11626 {
11627 }
11628 }
11629 else if(dataMember)
11630 {
11631 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11632 struct Type * type;
11633 uint64 part = 0;
11634
11635 bits = (bits & ~bitMember->mask);
11636 if(!bitMember->dataType)
11637 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11638 type = bitMember->dataType;
11639 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11640 {
11641 if(!type->__anon1._class->__anon1.registered->dataType)
11642 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11643 type = type->__anon1._class->__anon1.registered->dataType;
11644 }
11645 switch(type->kind)
11646 {
11647 case 24:
11648 case 1:
11649 {
11650 unsigned char v;
11651
11652 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11653 part = (uint64)v;
11654 break;
11655 }
11656 case 2:
11657 {
11658 unsigned short v;
11659
11660 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11661 part = (uint64)v;
11662 break;
11663 }
11664 case 3:
11665 case 5:
11666 {
11667 unsigned int v;
11668
11669 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11670 part = (uint64)v;
11671 break;
11672 }
11673 case 4:
11674 {
11675 uint64 v;
11676
11677 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11678 part = v;
11679 break;
11680 }
11681 case 22:
11682 {
11683 uintptr_t v;
11684
11685 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11686 part = (uint64)v;
11687 break;
11688 }
11689 case 23:
11690 {
11691 size_t v;
11692
11693 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11694 part = (uint64)v;
11695 break;
11696 }
11697 }
11698 bits |= part << bitMember->pos;
11699 }
11700 }
11701 }
11702 else
11703 {
11704 if(_class && _class->type == 3)
11705 {
11706 ComputeExpression(member->initializer->__anon1.exp);
11707 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11708 exp->type = 2;
11709 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11710 }
11711 }
11712 }
11713 }
11714 break;
11715 }
11716 }
11717 }
11718 }
11719 if(_class && _class->type == 2)
11720 {
11721 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11722 exp->type = 2;
11723 }
11724 if(exp->type != 1)
11725 {
11726 FreeInstance(inst);
11727 }
11728 }
11729
11730 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11731 {
11732 if(exp->__anon1.op.op == SIZEOF)
11733 {
11734 FreeExpContents(exp);
11735 exp->type = 2;
11736 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11737 }
11738 else
11739 {
11740 if(!exp->__anon1.op.exp1)
11741 {
11742 switch(exp->__anon1.op.op)
11743 {
11744 case '+':
11745 {
11746 struct Expression * exp2 = exp->__anon1.op.exp2;
11747
11748 exp->__anon1.op.exp2 = (((void *)0));
11749 FreeExpContents(exp);
11750 FreeType(exp->expType);
11751 FreeType(exp->destType);
11752 *exp = *exp2;
11753 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11754 break;
11755 }
11756 case '-':
11757 if(op1->ops.Neg)
11758 {
11759 FreeExpContents(exp);
11760 op1->ops.Neg(exp, op1);
11761 }
11762 break;
11763 case '~':
11764 if(op1->ops.BitNot)
11765 {
11766 FreeExpContents(exp);
11767 op1->ops.BitNot(exp, op1);
11768 }
11769 break;
11770 case '!':
11771 if(op1->ops.Not)
11772 {
11773 FreeExpContents(exp);
11774 op1->ops.Not(exp, op1);
11775 }
11776 break;
11777 }
11778 }
11779 else
11780 {
11781 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11782 {
11783 if(Promote(op2, op1->kind, op1->type->isSigned))
11784 op2->kind = op1->kind, op2->ops = op1->ops;
11785 else if(Promote(op1, op2->kind, op2->type->isSigned))
11786 op1->kind = op2->kind, op1->ops = op2->ops;
11787 }
11788 switch(exp->__anon1.op.op)
11789 {
11790 case '+':
11791 if(op1->ops.Add)
11792 {
11793 FreeExpContents(exp);
11794 op1->ops.Add(exp, op1, op2);
11795 }
11796 break;
11797 case '-':
11798 if(op1->ops.Sub)
11799 {
11800 FreeExpContents(exp);
11801 op1->ops.Sub(exp, op1, op2);
11802 }
11803 break;
11804 case '*':
11805 if(op1->ops.Mul)
11806 {
11807 FreeExpContents(exp);
11808 op1->ops.Mul(exp, op1, op2);
11809 }
11810 break;
11811 case '/':
11812 if(op1->ops.Div)
11813 {
11814 FreeExpContents(exp);
11815 op1->ops.Div(exp, op1, op2);
11816 }
11817 break;
11818 case '%':
11819 if(op1->ops.Mod)
11820 {
11821 FreeExpContents(exp);
11822 op1->ops.Mod(exp, op1, op2);
11823 }
11824 break;
11825 case '&':
11826 if(exp->__anon1.op.exp2)
11827 {
11828 if(op1->ops.BitAnd)
11829 {
11830 FreeExpContents(exp);
11831 op1->ops.BitAnd(exp, op1, op2);
11832 }
11833 }
11834 break;
11835 case '|':
11836 if(op1->ops.BitOr)
11837 {
11838 FreeExpContents(exp);
11839 op1->ops.BitOr(exp, op1, op2);
11840 }
11841 break;
11842 case '^':
11843 if(op1->ops.BitXor)
11844 {
11845 FreeExpContents(exp);
11846 op1->ops.BitXor(exp, op1, op2);
11847 }
11848 break;
11849 case LEFT_OP:
11850 if(op1->ops.LShift)
11851 {
11852 FreeExpContents(exp);
11853 op1->ops.LShift(exp, op1, op2);
11854 }
11855 break;
11856 case RIGHT_OP:
11857 if(op1->ops.RShift)
11858 {
11859 FreeExpContents(exp);
11860 op1->ops.RShift(exp, op1, op2);
11861 }
11862 break;
11863 case EQ_OP:
11864 if(op1->ops.Equ)
11865 {
11866 FreeExpContents(exp);
11867 op1->ops.Equ(exp, op1, op2);
11868 }
11869 break;
11870 case NE_OP:
11871 if(op1->ops.Nqu)
11872 {
11873 FreeExpContents(exp);
11874 op1->ops.Nqu(exp, op1, op2);
11875 }
11876 break;
11877 case AND_OP:
11878 if(op1->ops.And)
11879 {
11880 FreeExpContents(exp);
11881 op1->ops.And(exp, op1, op2);
11882 }
11883 break;
11884 case OR_OP:
11885 if(op1->ops.Or)
11886 {
11887 FreeExpContents(exp);
11888 op1->ops.Or(exp, op1, op2);
11889 }
11890 break;
11891 case '>':
11892 if(op1->ops.Grt)
11893 {
11894 FreeExpContents(exp);
11895 op1->ops.Grt(exp, op1, op2);
11896 }
11897 break;
11898 case '<':
11899 if(op1->ops.Sma)
11900 {
11901 FreeExpContents(exp);
11902 op1->ops.Sma(exp, op1, op2);
11903 }
11904 break;
11905 case GE_OP:
11906 if(op1->ops.GrtEqu)
11907 {
11908 FreeExpContents(exp);
11909 op1->ops.GrtEqu(exp, op1, op2);
11910 }
11911 break;
11912 case LE_OP:
11913 if(op1->ops.SmaEqu)
11914 {
11915 FreeExpContents(exp);
11916 op1->ops.SmaEqu(exp, op1, op2);
11917 }
11918 break;
11919 }
11920 }
11921 }
11922 }
11923
11924 void ApplyAnyObjectLogic(struct Expression * e)
11925 {
11926 struct Type * destType = e->destType;
11927
11928 if(destType && (destType->classObjectType == 3))
11929 {
11930 if(e && e->expType)
11931 {
11932 struct Type * type = e->expType;
11933 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11934
11935 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11936 {
11937 _class = type->__anon1._class->__anon1.registered;
11938 }
11939 else if(type->kind == 19)
11940 {
11941 _class = FindClass("ecere::com::Class")->__anon1.registered;
11942 }
11943 else
11944 {
11945 char string[1024] = "";
11946 struct Symbol * classSym;
11947
11948 PrintTypeNoConst(type, string, 0, 1);
11949 classSym = FindClass(string);
11950 if(classSym)
11951 _class = classSym->__anon1.registered;
11952 }
11953 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)))
11954 {
11955 if(!_class || strcmp(_class->fullName, "char *"))
11956 {
11957 struct Expression * checkedExp = e, * newExp;
11958
11959 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11960 {
11961 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11962 {
11963 if(checkedExp->type == 23)
11964 {
11965 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11966 }
11967 else
11968 checkedExp = (*checkedExp->__anon1.list).last;
11969 }
11970 else if(checkedExp->type == 11)
11971 checkedExp = checkedExp->__anon1.cast.exp;
11972 }
11973 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
11974 {
11975 newExp = checkedExp->__anon1.op.exp2;
11976 checkedExp->__anon1.op.exp2 = (((void *)0));
11977 FreeExpContents(checkedExp);
11978 if(e->expType && e->expType->passAsTemplate)
11979 {
11980 char size[100];
11981
11982 ComputeTypeSize(e->expType);
11983 sprintf(size, "%d", e->expType->size);
11984 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))))));
11985 }
11986 ReplaceExpContents(checkedExp, newExp);
11987 e->byReference = 1;
11988 }
11989 else if(!e->byReference || (_class && _class->type == 5))
11990 {
11991 struct Expression * checkedExp;
11992
11993 {
11994 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;
11995
11996 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11997 {
11998 struct Context * context = PushContext();
11999 struct Declarator * decl;
12000 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12001 char typeString[1024];
12002 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12003
12004 typeString[0] = '\0';
12005 *newExp = *e;
12006 newExp->prev = (((void *)0));
12007 newExp->next = (((void *)0));
12008 newExp->expType = (((void *)0));
12009 PrintTypeNoConst(e->expType, typeString, 0, 1);
12010 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12011 newExp->destType = ProcessType(specs, decl);
12012 curContext = context;
12013 if(curCompound)
12014 {
12015 char name[100];
12016 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12017
12018 e->type = 23;
12019 sprintf(name, "__internalValue%03X", internalValueCounter++);
12020 if(!curCompound->__anon1.compound.declarations)
12021 curCompound->__anon1.compound.declarations = MkList();
12022 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12023 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12024 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12025 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
12026 }
12027 else
12028 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12029 {
12030 struct Type * type = e->destType;
12031
12032 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12033 CopyTypeInto(e->destType, type);
12034 e->destType->refCount = 1;
12035 e->destType->classObjectType = 0;
12036 FreeType(type);
12037 }
12038 e->__anon1.compound->__anon1.compound.context = context;
12039 PopContext(context);
12040 curContext = context->parent;
12041 }
12042 }
12043 checkedExp = e;
12044 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
12045 {
12046 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
12047 {
12048 if(checkedExp->type == 23)
12049 {
12050 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12051 }
12052 else
12053 checkedExp = (*checkedExp->__anon1.list).last;
12054 }
12055 else if(checkedExp->type == 11)
12056 checkedExp = checkedExp->__anon1.cast.exp;
12057 }
12058 {
12059 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12060
12061 *operand = *checkedExp;
12062 __ecereMethod_Expression_Clear(checkedExp);
12063 checkedExp->destType = ProcessTypeString("void *", 0);
12064 checkedExp->expType = checkedExp->destType;
12065 checkedExp->destType->refCount++;
12066 checkedExp->type = 4;
12067 checkedExp->__anon1.op.op = '&';
12068 checkedExp->__anon1.op.exp1 = (((void *)0));
12069 checkedExp->__anon1.op.exp2 = operand;
12070 }
12071 }
12072 }
12073 }
12074 }
12075 }
12076 {
12077 }
12078 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))))
12079 {
12080 if(e->expType->classObjectType && destType && destType->classObjectType)
12081 {
12082 return ;
12083 }
12084 else
12085 {
12086 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12087
12088 *thisExp = *e;
12089 thisExp->prev = (((void *)0));
12090 thisExp->next = (((void *)0));
12091 __ecereMethod_Expression_Clear(e);
12092 e->type = 5;
12093 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12094 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
12095 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
12096 {
12097 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12098 CopyTypeInto(e->expType, thisExp->expType);
12099 e->expType->byReference = 0;
12100 e->expType->refCount = 1;
12101 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))
12102 {
12103 e->expType->classObjectType = 0;
12104 }
12105 }
12106 }
12107 }
12108 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12109 {
12110 if(destType->kind == 14)
12111 {
12112 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
12113 }
12114 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))
12115 {
12116 unsigned int byReference = e->expType->byReference;
12117 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12118 struct Declarator * decl;
12119 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12120 char typeString[1024];
12121 struct Type * type;
12122 int backupClassObjectType;
12123 unsigned int backupByReference;
12124
12125 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
12126 type = e->expType;
12127 else
12128 type = destType;
12129 backupClassObjectType = type->classObjectType;
12130 backupByReference = type->byReference;
12131 type->classObjectType = 0;
12132 type->byReference = 0;
12133 typeString[0] = '\0';
12134 PrintType(type, typeString, 0, 1);
12135 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12136 type->classObjectType = backupClassObjectType;
12137 type->byReference = backupByReference;
12138 *thisExp = *e;
12139 thisExp->prev = (((void *)0));
12140 thisExp->next = (((void *)0));
12141 __ecereMethod_Expression_Clear(e);
12142 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)))
12143 {
12144 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
12145 struct Type * t;
12146
12147 destType->refCount++;
12148 e->type = 4;
12149 e->__anon1.op.op = '*';
12150 e->__anon1.op.exp1 = (((void *)0));
12151 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12152 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12153 CopyTypeInto(t, thisExp->destType);
12154 t->passAsTemplate = 0;
12155 FreeType(thisExp->destType);
12156 thisExp->destType = t;
12157 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12158 CopyTypeInto(t, destType);
12159 t->passAsTemplate = passAsTemplate;
12160 FreeType(destType);
12161 destType = t;
12162 destType->refCount = 0;
12163 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12164 CopyTypeInto(e->expType, type);
12165 if(type->passAsTemplate)
12166 {
12167 e->expType->classObjectType = 0;
12168 e->expType->passAsTemplate = 0;
12169 }
12170 e->expType->byReference = 0;
12171 e->expType->refCount = 1;
12172 }
12173 else
12174 {
12175 e->type = 11;
12176 e->__anon1.cast.typeName = MkTypeName(specs, decl);
12177 e->__anon1.cast.exp = thisExp;
12178 e->byReference = 1;
12179 e->expType = type;
12180 type->refCount++;
12181 }
12182 if(e->destType)
12183 FreeType(e->destType);
12184 e->destType = destType;
12185 destType->refCount++;
12186 }
12187 }
12188 }
12189
12190 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
12191 {
12192 struct __ecereNameSpace__ecere__com__Class * _class;
12193 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
12194
12195 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
12196 ComputeModuleClasses(subModule->data);
12197 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->classes.first; _class; _class = _class->next)
12198 ComputeClassMembers(_class, 0);
12199 }
12200
12201 int ComputeTypeSize(struct Type * type)
12202 {
12203 unsigned int size = type ? type->size : 0;
12204
12205 if(!size && type && !type->computing)
12206 {
12207 type->computing = 1;
12208 switch(type->kind)
12209 {
12210 case 24:
12211 type->alignment = size = sizeof(char);
12212 break;
12213 case 1:
12214 type->alignment = size = sizeof(char);
12215 break;
12216 case 3:
12217 type->alignment = size = sizeof(int);
12218 break;
12219 case 4:
12220 type->alignment = size = sizeof(long long);
12221 break;
12222 case 22:
12223 type->alignment = size = targetBits / 8;
12224 type->pointerAlignment = 1;
12225 break;
12226 case 23:
12227 type->alignment = size = targetBits / 8;
12228 type->pointerAlignment = 1;
12229 break;
12230 case 5:
12231 type->alignment = size = sizeof(long);
12232 break;
12233 case 2:
12234 type->alignment = size = sizeof(short);
12235 break;
12236 case 6:
12237 type->alignment = size = sizeof(float);
12238 break;
12239 case 7:
12240 type->alignment = size = sizeof(double);
12241 break;
12242 case 8:
12243 {
12244 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
12245
12246 if(_class && _class->type == 1)
12247 {
12248 ComputeClassMembers(_class, 0);
12249 type->alignment = _class->structAlignment;
12250 type->pointerAlignment = (unsigned int)_class->pointerAlignment;
12251 size = _class->structSize;
12252 if(type->alignment && size % type->alignment)
12253 size += type->alignment - (size % type->alignment);
12254 }
12255 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
12256 {
12257 if(!_class->dataType)
12258 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12259 size = type->alignment = ComputeTypeSize(_class->dataType);
12260 }
12261 else
12262 {
12263 size = type->alignment = targetBits / 8;
12264 type->pointerAlignment = 1;
12265 }
12266 break;
12267 }
12268 case 13:
12269 case 19:
12270 size = type->alignment = targetBits / 8;
12271 type->pointerAlignment = 1;
12272 break;
12273 case 12:
12274 if(type->__anon1.__anon4.arraySizeExp)
12275 {
12276 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
12277 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
12278 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)))
12279 {
12280 struct Location oldLoc = yylloc;
12281 char expression[10240];
12282
12283 expression[0] = '\0';
12284 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
12285 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
12286 if(inCompiler)
12287 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
12288 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
12289 yylloc = oldLoc;
12290 }
12291 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
12292 }
12293 else if(type->__anon1.__anon4.enumClass)
12294 {
12295 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
12296 {
12297 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
12298 }
12299 else
12300 type->__anon1.__anon4.arraySize = 0;
12301 }
12302 else
12303 {
12304 type->__anon1.__anon4.arraySize = 0;
12305 }
12306 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
12307 if(type->__anon1.type)
12308 {
12309 type->alignment = type->__anon1.type->alignment;
12310 type->pointerAlignment = type->__anon1.type->pointerAlignment;
12311 }
12312 break;
12313 case 9:
12314 {
12315 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12316 {
12317 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12318
12319 if(symbol && symbol->type)
12320 {
12321 ComputeTypeSize(symbol->type);
12322 size = symbol->type->size;
12323 }
12324 }
12325 else
12326 {
12327 struct Type * member;
12328
12329 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12330 {
12331 int __simpleStruct0, __simpleStruct1;
12332 unsigned int addSize = ComputeTypeSize(member);
12333
12334 member->offset = size;
12335 if(member->alignment && size % member->alignment)
12336 member->offset += member->alignment - (size % member->alignment);
12337 size = member->offset;
12338 if(member->pointerAlignment && type->size <= 4)
12339 type->pointerAlignment = 1;
12340 else if(!member->pointerAlignment && member->alignment >= 8)
12341 type->pointerAlignment = 0;
12342 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12343 size += addSize;
12344 }
12345 if(type->alignment && size % type->alignment)
12346 size += type->alignment - (size % type->alignment);
12347 }
12348 break;
12349 }
12350 case 10:
12351 {
12352 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12353 {
12354 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12355
12356 if(symbol && symbol->type)
12357 {
12358 ComputeTypeSize(symbol->type);
12359 size = symbol->type->size;
12360 type->alignment = symbol->type->alignment;
12361 }
12362 }
12363 else
12364 {
12365 struct Type * member;
12366
12367 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12368 {
12369 int __simpleStruct0, __simpleStruct1;
12370 unsigned int addSize = ComputeTypeSize(member);
12371
12372 member->offset = size;
12373 if(member->alignment && size % member->alignment)
12374 member->offset += member->alignment - (size % member->alignment);
12375 size = member->offset;
12376 if(member->pointerAlignment && type->size <= 4)
12377 type->pointerAlignment = 1;
12378 else if(!member->pointerAlignment && member->alignment >= 8)
12379 type->pointerAlignment = 0;
12380 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12381 size = ((size > addSize) ? size : addSize);
12382 }
12383 if(type->alignment && size % type->alignment)
12384 size += type->alignment - (size % type->alignment);
12385 }
12386 break;
12387 }
12388 case 20:
12389 {
12390 struct TemplateParameter * param = type->__anon1.templateParameter;
12391 struct Type * baseType = ProcessTemplateParameterType(param);
12392
12393 if(baseType)
12394 {
12395 size = ComputeTypeSize(baseType);
12396 type->alignment = baseType->alignment;
12397 type->pointerAlignment = baseType->pointerAlignment;
12398 }
12399 else
12400 type->alignment = size = sizeof(uint64);
12401 break;
12402 }
12403 case 15:
12404 {
12405 type->alignment = size = sizeof(enum
12406 {
12407 test
12408 });
12409 break;
12410 }
12411 case 21:
12412 {
12413 type->alignment = size = targetBits / 8;
12414 type->pointerAlignment = 1;
12415 break;
12416 }
12417 }
12418 type->size = size;
12419 type->computing = 0;
12420 }
12421 return size;
12422 }
12423
12424 struct External * _DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl)
12425 {
12426 struct External * external = (((void *)0));
12427 struct Symbol * classSym = FindClass(name);
12428 struct __ecereNameSpace__ecere__sys__OldList * curDeclarations = (((void *)0));
12429 struct Specifier * curSpec = (((void *)0));
12430
12431 if(!inCompiler || !classSym)
12432 return (((void *)0));
12433 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
12434 return (((void *)0));
12435 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
12436 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
12437 external = classSym->__anon2.__anon1.structExternal;
12438 if(external && external->__anon1.declaration)
12439 {
12440 struct Specifier * spec;
12441
12442 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12443 if(spec->type == 3 || spec->type == 4)
12444 {
12445 curSpec = spec;
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
12457 classSym->declaring++;
12458 if(strchr(classSym->string, '<'))
12459 {
12460 if(classSym->__anon1.registered->templateClass)
12461 {
12462 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
12463 classSym->declaring--;
12464 }
12465 return external;
12466 }
12467 structName[0] = 0;
12468 FullClassNameCat(structName, name, 0);
12469 classSym->declaredStructSym = 1;
12470 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
12471 {
12472 unsigned int add = 0;
12473
12474 if(!external)
12475 {
12476 external = MkExternalDeclaration((((void *)0)));
12477 classSym->__anon2.__anon1.structExternal = external;
12478 external->symbol = classSym;
12479 add = 1;
12480 }
12481 if(!skipNoHead)
12482 {
12483 declarations = MkList();
12484 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
12485 }
12486 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
12487 {
12488 FreeList(declarations, (void *)(FreeClassDef));
12489 declarations = (((void *)0));
12490 }
12491 if(classSym->__anon1.registered->type != 5 && !declarations)
12492 {
12493 FreeExternal(external);
12494 external = (((void *)0));
12495 classSym->__anon2.__anon1.structExternal = (((void *)0));
12496 }
12497 else
12498 {
12499 if(curSpec)
12500 curSpec->__anon1.__anon2.definitions = declarations;
12501 else
12502 {
12503 char className[1024];
12504
12505 strcpy(className, "__ecereClass_");
12506 FullClassNameCat(className, classSym->string, 1);
12507 specifiers = MkList();
12508 declarators = MkList();
12509 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
12510 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12511 }
12512 if(add)
12513 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12514 }
12515 }
12516 classSym->declaring--;
12517 }
12518 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
12519 {
12520 classSym->declaredStructSym = 1;
12521 if(classSym->__anon1.registered)
12522 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
12523 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
12524 {
12525 struct Specifier * spec;
12526
12527 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
12528 {
12529 if(spec->__anon1.__anon2.definitions)
12530 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
12531 }
12532 }
12533 }
12534 if(inCompiler && neededBy && (external || !classSym->imported))
12535 {
12536 if(!external)
12537 {
12538 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
12539 external->symbol = classSym;
12540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12541 }
12542 if(fwdDecl)
12543 {
12544 struct External * e = external->fwdDecl ? external->fwdDecl : external;
12545
12546 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
12547 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
12548 }
12549 else
12550 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
12551 }
12552 return external;
12553 }
12554
12555 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)
12556 {
12557 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
12558 unsigned int found = 0;
12559 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
12560 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12561 unsigned int freeType = 0;
12562
12563 yylloc = member->loc;
12564 if(!ident)
12565 {
12566 if(curMember)
12567 {
12568 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
12569 if(*curMember)
12570 {
12571 found = 1;
12572 dataMember = *curMember;
12573 }
12574 }
12575 }
12576 else
12577 {
12578 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
12579 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
12580 int _subMemberStackPos = 0;
12581
12582 if(!thisMember)
12583 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
12584 if(thisMember)
12585 {
12586 dataMember = thisMember;
12587 if(curMember && thisMember->memberAccess == 1)
12588 {
12589 *curMember = thisMember;
12590 *curClass = thisMember->_class;
12591 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
12592 *subMemberStackPos = _subMemberStackPos;
12593 }
12594 found = 1;
12595 }
12596 else
12597 {
12598 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
12599 if(method && method->type == 1)
12600 found = 1;
12601 else
12602 method = (((void *)0));
12603 }
12604 }
12605 if(found)
12606 {
12607 struct Type * type = (((void *)0));
12608
12609 if(dataMember)
12610 {
12611 if(!dataMember->dataType && dataMember->dataTypeString)
12612 {
12613 struct Context * context = SetupTemplatesContext(_class);
12614
12615 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12616 FinishTemplatesContext(context);
12617 }
12618 type = dataMember->dataType;
12619 }
12620 else if(method)
12621 {
12622 if(!method->dataType)
12623 ProcessMethodType(method);
12624 type = method->dataType;
12625 }
12626 if(ident && ident->next)
12627 {
12628 for(ident = ident->next; ident && type; ident = ident->next)
12629 {
12630 if(type->kind == 8)
12631 {
12632 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
12633 if(!dataMember)
12634 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
12635 if(dataMember)
12636 type = dataMember->dataType;
12637 }
12638 else if(type->kind == 9 || type->kind == 10)
12639 {
12640 struct Type * memberType;
12641
12642 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
12643 {
12644 if(!strcmp(memberType->name, ident->string))
12645 {
12646 type = memberType;
12647 break;
12648 }
12649 }
12650 }
12651 }
12652 }
12653 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
12654 {
12655 int id = 0;
12656 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
12657 struct __ecereNameSpace__ecere__com__Class * sClass;
12658
12659 for(sClass = _class; sClass; sClass = sClass->base)
12660 {
12661 id = 0;
12662 if(sClass->templateClass)
12663 sClass = sClass->templateClass;
12664 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
12665 {
12666 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
12667 {
12668 for(sClass = sClass->base; sClass; sClass = sClass->base)
12669 {
12670 if(sClass->templateClass)
12671 sClass = sClass->templateClass;
12672 id += sClass->templateParams.count;
12673 }
12674 break;
12675 }
12676 id++;
12677 }
12678 if(curParam)
12679 break;
12680 }
12681 if(curParam)
12682 {
12683 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
12684
12685 if(arg.__anon1.__anon1.dataTypeString)
12686 {
12687 unsigned int constant = type->constant;
12688
12689 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
12690 if(type->kind == 8 && constant)
12691 type->constant = 1;
12692 else if(type->kind == 13)
12693 {
12694 struct Type * t = type->__anon1.type;
12695
12696 while(t->kind == 13)
12697 t = t->__anon1.type;
12698 if(constant)
12699 t->constant = constant;
12700 }
12701 freeType = 1;
12702 if(type && _class->templateClass)
12703 type->passAsTemplate = 1;
12704 if(type)
12705 {
12706 }
12707 }
12708 }
12709 }
12710 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
12711 {
12712 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
12713 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
12714 int paramCount = 0;
12715 int lastParam = -1;
12716 char templateString[1024];
12717 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
12718
12719 sprintf(templateString, "%s<", expClass->templateClass->fullName);
12720 for(cClass = expClass; cClass; cClass = cClass->base)
12721 {
12722 int p = 0;
12723
12724 if(cClass->templateClass)
12725 cClass = cClass->templateClass;
12726 for(param = cClass->templateParams.first; param; param = param->next)
12727 {
12728 int id = p;
12729 struct __ecereNameSpace__ecere__com__Class * sClass;
12730 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
12731
12732 for(sClass = cClass->base; sClass; sClass = sClass->base)
12733 {
12734 if(sClass->templateClass)
12735 sClass = sClass->templateClass;
12736 id += sClass->templateParams.count;
12737 }
12738 arg = expClass->templateArgs[id];
12739 for(sClass = _class; sClass; sClass = sClass->base)
12740 {
12741 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
12742 int p = 0;
12743 struct __ecereNameSpace__ecere__com__Class * nextClass;
12744
12745 if(sClass->templateClass)
12746 sClass = sClass->templateClass;
12747 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
12748 {
12749 if(nextClass->templateClass)
12750 nextClass = nextClass->templateClass;
12751 p += nextClass->templateParams.count;
12752 }
12753 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
12754 {
12755 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
12756 {
12757 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12758 {
12759 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
12760 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
12761 break;
12762 }
12763 }
12764 }
12765 }
12766 {
12767 char argument[256];
12768
12769 argument[0] = '\0';
12770 switch(param->type)
12771 {
12772 case 2:
12773 {
12774 char expString[1024];
12775 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12776 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
12777 struct Expression * exp;
12778 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
12779
12780 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
12781 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
12782 ProcessExpressionType(exp);
12783 ComputeExpression(exp);
12784 expString[0] = '\0';
12785 PrintExpression(exp, expString);
12786 strcat(argument, expString);
12787 FreeExpression(exp);
12788 break;
12789 }
12790 case 1:
12791 {
12792 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
12793 break;
12794 }
12795 case 0:
12796 {
12797 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12798 strcat(argument, arg.__anon1.__anon1.dataTypeString);
12799 break;
12800 }
12801 }
12802 if(argument[0])
12803 {
12804 if(paramCount)
12805 strcat(templateString, ", ");
12806 if(lastParam != p - 1)
12807 {
12808 strcat(templateString, param->name);
12809 strcat(templateString, " = ");
12810 }
12811 strcat(templateString, argument);
12812 paramCount++;
12813 lastParam = p;
12814 }
12815 p++;
12816 }
12817 }
12818 }
12819 {
12820 int len = strlen(templateString);
12821
12822 if(templateString[len - 1] == '<')
12823 len--;
12824 else
12825 {
12826 if(templateString[len - 1] == '>')
12827 templateString[len++] = ' ';
12828 templateString[len++] = '>';
12829 }
12830 templateString[len++] = '\0';
12831 }
12832 {
12833 struct Context * context = SetupTemplatesContext(_class);
12834
12835 if(freeType)
12836 FreeType(type);
12837 type = ProcessTypeString(templateString, 0);
12838 freeType = 1;
12839 FinishTemplatesContext(context);
12840 }
12841 }
12842 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
12843 {
12844 ProcessExpressionType(member->initializer->__anon1.exp);
12845 if(!member->initializer->__anon1.exp->expType)
12846 {
12847 if(inCompiler)
12848 {
12849 char expString[10240];
12850
12851 expString[0] = '\0';
12852 PrintExpression(member->initializer->__anon1.exp, expString);
12853 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12854 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
12855 }
12856 }
12857 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
12858 {
12859 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
12860 }
12861 }
12862 else if(member->initializer)
12863 {
12864 ProcessInitializer(member->initializer, type);
12865 }
12866 if(freeType)
12867 FreeType(type);
12868 }
12869 else
12870 {
12871 if(_class && _class->type == 3)
12872 {
12873 if(member->initializer)
12874 {
12875 struct Type * type = MkClassType(_class->fullName);
12876
12877 ProcessInitializer(member->initializer, type);
12878 FreeType(type);
12879 }
12880 }
12881 else
12882 {
12883 if(member->initializer)
12884 {
12885 ProcessInitializer(member->initializer, (((void *)0)));
12886 }
12887 if(ident)
12888 {
12889 if(method)
12890 {
12891 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12892 }
12893 else if(_class)
12894 {
12895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12896 if(inCompiler)
12897 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
12898 }
12899 }
12900 else if(_class)
12901 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
12902 }
12903 }
12904 }
12905
12906 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
12907 {
12908 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
12909
12910 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)))
12911 {
12912 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
12913
12914 if(_class->type == 4)
12915 {
12916 struct __ecereNameSpace__ecere__sys__OldList converts =
12917 {
12918 0, 0, 0, 0, 0
12919 };
12920 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12921
12922 type->kind = 8;
12923 if(!_class->symbol)
12924 _class->symbol = FindClass(_class->fullName);
12925 type->__anon1._class = _class->symbol;
12926 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))
12927 {
12928 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12929 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12930
12931 if(enumClass)
12932 {
12933 struct __ecereNameSpace__ecere__com__Class * baseClass;
12934
12935 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12936 {
12937 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12938
12939 for(value = e->values.first; value; value = value->next)
12940 {
12941 if(!strcmp(value->name, string))
12942 break;
12943 }
12944 if(value)
12945 {
12946 FreeType(sourceExp->expType);
12947 sourceExp->isConstant = 1;
12948 sourceExp->expType = MkClassType(baseClass->fullName);
12949 if(inCompiler || inPreCompiler || inDebugger)
12950 {
12951 char constant[256];
12952
12953 FreeExpContents(sourceExp);
12954 sourceExp->type = 2;
12955 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
12956 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
12957 else
12958 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
12959 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12960 }
12961 while(converts.first)
12962 {
12963 struct Conversion * convert = converts.first;
12964
12965 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
12966 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
12967 }
12968 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12969 return 1;
12970 }
12971 }
12972 }
12973 }
12974 if(converts.first)
12975 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12976 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12977 }
12978 }
12979 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)))
12980 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
12981 return 1;
12982 return 0;
12983 }
12984
12985 void ComputeExpression(struct Expression * exp)
12986 {
12987 switch(exp->type)
12988 {
12989 case 0:
12990 {
12991 struct Identifier * id = exp->__anon1.__anon1.identifier;
12992
12993 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
12994 {
12995 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
12996
12997 if(c && c->type == 4)
12998 {
12999 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13000
13001 if(enumClass)
13002 {
13003 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
13004 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
13005
13006 for(value = e->values.first; value; value = value->next)
13007 {
13008 if(!strcmp(value->name, id->string))
13009 break;
13010 }
13011 if(value)
13012 {
13013 const char * dts = c->dataTypeString;
13014
13015 FreeExpContents(exp);
13016 exp->type = 2;
13017 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
13018 }
13019 }
13020 }
13021 }
13022 break;
13023 }
13024 case 1:
13025 {
13026 ComputeInstantiation(exp);
13027 break;
13028 }
13029 case 4:
13030 {
13031 struct Expression * exp1, * exp2 = (((void *)0));
13032 struct Operand op1 =
13033 {
13034 0, 0, 0,
13035 .__anon1 = {
13036 .c = 0
13037 },
13038 {
13039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13040 }
13041 };
13042 struct Operand op2 =
13043 {
13044 0, 0, 0,
13045 .__anon1 = {
13046 .c = 0
13047 },
13048 {
13049 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13050 }
13051 };
13052
13053 if(exp->__anon1.op.exp2)
13054 {
13055 struct Expression * e = exp->__anon1.op.exp2;
13056
13057 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13058 {
13059 if(e->type == 5 || e->type == 32 || e->type == 23)
13060 {
13061 if(e->type == 23)
13062 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13063 else
13064 e = (*e->__anon1.list).last;
13065 }
13066 }
13067 if(exp->__anon1.op.op == 261 && e && e->expType)
13068 {
13069 if(e->type == 3 && e->__anon1.__anon2.string)
13070 {
13071 char * string = e->__anon1.__anon2.string;
13072 int len = strlen(string);
13073 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13074
13075 len = UnescapeString(tmp, string + 1, len - 2);
13076 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13077 FreeExpContents(exp);
13078 exp->type = 2;
13079 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13080 }
13081 else
13082 {
13083 struct Type * type = e->expType;
13084
13085 type->refCount++;
13086 FreeExpContents(exp);
13087 exp->type = 2;
13088 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13089 FreeType(type);
13090 }
13091 break;
13092 }
13093 else
13094 ComputeExpression(exp->__anon1.op.exp2);
13095 }
13096 if(exp->__anon1.op.exp1)
13097 {
13098 ComputeExpression(exp->__anon1.op.exp1);
13099 exp1 = exp->__anon1.op.exp1;
13100 exp2 = exp->__anon1.op.exp2;
13101 op1 = GetOperand(exp1);
13102 if(op1.type)
13103 op1.type->refCount++;
13104 if(exp2)
13105 {
13106 op2 = GetOperand(exp2);
13107 if(op2.type)
13108 op2.type->refCount++;
13109 }
13110 }
13111 else
13112 {
13113 exp1 = exp->__anon1.op.exp2;
13114 op1 = GetOperand(exp1);
13115 if(op1.type)
13116 op1.type->refCount++;
13117 }
13118 CallOperator(exp, exp1, exp2, &op1, &op2);
13119 if(op1.type)
13120 FreeType(op1.type);
13121 if(op2.type)
13122 FreeType(op2.type);
13123 break;
13124 }
13125 case 5:
13126 case 32:
13127 {
13128 struct Expression * e, * n;
13129
13130 for(e = (*exp->__anon1.list).first; e; e = n)
13131 {
13132 n = e->next;
13133 if(!n)
13134 {
13135 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13136 struct Expression * prev = exp->prev;
13137 struct Expression * next = exp->next;
13138
13139 ComputeExpression(e);
13140 FreeType(exp->expType);
13141 FreeType(exp->destType);
13142 *exp = *e;
13143 exp->prev = prev;
13144 exp->next = next;
13145 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13146 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13147 }
13148 else
13149 {
13150 FreeExpression(e);
13151 }
13152 }
13153 break;
13154 }
13155 case 8:
13156 {
13157 struct Expression * memberExp = exp->__anon1.member.exp;
13158 struct Identifier * memberID = exp->__anon1.member.member;
13159 struct Type * type;
13160
13161 ComputeExpression(exp->__anon1.member.exp);
13162 type = exp->__anon1.member.exp->expType;
13163 if(type)
13164 {
13165 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)));
13166 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13167 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13168 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
13169
13170 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
13171 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13172 if(!_class)
13173 {
13174 char string[256];
13175 struct Symbol * classSym;
13176
13177 string[0] = '\0';
13178 PrintTypeNoConst(type, string, 0, 1);
13179 classSym = FindClass(string);
13180 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13181 }
13182 if(exp->__anon1.member.member)
13183 {
13184 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
13185 if(!prop)
13186 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
13187 }
13188 if(!prop && !member && _class && exp->__anon1.member.member)
13189 {
13190 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
13191
13192 convertTo = _class;
13193 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13194 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
13195 }
13196 if(prop)
13197 {
13198 if(prop->compiled)
13199 {
13200 struct Type * type = prop->dataType;
13201
13202 if(_class->type == 3)
13203 {
13204 if(type->kind == 8)
13205 {
13206 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13207
13208 if(_class->type == 3)
13209 {
13210 if(!_class->dataType)
13211 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13212 type = _class->dataType;
13213 }
13214 }
13215 switch(type->kind)
13216 {
13217 case 6:
13218 {
13219 float value;
13220 float (* Get)(float) = (void *)prop->Get;
13221
13222 GetFloat(exp->__anon1.member.exp, &value);
13223 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
13224 exp->type = 2;
13225 break;
13226 }
13227 case 7:
13228 {
13229 double value;
13230 double (* Get)(double);
13231
13232 GetDouble(exp->__anon1.member.exp, &value);
13233 if(convertTo)
13234 Get = (void *)prop->Set;
13235 else
13236 Get = (void *)prop->Get;
13237 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
13238 exp->type = 2;
13239 break;
13240 }
13241 }
13242 }
13243 else
13244 {
13245 if(convertTo)
13246 {
13247 struct Expression * value = exp->__anon1.member.exp;
13248 struct Type * type;
13249
13250 if(!prop->dataType)
13251 ProcessPropertyType(prop);
13252 type = prop->dataType;
13253 if(!type)
13254 {
13255 }
13256 else if(_class->type == 1)
13257 {
13258 switch(type->kind)
13259 {
13260 case 8:
13261 {
13262 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13263
13264 if(propertyClass->type == 1 && value->type == 1)
13265 {
13266 void (* Set)(void *, void *) = (void *)prop->Set;
13267
13268 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13269 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13270 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13271 exp->__anon1.instance->loc = exp->loc;
13272 exp->type = 1;
13273 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
13274 PopulateInstance(exp->__anon1.instance);
13275 }
13276 break;
13277 }
13278 case 3:
13279 {
13280 int intValue;
13281 void (* Set)(void *, int) = (void *)prop->Set;
13282
13283 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13284 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13285 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13286 exp->__anon1.instance->loc = exp->loc;
13287 exp->type = 1;
13288 GetInt(value, &intValue);
13289 Set(exp->__anon1.instance->data, intValue);
13290 PopulateInstance(exp->__anon1.instance);
13291 break;
13292 }
13293 case 4:
13294 {
13295 long long intValue;
13296 void (* Set)(void *, long long) = (void *)prop->Set;
13297
13298 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13299 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13300 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13301 exp->__anon1.instance->loc = exp->loc;
13302 exp->type = 1;
13303 GetInt64(value, &intValue);
13304 Set(exp->__anon1.instance->data, intValue);
13305 PopulateInstance(exp->__anon1.instance);
13306 break;
13307 }
13308 case 22:
13309 {
13310 intptr_t intValue;
13311 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13312
13313 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13314 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13315 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13316 exp->__anon1.instance->loc = exp->loc;
13317 exp->type = 1;
13318 GetIntPtr(value, &intValue);
13319 Set(exp->__anon1.instance->data, intValue);
13320 PopulateInstance(exp->__anon1.instance);
13321 break;
13322 }
13323 case 23:
13324 {
13325 ssize_t intValue;
13326 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13327
13328 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13329 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13330 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13331 exp->__anon1.instance->loc = exp->loc;
13332 exp->type = 1;
13333 GetIntSize(value, &intValue);
13334 Set(exp->__anon1.instance->data, intValue);
13335 PopulateInstance(exp->__anon1.instance);
13336 break;
13337 }
13338 case 6:
13339 {
13340 float floatValue;
13341 void (* Set)(void *, float) = (void *)prop->Set;
13342
13343 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13344 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13345 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13346 exp->__anon1.instance->loc = exp->loc;
13347 exp->type = 1;
13348 GetFloat(value, &floatValue);
13349 Set(exp->__anon1.instance->data, floatValue);
13350 PopulateInstance(exp->__anon1.instance);
13351 break;
13352 }
13353 case 7:
13354 {
13355 double doubleValue;
13356 void (* Set)(void *, double) = (void *)prop->Set;
13357
13358 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13359 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13360 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13361 exp->__anon1.instance->loc = exp->loc;
13362 exp->type = 1;
13363 GetDouble(value, &doubleValue);
13364 Set(exp->__anon1.instance->data, doubleValue);
13365 PopulateInstance(exp->__anon1.instance);
13366 break;
13367 }
13368 }
13369 }
13370 else if(_class->type == 2)
13371 {
13372 switch(type->kind)
13373 {
13374 case 8:
13375 {
13376 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13377
13378 if(propertyClass->type == 1 && value->__anon1.instance->data)
13379 {
13380 unsigned int (* Set)(void *) = (void *)prop->Set;
13381 unsigned int bits = Set(value->__anon1.instance->data);
13382
13383 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13384 exp->type = 2;
13385 break;
13386 }
13387 else if(_class->type == 2)
13388 {
13389 unsigned int value;
13390 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
13391 unsigned int bits;
13392
13393 GetUInt(exp->__anon1.member.exp, &value);
13394 bits = Set(value);
13395 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13396 exp->type = 2;
13397 }
13398 }
13399 }
13400 }
13401 }
13402 else
13403 {
13404 if(_class->type == 2)
13405 {
13406 unsigned int value;
13407
13408 GetUInt(exp->__anon1.member.exp, &value);
13409 switch(type->kind)
13410 {
13411 case 8:
13412 {
13413 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13414
13415 if(_class->type == 1)
13416 {
13417 void (* Get)(unsigned int, void *) = (void *)prop->Get;
13418
13419 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13420 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13421 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13422 exp->__anon1.instance->loc = exp->loc;
13423 exp->type = 1;
13424 Get(value, exp->__anon1.instance->data);
13425 PopulateInstance(exp->__anon1.instance);
13426 }
13427 else if(_class->type == 2)
13428 {
13429 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
13430 uint64 bits = Get(value);
13431
13432 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
13433 exp->type = 2;
13434 }
13435 break;
13436 }
13437 }
13438 }
13439 else if(_class->type == 1)
13440 {
13441 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
13442
13443 switch(type->kind)
13444 {
13445 case 8:
13446 {
13447 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13448
13449 if(_class->type == 1 && value)
13450 {
13451 void (* Get)(void *, void *) = (void *)prop->Get;
13452
13453 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13454 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13455 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13456 exp->__anon1.instance->loc = exp->loc;
13457 exp->type = 1;
13458 Get(value, exp->__anon1.instance->data);
13459 PopulateInstance(exp->__anon1.instance);
13460 }
13461 break;
13462 }
13463 }
13464 }
13465 }
13466 }
13467 }
13468 else
13469 {
13470 exp->isConstant = 0;
13471 }
13472 }
13473 else if(member)
13474 {
13475 }
13476 }
13477 if(exp->type != 8)
13478 {
13479 FreeExpression(memberExp);
13480 FreeIdentifier(memberID);
13481 }
13482 break;
13483 }
13484 case 10:
13485 {
13486 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
13487
13488 FreeExpContents(exp);
13489 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13490 exp->type = 2;
13491 FreeType(type);
13492 break;
13493 }
13494 case 15:
13495 {
13496 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
13497
13498 if(classSym && classSym->__anon1.registered)
13499 {
13500 if(classSym->__anon1.registered->fixed)
13501 {
13502 FreeSpecifier(exp->__anon1._class);
13503 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
13504 exp->type = 2;
13505 }
13506 else
13507 {
13508 char className[1024];
13509
13510 strcpy(className, "__ecereClass_");
13511 FullClassNameCat(className, classSym->string, 1);
13512 DeclareClass(curExternal, classSym, className);
13513 FreeExpContents(exp);
13514 exp->type = 9;
13515 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
13516 exp->__anon1.member.member = MkIdentifier("structSize");
13517 }
13518 }
13519 break;
13520 }
13521 case 11:
13522 {
13523 struct Type * type;
13524 struct Expression * e = exp;
13525
13526 if(exp->type == 11)
13527 {
13528 if(exp->__anon1.cast.exp)
13529 ComputeExpression(exp->__anon1.cast.exp);
13530 e = exp->__anon1.cast.exp;
13531 }
13532 if(e && exp->expType)
13533 {
13534 type = exp->expType;
13535 if(type->kind == 8)
13536 {
13537 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13538
13539 if(_class && (_class->type == 3 || _class->type == 2))
13540 {
13541 if(!_class->dataType)
13542 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13543 type = _class->dataType;
13544 }
13545 }
13546 switch(type->kind)
13547 {
13548 case 24:
13549 case 1:
13550 if(type->isSigned)
13551 {
13552 char value = 0;
13553
13554 if(GetChar(e, &value))
13555 {
13556 FreeExpContents(exp);
13557 exp->__anon1.__anon1.constant = PrintChar(value);
13558 exp->type = 2;
13559 }
13560 }
13561 else
13562 {
13563 unsigned char value = 0;
13564
13565 if(GetUChar(e, &value))
13566 {
13567 FreeExpContents(exp);
13568 exp->__anon1.__anon1.constant = PrintUChar(value);
13569 exp->type = 2;
13570 }
13571 }
13572 break;
13573 case 2:
13574 if(type->isSigned)
13575 {
13576 short value = 0;
13577
13578 if(GetShort(e, &value))
13579 {
13580 FreeExpContents(exp);
13581 exp->__anon1.__anon1.constant = PrintShort(value);
13582 exp->type = 2;
13583 }
13584 }
13585 else
13586 {
13587 unsigned short value = 0;
13588
13589 if(GetUShort(e, &value))
13590 {
13591 FreeExpContents(exp);
13592 exp->__anon1.__anon1.constant = PrintUShort(value);
13593 exp->type = 2;
13594 }
13595 }
13596 break;
13597 case 3:
13598 if(type->isSigned)
13599 {
13600 int value = 0;
13601
13602 if(GetInt(e, &value))
13603 {
13604 FreeExpContents(exp);
13605 exp->__anon1.__anon1.constant = PrintInt(value);
13606 exp->type = 2;
13607 }
13608 }
13609 else
13610 {
13611 unsigned int value = 0;
13612
13613 if(GetUInt(e, &value))
13614 {
13615 FreeExpContents(exp);
13616 exp->__anon1.__anon1.constant = PrintUInt(value);
13617 exp->type = 2;
13618 }
13619 }
13620 break;
13621 case 4:
13622 if(type->isSigned)
13623 {
13624 long long value = 0;
13625
13626 if(GetInt64(e, &value))
13627 {
13628 FreeExpContents(exp);
13629 exp->__anon1.__anon1.constant = PrintInt64(value);
13630 exp->type = 2;
13631 }
13632 }
13633 else
13634 {
13635 uint64 value = 0;
13636
13637 if(GetUInt64(e, &value))
13638 {
13639 FreeExpContents(exp);
13640 exp->__anon1.__anon1.constant = PrintUInt64(value);
13641 exp->type = 2;
13642 }
13643 }
13644 break;
13645 case 22:
13646 if(type->isSigned)
13647 {
13648 intptr_t value = 0;
13649
13650 if(GetIntPtr(e, &value))
13651 {
13652 FreeExpContents(exp);
13653 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13654 exp->type = 2;
13655 }
13656 }
13657 else
13658 {
13659 uintptr_t value = 0;
13660
13661 if(GetUIntPtr(e, &value))
13662 {
13663 FreeExpContents(exp);
13664 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13665 exp->type = 2;
13666 }
13667 }
13668 break;
13669 case 23:
13670 if(type->isSigned)
13671 {
13672 ssize_t value = 0;
13673
13674 if(GetIntSize(e, &value))
13675 {
13676 FreeExpContents(exp);
13677 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13678 exp->type = 2;
13679 }
13680 }
13681 else
13682 {
13683 size_t value = 0;
13684
13685 if(GetUIntSize(e, &value))
13686 {
13687 FreeExpContents(exp);
13688 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13689 exp->type = 2;
13690 }
13691 }
13692 break;
13693 case 6:
13694 {
13695 float value = 0;
13696
13697 if(GetFloat(e, &value))
13698 {
13699 FreeExpContents(exp);
13700 exp->__anon1.__anon1.constant = PrintFloat(value);
13701 exp->type = 2;
13702 }
13703 break;
13704 }
13705 case 7:
13706 {
13707 double value = 0;
13708
13709 if(GetDouble(e, &value))
13710 {
13711 FreeExpContents(exp);
13712 exp->__anon1.__anon1.constant = PrintDouble(value);
13713 exp->type = 2;
13714 }
13715 break;
13716 }
13717 }
13718 }
13719 break;
13720 }
13721 case 12:
13722 {
13723 struct Operand op1 =
13724 {
13725 0, 0, 0,
13726 .__anon1 = {
13727 .c = 0
13728 },
13729 {
13730 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13731 }
13732 };
13733 struct Operand op2 =
13734 {
13735 0, 0, 0,
13736 .__anon1 = {
13737 .c = 0
13738 },
13739 {
13740 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13741 }
13742 };
13743 struct Operand op3 =
13744 {
13745 0, 0, 0,
13746 .__anon1 = {
13747 .c = 0
13748 },
13749 {
13750 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13751 }
13752 };
13753
13754 if(exp->__anon1.cond.exp)
13755 ComputeExpression((*exp->__anon1.cond.exp).last);
13756 if(exp->__anon1.cond.elseExp)
13757 ComputeExpression(exp->__anon1.cond.elseExp);
13758 if(exp->__anon1.cond.cond)
13759 ComputeExpression(exp->__anon1.cond.cond);
13760 op1 = GetOperand(exp->__anon1.cond.cond);
13761 if(op1.type)
13762 op1.type->refCount++;
13763 op2 = GetOperand((*exp->__anon1.cond.exp).last);
13764 if(op2.type)
13765 op2.type->refCount++;
13766 op3 = GetOperand(exp->__anon1.cond.elseExp);
13767 if(op3.type)
13768 op3.type->refCount++;
13769 if(op1.ops.Cond)
13770 {
13771 FreeExpContents(exp);
13772 op1.ops.Cond(exp, &op1, &op2, &op3);
13773 }
13774 if(op1.type)
13775 FreeType(op1.type);
13776 if(op2.type)
13777 FreeType(op2.type);
13778 if(op3.type)
13779 FreeType(op3.type);
13780 break;
13781 }
13782 }
13783 }
13784
13785 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
13786 {
13787 struct __ecereNameSpace__ecere__com__Instance * module;
13788
13789 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))
13790 return 1;
13791 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))
13792 return 1;
13793 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))
13794 return 1;
13795 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)
13796 {
13797 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
13798 return 1;
13799 }
13800 return 0;
13801 }
13802
13803 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
13804 {
13805 struct Type * source;
13806 struct Type * realDest = dest;
13807 struct Type * backupSourceExpType = (((void *)0));
13808 struct Expression * nbExp = GetNonBracketsExp(sourceExp);
13809 struct Expression * computedExp = nbExp;
13810
13811 dest->refCount++;
13812 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)
13813 {
13814 computedExp = CopyExpression(nbExp);
13815 ComputeExpression(computedExp);
13816 }
13817 source = sourceExp->expType;
13818 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
13819 {
13820 if(computedExp != nbExp)
13821 {
13822 FreeExpression(computedExp);
13823 computedExp = nbExp;
13824 }
13825 FreeType(dest);
13826 return 1;
13827 }
13828 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
13829 {
13830 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
13831 {
13832 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
13833
13834 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
13835 ;
13836 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
13837 ;
13838 if(sourceBase == destBase)
13839 {
13840 if(computedExp != nbExp)
13841 {
13842 FreeExpression(computedExp);
13843 computedExp = nbExp;
13844 }
13845 FreeType(dest);
13846 return 1;
13847 }
13848 }
13849 }
13850 if(source)
13851 {
13852 struct __ecereNameSpace__ecere__sys__OldList * specs;
13853 unsigned int flag = 0;
13854 long long value = (((int)0x7fffffff));
13855
13856 source->refCount++;
13857 if(computedExp->type == 2)
13858 {
13859 if(source->isSigned)
13860 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13861 else
13862 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13863 }
13864 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
13865 {
13866 if(source->isSigned)
13867 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13868 else
13869 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13870 }
13871 if(computedExp != nbExp)
13872 {
13873 FreeExpression(computedExp);
13874 computedExp = nbExp;
13875 }
13876 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
13877 {
13878 FreeType(source);
13879 source = __extension__ ({
13880 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13881
13882 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
13883 });
13884 }
13885 if(dest->kind == 8)
13886 {
13887 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13888
13889 if(_class && _class->type == 3)
13890 {
13891 if(source->kind != 8)
13892 {
13893 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13894 struct Type * tempDest, * tempSource;
13895
13896 for(; _class->base->type != 1000; _class = _class->base)
13897 ;
13898 tempSource = dest;
13899 tempDest = tempType;
13900 tempType->kind = 8;
13901 if(!_class->symbol)
13902 _class->symbol = FindClass(_class->fullName);
13903 tempType->__anon1._class = _class->symbol;
13904 tempType->truth = dest->truth;
13905 if(tempType->__anon1._class)
13906 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13907 backupSourceExpType = sourceExp->expType;
13908 if(dest->passAsTemplate)
13909 {
13910 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13911 CopyTypeInto(sourceExp->expType, dest);
13912 sourceExp->expType->passAsTemplate = 0;
13913 }
13914 else
13915 {
13916 sourceExp->expType = dest;
13917 dest->refCount++;
13918 }
13919 flag = 1;
13920 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13921 }
13922 }
13923 if(_class && _class->type == 2 && source->kind != 8)
13924 {
13925 if(!dest->__anon1._class->__anon1.registered->dataType)
13926 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
13927 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13928 {
13929 FreeType(source);
13930 FreeType(sourceExp->expType);
13931 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
13932 source->refCount++;
13933 }
13934 }
13935 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
13936 {
13937 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13938 struct Declarator * decl;
13939 char string[1024];
13940
13941 ReadString(string, sourceExp->__anon1.__anon2.string);
13942 decl = SpecDeclFromString(string, specs, (((void *)0)));
13943 FreeExpContents(sourceExp);
13944 FreeType(sourceExp->expType);
13945 sourceExp->type = 24;
13946 sourceExp->__anon1._classExp.specifiers = specs;
13947 sourceExp->__anon1._classExp.decl = decl;
13948 sourceExp->expType = dest;
13949 dest->refCount++;
13950 FreeType(source);
13951 FreeType(dest);
13952 if(backupSourceExpType)
13953 FreeType(backupSourceExpType);
13954 return 1;
13955 }
13956 }
13957 else if(source->kind == 8)
13958 {
13959 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
13960
13961 if(_class && (_class->type == 3 || _class->type == 2))
13962 {
13963 if(dest->kind != 8)
13964 {
13965 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13966 struct Type * tempDest, * tempSource;
13967
13968 if(!source->__anon1._class->__anon1.registered->dataType)
13969 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
13970 for(; _class->base->type != 1000; _class = _class->base)
13971 ;
13972 tempDest = source;
13973 tempSource = tempType;
13974 tempType->kind = 8;
13975 tempType->__anon1._class = FindClass(_class->fullName);
13976 tempType->truth = source->truth;
13977 tempType->classObjectType = source->classObjectType;
13978 if(tempType->__anon1._class)
13979 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13980 if(conversions && conversions->last)
13981 {
13982 ((struct Conversion *)conversions->last)->resultType = dest;
13983 dest->refCount++;
13984 }
13985 FreeType(sourceExp->expType);
13986 sourceExp->expType = MkClassType(_class->fullName);
13987 sourceExp->expType->truth = source->truth;
13988 sourceExp->expType->classObjectType = source->classObjectType;
13989 if(!sourceExp->destType)
13990 {
13991 FreeType(sourceExp->destType);
13992 sourceExp->destType = sourceExp->expType;
13993 if(sourceExp->expType)
13994 sourceExp->expType->refCount++;
13995 }
13996 if(!_class->dataType)
13997 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13998 FreeType(dest);
13999 dest = MkClassType(source->__anon1._class->string);
14000 dest->truth = source->truth;
14001 dest->classObjectType = source->classObjectType;
14002 FreeType(source);
14003 source = _class->dataType;
14004 source->refCount++;
14005 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
14006 }
14007 }
14008 }
14009 if(!flag)
14010 {
14011 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
14012 {
14013 FreeType(source);
14014 FreeType(dest);
14015 return 1;
14016 }
14017 }
14018 if(dest->kind == 8)
14019 {
14020 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
14021 unsigned int fittingValue = 0;
14022
14023 if(_class && _class->type == 4)
14024 {
14025 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14026 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14027
14028 if(c && value >= 0 && value <= c->largest)
14029 fittingValue = 1;
14030 }
14031 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
14032 {
14033 if(_class->type == 0 || _class->type == 5)
14034 {
14035 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14036
14037 *newExp = *sourceExp;
14038 if(sourceExp->destType)
14039 sourceExp->destType->refCount++;
14040 if(sourceExp->expType)
14041 sourceExp->expType->refCount++;
14042 sourceExp->type = 11;
14043 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
14044 sourceExp->__anon1.cast.exp = newExp;
14045 FreeType(sourceExp->expType);
14046 sourceExp->expType = (((void *)0));
14047 ProcessExpressionType(sourceExp);
14048 if(!inCompiler)
14049 {
14050 FreeType(sourceExp->expType);
14051 sourceExp->expType = dest;
14052 }
14053 FreeType(source);
14054 if(inCompiler)
14055 FreeType(dest);
14056 if(backupSourceExpType)
14057 FreeType(backupSourceExpType);
14058 return 1;
14059 }
14060 if(!_class->dataType)
14061 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14062 FreeType(dest);
14063 dest = _class->dataType;
14064 dest->refCount++;
14065 }
14066 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))
14067 {
14068 specs = MkListOne(MkSpecifier(DOUBLE));
14069 }
14070 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))
14071 {
14072 specs = MkListOne(MkSpecifier(FLOAT));
14073 }
14074 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))
14075 {
14076 specs = MkList();
14077 if(!dest->isSigned)
14078 ListAdd(specs, MkSpecifier(UNSIGNED));
14079 ListAdd(specs, MkSpecifier(INT64));
14080 }
14081 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
14082 {
14083 specs = MkList();
14084 if(!dest->isSigned)
14085 ListAdd(specs, MkSpecifier(UNSIGNED));
14086 ListAdd(specs, MkSpecifier(INT));
14087 }
14088 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14089 {
14090 specs = MkList();
14091 if(!dest->isSigned)
14092 ListAdd(specs, MkSpecifier(UNSIGNED));
14093 ListAdd(specs, MkSpecifier(SHORT));
14094 }
14095 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14096 {
14097 specs = MkList();
14098 if(!dest->isSigned)
14099 ListAdd(specs, MkSpecifier(UNSIGNED));
14100 ListAdd(specs, MkSpecifier(CHAR));
14101 }
14102 else
14103 {
14104 FreeType(source);
14105 FreeType(dest);
14106 if(backupSourceExpType)
14107 {
14108 if(sourceExp->expType)
14109 FreeType(sourceExp->expType);
14110 sourceExp->expType = backupSourceExpType;
14111 }
14112 return 0;
14113 }
14114 }
14115 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))
14116 {
14117 specs = MkListOne(MkSpecifier(DOUBLE));
14118 }
14119 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))
14120 {
14121 specs = MkListOne(MkSpecifier(FLOAT));
14122 }
14123 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
14124 {
14125 specs = MkList();
14126 ListAdd(specs, MkSpecifier(BOOL));
14127 }
14128 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)))
14129 {
14130 if(source->kind == 3)
14131 return 1;
14132 else
14133 {
14134 specs = MkList();
14135 if(!dest->isSigned)
14136 ListAdd(specs, MkSpecifier(UNSIGNED));
14137 ListAdd(specs, MkSpecifier(CHAR));
14138 }
14139 }
14140 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)))))
14141 {
14142 if(source->kind == 3)
14143 return 1;
14144 else
14145 {
14146 specs = MkList();
14147 if(!dest->isSigned)
14148 ListAdd(specs, MkSpecifier(UNSIGNED));
14149 ListAdd(specs, MkSpecifier(SHORT));
14150 }
14151 }
14152 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
14153 {
14154 specs = MkList();
14155 if(!dest->isSigned)
14156 ListAdd(specs, MkSpecifier(UNSIGNED));
14157 ListAdd(specs, MkSpecifier(INT));
14158 }
14159 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
14160 {
14161 specs = MkList();
14162 if(!dest->isSigned)
14163 ListAdd(specs, MkSpecifier(UNSIGNED));
14164 ListAdd(specs, MkSpecifier(INT64));
14165 }
14166 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
14167 {
14168 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
14169 }
14170 else
14171 {
14172 FreeType(source);
14173 FreeType(dest);
14174 if(backupSourceExpType)
14175 {
14176 if(sourceExp->expType)
14177 FreeType(sourceExp->expType);
14178 sourceExp->expType = backupSourceExpType;
14179 }
14180 return 0;
14181 }
14182 if(!flag && !sourceExp->opDestType)
14183 {
14184 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14185
14186 *newExp = *sourceExp;
14187 newExp->prev = (((void *)0));
14188 newExp->next = (((void *)0));
14189 if(sourceExp->destType)
14190 sourceExp->destType->refCount++;
14191 if(sourceExp->expType)
14192 sourceExp->expType->refCount++;
14193 sourceExp->type = 11;
14194 if(realDest->kind == 8)
14195 {
14196 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
14197 FreeList(specs, (void *)(FreeSpecifier));
14198 }
14199 else
14200 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
14201 if(newExp->type == 4)
14202 {
14203 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
14204 }
14205 else
14206 sourceExp->__anon1.cast.exp = newExp;
14207 FreeType(sourceExp->expType);
14208 sourceExp->expType = (((void *)0));
14209 ProcessExpressionType(sourceExp);
14210 }
14211 else
14212 FreeList(specs, (void *)(FreeSpecifier));
14213 FreeType(dest);
14214 FreeType(source);
14215 if(backupSourceExpType)
14216 FreeType(backupSourceExpType);
14217 return 1;
14218 }
14219 else
14220 {
14221 if(computedExp != nbExp)
14222 {
14223 FreeExpression(computedExp);
14224 computedExp = nbExp;
14225 }
14226 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
14227 sourceExp = (*sourceExp->__anon1.list).last;
14228 if(sourceExp->type == 0)
14229 {
14230 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
14231
14232 if(dest->kind == 8)
14233 {
14234 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
14235 {
14236 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
14237 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14238
14239 if(enumClass)
14240 {
14241 for(; _class && _class->type == 4; _class = _class->base)
14242 {
14243 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
14244 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14245
14246 for(value = e->values.first; value; value = value->next)
14247 {
14248 if(!strcmp(value->name, id->string))
14249 break;
14250 }
14251 if(value)
14252 {
14253 FreeType(sourceExp->expType);
14254 sourceExp->isConstant = 1;
14255 sourceExp->expType = MkClassType(_class->fullName);
14256 if(inCompiler || inPreCompiler || inDebugger)
14257 {
14258 FreeExpContents(sourceExp);
14259 sourceExp->type = 2;
14260 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
14261 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
14262 else
14263 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
14264 }
14265 FreeType(dest);
14266 return 1;
14267 }
14268 }
14269 }
14270 }
14271 }
14272 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
14273 {
14274 FreeType(dest);
14275 return 1;
14276 }
14277 }
14278 FreeType(dest);
14279 }
14280 return 0;
14281 }
14282
14283 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
14284 {
14285 unsigned int result = 1;
14286
14287 if(destType)
14288 {
14289 struct __ecereNameSpace__ecere__sys__OldList converts =
14290 {
14291 0, 0, 0, 0, 0
14292 };
14293 struct Conversion * convert;
14294
14295 if(destType->kind == 0)
14296 return 0;
14297 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
14298 result = 0;
14299 if(converts.count)
14300 {
14301 for(convert = converts.first; convert; convert = convert->next)
14302 {
14303 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
14304
14305 if(!empty)
14306 {
14307 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14308 int objectType = exp->expType ? exp->expType->classObjectType : 0;
14309
14310 *newExp = *exp;
14311 newExp->prev = (((void *)0));
14312 newExp->next = (((void *)0));
14313 newExp->destType = (((void *)0));
14314 if(convert->isGet)
14315 {
14316 exp->type = 8;
14317 exp->addedThis = 1;
14318 exp->__anon1.member.exp = newExp;
14319 FreeType(exp->__anon1.member.exp->expType);
14320 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
14321 exp->__anon1.member.exp->expType->classObjectType = objectType;
14322 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
14323 exp->__anon1.member.memberType = 1;
14324 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14325 exp->needCast = 1;
14326 if(exp->expType)
14327 exp->expType->refCount++;
14328 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14329 }
14330 else
14331 {
14332 {
14333 exp->type = 8;
14334 exp->addedThis = 1;
14335 exp->__anon1.member.exp = newExp;
14336 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)
14337 {
14338 newExp->byReference = 1;
14339 }
14340 FreeType(exp->__anon1.member.exp->expType);
14341 exp->__anon1.member.exp->expType = (((void *)0));
14342 if(convert->convert->dataType)
14343 {
14344 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14345 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
14346 exp->__anon1.member.exp->expType->refCount = 1;
14347 exp->__anon1.member.exp->expType->classObjectType = objectType;
14348 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14349 }
14350 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
14351 exp->__anon1.member.memberType = 4;
14352 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14353 exp->needCast = 1;
14354 if(convert->resultType)
14355 convert->resultType->refCount++;
14356 }
14357 }
14358 }
14359 else
14360 {
14361 FreeType(exp->expType);
14362 if(convert->isGet)
14363 {
14364 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14365 if(exp->destType->casted)
14366 exp->needCast = 1;
14367 if(exp->expType)
14368 exp->expType->refCount++;
14369 }
14370 else
14371 {
14372 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14373 if(exp->destType->casted)
14374 exp->needCast = 1;
14375 if(convert->resultType)
14376 convert->resultType->refCount++;
14377 }
14378 }
14379 }
14380 if(exp->isConstant && inCompiler)
14381 ComputeExpression(exp);
14382 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
14383 }
14384 if(!result && exp->expType && converts.count)
14385 {
14386 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14387 }
14388 if(!result && exp->expType && exp->destType)
14389 {
14390 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))
14391 result = 1;
14392 }
14393 }
14394 return result;
14395 }
14396
14397 static void ProcessFunction(struct FunctionDefinition *  function);
14398
14399 void ProcessInstantiationType(struct Instantiation * inst)
14400 {
14401 yylloc = inst->loc;
14402 if(inst->_class)
14403 {
14404 struct MembersInit * members;
14405 struct Symbol * classSym;
14406 struct __ecereNameSpace__ecere__com__Class * _class;
14407
14408 classSym = inst->_class->__anon1.__anon1.symbol;
14409 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14410 if(!_class || _class->type != 5)
14411 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14412 afterExternal = afterExternal ? afterExternal : curExternal;
14413 if(inst->exp)
14414 ProcessExpressionType(inst->exp);
14415 inst->isConstant = 1;
14416 if(inst->members)
14417 {
14418 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14419 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14420 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14421 int subMemberStackPos = 0;
14422
14423 for(members = (*inst->members).first; members; members = members->next)
14424 {
14425 switch(members->type)
14426 {
14427 case 1:
14428 {
14429 char name[1024];
14430 static unsigned int instMethodID = 0;
14431 struct External * external = curExternal;
14432 struct Context * context = curContext;
14433 struct Declarator * declarator = members->__anon1.function->declarator;
14434 struct Identifier * nameID = GetDeclId(declarator);
14435 char * unmangled = nameID ? nameID->string : (((void *)0));
14436 struct Expression * exp;
14437 struct External * createdExternal = (((void *)0));
14438
14439 if(inCompiler)
14440 {
14441 char number[16];
14442
14443 strcpy(name, "__ecereInstMeth_");
14444 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14445 strcat(name, "_");
14446 strcat(name, nameID->string);
14447 strcat(name, "_");
14448 sprintf(number, "_%08d", instMethodID++);
14449 strcat(name, number);
14450 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14451 }
14452 if(declarator)
14453 {
14454 struct Symbol * symbol = declarator->symbol;
14455 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14456
14457 if(method && method->type == 1)
14458 {
14459 symbol->__anon1.method = method;
14460 ProcessMethodType(method);
14461 if(!symbol->type->__anon1.__anon2.thisClass)
14462 {
14463 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14464 {
14465 if(!currentClass->symbol)
14466 currentClass->symbol = FindClass(currentClass->fullName);
14467 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14468 }
14469 else
14470 {
14471 if(!_class->symbol)
14472 _class->symbol = FindClass(_class->fullName);
14473 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14474 }
14475 }
14476 DeclareType(curExternal, symbol->type, 1, 1);
14477 }
14478 else if(classSym)
14479 {
14480 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14481 }
14482 }
14483 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14484 if(nameID)
14485 {
14486 FreeSpecifier(nameID->_class);
14487 nameID->_class = (((void *)0));
14488 }
14489 curExternal = createdExternal;
14490 if(inCompiler)
14491 {
14492 if(createdExternal->__anon1.function)
14493 ProcessFunction(createdExternal->__anon1.function);
14494 }
14495 else if(declarator)
14496 {
14497 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14498 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14499 }
14500 curExternal = external;
14501 curContext = context;
14502 if(inCompiler)
14503 {
14504 FreeClassFunction(members->__anon1.function);
14505 exp = QMkExpId(name);
14506 members->type = 0;
14507 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14508 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14509 }
14510 break;
14511 }
14512 case 0:
14513 {
14514 if(members->__anon1.dataMembers && classSym)
14515 {
14516 struct MemberInit * member;
14517 struct Location oldyyloc = yylloc;
14518
14519 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14520 {
14521 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14522 if(member->initializer && !member->initializer->isConstant)
14523 inst->isConstant = 0;
14524 }
14525 yylloc = oldyyloc;
14526 }
14527 break;
14528 }
14529 }
14530 }
14531 }
14532 }
14533 }
14534
14535 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14536
14537 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14538 {
14539 switch(spec->type)
14540 {
14541 case 0:
14542 {
14543 if(spec->__anon1.specifier == THISCLASS)
14544 {
14545 if(thisClass)
14546 {
14547 spec->type = 1;
14548 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14549 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14550 ProcessSpecifier(spec, declareStruct, 0);
14551 }
14552 }
14553 break;
14554 }
14555 case 1:
14556 {
14557 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14558
14559 if(symbol)
14560 DeclareType(curExternal, symbol->type, 1, 1);
14561 else if(spec->__anon1.__anon1.symbol)
14562 {
14563 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14564
14565 if(warnClasses && !c)
14566 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14567 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14568 }
14569 break;
14570 }
14571 case 2:
14572 {
14573 struct Enumerator * e;
14574
14575 if(spec->__anon1.__anon2.list)
14576 {
14577 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14578 {
14579 if(e->exp)
14580 ProcessExpressionType(e->exp);
14581 }
14582 }
14583 if(inCompiler)
14584 break;
14585 }
14586 case 3:
14587 case 4:
14588 {
14589 if(spec->__anon1.__anon2.definitions)
14590 {
14591 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14592
14593 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14594 }
14595 break;
14596 }
14597 }
14598 }
14599
14600 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14601 {
14602 switch(decl->type)
14603 {
14604 case 1:
14605 if(decl->__anon1.identifier->classSym)
14606 {
14607 FreeSpecifier(decl->__anon1.identifier->_class);
14608 decl->__anon1.identifier->_class = (((void *)0));
14609 }
14610 break;
14611 case 3:
14612 if(decl->__anon1.array.exp)
14613 ProcessExpressionType(decl->__anon1.array.exp);
14614 case 0:
14615 case 2:
14616 case 4:
14617 case 5:
14618 case 6:
14619 case 7:
14620 {
14621 struct Identifier * id = (((void *)0));
14622 struct Specifier * classSpec = (((void *)0));
14623
14624 if(decl->type == 4)
14625 {
14626 id = GetDeclId(decl);
14627 if(id && id->_class)
14628 {
14629 classSpec = id->_class;
14630 id->_class = (((void *)0));
14631 }
14632 }
14633 if(decl->declarator)
14634 ProcessDeclarator(decl->declarator, isFunction);
14635 if(decl->type == 4)
14636 {
14637 if(classSpec)
14638 {
14639 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14640
14641 if(!decl->__anon1.function.parameters)
14642 decl->__anon1.function.parameters = MkList();
14643 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14644 }
14645 if(decl->__anon1.function.parameters)
14646 {
14647 struct TypeName * param;
14648
14649 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14650 {
14651 if(param->qualifiers)
14652 {
14653 struct Specifier * spec;
14654
14655 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14656 {
14657 if(spec->type == 0)
14658 {
14659 if(spec->__anon1.specifier == TYPED_OBJECT)
14660 {
14661 struct Declarator * d = param->declarator;
14662 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);
14663
14664 if(d->type != 5)
14665 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14666 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14667 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14668 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14669 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14670 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14671 param = newParam;
14672 break;
14673 }
14674 else if(spec->__anon1.specifier == ANY_OBJECT)
14675 {
14676 struct Declarator * d = param->declarator;
14677
14678 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14679 param->qualifiers = MkListOne(MkSpecifier(VOID));
14680 if(d->type != 5)
14681 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14682 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14683 break;
14684 }
14685 else if(spec->__anon1.specifier == THISCLASS)
14686 {
14687 if(thisClass)
14688 {
14689 spec->type = 1;
14690 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14691 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14692 ProcessSpecifier(spec, 0, 0);
14693 }
14694 break;
14695 }
14696 }
14697 else if(spec->type == 1)
14698 {
14699 ProcessSpecifier(spec, isFunction, 1);
14700 }
14701 }
14702 }
14703 if(param->declarator)
14704 ProcessDeclarator(param->declarator, 0);
14705 }
14706 }
14707 }
14708 break;
14709 }
14710 }
14711 }
14712
14713 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14714 {
14715 yylloc = decl->loc;
14716 switch(decl->type)
14717 {
14718 case 1:
14719 {
14720 unsigned int declareStruct = 0;
14721
14722 if(decl->__anon1.__anon1.declarators)
14723 {
14724 struct InitDeclarator * d;
14725
14726 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14727 {
14728 struct Type * type, * subType;
14729
14730 ProcessDeclarator(d->declarator, 0);
14731 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14732 if(d->initializer)
14733 {
14734 ProcessInitializer(d->initializer, type);
14735 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14736 {
14737 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14738 {
14739 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14740
14741 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14742 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14743 if(decl->__anon1.__anon1.specifiers)
14744 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14745 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14746 d = (((void *)0));
14747 decl->type = 2;
14748 decl->__anon1.inst = inst;
14749 }
14750 }
14751 }
14752 for(subType = type; subType; )
14753 {
14754 if(subType->kind == 8)
14755 {
14756 declareStruct = 1;
14757 break;
14758 }
14759 else if(subType->kind == 13)
14760 break;
14761 else if(subType->kind == 12)
14762 subType = subType->__anon1.__anon4.arrayType;
14763 else
14764 break;
14765 }
14766 FreeType(type);
14767 if(!d)
14768 break;
14769 }
14770 }
14771 if(decl->__anon1.__anon1.specifiers)
14772 {
14773 struct Specifier * s;
14774
14775 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
14776 {
14777 ProcessSpecifier(s, declareStruct, 1);
14778 }
14779 }
14780 break;
14781 }
14782 case 2:
14783 {
14784 ProcessInstantiationType(decl->__anon1.inst);
14785 break;
14786 }
14787 case 0:
14788 {
14789 struct Specifier * spec;
14790 struct Declarator * d;
14791 unsigned int declareStruct = 0;
14792
14793 if(decl->__anon1.__anon1.declarators)
14794 {
14795 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14796 {
14797 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14798 struct Type * subType;
14799
14800 ProcessDeclarator(d, 0);
14801 for(subType = type; subType; )
14802 {
14803 if(subType->kind == 8)
14804 {
14805 declareStruct = 1;
14806 break;
14807 }
14808 else if(subType->kind == 13)
14809 break;
14810 else if(subType->kind == 12)
14811 subType = subType->__anon1.__anon4.arrayType;
14812 else
14813 break;
14814 }
14815 FreeType(type);
14816 }
14817 }
14818 if(decl->__anon1.__anon1.specifiers)
14819 {
14820 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
14821 ProcessSpecifier(spec, declareStruct, warnClasses);
14822 }
14823 break;
14824 }
14825 }
14826 }
14827
14828 static void ProcessStatement(struct Statement * stmt)
14829 {
14830 yylloc = stmt->loc;
14831 switch(stmt->type)
14832 {
14833 case 0:
14834 ProcessStatement(stmt->__anon1.labeled.stmt);
14835 break;
14836 case 1:
14837 if(stmt->__anon1.caseStmt.exp)
14838 {
14839 FreeType(stmt->__anon1.caseStmt.exp->destType);
14840 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
14841 if(curSwitchType)
14842 curSwitchType->refCount++;
14843 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
14844 ComputeExpression(stmt->__anon1.caseStmt.exp);
14845 }
14846 if(stmt->__anon1.caseStmt.stmt)
14847 ProcessStatement(stmt->__anon1.caseStmt.stmt);
14848 break;
14849 case 2:
14850 {
14851 if(stmt->__anon1.compound.context)
14852 {
14853 struct Declaration * decl;
14854 struct Statement * s;
14855 struct Statement * prevCompound = curCompound;
14856 struct Context * prevContext = curContext;
14857
14858 if(!stmt->__anon1.compound.isSwitch)
14859 curCompound = stmt;
14860 curContext = stmt->__anon1.compound.context;
14861 if(stmt->__anon1.compound.declarations)
14862 {
14863 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
14864 ProcessDeclaration(decl, 1);
14865 }
14866 if(stmt->__anon1.compound.statements)
14867 {
14868 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
14869 ProcessStatement(s);
14870 }
14871 curContext = prevContext;
14872 curCompound = prevCompound;
14873 }
14874 break;
14875 }
14876 case 3:
14877 {
14878 struct Expression * exp;
14879
14880 if(stmt->__anon1.expressions)
14881 {
14882 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14883 ProcessExpressionType(exp);
14884 }
14885 break;
14886 }
14887 case 4:
14888 {
14889 struct Expression * exp;
14890
14891 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
14892 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
14893 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
14894 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
14895 {
14896 ProcessExpressionType(exp);
14897 }
14898 if(stmt->__anon1.ifStmt.stmt)
14899 ProcessStatement(stmt->__anon1.ifStmt.stmt);
14900 if(stmt->__anon1.ifStmt.elseStmt)
14901 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
14902 break;
14903 }
14904 case 5:
14905 {
14906 struct Type * oldSwitchType = curSwitchType;
14907
14908 if(stmt->__anon1.switchStmt.exp)
14909 {
14910 struct Expression * exp;
14911
14912 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
14913 {
14914 if(!exp->next)
14915 {
14916 ProcessExpressionType(exp);
14917 }
14918 if(!exp->next)
14919 curSwitchType = exp->expType;
14920 }
14921 }
14922 ProcessStatement(stmt->__anon1.switchStmt.stmt);
14923 curSwitchType = oldSwitchType;
14924 break;
14925 }
14926 case 6:
14927 {
14928 if(stmt->__anon1.whileStmt.exp)
14929 {
14930 struct Expression * exp;
14931
14932 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
14933 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
14934 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
14935 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
14936 {
14937 ProcessExpressionType(exp);
14938 }
14939 }
14940 if(stmt->__anon1.whileStmt.stmt)
14941 ProcessStatement(stmt->__anon1.whileStmt.stmt);
14942 break;
14943 }
14944 case 7:
14945 {
14946 if(stmt->__anon1.doWhile.exp)
14947 {
14948 struct Expression * exp;
14949
14950 if((*stmt->__anon1.doWhile.exp).last)
14951 {
14952 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
14953 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
14954 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
14955 }
14956 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
14957 {
14958 ProcessExpressionType(exp);
14959 }
14960 }
14961 if(stmt->__anon1.doWhile.stmt)
14962 ProcessStatement(stmt->__anon1.doWhile.stmt);
14963 break;
14964 }
14965 case 8:
14966 {
14967 struct Expression * exp;
14968
14969 if(stmt->__anon1.forStmt.init)
14970 ProcessStatement(stmt->__anon1.forStmt.init);
14971 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
14972 {
14973 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
14974 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
14975 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
14976 }
14977 if(stmt->__anon1.forStmt.check)
14978 ProcessStatement(stmt->__anon1.forStmt.check);
14979 if(stmt->__anon1.forStmt.increment)
14980 {
14981 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
14982 ProcessExpressionType(exp);
14983 }
14984 if(stmt->__anon1.forStmt.stmt)
14985 ProcessStatement(stmt->__anon1.forStmt.stmt);
14986 break;
14987 }
14988 case 18:
14989 {
14990 struct Identifier * id = stmt->__anon1.forEachStmt.id;
14991 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
14992 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
14993 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
14994 char iteratorType[1024];
14995 struct Type * source;
14996 struct Expression * e;
14997 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));
14998 struct Expression * arrayExp;
14999 const char * typeString = (((void *)0));
15000 int builtinCount = 0;
15001
15002 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15003 {
15004 if(!e->next)
15005 {
15006 FreeType(e->destType);
15007 e->destType = ProcessTypeString("Container", 0);
15008 }
15009 if(!isBuiltin || e->next)
15010 ProcessExpressionType(e);
15011 }
15012 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15013 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)))
15014 {
15015 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
15016 struct Symbol * symbol;
15017 struct Expression * expIt = (((void *)0));
15018 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
15019 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15020 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15021 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15022
15023 if(inCompiler)
15024 {
15025 stmt->type = 2;
15026 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15027 stmt->__anon1.compound.context->parent = curContext;
15028 curContext = stmt->__anon1.compound.context;
15029 }
15030 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
15031 {
15032 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15033
15034 isCustomAVLTree = 1;
15035 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
15036 isMap = 1;
15037 }
15038 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15039 isArray = 1;
15040 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15041 {
15042 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15043
15044 isLinkList = 1;
15045 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15046 }
15047 if(inCompiler && isArray)
15048 {
15049 struct Declarator * decl;
15050 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15051
15052 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15053 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15054 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15055 }
15056 else if(isBuiltin)
15057 {
15058 struct Type * type = (((void *)0));
15059 char typeStringBuf[1024];
15060
15061 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15062 if(((struct Expression *)(*exp).last)->type == 11)
15063 {
15064 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15065
15066 if(typeName)
15067 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15068 }
15069 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)
15070 {
15071 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15072
15073 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15074 }
15075 else if(arrayExp->__anon1.list)
15076 {
15077 struct Expression * e;
15078
15079 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15080 {
15081 ProcessExpressionType(e);
15082 if(e->expType)
15083 {
15084 if(!type)
15085 {
15086 type = e->expType;
15087 type->refCount++;
15088 }
15089 else
15090 {
15091 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15092 {
15093 FreeType(type);
15094 type = e->expType;
15095 e->expType = (((void *)0));
15096 e = (*arrayExp->__anon1.list).first;
15097 ProcessExpressionType(e);
15098 if(e->expType)
15099 {
15100 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15101 {
15102 FreeType(e->expType);
15103 e->expType = (((void *)0));
15104 FreeType(type);
15105 type = (((void *)0));
15106 break;
15107 }
15108 }
15109 }
15110 }
15111 if(e->expType)
15112 {
15113 FreeType(e->expType);
15114 e->expType = (((void *)0));
15115 }
15116 }
15117 }
15118 if(type)
15119 {
15120 typeStringBuf[0] = '\0';
15121 PrintType(type, typeStringBuf, 0, 1);
15122 typeString = typeStringBuf;
15123 FreeType(type);
15124 }
15125 }
15126 if(typeString)
15127 {
15128 if(inCompiler)
15129 {
15130 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15131 struct Declarator * decl;
15132 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15133
15134 if(arrayExp->__anon1.list)
15135 {
15136 struct Expression * e;
15137
15138 builtinCount = (*arrayExp->__anon1.list).count;
15139 type = ProcessTypeString(typeString, 0);
15140 while((e = (*arrayExp->__anon1.list).first))
15141 {
15142 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15143 e->destType = type;
15144 type->refCount++;
15145 ProcessExpressionType(e);
15146 if(inCompiler)
15147 ListAdd(initializers, MkInitializerAssignment(e));
15148 }
15149 FreeType(type);
15150 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15151 }
15152 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15153 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15154 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15155 FreeList(exp, (void *)(FreeExpression));
15156 }
15157 else if(arrayExp->__anon1.list)
15158 {
15159 struct Expression * e;
15160
15161 type = ProcessTypeString(typeString, 0);
15162 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15163 {
15164 e->destType = type;
15165 type->refCount++;
15166 ProcessExpressionType(e);
15167 }
15168 FreeType(type);
15169 }
15170 }
15171 else
15172 {
15173 arrayExp->expType = ProcessTypeString("Container", 0);
15174 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15175 }
15176 }
15177 else if(inCompiler && isLinkList && !isList)
15178 {
15179 struct Declarator * decl;
15180 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15181
15182 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15183 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15184 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15185 }
15186 else if(inCompiler && _class->templateArgs)
15187 {
15188 if(isMap)
15189 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15190 else
15191 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15192 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)))))))));
15193 }
15194 if(inCompiler)
15195 {
15196 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15197 if(block)
15198 {
15199 switch(block->type)
15200 {
15201 case 2:
15202 if(block->__anon1.compound.context)
15203 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15204 break;
15205 case 4:
15206 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15207 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15208 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15209 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15210 break;
15211 case 5:
15212 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15213 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15214 break;
15215 case 6:
15216 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15217 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15218 break;
15219 case 7:
15220 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15221 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15222 break;
15223 case 8:
15224 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15225 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15226 break;
15227 case 18:
15228 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15229 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15230 break;
15231 }
15232 }
15233 if(filter)
15234 {
15235 block = MkIfStmt(filter, block, (((void *)0)));
15236 }
15237 if(isArray)
15238 {
15239 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));
15240 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15241 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15242 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15243 }
15244 else if(isBuiltin)
15245 {
15246 char count[128];
15247
15248 sprintf(count, "%d", builtinCount);
15249 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));
15250 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15251 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15252 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15253 }
15254 else if(isLinkList && !isList)
15255 {
15256 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15257 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15258
15259 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15260 {
15261 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));
15262 }
15263 else
15264 {
15265 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15266 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15267
15268 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));
15269 }
15270 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15271 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15272 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15273 }
15274 else
15275 {
15276 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15277 }
15278 ProcessExpressionType(expIt);
15279 if((*stmt->__anon1.compound.declarations).first)
15280 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15281 if(symbol)
15282 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15283 ProcessStatement(stmt);
15284 }
15285 else
15286 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15287 if(inCompiler)
15288 curContext = stmt->__anon1.compound.context->parent;
15289 break;
15290 }
15291 else
15292 {
15293 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15294 }
15295 break;
15296 }
15297 case 9:
15298 break;
15299 case 10:
15300 break;
15301 case 11:
15302 break;
15303 case 12:
15304 {
15305 struct Expression * exp;
15306
15307 if(stmt->__anon1.expressions)
15308 {
15309 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15310 {
15311 if(!exp->next)
15312 {
15313 if(curFunction && !curFunction->type)
15314 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15315 FreeType(exp->destType);
15316 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15317 if(exp->destType)
15318 exp->destType->refCount++;
15319 }
15320 ProcessExpressionType(exp);
15321 }
15322 }
15323 break;
15324 }
15325 case 14:
15326 {
15327 ProcessDeclaration(stmt->__anon1.decl, 1);
15328 break;
15329 }
15330 case 13:
15331 {
15332 struct AsmField * field;
15333
15334 if(stmt->__anon1.asmStmt.inputFields)
15335 {
15336 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15337 if(field->expression)
15338 ProcessExpressionType(field->expression);
15339 }
15340 if(stmt->__anon1.asmStmt.outputFields)
15341 {
15342 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15343 if(field->expression)
15344 ProcessExpressionType(field->expression);
15345 }
15346 if(stmt->__anon1.asmStmt.clobberedFields)
15347 {
15348 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15349 {
15350 if(field->expression)
15351 ProcessExpressionType(field->expression);
15352 }
15353 }
15354 break;
15355 }
15356 case 17:
15357 {
15358 struct PropertyWatch * propWatch;
15359 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15360 struct Expression * object = stmt->__anon1._watch.object;
15361 struct Expression * watcher = stmt->__anon1._watch.watcher;
15362
15363 if(watcher)
15364 ProcessExpressionType(watcher);
15365 if(object)
15366 ProcessExpressionType(object);
15367 if(inCompiler)
15368 {
15369 if(watcher || thisClass)
15370 {
15371 struct External * external = curExternal;
15372 struct Context * context = curContext;
15373
15374 stmt->type = 3;
15375 stmt->__anon1.expressions = MkList();
15376 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15377 {
15378 struct ClassFunction * func;
15379 char watcherName[1024];
15380 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;
15381 struct External * createdExternal;
15382
15383 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15384 if(propWatch->deleteWatch)
15385 strcat(watcherName, "_delete");
15386 else
15387 {
15388 struct Identifier * propID;
15389
15390 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15391 {
15392 strcat(watcherName, "_");
15393 strcat(watcherName, propID->string);
15394 }
15395 }
15396 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15397 {
15398 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)));
15399 ProcessClassFunctionBody(func, propWatch->compound);
15400 propWatch->compound = (((void *)0));
15401 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15402 FreeClassFunction(func);
15403 curExternal = createdExternal;
15404 ProcessFunction(createdExternal->__anon1.function);
15405 if(propWatch->deleteWatch)
15406 {
15407 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15408
15409 ListAdd(args, CopyExpression(object));
15410 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15411 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15412 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15413 }
15414 else
15415 {
15416 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15417 struct Identifier * propID;
15418
15419 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15420 {
15421 char propName[1024];
15422 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15423
15424 if(prop)
15425 {
15426 char getName[1024], setName[1024];
15427 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15428
15429 DeclareProperty(createdExternal, prop, setName, getName);
15430 strcpy(propName, "__ecereProp_");
15431 FullClassNameCat(propName, prop->_class->fullName, 0);
15432 strcat(propName, "_");
15433 FullClassNameCat(propName, prop->name, 1);
15434 ListAdd(args, CopyExpression(object));
15435 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15436 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15437 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15438 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15439 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15440 }
15441 else
15442 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15443 }
15444 }
15445 }
15446 else
15447 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15448 }
15449 curExternal = external;
15450 curContext = context;
15451 if(watcher)
15452 FreeExpression(watcher);
15453 if(object)
15454 FreeExpression(object);
15455 FreeList(watches, (void *)(FreePropertyWatch));
15456 }
15457 else
15458 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15459 }
15460 else
15461 {
15462 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15463 {
15464 ProcessStatement(propWatch->compound);
15465 }
15466 }
15467 break;
15468 }
15469 case 15:
15470 {
15471 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15472 struct Expression * object = stmt->__anon1._watch.object;
15473 struct __ecereNameSpace__ecere__com__Class * _class;
15474
15475 if(object)
15476 ProcessExpressionType(object);
15477 if(inCompiler)
15478 {
15479 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15480 if(_class)
15481 {
15482 struct Identifier * propID;
15483
15484 stmt->type = 3;
15485 stmt->__anon1.expressions = MkList();
15486 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15487 {
15488 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15489 }
15490 else if(!watches)
15491 {
15492 }
15493 if(watches)
15494 {
15495 for(propID = (*watches).first; propID; propID = propID->next)
15496 {
15497 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15498
15499 if(prop)
15500 {
15501 CreateFireWatcher(prop, object, stmt);
15502 }
15503 else
15504 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15505 }
15506 }
15507 else
15508 {
15509 struct __ecereNameSpace__ecere__com__Property * prop;
15510 struct __ecereNameSpace__ecere__com__Class * base;
15511
15512 for(base = _class; base; base = base->base)
15513 {
15514 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15515 {
15516 if(prop->isProperty && prop->isWatchable)
15517 {
15518 CreateFireWatcher(prop, object, stmt);
15519 }
15520 }
15521 }
15522 }
15523 if(object)
15524 FreeExpression(object);
15525 FreeList(watches, (void *)(FreeIdentifier));
15526 }
15527 else
15528 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15529 }
15530 break;
15531 }
15532 case 16:
15533 {
15534 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15535 struct Expression * object = stmt->__anon1._watch.object;
15536 struct Expression * watcher = stmt->__anon1._watch.watcher;
15537 struct __ecereNameSpace__ecere__com__Class * _class;
15538
15539 if(object)
15540 ProcessExpressionType(object);
15541 if(watcher)
15542 ProcessExpressionType(watcher);
15543 if(inCompiler)
15544 {
15545 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15546 if(watcher || thisClass)
15547 {
15548 if(_class)
15549 {
15550 struct Identifier * propID;
15551
15552 stmt->type = 3;
15553 stmt->__anon1.expressions = MkList();
15554 if(!watches)
15555 {
15556 struct __ecereNameSpace__ecere__sys__OldList * args;
15557
15558 args = MkList();
15559 ListAdd(args, CopyExpression(object));
15560 ListAdd(args, MkExpConstant("0"));
15561 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15562 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15563 }
15564 else
15565 {
15566 for(propID = (*watches).first; propID; propID = propID->next)
15567 {
15568 char propName[1024];
15569 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15570
15571 if(prop)
15572 {
15573 char getName[1024], setName[1024];
15574 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15575
15576 DeclareProperty(curExternal, prop, setName, getName);
15577 strcpy(propName, "__ecereProp_");
15578 FullClassNameCat(propName, prop->_class->fullName, 0);
15579 strcat(propName, "_");
15580 FullClassNameCat(propName, prop->name, 1);
15581 ListAdd(args, CopyExpression(object));
15582 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15583 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15584 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15585 }
15586 else
15587 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15588 }
15589 }
15590 if(object)
15591 FreeExpression(object);
15592 if(watcher)
15593 FreeExpression(watcher);
15594 FreeList(watches, (void *)(FreeIdentifier));
15595 }
15596 else
15597 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15598 }
15599 else
15600 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15601 }
15602 break;
15603 }
15604 }
15605 }
15606
15607 void ComputeDataTypes()
15608 {
15609 struct External * external;
15610
15611 currentClass = (((void *)0));
15612 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15613 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15614 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15615 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15616 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15617 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15618 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15619 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15620 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15621 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15622 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15623 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15624 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15625 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15626 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15627 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15628 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15629 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15630 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15631 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15632 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15633 for(external = (*ast).first; external; external = external->next)
15634 {
15635 afterExternal = curExternal = external;
15636 if(external->type == 0)
15637 {
15638 if(memoryGuard)
15639 {
15640 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15641 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15642 }
15643 currentClass = external->__anon1.function->_class;
15644 ProcessFunction(external->__anon1.function);
15645 }
15646 else if(external->type == 1)
15647 {
15648 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15649 {
15650 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15651 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15652 }
15653 currentClass = (((void *)0));
15654 if(external->__anon1.declaration)
15655 ProcessDeclaration(external->__anon1.declaration, 1);
15656 }
15657 else if(external->type == 2)
15658 {
15659 struct ClassDefinition * _class = external->__anon1._class;
15660
15661 currentClass = external->symbol->__anon1.registered;
15662 if(memoryGuard)
15663 {
15664 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15665 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15666 }
15667 if(_class->definitions)
15668 {
15669 ProcessClass(_class->definitions, _class->symbol);
15670 }
15671 if(inCompiler)
15672 {
15673 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15674 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
15675 }
15676 }
15677 else if(external->type == 4)
15678 {
15679 thisNameSpace = external->__anon1.id->string;
15680 }
15681 }
15682 currentClass = (((void *)0));
15683 thisNameSpace = (((void *)0));
15684 curExternal = (((void *)0));
15685 }
15686
15687 void ProcessExpressionType(struct Expression * exp)
15688 {
15689 unsigned int unresolved = 0;
15690 struct Location oldyylloc = yylloc;
15691 unsigned int notByReference = 0;
15692
15693 if(!exp || exp->expType)
15694 return ;
15695 yylloc = exp->loc;
15696 switch(exp->type)
15697 {
15698 case 0:
15699 {
15700 struct Identifier * id = exp->__anon1.__anon1.identifier;
15701
15702 if(!id || !topContext)
15703 return ;
15704 if(id->_class && id->_class->__anon1.__anon1.name)
15705 {
15706 id->classSym = id->_class->__anon1.__anon1.symbol;
15707 }
15708 if(!strcmp(id->string, "__runtimePlatform"))
15709 {
15710 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15711 break;
15712 }
15713 else if(strstr(id->string, "__ecereClass") == id->string)
15714 {
15715 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15716 break;
15717 }
15718 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15719 {
15720 ReplaceClassMembers(exp, thisClass);
15721 if(exp->type != 0)
15722 {
15723 ProcessExpressionType(exp);
15724 break;
15725 }
15726 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15727 break;
15728 }
15729 else
15730 {
15731 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15732
15733 if(!symbol)
15734 {
15735 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15736 break;
15737 else
15738 {
15739 if(thisClass)
15740 {
15741 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15742 if(exp->type != 0)
15743 {
15744 ProcessExpressionType(exp);
15745 break;
15746 }
15747 }
15748 else if(currentClass && !id->_class)
15749 {
15750 if(ResolveIdWithClass(exp, currentClass, 1))
15751 break;
15752 }
15753 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15754 }
15755 }
15756 if(symbol)
15757 {
15758 struct Type * type = symbol->type;
15759 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15760
15761 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15762 {
15763 struct Context * context = SetupTemplatesContext(_class);
15764
15765 type = ReplaceThisClassType(_class);
15766 FinishTemplatesContext(context);
15767 if(type)
15768 type->refCount = 0;
15769 }
15770 FreeSpecifier(id->_class);
15771 id->_class = (((void *)0));
15772 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15773 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
15774 id->classSym = (((void *)0));
15775 exp->expType = type;
15776 if(type)
15777 type->refCount++;
15778 if(type && (type->kind == 15))
15779 exp->isConstant = 1;
15780 if(symbol->isParam || !strcmp(id->string, "this"))
15781 {
15782 if(_class && _class->type == 1 && !type->declaredWithStruct)
15783 exp->byReference = 1;
15784 }
15785 if(symbol->isIterator)
15786 {
15787 if(symbol->isIterator == 3)
15788 {
15789 exp->type = 5;
15790 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
15791 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
15792 exp->expType = (((void *)0));
15793 ProcessExpressionType(exp);
15794 }
15795 else if(symbol->isIterator != 4)
15796 {
15797 exp->type = 8;
15798 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
15799 exp->__anon1.member.exp->expType = exp->expType;
15800 exp->__anon1.member.member = MkIdentifier("data");
15801 exp->expType = (((void *)0));
15802 ProcessExpressionType(exp);
15803 }
15804 }
15805 break;
15806 }
15807 else
15808 {
15809 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
15810
15811 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15812 {
15813 char name[1024];
15814
15815 strcpy(name, thisNameSpace);
15816 strcat(name, "::");
15817 strcat(name, id->string);
15818 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
15819 }
15820 if(!definedExp)
15821 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
15822 if(definedExp)
15823 {
15824 int c;
15825
15826 for(c = 0; c < definedExpStackPos; c++)
15827 if(definedExpStack[c] == definedExp)
15828 break;
15829 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
15830 {
15831 struct Location backupYylloc = yylloc;
15832 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
15833
15834 definedExpStack[definedExpStackPos++] = definedExp;
15835 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
15836 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
15837 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15838
15839 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15840 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
15841 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
15842 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15843
15844 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15845 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
15846 echoOn = 0;
15847 parsedExpression = (((void *)0));
15848 resetScanner();
15849 expression_yyparse();
15850 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
15851 if(backInput)
15852 fileInput = backInput;
15853 yylloc = backupYylloc;
15854 if(parsedExpression)
15855 {
15856 FreeIdentifier(id);
15857 exp->type = 5;
15858 exp->__anon1.list = MkListOne(parsedExpression);
15859 ApplyLocation(parsedExpression, &yylloc);
15860 ProcessExpressionType(exp);
15861 definedExpStackPos--;
15862 return ;
15863 }
15864 definedExpStackPos--;
15865 }
15866 else
15867 {
15868 if(inCompiler)
15869 {
15870 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
15871 }
15872 }
15873 }
15874 else
15875 {
15876 struct GlobalData * data = (((void *)0));
15877
15878 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15879 {
15880 char name[1024];
15881
15882 strcpy(name, thisNameSpace);
15883 strcat(name, "::");
15884 strcat(name, id->string);
15885 data = FindGlobalData(name);
15886 }
15887 if(!data)
15888 data = FindGlobalData(id->string);
15889 if(data)
15890 {
15891 DeclareGlobalData(curExternal, data);
15892 exp->expType = data->dataType;
15893 if(data->dataType)
15894 data->dataType->refCount++;
15895 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15896 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
15897 FreeSpecifier(id->_class);
15898 id->_class = (((void *)0));
15899 break;
15900 }
15901 else
15902 {
15903 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
15904
15905 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15906 {
15907 char name[1024];
15908
15909 strcpy(name, thisNameSpace);
15910 strcat(name, "::");
15911 strcat(name, id->string);
15912 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
15913 }
15914 if(!function)
15915 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
15916 if(function)
15917 {
15918 char name[1024];
15919
15920 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15921 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
15922 name[0] = 0;
15923 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
15924 strcpy(name, "__ecereFunction_");
15925 FullClassNameCat(name, id->string, 0);
15926 if(DeclareFunction(curExternal, function, name))
15927 {
15928 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15929 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
15930 }
15931 exp->expType = function->dataType;
15932 if(function->dataType)
15933 function->dataType->refCount++;
15934 FreeSpecifier(id->_class);
15935 id->_class = (((void *)0));
15936 break;
15937 }
15938 }
15939 }
15940 }
15941 }
15942 unresolved = 1;
15943 break;
15944 }
15945 case 1:
15946 {
15947 if(!exp->__anon1.instance->_class)
15948 {
15949 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
15950 {
15951 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
15952 }
15953 }
15954 ProcessInstantiationType(exp->__anon1.instance);
15955 exp->isConstant = exp->__anon1.instance->isConstant;
15956 if(exp->__anon1.instance->_class)
15957 {
15958 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
15959 }
15960 break;
15961 }
15962 case 2:
15963 {
15964 if(!exp->expType)
15965 {
15966 char * constant = exp->__anon1.__anon1.constant;
15967 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
15968
15969 exp->expType = type;
15970 if(constant[0] == '\'')
15971 {
15972 if((int)((unsigned char *)constant)[1] > 127)
15973 {
15974 int nb;
15975 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
15976
15977 if(nb < 2)
15978 ch = constant[1];
15979 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
15980 exp->__anon1.__anon1.constant = PrintUInt(ch);
15981 type->kind = 8;
15982 type->__anon1._class = FindClass("unichar");
15983 type->isSigned = 0;
15984 }
15985 else
15986 {
15987 type->kind = 1;
15988 type->isSigned = 1;
15989 }
15990 }
15991 else
15992 {
15993 char * dot = strchr(constant, '.');
15994 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
15995 char * exponent;
15996
15997 if(isHex)
15998 {
15999 exponent = strchr(constant, 'p');
16000 if(!exponent)
16001 exponent = strchr(constant, 'P');
16002 }
16003 else
16004 {
16005 exponent = strchr(constant, 'e');
16006 if(!exponent)
16007 exponent = strchr(constant, 'E');
16008 }
16009 if(dot || exponent)
16010 {
16011 if(strchr(constant, 'f') || strchr(constant, 'F'))
16012 type->kind = 6;
16013 else
16014 type->kind = 7;
16015 type->isSigned = 1;
16016 }
16017 else
16018 {
16019 unsigned int isSigned = constant[0] == '-';
16020 char * endP = (((void *)0));
16021 long long i64 = strtoll(constant, &endP, 0);
16022 uint64 ui64 = strtoull(constant, &endP, 0);
16023 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16024 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16025
16026 if(isSigned)
16027 {
16028 if(i64 < (((int)0x80000000)))
16029 is64Bit = 1;
16030 }
16031 else
16032 {
16033 if(ui64 > (((int)0x7fffffff)))
16034 {
16035 if(ui64 > (0xffffffff))
16036 {
16037 is64Bit = 1;
16038 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16039 isSigned = 1;
16040 }
16041 }
16042 else if(constant[0] != '0' || !constant[1])
16043 isSigned = 1;
16044 }
16045 if(forceUnsigned)
16046 isSigned = 0;
16047 type->kind = is64Bit ? 4 : 3;
16048 type->isSigned = isSigned;
16049 }
16050 }
16051 exp->isConstant = 1;
16052 if(exp->destType && exp->destType->kind == 7)
16053 type->kind = 7;
16054 else if(exp->destType && exp->destType->kind == 6)
16055 type->kind = 6;
16056 else if(exp->destType && exp->destType->kind == 4)
16057 type->kind = 4;
16058 }
16059 break;
16060 }
16061 case 3:
16062 {
16063 exp->isConstant = 1;
16064 exp->expType = __extension__ ({
16065 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16066
16067 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16068 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16069
16070 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16071 }), __ecereInstance2;
16072 });
16073 break;
16074 }
16075 case 13:
16076 case 26:
16077 ProcessExpressionType(exp->__anon1._new.size);
16078 exp->expType = __extension__ ({
16079 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16080
16081 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16082 });
16083 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16084 break;
16085 case 14:
16086 case 27:
16087 ProcessExpressionType(exp->__anon1._renew.size);
16088 ProcessExpressionType(exp->__anon1._renew.exp);
16089 exp->expType = __extension__ ({
16090 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16091
16092 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16093 });
16094 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16095 break;
16096 case 4:
16097 {
16098 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16099 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16100 unsigned int useDestType = 0, useSideType = 0;
16101 struct Location oldyylloc = yylloc;
16102 unsigned int useSideUnit = 0;
16103 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16104 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16105
16106 switch(exp->__anon1.op.op)
16107 {
16108 case '=':
16109 case MUL_ASSIGN:
16110 case DIV_ASSIGN:
16111 case MOD_ASSIGN:
16112 case ADD_ASSIGN:
16113 case SUB_ASSIGN:
16114 case LEFT_ASSIGN:
16115 case RIGHT_ASSIGN:
16116 case AND_ASSIGN:
16117 case XOR_ASSIGN:
16118 case OR_ASSIGN:
16119 assign = 1;
16120 break;
16121 case '!':
16122 break;
16123 case AND_OP:
16124 case OR_OP:
16125 boolOps = 1;
16126 boolResult = 1;
16127 break;
16128 case EQ_OP:
16129 case '<':
16130 case '>':
16131 case LE_OP:
16132 case GE_OP:
16133 case NE_OP:
16134 boolResult = 1;
16135 useSideType = 1;
16136 break;
16137 case '+':
16138 case '-':
16139 useSideUnit = 1;
16140 useSideType = 1;
16141 useDestType = 1;
16142 break;
16143 case LEFT_OP:
16144 case RIGHT_OP:
16145 break;
16146 case '|':
16147 case '^':
16148 useSideType = 1;
16149 useDestType = 1;
16150 break;
16151 case '/':
16152 case '%':
16153 useSideType = 1;
16154 useDestType = 1;
16155 break;
16156 case '&':
16157 case '*':
16158 if(exp->__anon1.op.exp1)
16159 {
16160 useSideType = 1;
16161 useDestType = 1;
16162 }
16163 break;
16164 }
16165 if(exp->__anon1.op.op == '&')
16166 {
16167 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16168 {
16169 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16170 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16171
16172 if(symbol && symbol->isIterator == 2)
16173 {
16174 exp->type = 8;
16175 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16176 exp->__anon1.member.member = MkIdentifier("key");
16177 exp->expType = (((void *)0));
16178 exp->__anon1.op.exp2->expType = symbol->type;
16179 symbol->type->refCount++;
16180 ProcessExpressionType(exp);
16181 FreeType(dummy);
16182 break;
16183 }
16184 }
16185 }
16186 if(exp->__anon1.op.exp1)
16187 {
16188 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16189 useDestType = 0;
16190 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16191 {
16192 if(exp->__anon1.op.exp1->destType)
16193 FreeType(exp->__anon1.op.exp1->destType);
16194 exp->__anon1.op.exp1->destType = exp->destType;
16195 exp->__anon1.op.exp1->opDestType = 1;
16196 if(exp->destType)
16197 exp->destType->refCount++;
16198 }
16199 else if(!assign)
16200 {
16201 if(exp->__anon1.op.exp1->destType)
16202 FreeType(exp->__anon1.op.exp1->destType);
16203 exp->__anon1.op.exp1->destType = dummy;
16204 dummy->refCount++;
16205 }
16206 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16207 exp->__anon1.op.exp1->destType->count++;
16208 ProcessExpressionType(exp->__anon1.op.exp1);
16209 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16210 exp->__anon1.op.exp1->destType->count--;
16211 exp->__anon1.op.exp1->opDestType = 0;
16212 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)
16213 {
16214 exp->__anon1.op.exp2 = MkExpConstant("1");
16215 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16216 assign = 1;
16217 }
16218 if(exp->__anon1.op.exp1->destType == dummy)
16219 {
16220 FreeType(dummy);
16221 exp->__anon1.op.exp1->destType = (((void *)0));
16222 }
16223 if(exp->__anon1.op.exp2)
16224 {
16225 if(!assign && exp->__anon1.op.exp1->expType && (exp->__anon1.op.exp1->expType->kind == 1 || exp->__anon1.op.exp1->expType->kind == 2))
16226 {
16227 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);
16228
16229 FreeType(exp->__anon1.op.exp1->expType);
16230 exp->__anon1.op.exp1->expType = type;
16231 }
16232 }
16233 type1 = exp->__anon1.op.exp1->expType;
16234 }
16235 if(exp->__anon1.op.exp2)
16236 {
16237 char expString[10240];
16238
16239 expString[0] = '\0';
16240 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16241 {
16242 if(exp->__anon1.op.exp1)
16243 {
16244 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16245 if(exp->__anon1.op.exp1->expType)
16246 exp->__anon1.op.exp1->expType->refCount++;
16247 }
16248 else
16249 {
16250 exp->__anon1.op.exp2->destType = exp->destType;
16251 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16252 exp->__anon1.op.exp2->opDestType = 1;
16253 if(exp->destType)
16254 exp->destType->refCount++;
16255 }
16256 if(type1)
16257 type1->refCount++;
16258 exp->expType = type1;
16259 }
16260 else if(assign)
16261 {
16262 if(inCompiler)
16263 PrintExpression(exp->__anon1.op.exp2, expString);
16264 if(type1 && type1->kind == 13)
16265 {
16266 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)
16267 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16268 else if(exp->__anon1.op.op == '=')
16269 {
16270 if(exp->__anon1.op.exp2->destType)
16271 FreeType(exp->__anon1.op.exp2->destType);
16272 exp->__anon1.op.exp2->destType = type1;
16273 if(type1)
16274 type1->refCount++;
16275 }
16276 }
16277 else
16278 {
16279 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)
16280 ;
16281 else
16282 {
16283 if(exp->__anon1.op.exp2->destType)
16284 FreeType(exp->__anon1.op.exp2->destType);
16285 exp->__anon1.op.exp2->destType = type1;
16286 if(type1)
16287 type1->refCount++;
16288 }
16289 }
16290 if(type1)
16291 type1->refCount++;
16292 exp->expType = type1;
16293 }
16294 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16295 {
16296 if(exp->__anon1.op.exp2->destType)
16297 FreeType(exp->__anon1.op.exp2->destType);
16298 exp->__anon1.op.exp2->destType = exp->destType;
16299 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16300 exp->__anon1.op.exp2->opDestType = 1;
16301 if(exp->destType)
16302 exp->destType->refCount++;
16303 }
16304 else
16305 {
16306 if(exp->__anon1.op.exp2->destType)
16307 FreeType(exp->__anon1.op.exp2->destType);
16308 exp->__anon1.op.exp2->destType = dummy;
16309 dummy->refCount++;
16310 }
16311 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))
16312 {
16313 FreeType(exp->__anon1.op.exp2->destType);
16314 exp->__anon1.op.exp2->destType = type1;
16315 type1->refCount++;
16316 }
16317 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16318 exp->__anon1.op.exp2->destType->count++;
16319 if(exp->__anon1.op.op == SIZEOF)
16320 {
16321 struct Expression * e = exp->__anon1.op.exp2;
16322
16323 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16324 {
16325 if(e->type == 5 || e->type == 32 || e->type == 23)
16326 {
16327 if(e->type == 23)
16328 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16329 else
16330 e = (*e->__anon1.list).last;
16331 }
16332 }
16333 if(e->type == 11 && e->__anon1.cast.exp)
16334 e->__anon1.cast.exp->needCast = 1;
16335 }
16336 ProcessExpressionType(exp->__anon1.op.exp2);
16337 exp->__anon1.op.exp2->opDestType = 0;
16338 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16339 exp->__anon1.op.exp2->destType->count--;
16340 if(!assign && (exp->__anon1.op.exp1 || exp->__anon1.op.op == '~'))
16341 {
16342 if(exp->__anon1.op.exp2->expType && (exp->__anon1.op.exp2->expType->kind == 1 || exp->__anon1.op.exp2->expType->kind == 2))
16343 {
16344 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);
16345
16346 FreeType(exp->__anon1.op.exp2->expType);
16347 exp->__anon1.op.exp2->expType = type;
16348 }
16349 }
16350 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16351 {
16352 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)
16353 {
16354 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16355 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16356 }
16357 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)))
16358 {
16359 if(exp->__anon1.op.op == ADD_ASSIGN)
16360 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16361 }
16362 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))
16363 {
16364 if(exp->__anon1.op.op == ADD_ASSIGN)
16365 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16366 }
16367 else if(inCompiler)
16368 {
16369 char type1String[1024];
16370 char type2String[1024];
16371
16372 type1String[0] = '\0';
16373 type2String[0] = '\0';
16374 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16375 PrintType(type1, type2String, 0, 1);
16376 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16377 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16378 }
16379 }
16380 if(exp->__anon1.op.exp2->destType == dummy)
16381 {
16382 FreeType(dummy);
16383 exp->__anon1.op.exp2->destType = (((void *)0));
16384 }
16385 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16386 {
16387 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16388 type2->refCount = 1;
16389 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16390 type2->isSigned = 1;
16391 }
16392 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))
16393 {
16394 type2 = __extension__ ({
16395 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16396
16397 __ecereInstance1->kind = 3, __ecereInstance1;
16398 });
16399 type2->refCount = 1;
16400 type2->isSigned = 1;
16401 }
16402 else
16403 {
16404 type2 = exp->__anon1.op.exp2->expType;
16405 if(type2)
16406 type2->refCount++;
16407 }
16408 }
16409 dummy->kind = 0;
16410 if(exp->__anon1.op.op == SIZEOF)
16411 {
16412 exp->expType = __extension__ ({
16413 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16414
16415 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16416 });
16417 exp->isConstant = 1;
16418 }
16419 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16420 {
16421 exp->expType = Dereference(type2);
16422 if(type2 && type2->kind == 8)
16423 notByReference = 1;
16424 }
16425 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16426 exp->expType = Reference(type2);
16427 else if(exp->__anon1.op.op == LEFT_OP || exp->__anon1.op.op == RIGHT_OP)
16428 {
16429 if(exp->__anon1.op.exp1->expType)
16430 {
16431 exp->expType = exp->__anon1.op.exp1->expType;
16432 exp->expType->refCount++;
16433 }
16434 }
16435 else if(!assign)
16436 {
16437 if(boolOps)
16438 {
16439 if(exp->__anon1.op.exp1)
16440 {
16441 if(exp->__anon1.op.exp1->destType)
16442 FreeType(exp->__anon1.op.exp1->destType);
16443 exp->__anon1.op.exp1->destType = MkClassType("bool");
16444 exp->__anon1.op.exp1->destType->truth = 1;
16445 if(!exp->__anon1.op.exp1->expType)
16446 ProcessExpressionType(exp->__anon1.op.exp1);
16447 else
16448 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16449 FreeType(exp->__anon1.op.exp1->expType);
16450 exp->__anon1.op.exp1->expType = MkClassType("bool");
16451 exp->__anon1.op.exp1->expType->truth = 1;
16452 }
16453 if(exp->__anon1.op.exp2)
16454 {
16455 if(exp->__anon1.op.exp2->destType)
16456 FreeType(exp->__anon1.op.exp2->destType);
16457 exp->__anon1.op.exp2->destType = MkClassType("bool");
16458 exp->__anon1.op.exp2->destType->truth = 1;
16459 if(!exp->__anon1.op.exp2->expType)
16460 ProcessExpressionType(exp->__anon1.op.exp2);
16461 else
16462 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16463 FreeType(exp->__anon1.op.exp2->expType);
16464 exp->__anon1.op.exp2->expType = MkClassType("bool");
16465 exp->__anon1.op.exp2->expType->truth = 1;
16466 }
16467 }
16468 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")))))
16469 {
16470 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"))))
16471 {
16472 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)))
16473 {
16474 struct Type * intType;
16475
16476 if(!type1->__anon1._class->__anon1.registered->dataType)
16477 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16478 if(!type2->__anon1._class->__anon1.registered->dataType)
16479 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16480 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
16481 if(exp->__anon1.op.exp1->destType)
16482 FreeType(exp->__anon1.op.exp1->destType);
16483 if(exp->__anon1.op.exp2->destType)
16484 FreeType(exp->__anon1.op.exp2->destType);
16485 exp->__anon1.op.exp1->destType = intType;
16486 exp->__anon1.op.exp2->destType = intType;
16487 intType->refCount++;
16488 }
16489 else
16490 {
16491 if(exp->__anon1.op.exp2->destType)
16492 FreeType(exp->__anon1.op.exp2->destType);
16493 exp->__anon1.op.exp2->destType = type1;
16494 type1->refCount++;
16495 if(exp->__anon1.op.exp1->destType)
16496 FreeType(exp->__anon1.op.exp1->destType);
16497 exp->__anon1.op.exp1->destType = type2;
16498 type2->refCount++;
16499 }
16500 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)
16501 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);
16502 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16503 {
16504 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16505
16506 if(argExp)
16507 {
16508 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16509
16510 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16511 ProcessExpressionType(exp->__anon1.op.exp1);
16512 if(type2->kind != 13)
16513 {
16514 ProcessExpressionType(classExp);
16515 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16516 if(!exp->__anon1.op.exp2->expType)
16517 {
16518 if(type2)
16519 FreeType(type2);
16520 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16521 type2->refCount++;
16522 }
16523 ProcessExpressionType(exp->__anon1.op.exp2);
16524 }
16525 }
16526 }
16527 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)))
16528 {
16529 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16530 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16531 exp->expType = type1;
16532 if(type1)
16533 type1->refCount++;
16534 }
16535 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)))
16536 {
16537 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16538 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16539 exp->expType = type2;
16540 if(type2)
16541 type2->refCount++;
16542 }
16543 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))
16544 {
16545 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16546 }
16547 else
16548 {
16549 unsigned int success = 0;
16550
16551 if(type1->kind == 13 && type2->kind == 13)
16552 {
16553 if(exp->__anon1.op.op == '+')
16554 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16555 else if(exp->__anon1.op.op == '-')
16556 {
16557 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16558 {
16559 exp->expType = __extension__ ({
16560 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16561
16562 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16563 });
16564 success = 1;
16565 if(type1->__anon1.type->kind == 20)
16566 {
16567 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16568
16569 if(argExp)
16570 {
16571 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16572
16573 ProcessExpressionType(classExp);
16574 exp->type = 5;
16575 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"))));
16576 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16577 FreeType(dummy);
16578 return ;
16579 }
16580 }
16581 }
16582 }
16583 }
16584 if(!success && exp->__anon1.op.exp1->type == 2)
16585 {
16586 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16587 {
16588 if(exp->expType)
16589 FreeType(exp->expType);
16590 exp->expType = exp->__anon1.op.exp1->destType;
16591 if(exp->__anon1.op.exp1->destType)
16592 exp->__anon1.op.exp1->destType->refCount++;
16593 success = 1;
16594 }
16595 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16596 {
16597 if(exp->expType)
16598 FreeType(exp->expType);
16599 exp->expType = exp->__anon1.op.exp2->destType;
16600 if(exp->__anon1.op.exp2->destType)
16601 exp->__anon1.op.exp2->destType->refCount++;
16602 success = 1;
16603 }
16604 }
16605 else if(!success)
16606 {
16607 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16608 {
16609 if(exp->expType)
16610 FreeType(exp->expType);
16611 exp->expType = exp->__anon1.op.exp2->destType;
16612 if(exp->__anon1.op.exp2->destType)
16613 exp->__anon1.op.exp2->destType->refCount++;
16614 success = 1;
16615 }
16616 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16617 {
16618 if(exp->expType)
16619 FreeType(exp->expType);
16620 exp->expType = exp->__anon1.op.exp1->destType;
16621 if(exp->__anon1.op.exp1->destType)
16622 exp->__anon1.op.exp1->destType->refCount++;
16623 success = 1;
16624 }
16625 }
16626 if(!success)
16627 {
16628 char expString1[10240];
16629 char expString2[10240];
16630 char type1[1024];
16631 char type2[1024];
16632
16633 expString1[0] = '\0';
16634 expString2[0] = '\0';
16635 type1[0] = '\0';
16636 type2[0] = '\0';
16637 if(inCompiler)
16638 {
16639 PrintExpression(exp->__anon1.op.exp1, expString1);
16640 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16641 PrintExpression(exp->__anon1.op.exp2, expString2);
16642 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16643 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16644 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16645 }
16646 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16647 }
16648 }
16649 }
16650 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)
16651 {
16652 if(exp->__anon1.op.exp1->destType)
16653 FreeType(exp->__anon1.op.exp1->destType);
16654 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16655 if(type2->__anon1._class->__anon1.registered->dataType)
16656 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16657 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16658 exp->expType = type2;
16659 if(type2)
16660 type2->refCount++;
16661 }
16662 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)
16663 {
16664 if(exp->__anon1.op.exp2->destType)
16665 FreeType(exp->__anon1.op.exp2->destType);
16666 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16667 if(type1->__anon1._class->__anon1.registered->dataType)
16668 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16669 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16670 exp->expType = type1;
16671 if(type1)
16672 type1->refCount++;
16673 }
16674 else if(type1)
16675 {
16676 unsigned int valid = 0;
16677
16678 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
16679 {
16680 if(exp->__anon1.op.exp2->destType)
16681 FreeType(exp->__anon1.op.exp2->destType);
16682 if(!type1->__anon1._class->__anon1.registered->dataType)
16683 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16684 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16685 exp->__anon1.op.exp2->destType->refCount++;
16686 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16687 if(type2)
16688 FreeType(type2);
16689 type2 = exp->__anon1.op.exp2->destType;
16690 if(type2)
16691 type2->refCount++;
16692 exp->expType = type2;
16693 type2->refCount++;
16694 }
16695 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
16696 {
16697 if(exp->__anon1.op.exp1->destType)
16698 FreeType(exp->__anon1.op.exp1->destType);
16699 if(!type2->__anon1._class->__anon1.registered->dataType)
16700 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16701 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16702 exp->__anon1.op.exp1->destType->refCount++;
16703 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16704 type1 = exp->__anon1.op.exp1->destType;
16705 exp->expType = type1;
16706 type1->refCount++;
16707 }
16708 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
16709 {
16710 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
16711 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
16712
16713 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
16714 {
16715 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16716 {
16717 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16718 {
16719 if(exp->expType)
16720 FreeType(exp->expType);
16721 exp->expType = exp->__anon1.op.exp2->expType;
16722 if(exp->__anon1.op.exp2->expType)
16723 exp->__anon1.op.exp2->expType->refCount++;
16724 valid = 1;
16725 }
16726 }
16727 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16728 {
16729 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16730 {
16731 if(exp->expType)
16732 FreeType(exp->expType);
16733 exp->expType = exp->__anon1.op.exp1->expType;
16734 if(exp->__anon1.op.exp1->expType)
16735 exp->__anon1.op.exp1->expType->refCount++;
16736 valid = 1;
16737 }
16738 }
16739 }
16740 else
16741 {
16742 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16743 {
16744 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16745 {
16746 if(exp->expType)
16747 FreeType(exp->expType);
16748 exp->expType = exp->__anon1.op.exp1->expType;
16749 if(exp->__anon1.op.exp1->expType)
16750 exp->__anon1.op.exp1->expType->refCount++;
16751 valid = 1;
16752 }
16753 }
16754 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16755 {
16756 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16757 {
16758 if(exp->expType)
16759 FreeType(exp->expType);
16760 exp->expType = exp->__anon1.op.exp2->expType;
16761 if(exp->__anon1.op.exp2->expType)
16762 exp->__anon1.op.exp2->expType->refCount++;
16763 valid = 1;
16764 }
16765 }
16766 }
16767 }
16768 if(!valid)
16769 {
16770 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))
16771 {
16772 if(exp->__anon1.op.exp1->destType)
16773 FreeType(exp->__anon1.op.exp1->destType);
16774 exp->__anon1.op.exp1->destType = type2;
16775 type2->refCount++;
16776 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16777 {
16778 if(exp->expType)
16779 FreeType(exp->expType);
16780 exp->expType = exp->__anon1.op.exp1->destType;
16781 if(exp->__anon1.op.exp1->destType)
16782 exp->__anon1.op.exp1->destType->refCount++;
16783 }
16784 }
16785 else
16786 {
16787 if(exp->__anon1.op.exp2->destType)
16788 FreeType(exp->__anon1.op.exp2->destType);
16789 exp->__anon1.op.exp2->destType = type1;
16790 type1->refCount++;
16791 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16792 {
16793 if(exp->expType)
16794 FreeType(exp->expType);
16795 exp->expType = exp->__anon1.op.exp2->destType;
16796 if(exp->__anon1.op.exp2->destType)
16797 exp->__anon1.op.exp2->destType->refCount++;
16798 }
16799 else if(type1 && type2)
16800 {
16801 char expString1[10240];
16802 char expString2[10240];
16803 char type1String[1024];
16804 char type2String[1024];
16805
16806 expString1[0] = '\0';
16807 expString2[0] = '\0';
16808 type1String[0] = '\0';
16809 type2String[0] = '\0';
16810 if(inCompiler)
16811 {
16812 PrintExpression(exp->__anon1.op.exp1, expString1);
16813 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16814 PrintExpression(exp->__anon1.op.exp2, expString2);
16815 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16816 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
16817 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
16818 }
16819 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
16820 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
16821 {
16822 exp->expType = exp->__anon1.op.exp1->expType;
16823 if(exp->__anon1.op.exp1->expType)
16824 exp->__anon1.op.exp1->expType->refCount++;
16825 }
16826 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16827 {
16828 exp->expType = exp->__anon1.op.exp2->expType;
16829 if(exp->__anon1.op.exp2->expType)
16830 exp->__anon1.op.exp2->expType->refCount++;
16831 }
16832 }
16833 }
16834 }
16835 }
16836 else if(type2)
16837 {
16838 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16839 {
16840 struct Type * oldType = exp->__anon1.op.exp1->expType;
16841
16842 exp->__anon1.op.exp1->expType = (((void *)0));
16843 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16844 FreeType(oldType);
16845 else
16846 exp->__anon1.op.exp1->expType = oldType;
16847 }
16848 if(exp->__anon1.op.exp1->destType)
16849 FreeType(exp->__anon1.op.exp1->destType);
16850 exp->__anon1.op.exp1->destType = type2;
16851 type2->refCount++;
16852 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16853 {
16854 if(exp->expType)
16855 FreeType(exp->expType);
16856 exp->expType = exp->__anon1.op.exp1->destType;
16857 if(exp->__anon1.op.exp1->destType)
16858 exp->__anon1.op.exp1->destType->refCount++;
16859 }
16860 }
16861 }
16862 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
16863 {
16864 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16865 {
16866 if(exp->__anon1.op.exp1->destType)
16867 FreeType(exp->__anon1.op.exp1->destType);
16868 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16869 if(type2->__anon1._class->__anon1.registered->dataType)
16870 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16871 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16872 }
16873 if(exp->__anon1.op.op == '!')
16874 {
16875 exp->expType = MkClassType("bool");
16876 exp->expType->truth = 1;
16877 }
16878 else
16879 {
16880 exp->expType = type2;
16881 if(type2)
16882 type2->refCount++;
16883 }
16884 }
16885 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
16886 {
16887 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16888 {
16889 if(exp->__anon1.op.exp2->destType)
16890 FreeType(exp->__anon1.op.exp2->destType);
16891 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16892 if(type1->__anon1._class->__anon1.registered->dataType)
16893 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16894 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16895 }
16896 exp->expType = type1;
16897 if(type1)
16898 type1->refCount++;
16899 }
16900 }
16901 yylloc = exp->loc;
16902 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
16903 {
16904 char expString[10000];
16905
16906 expString[0] = '\0';
16907 if(inCompiler)
16908 {
16909 PrintExpression(exp->__anon1.op.exp1, expString);
16910 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16911 }
16912 if(expString[0])
16913 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16914 }
16915 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
16916 {
16917 char expString[10240];
16918
16919 expString[0] = '\0';
16920 if(inCompiler)
16921 {
16922 PrintExpression(exp->__anon1.op.exp2, expString);
16923 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16924 }
16925 if(expString[0])
16926 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16927 }
16928 if(boolResult)
16929 {
16930 FreeType(exp->expType);
16931 exp->expType = MkClassType("bool");
16932 exp->expType->truth = 1;
16933 }
16934 if(exp->__anon1.op.op != SIZEOF)
16935 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
16936 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
16937 {
16938 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
16939 }
16940 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
16941 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
16942 yylloc = oldyylloc;
16943 FreeType(dummy);
16944 if(type2)
16945 FreeType(type2);
16946 break;
16947 }
16948 case 5:
16949 case 32:
16950 {
16951 struct Expression * e;
16952
16953 exp->isConstant = 1;
16954 for(e = (*exp->__anon1.list).first; e; e = e->next)
16955 {
16956 if(!e->next)
16957 {
16958 FreeType(e->destType);
16959 e->opDestType = exp->opDestType;
16960 e->destType = exp->destType;
16961 if(e->destType)
16962 {
16963 exp->destType->refCount++;
16964 }
16965 }
16966 ProcessExpressionType(e);
16967 if(!exp->expType && !e->next)
16968 {
16969 exp->expType = e->expType;
16970 if(e->expType)
16971 e->expType->refCount++;
16972 }
16973 if(!e->isConstant)
16974 exp->isConstant = 0;
16975 }
16976 e = (*exp->__anon1.list).first;
16977 if(!e->next && e->type == 8)
16978 {
16979 struct Expression * next = exp->next, * prev = exp->prev;
16980
16981 FreeType(exp->expType);
16982 FreeType(exp->destType);
16983 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16984 *exp = *e;
16985 exp->prev = prev;
16986 exp->next = next;
16987 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
16988 ProcessExpressionType(exp);
16989 }
16990 break;
16991 }
16992 case 6:
16993 {
16994 struct Expression * e;
16995
16996 exp->isConstant = 1;
16997 ProcessExpressionType(exp->__anon1.index.exp);
16998 if(!exp->__anon1.index.exp->isConstant)
16999 exp->isConstant = 0;
17000 if(exp->__anon1.index.exp->expType)
17001 {
17002 struct Type * source = exp->__anon1.index.exp->expType;
17003
17004 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
17005 {
17006 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
17007 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
17008
17009 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
17010 {
17011 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
17012 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
17013 {
17014 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
17015
17016 if(type->kind == 8)
17017 type->constant = 1;
17018 else if(type->kind == 13)
17019 {
17020 struct Type * t = type;
17021
17022 while(t->kind == 13)
17023 t = t->__anon1.type;
17024 t->constant = 1;
17025 }
17026 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
17027 }
17028 }
17029 }
17030 }
17031 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
17032 {
17033 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
17034 {
17035 if(e->destType)
17036 FreeType(e->destType);
17037 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
17038 }
17039 ProcessExpressionType(e);
17040 if(!e->next)
17041 {
17042 }
17043 if(!e->isConstant)
17044 exp->isConstant = 0;
17045 }
17046 if(!exp->expType)
17047 exp->expType = Dereference(exp->__anon1.index.exp->expType);
17048 if(exp->expType)
17049 DeclareType(curExternal, exp->expType, 1, 0);
17050 break;
17051 }
17052 case 7:
17053 {
17054 struct Expression * e;
17055 struct Type * functionType;
17056 struct Type * methodType = (((void *)0));
17057 char name[1024];
17058
17059 name[0] = '\0';
17060 if(inCompiler)
17061 {
17062 PrintExpression(exp->__anon1.call.exp, name);
17063 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17064 {
17065 PrintExpression(exp->__anon1.call.exp, name);
17066 }
17067 }
17068 if(exp->__anon1.call.exp->type == 0)
17069 {
17070 struct Expression * idExp = exp->__anon1.call.exp;
17071 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17072
17073 if(!strcmp(id->string, "__builtin_frame_address"))
17074 {
17075 exp->expType = ProcessTypeString("void *", 1);
17076 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17077 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17078 break;
17079 }
17080 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17081 {
17082 exp->expType = ProcessTypeString("int", 1);
17083 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17084 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17085 break;
17086 }
17087 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17088 {
17089 struct Expression * a = (((void *)0));
17090 struct Expression * b = (((void *)0));
17091 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17092
17093 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17094 {
17095 a = (*exp->__anon1.call.arguments).first;
17096 b = (*exp->__anon1.call.arguments).last;
17097 tempExp1 = a;
17098 tempExp2 = b;
17099 }
17100 else if((*exp->__anon1.call.arguments).count == 1)
17101 {
17102 a = (*exp->__anon1.call.arguments).first;
17103 tempExp1 = a;
17104 }
17105 if(a)
17106 {
17107 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17108 idExp->__anon1.__anon1.identifier = (((void *)0));
17109 FreeExpContents(exp);
17110 ProcessExpressionType(a);
17111 if(b)
17112 ProcessExpressionType(b);
17113 exp->type = 5;
17114 exp->__anon1.list = MkList();
17115 if(a->expType && (!b || b->expType))
17116 {
17117 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17118 {
17119 if(inCompiler)
17120 {
17121 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17122 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17123 struct Declaration * decl;
17124 char temp1[1024], temp2[1024];
17125
17126 GetTypeSpecs(a->expType, specs);
17127 if(a && !a->isConstant && a->type != 0)
17128 {
17129 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17130 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17131 tempExp1 = QMkExpId(temp1);
17132 tempExp1->expType = a->expType;
17133 if(a->expType)
17134 a->expType->refCount++;
17135 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17136 }
17137 if(b && !b->isConstant && b->type != 0)
17138 {
17139 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17140 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17141 tempExp2 = QMkExpId(temp2);
17142 tempExp2->expType = b->expType;
17143 if(b->expType)
17144 b->expType->refCount++;
17145 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17146 }
17147 decl = MkDeclaration(specs, decls);
17148 if(!curCompound->__anon1.compound.declarations)
17149 curCompound->__anon1.compound.declarations = MkList();
17150 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17151 }
17152 }
17153 }
17154 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17155 {
17156 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17157
17158 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17159 exp->expType = a->expType;
17160 if(a->expType)
17161 a->expType->refCount++;
17162 }
17163 else if(!strcmp(id->string, "Abs"))
17164 {
17165 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17166 exp->expType = a->expType;
17167 if(a->expType)
17168 a->expType->refCount++;
17169 }
17170 else if(!strcmp(id->string, "Sgn"))
17171 {
17172 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"))))));
17173 exp->expType = ProcessTypeString("int", 0);
17174 }
17175 FreeExpression(tempExp1);
17176 if(tempExp2)
17177 FreeExpression(tempExp2);
17178 FreeIdentifier(id);
17179 break;
17180 }
17181 }
17182 }
17183 {
17184 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17185
17186 if(!exp->__anon1.call.exp->destType)
17187 {
17188 exp->__anon1.call.exp->destType = dummy;
17189 dummy->refCount++;
17190 }
17191 ProcessExpressionType(exp->__anon1.call.exp);
17192 if(exp->__anon1.call.exp->destType == dummy)
17193 {
17194 FreeType(dummy);
17195 exp->__anon1.call.exp->destType = (((void *)0));
17196 }
17197 FreeType(dummy);
17198 }
17199 functionType = exp->__anon1.call.exp->expType;
17200 if(functionType && functionType->kind == 16)
17201 {
17202 methodType = functionType;
17203 functionType = methodType->__anon1.__anon3.method->dataType;
17204 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17205 {
17206 char typeString[1024];
17207
17208 typeString[0] = '\0';
17209 {
17210 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17211
17212 functionType->__anon1.__anon2.thisClass = (((void *)0));
17213 PrintType(functionType, typeString, 1, 1);
17214 functionType->__anon1.__anon2.thisClass = back;
17215 }
17216 if(strstr(typeString, "thisclass"))
17217 {
17218 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17219 struct Declarator * decl;
17220
17221 {
17222 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17223
17224 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17225 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))
17226 thisClassParams = 0;
17227 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17228 {
17229 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17230
17231 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17232 ProcessDeclarator(decl, 1);
17233 thisClass = backupThisClass;
17234 }
17235 thisClassParams = 1;
17236 functionType = ProcessType(specs, decl);
17237 functionType->refCount = 0;
17238 FinishTemplatesContext(context);
17239 {
17240 struct Type * p, * op;
17241
17242 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)
17243 {
17244 if(op->kind == 21)
17245 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17246 }
17247 }
17248 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17249 {
17250 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17251 }
17252 }
17253 FreeList(specs, (void *)(FreeSpecifier));
17254 FreeDeclarator(decl);
17255 }
17256 }
17257 }
17258 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17259 {
17260 struct Type * type = functionType->__anon1.type;
17261
17262 if(!functionType->refCount)
17263 {
17264 functionType->__anon1.type = (((void *)0));
17265 FreeType(functionType);
17266 }
17267 functionType = type;
17268 }
17269 if(functionType && functionType->kind != 11)
17270 {
17271 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17272 }
17273 else if(functionType)
17274 {
17275 unsigned int emptyParams = 0, noParams = 0;
17276 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17277 struct Type * type = functionType->__anon1.__anon2.params.first;
17278 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17279 int extra = 0;
17280 struct Location oldyylloc = yylloc;
17281
17282 if(!type)
17283 emptyParams = 1;
17284 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17285 {
17286 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17287 e = e->next;
17288 }
17289 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17290 {
17291 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)
17292 {
17293 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17294 if(e)
17295 {
17296 e->destType = type;
17297 e = e->next;
17298 type = functionType->__anon1.__anon2.params.first;
17299 }
17300 else
17301 type->refCount = 0;
17302 }
17303 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17304 {
17305 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17306 type->byReference = functionType->byReference;
17307 type->typedByReference = functionType->typedByReference;
17308 if(e)
17309 {
17310 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17311 e = e->next;
17312 e->destType = type;
17313 e = e->next;
17314 type = functionType->__anon1.__anon2.params.first;
17315 }
17316 else
17317 type->refCount = 0;
17318 }
17319 }
17320 if(type && type->kind == 0)
17321 {
17322 noParams = 1;
17323 if(!type->refCount)
17324 FreeType(type);
17325 type = (((void *)0));
17326 }
17327 for(; e; e = e->next)
17328 {
17329 if(!type && !emptyParams)
17330 {
17331 yylloc = e->loc;
17332 if(methodType && methodType->__anon1.__anon3.methodClass)
17333 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);
17334 else
17335 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);
17336 break;
17337 }
17338 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17339 {
17340 struct Type * templatedType = (((void *)0));
17341 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17342 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17343 int id = 0;
17344
17345 if(_class && _class->templateArgs)
17346 {
17347 struct __ecereNameSpace__ecere__com__Class * sClass;
17348
17349 for(sClass = _class; sClass; sClass = sClass->base)
17350 {
17351 if(sClass->templateClass)
17352 sClass = sClass->templateClass;
17353 id = 0;
17354 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17355 {
17356 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17357 {
17358 struct __ecereNameSpace__ecere__com__Class * nextClass;
17359
17360 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17361 {
17362 if(nextClass->templateClass)
17363 nextClass = nextClass->templateClass;
17364 id += nextClass->templateParams.count;
17365 }
17366 break;
17367 }
17368 id++;
17369 }
17370 if(curParam)
17371 break;
17372 }
17373 }
17374 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17375 {
17376 unsigned int constant = type->constant;
17377 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17378
17379 {
17380 struct Context * context = SetupTemplatesContext(_class);
17381
17382 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17383 FinishTemplatesContext(context);
17384 }
17385 if(templatedType->kind == 8 && constant)
17386 templatedType->constant = 1;
17387 else if(templatedType->kind == 13)
17388 {
17389 struct Type * t = templatedType->__anon1.type;
17390
17391 while(t->kind == 13)
17392 t = t->__anon1.type;
17393 if(constant)
17394 t->constant = constant;
17395 }
17396 e->destType = templatedType;
17397 if(templatedType)
17398 {
17399 templatedType->passAsTemplate = 1;
17400 }
17401 }
17402 else
17403 {
17404 e->destType = type;
17405 if(type)
17406 type->refCount++;
17407 }
17408 }
17409 else
17410 {
17411 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17412 {
17413 e->destType = type->prev;
17414 e->destType->refCount++;
17415 }
17416 else
17417 {
17418 e->destType = type;
17419 if(type)
17420 type->refCount++;
17421 }
17422 }
17423 if(type && type->kind != 14)
17424 {
17425 struct Type * next = type->next;
17426
17427 if(!type->refCount)
17428 FreeType(type);
17429 type = next;
17430 }
17431 }
17432 if(type && type->kind != 14)
17433 {
17434 if(methodType && methodType->__anon1.__anon3.methodClass)
17435 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);
17436 else
17437 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);
17438 }
17439 yylloc = oldyylloc;
17440 if(type && !type->refCount)
17441 FreeType(type);
17442 }
17443 else
17444 {
17445 functionType = __extension__ ({
17446 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17447
17448 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17449 });
17450 if(exp->__anon1.call.exp->type == 0)
17451 {
17452 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17453
17454 if(inCompiler)
17455 {
17456 struct Symbol * symbol;
17457 struct Location oldyylloc = yylloc;
17458
17459 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17460 if(strstr(string, "__builtin_") == string)
17461 {
17462 if(exp->destType)
17463 {
17464 functionType->__anon1.__anon2.returnType = exp->destType;
17465 exp->destType->refCount++;
17466 }
17467 }
17468 else
17469 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17470 symbol = __extension__ ({
17471 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17472
17473 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17474 });
17475 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17476 if(strstr(symbol->string, "::"))
17477 globalContext->hasNameSpace = 1;
17478 yylloc = oldyylloc;
17479 }
17480 }
17481 else if(exp->__anon1.call.exp->type == 8)
17482 {
17483 }
17484 else
17485 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17486 if(!functionType->__anon1.__anon2.returnType)
17487 {
17488 functionType->__anon1.__anon2.returnType = __extension__ ({
17489 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17490
17491 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17492 });
17493 }
17494 }
17495 if(functionType && functionType->kind == 11)
17496 {
17497 exp->expType = functionType->__anon1.__anon2.returnType;
17498 if(functionType->__anon1.__anon2.returnType)
17499 functionType->__anon1.__anon2.returnType->refCount++;
17500 if(!functionType->refCount)
17501 FreeType(functionType);
17502 }
17503 if(exp->__anon1.call.arguments)
17504 {
17505 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17506 ProcessExpressionType(e);
17507 }
17508 break;
17509 }
17510 case 8:
17511 {
17512 struct Type * type;
17513 struct Location oldyylloc = yylloc;
17514 unsigned int thisPtr;
17515 struct Expression * checkExp = exp->__anon1.member.exp;
17516
17517 while(checkExp)
17518 {
17519 if(checkExp->type == 11)
17520 checkExp = checkExp->__anon1.cast.exp;
17521 else if(checkExp->type == 5)
17522 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17523 else
17524 break;
17525 }
17526 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17527 exp->thisPtr = thisPtr;
17528 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17529 {
17530 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17531 }
17532 ProcessExpressionType(exp->__anon1.member.exp);
17533 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)
17534 {
17535 exp->isConstant = 0;
17536 }
17537 else
17538 exp->isConstant = exp->__anon1.member.exp->isConstant;
17539 type = exp->__anon1.member.exp->expType;
17540 yylloc = exp->loc;
17541 if(type && (type->kind == 20))
17542 {
17543 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17544 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17545
17546 if(_class)
17547 {
17548 for(param = _class->templateParams.first; param; param = param->next)
17549 {
17550 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17551 break;
17552 }
17553 }
17554 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17555 {
17556 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17557
17558 if(argExp)
17559 {
17560 struct Expression * expMember = exp->__anon1.member.exp;
17561 struct Declarator * decl;
17562 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17563 char thisClassTypeString[1024];
17564
17565 FreeIdentifier(exp->__anon1.member.member);
17566 ProcessExpressionType(argExp);
17567 {
17568 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17569
17570 if(colon)
17571 {
17572 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17573 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17574 }
17575 else
17576 strcpy(thisClassTypeString, _class->fullName);
17577 }
17578 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17579 exp->expType = ProcessType(specs, decl);
17580 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17581 {
17582 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17583 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17584 int paramCount = 0;
17585 int lastParam = -1;
17586 char templateString[1024];
17587 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17588
17589 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17590 for(cClass = expClass; cClass; cClass = cClass->base)
17591 {
17592 int p = 0;
17593
17594 for(param = cClass->templateParams.first; param; param = param->next)
17595 {
17596 int id = p;
17597 struct __ecereNameSpace__ecere__com__Class * sClass;
17598 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17599
17600 for(sClass = cClass->base; sClass; sClass = sClass->base)
17601 id += sClass->templateParams.count;
17602 arg = expClass->templateArgs[id];
17603 for(sClass = _class; sClass; sClass = sClass->base)
17604 {
17605 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17606 int p = 0;
17607 struct __ecereNameSpace__ecere__com__Class * nextClass;
17608
17609 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17610 p += nextClass->templateParams.count;
17611 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17612 {
17613 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17614 {
17615 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17616 {
17617 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17618 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17619 break;
17620 }
17621 }
17622 }
17623 }
17624 {
17625 char argument[256];
17626
17627 argument[0] = '\0';
17628 switch(param->type)
17629 {
17630 case 2:
17631 {
17632 char expString[1024];
17633 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17634 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17635 struct Expression * exp;
17636 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17637
17638 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17639 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17640 ProcessExpressionType(exp);
17641 ComputeExpression(exp);
17642 expString[0] = '\0';
17643 PrintExpression(exp, expString);
17644 strcat(argument, expString);
17645 FreeExpression(exp);
17646 break;
17647 }
17648 case 1:
17649 {
17650 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17651 break;
17652 }
17653 case 0:
17654 {
17655 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17656 {
17657 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17658 strcat(argument, thisClassTypeString);
17659 else
17660 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17661 }
17662 break;
17663 }
17664 }
17665 if(argument[0])
17666 {
17667 if(paramCount)
17668 strcat(templateString, ", ");
17669 if(lastParam != p - 1)
17670 {
17671 strcat(templateString, param->name);
17672 strcat(templateString, " = ");
17673 }
17674 strcat(templateString, argument);
17675 paramCount++;
17676 lastParam = p;
17677 }
17678 p++;
17679 }
17680 }
17681 }
17682 {
17683 int len = strlen(templateString);
17684
17685 if(templateString[len - 1] == '>')
17686 templateString[len++] = ' ';
17687 templateString[len++] = '>';
17688 templateString[len++] = '\0';
17689 }
17690 {
17691 struct Context * context = SetupTemplatesContext(_class);
17692
17693 FreeType(exp->expType);
17694 exp->expType = ProcessTypeString(templateString, 0);
17695 FinishTemplatesContext(context);
17696 }
17697 }
17698 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
17699 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
17700 exp->type = 5;
17701 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")))))))));
17702 }
17703 }
17704 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
17705 {
17706 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
17707 }
17708 }
17709 if(type && (type->kind == 20))
17710 ;
17711 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)))
17712 {
17713 struct Identifier * id = exp->__anon1.member.member;
17714 int typeKind = type->kind;
17715 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));
17716
17717 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
17718 {
17719 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
17720 typeKind = 8;
17721 }
17722 if(id)
17723 {
17724 if(typeKind == 3 || typeKind == 15)
17725 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
17726 else if(!_class)
17727 {
17728 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17729 {
17730 _class = type->__anon1._class->__anon1.registered;
17731 }
17732 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
17733 {
17734 _class = FindClass("char *")->__anon1.registered;
17735 }
17736 else if(type->kind == 13)
17737 {
17738 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
17739 FreeType(exp->expType);
17740 exp->expType = ProcessTypeString("uintptr", 0);
17741 exp->byReference = 1;
17742 }
17743 else
17744 {
17745 char string[1024] = "";
17746 struct Symbol * classSym;
17747
17748 PrintTypeNoConst(type, string, 0, 1);
17749 classSym = FindClass(string);
17750 if(classSym)
17751 _class = classSym->__anon1.registered;
17752 }
17753 }
17754 }
17755 if(_class && id)
17756 {
17757 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
17758 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
17759 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17760 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
17761 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
17762
17763 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
17764 exp->__anon1.member.memberType = 1;
17765 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
17766 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
17767 if(typeKind != 19)
17768 {
17769 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
17770 {
17771 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17772 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
17773 {
17774 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17775 if(prop)
17776 member = (((void *)0));
17777 }
17778 if(!member && !prop)
17779 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17780 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
17781 exp->__anon1.member.thisPtr = 1;
17782 }
17783 else
17784 {
17785 unsigned int useMemberForNonConst = 0;
17786
17787 if(!id->classSym)
17788 {
17789 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
17790 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);
17791 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17792 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
17793 }
17794 if((!prop || useMemberForNonConst) && !member)
17795 {
17796 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
17797 if(!method)
17798 {
17799 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17800 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);
17801 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17802 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17803 }
17804 }
17805 if(member && prop)
17806 {
17807 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
17808 prop = (((void *)0));
17809 else
17810 member = (((void *)0));
17811 }
17812 }
17813 }
17814 if(!prop && !member && !method)
17815 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
17816 if(!prop && !member && !method)
17817 {
17818 if(typeKind == 19)
17819 {
17820 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
17821 if(classProp)
17822 {
17823 exp->__anon1.member.memberType = 5;
17824 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
17825 }
17826 else
17827 {
17828 char structName[1024];
17829 struct Identifier * id = exp->__anon1.member.member;
17830 struct Expression * classExp = exp->__anon1.member.exp;
17831
17832 type->refCount++;
17833 FreeType(classExp->expType);
17834 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
17835 strcpy(structName, "__ecereClassData_");
17836 FullClassNameCat(structName, type->__anon1._class->string, 0);
17837 exp->type = 9;
17838 exp->__anon1.member.member = id;
17839 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"))))))));
17840 FreeType(type);
17841 ProcessExpressionType(exp);
17842 return ;
17843 }
17844 }
17845 else
17846 {
17847 struct Symbol * classSym = FindClass(id->string);
17848
17849 if(classSym)
17850 {
17851 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
17852
17853 if(convertClass)
17854 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
17855 }
17856 }
17857 }
17858 if(exp->__anon1.member.exp->destType)
17859 FreeType(exp->__anon1.member.exp->destType);
17860 {
17861 if(method && !method->_class->symbol)
17862 method->_class->symbol = FindClass(method->_class->fullName);
17863 if(prop && !prop->_class->symbol)
17864 prop->_class->symbol = FindClass(prop->_class->fullName);
17865 exp->__anon1.member.exp->destType = __extension__ ({
17866 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17867
17868 __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;
17869 });
17870 }
17871 if(prop)
17872 {
17873 exp->__anon1.member.memberType = 1;
17874 if(!prop->dataType)
17875 ProcessPropertyType(prop);
17876 exp->expType = prop->dataType;
17877 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
17878 {
17879 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17880
17881 CopyTypeInto(type, exp->expType);
17882 type->refCount = 1;
17883 type->constant = 1;
17884 exp->expType = type;
17885 }
17886 else if(prop->dataType)
17887 prop->dataType->refCount++;
17888 }
17889 else if(member)
17890 {
17891 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17892 {
17893 FreeExpContents(exp);
17894 exp->type = 0;
17895 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17896 ProcessExpressionType(exp);
17897 return ;
17898 }
17899 exp->__anon1.member.memberType = 3;
17900 DeclareStruct(curExternal, _class->fullName, 0, 1);
17901 if(member->_class != _class)
17902 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
17903 if(!member->dataType)
17904 {
17905 struct Context * context = SetupTemplatesContext(_class);
17906
17907 member->dataType = ProcessTypeString(member->dataTypeString, 0);
17908 FinishTemplatesContext(context);
17909 }
17910 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)
17911 member->dataType->bitMemberSize = ((struct __ecereNameSpace__ecere__com__BitMember *)member)->size;
17912 exp->expType = member->dataType;
17913 if(member->dataType)
17914 member->dataType->refCount++;
17915 }
17916 else if(revConvert)
17917 {
17918 exp->__anon1.member.memberType = 4;
17919 exp->expType = MkClassType(revConvert->_class->fullName);
17920 }
17921 else if(method)
17922 {
17923 {
17924 exp->__anon1.member.memberType = 2;
17925 }
17926 if(!method->dataType)
17927 ProcessMethodType(method);
17928 exp->expType = __extension__ ({
17929 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17930
17931 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
17932 });
17933 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
17934 exp->expType->__anon1.__anon3.usedClass = _class;
17935 }
17936 else if(!classProp)
17937 {
17938 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17939 {
17940 FreeExpContents(exp);
17941 exp->type = 0;
17942 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17943 FreeType(exp->expType);
17944 exp->expType = MkClassType("ecere::com::Class");
17945 return ;
17946 }
17947 yylloc = exp->__anon1.member.member->loc;
17948 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
17949 if(inCompiler)
17950 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
17951 }
17952 if(_class && exp->expType)
17953 {
17954 struct __ecereNameSpace__ecere__com__Class * tClass;
17955
17956 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
17957 while(tClass && !tClass->templateClass)
17958 tClass = tClass->base;
17959 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
17960 {
17961 int id = 0;
17962 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17963 struct __ecereNameSpace__ecere__com__Class * sClass;
17964
17965 for(sClass = tClass; sClass; sClass = sClass->base)
17966 {
17967 id = 0;
17968 if(sClass->templateClass)
17969 sClass = sClass->templateClass;
17970 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17971 {
17972 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
17973 {
17974 for(sClass = sClass->base; sClass; sClass = sClass->base)
17975 id += sClass->templateParams.count;
17976 break;
17977 }
17978 id++;
17979 }
17980 if(curParam)
17981 break;
17982 }
17983 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
17984 {
17985 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
17986 struct Context * context = SetupTemplatesContext(tClass);
17987 unsigned int constant = exp->expType->constant;
17988 unsigned int passAsTemplate = 0;
17989 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
17990 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
17991
17992 if(t && t->kind == 8 && t->__anon1._class)
17993 thisClassFrom = t->__anon1._class->__anon1.registered;
17994 else
17995 thisClassFrom = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "class");
17996 FreeType(t);
17997 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
17998 FreeType(exp->expType);
17999 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18000 exp->expType->thisClassFrom = thisClassFrom;
18001 if(exp->expType->kind == 8 && constant)
18002 exp->expType->constant = 1;
18003 else if(exp->expType->kind == 13)
18004 {
18005 struct Type * t = exp->expType->__anon1.type;
18006
18007 while(t->kind == 13)
18008 t = t->__anon1.type;
18009 if(constant)
18010 t->constant = constant;
18011 }
18012 if(exp->expType)
18013 {
18014 if(exp->expType->kind == 21)
18015 {
18016 FreeType(exp->expType);
18017 exp->expType = ReplaceThisClassType(_class);
18018 }
18019 if(passAsTemplate)
18020 exp->expType->passAsTemplate = 1;
18021 if(!exp->destType)
18022 {
18023 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18024 if(exp->destType->kind == 8 && constant)
18025 exp->destType->constant = 1;
18026 else if(exp->destType->kind == 13)
18027 {
18028 struct Type * t = exp->destType->__anon1.type;
18029
18030 while(t->kind == 13)
18031 t = t->__anon1.type;
18032 if(constant)
18033 t->constant = constant;
18034 }
18035 if(exp->destType->kind == 21)
18036 {
18037 FreeType(exp->destType);
18038 exp->destType = ReplaceThisClassType(_class);
18039 }
18040 }
18041 }
18042 FinishTemplatesContext(context);
18043 }
18044 }
18045 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)
18046 {
18047 int id = 0;
18048 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
18049 struct __ecereNameSpace__ecere__com__Class * sClass;
18050
18051 for(sClass = tClass; sClass; sClass = sClass->base)
18052 {
18053 id = 0;
18054 if(sClass->templateClass)
18055 sClass = sClass->templateClass;
18056 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18057 {
18058 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
18059 {
18060 for(sClass = sClass->base; sClass; sClass = sClass->base)
18061 id += sClass->templateParams.count;
18062 break;
18063 }
18064 id++;
18065 }
18066 if(curParam)
18067 break;
18068 }
18069 if(curParam)
18070 {
18071 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18072 struct Context * context = SetupTemplatesContext(tClass);
18073 struct Type * basicType;
18074
18075 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18076 if(basicType)
18077 {
18078 if(basicType->kind == 21)
18079 {
18080 FreeType(basicType);
18081 basicType = ReplaceThisClassType(_class);
18082 }
18083 FreeType(exp->expType);
18084 exp->expType = __extension__ ({
18085 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18086
18087 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18088 });
18089 if(!exp->destType)
18090 {
18091 exp->destType = exp->expType;
18092 exp->destType->refCount++;
18093 }
18094 {
18095 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18096 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18097 struct Declarator * decl;
18098
18099 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18100 *newExp = *exp;
18101 if(exp->destType)
18102 exp->destType->refCount++;
18103 if(exp->expType)
18104 exp->expType->refCount++;
18105 exp->type = 11;
18106 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18107 exp->__anon1.cast.exp = newExp;
18108 }
18109 }
18110 FinishTemplatesContext(context);
18111 }
18112 }
18113 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18114 {
18115 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18116
18117 if(expClass)
18118 {
18119 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18120 int p = 0;
18121 int paramCount = 0;
18122 int lastParam = -1;
18123 char templateString[1024];
18124 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18125
18126 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18127 while(cClass != expClass)
18128 {
18129 struct __ecereNameSpace__ecere__com__Class * sClass;
18130
18131 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18132 ;
18133 cClass = sClass;
18134 for(param = cClass->templateParams.first; param; param = param->next)
18135 {
18136 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18137 int cp = 0;
18138 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18139 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18140
18141 while(cClassCur != tClass && !paramCur)
18142 {
18143 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18144
18145 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18146 ;
18147 cClassCur = sClassCur;
18148 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18149 {
18150 if(!strcmp(paramCur->name, param->name))
18151 {
18152 break;
18153 }
18154 cp++;
18155 }
18156 }
18157 if(paramCur && paramCur->type == 0)
18158 arg = tClass->templateArgs[cp];
18159 else
18160 arg = expClass->templateArgs[p];
18161 {
18162 char argument[256];
18163
18164 argument[0] = '\0';
18165 switch(param->type)
18166 {
18167 case 2:
18168 {
18169 char expString[1024];
18170 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18171 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18172 struct Expression * exp;
18173 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18174
18175 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18176 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18177 ProcessExpressionType(exp);
18178 ComputeExpression(exp);
18179 expString[0] = '\0';
18180 PrintExpression(exp, expString);
18181 strcat(argument, expString);
18182 FreeExpression(exp);
18183 break;
18184 }
18185 case 1:
18186 {
18187 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18188 break;
18189 }
18190 case 0:
18191 {
18192 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18193 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18194 break;
18195 }
18196 }
18197 if(argument[0])
18198 {
18199 if(paramCount)
18200 strcat(templateString, ", ");
18201 if(lastParam != p - 1)
18202 {
18203 strcat(templateString, param->name);
18204 strcat(templateString, " = ");
18205 }
18206 strcat(templateString, argument);
18207 paramCount++;
18208 lastParam = p;
18209 }
18210 }
18211 p++;
18212 }
18213 }
18214 {
18215 int len = strlen(templateString);
18216
18217 if(templateString[len - 1] == '>')
18218 templateString[len++] = ' ';
18219 templateString[len++] = '>';
18220 templateString[len++] = '\0';
18221 }
18222 FreeType(exp->expType);
18223 {
18224 struct Context * context = SetupTemplatesContext(tClass);
18225
18226 exp->expType = ProcessTypeString(templateString, 0);
18227 FinishTemplatesContext(context);
18228 }
18229 }
18230 }
18231 }
18232 }
18233 else
18234 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)");
18235 }
18236 else if(type && (type->kind == 9 || type->kind == 10))
18237 {
18238 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18239
18240 if(memberType)
18241 {
18242 exp->expType = memberType;
18243 if(memberType)
18244 memberType->refCount++;
18245 }
18246 }
18247 else
18248 {
18249 char expString[10240];
18250
18251 expString[0] = '\0';
18252 if(inCompiler)
18253 {
18254 PrintExpression(exp, expString);
18255 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18256 }
18257 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18258 }
18259 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18260 {
18261 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18262 {
18263 struct Identifier * id = exp->__anon1.member.member;
18264 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));
18265
18266 if(_class)
18267 {
18268 FreeType(exp->expType);
18269 exp->expType = ReplaceThisClassType(_class);
18270 }
18271 }
18272 }
18273 yylloc = oldyylloc;
18274 break;
18275 }
18276 case 9:
18277 {
18278 struct Type * destType = exp->destType;
18279
18280 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18281 {
18282 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18283 }
18284 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18285 exp->type = 8;
18286 if(destType)
18287 destType->count++;
18288 ProcessExpressionType(exp);
18289 if(destType)
18290 destType->count--;
18291 break;
18292 }
18293 case 15:
18294 {
18295 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18296
18297 if(classSym && classSym->__anon1.registered)
18298 {
18299 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18300 {
18301 char name[1024];
18302 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18303
18304 name[0] = '\0';
18305 DeclareStruct(curExternal, classSym->string, 0, 1);
18306 FreeSpecifier(exp->__anon1._class);
18307 FullClassNameCat(name, classSym->string, 0);
18308 if(b->offset == 0)
18309 {
18310 exp->type = 10;
18311 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18312 }
18313 else
18314 {
18315 struct Expression * e;
18316
18317 exp->type = 4;
18318 if(b->structSize == b->offset)
18319 exp->__anon1.op.exp1 = MkExpConstant("0");
18320 else
18321 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18322 exp->__anon1.op.op = '+';
18323 e = exp;
18324 while(b->offset != 0)
18325 {
18326 struct Symbol * sym;
18327 struct Expression * typeSize;
18328
18329 b = b->base;
18330 sym = FindClass(b->fullName);
18331 name[0] = '\0';
18332 DeclareStruct(curExternal, sym->string, 0, 1);
18333 FullClassNameCat(name, sym->string, 0);
18334 if(b->structSize == b->offset)
18335 typeSize = MkExpConstant("0");
18336 else
18337 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18338 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18339 e = e->__anon1.op.exp2;
18340 }
18341 }
18342 }
18343 else
18344 {
18345 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18346 {
18347 FreeSpecifier(exp->__anon1._class);
18348 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18349 exp->type = 2;
18350 }
18351 else
18352 {
18353 char className[1024];
18354
18355 strcpy(className, "__ecereClass_");
18356 FullClassNameCat(className, classSym->string, 1);
18357 DeclareClass(curExternal, classSym, className);
18358 FreeExpContents(exp);
18359 exp->type = 9;
18360 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18361 exp->__anon1.member.member = MkIdentifier("structSize");
18362 }
18363 }
18364 }
18365 exp->expType = __extension__ ({
18366 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18367
18368 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18369 });
18370 break;
18371 }
18372 case 10:
18373 {
18374 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
18375
18376 exp->expType = __extension__ ({
18377 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18378
18379 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18380 });
18381 exp->isConstant = 1;
18382 DeclareType(curExternal, type, 1, 0);
18383 FreeType(type);
18384 break;
18385 }
18386 case 11:
18387 {
18388 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18389
18390 type->count = 1;
18391 FreeType(exp->__anon1.cast.exp->destType);
18392 exp->__anon1.cast.exp->destType = type;
18393 type->refCount++;
18394 type->casted = 1;
18395 ProcessExpressionType(exp->__anon1.cast.exp);
18396 type->casted = 0;
18397 type->count = 0;
18398 exp->expType = type;
18399 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18400 {
18401 void * prev = exp->prev, * next = exp->next;
18402 struct Type * expType = exp->__anon1.cast.exp->destType;
18403 struct Expression * castExp = exp->__anon1.cast.exp;
18404 struct Type * destType = exp->destType;
18405
18406 if(expType)
18407 expType->refCount++;
18408 FreeType(exp->expType);
18409 FreeTypeName(exp->__anon1.cast.typeName);
18410 *exp = *castExp;
18411 FreeType(exp->expType);
18412 FreeType(exp->destType);
18413 exp->expType = expType;
18414 exp->destType = destType;
18415 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
18416 exp->prev = prev;
18417 exp->next = next;
18418 }
18419 else
18420 {
18421 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18422 }
18423 break;
18424 }
18425 case 33:
18426 {
18427 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18428
18429 exp->expType = type;
18430 break;
18431 }
18432 case 34:
18433 {
18434 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18435
18436 ProcessExpressionType(exp->__anon1.vaArg.exp);
18437 exp->expType = type;
18438 break;
18439 }
18440 case 12:
18441 {
18442 struct Expression * e;
18443 struct Type * t = exp->destType;
18444
18445 if(t && !exp->destType->casted)
18446 {
18447 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18448 CopyTypeInto(t, exp->destType);
18449 t->count = 0;
18450 }
18451 else if(t)
18452 t->refCount++;
18453 exp->isConstant = 1;
18454 FreeType(exp->__anon1.cond.cond->destType);
18455 exp->__anon1.cond.cond->destType = MkClassType("bool");
18456 exp->__anon1.cond.cond->destType->truth = 1;
18457 ProcessExpressionType(exp->__anon1.cond.cond);
18458 if(!exp->__anon1.cond.cond->isConstant)
18459 exp->isConstant = 0;
18460 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18461 {
18462 if(!e->next)
18463 {
18464 FreeType(e->destType);
18465 e->destType = t;
18466 if(e->destType)
18467 e->destType->refCount++;
18468 }
18469 ProcessExpressionType(e);
18470 if(!e->next)
18471 {
18472 exp->expType = e->expType;
18473 if(e->expType)
18474 e->expType->refCount++;
18475 }
18476 if(!e->isConstant)
18477 exp->isConstant = 0;
18478 }
18479 FreeType(exp->__anon1.cond.elseExp->destType);
18480 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18481 if(exp->__anon1.cond.elseExp->destType)
18482 exp->__anon1.cond.elseExp->destType->refCount++;
18483 ProcessExpressionType(exp->__anon1.cond.elseExp);
18484 if(!exp->__anon1.cond.elseExp->isConstant)
18485 exp->isConstant = 0;
18486 FreeType(t);
18487 break;
18488 }
18489 case 23:
18490 {
18491 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18492 {
18493 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18494
18495 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18496 {
18497 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18498 if(exp->destType)
18499 exp->destType->refCount++;
18500 }
18501 ProcessStatement(exp->__anon1.compound);
18502 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18503 if(exp->expType)
18504 exp->expType->refCount++;
18505 }
18506 break;
18507 }
18508 case 24:
18509 {
18510 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18511
18512 if(spec && spec->type == 1)
18513 {
18514 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18515 exp->expType->kind = 19;
18516 exp->byReference = 1;
18517 }
18518 else
18519 {
18520 exp->expType = MkClassType("ecere::com::Class");
18521 exp->byReference = 1;
18522 }
18523 break;
18524 }
18525 case 25:
18526 {
18527 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18528
18529 if(_class)
18530 {
18531 struct Identifier * id = exp->__anon1.classData.id;
18532 char structName[1024];
18533 struct Expression * classExp;
18534
18535 strcpy(structName, "__ecereClassData_");
18536 FullClassNameCat(structName, _class->fullName, 0);
18537 exp->type = 9;
18538 exp->__anon1.member.member = id;
18539 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18540 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18541 else
18542 classExp = MkExpIdentifier(MkIdentifier("class"));
18543 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"))))))));
18544 ProcessExpressionType(exp);
18545 return ;
18546 }
18547 break;
18548 }
18549 case 35:
18550 {
18551 struct Type * type = (((void *)0));
18552 const char * typeString = (((void *)0));
18553 char typeStringBuf[1024];
18554
18555 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))
18556 {
18557 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18558
18559 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18560 }
18561 else if(exp->__anon1.list)
18562 {
18563 struct Expression * e;
18564
18565 for(e = (*exp->__anon1.list).first; e; e = e->next)
18566 {
18567 ProcessExpressionType(e);
18568 if(e->expType)
18569 {
18570 if(!type)
18571 {
18572 type = e->expType;
18573 type->refCount++;
18574 }
18575 else
18576 {
18577 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18578 {
18579 FreeType(type);
18580 type = e->expType;
18581 e->expType = (((void *)0));
18582 e = (*exp->__anon1.list).first;
18583 ProcessExpressionType(e);
18584 if(e->expType)
18585 {
18586 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18587 {
18588 FreeType(e->expType);
18589 e->expType = (((void *)0));
18590 FreeType(type);
18591 type = (((void *)0));
18592 break;
18593 }
18594 }
18595 }
18596 }
18597 if(e->expType)
18598 {
18599 FreeType(e->expType);
18600 e->expType = (((void *)0));
18601 }
18602 }
18603 }
18604 if(type)
18605 {
18606 typeStringBuf[0] = '\0';
18607 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18608 typeString = typeStringBuf;
18609 FreeType(type);
18610 type = (((void *)0));
18611 }
18612 }
18613 if(typeString)
18614 {
18615 char templateString[1024];
18616 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18617 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18618 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18619 struct Expression * expExt;
18620 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18621
18622 sprintf(templateString, "Container<%s>", typeString);
18623 if(exp->__anon1.list)
18624 {
18625 struct Expression * e;
18626
18627 type = ProcessTypeString(typeString, 0);
18628 while((e = (*exp->__anon1.list).first))
18629 {
18630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18631 e->destType = type;
18632 type->refCount++;
18633 ProcessExpressionType(e);
18634 ListAdd(initializers, MkInitializerAssignment(e));
18635 }
18636 FreeType(type);
18637 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18638 }
18639 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18640 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18641 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18642 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18643 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18644 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18645 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18646 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18647 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18648 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18649 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18650
18651 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18652 })));
18653 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18654 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18655 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18656 exp->expType = ProcessTypeString(templateString, 0);
18657 exp->type = 5;
18658 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18659 ProcessExpressionType(expExt);
18660 }
18661 else
18662 {
18663 exp->expType = ProcessTypeString("Container", 0);
18664 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18665 }
18666 break;
18667 }
18668 }
18669 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18670 {
18671 FreeType(exp->expType);
18672 exp->expType = ReplaceThisClassType(thisClass);
18673 }
18674 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)
18675 {
18676 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
18677
18678 if(symbol)
18679 {
18680 if(exp->expType->kind != 15)
18681 {
18682 struct Type * member;
18683 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
18684
18685 FreeType(exp->expType);
18686 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18687 exp->expType->kind = symbol->type->kind;
18688 exp->expType->refCount++;
18689 exp->expType->__anon1.__anon1.enumName = enumName;
18690 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
18691 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18692 member->refCount++;
18693 }
18694 else
18695 {
18696 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
18697
18698 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18699 {
18700 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);
18701
18702 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
18703 }
18704 }
18705 }
18706 }
18707 yylloc = exp->loc;
18708 if(exp->destType && (exp->destType->kind == 18))
18709 ;
18710 else if(exp->destType && !exp->destType->keepCast)
18711 {
18712 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
18713 exp->needTemplateCast = 1;
18714 if(exp->destType->kind == 0)
18715 ;
18716 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
18717 {
18718 unsigned int invalidCast = 0;
18719
18720 if(inCompiler && exp->destType->count && exp->expType)
18721 {
18722 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
18723 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
18724
18725 if(c1 && c1->type != 1)
18726 c1 = (((void *)0));
18727 if(c2 && c2->type != 1)
18728 c2 = (((void *)0));
18729 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
18730 invalidCast = 1;
18731 }
18732 if(!exp->destType->count || unresolved || invalidCast)
18733 {
18734 if(!exp->expType)
18735 {
18736 yylloc = exp->loc;
18737 if(exp->destType->kind != 14)
18738 {
18739 char type2[1024];
18740
18741 type2[0] = '\0';
18742 if(inCompiler)
18743 {
18744 char expString[10240];
18745
18746 expString[0] = '\0';
18747 PrintType(exp->destType, type2, 0, 1);
18748 if(inCompiler)
18749 {
18750 PrintExpression(exp, expString);
18751 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18752 }
18753 if(unresolved)
18754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
18755 else if(exp->type != 16)
18756 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
18757 }
18758 }
18759 else
18760 {
18761 char expString[10240];
18762
18763 expString[0] = '\0';
18764 if(inCompiler)
18765 {
18766 PrintExpression(exp, expString);
18767 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18768 }
18769 if(unresolved)
18770 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
18771 else if(exp->type != 16)
18772 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18773 }
18774 }
18775 else
18776 {
18777 char type1[1024];
18778 char type2[1024];
18779
18780 type1[0] = '\0';
18781 type2[0] = '\0';
18782 if(inCompiler)
18783 {
18784 PrintType(exp->expType, type1, 0, 1);
18785 PrintType(exp->destType, type2, 0, 1);
18786 }
18787 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)))
18788 ;
18789 else
18790 {
18791 struct Expression * nbExp = GetNonBracketsExp(exp);
18792 unsigned int skipWarning = 0;
18793 int kind = exp->destType->kind;
18794
18795 if(nbExp->type == 12 && !nbExp->destType->casted && nbExp->destType->kind == exp->destType->kind)
18796 skipWarning = 1;
18797 if((kind == 1 || kind == 2) && exp->destType->isSigned == exp->expType->signedBeforePromotion && nbExp->type == 4 && nbExp->__anon1.op.exp1 && nbExp->__anon1.op.exp2)
18798 {
18799 int op = nbExp->__anon1.op.op;
18800 struct Expression * nbExp1, * nbExp2;
18801 int from;
18802
18803 switch(op)
18804 {
18805 case '%':
18806 case '/':
18807 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18808 from = nbExp1->expType->promotedFrom;
18809 if(from == 1 || (kind == 2 && from == 2))
18810 skipWarning = 1;
18811 break;
18812 case LEFT_OP:
18813 case RIGHT_OP:
18814 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18815 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18816 from = nbExp1->expType->promotedFrom;
18817 if(op == RIGHT_OP && (from == 1 || (kind == 2 && from == 2)))
18818 skipWarning = 1;
18819 else if(nbExp2->isConstant && nbExp2->type == 2 && (nbExp->__anon1.op.op == RIGHT_OP || nbExp1->expType->bitMemberSize))
18820 {
18821 int n = strtol(nbExp2->__anon1.__anon1.constant, (((void *)0)), 0);
18822 int s = from == 1 ? 8 : 16;
18823
18824 if(nbExp1->expType->bitMemberSize && nbExp1->expType->bitMemberSize < s)
18825 s = nbExp1->expType->bitMemberSize;
18826 if(nbExp->__anon1.op.op == RIGHT_OP)
18827 s -= n;
18828 else
18829 s += n;
18830 if(s <= (kind == 1 ? 8 : 16))
18831 skipWarning = 1;
18832 }
18833 break;
18834 case '-':
18835 if(!exp->destType->isSigned)
18836 {
18837 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18838 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18839 from = nbExp2->expType->promotedFrom;
18840 if((from == 1 || from == 2) && nbExp1->isConstant && nbExp1->type == 2)
18841 {
18842 int n = strtol(nbExp1->__anon1.__anon1.constant, (((void *)0)), 0);
18843
18844 if(n == (from == 1 ? 255 : 65535))
18845 skipWarning = 1;
18846 }
18847 }
18848 break;
18849 case '|':
18850 {
18851 int kind1, kind2;
18852
18853 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18854 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18855 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
18856 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
18857 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)))
18858 skipWarning = 1;
18859 break;
18860 }
18861 case '&':
18862 {
18863 int kind1, kind2;
18864
18865 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18866 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18867 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
18868 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
18869 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)))
18870 skipWarning = 1;
18871 break;
18872 }
18873 }
18874 }
18875 if(!skipWarning)
18876 {
18877 char expString[10240];
18878
18879 expString[0] = '\0';
18880 if(inCompiler)
18881 {
18882 PrintExpression(exp, expString);
18883 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18884 }
18885 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")))
18886 {
18887 if(invalidCast)
18888 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18889 else
18890 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18891 }
18892 }
18893 if(!inCompiler)
18894 {
18895 FreeType(exp->expType);
18896 exp->destType->refCount++;
18897 exp->expType = exp->destType;
18898 }
18899 }
18900 }
18901 }
18902 }
18903 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))
18904 {
18905 struct Expression * nbExp = GetNonBracketsExp(exp);
18906
18907 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
18908 {
18909 struct Expression * e = MoveExpContents(exp);
18910
18911 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
18912 exp->type = 11;
18913 exp->__anon1.cast.exp->destType = exp->destType;
18914 if(exp->destType)
18915 exp->destType->refCount++;
18916 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
18917 }
18918 }
18919 }
18920 else if(unresolved)
18921 {
18922 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
18923 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);
18924 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
18925 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
18926 }
18927 else if(!exp->expType && exp->type != 16)
18928 {
18929 char expString[10240];
18930
18931 expString[0] = '\0';
18932 if(inCompiler)
18933 {
18934 PrintExpression(exp, expString);
18935 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18936 }
18937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18938 }
18939 if(inCompiler)
18940 ApplyAnyObjectLogic(exp);
18941 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)))
18942 {
18943 exp->byReference = 1;
18944 }
18945 yylloc = oldyylloc;
18946 }
18947
18948 static void ProcessFunction(struct FunctionDefinition * function)
18949 {
18950 struct Identifier * id = GetDeclId(function->declarator);
18951 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18952 struct Type * type = symbol ? symbol->type : (((void *)0));
18953 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18954 struct Context * oldTopContext = topContext;
18955
18956 yylloc = function->loc;
18957 if(type && type->__anon1.__anon2.thisClass)
18958 {
18959 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18960 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18961 char className[1024];
18962 char structName[1024];
18963 struct Declarator * funcDecl;
18964 struct Symbol * thisSymbol;
18965 unsigned int typedObject = 0;
18966
18967 if(_class && !_class->base)
18968 {
18969 _class = currentClass;
18970 if(_class && !_class->symbol)
18971 _class->symbol = FindClass(_class->fullName);
18972 classSym = _class ? _class->symbol : (((void *)0));
18973 typedObject = 1;
18974 }
18975 thisClass = _class;
18976 if(inCompiler && _class)
18977 {
18978 if(type->kind == 11)
18979 {
18980 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18981 {
18982 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18983
18984 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18985 FreeType(param);
18986 }
18987 if(type->classObjectType != 1)
18988 {
18989 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18990 symbol->type->__anon1.__anon2.staticMethod = 1;
18991 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18992 symbol->type->extraParam = 0;
18993 }
18994 }
18995 strcpy(className, "__ecereClass_");
18996 FullClassNameCat(className, _class->fullName, 1);
18997 structName[0] = 0;
18998 FullClassNameCat(structName, _class->fullName, 0);
18999 funcDecl = GetFuncDecl(function->declarator);
19000 if(funcDecl)
19001 {
19002 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19003 {
19004 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19005
19006 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19007 {
19008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19009 FreeTypeName(param);
19010 }
19011 }
19012 if(!function->propertyNoThis)
19013 {
19014 struct TypeName * thisParam = (((void *)0));
19015
19016 if(type->classObjectType != 1)
19017 {
19018 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19019 if(!funcDecl->__anon1.function.parameters)
19020 funcDecl->__anon1.function.parameters = MkList();
19021 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19022 }
19023 if(typedObject)
19024 {
19025 if(type->classObjectType != 1)
19026 {
19027 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
19028 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
19029 }
19030 thisParam = __extension__ ({
19031 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
19032
19033 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
19034 });
19035 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
19036 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19037 }
19038 }
19039 }
19040 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19041 {
19042 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19043
19044 funcDecl = GetFuncDecl(initDecl->declarator);
19045 if(funcDecl)
19046 {
19047 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19048 {
19049 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19050
19051 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19052 {
19053 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19054 FreeTypeName(param);
19055 }
19056 }
19057 if(type->classObjectType != 1)
19058 {
19059 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
19060 {
19061 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19062
19063 if(!funcDecl->__anon1.function.parameters)
19064 funcDecl->__anon1.function.parameters = MkList();
19065 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19066 }
19067 }
19068 }
19069 }
19070 }
19071 if(function->body)
19072 {
19073 if(type->classObjectType != 1)
19074 {
19075 thisSymbol = __extension__ ({
19076 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
19077
19078 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
19079 });
19080 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19081 if(typedObject && thisSymbol->type)
19082 {
19083 thisSymbol->type->classObjectType = 2;
19084 thisSymbol->type->byReference = type->byReference;
19085 thisSymbol->type->typedByReference = type->byReference;
19086 }
19087 }
19088 }
19089 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
19090 {
19091 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
19092
19093 {
19094 struct __ecereNameSpace__ecere__com__Class * base;
19095
19096 for(base = _class; base && base->type != 1000; base = base->next)
19097 {
19098 for(member = base->membersAndProperties.first; member; member = member->next)
19099 if(!member->isProperty)
19100 break;
19101 if(member)
19102 break;
19103 }
19104 }
19105 for(member = _class->membersAndProperties.first; member; member = member->next)
19106 if(!member->isProperty)
19107 break;
19108 if(member)
19109 {
19110 char pointerName[1024];
19111 struct Declaration * decl;
19112 struct Initializer * initializer;
19113 struct Expression * exp, * bytePtr;
19114
19115 strcpy(pointerName, "__ecerePointer_");
19116 FullClassNameCat(pointerName, _class->fullName, 0);
19117 {
19118 char className[1024];
19119
19120 strcpy(className, "__ecereClass_");
19121 FullClassNameCat(className, classSym->string, 1);
19122 DeclareClass(curExternal, classSym, className);
19123 }
19124 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
19125 if(_class->fixed)
19126 {
19127 struct Expression * e;
19128
19129 if(_class->offset && _class->offset == _class->base->structSize)
19130 {
19131 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
19132 ProcessExpressionType(e);
19133 }
19134 else
19135 {
19136 char string[256];
19137
19138 sprintf(string, "%d", _class->offset);
19139 e = MkExpConstant(string);
19140 }
19141 exp = QBrackets(MkExpOp(bytePtr, '+', e));
19142 }
19143 else
19144 {
19145 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
19146 }
19147 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
19148 exp->expType = __extension__ ({
19149 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19150
19151 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
19152 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19153
19154 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19155 }), __ecereInstance2;
19156 });
19157 if(function->body)
19158 {
19159 yylloc = function->body->loc;
19160 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19161 {
19162 struct Context * prevContext = curContext;
19163 struct __ecereNameSpace__ecere__sys__OldList * list;
19164
19165 curContext = function->body->__anon1.compound.context;
19166 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19167 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19168 curContext = prevContext;
19169 }
19170 decl->symbol = (((void *)0));
19171 if(!function->body->__anon1.compound.declarations)
19172 function->body->__anon1.compound.declarations = MkList();
19173 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19174 }
19175 }
19176 }
19177 }
19178 else
19179 thisClass = (((void *)0));
19180 if(id)
19181 {
19182 FreeSpecifier(id->_class);
19183 id->_class = (((void *)0));
19184 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19185 {
19186 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19187
19188 id = GetDeclId(initDecl->declarator);
19189 FreeSpecifier(id->_class);
19190 id->_class = (((void *)0));
19191 }
19192 }
19193 if(function->body)
19194 topContext = function->body->__anon1.compound.context;
19195 {
19196 struct FunctionDefinition * oldFunction = curFunction;
19197
19198 curFunction = function;
19199 if(function->body)
19200 ProcessStatement(function->body);
19201 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19202 {
19203 struct Statement * prevCompound = curCompound;
19204 struct Context * prevContext = curContext;
19205 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19206
19207 if(!function->body->__anon1.compound.statements)
19208 function->body->__anon1.compound.statements = MkList();
19209 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19210 curCompound = function->body;
19211 curContext = function->body->__anon1.compound.context;
19212 ProcessStatement(fireWatchers);
19213 curContext = prevContext;
19214 curCompound = prevCompound;
19215 }
19216 curFunction = oldFunction;
19217 }
19218 if(function->declarator)
19219 {
19220 ProcessDeclarator(function->declarator, 1);
19221 }
19222 topContext = oldTopContext;
19223 thisClass = oldThisClass;
19224 }
19225
19226 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19227 {
19228 struct ClassDef * def;
19229 struct External * external = curExternal;
19230 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19231
19232 for(def = definitions->first; def; def = def->next)
19233 {
19234 if(def->type == 0)
19235 {
19236 if(def->__anon1.function->declarator)
19237 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19238 else
19239 curExternal = external;
19240 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19241 }
19242 else if(def->type == 2)
19243 {
19244 if(def->__anon1.decl->type == 2)
19245 {
19246 thisClass = regClass;
19247 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19248 thisClass = (((void *)0));
19249 }
19250 else
19251 {
19252 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19253
19254 if(regClass)
19255 thisClass = regClass;
19256 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19257 thisClass = backThisClass;
19258 }
19259 }
19260 else if(def->type == 1 && def->__anon1.defProperties)
19261 {
19262 struct MemberInit * defProperty;
19263 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);
19264
19265 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19266 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19267 {
19268 thisClass = regClass;
19269 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19270 thisClass = (((void *)0));
19271 }
19272 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19273 FreeSymbol(thisSymbol);
19274 }
19275 else if(def->type == 3 && def->__anon1.propertyDef)
19276 {
19277 struct PropertyDef * prop = def->__anon1.propertyDef;
19278
19279 thisClass = regClass;
19280 if(prop->setStmt)
19281 {
19282 if(regClass)
19283 {
19284 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19285
19286 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19287 }
19288 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19289 ProcessStatement(prop->setStmt);
19290 }
19291 if(prop->getStmt)
19292 {
19293 if(regClass)
19294 {
19295 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19296
19297 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19298 }
19299 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19300 ProcessStatement(prop->getStmt);
19301 }
19302 if(prop->issetStmt)
19303 {
19304 if(regClass)
19305 {
19306 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19307
19308 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19309 }
19310 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19311 ProcessStatement(prop->issetStmt);
19312 }
19313 thisClass = (((void *)0));
19314 }
19315 else if(def->type == 4 && def->__anon1.propertyWatch)
19316 {
19317 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19318
19319 thisClass = regClass;
19320 if(propertyWatch->compound)
19321 {
19322 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);
19323
19324 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19325 curExternal = (((void *)0));
19326 ProcessStatement(propertyWatch->compound);
19327 }
19328 thisClass = (((void *)0));
19329 }
19330 }
19331 }
19332
19333 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19334 {
19335 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19336
19337 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19338 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19339 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19340 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19341 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19342 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19343 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19344 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19345 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19346 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19347 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19348 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19349 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19350 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19351 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19352 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19354 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19355 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19356 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19357 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19359 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19360 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19364 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19365 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19386 __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);
19387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19391 __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);
19392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19406 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19407 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)
19408 __ecereClass_Conversion = class;
19409 __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);
19410 __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);
19411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19412 __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);
19413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19422 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19427 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19428 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19429 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19430 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19431 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19432 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19433 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19434 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19435 }
19436