430f564d521166f8272c891570243749d5e37484
[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 * CopyExpression(struct Expression * exp);
647
648 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
649
650 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
651
652 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
653
654 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
655
656 extern struct Expression * MoveExpContents(struct Expression * exp);
657
658 extern struct Expression * QBrackets(struct Expression * exp);
659
660 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
661
662 struct Statement;
663
664 static struct Statement * curCompound;
665
666 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
667
668 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
669
670 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
671
672 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
673
674 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
675
676 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
677
678 struct External;
679
680 struct External * curExternal, * afterExternal;
681
682 extern void FreeExternal(struct External * external);
683
684 struct Type;
685
686 static struct Type * curSwitchType;
687
688 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
689
690 extern void FreeType(struct Type * type);
691
692 extern struct Type * MkClassType(const char *  name);
693
694 extern void CopyTypeInto(struct Type * type, struct Type * src);
695
696 struct __ecereNameSpace__ecere__com__Class;
697
698 struct __ecereNameSpace__ecere__com__Instance
699 {
700 void * *  _vTbl;
701 struct __ecereNameSpace__ecere__com__Class * _class;
702 int _refCount;
703 } ecere_gcc_struct;
704
705 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
706
707 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
708
709 static struct __ecereNameSpace__ecere__com__Class * currentClass;
710
711 struct __ecereNameSpace__ecere__com__Class * thisClass;
712
713 struct __ecereNameSpace__ecere__com__Class * containerClass;
714
715 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
716
717 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
718
719 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
720
721 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
722
723 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
724
725 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
726
727 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
728
729 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
730
731 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
732
733 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
734
735 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
736
737 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
738 {
739 thisClass = c;
740 }
741
742 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
743 {
744 return thisClass;
745 }
746
747 struct Context;
748
749 extern struct Context * curContext;
750
751 extern struct Context * topContext;
752
753 extern struct Context * PushContext(void);
754
755 extern void PopContext(struct Context * ctx);
756
757 extern void FreeContext(struct Context * context);
758
759 extern struct Context * globalContext;
760
761 struct ModuleImport;
762
763 extern struct ModuleImport * mainModule;
764
765 struct ModuleImport
766 {
767 struct ModuleImport * prev;
768 struct ModuleImport * next;
769 char *  name;
770 struct __ecereNameSpace__ecere__sys__OldList classes;
771 struct __ecereNameSpace__ecere__sys__OldList functions;
772 int importType;
773 int importAccess;
774 } ecere_gcc_struct;
775
776 struct __ecereNameSpace__ecere__com__NameSpace;
777
778 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
779
780 struct FunctionDefinition;
781
782 static struct FunctionDefinition * curFunction;
783
784 struct __ecereNameSpace__ecere__sys__BTNode;
785
786 struct __ecereNameSpace__ecere__sys__BTNode
787 {
788 uintptr_t key;
789 struct __ecereNameSpace__ecere__sys__BTNode * parent;
790 struct __ecereNameSpace__ecere__sys__BTNode * left;
791 struct __ecereNameSpace__ecere__sys__BTNode * right;
792 int depth;
793 } ecere_gcc_struct;
794
795 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
796
797 struct __ecereNameSpace__ecere__com__Property;
798
799 struct __ecereNameSpace__ecere__com__Property
800 {
801 struct __ecereNameSpace__ecere__com__Property * prev;
802 struct __ecereNameSpace__ecere__com__Property * next;
803 const char *  name;
804 unsigned int isProperty;
805 int memberAccess;
806 int id;
807 struct __ecereNameSpace__ecere__com__Class * _class;
808 const char *  dataTypeString;
809 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
810 struct Type * dataType;
811 void (*  Set)(void * , int);
812 int (*  Get)(void * );
813 unsigned int (*  IsSet)(void * );
814 void *  data;
815 void *  symbol;
816 int vid;
817 unsigned int conversion;
818 unsigned int watcherOffset;
819 const char *  category;
820 unsigned int compiled;
821 unsigned int selfWatchable;
822 unsigned int isWatchable;
823 } ecere_gcc_struct;
824
825 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
826
827 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
828
829 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
830
831 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
832
833 struct Identifier;
834
835 extern void FreeIdentifier(struct Identifier * id);
836
837 extern struct Identifier * MkIdentifier(const char *  string);
838
839 extern struct Expression * MkExpIdentifier(struct Identifier * id);
840
841 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
842
843 extern struct Identifier * CopyIdentifier(struct Identifier * id);
844
845 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
846
847 struct __ecereNameSpace__ecere__sys__OldLink;
848
849 struct __ecereNameSpace__ecere__sys__OldLink
850 {
851 struct __ecereNameSpace__ecere__sys__OldLink * prev;
852 struct __ecereNameSpace__ecere__sys__OldLink * next;
853 void *  data;
854 } ecere_gcc_struct;
855
856 struct Declaration;
857
858 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
859
860 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
861
862 struct Specifier;
863
864 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
865
866 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
867
868 extern struct Specifier * MkSpecifier(int specifier);
869
870 extern struct Specifier * MkSpecifierName(const char *  name);
871
872 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
873
874 extern void FreeSpecifier(struct Specifier * spec);
875
876 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
877
878 struct Statement
879 {
880 struct Statement * prev;
881 struct Statement * next;
882 struct Location loc;
883 int type;
884 union
885 {
886 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
887 struct
888 {
889 struct Identifier * id;
890 struct Statement * stmt;
891 } ecere_gcc_struct labeled;
892 struct
893 {
894 struct Expression * exp;
895 struct Statement * stmt;
896 } ecere_gcc_struct caseStmt;
897 struct
898 {
899 struct __ecereNameSpace__ecere__sys__OldList * declarations;
900 struct __ecereNameSpace__ecere__sys__OldList * statements;
901 struct Context * context;
902 unsigned int isSwitch;
903 } ecere_gcc_struct compound;
904 struct
905 {
906 struct __ecereNameSpace__ecere__sys__OldList * exp;
907 struct Statement * stmt;
908 struct Statement * elseStmt;
909 } ecere_gcc_struct ifStmt;
910 struct
911 {
912 struct __ecereNameSpace__ecere__sys__OldList * exp;
913 struct Statement * stmt;
914 } ecere_gcc_struct switchStmt;
915 struct
916 {
917 struct __ecereNameSpace__ecere__sys__OldList * exp;
918 struct Statement * stmt;
919 } ecere_gcc_struct whileStmt;
920 struct
921 {
922 struct __ecereNameSpace__ecere__sys__OldList * exp;
923 struct Statement * stmt;
924 } ecere_gcc_struct doWhile;
925 struct
926 {
927 struct Statement * init;
928 struct Statement * check;
929 struct __ecereNameSpace__ecere__sys__OldList * increment;
930 struct Statement * stmt;
931 } ecere_gcc_struct forStmt;
932 struct
933 {
934 struct Identifier * id;
935 } ecere_gcc_struct gotoStmt;
936 struct
937 {
938 struct Specifier * spec;
939 char * statements;
940 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
941 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
942 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
943 } ecere_gcc_struct asmStmt;
944 struct
945 {
946 struct Expression * watcher;
947 struct Expression * object;
948 struct __ecereNameSpace__ecere__sys__OldList * watches;
949 } ecere_gcc_struct _watch;
950 struct
951 {
952 struct Identifier * id;
953 struct __ecereNameSpace__ecere__sys__OldList * exp;
954 struct __ecereNameSpace__ecere__sys__OldList * filter;
955 struct Statement * stmt;
956 } ecere_gcc_struct forEachStmt;
957 struct Declaration * decl;
958 } ecere_gcc_struct __anon1;
959 } ecere_gcc_struct;
960
961 extern struct Specifier * CopySpecifier(struct Specifier * spec);
962
963 extern struct Expression * MkExpClassSize(struct Specifier * _class);
964
965 struct Symbol;
966
967 struct Identifier
968 {
969 struct Identifier * prev;
970 struct Identifier * next;
971 struct Location loc;
972 struct Symbol * classSym;
973 struct Specifier * _class;
974 char *  string;
975 struct Identifier * badID;
976 } ecere_gcc_struct;
977
978 extern struct Symbol * FindStruct(struct Context * ctx, const char *  name);
979
980 extern struct Symbol * FindClass(const char *  name);
981
982 extern void DeclareClass(struct External * neededFor, struct Symbol * classSym, const char *  className);
983
984 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
985
986 extern void FreeSymbol(struct Symbol * symbol);
987
988 struct ClassDef;
989
990 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
991
992 extern void FreeClassDef(struct ClassDef * def);
993
994 struct Declarator;
995
996 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
997
998 struct TemplateDatatype
999 {
1000 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1001 struct Declarator * decl;
1002 } ecere_gcc_struct;
1003
1004 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1005
1006 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1007
1008 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1009
1010 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
1011
1012 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
1013
1014 struct Declarator
1015 {
1016 struct Declarator * prev;
1017 struct Declarator * next;
1018 struct Location loc;
1019 int type;
1020 struct Symbol * symbol;
1021 struct Declarator * declarator;
1022 union
1023 {
1024 struct Identifier * identifier;
1025 struct
1026 {
1027 struct Expression * exp;
1028 struct Expression * posExp;
1029 struct Attrib * attrib;
1030 } ecere_gcc_struct structDecl;
1031 struct
1032 {
1033 struct Expression * exp;
1034 struct Specifier * enumClass;
1035 } ecere_gcc_struct array;
1036 struct
1037 {
1038 struct __ecereNameSpace__ecere__sys__OldList * parameters;
1039 } ecere_gcc_struct function;
1040 struct
1041 {
1042 struct Pointer * pointer;
1043 } ecere_gcc_struct pointer;
1044 struct
1045 {
1046 struct ExtDecl * extended;
1047 } ecere_gcc_struct extended;
1048 } ecere_gcc_struct __anon1;
1049 } ecere_gcc_struct;
1050
1051 extern struct Identifier * GetDeclId(struct Declarator * decl);
1052
1053 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
1054
1055 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1056
1057 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1058
1059 extern void FreeDeclarator(struct Declarator * decl);
1060
1061 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1062
1063 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
1064
1065 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1066
1067 struct FunctionDefinition
1068 {
1069 struct FunctionDefinition * prev;
1070 struct FunctionDefinition * next;
1071 struct Location loc;
1072 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1073 struct Declarator * declarator;
1074 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1075 struct Statement * body;
1076 struct __ecereNameSpace__ecere__com__Class * _class;
1077 struct __ecereNameSpace__ecere__sys__OldList attached;
1078 int declMode;
1079 struct Type * type;
1080 struct Symbol * propSet;
1081 int tempCount;
1082 unsigned int propertyNoThis;
1083 } ecere_gcc_struct;
1084
1085 extern struct Declarator * QMkPtrDecl(const char *  id);
1086
1087 struct ClassFunction;
1088
1089 struct ClassFunction
1090 {
1091 struct ClassFunction * prev;
1092 struct ClassFunction * next;
1093 struct Location loc;
1094 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1095 struct Declarator * declarator;
1096 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1097 struct Statement * body;
1098 struct __ecereNameSpace__ecere__com__Class * _class;
1099 struct __ecereNameSpace__ecere__sys__OldList attached;
1100 int declMode;
1101 struct Type * type;
1102 struct Symbol * propSet;
1103 unsigned int isVirtual;
1104 unsigned int isConstructor;
1105 unsigned int isDestructor;
1106 unsigned int dontMangle;
1107 int id;
1108 int idCode;
1109 } ecere_gcc_struct;
1110
1111 extern struct External * ProcessClassFunction(struct __ecereNameSpace__ecere__com__Class * owningClass, struct ClassFunction * func, struct __ecereNameSpace__ecere__sys__OldList * defs, struct External * after, unsigned int makeStatic);
1112
1113 extern void FreeClassFunction(struct ClassFunction * func);
1114
1115 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1116
1117 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1118
1119 struct TypeName;
1120
1121 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1122
1123 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1124
1125 struct TypeName
1126 {
1127 struct TypeName * prev;
1128 struct TypeName * next;
1129 struct Location loc;
1130 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
1131 struct Declarator * declarator;
1132 int classObjectType;
1133 struct Expression * bitCount;
1134 } ecere_gcc_struct;
1135
1136 extern void FreeTypeName(struct TypeName * typeName);
1137
1138 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
1139
1140 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
1141
1142 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
1143
1144 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
1145
1146 struct __ecereNameSpace__ecere__com__BTNamedLink;
1147
1148 struct __ecereNameSpace__ecere__com__BTNamedLink
1149 {
1150 const char *  name;
1151 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1152 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1153 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1154 int depth;
1155 void *  data;
1156 } ecere_gcc_struct;
1157
1158 struct __ecereNameSpace__ecere__sys__NamedLink64;
1159
1160 struct __ecereNameSpace__ecere__sys__NamedLink64
1161 {
1162 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
1163 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
1164 char *  name;
1165 long long data;
1166 } ecere_gcc_struct;
1167
1168 struct Instantiation;
1169
1170 struct Declaration
1171 {
1172 struct Declaration * prev;
1173 struct Declaration * next;
1174 struct Location loc;
1175 int type;
1176 union
1177 {
1178 struct
1179 {
1180 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1181 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1182 } ecere_gcc_struct __anon1;
1183 struct Instantiation * inst;
1184 struct
1185 {
1186 struct Identifier * id;
1187 struct Expression * exp;
1188 } ecere_gcc_struct __anon2;
1189 } ecere_gcc_struct __anon1;
1190 struct Specifier * extStorage;
1191 struct Symbol * symbol;
1192 int declMode;
1193 } ecere_gcc_struct;
1194
1195 struct Instantiation
1196 {
1197 struct Instantiation * prev;
1198 struct Instantiation * next;
1199 struct Location loc;
1200 struct Specifier * _class;
1201 struct Expression * exp;
1202 struct __ecereNameSpace__ecere__sys__OldList *  members;
1203 struct Symbol * symbol;
1204 unsigned int fullSet;
1205 unsigned int isConstant;
1206 unsigned char *  data;
1207 struct Location nameLoc;
1208 struct Location insideLoc;
1209 unsigned int built;
1210 } ecere_gcc_struct;
1211
1212 extern void FreeInstance(struct Instantiation * inst);
1213
1214 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
1215
1216 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
1217
1218 struct InitDeclarator;
1219
1220 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1221
1222 struct PropertyWatch;
1223
1224 struct PropertyWatch
1225 {
1226 struct PropertyWatch * prev;
1227 struct PropertyWatch * next;
1228 struct Location loc;
1229 struct Statement * compound;
1230 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1231 unsigned int deleteWatch;
1232 } ecere_gcc_struct;
1233
1234 extern void FreePropertyWatch(struct PropertyWatch * watcher);
1235
1236 struct PropertyImport;
1237
1238 struct PropertyImport
1239 {
1240 struct PropertyImport * prev;
1241 struct PropertyImport * next;
1242 char *  name;
1243 unsigned int isVirtual;
1244 unsigned int hasSet;
1245 unsigned int hasGet;
1246 } ecere_gcc_struct;
1247
1248 struct MethodImport;
1249
1250 struct MethodImport
1251 {
1252 struct MethodImport * prev;
1253 struct MethodImport * next;
1254 char *  name;
1255 unsigned int isVirtual;
1256 } ecere_gcc_struct;
1257
1258 struct FunctionImport;
1259
1260 struct FunctionImport
1261 {
1262 struct FunctionImport * prev;
1263 struct FunctionImport * next;
1264 char *  name;
1265 } ecere_gcc_struct;
1266
1267 struct ClassImport;
1268
1269 struct ClassImport
1270 {
1271 struct ClassImport * prev;
1272 struct ClassImport * next;
1273 char *  name;
1274 struct __ecereNameSpace__ecere__sys__OldList methods;
1275 struct __ecereNameSpace__ecere__sys__OldList properties;
1276 unsigned int itself;
1277 int isRemote;
1278 } ecere_gcc_struct;
1279
1280 struct Initializer;
1281
1282 struct Expression
1283 {
1284 struct Expression * prev;
1285 struct Expression * next;
1286 struct Location loc;
1287 int type;
1288 union
1289 {
1290 struct
1291 {
1292 char *  constant;
1293 struct Identifier * identifier;
1294 } ecere_gcc_struct __anon1;
1295 struct Statement * compound;
1296 struct Instantiation * instance;
1297 struct
1298 {
1299 char *  string;
1300 unsigned int intlString;
1301 unsigned int wideString;
1302 } ecere_gcc_struct __anon2;
1303 struct __ecereNameSpace__ecere__sys__OldList *  list;
1304 struct
1305 {
1306 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1307 struct Declarator * decl;
1308 } ecere_gcc_struct _classExp;
1309 struct
1310 {
1311 struct Identifier * id;
1312 } ecere_gcc_struct classData;
1313 struct
1314 {
1315 struct Expression * exp;
1316 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1317 struct Location argLoc;
1318 } ecere_gcc_struct call;
1319 struct
1320 {
1321 struct Expression * exp;
1322 struct __ecereNameSpace__ecere__sys__OldList * index;
1323 } ecere_gcc_struct index;
1324 struct
1325 {
1326 struct Expression * exp;
1327 struct Identifier * member;
1328 int memberType;
1329 unsigned int thisPtr;
1330 } ecere_gcc_struct member;
1331 struct
1332 {
1333 int op;
1334 struct Expression * exp1;
1335 struct Expression * exp2;
1336 } ecere_gcc_struct op;
1337 struct TypeName * typeName;
1338 struct Specifier * _class;
1339 struct
1340 {
1341 struct TypeName * typeName;
1342 struct Expression * exp;
1343 } ecere_gcc_struct cast;
1344 struct
1345 {
1346 struct Expression * cond;
1347 struct __ecereNameSpace__ecere__sys__OldList * exp;
1348 struct Expression * elseExp;
1349 } ecere_gcc_struct cond;
1350 struct
1351 {
1352 struct TypeName * typeName;
1353 struct Expression * size;
1354 } ecere_gcc_struct _new;
1355 struct
1356 {
1357 struct TypeName * typeName;
1358 struct Expression * size;
1359 struct Expression * exp;
1360 } ecere_gcc_struct _renew;
1361 struct
1362 {
1363 char * table;
1364 struct Identifier * id;
1365 } ecere_gcc_struct db;
1366 struct
1367 {
1368 struct Expression * ds;
1369 struct Expression * name;
1370 } ecere_gcc_struct dbopen;
1371 struct
1372 {
1373 struct TypeName * typeName;
1374 struct Initializer * initializer;
1375 } ecere_gcc_struct initializer;
1376 struct
1377 {
1378 struct Expression * exp;
1379 struct TypeName * typeName;
1380 } ecere_gcc_struct vaArg;
1381 } ecere_gcc_struct __anon1;
1382 unsigned int debugValue;
1383 struct __ecereNameSpace__ecere__com__DataValue val;
1384 uint64 address;
1385 unsigned int hasAddress;
1386 struct Type * expType;
1387 struct Type * destType;
1388 unsigned int usage;
1389 int tempCount;
1390 unsigned int byReference;
1391 unsigned int isConstant;
1392 unsigned int addedThis;
1393 unsigned int needCast;
1394 unsigned int thisPtr;
1395 unsigned int opDestType;
1396 unsigned int needTemplateCast;
1397 } ecere_gcc_struct;
1398
1399 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1400
1401 struct Initializer
1402 {
1403 struct Initializer * prev;
1404 struct Initializer * next;
1405 struct Location loc;
1406 int type;
1407 union
1408 {
1409 struct Expression * exp;
1410 struct __ecereNameSpace__ecere__sys__OldList *  list;
1411 } ecere_gcc_struct __anon1;
1412 unsigned int isConstant;
1413 struct Identifier * id;
1414 } ecere_gcc_struct;
1415
1416 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1417
1418 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
1419
1420 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
1421
1422 struct InitDeclarator
1423 {
1424 struct InitDeclarator * prev;
1425 struct InitDeclarator * next;
1426 struct Location loc;
1427 struct Declarator * declarator;
1428 struct Initializer * initializer;
1429 } ecere_gcc_struct;
1430
1431 void ApplyLocation(struct Expression * exp, struct Location * loc)
1432 {
1433 exp->loc = *loc;
1434 switch(exp->type)
1435 {
1436 case 4:
1437 if(exp->__anon1.op.exp1)
1438 ApplyLocation(exp->__anon1.op.exp1, loc);
1439 if(exp->__anon1.op.exp2)
1440 ApplyLocation(exp->__anon1.op.exp2, loc);
1441 break;
1442 case 5:
1443 if(exp->__anon1.list)
1444 {
1445 struct Expression * e;
1446
1447 for(e = (*exp->__anon1.list).first; e; e = e->next)
1448 ApplyLocation(e, loc);
1449 }
1450 break;
1451 case 6:
1452 if(exp->__anon1.index.index)
1453 {
1454 struct Expression * e;
1455
1456 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1457 ApplyLocation(e, loc);
1458 }
1459 if(exp->__anon1.index.exp)
1460 ApplyLocation(exp->__anon1.index.exp, loc);
1461 break;
1462 case 7:
1463 if(exp->__anon1.call.arguments)
1464 {
1465 struct Expression * arg;
1466
1467 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1468 ApplyLocation(arg, loc);
1469 }
1470 if(exp->__anon1.call.exp)
1471 ApplyLocation(exp->__anon1.call.exp, loc);
1472 break;
1473 case 8:
1474 case 9:
1475 if(exp->__anon1.member.exp)
1476 ApplyLocation(exp->__anon1.member.exp, loc);
1477 break;
1478 case 11:
1479 if(exp->__anon1.cast.exp)
1480 ApplyLocation(exp->__anon1.cast.exp, loc);
1481 break;
1482 case 12:
1483 if(exp->__anon1.cond.exp)
1484 {
1485 struct Expression * e;
1486
1487 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1488 ApplyLocation(e, loc);
1489 }
1490 if(exp->__anon1.cond.cond)
1491 ApplyLocation(exp->__anon1.cond.cond, loc);
1492 if(exp->__anon1.cond.elseExp)
1493 ApplyLocation(exp->__anon1.cond.elseExp, loc);
1494 break;
1495 case 34:
1496 if(exp->__anon1.vaArg.exp)
1497 ApplyLocation(exp->__anon1.vaArg.exp, loc);
1498 break;
1499 default:
1500 break;
1501 }
1502 }
1503
1504 void __ecereMethod_Expression_Clear();
1505
1506 struct MembersInit;
1507
1508 struct MembersInit
1509 {
1510 struct MembersInit * prev;
1511 struct MembersInit * next;
1512 struct Location loc;
1513 int type;
1514 union
1515 {
1516 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1517 struct ClassFunction * function;
1518 } ecere_gcc_struct __anon1;
1519 } ecere_gcc_struct;
1520
1521 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
1522
1523 struct Operand;
1524
1525 struct OpTable
1526 {
1527 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1528 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1529 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1530 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1531 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1532 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1533 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1534 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1535 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1536 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1537 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1538 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1539 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1540 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1541 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1542 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1543 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1544 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1545 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1546 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1547 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1548 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1549 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1550 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1551 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1552 unsigned int (*  Not)(struct Expression *, struct Operand *);
1553 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1554 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1555 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1556 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1557 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1558 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1559 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1560 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1561 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1562 } ecere_gcc_struct;
1563
1564 struct Operand
1565 {
1566 int kind;
1567 struct Type * type;
1568 unsigned int ptrSize;
1569 union
1570 {
1571 char c;
1572 unsigned char uc;
1573 short s;
1574 unsigned short us;
1575 int i;
1576 unsigned int ui;
1577 float f;
1578 double d;
1579 long long i64;
1580 uint64 ui64;
1581 } ecere_gcc_struct __anon1;
1582 struct OpTable ops;
1583 } ecere_gcc_struct;
1584
1585 struct External *  _DeclareStruct(struct External *  neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl);
1586
1587 struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference)
1588 {
1589 return _DeclareStruct(neededBy, name, skipNoHead, needDereference, 0);
1590 }
1591
1592 static void _DeclareType(struct External *  neededFor, struct Type *  type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl);
1593
1594 void DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1595 {
1596 _DeclareType(neededFor, type, needDereference, forFunctionDef, 0);
1597 }
1598
1599 void DeclareTypeForwardDeclare(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1600 {
1601 _DeclareType(neededFor, type, needDereference, forFunctionDef, 1);
1602 }
1603
1604 static void _PrintType(struct Type *  type, char *  string, unsigned int printName, unsigned int fullName, unsigned int printConst);
1605
1606 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1607 {
1608 _PrintType(type, string, printName, fullName, 1);
1609 }
1610
1611 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1612 {
1613 _PrintType(type, string, printName, fullName, 0);
1614 }
1615
1616 struct __ecereNameSpace__ecere__com__Method;
1617
1618 struct __ecereNameSpace__ecere__com__Method
1619 {
1620 const char *  name;
1621 struct __ecereNameSpace__ecere__com__Method * parent;
1622 struct __ecereNameSpace__ecere__com__Method * left;
1623 struct __ecereNameSpace__ecere__com__Method * right;
1624 int depth;
1625 int (*  function)();
1626 int vid;
1627 int type;
1628 struct __ecereNameSpace__ecere__com__Class * _class;
1629 void *  symbol;
1630 const char *  dataTypeString;
1631 struct Type * dataType;
1632 int memberAccess;
1633 } ecere_gcc_struct;
1634
1635 struct Symbol
1636 {
1637 char *  string;
1638 struct Symbol * parent;
1639 struct Symbol * left;
1640 struct Symbol * right;
1641 int depth;
1642 struct Type * type;
1643 union
1644 {
1645 struct __ecereNameSpace__ecere__com__Method * method;
1646 struct __ecereNameSpace__ecere__com__Property * _property;
1647 struct __ecereNameSpace__ecere__com__Class * registered;
1648 } ecere_gcc_struct __anon1;
1649 unsigned int notYetDeclared;
1650 union
1651 {
1652 struct
1653 {
1654 struct External * pointerExternal;
1655 struct External * structExternal;
1656 } ecere_gcc_struct __anon1;
1657 struct
1658 {
1659 struct External * externalGet;
1660 struct External * externalSet;
1661 struct External * externalPtr;
1662 struct External * externalIsSet;
1663 } ecere_gcc_struct __anon2;
1664 struct
1665 {
1666 struct External * methodExternal;
1667 struct External * methodCodeExternal;
1668 } ecere_gcc_struct __anon3;
1669 } ecere_gcc_struct __anon2;
1670 unsigned int imported;
1671 unsigned int declaredStructSym;
1672 struct __ecereNameSpace__ecere__com__Class * _class;
1673 unsigned int declaredStruct;
1674 unsigned int needConstructor;
1675 unsigned int needDestructor;
1676 char *  constructorName;
1677 char *  structName;
1678 char *  className;
1679 char *  destructorName;
1680 struct ModuleImport * module;
1681 struct ClassImport * _import;
1682 struct Location nameLoc;
1683 unsigned int isParam;
1684 unsigned int isRemote;
1685 unsigned int isStruct;
1686 unsigned int fireWatchersDone;
1687 int declaring;
1688 unsigned int classData;
1689 unsigned int isStatic;
1690 char *  shortName;
1691 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
1692 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
1693 struct Context * ctx;
1694 int isIterator;
1695 struct Expression * propCategory;
1696 unsigned int mustRegister;
1697 } ecere_gcc_struct;
1698
1699 struct __ecereNameSpace__ecere__com__ClassProperty;
1700
1701 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1702
1703 struct __ecereNameSpace__ecere__com__ClassProperty
1704 {
1705 const char *  name;
1706 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1707 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1708 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1709 int depth;
1710 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1711 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1712 const char *  dataTypeString;
1713 struct Type * dataType;
1714 unsigned int constant;
1715 } ecere_gcc_struct;
1716
1717 struct __ecereNameSpace__ecere__com__BitMember;
1718
1719 struct __ecereNameSpace__ecere__com__BitMember
1720 {
1721 struct __ecereNameSpace__ecere__com__BitMember * prev;
1722 struct __ecereNameSpace__ecere__com__BitMember * next;
1723 const char *  name;
1724 unsigned int isProperty;
1725 int memberAccess;
1726 int id;
1727 struct __ecereNameSpace__ecere__com__Class * _class;
1728 const char *  dataTypeString;
1729 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1730 struct Type * dataType;
1731 int type;
1732 int size;
1733 int pos;
1734 uint64 mask;
1735 } ecere_gcc_struct;
1736
1737 struct __ecereNameSpace__ecere__com__DataMember;
1738
1739 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1740 {
1741 union
1742 {
1743 struct
1744 {
1745 const char *  dataTypeString;
1746 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1747 } ecere_gcc_struct __anon1;
1748 struct __ecereNameSpace__ecere__com__DataValue expression;
1749 struct
1750 {
1751 const char *  memberString;
1752 union
1753 {
1754 struct __ecereNameSpace__ecere__com__DataMember * member;
1755 struct __ecereNameSpace__ecere__com__Property * prop;
1756 struct __ecereNameSpace__ecere__com__Method * method;
1757 } ecere_gcc_struct __anon1;
1758 } ecere_gcc_struct __anon2;
1759 } ecere_gcc_struct __anon1;
1760 } ecere_gcc_struct;
1761
1762 extern void __ecereNameSpace__ecere__com__eClass_FindNextMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class **  curClass, struct __ecereNameSpace__ecere__com__DataMember **  curMember, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
1763
1764 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, unsigned int size, unsigned int alignment, int declMode);
1765
1766 struct TemplateParameter;
1767
1768 struct TemplateParameter
1769 {
1770 struct TemplateParameter * prev;
1771 struct TemplateParameter * next;
1772 struct Location loc;
1773 int type;
1774 struct Identifier * identifier;
1775 union
1776 {
1777 struct TemplateDatatype * dataType;
1778 int memberType;
1779 } ecere_gcc_struct __anon1;
1780 struct TemplateArgument * defaultArgument;
1781 const char *  dataTypeString;
1782 struct Type * baseType;
1783 } ecere_gcc_struct;
1784
1785 struct Type
1786 {
1787 struct Type * prev;
1788 struct Type * next;
1789 int refCount;
1790 union
1791 {
1792 struct Symbol * _class;
1793 struct
1794 {
1795 struct __ecereNameSpace__ecere__sys__OldList members;
1796 char *  enumName;
1797 } ecere_gcc_struct __anon1;
1798 struct
1799 {
1800 struct Type * returnType;
1801 struct __ecereNameSpace__ecere__sys__OldList params;
1802 struct Symbol * thisClass;
1803 unsigned int staticMethod;
1804 struct TemplateParameter * thisClassTemplate;
1805 } ecere_gcc_struct __anon2;
1806 struct
1807 {
1808 struct __ecereNameSpace__ecere__com__Method * method;
1809 struct __ecereNameSpace__ecere__com__Class * methodClass;
1810 struct __ecereNameSpace__ecere__com__Class * usedClass;
1811 } ecere_gcc_struct __anon3;
1812 struct
1813 {
1814 struct Type * arrayType;
1815 int arraySize;
1816 struct Expression * arraySizeExp;
1817 unsigned int freeExp;
1818 struct Symbol * enumClass;
1819 } ecere_gcc_struct __anon4;
1820 struct Type * type;
1821 struct TemplateParameter * templateParameter;
1822 } ecere_gcc_struct __anon1;
1823 int kind;
1824 unsigned int size;
1825 char *  name;
1826 char *  typeName;
1827 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1828 int 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)) : (short)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)) : (unsigned short)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)) : (char)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)) : (unsigned char)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)) : (short)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)) : (unsigned short)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)) : (char)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)) : (unsigned char)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((short)(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((unsigned short)(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((char)(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((unsigned char)(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((short)(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((unsigned short)(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((char)(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((unsigned char)(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((short)(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((unsigned short)(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((char)(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((unsigned char)(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((short)(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((unsigned short)(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((char)(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((unsigned char)(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 ? ((short)(op1->__anon1.s /= value2)) : (short)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 ? ((unsigned short)(op1->__anon1.us /= value2)) : (unsigned short)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 ? ((char)(op1->__anon1.c /= value2)) : (char)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 ? ((unsigned char)(op1->__anon1.uc /= value2)) : (unsigned char)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 ? ((short)(op1->__anon1.s %= value2)) : (short)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 ? ((unsigned short)(op1->__anon1.us %= value2)) : (unsigned short)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 ? ((char)(op1->__anon1.c %= value2)) : (char)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 ? ((unsigned char)(op1->__anon1.uc %= value2)) : (unsigned char)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((short)(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((unsigned short)(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((char)(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((unsigned char)(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((short)(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((unsigned short)(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((char)(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((unsigned char)(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((short)(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((unsigned short)(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((char)(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((unsigned char)(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((short)(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((unsigned short)(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((char)(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((unsigned char)(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((short)(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((unsigned short)(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((char)(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((unsigned char)(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 = (char)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 = (unsigned char)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 = (short)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 = (unsigned short)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 * computedExp = sourceExp;
13809
13810 dest->refCount++;
13811 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)
13812 {
13813 computedExp = CopyExpression(sourceExp);
13814 ComputeExpression(computedExp);
13815 }
13816 source = sourceExp->expType;
13817 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
13818 {
13819 if(computedExp != sourceExp)
13820 {
13821 FreeExpression(computedExp);
13822 computedExp = sourceExp;
13823 }
13824 FreeType(dest);
13825 return 1;
13826 }
13827 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
13828 {
13829 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
13830 {
13831 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
13832
13833 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
13834 ;
13835 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
13836 ;
13837 if(sourceBase == destBase)
13838 {
13839 if(computedExp != sourceExp)
13840 {
13841 FreeExpression(computedExp);
13842 computedExp = sourceExp;
13843 }
13844 FreeType(dest);
13845 return 1;
13846 }
13847 }
13848 }
13849 if(source)
13850 {
13851 struct __ecereNameSpace__ecere__sys__OldList * specs;
13852 unsigned int flag = 0;
13853 long long value = (((int)0x7fffffff));
13854
13855 source->refCount++;
13856 if(computedExp->type == 2)
13857 {
13858 if(source->isSigned)
13859 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13860 else
13861 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13862 }
13863 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
13864 {
13865 if(source->isSigned)
13866 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13867 else
13868 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13869 }
13870 if(computedExp != sourceExp)
13871 {
13872 FreeExpression(computedExp);
13873 computedExp = sourceExp;
13874 }
13875 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
13876 {
13877 FreeType(source);
13878 source = __extension__ ({
13879 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13880
13881 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
13882 });
13883 }
13884 if(dest->kind == 8)
13885 {
13886 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13887
13888 if(_class && _class->type == 3)
13889 {
13890 if(source->kind != 8)
13891 {
13892 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13893 struct Type * tempDest, * tempSource;
13894
13895 for(; _class->base->type != 1000; _class = _class->base)
13896 ;
13897 tempSource = dest;
13898 tempDest = tempType;
13899 tempType->kind = 8;
13900 if(!_class->symbol)
13901 _class->symbol = FindClass(_class->fullName);
13902 tempType->__anon1._class = _class->symbol;
13903 tempType->truth = dest->truth;
13904 if(tempType->__anon1._class)
13905 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13906 backupSourceExpType = sourceExp->expType;
13907 if(dest->passAsTemplate)
13908 {
13909 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13910 CopyTypeInto(sourceExp->expType, dest);
13911 sourceExp->expType->passAsTemplate = 0;
13912 }
13913 else
13914 {
13915 sourceExp->expType = dest;
13916 dest->refCount++;
13917 }
13918 flag = 1;
13919 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13920 }
13921 }
13922 if(_class && _class->type == 2 && source->kind != 8)
13923 {
13924 if(!dest->__anon1._class->__anon1.registered->dataType)
13925 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
13926 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13927 {
13928 FreeType(source);
13929 FreeType(sourceExp->expType);
13930 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
13931 source->refCount++;
13932 }
13933 }
13934 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
13935 {
13936 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13937 struct Declarator * decl;
13938 char string[1024];
13939
13940 ReadString(string, sourceExp->__anon1.__anon2.string);
13941 decl = SpecDeclFromString(string, specs, (((void *)0)));
13942 FreeExpContents(sourceExp);
13943 FreeType(sourceExp->expType);
13944 sourceExp->type = 24;
13945 sourceExp->__anon1._classExp.specifiers = specs;
13946 sourceExp->__anon1._classExp.decl = decl;
13947 sourceExp->expType = dest;
13948 dest->refCount++;
13949 FreeType(source);
13950 FreeType(dest);
13951 if(backupSourceExpType)
13952 FreeType(backupSourceExpType);
13953 return 1;
13954 }
13955 }
13956 else if(source->kind == 8)
13957 {
13958 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
13959
13960 if(_class && (_class->type == 3 || _class->type == 2))
13961 {
13962 if(dest->kind != 8)
13963 {
13964 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13965 struct Type * tempDest, * tempSource;
13966
13967 if(!source->__anon1._class->__anon1.registered->dataType)
13968 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
13969 for(; _class->base->type != 1000; _class = _class->base)
13970 ;
13971 tempDest = source;
13972 tempSource = tempType;
13973 tempType->kind = 8;
13974 tempType->__anon1._class = FindClass(_class->fullName);
13975 tempType->truth = source->truth;
13976 tempType->classObjectType = source->classObjectType;
13977 if(tempType->__anon1._class)
13978 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13979 if(conversions && conversions->last)
13980 {
13981 ((struct Conversion *)conversions->last)->resultType = dest;
13982 dest->refCount++;
13983 }
13984 FreeType(sourceExp->expType);
13985 sourceExp->expType = MkClassType(_class->fullName);
13986 sourceExp->expType->truth = source->truth;
13987 sourceExp->expType->classObjectType = source->classObjectType;
13988 if(!sourceExp->destType)
13989 {
13990 FreeType(sourceExp->destType);
13991 sourceExp->destType = sourceExp->expType;
13992 if(sourceExp->expType)
13993 sourceExp->expType->refCount++;
13994 }
13995 if(!_class->dataType)
13996 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13997 FreeType(dest);
13998 dest = MkClassType(source->__anon1._class->string);
13999 dest->truth = source->truth;
14000 dest->classObjectType = source->classObjectType;
14001 FreeType(source);
14002 source = _class->dataType;
14003 source->refCount++;
14004 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
14005 }
14006 }
14007 }
14008 if(!flag)
14009 {
14010 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
14011 {
14012 FreeType(source);
14013 FreeType(dest);
14014 return 1;
14015 }
14016 }
14017 if(dest->kind == 8)
14018 {
14019 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
14020 unsigned int fittingValue = 0;
14021
14022 if(_class && _class->type == 4)
14023 {
14024 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14025 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14026
14027 if(c && value >= 0 && value <= c->largest)
14028 fittingValue = 1;
14029 }
14030 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
14031 {
14032 if(_class->type == 0 || _class->type == 5)
14033 {
14034 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14035
14036 *newExp = *sourceExp;
14037 if(sourceExp->destType)
14038 sourceExp->destType->refCount++;
14039 if(sourceExp->expType)
14040 sourceExp->expType->refCount++;
14041 sourceExp->type = 11;
14042 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
14043 sourceExp->__anon1.cast.exp = newExp;
14044 FreeType(sourceExp->expType);
14045 sourceExp->expType = (((void *)0));
14046 ProcessExpressionType(sourceExp);
14047 if(!inCompiler)
14048 {
14049 FreeType(sourceExp->expType);
14050 sourceExp->expType = dest;
14051 }
14052 FreeType(source);
14053 if(inCompiler)
14054 FreeType(dest);
14055 if(backupSourceExpType)
14056 FreeType(backupSourceExpType);
14057 return 1;
14058 }
14059 if(!_class->dataType)
14060 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14061 FreeType(dest);
14062 dest = _class->dataType;
14063 dest->refCount++;
14064 }
14065 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))
14066 {
14067 specs = MkListOne(MkSpecifier(DOUBLE));
14068 }
14069 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))
14070 {
14071 specs = MkListOne(MkSpecifier(FLOAT));
14072 }
14073 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))
14074 {
14075 specs = MkList();
14076 if(!dest->isSigned)
14077 ListAdd(specs, MkSpecifier(UNSIGNED));
14078 ListAdd(specs, MkSpecifier(INT64));
14079 }
14080 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
14081 {
14082 specs = MkList();
14083 if(!dest->isSigned)
14084 ListAdd(specs, MkSpecifier(UNSIGNED));
14085 ListAdd(specs, MkSpecifier(INT));
14086 }
14087 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14088 {
14089 specs = MkList();
14090 if(!dest->isSigned)
14091 ListAdd(specs, MkSpecifier(UNSIGNED));
14092 ListAdd(specs, MkSpecifier(SHORT));
14093 }
14094 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14095 {
14096 specs = MkList();
14097 if(!dest->isSigned)
14098 ListAdd(specs, MkSpecifier(UNSIGNED));
14099 ListAdd(specs, MkSpecifier(CHAR));
14100 }
14101 else
14102 {
14103 FreeType(source);
14104 FreeType(dest);
14105 if(backupSourceExpType)
14106 {
14107 if(sourceExp->expType)
14108 FreeType(sourceExp->expType);
14109 sourceExp->expType = backupSourceExpType;
14110 }
14111 return 0;
14112 }
14113 }
14114 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))
14115 {
14116 specs = MkListOne(MkSpecifier(DOUBLE));
14117 }
14118 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))
14119 {
14120 specs = MkListOne(MkSpecifier(FLOAT));
14121 }
14122 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
14123 {
14124 specs = MkList();
14125 ListAdd(specs, MkSpecifier(BOOL));
14126 }
14127 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)))
14128 {
14129 specs = MkList();
14130 if(!dest->isSigned)
14131 ListAdd(specs, MkSpecifier(UNSIGNED));
14132 ListAdd(specs, MkSpecifier(CHAR));
14133 }
14134 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)))))
14135 {
14136 specs = MkList();
14137 if(!dest->isSigned)
14138 ListAdd(specs, MkSpecifier(UNSIGNED));
14139 ListAdd(specs, MkSpecifier(SHORT));
14140 }
14141 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
14142 {
14143 specs = MkList();
14144 if(!dest->isSigned)
14145 ListAdd(specs, MkSpecifier(UNSIGNED));
14146 ListAdd(specs, MkSpecifier(INT));
14147 }
14148 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
14149 {
14150 specs = MkList();
14151 if(!dest->isSigned)
14152 ListAdd(specs, MkSpecifier(UNSIGNED));
14153 ListAdd(specs, MkSpecifier(INT64));
14154 }
14155 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
14156 {
14157 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
14158 }
14159 else
14160 {
14161 FreeType(source);
14162 FreeType(dest);
14163 if(backupSourceExpType)
14164 {
14165 if(sourceExp->expType)
14166 FreeType(sourceExp->expType);
14167 sourceExp->expType = backupSourceExpType;
14168 }
14169 return 0;
14170 }
14171 if(!flag && !sourceExp->opDestType)
14172 {
14173 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14174
14175 *newExp = *sourceExp;
14176 newExp->prev = (((void *)0));
14177 newExp->next = (((void *)0));
14178 if(sourceExp->destType)
14179 sourceExp->destType->refCount++;
14180 if(sourceExp->expType)
14181 sourceExp->expType->refCount++;
14182 sourceExp->type = 11;
14183 if(realDest->kind == 8)
14184 {
14185 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
14186 FreeList(specs, (void *)(FreeSpecifier));
14187 }
14188 else
14189 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
14190 if(newExp->type == 4)
14191 {
14192 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
14193 }
14194 else
14195 sourceExp->__anon1.cast.exp = newExp;
14196 FreeType(sourceExp->expType);
14197 sourceExp->expType = (((void *)0));
14198 ProcessExpressionType(sourceExp);
14199 }
14200 else
14201 FreeList(specs, (void *)(FreeSpecifier));
14202 FreeType(dest);
14203 FreeType(source);
14204 if(backupSourceExpType)
14205 FreeType(backupSourceExpType);
14206 return 1;
14207 }
14208 else
14209 {
14210 if(computedExp != sourceExp)
14211 {
14212 FreeExpression(computedExp);
14213 computedExp = sourceExp;
14214 }
14215 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
14216 sourceExp = (*sourceExp->__anon1.list).last;
14217 if(sourceExp->type == 0)
14218 {
14219 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
14220
14221 if(dest->kind == 8)
14222 {
14223 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
14224 {
14225 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
14226 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14227
14228 if(enumClass)
14229 {
14230 for(; _class && _class->type == 4; _class = _class->base)
14231 {
14232 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
14233 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14234
14235 for(value = e->values.first; value; value = value->next)
14236 {
14237 if(!strcmp(value->name, id->string))
14238 break;
14239 }
14240 if(value)
14241 {
14242 FreeType(sourceExp->expType);
14243 sourceExp->isConstant = 1;
14244 sourceExp->expType = MkClassType(_class->fullName);
14245 if(inCompiler || inPreCompiler || inDebugger)
14246 {
14247 FreeExpContents(sourceExp);
14248 sourceExp->type = 2;
14249 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
14250 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
14251 else
14252 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
14253 }
14254 FreeType(dest);
14255 return 1;
14256 }
14257 }
14258 }
14259 }
14260 }
14261 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
14262 {
14263 FreeType(dest);
14264 return 1;
14265 }
14266 }
14267 FreeType(dest);
14268 }
14269 return 0;
14270 }
14271
14272 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
14273 {
14274 unsigned int result = 1;
14275
14276 if(destType)
14277 {
14278 struct __ecereNameSpace__ecere__sys__OldList converts =
14279 {
14280 0, 0, 0, 0, 0
14281 };
14282 struct Conversion * convert;
14283
14284 if(destType->kind == 0)
14285 return 0;
14286 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
14287 result = 0;
14288 if(converts.count)
14289 {
14290 for(convert = converts.first; convert; convert = convert->next)
14291 {
14292 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
14293
14294 if(!empty)
14295 {
14296 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14297 int objectType = exp->expType ? exp->expType->classObjectType : 0;
14298
14299 *newExp = *exp;
14300 newExp->prev = (((void *)0));
14301 newExp->next = (((void *)0));
14302 newExp->destType = (((void *)0));
14303 if(convert->isGet)
14304 {
14305 exp->type = 8;
14306 exp->addedThis = 1;
14307 exp->__anon1.member.exp = newExp;
14308 FreeType(exp->__anon1.member.exp->expType);
14309 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
14310 exp->__anon1.member.exp->expType->classObjectType = objectType;
14311 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
14312 exp->__anon1.member.memberType = 1;
14313 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14314 exp->needCast = 1;
14315 if(exp->expType)
14316 exp->expType->refCount++;
14317 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14318 }
14319 else
14320 {
14321 {
14322 exp->type = 8;
14323 exp->addedThis = 1;
14324 exp->__anon1.member.exp = newExp;
14325 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)
14326 {
14327 newExp->byReference = 1;
14328 }
14329 FreeType(exp->__anon1.member.exp->expType);
14330 exp->__anon1.member.exp->expType = (((void *)0));
14331 if(convert->convert->dataType)
14332 {
14333 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14334 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
14335 exp->__anon1.member.exp->expType->refCount = 1;
14336 exp->__anon1.member.exp->expType->classObjectType = objectType;
14337 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14338 }
14339 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
14340 exp->__anon1.member.memberType = 4;
14341 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14342 exp->needCast = 1;
14343 if(convert->resultType)
14344 convert->resultType->refCount++;
14345 }
14346 }
14347 }
14348 else
14349 {
14350 FreeType(exp->expType);
14351 if(convert->isGet)
14352 {
14353 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14354 if(exp->destType->casted)
14355 exp->needCast = 1;
14356 if(exp->expType)
14357 exp->expType->refCount++;
14358 }
14359 else
14360 {
14361 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14362 if(exp->destType->casted)
14363 exp->needCast = 1;
14364 if(convert->resultType)
14365 convert->resultType->refCount++;
14366 }
14367 }
14368 }
14369 if(exp->isConstant && inCompiler)
14370 ComputeExpression(exp);
14371 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
14372 }
14373 if(!result && exp->expType && converts.count)
14374 {
14375 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14376 }
14377 if(!result && exp->expType && exp->destType)
14378 {
14379 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))
14380 result = 1;
14381 }
14382 }
14383 return result;
14384 }
14385
14386 static void ProcessFunction(struct FunctionDefinition *  function);
14387
14388 void ProcessInstantiationType(struct Instantiation * inst)
14389 {
14390 yylloc = inst->loc;
14391 if(inst->_class)
14392 {
14393 struct MembersInit * members;
14394 struct Symbol * classSym;
14395 struct __ecereNameSpace__ecere__com__Class * _class;
14396
14397 classSym = inst->_class->__anon1.__anon1.symbol;
14398 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14399 if(!_class || _class->type != 5)
14400 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14401 afterExternal = afterExternal ? afterExternal : curExternal;
14402 if(inst->exp)
14403 ProcessExpressionType(inst->exp);
14404 inst->isConstant = 1;
14405 if(inst->members)
14406 {
14407 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14408 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14409 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14410 int subMemberStackPos = 0;
14411
14412 for(members = (*inst->members).first; members; members = members->next)
14413 {
14414 switch(members->type)
14415 {
14416 case 1:
14417 {
14418 char name[1024];
14419 static unsigned int instMethodID = 0;
14420 struct External * external = curExternal;
14421 struct Context * context = curContext;
14422 struct Declarator * declarator = members->__anon1.function->declarator;
14423 struct Identifier * nameID = GetDeclId(declarator);
14424 char * unmangled = nameID ? nameID->string : (((void *)0));
14425 struct Expression * exp;
14426 struct External * createdExternal = (((void *)0));
14427
14428 if(inCompiler)
14429 {
14430 char number[16];
14431
14432 strcpy(name, "__ecereInstMeth_");
14433 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14434 strcat(name, "_");
14435 strcat(name, nameID->string);
14436 strcat(name, "_");
14437 sprintf(number, "_%08d", instMethodID++);
14438 strcat(name, number);
14439 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14440 }
14441 if(declarator)
14442 {
14443 struct Symbol * symbol = declarator->symbol;
14444 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14445
14446 if(method && method->type == 1)
14447 {
14448 symbol->__anon1.method = method;
14449 ProcessMethodType(method);
14450 if(!symbol->type->__anon1.__anon2.thisClass)
14451 {
14452 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14453 {
14454 if(!currentClass->symbol)
14455 currentClass->symbol = FindClass(currentClass->fullName);
14456 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14457 }
14458 else
14459 {
14460 if(!_class->symbol)
14461 _class->symbol = FindClass(_class->fullName);
14462 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14463 }
14464 }
14465 DeclareType(curExternal, symbol->type, 1, 1);
14466 }
14467 else if(classSym)
14468 {
14469 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14470 }
14471 }
14472 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14473 if(nameID)
14474 {
14475 FreeSpecifier(nameID->_class);
14476 nameID->_class = (((void *)0));
14477 }
14478 curExternal = createdExternal;
14479 if(inCompiler)
14480 {
14481 if(createdExternal->__anon1.function)
14482 ProcessFunction(createdExternal->__anon1.function);
14483 }
14484 else if(declarator)
14485 {
14486 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14487 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14488 }
14489 curExternal = external;
14490 curContext = context;
14491 if(inCompiler)
14492 {
14493 FreeClassFunction(members->__anon1.function);
14494 exp = QMkExpId(name);
14495 members->type = 0;
14496 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14497 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14498 }
14499 break;
14500 }
14501 case 0:
14502 {
14503 if(members->__anon1.dataMembers && classSym)
14504 {
14505 struct MemberInit * member;
14506 struct Location oldyyloc = yylloc;
14507
14508 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14509 {
14510 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14511 if(member->initializer && !member->initializer->isConstant)
14512 inst->isConstant = 0;
14513 }
14514 yylloc = oldyyloc;
14515 }
14516 break;
14517 }
14518 }
14519 }
14520 }
14521 }
14522 }
14523
14524 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14525
14526 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14527 {
14528 switch(spec->type)
14529 {
14530 case 0:
14531 {
14532 if(spec->__anon1.specifier == THISCLASS)
14533 {
14534 if(thisClass)
14535 {
14536 spec->type = 1;
14537 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14538 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14539 ProcessSpecifier(spec, declareStruct, 0);
14540 }
14541 }
14542 break;
14543 }
14544 case 1:
14545 {
14546 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14547
14548 if(symbol)
14549 DeclareType(curExternal, symbol->type, 1, 1);
14550 else if(spec->__anon1.__anon1.symbol)
14551 {
14552 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14553
14554 if(warnClasses && !c)
14555 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14556 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14557 }
14558 break;
14559 }
14560 case 2:
14561 {
14562 struct Enumerator * e;
14563
14564 if(spec->__anon1.__anon2.list)
14565 {
14566 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14567 {
14568 if(e->exp)
14569 ProcessExpressionType(e->exp);
14570 }
14571 }
14572 if(inCompiler)
14573 break;
14574 }
14575 case 3:
14576 case 4:
14577 {
14578 if(spec->__anon1.__anon2.definitions)
14579 {
14580 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14581
14582 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14583 }
14584 break;
14585 }
14586 }
14587 }
14588
14589 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14590 {
14591 switch(decl->type)
14592 {
14593 case 1:
14594 if(decl->__anon1.identifier->classSym)
14595 {
14596 FreeSpecifier(decl->__anon1.identifier->_class);
14597 decl->__anon1.identifier->_class = (((void *)0));
14598 }
14599 break;
14600 case 3:
14601 if(decl->__anon1.array.exp)
14602 ProcessExpressionType(decl->__anon1.array.exp);
14603 case 0:
14604 case 2:
14605 case 4:
14606 case 5:
14607 case 6:
14608 case 7:
14609 {
14610 struct Identifier * id = (((void *)0));
14611 struct Specifier * classSpec = (((void *)0));
14612
14613 if(decl->type == 4)
14614 {
14615 id = GetDeclId(decl);
14616 if(id && id->_class)
14617 {
14618 classSpec = id->_class;
14619 id->_class = (((void *)0));
14620 }
14621 }
14622 if(decl->declarator)
14623 ProcessDeclarator(decl->declarator, isFunction);
14624 if(decl->type == 4)
14625 {
14626 if(classSpec)
14627 {
14628 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14629
14630 if(!decl->__anon1.function.parameters)
14631 decl->__anon1.function.parameters = MkList();
14632 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14633 }
14634 if(decl->__anon1.function.parameters)
14635 {
14636 struct TypeName * param;
14637
14638 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14639 {
14640 if(param->qualifiers)
14641 {
14642 struct Specifier * spec;
14643
14644 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14645 {
14646 if(spec->type == 0)
14647 {
14648 if(spec->__anon1.specifier == TYPED_OBJECT)
14649 {
14650 struct Declarator * d = param->declarator;
14651 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);
14652
14653 if(d->type != 5)
14654 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14655 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14656 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14657 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14658 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14659 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14660 param = newParam;
14661 break;
14662 }
14663 else if(spec->__anon1.specifier == ANY_OBJECT)
14664 {
14665 struct Declarator * d = param->declarator;
14666
14667 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14668 param->qualifiers = MkListOne(MkSpecifier(VOID));
14669 if(d->type != 5)
14670 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14671 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14672 break;
14673 }
14674 else if(spec->__anon1.specifier == THISCLASS)
14675 {
14676 if(thisClass)
14677 {
14678 spec->type = 1;
14679 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14680 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14681 ProcessSpecifier(spec, 0, 0);
14682 }
14683 break;
14684 }
14685 }
14686 else if(spec->type == 1)
14687 {
14688 ProcessSpecifier(spec, isFunction, 1);
14689 }
14690 }
14691 }
14692 if(param->declarator)
14693 ProcessDeclarator(param->declarator, 0);
14694 }
14695 }
14696 }
14697 break;
14698 }
14699 }
14700 }
14701
14702 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14703 {
14704 yylloc = decl->loc;
14705 switch(decl->type)
14706 {
14707 case 1:
14708 {
14709 unsigned int declareStruct = 0;
14710
14711 if(decl->__anon1.__anon1.declarators)
14712 {
14713 struct InitDeclarator * d;
14714
14715 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14716 {
14717 struct Type * type, * subType;
14718
14719 ProcessDeclarator(d->declarator, 0);
14720 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14721 if(d->initializer)
14722 {
14723 ProcessInitializer(d->initializer, type);
14724 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14725 {
14726 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14727 {
14728 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14729
14730 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14731 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14732 if(decl->__anon1.__anon1.specifiers)
14733 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14734 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14735 d = (((void *)0));
14736 decl->type = 2;
14737 decl->__anon1.inst = inst;
14738 }
14739 }
14740 }
14741 for(subType = type; subType; )
14742 {
14743 if(subType->kind == 8)
14744 {
14745 declareStruct = 1;
14746 break;
14747 }
14748 else if(subType->kind == 13)
14749 break;
14750 else if(subType->kind == 12)
14751 subType = subType->__anon1.__anon4.arrayType;
14752 else
14753 break;
14754 }
14755 FreeType(type);
14756 if(!d)
14757 break;
14758 }
14759 }
14760 if(decl->__anon1.__anon1.specifiers)
14761 {
14762 struct Specifier * s;
14763
14764 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
14765 {
14766 ProcessSpecifier(s, declareStruct, 1);
14767 }
14768 }
14769 break;
14770 }
14771 case 2:
14772 {
14773 ProcessInstantiationType(decl->__anon1.inst);
14774 break;
14775 }
14776 case 0:
14777 {
14778 struct Specifier * spec;
14779 struct Declarator * d;
14780 unsigned int declareStruct = 0;
14781
14782 if(decl->__anon1.__anon1.declarators)
14783 {
14784 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14785 {
14786 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14787 struct Type * subType;
14788
14789 ProcessDeclarator(d, 0);
14790 for(subType = type; subType; )
14791 {
14792 if(subType->kind == 8)
14793 {
14794 declareStruct = 1;
14795 break;
14796 }
14797 else if(subType->kind == 13)
14798 break;
14799 else if(subType->kind == 12)
14800 subType = subType->__anon1.__anon4.arrayType;
14801 else
14802 break;
14803 }
14804 FreeType(type);
14805 }
14806 }
14807 if(decl->__anon1.__anon1.specifiers)
14808 {
14809 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
14810 ProcessSpecifier(spec, declareStruct, warnClasses);
14811 }
14812 break;
14813 }
14814 }
14815 }
14816
14817 static void ProcessStatement(struct Statement * stmt)
14818 {
14819 yylloc = stmt->loc;
14820 switch(stmt->type)
14821 {
14822 case 0:
14823 ProcessStatement(stmt->__anon1.labeled.stmt);
14824 break;
14825 case 1:
14826 if(stmt->__anon1.caseStmt.exp)
14827 {
14828 FreeType(stmt->__anon1.caseStmt.exp->destType);
14829 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
14830 if(curSwitchType)
14831 curSwitchType->refCount++;
14832 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
14833 ComputeExpression(stmt->__anon1.caseStmt.exp);
14834 }
14835 if(stmt->__anon1.caseStmt.stmt)
14836 ProcessStatement(stmt->__anon1.caseStmt.stmt);
14837 break;
14838 case 2:
14839 {
14840 if(stmt->__anon1.compound.context)
14841 {
14842 struct Declaration * decl;
14843 struct Statement * s;
14844 struct Statement * prevCompound = curCompound;
14845 struct Context * prevContext = curContext;
14846
14847 if(!stmt->__anon1.compound.isSwitch)
14848 curCompound = stmt;
14849 curContext = stmt->__anon1.compound.context;
14850 if(stmt->__anon1.compound.declarations)
14851 {
14852 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
14853 ProcessDeclaration(decl, 1);
14854 }
14855 if(stmt->__anon1.compound.statements)
14856 {
14857 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
14858 ProcessStatement(s);
14859 }
14860 curContext = prevContext;
14861 curCompound = prevCompound;
14862 }
14863 break;
14864 }
14865 case 3:
14866 {
14867 struct Expression * exp;
14868
14869 if(stmt->__anon1.expressions)
14870 {
14871 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14872 ProcessExpressionType(exp);
14873 }
14874 break;
14875 }
14876 case 4:
14877 {
14878 struct Expression * exp;
14879
14880 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
14881 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
14882 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
14883 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
14884 {
14885 ProcessExpressionType(exp);
14886 }
14887 if(stmt->__anon1.ifStmt.stmt)
14888 ProcessStatement(stmt->__anon1.ifStmt.stmt);
14889 if(stmt->__anon1.ifStmt.elseStmt)
14890 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
14891 break;
14892 }
14893 case 5:
14894 {
14895 struct Type * oldSwitchType = curSwitchType;
14896
14897 if(stmt->__anon1.switchStmt.exp)
14898 {
14899 struct Expression * exp;
14900
14901 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
14902 {
14903 if(!exp->next)
14904 {
14905 ProcessExpressionType(exp);
14906 }
14907 if(!exp->next)
14908 curSwitchType = exp->expType;
14909 }
14910 }
14911 ProcessStatement(stmt->__anon1.switchStmt.stmt);
14912 curSwitchType = oldSwitchType;
14913 break;
14914 }
14915 case 6:
14916 {
14917 if(stmt->__anon1.whileStmt.exp)
14918 {
14919 struct Expression * exp;
14920
14921 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
14922 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
14923 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
14924 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
14925 {
14926 ProcessExpressionType(exp);
14927 }
14928 }
14929 if(stmt->__anon1.whileStmt.stmt)
14930 ProcessStatement(stmt->__anon1.whileStmt.stmt);
14931 break;
14932 }
14933 case 7:
14934 {
14935 if(stmt->__anon1.doWhile.exp)
14936 {
14937 struct Expression * exp;
14938
14939 if((*stmt->__anon1.doWhile.exp).last)
14940 {
14941 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
14942 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
14943 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
14944 }
14945 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
14946 {
14947 ProcessExpressionType(exp);
14948 }
14949 }
14950 if(stmt->__anon1.doWhile.stmt)
14951 ProcessStatement(stmt->__anon1.doWhile.stmt);
14952 break;
14953 }
14954 case 8:
14955 {
14956 struct Expression * exp;
14957
14958 if(stmt->__anon1.forStmt.init)
14959 ProcessStatement(stmt->__anon1.forStmt.init);
14960 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
14961 {
14962 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
14963 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
14964 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
14965 }
14966 if(stmt->__anon1.forStmt.check)
14967 ProcessStatement(stmt->__anon1.forStmt.check);
14968 if(stmt->__anon1.forStmt.increment)
14969 {
14970 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
14971 ProcessExpressionType(exp);
14972 }
14973 if(stmt->__anon1.forStmt.stmt)
14974 ProcessStatement(stmt->__anon1.forStmt.stmt);
14975 break;
14976 }
14977 case 18:
14978 {
14979 struct Identifier * id = stmt->__anon1.forEachStmt.id;
14980 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
14981 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
14982 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
14983 char iteratorType[1024];
14984 struct Type * source;
14985 struct Expression * e;
14986 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));
14987 struct Expression * arrayExp;
14988 const char * typeString = (((void *)0));
14989 int builtinCount = 0;
14990
14991 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
14992 {
14993 if(!e->next)
14994 {
14995 FreeType(e->destType);
14996 e->destType = ProcessTypeString("Container", 0);
14997 }
14998 if(!isBuiltin || e->next)
14999 ProcessExpressionType(e);
15000 }
15001 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15002 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)))
15003 {
15004 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
15005 struct Symbol * symbol;
15006 struct Expression * expIt = (((void *)0));
15007 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
15008 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15009 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15010 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15011
15012 if(inCompiler)
15013 {
15014 stmt->type = 2;
15015 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15016 stmt->__anon1.compound.context->parent = curContext;
15017 curContext = stmt->__anon1.compound.context;
15018 }
15019 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
15020 {
15021 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15022
15023 isCustomAVLTree = 1;
15024 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
15025 isMap = 1;
15026 }
15027 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15028 isArray = 1;
15029 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15030 {
15031 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15032
15033 isLinkList = 1;
15034 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15035 }
15036 if(inCompiler && isArray)
15037 {
15038 struct Declarator * decl;
15039 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15040
15041 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15042 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15043 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15044 }
15045 else if(isBuiltin)
15046 {
15047 struct Type * type = (((void *)0));
15048 char typeStringBuf[1024];
15049
15050 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15051 if(((struct Expression *)(*exp).last)->type == 11)
15052 {
15053 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15054
15055 if(typeName)
15056 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15057 }
15058 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)
15059 {
15060 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15061
15062 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15063 }
15064 else if(arrayExp->__anon1.list)
15065 {
15066 struct Expression * e;
15067
15068 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15069 {
15070 ProcessExpressionType(e);
15071 if(e->expType)
15072 {
15073 if(!type)
15074 {
15075 type = e->expType;
15076 type->refCount++;
15077 }
15078 else
15079 {
15080 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15081 {
15082 FreeType(type);
15083 type = e->expType;
15084 e->expType = (((void *)0));
15085 e = (*arrayExp->__anon1.list).first;
15086 ProcessExpressionType(e);
15087 if(e->expType)
15088 {
15089 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15090 {
15091 FreeType(e->expType);
15092 e->expType = (((void *)0));
15093 FreeType(type);
15094 type = (((void *)0));
15095 break;
15096 }
15097 }
15098 }
15099 }
15100 if(e->expType)
15101 {
15102 FreeType(e->expType);
15103 e->expType = (((void *)0));
15104 }
15105 }
15106 }
15107 if(type)
15108 {
15109 typeStringBuf[0] = '\0';
15110 PrintType(type, typeStringBuf, 0, 1);
15111 typeString = typeStringBuf;
15112 FreeType(type);
15113 }
15114 }
15115 if(typeString)
15116 {
15117 if(inCompiler)
15118 {
15119 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15120 struct Declarator * decl;
15121 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15122
15123 if(arrayExp->__anon1.list)
15124 {
15125 struct Expression * e;
15126
15127 builtinCount = (*arrayExp->__anon1.list).count;
15128 type = ProcessTypeString(typeString, 0);
15129 while((e = (*arrayExp->__anon1.list).first))
15130 {
15131 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15132 e->destType = type;
15133 type->refCount++;
15134 ProcessExpressionType(e);
15135 if(inCompiler)
15136 ListAdd(initializers, MkInitializerAssignment(e));
15137 }
15138 FreeType(type);
15139 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15140 }
15141 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15142 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15143 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15144 FreeList(exp, (void *)(FreeExpression));
15145 }
15146 else if(arrayExp->__anon1.list)
15147 {
15148 struct Expression * e;
15149
15150 type = ProcessTypeString(typeString, 0);
15151 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15152 {
15153 e->destType = type;
15154 type->refCount++;
15155 ProcessExpressionType(e);
15156 }
15157 FreeType(type);
15158 }
15159 }
15160 else
15161 {
15162 arrayExp->expType = ProcessTypeString("Container", 0);
15163 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15164 }
15165 }
15166 else if(inCompiler && isLinkList && !isList)
15167 {
15168 struct Declarator * decl;
15169 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15170
15171 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15172 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15173 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15174 }
15175 else if(inCompiler && _class->templateArgs)
15176 {
15177 if(isMap)
15178 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15179 else
15180 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15181 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)))))))));
15182 }
15183 if(inCompiler)
15184 {
15185 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15186 if(block)
15187 {
15188 switch(block->type)
15189 {
15190 case 2:
15191 if(block->__anon1.compound.context)
15192 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15193 break;
15194 case 4:
15195 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15196 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15197 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15198 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15199 break;
15200 case 5:
15201 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15202 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15203 break;
15204 case 6:
15205 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15206 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15207 break;
15208 case 7:
15209 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15210 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15211 break;
15212 case 8:
15213 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15214 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15215 break;
15216 case 18:
15217 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15218 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15219 break;
15220 }
15221 }
15222 if(filter)
15223 {
15224 block = MkIfStmt(filter, block, (((void *)0)));
15225 }
15226 if(isArray)
15227 {
15228 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));
15229 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15230 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15231 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15232 }
15233 else if(isBuiltin)
15234 {
15235 char count[128];
15236
15237 sprintf(count, "%d", builtinCount);
15238 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));
15239 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15240 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15241 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15242 }
15243 else if(isLinkList && !isList)
15244 {
15245 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15246 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15247
15248 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15249 {
15250 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));
15251 }
15252 else
15253 {
15254 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15255 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15256
15257 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));
15258 }
15259 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15260 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15261 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15262 }
15263 else
15264 {
15265 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15266 }
15267 ProcessExpressionType(expIt);
15268 if((*stmt->__anon1.compound.declarations).first)
15269 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15270 if(symbol)
15271 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15272 ProcessStatement(stmt);
15273 }
15274 else
15275 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15276 if(inCompiler)
15277 curContext = stmt->__anon1.compound.context->parent;
15278 break;
15279 }
15280 else
15281 {
15282 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15283 }
15284 break;
15285 }
15286 case 9:
15287 break;
15288 case 10:
15289 break;
15290 case 11:
15291 break;
15292 case 12:
15293 {
15294 struct Expression * exp;
15295
15296 if(stmt->__anon1.expressions)
15297 {
15298 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15299 {
15300 if(!exp->next)
15301 {
15302 if(curFunction && !curFunction->type)
15303 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15304 FreeType(exp->destType);
15305 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15306 if(exp->destType)
15307 exp->destType->refCount++;
15308 }
15309 ProcessExpressionType(exp);
15310 }
15311 }
15312 break;
15313 }
15314 case 14:
15315 {
15316 ProcessDeclaration(stmt->__anon1.decl, 1);
15317 break;
15318 }
15319 case 13:
15320 {
15321 struct AsmField * field;
15322
15323 if(stmt->__anon1.asmStmt.inputFields)
15324 {
15325 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15326 if(field->expression)
15327 ProcessExpressionType(field->expression);
15328 }
15329 if(stmt->__anon1.asmStmt.outputFields)
15330 {
15331 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15332 if(field->expression)
15333 ProcessExpressionType(field->expression);
15334 }
15335 if(stmt->__anon1.asmStmt.clobberedFields)
15336 {
15337 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15338 {
15339 if(field->expression)
15340 ProcessExpressionType(field->expression);
15341 }
15342 }
15343 break;
15344 }
15345 case 17:
15346 {
15347 struct PropertyWatch * propWatch;
15348 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15349 struct Expression * object = stmt->__anon1._watch.object;
15350 struct Expression * watcher = stmt->__anon1._watch.watcher;
15351
15352 if(watcher)
15353 ProcessExpressionType(watcher);
15354 if(object)
15355 ProcessExpressionType(object);
15356 if(inCompiler)
15357 {
15358 if(watcher || thisClass)
15359 {
15360 struct External * external = curExternal;
15361 struct Context * context = curContext;
15362
15363 stmt->type = 3;
15364 stmt->__anon1.expressions = MkList();
15365 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15366 {
15367 struct ClassFunction * func;
15368 char watcherName[1024];
15369 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;
15370 struct External * createdExternal;
15371
15372 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15373 if(propWatch->deleteWatch)
15374 strcat(watcherName, "_delete");
15375 else
15376 {
15377 struct Identifier * propID;
15378
15379 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15380 {
15381 strcat(watcherName, "_");
15382 strcat(watcherName, propID->string);
15383 }
15384 }
15385 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15386 {
15387 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)));
15388 ProcessClassFunctionBody(func, propWatch->compound);
15389 propWatch->compound = (((void *)0));
15390 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15391 FreeClassFunction(func);
15392 curExternal = createdExternal;
15393 ProcessFunction(createdExternal->__anon1.function);
15394 if(propWatch->deleteWatch)
15395 {
15396 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15397
15398 ListAdd(args, CopyExpression(object));
15399 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15400 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15401 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15402 }
15403 else
15404 {
15405 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15406 struct Identifier * propID;
15407
15408 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15409 {
15410 char propName[1024];
15411 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15412
15413 if(prop)
15414 {
15415 char getName[1024], setName[1024];
15416 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15417
15418 DeclareProperty(createdExternal, prop, setName, getName);
15419 strcpy(propName, "__ecereProp_");
15420 FullClassNameCat(propName, prop->_class->fullName, 0);
15421 strcat(propName, "_");
15422 FullClassNameCat(propName, prop->name, 1);
15423 ListAdd(args, CopyExpression(object));
15424 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15425 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15426 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15427 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15428 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15429 }
15430 else
15431 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15432 }
15433 }
15434 }
15435 else
15436 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15437 }
15438 curExternal = external;
15439 curContext = context;
15440 if(watcher)
15441 FreeExpression(watcher);
15442 if(object)
15443 FreeExpression(object);
15444 FreeList(watches, (void *)(FreePropertyWatch));
15445 }
15446 else
15447 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15448 }
15449 else
15450 {
15451 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15452 {
15453 ProcessStatement(propWatch->compound);
15454 }
15455 }
15456 break;
15457 }
15458 case 15:
15459 {
15460 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15461 struct Expression * object = stmt->__anon1._watch.object;
15462 struct __ecereNameSpace__ecere__com__Class * _class;
15463
15464 if(object)
15465 ProcessExpressionType(object);
15466 if(inCompiler)
15467 {
15468 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15469 if(_class)
15470 {
15471 struct Identifier * propID;
15472
15473 stmt->type = 3;
15474 stmt->__anon1.expressions = MkList();
15475 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15476 {
15477 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15478 }
15479 else if(!watches)
15480 {
15481 }
15482 if(watches)
15483 {
15484 for(propID = (*watches).first; propID; propID = propID->next)
15485 {
15486 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15487
15488 if(prop)
15489 {
15490 CreateFireWatcher(prop, object, stmt);
15491 }
15492 else
15493 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15494 }
15495 }
15496 else
15497 {
15498 struct __ecereNameSpace__ecere__com__Property * prop;
15499 struct __ecereNameSpace__ecere__com__Class * base;
15500
15501 for(base = _class; base; base = base->base)
15502 {
15503 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15504 {
15505 if(prop->isProperty && prop->isWatchable)
15506 {
15507 CreateFireWatcher(prop, object, stmt);
15508 }
15509 }
15510 }
15511 }
15512 if(object)
15513 FreeExpression(object);
15514 FreeList(watches, (void *)(FreeIdentifier));
15515 }
15516 else
15517 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15518 }
15519 break;
15520 }
15521 case 16:
15522 {
15523 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15524 struct Expression * object = stmt->__anon1._watch.object;
15525 struct Expression * watcher = stmt->__anon1._watch.watcher;
15526 struct __ecereNameSpace__ecere__com__Class * _class;
15527
15528 if(object)
15529 ProcessExpressionType(object);
15530 if(watcher)
15531 ProcessExpressionType(watcher);
15532 if(inCompiler)
15533 {
15534 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15535 if(watcher || thisClass)
15536 {
15537 if(_class)
15538 {
15539 struct Identifier * propID;
15540
15541 stmt->type = 3;
15542 stmt->__anon1.expressions = MkList();
15543 if(!watches)
15544 {
15545 struct __ecereNameSpace__ecere__sys__OldList * args;
15546
15547 args = MkList();
15548 ListAdd(args, CopyExpression(object));
15549 ListAdd(args, MkExpConstant("0"));
15550 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15551 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15552 }
15553 else
15554 {
15555 for(propID = (*watches).first; propID; propID = propID->next)
15556 {
15557 char propName[1024];
15558 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15559
15560 if(prop)
15561 {
15562 char getName[1024], setName[1024];
15563 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15564
15565 DeclareProperty(curExternal, prop, setName, getName);
15566 strcpy(propName, "__ecereProp_");
15567 FullClassNameCat(propName, prop->_class->fullName, 0);
15568 strcat(propName, "_");
15569 FullClassNameCat(propName, prop->name, 1);
15570 ListAdd(args, CopyExpression(object));
15571 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15572 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15573 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15574 }
15575 else
15576 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15577 }
15578 }
15579 if(object)
15580 FreeExpression(object);
15581 if(watcher)
15582 FreeExpression(watcher);
15583 FreeList(watches, (void *)(FreeIdentifier));
15584 }
15585 else
15586 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15587 }
15588 else
15589 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15590 }
15591 break;
15592 }
15593 }
15594 }
15595
15596 void ComputeDataTypes()
15597 {
15598 struct External * external;
15599
15600 currentClass = (((void *)0));
15601 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15602 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15603 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15604 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15605 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15606 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15607 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15608 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15609 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15610 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15611 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15612 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15613 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15614 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15615 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15616 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15617 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15618 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15619 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15620 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15621 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15622 for(external = (*ast).first; external; external = external->next)
15623 {
15624 afterExternal = curExternal = external;
15625 if(external->type == 0)
15626 {
15627 if(memoryGuard)
15628 {
15629 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15630 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15631 }
15632 currentClass = external->__anon1.function->_class;
15633 ProcessFunction(external->__anon1.function);
15634 }
15635 else if(external->type == 1)
15636 {
15637 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15638 {
15639 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15640 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15641 }
15642 currentClass = (((void *)0));
15643 if(external->__anon1.declaration)
15644 ProcessDeclaration(external->__anon1.declaration, 1);
15645 }
15646 else if(external->type == 2)
15647 {
15648 struct ClassDefinition * _class = external->__anon1._class;
15649
15650 currentClass = external->symbol->__anon1.registered;
15651 if(memoryGuard)
15652 {
15653 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15654 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15655 }
15656 if(_class->definitions)
15657 {
15658 ProcessClass(_class->definitions, _class->symbol);
15659 }
15660 if(inCompiler)
15661 {
15662 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15663 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
15664 }
15665 }
15666 else if(external->type == 4)
15667 {
15668 thisNameSpace = external->__anon1.id->string;
15669 }
15670 }
15671 currentClass = (((void *)0));
15672 thisNameSpace = (((void *)0));
15673 curExternal = (((void *)0));
15674 }
15675
15676 void ProcessExpressionType(struct Expression * exp)
15677 {
15678 unsigned int unresolved = 0;
15679 struct Location oldyylloc = yylloc;
15680 unsigned int notByReference = 0;
15681
15682 if(!exp || exp->expType)
15683 return ;
15684 yylloc = exp->loc;
15685 switch(exp->type)
15686 {
15687 case 0:
15688 {
15689 struct Identifier * id = exp->__anon1.__anon1.identifier;
15690
15691 if(!id || !topContext)
15692 return ;
15693 if(id->_class && id->_class->__anon1.__anon1.name)
15694 {
15695 id->classSym = id->_class->__anon1.__anon1.symbol;
15696 }
15697 if(!strcmp(id->string, "__runtimePlatform"))
15698 {
15699 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15700 break;
15701 }
15702 else if(strstr(id->string, "__ecereClass") == id->string)
15703 {
15704 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15705 break;
15706 }
15707 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15708 {
15709 ReplaceClassMembers(exp, thisClass);
15710 if(exp->type != 0)
15711 {
15712 ProcessExpressionType(exp);
15713 break;
15714 }
15715 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15716 break;
15717 }
15718 else
15719 {
15720 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15721
15722 if(!symbol)
15723 {
15724 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15725 break;
15726 else
15727 {
15728 if(thisClass)
15729 {
15730 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15731 if(exp->type != 0)
15732 {
15733 ProcessExpressionType(exp);
15734 break;
15735 }
15736 }
15737 else if(currentClass && !id->_class)
15738 {
15739 if(ResolveIdWithClass(exp, currentClass, 1))
15740 break;
15741 }
15742 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15743 }
15744 }
15745 if(symbol)
15746 {
15747 struct Type * type = symbol->type;
15748 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15749
15750 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15751 {
15752 struct Context * context = SetupTemplatesContext(_class);
15753
15754 type = ReplaceThisClassType(_class);
15755 FinishTemplatesContext(context);
15756 if(type)
15757 type->refCount = 0;
15758 }
15759 FreeSpecifier(id->_class);
15760 id->_class = (((void *)0));
15761 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15762 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
15763 id->classSym = (((void *)0));
15764 exp->expType = type;
15765 if(type)
15766 type->refCount++;
15767 if(type && (type->kind == 15))
15768 exp->isConstant = 1;
15769 if(symbol->isParam || !strcmp(id->string, "this"))
15770 {
15771 if(_class && _class->type == 1 && !type->declaredWithStruct)
15772 exp->byReference = 1;
15773 }
15774 if(symbol->isIterator)
15775 {
15776 if(symbol->isIterator == 3)
15777 {
15778 exp->type = 5;
15779 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
15780 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
15781 exp->expType = (((void *)0));
15782 ProcessExpressionType(exp);
15783 }
15784 else if(symbol->isIterator != 4)
15785 {
15786 exp->type = 8;
15787 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
15788 exp->__anon1.member.exp->expType = exp->expType;
15789 exp->__anon1.member.member = MkIdentifier("data");
15790 exp->expType = (((void *)0));
15791 ProcessExpressionType(exp);
15792 }
15793 }
15794 break;
15795 }
15796 else
15797 {
15798 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
15799
15800 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15801 {
15802 char name[1024];
15803
15804 strcpy(name, thisNameSpace);
15805 strcat(name, "::");
15806 strcat(name, id->string);
15807 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
15808 }
15809 if(!definedExp)
15810 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
15811 if(definedExp)
15812 {
15813 int c;
15814
15815 for(c = 0; c < definedExpStackPos; c++)
15816 if(definedExpStack[c] == definedExp)
15817 break;
15818 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
15819 {
15820 struct Location backupYylloc = yylloc;
15821 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
15822
15823 definedExpStack[definedExpStackPos++] = definedExp;
15824 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
15825 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
15826 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15827
15828 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15829 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
15830 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
15831 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15832
15833 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15834 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
15835 echoOn = 0;
15836 parsedExpression = (((void *)0));
15837 resetScanner();
15838 expression_yyparse();
15839 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
15840 if(backInput)
15841 fileInput = backInput;
15842 yylloc = backupYylloc;
15843 if(parsedExpression)
15844 {
15845 FreeIdentifier(id);
15846 exp->type = 5;
15847 exp->__anon1.list = MkListOne(parsedExpression);
15848 ApplyLocation(parsedExpression, &yylloc);
15849 ProcessExpressionType(exp);
15850 definedExpStackPos--;
15851 return ;
15852 }
15853 definedExpStackPos--;
15854 }
15855 else
15856 {
15857 if(inCompiler)
15858 {
15859 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
15860 }
15861 }
15862 }
15863 else
15864 {
15865 struct GlobalData * data = (((void *)0));
15866
15867 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15868 {
15869 char name[1024];
15870
15871 strcpy(name, thisNameSpace);
15872 strcat(name, "::");
15873 strcat(name, id->string);
15874 data = FindGlobalData(name);
15875 }
15876 if(!data)
15877 data = FindGlobalData(id->string);
15878 if(data)
15879 {
15880 DeclareGlobalData(curExternal, data);
15881 exp->expType = data->dataType;
15882 if(data->dataType)
15883 data->dataType->refCount++;
15884 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15885 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
15886 FreeSpecifier(id->_class);
15887 id->_class = (((void *)0));
15888 break;
15889 }
15890 else
15891 {
15892 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
15893
15894 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15895 {
15896 char name[1024];
15897
15898 strcpy(name, thisNameSpace);
15899 strcat(name, "::");
15900 strcat(name, id->string);
15901 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
15902 }
15903 if(!function)
15904 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
15905 if(function)
15906 {
15907 char name[1024];
15908
15909 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15910 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
15911 name[0] = 0;
15912 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
15913 strcpy(name, "__ecereFunction_");
15914 FullClassNameCat(name, id->string, 0);
15915 if(DeclareFunction(curExternal, function, name))
15916 {
15917 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15918 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
15919 }
15920 exp->expType = function->dataType;
15921 if(function->dataType)
15922 function->dataType->refCount++;
15923 FreeSpecifier(id->_class);
15924 id->_class = (((void *)0));
15925 break;
15926 }
15927 }
15928 }
15929 }
15930 }
15931 unresolved = 1;
15932 break;
15933 }
15934 case 1:
15935 {
15936 if(!exp->__anon1.instance->_class)
15937 {
15938 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
15939 {
15940 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
15941 }
15942 }
15943 ProcessInstantiationType(exp->__anon1.instance);
15944 exp->isConstant = exp->__anon1.instance->isConstant;
15945 if(exp->__anon1.instance->_class)
15946 {
15947 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
15948 }
15949 break;
15950 }
15951 case 2:
15952 {
15953 if(!exp->expType)
15954 {
15955 char * constant = exp->__anon1.__anon1.constant;
15956 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
15957
15958 exp->expType = type;
15959 if(constant[0] == '\'')
15960 {
15961 if((int)((unsigned char *)constant)[1] > 127)
15962 {
15963 int nb;
15964 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
15965
15966 if(nb < 2)
15967 ch = constant[1];
15968 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
15969 exp->__anon1.__anon1.constant = PrintUInt(ch);
15970 type->kind = 8;
15971 type->__anon1._class = FindClass("unichar");
15972 type->isSigned = 0;
15973 }
15974 else
15975 {
15976 type->kind = 1;
15977 type->isSigned = 1;
15978 }
15979 }
15980 else
15981 {
15982 char * dot = strchr(constant, '.');
15983 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
15984 char * exponent;
15985
15986 if(isHex)
15987 {
15988 exponent = strchr(constant, 'p');
15989 if(!exponent)
15990 exponent = strchr(constant, 'P');
15991 }
15992 else
15993 {
15994 exponent = strchr(constant, 'e');
15995 if(!exponent)
15996 exponent = strchr(constant, 'E');
15997 }
15998 if(dot || exponent)
15999 {
16000 if(strchr(constant, 'f') || strchr(constant, 'F'))
16001 type->kind = 6;
16002 else
16003 type->kind = 7;
16004 type->isSigned = 1;
16005 }
16006 else
16007 {
16008 unsigned int isSigned = constant[0] == '-';
16009 char * endP = (((void *)0));
16010 long long i64 = strtoll(constant, &endP, 0);
16011 uint64 ui64 = strtoull(constant, &endP, 0);
16012 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16013 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16014
16015 if(isSigned)
16016 {
16017 if(i64 < (((int)0x80000000)))
16018 is64Bit = 1;
16019 }
16020 else
16021 {
16022 if(ui64 > (((int)0x7fffffff)))
16023 {
16024 if(ui64 > (0xffffffff))
16025 {
16026 is64Bit = 1;
16027 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16028 isSigned = 1;
16029 }
16030 }
16031 else if(constant[0] != '0' || !constant[1])
16032 isSigned = 1;
16033 }
16034 if(forceUnsigned)
16035 isSigned = 0;
16036 type->kind = is64Bit ? 4 : 3;
16037 type->isSigned = isSigned;
16038 }
16039 }
16040 exp->isConstant = 1;
16041 if(exp->destType && exp->destType->kind == 7)
16042 type->kind = 7;
16043 else if(exp->destType && exp->destType->kind == 6)
16044 type->kind = 6;
16045 else if(exp->destType && exp->destType->kind == 4)
16046 type->kind = 4;
16047 }
16048 break;
16049 }
16050 case 3:
16051 {
16052 exp->isConstant = 1;
16053 exp->expType = __extension__ ({
16054 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16055
16056 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16057 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16058
16059 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16060 }), __ecereInstance2;
16061 });
16062 break;
16063 }
16064 case 13:
16065 case 26:
16066 ProcessExpressionType(exp->__anon1._new.size);
16067 exp->expType = __extension__ ({
16068 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16069
16070 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16071 });
16072 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16073 break;
16074 case 14:
16075 case 27:
16076 ProcessExpressionType(exp->__anon1._renew.size);
16077 ProcessExpressionType(exp->__anon1._renew.exp);
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._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16082 });
16083 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16084 break;
16085 case 4:
16086 {
16087 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16088 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16089 unsigned int useDestType = 0, useSideType = 0;
16090 struct Location oldyylloc = yylloc;
16091 unsigned int useSideUnit = 0;
16092 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16093 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16094
16095 switch(exp->__anon1.op.op)
16096 {
16097 case '=':
16098 case MUL_ASSIGN:
16099 case DIV_ASSIGN:
16100 case MOD_ASSIGN:
16101 case ADD_ASSIGN:
16102 case SUB_ASSIGN:
16103 case LEFT_ASSIGN:
16104 case RIGHT_ASSIGN:
16105 case AND_ASSIGN:
16106 case XOR_ASSIGN:
16107 case OR_ASSIGN:
16108 assign = 1;
16109 break;
16110 case '!':
16111 break;
16112 case AND_OP:
16113 case OR_OP:
16114 boolOps = 1;
16115 boolResult = 1;
16116 break;
16117 case EQ_OP:
16118 case '<':
16119 case '>':
16120 case LE_OP:
16121 case GE_OP:
16122 case NE_OP:
16123 boolResult = 1;
16124 useSideType = 1;
16125 break;
16126 case '+':
16127 case '-':
16128 useSideUnit = 1;
16129 useSideType = 1;
16130 useDestType = 1;
16131 break;
16132 case LEFT_OP:
16133 case RIGHT_OP:
16134 break;
16135 case '|':
16136 case '^':
16137 useSideType = 1;
16138 useDestType = 1;
16139 break;
16140 case '/':
16141 case '%':
16142 useSideType = 1;
16143 useDestType = 1;
16144 break;
16145 case '&':
16146 case '*':
16147 if(exp->__anon1.op.exp1)
16148 {
16149 useSideType = 1;
16150 useDestType = 1;
16151 }
16152 break;
16153 }
16154 if(exp->__anon1.op.op == '&')
16155 {
16156 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16157 {
16158 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16159 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16160
16161 if(symbol && symbol->isIterator == 2)
16162 {
16163 exp->type = 8;
16164 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16165 exp->__anon1.member.member = MkIdentifier("key");
16166 exp->expType = (((void *)0));
16167 exp->__anon1.op.exp2->expType = symbol->type;
16168 symbol->type->refCount++;
16169 ProcessExpressionType(exp);
16170 FreeType(dummy);
16171 break;
16172 }
16173 }
16174 }
16175 if(exp->__anon1.op.exp1)
16176 {
16177 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16178 useDestType = 0;
16179 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16180 {
16181 if(exp->__anon1.op.exp1->destType)
16182 FreeType(exp->__anon1.op.exp1->destType);
16183 exp->__anon1.op.exp1->destType = exp->destType;
16184 exp->__anon1.op.exp1->opDestType = 1;
16185 if(exp->destType)
16186 exp->destType->refCount++;
16187 }
16188 else if(!assign)
16189 {
16190 if(exp->__anon1.op.exp1->destType)
16191 FreeType(exp->__anon1.op.exp1->destType);
16192 exp->__anon1.op.exp1->destType = dummy;
16193 dummy->refCount++;
16194 }
16195 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16196 exp->__anon1.op.exp1->destType->count++;
16197 ProcessExpressionType(exp->__anon1.op.exp1);
16198 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16199 exp->__anon1.op.exp1->destType->count--;
16200 exp->__anon1.op.exp1->opDestType = 0;
16201 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)
16202 {
16203 exp->__anon1.op.exp2 = MkExpConstant("1");
16204 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16205 assign = 1;
16206 }
16207 if(exp->__anon1.op.exp1->destType == dummy)
16208 {
16209 FreeType(dummy);
16210 exp->__anon1.op.exp1->destType = (((void *)0));
16211 }
16212 if(exp->__anon1.op.exp2)
16213 {
16214 if(exp->__anon1.op.exp1->expType && (exp->__anon1.op.exp1->expType->kind == 1 || exp->__anon1.op.exp1->expType->kind == 2))
16215 {
16216 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);
16217
16218 FreeType(exp->__anon1.op.exp1->expType);
16219 exp->__anon1.op.exp1->expType = type;
16220 }
16221 }
16222 type1 = exp->__anon1.op.exp1->expType;
16223 }
16224 if(exp->__anon1.op.exp2)
16225 {
16226 char expString[10240];
16227
16228 expString[0] = '\0';
16229 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16230 {
16231 if(exp->__anon1.op.exp1)
16232 {
16233 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16234 if(exp->__anon1.op.exp1->expType)
16235 exp->__anon1.op.exp1->expType->refCount++;
16236 }
16237 else
16238 {
16239 exp->__anon1.op.exp2->destType = exp->destType;
16240 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16241 exp->__anon1.op.exp2->opDestType = 1;
16242 if(exp->destType)
16243 exp->destType->refCount++;
16244 }
16245 if(type1)
16246 type1->refCount++;
16247 exp->expType = type1;
16248 }
16249 else if(assign)
16250 {
16251 if(inCompiler)
16252 PrintExpression(exp->__anon1.op.exp2, expString);
16253 if(type1 && type1->kind == 13)
16254 {
16255 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)
16256 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16257 else if(exp->__anon1.op.op == '=')
16258 {
16259 if(exp->__anon1.op.exp2->destType)
16260 FreeType(exp->__anon1.op.exp2->destType);
16261 exp->__anon1.op.exp2->destType = type1;
16262 if(type1)
16263 type1->refCount++;
16264 }
16265 }
16266 else
16267 {
16268 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)
16269 ;
16270 else
16271 {
16272 if(exp->__anon1.op.exp2->destType)
16273 FreeType(exp->__anon1.op.exp2->destType);
16274 exp->__anon1.op.exp2->destType = type1;
16275 if(type1)
16276 type1->refCount++;
16277 }
16278 }
16279 if(type1)
16280 type1->refCount++;
16281 exp->expType = type1;
16282 }
16283 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16284 {
16285 if(exp->__anon1.op.exp2->destType)
16286 FreeType(exp->__anon1.op.exp2->destType);
16287 exp->__anon1.op.exp2->destType = exp->destType;
16288 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16289 exp->__anon1.op.exp2->opDestType = 1;
16290 if(exp->destType)
16291 exp->destType->refCount++;
16292 }
16293 else
16294 {
16295 if(exp->__anon1.op.exp2->destType)
16296 FreeType(exp->__anon1.op.exp2->destType);
16297 exp->__anon1.op.exp2->destType = dummy;
16298 dummy->refCount++;
16299 }
16300 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))
16301 {
16302 FreeType(exp->__anon1.op.exp2->destType);
16303 exp->__anon1.op.exp2->destType = type1;
16304 type1->refCount++;
16305 }
16306 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16307 exp->__anon1.op.exp2->destType->count++;
16308 if(exp->__anon1.op.op == SIZEOF)
16309 {
16310 struct Expression * e = exp->__anon1.op.exp2;
16311
16312 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16313 {
16314 if(e->type == 5 || e->type == 32 || e->type == 23)
16315 {
16316 if(e->type == 23)
16317 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16318 else
16319 e = (*e->__anon1.list).last;
16320 }
16321 }
16322 if(e->type == 11 && e->__anon1.cast.exp)
16323 e->__anon1.cast.exp->needCast = 1;
16324 }
16325 ProcessExpressionType(exp->__anon1.op.exp2);
16326 exp->__anon1.op.exp2->opDestType = 0;
16327 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16328 exp->__anon1.op.exp2->destType->count--;
16329 if(exp->__anon1.op.exp1 || exp->__anon1.op.op == '~')
16330 {
16331 if(exp->__anon1.op.exp2->expType && (exp->__anon1.op.exp2->expType->kind == 1 || exp->__anon1.op.exp2->expType->kind == 2))
16332 {
16333 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);
16334
16335 FreeType(exp->__anon1.op.exp2->expType);
16336 exp->__anon1.op.exp2->expType = type;
16337 }
16338 }
16339 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16340 {
16341 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)
16342 {
16343 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16344 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16345 }
16346 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)))
16347 {
16348 if(exp->__anon1.op.op == ADD_ASSIGN)
16349 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16350 }
16351 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))
16352 {
16353 if(exp->__anon1.op.op == ADD_ASSIGN)
16354 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16355 }
16356 else if(inCompiler)
16357 {
16358 char type1String[1024];
16359 char type2String[1024];
16360
16361 type1String[0] = '\0';
16362 type2String[0] = '\0';
16363 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16364 PrintType(type1, type2String, 0, 1);
16365 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16366 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16367 }
16368 }
16369 if(exp->__anon1.op.exp2->destType == dummy)
16370 {
16371 FreeType(dummy);
16372 exp->__anon1.op.exp2->destType = (((void *)0));
16373 }
16374 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16375 {
16376 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16377 type2->refCount = 1;
16378 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16379 type2->isSigned = 1;
16380 }
16381 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))
16382 {
16383 type2 = __extension__ ({
16384 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16385
16386 __ecereInstance1->kind = 3, __ecereInstance1;
16387 });
16388 type2->refCount = 1;
16389 type2->isSigned = 1;
16390 }
16391 else
16392 {
16393 type2 = exp->__anon1.op.exp2->expType;
16394 if(type2)
16395 type2->refCount++;
16396 }
16397 }
16398 dummy->kind = 0;
16399 if(exp->__anon1.op.op == SIZEOF)
16400 {
16401 exp->expType = __extension__ ({
16402 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16403
16404 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16405 });
16406 exp->isConstant = 1;
16407 }
16408 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16409 {
16410 exp->expType = Dereference(type2);
16411 if(type2 && type2->kind == 8)
16412 notByReference = 1;
16413 }
16414 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16415 exp->expType = Reference(type2);
16416 else if(exp->__anon1.op.op == LEFT_OP || exp->__anon1.op.op == RIGHT_OP)
16417 {
16418 if(exp->__anon1.op.exp1->expType)
16419 {
16420 exp->expType = exp->__anon1.op.exp1->expType;
16421 exp->expType->refCount++;
16422 }
16423 }
16424 else if(!assign)
16425 {
16426 if(boolOps)
16427 {
16428 if(exp->__anon1.op.exp1)
16429 {
16430 if(exp->__anon1.op.exp1->destType)
16431 FreeType(exp->__anon1.op.exp1->destType);
16432 exp->__anon1.op.exp1->destType = MkClassType("bool");
16433 exp->__anon1.op.exp1->destType->truth = 1;
16434 if(!exp->__anon1.op.exp1->expType)
16435 ProcessExpressionType(exp->__anon1.op.exp1);
16436 else
16437 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16438 FreeType(exp->__anon1.op.exp1->expType);
16439 exp->__anon1.op.exp1->expType = MkClassType("bool");
16440 exp->__anon1.op.exp1->expType->truth = 1;
16441 }
16442 if(exp->__anon1.op.exp2)
16443 {
16444 if(exp->__anon1.op.exp2->destType)
16445 FreeType(exp->__anon1.op.exp2->destType);
16446 exp->__anon1.op.exp2->destType = MkClassType("bool");
16447 exp->__anon1.op.exp2->destType->truth = 1;
16448 if(!exp->__anon1.op.exp2->expType)
16449 ProcessExpressionType(exp->__anon1.op.exp2);
16450 else
16451 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16452 FreeType(exp->__anon1.op.exp2->expType);
16453 exp->__anon1.op.exp2->expType = MkClassType("bool");
16454 exp->__anon1.op.exp2->expType->truth = 1;
16455 }
16456 }
16457 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")))))
16458 {
16459 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"))))
16460 {
16461 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)))
16462 {
16463 struct Type * intType;
16464
16465 if(!type1->__anon1._class->__anon1.registered->dataType)
16466 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16467 if(!type2->__anon1._class->__anon1.registered->dataType)
16468 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16469 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
16470 if(exp->__anon1.op.exp1->destType)
16471 FreeType(exp->__anon1.op.exp1->destType);
16472 if(exp->__anon1.op.exp2->destType)
16473 FreeType(exp->__anon1.op.exp2->destType);
16474 exp->__anon1.op.exp1->destType = intType;
16475 exp->__anon1.op.exp2->destType = intType;
16476 intType->refCount++;
16477 }
16478 else
16479 {
16480 if(exp->__anon1.op.exp2->destType)
16481 FreeType(exp->__anon1.op.exp2->destType);
16482 exp->__anon1.op.exp2->destType = type1;
16483 type1->refCount++;
16484 if(exp->__anon1.op.exp1->destType)
16485 FreeType(exp->__anon1.op.exp1->destType);
16486 exp->__anon1.op.exp1->destType = type2;
16487 type2->refCount++;
16488 }
16489 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)
16490 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);
16491 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16492 {
16493 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16494
16495 if(argExp)
16496 {
16497 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16498
16499 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16500 ProcessExpressionType(exp->__anon1.op.exp1);
16501 if(type2->kind != 13)
16502 {
16503 ProcessExpressionType(classExp);
16504 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16505 if(!exp->__anon1.op.exp2->expType)
16506 {
16507 if(type2)
16508 FreeType(type2);
16509 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16510 type2->refCount++;
16511 }
16512 ProcessExpressionType(exp->__anon1.op.exp2);
16513 }
16514 }
16515 }
16516 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)))
16517 {
16518 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16519 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16520 exp->expType = type1;
16521 if(type1)
16522 type1->refCount++;
16523 }
16524 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)))
16525 {
16526 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16527 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16528 exp->expType = type2;
16529 if(type2)
16530 type2->refCount++;
16531 }
16532 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))
16533 {
16534 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16535 }
16536 else
16537 {
16538 unsigned int success = 0;
16539
16540 if(type1->kind == 13 && type2->kind == 13)
16541 {
16542 if(exp->__anon1.op.op == '+')
16543 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16544 else if(exp->__anon1.op.op == '-')
16545 {
16546 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16547 {
16548 exp->expType = __extension__ ({
16549 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16550
16551 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16552 });
16553 success = 1;
16554 if(type1->__anon1.type->kind == 20)
16555 {
16556 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16557
16558 if(argExp)
16559 {
16560 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16561
16562 ProcessExpressionType(classExp);
16563 exp->type = 5;
16564 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"))));
16565 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16566 FreeType(dummy);
16567 return ;
16568 }
16569 }
16570 }
16571 }
16572 }
16573 if(!success && exp->__anon1.op.exp1->type == 2)
16574 {
16575 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16576 {
16577 if(exp->expType)
16578 FreeType(exp->expType);
16579 exp->expType = exp->__anon1.op.exp1->destType;
16580 if(exp->__anon1.op.exp1->destType)
16581 exp->__anon1.op.exp1->destType->refCount++;
16582 success = 1;
16583 }
16584 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16585 {
16586 if(exp->expType)
16587 FreeType(exp->expType);
16588 exp->expType = exp->__anon1.op.exp2->destType;
16589 if(exp->__anon1.op.exp2->destType)
16590 exp->__anon1.op.exp2->destType->refCount++;
16591 success = 1;
16592 }
16593 }
16594 else if(!success)
16595 {
16596 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16597 {
16598 if(exp->expType)
16599 FreeType(exp->expType);
16600 exp->expType = exp->__anon1.op.exp2->destType;
16601 if(exp->__anon1.op.exp2->destType)
16602 exp->__anon1.op.exp2->destType->refCount++;
16603 success = 1;
16604 }
16605 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16606 {
16607 if(exp->expType)
16608 FreeType(exp->expType);
16609 exp->expType = exp->__anon1.op.exp1->destType;
16610 if(exp->__anon1.op.exp1->destType)
16611 exp->__anon1.op.exp1->destType->refCount++;
16612 success = 1;
16613 }
16614 }
16615 if(!success)
16616 {
16617 char expString1[10240];
16618 char expString2[10240];
16619 char type1[1024];
16620 char type2[1024];
16621
16622 expString1[0] = '\0';
16623 expString2[0] = '\0';
16624 type1[0] = '\0';
16625 type2[0] = '\0';
16626 if(inCompiler)
16627 {
16628 PrintExpression(exp->__anon1.op.exp1, expString1);
16629 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16630 PrintExpression(exp->__anon1.op.exp2, expString2);
16631 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16632 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16633 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16634 }
16635 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16636 }
16637 }
16638 }
16639 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)
16640 {
16641 if(exp->__anon1.op.exp1->destType)
16642 FreeType(exp->__anon1.op.exp1->destType);
16643 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16644 if(type2->__anon1._class->__anon1.registered->dataType)
16645 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16646 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16647 exp->expType = type2;
16648 if(type2)
16649 type2->refCount++;
16650 }
16651 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)
16652 {
16653 if(exp->__anon1.op.exp2->destType)
16654 FreeType(exp->__anon1.op.exp2->destType);
16655 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16656 if(type1->__anon1._class->__anon1.registered->dataType)
16657 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16658 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16659 exp->expType = type1;
16660 if(type1)
16661 type1->refCount++;
16662 }
16663 else if(type1)
16664 {
16665 unsigned int valid = 0;
16666
16667 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
16668 {
16669 if(exp->__anon1.op.exp2->destType)
16670 FreeType(exp->__anon1.op.exp2->destType);
16671 if(!type1->__anon1._class->__anon1.registered->dataType)
16672 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16673 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16674 exp->__anon1.op.exp2->destType->refCount++;
16675 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16676 if(type2)
16677 FreeType(type2);
16678 type2 = exp->__anon1.op.exp2->destType;
16679 if(type2)
16680 type2->refCount++;
16681 exp->expType = type2;
16682 type2->refCount++;
16683 }
16684 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
16685 {
16686 if(exp->__anon1.op.exp1->destType)
16687 FreeType(exp->__anon1.op.exp1->destType);
16688 if(!type2->__anon1._class->__anon1.registered->dataType)
16689 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16690 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16691 exp->__anon1.op.exp1->destType->refCount++;
16692 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16693 type1 = exp->__anon1.op.exp1->destType;
16694 exp->expType = type1;
16695 type1->refCount++;
16696 }
16697 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
16698 {
16699 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
16700 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
16701
16702 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
16703 {
16704 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16705 {
16706 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16707 {
16708 if(exp->expType)
16709 FreeType(exp->expType);
16710 exp->expType = exp->__anon1.op.exp2->expType;
16711 if(exp->__anon1.op.exp2->expType)
16712 exp->__anon1.op.exp2->expType->refCount++;
16713 valid = 1;
16714 }
16715 }
16716 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16717 {
16718 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16719 {
16720 if(exp->expType)
16721 FreeType(exp->expType);
16722 exp->expType = exp->__anon1.op.exp1->expType;
16723 if(exp->__anon1.op.exp1->expType)
16724 exp->__anon1.op.exp1->expType->refCount++;
16725 valid = 1;
16726 }
16727 }
16728 }
16729 else
16730 {
16731 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16732 {
16733 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16734 {
16735 if(exp->expType)
16736 FreeType(exp->expType);
16737 exp->expType = exp->__anon1.op.exp1->expType;
16738 if(exp->__anon1.op.exp1->expType)
16739 exp->__anon1.op.exp1->expType->refCount++;
16740 valid = 1;
16741 }
16742 }
16743 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16744 {
16745 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16746 {
16747 if(exp->expType)
16748 FreeType(exp->expType);
16749 exp->expType = exp->__anon1.op.exp2->expType;
16750 if(exp->__anon1.op.exp2->expType)
16751 exp->__anon1.op.exp2->expType->refCount++;
16752 valid = 1;
16753 }
16754 }
16755 }
16756 }
16757 if(!valid)
16758 {
16759 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))
16760 {
16761 if(exp->__anon1.op.exp1->destType)
16762 FreeType(exp->__anon1.op.exp1->destType);
16763 exp->__anon1.op.exp1->destType = type2;
16764 type2->refCount++;
16765 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16766 {
16767 if(exp->expType)
16768 FreeType(exp->expType);
16769 exp->expType = exp->__anon1.op.exp1->destType;
16770 if(exp->__anon1.op.exp1->destType)
16771 exp->__anon1.op.exp1->destType->refCount++;
16772 }
16773 }
16774 else
16775 {
16776 if(exp->__anon1.op.exp2->destType)
16777 FreeType(exp->__anon1.op.exp2->destType);
16778 exp->__anon1.op.exp2->destType = type1;
16779 type1->refCount++;
16780 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16781 {
16782 if(exp->expType)
16783 FreeType(exp->expType);
16784 exp->expType = exp->__anon1.op.exp2->destType;
16785 if(exp->__anon1.op.exp2->destType)
16786 exp->__anon1.op.exp2->destType->refCount++;
16787 }
16788 else if(type1 && type2)
16789 {
16790 char expString1[10240];
16791 char expString2[10240];
16792 char type1String[1024];
16793 char type2String[1024];
16794
16795 expString1[0] = '\0';
16796 expString2[0] = '\0';
16797 type1String[0] = '\0';
16798 type2String[0] = '\0';
16799 if(inCompiler)
16800 {
16801 PrintExpression(exp->__anon1.op.exp1, expString1);
16802 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16803 PrintExpression(exp->__anon1.op.exp2, expString2);
16804 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16805 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
16806 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
16807 }
16808 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
16809 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
16810 {
16811 exp->expType = exp->__anon1.op.exp1->expType;
16812 if(exp->__anon1.op.exp1->expType)
16813 exp->__anon1.op.exp1->expType->refCount++;
16814 }
16815 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16816 {
16817 exp->expType = exp->__anon1.op.exp2->expType;
16818 if(exp->__anon1.op.exp2->expType)
16819 exp->__anon1.op.exp2->expType->refCount++;
16820 }
16821 }
16822 }
16823 }
16824 }
16825 else if(type2)
16826 {
16827 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16828 {
16829 struct Type * oldType = exp->__anon1.op.exp1->expType;
16830
16831 exp->__anon1.op.exp1->expType = (((void *)0));
16832 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16833 FreeType(oldType);
16834 else
16835 exp->__anon1.op.exp1->expType = oldType;
16836 }
16837 if(exp->__anon1.op.exp1->destType)
16838 FreeType(exp->__anon1.op.exp1->destType);
16839 exp->__anon1.op.exp1->destType = type2;
16840 type2->refCount++;
16841 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16842 {
16843 if(exp->expType)
16844 FreeType(exp->expType);
16845 exp->expType = exp->__anon1.op.exp1->destType;
16846 if(exp->__anon1.op.exp1->destType)
16847 exp->__anon1.op.exp1->destType->refCount++;
16848 }
16849 }
16850 }
16851 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
16852 {
16853 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16854 {
16855 if(exp->__anon1.op.exp1->destType)
16856 FreeType(exp->__anon1.op.exp1->destType);
16857 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16858 if(type2->__anon1._class->__anon1.registered->dataType)
16859 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16860 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16861 }
16862 if(exp->__anon1.op.op == '!')
16863 {
16864 exp->expType = MkClassType("bool");
16865 exp->expType->truth = 1;
16866 }
16867 else
16868 {
16869 exp->expType = type2;
16870 if(type2)
16871 type2->refCount++;
16872 }
16873 }
16874 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
16875 {
16876 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16877 {
16878 if(exp->__anon1.op.exp2->destType)
16879 FreeType(exp->__anon1.op.exp2->destType);
16880 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16881 if(type1->__anon1._class->__anon1.registered->dataType)
16882 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16883 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16884 }
16885 exp->expType = type1;
16886 if(type1)
16887 type1->refCount++;
16888 }
16889 }
16890 yylloc = exp->loc;
16891 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
16892 {
16893 char expString[10000];
16894
16895 expString[0] = '\0';
16896 if(inCompiler)
16897 {
16898 PrintExpression(exp->__anon1.op.exp1, expString);
16899 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16900 }
16901 if(expString[0])
16902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16903 }
16904 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
16905 {
16906 char expString[10240];
16907
16908 expString[0] = '\0';
16909 if(inCompiler)
16910 {
16911 PrintExpression(exp->__anon1.op.exp2, expString);
16912 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16913 }
16914 if(expString[0])
16915 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16916 }
16917 if(boolResult)
16918 {
16919 FreeType(exp->expType);
16920 exp->expType = MkClassType("bool");
16921 exp->expType->truth = 1;
16922 }
16923 if(exp->__anon1.op.op != SIZEOF)
16924 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
16925 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
16926 {
16927 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
16928 }
16929 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
16930 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
16931 yylloc = oldyylloc;
16932 FreeType(dummy);
16933 if(type2)
16934 FreeType(type2);
16935 break;
16936 }
16937 case 5:
16938 case 32:
16939 {
16940 struct Expression * e;
16941
16942 exp->isConstant = 1;
16943 for(e = (*exp->__anon1.list).first; e; e = e->next)
16944 {
16945 if(!e->next)
16946 {
16947 FreeType(e->destType);
16948 e->opDestType = exp->opDestType;
16949 e->destType = exp->destType;
16950 if(e->destType)
16951 {
16952 exp->destType->refCount++;
16953 }
16954 }
16955 ProcessExpressionType(e);
16956 if(!exp->expType && !e->next)
16957 {
16958 exp->expType = e->expType;
16959 if(e->expType)
16960 e->expType->refCount++;
16961 }
16962 if(!e->isConstant)
16963 exp->isConstant = 0;
16964 }
16965 e = (*exp->__anon1.list).first;
16966 if(!e->next && e->type == 8)
16967 {
16968 struct Expression * next = exp->next, * prev = exp->prev;
16969
16970 FreeType(exp->expType);
16971 FreeType(exp->destType);
16972 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16973 *exp = *e;
16974 exp->prev = prev;
16975 exp->next = next;
16976 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
16977 ProcessExpressionType(exp);
16978 }
16979 break;
16980 }
16981 case 6:
16982 {
16983 struct Expression * e;
16984
16985 exp->isConstant = 1;
16986 ProcessExpressionType(exp->__anon1.index.exp);
16987 if(!exp->__anon1.index.exp->isConstant)
16988 exp->isConstant = 0;
16989 if(exp->__anon1.index.exp->expType)
16990 {
16991 struct Type * source = exp->__anon1.index.exp->expType;
16992
16993 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
16994 {
16995 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
16996 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
16997
16998 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
16999 {
17000 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
17001 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
17002 {
17003 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
17004
17005 if(type->kind == 8)
17006 type->constant = 1;
17007 else if(type->kind == 13)
17008 {
17009 struct Type * t = type;
17010
17011 while(t->kind == 13)
17012 t = t->__anon1.type;
17013 t->constant = 1;
17014 }
17015 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
17016 }
17017 }
17018 }
17019 }
17020 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
17021 {
17022 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
17023 {
17024 if(e->destType)
17025 FreeType(e->destType);
17026 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
17027 }
17028 ProcessExpressionType(e);
17029 if(!e->next)
17030 {
17031 }
17032 if(!e->isConstant)
17033 exp->isConstant = 0;
17034 }
17035 if(!exp->expType)
17036 exp->expType = Dereference(exp->__anon1.index.exp->expType);
17037 if(exp->expType)
17038 DeclareType(curExternal, exp->expType, 1, 0);
17039 break;
17040 }
17041 case 7:
17042 {
17043 struct Expression * e;
17044 struct Type * functionType;
17045 struct Type * methodType = (((void *)0));
17046 char name[1024];
17047
17048 name[0] = '\0';
17049 if(inCompiler)
17050 {
17051 PrintExpression(exp->__anon1.call.exp, name);
17052 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17053 {
17054 PrintExpression(exp->__anon1.call.exp, name);
17055 }
17056 }
17057 if(exp->__anon1.call.exp->type == 0)
17058 {
17059 struct Expression * idExp = exp->__anon1.call.exp;
17060 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17061
17062 if(!strcmp(id->string, "__builtin_frame_address"))
17063 {
17064 exp->expType = ProcessTypeString("void *", 1);
17065 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17066 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17067 break;
17068 }
17069 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17070 {
17071 exp->expType = ProcessTypeString("int", 1);
17072 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17073 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17074 break;
17075 }
17076 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17077 {
17078 struct Expression * a = (((void *)0));
17079 struct Expression * b = (((void *)0));
17080 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17081
17082 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17083 {
17084 a = (*exp->__anon1.call.arguments).first;
17085 b = (*exp->__anon1.call.arguments).last;
17086 tempExp1 = a;
17087 tempExp2 = b;
17088 }
17089 else if((*exp->__anon1.call.arguments).count == 1)
17090 {
17091 a = (*exp->__anon1.call.arguments).first;
17092 tempExp1 = a;
17093 }
17094 if(a)
17095 {
17096 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17097 idExp->__anon1.__anon1.identifier = (((void *)0));
17098 FreeExpContents(exp);
17099 ProcessExpressionType(a);
17100 if(b)
17101 ProcessExpressionType(b);
17102 exp->type = 5;
17103 exp->__anon1.list = MkList();
17104 if(a->expType && (!b || b->expType))
17105 {
17106 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17107 {
17108 if(inCompiler)
17109 {
17110 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17111 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17112 struct Declaration * decl;
17113 char temp1[1024], temp2[1024];
17114
17115 GetTypeSpecs(a->expType, specs);
17116 if(a && !a->isConstant && a->type != 0)
17117 {
17118 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17119 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17120 tempExp1 = QMkExpId(temp1);
17121 tempExp1->expType = a->expType;
17122 if(a->expType)
17123 a->expType->refCount++;
17124 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17125 }
17126 if(b && !b->isConstant && b->type != 0)
17127 {
17128 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17129 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17130 tempExp2 = QMkExpId(temp2);
17131 tempExp2->expType = b->expType;
17132 if(b->expType)
17133 b->expType->refCount++;
17134 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17135 }
17136 decl = MkDeclaration(specs, decls);
17137 if(!curCompound->__anon1.compound.declarations)
17138 curCompound->__anon1.compound.declarations = MkList();
17139 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17140 }
17141 }
17142 }
17143 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17144 {
17145 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17146
17147 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17148 exp->expType = a->expType;
17149 if(a->expType)
17150 a->expType->refCount++;
17151 }
17152 else if(!strcmp(id->string, "Abs"))
17153 {
17154 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17155 exp->expType = a->expType;
17156 if(a->expType)
17157 a->expType->refCount++;
17158 }
17159 else if(!strcmp(id->string, "Sgn"))
17160 {
17161 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"))))));
17162 exp->expType = ProcessTypeString("int", 0);
17163 }
17164 FreeExpression(tempExp1);
17165 if(tempExp2)
17166 FreeExpression(tempExp2);
17167 FreeIdentifier(id);
17168 break;
17169 }
17170 }
17171 }
17172 {
17173 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17174
17175 if(!exp->__anon1.call.exp->destType)
17176 {
17177 exp->__anon1.call.exp->destType = dummy;
17178 dummy->refCount++;
17179 }
17180 ProcessExpressionType(exp->__anon1.call.exp);
17181 if(exp->__anon1.call.exp->destType == dummy)
17182 {
17183 FreeType(dummy);
17184 exp->__anon1.call.exp->destType = (((void *)0));
17185 }
17186 FreeType(dummy);
17187 }
17188 functionType = exp->__anon1.call.exp->expType;
17189 if(functionType && functionType->kind == 16)
17190 {
17191 methodType = functionType;
17192 functionType = methodType->__anon1.__anon3.method->dataType;
17193 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17194 {
17195 char typeString[1024];
17196
17197 typeString[0] = '\0';
17198 {
17199 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17200
17201 functionType->__anon1.__anon2.thisClass = (((void *)0));
17202 PrintType(functionType, typeString, 1, 1);
17203 functionType->__anon1.__anon2.thisClass = back;
17204 }
17205 if(strstr(typeString, "thisclass"))
17206 {
17207 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17208 struct Declarator * decl;
17209
17210 {
17211 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17212
17213 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17214 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))
17215 thisClassParams = 0;
17216 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17217 {
17218 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17219
17220 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17221 ProcessDeclarator(decl, 1);
17222 thisClass = backupThisClass;
17223 }
17224 thisClassParams = 1;
17225 functionType = ProcessType(specs, decl);
17226 functionType->refCount = 0;
17227 FinishTemplatesContext(context);
17228 {
17229 struct Type * p, * op;
17230
17231 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)
17232 {
17233 if(op->kind == 21)
17234 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17235 }
17236 }
17237 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17238 {
17239 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17240 }
17241 }
17242 FreeList(specs, (void *)(FreeSpecifier));
17243 FreeDeclarator(decl);
17244 }
17245 }
17246 }
17247 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17248 {
17249 struct Type * type = functionType->__anon1.type;
17250
17251 if(!functionType->refCount)
17252 {
17253 functionType->__anon1.type = (((void *)0));
17254 FreeType(functionType);
17255 }
17256 functionType = type;
17257 }
17258 if(functionType && functionType->kind != 11)
17259 {
17260 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17261 }
17262 else if(functionType)
17263 {
17264 unsigned int emptyParams = 0, noParams = 0;
17265 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17266 struct Type * type = functionType->__anon1.__anon2.params.first;
17267 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17268 int extra = 0;
17269 struct Location oldyylloc = yylloc;
17270
17271 if(!type)
17272 emptyParams = 1;
17273 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17274 {
17275 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17276 e = e->next;
17277 }
17278 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17279 {
17280 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)
17281 {
17282 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17283 if(e)
17284 {
17285 e->destType = type;
17286 e = e->next;
17287 type = functionType->__anon1.__anon2.params.first;
17288 }
17289 else
17290 type->refCount = 0;
17291 }
17292 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17293 {
17294 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17295 type->byReference = functionType->byReference;
17296 type->typedByReference = functionType->typedByReference;
17297 if(e)
17298 {
17299 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17300 e = e->next;
17301 e->destType = type;
17302 e = e->next;
17303 type = functionType->__anon1.__anon2.params.first;
17304 }
17305 else
17306 type->refCount = 0;
17307 }
17308 }
17309 if(type && type->kind == 0)
17310 {
17311 noParams = 1;
17312 if(!type->refCount)
17313 FreeType(type);
17314 type = (((void *)0));
17315 }
17316 for(; e; e = e->next)
17317 {
17318 if(!type && !emptyParams)
17319 {
17320 yylloc = e->loc;
17321 if(methodType && methodType->__anon1.__anon3.methodClass)
17322 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);
17323 else
17324 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);
17325 break;
17326 }
17327 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17328 {
17329 struct Type * templatedType = (((void *)0));
17330 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17331 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17332 int id = 0;
17333
17334 if(_class && _class->templateArgs)
17335 {
17336 struct __ecereNameSpace__ecere__com__Class * sClass;
17337
17338 for(sClass = _class; sClass; sClass = sClass->base)
17339 {
17340 if(sClass->templateClass)
17341 sClass = sClass->templateClass;
17342 id = 0;
17343 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17344 {
17345 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17346 {
17347 struct __ecereNameSpace__ecere__com__Class * nextClass;
17348
17349 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17350 {
17351 if(nextClass->templateClass)
17352 nextClass = nextClass->templateClass;
17353 id += nextClass->templateParams.count;
17354 }
17355 break;
17356 }
17357 id++;
17358 }
17359 if(curParam)
17360 break;
17361 }
17362 }
17363 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17364 {
17365 unsigned int constant = type->constant;
17366 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17367
17368 {
17369 struct Context * context = SetupTemplatesContext(_class);
17370
17371 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17372 FinishTemplatesContext(context);
17373 }
17374 if(templatedType->kind == 8 && constant)
17375 templatedType->constant = 1;
17376 else if(templatedType->kind == 13)
17377 {
17378 struct Type * t = templatedType->__anon1.type;
17379
17380 while(t->kind == 13)
17381 t = t->__anon1.type;
17382 if(constant)
17383 t->constant = constant;
17384 }
17385 e->destType = templatedType;
17386 if(templatedType)
17387 {
17388 templatedType->passAsTemplate = 1;
17389 }
17390 }
17391 else
17392 {
17393 e->destType = type;
17394 if(type)
17395 type->refCount++;
17396 }
17397 }
17398 else
17399 {
17400 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17401 {
17402 e->destType = type->prev;
17403 e->destType->refCount++;
17404 }
17405 else
17406 {
17407 e->destType = type;
17408 if(type)
17409 type->refCount++;
17410 }
17411 }
17412 if(type && type->kind != 14)
17413 {
17414 struct Type * next = type->next;
17415
17416 if(!type->refCount)
17417 FreeType(type);
17418 type = next;
17419 }
17420 }
17421 if(type && type->kind != 14)
17422 {
17423 if(methodType && methodType->__anon1.__anon3.methodClass)
17424 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);
17425 else
17426 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);
17427 }
17428 yylloc = oldyylloc;
17429 if(type && !type->refCount)
17430 FreeType(type);
17431 }
17432 else
17433 {
17434 functionType = __extension__ ({
17435 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17436
17437 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17438 });
17439 if(exp->__anon1.call.exp->type == 0)
17440 {
17441 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17442
17443 if(inCompiler)
17444 {
17445 struct Symbol * symbol;
17446 struct Location oldyylloc = yylloc;
17447
17448 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17449 if(strstr(string, "__builtin_") == string)
17450 {
17451 if(exp->destType)
17452 {
17453 functionType->__anon1.__anon2.returnType = exp->destType;
17454 exp->destType->refCount++;
17455 }
17456 }
17457 else
17458 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17459 symbol = __extension__ ({
17460 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17461
17462 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17463 });
17464 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17465 if(strstr(symbol->string, "::"))
17466 globalContext->hasNameSpace = 1;
17467 yylloc = oldyylloc;
17468 }
17469 }
17470 else if(exp->__anon1.call.exp->type == 8)
17471 {
17472 }
17473 else
17474 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17475 if(!functionType->__anon1.__anon2.returnType)
17476 {
17477 functionType->__anon1.__anon2.returnType = __extension__ ({
17478 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17479
17480 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17481 });
17482 }
17483 }
17484 if(functionType && functionType->kind == 11)
17485 {
17486 exp->expType = functionType->__anon1.__anon2.returnType;
17487 if(functionType->__anon1.__anon2.returnType)
17488 functionType->__anon1.__anon2.returnType->refCount++;
17489 if(!functionType->refCount)
17490 FreeType(functionType);
17491 }
17492 if(exp->__anon1.call.arguments)
17493 {
17494 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17495 ProcessExpressionType(e);
17496 }
17497 break;
17498 }
17499 case 8:
17500 {
17501 struct Type * type;
17502 struct Location oldyylloc = yylloc;
17503 unsigned int thisPtr;
17504 struct Expression * checkExp = exp->__anon1.member.exp;
17505
17506 while(checkExp)
17507 {
17508 if(checkExp->type == 11)
17509 checkExp = checkExp->__anon1.cast.exp;
17510 else if(checkExp->type == 5)
17511 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17512 else
17513 break;
17514 }
17515 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17516 exp->thisPtr = thisPtr;
17517 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17518 {
17519 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17520 }
17521 ProcessExpressionType(exp->__anon1.member.exp);
17522 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)
17523 {
17524 exp->isConstant = 0;
17525 }
17526 else
17527 exp->isConstant = exp->__anon1.member.exp->isConstant;
17528 type = exp->__anon1.member.exp->expType;
17529 yylloc = exp->loc;
17530 if(type && (type->kind == 20))
17531 {
17532 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17533 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17534
17535 if(_class)
17536 {
17537 for(param = _class->templateParams.first; param; param = param->next)
17538 {
17539 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17540 break;
17541 }
17542 }
17543 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17544 {
17545 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17546
17547 if(argExp)
17548 {
17549 struct Expression * expMember = exp->__anon1.member.exp;
17550 struct Declarator * decl;
17551 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17552 char thisClassTypeString[1024];
17553
17554 FreeIdentifier(exp->__anon1.member.member);
17555 ProcessExpressionType(argExp);
17556 {
17557 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17558
17559 if(colon)
17560 {
17561 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17562 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17563 }
17564 else
17565 strcpy(thisClassTypeString, _class->fullName);
17566 }
17567 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17568 exp->expType = ProcessType(specs, decl);
17569 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17570 {
17571 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17572 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17573 int paramCount = 0;
17574 int lastParam = -1;
17575 char templateString[1024];
17576 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17577
17578 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17579 for(cClass = expClass; cClass; cClass = cClass->base)
17580 {
17581 int p = 0;
17582
17583 for(param = cClass->templateParams.first; param; param = param->next)
17584 {
17585 int id = p;
17586 struct __ecereNameSpace__ecere__com__Class * sClass;
17587 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17588
17589 for(sClass = cClass->base; sClass; sClass = sClass->base)
17590 id += sClass->templateParams.count;
17591 arg = expClass->templateArgs[id];
17592 for(sClass = _class; sClass; sClass = sClass->base)
17593 {
17594 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17595 int p = 0;
17596 struct __ecereNameSpace__ecere__com__Class * nextClass;
17597
17598 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17599 p += nextClass->templateParams.count;
17600 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17601 {
17602 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17603 {
17604 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17605 {
17606 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17607 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17608 break;
17609 }
17610 }
17611 }
17612 }
17613 {
17614 char argument[256];
17615
17616 argument[0] = '\0';
17617 switch(param->type)
17618 {
17619 case 2:
17620 {
17621 char expString[1024];
17622 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17623 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17624 struct Expression * exp;
17625 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17626
17627 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17628 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17629 ProcessExpressionType(exp);
17630 ComputeExpression(exp);
17631 expString[0] = '\0';
17632 PrintExpression(exp, expString);
17633 strcat(argument, expString);
17634 FreeExpression(exp);
17635 break;
17636 }
17637 case 1:
17638 {
17639 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17640 break;
17641 }
17642 case 0:
17643 {
17644 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17645 {
17646 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17647 strcat(argument, thisClassTypeString);
17648 else
17649 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17650 }
17651 break;
17652 }
17653 }
17654 if(argument[0])
17655 {
17656 if(paramCount)
17657 strcat(templateString, ", ");
17658 if(lastParam != p - 1)
17659 {
17660 strcat(templateString, param->name);
17661 strcat(templateString, " = ");
17662 }
17663 strcat(templateString, argument);
17664 paramCount++;
17665 lastParam = p;
17666 }
17667 p++;
17668 }
17669 }
17670 }
17671 {
17672 int len = strlen(templateString);
17673
17674 if(templateString[len - 1] == '>')
17675 templateString[len++] = ' ';
17676 templateString[len++] = '>';
17677 templateString[len++] = '\0';
17678 }
17679 {
17680 struct Context * context = SetupTemplatesContext(_class);
17681
17682 FreeType(exp->expType);
17683 exp->expType = ProcessTypeString(templateString, 0);
17684 FinishTemplatesContext(context);
17685 }
17686 }
17687 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
17688 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
17689 exp->type = 5;
17690 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")))))))));
17691 }
17692 }
17693 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
17694 {
17695 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
17696 }
17697 }
17698 if(type && (type->kind == 20))
17699 ;
17700 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)))
17701 {
17702 struct Identifier * id = exp->__anon1.member.member;
17703 int typeKind = type->kind;
17704 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));
17705
17706 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
17707 {
17708 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
17709 typeKind = 8;
17710 }
17711 if(id)
17712 {
17713 if(typeKind == 3 || typeKind == 15)
17714 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
17715 else if(!_class)
17716 {
17717 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17718 {
17719 _class = type->__anon1._class->__anon1.registered;
17720 }
17721 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
17722 {
17723 _class = FindClass("char *")->__anon1.registered;
17724 }
17725 else if(type->kind == 13)
17726 {
17727 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
17728 FreeType(exp->expType);
17729 exp->expType = ProcessTypeString("uintptr", 0);
17730 exp->byReference = 1;
17731 }
17732 else
17733 {
17734 char string[1024] = "";
17735 struct Symbol * classSym;
17736
17737 PrintTypeNoConst(type, string, 0, 1);
17738 classSym = FindClass(string);
17739 if(classSym)
17740 _class = classSym->__anon1.registered;
17741 }
17742 }
17743 }
17744 if(_class && id)
17745 {
17746 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
17747 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
17748 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17749 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
17750 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
17751
17752 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
17753 exp->__anon1.member.memberType = 1;
17754 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
17755 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
17756 if(typeKind != 19)
17757 {
17758 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
17759 {
17760 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17761 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
17762 {
17763 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17764 if(prop)
17765 member = (((void *)0));
17766 }
17767 if(!member && !prop)
17768 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17769 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
17770 exp->__anon1.member.thisPtr = 1;
17771 }
17772 else
17773 {
17774 unsigned int useMemberForNonConst = 0;
17775
17776 if(!id->classSym)
17777 {
17778 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
17779 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);
17780 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17781 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
17782 }
17783 if((!prop || useMemberForNonConst) && !member)
17784 {
17785 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
17786 if(!method)
17787 {
17788 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17789 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);
17790 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17791 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17792 }
17793 }
17794 if(member && prop)
17795 {
17796 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
17797 prop = (((void *)0));
17798 else
17799 member = (((void *)0));
17800 }
17801 }
17802 }
17803 if(!prop && !member && !method)
17804 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
17805 if(!prop && !member && !method)
17806 {
17807 if(typeKind == 19)
17808 {
17809 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
17810 if(classProp)
17811 {
17812 exp->__anon1.member.memberType = 5;
17813 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
17814 }
17815 else
17816 {
17817 char structName[1024];
17818 struct Identifier * id = exp->__anon1.member.member;
17819 struct Expression * classExp = exp->__anon1.member.exp;
17820
17821 type->refCount++;
17822 FreeType(classExp->expType);
17823 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
17824 strcpy(structName, "__ecereClassData_");
17825 FullClassNameCat(structName, type->__anon1._class->string, 0);
17826 exp->type = 9;
17827 exp->__anon1.member.member = id;
17828 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"))))))));
17829 FreeType(type);
17830 ProcessExpressionType(exp);
17831 return ;
17832 }
17833 }
17834 else
17835 {
17836 struct Symbol * classSym = FindClass(id->string);
17837
17838 if(classSym)
17839 {
17840 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
17841
17842 if(convertClass)
17843 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
17844 }
17845 }
17846 }
17847 if(exp->__anon1.member.exp->destType)
17848 FreeType(exp->__anon1.member.exp->destType);
17849 {
17850 if(method && !method->_class->symbol)
17851 method->_class->symbol = FindClass(method->_class->fullName);
17852 if(prop && !prop->_class->symbol)
17853 prop->_class->symbol = FindClass(prop->_class->fullName);
17854 exp->__anon1.member.exp->destType = __extension__ ({
17855 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17856
17857 __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;
17858 });
17859 }
17860 if(prop)
17861 {
17862 exp->__anon1.member.memberType = 1;
17863 if(!prop->dataType)
17864 ProcessPropertyType(prop);
17865 exp->expType = prop->dataType;
17866 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
17867 {
17868 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17869
17870 CopyTypeInto(type, exp->expType);
17871 type->refCount = 1;
17872 type->constant = 1;
17873 exp->expType = type;
17874 }
17875 else if(prop->dataType)
17876 prop->dataType->refCount++;
17877 }
17878 else if(member)
17879 {
17880 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17881 {
17882 FreeExpContents(exp);
17883 exp->type = 0;
17884 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17885 ProcessExpressionType(exp);
17886 return ;
17887 }
17888 exp->__anon1.member.memberType = 3;
17889 DeclareStruct(curExternal, _class->fullName, 0, 1);
17890 if(member->_class != _class)
17891 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
17892 if(!member->dataType)
17893 {
17894 struct Context * context = SetupTemplatesContext(_class);
17895
17896 member->dataType = ProcessTypeString(member->dataTypeString, 0);
17897 FinishTemplatesContext(context);
17898 }
17899 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)
17900 member->dataType->bitMemberSize = ((struct __ecereNameSpace__ecere__com__BitMember *)member)->size;
17901 exp->expType = member->dataType;
17902 if(member->dataType)
17903 member->dataType->refCount++;
17904 }
17905 else if(revConvert)
17906 {
17907 exp->__anon1.member.memberType = 4;
17908 exp->expType = MkClassType(revConvert->_class->fullName);
17909 }
17910 else if(method)
17911 {
17912 {
17913 exp->__anon1.member.memberType = 2;
17914 }
17915 if(!method->dataType)
17916 ProcessMethodType(method);
17917 exp->expType = __extension__ ({
17918 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17919
17920 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
17921 });
17922 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
17923 exp->expType->__anon1.__anon3.usedClass = _class;
17924 }
17925 else if(!classProp)
17926 {
17927 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17928 {
17929 FreeExpContents(exp);
17930 exp->type = 0;
17931 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17932 FreeType(exp->expType);
17933 exp->expType = MkClassType("ecere::com::Class");
17934 return ;
17935 }
17936 yylloc = exp->__anon1.member.member->loc;
17937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
17938 if(inCompiler)
17939 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
17940 }
17941 if(_class && exp->expType)
17942 {
17943 struct __ecereNameSpace__ecere__com__Class * tClass;
17944
17945 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
17946 while(tClass && !tClass->templateClass)
17947 tClass = tClass->base;
17948 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
17949 {
17950 int id = 0;
17951 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17952 struct __ecereNameSpace__ecere__com__Class * sClass;
17953
17954 for(sClass = tClass; sClass; sClass = sClass->base)
17955 {
17956 id = 0;
17957 if(sClass->templateClass)
17958 sClass = sClass->templateClass;
17959 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17960 {
17961 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
17962 {
17963 for(sClass = sClass->base; sClass; sClass = sClass->base)
17964 id += sClass->templateParams.count;
17965 break;
17966 }
17967 id++;
17968 }
17969 if(curParam)
17970 break;
17971 }
17972 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
17973 {
17974 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
17975 struct Context * context = SetupTemplatesContext(tClass);
17976 unsigned int constant = exp->expType->constant;
17977 unsigned int passAsTemplate = 0;
17978 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
17979 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
17980
17981 if(t && t->kind == 8 && t->__anon1._class)
17982 thisClassFrom = t->__anon1._class->__anon1.registered;
17983 else
17984 thisClassFrom = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "class");
17985 FreeType(t);
17986 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
17987 FreeType(exp->expType);
17988 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17989 exp->expType->thisClassFrom = thisClassFrom;
17990 if(exp->expType->kind == 8 && constant)
17991 exp->expType->constant = 1;
17992 else if(exp->expType->kind == 13)
17993 {
17994 struct Type * t = exp->expType->__anon1.type;
17995
17996 while(t->kind == 13)
17997 t = t->__anon1.type;
17998 if(constant)
17999 t->constant = constant;
18000 }
18001 if(exp->expType)
18002 {
18003 if(exp->expType->kind == 21)
18004 {
18005 FreeType(exp->expType);
18006 exp->expType = ReplaceThisClassType(_class);
18007 }
18008 if(passAsTemplate)
18009 exp->expType->passAsTemplate = 1;
18010 if(!exp->destType)
18011 {
18012 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18013 if(exp->destType->kind == 8 && constant)
18014 exp->destType->constant = 1;
18015 else if(exp->destType->kind == 13)
18016 {
18017 struct Type * t = exp->destType->__anon1.type;
18018
18019 while(t->kind == 13)
18020 t = t->__anon1.type;
18021 if(constant)
18022 t->constant = constant;
18023 }
18024 if(exp->destType->kind == 21)
18025 {
18026 FreeType(exp->destType);
18027 exp->destType = ReplaceThisClassType(_class);
18028 }
18029 }
18030 }
18031 FinishTemplatesContext(context);
18032 }
18033 }
18034 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)
18035 {
18036 int id = 0;
18037 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
18038 struct __ecereNameSpace__ecere__com__Class * sClass;
18039
18040 for(sClass = tClass; sClass; sClass = sClass->base)
18041 {
18042 id = 0;
18043 if(sClass->templateClass)
18044 sClass = sClass->templateClass;
18045 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18046 {
18047 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
18048 {
18049 for(sClass = sClass->base; sClass; sClass = sClass->base)
18050 id += sClass->templateParams.count;
18051 break;
18052 }
18053 id++;
18054 }
18055 if(curParam)
18056 break;
18057 }
18058 if(curParam)
18059 {
18060 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18061 struct Context * context = SetupTemplatesContext(tClass);
18062 struct Type * basicType;
18063
18064 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18065 if(basicType)
18066 {
18067 if(basicType->kind == 21)
18068 {
18069 FreeType(basicType);
18070 basicType = ReplaceThisClassType(_class);
18071 }
18072 FreeType(exp->expType);
18073 exp->expType = __extension__ ({
18074 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18075
18076 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18077 });
18078 if(!exp->destType)
18079 {
18080 exp->destType = exp->expType;
18081 exp->destType->refCount++;
18082 }
18083 {
18084 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18085 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18086 struct Declarator * decl;
18087
18088 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18089 *newExp = *exp;
18090 if(exp->destType)
18091 exp->destType->refCount++;
18092 if(exp->expType)
18093 exp->expType->refCount++;
18094 exp->type = 11;
18095 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18096 exp->__anon1.cast.exp = newExp;
18097 }
18098 }
18099 FinishTemplatesContext(context);
18100 }
18101 }
18102 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18103 {
18104 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18105
18106 if(expClass)
18107 {
18108 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18109 int p = 0;
18110 int paramCount = 0;
18111 int lastParam = -1;
18112 char templateString[1024];
18113 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18114
18115 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18116 while(cClass != expClass)
18117 {
18118 struct __ecereNameSpace__ecere__com__Class * sClass;
18119
18120 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18121 ;
18122 cClass = sClass;
18123 for(param = cClass->templateParams.first; param; param = param->next)
18124 {
18125 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18126 int cp = 0;
18127 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18128 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18129
18130 while(cClassCur != tClass && !paramCur)
18131 {
18132 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18133
18134 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18135 ;
18136 cClassCur = sClassCur;
18137 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18138 {
18139 if(!strcmp(paramCur->name, param->name))
18140 {
18141 break;
18142 }
18143 cp++;
18144 }
18145 }
18146 if(paramCur && paramCur->type == 0)
18147 arg = tClass->templateArgs[cp];
18148 else
18149 arg = expClass->templateArgs[p];
18150 {
18151 char argument[256];
18152
18153 argument[0] = '\0';
18154 switch(param->type)
18155 {
18156 case 2:
18157 {
18158 char expString[1024];
18159 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18160 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18161 struct Expression * exp;
18162 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18163
18164 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18165 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18166 ProcessExpressionType(exp);
18167 ComputeExpression(exp);
18168 expString[0] = '\0';
18169 PrintExpression(exp, expString);
18170 strcat(argument, expString);
18171 FreeExpression(exp);
18172 break;
18173 }
18174 case 1:
18175 {
18176 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18177 break;
18178 }
18179 case 0:
18180 {
18181 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18182 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18183 break;
18184 }
18185 }
18186 if(argument[0])
18187 {
18188 if(paramCount)
18189 strcat(templateString, ", ");
18190 if(lastParam != p - 1)
18191 {
18192 strcat(templateString, param->name);
18193 strcat(templateString, " = ");
18194 }
18195 strcat(templateString, argument);
18196 paramCount++;
18197 lastParam = p;
18198 }
18199 }
18200 p++;
18201 }
18202 }
18203 {
18204 int len = strlen(templateString);
18205
18206 if(templateString[len - 1] == '>')
18207 templateString[len++] = ' ';
18208 templateString[len++] = '>';
18209 templateString[len++] = '\0';
18210 }
18211 FreeType(exp->expType);
18212 {
18213 struct Context * context = SetupTemplatesContext(tClass);
18214
18215 exp->expType = ProcessTypeString(templateString, 0);
18216 FinishTemplatesContext(context);
18217 }
18218 }
18219 }
18220 }
18221 }
18222 else
18223 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)");
18224 }
18225 else if(type && (type->kind == 9 || type->kind == 10))
18226 {
18227 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18228
18229 if(memberType)
18230 {
18231 exp->expType = memberType;
18232 if(memberType)
18233 memberType->refCount++;
18234 }
18235 }
18236 else
18237 {
18238 char expString[10240];
18239
18240 expString[0] = '\0';
18241 if(inCompiler)
18242 {
18243 PrintExpression(exp, expString);
18244 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18245 }
18246 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18247 }
18248 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18249 {
18250 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18251 {
18252 struct Identifier * id = exp->__anon1.member.member;
18253 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));
18254
18255 if(_class)
18256 {
18257 FreeType(exp->expType);
18258 exp->expType = ReplaceThisClassType(_class);
18259 }
18260 }
18261 }
18262 yylloc = oldyylloc;
18263 break;
18264 }
18265 case 9:
18266 {
18267 struct Type * destType = exp->destType;
18268
18269 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18270 {
18271 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18272 }
18273 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18274 exp->type = 8;
18275 if(destType)
18276 destType->count++;
18277 ProcessExpressionType(exp);
18278 if(destType)
18279 destType->count--;
18280 break;
18281 }
18282 case 15:
18283 {
18284 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18285
18286 if(classSym && classSym->__anon1.registered)
18287 {
18288 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18289 {
18290 char name[1024];
18291 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18292
18293 name[0] = '\0';
18294 DeclareStruct(curExternal, classSym->string, 0, 1);
18295 FreeSpecifier(exp->__anon1._class);
18296 FullClassNameCat(name, classSym->string, 0);
18297 if(b->offset == 0)
18298 {
18299 exp->type = 10;
18300 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18301 }
18302 else
18303 {
18304 struct Expression * e;
18305
18306 exp->type = 4;
18307 if(b->structSize == b->offset)
18308 exp->__anon1.op.exp1 = MkExpConstant("0");
18309 else
18310 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18311 exp->__anon1.op.op = '+';
18312 e = exp;
18313 while(b->offset != 0)
18314 {
18315 struct Symbol * sym;
18316 struct Expression * typeSize;
18317
18318 b = b->base;
18319 sym = FindClass(b->fullName);
18320 name[0] = '\0';
18321 DeclareStruct(curExternal, sym->string, 0, 1);
18322 FullClassNameCat(name, sym->string, 0);
18323 if(b->structSize == b->offset)
18324 typeSize = MkExpConstant("0");
18325 else
18326 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18327 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18328 e = e->__anon1.op.exp2;
18329 }
18330 }
18331 }
18332 else
18333 {
18334 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18335 {
18336 FreeSpecifier(exp->__anon1._class);
18337 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18338 exp->type = 2;
18339 }
18340 else
18341 {
18342 char className[1024];
18343
18344 strcpy(className, "__ecereClass_");
18345 FullClassNameCat(className, classSym->string, 1);
18346 DeclareClass(curExternal, classSym, className);
18347 FreeExpContents(exp);
18348 exp->type = 9;
18349 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18350 exp->__anon1.member.member = MkIdentifier("structSize");
18351 }
18352 }
18353 }
18354 exp->expType = __extension__ ({
18355 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18356
18357 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18358 });
18359 break;
18360 }
18361 case 10:
18362 {
18363 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
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 exp->isConstant = 1;
18371 DeclareType(curExternal, type, 1, 0);
18372 FreeType(type);
18373 break;
18374 }
18375 case 11:
18376 {
18377 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18378
18379 type->count = 1;
18380 FreeType(exp->__anon1.cast.exp->destType);
18381 exp->__anon1.cast.exp->destType = type;
18382 type->refCount++;
18383 type->casted = 1;
18384 ProcessExpressionType(exp->__anon1.cast.exp);
18385 type->casted = 0;
18386 type->count = 0;
18387 exp->expType = type;
18388 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18389 {
18390 void * prev = exp->prev, * next = exp->next;
18391 struct Type * expType = exp->__anon1.cast.exp->destType;
18392 struct Expression * castExp = exp->__anon1.cast.exp;
18393 struct Type * destType = exp->destType;
18394
18395 if(expType)
18396 expType->refCount++;
18397 FreeType(exp->expType);
18398 FreeTypeName(exp->__anon1.cast.typeName);
18399 *exp = *castExp;
18400 FreeType(exp->expType);
18401 FreeType(exp->destType);
18402 exp->expType = expType;
18403 exp->destType = destType;
18404 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
18405 exp->prev = prev;
18406 exp->next = next;
18407 }
18408 else
18409 {
18410 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18411 }
18412 break;
18413 }
18414 case 33:
18415 {
18416 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18417
18418 exp->expType = type;
18419 break;
18420 }
18421 case 34:
18422 {
18423 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18424
18425 ProcessExpressionType(exp->__anon1.vaArg.exp);
18426 exp->expType = type;
18427 break;
18428 }
18429 case 12:
18430 {
18431 struct Expression * e;
18432 struct Type * t = exp->destType;
18433
18434 if(t && !exp->destType->casted)
18435 {
18436 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18437 CopyTypeInto(t, exp->destType);
18438 t->count = 0;
18439 }
18440 else if(t)
18441 t->refCount++;
18442 exp->isConstant = 1;
18443 FreeType(exp->__anon1.cond.cond->destType);
18444 exp->__anon1.cond.cond->destType = MkClassType("bool");
18445 exp->__anon1.cond.cond->destType->truth = 1;
18446 ProcessExpressionType(exp->__anon1.cond.cond);
18447 if(!exp->__anon1.cond.cond->isConstant)
18448 exp->isConstant = 0;
18449 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18450 {
18451 if(!e->next)
18452 {
18453 FreeType(e->destType);
18454 e->destType = t;
18455 if(e->destType)
18456 e->destType->refCount++;
18457 }
18458 ProcessExpressionType(e);
18459 if(!e->next)
18460 {
18461 exp->expType = e->expType;
18462 if(e->expType)
18463 e->expType->refCount++;
18464 }
18465 if(!e->isConstant)
18466 exp->isConstant = 0;
18467 }
18468 FreeType(exp->__anon1.cond.elseExp->destType);
18469 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18470 if(exp->__anon1.cond.elseExp->destType)
18471 exp->__anon1.cond.elseExp->destType->refCount++;
18472 ProcessExpressionType(exp->__anon1.cond.elseExp);
18473 if(!exp->__anon1.cond.elseExp->isConstant)
18474 exp->isConstant = 0;
18475 FreeType(t);
18476 break;
18477 }
18478 case 23:
18479 {
18480 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18481 {
18482 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18483
18484 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18485 {
18486 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18487 if(exp->destType)
18488 exp->destType->refCount++;
18489 }
18490 ProcessStatement(exp->__anon1.compound);
18491 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18492 if(exp->expType)
18493 exp->expType->refCount++;
18494 }
18495 break;
18496 }
18497 case 24:
18498 {
18499 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18500
18501 if(spec && spec->type == 1)
18502 {
18503 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18504 exp->expType->kind = 19;
18505 exp->byReference = 1;
18506 }
18507 else
18508 {
18509 exp->expType = MkClassType("ecere::com::Class");
18510 exp->byReference = 1;
18511 }
18512 break;
18513 }
18514 case 25:
18515 {
18516 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18517
18518 if(_class)
18519 {
18520 struct Identifier * id = exp->__anon1.classData.id;
18521 char structName[1024];
18522 struct Expression * classExp;
18523
18524 strcpy(structName, "__ecereClassData_");
18525 FullClassNameCat(structName, _class->fullName, 0);
18526 exp->type = 9;
18527 exp->__anon1.member.member = id;
18528 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18529 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18530 else
18531 classExp = MkExpIdentifier(MkIdentifier("class"));
18532 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"))))))));
18533 ProcessExpressionType(exp);
18534 return ;
18535 }
18536 break;
18537 }
18538 case 35:
18539 {
18540 struct Type * type = (((void *)0));
18541 const char * typeString = (((void *)0));
18542 char typeStringBuf[1024];
18543
18544 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))
18545 {
18546 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18547
18548 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18549 }
18550 else if(exp->__anon1.list)
18551 {
18552 struct Expression * e;
18553
18554 for(e = (*exp->__anon1.list).first; e; e = e->next)
18555 {
18556 ProcessExpressionType(e);
18557 if(e->expType)
18558 {
18559 if(!type)
18560 {
18561 type = e->expType;
18562 type->refCount++;
18563 }
18564 else
18565 {
18566 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18567 {
18568 FreeType(type);
18569 type = e->expType;
18570 e->expType = (((void *)0));
18571 e = (*exp->__anon1.list).first;
18572 ProcessExpressionType(e);
18573 if(e->expType)
18574 {
18575 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18576 {
18577 FreeType(e->expType);
18578 e->expType = (((void *)0));
18579 FreeType(type);
18580 type = (((void *)0));
18581 break;
18582 }
18583 }
18584 }
18585 }
18586 if(e->expType)
18587 {
18588 FreeType(e->expType);
18589 e->expType = (((void *)0));
18590 }
18591 }
18592 }
18593 if(type)
18594 {
18595 typeStringBuf[0] = '\0';
18596 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18597 typeString = typeStringBuf;
18598 FreeType(type);
18599 type = (((void *)0));
18600 }
18601 }
18602 if(typeString)
18603 {
18604 char templateString[1024];
18605 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18606 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18607 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18608 struct Expression * expExt;
18609 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18610
18611 sprintf(templateString, "Container<%s>", typeString);
18612 if(exp->__anon1.list)
18613 {
18614 struct Expression * e;
18615
18616 type = ProcessTypeString(typeString, 0);
18617 while((e = (*exp->__anon1.list).first))
18618 {
18619 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18620 e->destType = type;
18621 type->refCount++;
18622 ProcessExpressionType(e);
18623 ListAdd(initializers, MkInitializerAssignment(e));
18624 }
18625 FreeType(type);
18626 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18627 }
18628 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18629 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18630 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18631 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18632 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18633 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18634 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18635 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18636 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18637 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18638 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18639
18640 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18641 })));
18642 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18643 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18644 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18645 exp->expType = ProcessTypeString(templateString, 0);
18646 exp->type = 5;
18647 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18648 ProcessExpressionType(expExt);
18649 }
18650 else
18651 {
18652 exp->expType = ProcessTypeString("Container", 0);
18653 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18654 }
18655 break;
18656 }
18657 }
18658 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18659 {
18660 FreeType(exp->expType);
18661 exp->expType = ReplaceThisClassType(thisClass);
18662 }
18663 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)
18664 {
18665 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
18666
18667 if(symbol)
18668 {
18669 if(exp->expType->kind != 15)
18670 {
18671 struct Type * member;
18672 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
18673
18674 FreeType(exp->expType);
18675 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18676 exp->expType->kind = symbol->type->kind;
18677 exp->expType->refCount++;
18678 exp->expType->__anon1.__anon1.enumName = enumName;
18679 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
18680 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18681 member->refCount++;
18682 }
18683 else
18684 {
18685 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
18686
18687 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18688 {
18689 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);
18690
18691 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
18692 }
18693 }
18694 }
18695 }
18696 yylloc = exp->loc;
18697 if(exp->destType && (exp->destType->kind == 18))
18698 ;
18699 else if(exp->destType && !exp->destType->keepCast)
18700 {
18701 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
18702 exp->needTemplateCast = 1;
18703 if(exp->destType->kind == 0)
18704 ;
18705 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
18706 {
18707 unsigned int invalidCast = 0;
18708
18709 if(inCompiler && exp->destType->count && exp->expType)
18710 {
18711 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
18712 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
18713
18714 if(c1 && c1->type != 1)
18715 c1 = (((void *)0));
18716 if(c2 && c2->type != 1)
18717 c2 = (((void *)0));
18718 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
18719 invalidCast = 1;
18720 }
18721 if(!exp->destType->count || unresolved || invalidCast)
18722 {
18723 if(!exp->expType)
18724 {
18725 yylloc = exp->loc;
18726 if(exp->destType->kind != 14)
18727 {
18728 char type2[1024];
18729
18730 type2[0] = '\0';
18731 if(inCompiler)
18732 {
18733 char expString[10240];
18734
18735 expString[0] = '\0';
18736 PrintType(exp->destType, type2, 0, 1);
18737 if(inCompiler)
18738 {
18739 PrintExpression(exp, expString);
18740 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18741 }
18742 if(unresolved)
18743 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
18744 else if(exp->type != 16)
18745 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
18746 }
18747 }
18748 else
18749 {
18750 char expString[10240];
18751
18752 expString[0] = '\0';
18753 if(inCompiler)
18754 {
18755 PrintExpression(exp, expString);
18756 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18757 }
18758 if(unresolved)
18759 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
18760 else if(exp->type != 16)
18761 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18762 }
18763 }
18764 else
18765 {
18766 char type1[1024];
18767 char type2[1024];
18768
18769 type1[0] = '\0';
18770 type2[0] = '\0';
18771 if(inCompiler)
18772 {
18773 PrintType(exp->expType, type1, 0, 1);
18774 PrintType(exp->destType, type2, 0, 1);
18775 }
18776 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)))
18777 ;
18778 else
18779 {
18780 struct Expression * nbExp = GetNonBracketsExp(exp);
18781 unsigned int skipWarning = 0;
18782 int kind = exp->destType->kind;
18783
18784 if((kind == 1 || kind == 2) && exp->destType->isSigned == exp->expType->signedBeforePromotion && nbExp->type == 4 && nbExp->__anon1.op.exp1 && nbExp->__anon1.op.exp2)
18785 {
18786 int op = nbExp->__anon1.op.op;
18787 struct Expression * nbExp1, * nbExp2;
18788 int from;
18789
18790 switch(op)
18791 {
18792 case '%':
18793 case '/':
18794 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18795 from = nbExp1->expType->promotedFrom;
18796 if(from == 1 || (kind == 2 && from == 2))
18797 skipWarning = 1;
18798 break;
18799 case LEFT_OP:
18800 case RIGHT_OP:
18801 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18802 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18803 from = nbExp1->expType->promotedFrom;
18804 if(op == RIGHT_OP && (from == 1 || (kind == 2 && from == 2)))
18805 skipWarning = 1;
18806 else if(nbExp2->isConstant && nbExp2->type == 2 && (nbExp->__anon1.op.op == RIGHT_OP || nbExp1->expType->bitMemberSize))
18807 {
18808 int n = strtol(nbExp2->__anon1.__anon1.constant, (((void *)0)), 0);
18809 int s = from == 1 ? 8 : 16;
18810
18811 if(nbExp1->expType->bitMemberSize && nbExp1->expType->bitMemberSize < s)
18812 s = nbExp1->expType->bitMemberSize;
18813 if(nbExp->__anon1.op.op == RIGHT_OP)
18814 s -= n;
18815 else
18816 s += n;
18817 if(s <= (kind == 1 ? 8 : 16))
18818 skipWarning = 1;
18819 }
18820 break;
18821 case '-':
18822 if(!exp->destType->isSigned)
18823 {
18824 struct Expression * nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
18825 struct Expression * nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
18826 int from = nbExp2->expType->promotedFrom;
18827
18828 if((from == 1 || from == 2) && nbExp1->isConstant && nbExp1->type == 2)
18829 {
18830 int n = strtol(nbExp1->__anon1.__anon1.constant, (((void *)0)), 0);
18831
18832 if(n == (from == 1 ? 255 : 65535))
18833 skipWarning = 1;
18834 }
18835 }
18836 break;
18837 }
18838 }
18839 if(!skipWarning)
18840 {
18841 char expString[10240];
18842
18843 expString[0] = '\0';
18844 if(inCompiler)
18845 {
18846 PrintExpression(exp, expString);
18847 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18848 }
18849 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")))
18850 {
18851 if(invalidCast)
18852 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18853 else
18854 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18855 }
18856 }
18857 if(!inCompiler)
18858 {
18859 FreeType(exp->expType);
18860 exp->destType->refCount++;
18861 exp->expType = exp->destType;
18862 }
18863 }
18864 }
18865 }
18866 }
18867 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))
18868 {
18869 struct Expression * nbExp = GetNonBracketsExp(exp);
18870
18871 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
18872 {
18873 struct Expression * e = MoveExpContents(exp);
18874
18875 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
18876 exp->type = 11;
18877 exp->__anon1.cast.exp->destType = exp->destType;
18878 if(exp->destType)
18879 exp->destType->refCount++;
18880 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
18881 }
18882 }
18883 }
18884 else if(unresolved)
18885 {
18886 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
18887 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);
18888 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
18889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
18890 }
18891 else if(!exp->expType && exp->type != 16)
18892 {
18893 char expString[10240];
18894
18895 expString[0] = '\0';
18896 if(inCompiler)
18897 {
18898 PrintExpression(exp, expString);
18899 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18900 }
18901 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18902 }
18903 if(inCompiler)
18904 ApplyAnyObjectLogic(exp);
18905 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)))
18906 {
18907 exp->byReference = 1;
18908 }
18909 yylloc = oldyylloc;
18910 }
18911
18912 static void ProcessFunction(struct FunctionDefinition * function)
18913 {
18914 struct Identifier * id = GetDeclId(function->declarator);
18915 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18916 struct Type * type = symbol ? symbol->type : (((void *)0));
18917 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18918 struct Context * oldTopContext = topContext;
18919
18920 yylloc = function->loc;
18921 if(type && type->__anon1.__anon2.thisClass)
18922 {
18923 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18924 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18925 char className[1024];
18926 char structName[1024];
18927 struct Declarator * funcDecl;
18928 struct Symbol * thisSymbol;
18929 unsigned int typedObject = 0;
18930
18931 if(_class && !_class->base)
18932 {
18933 _class = currentClass;
18934 if(_class && !_class->symbol)
18935 _class->symbol = FindClass(_class->fullName);
18936 classSym = _class ? _class->symbol : (((void *)0));
18937 typedObject = 1;
18938 }
18939 thisClass = _class;
18940 if(inCompiler && _class)
18941 {
18942 if(type->kind == 11)
18943 {
18944 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18945 {
18946 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18947
18948 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18949 FreeType(param);
18950 }
18951 if(type->classObjectType != 1)
18952 {
18953 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18954 symbol->type->__anon1.__anon2.staticMethod = 1;
18955 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18956 symbol->type->extraParam = 0;
18957 }
18958 }
18959 strcpy(className, "__ecereClass_");
18960 FullClassNameCat(className, _class->fullName, 1);
18961 structName[0] = 0;
18962 FullClassNameCat(structName, _class->fullName, 0);
18963 funcDecl = GetFuncDecl(function->declarator);
18964 if(funcDecl)
18965 {
18966 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18967 {
18968 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18969
18970 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18971 {
18972 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18973 FreeTypeName(param);
18974 }
18975 }
18976 if(!function->propertyNoThis)
18977 {
18978 struct TypeName * thisParam = (((void *)0));
18979
18980 if(type->classObjectType != 1)
18981 {
18982 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18983 if(!funcDecl->__anon1.function.parameters)
18984 funcDecl->__anon1.function.parameters = MkList();
18985 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18986 }
18987 if(typedObject)
18988 {
18989 if(type->classObjectType != 1)
18990 {
18991 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18992 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18993 }
18994 thisParam = __extension__ ({
18995 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18996
18997 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18998 });
18999 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
19000 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19001 }
19002 }
19003 }
19004 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19005 {
19006 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19007
19008 funcDecl = GetFuncDecl(initDecl->declarator);
19009 if(funcDecl)
19010 {
19011 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19012 {
19013 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19014
19015 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19016 {
19017 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19018 FreeTypeName(param);
19019 }
19020 }
19021 if(type->classObjectType != 1)
19022 {
19023 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
19024 {
19025 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19026
19027 if(!funcDecl->__anon1.function.parameters)
19028 funcDecl->__anon1.function.parameters = MkList();
19029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19030 }
19031 }
19032 }
19033 }
19034 }
19035 if(function->body)
19036 {
19037 if(type->classObjectType != 1)
19038 {
19039 thisSymbol = __extension__ ({
19040 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
19041
19042 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
19043 });
19044 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19045 if(typedObject && thisSymbol->type)
19046 {
19047 thisSymbol->type->classObjectType = 2;
19048 thisSymbol->type->byReference = type->byReference;
19049 thisSymbol->type->typedByReference = type->byReference;
19050 }
19051 }
19052 }
19053 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
19054 {
19055 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
19056
19057 {
19058 struct __ecereNameSpace__ecere__com__Class * base;
19059
19060 for(base = _class; base && base->type != 1000; base = base->next)
19061 {
19062 for(member = base->membersAndProperties.first; member; member = member->next)
19063 if(!member->isProperty)
19064 break;
19065 if(member)
19066 break;
19067 }
19068 }
19069 for(member = _class->membersAndProperties.first; member; member = member->next)
19070 if(!member->isProperty)
19071 break;
19072 if(member)
19073 {
19074 char pointerName[1024];
19075 struct Declaration * decl;
19076 struct Initializer * initializer;
19077 struct Expression * exp, * bytePtr;
19078
19079 strcpy(pointerName, "__ecerePointer_");
19080 FullClassNameCat(pointerName, _class->fullName, 0);
19081 {
19082 char className[1024];
19083
19084 strcpy(className, "__ecereClass_");
19085 FullClassNameCat(className, classSym->string, 1);
19086 DeclareClass(curExternal, classSym, className);
19087 }
19088 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
19089 if(_class->fixed)
19090 {
19091 struct Expression * e;
19092
19093 if(_class->offset && _class->offset == _class->base->structSize)
19094 {
19095 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
19096 ProcessExpressionType(e);
19097 }
19098 else
19099 {
19100 char string[256];
19101
19102 sprintf(string, "%d", _class->offset);
19103 e = MkExpConstant(string);
19104 }
19105 exp = QBrackets(MkExpOp(bytePtr, '+', e));
19106 }
19107 else
19108 {
19109 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
19110 }
19111 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
19112 exp->expType = __extension__ ({
19113 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19114
19115 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
19116 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19117
19118 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19119 }), __ecereInstance2;
19120 });
19121 if(function->body)
19122 {
19123 yylloc = function->body->loc;
19124 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19125 {
19126 struct Context * prevContext = curContext;
19127 struct __ecereNameSpace__ecere__sys__OldList * list;
19128
19129 curContext = function->body->__anon1.compound.context;
19130 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19131 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19132 curContext = prevContext;
19133 }
19134 decl->symbol = (((void *)0));
19135 if(!function->body->__anon1.compound.declarations)
19136 function->body->__anon1.compound.declarations = MkList();
19137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19138 }
19139 }
19140 }
19141 }
19142 else
19143 thisClass = (((void *)0));
19144 if(id)
19145 {
19146 FreeSpecifier(id->_class);
19147 id->_class = (((void *)0));
19148 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19149 {
19150 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19151
19152 id = GetDeclId(initDecl->declarator);
19153 FreeSpecifier(id->_class);
19154 id->_class = (((void *)0));
19155 }
19156 }
19157 if(function->body)
19158 topContext = function->body->__anon1.compound.context;
19159 {
19160 struct FunctionDefinition * oldFunction = curFunction;
19161
19162 curFunction = function;
19163 if(function->body)
19164 ProcessStatement(function->body);
19165 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19166 {
19167 struct Statement * prevCompound = curCompound;
19168 struct Context * prevContext = curContext;
19169 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19170
19171 if(!function->body->__anon1.compound.statements)
19172 function->body->__anon1.compound.statements = MkList();
19173 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19174 curCompound = function->body;
19175 curContext = function->body->__anon1.compound.context;
19176 ProcessStatement(fireWatchers);
19177 curContext = prevContext;
19178 curCompound = prevCompound;
19179 }
19180 curFunction = oldFunction;
19181 }
19182 if(function->declarator)
19183 {
19184 ProcessDeclarator(function->declarator, 1);
19185 }
19186 topContext = oldTopContext;
19187 thisClass = oldThisClass;
19188 }
19189
19190 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19191 {
19192 struct ClassDef * def;
19193 struct External * external = curExternal;
19194 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19195
19196 for(def = definitions->first; def; def = def->next)
19197 {
19198 if(def->type == 0)
19199 {
19200 if(def->__anon1.function->declarator)
19201 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19202 else
19203 curExternal = external;
19204 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19205 }
19206 else if(def->type == 2)
19207 {
19208 if(def->__anon1.decl->type == 2)
19209 {
19210 thisClass = regClass;
19211 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19212 thisClass = (((void *)0));
19213 }
19214 else
19215 {
19216 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19217
19218 if(regClass)
19219 thisClass = regClass;
19220 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19221 thisClass = backThisClass;
19222 }
19223 }
19224 else if(def->type == 1 && def->__anon1.defProperties)
19225 {
19226 struct MemberInit * defProperty;
19227 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);
19228
19229 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19230 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19231 {
19232 thisClass = regClass;
19233 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19234 thisClass = (((void *)0));
19235 }
19236 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19237 FreeSymbol(thisSymbol);
19238 }
19239 else if(def->type == 3 && def->__anon1.propertyDef)
19240 {
19241 struct PropertyDef * prop = def->__anon1.propertyDef;
19242
19243 thisClass = regClass;
19244 if(prop->setStmt)
19245 {
19246 if(regClass)
19247 {
19248 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19249
19250 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19251 }
19252 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19253 ProcessStatement(prop->setStmt);
19254 }
19255 if(prop->getStmt)
19256 {
19257 if(regClass)
19258 {
19259 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19260
19261 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19262 }
19263 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19264 ProcessStatement(prop->getStmt);
19265 }
19266 if(prop->issetStmt)
19267 {
19268 if(regClass)
19269 {
19270 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19271
19272 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19273 }
19274 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19275 ProcessStatement(prop->issetStmt);
19276 }
19277 thisClass = (((void *)0));
19278 }
19279 else if(def->type == 4 && def->__anon1.propertyWatch)
19280 {
19281 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19282
19283 thisClass = regClass;
19284 if(propertyWatch->compound)
19285 {
19286 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);
19287
19288 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19289 curExternal = (((void *)0));
19290 ProcessStatement(propertyWatch->compound);
19291 }
19292 thisClass = (((void *)0));
19293 }
19294 }
19295 }
19296
19297 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19298 {
19299 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19300
19301 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19302 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19303 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19304 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19305 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19306 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19307 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19308 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19309 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19310 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19311 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19312 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19313 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19314 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19315 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19316 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19317 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19318 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19319 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19320 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19321 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19322 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19323 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19324 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19325 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19326 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19327 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19328 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19329 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19330 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19331 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19332 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19333 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19334 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19335 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19336 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19337 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19338 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19339 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19340 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19341 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19342 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19343 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19344 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19345 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19346 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19347 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19348 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19349 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19350 __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);
19351 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19352 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19354 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19355 __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);
19356 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19357 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19359 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19360 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19364 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19365 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19370 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19371 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)
19372 __ecereClass_Conversion = class;
19373 __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);
19374 __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);
19375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19376 __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);
19377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19399 }
19400