compiler/libec: Fixed keeping cast between long/int types
[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 #include <stdint.h>
39 #include <sys/types.h>
40 enum yytokentype
41 {
42 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
43 };
44
45 extern int returnCode;
46
47 extern unsigned int yydebug;
48
49 extern unsigned int echoOn;
50
51 void resetScanner();
52
53 int propWatcherID;
54
55 int expression_yyparse();
56
57 static char * thisNameSpace;
58
59 unsigned int thisClassParams = 1;
60
61 unsigned int internalValueCounter;
62
63 extern unsigned int outputLineNumbers;
64
65 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isInf;
66
67 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_signBit;
68
69 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isNan;
70
71 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isInf;
72
73 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_signBit;
74
75 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isNan;
76
77 extern int targetBits;
78
79 extern unsigned int inCompiler;
80
81 extern unsigned int inPreCompiler;
82
83 extern unsigned int inDebugger;
84
85 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
86
87 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
88
89 int UnescapeString(char * d, char * s, int len)
90 {
91 int j = 0, k = 0;
92 char ch;
93
94 while(j < len && (ch = s[j]))
95 {
96 switch(ch)
97 {
98 case '\\':
99 switch((ch = s[++j]))
100 {
101 case 'n':
102 d[k] = '\n';
103 break;
104 case 't':
105 d[k] = '\t';
106 break;
107 case 'a':
108 d[k] = '\a';
109 break;
110 case 'b':
111 d[k] = '\b';
112 break;
113 case 'f':
114 d[k] = '\f';
115 break;
116 case 'r':
117 d[k] = '\r';
118 break;
119 case 'v':
120 d[k] = '\v';
121 break;
122 case '\\':
123 d[k] = '\\';
124 break;
125 case '\"':
126 d[k] = '\"';
127 break;
128 case '\'':
129 d[k] = '\'';
130 break;
131 default:
132 d[k] = '\\';
133 d[k] = ch;
134 }
135 break;
136 default:
137 d[k] = ch;
138 }
139 j++, k++;
140 }
141 d[k] = '\0';
142 return k;
143 }
144
145 char * OffsetEscapedString(char * s, int len, int offset)
146 {
147 char ch;
148 int j = 0, k = 0;
149
150 while(j < len && k < offset && (ch = s[j]))
151 {
152 if(ch == '\\')
153 ++j;
154 j++, k++;
155 }
156 return (k == offset) ? s + j : (((void *)0));
157 }
158
159 extern int __ecereVMethodID_class_OnGetString;
160
161 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
162
163 extern unsigned int parseError;
164
165 static int definedExpStackPos;
166
167 static void * definedExpStack[512];
168
169 extern const char *  sourceFile;
170
171 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
172
173 extern unsigned int memoryGuard;
174
175 struct __ecereNameSpace__ecere__sys__OldList
176 {
177 void *  first;
178 void *  last;
179 int count;
180 unsigned int offset;
181 unsigned int circ;
182 } __attribute__ ((gcc_struct));
183
184 struct __ecereNameSpace__ecere__com__DataValue
185 {
186 union
187 {
188 char c;
189 unsigned char uc;
190 short s;
191 unsigned short us;
192 int i;
193 unsigned int ui;
194 void *  p;
195 float f;
196 double d;
197 long long i64;
198 uint64 ui64;
199 } __attribute__ ((gcc_struct)) __anon1;
200 } __attribute__ ((gcc_struct));
201
202 struct __ecereNameSpace__ecere__com__SerialBuffer
203 {
204 unsigned char *  _buffer;
205 unsigned int count;
206 unsigned int _size;
207 unsigned int pos;
208 } __attribute__ ((gcc_struct));
209
210 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
211
212 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
213
214 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
215
216 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
217
218 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
219
220 struct Pointer;
221
222 struct Attrib;
223
224 struct Attribute;
225
226 struct TemplateArgument;
227
228 struct DBTableEntry;
229
230 struct DBIndexItem;
231
232 struct DBTableDef;
233
234 struct CodePosition
235 {
236 int line;
237 int charPos;
238 int pos;
239 int included;
240 } __attribute__ ((gcc_struct));
241
242 extern size_t strlen(const char * );
243
244 extern int strcmp(const char * , const char * );
245
246 extern int sprintf(char * , const char * , ...);
247
248 extern char *  strcat(char * , const char * );
249
250 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
251
252 extern int isprint(int c);
253
254 extern char *  strcpy(char * , const char * );
255
256 extern void Compiler_Error(const char *  format, ...);
257
258 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
259
260 struct __ecereNameSpace__ecere__com__LinkList
261 {
262 void * first;
263 void * last;
264 int count;
265 } __attribute__ ((gcc_struct));
266
267 extern char *  strchr(const char * , int);
268
269 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
270
271 extern void *  memcpy(void * , const void * , size_t size);
272
273 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
274
275 extern void Compiler_Warning(const char *  format, ...);
276
277 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
278
279 extern long long strtoll(const char *  nptr, char * *  endptr, int base);
280
281 extern uint64 strtoull(const char *  nptr, char * *  endptr, int base);
282
283 extern int strtol(const char * , char * * , int base);
284
285 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
286
287 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
288
289 extern double strtod(const char * , char * * );
290
291 extern int strncmp(const char * , const char * , size_t n);
292
293 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
294
295 extern char *  QMkString(const char *  source);
296
297 extern char *  strncpy(char * , const char * , size_t n);
298
299 extern int printf(const char * , ...);
300
301 extern char *  strstr(const char * , const char * );
302
303 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
304
305 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
306
307 extern int (* __ecereProp_float_Get_signBit)(float this);
308
309 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
310
311 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
312
313 extern int (* __ecereProp_double_Get_signBit)(double this);
314
315 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
316
317 extern float (* __ecereMethod_float_inf)(void);
318
319 extern float (* __ecereMethod_float_nan)(void);
320
321 extern double (* __ecereMethod_double_inf)(void);
322
323 extern double (* __ecereMethod_double_nan)(void);
324
325 int __ecereVMethodID_class_OnGetString;
326
327 void SetYydebug(unsigned int b)
328 {
329 yydebug = b;
330 }
331
332 unsigned int GetParseError()
333 {
334 return parseError;
335 }
336
337 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
338
339 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
340
341 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
342
343 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
344
345 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
346
347 struct __ecereNameSpace__ecere__com__EnumClassData
348 {
349 struct __ecereNameSpace__ecere__sys__OldList values;
350 long long largest;
351 } __attribute__ ((gcc_struct));
352
353 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
354
355 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
356
357 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
358
359 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
360
361 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
362
363 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
364
365 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
366
367 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
368
369 struct Location
370 {
371 struct CodePosition start;
372 struct CodePosition end;
373 } __attribute__ ((gcc_struct));
374
375 void ReadString(char * output, char * string)
376 {
377 int len = strlen(string);
378 int c, d = 0;
379 unsigned int quoted = 0, escaped = 0;
380
381 for(c = 0; c < len; c++)
382 {
383 char ch = string[c];
384
385 if(escaped)
386 {
387 switch(ch)
388 {
389 case 'n':
390 output[d] = '\n';
391 break;
392 case 't':
393 output[d] = '\t';
394 break;
395 case 'a':
396 output[d] = '\a';
397 break;
398 case 'b':
399 output[d] = '\b';
400 break;
401 case 'f':
402 output[d] = '\f';
403 break;
404 case 'r':
405 output[d] = '\r';
406 break;
407 case 'v':
408 output[d] = '\v';
409 break;
410 case '\\':
411 output[d] = '\\';
412 break;
413 case '\"':
414 output[d] = '\"';
415 break;
416 case '\'':
417 output[d] = '\'';
418 break;
419 default:
420 output[d] = ch;
421 }
422 d++;
423 escaped = 0;
424 }
425 else
426 {
427 if(ch == '\"')
428 quoted ^= 1;
429 else if(quoted)
430 {
431 if(ch == '\\')
432 escaped = 1;
433 else
434 output[d++] = ch;
435 }
436 }
437 }
438 output[d] = '\0';
439 }
440
441 char * PrintInt(long long result)
442 {
443 char temp[100];
444
445 if(result > (((int)0x7fffffff)))
446 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
447 else
448 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
449 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
450 strcat(temp, "LL");
451 return __ecereNameSpace__ecere__sys__CopyString(temp);
452 }
453
454 char * PrintUInt(uint64 result)
455 {
456 char temp[100];
457
458 if(result > (0xffffffff))
459 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
460 else if(result > (((int)0x7fffffff)))
461 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
462 else
463 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
464 return __ecereNameSpace__ecere__sys__CopyString(temp);
465 }
466
467 char * PrintInt64(long long result)
468 {
469 char temp[100];
470
471 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
472 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
473 else
474 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
475 return __ecereNameSpace__ecere__sys__CopyString(temp);
476 }
477
478 char * PrintUInt64(uint64 result)
479 {
480 char temp[100];
481
482 if(result > (0xffffffff))
483 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
484 else if(result > (((int)0x7fffffff)))
485 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
486 else
487 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
488 return __ecereNameSpace__ecere__sys__CopyString(temp);
489 }
490
491 char * PrintHexUInt(uint64 result)
492 {
493 char temp[100];
494
495 if(result > (0xffffffff))
496 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
497 else
498 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
499 if(result > (0xffffffff))
500 strcat(temp, "LL");
501 return __ecereNameSpace__ecere__sys__CopyString(temp);
502 }
503
504 char * PrintHexUInt64(uint64 result)
505 {
506 char temp[100];
507
508 if(result > (0xffffffff))
509 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
510 else
511 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
512 return __ecereNameSpace__ecere__sys__CopyString(temp);
513 }
514
515 char * PrintShort(short result)
516 {
517 char temp[100];
518
519 sprintf(temp, "%d", (unsigned short)result);
520 return __ecereNameSpace__ecere__sys__CopyString(temp);
521 }
522
523 char * PrintUShort(unsigned short result)
524 {
525 char temp[100];
526
527 if(result > (unsigned short)32767)
528 sprintf(temp, "0x%X", (int)result);
529 else
530 sprintf(temp, "%d", (int)result);
531 return __ecereNameSpace__ecere__sys__CopyString(temp);
532 }
533
534 char * PrintUChar(unsigned char result)
535 {
536 char temp[100];
537
538 sprintf(temp, "0x%X", result);
539 return __ecereNameSpace__ecere__sys__CopyString(temp);
540 }
541
542 char * PrintChar(char result)
543 {
544 char temp[100];
545
546 if(result > (char)0 && isprint(result))
547 sprintf(temp, "'%c'", result);
548 else if(result < (char)0)
549 sprintf(temp, "%d", (int)result);
550 else
551 sprintf(temp, "0x%X", (unsigned char)result);
552 return __ecereNameSpace__ecere__sys__CopyString(temp);
553 }
554
555 char * PrintFloat(float result)
556 {
557 char temp[350];
558
559 if(__ecereProp_float_Get_isInf(result))
560 {
561 if(__ecereProp_float_Get_signBit(result))
562 strcpy(temp, "-inf");
563 else
564 strcpy(temp, "inf");
565 }
566 else if(__ecereProp_float_Get_isNan(result))
567 {
568 if(__ecereProp_float_Get_signBit(result))
569 strcpy(temp, "-nan");
570 else
571 strcpy(temp, "nan");
572 }
573 else
574 sprintf(temp, "%.16ff", result);
575 return __ecereNameSpace__ecere__sys__CopyString(temp);
576 }
577
578 char * PrintDouble(double result)
579 {
580 char temp[350];
581
582 if(__ecereProp_double_Get_isInf(result))
583 {
584 if(__ecereProp_double_Get_signBit(result))
585 strcpy(temp, "-inf");
586 else
587 strcpy(temp, "inf");
588 }
589 else if(__ecereProp_double_Get_isNan(result))
590 {
591 if(__ecereProp_double_Get_signBit(result))
592 strcpy(temp, "-nan");
593 else
594 strcpy(temp, "nan");
595 }
596 else
597 sprintf(temp, "%.16f", result);
598 return __ecereNameSpace__ecere__sys__CopyString(temp);
599 }
600
601 extern struct Location yylloc;
602
603 struct ExtDecl
604 {
605 struct Location loc;
606 int type;
607 union
608 {
609 char * s;
610 struct Attrib * attr;
611 } __attribute__ ((gcc_struct)) __anon1;
612 } __attribute__ ((gcc_struct));
613
614 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
615
616 struct Expression;
617
618 extern struct Expression * parsedExpression;
619
620 extern struct Expression * QMkExpId(const char *  id);
621
622 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
623
624 void ComputeExpression(struct Expression * exp);
625
626 extern struct Expression * MkExpConstant(const char *  string);
627
628 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
629
630 extern void FreeExpression(struct Expression * exp);
631
632 extern void FreeExpContents(struct Expression * exp);
633
634 extern struct Expression * CopyExpression(struct Expression * exp);
635
636 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
637
638 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
639
640 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
641
642 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
643
644 extern struct Expression * MoveExpContents(struct Expression * exp);
645
646 extern struct Expression * QBrackets(struct Expression * exp);
647
648 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
649
650 struct Statement;
651
652 static struct Statement * curCompound;
653
654 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
655
656 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
657
658 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
659
660 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
661
662 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
663
664 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
665
666 struct External;
667
668 struct External * curExternal, * afterExternal;
669
670 extern void FreeExternal(struct External * external);
671
672 struct Type;
673
674 static struct Type * curSwitchType;
675
676 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
677
678 extern void FreeType(struct Type * type);
679
680 extern struct Type * MkClassType(const char *  name);
681
682 extern void CopyTypeInto(struct Type * type, struct Type * src);
683
684 struct __ecereNameSpace__ecere__com__Class;
685
686 struct __ecereNameSpace__ecere__com__Instance
687 {
688 void * *  _vTbl;
689 struct __ecereNameSpace__ecere__com__Class * _class;
690 int _refCount;
691 } __attribute__ ((gcc_struct));
692
693 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
694
695 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
696
697 static struct __ecereNameSpace__ecere__com__Class * currentClass;
698
699 struct __ecereNameSpace__ecere__com__Class * thisClass;
700
701 struct __ecereNameSpace__ecere__com__Class * containerClass;
702
703 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
704
705 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
706
707 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
708
709 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
710
711 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
712
713 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
714
715 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
716
717 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
718
719 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
720
721 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
722
723 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
724
725 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
726 {
727 thisClass = c;
728 }
729
730 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
731 {
732 return thisClass;
733 }
734
735 struct Context;
736
737 extern struct Context * curContext;
738
739 extern struct Context * topContext;
740
741 extern struct Context * PushContext(void);
742
743 extern void PopContext(struct Context * ctx);
744
745 extern void FreeContext(struct Context * context);
746
747 extern struct Context * globalContext;
748
749 struct ModuleImport;
750
751 extern struct ModuleImport * mainModule;
752
753 struct ModuleImport
754 {
755 struct ModuleImport * prev;
756 struct ModuleImport * next;
757 char *  name;
758 struct __ecereNameSpace__ecere__sys__OldList classes;
759 struct __ecereNameSpace__ecere__sys__OldList functions;
760 int importType;
761 int importAccess;
762 } __attribute__ ((gcc_struct));
763
764 struct __ecereNameSpace__ecere__com__NameSpace;
765
766 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
767
768 struct FunctionDefinition;
769
770 static struct FunctionDefinition * curFunction;
771
772 struct __ecereNameSpace__ecere__sys__BTNode;
773
774 struct __ecereNameSpace__ecere__sys__BTNode
775 {
776 uintptr_t key;
777 struct __ecereNameSpace__ecere__sys__BTNode * parent;
778 struct __ecereNameSpace__ecere__sys__BTNode * left;
779 struct __ecereNameSpace__ecere__sys__BTNode * right;
780 int depth;
781 } __attribute__ ((gcc_struct));
782
783 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
784
785 struct __ecereNameSpace__ecere__com__Property;
786
787 struct __ecereNameSpace__ecere__com__Property
788 {
789 struct __ecereNameSpace__ecere__com__Property * prev;
790 struct __ecereNameSpace__ecere__com__Property * next;
791 const char *  name;
792 unsigned int isProperty;
793 int memberAccess;
794 int id;
795 struct __ecereNameSpace__ecere__com__Class * _class;
796 const char *  dataTypeString;
797 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
798 struct Type * dataType;
799 void (*  Set)(void * , int);
800 int (*  Get)(void * );
801 unsigned int (*  IsSet)(void * );
802 void *  data;
803 void *  symbol;
804 int vid;
805 unsigned int conversion;
806 unsigned int watcherOffset;
807 const char *  category;
808 unsigned int compiled;
809 unsigned int selfWatchable;
810 unsigned int isWatchable;
811 } __attribute__ ((gcc_struct));
812
813 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
814
815 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);
816
817 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
818
819 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
820
821 struct Identifier;
822
823 extern void FreeIdentifier(struct Identifier * id);
824
825 extern struct Identifier * MkIdentifier(const char *  string);
826
827 extern struct Expression * MkExpIdentifier(struct Identifier * id);
828
829 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
830
831 extern struct Identifier * CopyIdentifier(struct Identifier * id);
832
833 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
834
835 struct __ecereNameSpace__ecere__sys__OldLink;
836
837 struct __ecereNameSpace__ecere__sys__OldLink
838 {
839 struct __ecereNameSpace__ecere__sys__OldLink * prev;
840 struct __ecereNameSpace__ecere__sys__OldLink * next;
841 void *  data;
842 } __attribute__ ((gcc_struct));
843
844 struct Declaration;
845
846 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
847
848 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
849
850 struct Specifier;
851
852 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
853
854 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
855
856 extern struct Specifier * MkSpecifier(int specifier);
857
858 extern struct Specifier * MkSpecifierName(const char *  name);
859
860 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
861
862 extern void FreeSpecifier(struct Specifier * spec);
863
864 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
865
866 struct Statement
867 {
868 struct Statement * prev;
869 struct Statement * next;
870 struct Location loc;
871 int type;
872 union
873 {
874 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
875 struct
876 {
877 struct Identifier * id;
878 struct Statement * stmt;
879 } __attribute__ ((gcc_struct)) labeled;
880 struct
881 {
882 struct Expression * exp;
883 struct Statement * stmt;
884 } __attribute__ ((gcc_struct)) caseStmt;
885 struct
886 {
887 struct __ecereNameSpace__ecere__sys__OldList * declarations;
888 struct __ecereNameSpace__ecere__sys__OldList * statements;
889 struct Context * context;
890 unsigned int isSwitch;
891 } __attribute__ ((gcc_struct)) compound;
892 struct
893 {
894 struct __ecereNameSpace__ecere__sys__OldList * exp;
895 struct Statement * stmt;
896 struct Statement * elseStmt;
897 } __attribute__ ((gcc_struct)) ifStmt;
898 struct
899 {
900 struct __ecereNameSpace__ecere__sys__OldList * exp;
901 struct Statement * stmt;
902 } __attribute__ ((gcc_struct)) switchStmt;
903 struct
904 {
905 struct __ecereNameSpace__ecere__sys__OldList * exp;
906 struct Statement * stmt;
907 } __attribute__ ((gcc_struct)) whileStmt;
908 struct
909 {
910 struct __ecereNameSpace__ecere__sys__OldList * exp;
911 struct Statement * stmt;
912 } __attribute__ ((gcc_struct)) doWhile;
913 struct
914 {
915 struct Statement * init;
916 struct Statement * check;
917 struct __ecereNameSpace__ecere__sys__OldList * increment;
918 struct Statement * stmt;
919 } __attribute__ ((gcc_struct)) forStmt;
920 struct
921 {
922 struct Identifier * id;
923 } __attribute__ ((gcc_struct)) gotoStmt;
924 struct
925 {
926 struct Specifier * spec;
927 char * statements;
928 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
929 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
930 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
931 } __attribute__ ((gcc_struct)) asmStmt;
932 struct
933 {
934 struct Expression * watcher;
935 struct Expression * object;
936 struct __ecereNameSpace__ecere__sys__OldList * watches;
937 } __attribute__ ((gcc_struct)) _watch;
938 struct
939 {
940 struct Identifier * id;
941 struct __ecereNameSpace__ecere__sys__OldList * exp;
942 struct __ecereNameSpace__ecere__sys__OldList * filter;
943 struct Statement * stmt;
944 } __attribute__ ((gcc_struct)) forEachStmt;
945 struct Declaration * decl;
946 } __attribute__ ((gcc_struct)) __anon1;
947 } __attribute__ ((gcc_struct));
948
949 extern struct Specifier * CopySpecifier(struct Specifier * spec);
950
951 extern struct Expression * MkExpClassSize(struct Specifier * _class);
952
953 struct Symbol;
954
955 struct Identifier
956 {
957 struct Identifier * prev;
958 struct Identifier * next;
959 struct Location loc;
960 struct Symbol * classSym;
961 struct Specifier * _class;
962 char *  string;
963 struct Identifier * badID;
964 } __attribute__ ((gcc_struct));
965
966 extern struct Symbol * FindStruct(struct Context * ctx, const char *  name);
967
968 extern struct Symbol * FindClass(const char *  name);
969
970 extern void DeclareClass(struct External * neededFor, struct Symbol * classSym, const char *  className);
971
972 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
973
974 extern void FreeSymbol(struct Symbol * symbol);
975
976 struct ClassDef;
977
978 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
979
980 extern void FreeClassDef(struct ClassDef * def);
981
982 struct Declarator;
983
984 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
985
986 struct TemplateDatatype
987 {
988 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
989 struct Declarator * decl;
990 } __attribute__ ((gcc_struct));
991
992 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
993
994 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
995
996 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
997
998 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
999
1000 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
1001
1002 struct Declarator
1003 {
1004 struct Declarator * prev;
1005 struct Declarator * next;
1006 struct Location loc;
1007 int type;
1008 struct Symbol * symbol;
1009 struct Declarator * declarator;
1010 union
1011 {
1012 struct Identifier * identifier;
1013 struct
1014 {
1015 struct Expression * exp;
1016 struct Expression * posExp;
1017 struct Attrib * attrib;
1018 } __attribute__ ((gcc_struct)) structDecl;
1019 struct
1020 {
1021 struct Expression * exp;
1022 struct Specifier * enumClass;
1023 } __attribute__ ((gcc_struct)) array;
1024 struct
1025 {
1026 struct __ecereNameSpace__ecere__sys__OldList * parameters;
1027 } __attribute__ ((gcc_struct)) function;
1028 struct
1029 {
1030 struct Pointer * pointer;
1031 } __attribute__ ((gcc_struct)) pointer;
1032 struct
1033 {
1034 struct ExtDecl * extended;
1035 } __attribute__ ((gcc_struct)) extended;
1036 } __attribute__ ((gcc_struct)) __anon1;
1037 } __attribute__ ((gcc_struct));
1038
1039 extern struct Identifier * GetDeclId(struct Declarator * decl);
1040
1041 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
1042
1043 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1044
1045 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1046
1047 extern void FreeDeclarator(struct Declarator * decl);
1048
1049 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1050
1051 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
1052
1053 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1054
1055 struct FunctionDefinition
1056 {
1057 struct FunctionDefinition * prev;
1058 struct FunctionDefinition * next;
1059 struct Location loc;
1060 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1061 struct Declarator * declarator;
1062 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1063 struct Statement * body;
1064 struct __ecereNameSpace__ecere__com__Class * _class;
1065 struct __ecereNameSpace__ecere__sys__OldList attached;
1066 int declMode;
1067 struct Type * type;
1068 struct Symbol * propSet;
1069 int tempCount;
1070 unsigned int propertyNoThis;
1071 } __attribute__ ((gcc_struct));
1072
1073 extern struct Declarator * QMkPtrDecl(const char *  id);
1074
1075 struct ClassFunction;
1076
1077 struct ClassFunction
1078 {
1079 struct ClassFunction * prev;
1080 struct ClassFunction * next;
1081 struct Location loc;
1082 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1083 struct Declarator * declarator;
1084 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1085 struct Statement * body;
1086 struct __ecereNameSpace__ecere__com__Class * _class;
1087 struct __ecereNameSpace__ecere__sys__OldList attached;
1088 int declMode;
1089 struct Type * type;
1090 struct Symbol * propSet;
1091 unsigned int isVirtual;
1092 unsigned int isConstructor;
1093 unsigned int isDestructor;
1094 unsigned int dontMangle;
1095 int id;
1096 int idCode;
1097 } __attribute__ ((gcc_struct));
1098
1099 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);
1100
1101 extern void FreeClassFunction(struct ClassFunction * func);
1102
1103 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1104
1105 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1106
1107 struct TypeName;
1108
1109 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1110
1111 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1112
1113 struct TypeName
1114 {
1115 struct TypeName * prev;
1116 struct TypeName * next;
1117 struct Location loc;
1118 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
1119 struct Declarator * declarator;
1120 int classObjectType;
1121 struct Expression * bitCount;
1122 } __attribute__ ((gcc_struct));
1123
1124 extern void FreeTypeName(struct TypeName * typeName);
1125
1126 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
1127
1128 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
1129
1130 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
1131
1132 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
1133
1134 struct __ecereNameSpace__ecere__com__BTNamedLink;
1135
1136 struct __ecereNameSpace__ecere__com__BTNamedLink
1137 {
1138 const char *  name;
1139 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1140 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1141 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1142 int depth;
1143 void *  data;
1144 } __attribute__ ((gcc_struct));
1145
1146 struct __ecereNameSpace__ecere__sys__NamedLink64;
1147
1148 struct __ecereNameSpace__ecere__sys__NamedLink64
1149 {
1150 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
1151 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
1152 char *  name;
1153 long long data;
1154 } __attribute__ ((gcc_struct));
1155
1156 struct Instantiation;
1157
1158 struct Declaration
1159 {
1160 struct Declaration * prev;
1161 struct Declaration * next;
1162 struct Location loc;
1163 int type;
1164 union
1165 {
1166 struct
1167 {
1168 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1169 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1170 } __attribute__ ((gcc_struct)) __anon1;
1171 struct Instantiation * inst;
1172 struct
1173 {
1174 struct Identifier * id;
1175 struct Expression * exp;
1176 } __attribute__ ((gcc_struct)) __anon2;
1177 } __attribute__ ((gcc_struct)) __anon1;
1178 struct Specifier * extStorage;
1179 struct Symbol * symbol;
1180 int declMode;
1181 } __attribute__ ((gcc_struct));
1182
1183 struct Instantiation
1184 {
1185 struct Instantiation * prev;
1186 struct Instantiation * next;
1187 struct Location loc;
1188 struct Specifier * _class;
1189 struct Expression * exp;
1190 struct __ecereNameSpace__ecere__sys__OldList *  members;
1191 struct Symbol * symbol;
1192 unsigned int fullSet;
1193 unsigned int isConstant;
1194 unsigned char *  data;
1195 struct Location nameLoc;
1196 struct Location insideLoc;
1197 unsigned int built;
1198 } __attribute__ ((gcc_struct));
1199
1200 extern void FreeInstance(struct Instantiation * inst);
1201
1202 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
1203
1204 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
1205
1206 struct InitDeclarator;
1207
1208 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1209
1210 struct PropertyWatch;
1211
1212 struct PropertyWatch
1213 {
1214 struct PropertyWatch * prev;
1215 struct PropertyWatch * next;
1216 struct Location loc;
1217 struct Statement * compound;
1218 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1219 unsigned int deleteWatch;
1220 } __attribute__ ((gcc_struct));
1221
1222 extern void FreePropertyWatch(struct PropertyWatch * watcher);
1223
1224 struct PropertyImport;
1225
1226 struct PropertyImport
1227 {
1228 struct PropertyImport * prev;
1229 struct PropertyImport * next;
1230 char *  name;
1231 unsigned int isVirtual;
1232 unsigned int hasSet;
1233 unsigned int hasGet;
1234 } __attribute__ ((gcc_struct));
1235
1236 struct MethodImport;
1237
1238 struct MethodImport
1239 {
1240 struct MethodImport * prev;
1241 struct MethodImport * next;
1242 char *  name;
1243 unsigned int isVirtual;
1244 } __attribute__ ((gcc_struct));
1245
1246 struct FunctionImport;
1247
1248 struct FunctionImport
1249 {
1250 struct FunctionImport * prev;
1251 struct FunctionImport * next;
1252 char *  name;
1253 } __attribute__ ((gcc_struct));
1254
1255 struct ClassImport;
1256
1257 struct ClassImport
1258 {
1259 struct ClassImport * prev;
1260 struct ClassImport * next;
1261 char *  name;
1262 struct __ecereNameSpace__ecere__sys__OldList methods;
1263 struct __ecereNameSpace__ecere__sys__OldList properties;
1264 unsigned int itself;
1265 int isRemote;
1266 } __attribute__ ((gcc_struct));
1267
1268 struct Initializer;
1269
1270 struct Expression
1271 {
1272 struct Expression * prev;
1273 struct Expression * next;
1274 struct Location loc;
1275 int type;
1276 union
1277 {
1278 struct
1279 {
1280 char *  constant;
1281 struct Identifier * identifier;
1282 } __attribute__ ((gcc_struct)) __anon1;
1283 struct Statement * compound;
1284 struct Instantiation * instance;
1285 struct
1286 {
1287 char *  string;
1288 unsigned int intlString;
1289 unsigned int wideString;
1290 } __attribute__ ((gcc_struct)) __anon2;
1291 struct __ecereNameSpace__ecere__sys__OldList *  list;
1292 struct
1293 {
1294 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1295 struct Declarator * decl;
1296 } __attribute__ ((gcc_struct)) _classExp;
1297 struct
1298 {
1299 struct Identifier * id;
1300 } __attribute__ ((gcc_struct)) classData;
1301 struct
1302 {
1303 struct Expression * exp;
1304 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1305 struct Location argLoc;
1306 } __attribute__ ((gcc_struct)) call;
1307 struct
1308 {
1309 struct Expression * exp;
1310 struct __ecereNameSpace__ecere__sys__OldList * index;
1311 } __attribute__ ((gcc_struct)) index;
1312 struct
1313 {
1314 struct Expression * exp;
1315 struct Identifier * member;
1316 int memberType;
1317 unsigned int thisPtr;
1318 } __attribute__ ((gcc_struct)) member;
1319 struct
1320 {
1321 int op;
1322 struct Expression * exp1;
1323 struct Expression * exp2;
1324 } __attribute__ ((gcc_struct)) op;
1325 struct TypeName * typeName;
1326 struct Specifier * _class;
1327 struct
1328 {
1329 struct TypeName * typeName;
1330 struct Expression * exp;
1331 } __attribute__ ((gcc_struct)) cast;
1332 struct
1333 {
1334 struct Expression * cond;
1335 struct __ecereNameSpace__ecere__sys__OldList * exp;
1336 struct Expression * elseExp;
1337 } __attribute__ ((gcc_struct)) cond;
1338 struct
1339 {
1340 struct TypeName * typeName;
1341 struct Expression * size;
1342 } __attribute__ ((gcc_struct)) _new;
1343 struct
1344 {
1345 struct TypeName * typeName;
1346 struct Expression * size;
1347 struct Expression * exp;
1348 } __attribute__ ((gcc_struct)) _renew;
1349 struct
1350 {
1351 char * table;
1352 struct Identifier * id;
1353 } __attribute__ ((gcc_struct)) db;
1354 struct
1355 {
1356 struct Expression * ds;
1357 struct Expression * name;
1358 } __attribute__ ((gcc_struct)) dbopen;
1359 struct
1360 {
1361 struct TypeName * typeName;
1362 struct Initializer * initializer;
1363 } __attribute__ ((gcc_struct)) initializer;
1364 struct
1365 {
1366 struct Expression * exp;
1367 struct TypeName * typeName;
1368 } __attribute__ ((gcc_struct)) vaArg;
1369 } __attribute__ ((gcc_struct)) __anon1;
1370 unsigned int debugValue;
1371 struct __ecereNameSpace__ecere__com__DataValue val;
1372 uint64 address;
1373 unsigned int hasAddress;
1374 struct Type * expType;
1375 struct Type * destType;
1376 unsigned int usage;
1377 int tempCount;
1378 unsigned int byReference;
1379 unsigned int isConstant;
1380 unsigned int addedThis;
1381 unsigned int needCast;
1382 unsigned int thisPtr;
1383 unsigned int opDestType;
1384 unsigned int needTemplateCast;
1385 } __attribute__ ((gcc_struct));
1386
1387 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1388
1389 struct Initializer
1390 {
1391 struct Initializer * prev;
1392 struct Initializer * next;
1393 struct Location loc;
1394 int type;
1395 union
1396 {
1397 struct Expression * exp;
1398 struct __ecereNameSpace__ecere__sys__OldList *  list;
1399 } __attribute__ ((gcc_struct)) __anon1;
1400 unsigned int isConstant;
1401 struct Identifier * id;
1402 } __attribute__ ((gcc_struct));
1403
1404 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1405
1406 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
1407
1408 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
1409
1410 struct InitDeclarator
1411 {
1412 struct InitDeclarator * prev;
1413 struct InitDeclarator * next;
1414 struct Location loc;
1415 struct Declarator * declarator;
1416 struct Initializer * initializer;
1417 } __attribute__ ((gcc_struct));
1418
1419 void ApplyLocation(struct Expression * exp, struct Location * loc)
1420 {
1421 exp->loc = *loc;
1422 switch(exp->type)
1423 {
1424 case 4:
1425 if(exp->__anon1.op.exp1)
1426 ApplyLocation(exp->__anon1.op.exp1, loc);
1427 if(exp->__anon1.op.exp2)
1428 ApplyLocation(exp->__anon1.op.exp2, loc);
1429 break;
1430 case 5:
1431 if(exp->__anon1.list)
1432 {
1433 struct Expression * e;
1434
1435 for(e = (*exp->__anon1.list).first; e; e = e->next)
1436 ApplyLocation(e, loc);
1437 }
1438 break;
1439 case 6:
1440 if(exp->__anon1.index.index)
1441 {
1442 struct Expression * e;
1443
1444 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1445 ApplyLocation(e, loc);
1446 }
1447 if(exp->__anon1.index.exp)
1448 ApplyLocation(exp->__anon1.index.exp, loc);
1449 break;
1450 case 7:
1451 if(exp->__anon1.call.arguments)
1452 {
1453 struct Expression * arg;
1454
1455 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1456 ApplyLocation(arg, loc);
1457 }
1458 if(exp->__anon1.call.exp)
1459 ApplyLocation(exp->__anon1.call.exp, loc);
1460 break;
1461 case 8:
1462 case 9:
1463 if(exp->__anon1.member.exp)
1464 ApplyLocation(exp->__anon1.member.exp, loc);
1465 break;
1466 case 11:
1467 if(exp->__anon1.cast.exp)
1468 ApplyLocation(exp->__anon1.cast.exp, loc);
1469 break;
1470 case 12:
1471 if(exp->__anon1.cond.exp)
1472 {
1473 struct Expression * e;
1474
1475 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1476 ApplyLocation(e, loc);
1477 }
1478 if(exp->__anon1.cond.cond)
1479 ApplyLocation(exp->__anon1.cond.cond, loc);
1480 if(exp->__anon1.cond.elseExp)
1481 ApplyLocation(exp->__anon1.cond.elseExp, loc);
1482 break;
1483 case 34:
1484 if(exp->__anon1.vaArg.exp)
1485 ApplyLocation(exp->__anon1.vaArg.exp, loc);
1486 break;
1487 default:
1488 break;
1489 }
1490 }
1491
1492 void __ecereMethod_Expression_Clear();
1493
1494 struct MembersInit;
1495
1496 struct MembersInit
1497 {
1498 struct MembersInit * prev;
1499 struct MembersInit * next;
1500 struct Location loc;
1501 int type;
1502 union
1503 {
1504 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1505 struct ClassFunction * function;
1506 } __attribute__ ((gcc_struct)) __anon1;
1507 } __attribute__ ((gcc_struct));
1508
1509 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
1510
1511 struct Operand;
1512
1513 struct OpTable
1514 {
1515 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1516 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1517 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1518 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1519 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1520 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1521 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1522 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1523 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1524 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1525 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1526 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1527 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1528 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1529 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1530 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1531 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1532 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1533 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1534 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1535 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1536 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1537 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1538 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1539 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1540 unsigned int (*  Not)(struct Expression *, struct Operand *);
1541 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1542 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1543 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1544 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1545 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1546 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1547 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1548 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1549 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1550 } __attribute__ ((gcc_struct));
1551
1552 struct Operand
1553 {
1554 int kind;
1555 struct Type * type;
1556 unsigned int ptrSize;
1557 union
1558 {
1559 char c;
1560 unsigned char uc;
1561 short s;
1562 unsigned short us;
1563 int i;
1564 unsigned int ui;
1565 float f;
1566 double d;
1567 long long i64;
1568 uint64 ui64;
1569 } __attribute__ ((gcc_struct)) __anon1;
1570 struct OpTable ops;
1571 } __attribute__ ((gcc_struct));
1572
1573 struct External *  _DeclareStruct(struct External *  neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl);
1574
1575 struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference)
1576 {
1577 return _DeclareStruct(neededBy, name, skipNoHead, needDereference, 0);
1578 }
1579
1580 static void _DeclareType(struct External *  neededFor, struct Type *  type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl);
1581
1582 void DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1583 {
1584 _DeclareType(neededFor, type, needDereference, forFunctionDef, 0);
1585 }
1586
1587 void DeclareTypeForwardDeclare(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1588 {
1589 _DeclareType(neededFor, type, needDereference, forFunctionDef, 1);
1590 }
1591
1592 static void _PrintType(struct Type *  type, char *  string, unsigned int printName, unsigned int fullName, unsigned int printConst);
1593
1594 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1595 {
1596 _PrintType(type, string, printName, fullName, 1);
1597 }
1598
1599 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1600 {
1601 _PrintType(type, string, printName, fullName, 0);
1602 }
1603
1604 struct __ecereNameSpace__ecere__com__Method;
1605
1606 struct __ecereNameSpace__ecere__com__Method
1607 {
1608 const char *  name;
1609 struct __ecereNameSpace__ecere__com__Method * parent;
1610 struct __ecereNameSpace__ecere__com__Method * left;
1611 struct __ecereNameSpace__ecere__com__Method * right;
1612 int depth;
1613 int (*  function)();
1614 int vid;
1615 int type;
1616 struct __ecereNameSpace__ecere__com__Class * _class;
1617 void *  symbol;
1618 const char *  dataTypeString;
1619 struct Type * dataType;
1620 int memberAccess;
1621 } __attribute__ ((gcc_struct));
1622
1623 struct Symbol
1624 {
1625 char *  string;
1626 struct Symbol * parent;
1627 struct Symbol * left;
1628 struct Symbol * right;
1629 int depth;
1630 struct Type * type;
1631 union
1632 {
1633 struct __ecereNameSpace__ecere__com__Method * method;
1634 struct __ecereNameSpace__ecere__com__Property * _property;
1635 struct __ecereNameSpace__ecere__com__Class * registered;
1636 } __attribute__ ((gcc_struct)) __anon1;
1637 unsigned int notYetDeclared;
1638 union
1639 {
1640 struct
1641 {
1642 struct External * pointerExternal;
1643 struct External * structExternal;
1644 } __attribute__ ((gcc_struct)) __anon1;
1645 struct
1646 {
1647 struct External * externalGet;
1648 struct External * externalSet;
1649 struct External * externalPtr;
1650 struct External * externalIsSet;
1651 } __attribute__ ((gcc_struct)) __anon2;
1652 struct
1653 {
1654 struct External * methodExternal;
1655 struct External * methodCodeExternal;
1656 } __attribute__ ((gcc_struct)) __anon3;
1657 } __attribute__ ((gcc_struct)) __anon2;
1658 unsigned int imported;
1659 unsigned int declaredStructSym;
1660 struct __ecereNameSpace__ecere__com__Class * _class;
1661 unsigned int declaredStruct;
1662 unsigned int needConstructor;
1663 unsigned int needDestructor;
1664 char *  constructorName;
1665 char *  structName;
1666 char *  className;
1667 char *  destructorName;
1668 struct ModuleImport * module;
1669 struct ClassImport * _import;
1670 struct Location nameLoc;
1671 unsigned int isParam;
1672 unsigned int isRemote;
1673 unsigned int isStruct;
1674 unsigned int fireWatchersDone;
1675 int declaring;
1676 unsigned int classData;
1677 unsigned int isStatic;
1678 char *  shortName;
1679 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
1680 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
1681 struct Context * ctx;
1682 int isIterator;
1683 struct Expression * propCategory;
1684 unsigned int mustRegister;
1685 } __attribute__ ((gcc_struct));
1686
1687 struct __ecereNameSpace__ecere__com__ClassProperty;
1688
1689 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1690
1691 struct __ecereNameSpace__ecere__com__ClassProperty
1692 {
1693 const char *  name;
1694 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1695 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1696 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1697 int depth;
1698 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1699 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1700 const char *  dataTypeString;
1701 struct Type * dataType;
1702 unsigned int constant;
1703 } __attribute__ ((gcc_struct));
1704
1705 struct __ecereNameSpace__ecere__com__BitMember;
1706
1707 struct __ecereNameSpace__ecere__com__BitMember
1708 {
1709 struct __ecereNameSpace__ecere__com__BitMember * prev;
1710 struct __ecereNameSpace__ecere__com__BitMember * next;
1711 const char *  name;
1712 unsigned int isProperty;
1713 int memberAccess;
1714 int id;
1715 struct __ecereNameSpace__ecere__com__Class * _class;
1716 const char *  dataTypeString;
1717 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1718 struct Type * dataType;
1719 int type;
1720 int size;
1721 int pos;
1722 uint64 mask;
1723 } __attribute__ ((gcc_struct));
1724
1725 struct __ecereNameSpace__ecere__com__DataMember;
1726
1727 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1728 {
1729 union
1730 {
1731 struct
1732 {
1733 const char *  dataTypeString;
1734 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1735 } __attribute__ ((gcc_struct)) __anon1;
1736 struct __ecereNameSpace__ecere__com__DataValue expression;
1737 struct
1738 {
1739 const char *  memberString;
1740 union
1741 {
1742 struct __ecereNameSpace__ecere__com__DataMember * member;
1743 struct __ecereNameSpace__ecere__com__Property * prop;
1744 struct __ecereNameSpace__ecere__com__Method * method;
1745 } __attribute__ ((gcc_struct)) __anon1;
1746 } __attribute__ ((gcc_struct)) __anon2;
1747 } __attribute__ ((gcc_struct)) __anon1;
1748 } __attribute__ ((gcc_struct));
1749
1750 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);
1751
1752 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);
1753
1754 struct TemplateParameter;
1755
1756 struct TemplateParameter
1757 {
1758 struct TemplateParameter * prev;
1759 struct TemplateParameter * next;
1760 struct Location loc;
1761 int type;
1762 struct Identifier * identifier;
1763 union
1764 {
1765 struct TemplateDatatype * dataType;
1766 int memberType;
1767 } __attribute__ ((gcc_struct)) __anon1;
1768 struct TemplateArgument * defaultArgument;
1769 const char *  dataTypeString;
1770 struct Type * baseType;
1771 } __attribute__ ((gcc_struct));
1772
1773 struct Type
1774 {
1775 struct Type * prev;
1776 struct Type * next;
1777 int refCount;
1778 union
1779 {
1780 struct Symbol * _class;
1781 struct
1782 {
1783 struct __ecereNameSpace__ecere__sys__OldList members;
1784 char *  enumName;
1785 } __attribute__ ((gcc_struct)) __anon1;
1786 struct
1787 {
1788 struct Type * returnType;
1789 struct __ecereNameSpace__ecere__sys__OldList params;
1790 struct Symbol * thisClass;
1791 unsigned int staticMethod;
1792 struct TemplateParameter * thisClassTemplate;
1793 } __attribute__ ((gcc_struct)) __anon2;
1794 struct
1795 {
1796 struct __ecereNameSpace__ecere__com__Method * method;
1797 struct __ecereNameSpace__ecere__com__Class * methodClass;
1798 struct __ecereNameSpace__ecere__com__Class * usedClass;
1799 } __attribute__ ((gcc_struct)) __anon3;
1800 struct
1801 {
1802 struct Type * arrayType;
1803 int arraySize;
1804 struct Expression * arraySizeExp;
1805 unsigned int freeExp;
1806 struct Symbol * enumClass;
1807 } __attribute__ ((gcc_struct)) __anon4;
1808 struct Type * type;
1809 struct TemplateParameter * templateParameter;
1810 } __attribute__ ((gcc_struct)) __anon1;
1811 int kind;
1812 unsigned int size;
1813 char *  name;
1814 char *  typeName;
1815 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1816 int classObjectType;
1817 int alignment;
1818 unsigned int offset;
1819 int bitFieldCount;
1820 int count;
1821 unsigned int isSigned : 1;
1822 unsigned int constant : 1;
1823 unsigned int truth : 1;
1824 unsigned int byReference : 1;
1825 unsigned int extraParam : 1;
1826 unsigned int directClassAccess : 1;
1827 unsigned int computing : 1;
1828 unsigned int keepCast : 1;
1829 unsigned int passAsTemplate : 1;
1830 unsigned int dllExport : 1;
1831 unsigned int attrStdcall : 1;
1832 unsigned int declaredWithStruct : 1;
1833 unsigned int typedByReference : 1;
1834 unsigned int casted : 1;
1835 unsigned int pointerAlignment : 1;
1836 unsigned int isLong : 1;
1837 } __attribute__ ((gcc_struct));
1838
1839 struct Specifier
1840 {
1841 struct Specifier * prev;
1842 struct Specifier * next;
1843 struct Location loc;
1844 int type;
1845 union
1846 {
1847 int specifier;
1848 struct
1849 {
1850 struct ExtDecl * extDecl;
1851 char *  name;
1852 struct Symbol * symbol;
1853 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
1854 struct Specifier * nsSpec;
1855 } __attribute__ ((gcc_struct)) __anon1;
1856 struct
1857 {
1858 struct Identifier * id;
1859 struct __ecereNameSpace__ecere__sys__OldList *  list;
1860 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
1861 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
1862 unsigned int addNameSpace;
1863 struct Context * ctx;
1864 struct ExtDecl * extDeclStruct;
1865 } __attribute__ ((gcc_struct)) __anon2;
1866 struct Expression * expression;
1867 struct Specifier * _class;
1868 struct TemplateParameter * templateParameter;
1869 } __attribute__ ((gcc_struct)) __anon1;
1870 } __attribute__ ((gcc_struct));
1871
1872 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
1873
1874 struct TemplatedType
1875 {
1876 uintptr_t key;
1877 struct __ecereNameSpace__ecere__sys__BTNode * parent;
1878 struct __ecereNameSpace__ecere__sys__BTNode * left;
1879 struct __ecereNameSpace__ecere__sys__BTNode * right;
1880 int depth;
1881 struct TemplateParameter * param;
1882 } __attribute__ ((gcc_struct));
1883
1884 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1885 {
1886 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1887 {
1888 if(!param->baseType)
1889 {
1890 if(param->dataTypeString)
1891 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1892 else
1893 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1894 }
1895 return param->baseType;
1896 }
1897 return (((void *)0));
1898 }
1899
1900 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1901 {
1902 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1903 return 1;
1904 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1905 {
1906 return 0;
1907 }
1908 if(type1->kind == type2->kind && type1->isLong == type2->isLong)
1909 {
1910 switch(type1->kind)
1911 {
1912 case 24:
1913 case 1:
1914 case 2:
1915 case 3:
1916 case 4:
1917 case 22:
1918 case 23:
1919 if(type1->passAsTemplate && !type2->passAsTemplate)
1920 return 1;
1921 return type1->isSigned != type2->isSigned;
1922 case 8:
1923 return type1->__anon1._class != type2->__anon1._class;
1924 case 13:
1925 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1926 default:
1927 return 1;
1928 }
1929 }
1930 return 1;
1931 }
1932
1933 unsigned int GetOpInt(struct Operand * op2, int * value2)
1934 {
1935 if(op2->kind == 3 && op2->type->isSigned)
1936 *value2 = op2->__anon1.i;
1937 else if(op2->kind == 3)
1938 *value2 = (int)op2->__anon1.ui;
1939 else if(op2->kind == 4 && op2->type->isSigned)
1940 *value2 = (int)op2->__anon1.i64;
1941 else if(op2->kind == 4)
1942 *value2 = (int)op2->__anon1.ui64;
1943 else if(op2->kind == 23 && op2->type->isSigned)
1944 *value2 = (int)op2->__anon1.i64;
1945 else if(op2->kind == 23)
1946 *value2 = (int)op2->__anon1.ui64;
1947 else if(op2->kind == 22 && op2->type->isSigned)
1948 *value2 = (int)op2->__anon1.i64;
1949 else if(op2->kind == 22)
1950 *value2 = (int)op2->__anon1.ui64;
1951 else if(op2->kind == 2 && op2->type->isSigned)
1952 *value2 = (int)op2->__anon1.s;
1953 else if(op2->kind == 2)
1954 *value2 = (int)op2->__anon1.us;
1955 else if(op2->kind == 1 && op2->type->isSigned)
1956 *value2 = (int)op2->__anon1.c;
1957 else if(op2->kind == 24 || op2->kind == 1)
1958 *value2 = (int)op2->__anon1.uc;
1959 else if(op2->kind == 6)
1960 *value2 = (int)op2->__anon1.f;
1961 else if(op2->kind == 7)
1962 *value2 = (int)op2->__anon1.d;
1963 else if(op2->kind == 13)
1964 *value2 = (int)op2->__anon1.ui64;
1965 else
1966 return 0;
1967 return 1;
1968 }
1969
1970 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1971 {
1972 if(op2->kind == 3 && op2->type->isSigned)
1973 *value2 = (unsigned int)op2->__anon1.i;
1974 else if(op2->kind == 3)
1975 *value2 = op2->__anon1.ui;
1976 else if(op2->kind == 4 && op2->type->isSigned)
1977 *value2 = (unsigned int)op2->__anon1.i64;
1978 else if(op2->kind == 4)
1979 *value2 = (unsigned int)op2->__anon1.ui64;
1980 else if(op2->kind == 23 && op2->type->isSigned)
1981 *value2 = (unsigned int)op2->__anon1.i64;
1982 else if(op2->kind == 23)
1983 *value2 = (unsigned int)op2->__anon1.ui64;
1984 else if(op2->kind == 22 && op2->type->isSigned)
1985 *value2 = (unsigned int)op2->__anon1.i64;
1986 else if(op2->kind == 22)
1987 *value2 = (unsigned int)op2->__anon1.ui64;
1988 else if(op2->kind == 2 && op2->type->isSigned)
1989 *value2 = (unsigned int)op2->__anon1.s;
1990 else if(op2->kind == 2)
1991 *value2 = (unsigned int)op2->__anon1.us;
1992 else if(op2->kind == 1 && op2->type->isSigned)
1993 *value2 = (unsigned int)op2->__anon1.c;
1994 else if(op2->kind == 24 || op2->kind == 1)
1995 *value2 = (unsigned int)op2->__anon1.uc;
1996 else if(op2->kind == 6)
1997 *value2 = (unsigned int)op2->__anon1.f;
1998 else if(op2->kind == 7)
1999 *value2 = (unsigned int)op2->__anon1.d;
2000 else if(op2->kind == 13)
2001 *value2 = (unsigned int)op2->__anon1.ui64;
2002 else
2003 return 0;
2004 return 1;
2005 }
2006
2007 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
2008 {
2009 if(op2->kind == 3 && op2->type->isSigned)
2010 *value2 = (long long)op2->__anon1.i;
2011 else if(op2->kind == 3)
2012 *value2 = (long long)op2->__anon1.ui;
2013 else if(op2->kind == 4 && op2->type->isSigned)
2014 *value2 = op2->__anon1.i64;
2015 else if(op2->kind == 4)
2016 *value2 = (long long)op2->__anon1.ui64;
2017 else if(op2->kind == 23 && op2->type->isSigned)
2018 *value2 = op2->__anon1.i64;
2019 else if(op2->kind == 23)
2020 *value2 = (long long)op2->__anon1.ui64;
2021 else if(op2->kind == 22 && op2->type->isSigned)
2022 *value2 = op2->__anon1.i64;
2023 else if(op2->kind == 22)
2024 *value2 = (long long)op2->__anon1.ui64;
2025 else if(op2->kind == 2 && op2->type->isSigned)
2026 *value2 = (long long)op2->__anon1.s;
2027 else if(op2->kind == 2)
2028 *value2 = (long long)op2->__anon1.us;
2029 else if(op2->kind == 1 && op2->type->isSigned)
2030 *value2 = (long long)op2->__anon1.c;
2031 else if(op2->kind == 24 || op2->kind == 1)
2032 *value2 = (long long)op2->__anon1.uc;
2033 else if(op2->kind == 6)
2034 *value2 = (long long)op2->__anon1.f;
2035 else if(op2->kind == 7)
2036 *value2 = (long long)op2->__anon1.d;
2037 else if(op2->kind == 13)
2038 *value2 = (long long)op2->__anon1.ui64;
2039 else
2040 return 0;
2041 return 1;
2042 }
2043
2044 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
2045 {
2046 if(op2->kind == 3 && op2->type->isSigned)
2047 *value2 = (uint64)op2->__anon1.i;
2048 else if(op2->kind == 3)
2049 *value2 = (uint64)op2->__anon1.ui;
2050 else if(op2->kind == 4 && op2->type->isSigned)
2051 *value2 = (uint64)op2->__anon1.i64;
2052 else if(op2->kind == 4)
2053 *value2 = op2->__anon1.ui64;
2054 else if(op2->kind == 23 && op2->type->isSigned)
2055 *value2 = (uint64)op2->__anon1.i64;
2056 else if(op2->kind == 23)
2057 *value2 = op2->__anon1.ui64;
2058 else if(op2->kind == 22 && op2->type->isSigned)
2059 *value2 = (uint64)op2->__anon1.i64;
2060 else if(op2->kind == 22)
2061 *value2 = op2->__anon1.ui64;
2062 else if(op2->kind == 2 && op2->type->isSigned)
2063 *value2 = (uint64)op2->__anon1.s;
2064 else if(op2->kind == 2)
2065 *value2 = (uint64)op2->__anon1.us;
2066 else if(op2->kind == 1 && op2->type->isSigned)
2067 *value2 = (uint64)op2->__anon1.c;
2068 else if(op2->kind == 24 || op2->kind == 1)
2069 *value2 = (uint64)op2->__anon1.uc;
2070 else if(op2->kind == 6)
2071 *value2 = (uint64)op2->__anon1.f;
2072 else if(op2->kind == 7)
2073 *value2 = (uint64)op2->__anon1.d;
2074 else if(op2->kind == 13)
2075 *value2 = op2->__anon1.ui64;
2076 else
2077 return 0;
2078 return 1;
2079 }
2080
2081 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
2082 {
2083 if(op2->kind == 3 && op2->type->isSigned)
2084 *value2 = (intptr_t)op2->__anon1.i;
2085 else if(op2->kind == 3)
2086 *value2 = (intptr_t)op2->__anon1.ui;
2087 else if(op2->kind == 4 && op2->type->isSigned)
2088 *value2 = (intptr_t)op2->__anon1.i64;
2089 else if(op2->kind == 4)
2090 *value2 = (intptr_t)op2->__anon1.ui64;
2091 else if(op2->kind == 23 && op2->type->isSigned)
2092 *value2 = (intptr_t)op2->__anon1.i64;
2093 else if(op2->kind == 23)
2094 *value2 = (intptr_t)op2->__anon1.ui64;
2095 else if(op2->kind == 22 && op2->type->isSigned)
2096 *value2 = (intptr_t)op2->__anon1.i64;
2097 else if(op2->kind == 22)
2098 *value2 = (intptr_t)op2->__anon1.ui64;
2099 else if(op2->kind == 2 && op2->type->isSigned)
2100 *value2 = (intptr_t)op2->__anon1.s;
2101 else if(op2->kind == 2)
2102 *value2 = (intptr_t)op2->__anon1.us;
2103 else if(op2->kind == 1 && op2->type->isSigned)
2104 *value2 = (intptr_t)op2->__anon1.c;
2105 else if(op2->kind == 24 || op2->kind == 1)
2106 *value2 = (intptr_t)op2->__anon1.uc;
2107 else if(op2->kind == 6)
2108 *value2 = (intptr_t)op2->__anon1.f;
2109 else if(op2->kind == 7)
2110 *value2 = (intptr_t)op2->__anon1.d;
2111 else if(op2->kind == 13)
2112 *value2 = (intptr_t)op2->__anon1.ui64;
2113 else
2114 return 0;
2115 return 1;
2116 }
2117
2118 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
2119 {
2120 if(op2->kind == 3 && op2->type->isSigned)
2121 *value2 = (uintptr_t)op2->__anon1.i;
2122 else if(op2->kind == 3)
2123 *value2 = (uintptr_t)op2->__anon1.ui;
2124 else if(op2->kind == 4 && op2->type->isSigned)
2125 *value2 = (uintptr_t)op2->__anon1.i64;
2126 else if(op2->kind == 4)
2127 *value2 = (uintptr_t)op2->__anon1.ui64;
2128 else if(op2->kind == 23 && op2->type->isSigned)
2129 *value2 = (uintptr_t)op2->__anon1.i64;
2130 else if(op2->kind == 23)
2131 *value2 = (uintptr_t)op2->__anon1.ui64;
2132 else if(op2->kind == 22 && op2->type->isSigned)
2133 *value2 = (uintptr_t)op2->__anon1.i64;
2134 else if(op2->kind == 22)
2135 *value2 = (uintptr_t)op2->__anon1.ui64;
2136 else if(op2->kind == 2 && op2->type->isSigned)
2137 *value2 = (uintptr_t)op2->__anon1.s;
2138 else if(op2->kind == 2)
2139 *value2 = (uintptr_t)op2->__anon1.us;
2140 else if(op2->kind == 1 && op2->type->isSigned)
2141 *value2 = (uintptr_t)op2->__anon1.c;
2142 else if(op2->kind == 24 || op2->kind == 1)
2143 *value2 = (uintptr_t)op2->__anon1.uc;
2144 else if(op2->kind == 6)
2145 *value2 = (uintptr_t)op2->__anon1.f;
2146 else if(op2->kind == 7)
2147 *value2 = (uintptr_t)op2->__anon1.d;
2148 else if(op2->kind == 13)
2149 *value2 = (uintptr_t)op2->__anon1.ui64;
2150 else
2151 return 0;
2152 return 1;
2153 }
2154
2155 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2156 {
2157 if(op2->kind == 3 && op2->type->isSigned)
2158 *value2 = (ssize_t)op2->__anon1.i;
2159 else if(op2->kind == 3)
2160 *value2 = (ssize_t)op2->__anon1.ui;
2161 else if(op2->kind == 4 && op2->type->isSigned)
2162 *value2 = (ssize_t)op2->__anon1.i64;
2163 else if(op2->kind == 4)
2164 *value2 = (ssize_t)op2->__anon1.ui64;
2165 else if(op2->kind == 23 && op2->type->isSigned)
2166 *value2 = (ssize_t)op2->__anon1.i64;
2167 else if(op2->kind == 23)
2168 *value2 = (ssize_t)op2->__anon1.ui64;
2169 else if(op2->kind == 22 && op2->type->isSigned)
2170 *value2 = (ssize_t)op2->__anon1.i64;
2171 else if(op2->kind == 22)
2172 *value2 = (ssize_t)op2->__anon1.ui64;
2173 else if(op2->kind == 2 && op2->type->isSigned)
2174 *value2 = (ssize_t)op2->__anon1.s;
2175 else if(op2->kind == 2)
2176 *value2 = (ssize_t)op2->__anon1.us;
2177 else if(op2->kind == 1 && op2->type->isSigned)
2178 *value2 = (ssize_t)op2->__anon1.c;
2179 else if(op2->kind == 24 || op2->kind == 1)
2180 *value2 = (ssize_t)op2->__anon1.uc;
2181 else if(op2->kind == 6)
2182 *value2 = (ssize_t)op2->__anon1.f;
2183 else if(op2->kind == 7)
2184 *value2 = (ssize_t)op2->__anon1.d;
2185 else if(op2->kind == 13)
2186 *value2 = (ssize_t)op2->__anon1.ui64;
2187 else
2188 return 0;
2189 return 1;
2190 }
2191
2192 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2193 {
2194 if(op2->kind == 3 && op2->type->isSigned)
2195 *value2 = (size_t)op2->__anon1.i;
2196 else if(op2->kind == 3)
2197 *value2 = (size_t)op2->__anon1.ui;
2198 else if(op2->kind == 4 && op2->type->isSigned)
2199 *value2 = (size_t)op2->__anon1.i64;
2200 else if(op2->kind == 4)
2201 *value2 = (size_t)op2->__anon1.ui64;
2202 else if(op2->kind == 23 && op2->type->isSigned)
2203 *value2 = (size_t)op2->__anon1.i64;
2204 else if(op2->kind == 23)
2205 *value2 = (size_t)op2->__anon1.ui64;
2206 else if(op2->kind == 22 && op2->type->isSigned)
2207 *value2 = (size_t)op2->__anon1.i64;
2208 else if(op2->kind == 22)
2209 *value2 = (size_t)op2->__anon1.ui64;
2210 else if(op2->kind == 2 && op2->type->isSigned)
2211 *value2 = (size_t)op2->__anon1.s;
2212 else if(op2->kind == 2)
2213 *value2 = (size_t)op2->__anon1.us;
2214 else if(op2->kind == 1 && op2->type->isSigned)
2215 *value2 = (size_t)op2->__anon1.c;
2216 else if(op2->kind == 24 || op2->kind == 1)
2217 *value2 = (size_t)op2->__anon1.uc;
2218 else if(op2->kind == 6)
2219 *value2 = (size_t)op2->__anon1.f;
2220 else if(op2->kind == 7)
2221 *value2 = (size_t)op2->__anon1.d;
2222 else if(op2->kind == 13)
2223 *value2 = (size_t)op2->__anon1.ui64;
2224 else
2225 return 0;
2226 return 1;
2227 }
2228
2229 unsigned int GetOpShort(struct Operand * op2, short * value2)
2230 {
2231 if(op2->kind == 3 && op2->type->isSigned)
2232 *value2 = (short)op2->__anon1.i;
2233 else if(op2->kind == 3)
2234 *value2 = (short)op2->__anon1.ui;
2235 else if(op2->kind == 4 && op2->type->isSigned)
2236 *value2 = (short)op2->__anon1.i64;
2237 else if(op2->kind == 4)
2238 *value2 = (short)op2->__anon1.ui64;
2239 else if(op2->kind == 23 && op2->type->isSigned)
2240 *value2 = (short)op2->__anon1.i64;
2241 else if(op2->kind == 23)
2242 *value2 = (short)op2->__anon1.ui64;
2243 else if(op2->kind == 22 && op2->type->isSigned)
2244 *value2 = (short)op2->__anon1.i64;
2245 else if(op2->kind == 22)
2246 *value2 = (short)op2->__anon1.ui64;
2247 else if(op2->kind == 2 && op2->type->isSigned)
2248 *value2 = op2->__anon1.s;
2249 else if(op2->kind == 2)
2250 *value2 = (short)op2->__anon1.us;
2251 else if(op2->kind == 1 && op2->type->isSigned)
2252 *value2 = (short)op2->__anon1.c;
2253 else if(op2->kind == 24 || op2->kind == 1)
2254 *value2 = (short)op2->__anon1.uc;
2255 else if(op2->kind == 6)
2256 *value2 = (short)op2->__anon1.f;
2257 else if(op2->kind == 7)
2258 *value2 = (short)op2->__anon1.d;
2259 else if(op2->kind == 13)
2260 *value2 = (short)op2->__anon1.ui64;
2261 else
2262 return 0;
2263 return 1;
2264 }
2265
2266 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2267 {
2268 if(op2->kind == 3 && op2->type->isSigned)
2269 *value2 = (unsigned short)op2->__anon1.i;
2270 else if(op2->kind == 3)
2271 *value2 = (unsigned short)op2->__anon1.ui;
2272 else if(op2->kind == 4 && op2->type->isSigned)
2273 *value2 = (unsigned short)op2->__anon1.i64;
2274 else if(op2->kind == 4)
2275 *value2 = (unsigned short)op2->__anon1.ui64;
2276 else if(op2->kind == 23 && op2->type->isSigned)
2277 *value2 = (unsigned short)op2->__anon1.i64;
2278 else if(op2->kind == 23)
2279 *value2 = (unsigned short)op2->__anon1.ui64;
2280 else if(op2->kind == 22 && op2->type->isSigned)
2281 *value2 = (unsigned short)op2->__anon1.i64;
2282 else if(op2->kind == 22)
2283 *value2 = (unsigned short)op2->__anon1.ui64;
2284 else if(op2->kind == 2 && op2->type->isSigned)
2285 *value2 = (unsigned short)op2->__anon1.s;
2286 else if(op2->kind == 2)
2287 *value2 = op2->__anon1.us;
2288 else if(op2->kind == 1 && op2->type->isSigned)
2289 *value2 = (unsigned short)op2->__anon1.c;
2290 else if(op2->kind == 24 || op2->kind == 1)
2291 *value2 = (unsigned short)op2->__anon1.uc;
2292 else if(op2->kind == 6)
2293 *value2 = (unsigned short)op2->__anon1.f;
2294 else if(op2->kind == 7)
2295 *value2 = (unsigned short)op2->__anon1.d;
2296 else if(op2->kind == 13)
2297 *value2 = (unsigned short)op2->__anon1.ui64;
2298 else
2299 return 0;
2300 return 1;
2301 }
2302
2303 unsigned int GetOpChar(struct Operand * op2, char * value2)
2304 {
2305 if(op2->kind == 3 && op2->type->isSigned)
2306 *value2 = (char)op2->__anon1.i;
2307 else if(op2->kind == 3)
2308 *value2 = (char)op2->__anon1.ui;
2309 else if(op2->kind == 4 && op2->type->isSigned)
2310 *value2 = (char)op2->__anon1.i64;
2311 else if(op2->kind == 4)
2312 *value2 = (char)op2->__anon1.ui64;
2313 else if(op2->kind == 23 && op2->type->isSigned)
2314 *value2 = (char)op2->__anon1.i64;
2315 else if(op2->kind == 23)
2316 *value2 = (char)op2->__anon1.ui64;
2317 else if(op2->kind == 22 && op2->type->isSigned)
2318 *value2 = (char)op2->__anon1.i64;
2319 else if(op2->kind == 22)
2320 *value2 = (char)op2->__anon1.ui64;
2321 else if(op2->kind == 2 && op2->type->isSigned)
2322 *value2 = (char)op2->__anon1.s;
2323 else if(op2->kind == 2)
2324 *value2 = (char)op2->__anon1.us;
2325 else if(op2->kind == 1 && op2->type->isSigned)
2326 *value2 = op2->__anon1.c;
2327 else if(op2->kind == 24 || op2->kind == 1)
2328 *value2 = (char)op2->__anon1.uc;
2329 else if(op2->kind == 6)
2330 *value2 = (char)op2->__anon1.f;
2331 else if(op2->kind == 7)
2332 *value2 = (char)op2->__anon1.d;
2333 else if(op2->kind == 13)
2334 *value2 = (char)op2->__anon1.ui64;
2335 else
2336 return 0;
2337 return 1;
2338 }
2339
2340 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2341 {
2342 if(op2->kind == 3 && op2->type->isSigned)
2343 *value2 = (unsigned char)op2->__anon1.i;
2344 else if(op2->kind == 3)
2345 *value2 = (unsigned char)op2->__anon1.ui;
2346 else if(op2->kind == 4 && op2->type->isSigned)
2347 *value2 = (unsigned char)op2->__anon1.i64;
2348 else if(op2->kind == 4)
2349 *value2 = (unsigned char)op2->__anon1.ui64;
2350 else if(op2->kind == 23 && op2->type->isSigned)
2351 *value2 = (unsigned char)op2->__anon1.i64;
2352 else if(op2->kind == 23)
2353 *value2 = (unsigned char)op2->__anon1.ui64;
2354 else if(op2->kind == 22 && op2->type->isSigned)
2355 *value2 = (unsigned char)op2->__anon1.i64;
2356 else if(op2->kind == 22)
2357 *value2 = (unsigned char)op2->__anon1.ui64;
2358 else if(op2->kind == 2 && op2->type->isSigned)
2359 *value2 = (unsigned char)op2->__anon1.s;
2360 else if(op2->kind == 2)
2361 *value2 = (unsigned char)op2->__anon1.us;
2362 else if(op2->kind == 1 && op2->type->isSigned)
2363 *value2 = (unsigned char)op2->__anon1.c;
2364 else if(op2->kind == 24 || op2->kind == 1)
2365 *value2 = op2->__anon1.uc;
2366 else if(op2->kind == 6)
2367 *value2 = (unsigned char)op2->__anon1.f;
2368 else if(op2->kind == 7)
2369 *value2 = (unsigned char)op2->__anon1.d;
2370 else if(op2->kind == 13)
2371 *value2 = (unsigned char)op2->__anon1.ui64;
2372 else
2373 return 0;
2374 return 1;
2375 }
2376
2377 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2378 {
2379 if(op2->kind == 3 && op2->type->isSigned)
2380 *value2 = (float)(float)op2->__anon1.i;
2381 else if(op2->kind == 3)
2382 *value2 = (float)(float)op2->__anon1.ui;
2383 else if(op2->kind == 4 && op2->type->isSigned)
2384 *value2 = (float)(float)op2->__anon1.i64;
2385 else if(op2->kind == 4)
2386 *value2 = (float)(float)op2->__anon1.ui64;
2387 else if(op2->kind == 23 && op2->type->isSigned)
2388 *value2 = (float)(float)op2->__anon1.i64;
2389 else if(op2->kind == 23)
2390 *value2 = (float)(float)op2->__anon1.ui64;
2391 else if(op2->kind == 22 && op2->type->isSigned)
2392 *value2 = (float)(float)op2->__anon1.i64;
2393 else if(op2->kind == 22)
2394 *value2 = (float)(float)op2->__anon1.ui64;
2395 else if(op2->kind == 2 && op2->type->isSigned)
2396 *value2 = (float)(float)op2->__anon1.s;
2397 else if(op2->kind == 2)
2398 *value2 = (float)(float)op2->__anon1.us;
2399 else if(op2->kind == 1 && op2->type->isSigned)
2400 *value2 = (float)(float)op2->__anon1.c;
2401 else if(op2->kind == 24 || op2->kind == 1)
2402 *value2 = (float)(float)op2->__anon1.uc;
2403 else if(op2->kind == 6)
2404 *value2 = (float)op2->__anon1.f;
2405 else if(op2->kind == 7)
2406 *value2 = (float)op2->__anon1.d;
2407 else if(op2->kind == 13)
2408 *value2 = (float)(float)op2->__anon1.ui64;
2409 else
2410 return 0;
2411 return 1;
2412 }
2413
2414 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2415 {
2416 if(op2->kind == 3 && op2->type->isSigned)
2417 *value2 = (double)(double)op2->__anon1.i;
2418 else if(op2->kind == 3)
2419 *value2 = (double)(double)op2->__anon1.ui;
2420 else if(op2->kind == 4 && op2->type->isSigned)
2421 *value2 = (double)(double)op2->__anon1.i64;
2422 else if(op2->kind == 4)
2423 *value2 = (double)(double)op2->__anon1.ui64;
2424 else if(op2->kind == 23 && op2->type->isSigned)
2425 *value2 = (double)(double)op2->__anon1.i64;
2426 else if(op2->kind == 23)
2427 *value2 = (double)(double)op2->__anon1.ui64;
2428 else if(op2->kind == 22 && op2->type->isSigned)
2429 *value2 = (double)(double)op2->__anon1.i64;
2430 else if(op2->kind == 22)
2431 *value2 = (double)(double)op2->__anon1.ui64;
2432 else if(op2->kind == 2 && op2->type->isSigned)
2433 *value2 = (double)(double)op2->__anon1.s;
2434 else if(op2->kind == 2)
2435 *value2 = (double)(double)op2->__anon1.us;
2436 else if(op2->kind == 1 && op2->type->isSigned)
2437 *value2 = (double)(double)op2->__anon1.c;
2438 else if(op2->kind == 24 || op2->kind == 1)
2439 *value2 = (double)(double)op2->__anon1.uc;
2440 else if(op2->kind == 6)
2441 *value2 = (double)op2->__anon1.f;
2442 else if(op2->kind == 7)
2443 *value2 = (double)op2->__anon1.d;
2444 else if(op2->kind == 13)
2445 *value2 = (double)(double)op2->__anon1.ui64;
2446 else
2447 return 0;
2448 return 1;
2449 }
2450
2451 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2452 {
2453 int value2 = op2->__anon1.i;
2454
2455 exp->type = 2;
2456 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
2457 if(!exp->expType)
2458 {
2459 exp->expType = op1->type;
2460 if(op1->type)
2461 op1->type->refCount++;
2462 }
2463 return 1;
2464 }
2465
2466 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2467 {
2468 unsigned int value2 = op2->__anon1.ui;
2469
2470 exp->type = 2;
2471 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + 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 Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2482 {
2483 long long value2 = op2->__anon1.i64;
2484
2485 exp->type = 2;
2486 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + 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 UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2497 {
2498 uint64 value2 = op2->__anon1.ui64;
2499
2500 exp->type = 2;
2501 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + 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 ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2512 {
2513 short value2 = op2->__anon1.s;
2514
2515 exp->type = 2;
2516 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + 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 UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2527 {
2528 unsigned short value2 = op2->__anon1.us;
2529
2530 exp->type = 2;
2531 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + 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 CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2542 {
2543 char value2 = op2->__anon1.c;
2544
2545 exp->type = 2;
2546 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + 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 UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2557 {
2558 unsigned char value2 = op2->__anon1.uc;
2559
2560 exp->type = 2;
2561 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + 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 FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2572 {
2573 float value2 = op2->__anon1.f;
2574
2575 exp->type = 2;
2576 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + 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 DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2587 {
2588 double value2 = op2->__anon1.d;
2589
2590 exp->type = 2;
2591 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + 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 IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2602 {
2603 int value2 = op2->__anon1.i;
2604
2605 exp->type = 2;
2606 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - 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 UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2617 {
2618 unsigned int value2 = op2->__anon1.ui;
2619
2620 exp->type = 2;
2621 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - 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 Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2632 {
2633 long long value2 = op2->__anon1.i64;
2634
2635 exp->type = 2;
2636 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - 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 UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2647 {
2648 uint64 value2 = op2->__anon1.ui64;
2649
2650 exp->type = 2;
2651 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - 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 ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2662 {
2663 short value2 = op2->__anon1.s;
2664
2665 exp->type = 2;
2666 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - 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 UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2677 {
2678 unsigned short value2 = op2->__anon1.us;
2679
2680 exp->type = 2;
2681 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - 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 CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2692 {
2693 char value2 = op2->__anon1.c;
2694
2695 exp->type = 2;
2696 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - 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 UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2707 {
2708 unsigned char value2 = op2->__anon1.uc;
2709
2710 exp->type = 2;
2711 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - 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 FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2722 {
2723 float value2 = op2->__anon1.f;
2724
2725 exp->type = 2;
2726 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - 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 DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2737 {
2738 double value2 = op2->__anon1.d;
2739
2740 exp->type = 2;
2741 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - 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 IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2752 {
2753 int value2 = op2->__anon1.i;
2754
2755 exp->type = 2;
2756 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * 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 UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2767 {
2768 unsigned int value2 = op2->__anon1.ui;
2769
2770 exp->type = 2;
2771 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * 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 Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2782 {
2783 long long value2 = op2->__anon1.i64;
2784
2785 exp->type = 2;
2786 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * 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 UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2797 {
2798 uint64 value2 = op2->__anon1.ui64;
2799
2800 exp->type = 2;
2801 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * 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 ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2812 {
2813 short value2 = op2->__anon1.s;
2814
2815 exp->type = 2;
2816 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * 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 UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2827 {
2828 unsigned short value2 = op2->__anon1.us;
2829
2830 exp->type = 2;
2831 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * 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 CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2842 {
2843 char value2 = op2->__anon1.c;
2844
2845 exp->type = 2;
2846 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * 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 UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2857 {
2858 unsigned char value2 = op2->__anon1.uc;
2859
2860 exp->type = 2;
2861 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * 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 FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2872 {
2873 float value2 = op2->__anon1.f;
2874
2875 exp->type = 2;
2876 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * 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 DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2887 {
2888 double value2 = op2->__anon1.d;
2889
2890 exp->type = 2;
2891 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * 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 IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2902 {
2903 int value2 = op2->__anon1.i;
2904
2905 exp->type = 2;
2906 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
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 UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2917 {
2918 unsigned int value2 = op2->__anon1.ui;
2919
2920 exp->type = 2;
2921 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / 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 Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2932 {
2933 long long value2 = op2->__anon1.i64;
2934
2935 exp->type = 2;
2936 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / 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 UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2947 {
2948 uint64 value2 = op2->__anon1.ui64;
2949
2950 exp->type = 2;
2951 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / 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 ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2962 {
2963 short value2 = op2->__anon1.s;
2964
2965 exp->type = 2;
2966 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)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 UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2977 {
2978 unsigned short value2 = op2->__anon1.us;
2979
2980 exp->type = 2;
2981 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned 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 CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2992 {
2993 char value2 = op2->__anon1.c;
2994
2995 exp->type = 2;
2996 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)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 UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3007 {
3008 unsigned char value2 = op2->__anon1.uc;
3009
3010 exp->type = 2;
3011 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned 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 FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3022 {
3023 float value2 = op2->__anon1.f;
3024
3025 exp->type = 2;
3026 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
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 DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3037 {
3038 double value2 = op2->__anon1.d;
3039
3040 exp->type = 2;
3041 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / 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 IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3052 {
3053 int value2 = op2->__anon1.i;
3054
3055 exp->type = 2;
3056 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
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 UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3067 {
3068 unsigned int value2 = op2->__anon1.ui;
3069
3070 exp->type = 2;
3071 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % 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 Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3082 {
3083 long long value2 = op2->__anon1.i64;
3084
3085 exp->type = 2;
3086 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % 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 UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3097 {
3098 uint64 value2 = op2->__anon1.ui64;
3099
3100 exp->type = 2;
3101 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % 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 ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3112 {
3113 short value2 = op2->__anon1.s;
3114
3115 exp->type = 2;
3116 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)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 UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3127 {
3128 unsigned short value2 = op2->__anon1.us;
3129
3130 exp->type = 2;
3131 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned 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 CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3142 {
3143 char value2 = op2->__anon1.c;
3144
3145 exp->type = 2;
3146 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)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 UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3157 {
3158 unsigned char value2 = op2->__anon1.uc;
3159
3160 exp->type = 2;
3161 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned 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 IntNeg(struct Expression * exp, struct Operand * op1)
3172 {
3173 exp->type = 2;
3174 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
3175 if(!exp->expType)
3176 {
3177 exp->expType = op1->type;
3178 if(op1->type)
3179 op1->type->refCount++;
3180 }
3181 return 1;
3182 }
3183
3184 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
3185 {
3186 exp->type = 2;
3187 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
3188 if(!exp->expType)
3189 {
3190 exp->expType = op1->type;
3191 if(op1->type)
3192 op1->type->refCount++;
3193 }
3194 return 1;
3195 }
3196
3197 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
3198 {
3199 exp->type = 2;
3200 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
3201 if(!exp->expType)
3202 {
3203 exp->expType = op1->type;
3204 if(op1->type)
3205 op1->type->refCount++;
3206 }
3207 return 1;
3208 }
3209
3210 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
3211 {
3212 exp->type = 2;
3213 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
3214 if(!exp->expType)
3215 {
3216 exp->expType = op1->type;
3217 if(op1->type)
3218 op1->type->refCount++;
3219 }
3220 return 1;
3221 }
3222
3223 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
3224 {
3225 exp->type = 2;
3226 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
3227 if(!exp->expType)
3228 {
3229 exp->expType = op1->type;
3230 if(op1->type)
3231 op1->type->refCount++;
3232 }
3233 return 1;
3234 }
3235
3236 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
3237 {
3238 exp->type = 2;
3239 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
3240 if(!exp->expType)
3241 {
3242 exp->expType = op1->type;
3243 if(op1->type)
3244 op1->type->refCount++;
3245 }
3246 return 1;
3247 }
3248
3249 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
3250 {
3251 exp->type = 2;
3252 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
3253 if(!exp->expType)
3254 {
3255 exp->expType = op1->type;
3256 if(op1->type)
3257 op1->type->refCount++;
3258 }
3259 return 1;
3260 }
3261
3262 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
3263 {
3264 exp->type = 2;
3265 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
3266 if(!exp->expType)
3267 {
3268 exp->expType = op1->type;
3269 if(op1->type)
3270 op1->type->refCount++;
3271 }
3272 return 1;
3273 }
3274
3275 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
3276 {
3277 exp->type = 2;
3278 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
3279 if(!exp->expType)
3280 {
3281 exp->expType = op1->type;
3282 if(op1->type)
3283 op1->type->refCount++;
3284 }
3285 return 1;
3286 }
3287
3288 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
3289 {
3290 exp->type = 2;
3291 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
3292 if(!exp->expType)
3293 {
3294 exp->expType = op1->type;
3295 if(op1->type)
3296 op1->type->refCount++;
3297 }
3298 return 1;
3299 }
3300
3301 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
3302 {
3303 exp->type = 2;
3304 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
3305 if(!exp->expType)
3306 {
3307 exp->expType = op1->type;
3308 if(op1->type)
3309 op1->type->refCount++;
3310 }
3311 return 1;
3312 }
3313
3314 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
3315 {
3316 exp->type = 2;
3317 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
3318 if(!exp->expType)
3319 {
3320 exp->expType = op1->type;
3321 if(op1->type)
3322 op1->type->refCount++;
3323 }
3324 return 1;
3325 }
3326
3327 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
3328 {
3329 exp->type = 2;
3330 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
3331 if(!exp->expType)
3332 {
3333 exp->expType = op1->type;
3334 if(op1->type)
3335 op1->type->refCount++;
3336 }
3337 return 1;
3338 }
3339
3340 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
3341 {
3342 exp->type = 2;
3343 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
3344 if(!exp->expType)
3345 {
3346 exp->expType = op1->type;
3347 if(op1->type)
3348 op1->type->refCount++;
3349 }
3350 return 1;
3351 }
3352
3353 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
3354 {
3355 exp->type = 2;
3356 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
3357 if(!exp->expType)
3358 {
3359 exp->expType = op1->type;
3360 if(op1->type)
3361 op1->type->refCount++;
3362 }
3363 return 1;
3364 }
3365
3366 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
3367 {
3368 exp->type = 2;
3369 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
3370 if(!exp->expType)
3371 {
3372 exp->expType = op1->type;
3373 if(op1->type)
3374 op1->type->refCount++;
3375 }
3376 return 1;
3377 }
3378
3379 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
3380 {
3381 exp->type = 2;
3382 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
3383 if(!exp->expType)
3384 {
3385 exp->expType = op1->type;
3386 if(op1->type)
3387 op1->type->refCount++;
3388 }
3389 return 1;
3390 }
3391
3392 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
3393 {
3394 exp->type = 2;
3395 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
3396 if(!exp->expType)
3397 {
3398 exp->expType = op1->type;
3399 if(op1->type)
3400 op1->type->refCount++;
3401 }
3402 return 1;
3403 }
3404
3405 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
3406 {
3407 exp->type = 2;
3408 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
3409 if(!exp->expType)
3410 {
3411 exp->expType = op1->type;
3412 if(op1->type)
3413 op1->type->refCount++;
3414 }
3415 return 1;
3416 }
3417
3418 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
3419 {
3420 exp->type = 2;
3421 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
3422 if(!exp->expType)
3423 {
3424 exp->expType = op1->type;
3425 if(op1->type)
3426 op1->type->refCount++;
3427 }
3428 return 1;
3429 }
3430
3431 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
3432 {
3433 exp->type = 2;
3434 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
3435 if(!exp->expType)
3436 {
3437 exp->expType = op1->type;
3438 if(op1->type)
3439 op1->type->refCount++;
3440 }
3441 return 1;
3442 }
3443
3444 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
3445 {
3446 exp->type = 2;
3447 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
3448 if(!exp->expType)
3449 {
3450 exp->expType = op1->type;
3451 if(op1->type)
3452 op1->type->refCount++;
3453 }
3454 return 1;
3455 }
3456
3457 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
3458 {
3459 exp->type = 2;
3460 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
3461 if(!exp->expType)
3462 {
3463 exp->expType = op1->type;
3464 if(op1->type)
3465 op1->type->refCount++;
3466 }
3467 return 1;
3468 }
3469
3470 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
3471 {
3472 exp->type = 2;
3473 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
3474 if(!exp->expType)
3475 {
3476 exp->expType = op1->type;
3477 if(op1->type)
3478 op1->type->refCount++;
3479 }
3480 return 1;
3481 }
3482
3483 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
3484 {
3485 exp->type = 2;
3486 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
3487 if(!exp->expType)
3488 {
3489 exp->expType = op1->type;
3490 if(op1->type)
3491 op1->type->refCount++;
3492 }
3493 return 1;
3494 }
3495
3496 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
3497 {
3498 exp->type = 2;
3499 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
3500 if(!exp->expType)
3501 {
3502 exp->expType = op1->type;
3503 if(op1->type)
3504 op1->type->refCount++;
3505 }
3506 return 1;
3507 }
3508
3509 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
3510 {
3511 exp->type = 2;
3512 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
3513 if(!exp->expType)
3514 {
3515 exp->expType = op1->type;
3516 if(op1->type)
3517 op1->type->refCount++;
3518 }
3519 return 1;
3520 }
3521
3522 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
3523 {
3524 exp->type = 2;
3525 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
3526 if(!exp->expType)
3527 {
3528 exp->expType = op1->type;
3529 if(op1->type)
3530 op1->type->refCount++;
3531 }
3532 return 1;
3533 }
3534
3535 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
3536 {
3537 exp->type = 2;
3538 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
3539 if(!exp->expType)
3540 {
3541 exp->expType = op1->type;
3542 if(op1->type)
3543 op1->type->refCount++;
3544 }
3545 return 1;
3546 }
3547
3548 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
3549 {
3550 exp->type = 2;
3551 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
3552 if(!exp->expType)
3553 {
3554 exp->expType = op1->type;
3555 if(op1->type)
3556 op1->type->refCount++;
3557 }
3558 return 1;
3559 }
3560
3561 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3562 {
3563 int value2 = op2->__anon1.i;
3564
3565 exp->type = 2;
3566 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
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 UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3577 {
3578 unsigned int value2 = op2->__anon1.ui;
3579
3580 exp->type = 2;
3581 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = 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 Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3592 {
3593 long long value2 = op2->__anon1.i64;
3594
3595 exp->type = 2;
3596 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = 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 UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3607 {
3608 uint64 value2 = op2->__anon1.ui64;
3609
3610 exp->type = 2;
3611 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = 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 ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3622 {
3623 short value2 = op2->__anon1.s;
3624
3625 exp->type = 2;
3626 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = 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 UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3637 {
3638 unsigned short value2 = op2->__anon1.us;
3639
3640 exp->type = 2;
3641 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = 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 CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3652 {
3653 char value2 = op2->__anon1.c;
3654
3655 exp->type = 2;
3656 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = 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 UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3667 {
3668 unsigned char value2 = op2->__anon1.uc;
3669
3670 exp->type = 2;
3671 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = 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 FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3682 {
3683 float value2 = op2->__anon1.f;
3684
3685 exp->type = 2;
3686 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = 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 DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3697 {
3698 double value2 = op2->__anon1.d;
3699
3700 exp->type = 2;
3701 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = 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 IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3712 {
3713 int value2 = op2->__anon1.i;
3714
3715 exp->type = 2;
3716 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += 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 UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3727 {
3728 unsigned int value2 = op2->__anon1.ui;
3729
3730 exp->type = 2;
3731 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += 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 Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3742 {
3743 long long value2 = op2->__anon1.i64;
3744
3745 exp->type = 2;
3746 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += 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 UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3757 {
3758 uint64 value2 = op2->__anon1.ui64;
3759
3760 exp->type = 2;
3761 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += 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 ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3772 {
3773 short value2 = op2->__anon1.s;
3774
3775 exp->type = 2;
3776 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += 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 UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3787 {
3788 unsigned short value2 = op2->__anon1.us;
3789
3790 exp->type = 2;
3791 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += 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 CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3802 {
3803 char value2 = op2->__anon1.c;
3804
3805 exp->type = 2;
3806 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += 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 UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3817 {
3818 unsigned char value2 = op2->__anon1.uc;
3819
3820 exp->type = 2;
3821 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += 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 FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3832 {
3833 float value2 = op2->__anon1.f;
3834
3835 exp->type = 2;
3836 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += 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 DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3847 {
3848 double value2 = op2->__anon1.d;
3849
3850 exp->type = 2;
3851 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += 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 IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3862 {
3863 int value2 = op2->__anon1.i;
3864
3865 exp->type = 2;
3866 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= 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 UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3877 {
3878 unsigned int value2 = op2->__anon1.ui;
3879
3880 exp->type = 2;
3881 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= 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 Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3892 {
3893 long long value2 = op2->__anon1.i64;
3894
3895 exp->type = 2;
3896 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= 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 UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3907 {
3908 uint64 value2 = op2->__anon1.ui64;
3909
3910 exp->type = 2;
3911 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= 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 ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3922 {
3923 short value2 = op2->__anon1.s;
3924
3925 exp->type = 2;
3926 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= 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 UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3937 {
3938 unsigned short value2 = op2->__anon1.us;
3939
3940 exp->type = 2;
3941 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= 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 CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3952 {
3953 char value2 = op2->__anon1.c;
3954
3955 exp->type = 2;
3956 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= 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 UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3967 {
3968 unsigned char value2 = op2->__anon1.uc;
3969
3970 exp->type = 2;
3971 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= 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 FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3982 {
3983 float value2 = op2->__anon1.f;
3984
3985 exp->type = 2;
3986 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= 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 DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3997 {
3998 double value2 = op2->__anon1.d;
3999
4000 exp->type = 2;
4001 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= 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 IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4012 {
4013 int value2 = op2->__anon1.i;
4014
4015 exp->type = 2;
4016 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= 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 UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4027 {
4028 unsigned int value2 = op2->__anon1.ui;
4029
4030 exp->type = 2;
4031 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= 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 Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4042 {
4043 long long value2 = op2->__anon1.i64;
4044
4045 exp->type = 2;
4046 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= 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 UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4057 {
4058 uint64 value2 = op2->__anon1.ui64;
4059
4060 exp->type = 2;
4061 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= 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 ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4072 {
4073 short value2 = op2->__anon1.s;
4074
4075 exp->type = 2;
4076 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= 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 UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4087 {
4088 unsigned short value2 = op2->__anon1.us;
4089
4090 exp->type = 2;
4091 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= 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 CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4102 {
4103 char value2 = op2->__anon1.c;
4104
4105 exp->type = 2;
4106 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= 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 UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4117 {
4118 unsigned char value2 = op2->__anon1.uc;
4119
4120 exp->type = 2;
4121 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= 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 FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4132 {
4133 float value2 = op2->__anon1.f;
4134
4135 exp->type = 2;
4136 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= 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 DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4147 {
4148 double value2 = op2->__anon1.d;
4149
4150 exp->type = 2;
4151 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= 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 IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4162 {
4163 int value2 = op2->__anon1.i;
4164
4165 exp->type = 2;
4166 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
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 UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4177 {
4178 unsigned int value2 = op2->__anon1.ui;
4179
4180 exp->type = 2;
4181 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= 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 Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4192 {
4193 long long value2 = op2->__anon1.i64;
4194
4195 exp->type = 2;
4196 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= 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 UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4207 {
4208 uint64 value2 = op2->__anon1.ui64;
4209
4210 exp->type = 2;
4211 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= 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 ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4222 {
4223 short value2 = op2->__anon1.s;
4224
4225 exp->type = 2;
4226 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)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 UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4237 {
4238 unsigned short value2 = op2->__anon1.us;
4239
4240 exp->type = 2;
4241 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned 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 CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4252 {
4253 char value2 = op2->__anon1.c;
4254
4255 exp->type = 2;
4256 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)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 UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4267 {
4268 unsigned char value2 = op2->__anon1.uc;
4269
4270 exp->type = 2;
4271 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned 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 FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4282 {
4283 float value2 = op2->__anon1.f;
4284
4285 exp->type = 2;
4286 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
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 DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4297 {
4298 double value2 = op2->__anon1.d;
4299
4300 exp->type = 2;
4301 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= 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 IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4312 {
4313 int value2 = op2->__anon1.i;
4314
4315 exp->type = 2;
4316 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
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 UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4327 {
4328 unsigned int value2 = op2->__anon1.ui;
4329
4330 exp->type = 2;
4331 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= 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 Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4342 {
4343 long long value2 = op2->__anon1.i64;
4344
4345 exp->type = 2;
4346 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= 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 UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4357 {
4358 uint64 value2 = op2->__anon1.ui64;
4359
4360 exp->type = 2;
4361 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= 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 ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4372 {
4373 short value2 = op2->__anon1.s;
4374
4375 exp->type = 2;
4376 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)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 UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4387 {
4388 unsigned short value2 = op2->__anon1.us;
4389
4390 exp->type = 2;
4391 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned 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 CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4402 {
4403 char value2 = op2->__anon1.c;
4404
4405 exp->type = 2;
4406 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)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 UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4417 {
4418 unsigned char value2 = op2->__anon1.uc;
4419
4420 exp->type = 2;
4421 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned 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 IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4432 {
4433 int value2 = op2->__anon1.i;
4434
4435 exp->type = 2;
4436 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
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 UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4447 {
4448 unsigned int value2 = op2->__anon1.ui;
4449
4450 exp->type = 2;
4451 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & 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 Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4462 {
4463 long long value2 = op2->__anon1.i64;
4464
4465 exp->type = 2;
4466 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & 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 UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4477 {
4478 uint64 value2 = op2->__anon1.ui64;
4479
4480 exp->type = 2;
4481 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & 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 ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4492 {
4493 short value2 = op2->__anon1.s;
4494
4495 exp->type = 2;
4496 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & 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 UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4507 {
4508 unsigned short value2 = op2->__anon1.us;
4509
4510 exp->type = 2;
4511 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & 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 CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4522 {
4523 char value2 = op2->__anon1.c;
4524
4525 exp->type = 2;
4526 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & 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 UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4537 {
4538 unsigned char value2 = op2->__anon1.uc;
4539
4540 exp->type = 2;
4541 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & 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 IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4552 {
4553 int value2 = op2->__anon1.i;
4554
4555 exp->type = 2;
4556 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | 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 UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4567 {
4568 unsigned int value2 = op2->__anon1.ui;
4569
4570 exp->type = 2;
4571 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | 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 Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4582 {
4583 long long value2 = op2->__anon1.i64;
4584
4585 exp->type = 2;
4586 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | 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 UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4597 {
4598 uint64 value2 = op2->__anon1.ui64;
4599
4600 exp->type = 2;
4601 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | 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 ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4612 {
4613 short value2 = op2->__anon1.s;
4614
4615 exp->type = 2;
4616 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | 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 UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4627 {
4628 unsigned short value2 = op2->__anon1.us;
4629
4630 exp->type = 2;
4631 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | 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 CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4642 {
4643 char value2 = op2->__anon1.c;
4644
4645 exp->type = 2;
4646 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | 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 UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4657 {
4658 unsigned char value2 = op2->__anon1.uc;
4659
4660 exp->type = 2;
4661 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | 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 IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4672 {
4673 int value2 = op2->__anon1.i;
4674
4675 exp->type = 2;
4676 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ 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 UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4687 {
4688 unsigned int value2 = op2->__anon1.ui;
4689
4690 exp->type = 2;
4691 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ 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 Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4702 {
4703 long long value2 = op2->__anon1.i64;
4704
4705 exp->type = 2;
4706 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ 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 UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4717 {
4718 uint64 value2 = op2->__anon1.ui64;
4719
4720 exp->type = 2;
4721 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ 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 ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4732 {
4733 short value2 = op2->__anon1.s;
4734
4735 exp->type = 2;
4736 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ 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 UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4747 {
4748 unsigned short value2 = op2->__anon1.us;
4749
4750 exp->type = 2;
4751 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ 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 CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4762 {
4763 char value2 = op2->__anon1.c;
4764
4765 exp->type = 2;
4766 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ 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 UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4777 {
4778 unsigned char value2 = op2->__anon1.uc;
4779
4780 exp->type = 2;
4781 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ 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 IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4792 {
4793 int value2 = op2->__anon1.i;
4794
4795 exp->type = 2;
4796 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << 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 UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4807 {
4808 unsigned int value2 = op2->__anon1.ui;
4809
4810 exp->type = 2;
4811 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << 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 Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4822 {
4823 long long value2 = op2->__anon1.i64;
4824
4825 exp->type = 2;
4826 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << 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 UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4837 {
4838 uint64 value2 = op2->__anon1.ui64;
4839
4840 exp->type = 2;
4841 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << 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 ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4852 {
4853 short value2 = op2->__anon1.s;
4854
4855 exp->type = 2;
4856 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << 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 UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4867 {
4868 unsigned short value2 = op2->__anon1.us;
4869
4870 exp->type = 2;
4871 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << 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 CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4882 {
4883 char value2 = op2->__anon1.c;
4884
4885 exp->type = 2;
4886 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << 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 UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4897 {
4898 unsigned char value2 = op2->__anon1.uc;
4899
4900 exp->type = 2;
4901 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << 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 IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4912 {
4913 int value2 = op2->__anon1.i;
4914
4915 exp->type = 2;
4916 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> 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 UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4927 {
4928 unsigned int value2 = op2->__anon1.ui;
4929
4930 exp->type = 2;
4931 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> 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 Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4942 {
4943 long long value2 = op2->__anon1.i64;
4944
4945 exp->type = 2;
4946 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> 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 UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4957 {
4958 uint64 value2 = op2->__anon1.ui64;
4959
4960 exp->type = 2;
4961 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> 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 ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4972 {
4973 short value2 = op2->__anon1.s;
4974
4975 exp->type = 2;
4976 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> 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 UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4987 {
4988 unsigned short value2 = op2->__anon1.us;
4989
4990 exp->type = 2;
4991 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> 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 CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5002 {
5003 char value2 = op2->__anon1.c;
5004
5005 exp->type = 2;
5006 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> 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 UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5017 {
5018 unsigned char value2 = op2->__anon1.uc;
5019
5020 exp->type = 2;
5021 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> 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 IntBitNot(struct Expression * exp, struct Operand * op1)
5032 {
5033 exp->type = 2;
5034 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
5035 if(!exp->expType)
5036 {
5037 exp->expType = op1->type;
5038 if(op1->type)
5039 op1->type->refCount++;
5040 }
5041 return 1;
5042 }
5043
5044 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
5045 {
5046 exp->type = 2;
5047 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
5048 if(!exp->expType)
5049 {
5050 exp->expType = op1->type;
5051 if(op1->type)
5052 op1->type->refCount++;
5053 }
5054 return 1;
5055 }
5056
5057 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
5058 {
5059 exp->type = 2;
5060 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
5061 if(!exp->expType)
5062 {
5063 exp->expType = op1->type;
5064 if(op1->type)
5065 op1->type->refCount++;
5066 }
5067 return 1;
5068 }
5069
5070 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
5071 {
5072 exp->type = 2;
5073 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
5074 if(!exp->expType)
5075 {
5076 exp->expType = op1->type;
5077 if(op1->type)
5078 op1->type->refCount++;
5079 }
5080 return 1;
5081 }
5082
5083 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
5084 {
5085 exp->type = 2;
5086 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
5087 if(!exp->expType)
5088 {
5089 exp->expType = op1->type;
5090 if(op1->type)
5091 op1->type->refCount++;
5092 }
5093 return 1;
5094 }
5095
5096 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
5097 {
5098 exp->type = 2;
5099 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
5100 if(!exp->expType)
5101 {
5102 exp->expType = op1->type;
5103 if(op1->type)
5104 op1->type->refCount++;
5105 }
5106 return 1;
5107 }
5108
5109 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
5110 {
5111 exp->type = 2;
5112 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
5113 if(!exp->expType)
5114 {
5115 exp->expType = op1->type;
5116 if(op1->type)
5117 op1->type->refCount++;
5118 }
5119 return 1;
5120 }
5121
5122 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
5123 {
5124 exp->type = 2;
5125 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
5126 if(!exp->expType)
5127 {
5128 exp->expType = op1->type;
5129 if(op1->type)
5130 op1->type->refCount++;
5131 }
5132 return 1;
5133 }
5134
5135 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5136 {
5137 int value2 = op2->__anon1.i;
5138
5139 exp->type = 2;
5140 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
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 UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5151 {
5152 unsigned int value2 = op2->__anon1.ui;
5153
5154 exp->type = 2;
5155 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= 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 Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5166 {
5167 long long value2 = op2->__anon1.i64;
5168
5169 exp->type = 2;
5170 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= 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 UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5181 {
5182 uint64 value2 = op2->__anon1.ui64;
5183
5184 exp->type = 2;
5185 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= 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 ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5196 {
5197 short value2 = op2->__anon1.s;
5198
5199 exp->type = 2;
5200 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= 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 UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5211 {
5212 unsigned short value2 = op2->__anon1.us;
5213
5214 exp->type = 2;
5215 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= 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 CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5226 {
5227 char value2 = op2->__anon1.c;
5228
5229 exp->type = 2;
5230 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= 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 UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5241 {
5242 unsigned char value2 = op2->__anon1.uc;
5243
5244 exp->type = 2;
5245 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= 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 IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5256 {
5257 int value2 = op2->__anon1.i;
5258
5259 exp->type = 2;
5260 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= 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 UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5271 {
5272 unsigned int value2 = op2->__anon1.ui;
5273
5274 exp->type = 2;
5275 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= 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 Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5286 {
5287 long long value2 = op2->__anon1.i64;
5288
5289 exp->type = 2;
5290 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= 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 UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5301 {
5302 uint64 value2 = op2->__anon1.ui64;
5303
5304 exp->type = 2;
5305 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= 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 ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5316 {
5317 short value2 = op2->__anon1.s;
5318
5319 exp->type = 2;
5320 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= 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 UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5331 {
5332 unsigned short value2 = op2->__anon1.us;
5333
5334 exp->type = 2;
5335 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= 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 CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5346 {
5347 char value2 = op2->__anon1.c;
5348
5349 exp->type = 2;
5350 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= 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 UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5361 {
5362 unsigned char value2 = op2->__anon1.uc;
5363
5364 exp->type = 2;
5365 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= 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 IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5376 {
5377 int value2 = op2->__anon1.i;
5378
5379 exp->type = 2;
5380 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= 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 UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5391 {
5392 unsigned int value2 = op2->__anon1.ui;
5393
5394 exp->type = 2;
5395 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= 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 Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5406 {
5407 long long value2 = op2->__anon1.i64;
5408
5409 exp->type = 2;
5410 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= 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 UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5421 {
5422 uint64 value2 = op2->__anon1.ui64;
5423
5424 exp->type = 2;
5425 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= 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 ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5436 {
5437 short value2 = op2->__anon1.s;
5438
5439 exp->type = 2;
5440 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= 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 UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5451 {
5452 unsigned short value2 = op2->__anon1.us;
5453
5454 exp->type = 2;
5455 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= 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 CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5466 {
5467 char value2 = op2->__anon1.c;
5468
5469 exp->type = 2;
5470 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= 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 UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5481 {
5482 unsigned char value2 = op2->__anon1.uc;
5483
5484 exp->type = 2;
5485 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= 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 IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5496 {
5497 int value2 = op2->__anon1.i;
5498
5499 exp->type = 2;
5500 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= 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 UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5511 {
5512 unsigned int value2 = op2->__anon1.ui;
5513
5514 exp->type = 2;
5515 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= 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 Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5526 {
5527 long long value2 = op2->__anon1.i64;
5528
5529 exp->type = 2;
5530 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= 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 UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5541 {
5542 uint64 value2 = op2->__anon1.ui64;
5543
5544 exp->type = 2;
5545 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= 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 ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5556 {
5557 short value2 = op2->__anon1.s;
5558
5559 exp->type = 2;
5560 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= 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 UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5571 {
5572 unsigned short value2 = op2->__anon1.us;
5573
5574 exp->type = 2;
5575 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= 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 CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5586 {
5587 char value2 = op2->__anon1.c;
5588
5589 exp->type = 2;
5590 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= 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 UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5601 {
5602 unsigned char value2 = op2->__anon1.uc;
5603
5604 exp->type = 2;
5605 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= 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 IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5616 {
5617 int value2 = op2->__anon1.i;
5618
5619 exp->type = 2;
5620 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= 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 UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5631 {
5632 unsigned int value2 = op2->__anon1.ui;
5633
5634 exp->type = 2;
5635 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= 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 Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5646 {
5647 long long value2 = op2->__anon1.i64;
5648
5649 exp->type = 2;
5650 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= 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 UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5661 {
5662 uint64 value2 = op2->__anon1.ui64;
5663
5664 exp->type = 2;
5665 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= 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 ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5676 {
5677 short value2 = op2->__anon1.s;
5678
5679 exp->type = 2;
5680 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= 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 UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5691 {
5692 unsigned short value2 = op2->__anon1.us;
5693
5694 exp->type = 2;
5695 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= 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 CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5706 {
5707 char value2 = op2->__anon1.c;
5708
5709 exp->type = 2;
5710 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= 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 UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5721 {
5722 unsigned char value2 = op2->__anon1.uc;
5723
5724 exp->type = 2;
5725 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= 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 IntNot(struct Expression * exp, struct Operand * op1)
5736 {
5737 exp->type = 2;
5738 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
5739 if(!exp->expType)
5740 {
5741 exp->expType = op1->type;
5742 if(op1->type)
5743 op1->type->refCount++;
5744 }
5745 return 1;
5746 }
5747
5748 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
5749 {
5750 exp->type = 2;
5751 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
5752 if(!exp->expType)
5753 {
5754 exp->expType = op1->type;
5755 if(op1->type)
5756 op1->type->refCount++;
5757 }
5758 return 1;
5759 }
5760
5761 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
5762 {
5763 exp->type = 2;
5764 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
5765 if(!exp->expType)
5766 {
5767 exp->expType = op1->type;
5768 if(op1->type)
5769 op1->type->refCount++;
5770 }
5771 return 1;
5772 }
5773
5774 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
5775 {
5776 exp->type = 2;
5777 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
5778 if(!exp->expType)
5779 {
5780 exp->expType = op1->type;
5781 if(op1->type)
5782 op1->type->refCount++;
5783 }
5784 return 1;
5785 }
5786
5787 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
5788 {
5789 exp->type = 2;
5790 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
5791 if(!exp->expType)
5792 {
5793 exp->expType = op1->type;
5794 if(op1->type)
5795 op1->type->refCount++;
5796 }
5797 return 1;
5798 }
5799
5800 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
5801 {
5802 exp->type = 2;
5803 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
5804 if(!exp->expType)
5805 {
5806 exp->expType = op1->type;
5807 if(op1->type)
5808 op1->type->refCount++;
5809 }
5810 return 1;
5811 }
5812
5813 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
5814 {
5815 exp->type = 2;
5816 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
5817 if(!exp->expType)
5818 {
5819 exp->expType = op1->type;
5820 if(op1->type)
5821 op1->type->refCount++;
5822 }
5823 return 1;
5824 }
5825
5826 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
5827 {
5828 exp->type = 2;
5829 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
5830 if(!exp->expType)
5831 {
5832 exp->expType = op1->type;
5833 if(op1->type)
5834 op1->type->refCount++;
5835 }
5836 return 1;
5837 }
5838
5839 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5840 {
5841 int value2 = op2->__anon1.i;
5842
5843 exp->type = 2;
5844 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
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 UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5855 {
5856 unsigned int value2 = op2->__anon1.ui;
5857
5858 exp->type = 2;
5859 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == 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 Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5870 {
5871 long long value2 = op2->__anon1.i64;
5872
5873 exp->type = 2;
5874 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == 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 UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5885 {
5886 uint64 value2 = op2->__anon1.ui64;
5887
5888 exp->type = 2;
5889 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == 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 ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5900 {
5901 short value2 = op2->__anon1.s;
5902
5903 exp->type = 2;
5904 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == 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 UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5915 {
5916 unsigned short value2 = op2->__anon1.us;
5917
5918 exp->type = 2;
5919 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == 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 CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5930 {
5931 char value2 = op2->__anon1.c;
5932
5933 exp->type = 2;
5934 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == 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 UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5945 {
5946 unsigned char value2 = op2->__anon1.uc;
5947
5948 exp->type = 2;
5949 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == 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 FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5960 {
5961 float value2 = op2->__anon1.f;
5962
5963 exp->type = 2;
5964 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == 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 DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5975 {
5976 double value2 = op2->__anon1.d;
5977
5978 exp->type = 2;
5979 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == 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 IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5990 {
5991 int value2 = op2->__anon1.i;
5992
5993 exp->type = 2;
5994 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != 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 UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6005 {
6006 unsigned int value2 = op2->__anon1.ui;
6007
6008 exp->type = 2;
6009 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != 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 Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6020 {
6021 long long value2 = op2->__anon1.i64;
6022
6023 exp->type = 2;
6024 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != 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 UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6035 {
6036 uint64 value2 = op2->__anon1.ui64;
6037
6038 exp->type = 2;
6039 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != 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 ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6050 {
6051 short value2 = op2->__anon1.s;
6052
6053 exp->type = 2;
6054 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != 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 UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6065 {
6066 unsigned short value2 = op2->__anon1.us;
6067
6068 exp->type = 2;
6069 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != 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 CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6080 {
6081 char value2 = op2->__anon1.c;
6082
6083 exp->type = 2;
6084 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != 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 UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6095 {
6096 unsigned char value2 = op2->__anon1.uc;
6097
6098 exp->type = 2;
6099 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != 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 FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6110 {
6111 float value2 = op2->__anon1.f;
6112
6113 exp->type = 2;
6114 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != 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 DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6125 {
6126 double value2 = op2->__anon1.d;
6127
6128 exp->type = 2;
6129 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != 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 IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6140 {
6141 int value2 = op2->__anon1.i;
6142
6143 exp->type = 2;
6144 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && 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 UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6155 {
6156 unsigned int value2 = op2->__anon1.ui;
6157
6158 exp->type = 2;
6159 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && 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 Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6170 {
6171 long long value2 = op2->__anon1.i64;
6172
6173 exp->type = 2;
6174 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && 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 UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6185 {
6186 uint64 value2 = op2->__anon1.ui64;
6187
6188 exp->type = 2;
6189 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && 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 ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6200 {
6201 short value2 = op2->__anon1.s;
6202
6203 exp->type = 2;
6204 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && 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 UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6215 {
6216 unsigned short value2 = op2->__anon1.us;
6217
6218 exp->type = 2;
6219 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && 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 CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6230 {
6231 char value2 = op2->__anon1.c;
6232
6233 exp->type = 2;
6234 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && 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 UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6245 {
6246 unsigned char value2 = op2->__anon1.uc;
6247
6248 exp->type = 2;
6249 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && 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 FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6260 {
6261 float value2 = op2->__anon1.f;
6262
6263 exp->type = 2;
6264 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && 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 DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6275 {
6276 double value2 = op2->__anon1.d;
6277
6278 exp->type = 2;
6279 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && 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 IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6290 {
6291 int value2 = op2->__anon1.i;
6292
6293 exp->type = 2;
6294 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || 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 UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6305 {
6306 unsigned int value2 = op2->__anon1.ui;
6307
6308 exp->type = 2;
6309 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || 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 Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6320 {
6321 long long value2 = op2->__anon1.i64;
6322
6323 exp->type = 2;
6324 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || 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 UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6335 {
6336 uint64 value2 = op2->__anon1.ui64;
6337
6338 exp->type = 2;
6339 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || 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 ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6350 {
6351 short value2 = op2->__anon1.s;
6352
6353 exp->type = 2;
6354 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || 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 UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6365 {
6366 unsigned short value2 = op2->__anon1.us;
6367
6368 exp->type = 2;
6369 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || 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 CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6380 {
6381 char value2 = op2->__anon1.c;
6382
6383 exp->type = 2;
6384 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || 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 UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6395 {
6396 unsigned char value2 = op2->__anon1.uc;
6397
6398 exp->type = 2;
6399 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || 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 FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6410 {
6411 float value2 = op2->__anon1.f;
6412
6413 exp->type = 2;
6414 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || 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 DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6425 {
6426 double value2 = op2->__anon1.d;
6427
6428 exp->type = 2;
6429 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || 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 IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6440 {
6441 int value2 = op2->__anon1.i;
6442
6443 exp->type = 2;
6444 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > 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 UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6455 {
6456 unsigned int value2 = op2->__anon1.ui;
6457
6458 exp->type = 2;
6459 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > 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 Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6470 {
6471 long long value2 = op2->__anon1.i64;
6472
6473 exp->type = 2;
6474 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > 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 UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6485 {
6486 uint64 value2 = op2->__anon1.ui64;
6487
6488 exp->type = 2;
6489 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > 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 ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6500 {
6501 short value2 = op2->__anon1.s;
6502
6503 exp->type = 2;
6504 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > 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 UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6515 {
6516 unsigned short value2 = op2->__anon1.us;
6517
6518 exp->type = 2;
6519 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > 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 CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6530 {
6531 char value2 = op2->__anon1.c;
6532
6533 exp->type = 2;
6534 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > 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 UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6545 {
6546 unsigned char value2 = op2->__anon1.uc;
6547
6548 exp->type = 2;
6549 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > 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 FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6560 {
6561 float value2 = op2->__anon1.f;
6562
6563 exp->type = 2;
6564 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > 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 DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6575 {
6576 double value2 = op2->__anon1.d;
6577
6578 exp->type = 2;
6579 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > 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 IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6590 {
6591 int value2 = op2->__anon1.i;
6592
6593 exp->type = 2;
6594 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < 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 UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6605 {
6606 unsigned int value2 = op2->__anon1.ui;
6607
6608 exp->type = 2;
6609 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < 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 Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6620 {
6621 long long value2 = op2->__anon1.i64;
6622
6623 exp->type = 2;
6624 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < 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 UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6635 {
6636 uint64 value2 = op2->__anon1.ui64;
6637
6638 exp->type = 2;
6639 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < 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 ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6650 {
6651 short value2 = op2->__anon1.s;
6652
6653 exp->type = 2;
6654 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < 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 UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6665 {
6666 unsigned short value2 = op2->__anon1.us;
6667
6668 exp->type = 2;
6669 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < 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 CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6680 {
6681 char value2 = op2->__anon1.c;
6682
6683 exp->type = 2;
6684 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < 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 UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6695 {
6696 unsigned char value2 = op2->__anon1.uc;
6697
6698 exp->type = 2;
6699 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < 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 FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6710 {
6711 float value2 = op2->__anon1.f;
6712
6713 exp->type = 2;
6714 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < 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 DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6725 {
6726 double value2 = op2->__anon1.d;
6727
6728 exp->type = 2;
6729 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < 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 IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6740 {
6741 int value2 = op2->__anon1.i;
6742
6743 exp->type = 2;
6744 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= 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 UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6755 {
6756 unsigned int value2 = op2->__anon1.ui;
6757
6758 exp->type = 2;
6759 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= 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 Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6770 {
6771 long long value2 = op2->__anon1.i64;
6772
6773 exp->type = 2;
6774 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= 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 UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6785 {
6786 uint64 value2 = op2->__anon1.ui64;
6787
6788 exp->type = 2;
6789 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= 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 ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6800 {
6801 short value2 = op2->__anon1.s;
6802
6803 exp->type = 2;
6804 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= 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 UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6815 {
6816 unsigned short value2 = op2->__anon1.us;
6817
6818 exp->type = 2;
6819 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= 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 CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6830 {
6831 char value2 = op2->__anon1.c;
6832
6833 exp->type = 2;
6834 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= 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 UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6845 {
6846 unsigned char value2 = op2->__anon1.uc;
6847
6848 exp->type = 2;
6849 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= 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 FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6860 {
6861 float value2 = op2->__anon1.f;
6862
6863 exp->type = 2;
6864 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= 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 DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6875 {
6876 double value2 = op2->__anon1.d;
6877
6878 exp->type = 2;
6879 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= 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 IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6890 {
6891 int value2 = op2->__anon1.i;
6892
6893 exp->type = 2;
6894 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= 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 UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6905 {
6906 unsigned int value2 = op2->__anon1.ui;
6907
6908 exp->type = 2;
6909 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= 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 Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6920 {
6921 long long value2 = op2->__anon1.i64;
6922
6923 exp->type = 2;
6924 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= 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 UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6935 {
6936 uint64 value2 = op2->__anon1.ui64;
6937
6938 exp->type = 2;
6939 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= 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 ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6950 {
6951 short value2 = op2->__anon1.s;
6952
6953 exp->type = 2;
6954 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= 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 UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6965 {
6966 unsigned short value2 = op2->__anon1.us;
6967
6968 exp->type = 2;
6969 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= 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 CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6980 {
6981 char value2 = op2->__anon1.c;
6982
6983 exp->type = 2;
6984 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= 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 UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6995 {
6996 unsigned char value2 = op2->__anon1.uc;
6997
6998 exp->type = 2;
6999 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= 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 FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7010 {
7011 float value2 = op2->__anon1.f;
7012
7013 exp->type = 2;
7014 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= 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 DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7025 {
7026 double value2 = op2->__anon1.d;
7027
7028 exp->type = 2;
7029 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= 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 IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7040 {
7041 exp->type = 2;
7042 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
7043 if(!exp->expType)
7044 {
7045 exp->expType = op1->type;
7046 if(op1->type)
7047 op1->type->refCount++;
7048 }
7049 return 1;
7050 }
7051
7052 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7053 {
7054 exp->type = 2;
7055 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
7056 if(!exp->expType)
7057 {
7058 exp->expType = op1->type;
7059 if(op1->type)
7060 op1->type->refCount++;
7061 }
7062 return 1;
7063 }
7064
7065 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7066 {
7067 exp->type = 2;
7068 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
7069 if(!exp->expType)
7070 {
7071 exp->expType = op1->type;
7072 if(op1->type)
7073 op1->type->refCount++;
7074 }
7075 return 1;
7076 }
7077
7078 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7079 {
7080 exp->type = 2;
7081 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
7082 if(!exp->expType)
7083 {
7084 exp->expType = op1->type;
7085 if(op1->type)
7086 op1->type->refCount++;
7087 }
7088 return 1;
7089 }
7090
7091 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7092 {
7093 exp->type = 2;
7094 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
7095 if(!exp->expType)
7096 {
7097 exp->expType = op1->type;
7098 if(op1->type)
7099 op1->type->refCount++;
7100 }
7101 return 1;
7102 }
7103
7104 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7105 {
7106 exp->type = 2;
7107 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
7108 if(!exp->expType)
7109 {
7110 exp->expType = op1->type;
7111 if(op1->type)
7112 op1->type->refCount++;
7113 }
7114 return 1;
7115 }
7116
7117 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7118 {
7119 exp->type = 2;
7120 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
7121 if(!exp->expType)
7122 {
7123 exp->expType = op1->type;
7124 if(op1->type)
7125 op1->type->refCount++;
7126 }
7127 return 1;
7128 }
7129
7130 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7131 {
7132 exp->type = 2;
7133 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
7134 if(!exp->expType)
7135 {
7136 exp->expType = op1->type;
7137 if(op1->type)
7138 op1->type->refCount++;
7139 }
7140 return 1;
7141 }
7142
7143 static void PrintName(struct Type * type, char * string, unsigned int fullName)
7144 {
7145 if(type->name && type->name[0])
7146 {
7147 if(fullName)
7148 strcat(string, type->name);
7149 else
7150 {
7151 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
7152
7153 if(name)
7154 name += 2;
7155 else
7156 name = type->name;
7157 strcat(string, name);
7158 }
7159 }
7160 }
7161
7162 static void PrintAttribs(struct Type * type, char * string)
7163 {
7164 if(type)
7165 {
7166 if(type->dllExport)
7167 strcat(string, "dllexport ");
7168 if(type->attrStdcall)
7169 strcat(string, "stdcall ");
7170 }
7171 }
7172
7173 static struct Type * FindMember(struct Type * type, char * string)
7174 {
7175 struct Type * memberType;
7176
7177 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7178 {
7179 if(!memberType->name)
7180 {
7181 struct Type * subType = FindMember(memberType, string);
7182
7183 if(subType)
7184 return subType;
7185 }
7186 else if(!strcmp(memberType->name, string))
7187 return memberType;
7188 }
7189 return (((void *)0));
7190 }
7191
7192 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
7193
7194 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
7195
7196 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
7197 {
7198 unsigned int result = 0;
7199
7200 switch(kind)
7201 {
7202 case 2:
7203 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
7204 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
7205 break;
7206 case 3:
7207 case 5:
7208 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
7209 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7210 break;
7211 case 4:
7212 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)
7213 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7214 break;
7215 case 6:
7216 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)
7217 result = GetOpFloat(op, &op->__anon1.f);
7218 break;
7219 case 7:
7220 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)
7221 result = GetOpDouble(op, &op->__anon1.d);
7222 break;
7223 case 13:
7224 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)
7225 result = GetOpUInt64(op, &op->__anon1.ui64);
7226 break;
7227 case 15:
7228 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)
7229 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7230 break;
7231 case 22:
7232 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7233 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7234 break;
7235 case 23:
7236 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7237 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7238 break;
7239 }
7240 return result;
7241 }
7242
7243 struct OpTable floatOps =
7244 {
7245 (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)
7246 };
7247
7248 struct OpTable doubleOps =
7249 {
7250 (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)
7251 };
7252
7253 struct OpTable intOps =
7254 {
7255 (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)
7256 };
7257
7258 struct OpTable uintOps =
7259 {
7260 (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)
7261 };
7262
7263 struct OpTable int64Ops =
7264 {
7265 (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)
7266 };
7267
7268 struct OpTable uint64Ops =
7269 {
7270 (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)
7271 };
7272
7273 struct OpTable shortOps =
7274 {
7275 (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)
7276 };
7277
7278 struct OpTable ushortOps =
7279 {
7280 (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)
7281 };
7282
7283 struct OpTable charOps =
7284 {
7285 (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)
7286 };
7287
7288 struct OpTable ucharOps =
7289 {
7290 (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)
7291 };
7292
7293 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
7294 {
7295 struct Type * memberType;
7296
7297 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7298 {
7299 if(!memberType->name)
7300 {
7301 struct Type * subType = FindMember(memberType, string);
7302
7303 if(subType)
7304 {
7305 *offset += memberType->offset;
7306 return subType;
7307 }
7308 }
7309 else if(!strcmp(memberType->name, string))
7310 {
7311 *offset += memberType->offset;
7312 return memberType;
7313 }
7314 }
7315 return (((void *)0));
7316 }
7317
7318 struct __ecereNameSpace__ecere__com__Module;
7319
7320 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);
7321
7322 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
7323
7324 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);
7325
7326 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);
7327
7328 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
7329
7330 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7331
7332 struct GlobalData
7333 {
7334 uintptr_t key;
7335 struct __ecereNameSpace__ecere__sys__BTNode * parent;
7336 struct __ecereNameSpace__ecere__sys__BTNode * left;
7337 struct __ecereNameSpace__ecere__sys__BTNode * right;
7338 int depth;
7339 struct __ecereNameSpace__ecere__com__Instance * module;
7340 char *  dataTypeString;
7341 struct Type * dataType;
7342 void *  symbol;
7343 char *  fullName;
7344 } __attribute__ ((gcc_struct));
7345
7346 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);
7347
7348 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
7349
7350 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);
7351
7352 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
7353
7354 struct __ecereNameSpace__ecere__com__DefinedExpression;
7355
7356 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7357
7358 struct __ecereNameSpace__ecere__com__DefinedExpression
7359 {
7360 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
7361 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
7362 const char *  name;
7363 const char *  value;
7364 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7365 } __attribute__ ((gcc_struct));
7366
7367 struct __ecereNameSpace__ecere__sys__BinaryTree;
7368
7369 struct __ecereNameSpace__ecere__sys__BinaryTree
7370 {
7371 struct __ecereNameSpace__ecere__sys__BTNode * root;
7372 int count;
7373 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
7374 void (*  FreeKey)(void *  key);
7375 } __attribute__ ((gcc_struct));
7376
7377 struct __ecereNameSpace__ecere__com__Class
7378 {
7379 struct __ecereNameSpace__ecere__com__Class * prev;
7380 struct __ecereNameSpace__ecere__com__Class * next;
7381 const char *  name;
7382 int offset;
7383 int structSize;
7384 void * *  _vTbl;
7385 int vTblSize;
7386 unsigned int (*  Constructor)(void * );
7387 void (*  Destructor)(void * );
7388 int offsetClass;
7389 int sizeClass;
7390 struct __ecereNameSpace__ecere__com__Class * base;
7391 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
7392 struct __ecereNameSpace__ecere__sys__BinaryTree members;
7393 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
7394 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
7395 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
7396 struct __ecereNameSpace__ecere__sys__OldList derivatives;
7397 int memberID;
7398 int startMemberID;
7399 int type;
7400 struct __ecereNameSpace__ecere__com__Instance * module;
7401 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7402 const char *  dataTypeString;
7403 struct Type * dataType;
7404 int typeSize;
7405 int defaultAlignment;
7406 void (*  Initialize)();
7407 int memberOffset;
7408 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
7409 const char *  designerClass;
7410 unsigned int noExpansion;
7411 const char *  defaultProperty;
7412 unsigned int comRedefinition;
7413 int count;
7414 int isRemote;
7415 unsigned int internalDecl;
7416 void *  data;
7417 unsigned int computeSize;
7418 short structAlignment;
7419 short pointerAlignment;
7420 int destructionWatchOffset;
7421 unsigned int fixed;
7422 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
7423 int inheritanceAccess;
7424 const char *  fullName;
7425 void *  symbol;
7426 struct __ecereNameSpace__ecere__sys__OldList conversions;
7427 struct __ecereNameSpace__ecere__sys__OldList templateParams;
7428 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
7429 struct __ecereNameSpace__ecere__com__Class * templateClass;
7430 struct __ecereNameSpace__ecere__sys__OldList templatized;
7431 int numParams;
7432 unsigned int isInstanceClass;
7433 unsigned int byValueSystemClass;
7434 } __attribute__ ((gcc_struct));
7435
7436 struct __ecereNameSpace__ecere__com__NameSpace
7437 {
7438 const char *  name;
7439 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
7440 struct __ecereNameSpace__ecere__com__NameSpace *  left;
7441 struct __ecereNameSpace__ecere__com__NameSpace *  right;
7442 int depth;
7443 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
7444 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
7445 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
7446 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
7447 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
7448 } __attribute__ ((gcc_struct));
7449
7450 struct __ecereNameSpace__ecere__com__DataMember
7451 {
7452 struct __ecereNameSpace__ecere__com__DataMember * prev;
7453 struct __ecereNameSpace__ecere__com__DataMember * next;
7454 const char *  name;
7455 unsigned int isProperty;
7456 int memberAccess;
7457 int id;
7458 struct __ecereNameSpace__ecere__com__Class * _class;
7459 const char *  dataTypeString;
7460 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
7461 struct Type * dataType;
7462 int type;
7463 int offset;
7464 int memberID;
7465 struct __ecereNameSpace__ecere__sys__OldList members;
7466 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
7467 int memberOffset;
7468 short structAlignment;
7469 short pointerAlignment;
7470 } __attribute__ ((gcc_struct));
7471
7472 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7473
7474 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7475
7476 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
7477
7478 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7479
7480 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7481
7482 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
7483
7484 static void _DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl)
7485 {
7486 if(inCompiler)
7487 {
7488 if(type->kind == 11)
7489 {
7490 struct Type * param;
7491
7492 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
7493 _DeclareType(neededFor, param, forFunctionDef, 0, fwdDecl);
7494 _DeclareType(neededFor, type->__anon1.__anon2.returnType, forFunctionDef, 0, fwdDecl);
7495 }
7496 else if(type->kind == 13)
7497 _DeclareType(neededFor, type->__anon1.type, 0, 0, fwdDecl);
7498 else if(type->kind == 8)
7499 {
7500 struct __ecereNameSpace__ecere__com__Class * c = type->__anon1._class->__anon1.registered;
7501
7502 _DeclareStruct(neededFor, c ? c->fullName : "ecere::com::Instance", c ? c->type == 5 : 0, needDereference && c && c->type == 1, fwdDecl);
7503 }
7504 else if(type->kind == 9 || type->kind == 10)
7505 {
7506 struct Type * member;
7507
7508 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7509 _DeclareType(neededFor, member, needDereference, forFunctionDef, fwdDecl);
7510 }
7511 else if(type->kind == 12)
7512 _DeclareType(neededFor, type->__anon1.__anon4.arrayType, 1, 0, fwdDecl);
7513 }
7514 }
7515
7516 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
7517 {
7518 unsigned int status = 1;
7519
7520 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))
7521 {
7522 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
7523 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
7524
7525 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
7526 {
7527 struct Type * sourceType = source, * destType = dest;
7528
7529 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
7530 sourceType = sourceType->__anon1.type;
7531 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
7532 destType = destType->__anon1.type;
7533 if(!destType->constant && sourceType->constant)
7534 {
7535 status = 0;
7536 if(warn)
7537 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
7538 }
7539 }
7540 }
7541 return status;
7542 }
7543
7544 struct Operand GetOperand(struct Expression * exp)
7545 {
7546 struct Operand op =
7547 {
7548 0, 0, 0,
7549 .__anon1 = {
7550 .c = 0
7551 },
7552 {
7553 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7554 }
7555 };
7556 struct Type * type = exp->expType;
7557
7558 if(type)
7559 {
7560 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))
7561 {
7562 if(!type->__anon1._class->__anon1.registered->dataType)
7563 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7564 type = type->__anon1._class->__anon1.registered->dataType;
7565 }
7566 if(exp->type == 3 && op.kind == 13)
7567 {
7568 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
7569 op.kind = 13;
7570 op.ops = uint64Ops;
7571 }
7572 else if(exp->isConstant && exp->type == 2)
7573 {
7574 op.kind = type->kind;
7575 op.type = type;
7576 switch(op.kind)
7577 {
7578 case 24:
7579 case 1:
7580 {
7581 if(exp->__anon1.__anon1.constant[0] == '\'')
7582 {
7583 op.__anon1.c = exp->__anon1.__anon1.constant[1];
7584 op.ops = charOps;
7585 }
7586 else if(type->isSigned)
7587 {
7588 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7589 op.ops = charOps;
7590 }
7591 else
7592 {
7593 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7594 op.ops = ucharOps;
7595 }
7596 break;
7597 }
7598 case 2:
7599 if(type->isSigned)
7600 {
7601 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7602 op.ops = shortOps;
7603 }
7604 else
7605 {
7606 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7607 op.ops = ushortOps;
7608 }
7609 break;
7610 case 3:
7611 case 5:
7612 if(type->isSigned)
7613 {
7614 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7615 op.ops = intOps;
7616 }
7617 else
7618 {
7619 op.__anon1.ui = (unsigned int)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7620 op.ops = uintOps;
7621 }
7622 op.kind = 3;
7623 break;
7624 case 4:
7625 if(type->isSigned)
7626 {
7627 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7628 op.ops = int64Ops;
7629 }
7630 else
7631 {
7632 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7633 op.ops = uint64Ops;
7634 }
7635 op.kind = 4;
7636 break;
7637 case 22:
7638 if(type->isSigned)
7639 {
7640 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7641 op.ops = int64Ops;
7642 }
7643 else
7644 {
7645 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7646 op.ops = uint64Ops;
7647 }
7648 op.kind = 4;
7649 break;
7650 case 23:
7651 if(type->isSigned)
7652 {
7653 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7654 op.ops = int64Ops;
7655 }
7656 else
7657 {
7658 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7659 op.ops = uint64Ops;
7660 }
7661 op.kind = 4;
7662 break;
7663 case 6:
7664 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7665 op.__anon1.f = __ecereMethod_float_inf();
7666 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7667 op.__anon1.f = -__ecereMethod_float_inf();
7668 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7669 op.__anon1.f = __ecereMethod_float_nan();
7670 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7671 op.__anon1.f = -__ecereMethod_float_nan();
7672 else
7673 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7674 op.ops = floatOps;
7675 break;
7676 case 7:
7677 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7678 op.__anon1.d = __ecereMethod_double_inf();
7679 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7680 op.__anon1.d = -__ecereMethod_double_inf();
7681 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7682 op.__anon1.d = __ecereMethod_double_nan();
7683 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7684 op.__anon1.d = -__ecereMethod_double_nan();
7685 else
7686 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7687 op.ops = doubleOps;
7688 break;
7689 case 12:
7690 case 13:
7691 case 8:
7692 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7693 op.kind = 13;
7694 op.ops = uint64Ops;
7695 break;
7696 }
7697 }
7698 }
7699 return op;
7700 }
7701
7702 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
7703 {
7704 long long v = 0;
7705
7706 switch(_class->typeSize)
7707 {
7708 case 8:
7709 if(!strcmp(_class->dataTypeString, "uint64"))
7710 v = (long long)*(uint64 *)ptr;
7711 else
7712 v = *(long long *)ptr;
7713 break;
7714 case 4:
7715 if(!strcmp(_class->dataTypeString, "uint"))
7716 v = (long long)*(unsigned int *)ptr;
7717 else
7718 v = (long long)*(int *)ptr;
7719 break;
7720 case 2:
7721 if(!strcmp(_class->dataTypeString, "uint16"))
7722 v = (long long)*(unsigned short *)ptr;
7723 else
7724 v = (long long)*(short *)ptr;
7725 break;
7726 case 1:
7727 if(!strcmp(_class->dataTypeString, "byte"))
7728 v = (long long)*(unsigned char *)ptr;
7729 else
7730 v = (long long)*(char *)ptr;
7731 break;
7732 }
7733 return v;
7734 }
7735
7736 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
7737 {
7738 if(!type->isSigned && type->kind != 22 && type->kind != 23)
7739 ListAdd(specs, MkSpecifier(UNSIGNED));
7740 switch(type->kind)
7741 {
7742 case 8:
7743 {
7744 if(type->__anon1._class->__anon1.registered)
7745 {
7746 if(!type->__anon1._class->__anon1.registered->dataType)
7747 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7748 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
7749 }
7750 break;
7751 }
7752 case 7:
7753 ListAdd(specs, MkSpecifier(DOUBLE));
7754 break;
7755 case 6:
7756 ListAdd(specs, MkSpecifier(FLOAT));
7757 break;
7758 case 1:
7759 ListAdd(specs, MkSpecifier(CHAR));
7760 break;
7761 case 24:
7762 ListAdd(specs, MkSpecifier(_BOOL));
7763 break;
7764 case 2:
7765 ListAdd(specs, MkSpecifier(SHORT));
7766 break;
7767 case 4:
7768 ListAdd(specs, MkSpecifier(INT64));
7769 break;
7770 case 22:
7771 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
7772 break;
7773 case 23:
7774 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
7775 break;
7776 case 3:
7777 default:
7778 ListAdd(specs, MkSpecifier(INT));
7779 break;
7780 }
7781 }
7782
7783 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
7784 {
7785 if(type)
7786 {
7787 if(printConst && type->constant)
7788 strcat(string, "const ");
7789 switch(type->kind)
7790 {
7791 case 8:
7792 {
7793 struct Symbol * c = type->__anon1._class;
7794 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
7795
7796 if(type->classObjectType == 2 && isObjectBaseClass)
7797 strcat(string, "typed_object");
7798 else if(type->classObjectType == 3 && isObjectBaseClass)
7799 strcat(string, "any_object");
7800 else
7801 {
7802 if(c && c->string)
7803 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
7804 }
7805 if(type->byReference)
7806 strcat(string, " &");
7807 break;
7808 }
7809 case 0:
7810 strcat(string, "void");
7811 break;
7812 case 3:
7813 strcat(string, type->isSigned ? "int" : "uint");
7814 break;
7815 case 4:
7816 strcat(string, type->isSigned ? "int64" : "uint64");
7817 break;
7818 case 22:
7819 strcat(string, type->isSigned ? "intptr" : "uintptr");
7820 break;
7821 case 23:
7822 strcat(string, type->isSigned ? "intsize" : "uintsize");
7823 break;
7824 case 1:
7825 strcat(string, type->isSigned ? "char" : "byte");
7826 break;
7827 case 24:
7828 strcat(string, "_Bool");
7829 break;
7830 case 2:
7831 strcat(string, type->isSigned ? "short" : "uint16");
7832 break;
7833 case 6:
7834 strcat(string, "float");
7835 break;
7836 case 7:
7837 strcat(string, "double");
7838 break;
7839 case 9:
7840 if(type->__anon1.__anon1.enumName)
7841 {
7842 strcat(string, "struct ");
7843 strcat(string, type->__anon1.__anon1.enumName);
7844 }
7845 else if(type->typeName)
7846 strcat(string, type->typeName);
7847 else
7848 {
7849 struct Type * member;
7850
7851 strcat(string, "struct { ");
7852 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7853 {
7854 PrintType(member, string, 1, fullName);
7855 strcat(string, "; ");
7856 }
7857 strcat(string, "}");
7858 }
7859 break;
7860 case 10:
7861 if(type->__anon1.__anon1.enumName)
7862 {
7863 strcat(string, "union ");
7864 strcat(string, type->__anon1.__anon1.enumName);
7865 }
7866 else if(type->typeName)
7867 strcat(string, type->typeName);
7868 else
7869 {
7870 strcat(string, "union ");
7871 strcat(string, "(unnamed)");
7872 }
7873 break;
7874 case 15:
7875 if(type->__anon1.__anon1.enumName)
7876 {
7877 strcat(string, "enum ");
7878 strcat(string, type->__anon1.__anon1.enumName);
7879 }
7880 else if(type->typeName)
7881 strcat(string, type->typeName);
7882 else
7883 strcat(string, "int");
7884 break;
7885 case 14:
7886 strcat(string, "...");
7887 break;
7888 case 19:
7889 strcat(string, "subclass(");
7890 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
7891 strcat(string, ")");
7892 break;
7893 case 20:
7894 strcat(string, type->__anon1.templateParameter->identifier->string);
7895 break;
7896 case 21:
7897 strcat(string, "thisclass");
7898 break;
7899 case 17:
7900 strcat(string, "__builtin_va_list");
7901 break;
7902 }
7903 }
7904 }
7905
7906 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
7907
7908 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
7909
7910 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
7911
7912 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
7913
7914 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
7915
7916 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
7917
7918 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
7919
7920 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
7921
7922 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
7923
7924 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
7925
7926 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
7927
7928 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
7929
7930 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
7931
7932 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
7933
7934 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
7935
7936 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
7937
7938 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
7939
7940 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
7941
7942 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
7943
7944 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
7945
7946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
7947
7948 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
7949
7950 struct __ecereNameSpace__ecere__com__Application
7951 {
7952 int argc;
7953 const char * *  argv;
7954 int exitCode;
7955 unsigned int isGUIApp;
7956 struct __ecereNameSpace__ecere__sys__OldList allModules;
7957 char *  parsedCommand;
7958 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
7959 } __attribute__ ((gcc_struct));
7960
7961 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)
7962 {
7963 if(*curMember)
7964 {
7965 *curMember = (*curMember)->next;
7966 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
7967 {
7968 *curMember = subMemberStack[--(*subMemberStackPos)];
7969 *curMember = (*curMember)->next;
7970 }
7971 while((*curMember) && (*curMember)->isProperty)
7972 *curMember = (*curMember)->next;
7973 if(subMemberStackPos)
7974 {
7975 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
7976 {
7977 subMemberStack[(*subMemberStackPos)++] = *curMember;
7978 *curMember = (*curMember)->members.first;
7979 while(*curMember && (*curMember)->isProperty)
7980 *curMember = (*curMember)->next;
7981 }
7982 }
7983 }
7984 while(!*curMember)
7985 {
7986 if(!*curMember)
7987 {
7988 if(subMemberStackPos && *subMemberStackPos)
7989 {
7990 *curMember = subMemberStack[--(*subMemberStackPos)];
7991 *curMember = (*curMember)->next;
7992 }
7993 else
7994 {
7995 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
7996
7997 if(*curClass == _class)
7998 break;
7999 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
8000 ;
8001 *curMember = (*curClass)->membersAndProperties.first;
8002 }
8003 while((*curMember) && (*curMember)->isProperty)
8004 *curMember = (*curMember)->next;
8005 if(subMemberStackPos)
8006 {
8007 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8008 {
8009 subMemberStack[(*subMemberStackPos)++] = *curMember;
8010 *curMember = (*curMember)->members.first;
8011 while(*curMember && (*curMember)->isProperty)
8012 *curMember = (*curMember)->next;
8013 }
8014 }
8015 }
8016 }
8017 }
8018
8019 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
8020 {
8021 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
8022 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
8023 struct __ecereNameSpace__ecere__com__NameSpace * child;
8024
8025 if(!data)
8026 {
8027 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)))
8028 {
8029 data = ScanGlobalData(child, name);
8030 if(data)
8031 break;
8032 }
8033 }
8034 return data;
8035 }
8036
8037 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
8038 {
8039 int nsLen = strlen(nameSpace);
8040 struct Symbol * symbol;
8041
8042 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)))
8043 {
8044 char * s = symbol->string;
8045
8046 if(!strncmp(s, nameSpace, nsLen))
8047 {
8048 int c;
8049 char * namePart;
8050
8051 for(c = strlen(s) - 1; c >= 0; c--)
8052 if(s[c] == ':')
8053 break;
8054 namePart = s + c + 1;
8055 if(!strcmp(namePart, name))
8056 {
8057 return symbol;
8058 }
8059 }
8060 else
8061 break;
8062 }
8063 return (((void *)0));
8064 }
8065
8066 unsigned int GetInt(struct Expression * exp, int * value2)
8067 {
8068 struct Operand op2 = GetOperand(exp);
8069
8070 return GetOpInt(&op2, value2);
8071 }
8072
8073 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
8074 {
8075 struct Operand op2 = GetOperand(exp);
8076
8077 return GetOpUInt(&op2, value2);
8078 }
8079
8080 unsigned int GetInt64(struct Expression * exp, long long * value2)
8081 {
8082 struct Operand op2 = GetOperand(exp);
8083
8084 return GetOpInt64(&op2, value2);
8085 }
8086
8087 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
8088 {
8089 struct Operand op2 = GetOperand(exp);
8090
8091 return GetOpUInt64(&op2, value2);
8092 }
8093
8094 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
8095 {
8096 struct Operand op2 = GetOperand(exp);
8097
8098 return GetOpIntPtr(&op2, value2);
8099 }
8100
8101 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
8102 {
8103 struct Operand op2 = GetOperand(exp);
8104
8105 return GetOpUIntPtr(&op2, value2);
8106 }
8107
8108 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
8109 {
8110 struct Operand op2 = GetOperand(exp);
8111
8112 return GetOpIntSize(&op2, value2);
8113 }
8114
8115 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
8116 {
8117 struct Operand op2 = GetOperand(exp);
8118
8119 return GetOpUIntSize(&op2, value2);
8120 }
8121
8122 unsigned int GetShort(struct Expression * exp, short * value2)
8123 {
8124 struct Operand op2 = GetOperand(exp);
8125
8126 return GetOpShort(&op2, value2);
8127 }
8128
8129 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
8130 {
8131 struct Operand op2 = GetOperand(exp);
8132
8133 return GetOpUShort(&op2, value2);
8134 }
8135
8136 unsigned int GetChar(struct Expression * exp, char * value2)
8137 {
8138 struct Operand op2 = GetOperand(exp);
8139
8140 return GetOpChar(&op2, value2);
8141 }
8142
8143 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
8144 {
8145 struct Operand op2 = GetOperand(exp);
8146
8147 return GetOpUChar(&op2, value2);
8148 }
8149
8150 unsigned int GetFloat(struct Expression * exp, float * value2)
8151 {
8152 struct Operand op2 = GetOperand(exp);
8153
8154 return GetOpFloat(&op2, value2);
8155 }
8156
8157 unsigned int GetDouble(struct Expression * exp, double * value2)
8158 {
8159 struct Operand op2 = GetOperand(exp);
8160
8161 return GetOpDouble(&op2, value2);
8162 }
8163
8164 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
8165 {
8166 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8167 {
8168 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
8169 PrintAttribs(type, string);
8170 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
8171 strcat(string, " const");
8172 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
8173 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8174 strcat(string, " (");
8175 if(type->kind == 13)
8176 {
8177 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
8178 PrintAttribs(type->__anon1.type, string);
8179 }
8180 if(type->kind == 13)
8181 {
8182 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
8183 strcat(string, "*");
8184 else
8185 strcat(string, " *");
8186 }
8187 if(printConst && type->constant && type->kind == 13)
8188 strcat(string, " const");
8189 }
8190 else
8191 PrintTypeSpecs(type, string, fullName, printConst);
8192 }
8193
8194 void PrintExpression(struct Expression * exp, char * string)
8195 {
8196 {
8197 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8198 int count;
8199 unsigned int backOutputLineNumbers = outputLineNumbers;
8200
8201 outputLineNumbers = 0;
8202 if(exp)
8203 OutputExpression(exp, f);
8204 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8205 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8206
8207 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8208 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
8209 count = strlen(string);
8210 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8211 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8212
8213 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8214 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
8215 string[count] = '\0';
8216 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
8217 outputLineNumbers = backOutputLineNumbers;
8218 }
8219 }
8220
8221 struct Type * Dereference(struct Type * source)
8222 {
8223 struct Type * type = (((void *)0));
8224
8225 if(source)
8226 {
8227 if(source->kind == 13 || source->kind == 12)
8228 {
8229 type = source->__anon1.type;
8230 source->__anon1.type->refCount++;
8231 }
8232 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
8233 {
8234 type = __extension__ ({
8235 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8236
8237 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
8238 });
8239 }
8240 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
8241 {
8242 type = source;
8243 source->refCount++;
8244 }
8245 else
8246 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
8247 }
8248 return type;
8249 }
8250
8251 static struct Type * Reference(struct Type * source)
8252 {
8253 struct Type * type = (((void *)0));
8254
8255 if(source)
8256 {
8257 type = __extension__ ({
8258 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8259
8260 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
8261 });
8262 source->refCount++;
8263 }
8264 return type;
8265 }
8266
8267 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
8268 {
8269 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
8270
8271 FreeExpContents(checkedExp);
8272 FreeType(checkedExp->expType);
8273 FreeType(checkedExp->destType);
8274 *checkedExp = *newExp;
8275 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
8276 checkedExp->prev = prev;
8277 checkedExp->next = next;
8278 }
8279
8280 void FinishTemplatesContext(struct Context * context)
8281 {
8282 PopContext(context);
8283 FreeContext(context);
8284 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
8285 }
8286
8287 static __attribute__((unused)) void UnusedFunction()
8288 {
8289 int a;
8290
8291 ((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);
8292 }
8293
8294 struct Expression * ParseExpressionString(char * expression)
8295 {
8296 parseError = 0;
8297 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8298 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8299 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8300
8301 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8302 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
8303 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8304 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8305
8306 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8307 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
8308 echoOn = 0;
8309 parsedExpression = (((void *)0));
8310 resetScanner();
8311 expression_yyparse();
8312 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
8313 return parsedExpression;
8314 }
8315
8316 struct __ecereNameSpace__ecere__com__Module
8317 {
8318 struct __ecereNameSpace__ecere__com__Instance * application;
8319 struct __ecereNameSpace__ecere__sys__OldList classes;
8320 struct __ecereNameSpace__ecere__sys__OldList defines;
8321 struct __ecereNameSpace__ecere__sys__OldList functions;
8322 struct __ecereNameSpace__ecere__sys__OldList modules;
8323 struct __ecereNameSpace__ecere__com__Instance * prev;
8324 struct __ecereNameSpace__ecere__com__Instance * next;
8325 const char *  name;
8326 void *  library;
8327 void *  Unload;
8328 int importType;
8329 int origImportType;
8330 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
8331 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
8332 } __attribute__ ((gcc_struct));
8333
8334 static struct GlobalData * FindGlobalData(char * name)
8335 {
8336 int start = 0, c;
8337 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
8338
8339 nameSpace = globalData;
8340 for(c = 0; name[c]; c++)
8341 {
8342 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
8343 {
8344 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
8345 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
8346
8347 strncpy(spaceName, name + start, c - start);
8348 spaceName[c - start] = '\0';
8349 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
8350 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
8351 if(!newSpace)
8352 return (((void *)0));
8353 nameSpace = newSpace;
8354 if(name[c] == ':')
8355 c++;
8356 start = c + 1;
8357 }
8358 }
8359 if(c - start)
8360 {
8361 return ScanGlobalData(nameSpace, name + start);
8362 }
8363 return (((void *)0));
8364 }
8365
8366 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
8367 {
8368 int c;
8369 char nameSpace[1024];
8370 const char * namePart;
8371 unsigned int gotColon = 0;
8372
8373 nameSpace[0] = '\0';
8374 for(c = strlen(name) - 1; c >= 0; c--)
8375 if(name[c] == ':')
8376 {
8377 gotColon = 1;
8378 break;
8379 }
8380 namePart = name + c + 1;
8381 while(c >= 0 && name[c] == ':')
8382 c--;
8383 if(c >= 0)
8384 {
8385 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
8386
8387 if(symbol)
8388 return symbol;
8389 memcpy(nameSpace, name, c + 1);
8390 nameSpace[c + 1] = (char)0;
8391 return ScanWithNameSpace(tree, nameSpace, namePart);
8392 }
8393 else if(gotColon)
8394 {
8395 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8396
8397 return symbol;
8398 }
8399 else
8400 {
8401 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8402
8403 if(symbol)
8404 return symbol;
8405 return ScanWithNameSpace(tree, "", namePart);
8406 }
8407 return (((void *)0));
8408 }
8409
8410 static void PrintArraySize(struct Type * arrayType, char * string)
8411 {
8412 char size[256];
8413
8414 size[0] = '\0';
8415 strcat(size, "[");
8416 if(arrayType->__anon1.__anon4.enumClass)
8417 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
8418 else if(arrayType->__anon1.__anon4.arraySizeExp)
8419 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
8420 strcat(size, "]");
8421 strcat(string, size);
8422 }
8423
8424 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
8425 {
8426
8427 }
8428
8429 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
8430 {
8431 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8432 strcat(string, ")");
8433 if(type->kind == 12)
8434 PrintArraySize(type, string);
8435 else if(type->kind == 11)
8436 {
8437 struct Type * param;
8438
8439 strcat(string, "(");
8440 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
8441 {
8442 PrintType(param, string, 1, fullName);
8443 if(param->next)
8444 strcat(string, ", ");
8445 }
8446 strcat(string, ")");
8447 }
8448 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8449 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
8450 }
8451
8452 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
8453 {
8454 PrePrintType(type, string, fullName, (((void *)0)), printConst);
8455 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
8456 strcat(string, " ");
8457 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
8458 {
8459 struct Symbol * _class = type->__anon1.__anon2.thisClass;
8460
8461 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
8462 {
8463 if(type->classObjectType == 1)
8464 strcat(string, "class");
8465 else
8466 strcat(string, type->byReference ? "typed_object&" : "typed_object");
8467 }
8468 else if(_class && _class->string)
8469 {
8470 char * s = _class->string;
8471
8472 if(fullName)
8473 strcat(string, s);
8474 else
8475 {
8476 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
8477
8478 if(name)
8479 name += 2;
8480 else
8481 name = s;
8482 strcat(string, name);
8483 }
8484 }
8485 strcat(string, "::");
8486 }
8487 if(printName && type->name)
8488 PrintName(type, string, fullName);
8489 PostPrintType(type, string, fullName);
8490 if(type->bitFieldCount)
8491 {
8492 char count[100];
8493
8494 sprintf(count, ":%d", type->bitFieldCount);
8495 strcat(string, count);
8496 }
8497 }
8498
8499 struct Conversion;
8500
8501 struct Conversion
8502 {
8503 struct Conversion * prev, * next;
8504 struct __ecereNameSpace__ecere__com__Property * convert;
8505 unsigned int isGet;
8506 struct Type * resultType;
8507 } __attribute__ ((gcc_struct));
8508
8509 static void FreeConvert(struct Conversion * convert)
8510 {
8511 if(convert->resultType)
8512 FreeType(convert->resultType);
8513 }
8514
8515 struct Enumerator;
8516
8517 struct Enumerator
8518 {
8519 struct Enumerator * prev;
8520 struct Enumerator * next;
8521 struct Location loc;
8522 struct Identifier * id;
8523 struct Expression * exp;
8524 } __attribute__ ((gcc_struct));
8525
8526 struct AsmField;
8527
8528 struct AsmField
8529 {
8530 struct AsmField * prev;
8531 struct AsmField * next;
8532 struct Location loc;
8533 char *  command;
8534 struct Expression * expression;
8535 struct Identifier * symbolic;
8536 } __attribute__ ((gcc_struct));
8537
8538 struct ClassDefinition;
8539
8540 struct Context
8541 {
8542 struct Context * parent;
8543 struct __ecereNameSpace__ecere__sys__BinaryTree types;
8544 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
8545 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
8546 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
8547 int nextID;
8548 int simpleID;
8549 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
8550 struct ClassDefinition * classDef;
8551 unsigned int templateTypesOnly;
8552 unsigned int hasNameSpace;
8553 } __attribute__ ((gcc_struct));
8554
8555 struct External
8556 {
8557 struct External * prev;
8558 struct External * next;
8559 struct Location loc;
8560 int type;
8561 struct Symbol * symbol;
8562 union
8563 {
8564 struct FunctionDefinition * function;
8565 struct ClassDefinition * _class;
8566 struct Declaration * declaration;
8567 char *  importString;
8568 struct Identifier * id;
8569 struct DBTableDef * table;
8570 } __attribute__ ((gcc_struct)) __anon1;
8571 int importType;
8572 struct External * fwdDecl;
8573 struct __ecereNameSpace__ecere__com__Instance * outgoing;
8574 struct __ecereNameSpace__ecere__com__Instance * incoming;
8575 int nonBreakableIncoming;
8576 } __attribute__ ((gcc_struct));
8577
8578 struct ClassDefinition
8579 {
8580 struct ClassDefinition * prev;
8581 struct ClassDefinition * next;
8582 struct Location loc;
8583 struct Specifier * _class;
8584 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
8585 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
8586 struct Symbol * symbol;
8587 struct Location blockStart;
8588 struct Location nameLoc;
8589 int declMode;
8590 unsigned int deleteWatchable;
8591 } __attribute__ ((gcc_struct));
8592
8593 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
8594
8595 void __ecereMethod_External_CreateEdge(struct External * this, struct External * from, unsigned int soft);
8596
8597 void DeclareGlobalData(struct External * neededFor, struct GlobalData * data)
8598 {
8599 struct Symbol * symbol = data->symbol;
8600
8601 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
8602 {
8603 if(inCompiler)
8604 {
8605 if(!symbol)
8606 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
8607 }
8608 if(!data->dataType)
8609 data->dataType = ProcessTypeString(data->dataTypeString, 0);
8610 if(inCompiler)
8611 {
8612 struct Declaration * decl;
8613 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
8614 struct Declarator * d;
8615 struct External * external;
8616
8617 specifiers = MkList();
8618 declarators = MkList();
8619 ListAdd(specifiers, MkSpecifier(EXTERN));
8620 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
8621 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
8622 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
8623 decl = MkDeclaration(specifiers, declarators);
8624 external = MkExternalDeclaration(decl);
8625 if(curExternal)
8626 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
8627 external->symbol = symbol;
8628 symbol->__anon2.__anon1.pointerExternal = external;
8629 DeclareType(external, data->dataType, 1, 1);
8630 }
8631 }
8632 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
8633 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, 0);
8634 }
8635
8636 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
8637 {
8638 struct Context * ctx;
8639 struct Symbol * symbol = (((void *)0));
8640
8641 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
8642 {
8643 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
8644 {
8645 symbol = (((void *)0));
8646 if(thisNameSpace)
8647 {
8648 char curName[1024];
8649
8650 strcpy(curName, thisNameSpace);
8651 strcat(curName, "::");
8652 strcat(curName, name);
8653 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
8654 }
8655 if(!symbol)
8656 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
8657 }
8658 else
8659 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
8660 if(symbol || ctx == endContext)
8661 break;
8662 }
8663 if(inCompiler && symbol && ctx == globalContext && symbol->__anon2.__anon1.pointerExternal && curExternal && symbol->__anon2.__anon1.pointerExternal != curExternal)
8664 __ecereMethod_External_CreateUniqueEdge(curExternal, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
8665 return symbol;
8666 }
8667
8668 struct PropertyDef;
8669
8670 struct ClassDef
8671 {
8672 struct ClassDef * prev;
8673 struct ClassDef * next;
8674 struct Location loc;
8675 int type;
8676 union
8677 {
8678 struct Declaration * decl;
8679 struct ClassFunction * function;
8680 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
8681 struct PropertyDef * propertyDef;
8682 struct PropertyWatch * propertyWatch;
8683 char *  designer;
8684 struct Identifier * defaultProperty;
8685 struct
8686 {
8687 struct Identifier * id;
8688 struct Initializer * initializer;
8689 } __attribute__ ((gcc_struct)) __anon1;
8690 } __attribute__ ((gcc_struct)) __anon1;
8691 int memberAccess;
8692 void *  object;
8693 } __attribute__ ((gcc_struct));
8694
8695 struct PropertyDef
8696 {
8697 struct PropertyDef * prev;
8698 struct PropertyDef * next;
8699 struct Location loc;
8700 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
8701 struct Declarator * declarator;
8702 struct Identifier * id;
8703 struct Statement * getStmt;
8704 struct Statement * setStmt;
8705 struct Statement * issetStmt;
8706 struct Symbol * symbol;
8707 struct Expression * category;
8708 struct
8709 {
8710 unsigned int conversion : 1;
8711 unsigned int isWatchable : 1;
8712 unsigned int isDBProp : 1;
8713 } __attribute__ ((gcc_struct)) __anon1;
8714 } __attribute__ ((gcc_struct));
8715
8716 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
8717 {
8718 struct ClassDef * def;
8719 int anonID = 1;
8720
8721 for(def = (*definitions).first; def; def = def->next)
8722 {
8723 if(def->type == 2)
8724 {
8725 struct Declaration * decl = def->__anon1.decl;
8726
8727 if(decl && decl->__anon1.__anon1.specifiers)
8728 {
8729 struct Specifier * spec;
8730 unsigned int isStruct = 0;
8731
8732 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
8733 {
8734 if(spec->type == 3 || spec->type == 4)
8735 {
8736 if(spec->__anon1.__anon2.definitions)
8737 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
8738 isStruct = 1;
8739 }
8740 }
8741 if(isStruct)
8742 {
8743 struct Declarator * d = (((void *)0));
8744
8745 if(decl->__anon1.__anon1.declarators)
8746 {
8747 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
8748 {
8749 struct Identifier * idDecl = GetDeclId(d);
8750
8751 if(idDecl)
8752 break;
8753 }
8754 }
8755 if(!d)
8756 {
8757 char id[100];
8758
8759 sprintf(id, "__anon%d", anonID++);
8760 if(!decl->__anon1.__anon1.declarators)
8761 decl->__anon1.__anon1.declarators = MkList();
8762 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
8763 }
8764 }
8765 }
8766 }
8767 }
8768 }
8769
8770 struct MemberInit;
8771
8772 typedef union YYSTYPE
8773 {
8774 int specifierType;
8775 int i;
8776 int declMode;
8777 struct Identifier * id;
8778 struct Expression * exp;
8779 struct Specifier * specifier;
8780 struct __ecereNameSpace__ecere__sys__OldList * list;
8781 struct Enumerator * enumerator;
8782 struct Declarator * declarator;
8783 struct Pointer * pointer;
8784 struct Initializer * initializer;
8785 struct InitDeclarator * initDeclarator;
8786 struct TypeName * typeName;
8787 struct Declaration * declaration;
8788 struct Statement * stmt;
8789 struct FunctionDefinition * function;
8790 struct External * external;
8791 struct Context * context;
8792 struct AsmField * asmField;
8793 struct Attrib * attrib;
8794 struct ExtDecl * extDecl;
8795 struct Attribute * attribute;
8796 struct Instantiation * instance;
8797 struct MembersInit * membersInit;
8798 struct MemberInit * memberInit;
8799 struct ClassFunction * classFunction;
8800 struct ClassDefinition * _class;
8801 struct ClassDef * classDef;
8802 struct PropertyDef * prop;
8803 char * string;
8804 struct Symbol * symbol;
8805 struct PropertyWatch * propertyWatch;
8806 struct TemplateParameter * templateParameter;
8807 struct TemplateArgument * templateArgument;
8808 struct TemplateDatatype * templateDatatype;
8809 struct DBTableEntry * dbtableEntry;
8810 struct DBIndexItem * dbindexItem;
8811 struct DBTableDef * dbtableDef;
8812 } __attribute__ ((gcc_struct)) YYSTYPE;
8813
8814 extern YYSTYPE yylval;
8815
8816 struct MemberInit
8817 {
8818 struct MemberInit * prev;
8819 struct MemberInit * next;
8820 struct Location loc;
8821 struct Location realLoc;
8822 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
8823 struct Initializer * initializer;
8824 unsigned int used;
8825 unsigned int variable;
8826 unsigned int takeOutExp;
8827 } __attribute__ ((gcc_struct));
8828
8829 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
8830
8831 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
8832
8833 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
8834 {
8835 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
8836 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
8837 const char *  name;
8838 int type;
8839 union
8840 {
8841 const char *  dataTypeString;
8842 int memberType;
8843 } __attribute__ ((gcc_struct)) __anon1;
8844 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
8845 void *  param;
8846 } __attribute__ ((gcc_struct));
8847
8848 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
8849 {
8850 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
8851 int id = 0;
8852 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
8853 struct __ecereNameSpace__ecere__com__Class * sClass;
8854
8855 for(sClass = _class; sClass; sClass = sClass->base)
8856 {
8857 id = 0;
8858 if(sClass->templateClass)
8859 sClass = sClass->templateClass;
8860 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
8861 {
8862 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
8863 {
8864 for(sClass = sClass->base; sClass; sClass = sClass->base)
8865 {
8866 if(sClass->templateClass)
8867 sClass = sClass->templateClass;
8868 id += sClass->templateParams.count;
8869 }
8870 break;
8871 }
8872 id++;
8873 }
8874 if(curParam)
8875 break;
8876 }
8877 if(curParam)
8878 {
8879 arg = &_class->templateArgs[id];
8880 if(arg && param->type == 0)
8881 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
8882 }
8883 return arg;
8884 }
8885
8886 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
8887 {
8888 struct Context * context = PushContext();
8889
8890 context->templateTypesOnly = 1;
8891 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
8892 {
8893 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
8894
8895 for(; param; param = param->next)
8896 {
8897 if(param->type == 0 && param->identifier)
8898 {
8899 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
8900
8901 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8902 }
8903 }
8904 }
8905 else if(_class)
8906 {
8907 struct __ecereNameSpace__ecere__com__Class * sClass;
8908
8909 for(sClass = _class; sClass; sClass = sClass->base)
8910 {
8911 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
8912
8913 for(p = sClass->templateParams.first; p; p = p->next)
8914 {
8915 if(p->type == 0)
8916 {
8917 struct TemplateParameter * param = p->param;
8918 struct TemplatedType * type;
8919
8920 if(!param)
8921 {
8922 p->param = param = __extension__ ({
8923 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
8924
8925 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
8926 });
8927 }
8928 type = __extension__ ({
8929 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
8930
8931 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
8932 });
8933 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8934 }
8935 }
8936 }
8937 }
8938 return context;
8939 }
8940
8941 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
8942 {
8943 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8944 {
8945 unsigned int first = 1;
8946 int p = 0;
8947 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8948 int lastParam = -1;
8949 char className[1024];
8950
8951 strcpy(className, _class->fullName);
8952 for(param = _class->templateParams.first; param; param = param->next)
8953 {
8954 {
8955 if(first)
8956 strcat(className, "<");
8957 if(!first)
8958 strcat(className, ", ");
8959 if(lastParam + 1 != p)
8960 {
8961 strcat(className, param->name);
8962 strcat(className, " = ");
8963 }
8964 strcat(className, param->name);
8965 first = 0;
8966 lastParam = p;
8967 }
8968 p++;
8969 }
8970 if(!first)
8971 {
8972 int len = strlen(className);
8973
8974 if(className[len - 1] == '>')
8975 className[len++] = ' ';
8976 className[len++] = '>';
8977 className[len++] = '\0';
8978 }
8979 return __ecereNameSpace__ecere__sys__CopyString(className);
8980 }
8981 else
8982 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
8983 }
8984
8985 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
8986 {
8987 struct Type * type;
8988
8989 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8990 {
8991 unsigned int first = 1;
8992 int p = 0;
8993 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8994 int lastParam = -1;
8995 char className[1024];
8996
8997 strcpy(className, _class->fullName);
8998 for(param = _class->templateParams.first; param; param = param->next)
8999 {
9000 {
9001 if(first)
9002 strcat(className, "<");
9003 if(!first)
9004 strcat(className, ", ");
9005 if(lastParam + 1 != p)
9006 {
9007 strcat(className, param->name);
9008 strcat(className, " = ");
9009 }
9010 strcat(className, param->name);
9011 first = 0;
9012 lastParam = p;
9013 }
9014 p++;
9015 }
9016 if(!first)
9017 {
9018 int len = strlen(className);
9019
9020 if(className[len - 1] == '>')
9021 className[len++] = ' ';
9022 className[len++] = '>';
9023 className[len++] = '\0';
9024 }
9025 type = MkClassType(className);
9026 }
9027 else
9028 {
9029 type = MkClassType(_class->fullName);
9030 }
9031 return type;
9032 }
9033
9034 static int DeclareMembers(struct External * neededBy, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9035 {
9036 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9037 struct __ecereNameSpace__ecere__com__DataMember * member;
9038 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9039
9040 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
9041 DeclareMembers(neededBy, _class->base, 0);
9042 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
9043 {
9044 if(!member->isProperty)
9045 {
9046 switch(member->type)
9047 {
9048 case 0:
9049 {
9050 if(!member->dataType && member->dataTypeString)
9051 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9052 if(member->dataType)
9053 DeclareType(neededBy, member->dataType, 1, 0);
9054 break;
9055 }
9056 case 1:
9057 case 2:
9058 {
9059 DeclareMembers(neededBy, (struct __ecereNameSpace__ecere__com__Class *)member, 1);
9060 break;
9061 }
9062 }
9063 }
9064 }
9065 if(context)
9066 FinishTemplatesContext(context);
9067 return topMember ? topMember->memberID : _class->memberID;
9068 }
9069
9070 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
9071 {
9072 if(!method->dataType)
9073 {
9074 struct Context * context = SetupTemplatesContext(method->_class);
9075
9076 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9077 FinishTemplatesContext(context);
9078 if(method->type != 1 && method->dataType)
9079 {
9080 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
9081 {
9082 if(!method->_class->symbol)
9083 method->_class->symbol = FindClass(method->_class->fullName);
9084 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
9085 }
9086 }
9087 }
9088 }
9089
9090 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
9091 {
9092 if(!prop->dataType)
9093 {
9094 struct Context * context = SetupTemplatesContext(prop->_class);
9095
9096 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
9097 FinishTemplatesContext(context);
9098 }
9099 }
9100
9101 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
9102 {
9103 if(specs != (((void *)0)) && _class)
9104 {
9105 struct Specifier * spec;
9106
9107 for(spec = specs->first; spec; spec = spec->next)
9108 {
9109 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
9110 {
9111 spec->type = 1;
9112 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
9113 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
9114 }
9115 }
9116 }
9117 }
9118
9119 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
9120 {
9121 struct Identifier * id = exp->__anon1.__anon1.identifier;
9122 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9123 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9124 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9125 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9126
9127 if(_class && _class->type == 4)
9128 {
9129 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
9130 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9131
9132 if(enumClass)
9133 {
9134 struct __ecereNameSpace__ecere__com__Class * baseClass;
9135
9136 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
9137 {
9138 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
9139
9140 for(value = e->values.first; value; value = value->next)
9141 {
9142 if(!strcmp(value->name, id->string))
9143 break;
9144 }
9145 if(value)
9146 {
9147 exp->isConstant = 1;
9148 if(inCompiler || inPreCompiler || inDebugger)
9149 {
9150 char constant[256];
9151
9152 FreeExpContents(exp);
9153 exp->type = 2;
9154 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
9155 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
9156 else
9157 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
9158 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9159 }
9160 exp->expType = MkClassType(baseClass->fullName);
9161 break;
9162 }
9163 }
9164 }
9165 if(value)
9166 return 1;
9167 }
9168 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
9169 {
9170 ProcessMethodType(method);
9171 exp->expType = __extension__ ({
9172 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
9173
9174 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
9175 });
9176 return 1;
9177 }
9178 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
9179 {
9180 if(!prop->dataType)
9181 ProcessPropertyType(prop);
9182 exp->expType = prop->dataType;
9183 if(prop->dataType)
9184 prop->dataType->refCount++;
9185 return 1;
9186 }
9187 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
9188 {
9189 if(!member->dataType)
9190 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9191 exp->expType = member->dataType;
9192 if(member->dataType)
9193 member->dataType->refCount++;
9194 return 1;
9195 }
9196 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
9197 {
9198 if(!classProp->dataType)
9199 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
9200 if(classProp->constant)
9201 {
9202 FreeExpContents(exp);
9203 exp->isConstant = 1;
9204 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
9205 {
9206 exp->type = 3;
9207 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
9208 }
9209 else
9210 {
9211 char constant[256];
9212
9213 exp->type = 2;
9214 sprintf(constant, "%d", (int)classProp->Get(_class));
9215 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9216 }
9217 }
9218 else
9219 {
9220 }
9221 exp->expType = classProp->dataType;
9222 if(classProp->dataType)
9223 classProp->dataType->refCount++;
9224 return 1;
9225 }
9226 return 0;
9227 }
9228
9229 void DeclareProperty(struct External * neededBy, struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
9230 {
9231 struct Symbol * symbol = prop->symbol;
9232 unsigned int imported = 0;
9233 unsigned int dllImport = 0;
9234 struct External * structExternal = (((void *)0));
9235 struct External * instExternal = (((void *)0));
9236
9237 strcpy(setName, "__ecereProp_");
9238 FullClassNameCat(setName, prop->_class->fullName, 0);
9239 strcat(setName, "_Set_");
9240 FullClassNameCat(setName, prop->name, 1);
9241 strcpy(getName, "__ecereProp_");
9242 FullClassNameCat(getName, prop->_class->fullName, 0);
9243 strcat(getName, "_Get_");
9244 FullClassNameCat(getName, prop->name, 1);
9245 if(!symbol || symbol->_import)
9246 {
9247 if(!symbol)
9248 {
9249 struct Symbol * classSym;
9250
9251 if(!prop->_class->symbol)
9252 prop->_class->symbol = FindClass(prop->_class->fullName);
9253 classSym = prop->_class->symbol;
9254 if(classSym && !classSym->_import)
9255 {
9256 struct ModuleImport * module;
9257
9258 if(prop->_class->module)
9259 module = FindModule(prop->_class->module);
9260 else
9261 module = mainModule;
9262 classSym->_import = __extension__ ({
9263 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9264
9265 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
9266 });
9267 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9268 }
9269 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9270 symbol->_import = (struct ClassImport *)__extension__ ({
9271 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
9272
9273 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
9274 });
9275 if(classSym)
9276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
9277 }
9278 imported = 1;
9279 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)
9280 dllImport = 1;
9281 }
9282 if(!symbol->type)
9283 {
9284 struct Context * context = SetupTemplatesContext(prop->_class);
9285
9286 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
9287 FinishTemplatesContext(context);
9288 }
9289 if((prop->Get && !symbol->__anon2.__anon2.externalGet) || (prop->Set && !symbol->__anon2.__anon2.externalSet))
9290 {
9291 if(prop->_class->type == 0 && prop->_class->structSize)
9292 instExternal = DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
9293 structExternal = DeclareStruct((((void *)0)), prop->_class->fullName, prop->_class->type != 1, 0);
9294 }
9295 if(prop->Get && !symbol->__anon2.__anon2.externalGet)
9296 {
9297 struct Declaration * decl;
9298 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9299 struct Declarator * d;
9300 struct __ecereNameSpace__ecere__sys__OldList * params;
9301 struct Specifier * spec = (((void *)0));
9302 struct External * external;
9303 struct Declarator * typeDecl;
9304 unsigned int simple = 0;
9305 unsigned int needReference;
9306
9307 specifiers = MkList();
9308 declarators = MkList();
9309 params = MkList();
9310 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9311 d = MkDeclaratorIdentifier(MkIdentifier(getName));
9312 if(dllImport)
9313 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9314 {
9315 struct Context * context = SetupTemplatesContext(prop->_class);
9316
9317 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
9318 FinishTemplatesContext(context);
9319 }
9320 needReference = !typeDecl || typeDecl->type == 1;
9321 for(spec = (*specifiers).first; spec; spec = spec->next)
9322 {
9323 if(spec->type == 1)
9324 {
9325 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9326
9327 if(needReference)
9328 {
9329 symbol->_class = classSym->__anon1.registered;
9330 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
9331 simple = 1;
9332 }
9333 break;
9334 }
9335 }
9336 if(!simple)
9337 d = PlugDeclarator(typeDecl, d);
9338 else
9339 {
9340 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
9341 specifiers = MkList();
9342 }
9343 d = MkDeclaratorFunction(d, params);
9344 if(dllImport)
9345 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9346 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9347 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9348 if(simple)
9349 ListAdd(specifiers, MkSpecifier(VOID));
9350 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9351 decl = MkDeclaration(specifiers, declarators);
9352 external = MkExternalDeclaration(decl);
9353 if(structExternal)
9354 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9355 if(instExternal)
9356 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9357 if(spec)
9358 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9359 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9360 external->symbol = symbol;
9361 symbol->__anon2.__anon2.externalGet = external;
9362 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9363 if(typeDecl)
9364 FreeDeclarator(typeDecl);
9365 }
9366 if(prop->Set && !symbol->__anon2.__anon2.externalSet)
9367 {
9368 struct Declaration * decl;
9369 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9370 struct Declarator * d;
9371 struct __ecereNameSpace__ecere__sys__OldList * params;
9372 struct Specifier * spec = (((void *)0));
9373 struct External * external;
9374 struct Declarator * typeDecl;
9375 unsigned int needReference;
9376
9377 declarators = MkList();
9378 params = MkList();
9379 if(!prop->conversion || prop->_class->type == 1)
9380 {
9381 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9382 }
9383 specifiers = MkList();
9384 {
9385 struct Context * context = SetupTemplatesContext(prop->_class);
9386
9387 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
9388 FinishTemplatesContext(context);
9389 }
9390 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
9391 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
9392 ListAdd(params, MkTypeName(specifiers, d));
9393 d = MkDeclaratorIdentifier(MkIdentifier(setName));
9394 if(dllImport)
9395 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9396 d = MkDeclaratorFunction(d, params);
9397 needReference = !typeDecl || typeDecl->type == 1;
9398 for(spec = (*specifiers).first; spec; spec = spec->next)
9399 {
9400 if(spec->type == 1)
9401 {
9402 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9403
9404 if(needReference)
9405 symbol->_class = classSym->__anon1.registered;
9406 break;
9407 }
9408 }
9409 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9410 specifiers = MkList();
9411 if(dllImport)
9412 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9413 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9414 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9415 if(!prop->conversion || prop->_class->type == 1)
9416 ListAdd(specifiers, MkSpecifier(VOID));
9417 else
9418 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
9419 decl = MkDeclaration(specifiers, declarators);
9420 external = MkExternalDeclaration(decl);
9421 if(structExternal)
9422 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9423 if(instExternal)
9424 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9425 if(spec)
9426 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9427 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9428 external->symbol = symbol;
9429 symbol->__anon2.__anon2.externalSet = external;
9430 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9431 }
9432 if(!symbol->__anon2.__anon2.externalPtr)
9433 {
9434 struct Declaration * decl;
9435 struct External * external;
9436 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
9437 char propName[1024];
9438
9439 if(imported)
9440 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9441 else
9442 {
9443 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9444 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
9445 }
9446 ListAdd(specifiers, MkSpecifierName("Property"));
9447 strcpy(propName, "__ecereProp_");
9448 FullClassNameCat(propName, prop->_class->fullName, 0);
9449 strcat(propName, "_");
9450 FullClassNameCat(propName, prop->name, 1);
9451 {
9452 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
9453
9454 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9455 if(!imported)
9456 {
9457 strcpy(propName, "__ecerePropM_");
9458 FullClassNameCat(propName, prop->_class->fullName, 0);
9459 strcat(propName, "_");
9460 FullClassNameCat(propName, prop->name, 1);
9461 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9462 }
9463 decl = MkDeclaration(specifiers, list);
9464 }
9465 external = MkExternalDeclaration(decl);
9466 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
9467 external->symbol = symbol;
9468 symbol->__anon2.__anon2.externalPtr = external;
9469 }
9470 if(inCompiler && neededBy)
9471 {
9472 if(symbol->__anon2.__anon2.externalPtr)
9473 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalPtr, 0);
9474 if(symbol->__anon2.__anon2.externalGet)
9475 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalGet, symbol->__anon2.__anon2.externalGet->type == 0);
9476 if(symbol->__anon2.__anon2.externalSet)
9477 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalSet, symbol->__anon2.__anon2.externalSet->type == 0);
9478 }
9479 }
9480
9481 static void ProcessDeclarator(struct Declarator *  decl, unsigned int isFunction);
9482
9483 void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char * name)
9484 {
9485 struct Symbol * symbol = method->symbol;
9486
9487 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && (!symbol->__anon2.__anon3.methodCodeExternal || method->type == 1)))
9488 {
9489 unsigned int dllImport = 0;
9490
9491 if(!method->dataType)
9492 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9493 {
9494 if(!symbol || method->type == 1)
9495 {
9496 struct Symbol * classSym;
9497
9498 if(!method->_class->symbol)
9499 method->_class->symbol = FindClass(method->_class->fullName);
9500 classSym = method->_class->symbol;
9501 if(!classSym->_import)
9502 {
9503 struct ModuleImport * module;
9504
9505 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->name)
9506 module = FindModule(method->_class->module);
9507 else
9508 module = mainModule;
9509 classSym->_import = __extension__ ({
9510 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9511
9512 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
9513 });
9514 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9515 }
9516 if(!symbol)
9517 {
9518 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9519 }
9520 if(!symbol->_import)
9521 {
9522 symbol->_import = (struct ClassImport *)__extension__ ({
9523 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
9524
9525 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
9526 });
9527 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
9528 }
9529 if(!symbol)
9530 {
9531 symbol->type = method->dataType;
9532 if(symbol->type)
9533 symbol->type->refCount++;
9534 }
9535 }
9536 if(!method->dataType->dllExport)
9537 {
9538 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)
9539 dllImport = 1;
9540 }
9541 }
9542 if(inCompiler)
9543 {
9544 struct Declaration * decl;
9545 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9546 struct Declarator * d;
9547 struct Declarator * funcDecl;
9548 struct External * external;
9549
9550 specifiers = MkList();
9551 declarators = MkList();
9552 if(dllImport)
9553 ListAdd(specifiers, MkSpecifier(EXTERN));
9554 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
9555 ListAdd(specifiers, MkSpecifier(STATIC));
9556 if(method->type == 1)
9557 {
9558 ListAdd(specifiers, MkSpecifier(INT));
9559 d = MkDeclaratorIdentifier(MkIdentifier(name));
9560 }
9561 else
9562 {
9563 d = MkDeclaratorIdentifier(MkIdentifier(name));
9564 if(dllImport)
9565 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9566 {
9567 struct Context * context = SetupTemplatesContext(method->_class);
9568
9569 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
9570 FinishTemplatesContext(context);
9571 }
9572 funcDecl = GetFuncDecl(d);
9573 if(dllImport)
9574 {
9575 struct Specifier * spec, * next;
9576
9577 for(spec = (*specifiers).first; spec; spec = next)
9578 {
9579 next = spec->next;
9580 if(spec->type == 5)
9581 {
9582 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9583 FreeSpecifier(spec);
9584 }
9585 }
9586 }
9587 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
9588 {
9589 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
9590 {
9591 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
9592 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")));
9593 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
9594 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
9595
9596 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
9597 {
9598 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
9599
9600 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
9601 FreeTypeName(param);
9602 }
9603 if(!funcDecl->__anon1.function.parameters)
9604 funcDecl->__anon1.function.parameters = MkList();
9605 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
9606 }
9607 }
9608 }
9609 ProcessDeclarator(d, 1);
9610 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9611 decl = MkDeclaration(specifiers, declarators);
9612 ReplaceThisClassSpecifiers(specifiers, method->_class);
9613 external = MkExternalDeclaration(decl);
9614 external->symbol = symbol;
9615 symbol->__anon2.__anon1.pointerExternal = external;
9616 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9617 DeclareStruct(external, method->_class->fullName, 1, 1);
9618 if(method->dataType)
9619 DeclareType(external, method->dataType, 1, 1);
9620 }
9621 }
9622 if(inCompiler && neededFor)
9623 {
9624 struct External * external = symbol->__anon2.__anon1.pointerExternal ? symbol->__anon2.__anon1.pointerExternal : symbol->__anon2.__anon3.methodCodeExternal;
9625
9626 __ecereMethod_External_CreateUniqueEdge(neededFor, external, external->type == 0);
9627 }
9628 }
9629
9630 struct __ecereNameSpace__ecere__com__GlobalFunction;
9631
9632 struct __ecereNameSpace__ecere__com__GlobalFunction
9633 {
9634 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
9635 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
9636 const char *  name;
9637 int (*  function)();
9638 struct __ecereNameSpace__ecere__com__Instance * module;
9639 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
9640 const char *  dataTypeString;
9641 struct Type * dataType;
9642 void *  symbol;
9643 } __attribute__ ((gcc_struct));
9644
9645 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
9646
9647 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);
9648
9649 unsigned int DeclareFunction(struct External * neededFor, struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
9650 {
9651 struct Symbol * symbol = function->symbol;
9652
9653 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
9654 {
9655 unsigned int imported = 0;
9656 unsigned int dllImport = 0;
9657
9658 if(!function->dataType)
9659 {
9660 function->dataType = ProcessTypeString(function->dataTypeString, 0);
9661 if(!function->dataType->__anon1.__anon2.thisClass)
9662 function->dataType->__anon1.__anon2.staticMethod = 1;
9663 }
9664 if(inCompiler)
9665 {
9666 if(!symbol)
9667 {
9668 struct ModuleImport * module = FindModule(function->module);
9669
9670 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9671 if(module->name)
9672 {
9673 if(!function->dataType->dllExport)
9674 {
9675 symbol->_import = (struct ClassImport *)__extension__ ({
9676 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
9677
9678 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
9679 });
9680 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
9681 }
9682 }
9683 {
9684 symbol->type = ProcessTypeString(function->dataTypeString, 0);
9685 if(!symbol->type->__anon1.__anon2.thisClass)
9686 symbol->type->__anon1.__anon2.staticMethod = 1;
9687 }
9688 }
9689 imported = symbol->_import ? 1 : 0;
9690 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9691 dllImport = 1;
9692 }
9693 if(inCompiler)
9694 {
9695 {
9696 struct Declaration * decl;
9697 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9698 struct Declarator * d;
9699 struct Declarator * funcDecl;
9700 struct External * external;
9701
9702 specifiers = MkList();
9703 declarators = MkList();
9704 ListAdd(specifiers, MkSpecifier(EXTERN));
9705 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
9706 if(dllImport)
9707 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9708 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
9709 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType == 1)
9710 {
9711 struct Specifier * spec;
9712
9713 for(spec = (*specifiers).first; spec; spec = spec->next)
9714 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
9715 {
9716 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9717 FreeSpecifier(spec);
9718 break;
9719 }
9720 }
9721 funcDecl = GetFuncDecl(d);
9722 if(funcDecl && !funcDecl->__anon1.function.parameters)
9723 {
9724 funcDecl->__anon1.function.parameters = MkList();
9725 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
9726 }
9727 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9728 {
9729 struct Context * oldCtx = curContext;
9730
9731 curContext = globalContext;
9732 decl = MkDeclaration(specifiers, declarators);
9733 curContext = oldCtx;
9734 }
9735 external = MkExternalDeclaration(decl);
9736 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9737 external->symbol = symbol;
9738 symbol->__anon2.__anon1.pointerExternal = external;
9739 DeclareType(external, function->dataType, 1, 1);
9740 }
9741 }
9742 }
9743 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
9744 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
9745 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;
9746 }
9747
9748 void DeclareFunctionUtil(struct External * neededBy, const char * s)
9749 {
9750 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
9751
9752 if(function)
9753 {
9754 char name[1024];
9755
9756 name[0] = (char)0;
9757 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
9758 strcpy(name, "__ecereFunction_");
9759 FullClassNameCat(name, s, 0);
9760 DeclareFunction(neededBy, function, name);
9761 }
9762 else if(neededBy)
9763 FindSymbol(s, globalContext, globalContext, 0, 0);
9764 }
9765
9766 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
9767 {
9768 char propName[1024], propNameM[1024];
9769 char getName[1024], setName[1024];
9770 struct __ecereNameSpace__ecere__sys__OldList * args;
9771
9772 DeclareProperty(curExternal, prop, setName, getName);
9773 strcpy(propName, "__ecereProp_");
9774 FullClassNameCat(propName, prop->_class->fullName, 0);
9775 strcat(propName, "_");
9776 FullClassNameCat(propName, prop->name, 1);
9777 strcpy(propNameM, "__ecerePropM_");
9778 FullClassNameCat(propNameM, prop->_class->fullName, 0);
9779 strcat(propNameM, "_");
9780 FullClassNameCat(propNameM, prop->name, 1);
9781 if(prop->isWatchable)
9782 {
9783 args = MkList();
9784 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9785 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9786 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9787 args = MkList();
9788 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9789 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9790 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9791 DeclareFunctionUtil(curExternal, "eInstance_FireWatchers");
9792 }
9793 {
9794 args = MkList();
9795 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9796 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9797 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9798 args = MkList();
9799 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9800 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9801 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9802 DeclareFunctionUtil(curExternal, "eInstance_FireSelfWatchers");
9803 }
9804 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
9805 curFunction->propSet->fireWatchersDone = 1;
9806 }
9807
9808 struct __ecereNameSpace__ecere__com__SubModule;
9809
9810 struct __ecereNameSpace__ecere__com__SubModule
9811 {
9812 struct __ecereNameSpace__ecere__com__SubModule * prev;
9813 struct __ecereNameSpace__ecere__com__SubModule * next;
9814 struct __ecereNameSpace__ecere__com__Instance * module;
9815 int importMode;
9816 } __attribute__ ((gcc_struct));
9817
9818 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
9819 {
9820 struct __ecereNameSpace__ecere__com__SubModule * subModule;
9821
9822 if(searchFor == searchIn)
9823 return 1;
9824 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
9825 {
9826 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
9827 {
9828 if(ModuleVisibility(subModule->module, searchFor))
9829 return 1;
9830 }
9831 }
9832 return 0;
9833 }
9834
9835 void ProcessExpressionType(struct Expression *  exp);
9836
9837 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
9838 {
9839 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
9840 {
9841 struct Identifier * id = exp->__anon1.__anon1.identifier;
9842 struct Context * ctx;
9843 struct Symbol * symbol = (((void *)0));
9844
9845 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
9846 {
9847 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
9848 {
9849 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
9850 if(symbol)
9851 break;
9852 }
9853 }
9854 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))))
9855 {
9856 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
9857 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9858 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9859 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9860
9861 if(!prop)
9862 {
9863 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
9864 }
9865 if(!prop && !method)
9866 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
9867 if(!prop && !method && !member)
9868 {
9869 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
9870 }
9871 if(prop || method || member || classProp)
9872 {
9873 exp->type = 8;
9874 exp->__anon1.member.member = id;
9875 exp->__anon1.member.memberType = 0;
9876 exp->__anon1.member.exp = QMkExpId("this");
9877 exp->addedThis = 1;
9878 }
9879 else if(_class && _class->templateParams.first)
9880 {
9881 struct __ecereNameSpace__ecere__com__Class * sClass;
9882
9883 for(sClass = _class; sClass; sClass = sClass->base)
9884 {
9885 if(sClass->templateParams.first)
9886 {
9887 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9888
9889 for(param = sClass->templateParams.first; param; param = param->next)
9890 {
9891 if(param->type == 2 && !strcmp(param->name, id->string))
9892 {
9893 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
9894
9895 if(argExp)
9896 {
9897 struct Declarator * decl;
9898 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
9899
9900 FreeIdentifier(exp->__anon1.member.member);
9901 ProcessExpressionType(argExp);
9902 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
9903 exp->expType = ProcessType(specs, decl);
9904 exp->type = 5;
9905 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
9906 }
9907 }
9908 }
9909 }
9910 }
9911 }
9912 }
9913 }
9914 }
9915
9916 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9917 {
9918 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9919
9920 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9921 {
9922 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9923 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9924 else
9925 {
9926 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9927 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9928 struct Type * type;
9929 void * ptr = inst->data + dataMember->offset + offset;
9930 char * result = (((void *)0));
9931
9932 exp->loc = member->loc = inst->loc;
9933 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9934 if(!dataMember->dataType)
9935 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
9936 type = dataMember->dataType;
9937 if(type->kind == 8)
9938 {
9939 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
9940
9941 if(_class->type == 4)
9942 {
9943 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9944
9945 if(enumClass)
9946 {
9947 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9948 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
9949
9950 for(item = e->values.first; item; item = item->next)
9951 {
9952 if(item->data == GetEnumValue(_class, ptr))
9953 {
9954 result = item->name;
9955 break;
9956 }
9957 }
9958 if(result)
9959 {
9960 exp->__anon1.__anon1.identifier = MkIdentifier(result);
9961 exp->type = 0;
9962 exp->destType = MkClassType(_class->fullName);
9963 ProcessExpressionType(exp);
9964 }
9965 }
9966 }
9967 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9968 {
9969 if(!_class->dataType)
9970 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
9971 type = _class->dataType;
9972 }
9973 }
9974 if(!result)
9975 {
9976 switch(type->kind)
9977 {
9978 case 6:
9979 {
9980 FreeExpContents(exp);
9981 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
9982 exp->type = 2;
9983 break;
9984 }
9985 case 7:
9986 {
9987 FreeExpContents(exp);
9988 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
9989 exp->type = 2;
9990 break;
9991 }
9992 case 3:
9993 {
9994 FreeExpContents(exp);
9995 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
9996 exp->type = 2;
9997 break;
9998 }
9999 case 4:
10000 {
10001 FreeExpContents(exp);
10002 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10003 exp->type = 2;
10004 break;
10005 }
10006 case 22:
10007 {
10008 FreeExpContents(exp);
10009 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10010 exp->type = 2;
10011 break;
10012 }
10013 case 23:
10014 {
10015 FreeExpContents(exp);
10016 exp->__anon1.__anon1.constant = PrintInt64((long long)*(ssize_t *)ptr);
10017 exp->type = 2;
10018 break;
10019 }
10020 default:
10021 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10022 }
10023 }
10024 ListAdd(memberList, member);
10025 }
10026 if(parentDataMember->type == 1)
10027 break;
10028 }
10029 }
10030
10031 void CheckTemplateTypes(struct Expression * exp)
10032 {
10033 struct Expression * nbExp = GetNonBracketsExp(exp);
10034
10035 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
10036 {
10037 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10038 struct Context * context;
10039 int kind = exp->expType->kind;
10040
10041 *newExp = *exp;
10042 if(exp->destType)
10043 exp->destType->refCount++;
10044 if(exp->expType)
10045 exp->expType->refCount++;
10046 newExp->prev = (((void *)0));
10047 newExp->next = (((void *)0));
10048 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10049 {
10050 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10051
10052 if(c->type == 2 || c->type == 4 || c->type == 3)
10053 {
10054 if(!c->dataType)
10055 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10056 kind = c->dataType->kind;
10057 }
10058 }
10059 switch(kind)
10060 {
10061 case 7:
10062 if(exp->destType->classObjectType)
10063 {
10064 if(exp->destType)
10065 exp->destType->refCount--;
10066 if(exp->expType)
10067 exp->expType->refCount--;
10068 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10069 }
10070 else
10071 {
10072 struct __ecereNameSpace__ecere__sys__OldList * specs;
10073 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10074 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10075
10076 context = PushContext();
10077 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10078 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10079 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10080 exp->type = 23;
10081 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10082 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10083 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10084 exp->__anon1.compound->__anon1.compound.context = context;
10085 PopContext(context);
10086 }
10087 break;
10088 default:
10089 exp->type = 11;
10090 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10091 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))
10092 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
10093 else
10094 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10095 exp->needCast = 1;
10096 break;
10097 }
10098 }
10099 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10100 {
10101 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10102 struct Context * context;
10103 int kind = exp->expType->kind;
10104
10105 *newExp = *exp;
10106 if(exp->destType)
10107 exp->destType->refCount++;
10108 if(exp->expType)
10109 exp->expType->refCount++;
10110 newExp->prev = (((void *)0));
10111 newExp->next = (((void *)0));
10112 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10113 {
10114 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10115
10116 if(c->type == 2 || c->type == 4 || c->type == 3)
10117 {
10118 if(!c->dataType)
10119 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10120 kind = c->dataType->kind;
10121 }
10122 }
10123 switch(kind)
10124 {
10125 case 7:
10126 if(exp->destType->classObjectType)
10127 {
10128 if(exp->destType)
10129 exp->destType->refCount--;
10130 if(exp->expType)
10131 exp->expType->refCount--;
10132 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10133 }
10134 else
10135 {
10136 struct __ecereNameSpace__ecere__sys__OldList * specs;
10137 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10138 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10139
10140 context = PushContext();
10141 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10142 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10143 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10144 exp->type = 23;
10145 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10146 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10147 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10148 exp->__anon1.compound->__anon1.compound.context = context;
10149 PopContext(context);
10150 }
10151 break;
10152 case 8:
10153 {
10154 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
10155 {
10156 exp->type = 5;
10157 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10158 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)));
10159 ProcessExpressionType((*exp->__anon1.list).first);
10160 break;
10161 }
10162 else
10163 {
10164 exp->type = 5;
10165 if(__ecereProp_Type_Get_isPointerType(exp->expType))
10166 {
10167 exp->needTemplateCast = 2;
10168 newExp->needCast = 1;
10169 newExp->needTemplateCast = 2;
10170 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10171 }
10172 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
10173 exp->needTemplateCast = 2;
10174 newExp->needCast = 1;
10175 newExp->needTemplateCast = 2;
10176 ProcessExpressionType((*exp->__anon1.list).first);
10177 break;
10178 }
10179 }
10180 default:
10181 {
10182 if(exp->expType->kind == 20)
10183 {
10184 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
10185
10186 if(type)
10187 {
10188 FreeType(exp->destType);
10189 FreeType(exp->expType);
10190 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10191 break;
10192 }
10193 }
10194 {
10195 char typeString[1024];
10196 struct Declarator * decl;
10197 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10198
10199 typeString[0] = '\0';
10200 PrintType(exp->expType, typeString, 0, 0);
10201 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10202 exp->type = 11;
10203 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
10204 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10205 exp->__anon1.cast.exp->needCast = 1;
10206 exp->needTemplateCast = 2;
10207 newExp->needTemplateCast = 2;
10208 }
10209 break;
10210 }
10211 }
10212 }
10213 }
10214
10215 static void ProcessInitializer(struct Initializer * init, struct Type * type)
10216 {
10217 switch(init->type)
10218 {
10219 case 0:
10220 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
10221 {
10222 if(init->__anon1.exp && !init->__anon1.exp->destType)
10223 {
10224 FreeType(init->__anon1.exp->destType);
10225 init->__anon1.exp->destType = type;
10226 if(type)
10227 type->refCount++;
10228 }
10229 if(init->__anon1.exp)
10230 {
10231 ProcessExpressionType(init->__anon1.exp);
10232 init->isConstant = init->__anon1.exp->isConstant;
10233 }
10234 break;
10235 }
10236 else
10237 {
10238 struct Expression * exp = init->__anon1.exp;
10239 struct Instantiation * inst = exp->__anon1.instance;
10240 struct MembersInit * members;
10241
10242 init->type = 1;
10243 init->__anon1.list = MkList();
10244 if(inst->members)
10245 {
10246 for(members = (*inst->members).first; members; members = members->next)
10247 {
10248 if(members->type == 0)
10249 {
10250 struct MemberInit * member;
10251
10252 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
10253 {
10254 ListAdd(init->__anon1.list, member->initializer);
10255 member->initializer = (((void *)0));
10256 }
10257 }
10258 }
10259 }
10260 FreeExpression(exp);
10261 }
10262 case 1:
10263 {
10264 struct Initializer * i;
10265 struct Type * initializerType = (((void *)0));
10266 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10267 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10268 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10269 int subMemberStackPos = 0;
10270
10271 if(type && type->kind == 12)
10272 initializerType = Dereference(type);
10273 else if(type && (type->kind == 9 || type->kind == 10))
10274 initializerType = type->__anon1.__anon1.members.first;
10275 for(i = (*init->__anon1.list).first; i; i = i->next)
10276 {
10277 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
10278 {
10279 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10280 if(curMember)
10281 {
10282 if(!curMember->dataType)
10283 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
10284 initializerType = curMember->dataType;
10285 }
10286 }
10287 ProcessInitializer(i, initializerType);
10288 if(initializerType && type && (type->kind == 9 || type->kind == 10))
10289 initializerType = initializerType->next;
10290 if(!i->isConstant)
10291 init->isConstant = 0;
10292 }
10293 if(type && type->kind == 12)
10294 FreeType(initializerType);
10295 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))
10296 {
10297 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
10298 }
10299 break;
10300 }
10301 }
10302 }
10303
10304 void PopulateInstance(struct Instantiation * inst)
10305 {
10306 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
10307 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
10308 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10309 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10310
10311 if(!inst->members)
10312 inst->members = MkListOne(MkMembersInitList(memberList));
10313 else
10314 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10315 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10316 {
10317 if(!dataMember->isProperty)
10318 {
10319 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10320 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10321 else
10322 {
10323 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10324 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10325 struct Type * type;
10326 void * ptr = inst->data + dataMember->offset;
10327 char * result = (((void *)0));
10328
10329 exp->loc = member->loc = inst->loc;
10330 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10331 if(!dataMember->dataType)
10332 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10333 type = dataMember->dataType;
10334 if(type->kind == 8)
10335 {
10336 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
10337
10338 if(_class->type == 4)
10339 {
10340 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10341
10342 if(enumClass)
10343 {
10344 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10345 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
10346
10347 for(item = e->values.first; item; item = item->next)
10348 {
10349 if(item->data == GetEnumValue(_class, ptr))
10350 {
10351 result = item->name;
10352 break;
10353 }
10354 }
10355 }
10356 if(result)
10357 {
10358 exp->__anon1.__anon1.identifier = MkIdentifier(result);
10359 exp->type = 0;
10360 exp->destType = MkClassType(_class->fullName);
10361 ProcessExpressionType(exp);
10362 }
10363 }
10364 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10365 {
10366 if(!_class->dataType)
10367 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
10368 type = _class->dataType;
10369 }
10370 }
10371 if(!result)
10372 {
10373 switch(type->kind)
10374 {
10375 case 6:
10376 {
10377 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10378 exp->type = 2;
10379 break;
10380 }
10381 case 7:
10382 {
10383 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10384 exp->type = 2;
10385 break;
10386 }
10387 case 3:
10388 {
10389 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10390 exp->type = 2;
10391 break;
10392 }
10393 case 4:
10394 {
10395 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10396 exp->type = 2;
10397 break;
10398 }
10399 case 22:
10400 {
10401 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10402 exp->type = 2;
10403 break;
10404 }
10405 default:
10406 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10407 }
10408 }
10409 ListAdd(memberList, member);
10410 }
10411 }
10412 }
10413 }
10414
10415 int ComputeTypeSize(struct Type *  type);
10416
10417 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
10418 {
10419 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10420 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10421
10422 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))
10423 {
10424 int unionMemberOffset = 0;
10425 int bitFields = 0;
10426
10427 if(member)
10428 {
10429 member->memberOffset = 0;
10430 if(targetBits < sizeof(void *) * 8)
10431 member->structAlignment = (short)0;
10432 }
10433 else if(targetBits < sizeof(void *) * 8)
10434 _class->structAlignment = (short)0;
10435 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
10436 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
10437 if(!member && _class->destructionWatchOffset)
10438 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10439 {
10440 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10441
10442 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10443 {
10444 if(!dataMember->isProperty)
10445 {
10446 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
10447 {
10448 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10449 }
10450 }
10451 }
10452 }
10453 {
10454 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10455
10456 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10457 {
10458 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
10459 {
10460 if(!isMember && _class->type == 2 && dataMember->dataType)
10461 {
10462 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10463 uint64 mask = 0;
10464 int d;
10465
10466 ComputeTypeSize(dataMember->dataType);
10467 if(bitMember->pos == -1)
10468 bitMember->pos = _class->memberOffset;
10469 if(!bitMember->size)
10470 bitMember->size = dataMember->dataType->size * 8;
10471 _class->memberOffset = bitMember->pos + bitMember->size;
10472 for(d = 0; d < bitMember->size; d++)
10473 {
10474 if(d)
10475 mask <<= 1;
10476 mask |= 1;
10477 }
10478 bitMember->mask = mask << bitMember->pos;
10479 }
10480 else if(dataMember->type == 0 && dataMember->dataType)
10481 {
10482 int size;
10483 int alignment = 0;
10484
10485 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)))
10486 ComputeTypeSize(dataMember->dataType);
10487 if(dataMember->dataType->bitFieldCount)
10488 {
10489 bitFields += dataMember->dataType->bitFieldCount;
10490 size = 0;
10491 }
10492 else
10493 {
10494 if(bitFields)
10495 {
10496 int size = (bitFields + 7) / 8;
10497
10498 if(isMember)
10499 {
10500 int __simpleStruct0;
10501
10502 if(alignment)
10503 {
10504 short __simpleStruct0;
10505
10506 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10507 if(member->memberOffset % alignment)
10508 member->memberOffset += alignment - (member->memberOffset % alignment);
10509 }
10510 dataMember->offset = member->memberOffset;
10511 if(member->type == 1)
10512 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10513 else
10514 {
10515 member->memberOffset += size;
10516 }
10517 }
10518 else
10519 {
10520 if(alignment)
10521 {
10522 short __simpleStruct0;
10523
10524 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10525 if(_class->memberOffset % alignment)
10526 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10527 }
10528 dataMember->offset = _class->memberOffset;
10529 _class->memberOffset += size;
10530 }
10531 bitFields = 0;
10532 }
10533 size = dataMember->dataType->size;
10534 alignment = dataMember->dataType->alignment;
10535 }
10536 if(isMember)
10537 {
10538 int __simpleStruct0;
10539
10540 if(alignment)
10541 {
10542 short __simpleStruct0;
10543
10544 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10545 if(member->memberOffset % alignment)
10546 member->memberOffset += alignment - (member->memberOffset % alignment);
10547 }
10548 dataMember->offset = member->memberOffset;
10549 if(member->type == 1)
10550 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10551 else
10552 {
10553 member->memberOffset += size;
10554 }
10555 }
10556 else
10557 {
10558 if(alignment)
10559 {
10560 short __simpleStruct0;
10561
10562 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10563 if(_class->memberOffset % alignment)
10564 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10565 }
10566 dataMember->offset = _class->memberOffset;
10567 _class->memberOffset += size;
10568 }
10569 }
10570 else
10571 {
10572 int alignment;
10573
10574 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
10575 alignment = dataMember->structAlignment;
10576 if(isMember)
10577 {
10578 int __simpleStruct0;
10579
10580 if(alignment)
10581 {
10582 short __simpleStruct0;
10583
10584 if(member->memberOffset % alignment)
10585 member->memberOffset += alignment - (member->memberOffset % alignment);
10586 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10587 }
10588 dataMember->offset = member->memberOffset;
10589 if(member->type == 1)
10590 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10591 else
10592 member->memberOffset += dataMember->memberOffset;
10593 }
10594 else
10595 {
10596 if(alignment)
10597 {
10598 short __simpleStruct0;
10599
10600 if(_class->memberOffset % alignment)
10601 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10602 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10603 }
10604 dataMember->offset = _class->memberOffset;
10605 _class->memberOffset += dataMember->memberOffset;
10606 }
10607 }
10608 }
10609 }
10610 if(bitFields)
10611 {
10612 int alignment = 0;
10613 int size = (bitFields + 7) / 8;
10614
10615 if(isMember)
10616 {
10617 int __simpleStruct0;
10618
10619 if(alignment)
10620 {
10621 short __simpleStruct0;
10622
10623 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10624 if(member->memberOffset % alignment)
10625 member->memberOffset += alignment - (member->memberOffset % alignment);
10626 }
10627 if(member->type == 1)
10628 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10629 else
10630 {
10631 member->memberOffset += size;
10632 }
10633 }
10634 else
10635 {
10636 if(alignment)
10637 {
10638 short __simpleStruct0;
10639
10640 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10641 if(_class->memberOffset % alignment)
10642 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10643 }
10644 _class->memberOffset += size;
10645 }
10646 bitFields = 0;
10647 }
10648 }
10649 if(member && member->type == 1)
10650 {
10651 member->memberOffset = unionMemberOffset;
10652 }
10653 if(!isMember)
10654 {
10655 if(_class->type != 2)
10656 {
10657 int extra = 0;
10658
10659 if(_class->structAlignment)
10660 {
10661 if(_class->memberOffset % _class->structAlignment)
10662 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
10663 }
10664 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
10665 if(!member)
10666 {
10667 struct __ecereNameSpace__ecere__com__Property * prop;
10668
10669 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
10670 {
10671 if(prop->isProperty && prop->isWatchable)
10672 {
10673 prop->watcherOffset = _class->structSize;
10674 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10675 }
10676 }
10677 }
10678 {
10679 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
10680
10681 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
10682 {
10683 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
10684
10685 if(deriv->computeSize)
10686 {
10687 deriv->offset = _class->structSize;
10688 deriv->memberOffset = 0;
10689 deriv->structSize = deriv->offset;
10690 ComputeClassMembers(deriv, 0);
10691 }
10692 }
10693 }
10694 }
10695 }
10696 }
10697 if(context)
10698 FinishTemplatesContext(context);
10699 }
10700
10701 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)
10702 {
10703 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10704 unsigned int totalSize = 0;
10705 unsigned int maxSize = 0;
10706 int alignment;
10707 unsigned int size;
10708 struct __ecereNameSpace__ecere__com__DataMember * member;
10709 int anonID = 1;
10710 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10711
10712 if(addedPadding)
10713 *addedPadding = 0;
10714 if(!isMember && _class->base)
10715 {
10716 maxSize = _class->structSize;
10717 {
10718 if(_class->type == 1 || _class->type == 5)
10719 AddMembers(neededBy, declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
10720 else
10721 {
10722 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
10723
10724 if(maxSize > baseSize)
10725 maxSize -= baseSize;
10726 else
10727 maxSize = 0;
10728 }
10729 }
10730 }
10731 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
10732 {
10733 if(!member->isProperty)
10734 {
10735 switch(member->type)
10736 {
10737 case 0:
10738 {
10739 if(member->dataTypeString)
10740 {
10741 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
10742 struct Declarator * decl;
10743
10744 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
10745 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
10746 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
10747 if(!member->dataType)
10748 member->dataType = ProcessType(specs, decl);
10749 ReplaceThisClassSpecifiers(specs, topClass);
10750 {
10751 struct Type * type = ProcessType(specs, decl);
10752
10753 DeclareType(neededBy, member->dataType, 1, 0);
10754 FreeType(type);
10755 }
10756 ComputeTypeSize(member->dataType);
10757 size = member->dataType->size;
10758 alignment = member->dataType->alignment;
10759 if(alignment)
10760 {
10761 if(totalSize % alignment)
10762 totalSize += alignment - (totalSize % alignment);
10763 }
10764 totalSize += size;
10765 }
10766 break;
10767 }
10768 case 1:
10769 case 2:
10770 {
10771 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
10772 char id[100];
10773
10774 sprintf(id, "__anon%d", anonID++);
10775 size = 0;
10776 AddMembers(neededBy, list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
10777 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
10778 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
10779 alignment = member->structAlignment;
10780 if(alignment)
10781 {
10782 if(totalSize % alignment)
10783 totalSize += alignment - (totalSize % alignment);
10784 }
10785 totalSize += size;
10786 break;
10787 }
10788 }
10789 }
10790 }
10791 if(retSize)
10792 {
10793 unsigned int __simpleStruct0;
10794
10795 if(topMember && topMember->type == 1)
10796 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
10797 else
10798 *retSize += totalSize;
10799 }
10800 else if(totalSize < maxSize && _class->type != 1000)
10801 {
10802 int autoPadding = 0;
10803
10804 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
10805 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
10806 if(totalSize + autoPadding < maxSize)
10807 {
10808 char sizeString[50];
10809
10810 sprintf(sizeString, "%d", maxSize - totalSize);
10811 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
10812 if(addedPadding)
10813 *addedPadding = 1;
10814 }
10815 }
10816 if(context)
10817 FinishTemplatesContext(context);
10818 return topMember ? topMember->memberID : _class->memberID;
10819 }
10820
10821 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)
10822 {
10823 if(source && dest)
10824 {
10825 if(warnConst)
10826 CheckConstCompatibility(source, dest, 1);
10827 if(source->kind == 20 && dest->kind != 20)
10828 {
10829 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
10830
10831 if(type)
10832 source = type;
10833 }
10834 if(dest->kind == 20 && source->kind != 20)
10835 {
10836 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
10837
10838 if(type)
10839 dest = type;
10840 }
10841 if(dest->classObjectType == 2 && dest->kind != 11)
10842 {
10843 if(source->classObjectType != 3)
10844 return 1;
10845 else
10846 {
10847 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
10848 {
10849 return 1;
10850 }
10851 }
10852 }
10853 else
10854 {
10855 if(source->kind != 11 && source->classObjectType == 3)
10856 return 1;
10857 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
10858 return 1;
10859 }
10860 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
10861 {
10862 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))
10863 return 1;
10864 }
10865 if(dest->kind == 14 && source->kind != 0)
10866 return 1;
10867 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))
10868 return 1;
10869 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))
10870 return 1;
10871 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
10872 {
10873 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
10874 {
10875 if(conversions != (((void *)0)))
10876 {
10877 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
10878 return 1;
10879 }
10880 else
10881 {
10882 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
10883
10884 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
10885 ;
10886 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
10887 ;
10888 if(sourceBase == destBase)
10889 return 1;
10890 }
10891 }
10892 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))
10893 return 1;
10894 else
10895 {
10896 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))
10897 {
10898 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
10899 {
10900 return 1;
10901 }
10902 }
10903 }
10904 }
10905 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
10906 return 1;
10907 if(doConversion)
10908 {
10909 if(source->kind == 8)
10910 {
10911 struct __ecereNameSpace__ecere__com__Class * _class;
10912
10913 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10914 {
10915 struct __ecereNameSpace__ecere__com__Property * convert;
10916
10917 for(convert = _class->conversions.first; convert; convert = convert->next)
10918 {
10919 if(convert->memberAccess == 1 || _class->module == privateModule)
10920 {
10921 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10922
10923 if(!convert->dataType)
10924 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10925 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))
10926 {
10927 if(!conversions && !convert->Get)
10928 return 1;
10929 else if(conversions != (((void *)0)))
10930 {
10931 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))
10932 return 1;
10933 else
10934 {
10935 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10936
10937 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10938 return 1;
10939 }
10940 }
10941 }
10942 }
10943 }
10944 }
10945 }
10946 if(dest->kind == 8)
10947 {
10948 struct __ecereNameSpace__ecere__com__Class * _class;
10949
10950 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10951 {
10952 struct __ecereNameSpace__ecere__com__Property * convert;
10953
10954 for(convert = _class->conversions.first; convert; convert = convert->next)
10955 {
10956 if(convert->memberAccess == 1 || _class->module == privateModule)
10957 {
10958 struct Type * constType = (((void *)0));
10959 unsigned int success = 0;
10960
10961 if(!convert->dataType)
10962 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10963 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
10964 {
10965 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10966
10967 constType = __extension__ ({
10968 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10969
10970 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
10971 });
10972 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
10973 ptrType->constant = 1;
10974 }
10975 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
10976 {
10977 if(!conversions && !convert->Set)
10978 success = 1;
10979 else if(conversions != (((void *)0)))
10980 {
10981 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))
10982 success = 1;
10983 else
10984 {
10985 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
10986
10987 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
10988 success = 1;
10989 }
10990 }
10991 }
10992 if(constType)
10993 FreeType(constType);
10994 if(success)
10995 return 1;
10996 }
10997 }
10998 }
10999 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
11000 {
11001 if(!dest->__anon1._class->__anon1.registered->dataType)
11002 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
11003 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
11004 {
11005 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))
11006 {
11007 return 1;
11008 }
11009 }
11010 }
11011 }
11012 if(source->kind == 8)
11013 {
11014 struct __ecereNameSpace__ecere__com__Class * _class;
11015
11016 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
11017 {
11018 struct __ecereNameSpace__ecere__com__Property * convert;
11019
11020 for(convert = _class->conversions.first; convert; convert = convert->next)
11021 {
11022 if(convert->memberAccess == 1 || _class->module == privateModule)
11023 {
11024 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
11025
11026 if(!convert->dataType)
11027 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
11028 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))
11029 {
11030 if(!conversions && !convert->Get)
11031 return 1;
11032 else if(conversions != (((void *)0)))
11033 {
11034 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))
11035 return 1;
11036 else
11037 {
11038 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
11039
11040 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
11041 return 1;
11042 }
11043 }
11044 }
11045 }
11046 }
11047 }
11048 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
11049 {
11050 if(!source->__anon1._class->__anon1.registered->dataType)
11051 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
11052 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
11053 {
11054 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))
11055 return 1;
11056 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
11057 return 1;
11058 }
11059 }
11060 }
11061 }
11062 if(source->kind == 8 || source->kind == 19)
11063 ;
11064 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
11065 return 1;
11066 else if(dest->kind == 7 && source->kind == 6)
11067 return 1;
11068 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
11069 return 1;
11070 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
11071 return 1;
11072 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
11073 return 1;
11074 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
11075 return 1;
11076 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
11077 return 1;
11078 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))
11079 return 1;
11080 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))
11081 return 1;
11082 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)))
11083 {
11084 struct Type * paramSource, * paramDest;
11085
11086 if(dest->kind == 16)
11087 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
11088 if(source->kind == 16)
11089 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
11090 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
11091 dest = dest->__anon1.type;
11092 if(source->kind == 13 && source->__anon1.type->kind == 11)
11093 source = source->__anon1.type;
11094 if(dest->kind == 16)
11095 dest = dest->__anon1.__anon3.method->dataType;
11096 if(source->kind == 16)
11097 source = source->__anon1.__anon3.method->dataType;
11098 paramSource = source->__anon1.__anon2.params.first;
11099 if(paramSource && paramSource->kind == 0)
11100 paramSource = (((void *)0));
11101 paramDest = dest->__anon1.__anon2.params.first;
11102 if(paramDest && paramDest->kind == 0)
11103 paramDest = (((void *)0));
11104 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11105 {
11106 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))))
11107 {
11108 if(paramDest && paramDest->kind == 8)
11109 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
11110 else
11111 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
11112 return 0;
11113 }
11114 paramDest = paramDest->next;
11115 }
11116 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
11117 {
11118 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11119 {
11120 if(dest->__anon1.__anon2.thisClass)
11121 {
11122 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
11123 {
11124 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11125 return 0;
11126 }
11127 }
11128 else
11129 {
11130 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
11131 {
11132 if(owningClassDest)
11133 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
11134 else
11135 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
11136 return 0;
11137 }
11138 }
11139 paramSource = paramSource->next;
11140 }
11141 else
11142 {
11143 if(dest->__anon1.__anon2.thisClass)
11144 {
11145 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
11146 {
11147 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11148 return 0;
11149 }
11150 }
11151 else
11152 {
11153 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
11154 {
11155 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
11156 return 0;
11157 }
11158 }
11159 }
11160 }
11161 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
11162 {
11163 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
11164 return 0;
11165 }
11166 else
11167 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
11168 for(; paramDest; paramDest = paramDest->next)
11169 {
11170 if(!paramSource)
11171 {
11172 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
11173 return 0;
11174 }
11175 {
11176 struct Type * paramDestType = paramDest;
11177 struct Type * paramSourceType = paramSource;
11178 struct Type * type = paramDestType;
11179
11180 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
11181 {
11182 int id = 0;
11183 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
11184 struct __ecereNameSpace__ecere__com__Class * sClass;
11185
11186 for(sClass = owningClassSource; sClass; sClass = sClass->base)
11187 {
11188 id = 0;
11189 if(sClass->templateClass)
11190 sClass = sClass->templateClass;
11191 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
11192 {
11193 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
11194 {
11195 for(sClass = sClass->base; sClass; sClass = sClass->base)
11196 {
11197 if(sClass->templateClass)
11198 sClass = sClass->templateClass;
11199 id += sClass->templateParams.count;
11200 }
11201 break;
11202 }
11203 id++;
11204 }
11205 if(curParam)
11206 break;
11207 }
11208 if(curParam)
11209 {
11210 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
11211
11212 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
11213 }
11214 }
11215 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)))
11216 {
11217 char type[1024];
11218
11219 type[0] = (char)0;
11220 PrintType(paramDest, type, 0, 1);
11221 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
11222 if(paramDestType != paramDest)
11223 FreeType(paramDestType);
11224 return 0;
11225 }
11226 if(paramDestType != paramDest)
11227 FreeType(paramDestType);
11228 }
11229 paramSource = paramSource->next;
11230 }
11231 if(paramSource)
11232 {
11233 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
11234 return 0;
11235 }
11236 return 1;
11237 }
11238 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
11239 {
11240 return 1;
11241 }
11242 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
11243 {
11244 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))
11245 {
11246 ComputeTypeSize(source->__anon1.type);
11247 ComputeTypeSize(dest->__anon1.type);
11248 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))
11249 return 1;
11250 }
11251 }
11252 }
11253 return 0;
11254 }
11255
11256 void ComputeInstantiation(struct Expression * exp)
11257 {
11258 struct Instantiation * inst = exp->__anon1.instance;
11259 struct MembersInit * members;
11260 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11261 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11262 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11263 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11264 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11265 int subMemberStackPos = 0;
11266 uint64 bits = 0;
11267
11268 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11269 {
11270 if(inst->data)
11271 return ;
11272 if(_class->type == 0 || _class->type == 5)
11273 {
11274 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11275 if(_class->type == 0)
11276 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11277 }
11278 else
11279 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11280 }
11281 if(inst->members)
11282 {
11283 for(members = (*inst->members).first; members; members = members->next)
11284 {
11285 switch(members->type)
11286 {
11287 case 0:
11288 {
11289 if(members->__anon1.dataMembers)
11290 {
11291 struct MemberInit * member;
11292
11293 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11294 {
11295 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11296 unsigned int found = 0;
11297 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11298 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11299 unsigned int dataMemberOffset;
11300
11301 if(!ident)
11302 {
11303 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11304 if(curMember)
11305 {
11306 if(curMember->isProperty)
11307 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11308 else
11309 {
11310 dataMember = curMember;
11311 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11312 if(_class->type == 0)
11313 dataMemberOffset += _class->base->structSize;
11314 }
11315 found = 1;
11316 }
11317 }
11318 else
11319 {
11320 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11321 if(prop)
11322 {
11323 found = 1;
11324 if(prop->memberAccess == 1)
11325 {
11326 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11327 curClass = prop->_class;
11328 }
11329 }
11330 else
11331 {
11332 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11333 int _subMemberStackPos = 0;
11334
11335 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11336 if(dataMember)
11337 {
11338 found = 1;
11339 if(dataMember->memberAccess == 1)
11340 {
11341 curMember = dataMember;
11342 curClass = dataMember->_class;
11343 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11344 subMemberStackPos = _subMemberStackPos;
11345 }
11346 }
11347 }
11348 }
11349 if(found && member->initializer && member->initializer->type == 0)
11350 {
11351 struct Expression * value = member->initializer->__anon1.exp;
11352 struct Type * type = (((void *)0));
11353 unsigned int deepMember = 0;
11354
11355 if(prop)
11356 {
11357 type = prop->dataType;
11358 }
11359 else if(dataMember)
11360 {
11361 if(!dataMember->dataType)
11362 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11363 type = dataMember->dataType;
11364 }
11365 if(ident && ident->next)
11366 {
11367 deepMember = 1;
11368 for(ident = ident->next; ident && type; ident = ident->next)
11369 {
11370 if(type->kind == 8)
11371 {
11372 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11373 if(prop)
11374 type = prop->dataType;
11375 else
11376 {
11377 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11378 if(dataMember)
11379 type = dataMember->dataType;
11380 }
11381 }
11382 else if(type->kind == 9 || type->kind == 10)
11383 {
11384 struct Type * memberType;
11385
11386 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11387 {
11388 if(!strcmp(memberType->name, ident->string))
11389 {
11390 type = memberType;
11391 break;
11392 }
11393 }
11394 }
11395 }
11396 }
11397 if(value)
11398 {
11399 FreeType(value->destType);
11400 value->destType = type;
11401 if(type)
11402 type->refCount++;
11403 ComputeExpression(value);
11404 }
11405 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11406 {
11407 if(type->kind == 8)
11408 {
11409 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11410
11411 if(_class && (_class->type == 2 || _class->type == 3 || _class->type == 4))
11412 {
11413 if(!_class->dataType)
11414 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11415 type = _class->dataType;
11416 }
11417 }
11418 if(dataMember)
11419 {
11420 void * ptr = inst->data + dataMemberOffset;
11421
11422 if(value->type == 2)
11423 {
11424 switch(type->kind)
11425 {
11426 case 3:
11427 {
11428 GetInt(value, (int *)ptr);
11429 break;
11430 }
11431 case 4:
11432 {
11433 GetInt64(value, (long long *)ptr);
11434 break;
11435 }
11436 case 22:
11437 {
11438 GetIntPtr(value, (intptr_t *)ptr);
11439 break;
11440 }
11441 case 23:
11442 {
11443 GetIntSize(value, (ssize_t *)ptr);
11444 break;
11445 }
11446 case 6:
11447 {
11448 GetFloat(value, (float *)ptr);
11449 break;
11450 }
11451 case 7:
11452 {
11453 GetDouble(value, (double *)ptr);
11454 break;
11455 }
11456 }
11457 }
11458 else if(value->type == 1)
11459 {
11460 if(type->kind == 8)
11461 {
11462 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11463
11464 if(_class->type == 1)
11465 {
11466 ComputeTypeSize(type);
11467 if(value->__anon1.instance->data)
11468 memcpy(ptr, value->__anon1.instance->data, type->size);
11469 }
11470 }
11471 }
11472 }
11473 else if(prop && prop->Set != (void *)(intptr_t)1)
11474 {
11475 if(value->type == 1 && value->__anon1.instance->data)
11476 {
11477 if(type->kind == 8)
11478 {
11479 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11480
11481 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)))
11482 {
11483 void (* Set)(void *, void *) = (void *)prop->Set;
11484
11485 Set(inst->data, value->__anon1.instance->data);
11486 PopulateInstance(inst);
11487 }
11488 }
11489 }
11490 else if(value->type == 2)
11491 {
11492 switch(type->kind)
11493 {
11494 case 7:
11495 {
11496 void (* Set)(void *, double) = (void *)prop->Set;
11497
11498 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11499 break;
11500 }
11501 case 6:
11502 {
11503 void (* Set)(void *, float) = (void *)prop->Set;
11504
11505 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11506 break;
11507 }
11508 case 3:
11509 {
11510 void (* Set)(void *, int) = (void *)prop->Set;
11511
11512 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11513 break;
11514 }
11515 case 4:
11516 {
11517 void (* Set)(void *, long long) = (void *)prop->Set;
11518
11519 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11520 break;
11521 }
11522 case 22:
11523 {
11524 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11525
11526 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11527 break;
11528 }
11529 case 23:
11530 {
11531 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11532
11533 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11534 break;
11535 }
11536 }
11537 }
11538 else if(value->type == 3)
11539 {
11540 char temp[1024];
11541
11542 ReadString(temp, value->__anon1.__anon2.string);
11543 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11544 }
11545 }
11546 }
11547 else if(!deepMember && type && _class->type == 3)
11548 {
11549 if(prop)
11550 {
11551 if(value->type == 2)
11552 {
11553 if(type->kind == 8)
11554 {
11555 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11556
11557 if(_class->type == 3)
11558 {
11559 if(!_class->dataType)
11560 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11561 type = _class->dataType;
11562 }
11563 }
11564 switch(type->kind)
11565 {
11566 case 6:
11567 {
11568 float fValue;
11569 float (* Set)(float) = (void *)prop->Set;
11570
11571 GetFloat(member->initializer->__anon1.exp, &fValue);
11572 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11573 exp->type = 2;
11574 break;
11575 }
11576 case 7:
11577 {
11578 double dValue;
11579 double (* Set)(double) = (void *)prop->Set;
11580
11581 GetDouble(member->initializer->__anon1.exp, &dValue);
11582 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11583 exp->type = 2;
11584 break;
11585 }
11586 }
11587 }
11588 }
11589 }
11590 else if(!deepMember && type && _class->type == 2)
11591 {
11592 if(prop)
11593 {
11594 if(value->type == 1 && value->__anon1.instance->data)
11595 {
11596 unsigned int (* Set)(void *) = (void *)prop->Set;
11597
11598 bits = Set(value->__anon1.instance->data);
11599 }
11600 else if(value->type == 2)
11601 {
11602 }
11603 }
11604 else if(dataMember)
11605 {
11606 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11607 struct Type * type;
11608 uint64 part = 0;
11609
11610 bits = (bits & ~bitMember->mask);
11611 if(!bitMember->dataType)
11612 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11613 type = bitMember->dataType;
11614 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11615 {
11616 if(!type->__anon1._class->__anon1.registered->dataType)
11617 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11618 type = type->__anon1._class->__anon1.registered->dataType;
11619 }
11620 switch(type->kind)
11621 {
11622 case 24:
11623 case 1:
11624 {
11625 unsigned char v;
11626
11627 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11628 part = (uint64)v;
11629 break;
11630 }
11631 case 2:
11632 {
11633 unsigned short v;
11634
11635 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11636 part = (uint64)v;
11637 break;
11638 }
11639 case 3:
11640 case 5:
11641 {
11642 unsigned int v;
11643
11644 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11645 part = (uint64)v;
11646 break;
11647 }
11648 case 4:
11649 {
11650 uint64 v;
11651
11652 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11653 part = v;
11654 break;
11655 }
11656 case 22:
11657 {
11658 uintptr_t v;
11659
11660 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11661 part = (uint64)v;
11662 break;
11663 }
11664 case 23:
11665 {
11666 size_t v;
11667
11668 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11669 part = (uint64)v;
11670 break;
11671 }
11672 }
11673 bits |= part << bitMember->pos;
11674 }
11675 }
11676 }
11677 else
11678 {
11679 if(_class && _class->type == 3)
11680 {
11681 ComputeExpression(member->initializer->__anon1.exp);
11682 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11683 exp->type = 2;
11684 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11685 }
11686 }
11687 }
11688 }
11689 break;
11690 }
11691 }
11692 }
11693 }
11694 if(_class && _class->type == 2)
11695 {
11696 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11697 exp->type = 2;
11698 }
11699 if(exp->type != 1)
11700 {
11701 FreeInstance(inst);
11702 }
11703 }
11704
11705 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11706 {
11707 if(exp->__anon1.op.op == SIZEOF)
11708 {
11709 FreeExpContents(exp);
11710 exp->type = 2;
11711 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11712 }
11713 else
11714 {
11715 if(!exp->__anon1.op.exp1)
11716 {
11717 switch(exp->__anon1.op.op)
11718 {
11719 case '+':
11720 {
11721 struct Expression * exp2 = exp->__anon1.op.exp2;
11722
11723 exp->__anon1.op.exp2 = (((void *)0));
11724 FreeExpContents(exp);
11725 FreeType(exp->expType);
11726 FreeType(exp->destType);
11727 *exp = *exp2;
11728 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11729 break;
11730 }
11731 case '-':
11732 if(op1->ops.Neg)
11733 {
11734 FreeExpContents(exp);
11735 op1->ops.Neg(exp, op1);
11736 }
11737 break;
11738 case '~':
11739 if(op1->ops.BitNot)
11740 {
11741 FreeExpContents(exp);
11742 op1->ops.BitNot(exp, op1);
11743 }
11744 break;
11745 case '!':
11746 if(op1->ops.Not)
11747 {
11748 FreeExpContents(exp);
11749 op1->ops.Not(exp, op1);
11750 }
11751 break;
11752 }
11753 }
11754 else
11755 {
11756 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11757 {
11758 if(Promote(op2, op1->kind, op1->type->isSigned))
11759 op2->kind = op1->kind, op2->ops = op1->ops;
11760 else if(Promote(op1, op2->kind, op2->type->isSigned))
11761 op1->kind = op2->kind, op1->ops = op2->ops;
11762 }
11763 switch(exp->__anon1.op.op)
11764 {
11765 case '+':
11766 if(op1->ops.Add)
11767 {
11768 FreeExpContents(exp);
11769 op1->ops.Add(exp, op1, op2);
11770 }
11771 break;
11772 case '-':
11773 if(op1->ops.Sub)
11774 {
11775 FreeExpContents(exp);
11776 op1->ops.Sub(exp, op1, op2);
11777 }
11778 break;
11779 case '*':
11780 if(op1->ops.Mul)
11781 {
11782 FreeExpContents(exp);
11783 op1->ops.Mul(exp, op1, op2);
11784 }
11785 break;
11786 case '/':
11787 if(op1->ops.Div)
11788 {
11789 FreeExpContents(exp);
11790 op1->ops.Div(exp, op1, op2);
11791 }
11792 break;
11793 case '%':
11794 if(op1->ops.Mod)
11795 {
11796 FreeExpContents(exp);
11797 op1->ops.Mod(exp, op1, op2);
11798 }
11799 break;
11800 case '&':
11801 if(exp->__anon1.op.exp2)
11802 {
11803 if(op1->ops.BitAnd)
11804 {
11805 FreeExpContents(exp);
11806 op1->ops.BitAnd(exp, op1, op2);
11807 }
11808 }
11809 break;
11810 case '|':
11811 if(op1->ops.BitOr)
11812 {
11813 FreeExpContents(exp);
11814 op1->ops.BitOr(exp, op1, op2);
11815 }
11816 break;
11817 case '^':
11818 if(op1->ops.BitXor)
11819 {
11820 FreeExpContents(exp);
11821 op1->ops.BitXor(exp, op1, op2);
11822 }
11823 break;
11824 case LEFT_OP:
11825 if(op1->ops.LShift)
11826 {
11827 FreeExpContents(exp);
11828 op1->ops.LShift(exp, op1, op2);
11829 }
11830 break;
11831 case RIGHT_OP:
11832 if(op1->ops.RShift)
11833 {
11834 FreeExpContents(exp);
11835 op1->ops.RShift(exp, op1, op2);
11836 }
11837 break;
11838 case EQ_OP:
11839 if(op1->ops.Equ)
11840 {
11841 FreeExpContents(exp);
11842 op1->ops.Equ(exp, op1, op2);
11843 }
11844 break;
11845 case NE_OP:
11846 if(op1->ops.Nqu)
11847 {
11848 FreeExpContents(exp);
11849 op1->ops.Nqu(exp, op1, op2);
11850 }
11851 break;
11852 case AND_OP:
11853 if(op1->ops.And)
11854 {
11855 FreeExpContents(exp);
11856 op1->ops.And(exp, op1, op2);
11857 }
11858 break;
11859 case OR_OP:
11860 if(op1->ops.Or)
11861 {
11862 FreeExpContents(exp);
11863 op1->ops.Or(exp, op1, op2);
11864 }
11865 break;
11866 case '>':
11867 if(op1->ops.Grt)
11868 {
11869 FreeExpContents(exp);
11870 op1->ops.Grt(exp, op1, op2);
11871 }
11872 break;
11873 case '<':
11874 if(op1->ops.Sma)
11875 {
11876 FreeExpContents(exp);
11877 op1->ops.Sma(exp, op1, op2);
11878 }
11879 break;
11880 case GE_OP:
11881 if(op1->ops.GrtEqu)
11882 {
11883 FreeExpContents(exp);
11884 op1->ops.GrtEqu(exp, op1, op2);
11885 }
11886 break;
11887 case LE_OP:
11888 if(op1->ops.SmaEqu)
11889 {
11890 FreeExpContents(exp);
11891 op1->ops.SmaEqu(exp, op1, op2);
11892 }
11893 break;
11894 }
11895 }
11896 }
11897 }
11898
11899 void ApplyAnyObjectLogic(struct Expression * e)
11900 {
11901 struct Type * destType = e->destType;
11902
11903 if(destType && (destType->classObjectType == 3))
11904 {
11905 if(e && e->expType)
11906 {
11907 struct Type * type = e->expType;
11908 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11909
11910 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11911 {
11912 _class = type->__anon1._class->__anon1.registered;
11913 }
11914 else if(type->kind == 19)
11915 {
11916 _class = FindClass("ecere::com::Class")->__anon1.registered;
11917 }
11918 else
11919 {
11920 char string[1024] = "";
11921 struct Symbol * classSym;
11922
11923 PrintTypeNoConst(type, string, 0, 1);
11924 classSym = FindClass(string);
11925 if(classSym)
11926 _class = classSym->__anon1.registered;
11927 }
11928 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)))
11929 {
11930 if(!_class || strcmp(_class->fullName, "char *"))
11931 {
11932 struct Expression * checkedExp = e, * newExp;
11933
11934 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11935 {
11936 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11937 {
11938 if(checkedExp->type == 23)
11939 {
11940 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11941 }
11942 else
11943 checkedExp = (*checkedExp->__anon1.list).last;
11944 }
11945 else if(checkedExp->type == 11)
11946 checkedExp = checkedExp->__anon1.cast.exp;
11947 }
11948 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
11949 {
11950 newExp = checkedExp->__anon1.op.exp2;
11951 checkedExp->__anon1.op.exp2 = (((void *)0));
11952 FreeExpContents(checkedExp);
11953 if(e->expType && e->expType->passAsTemplate)
11954 {
11955 char size[100];
11956
11957 ComputeTypeSize(e->expType);
11958 sprintf(size, "%d", e->expType->size);
11959 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))))));
11960 }
11961 ReplaceExpContents(checkedExp, newExp);
11962 e->byReference = 1;
11963 }
11964 else if(!e->byReference || (_class && _class->type == 5))
11965 {
11966 struct Expression * checkedExp;
11967
11968 {
11969 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;
11970
11971 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11972 {
11973 struct Context * context = PushContext();
11974 struct Declarator * decl;
11975 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11976 char typeString[1024];
11977 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11978
11979 typeString[0] = '\0';
11980 *newExp = *e;
11981 newExp->prev = (((void *)0));
11982 newExp->next = (((void *)0));
11983 newExp->expType = (((void *)0));
11984 PrintTypeNoConst(e->expType, typeString, 0, 1);
11985 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11986 newExp->destType = ProcessType(specs, decl);
11987 curContext = context;
11988 if(curCompound)
11989 {
11990 char name[100];
11991 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11992
11993 e->type = 23;
11994 sprintf(name, "__internalValue%03X", internalValueCounter++);
11995 if(!curCompound->__anon1.compound.declarations)
11996 curCompound->__anon1.compound.declarations = MkList();
11997 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11998 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11999 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12000 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
12001 }
12002 else
12003 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12004 {
12005 struct Type * type = e->destType;
12006
12007 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12008 CopyTypeInto(e->destType, type);
12009 e->destType->refCount = 1;
12010 e->destType->classObjectType = 0;
12011 FreeType(type);
12012 }
12013 e->__anon1.compound->__anon1.compound.context = context;
12014 PopContext(context);
12015 curContext = context->parent;
12016 }
12017 }
12018 checkedExp = e;
12019 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
12020 {
12021 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
12022 {
12023 if(checkedExp->type == 23)
12024 {
12025 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12026 }
12027 else
12028 checkedExp = (*checkedExp->__anon1.list).last;
12029 }
12030 else if(checkedExp->type == 11)
12031 checkedExp = checkedExp->__anon1.cast.exp;
12032 }
12033 {
12034 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12035
12036 *operand = *checkedExp;
12037 __ecereMethod_Expression_Clear(checkedExp);
12038 checkedExp->destType = ProcessTypeString("void *", 0);
12039 checkedExp->expType = checkedExp->destType;
12040 checkedExp->destType->refCount++;
12041 checkedExp->type = 4;
12042 checkedExp->__anon1.op.op = '&';
12043 checkedExp->__anon1.op.exp1 = (((void *)0));
12044 checkedExp->__anon1.op.exp2 = operand;
12045 }
12046 }
12047 }
12048 }
12049 }
12050 }
12051 {
12052 }
12053 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))))
12054 {
12055 if(e->expType->classObjectType && destType && destType->classObjectType)
12056 {
12057 return ;
12058 }
12059 else
12060 {
12061 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12062
12063 *thisExp = *e;
12064 thisExp->prev = (((void *)0));
12065 thisExp->next = (((void *)0));
12066 __ecereMethod_Expression_Clear(e);
12067 e->type = 5;
12068 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12069 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
12070 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
12071 {
12072 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12073 CopyTypeInto(e->expType, thisExp->expType);
12074 e->expType->byReference = 0;
12075 e->expType->refCount = 1;
12076 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))
12077 {
12078 e->expType->classObjectType = 0;
12079 }
12080 }
12081 }
12082 }
12083 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12084 {
12085 if(destType->kind == 14)
12086 {
12087 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
12088 }
12089 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))
12090 {
12091 unsigned int byReference = e->expType->byReference;
12092 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12093 struct Declarator * decl;
12094 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12095 char typeString[1024];
12096 struct Type * type;
12097 int backupClassObjectType;
12098 unsigned int backupByReference;
12099
12100 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
12101 type = e->expType;
12102 else
12103 type = destType;
12104 backupClassObjectType = type->classObjectType;
12105 backupByReference = type->byReference;
12106 type->classObjectType = 0;
12107 type->byReference = 0;
12108 typeString[0] = '\0';
12109 PrintType(type, typeString, 0, 1);
12110 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12111 type->classObjectType = backupClassObjectType;
12112 type->byReference = backupByReference;
12113 *thisExp = *e;
12114 thisExp->prev = (((void *)0));
12115 thisExp->next = (((void *)0));
12116 __ecereMethod_Expression_Clear(e);
12117 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)))
12118 {
12119 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
12120 struct Type * t;
12121
12122 destType->refCount++;
12123 e->type = 4;
12124 e->__anon1.op.op = '*';
12125 e->__anon1.op.exp1 = (((void *)0));
12126 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12127 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12128 CopyTypeInto(t, thisExp->destType);
12129 t->passAsTemplate = 0;
12130 FreeType(thisExp->destType);
12131 thisExp->destType = t;
12132 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12133 CopyTypeInto(t, destType);
12134 t->passAsTemplate = passAsTemplate;
12135 FreeType(destType);
12136 destType = t;
12137 destType->refCount = 0;
12138 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12139 CopyTypeInto(e->expType, type);
12140 if(type->passAsTemplate)
12141 {
12142 e->expType->classObjectType = 0;
12143 e->expType->passAsTemplate = 0;
12144 }
12145 e->expType->byReference = 0;
12146 e->expType->refCount = 1;
12147 }
12148 else
12149 {
12150 e->type = 11;
12151 e->__anon1.cast.typeName = MkTypeName(specs, decl);
12152 e->__anon1.cast.exp = thisExp;
12153 e->byReference = 1;
12154 e->expType = type;
12155 type->refCount++;
12156 }
12157 if(e->destType)
12158 FreeType(e->destType);
12159 e->destType = destType;
12160 destType->refCount++;
12161 }
12162 }
12163 }
12164
12165 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
12166 {
12167 struct __ecereNameSpace__ecere__com__Class * _class;
12168 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
12169
12170 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
12171 ComputeModuleClasses(subModule->data);
12172 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->classes.first; _class; _class = _class->next)
12173 ComputeClassMembers(_class, 0);
12174 }
12175
12176 int ComputeTypeSize(struct Type * type)
12177 {
12178 unsigned int size = type ? type->size : 0;
12179
12180 if(!size && type && !type->computing)
12181 {
12182 type->computing = 1;
12183 switch(type->kind)
12184 {
12185 case 24:
12186 type->alignment = size = sizeof(char);
12187 break;
12188 case 1:
12189 type->alignment = size = sizeof(char);
12190 break;
12191 case 3:
12192 type->alignment = size = sizeof(int);
12193 break;
12194 case 4:
12195 type->alignment = size = sizeof(long long);
12196 break;
12197 case 22:
12198 type->alignment = size = targetBits / 8;
12199 type->pointerAlignment = 1;
12200 break;
12201 case 23:
12202 type->alignment = size = targetBits / 8;
12203 type->pointerAlignment = 1;
12204 break;
12205 case 5:
12206 type->alignment = size = sizeof(long);
12207 break;
12208 case 2:
12209 type->alignment = size = sizeof(short);
12210 break;
12211 case 6:
12212 type->alignment = size = sizeof(float);
12213 break;
12214 case 7:
12215 type->alignment = size = sizeof(double);
12216 break;
12217 case 8:
12218 {
12219 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
12220
12221 if(_class && _class->type == 1)
12222 {
12223 ComputeClassMembers(_class, 0);
12224 type->alignment = _class->structAlignment;
12225 type->pointerAlignment = (unsigned int)_class->pointerAlignment;
12226 size = _class->structSize;
12227 if(type->alignment && size % type->alignment)
12228 size += type->alignment - (size % type->alignment);
12229 }
12230 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
12231 {
12232 if(!_class->dataType)
12233 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12234 size = type->alignment = ComputeTypeSize(_class->dataType);
12235 }
12236 else
12237 {
12238 size = type->alignment = targetBits / 8;
12239 type->pointerAlignment = 1;
12240 }
12241 break;
12242 }
12243 case 13:
12244 case 19:
12245 size = type->alignment = targetBits / 8;
12246 type->pointerAlignment = 1;
12247 break;
12248 case 12:
12249 if(type->__anon1.__anon4.arraySizeExp)
12250 {
12251 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
12252 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
12253 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)))
12254 {
12255 struct Location oldLoc = yylloc;
12256 char expression[10240];
12257
12258 expression[0] = '\0';
12259 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
12260 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
12261 if(inCompiler)
12262 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
12263 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
12264 yylloc = oldLoc;
12265 }
12266 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
12267 }
12268 else if(type->__anon1.__anon4.enumClass)
12269 {
12270 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
12271 {
12272 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
12273 }
12274 else
12275 type->__anon1.__anon4.arraySize = 0;
12276 }
12277 else
12278 {
12279 type->__anon1.__anon4.arraySize = 0;
12280 }
12281 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
12282 if(type->__anon1.type)
12283 {
12284 type->alignment = type->__anon1.type->alignment;
12285 type->pointerAlignment = type->__anon1.type->pointerAlignment;
12286 }
12287 break;
12288 case 9:
12289 {
12290 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12291 {
12292 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12293
12294 if(symbol && symbol->type)
12295 {
12296 ComputeTypeSize(symbol->type);
12297 size = symbol->type->size;
12298 }
12299 }
12300 else
12301 {
12302 struct Type * member;
12303
12304 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12305 {
12306 int __simpleStruct0, __simpleStruct1;
12307 unsigned int addSize = ComputeTypeSize(member);
12308
12309 member->offset = size;
12310 if(member->alignment && size % member->alignment)
12311 member->offset += member->alignment - (size % member->alignment);
12312 size = member->offset;
12313 if(member->pointerAlignment && type->size <= 4)
12314 type->pointerAlignment = 1;
12315 else if(!member->pointerAlignment && member->alignment >= 8)
12316 type->pointerAlignment = 0;
12317 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12318 size += addSize;
12319 }
12320 if(type->alignment && size % type->alignment)
12321 size += type->alignment - (size % type->alignment);
12322 }
12323 break;
12324 }
12325 case 10:
12326 {
12327 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12328 {
12329 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12330
12331 if(symbol && symbol->type)
12332 {
12333 ComputeTypeSize(symbol->type);
12334 size = symbol->type->size;
12335 type->alignment = symbol->type->alignment;
12336 }
12337 }
12338 else
12339 {
12340 struct Type * member;
12341
12342 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12343 {
12344 int __simpleStruct0, __simpleStruct1;
12345 unsigned int addSize = ComputeTypeSize(member);
12346
12347 member->offset = size;
12348 if(member->alignment && size % member->alignment)
12349 member->offset += member->alignment - (size % member->alignment);
12350 size = member->offset;
12351 if(member->pointerAlignment && type->size <= 4)
12352 type->pointerAlignment = 1;
12353 else if(!member->pointerAlignment && member->alignment >= 8)
12354 type->pointerAlignment = 0;
12355 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12356 size = ((size > addSize) ? size : addSize);
12357 }
12358 if(type->alignment && size % type->alignment)
12359 size += type->alignment - (size % type->alignment);
12360 }
12361 break;
12362 }
12363 case 20:
12364 {
12365 struct TemplateParameter * param = type->__anon1.templateParameter;
12366 struct Type * baseType = ProcessTemplateParameterType(param);
12367
12368 if(baseType)
12369 {
12370 size = ComputeTypeSize(baseType);
12371 type->alignment = baseType->alignment;
12372 type->pointerAlignment = baseType->pointerAlignment;
12373 }
12374 else
12375 type->alignment = size = sizeof(uint64);
12376 break;
12377 }
12378 case 15:
12379 {
12380 type->alignment = size = sizeof(enum
12381 {
12382 test
12383 });
12384 break;
12385 }
12386 case 21:
12387 {
12388 type->alignment = size = targetBits / 8;
12389 type->pointerAlignment = 1;
12390 break;
12391 }
12392 }
12393 type->size = size;
12394 type->computing = 0;
12395 }
12396 return size;
12397 }
12398
12399 struct External * _DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl)
12400 {
12401 struct External * external = (((void *)0));
12402 struct Symbol * classSym = FindClass(name);
12403 struct __ecereNameSpace__ecere__sys__OldList * curDeclarations = (((void *)0));
12404 struct Specifier * curSpec = (((void *)0));
12405
12406 if(!inCompiler || !classSym)
12407 return (((void *)0));
12408 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
12409 return (((void *)0));
12410 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
12411 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
12412 external = classSym->__anon2.__anon1.structExternal;
12413 if(external && external->__anon1.declaration)
12414 {
12415 struct Specifier * spec;
12416
12417 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12418 if(spec->type == 3 || spec->type == 4)
12419 {
12420 curSpec = spec;
12421 curDeclarations = spec->__anon1.__anon2.definitions;
12422 break;
12423 }
12424 }
12425 if(classSym->__anon1.registered && !classSym->declaring && classSym->imported && (!classSym->declaredStructSym || (classSym->__anon1.registered->type == 5 && !skipNoHead && external && !curDeclarations)))
12426 {
12427 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12428 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
12429 char structName[1024];
12430 unsigned int addedPadding = 0;
12431
12432 classSym->declaring++;
12433 if(strchr(classSym->string, '<'))
12434 {
12435 if(classSym->__anon1.registered->templateClass)
12436 {
12437 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
12438 classSym->declaring--;
12439 }
12440 return external;
12441 }
12442 structName[0] = (char)0;
12443 FullClassNameCat(structName, name, 0);
12444 classSym->declaredStructSym = 1;
12445 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
12446 {
12447 unsigned int add = 0;
12448
12449 if(!external)
12450 {
12451 external = MkExternalDeclaration((((void *)0)));
12452 classSym->__anon2.__anon1.structExternal = external;
12453 external->symbol = classSym;
12454 add = 1;
12455 }
12456 if(!skipNoHead)
12457 {
12458 declarations = MkList();
12459 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
12460 }
12461 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
12462 {
12463 FreeList(declarations, (void *)(FreeClassDef));
12464 declarations = (((void *)0));
12465 }
12466 if(classSym->__anon1.registered->type != 5 && !declarations)
12467 {
12468 FreeExternal(external);
12469 external = (((void *)0));
12470 classSym->__anon2.__anon1.structExternal = (((void *)0));
12471 }
12472 else
12473 {
12474 if(curSpec)
12475 curSpec->__anon1.__anon2.definitions = declarations;
12476 else
12477 {
12478 char className[1024];
12479
12480 strcpy(className, "__ecereClass_");
12481 FullClassNameCat(className, classSym->string, 1);
12482 specifiers = MkList();
12483 declarators = MkList();
12484 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
12485 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12486 }
12487 if(add)
12488 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12489 }
12490 }
12491 classSym->declaring--;
12492 }
12493 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
12494 {
12495 classSym->declaredStructSym = 1;
12496 if(classSym->__anon1.registered)
12497 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
12498 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
12499 {
12500 struct Specifier * spec;
12501
12502 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
12503 {
12504 if(spec->__anon1.__anon2.definitions)
12505 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
12506 }
12507 }
12508 }
12509 if(inCompiler && neededBy && (external || !classSym->imported))
12510 {
12511 if(!external)
12512 {
12513 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
12514 external->symbol = classSym;
12515 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12516 }
12517 if(fwdDecl)
12518 {
12519 struct External * e = external->fwdDecl ? external->fwdDecl : external;
12520
12521 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
12522 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
12523 }
12524 else
12525 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
12526 }
12527 return external;
12528 }
12529
12530 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)
12531 {
12532 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
12533 unsigned int found = 0;
12534 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
12535 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12536 unsigned int freeType = 0;
12537
12538 yylloc = member->loc;
12539 if(!ident)
12540 {
12541 if(curMember)
12542 {
12543 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
12544 if(*curMember)
12545 {
12546 found = 1;
12547 dataMember = *curMember;
12548 }
12549 }
12550 }
12551 else
12552 {
12553 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
12554 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
12555 int _subMemberStackPos = 0;
12556
12557 if(!thisMember)
12558 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
12559 if(thisMember)
12560 {
12561 dataMember = thisMember;
12562 if(curMember && thisMember->memberAccess == 1)
12563 {
12564 *curMember = thisMember;
12565 *curClass = thisMember->_class;
12566 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
12567 *subMemberStackPos = _subMemberStackPos;
12568 }
12569 found = 1;
12570 }
12571 else
12572 {
12573 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
12574 if(method && method->type == 1)
12575 found = 1;
12576 else
12577 method = (((void *)0));
12578 }
12579 }
12580 if(found)
12581 {
12582 struct Type * type = (((void *)0));
12583
12584 if(dataMember)
12585 {
12586 if(!dataMember->dataType && dataMember->dataTypeString)
12587 {
12588 struct Context * context = SetupTemplatesContext(_class);
12589
12590 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12591 FinishTemplatesContext(context);
12592 }
12593 type = dataMember->dataType;
12594 }
12595 else if(method)
12596 {
12597 if(!method->dataType)
12598 ProcessMethodType(method);
12599 type = method->dataType;
12600 }
12601 if(ident && ident->next)
12602 {
12603 for(ident = ident->next; ident && type; ident = ident->next)
12604 {
12605 if(type->kind == 8)
12606 {
12607 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
12608 if(!dataMember)
12609 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
12610 if(dataMember)
12611 type = dataMember->dataType;
12612 }
12613 else if(type->kind == 9 || type->kind == 10)
12614 {
12615 struct Type * memberType;
12616
12617 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
12618 {
12619 if(!strcmp(memberType->name, ident->string))
12620 {
12621 type = memberType;
12622 break;
12623 }
12624 }
12625 }
12626 }
12627 }
12628 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
12629 {
12630 int id = 0;
12631 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
12632 struct __ecereNameSpace__ecere__com__Class * sClass;
12633
12634 for(sClass = _class; sClass; sClass = sClass->base)
12635 {
12636 id = 0;
12637 if(sClass->templateClass)
12638 sClass = sClass->templateClass;
12639 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
12640 {
12641 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
12642 {
12643 for(sClass = sClass->base; sClass; sClass = sClass->base)
12644 {
12645 if(sClass->templateClass)
12646 sClass = sClass->templateClass;
12647 id += sClass->templateParams.count;
12648 }
12649 break;
12650 }
12651 id++;
12652 }
12653 if(curParam)
12654 break;
12655 }
12656 if(curParam)
12657 {
12658 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
12659
12660 if(arg.__anon1.__anon1.dataTypeString)
12661 {
12662 unsigned int constant = type->constant;
12663
12664 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
12665 if(type->kind == 8 && constant)
12666 type->constant = 1;
12667 else if(type->kind == 13)
12668 {
12669 struct Type * t = type->__anon1.type;
12670
12671 while(t->kind == 13)
12672 t = t->__anon1.type;
12673 if(constant)
12674 t->constant = constant;
12675 }
12676 freeType = 1;
12677 if(type && _class->templateClass)
12678 type->passAsTemplate = 1;
12679 if(type)
12680 {
12681 }
12682 }
12683 }
12684 }
12685 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
12686 {
12687 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
12688 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
12689 int paramCount = 0;
12690 int lastParam = -1;
12691 char templateString[1024];
12692 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
12693
12694 sprintf(templateString, "%s<", expClass->templateClass->fullName);
12695 for(cClass = expClass; cClass; cClass = cClass->base)
12696 {
12697 int p = 0;
12698
12699 if(cClass->templateClass)
12700 cClass = cClass->templateClass;
12701 for(param = cClass->templateParams.first; param; param = param->next)
12702 {
12703 int id = p;
12704 struct __ecereNameSpace__ecere__com__Class * sClass;
12705 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
12706
12707 for(sClass = cClass->base; sClass; sClass = sClass->base)
12708 {
12709 if(sClass->templateClass)
12710 sClass = sClass->templateClass;
12711 id += sClass->templateParams.count;
12712 }
12713 arg = expClass->templateArgs[id];
12714 for(sClass = _class; sClass; sClass = sClass->base)
12715 {
12716 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
12717 int p = 0;
12718 struct __ecereNameSpace__ecere__com__Class * nextClass;
12719
12720 if(sClass->templateClass)
12721 sClass = sClass->templateClass;
12722 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
12723 {
12724 if(nextClass->templateClass)
12725 nextClass = nextClass->templateClass;
12726 p += nextClass->templateParams.count;
12727 }
12728 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
12729 {
12730 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
12731 {
12732 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12733 {
12734 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
12735 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
12736 break;
12737 }
12738 }
12739 }
12740 }
12741 {
12742 char argument[256];
12743
12744 argument[0] = '\0';
12745 switch(param->type)
12746 {
12747 case 2:
12748 {
12749 char expString[1024];
12750 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12751 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
12752 struct Expression * exp;
12753 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
12754
12755 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
12756 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
12757 ProcessExpressionType(exp);
12758 ComputeExpression(exp);
12759 expString[0] = '\0';
12760 PrintExpression(exp, expString);
12761 strcat(argument, expString);
12762 FreeExpression(exp);
12763 break;
12764 }
12765 case 1:
12766 {
12767 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
12768 break;
12769 }
12770 case 0:
12771 {
12772 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12773 strcat(argument, arg.__anon1.__anon1.dataTypeString);
12774 break;
12775 }
12776 }
12777 if(argument[0])
12778 {
12779 if(paramCount)
12780 strcat(templateString, ", ");
12781 if(lastParam != p - 1)
12782 {
12783 strcat(templateString, param->name);
12784 strcat(templateString, " = ");
12785 }
12786 strcat(templateString, argument);
12787 paramCount++;
12788 lastParam = p;
12789 }
12790 p++;
12791 }
12792 }
12793 }
12794 {
12795 int len = strlen(templateString);
12796
12797 if(templateString[len - 1] == '<')
12798 len--;
12799 else
12800 {
12801 if(templateString[len - 1] == '>')
12802 templateString[len++] = ' ';
12803 templateString[len++] = '>';
12804 }
12805 templateString[len++] = '\0';
12806 }
12807 {
12808 struct Context * context = SetupTemplatesContext(_class);
12809
12810 if(freeType)
12811 FreeType(type);
12812 type = ProcessTypeString(templateString, 0);
12813 freeType = 1;
12814 FinishTemplatesContext(context);
12815 }
12816 }
12817 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
12818 {
12819 ProcessExpressionType(member->initializer->__anon1.exp);
12820 if(!member->initializer->__anon1.exp->expType)
12821 {
12822 if(inCompiler)
12823 {
12824 char expString[10240];
12825
12826 expString[0] = '\0';
12827 PrintExpression(member->initializer->__anon1.exp, expString);
12828 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12829 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
12830 }
12831 }
12832 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
12833 {
12834 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
12835 }
12836 }
12837 else if(member->initializer)
12838 {
12839 ProcessInitializer(member->initializer, type);
12840 }
12841 if(freeType)
12842 FreeType(type);
12843 }
12844 else
12845 {
12846 if(_class && _class->type == 3)
12847 {
12848 if(member->initializer)
12849 {
12850 struct Type * type = MkClassType(_class->fullName);
12851
12852 ProcessInitializer(member->initializer, type);
12853 FreeType(type);
12854 }
12855 }
12856 else
12857 {
12858 if(member->initializer)
12859 {
12860 ProcessInitializer(member->initializer, (((void *)0)));
12861 }
12862 if(ident)
12863 {
12864 if(method)
12865 {
12866 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12867 }
12868 else if(_class)
12869 {
12870 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12871 if(inCompiler)
12872 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
12873 }
12874 }
12875 else if(_class)
12876 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
12877 }
12878 }
12879 }
12880
12881 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
12882 {
12883 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
12884
12885 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)))
12886 {
12887 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
12888
12889 if(_class->type == 4)
12890 {
12891 struct __ecereNameSpace__ecere__sys__OldList converts =
12892 {
12893 0, 0, 0, 0, 0
12894 };
12895 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12896
12897 type->kind = 8;
12898 if(!_class->symbol)
12899 _class->symbol = FindClass(_class->fullName);
12900 type->__anon1._class = _class->symbol;
12901 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))
12902 {
12903 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12904 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12905
12906 if(enumClass)
12907 {
12908 struct __ecereNameSpace__ecere__com__Class * baseClass;
12909
12910 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12911 {
12912 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12913
12914 for(value = e->values.first; value; value = value->next)
12915 {
12916 if(!strcmp(value->name, string))
12917 break;
12918 }
12919 if(value)
12920 {
12921 FreeType(sourceExp->expType);
12922 sourceExp->isConstant = 1;
12923 sourceExp->expType = MkClassType(baseClass->fullName);
12924 if(inCompiler || inPreCompiler || inDebugger)
12925 {
12926 char constant[256];
12927
12928 FreeExpContents(sourceExp);
12929 sourceExp->type = 2;
12930 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
12931 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
12932 else
12933 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
12934 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12935 }
12936 while(converts.first)
12937 {
12938 struct Conversion * convert = converts.first;
12939
12940 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
12941 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
12942 }
12943 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12944 return 1;
12945 }
12946 }
12947 }
12948 }
12949 if(converts.first)
12950 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12951 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12952 }
12953 }
12954 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)))
12955 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
12956 return 1;
12957 return 0;
12958 }
12959
12960 void ComputeExpression(struct Expression * exp)
12961 {
12962 switch(exp->type)
12963 {
12964 case 0:
12965 {
12966 struct Identifier * id = exp->__anon1.__anon1.identifier;
12967
12968 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
12969 {
12970 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
12971
12972 if(c && c->type == 4)
12973 {
12974 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12975
12976 if(enumClass)
12977 {
12978 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12979 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
12980
12981 for(value = e->values.first; value; value = value->next)
12982 {
12983 if(!strcmp(value->name, id->string))
12984 break;
12985 }
12986 if(value)
12987 {
12988 const char * dts = c->dataTypeString;
12989
12990 FreeExpContents(exp);
12991 exp->type = 2;
12992 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
12993 }
12994 }
12995 }
12996 }
12997 break;
12998 }
12999 case 1:
13000 {
13001 ComputeInstantiation(exp);
13002 break;
13003 }
13004 case 4:
13005 {
13006 struct Expression * exp1, * exp2 = (((void *)0));
13007 struct Operand op1 =
13008 {
13009 0, 0, 0,
13010 .__anon1 = {
13011 .c = 0
13012 },
13013 {
13014 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13015 }
13016 };
13017 struct Operand op2 =
13018 {
13019 0, 0, 0,
13020 .__anon1 = {
13021 .c = 0
13022 },
13023 {
13024 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13025 }
13026 };
13027
13028 if(exp->__anon1.op.exp2)
13029 {
13030 struct Expression * e = exp->__anon1.op.exp2;
13031
13032 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13033 {
13034 if(e->type == 5 || e->type == 32 || e->type == 23)
13035 {
13036 if(e->type == 23)
13037 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13038 else
13039 e = (*e->__anon1.list).last;
13040 }
13041 }
13042 if(exp->__anon1.op.op == 261 && e && e->expType)
13043 {
13044 if(e->type == 3 && e->__anon1.__anon2.string)
13045 {
13046 char * string = e->__anon1.__anon2.string;
13047 int len = strlen(string);
13048 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13049
13050 len = UnescapeString(tmp, string + 1, len - 2);
13051 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13052 FreeExpContents(exp);
13053 exp->type = 2;
13054 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13055 }
13056 else
13057 {
13058 struct Type * type = e->expType;
13059
13060 type->refCount++;
13061 FreeExpContents(exp);
13062 exp->type = 2;
13063 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13064 FreeType(type);
13065 }
13066 break;
13067 }
13068 else
13069 ComputeExpression(exp->__anon1.op.exp2);
13070 }
13071 if(exp->__anon1.op.exp1)
13072 {
13073 ComputeExpression(exp->__anon1.op.exp1);
13074 exp1 = exp->__anon1.op.exp1;
13075 exp2 = exp->__anon1.op.exp2;
13076 op1 = GetOperand(exp1);
13077 if(op1.type)
13078 op1.type->refCount++;
13079 if(exp2)
13080 {
13081 op2 = GetOperand(exp2);
13082 if(op2.type)
13083 op2.type->refCount++;
13084 }
13085 }
13086 else
13087 {
13088 exp1 = exp->__anon1.op.exp2;
13089 op1 = GetOperand(exp1);
13090 if(op1.type)
13091 op1.type->refCount++;
13092 }
13093 CallOperator(exp, exp1, exp2, &op1, &op2);
13094 if(op1.type)
13095 FreeType(op1.type);
13096 if(op2.type)
13097 FreeType(op2.type);
13098 break;
13099 }
13100 case 5:
13101 case 32:
13102 {
13103 struct Expression * e, * n;
13104
13105 for(e = (*exp->__anon1.list).first; e; e = n)
13106 {
13107 n = e->next;
13108 if(!n)
13109 {
13110 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13111 struct Expression * prev = exp->prev;
13112 struct Expression * next = exp->next;
13113
13114 ComputeExpression(e);
13115 FreeType(exp->expType);
13116 FreeType(exp->destType);
13117 *exp = *e;
13118 exp->prev = prev;
13119 exp->next = next;
13120 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13121 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13122 }
13123 else
13124 {
13125 FreeExpression(e);
13126 }
13127 }
13128 break;
13129 }
13130 case 8:
13131 {
13132 struct Expression * memberExp = exp->__anon1.member.exp;
13133 struct Identifier * memberID = exp->__anon1.member.member;
13134 struct Type * type;
13135
13136 ComputeExpression(exp->__anon1.member.exp);
13137 type = exp->__anon1.member.exp->expType;
13138 if(type)
13139 {
13140 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)));
13141 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13142 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13143 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
13144
13145 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
13146 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13147 if(!_class)
13148 {
13149 char string[256];
13150 struct Symbol * classSym;
13151
13152 string[0] = '\0';
13153 PrintTypeNoConst(type, string, 0, 1);
13154 classSym = FindClass(string);
13155 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13156 }
13157 if(exp->__anon1.member.member)
13158 {
13159 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
13160 if(!prop)
13161 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
13162 }
13163 if(!prop && !member && _class && exp->__anon1.member.member)
13164 {
13165 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
13166
13167 convertTo = _class;
13168 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13169 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
13170 }
13171 if(prop)
13172 {
13173 if(prop->compiled)
13174 {
13175 struct Type * type = prop->dataType;
13176
13177 if(_class->type == 3)
13178 {
13179 if(type->kind == 8)
13180 {
13181 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13182
13183 if(_class->type == 3)
13184 {
13185 if(!_class->dataType)
13186 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13187 type = _class->dataType;
13188 }
13189 }
13190 switch(type->kind)
13191 {
13192 case 6:
13193 {
13194 float value;
13195 float (* Get)(float) = (void *)prop->Get;
13196
13197 GetFloat(exp->__anon1.member.exp, &value);
13198 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
13199 exp->type = 2;
13200 break;
13201 }
13202 case 7:
13203 {
13204 double value;
13205 double (* Get)(double);
13206
13207 GetDouble(exp->__anon1.member.exp, &value);
13208 if(convertTo)
13209 Get = (void *)prop->Set;
13210 else
13211 Get = (void *)prop->Get;
13212 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
13213 exp->type = 2;
13214 break;
13215 }
13216 }
13217 }
13218 else
13219 {
13220 if(convertTo)
13221 {
13222 struct Expression * value = exp->__anon1.member.exp;
13223 struct Type * type;
13224
13225 if(!prop->dataType)
13226 ProcessPropertyType(prop);
13227 type = prop->dataType;
13228 if(!type)
13229 {
13230 }
13231 else if(_class->type == 1)
13232 {
13233 switch(type->kind)
13234 {
13235 case 8:
13236 {
13237 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13238
13239 if(propertyClass->type == 1 && value->type == 1)
13240 {
13241 void (* Set)(void *, void *) = (void *)prop->Set;
13242
13243 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13244 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13245 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13246 exp->__anon1.instance->loc = exp->loc;
13247 exp->type = 1;
13248 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
13249 PopulateInstance(exp->__anon1.instance);
13250 }
13251 break;
13252 }
13253 case 3:
13254 {
13255 int intValue;
13256 void (* Set)(void *, int) = (void *)prop->Set;
13257
13258 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13259 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13260 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13261 exp->__anon1.instance->loc = exp->loc;
13262 exp->type = 1;
13263 GetInt(value, &intValue);
13264 Set(exp->__anon1.instance->data, intValue);
13265 PopulateInstance(exp->__anon1.instance);
13266 break;
13267 }
13268 case 4:
13269 {
13270 long long intValue;
13271 void (* Set)(void *, long long) = (void *)prop->Set;
13272
13273 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13274 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13275 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13276 exp->__anon1.instance->loc = exp->loc;
13277 exp->type = 1;
13278 GetInt64(value, &intValue);
13279 Set(exp->__anon1.instance->data, intValue);
13280 PopulateInstance(exp->__anon1.instance);
13281 break;
13282 }
13283 case 22:
13284 {
13285 intptr_t intValue;
13286 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13287
13288 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13289 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13290 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13291 exp->__anon1.instance->loc = exp->loc;
13292 exp->type = 1;
13293 GetIntPtr(value, &intValue);
13294 Set(exp->__anon1.instance->data, intValue);
13295 PopulateInstance(exp->__anon1.instance);
13296 break;
13297 }
13298 case 23:
13299 {
13300 ssize_t intValue;
13301 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13302
13303 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13304 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13305 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13306 exp->__anon1.instance->loc = exp->loc;
13307 exp->type = 1;
13308 GetIntSize(value, &intValue);
13309 Set(exp->__anon1.instance->data, intValue);
13310 PopulateInstance(exp->__anon1.instance);
13311 break;
13312 }
13313 case 6:
13314 {
13315 float floatValue;
13316 void (* Set)(void *, float) = (void *)prop->Set;
13317
13318 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13319 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13320 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13321 exp->__anon1.instance->loc = exp->loc;
13322 exp->type = 1;
13323 GetFloat(value, &floatValue);
13324 Set(exp->__anon1.instance->data, floatValue);
13325 PopulateInstance(exp->__anon1.instance);
13326 break;
13327 }
13328 case 7:
13329 {
13330 double doubleValue;
13331 void (* Set)(void *, double) = (void *)prop->Set;
13332
13333 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13334 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13335 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13336 exp->__anon1.instance->loc = exp->loc;
13337 exp->type = 1;
13338 GetDouble(value, &doubleValue);
13339 Set(exp->__anon1.instance->data, doubleValue);
13340 PopulateInstance(exp->__anon1.instance);
13341 break;
13342 }
13343 }
13344 }
13345 else if(_class->type == 2)
13346 {
13347 switch(type->kind)
13348 {
13349 case 8:
13350 {
13351 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13352
13353 if(propertyClass->type == 1 && value->__anon1.instance->data)
13354 {
13355 unsigned int (* Set)(void *) = (void *)prop->Set;
13356 unsigned int bits = Set(value->__anon1.instance->data);
13357
13358 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13359 exp->type = 2;
13360 break;
13361 }
13362 else if(_class->type == 2)
13363 {
13364 unsigned int value;
13365 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
13366 unsigned int bits;
13367
13368 GetUInt(exp->__anon1.member.exp, &value);
13369 bits = Set(value);
13370 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13371 exp->type = 2;
13372 }
13373 }
13374 }
13375 }
13376 }
13377 else
13378 {
13379 if(_class->type == 2)
13380 {
13381 unsigned int value;
13382
13383 GetUInt(exp->__anon1.member.exp, &value);
13384 switch(type->kind)
13385 {
13386 case 8:
13387 {
13388 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13389
13390 if(_class->type == 1)
13391 {
13392 void (* Get)(unsigned int, void *) = (void *)prop->Get;
13393
13394 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13395 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13396 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13397 exp->__anon1.instance->loc = exp->loc;
13398 exp->type = 1;
13399 Get(value, exp->__anon1.instance->data);
13400 PopulateInstance(exp->__anon1.instance);
13401 }
13402 else if(_class->type == 2)
13403 {
13404 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
13405 uint64 bits = Get(value);
13406
13407 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
13408 exp->type = 2;
13409 }
13410 break;
13411 }
13412 }
13413 }
13414 else if(_class->type == 1)
13415 {
13416 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
13417
13418 switch(type->kind)
13419 {
13420 case 8:
13421 {
13422 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13423
13424 if(_class->type == 1 && value)
13425 {
13426 void (* Get)(void *, void *) = (void *)prop->Get;
13427
13428 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13429 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13430 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13431 exp->__anon1.instance->loc = exp->loc;
13432 exp->type = 1;
13433 Get(value, exp->__anon1.instance->data);
13434 PopulateInstance(exp->__anon1.instance);
13435 }
13436 break;
13437 }
13438 }
13439 }
13440 }
13441 }
13442 }
13443 else
13444 {
13445 exp->isConstant = 0;
13446 }
13447 }
13448 else if(member)
13449 {
13450 }
13451 }
13452 if(exp->type != 8)
13453 {
13454 FreeExpression(memberExp);
13455 FreeIdentifier(memberID);
13456 }
13457 break;
13458 }
13459 case 10:
13460 {
13461 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
13462
13463 FreeExpContents(exp);
13464 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13465 exp->type = 2;
13466 FreeType(type);
13467 break;
13468 }
13469 case 15:
13470 {
13471 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
13472
13473 if(classSym && classSym->__anon1.registered)
13474 {
13475 if(classSym->__anon1.registered->fixed)
13476 {
13477 FreeSpecifier(exp->__anon1._class);
13478 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
13479 exp->type = 2;
13480 }
13481 else
13482 {
13483 char className[1024];
13484
13485 strcpy(className, "__ecereClass_");
13486 FullClassNameCat(className, classSym->string, 1);
13487 DeclareClass(curExternal, classSym, className);
13488 FreeExpContents(exp);
13489 exp->type = 9;
13490 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
13491 exp->__anon1.member.member = MkIdentifier("structSize");
13492 }
13493 }
13494 break;
13495 }
13496 case 11:
13497 {
13498 struct Type * type;
13499 struct Expression * e = exp;
13500
13501 if(exp->type == 11)
13502 {
13503 if(exp->__anon1.cast.exp)
13504 ComputeExpression(exp->__anon1.cast.exp);
13505 e = exp->__anon1.cast.exp;
13506 }
13507 if(e && exp->expType)
13508 {
13509 type = exp->expType;
13510 if(type->kind == 8)
13511 {
13512 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13513
13514 if(_class && (_class->type == 3 || _class->type == 2))
13515 {
13516 if(!_class->dataType)
13517 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13518 type = _class->dataType;
13519 }
13520 }
13521 switch(type->kind)
13522 {
13523 case 24:
13524 case 1:
13525 if(type->isSigned)
13526 {
13527 char value = (char)0;
13528
13529 if(GetChar(e, &value))
13530 {
13531 FreeExpContents(exp);
13532 exp->__anon1.__anon1.constant = PrintChar(value);
13533 exp->type = 2;
13534 }
13535 }
13536 else
13537 {
13538 unsigned char value = (unsigned char)0;
13539
13540 if(GetUChar(e, &value))
13541 {
13542 FreeExpContents(exp);
13543 exp->__anon1.__anon1.constant = PrintUChar(value);
13544 exp->type = 2;
13545 }
13546 }
13547 break;
13548 case 2:
13549 if(type->isSigned)
13550 {
13551 short value = (short)0;
13552
13553 if(GetShort(e, &value))
13554 {
13555 FreeExpContents(exp);
13556 exp->__anon1.__anon1.constant = PrintShort(value);
13557 exp->type = 2;
13558 }
13559 }
13560 else
13561 {
13562 unsigned short value = (unsigned short)0;
13563
13564 if(GetUShort(e, &value))
13565 {
13566 FreeExpContents(exp);
13567 exp->__anon1.__anon1.constant = PrintUShort(value);
13568 exp->type = 2;
13569 }
13570 }
13571 break;
13572 case 3:
13573 if(type->isSigned)
13574 {
13575 int value = 0;
13576
13577 if(GetInt(e, &value))
13578 {
13579 FreeExpContents(exp);
13580 exp->__anon1.__anon1.constant = PrintInt(value);
13581 exp->type = 2;
13582 }
13583 }
13584 else
13585 {
13586 unsigned int value = 0;
13587
13588 if(GetUInt(e, &value))
13589 {
13590 FreeExpContents(exp);
13591 exp->__anon1.__anon1.constant = PrintUInt(value);
13592 exp->type = 2;
13593 }
13594 }
13595 break;
13596 case 4:
13597 if(type->isSigned)
13598 {
13599 long long value = 0;
13600
13601 if(GetInt64(e, &value))
13602 {
13603 FreeExpContents(exp);
13604 exp->__anon1.__anon1.constant = PrintInt64(value);
13605 exp->type = 2;
13606 }
13607 }
13608 else
13609 {
13610 uint64 value = 0;
13611
13612 if(GetUInt64(e, &value))
13613 {
13614 FreeExpContents(exp);
13615 exp->__anon1.__anon1.constant = PrintUInt64(value);
13616 exp->type = 2;
13617 }
13618 }
13619 break;
13620 case 22:
13621 if(type->isSigned)
13622 {
13623 intptr_t value = 0;
13624
13625 if(GetIntPtr(e, &value))
13626 {
13627 FreeExpContents(exp);
13628 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13629 exp->type = 2;
13630 }
13631 }
13632 else
13633 {
13634 uintptr_t value = 0;
13635
13636 if(GetUIntPtr(e, &value))
13637 {
13638 FreeExpContents(exp);
13639 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13640 exp->type = 2;
13641 }
13642 }
13643 break;
13644 case 23:
13645 if(type->isSigned)
13646 {
13647 ssize_t value = 0;
13648
13649 if(GetIntSize(e, &value))
13650 {
13651 FreeExpContents(exp);
13652 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13653 exp->type = 2;
13654 }
13655 }
13656 else
13657 {
13658 size_t value = 0;
13659
13660 if(GetUIntSize(e, &value))
13661 {
13662 FreeExpContents(exp);
13663 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13664 exp->type = 2;
13665 }
13666 }
13667 break;
13668 case 6:
13669 {
13670 float value = 0;
13671
13672 if(GetFloat(e, &value))
13673 {
13674 FreeExpContents(exp);
13675 exp->__anon1.__anon1.constant = PrintFloat(value);
13676 exp->type = 2;
13677 }
13678 break;
13679 }
13680 case 7:
13681 {
13682 double value = 0;
13683
13684 if(GetDouble(e, &value))
13685 {
13686 FreeExpContents(exp);
13687 exp->__anon1.__anon1.constant = PrintDouble(value);
13688 exp->type = 2;
13689 }
13690 break;
13691 }
13692 }
13693 }
13694 break;
13695 }
13696 case 12:
13697 {
13698 struct Operand op1 =
13699 {
13700 0, 0, 0,
13701 .__anon1 = {
13702 .c = 0
13703 },
13704 {
13705 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13706 }
13707 };
13708 struct Operand op2 =
13709 {
13710 0, 0, 0,
13711 .__anon1 = {
13712 .c = 0
13713 },
13714 {
13715 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13716 }
13717 };
13718 struct Operand op3 =
13719 {
13720 0, 0, 0,
13721 .__anon1 = {
13722 .c = 0
13723 },
13724 {
13725 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13726 }
13727 };
13728
13729 if(exp->__anon1.cond.exp)
13730 ComputeExpression((*exp->__anon1.cond.exp).last);
13731 if(exp->__anon1.cond.elseExp)
13732 ComputeExpression(exp->__anon1.cond.elseExp);
13733 if(exp->__anon1.cond.cond)
13734 ComputeExpression(exp->__anon1.cond.cond);
13735 op1 = GetOperand(exp->__anon1.cond.cond);
13736 if(op1.type)
13737 op1.type->refCount++;
13738 op2 = GetOperand((*exp->__anon1.cond.exp).last);
13739 if(op2.type)
13740 op2.type->refCount++;
13741 op3 = GetOperand(exp->__anon1.cond.elseExp);
13742 if(op3.type)
13743 op3.type->refCount++;
13744 if(op1.ops.Cond)
13745 {
13746 FreeExpContents(exp);
13747 op1.ops.Cond(exp, &op1, &op2, &op3);
13748 }
13749 if(op1.type)
13750 FreeType(op1.type);
13751 if(op2.type)
13752 FreeType(op2.type);
13753 if(op3.type)
13754 FreeType(op3.type);
13755 break;
13756 }
13757 }
13758 }
13759
13760 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
13761 {
13762 struct __ecereNameSpace__ecere__com__Instance * module;
13763
13764 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))
13765 return 1;
13766 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))
13767 return 1;
13768 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))
13769 return 1;
13770 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)
13771 {
13772 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
13773 return 1;
13774 }
13775 return 0;
13776 }
13777
13778 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
13779 {
13780 struct Type * source;
13781 struct Type * realDest = dest;
13782 struct Type * backupSourceExpType = (((void *)0));
13783 struct Expression * computedExp = sourceExp;
13784
13785 dest->refCount++;
13786 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)
13787 {
13788 computedExp = CopyExpression(sourceExp);
13789 ComputeExpression(computedExp);
13790 }
13791 source = sourceExp->expType;
13792 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
13793 {
13794 if(computedExp != sourceExp)
13795 {
13796 FreeExpression(computedExp);
13797 computedExp = sourceExp;
13798 }
13799 FreeType(dest);
13800 return 1;
13801 }
13802 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
13803 {
13804 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
13805 {
13806 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
13807
13808 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
13809 ;
13810 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
13811 ;
13812 if(sourceBase == destBase)
13813 {
13814 if(computedExp != sourceExp)
13815 {
13816 FreeExpression(computedExp);
13817 computedExp = sourceExp;
13818 }
13819 FreeType(dest);
13820 return 1;
13821 }
13822 }
13823 }
13824 if(source)
13825 {
13826 struct __ecereNameSpace__ecere__sys__OldList * specs;
13827 unsigned int flag = 0;
13828 long long value = (((int)0x7fffffff));
13829
13830 source->refCount++;
13831 if(computedExp->type == 2)
13832 {
13833 if(source->isSigned)
13834 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13835 else
13836 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13837 }
13838 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
13839 {
13840 if(source->isSigned)
13841 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13842 else
13843 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13844 }
13845 if(computedExp != sourceExp)
13846 {
13847 FreeExpression(computedExp);
13848 computedExp = sourceExp;
13849 }
13850 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
13851 {
13852 FreeType(source);
13853 source = __extension__ ({
13854 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13855
13856 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
13857 });
13858 }
13859 if(dest->kind == 8)
13860 {
13861 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13862
13863 if(_class && _class->type == 3)
13864 {
13865 if(source->kind != 8)
13866 {
13867 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13868 struct Type * tempDest, * tempSource;
13869
13870 for(; _class->base->type != 1000; _class = _class->base)
13871 ;
13872 tempSource = dest;
13873 tempDest = tempType;
13874 tempType->kind = 8;
13875 if(!_class->symbol)
13876 _class->symbol = FindClass(_class->fullName);
13877 tempType->__anon1._class = _class->symbol;
13878 tempType->truth = dest->truth;
13879 if(tempType->__anon1._class)
13880 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13881 backupSourceExpType = sourceExp->expType;
13882 if(dest->passAsTemplate)
13883 {
13884 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13885 CopyTypeInto(sourceExp->expType, dest);
13886 sourceExp->expType->passAsTemplate = 0;
13887 }
13888 else
13889 {
13890 sourceExp->expType = dest;
13891 dest->refCount++;
13892 }
13893 flag = 1;
13894 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13895 }
13896 }
13897 if(_class && _class->type == 2 && source->kind != 8)
13898 {
13899 if(!dest->__anon1._class->__anon1.registered->dataType)
13900 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
13901 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13902 {
13903 FreeType(source);
13904 FreeType(sourceExp->expType);
13905 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
13906 source->refCount++;
13907 }
13908 }
13909 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
13910 {
13911 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13912 struct Declarator * decl;
13913 char string[1024];
13914
13915 ReadString(string, sourceExp->__anon1.__anon2.string);
13916 decl = SpecDeclFromString(string, specs, (((void *)0)));
13917 FreeExpContents(sourceExp);
13918 FreeType(sourceExp->expType);
13919 sourceExp->type = 24;
13920 sourceExp->__anon1._classExp.specifiers = specs;
13921 sourceExp->__anon1._classExp.decl = decl;
13922 sourceExp->expType = dest;
13923 dest->refCount++;
13924 FreeType(source);
13925 FreeType(dest);
13926 if(backupSourceExpType)
13927 FreeType(backupSourceExpType);
13928 return 1;
13929 }
13930 }
13931 else if(source->kind == 8)
13932 {
13933 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
13934
13935 if(_class && (_class->type == 3 || _class->type == 2))
13936 {
13937 if(dest->kind != 8)
13938 {
13939 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13940 struct Type * tempDest, * tempSource;
13941
13942 if(!source->__anon1._class->__anon1.registered->dataType)
13943 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
13944 for(; _class->base->type != 1000; _class = _class->base)
13945 ;
13946 tempDest = source;
13947 tempSource = tempType;
13948 tempType->kind = 8;
13949 tempType->__anon1._class = FindClass(_class->fullName);
13950 tempType->truth = source->truth;
13951 tempType->classObjectType = source->classObjectType;
13952 if(tempType->__anon1._class)
13953 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13954 if(conversions && conversions->last)
13955 {
13956 ((struct Conversion *)conversions->last)->resultType = dest;
13957 dest->refCount++;
13958 }
13959 FreeType(sourceExp->expType);
13960 sourceExp->expType = MkClassType(_class->fullName);
13961 sourceExp->expType->truth = source->truth;
13962 sourceExp->expType->classObjectType = source->classObjectType;
13963 if(!sourceExp->destType)
13964 {
13965 FreeType(sourceExp->destType);
13966 sourceExp->destType = sourceExp->expType;
13967 if(sourceExp->expType)
13968 sourceExp->expType->refCount++;
13969 }
13970 if(!_class->dataType)
13971 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13972 FreeType(dest);
13973 dest = MkClassType(source->__anon1._class->string);
13974 dest->truth = source->truth;
13975 dest->classObjectType = source->classObjectType;
13976 FreeType(source);
13977 source = _class->dataType;
13978 source->refCount++;
13979 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13980 }
13981 }
13982 }
13983 if(!flag)
13984 {
13985 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13986 {
13987 FreeType(source);
13988 FreeType(dest);
13989 return 1;
13990 }
13991 }
13992 if(dest->kind == 8)
13993 {
13994 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13995 unsigned int fittingValue = 0;
13996
13997 if(_class && _class->type == 4)
13998 {
13999 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14000 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14001
14002 if(c && value >= 0 && value <= c->largest)
14003 fittingValue = 1;
14004 }
14005 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
14006 {
14007 if(_class->type == 0 || _class->type == 5)
14008 {
14009 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14010
14011 *newExp = *sourceExp;
14012 if(sourceExp->destType)
14013 sourceExp->destType->refCount++;
14014 if(sourceExp->expType)
14015 sourceExp->expType->refCount++;
14016 sourceExp->type = 11;
14017 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
14018 sourceExp->__anon1.cast.exp = newExp;
14019 FreeType(sourceExp->expType);
14020 sourceExp->expType = (((void *)0));
14021 ProcessExpressionType(sourceExp);
14022 if(!inCompiler)
14023 {
14024 FreeType(sourceExp->expType);
14025 sourceExp->expType = dest;
14026 }
14027 FreeType(source);
14028 if(inCompiler)
14029 FreeType(dest);
14030 if(backupSourceExpType)
14031 FreeType(backupSourceExpType);
14032 return 1;
14033 }
14034 if(!_class->dataType)
14035 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14036 FreeType(dest);
14037 dest = _class->dataType;
14038 dest->refCount++;
14039 }
14040 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))
14041 {
14042 specs = MkListOne(MkSpecifier(DOUBLE));
14043 }
14044 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))
14045 {
14046 specs = MkListOne(MkSpecifier(FLOAT));
14047 }
14048 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))
14049 {
14050 specs = MkList();
14051 if(!dest->isSigned)
14052 ListAdd(specs, MkSpecifier(UNSIGNED));
14053 ListAdd(specs, MkSpecifier(INT64));
14054 }
14055 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
14056 {
14057 specs = MkList();
14058 if(!dest->isSigned)
14059 ListAdd(specs, MkSpecifier(UNSIGNED));
14060 ListAdd(specs, MkSpecifier(INT));
14061 }
14062 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14063 {
14064 specs = MkList();
14065 if(!dest->isSigned)
14066 ListAdd(specs, MkSpecifier(UNSIGNED));
14067 ListAdd(specs, MkSpecifier(SHORT));
14068 }
14069 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14070 {
14071 specs = MkList();
14072 if(!dest->isSigned)
14073 ListAdd(specs, MkSpecifier(UNSIGNED));
14074 ListAdd(specs, MkSpecifier(CHAR));
14075 }
14076 else
14077 {
14078 FreeType(source);
14079 FreeType(dest);
14080 if(backupSourceExpType)
14081 {
14082 if(sourceExp->expType)
14083 FreeType(sourceExp->expType);
14084 sourceExp->expType = backupSourceExpType;
14085 }
14086 return 0;
14087 }
14088 }
14089 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))
14090 {
14091 specs = MkListOne(MkSpecifier(DOUBLE));
14092 }
14093 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))
14094 {
14095 specs = MkListOne(MkSpecifier(FLOAT));
14096 }
14097 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
14098 {
14099 specs = MkList();
14100 ListAdd(specs, MkSpecifier(BOOL));
14101 }
14102 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)))
14103 {
14104 specs = MkList();
14105 if(!dest->isSigned)
14106 ListAdd(specs, MkSpecifier(UNSIGNED));
14107 ListAdd(specs, MkSpecifier(CHAR));
14108 }
14109 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)))))
14110 {
14111 specs = MkList();
14112 if(!dest->isSigned)
14113 ListAdd(specs, MkSpecifier(UNSIGNED));
14114 ListAdd(specs, MkSpecifier(SHORT));
14115 }
14116 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
14117 {
14118 specs = MkList();
14119 if(!dest->isSigned)
14120 ListAdd(specs, MkSpecifier(UNSIGNED));
14121 ListAdd(specs, MkSpecifier(INT));
14122 }
14123 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
14124 {
14125 specs = MkList();
14126 if(!dest->isSigned)
14127 ListAdd(specs, MkSpecifier(UNSIGNED));
14128 ListAdd(specs, MkSpecifier(INT64));
14129 }
14130 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
14131 {
14132 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
14133 }
14134 else
14135 {
14136 FreeType(source);
14137 FreeType(dest);
14138 if(backupSourceExpType)
14139 {
14140 if(sourceExp->expType)
14141 FreeType(sourceExp->expType);
14142 sourceExp->expType = backupSourceExpType;
14143 }
14144 return 0;
14145 }
14146 if(!flag && !sourceExp->opDestType)
14147 {
14148 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14149
14150 *newExp = *sourceExp;
14151 newExp->prev = (((void *)0));
14152 newExp->next = (((void *)0));
14153 if(sourceExp->destType)
14154 sourceExp->destType->refCount++;
14155 if(sourceExp->expType)
14156 sourceExp->expType->refCount++;
14157 sourceExp->type = 11;
14158 if(realDest->kind == 8)
14159 {
14160 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
14161 FreeList(specs, (void *)(FreeSpecifier));
14162 }
14163 else
14164 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
14165 if(newExp->type == 4)
14166 {
14167 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
14168 }
14169 else
14170 sourceExp->__anon1.cast.exp = newExp;
14171 FreeType(sourceExp->expType);
14172 sourceExp->expType = (((void *)0));
14173 ProcessExpressionType(sourceExp);
14174 }
14175 else
14176 FreeList(specs, (void *)(FreeSpecifier));
14177 FreeType(dest);
14178 FreeType(source);
14179 if(backupSourceExpType)
14180 FreeType(backupSourceExpType);
14181 return 1;
14182 }
14183 else
14184 {
14185 if(computedExp != sourceExp)
14186 {
14187 FreeExpression(computedExp);
14188 computedExp = sourceExp;
14189 }
14190 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
14191 sourceExp = (*sourceExp->__anon1.list).last;
14192 if(sourceExp->type == 0)
14193 {
14194 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
14195
14196 if(dest->kind == 8)
14197 {
14198 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
14199 {
14200 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
14201 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14202
14203 if(enumClass)
14204 {
14205 for(; _class && _class->type == 4; _class = _class->base)
14206 {
14207 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
14208 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14209
14210 for(value = e->values.first; value; value = value->next)
14211 {
14212 if(!strcmp(value->name, id->string))
14213 break;
14214 }
14215 if(value)
14216 {
14217 FreeType(sourceExp->expType);
14218 sourceExp->isConstant = 1;
14219 sourceExp->expType = MkClassType(_class->fullName);
14220 if(inCompiler || inPreCompiler || inDebugger)
14221 {
14222 FreeExpContents(sourceExp);
14223 sourceExp->type = 2;
14224 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
14225 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
14226 else
14227 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
14228 }
14229 FreeType(dest);
14230 return 1;
14231 }
14232 }
14233 }
14234 }
14235 }
14236 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
14237 {
14238 FreeType(dest);
14239 return 1;
14240 }
14241 }
14242 FreeType(dest);
14243 }
14244 return 0;
14245 }
14246
14247 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
14248 {
14249 unsigned int result = 1;
14250
14251 if(destType)
14252 {
14253 struct __ecereNameSpace__ecere__sys__OldList converts =
14254 {
14255 0, 0, 0, 0, 0
14256 };
14257 struct Conversion * convert;
14258
14259 if(destType->kind == 0)
14260 return 0;
14261 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
14262 result = 0;
14263 if(converts.count)
14264 {
14265 for(convert = converts.first; convert; convert = convert->next)
14266 {
14267 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
14268
14269 if(!empty)
14270 {
14271 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14272 int objectType = exp->expType ? exp->expType->classObjectType : 0;
14273
14274 *newExp = *exp;
14275 newExp->prev = (((void *)0));
14276 newExp->next = (((void *)0));
14277 newExp->destType = (((void *)0));
14278 if(convert->isGet)
14279 {
14280 exp->type = 8;
14281 exp->addedThis = 1;
14282 exp->__anon1.member.exp = newExp;
14283 FreeType(exp->__anon1.member.exp->expType);
14284 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
14285 exp->__anon1.member.exp->expType->classObjectType = objectType;
14286 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
14287 exp->__anon1.member.memberType = 1;
14288 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14289 exp->needCast = 1;
14290 if(exp->expType)
14291 exp->expType->refCount++;
14292 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14293 }
14294 else
14295 {
14296 {
14297 exp->type = 8;
14298 exp->addedThis = 1;
14299 exp->__anon1.member.exp = newExp;
14300 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)
14301 {
14302 newExp->byReference = 1;
14303 }
14304 FreeType(exp->__anon1.member.exp->expType);
14305 exp->__anon1.member.exp->expType = (((void *)0));
14306 if(convert->convert->dataType)
14307 {
14308 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14309 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
14310 exp->__anon1.member.exp->expType->refCount = 1;
14311 exp->__anon1.member.exp->expType->classObjectType = objectType;
14312 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14313 }
14314 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
14315 exp->__anon1.member.memberType = 4;
14316 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14317 exp->needCast = 1;
14318 if(convert->resultType)
14319 convert->resultType->refCount++;
14320 }
14321 }
14322 }
14323 else
14324 {
14325 FreeType(exp->expType);
14326 if(convert->isGet)
14327 {
14328 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14329 if(exp->destType->casted)
14330 exp->needCast = 1;
14331 if(exp->expType)
14332 exp->expType->refCount++;
14333 }
14334 else
14335 {
14336 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14337 if(exp->destType->casted)
14338 exp->needCast = 1;
14339 if(convert->resultType)
14340 convert->resultType->refCount++;
14341 }
14342 }
14343 }
14344 if(exp->isConstant && inCompiler)
14345 ComputeExpression(exp);
14346 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
14347 }
14348 if(!result && exp->expType && converts.count)
14349 {
14350 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14351 }
14352 if(!result && exp->expType && exp->destType)
14353 {
14354 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))
14355 result = 1;
14356 }
14357 }
14358 return result;
14359 }
14360
14361 static void ProcessFunction(struct FunctionDefinition *  function);
14362
14363 void ProcessInstantiationType(struct Instantiation * inst)
14364 {
14365 yylloc = inst->loc;
14366 if(inst->_class)
14367 {
14368 struct MembersInit * members;
14369 struct Symbol * classSym;
14370 struct __ecereNameSpace__ecere__com__Class * _class;
14371
14372 classSym = inst->_class->__anon1.__anon1.symbol;
14373 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14374 if(!_class || _class->type != 5)
14375 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14376 afterExternal = afterExternal ? afterExternal : curExternal;
14377 if(inst->exp)
14378 ProcessExpressionType(inst->exp);
14379 inst->isConstant = 1;
14380 if(inst->members)
14381 {
14382 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14383 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14384 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14385 int subMemberStackPos = 0;
14386
14387 for(members = (*inst->members).first; members; members = members->next)
14388 {
14389 switch(members->type)
14390 {
14391 case 1:
14392 {
14393 char name[1024];
14394 static unsigned int instMethodID = 0;
14395 struct External * external = curExternal;
14396 struct Context * context = curContext;
14397 struct Declarator * declarator = members->__anon1.function->declarator;
14398 struct Identifier * nameID = GetDeclId(declarator);
14399 char * unmangled = nameID ? nameID->string : (((void *)0));
14400 struct Expression * exp;
14401 struct External * createdExternal = (((void *)0));
14402
14403 if(inCompiler)
14404 {
14405 char number[16];
14406
14407 strcpy(name, "__ecereInstMeth_");
14408 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14409 strcat(name, "_");
14410 strcat(name, nameID->string);
14411 strcat(name, "_");
14412 sprintf(number, "_%08d", instMethodID++);
14413 strcat(name, number);
14414 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14415 }
14416 if(declarator)
14417 {
14418 struct Symbol * symbol = declarator->symbol;
14419 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14420
14421 if(method && method->type == 1)
14422 {
14423 symbol->__anon1.method = method;
14424 ProcessMethodType(method);
14425 if(!symbol->type->__anon1.__anon2.thisClass)
14426 {
14427 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14428 {
14429 if(!currentClass->symbol)
14430 currentClass->symbol = FindClass(currentClass->fullName);
14431 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14432 }
14433 else
14434 {
14435 if(!_class->symbol)
14436 _class->symbol = FindClass(_class->fullName);
14437 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14438 }
14439 }
14440 DeclareType(curExternal, symbol->type, 1, 1);
14441 }
14442 else if(classSym)
14443 {
14444 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14445 }
14446 }
14447 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14448 if(nameID)
14449 {
14450 FreeSpecifier(nameID->_class);
14451 nameID->_class = (((void *)0));
14452 }
14453 curExternal = createdExternal;
14454 if(inCompiler)
14455 {
14456 if(createdExternal->__anon1.function)
14457 ProcessFunction(createdExternal->__anon1.function);
14458 }
14459 else if(declarator)
14460 {
14461 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14462 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14463 }
14464 curExternal = external;
14465 curContext = context;
14466 if(inCompiler)
14467 {
14468 FreeClassFunction(members->__anon1.function);
14469 exp = QMkExpId(name);
14470 members->type = 0;
14471 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14472 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14473 }
14474 break;
14475 }
14476 case 0:
14477 {
14478 if(members->__anon1.dataMembers && classSym)
14479 {
14480 struct MemberInit * member;
14481 struct Location oldyyloc = yylloc;
14482
14483 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14484 {
14485 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14486 if(member->initializer && !member->initializer->isConstant)
14487 inst->isConstant = 0;
14488 }
14489 yylloc = oldyyloc;
14490 }
14491 break;
14492 }
14493 }
14494 }
14495 }
14496 }
14497 }
14498
14499 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14500
14501 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14502 {
14503 switch(spec->type)
14504 {
14505 case 0:
14506 {
14507 if(spec->__anon1.specifier == THISCLASS)
14508 {
14509 if(thisClass)
14510 {
14511 spec->type = 1;
14512 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14513 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14514 ProcessSpecifier(spec, declareStruct, 0);
14515 }
14516 }
14517 break;
14518 }
14519 case 1:
14520 {
14521 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14522
14523 if(symbol)
14524 DeclareType(curExternal, symbol->type, 1, 1);
14525 else if(spec->__anon1.__anon1.symbol)
14526 {
14527 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14528
14529 if(warnClasses && !c)
14530 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14531 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14532 }
14533 break;
14534 }
14535 case 2:
14536 {
14537 struct Enumerator * e;
14538
14539 if(spec->__anon1.__anon2.list)
14540 {
14541 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14542 {
14543 if(e->exp)
14544 ProcessExpressionType(e->exp);
14545 }
14546 }
14547 if(inCompiler)
14548 break;
14549 }
14550 case 3:
14551 case 4:
14552 {
14553 if(spec->__anon1.__anon2.definitions)
14554 {
14555 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14556
14557 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14558 }
14559 break;
14560 }
14561 }
14562 }
14563
14564 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14565 {
14566 switch(decl->type)
14567 {
14568 case 1:
14569 if(decl->__anon1.identifier->classSym)
14570 {
14571 FreeSpecifier(decl->__anon1.identifier->_class);
14572 decl->__anon1.identifier->_class = (((void *)0));
14573 }
14574 break;
14575 case 3:
14576 if(decl->__anon1.array.exp)
14577 ProcessExpressionType(decl->__anon1.array.exp);
14578 case 0:
14579 case 2:
14580 case 4:
14581 case 5:
14582 case 6:
14583 case 7:
14584 {
14585 struct Identifier * id = (((void *)0));
14586 struct Specifier * classSpec = (((void *)0));
14587
14588 if(decl->type == 4)
14589 {
14590 id = GetDeclId(decl);
14591 if(id && id->_class)
14592 {
14593 classSpec = id->_class;
14594 id->_class = (((void *)0));
14595 }
14596 }
14597 if(decl->declarator)
14598 ProcessDeclarator(decl->declarator, isFunction);
14599 if(decl->type == 4)
14600 {
14601 if(classSpec)
14602 {
14603 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14604
14605 if(!decl->__anon1.function.parameters)
14606 decl->__anon1.function.parameters = MkList();
14607 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14608 }
14609 if(decl->__anon1.function.parameters)
14610 {
14611 struct TypeName * param;
14612
14613 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14614 {
14615 if(param->qualifiers)
14616 {
14617 struct Specifier * spec;
14618
14619 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14620 {
14621 if(spec->type == 0)
14622 {
14623 if(spec->__anon1.specifier == TYPED_OBJECT)
14624 {
14625 struct Declarator * d = param->declarator;
14626 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);
14627
14628 if(d->type != 5)
14629 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14630 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14631 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14632 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14633 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14634 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14635 param = newParam;
14636 break;
14637 }
14638 else if(spec->__anon1.specifier == ANY_OBJECT)
14639 {
14640 struct Declarator * d = param->declarator;
14641
14642 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14643 param->qualifiers = MkListOne(MkSpecifier(VOID));
14644 if(d->type != 5)
14645 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14646 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14647 break;
14648 }
14649 else if(spec->__anon1.specifier == THISCLASS)
14650 {
14651 if(thisClass)
14652 {
14653 spec->type = 1;
14654 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14655 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14656 ProcessSpecifier(spec, 0, 0);
14657 }
14658 break;
14659 }
14660 }
14661 else if(spec->type == 1)
14662 {
14663 ProcessSpecifier(spec, isFunction, 1);
14664 }
14665 }
14666 }
14667 if(param->declarator)
14668 ProcessDeclarator(param->declarator, 0);
14669 }
14670 }
14671 }
14672 break;
14673 }
14674 }
14675 }
14676
14677 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14678 {
14679 yylloc = decl->loc;
14680 switch(decl->type)
14681 {
14682 case 1:
14683 {
14684 unsigned int declareStruct = 0;
14685
14686 if(decl->__anon1.__anon1.declarators)
14687 {
14688 struct InitDeclarator * d;
14689
14690 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14691 {
14692 struct Type * type, * subType;
14693
14694 ProcessDeclarator(d->declarator, 0);
14695 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14696 if(d->initializer)
14697 {
14698 ProcessInitializer(d->initializer, type);
14699 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14700 {
14701 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14702 {
14703 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14704
14705 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14706 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14707 if(decl->__anon1.__anon1.specifiers)
14708 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14709 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14710 d = (((void *)0));
14711 decl->type = 2;
14712 decl->__anon1.inst = inst;
14713 }
14714 }
14715 }
14716 for(subType = type; subType; )
14717 {
14718 if(subType->kind == 8)
14719 {
14720 declareStruct = 1;
14721 break;
14722 }
14723 else if(subType->kind == 13)
14724 break;
14725 else if(subType->kind == 12)
14726 subType = subType->__anon1.__anon4.arrayType;
14727 else
14728 break;
14729 }
14730 FreeType(type);
14731 if(!d)
14732 break;
14733 }
14734 }
14735 if(decl->__anon1.__anon1.specifiers)
14736 {
14737 struct Specifier * s;
14738
14739 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
14740 {
14741 ProcessSpecifier(s, declareStruct, 1);
14742 }
14743 }
14744 break;
14745 }
14746 case 2:
14747 {
14748 ProcessInstantiationType(decl->__anon1.inst);
14749 break;
14750 }
14751 case 0:
14752 {
14753 struct Specifier * spec;
14754 struct Declarator * d;
14755 unsigned int declareStruct = 0;
14756
14757 if(decl->__anon1.__anon1.declarators)
14758 {
14759 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14760 {
14761 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14762 struct Type * subType;
14763
14764 ProcessDeclarator(d, 0);
14765 for(subType = type; subType; )
14766 {
14767 if(subType->kind == 8)
14768 {
14769 declareStruct = 1;
14770 break;
14771 }
14772 else if(subType->kind == 13)
14773 break;
14774 else if(subType->kind == 12)
14775 subType = subType->__anon1.__anon4.arrayType;
14776 else
14777 break;
14778 }
14779 FreeType(type);
14780 }
14781 }
14782 if(decl->__anon1.__anon1.specifiers)
14783 {
14784 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
14785 ProcessSpecifier(spec, declareStruct, warnClasses);
14786 }
14787 break;
14788 }
14789 }
14790 }
14791
14792 static void ProcessStatement(struct Statement * stmt)
14793 {
14794 yylloc = stmt->loc;
14795 switch(stmt->type)
14796 {
14797 case 0:
14798 ProcessStatement(stmt->__anon1.labeled.stmt);
14799 break;
14800 case 1:
14801 if(stmt->__anon1.caseStmt.exp)
14802 {
14803 FreeType(stmt->__anon1.caseStmt.exp->destType);
14804 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
14805 if(curSwitchType)
14806 curSwitchType->refCount++;
14807 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
14808 ComputeExpression(stmt->__anon1.caseStmt.exp);
14809 }
14810 if(stmt->__anon1.caseStmt.stmt)
14811 ProcessStatement(stmt->__anon1.caseStmt.stmt);
14812 break;
14813 case 2:
14814 {
14815 if(stmt->__anon1.compound.context)
14816 {
14817 struct Declaration * decl;
14818 struct Statement * s;
14819 struct Statement * prevCompound = curCompound;
14820 struct Context * prevContext = curContext;
14821
14822 if(!stmt->__anon1.compound.isSwitch)
14823 curCompound = stmt;
14824 curContext = stmt->__anon1.compound.context;
14825 if(stmt->__anon1.compound.declarations)
14826 {
14827 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
14828 ProcessDeclaration(decl, 1);
14829 }
14830 if(stmt->__anon1.compound.statements)
14831 {
14832 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
14833 ProcessStatement(s);
14834 }
14835 curContext = prevContext;
14836 curCompound = prevCompound;
14837 }
14838 break;
14839 }
14840 case 3:
14841 {
14842 struct Expression * exp;
14843
14844 if(stmt->__anon1.expressions)
14845 {
14846 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14847 ProcessExpressionType(exp);
14848 }
14849 break;
14850 }
14851 case 4:
14852 {
14853 struct Expression * exp;
14854
14855 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
14856 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
14857 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
14858 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
14859 {
14860 ProcessExpressionType(exp);
14861 }
14862 if(stmt->__anon1.ifStmt.stmt)
14863 ProcessStatement(stmt->__anon1.ifStmt.stmt);
14864 if(stmt->__anon1.ifStmt.elseStmt)
14865 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
14866 break;
14867 }
14868 case 5:
14869 {
14870 struct Type * oldSwitchType = curSwitchType;
14871
14872 if(stmt->__anon1.switchStmt.exp)
14873 {
14874 struct Expression * exp;
14875
14876 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
14877 {
14878 if(!exp->next)
14879 {
14880 ProcessExpressionType(exp);
14881 }
14882 if(!exp->next)
14883 curSwitchType = exp->expType;
14884 }
14885 }
14886 ProcessStatement(stmt->__anon1.switchStmt.stmt);
14887 curSwitchType = oldSwitchType;
14888 break;
14889 }
14890 case 6:
14891 {
14892 if(stmt->__anon1.whileStmt.exp)
14893 {
14894 struct Expression * exp;
14895
14896 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
14897 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
14898 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
14899 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
14900 {
14901 ProcessExpressionType(exp);
14902 }
14903 }
14904 if(stmt->__anon1.whileStmt.stmt)
14905 ProcessStatement(stmt->__anon1.whileStmt.stmt);
14906 break;
14907 }
14908 case 7:
14909 {
14910 if(stmt->__anon1.doWhile.exp)
14911 {
14912 struct Expression * exp;
14913
14914 if((*stmt->__anon1.doWhile.exp).last)
14915 {
14916 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
14917 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
14918 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
14919 }
14920 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
14921 {
14922 ProcessExpressionType(exp);
14923 }
14924 }
14925 if(stmt->__anon1.doWhile.stmt)
14926 ProcessStatement(stmt->__anon1.doWhile.stmt);
14927 break;
14928 }
14929 case 8:
14930 {
14931 struct Expression * exp;
14932
14933 if(stmt->__anon1.forStmt.init)
14934 ProcessStatement(stmt->__anon1.forStmt.init);
14935 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
14936 {
14937 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
14938 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
14939 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
14940 }
14941 if(stmt->__anon1.forStmt.check)
14942 ProcessStatement(stmt->__anon1.forStmt.check);
14943 if(stmt->__anon1.forStmt.increment)
14944 {
14945 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
14946 ProcessExpressionType(exp);
14947 }
14948 if(stmt->__anon1.forStmt.stmt)
14949 ProcessStatement(stmt->__anon1.forStmt.stmt);
14950 break;
14951 }
14952 case 18:
14953 {
14954 struct Identifier * id = stmt->__anon1.forEachStmt.id;
14955 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
14956 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
14957 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
14958 char iteratorType[1024];
14959 struct Type * source;
14960 struct Expression * e;
14961 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));
14962 struct Expression * arrayExp;
14963 const char * typeString = (((void *)0));
14964 int builtinCount = 0;
14965
14966 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
14967 {
14968 if(!e->next)
14969 {
14970 FreeType(e->destType);
14971 e->destType = ProcessTypeString("Container", 0);
14972 }
14973 if(!isBuiltin || e->next)
14974 ProcessExpressionType(e);
14975 }
14976 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
14977 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)))
14978 {
14979 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
14980 struct Symbol * symbol;
14981 struct Expression * expIt = (((void *)0));
14982 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
14983 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
14984 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
14985 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
14986
14987 if(inCompiler)
14988 {
14989 stmt->type = 2;
14990 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
14991 stmt->__anon1.compound.context->parent = curContext;
14992 curContext = stmt->__anon1.compound.context;
14993 }
14994 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
14995 {
14996 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
14997
14998 isCustomAVLTree = 1;
14999 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
15000 isMap = 1;
15001 }
15002 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15003 isArray = 1;
15004 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15005 {
15006 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15007
15008 isLinkList = 1;
15009 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15010 }
15011 if(inCompiler && isArray)
15012 {
15013 struct Declarator * decl;
15014 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15015
15016 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15017 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15018 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15019 }
15020 else if(isBuiltin)
15021 {
15022 struct Type * type = (((void *)0));
15023 char typeStringBuf[1024];
15024
15025 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15026 if(((struct Expression *)(*exp).last)->type == 11)
15027 {
15028 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15029
15030 if(typeName)
15031 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15032 }
15033 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)
15034 {
15035 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15036
15037 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15038 }
15039 else if(arrayExp->__anon1.list)
15040 {
15041 struct Expression * e;
15042
15043 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15044 {
15045 ProcessExpressionType(e);
15046 if(e->expType)
15047 {
15048 if(!type)
15049 {
15050 type = e->expType;
15051 type->refCount++;
15052 }
15053 else
15054 {
15055 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15056 {
15057 FreeType(type);
15058 type = e->expType;
15059 e->expType = (((void *)0));
15060 e = (*arrayExp->__anon1.list).first;
15061 ProcessExpressionType(e);
15062 if(e->expType)
15063 {
15064 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15065 {
15066 FreeType(e->expType);
15067 e->expType = (((void *)0));
15068 FreeType(type);
15069 type = (((void *)0));
15070 break;
15071 }
15072 }
15073 }
15074 }
15075 if(e->expType)
15076 {
15077 FreeType(e->expType);
15078 e->expType = (((void *)0));
15079 }
15080 }
15081 }
15082 if(type)
15083 {
15084 typeStringBuf[0] = '\0';
15085 PrintType(type, typeStringBuf, 0, 1);
15086 typeString = typeStringBuf;
15087 FreeType(type);
15088 }
15089 }
15090 if(typeString)
15091 {
15092 if(inCompiler)
15093 {
15094 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15095 struct Declarator * decl;
15096 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15097
15098 if(arrayExp->__anon1.list)
15099 {
15100 struct Expression * e;
15101
15102 builtinCount = (*arrayExp->__anon1.list).count;
15103 type = ProcessTypeString(typeString, 0);
15104 while((e = (*arrayExp->__anon1.list).first))
15105 {
15106 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15107 e->destType = type;
15108 type->refCount++;
15109 ProcessExpressionType(e);
15110 if(inCompiler)
15111 ListAdd(initializers, MkInitializerAssignment(e));
15112 }
15113 FreeType(type);
15114 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15115 }
15116 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15117 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15118 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15119 FreeList(exp, (void *)(FreeExpression));
15120 }
15121 else if(arrayExp->__anon1.list)
15122 {
15123 struct Expression * e;
15124
15125 type = ProcessTypeString(typeString, 0);
15126 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15127 {
15128 e->destType = type;
15129 type->refCount++;
15130 ProcessExpressionType(e);
15131 }
15132 FreeType(type);
15133 }
15134 }
15135 else
15136 {
15137 arrayExp->expType = ProcessTypeString("Container", 0);
15138 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15139 }
15140 }
15141 else if(inCompiler && isLinkList && !isList)
15142 {
15143 struct Declarator * decl;
15144 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15145
15146 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15147 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15148 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15149 }
15150 else if(inCompiler && _class->templateArgs)
15151 {
15152 if(isMap)
15153 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15154 else
15155 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15156 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)))))))));
15157 }
15158 if(inCompiler)
15159 {
15160 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15161 if(block)
15162 {
15163 switch(block->type)
15164 {
15165 case 2:
15166 if(block->__anon1.compound.context)
15167 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15168 break;
15169 case 4:
15170 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15171 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15172 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15173 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15174 break;
15175 case 5:
15176 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15177 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15178 break;
15179 case 6:
15180 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15181 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15182 break;
15183 case 7:
15184 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15185 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15186 break;
15187 case 8:
15188 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15189 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15190 break;
15191 case 18:
15192 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15193 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15194 break;
15195 }
15196 }
15197 if(filter)
15198 {
15199 block = MkIfStmt(filter, block, (((void *)0)));
15200 }
15201 if(isArray)
15202 {
15203 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));
15204 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15205 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15206 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15207 }
15208 else if(isBuiltin)
15209 {
15210 char count[128];
15211
15212 sprintf(count, "%d", builtinCount);
15213 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));
15214 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15215 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15216 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15217 }
15218 else if(isLinkList && !isList)
15219 {
15220 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15221 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15222
15223 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15224 {
15225 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));
15226 }
15227 else
15228 {
15229 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15230 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15231
15232 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));
15233 }
15234 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15235 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15236 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15237 }
15238 else
15239 {
15240 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15241 }
15242 ProcessExpressionType(expIt);
15243 if((*stmt->__anon1.compound.declarations).first)
15244 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15245 if(symbol)
15246 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15247 ProcessStatement(stmt);
15248 }
15249 else
15250 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15251 if(inCompiler)
15252 curContext = stmt->__anon1.compound.context->parent;
15253 break;
15254 }
15255 else
15256 {
15257 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15258 }
15259 break;
15260 }
15261 case 9:
15262 break;
15263 case 10:
15264 break;
15265 case 11:
15266 break;
15267 case 12:
15268 {
15269 struct Expression * exp;
15270
15271 if(stmt->__anon1.expressions)
15272 {
15273 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15274 {
15275 if(!exp->next)
15276 {
15277 if(curFunction && !curFunction->type)
15278 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15279 FreeType(exp->destType);
15280 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15281 if(exp->destType)
15282 exp->destType->refCount++;
15283 }
15284 ProcessExpressionType(exp);
15285 }
15286 }
15287 break;
15288 }
15289 case 14:
15290 {
15291 ProcessDeclaration(stmt->__anon1.decl, 1);
15292 break;
15293 }
15294 case 13:
15295 {
15296 struct AsmField * field;
15297
15298 if(stmt->__anon1.asmStmt.inputFields)
15299 {
15300 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15301 if(field->expression)
15302 ProcessExpressionType(field->expression);
15303 }
15304 if(stmt->__anon1.asmStmt.outputFields)
15305 {
15306 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15307 if(field->expression)
15308 ProcessExpressionType(field->expression);
15309 }
15310 if(stmt->__anon1.asmStmt.clobberedFields)
15311 {
15312 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15313 {
15314 if(field->expression)
15315 ProcessExpressionType(field->expression);
15316 }
15317 }
15318 break;
15319 }
15320 case 17:
15321 {
15322 struct PropertyWatch * propWatch;
15323 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15324 struct Expression * object = stmt->__anon1._watch.object;
15325 struct Expression * watcher = stmt->__anon1._watch.watcher;
15326
15327 if(watcher)
15328 ProcessExpressionType(watcher);
15329 if(object)
15330 ProcessExpressionType(object);
15331 if(inCompiler)
15332 {
15333 if(watcher || thisClass)
15334 {
15335 struct External * external = curExternal;
15336 struct Context * context = curContext;
15337
15338 stmt->type = 3;
15339 stmt->__anon1.expressions = MkList();
15340 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15341 {
15342 struct ClassFunction * func;
15343 char watcherName[1024];
15344 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;
15345 struct External * createdExternal;
15346
15347 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15348 if(propWatch->deleteWatch)
15349 strcat(watcherName, "_delete");
15350 else
15351 {
15352 struct Identifier * propID;
15353
15354 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15355 {
15356 strcat(watcherName, "_");
15357 strcat(watcherName, propID->string);
15358 }
15359 }
15360 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15361 {
15362 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)));
15363 ProcessClassFunctionBody(func, propWatch->compound);
15364 propWatch->compound = (((void *)0));
15365 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15366 FreeClassFunction(func);
15367 curExternal = createdExternal;
15368 ProcessFunction(createdExternal->__anon1.function);
15369 if(propWatch->deleteWatch)
15370 {
15371 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15372
15373 ListAdd(args, CopyExpression(object));
15374 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15375 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15376 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15377 }
15378 else
15379 {
15380 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15381 struct Identifier * propID;
15382
15383 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15384 {
15385 char propName[1024];
15386 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15387
15388 if(prop)
15389 {
15390 char getName[1024], setName[1024];
15391 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15392
15393 DeclareProperty(createdExternal, prop, setName, getName);
15394 strcpy(propName, "__ecereProp_");
15395 FullClassNameCat(propName, prop->_class->fullName, 0);
15396 strcat(propName, "_");
15397 FullClassNameCat(propName, prop->name, 1);
15398 ListAdd(args, CopyExpression(object));
15399 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15400 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15401 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15402 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15403 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15404 }
15405 else
15406 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15407 }
15408 }
15409 }
15410 else
15411 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15412 }
15413 curExternal = external;
15414 curContext = context;
15415 if(watcher)
15416 FreeExpression(watcher);
15417 if(object)
15418 FreeExpression(object);
15419 FreeList(watches, (void *)(FreePropertyWatch));
15420 }
15421 else
15422 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15423 }
15424 else
15425 {
15426 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15427 {
15428 ProcessStatement(propWatch->compound);
15429 }
15430 }
15431 break;
15432 }
15433 case 15:
15434 {
15435 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15436 struct Expression * object = stmt->__anon1._watch.object;
15437 struct __ecereNameSpace__ecere__com__Class * _class;
15438
15439 if(object)
15440 ProcessExpressionType(object);
15441 if(inCompiler)
15442 {
15443 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15444 if(_class)
15445 {
15446 struct Identifier * propID;
15447
15448 stmt->type = 3;
15449 stmt->__anon1.expressions = MkList();
15450 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15451 {
15452 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15453 }
15454 else if(!watches)
15455 {
15456 }
15457 if(watches)
15458 {
15459 for(propID = (*watches).first; propID; propID = propID->next)
15460 {
15461 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15462
15463 if(prop)
15464 {
15465 CreateFireWatcher(prop, object, stmt);
15466 }
15467 else
15468 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15469 }
15470 }
15471 else
15472 {
15473 struct __ecereNameSpace__ecere__com__Property * prop;
15474 struct __ecereNameSpace__ecere__com__Class * base;
15475
15476 for(base = _class; base; base = base->base)
15477 {
15478 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15479 {
15480 if(prop->isProperty && prop->isWatchable)
15481 {
15482 CreateFireWatcher(prop, object, stmt);
15483 }
15484 }
15485 }
15486 }
15487 if(object)
15488 FreeExpression(object);
15489 FreeList(watches, (void *)(FreeIdentifier));
15490 }
15491 else
15492 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15493 }
15494 break;
15495 }
15496 case 16:
15497 {
15498 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15499 struct Expression * object = stmt->__anon1._watch.object;
15500 struct Expression * watcher = stmt->__anon1._watch.watcher;
15501 struct __ecereNameSpace__ecere__com__Class * _class;
15502
15503 if(object)
15504 ProcessExpressionType(object);
15505 if(watcher)
15506 ProcessExpressionType(watcher);
15507 if(inCompiler)
15508 {
15509 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15510 if(watcher || thisClass)
15511 {
15512 if(_class)
15513 {
15514 struct Identifier * propID;
15515
15516 stmt->type = 3;
15517 stmt->__anon1.expressions = MkList();
15518 if(!watches)
15519 {
15520 struct __ecereNameSpace__ecere__sys__OldList * args;
15521
15522 args = MkList();
15523 ListAdd(args, CopyExpression(object));
15524 ListAdd(args, MkExpConstant("0"));
15525 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15526 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15527 }
15528 else
15529 {
15530 for(propID = (*watches).first; propID; propID = propID->next)
15531 {
15532 char propName[1024];
15533 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15534
15535 if(prop)
15536 {
15537 char getName[1024], setName[1024];
15538 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15539
15540 DeclareProperty(curExternal, prop, setName, getName);
15541 strcpy(propName, "__ecereProp_");
15542 FullClassNameCat(propName, prop->_class->fullName, 0);
15543 strcat(propName, "_");
15544 FullClassNameCat(propName, prop->name, 1);
15545 ListAdd(args, CopyExpression(object));
15546 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15547 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15548 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15549 }
15550 else
15551 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15552 }
15553 }
15554 if(object)
15555 FreeExpression(object);
15556 if(watcher)
15557 FreeExpression(watcher);
15558 FreeList(watches, (void *)(FreeIdentifier));
15559 }
15560 else
15561 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15562 }
15563 else
15564 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15565 }
15566 break;
15567 }
15568 }
15569 }
15570
15571 void ComputeDataTypes()
15572 {
15573 struct External * external;
15574
15575 currentClass = (((void *)0));
15576 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15577 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15578 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15579 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15580 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15581 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15582 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15583 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15584 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15585 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15586 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15587 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15588 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15589 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15590 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15591 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15592 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15593 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15594 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15595 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15596 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15597 for(external = (*ast).first; external; external = external->next)
15598 {
15599 afterExternal = curExternal = external;
15600 if(external->type == 0)
15601 {
15602 if(memoryGuard)
15603 {
15604 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15605 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15606 }
15607 currentClass = external->__anon1.function->_class;
15608 ProcessFunction(external->__anon1.function);
15609 }
15610 else if(external->type == 1)
15611 {
15612 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15613 {
15614 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15615 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15616 }
15617 currentClass = (((void *)0));
15618 if(external->__anon1.declaration)
15619 ProcessDeclaration(external->__anon1.declaration, 1);
15620 }
15621 else if(external->type == 2)
15622 {
15623 struct ClassDefinition * _class = external->__anon1._class;
15624
15625 currentClass = external->symbol->__anon1.registered;
15626 if(memoryGuard)
15627 {
15628 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15629 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15630 }
15631 if(_class->definitions)
15632 {
15633 ProcessClass(_class->definitions, _class->symbol);
15634 }
15635 if(inCompiler)
15636 {
15637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15638 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
15639 }
15640 }
15641 else if(external->type == 4)
15642 {
15643 thisNameSpace = external->__anon1.id->string;
15644 }
15645 }
15646 currentClass = (((void *)0));
15647 thisNameSpace = (((void *)0));
15648 curExternal = (((void *)0));
15649 }
15650
15651 void ProcessExpressionType(struct Expression * exp)
15652 {
15653 unsigned int unresolved = 0;
15654 struct Location oldyylloc = yylloc;
15655 unsigned int notByReference = 0;
15656
15657 if(!exp || exp->expType)
15658 return ;
15659 yylloc = exp->loc;
15660 switch(exp->type)
15661 {
15662 case 0:
15663 {
15664 struct Identifier * id = exp->__anon1.__anon1.identifier;
15665
15666 if(!id || !topContext)
15667 return ;
15668 if(id->_class && id->_class->__anon1.__anon1.name)
15669 {
15670 id->classSym = id->_class->__anon1.__anon1.symbol;
15671 }
15672 if(!strcmp(id->string, "__runtimePlatform"))
15673 {
15674 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15675 break;
15676 }
15677 else if(strstr(id->string, "__ecereClass") == id->string)
15678 {
15679 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15680 break;
15681 }
15682 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15683 {
15684 ReplaceClassMembers(exp, thisClass);
15685 if(exp->type != 0)
15686 {
15687 ProcessExpressionType(exp);
15688 break;
15689 }
15690 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15691 break;
15692 }
15693 else
15694 {
15695 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15696
15697 if(!symbol)
15698 {
15699 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15700 break;
15701 else
15702 {
15703 if(thisClass)
15704 {
15705 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15706 if(exp->type != 0)
15707 {
15708 ProcessExpressionType(exp);
15709 break;
15710 }
15711 }
15712 else if(currentClass && !id->_class)
15713 {
15714 if(ResolveIdWithClass(exp, currentClass, 1))
15715 break;
15716 }
15717 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15718 }
15719 }
15720 if(symbol)
15721 {
15722 struct Type * type = symbol->type;
15723 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15724
15725 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15726 {
15727 struct Context * context = SetupTemplatesContext(_class);
15728
15729 type = ReplaceThisClassType(_class);
15730 FinishTemplatesContext(context);
15731 if(type)
15732 type->refCount = 0;
15733 }
15734 FreeSpecifier(id->_class);
15735 id->_class = (((void *)0));
15736 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15737 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
15738 id->classSym = (((void *)0));
15739 exp->expType = type;
15740 if(type)
15741 type->refCount++;
15742 if(type && (type->kind == 15))
15743 exp->isConstant = 1;
15744 if(symbol->isParam || !strcmp(id->string, "this"))
15745 {
15746 if(_class && _class->type == 1 && !type->declaredWithStruct)
15747 exp->byReference = 1;
15748 }
15749 if(symbol->isIterator)
15750 {
15751 if(symbol->isIterator == 3)
15752 {
15753 exp->type = 5;
15754 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
15755 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
15756 exp->expType = (((void *)0));
15757 ProcessExpressionType(exp);
15758 }
15759 else if(symbol->isIterator != 4)
15760 {
15761 exp->type = 8;
15762 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
15763 exp->__anon1.member.exp->expType = exp->expType;
15764 exp->__anon1.member.member = MkIdentifier("data");
15765 exp->expType = (((void *)0));
15766 ProcessExpressionType(exp);
15767 }
15768 }
15769 break;
15770 }
15771 else
15772 {
15773 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
15774
15775 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15776 {
15777 char name[1024];
15778
15779 strcpy(name, thisNameSpace);
15780 strcat(name, "::");
15781 strcat(name, id->string);
15782 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
15783 }
15784 if(!definedExp)
15785 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
15786 if(definedExp)
15787 {
15788 int c;
15789
15790 for(c = 0; c < definedExpStackPos; c++)
15791 if(definedExpStack[c] == definedExp)
15792 break;
15793 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
15794 {
15795 struct Location backupYylloc = yylloc;
15796 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
15797
15798 definedExpStack[definedExpStackPos++] = definedExp;
15799 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
15800 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
15801 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15802
15803 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15804 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
15805 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
15806 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15807
15808 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15809 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
15810 echoOn = 0;
15811 parsedExpression = (((void *)0));
15812 resetScanner();
15813 expression_yyparse();
15814 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
15815 if(backInput)
15816 fileInput = backInput;
15817 yylloc = backupYylloc;
15818 if(parsedExpression)
15819 {
15820 FreeIdentifier(id);
15821 exp->type = 5;
15822 exp->__anon1.list = MkListOne(parsedExpression);
15823 ApplyLocation(parsedExpression, &yylloc);
15824 ProcessExpressionType(exp);
15825 definedExpStackPos--;
15826 return ;
15827 }
15828 definedExpStackPos--;
15829 }
15830 else
15831 {
15832 if(inCompiler)
15833 {
15834 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
15835 }
15836 }
15837 }
15838 else
15839 {
15840 struct GlobalData * data = (((void *)0));
15841
15842 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15843 {
15844 char name[1024];
15845
15846 strcpy(name, thisNameSpace);
15847 strcat(name, "::");
15848 strcat(name, id->string);
15849 data = FindGlobalData(name);
15850 }
15851 if(!data)
15852 data = FindGlobalData(id->string);
15853 if(data)
15854 {
15855 DeclareGlobalData(curExternal, data);
15856 exp->expType = data->dataType;
15857 if(data->dataType)
15858 data->dataType->refCount++;
15859 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15860 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
15861 FreeSpecifier(id->_class);
15862 id->_class = (((void *)0));
15863 break;
15864 }
15865 else
15866 {
15867 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
15868
15869 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15870 {
15871 char name[1024];
15872
15873 strcpy(name, thisNameSpace);
15874 strcat(name, "::");
15875 strcat(name, id->string);
15876 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
15877 }
15878 if(!function)
15879 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
15880 if(function)
15881 {
15882 char name[1024];
15883
15884 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15885 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
15886 name[0] = (char)0;
15887 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
15888 strcpy(name, "__ecereFunction_");
15889 FullClassNameCat(name, id->string, 0);
15890 if(DeclareFunction(curExternal, function, name))
15891 {
15892 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15893 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
15894 }
15895 exp->expType = function->dataType;
15896 if(function->dataType)
15897 function->dataType->refCount++;
15898 FreeSpecifier(id->_class);
15899 id->_class = (((void *)0));
15900 break;
15901 }
15902 }
15903 }
15904 }
15905 }
15906 unresolved = 1;
15907 break;
15908 }
15909 case 1:
15910 {
15911 if(!exp->__anon1.instance->_class)
15912 {
15913 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
15914 {
15915 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
15916 }
15917 }
15918 ProcessInstantiationType(exp->__anon1.instance);
15919 exp->isConstant = exp->__anon1.instance->isConstant;
15920 if(exp->__anon1.instance->_class)
15921 {
15922 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
15923 }
15924 break;
15925 }
15926 case 2:
15927 {
15928 if(!exp->expType)
15929 {
15930 char * constant = exp->__anon1.__anon1.constant;
15931 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
15932
15933 exp->expType = type;
15934 if(constant[0] == '\'')
15935 {
15936 if((int)((unsigned char *)constant)[1] > 127)
15937 {
15938 int nb;
15939 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
15940
15941 if(nb < 2)
15942 ch = constant[1];
15943 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
15944 exp->__anon1.__anon1.constant = PrintUInt(ch);
15945 type->kind = 8;
15946 type->__anon1._class = FindClass("unichar");
15947 type->isSigned = 0;
15948 }
15949 else
15950 {
15951 type->kind = 1;
15952 type->isSigned = 1;
15953 }
15954 }
15955 else
15956 {
15957 char * dot = strchr(constant, '.');
15958 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
15959 char * exponent;
15960
15961 if(isHex)
15962 {
15963 exponent = strchr(constant, 'p');
15964 if(!exponent)
15965 exponent = strchr(constant, 'P');
15966 }
15967 else
15968 {
15969 exponent = strchr(constant, 'e');
15970 if(!exponent)
15971 exponent = strchr(constant, 'E');
15972 }
15973 if(dot || exponent)
15974 {
15975 if(strchr(constant, 'f') || strchr(constant, 'F'))
15976 type->kind = 6;
15977 else
15978 type->kind = 7;
15979 type->isSigned = 1;
15980 }
15981 else
15982 {
15983 unsigned int isSigned = constant[0] == '-';
15984 char * endP = (((void *)0));
15985 long long i64 = strtoll(constant, &endP, 0);
15986 uint64 ui64 = strtoull(constant, &endP, 0);
15987 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
15988 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
15989
15990 if(isSigned)
15991 {
15992 if(i64 < (((int)0x80000000)))
15993 is64Bit = 1;
15994 }
15995 else
15996 {
15997 if(ui64 > (((int)0x7fffffff)))
15998 {
15999 if(ui64 > (0xffffffff))
16000 {
16001 is64Bit = 1;
16002 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16003 isSigned = 1;
16004 }
16005 }
16006 else if(constant[0] != '0' || !constant[1])
16007 isSigned = 1;
16008 }
16009 if(forceUnsigned)
16010 isSigned = 0;
16011 type->kind = is64Bit ? 4 : 3;
16012 type->isSigned = isSigned;
16013 }
16014 }
16015 exp->isConstant = 1;
16016 if(exp->destType && exp->destType->kind == 7)
16017 type->kind = 7;
16018 else if(exp->destType && exp->destType->kind == 6)
16019 type->kind = 6;
16020 else if(exp->destType && exp->destType->kind == 4)
16021 type->kind = 4;
16022 }
16023 break;
16024 }
16025 case 3:
16026 {
16027 exp->isConstant = 1;
16028 exp->expType = __extension__ ({
16029 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16030
16031 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16032 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16033
16034 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16035 }), __ecereInstance2;
16036 });
16037 break;
16038 }
16039 case 13:
16040 case 26:
16041 ProcessExpressionType(exp->__anon1._new.size);
16042 exp->expType = __extension__ ({
16043 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16044
16045 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16046 });
16047 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16048 break;
16049 case 14:
16050 case 27:
16051 ProcessExpressionType(exp->__anon1._renew.size);
16052 ProcessExpressionType(exp->__anon1._renew.exp);
16053 exp->expType = __extension__ ({
16054 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16055
16056 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16057 });
16058 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16059 break;
16060 case 4:
16061 {
16062 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16063 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16064 unsigned int useDestType = 0, useSideType = 0;
16065 struct Location oldyylloc = yylloc;
16066 unsigned int useSideUnit = 0;
16067 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16068 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16069
16070 switch(exp->__anon1.op.op)
16071 {
16072 case '=':
16073 case MUL_ASSIGN:
16074 case DIV_ASSIGN:
16075 case MOD_ASSIGN:
16076 case ADD_ASSIGN:
16077 case SUB_ASSIGN:
16078 case LEFT_ASSIGN:
16079 case RIGHT_ASSIGN:
16080 case AND_ASSIGN:
16081 case XOR_ASSIGN:
16082 case OR_ASSIGN:
16083 assign = 1;
16084 break;
16085 case '!':
16086 break;
16087 case AND_OP:
16088 case OR_OP:
16089 boolOps = 1;
16090 boolResult = 1;
16091 break;
16092 case EQ_OP:
16093 case '<':
16094 case '>':
16095 case LE_OP:
16096 case GE_OP:
16097 case NE_OP:
16098 boolResult = 1;
16099 useSideType = 1;
16100 break;
16101 case '+':
16102 case '-':
16103 useSideUnit = 1;
16104 useSideType = 1;
16105 useDestType = 1;
16106 break;
16107 case LEFT_OP:
16108 case RIGHT_OP:
16109 useSideType = 1;
16110 useDestType = 1;
16111 break;
16112 case '|':
16113 case '^':
16114 useSideType = 1;
16115 useDestType = 1;
16116 break;
16117 case '/':
16118 case '%':
16119 useSideType = 1;
16120 useDestType = 1;
16121 break;
16122 case '&':
16123 case '*':
16124 if(exp->__anon1.op.exp1)
16125 {
16126 useSideType = 1;
16127 useDestType = 1;
16128 }
16129 break;
16130 }
16131 if(exp->__anon1.op.op == '&')
16132 {
16133 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16134 {
16135 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16136 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16137
16138 if(symbol && symbol->isIterator == 2)
16139 {
16140 exp->type = 8;
16141 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16142 exp->__anon1.member.member = MkIdentifier("key");
16143 exp->expType = (((void *)0));
16144 exp->__anon1.op.exp2->expType = symbol->type;
16145 symbol->type->refCount++;
16146 ProcessExpressionType(exp);
16147 FreeType(dummy);
16148 break;
16149 }
16150 }
16151 }
16152 if(exp->__anon1.op.exp1)
16153 {
16154 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16155 useDestType = 0;
16156 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16157 {
16158 if(exp->__anon1.op.exp1->destType)
16159 FreeType(exp->__anon1.op.exp1->destType);
16160 exp->__anon1.op.exp1->destType = exp->destType;
16161 exp->__anon1.op.exp1->opDestType = 1;
16162 if(exp->destType)
16163 exp->destType->refCount++;
16164 }
16165 else if(!assign)
16166 {
16167 if(exp->__anon1.op.exp1->destType)
16168 FreeType(exp->__anon1.op.exp1->destType);
16169 exp->__anon1.op.exp1->destType = dummy;
16170 dummy->refCount++;
16171 }
16172 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16173 exp->__anon1.op.exp1->destType->count++;
16174 ProcessExpressionType(exp->__anon1.op.exp1);
16175 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16176 exp->__anon1.op.exp1->destType->count--;
16177 exp->__anon1.op.exp1->opDestType = 0;
16178 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)
16179 {
16180 exp->__anon1.op.exp2 = MkExpConstant("1");
16181 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16182 assign = 1;
16183 }
16184 if(exp->__anon1.op.exp1->destType == dummy)
16185 {
16186 FreeType(dummy);
16187 exp->__anon1.op.exp1->destType = (((void *)0));
16188 }
16189 type1 = exp->__anon1.op.exp1->expType;
16190 }
16191 if(exp->__anon1.op.exp2)
16192 {
16193 char expString[10240];
16194
16195 expString[0] = '\0';
16196 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16197 {
16198 if(exp->__anon1.op.exp1)
16199 {
16200 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16201 if(exp->__anon1.op.exp1->expType)
16202 exp->__anon1.op.exp1->expType->refCount++;
16203 }
16204 else
16205 {
16206 exp->__anon1.op.exp2->destType = exp->destType;
16207 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16208 exp->__anon1.op.exp2->opDestType = 1;
16209 if(exp->destType)
16210 exp->destType->refCount++;
16211 }
16212 if(type1)
16213 type1->refCount++;
16214 exp->expType = type1;
16215 }
16216 else if(assign)
16217 {
16218 if(inCompiler)
16219 PrintExpression(exp->__anon1.op.exp2, expString);
16220 if(type1 && type1->kind == 13)
16221 {
16222 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)
16223 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16224 else if(exp->__anon1.op.op == '=')
16225 {
16226 if(exp->__anon1.op.exp2->destType)
16227 FreeType(exp->__anon1.op.exp2->destType);
16228 exp->__anon1.op.exp2->destType = type1;
16229 if(type1)
16230 type1->refCount++;
16231 }
16232 }
16233 else
16234 {
16235 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)
16236 ;
16237 else
16238 {
16239 if(exp->__anon1.op.exp2->destType)
16240 FreeType(exp->__anon1.op.exp2->destType);
16241 exp->__anon1.op.exp2->destType = type1;
16242 if(type1)
16243 type1->refCount++;
16244 }
16245 }
16246 if(type1)
16247 type1->refCount++;
16248 exp->expType = type1;
16249 }
16250 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16251 {
16252 if(exp->__anon1.op.exp2->destType)
16253 FreeType(exp->__anon1.op.exp2->destType);
16254 exp->__anon1.op.exp2->destType = exp->destType;
16255 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16256 exp->__anon1.op.exp2->opDestType = 1;
16257 if(exp->destType)
16258 exp->destType->refCount++;
16259 }
16260 else
16261 {
16262 if(exp->__anon1.op.exp2->destType)
16263 FreeType(exp->__anon1.op.exp2->destType);
16264 exp->__anon1.op.exp2->destType = dummy;
16265 dummy->refCount++;
16266 }
16267 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))
16268 {
16269 FreeType(exp->__anon1.op.exp2->destType);
16270 exp->__anon1.op.exp2->destType = type1;
16271 type1->refCount++;
16272 }
16273 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16274 exp->__anon1.op.exp2->destType->count++;
16275 if(exp->__anon1.op.op == SIZEOF)
16276 {
16277 struct Expression * e = exp->__anon1.op.exp2;
16278
16279 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16280 {
16281 if(e->type == 5 || e->type == 32 || e->type == 23)
16282 {
16283 if(e->type == 23)
16284 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16285 else
16286 e = (*e->__anon1.list).last;
16287 }
16288 }
16289 if(e->type == 11 && e->__anon1.cast.exp)
16290 e->__anon1.cast.exp->needCast = 1;
16291 }
16292 ProcessExpressionType(exp->__anon1.op.exp2);
16293 exp->__anon1.op.exp2->opDestType = 0;
16294 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16295 exp->__anon1.op.exp2->destType->count--;
16296 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16297 {
16298 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)
16299 {
16300 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16301 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16302 }
16303 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)))
16304 {
16305 if(exp->__anon1.op.op == ADD_ASSIGN)
16306 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16307 }
16308 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))
16309 {
16310 if(exp->__anon1.op.op == ADD_ASSIGN)
16311 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16312 }
16313 else if(inCompiler)
16314 {
16315 char type1String[1024];
16316 char type2String[1024];
16317
16318 type1String[0] = '\0';
16319 type2String[0] = '\0';
16320 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16321 PrintType(type1, type2String, 0, 1);
16322 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16323 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16324 }
16325 }
16326 if(exp->__anon1.op.exp2->destType == dummy)
16327 {
16328 FreeType(dummy);
16329 exp->__anon1.op.exp2->destType = (((void *)0));
16330 }
16331 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16332 {
16333 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16334 type2->refCount = 1;
16335 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16336 type2->isSigned = 1;
16337 }
16338 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))
16339 {
16340 type2 = __extension__ ({
16341 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16342
16343 __ecereInstance1->kind = 3, __ecereInstance1;
16344 });
16345 type2->refCount = 1;
16346 type2->isSigned = 1;
16347 }
16348 else
16349 {
16350 type2 = exp->__anon1.op.exp2->expType;
16351 if(type2)
16352 type2->refCount++;
16353 }
16354 }
16355 dummy->kind = 0;
16356 if(exp->__anon1.op.op == SIZEOF)
16357 {
16358 exp->expType = __extension__ ({
16359 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16360
16361 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16362 });
16363 exp->isConstant = 1;
16364 }
16365 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16366 {
16367 exp->expType = Dereference(type2);
16368 if(type2 && type2->kind == 8)
16369 notByReference = 1;
16370 }
16371 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16372 exp->expType = Reference(type2);
16373 else if(!assign)
16374 {
16375 if(boolOps)
16376 {
16377 if(exp->__anon1.op.exp1)
16378 {
16379 if(exp->__anon1.op.exp1->destType)
16380 FreeType(exp->__anon1.op.exp1->destType);
16381 exp->__anon1.op.exp1->destType = MkClassType("bool");
16382 exp->__anon1.op.exp1->destType->truth = 1;
16383 if(!exp->__anon1.op.exp1->expType)
16384 ProcessExpressionType(exp->__anon1.op.exp1);
16385 else
16386 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16387 FreeType(exp->__anon1.op.exp1->expType);
16388 exp->__anon1.op.exp1->expType = MkClassType("bool");
16389 exp->__anon1.op.exp1->expType->truth = 1;
16390 }
16391 if(exp->__anon1.op.exp2)
16392 {
16393 if(exp->__anon1.op.exp2->destType)
16394 FreeType(exp->__anon1.op.exp2->destType);
16395 exp->__anon1.op.exp2->destType = MkClassType("bool");
16396 exp->__anon1.op.exp2->destType->truth = 1;
16397 if(!exp->__anon1.op.exp2->expType)
16398 ProcessExpressionType(exp->__anon1.op.exp2);
16399 else
16400 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16401 FreeType(exp->__anon1.op.exp2->expType);
16402 exp->__anon1.op.exp2->expType = MkClassType("bool");
16403 exp->__anon1.op.exp2->expType->truth = 1;
16404 }
16405 }
16406 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")))))
16407 {
16408 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"))))
16409 {
16410 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)))
16411 {
16412 struct Type * intType;
16413
16414 if(!type1->__anon1._class->__anon1.registered->dataType)
16415 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16416 if(!type2->__anon1._class->__anon1.registered->dataType)
16417 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16418 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
16419 if(exp->__anon1.op.exp1->destType)
16420 FreeType(exp->__anon1.op.exp1->destType);
16421 if(exp->__anon1.op.exp2->destType)
16422 FreeType(exp->__anon1.op.exp2->destType);
16423 exp->__anon1.op.exp1->destType = intType;
16424 exp->__anon1.op.exp2->destType = intType;
16425 intType->refCount++;
16426 }
16427 else
16428 {
16429 if(exp->__anon1.op.exp2->destType)
16430 FreeType(exp->__anon1.op.exp2->destType);
16431 exp->__anon1.op.exp2->destType = type1;
16432 type1->refCount++;
16433 if(exp->__anon1.op.exp1->destType)
16434 FreeType(exp->__anon1.op.exp1->destType);
16435 exp->__anon1.op.exp1->destType = type2;
16436 type2->refCount++;
16437 }
16438 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)
16439 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);
16440 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16441 {
16442 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16443
16444 if(argExp)
16445 {
16446 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16447
16448 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16449 ProcessExpressionType(exp->__anon1.op.exp1);
16450 if(type2->kind != 13)
16451 {
16452 ProcessExpressionType(classExp);
16453 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16454 if(!exp->__anon1.op.exp2->expType)
16455 {
16456 if(type2)
16457 FreeType(type2);
16458 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16459 type2->refCount++;
16460 }
16461 ProcessExpressionType(exp->__anon1.op.exp2);
16462 }
16463 }
16464 }
16465 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)))
16466 {
16467 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16468 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16469 exp->expType = type1;
16470 if(type1)
16471 type1->refCount++;
16472 }
16473 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)))
16474 {
16475 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16476 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16477 exp->expType = type2;
16478 if(type2)
16479 type2->refCount++;
16480 }
16481 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))
16482 {
16483 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16484 }
16485 else
16486 {
16487 unsigned int success = 0;
16488
16489 if(type1->kind == 13 && type2->kind == 13)
16490 {
16491 if(exp->__anon1.op.op == '+')
16492 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16493 else if(exp->__anon1.op.op == '-')
16494 {
16495 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16496 {
16497 exp->expType = __extension__ ({
16498 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16499
16500 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16501 });
16502 success = 1;
16503 if(type1->__anon1.type->kind == 20)
16504 {
16505 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16506
16507 if(argExp)
16508 {
16509 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16510
16511 ProcessExpressionType(classExp);
16512 exp->type = 5;
16513 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"))));
16514 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16515 FreeType(dummy);
16516 return ;
16517 }
16518 }
16519 }
16520 }
16521 }
16522 if(!success && exp->__anon1.op.exp1->type == 2)
16523 {
16524 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16525 {
16526 if(exp->expType)
16527 FreeType(exp->expType);
16528 exp->expType = exp->__anon1.op.exp1->destType;
16529 if(exp->__anon1.op.exp1->destType)
16530 exp->__anon1.op.exp1->destType->refCount++;
16531 success = 1;
16532 }
16533 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16534 {
16535 if(exp->expType)
16536 FreeType(exp->expType);
16537 exp->expType = exp->__anon1.op.exp2->destType;
16538 if(exp->__anon1.op.exp2->destType)
16539 exp->__anon1.op.exp2->destType->refCount++;
16540 success = 1;
16541 }
16542 }
16543 else if(!success)
16544 {
16545 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16546 {
16547 if(exp->expType)
16548 FreeType(exp->expType);
16549 exp->expType = exp->__anon1.op.exp2->destType;
16550 if(exp->__anon1.op.exp2->destType)
16551 exp->__anon1.op.exp2->destType->refCount++;
16552 success = 1;
16553 }
16554 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16555 {
16556 if(exp->expType)
16557 FreeType(exp->expType);
16558 exp->expType = exp->__anon1.op.exp1->destType;
16559 if(exp->__anon1.op.exp1->destType)
16560 exp->__anon1.op.exp1->destType->refCount++;
16561 success = 1;
16562 }
16563 }
16564 if(!success)
16565 {
16566 char expString1[10240];
16567 char expString2[10240];
16568 char type1[1024];
16569 char type2[1024];
16570
16571 expString1[0] = '\0';
16572 expString2[0] = '\0';
16573 type1[0] = '\0';
16574 type2[0] = '\0';
16575 if(inCompiler)
16576 {
16577 PrintExpression(exp->__anon1.op.exp1, expString1);
16578 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16579 PrintExpression(exp->__anon1.op.exp2, expString2);
16580 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16581 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16582 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16583 }
16584 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16585 }
16586 }
16587 }
16588 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)
16589 {
16590 if(exp->__anon1.op.exp1->destType)
16591 FreeType(exp->__anon1.op.exp1->destType);
16592 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16593 if(type2->__anon1._class->__anon1.registered->dataType)
16594 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16595 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16596 exp->expType = type2;
16597 if(type2)
16598 type2->refCount++;
16599 }
16600 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)
16601 {
16602 if(exp->__anon1.op.exp2->destType)
16603 FreeType(exp->__anon1.op.exp2->destType);
16604 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16605 if(type1->__anon1._class->__anon1.registered->dataType)
16606 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16607 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16608 exp->expType = type1;
16609 if(type1)
16610 type1->refCount++;
16611 }
16612 else if(type1)
16613 {
16614 unsigned int valid = 0;
16615
16616 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
16617 {
16618 if(exp->__anon1.op.exp2->destType)
16619 FreeType(exp->__anon1.op.exp2->destType);
16620 if(!type1->__anon1._class->__anon1.registered->dataType)
16621 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16622 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16623 exp->__anon1.op.exp2->destType->refCount++;
16624 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16625 if(type2)
16626 FreeType(type2);
16627 type2 = exp->__anon1.op.exp2->destType;
16628 if(type2)
16629 type2->refCount++;
16630 exp->expType = type2;
16631 type2->refCount++;
16632 }
16633 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
16634 {
16635 if(exp->__anon1.op.exp1->destType)
16636 FreeType(exp->__anon1.op.exp1->destType);
16637 if(!type2->__anon1._class->__anon1.registered->dataType)
16638 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16639 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16640 exp->__anon1.op.exp1->destType->refCount++;
16641 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16642 type1 = exp->__anon1.op.exp1->destType;
16643 exp->expType = type1;
16644 type1->refCount++;
16645 }
16646 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
16647 {
16648 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
16649 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
16650
16651 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
16652 {
16653 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16654 {
16655 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16656 {
16657 if(exp->expType)
16658 FreeType(exp->expType);
16659 exp->expType = exp->__anon1.op.exp2->expType;
16660 if(exp->__anon1.op.exp2->expType)
16661 exp->__anon1.op.exp2->expType->refCount++;
16662 valid = 1;
16663 }
16664 }
16665 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16666 {
16667 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16668 {
16669 if(exp->expType)
16670 FreeType(exp->expType);
16671 exp->expType = exp->__anon1.op.exp1->expType;
16672 if(exp->__anon1.op.exp1->expType)
16673 exp->__anon1.op.exp1->expType->refCount++;
16674 valid = 1;
16675 }
16676 }
16677 }
16678 else
16679 {
16680 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16681 {
16682 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16683 {
16684 if(exp->expType)
16685 FreeType(exp->expType);
16686 exp->expType = exp->__anon1.op.exp1->expType;
16687 if(exp->__anon1.op.exp1->expType)
16688 exp->__anon1.op.exp1->expType->refCount++;
16689 valid = 1;
16690 }
16691 }
16692 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16693 {
16694 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16695 {
16696 if(exp->expType)
16697 FreeType(exp->expType);
16698 exp->expType = exp->__anon1.op.exp2->expType;
16699 if(exp->__anon1.op.exp2->expType)
16700 exp->__anon1.op.exp2->expType->refCount++;
16701 valid = 1;
16702 }
16703 }
16704 }
16705 }
16706 if(!valid)
16707 {
16708 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))
16709 {
16710 if(exp->__anon1.op.exp1->destType)
16711 FreeType(exp->__anon1.op.exp1->destType);
16712 exp->__anon1.op.exp1->destType = type2;
16713 type2->refCount++;
16714 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16715 {
16716 if(exp->expType)
16717 FreeType(exp->expType);
16718 exp->expType = exp->__anon1.op.exp1->destType;
16719 if(exp->__anon1.op.exp1->destType)
16720 exp->__anon1.op.exp1->destType->refCount++;
16721 }
16722 }
16723 else
16724 {
16725 if(exp->__anon1.op.exp2->destType)
16726 FreeType(exp->__anon1.op.exp2->destType);
16727 exp->__anon1.op.exp2->destType = type1;
16728 type1->refCount++;
16729 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16730 {
16731 if(exp->expType)
16732 FreeType(exp->expType);
16733 exp->expType = exp->__anon1.op.exp2->destType;
16734 if(exp->__anon1.op.exp2->destType)
16735 exp->__anon1.op.exp2->destType->refCount++;
16736 }
16737 else if(type1 && type2)
16738 {
16739 char expString1[10240];
16740 char expString2[10240];
16741 char type1String[1024];
16742 char type2String[1024];
16743
16744 expString1[0] = '\0';
16745 expString2[0] = '\0';
16746 type1String[0] = '\0';
16747 type2String[0] = '\0';
16748 if(inCompiler)
16749 {
16750 PrintExpression(exp->__anon1.op.exp1, expString1);
16751 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16752 PrintExpression(exp->__anon1.op.exp2, expString2);
16753 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16754 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
16755 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
16756 }
16757 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
16758 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
16759 {
16760 exp->expType = exp->__anon1.op.exp1->expType;
16761 if(exp->__anon1.op.exp1->expType)
16762 exp->__anon1.op.exp1->expType->refCount++;
16763 }
16764 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16765 {
16766 exp->expType = exp->__anon1.op.exp2->expType;
16767 if(exp->__anon1.op.exp2->expType)
16768 exp->__anon1.op.exp2->expType->refCount++;
16769 }
16770 }
16771 }
16772 }
16773 }
16774 else if(type2)
16775 {
16776 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16777 {
16778 struct Type * oldType = exp->__anon1.op.exp1->expType;
16779
16780 exp->__anon1.op.exp1->expType = (((void *)0));
16781 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16782 FreeType(oldType);
16783 else
16784 exp->__anon1.op.exp1->expType = oldType;
16785 }
16786 if(exp->__anon1.op.exp1->destType)
16787 FreeType(exp->__anon1.op.exp1->destType);
16788 exp->__anon1.op.exp1->destType = type2;
16789 type2->refCount++;
16790 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16791 {
16792 if(exp->expType)
16793 FreeType(exp->expType);
16794 exp->expType = exp->__anon1.op.exp1->destType;
16795 if(exp->__anon1.op.exp1->destType)
16796 exp->__anon1.op.exp1->destType->refCount++;
16797 }
16798 }
16799 }
16800 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
16801 {
16802 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16803 {
16804 if(exp->__anon1.op.exp1->destType)
16805 FreeType(exp->__anon1.op.exp1->destType);
16806 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16807 if(type2->__anon1._class->__anon1.registered->dataType)
16808 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16809 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16810 }
16811 if(exp->__anon1.op.op == '!')
16812 {
16813 exp->expType = MkClassType("bool");
16814 exp->expType->truth = 1;
16815 }
16816 else
16817 {
16818 exp->expType = type2;
16819 if(type2)
16820 type2->refCount++;
16821 }
16822 }
16823 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
16824 {
16825 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16826 {
16827 if(exp->__anon1.op.exp2->destType)
16828 FreeType(exp->__anon1.op.exp2->destType);
16829 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16830 if(type1->__anon1._class->__anon1.registered->dataType)
16831 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16832 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16833 }
16834 exp->expType = type1;
16835 if(type1)
16836 type1->refCount++;
16837 }
16838 }
16839 yylloc = exp->loc;
16840 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
16841 {
16842 char expString[10000];
16843
16844 expString[0] = '\0';
16845 if(inCompiler)
16846 {
16847 PrintExpression(exp->__anon1.op.exp1, expString);
16848 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16849 }
16850 if(expString[0])
16851 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16852 }
16853 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
16854 {
16855 char expString[10240];
16856
16857 expString[0] = '\0';
16858 if(inCompiler)
16859 {
16860 PrintExpression(exp->__anon1.op.exp2, expString);
16861 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16862 }
16863 if(expString[0])
16864 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16865 }
16866 if(boolResult)
16867 {
16868 FreeType(exp->expType);
16869 exp->expType = MkClassType("bool");
16870 exp->expType->truth = 1;
16871 }
16872 if(exp->__anon1.op.op != SIZEOF)
16873 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
16874 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
16875 {
16876 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
16877 }
16878 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
16879 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
16880 yylloc = oldyylloc;
16881 FreeType(dummy);
16882 if(type2)
16883 FreeType(type2);
16884 break;
16885 }
16886 case 5:
16887 case 32:
16888 {
16889 struct Expression * e;
16890
16891 exp->isConstant = 1;
16892 for(e = (*exp->__anon1.list).first; e; e = e->next)
16893 {
16894 if(!e->next)
16895 {
16896 FreeType(e->destType);
16897 e->opDestType = exp->opDestType;
16898 e->destType = exp->destType;
16899 if(e->destType)
16900 {
16901 exp->destType->refCount++;
16902 }
16903 }
16904 ProcessExpressionType(e);
16905 if(!exp->expType && !e->next)
16906 {
16907 exp->expType = e->expType;
16908 if(e->expType)
16909 e->expType->refCount++;
16910 }
16911 if(!e->isConstant)
16912 exp->isConstant = 0;
16913 }
16914 e = (*exp->__anon1.list).first;
16915 if(!e->next && e->type == 8)
16916 {
16917 struct Expression * next = exp->next, * prev = exp->prev;
16918
16919 FreeType(exp->expType);
16920 FreeType(exp->destType);
16921 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16922 *exp = *e;
16923 exp->prev = prev;
16924 exp->next = next;
16925 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
16926 ProcessExpressionType(exp);
16927 }
16928 break;
16929 }
16930 case 6:
16931 {
16932 struct Expression * e;
16933
16934 exp->isConstant = 1;
16935 ProcessExpressionType(exp->__anon1.index.exp);
16936 if(!exp->__anon1.index.exp->isConstant)
16937 exp->isConstant = 0;
16938 if(exp->__anon1.index.exp->expType)
16939 {
16940 struct Type * source = exp->__anon1.index.exp->expType;
16941
16942 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
16943 {
16944 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
16945 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
16946
16947 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
16948 {
16949 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
16950 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
16951 {
16952 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
16953
16954 if(type->kind == 8)
16955 type->constant = 1;
16956 else if(type->kind == 13)
16957 {
16958 struct Type * t = type;
16959
16960 while(t->kind == 13)
16961 t = t->__anon1.type;
16962 t->constant = 1;
16963 }
16964 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
16965 }
16966 }
16967 }
16968 }
16969 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
16970 {
16971 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
16972 {
16973 if(e->destType)
16974 FreeType(e->destType);
16975 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
16976 }
16977 ProcessExpressionType(e);
16978 if(!e->next)
16979 {
16980 }
16981 if(!e->isConstant)
16982 exp->isConstant = 0;
16983 }
16984 if(!exp->expType)
16985 exp->expType = Dereference(exp->__anon1.index.exp->expType);
16986 if(exp->expType)
16987 DeclareType(curExternal, exp->expType, 1, 0);
16988 break;
16989 }
16990 case 7:
16991 {
16992 struct Expression * e;
16993 struct Type * functionType;
16994 struct Type * methodType = (((void *)0));
16995 char name[1024];
16996
16997 name[0] = '\0';
16998 if(inCompiler)
16999 {
17000 PrintExpression(exp->__anon1.call.exp, name);
17001 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17002 {
17003 PrintExpression(exp->__anon1.call.exp, name);
17004 }
17005 }
17006 if(exp->__anon1.call.exp->type == 0)
17007 {
17008 struct Expression * idExp = exp->__anon1.call.exp;
17009 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17010
17011 if(!strcmp(id->string, "__builtin_frame_address"))
17012 {
17013 exp->expType = ProcessTypeString("void *", 1);
17014 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17015 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17016 break;
17017 }
17018 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17019 {
17020 exp->expType = ProcessTypeString("int", 1);
17021 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17022 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17023 break;
17024 }
17025 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17026 {
17027 struct Expression * a = (((void *)0));
17028 struct Expression * b = (((void *)0));
17029 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17030
17031 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17032 {
17033 a = (*exp->__anon1.call.arguments).first;
17034 b = (*exp->__anon1.call.arguments).last;
17035 tempExp1 = a;
17036 tempExp2 = b;
17037 }
17038 else if((*exp->__anon1.call.arguments).count == 1)
17039 {
17040 a = (*exp->__anon1.call.arguments).first;
17041 tempExp1 = a;
17042 }
17043 if(a)
17044 {
17045 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17046 idExp->__anon1.__anon1.identifier = (((void *)0));
17047 FreeExpContents(exp);
17048 ProcessExpressionType(a);
17049 if(b)
17050 ProcessExpressionType(b);
17051 exp->type = 5;
17052 exp->__anon1.list = MkList();
17053 if(a->expType && (!b || b->expType))
17054 {
17055 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17056 {
17057 if(inCompiler)
17058 {
17059 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17060 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17061 struct Declaration * decl;
17062 char temp1[1024], temp2[1024];
17063
17064 GetTypeSpecs(a->expType, specs);
17065 if(a && !a->isConstant && a->type != 0)
17066 {
17067 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17068 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17069 tempExp1 = QMkExpId(temp1);
17070 tempExp1->expType = a->expType;
17071 if(a->expType)
17072 a->expType->refCount++;
17073 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17074 }
17075 if(b && !b->isConstant && b->type != 0)
17076 {
17077 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17078 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17079 tempExp2 = QMkExpId(temp2);
17080 tempExp2->expType = b->expType;
17081 if(b->expType)
17082 b->expType->refCount++;
17083 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17084 }
17085 decl = MkDeclaration(specs, decls);
17086 if(!curCompound->__anon1.compound.declarations)
17087 curCompound->__anon1.compound.declarations = MkList();
17088 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17089 }
17090 }
17091 }
17092 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17093 {
17094 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17095
17096 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17097 exp->expType = a->expType;
17098 if(a->expType)
17099 a->expType->refCount++;
17100 }
17101 else if(!strcmp(id->string, "Abs"))
17102 {
17103 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17104 exp->expType = a->expType;
17105 if(a->expType)
17106 a->expType->refCount++;
17107 }
17108 else if(!strcmp(id->string, "Sgn"))
17109 {
17110 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"))))));
17111 exp->expType = ProcessTypeString("int", 0);
17112 }
17113 FreeExpression(tempExp1);
17114 if(tempExp2)
17115 FreeExpression(tempExp2);
17116 FreeIdentifier(id);
17117 break;
17118 }
17119 }
17120 }
17121 {
17122 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17123
17124 if(!exp->__anon1.call.exp->destType)
17125 {
17126 exp->__anon1.call.exp->destType = dummy;
17127 dummy->refCount++;
17128 }
17129 ProcessExpressionType(exp->__anon1.call.exp);
17130 if(exp->__anon1.call.exp->destType == dummy)
17131 {
17132 FreeType(dummy);
17133 exp->__anon1.call.exp->destType = (((void *)0));
17134 }
17135 FreeType(dummy);
17136 }
17137 functionType = exp->__anon1.call.exp->expType;
17138 if(functionType && functionType->kind == 16)
17139 {
17140 methodType = functionType;
17141 functionType = methodType->__anon1.__anon3.method->dataType;
17142 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17143 {
17144 char typeString[1024];
17145
17146 typeString[0] = '\0';
17147 {
17148 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17149
17150 functionType->__anon1.__anon2.thisClass = (((void *)0));
17151 PrintType(functionType, typeString, 1, 1);
17152 functionType->__anon1.__anon2.thisClass = back;
17153 }
17154 if(strstr(typeString, "thisclass"))
17155 {
17156 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17157 struct Declarator * decl;
17158
17159 {
17160 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17161
17162 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17163 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))
17164 thisClassParams = 0;
17165 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17166 {
17167 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17168
17169 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17170 ProcessDeclarator(decl, 1);
17171 thisClass = backupThisClass;
17172 }
17173 thisClassParams = 1;
17174 functionType = ProcessType(specs, decl);
17175 functionType->refCount = 0;
17176 FinishTemplatesContext(context);
17177 {
17178 struct Type * p, * op;
17179
17180 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)
17181 {
17182 if(op->kind == 21)
17183 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17184 }
17185 }
17186 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17187 {
17188 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17189 }
17190 }
17191 FreeList(specs, (void *)(FreeSpecifier));
17192 FreeDeclarator(decl);
17193 }
17194 }
17195 }
17196 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17197 {
17198 struct Type * type = functionType->__anon1.type;
17199
17200 if(!functionType->refCount)
17201 {
17202 functionType->__anon1.type = (((void *)0));
17203 FreeType(functionType);
17204 }
17205 functionType = type;
17206 }
17207 if(functionType && functionType->kind != 11)
17208 {
17209 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17210 }
17211 else if(functionType)
17212 {
17213 unsigned int emptyParams = 0, noParams = 0;
17214 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17215 struct Type * type = functionType->__anon1.__anon2.params.first;
17216 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17217 int extra = 0;
17218 struct Location oldyylloc = yylloc;
17219
17220 if(!type)
17221 emptyParams = 1;
17222 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17223 {
17224 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17225 e = e->next;
17226 }
17227 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17228 {
17229 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)
17230 {
17231 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17232 if(e)
17233 {
17234 e->destType = type;
17235 e = e->next;
17236 type = functionType->__anon1.__anon2.params.first;
17237 }
17238 else
17239 type->refCount = 0;
17240 }
17241 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17242 {
17243 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17244 type->byReference = functionType->byReference;
17245 type->typedByReference = functionType->typedByReference;
17246 if(e)
17247 {
17248 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17249 e = e->next;
17250 e->destType = type;
17251 e = e->next;
17252 type = functionType->__anon1.__anon2.params.first;
17253 }
17254 else
17255 type->refCount = 0;
17256 }
17257 }
17258 if(type && type->kind == 0)
17259 {
17260 noParams = 1;
17261 if(!type->refCount)
17262 FreeType(type);
17263 type = (((void *)0));
17264 }
17265 for(; e; e = e->next)
17266 {
17267 if(!type && !emptyParams)
17268 {
17269 yylloc = e->loc;
17270 if(methodType && methodType->__anon1.__anon3.methodClass)
17271 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);
17272 else
17273 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);
17274 break;
17275 }
17276 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17277 {
17278 struct Type * templatedType = (((void *)0));
17279 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17280 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17281 int id = 0;
17282
17283 if(_class && _class->templateArgs)
17284 {
17285 struct __ecereNameSpace__ecere__com__Class * sClass;
17286
17287 for(sClass = _class; sClass; sClass = sClass->base)
17288 {
17289 if(sClass->templateClass)
17290 sClass = sClass->templateClass;
17291 id = 0;
17292 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17293 {
17294 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17295 {
17296 struct __ecereNameSpace__ecere__com__Class * nextClass;
17297
17298 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17299 {
17300 if(nextClass->templateClass)
17301 nextClass = nextClass->templateClass;
17302 id += nextClass->templateParams.count;
17303 }
17304 break;
17305 }
17306 id++;
17307 }
17308 if(curParam)
17309 break;
17310 }
17311 }
17312 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17313 {
17314 unsigned int constant = type->constant;
17315 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17316
17317 {
17318 struct Context * context = SetupTemplatesContext(_class);
17319
17320 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17321 FinishTemplatesContext(context);
17322 }
17323 if(templatedType->kind == 8 && constant)
17324 templatedType->constant = 1;
17325 else if(templatedType->kind == 13)
17326 {
17327 struct Type * t = templatedType->__anon1.type;
17328
17329 while(t->kind == 13)
17330 t = t->__anon1.type;
17331 if(constant)
17332 t->constant = constant;
17333 }
17334 e->destType = templatedType;
17335 if(templatedType)
17336 {
17337 templatedType->passAsTemplate = 1;
17338 }
17339 }
17340 else
17341 {
17342 e->destType = type;
17343 if(type)
17344 type->refCount++;
17345 }
17346 }
17347 else
17348 {
17349 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17350 {
17351 e->destType = type->prev;
17352 e->destType->refCount++;
17353 }
17354 else
17355 {
17356 e->destType = type;
17357 if(type)
17358 type->refCount++;
17359 }
17360 }
17361 if(type && type->kind != 14)
17362 {
17363 struct Type * next = type->next;
17364
17365 if(!type->refCount)
17366 FreeType(type);
17367 type = next;
17368 }
17369 }
17370 if(type && type->kind != 14)
17371 {
17372 if(methodType && methodType->__anon1.__anon3.methodClass)
17373 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);
17374 else
17375 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);
17376 }
17377 yylloc = oldyylloc;
17378 if(type && !type->refCount)
17379 FreeType(type);
17380 }
17381 else
17382 {
17383 functionType = __extension__ ({
17384 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17385
17386 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17387 });
17388 if(exp->__anon1.call.exp->type == 0)
17389 {
17390 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17391
17392 if(inCompiler)
17393 {
17394 struct Symbol * symbol;
17395 struct Location oldyylloc = yylloc;
17396
17397 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17398 if(strstr(string, "__builtin_") == string)
17399 {
17400 if(exp->destType)
17401 {
17402 functionType->__anon1.__anon2.returnType = exp->destType;
17403 exp->destType->refCount++;
17404 }
17405 }
17406 else
17407 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17408 symbol = __extension__ ({
17409 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17410
17411 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17412 });
17413 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17414 if(strstr(symbol->string, "::"))
17415 globalContext->hasNameSpace = 1;
17416 yylloc = oldyylloc;
17417 }
17418 }
17419 else if(exp->__anon1.call.exp->type == 8)
17420 {
17421 }
17422 else
17423 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17424 if(!functionType->__anon1.__anon2.returnType)
17425 {
17426 functionType->__anon1.__anon2.returnType = __extension__ ({
17427 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17428
17429 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17430 });
17431 }
17432 }
17433 if(functionType && functionType->kind == 11)
17434 {
17435 exp->expType = functionType->__anon1.__anon2.returnType;
17436 if(functionType->__anon1.__anon2.returnType)
17437 functionType->__anon1.__anon2.returnType->refCount++;
17438 if(!functionType->refCount)
17439 FreeType(functionType);
17440 }
17441 if(exp->__anon1.call.arguments)
17442 {
17443 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17444 ProcessExpressionType(e);
17445 }
17446 break;
17447 }
17448 case 8:
17449 {
17450 struct Type * type;
17451 struct Location oldyylloc = yylloc;
17452 unsigned int thisPtr;
17453 struct Expression * checkExp = exp->__anon1.member.exp;
17454
17455 while(checkExp)
17456 {
17457 if(checkExp->type == 11)
17458 checkExp = checkExp->__anon1.cast.exp;
17459 else if(checkExp->type == 5)
17460 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17461 else
17462 break;
17463 }
17464 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17465 exp->thisPtr = thisPtr;
17466 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17467 {
17468 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17469 }
17470 ProcessExpressionType(exp->__anon1.member.exp);
17471 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)
17472 {
17473 exp->isConstant = 0;
17474 }
17475 else
17476 exp->isConstant = exp->__anon1.member.exp->isConstant;
17477 type = exp->__anon1.member.exp->expType;
17478 yylloc = exp->loc;
17479 if(type && (type->kind == 20))
17480 {
17481 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17482 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17483
17484 if(_class)
17485 {
17486 for(param = _class->templateParams.first; param; param = param->next)
17487 {
17488 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17489 break;
17490 }
17491 }
17492 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17493 {
17494 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17495
17496 if(argExp)
17497 {
17498 struct Expression * expMember = exp->__anon1.member.exp;
17499 struct Declarator * decl;
17500 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17501 char thisClassTypeString[1024];
17502
17503 FreeIdentifier(exp->__anon1.member.member);
17504 ProcessExpressionType(argExp);
17505 {
17506 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17507
17508 if(colon)
17509 {
17510 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17511 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17512 }
17513 else
17514 strcpy(thisClassTypeString, _class->fullName);
17515 }
17516 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17517 exp->expType = ProcessType(specs, decl);
17518 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17519 {
17520 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17521 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17522 int paramCount = 0;
17523 int lastParam = -1;
17524 char templateString[1024];
17525 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17526
17527 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17528 for(cClass = expClass; cClass; cClass = cClass->base)
17529 {
17530 int p = 0;
17531
17532 for(param = cClass->templateParams.first; param; param = param->next)
17533 {
17534 int id = p;
17535 struct __ecereNameSpace__ecere__com__Class * sClass;
17536 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17537
17538 for(sClass = cClass->base; sClass; sClass = sClass->base)
17539 id += sClass->templateParams.count;
17540 arg = expClass->templateArgs[id];
17541 for(sClass = _class; sClass; sClass = sClass->base)
17542 {
17543 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17544 int p = 0;
17545 struct __ecereNameSpace__ecere__com__Class * nextClass;
17546
17547 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17548 p += nextClass->templateParams.count;
17549 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17550 {
17551 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17552 {
17553 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17554 {
17555 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17556 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17557 break;
17558 }
17559 }
17560 }
17561 }
17562 {
17563 char argument[256];
17564
17565 argument[0] = '\0';
17566 switch(param->type)
17567 {
17568 case 2:
17569 {
17570 char expString[1024];
17571 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17572 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17573 struct Expression * exp;
17574 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17575
17576 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17577 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17578 ProcessExpressionType(exp);
17579 ComputeExpression(exp);
17580 expString[0] = '\0';
17581 PrintExpression(exp, expString);
17582 strcat(argument, expString);
17583 FreeExpression(exp);
17584 break;
17585 }
17586 case 1:
17587 {
17588 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17589 break;
17590 }
17591 case 0:
17592 {
17593 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17594 {
17595 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17596 strcat(argument, thisClassTypeString);
17597 else
17598 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17599 }
17600 break;
17601 }
17602 }
17603 if(argument[0])
17604 {
17605 if(paramCount)
17606 strcat(templateString, ", ");
17607 if(lastParam != p - 1)
17608 {
17609 strcat(templateString, param->name);
17610 strcat(templateString, " = ");
17611 }
17612 strcat(templateString, argument);
17613 paramCount++;
17614 lastParam = p;
17615 }
17616 p++;
17617 }
17618 }
17619 }
17620 {
17621 int len = strlen(templateString);
17622
17623 if(templateString[len - 1] == '>')
17624 templateString[len++] = ' ';
17625 templateString[len++] = '>';
17626 templateString[len++] = '\0';
17627 }
17628 {
17629 struct Context * context = SetupTemplatesContext(_class);
17630
17631 FreeType(exp->expType);
17632 exp->expType = ProcessTypeString(templateString, 0);
17633 FinishTemplatesContext(context);
17634 }
17635 }
17636 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
17637 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
17638 exp->type = 5;
17639 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")))))))));
17640 }
17641 }
17642 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
17643 {
17644 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
17645 }
17646 }
17647 if(type && (type->kind == 20))
17648 ;
17649 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)))
17650 {
17651 struct Identifier * id = exp->__anon1.member.member;
17652 int typeKind = type->kind;
17653 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));
17654
17655 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
17656 {
17657 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
17658 typeKind = 8;
17659 }
17660 if(id)
17661 {
17662 if(typeKind == 3 || typeKind == 15)
17663 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
17664 else if(!_class)
17665 {
17666 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17667 {
17668 _class = type->__anon1._class->__anon1.registered;
17669 }
17670 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
17671 {
17672 _class = FindClass("char *")->__anon1.registered;
17673 }
17674 else if(type->kind == 13)
17675 {
17676 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
17677 FreeType(exp->expType);
17678 exp->expType = ProcessTypeString("uintptr", 0);
17679 exp->byReference = 1;
17680 }
17681 else
17682 {
17683 char string[1024] = "";
17684 struct Symbol * classSym;
17685
17686 PrintTypeNoConst(type, string, 0, 1);
17687 classSym = FindClass(string);
17688 if(classSym)
17689 _class = classSym->__anon1.registered;
17690 }
17691 }
17692 }
17693 if(_class && id)
17694 {
17695 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
17696 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
17697 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17698 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
17699 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
17700
17701 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
17702 exp->__anon1.member.memberType = 1;
17703 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
17704 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
17705 if(typeKind != 19)
17706 {
17707 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
17708 {
17709 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17710 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
17711 {
17712 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17713 if(prop)
17714 member = (((void *)0));
17715 }
17716 if(!member && !prop)
17717 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17718 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
17719 exp->__anon1.member.thisPtr = 1;
17720 }
17721 else
17722 {
17723 unsigned int useMemberForNonConst = 0;
17724
17725 if(!id->classSym)
17726 {
17727 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
17728 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);
17729 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17730 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
17731 }
17732 if((!prop || useMemberForNonConst) && !member)
17733 {
17734 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
17735 if(!method)
17736 {
17737 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17738 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);
17739 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17740 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17741 }
17742 }
17743 if(member && prop)
17744 {
17745 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
17746 prop = (((void *)0));
17747 else
17748 member = (((void *)0));
17749 }
17750 }
17751 }
17752 if(!prop && !member && !method)
17753 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
17754 if(!prop && !member && !method)
17755 {
17756 if(typeKind == 19)
17757 {
17758 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
17759 if(classProp)
17760 {
17761 exp->__anon1.member.memberType = 5;
17762 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
17763 }
17764 else
17765 {
17766 char structName[1024];
17767 struct Identifier * id = exp->__anon1.member.member;
17768 struct Expression * classExp = exp->__anon1.member.exp;
17769
17770 type->refCount++;
17771 FreeType(classExp->expType);
17772 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
17773 strcpy(structName, "__ecereClassData_");
17774 FullClassNameCat(structName, type->__anon1._class->string, 0);
17775 exp->type = 9;
17776 exp->__anon1.member.member = id;
17777 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"))))))));
17778 FreeType(type);
17779 ProcessExpressionType(exp);
17780 return ;
17781 }
17782 }
17783 else
17784 {
17785 struct Symbol * classSym = FindClass(id->string);
17786
17787 if(classSym)
17788 {
17789 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
17790
17791 if(convertClass)
17792 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
17793 }
17794 }
17795 }
17796 if(exp->__anon1.member.exp->destType)
17797 FreeType(exp->__anon1.member.exp->destType);
17798 {
17799 if(method && !method->_class->symbol)
17800 method->_class->symbol = FindClass(method->_class->fullName);
17801 if(prop && !prop->_class->symbol)
17802 prop->_class->symbol = FindClass(prop->_class->fullName);
17803 exp->__anon1.member.exp->destType = __extension__ ({
17804 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17805
17806 __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;
17807 });
17808 }
17809 if(prop)
17810 {
17811 exp->__anon1.member.memberType = 1;
17812 if(!prop->dataType)
17813 ProcessPropertyType(prop);
17814 exp->expType = prop->dataType;
17815 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
17816 {
17817 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17818
17819 CopyTypeInto(type, exp->expType);
17820 type->refCount = 1;
17821 type->constant = 1;
17822 exp->expType = type;
17823 }
17824 else if(prop->dataType)
17825 prop->dataType->refCount++;
17826 }
17827 else if(member)
17828 {
17829 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17830 {
17831 FreeExpContents(exp);
17832 exp->type = 0;
17833 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17834 ProcessExpressionType(exp);
17835 return ;
17836 }
17837 exp->__anon1.member.memberType = 3;
17838 DeclareStruct(curExternal, _class->fullName, 0, 1);
17839 if(member->_class != _class)
17840 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
17841 if(!member->dataType)
17842 {
17843 struct Context * context = SetupTemplatesContext(_class);
17844
17845 member->dataType = ProcessTypeString(member->dataTypeString, 0);
17846 FinishTemplatesContext(context);
17847 }
17848 exp->expType = member->dataType;
17849 if(member->dataType)
17850 member->dataType->refCount++;
17851 }
17852 else if(revConvert)
17853 {
17854 exp->__anon1.member.memberType = 4;
17855 exp->expType = MkClassType(revConvert->_class->fullName);
17856 }
17857 else if(method)
17858 {
17859 {
17860 exp->__anon1.member.memberType = 2;
17861 }
17862 if(!method->dataType)
17863 ProcessMethodType(method);
17864 exp->expType = __extension__ ({
17865 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17866
17867 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
17868 });
17869 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
17870 exp->expType->__anon1.__anon3.usedClass = _class;
17871 }
17872 else if(!classProp)
17873 {
17874 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17875 {
17876 FreeExpContents(exp);
17877 exp->type = 0;
17878 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17879 FreeType(exp->expType);
17880 exp->expType = MkClassType("ecere::com::Class");
17881 return ;
17882 }
17883 yylloc = exp->__anon1.member.member->loc;
17884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
17885 if(inCompiler)
17886 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
17887 }
17888 if(_class && exp->expType)
17889 {
17890 struct __ecereNameSpace__ecere__com__Class * tClass;
17891
17892 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
17893 while(tClass && !tClass->templateClass)
17894 tClass = tClass->base;
17895 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
17896 {
17897 int id = 0;
17898 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17899 struct __ecereNameSpace__ecere__com__Class * sClass;
17900
17901 for(sClass = tClass; sClass; sClass = sClass->base)
17902 {
17903 id = 0;
17904 if(sClass->templateClass)
17905 sClass = sClass->templateClass;
17906 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17907 {
17908 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
17909 {
17910 for(sClass = sClass->base; sClass; sClass = sClass->base)
17911 id += sClass->templateParams.count;
17912 break;
17913 }
17914 id++;
17915 }
17916 if(curParam)
17917 break;
17918 }
17919 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
17920 {
17921 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
17922 struct Context * context = SetupTemplatesContext(tClass);
17923 unsigned int constant = exp->expType->constant;
17924 unsigned int passAsTemplate = 0;
17925 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
17926 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
17927
17928 if(t && t->kind == 8 && t->__anon1._class)
17929 thisClassFrom = t->__anon1._class->__anon1.registered;
17930 else
17931 thisClassFrom = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "class");
17932 FreeType(t);
17933 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
17934 FreeType(exp->expType);
17935 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17936 exp->expType->thisClassFrom = thisClassFrom;
17937 if(exp->expType->kind == 8 && constant)
17938 exp->expType->constant = 1;
17939 else if(exp->expType->kind == 13)
17940 {
17941 struct Type * t = exp->expType->__anon1.type;
17942
17943 while(t->kind == 13)
17944 t = t->__anon1.type;
17945 if(constant)
17946 t->constant = constant;
17947 }
17948 if(exp->expType)
17949 {
17950 if(exp->expType->kind == 21)
17951 {
17952 FreeType(exp->expType);
17953 exp->expType = ReplaceThisClassType(_class);
17954 }
17955 if(passAsTemplate)
17956 exp->expType->passAsTemplate = 1;
17957 if(!exp->destType)
17958 {
17959 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17960 if(exp->destType->kind == 8 && constant)
17961 exp->destType->constant = 1;
17962 else if(exp->destType->kind == 13)
17963 {
17964 struct Type * t = exp->destType->__anon1.type;
17965
17966 while(t->kind == 13)
17967 t = t->__anon1.type;
17968 if(constant)
17969 t->constant = constant;
17970 }
17971 if(exp->destType->kind == 21)
17972 {
17973 FreeType(exp->destType);
17974 exp->destType = ReplaceThisClassType(_class);
17975 }
17976 }
17977 }
17978 FinishTemplatesContext(context);
17979 }
17980 }
17981 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)
17982 {
17983 int id = 0;
17984 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17985 struct __ecereNameSpace__ecere__com__Class * sClass;
17986
17987 for(sClass = tClass; sClass; sClass = sClass->base)
17988 {
17989 id = 0;
17990 if(sClass->templateClass)
17991 sClass = sClass->templateClass;
17992 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17993 {
17994 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
17995 {
17996 for(sClass = sClass->base; sClass; sClass = sClass->base)
17997 id += sClass->templateParams.count;
17998 break;
17999 }
18000 id++;
18001 }
18002 if(curParam)
18003 break;
18004 }
18005 if(curParam)
18006 {
18007 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18008 struct Context * context = SetupTemplatesContext(tClass);
18009 struct Type * basicType;
18010
18011 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18012 if(basicType)
18013 {
18014 if(basicType->kind == 21)
18015 {
18016 FreeType(basicType);
18017 basicType = ReplaceThisClassType(_class);
18018 }
18019 FreeType(exp->expType);
18020 exp->expType = __extension__ ({
18021 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18022
18023 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18024 });
18025 if(!exp->destType)
18026 {
18027 exp->destType = exp->expType;
18028 exp->destType->refCount++;
18029 }
18030 {
18031 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18032 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18033 struct Declarator * decl;
18034
18035 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18036 *newExp = *exp;
18037 if(exp->destType)
18038 exp->destType->refCount++;
18039 if(exp->expType)
18040 exp->expType->refCount++;
18041 exp->type = 11;
18042 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18043 exp->__anon1.cast.exp = newExp;
18044 }
18045 }
18046 FinishTemplatesContext(context);
18047 }
18048 }
18049 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18050 {
18051 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18052
18053 if(expClass)
18054 {
18055 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18056 int p = 0;
18057 int paramCount = 0;
18058 int lastParam = -1;
18059 char templateString[1024];
18060 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18061
18062 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18063 while(cClass != expClass)
18064 {
18065 struct __ecereNameSpace__ecere__com__Class * sClass;
18066
18067 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18068 ;
18069 cClass = sClass;
18070 for(param = cClass->templateParams.first; param; param = param->next)
18071 {
18072 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18073 int cp = 0;
18074 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18075 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18076
18077 while(cClassCur != tClass && !paramCur)
18078 {
18079 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18080
18081 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18082 ;
18083 cClassCur = sClassCur;
18084 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18085 {
18086 if(!strcmp(paramCur->name, param->name))
18087 {
18088 break;
18089 }
18090 cp++;
18091 }
18092 }
18093 if(paramCur && paramCur->type == 0)
18094 arg = tClass->templateArgs[cp];
18095 else
18096 arg = expClass->templateArgs[p];
18097 {
18098 char argument[256];
18099
18100 argument[0] = '\0';
18101 switch(param->type)
18102 {
18103 case 2:
18104 {
18105 char expString[1024];
18106 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18107 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18108 struct Expression * exp;
18109 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18110
18111 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18112 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18113 ProcessExpressionType(exp);
18114 ComputeExpression(exp);
18115 expString[0] = '\0';
18116 PrintExpression(exp, expString);
18117 strcat(argument, expString);
18118 FreeExpression(exp);
18119 break;
18120 }
18121 case 1:
18122 {
18123 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18124 break;
18125 }
18126 case 0:
18127 {
18128 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18129 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18130 break;
18131 }
18132 }
18133 if(argument[0])
18134 {
18135 if(paramCount)
18136 strcat(templateString, ", ");
18137 if(lastParam != p - 1)
18138 {
18139 strcat(templateString, param->name);
18140 strcat(templateString, " = ");
18141 }
18142 strcat(templateString, argument);
18143 paramCount++;
18144 lastParam = p;
18145 }
18146 }
18147 p++;
18148 }
18149 }
18150 {
18151 int len = strlen(templateString);
18152
18153 if(templateString[len - 1] == '>')
18154 templateString[len++] = ' ';
18155 templateString[len++] = '>';
18156 templateString[len++] = '\0';
18157 }
18158 FreeType(exp->expType);
18159 {
18160 struct Context * context = SetupTemplatesContext(tClass);
18161
18162 exp->expType = ProcessTypeString(templateString, 0);
18163 FinishTemplatesContext(context);
18164 }
18165 }
18166 }
18167 }
18168 }
18169 else
18170 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)");
18171 }
18172 else if(type && (type->kind == 9 || type->kind == 10))
18173 {
18174 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18175
18176 if(memberType)
18177 {
18178 exp->expType = memberType;
18179 if(memberType)
18180 memberType->refCount++;
18181 }
18182 }
18183 else
18184 {
18185 char expString[10240];
18186
18187 expString[0] = '\0';
18188 if(inCompiler)
18189 {
18190 PrintExpression(exp, expString);
18191 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18192 }
18193 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18194 }
18195 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18196 {
18197 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18198 {
18199 struct Identifier * id = exp->__anon1.member.member;
18200 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));
18201
18202 if(_class)
18203 {
18204 FreeType(exp->expType);
18205 exp->expType = ReplaceThisClassType(_class);
18206 }
18207 }
18208 }
18209 yylloc = oldyylloc;
18210 break;
18211 }
18212 case 9:
18213 {
18214 struct Type * destType = exp->destType;
18215
18216 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18217 {
18218 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18219 }
18220 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18221 exp->type = 8;
18222 if(destType)
18223 destType->count++;
18224 ProcessExpressionType(exp);
18225 if(destType)
18226 destType->count--;
18227 break;
18228 }
18229 case 15:
18230 {
18231 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18232
18233 if(classSym && classSym->__anon1.registered)
18234 {
18235 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18236 {
18237 char name[1024];
18238 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18239
18240 name[0] = '\0';
18241 DeclareStruct(curExternal, classSym->string, 0, 1);
18242 FreeSpecifier(exp->__anon1._class);
18243 FullClassNameCat(name, classSym->string, 0);
18244 if(b->offset == 0)
18245 {
18246 exp->type = 10;
18247 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18248 }
18249 else
18250 {
18251 struct Expression * e;
18252
18253 exp->type = 4;
18254 if(b->structSize == b->offset)
18255 exp->__anon1.op.exp1 = MkExpConstant("0");
18256 else
18257 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18258 exp->__anon1.op.op = '+';
18259 e = exp;
18260 while(b->offset != 0)
18261 {
18262 struct Symbol * sym;
18263 struct Expression * typeSize;
18264
18265 b = b->base;
18266 sym = FindClass(b->fullName);
18267 name[0] = '\0';
18268 DeclareStruct(curExternal, sym->string, 0, 1);
18269 FullClassNameCat(name, sym->string, 0);
18270 if(b->structSize == b->offset)
18271 typeSize = MkExpConstant("0");
18272 else
18273 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18274 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18275 e = e->__anon1.op.exp2;
18276 }
18277 }
18278 }
18279 else
18280 {
18281 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18282 {
18283 FreeSpecifier(exp->__anon1._class);
18284 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18285 exp->type = 2;
18286 }
18287 else
18288 {
18289 char className[1024];
18290
18291 strcpy(className, "__ecereClass_");
18292 FullClassNameCat(className, classSym->string, 1);
18293 DeclareClass(curExternal, classSym, className);
18294 FreeExpContents(exp);
18295 exp->type = 9;
18296 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18297 exp->__anon1.member.member = MkIdentifier("structSize");
18298 }
18299 }
18300 }
18301 exp->expType = __extension__ ({
18302 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18303
18304 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18305 });
18306 break;
18307 }
18308 case 10:
18309 {
18310 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
18311
18312 exp->expType = __extension__ ({
18313 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18314
18315 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18316 });
18317 exp->isConstant = 1;
18318 DeclareType(curExternal, type, 1, 0);
18319 FreeType(type);
18320 break;
18321 }
18322 case 11:
18323 {
18324 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18325
18326 type->count = 1;
18327 FreeType(exp->__anon1.cast.exp->destType);
18328 exp->__anon1.cast.exp->destType = type;
18329 type->refCount++;
18330 type->casted = 1;
18331 ProcessExpressionType(exp->__anon1.cast.exp);
18332 type->casted = 0;
18333 type->count = 0;
18334 exp->expType = type;
18335 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18336 {
18337 void * prev = exp->prev, * next = exp->next;
18338 struct Type * expType = exp->__anon1.cast.exp->destType;
18339 struct Expression * castExp = exp->__anon1.cast.exp;
18340 struct Type * destType = exp->destType;
18341
18342 if(expType)
18343 expType->refCount++;
18344 FreeType(exp->expType);
18345 FreeTypeName(exp->__anon1.cast.typeName);
18346 *exp = *castExp;
18347 FreeType(exp->expType);
18348 FreeType(exp->destType);
18349 exp->expType = expType;
18350 exp->destType = destType;
18351 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
18352 exp->prev = prev;
18353 exp->next = next;
18354 }
18355 else
18356 {
18357 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18358 }
18359 break;
18360 }
18361 case 33:
18362 {
18363 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18364
18365 exp->expType = type;
18366 break;
18367 }
18368 case 34:
18369 {
18370 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18371
18372 ProcessExpressionType(exp->__anon1.vaArg.exp);
18373 exp->expType = type;
18374 break;
18375 }
18376 case 12:
18377 {
18378 struct Expression * e;
18379 struct Type * t = exp->destType;
18380
18381 if(t && !exp->destType->casted)
18382 {
18383 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18384 CopyTypeInto(t, exp->destType);
18385 t->count = 0;
18386 }
18387 else if(t)
18388 t->refCount++;
18389 exp->isConstant = 1;
18390 FreeType(exp->__anon1.cond.cond->destType);
18391 exp->__anon1.cond.cond->destType = MkClassType("bool");
18392 exp->__anon1.cond.cond->destType->truth = 1;
18393 ProcessExpressionType(exp->__anon1.cond.cond);
18394 if(!exp->__anon1.cond.cond->isConstant)
18395 exp->isConstant = 0;
18396 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18397 {
18398 if(!e->next)
18399 {
18400 FreeType(e->destType);
18401 e->destType = t;
18402 if(e->destType)
18403 e->destType->refCount++;
18404 }
18405 ProcessExpressionType(e);
18406 if(!e->next)
18407 {
18408 exp->expType = e->expType;
18409 if(e->expType)
18410 e->expType->refCount++;
18411 }
18412 if(!e->isConstant)
18413 exp->isConstant = 0;
18414 }
18415 FreeType(exp->__anon1.cond.elseExp->destType);
18416 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18417 if(exp->__anon1.cond.elseExp->destType)
18418 exp->__anon1.cond.elseExp->destType->refCount++;
18419 ProcessExpressionType(exp->__anon1.cond.elseExp);
18420 if(!exp->__anon1.cond.elseExp->isConstant)
18421 exp->isConstant = 0;
18422 FreeType(t);
18423 break;
18424 }
18425 case 23:
18426 {
18427 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18428 {
18429 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18430
18431 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18432 {
18433 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18434 if(exp->destType)
18435 exp->destType->refCount++;
18436 }
18437 ProcessStatement(exp->__anon1.compound);
18438 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18439 if(exp->expType)
18440 exp->expType->refCount++;
18441 }
18442 break;
18443 }
18444 case 24:
18445 {
18446 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18447
18448 if(spec && spec->type == 1)
18449 {
18450 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18451 exp->expType->kind = 19;
18452 exp->byReference = 1;
18453 }
18454 else
18455 {
18456 exp->expType = MkClassType("ecere::com::Class");
18457 exp->byReference = 1;
18458 }
18459 break;
18460 }
18461 case 25:
18462 {
18463 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18464
18465 if(_class)
18466 {
18467 struct Identifier * id = exp->__anon1.classData.id;
18468 char structName[1024];
18469 struct Expression * classExp;
18470
18471 strcpy(structName, "__ecereClassData_");
18472 FullClassNameCat(structName, _class->fullName, 0);
18473 exp->type = 9;
18474 exp->__anon1.member.member = id;
18475 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18476 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18477 else
18478 classExp = MkExpIdentifier(MkIdentifier("class"));
18479 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"))))))));
18480 ProcessExpressionType(exp);
18481 return ;
18482 }
18483 break;
18484 }
18485 case 35:
18486 {
18487 struct Type * type = (((void *)0));
18488 const char * typeString = (((void *)0));
18489 char typeStringBuf[1024];
18490
18491 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))
18492 {
18493 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18494
18495 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18496 }
18497 else if(exp->__anon1.list)
18498 {
18499 struct Expression * e;
18500
18501 for(e = (*exp->__anon1.list).first; e; e = e->next)
18502 {
18503 ProcessExpressionType(e);
18504 if(e->expType)
18505 {
18506 if(!type)
18507 {
18508 type = e->expType;
18509 type->refCount++;
18510 }
18511 else
18512 {
18513 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18514 {
18515 FreeType(type);
18516 type = e->expType;
18517 e->expType = (((void *)0));
18518 e = (*exp->__anon1.list).first;
18519 ProcessExpressionType(e);
18520 if(e->expType)
18521 {
18522 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18523 {
18524 FreeType(e->expType);
18525 e->expType = (((void *)0));
18526 FreeType(type);
18527 type = (((void *)0));
18528 break;
18529 }
18530 }
18531 }
18532 }
18533 if(e->expType)
18534 {
18535 FreeType(e->expType);
18536 e->expType = (((void *)0));
18537 }
18538 }
18539 }
18540 if(type)
18541 {
18542 typeStringBuf[0] = '\0';
18543 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18544 typeString = typeStringBuf;
18545 FreeType(type);
18546 type = (((void *)0));
18547 }
18548 }
18549 if(typeString)
18550 {
18551 char templateString[1024];
18552 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18553 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18554 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18555 struct Expression * expExt;
18556 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18557
18558 sprintf(templateString, "Container<%s>", typeString);
18559 if(exp->__anon1.list)
18560 {
18561 struct Expression * e;
18562
18563 type = ProcessTypeString(typeString, 0);
18564 while((e = (*exp->__anon1.list).first))
18565 {
18566 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18567 e->destType = type;
18568 type->refCount++;
18569 ProcessExpressionType(e);
18570 ListAdd(initializers, MkInitializerAssignment(e));
18571 }
18572 FreeType(type);
18573 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18574 }
18575 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18576 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18577 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18578 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18579 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18580 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18581 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18582 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18583 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18584 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18585 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18586
18587 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18588 })));
18589 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18590 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18591 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18592 exp->expType = ProcessTypeString(templateString, 0);
18593 exp->type = 5;
18594 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18595 ProcessExpressionType(expExt);
18596 }
18597 else
18598 {
18599 exp->expType = ProcessTypeString("Container", 0);
18600 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18601 }
18602 break;
18603 }
18604 }
18605 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18606 {
18607 FreeType(exp->expType);
18608 exp->expType = ReplaceThisClassType(thisClass);
18609 }
18610 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)
18611 {
18612 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
18613
18614 if(symbol)
18615 {
18616 if(exp->expType->kind != 15)
18617 {
18618 struct Type * member;
18619 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
18620
18621 FreeType(exp->expType);
18622 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18623 exp->expType->kind = symbol->type->kind;
18624 exp->expType->refCount++;
18625 exp->expType->__anon1.__anon1.enumName = enumName;
18626 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
18627 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18628 member->refCount++;
18629 }
18630 else
18631 {
18632 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
18633
18634 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18635 {
18636 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);
18637
18638 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
18639 }
18640 }
18641 }
18642 }
18643 yylloc = exp->loc;
18644 if(exp->destType && (exp->destType->kind == 18))
18645 ;
18646 else if(exp->destType && !exp->destType->keepCast)
18647 {
18648 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
18649 exp->needTemplateCast = 1;
18650 if(exp->destType->kind == 0)
18651 ;
18652 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
18653 {
18654 unsigned int invalidCast = 0;
18655
18656 if(inCompiler && exp->destType->count && exp->expType)
18657 {
18658 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
18659 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
18660
18661 if(c1 && c1->type != 1)
18662 c1 = (((void *)0));
18663 if(c2 && c2->type != 1)
18664 c2 = (((void *)0));
18665 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
18666 invalidCast = 1;
18667 }
18668 if(!exp->destType->count || unresolved || invalidCast)
18669 {
18670 if(!exp->expType)
18671 {
18672 yylloc = exp->loc;
18673 if(exp->destType->kind != 14)
18674 {
18675 char type2[1024];
18676
18677 type2[0] = '\0';
18678 if(inCompiler)
18679 {
18680 char expString[10240];
18681
18682 expString[0] = '\0';
18683 PrintType(exp->destType, type2, 0, 1);
18684 if(inCompiler)
18685 {
18686 PrintExpression(exp, expString);
18687 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18688 }
18689 if(unresolved)
18690 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
18691 else if(exp->type != 16)
18692 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
18693 }
18694 }
18695 else
18696 {
18697 char expString[10240];
18698
18699 expString[0] = '\0';
18700 if(inCompiler)
18701 {
18702 PrintExpression(exp, expString);
18703 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18704 }
18705 if(unresolved)
18706 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
18707 else if(exp->type != 16)
18708 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18709 }
18710 }
18711 else
18712 {
18713 char type1[1024];
18714 char type2[1024];
18715
18716 type1[0] = '\0';
18717 type2[0] = '\0';
18718 if(inCompiler)
18719 {
18720 PrintType(exp->expType, type1, 0, 1);
18721 PrintType(exp->destType, type2, 0, 1);
18722 }
18723 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)))
18724 ;
18725 else
18726 {
18727 char expString[10240];
18728
18729 expString[0] = '\0';
18730 if(inCompiler)
18731 {
18732 PrintExpression(exp, expString);
18733 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18734 }
18735 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")))
18736 {
18737 if(invalidCast)
18738 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18739 else
18740 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18741 }
18742 if(!inCompiler)
18743 {
18744 FreeType(exp->expType);
18745 exp->destType->refCount++;
18746 exp->expType = exp->destType;
18747 }
18748 }
18749 }
18750 }
18751 }
18752 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))
18753 {
18754 struct Expression * nbExp = GetNonBracketsExp(exp);
18755
18756 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
18757 {
18758 struct Expression * e = MoveExpContents(exp);
18759
18760 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
18761 exp->type = 11;
18762 exp->__anon1.cast.exp->destType = exp->destType;
18763 if(exp->destType)
18764 exp->destType->refCount++;
18765 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
18766 }
18767 }
18768 }
18769 else if(unresolved)
18770 {
18771 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
18772 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);
18773 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
18774 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
18775 }
18776 else if(!exp->expType && exp->type != 16)
18777 {
18778 char expString[10240];
18779
18780 expString[0] = '\0';
18781 if(inCompiler)
18782 {
18783 PrintExpression(exp, expString);
18784 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18785 }
18786 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18787 }
18788 if(inCompiler)
18789 ApplyAnyObjectLogic(exp);
18790 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)))
18791 {
18792 exp->byReference = 1;
18793 }
18794 yylloc = oldyylloc;
18795 }
18796
18797 static void ProcessFunction(struct FunctionDefinition * function)
18798 {
18799 struct Identifier * id = GetDeclId(function->declarator);
18800 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18801 struct Type * type = symbol ? symbol->type : (((void *)0));
18802 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18803 struct Context * oldTopContext = topContext;
18804
18805 yylloc = function->loc;
18806 if(type && type->__anon1.__anon2.thisClass)
18807 {
18808 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18809 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18810 char className[1024];
18811 char structName[1024];
18812 struct Declarator * funcDecl;
18813 struct Symbol * thisSymbol;
18814 unsigned int typedObject = 0;
18815
18816 if(_class && !_class->base)
18817 {
18818 _class = currentClass;
18819 if(_class && !_class->symbol)
18820 _class->symbol = FindClass(_class->fullName);
18821 classSym = _class ? _class->symbol : (((void *)0));
18822 typedObject = 1;
18823 }
18824 thisClass = _class;
18825 if(inCompiler && _class)
18826 {
18827 if(type->kind == 11)
18828 {
18829 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18830 {
18831 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18832
18833 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18834 FreeType(param);
18835 }
18836 if(type->classObjectType != 1)
18837 {
18838 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18839 symbol->type->__anon1.__anon2.staticMethod = 1;
18840 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18841 symbol->type->extraParam = 0;
18842 }
18843 }
18844 strcpy(className, "__ecereClass_");
18845 FullClassNameCat(className, _class->fullName, 1);
18846 structName[0] = (char)0;
18847 FullClassNameCat(structName, _class->fullName, 0);
18848 funcDecl = GetFuncDecl(function->declarator);
18849 if(funcDecl)
18850 {
18851 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18852 {
18853 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18854
18855 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18856 {
18857 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18858 FreeTypeName(param);
18859 }
18860 }
18861 if(!function->propertyNoThis)
18862 {
18863 struct TypeName * thisParam = (((void *)0));
18864
18865 if(type->classObjectType != 1)
18866 {
18867 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18868 if(!funcDecl->__anon1.function.parameters)
18869 funcDecl->__anon1.function.parameters = MkList();
18870 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18871 }
18872 if(typedObject)
18873 {
18874 if(type->classObjectType != 1)
18875 {
18876 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18877 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18878 }
18879 thisParam = __extension__ ({
18880 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18881
18882 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18883 });
18884 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
18885 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18886 }
18887 }
18888 }
18889 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18890 {
18891 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18892
18893 funcDecl = GetFuncDecl(initDecl->declarator);
18894 if(funcDecl)
18895 {
18896 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18897 {
18898 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18899
18900 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18901 {
18902 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18903 FreeTypeName(param);
18904 }
18905 }
18906 if(type->classObjectType != 1)
18907 {
18908 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18909 {
18910 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18911
18912 if(!funcDecl->__anon1.function.parameters)
18913 funcDecl->__anon1.function.parameters = MkList();
18914 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18915 }
18916 }
18917 }
18918 }
18919 }
18920 if(function->body)
18921 {
18922 if(type->classObjectType != 1)
18923 {
18924 thisSymbol = __extension__ ({
18925 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18926
18927 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18928 });
18929 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18930 if(typedObject && thisSymbol->type)
18931 {
18932 thisSymbol->type->classObjectType = 2;
18933 thisSymbol->type->byReference = type->byReference;
18934 thisSymbol->type->typedByReference = type->byReference;
18935 }
18936 }
18937 }
18938 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
18939 {
18940 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18941
18942 {
18943 struct __ecereNameSpace__ecere__com__Class * base;
18944
18945 for(base = _class; base && base->type != 1000; base = base->next)
18946 {
18947 for(member = base->membersAndProperties.first; member; member = member->next)
18948 if(!member->isProperty)
18949 break;
18950 if(member)
18951 break;
18952 }
18953 }
18954 for(member = _class->membersAndProperties.first; member; member = member->next)
18955 if(!member->isProperty)
18956 break;
18957 if(member)
18958 {
18959 char pointerName[1024];
18960 struct Declaration * decl;
18961 struct Initializer * initializer;
18962 struct Expression * exp, * bytePtr;
18963
18964 strcpy(pointerName, "__ecerePointer_");
18965 FullClassNameCat(pointerName, _class->fullName, 0);
18966 {
18967 char className[1024];
18968
18969 strcpy(className, "__ecereClass_");
18970 FullClassNameCat(className, classSym->string, 1);
18971 DeclareClass(curExternal, classSym, className);
18972 }
18973 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18974 if(_class->fixed)
18975 {
18976 struct Expression * e;
18977
18978 if(_class->offset && _class->offset == _class->base->structSize)
18979 {
18980 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
18981 ProcessExpressionType(e);
18982 }
18983 else
18984 {
18985 char string[256];
18986
18987 sprintf(string, "%d", _class->offset);
18988 e = MkExpConstant(string);
18989 }
18990 exp = QBrackets(MkExpOp(bytePtr, '+', e));
18991 }
18992 else
18993 {
18994 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18995 }
18996 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18997 exp->expType = __extension__ ({
18998 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18999
19000 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
19001 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19002
19003 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19004 }), __ecereInstance2;
19005 });
19006 if(function->body)
19007 {
19008 yylloc = function->body->loc;
19009 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19010 {
19011 struct Context * prevContext = curContext;
19012 struct __ecereNameSpace__ecere__sys__OldList * list;
19013
19014 curContext = function->body->__anon1.compound.context;
19015 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19016 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19017 curContext = prevContext;
19018 }
19019 decl->symbol = (((void *)0));
19020 if(!function->body->__anon1.compound.declarations)
19021 function->body->__anon1.compound.declarations = MkList();
19022 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19023 }
19024 }
19025 }
19026 }
19027 else
19028 thisClass = (((void *)0));
19029 if(id)
19030 {
19031 FreeSpecifier(id->_class);
19032 id->_class = (((void *)0));
19033 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19034 {
19035 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19036
19037 id = GetDeclId(initDecl->declarator);
19038 FreeSpecifier(id->_class);
19039 id->_class = (((void *)0));
19040 }
19041 }
19042 if(function->body)
19043 topContext = function->body->__anon1.compound.context;
19044 {
19045 struct FunctionDefinition * oldFunction = curFunction;
19046
19047 curFunction = function;
19048 if(function->body)
19049 ProcessStatement(function->body);
19050 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19051 {
19052 struct Statement * prevCompound = curCompound;
19053 struct Context * prevContext = curContext;
19054 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19055
19056 if(!function->body->__anon1.compound.statements)
19057 function->body->__anon1.compound.statements = MkList();
19058 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19059 curCompound = function->body;
19060 curContext = function->body->__anon1.compound.context;
19061 ProcessStatement(fireWatchers);
19062 curContext = prevContext;
19063 curCompound = prevCompound;
19064 }
19065 curFunction = oldFunction;
19066 }
19067 if(function->declarator)
19068 {
19069 ProcessDeclarator(function->declarator, 1);
19070 }
19071 topContext = oldTopContext;
19072 thisClass = oldThisClass;
19073 }
19074
19075 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19076 {
19077 struct ClassDef * def;
19078 struct External * external = curExternal;
19079 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19080
19081 for(def = definitions->first; def; def = def->next)
19082 {
19083 if(def->type == 0)
19084 {
19085 if(def->__anon1.function->declarator)
19086 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19087 else
19088 curExternal = external;
19089 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19090 }
19091 else if(def->type == 2)
19092 {
19093 if(def->__anon1.decl->type == 2)
19094 {
19095 thisClass = regClass;
19096 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19097 thisClass = (((void *)0));
19098 }
19099 else
19100 {
19101 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19102
19103 if(regClass)
19104 thisClass = regClass;
19105 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19106 thisClass = backThisClass;
19107 }
19108 }
19109 else if(def->type == 1 && def->__anon1.defProperties)
19110 {
19111 struct MemberInit * defProperty;
19112 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);
19113
19114 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19115 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19116 {
19117 thisClass = regClass;
19118 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19119 thisClass = (((void *)0));
19120 }
19121 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19122 FreeSymbol(thisSymbol);
19123 }
19124 else if(def->type == 3 && def->__anon1.propertyDef)
19125 {
19126 struct PropertyDef * prop = def->__anon1.propertyDef;
19127
19128 thisClass = regClass;
19129 if(prop->setStmt)
19130 {
19131 if(regClass)
19132 {
19133 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19134
19135 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19136 }
19137 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19138 ProcessStatement(prop->setStmt);
19139 }
19140 if(prop->getStmt)
19141 {
19142 if(regClass)
19143 {
19144 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19145
19146 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19147 }
19148 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19149 ProcessStatement(prop->getStmt);
19150 }
19151 if(prop->issetStmt)
19152 {
19153 if(regClass)
19154 {
19155 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19156
19157 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19158 }
19159 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19160 ProcessStatement(prop->issetStmt);
19161 }
19162 thisClass = (((void *)0));
19163 }
19164 else if(def->type == 4 && def->__anon1.propertyWatch)
19165 {
19166 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19167
19168 thisClass = regClass;
19169 if(propertyWatch->compound)
19170 {
19171 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);
19172
19173 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19174 curExternal = (((void *)0));
19175 ProcessStatement(propertyWatch->compound);
19176 }
19177 thisClass = (((void *)0));
19178 }
19179 }
19180 }
19181
19182 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19183 {
19184 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19185
19186 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19187 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19188 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19189 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19190 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19191 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19192 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19193 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19194 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19195 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19196 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19197 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19198 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19199 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19200 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19201 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19202 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19203 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19204 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19205 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19206 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19207 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19208 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19209 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19210 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19211 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19212 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19213 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19214 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19215 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19216 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19217 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19218 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19219 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19220 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19221 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19222 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19223 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19224 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19225 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19226 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19227 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19228 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19229 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19230 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19231 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19232 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19233 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19234 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19235 __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);
19236 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19237 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19238 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19239 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19240 __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);
19241 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19242 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19243 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19244 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19245 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19246 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19247 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19248 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19249 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19250 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19251 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19252 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19253 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19254 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19255 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19256 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)
19257 __ecereClass_Conversion = class;
19258 __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);
19259 __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);
19260 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19261 __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);
19262 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19263 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19264 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19265 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19266 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19267 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19268 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19269 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19270 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19271 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19272 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19273 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19274 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19275 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19276 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19277 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19278 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19279 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19280 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19281 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19282 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19283 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19284 }
19285