compiler/libec/pass15: Fix for using ^ (binary XOR) operator with enum values without...
[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 Declaration;
765
766 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
767
768 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
769
770 static void ProcessDeclaration(struct Declaration * decl);
771
772 struct __ecereNameSpace__ecere__com__NameSpace;
773
774 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
775
776 struct FunctionDefinition;
777
778 static struct FunctionDefinition * curFunction;
779
780 struct __ecereNameSpace__ecere__sys__BTNode;
781
782 struct __ecereNameSpace__ecere__sys__BTNode
783 {
784 uintptr_t key;
785 struct __ecereNameSpace__ecere__sys__BTNode * parent;
786 struct __ecereNameSpace__ecere__sys__BTNode * left;
787 struct __ecereNameSpace__ecere__sys__BTNode * right;
788 int depth;
789 } __attribute__ ((gcc_struct));
790
791 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
792
793 struct __ecereNameSpace__ecere__com__Property;
794
795 struct __ecereNameSpace__ecere__com__Property
796 {
797 struct __ecereNameSpace__ecere__com__Property * prev;
798 struct __ecereNameSpace__ecere__com__Property * next;
799 const char *  name;
800 unsigned int isProperty;
801 int memberAccess;
802 int id;
803 struct __ecereNameSpace__ecere__com__Class * _class;
804 const char *  dataTypeString;
805 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
806 struct Type * dataType;
807 void (*  Set)(void * , int);
808 int (*  Get)(void * );
809 unsigned int (*  IsSet)(void * );
810 void *  data;
811 void *  symbol;
812 int vid;
813 unsigned int conversion;
814 unsigned int watcherOffset;
815 const char *  category;
816 unsigned int compiled;
817 unsigned int selfWatchable;
818 unsigned int isWatchable;
819 } __attribute__ ((gcc_struct));
820
821 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
822
823 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);
824
825 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
826
827 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
828
829 struct Identifier;
830
831 extern void FreeIdentifier(struct Identifier * id);
832
833 extern struct Identifier * MkIdentifier(const char *  string);
834
835 extern struct Expression * MkExpIdentifier(struct Identifier * id);
836
837 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
838
839 extern struct Identifier * CopyIdentifier(struct Identifier * id);
840
841 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
842
843 struct __ecereNameSpace__ecere__sys__OldLink;
844
845 struct __ecereNameSpace__ecere__sys__OldLink
846 {
847 struct __ecereNameSpace__ecere__sys__OldLink * prev;
848 struct __ecereNameSpace__ecere__sys__OldLink * next;
849 void *  data;
850 } __attribute__ ((gcc_struct));
851
852 struct Specifier;
853
854 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
855
856 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
857
858 extern struct Specifier * MkSpecifier(int specifier);
859
860 extern struct Specifier * MkSpecifierName(const char *  name);
861
862 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
863
864 extern void FreeSpecifier(struct Specifier * spec);
865
866 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
867
868 struct Statement
869 {
870 struct Statement * prev;
871 struct Statement * next;
872 struct Location loc;
873 int type;
874 union
875 {
876 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
877 struct
878 {
879 struct Identifier * id;
880 struct Statement * stmt;
881 } __attribute__ ((gcc_struct)) labeled;
882 struct
883 {
884 struct Expression * exp;
885 struct Statement * stmt;
886 } __attribute__ ((gcc_struct)) caseStmt;
887 struct
888 {
889 struct __ecereNameSpace__ecere__sys__OldList * declarations;
890 struct __ecereNameSpace__ecere__sys__OldList * statements;
891 struct Context * context;
892 unsigned int isSwitch;
893 } __attribute__ ((gcc_struct)) compound;
894 struct
895 {
896 struct __ecereNameSpace__ecere__sys__OldList * exp;
897 struct Statement * stmt;
898 struct Statement * elseStmt;
899 } __attribute__ ((gcc_struct)) ifStmt;
900 struct
901 {
902 struct __ecereNameSpace__ecere__sys__OldList * exp;
903 struct Statement * stmt;
904 } __attribute__ ((gcc_struct)) switchStmt;
905 struct
906 {
907 struct __ecereNameSpace__ecere__sys__OldList * exp;
908 struct Statement * stmt;
909 } __attribute__ ((gcc_struct)) whileStmt;
910 struct
911 {
912 struct __ecereNameSpace__ecere__sys__OldList * exp;
913 struct Statement * stmt;
914 } __attribute__ ((gcc_struct)) doWhile;
915 struct
916 {
917 struct Statement * init;
918 struct Statement * check;
919 struct __ecereNameSpace__ecere__sys__OldList * increment;
920 struct Statement * stmt;
921 } __attribute__ ((gcc_struct)) forStmt;
922 struct
923 {
924 struct Identifier * id;
925 } __attribute__ ((gcc_struct)) gotoStmt;
926 struct
927 {
928 struct Specifier * spec;
929 char * statements;
930 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
931 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
932 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
933 } __attribute__ ((gcc_struct)) asmStmt;
934 struct
935 {
936 struct Expression * watcher;
937 struct Expression * object;
938 struct __ecereNameSpace__ecere__sys__OldList * watches;
939 } __attribute__ ((gcc_struct)) _watch;
940 struct
941 {
942 struct Identifier * id;
943 struct __ecereNameSpace__ecere__sys__OldList * exp;
944 struct __ecereNameSpace__ecere__sys__OldList * filter;
945 struct Statement * stmt;
946 } __attribute__ ((gcc_struct)) forEachStmt;
947 struct Declaration * decl;
948 } __attribute__ ((gcc_struct)) __anon1;
949 } __attribute__ ((gcc_struct));
950
951 extern struct Specifier * CopySpecifier(struct Specifier * spec);
952
953 extern struct Expression * MkExpClassSize(struct Specifier * _class);
954
955 struct Symbol;
956
957 struct Identifier
958 {
959 struct Identifier * prev;
960 struct Identifier * next;
961 struct Location loc;
962 struct Symbol * classSym;
963 struct Specifier * _class;
964 char *  string;
965 struct Identifier * badID;
966 } __attribute__ ((gcc_struct));
967
968 extern struct Symbol * FindStruct(struct Context * ctx, const char *  name);
969
970 extern struct Symbol * FindClass(const char *  name);
971
972 extern void DeclareClass(struct External * neededFor, struct Symbol * classSym, const char *  className);
973
974 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
975
976 extern void FreeSymbol(struct Symbol * symbol);
977
978 struct ClassDef;
979
980 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
981
982 extern void FreeClassDef(struct ClassDef * def);
983
984 struct Declarator;
985
986 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
987
988 struct TemplateDatatype
989 {
990 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
991 struct Declarator * decl;
992 } __attribute__ ((gcc_struct));
993
994 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
995
996 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
997
998 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
999
1000 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
1001
1002 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
1003
1004 struct Declarator
1005 {
1006 struct Declarator * prev;
1007 struct Declarator * next;
1008 struct Location loc;
1009 int type;
1010 struct Symbol * symbol;
1011 struct Declarator * declarator;
1012 union
1013 {
1014 struct Identifier * identifier;
1015 struct
1016 {
1017 struct Expression * exp;
1018 struct Expression * posExp;
1019 struct Attrib * attrib;
1020 } __attribute__ ((gcc_struct)) structDecl;
1021 struct
1022 {
1023 struct Expression * exp;
1024 struct Specifier * enumClass;
1025 } __attribute__ ((gcc_struct)) array;
1026 struct
1027 {
1028 struct __ecereNameSpace__ecere__sys__OldList * parameters;
1029 } __attribute__ ((gcc_struct)) function;
1030 struct
1031 {
1032 struct Pointer * pointer;
1033 } __attribute__ ((gcc_struct)) pointer;
1034 struct
1035 {
1036 struct ExtDecl * extended;
1037 } __attribute__ ((gcc_struct)) extended;
1038 } __attribute__ ((gcc_struct)) __anon1;
1039 } __attribute__ ((gcc_struct));
1040
1041 extern struct Identifier * GetDeclId(struct Declarator * decl);
1042
1043 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
1044
1045 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1046
1047 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1048
1049 extern void FreeDeclarator(struct Declarator * decl);
1050
1051 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1052
1053 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
1054
1055 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1056
1057 struct FunctionDefinition
1058 {
1059 struct FunctionDefinition * prev;
1060 struct FunctionDefinition * next;
1061 struct Location loc;
1062 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1063 struct Declarator * declarator;
1064 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1065 struct Statement * body;
1066 struct __ecereNameSpace__ecere__com__Class * _class;
1067 struct __ecereNameSpace__ecere__sys__OldList attached;
1068 int declMode;
1069 struct Type * type;
1070 struct Symbol * propSet;
1071 int tempCount;
1072 unsigned int propertyNoThis;
1073 } __attribute__ ((gcc_struct));
1074
1075 extern struct Declarator * QMkPtrDecl(const char *  id);
1076
1077 struct ClassFunction;
1078
1079 struct ClassFunction
1080 {
1081 struct ClassFunction * prev;
1082 struct ClassFunction * next;
1083 struct Location loc;
1084 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1085 struct Declarator * declarator;
1086 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1087 struct Statement * body;
1088 struct __ecereNameSpace__ecere__com__Class * _class;
1089 struct __ecereNameSpace__ecere__sys__OldList attached;
1090 int declMode;
1091 struct Type * type;
1092 struct Symbol * propSet;
1093 unsigned int isVirtual;
1094 unsigned int isConstructor;
1095 unsigned int isDestructor;
1096 unsigned int dontMangle;
1097 int id;
1098 int idCode;
1099 } __attribute__ ((gcc_struct));
1100
1101 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);
1102
1103 extern void FreeClassFunction(struct ClassFunction * func);
1104
1105 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1106
1107 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1108
1109 struct TypeName;
1110
1111 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1112
1113 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1114
1115 struct TypeName
1116 {
1117 struct TypeName * prev;
1118 struct TypeName * next;
1119 struct Location loc;
1120 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
1121 struct Declarator * declarator;
1122 int classObjectType;
1123 struct Expression * bitCount;
1124 } __attribute__ ((gcc_struct));
1125
1126 extern void FreeTypeName(struct TypeName * typeName);
1127
1128 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
1129
1130 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
1131
1132 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
1133
1134 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
1135
1136 struct __ecereNameSpace__ecere__com__BTNamedLink;
1137
1138 struct __ecereNameSpace__ecere__com__BTNamedLink
1139 {
1140 const char *  name;
1141 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1142 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1143 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1144 int depth;
1145 void *  data;
1146 } __attribute__ ((gcc_struct));
1147
1148 struct __ecereNameSpace__ecere__sys__NamedLink64;
1149
1150 struct __ecereNameSpace__ecere__sys__NamedLink64
1151 {
1152 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
1153 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
1154 char *  name;
1155 long long data;
1156 } __attribute__ ((gcc_struct));
1157
1158 struct Instantiation;
1159
1160 struct Declaration
1161 {
1162 struct Declaration * prev;
1163 struct Declaration * next;
1164 struct Location loc;
1165 int type;
1166 union
1167 {
1168 struct
1169 {
1170 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1171 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1172 } __attribute__ ((gcc_struct)) __anon1;
1173 struct Instantiation * inst;
1174 struct
1175 {
1176 struct Identifier * id;
1177 struct Expression * exp;
1178 } __attribute__ ((gcc_struct)) __anon2;
1179 } __attribute__ ((gcc_struct)) __anon1;
1180 struct Specifier * extStorage;
1181 struct Symbol * symbol;
1182 int declMode;
1183 } __attribute__ ((gcc_struct));
1184
1185 struct Instantiation
1186 {
1187 struct Instantiation * prev;
1188 struct Instantiation * next;
1189 struct Location loc;
1190 struct Specifier * _class;
1191 struct Expression * exp;
1192 struct __ecereNameSpace__ecere__sys__OldList *  members;
1193 struct Symbol * symbol;
1194 unsigned int fullSet;
1195 unsigned int isConstant;
1196 unsigned char *  data;
1197 struct Location nameLoc;
1198 struct Location insideLoc;
1199 unsigned int built;
1200 } __attribute__ ((gcc_struct));
1201
1202 extern void FreeInstance(struct Instantiation * inst);
1203
1204 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
1205
1206 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
1207
1208 struct InitDeclarator;
1209
1210 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1211
1212 struct PropertyWatch;
1213
1214 struct PropertyWatch
1215 {
1216 struct PropertyWatch * prev;
1217 struct PropertyWatch * next;
1218 struct Location loc;
1219 struct Statement * compound;
1220 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1221 unsigned int deleteWatch;
1222 } __attribute__ ((gcc_struct));
1223
1224 extern void FreePropertyWatch(struct PropertyWatch * watcher);
1225
1226 struct PropertyImport;
1227
1228 struct PropertyImport
1229 {
1230 struct PropertyImport * prev;
1231 struct PropertyImport * next;
1232 char *  name;
1233 unsigned int isVirtual;
1234 unsigned int hasSet;
1235 unsigned int hasGet;
1236 } __attribute__ ((gcc_struct));
1237
1238 struct MethodImport;
1239
1240 struct MethodImport
1241 {
1242 struct MethodImport * prev;
1243 struct MethodImport * next;
1244 char *  name;
1245 unsigned int isVirtual;
1246 } __attribute__ ((gcc_struct));
1247
1248 struct FunctionImport;
1249
1250 struct FunctionImport
1251 {
1252 struct FunctionImport * prev;
1253 struct FunctionImport * next;
1254 char *  name;
1255 } __attribute__ ((gcc_struct));
1256
1257 struct ClassImport;
1258
1259 struct ClassImport
1260 {
1261 struct ClassImport * prev;
1262 struct ClassImport * next;
1263 char *  name;
1264 struct __ecereNameSpace__ecere__sys__OldList methods;
1265 struct __ecereNameSpace__ecere__sys__OldList properties;
1266 unsigned int itself;
1267 int isRemote;
1268 } __attribute__ ((gcc_struct));
1269
1270 struct Initializer;
1271
1272 struct Expression
1273 {
1274 struct Expression * prev;
1275 struct Expression * next;
1276 struct Location loc;
1277 int type;
1278 union
1279 {
1280 struct
1281 {
1282 char *  constant;
1283 struct Identifier * identifier;
1284 } __attribute__ ((gcc_struct)) __anon1;
1285 struct Statement * compound;
1286 struct Instantiation * instance;
1287 struct
1288 {
1289 char *  string;
1290 unsigned int intlString;
1291 unsigned int wideString;
1292 } __attribute__ ((gcc_struct)) __anon2;
1293 struct __ecereNameSpace__ecere__sys__OldList *  list;
1294 struct
1295 {
1296 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1297 struct Declarator * decl;
1298 } __attribute__ ((gcc_struct)) _classExp;
1299 struct
1300 {
1301 struct Identifier * id;
1302 } __attribute__ ((gcc_struct)) classData;
1303 struct
1304 {
1305 struct Expression * exp;
1306 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1307 struct Location argLoc;
1308 } __attribute__ ((gcc_struct)) call;
1309 struct
1310 {
1311 struct Expression * exp;
1312 struct __ecereNameSpace__ecere__sys__OldList * index;
1313 } __attribute__ ((gcc_struct)) index;
1314 struct
1315 {
1316 struct Expression * exp;
1317 struct Identifier * member;
1318 int memberType;
1319 unsigned int thisPtr;
1320 } __attribute__ ((gcc_struct)) member;
1321 struct
1322 {
1323 int op;
1324 struct Expression * exp1;
1325 struct Expression * exp2;
1326 } __attribute__ ((gcc_struct)) op;
1327 struct TypeName * typeName;
1328 struct Specifier * _class;
1329 struct
1330 {
1331 struct TypeName * typeName;
1332 struct Expression * exp;
1333 } __attribute__ ((gcc_struct)) cast;
1334 struct
1335 {
1336 struct Expression * cond;
1337 struct __ecereNameSpace__ecere__sys__OldList * exp;
1338 struct Expression * elseExp;
1339 } __attribute__ ((gcc_struct)) cond;
1340 struct
1341 {
1342 struct TypeName * typeName;
1343 struct Expression * size;
1344 } __attribute__ ((gcc_struct)) _new;
1345 struct
1346 {
1347 struct TypeName * typeName;
1348 struct Expression * size;
1349 struct Expression * exp;
1350 } __attribute__ ((gcc_struct)) _renew;
1351 struct
1352 {
1353 char * table;
1354 struct Identifier * id;
1355 } __attribute__ ((gcc_struct)) db;
1356 struct
1357 {
1358 struct Expression * ds;
1359 struct Expression * name;
1360 } __attribute__ ((gcc_struct)) dbopen;
1361 struct
1362 {
1363 struct TypeName * typeName;
1364 struct Initializer * initializer;
1365 } __attribute__ ((gcc_struct)) initializer;
1366 struct
1367 {
1368 struct Expression * exp;
1369 struct TypeName * typeName;
1370 } __attribute__ ((gcc_struct)) vaArg;
1371 } __attribute__ ((gcc_struct)) __anon1;
1372 unsigned int debugValue;
1373 struct __ecereNameSpace__ecere__com__DataValue val;
1374 uint64 address;
1375 unsigned int hasAddress;
1376 struct Type * expType;
1377 struct Type * destType;
1378 unsigned int usage;
1379 int tempCount;
1380 unsigned int byReference;
1381 unsigned int isConstant;
1382 unsigned int addedThis;
1383 unsigned int needCast;
1384 unsigned int thisPtr;
1385 unsigned int opDestType;
1386 unsigned int needTemplateCast;
1387 } __attribute__ ((gcc_struct));
1388
1389 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1390
1391 struct Initializer
1392 {
1393 struct Initializer * prev;
1394 struct Initializer * next;
1395 struct Location loc;
1396 int type;
1397 union
1398 {
1399 struct Expression * exp;
1400 struct __ecereNameSpace__ecere__sys__OldList *  list;
1401 } __attribute__ ((gcc_struct)) __anon1;
1402 unsigned int isConstant;
1403 struct Identifier * id;
1404 } __attribute__ ((gcc_struct));
1405
1406 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1407
1408 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
1409
1410 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
1411
1412 struct InitDeclarator
1413 {
1414 struct InitDeclarator * prev;
1415 struct InitDeclarator * next;
1416 struct Location loc;
1417 struct Declarator * declarator;
1418 struct Initializer * initializer;
1419 } __attribute__ ((gcc_struct));
1420
1421 void ApplyLocation(struct Expression * exp, struct Location * loc)
1422 {
1423 exp->loc = *loc;
1424 switch(exp->type)
1425 {
1426 case 4:
1427 if(exp->__anon1.op.exp1)
1428 ApplyLocation(exp->__anon1.op.exp1, loc);
1429 if(exp->__anon1.op.exp2)
1430 ApplyLocation(exp->__anon1.op.exp2, loc);
1431 break;
1432 case 5:
1433 if(exp->__anon1.list)
1434 {
1435 struct Expression * e;
1436
1437 for(e = (*exp->__anon1.list).first; e; e = e->next)
1438 ApplyLocation(e, loc);
1439 }
1440 break;
1441 case 6:
1442 if(exp->__anon1.index.index)
1443 {
1444 struct Expression * e;
1445
1446 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1447 ApplyLocation(e, loc);
1448 }
1449 if(exp->__anon1.index.exp)
1450 ApplyLocation(exp->__anon1.index.exp, loc);
1451 break;
1452 case 7:
1453 if(exp->__anon1.call.arguments)
1454 {
1455 struct Expression * arg;
1456
1457 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1458 ApplyLocation(arg, loc);
1459 }
1460 if(exp->__anon1.call.exp)
1461 ApplyLocation(exp->__anon1.call.exp, loc);
1462 break;
1463 case 8:
1464 case 9:
1465 if(exp->__anon1.member.exp)
1466 ApplyLocation(exp->__anon1.member.exp, loc);
1467 break;
1468 case 11:
1469 if(exp->__anon1.cast.exp)
1470 ApplyLocation(exp->__anon1.cast.exp, loc);
1471 break;
1472 case 12:
1473 if(exp->__anon1.cond.exp)
1474 {
1475 struct Expression * e;
1476
1477 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1478 ApplyLocation(e, loc);
1479 }
1480 if(exp->__anon1.cond.cond)
1481 ApplyLocation(exp->__anon1.cond.cond, loc);
1482 if(exp->__anon1.cond.elseExp)
1483 ApplyLocation(exp->__anon1.cond.elseExp, loc);
1484 break;
1485 case 34:
1486 if(exp->__anon1.vaArg.exp)
1487 ApplyLocation(exp->__anon1.vaArg.exp, loc);
1488 break;
1489 default:
1490 break;
1491 }
1492 }
1493
1494 void __ecereMethod_Expression_Clear();
1495
1496 struct MembersInit;
1497
1498 struct MembersInit
1499 {
1500 struct MembersInit * prev;
1501 struct MembersInit * next;
1502 struct Location loc;
1503 int type;
1504 union
1505 {
1506 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1507 struct ClassFunction * function;
1508 } __attribute__ ((gcc_struct)) __anon1;
1509 } __attribute__ ((gcc_struct));
1510
1511 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
1512
1513 struct Operand;
1514
1515 struct OpTable
1516 {
1517 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1518 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1519 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1520 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1521 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1522 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1523 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1524 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1525 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1526 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1527 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1528 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1529 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1530 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1531 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1532 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1533 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1534 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1535 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1536 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1537 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1538 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1539 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1540 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1541 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1542 unsigned int (*  Not)(struct Expression *, struct Operand *);
1543 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1544 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1545 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1546 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1547 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1548 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1549 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1550 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1551 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1552 } __attribute__ ((gcc_struct));
1553
1554 struct Operand
1555 {
1556 int kind;
1557 struct Type * type;
1558 unsigned int ptrSize;
1559 union
1560 {
1561 char c;
1562 unsigned char uc;
1563 short s;
1564 unsigned short us;
1565 int i;
1566 unsigned int ui;
1567 float f;
1568 double d;
1569 long long i64;
1570 uint64 ui64;
1571 } __attribute__ ((gcc_struct)) __anon1;
1572 struct OpTable ops;
1573 } __attribute__ ((gcc_struct));
1574
1575 struct External *  _DeclareStruct(struct External *  neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl);
1576
1577 struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference)
1578 {
1579 return _DeclareStruct(neededBy, name, skipNoHead, needDereference, 0);
1580 }
1581
1582 static void _DeclareType(struct External *  neededFor, struct Type *  type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl);
1583
1584 void DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1585 {
1586 _DeclareType(neededFor, type, needDereference, forFunctionDef, 0);
1587 }
1588
1589 void DeclareTypeForwardDeclare(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1590 {
1591 _DeclareType(neededFor, type, needDereference, forFunctionDef, 1);
1592 }
1593
1594 static void _PrintType(struct Type *  type, char *  string, unsigned int printName, unsigned int fullName, unsigned int printConst);
1595
1596 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1597 {
1598 _PrintType(type, string, printName, fullName, 1);
1599 }
1600
1601 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1602 {
1603 _PrintType(type, string, printName, fullName, 0);
1604 }
1605
1606 struct __ecereNameSpace__ecere__com__Method;
1607
1608 struct __ecereNameSpace__ecere__com__Method
1609 {
1610 const char *  name;
1611 struct __ecereNameSpace__ecere__com__Method * parent;
1612 struct __ecereNameSpace__ecere__com__Method * left;
1613 struct __ecereNameSpace__ecere__com__Method * right;
1614 int depth;
1615 int (*  function)();
1616 int vid;
1617 int type;
1618 struct __ecereNameSpace__ecere__com__Class * _class;
1619 void *  symbol;
1620 const char *  dataTypeString;
1621 struct Type * dataType;
1622 int memberAccess;
1623 } __attribute__ ((gcc_struct));
1624
1625 struct Symbol
1626 {
1627 char *  string;
1628 struct Symbol * parent;
1629 struct Symbol * left;
1630 struct Symbol * right;
1631 int depth;
1632 struct Type * type;
1633 union
1634 {
1635 struct __ecereNameSpace__ecere__com__Method * method;
1636 struct __ecereNameSpace__ecere__com__Property * _property;
1637 struct __ecereNameSpace__ecere__com__Class * registered;
1638 } __attribute__ ((gcc_struct)) __anon1;
1639 unsigned int notYetDeclared;
1640 union
1641 {
1642 struct
1643 {
1644 struct External * pointerExternal;
1645 struct External * structExternal;
1646 } __attribute__ ((gcc_struct)) __anon1;
1647 struct
1648 {
1649 struct External * externalGet;
1650 struct External * externalSet;
1651 struct External * externalPtr;
1652 struct External * externalIsSet;
1653 } __attribute__ ((gcc_struct)) __anon2;
1654 struct
1655 {
1656 struct External * methodExternal;
1657 struct External * methodCodeExternal;
1658 } __attribute__ ((gcc_struct)) __anon3;
1659 } __attribute__ ((gcc_struct)) __anon2;
1660 unsigned int imported;
1661 unsigned int declaredStructSym;
1662 struct __ecereNameSpace__ecere__com__Class * _class;
1663 unsigned int declaredStruct;
1664 unsigned int needConstructor;
1665 unsigned int needDestructor;
1666 char *  constructorName;
1667 char *  structName;
1668 char *  className;
1669 char *  destructorName;
1670 struct ModuleImport * module;
1671 struct ClassImport * _import;
1672 struct Location nameLoc;
1673 unsigned int isParam;
1674 unsigned int isRemote;
1675 unsigned int isStruct;
1676 unsigned int fireWatchersDone;
1677 int declaring;
1678 unsigned int classData;
1679 unsigned int isStatic;
1680 char *  shortName;
1681 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
1682 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
1683 struct Context * ctx;
1684 int isIterator;
1685 struct Expression * propCategory;
1686 } __attribute__ ((gcc_struct));
1687
1688 struct __ecereNameSpace__ecere__com__ClassProperty;
1689
1690 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1691
1692 struct __ecereNameSpace__ecere__com__ClassProperty
1693 {
1694 const char *  name;
1695 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1696 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1697 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1698 int depth;
1699 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1700 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1701 const char *  dataTypeString;
1702 struct Type * dataType;
1703 unsigned int constant;
1704 } __attribute__ ((gcc_struct));
1705
1706 struct __ecereNameSpace__ecere__com__BitMember;
1707
1708 struct __ecereNameSpace__ecere__com__BitMember
1709 {
1710 struct __ecereNameSpace__ecere__com__BitMember * prev;
1711 struct __ecereNameSpace__ecere__com__BitMember * next;
1712 const char *  name;
1713 unsigned int isProperty;
1714 int memberAccess;
1715 int id;
1716 struct __ecereNameSpace__ecere__com__Class * _class;
1717 const char *  dataTypeString;
1718 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1719 struct Type * dataType;
1720 int type;
1721 int size;
1722 int pos;
1723 uint64 mask;
1724 } __attribute__ ((gcc_struct));
1725
1726 struct __ecereNameSpace__ecere__com__DataMember;
1727
1728 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1729 {
1730 union
1731 {
1732 struct
1733 {
1734 const char *  dataTypeString;
1735 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1736 } __attribute__ ((gcc_struct)) __anon1;
1737 struct __ecereNameSpace__ecere__com__DataValue expression;
1738 struct
1739 {
1740 const char *  memberString;
1741 union
1742 {
1743 struct __ecereNameSpace__ecere__com__DataMember * member;
1744 struct __ecereNameSpace__ecere__com__Property * prop;
1745 struct __ecereNameSpace__ecere__com__Method * method;
1746 } __attribute__ ((gcc_struct)) __anon1;
1747 } __attribute__ ((gcc_struct)) __anon2;
1748 } __attribute__ ((gcc_struct)) __anon1;
1749 } __attribute__ ((gcc_struct));
1750
1751 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);
1752
1753 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);
1754
1755 struct TemplateParameter;
1756
1757 struct TemplateParameter
1758 {
1759 struct TemplateParameter * prev;
1760 struct TemplateParameter * next;
1761 struct Location loc;
1762 int type;
1763 struct Identifier * identifier;
1764 union
1765 {
1766 struct TemplateDatatype * dataType;
1767 int memberType;
1768 } __attribute__ ((gcc_struct)) __anon1;
1769 struct TemplateArgument * defaultArgument;
1770 const char *  dataTypeString;
1771 struct Type * baseType;
1772 } __attribute__ ((gcc_struct));
1773
1774 struct Type
1775 {
1776 struct Type * prev;
1777 struct Type * next;
1778 int refCount;
1779 union
1780 {
1781 struct Symbol * _class;
1782 struct
1783 {
1784 struct __ecereNameSpace__ecere__sys__OldList members;
1785 char *  enumName;
1786 } __attribute__ ((gcc_struct)) __anon1;
1787 struct
1788 {
1789 struct Type * returnType;
1790 struct __ecereNameSpace__ecere__sys__OldList params;
1791 struct Symbol * thisClass;
1792 unsigned int staticMethod;
1793 struct TemplateParameter * thisClassTemplate;
1794 } __attribute__ ((gcc_struct)) __anon2;
1795 struct
1796 {
1797 struct __ecereNameSpace__ecere__com__Method * method;
1798 struct __ecereNameSpace__ecere__com__Class * methodClass;
1799 struct __ecereNameSpace__ecere__com__Class * usedClass;
1800 } __attribute__ ((gcc_struct)) __anon3;
1801 struct
1802 {
1803 struct Type * arrayType;
1804 int arraySize;
1805 struct Expression * arraySizeExp;
1806 unsigned int freeExp;
1807 struct Symbol * enumClass;
1808 } __attribute__ ((gcc_struct)) __anon4;
1809 struct Type * type;
1810 struct TemplateParameter * templateParameter;
1811 } __attribute__ ((gcc_struct)) __anon1;
1812 int kind;
1813 unsigned int size;
1814 char *  name;
1815 char *  typeName;
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 } __attribute__ ((gcc_struct));
1837
1838 struct Specifier
1839 {
1840 struct Specifier * prev;
1841 struct Specifier * next;
1842 struct Location loc;
1843 int type;
1844 union
1845 {
1846 int specifier;
1847 struct
1848 {
1849 struct ExtDecl * extDecl;
1850 char *  name;
1851 struct Symbol * symbol;
1852 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
1853 } __attribute__ ((gcc_struct)) __anon1;
1854 struct
1855 {
1856 struct Identifier * id;
1857 struct __ecereNameSpace__ecere__sys__OldList *  list;
1858 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
1859 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
1860 unsigned int addNameSpace;
1861 struct Context * ctx;
1862 struct ExtDecl * extDeclStruct;
1863 } __attribute__ ((gcc_struct)) __anon2;
1864 struct Expression * expression;
1865 struct Specifier * _class;
1866 struct TemplateParameter * templateParameter;
1867 } __attribute__ ((gcc_struct)) __anon1;
1868 } __attribute__ ((gcc_struct));
1869
1870 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
1871
1872 struct TemplatedType
1873 {
1874 uintptr_t key;
1875 struct __ecereNameSpace__ecere__sys__BTNode * parent;
1876 struct __ecereNameSpace__ecere__sys__BTNode * left;
1877 struct __ecereNameSpace__ecere__sys__BTNode * right;
1878 int depth;
1879 struct TemplateParameter * param;
1880 } __attribute__ ((gcc_struct));
1881
1882 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1883 {
1884 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1885 {
1886 if(!param->baseType)
1887 {
1888 if(param->dataTypeString)
1889 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1890 else
1891 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1892 }
1893 return param->baseType;
1894 }
1895 return (((void *)0));
1896 }
1897
1898 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1899 {
1900 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1901 return 1;
1902 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1903 {
1904 return 0;
1905 }
1906 if(type1->kind == type2->kind)
1907 {
1908 switch(type1->kind)
1909 {
1910 case 24:
1911 case 1:
1912 case 2:
1913 case 3:
1914 case 4:
1915 case 22:
1916 case 23:
1917 if(type1->passAsTemplate && !type2->passAsTemplate)
1918 return 1;
1919 return type1->isSigned != type2->isSigned;
1920 case 8:
1921 return type1->__anon1._class != type2->__anon1._class;
1922 case 13:
1923 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1924 default:
1925 return 1;
1926 }
1927 }
1928 return 1;
1929 }
1930
1931 unsigned int GetOpInt(struct Operand * op2, int * value2)
1932 {
1933 if(op2->kind == 3 && op2->type->isSigned)
1934 *value2 = op2->__anon1.i;
1935 else if(op2->kind == 3)
1936 *value2 = (int)op2->__anon1.ui;
1937 else if(op2->kind == 4 && op2->type->isSigned)
1938 *value2 = (int)op2->__anon1.i64;
1939 else if(op2->kind == 4)
1940 *value2 = (int)op2->__anon1.ui64;
1941 else if(op2->kind == 23 && op2->type->isSigned)
1942 *value2 = (int)op2->__anon1.i64;
1943 else if(op2->kind == 23)
1944 *value2 = (int)op2->__anon1.ui64;
1945 else if(op2->kind == 22 && op2->type->isSigned)
1946 *value2 = (int)op2->__anon1.i64;
1947 else if(op2->kind == 22)
1948 *value2 = (int)op2->__anon1.ui64;
1949 else if(op2->kind == 2 && op2->type->isSigned)
1950 *value2 = (int)op2->__anon1.s;
1951 else if(op2->kind == 2)
1952 *value2 = (int)op2->__anon1.us;
1953 else if(op2->kind == 1 && op2->type->isSigned)
1954 *value2 = (int)op2->__anon1.c;
1955 else if(op2->kind == 24 || op2->kind == 1)
1956 *value2 = (int)op2->__anon1.uc;
1957 else if(op2->kind == 6)
1958 *value2 = (int)op2->__anon1.f;
1959 else if(op2->kind == 7)
1960 *value2 = (int)op2->__anon1.d;
1961 else if(op2->kind == 13)
1962 *value2 = (int)op2->__anon1.ui64;
1963 else
1964 return 0;
1965 return 1;
1966 }
1967
1968 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1969 {
1970 if(op2->kind == 3 && op2->type->isSigned)
1971 *value2 = (unsigned int)op2->__anon1.i;
1972 else if(op2->kind == 3)
1973 *value2 = op2->__anon1.ui;
1974 else if(op2->kind == 4 && op2->type->isSigned)
1975 *value2 = (unsigned int)op2->__anon1.i64;
1976 else if(op2->kind == 4)
1977 *value2 = (unsigned int)op2->__anon1.ui64;
1978 else if(op2->kind == 23 && op2->type->isSigned)
1979 *value2 = (unsigned int)op2->__anon1.i64;
1980 else if(op2->kind == 23)
1981 *value2 = (unsigned int)op2->__anon1.ui64;
1982 else if(op2->kind == 22 && op2->type->isSigned)
1983 *value2 = (unsigned int)op2->__anon1.i64;
1984 else if(op2->kind == 22)
1985 *value2 = (unsigned int)op2->__anon1.ui64;
1986 else if(op2->kind == 2 && op2->type->isSigned)
1987 *value2 = (unsigned int)op2->__anon1.s;
1988 else if(op2->kind == 2)
1989 *value2 = (unsigned int)op2->__anon1.us;
1990 else if(op2->kind == 1 && op2->type->isSigned)
1991 *value2 = (unsigned int)op2->__anon1.c;
1992 else if(op2->kind == 24 || op2->kind == 1)
1993 *value2 = (unsigned int)op2->__anon1.uc;
1994 else if(op2->kind == 6)
1995 *value2 = (unsigned int)op2->__anon1.f;
1996 else if(op2->kind == 7)
1997 *value2 = (unsigned int)op2->__anon1.d;
1998 else if(op2->kind == 13)
1999 *value2 = (unsigned int)op2->__anon1.ui64;
2000 else
2001 return 0;
2002 return 1;
2003 }
2004
2005 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
2006 {
2007 if(op2->kind == 3 && op2->type->isSigned)
2008 *value2 = (long long)op2->__anon1.i;
2009 else if(op2->kind == 3)
2010 *value2 = (long long)op2->__anon1.ui;
2011 else if(op2->kind == 4 && op2->type->isSigned)
2012 *value2 = op2->__anon1.i64;
2013 else if(op2->kind == 4)
2014 *value2 = (long long)op2->__anon1.ui64;
2015 else if(op2->kind == 23 && op2->type->isSigned)
2016 *value2 = op2->__anon1.i64;
2017 else if(op2->kind == 23)
2018 *value2 = (long long)op2->__anon1.ui64;
2019 else if(op2->kind == 22 && op2->type->isSigned)
2020 *value2 = op2->__anon1.i64;
2021 else if(op2->kind == 22)
2022 *value2 = (long long)op2->__anon1.ui64;
2023 else if(op2->kind == 2 && op2->type->isSigned)
2024 *value2 = (long long)op2->__anon1.s;
2025 else if(op2->kind == 2)
2026 *value2 = (long long)op2->__anon1.us;
2027 else if(op2->kind == 1 && op2->type->isSigned)
2028 *value2 = (long long)op2->__anon1.c;
2029 else if(op2->kind == 24 || op2->kind == 1)
2030 *value2 = (long long)op2->__anon1.uc;
2031 else if(op2->kind == 6)
2032 *value2 = (long long)op2->__anon1.f;
2033 else if(op2->kind == 7)
2034 *value2 = (long long)op2->__anon1.d;
2035 else if(op2->kind == 13)
2036 *value2 = (long long)op2->__anon1.ui64;
2037 else
2038 return 0;
2039 return 1;
2040 }
2041
2042 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
2043 {
2044 if(op2->kind == 3 && op2->type->isSigned)
2045 *value2 = (uint64)op2->__anon1.i;
2046 else if(op2->kind == 3)
2047 *value2 = (uint64)op2->__anon1.ui;
2048 else if(op2->kind == 4 && op2->type->isSigned)
2049 *value2 = (uint64)op2->__anon1.i64;
2050 else if(op2->kind == 4)
2051 *value2 = op2->__anon1.ui64;
2052 else if(op2->kind == 23 && op2->type->isSigned)
2053 *value2 = (uint64)op2->__anon1.i64;
2054 else if(op2->kind == 23)
2055 *value2 = op2->__anon1.ui64;
2056 else if(op2->kind == 22 && op2->type->isSigned)
2057 *value2 = (uint64)op2->__anon1.i64;
2058 else if(op2->kind == 22)
2059 *value2 = op2->__anon1.ui64;
2060 else if(op2->kind == 2 && op2->type->isSigned)
2061 *value2 = (uint64)op2->__anon1.s;
2062 else if(op2->kind == 2)
2063 *value2 = (uint64)op2->__anon1.us;
2064 else if(op2->kind == 1 && op2->type->isSigned)
2065 *value2 = (uint64)op2->__anon1.c;
2066 else if(op2->kind == 24 || op2->kind == 1)
2067 *value2 = (uint64)op2->__anon1.uc;
2068 else if(op2->kind == 6)
2069 *value2 = (uint64)op2->__anon1.f;
2070 else if(op2->kind == 7)
2071 *value2 = (uint64)op2->__anon1.d;
2072 else if(op2->kind == 13)
2073 *value2 = op2->__anon1.ui64;
2074 else
2075 return 0;
2076 return 1;
2077 }
2078
2079 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
2080 {
2081 if(op2->kind == 3 && op2->type->isSigned)
2082 *value2 = (intptr_t)op2->__anon1.i;
2083 else if(op2->kind == 3)
2084 *value2 = (intptr_t)op2->__anon1.ui;
2085 else if(op2->kind == 4 && op2->type->isSigned)
2086 *value2 = (intptr_t)op2->__anon1.i64;
2087 else if(op2->kind == 4)
2088 *value2 = (intptr_t)op2->__anon1.ui64;
2089 else if(op2->kind == 23 && op2->type->isSigned)
2090 *value2 = (intptr_t)op2->__anon1.i64;
2091 else if(op2->kind == 23)
2092 *value2 = (intptr_t)op2->__anon1.ui64;
2093 else if(op2->kind == 22 && op2->type->isSigned)
2094 *value2 = (intptr_t)op2->__anon1.i64;
2095 else if(op2->kind == 22)
2096 *value2 = (intptr_t)op2->__anon1.ui64;
2097 else if(op2->kind == 2 && op2->type->isSigned)
2098 *value2 = (intptr_t)op2->__anon1.s;
2099 else if(op2->kind == 2)
2100 *value2 = (intptr_t)op2->__anon1.us;
2101 else if(op2->kind == 1 && op2->type->isSigned)
2102 *value2 = (intptr_t)op2->__anon1.c;
2103 else if(op2->kind == 24 || op2->kind == 1)
2104 *value2 = (intptr_t)op2->__anon1.uc;
2105 else if(op2->kind == 6)
2106 *value2 = (intptr_t)op2->__anon1.f;
2107 else if(op2->kind == 7)
2108 *value2 = (intptr_t)op2->__anon1.d;
2109 else if(op2->kind == 13)
2110 *value2 = (intptr_t)op2->__anon1.ui64;
2111 else
2112 return 0;
2113 return 1;
2114 }
2115
2116 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
2117 {
2118 if(op2->kind == 3 && op2->type->isSigned)
2119 *value2 = (uintptr_t)op2->__anon1.i;
2120 else if(op2->kind == 3)
2121 *value2 = (uintptr_t)op2->__anon1.ui;
2122 else if(op2->kind == 4 && op2->type->isSigned)
2123 *value2 = (uintptr_t)op2->__anon1.i64;
2124 else if(op2->kind == 4)
2125 *value2 = (uintptr_t)op2->__anon1.ui64;
2126 else if(op2->kind == 23 && op2->type->isSigned)
2127 *value2 = (uintptr_t)op2->__anon1.i64;
2128 else if(op2->kind == 23)
2129 *value2 = (uintptr_t)op2->__anon1.ui64;
2130 else if(op2->kind == 22 && op2->type->isSigned)
2131 *value2 = (uintptr_t)op2->__anon1.i64;
2132 else if(op2->kind == 22)
2133 *value2 = (uintptr_t)op2->__anon1.ui64;
2134 else if(op2->kind == 2 && op2->type->isSigned)
2135 *value2 = (uintptr_t)op2->__anon1.s;
2136 else if(op2->kind == 2)
2137 *value2 = (uintptr_t)op2->__anon1.us;
2138 else if(op2->kind == 1 && op2->type->isSigned)
2139 *value2 = (uintptr_t)op2->__anon1.c;
2140 else if(op2->kind == 24 || op2->kind == 1)
2141 *value2 = (uintptr_t)op2->__anon1.uc;
2142 else if(op2->kind == 6)
2143 *value2 = (uintptr_t)op2->__anon1.f;
2144 else if(op2->kind == 7)
2145 *value2 = (uintptr_t)op2->__anon1.d;
2146 else if(op2->kind == 13)
2147 *value2 = (uintptr_t)op2->__anon1.ui64;
2148 else
2149 return 0;
2150 return 1;
2151 }
2152
2153 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2154 {
2155 if(op2->kind == 3 && op2->type->isSigned)
2156 *value2 = (ssize_t)op2->__anon1.i;
2157 else if(op2->kind == 3)
2158 *value2 = (ssize_t)op2->__anon1.ui;
2159 else if(op2->kind == 4 && op2->type->isSigned)
2160 *value2 = (ssize_t)op2->__anon1.i64;
2161 else if(op2->kind == 4)
2162 *value2 = (ssize_t)op2->__anon1.ui64;
2163 else if(op2->kind == 23 && op2->type->isSigned)
2164 *value2 = (ssize_t)op2->__anon1.i64;
2165 else if(op2->kind == 23)
2166 *value2 = (ssize_t)op2->__anon1.ui64;
2167 else if(op2->kind == 22 && op2->type->isSigned)
2168 *value2 = (ssize_t)op2->__anon1.i64;
2169 else if(op2->kind == 22)
2170 *value2 = (ssize_t)op2->__anon1.ui64;
2171 else if(op2->kind == 2 && op2->type->isSigned)
2172 *value2 = (ssize_t)op2->__anon1.s;
2173 else if(op2->kind == 2)
2174 *value2 = (ssize_t)op2->__anon1.us;
2175 else if(op2->kind == 1 && op2->type->isSigned)
2176 *value2 = (ssize_t)op2->__anon1.c;
2177 else if(op2->kind == 24 || op2->kind == 1)
2178 *value2 = (ssize_t)op2->__anon1.uc;
2179 else if(op2->kind == 6)
2180 *value2 = (ssize_t)op2->__anon1.f;
2181 else if(op2->kind == 7)
2182 *value2 = (ssize_t)op2->__anon1.d;
2183 else if(op2->kind == 13)
2184 *value2 = (ssize_t)op2->__anon1.ui64;
2185 else
2186 return 0;
2187 return 1;
2188 }
2189
2190 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2191 {
2192 if(op2->kind == 3 && op2->type->isSigned)
2193 *value2 = (size_t)op2->__anon1.i;
2194 else if(op2->kind == 3)
2195 *value2 = (size_t)op2->__anon1.ui;
2196 else if(op2->kind == 4 && op2->type->isSigned)
2197 *value2 = (size_t)op2->__anon1.i64;
2198 else if(op2->kind == 4)
2199 *value2 = (size_t)op2->__anon1.ui64;
2200 else if(op2->kind == 23 && op2->type->isSigned)
2201 *value2 = (size_t)op2->__anon1.i64;
2202 else if(op2->kind == 23)
2203 *value2 = (size_t)op2->__anon1.ui64;
2204 else if(op2->kind == 22 && op2->type->isSigned)
2205 *value2 = (size_t)op2->__anon1.i64;
2206 else if(op2->kind == 22)
2207 *value2 = (size_t)op2->__anon1.ui64;
2208 else if(op2->kind == 2 && op2->type->isSigned)
2209 *value2 = (size_t)op2->__anon1.s;
2210 else if(op2->kind == 2)
2211 *value2 = (size_t)op2->__anon1.us;
2212 else if(op2->kind == 1 && op2->type->isSigned)
2213 *value2 = (size_t)op2->__anon1.c;
2214 else if(op2->kind == 24 || op2->kind == 1)
2215 *value2 = (size_t)op2->__anon1.uc;
2216 else if(op2->kind == 6)
2217 *value2 = (size_t)op2->__anon1.f;
2218 else if(op2->kind == 7)
2219 *value2 = (size_t)op2->__anon1.d;
2220 else if(op2->kind == 13)
2221 *value2 = (size_t)op2->__anon1.ui64;
2222 else
2223 return 0;
2224 return 1;
2225 }
2226
2227 unsigned int GetOpShort(struct Operand * op2, short * value2)
2228 {
2229 if(op2->kind == 3 && op2->type->isSigned)
2230 *value2 = (short)op2->__anon1.i;
2231 else if(op2->kind == 3)
2232 *value2 = (short)op2->__anon1.ui;
2233 else if(op2->kind == 4 && op2->type->isSigned)
2234 *value2 = (short)op2->__anon1.i64;
2235 else if(op2->kind == 4)
2236 *value2 = (short)op2->__anon1.ui64;
2237 else if(op2->kind == 23 && op2->type->isSigned)
2238 *value2 = (short)op2->__anon1.i64;
2239 else if(op2->kind == 23)
2240 *value2 = (short)op2->__anon1.ui64;
2241 else if(op2->kind == 22 && op2->type->isSigned)
2242 *value2 = (short)op2->__anon1.i64;
2243 else if(op2->kind == 22)
2244 *value2 = (short)op2->__anon1.ui64;
2245 else if(op2->kind == 2 && op2->type->isSigned)
2246 *value2 = op2->__anon1.s;
2247 else if(op2->kind == 2)
2248 *value2 = (short)op2->__anon1.us;
2249 else if(op2->kind == 1 && op2->type->isSigned)
2250 *value2 = (short)op2->__anon1.c;
2251 else if(op2->kind == 24 || op2->kind == 1)
2252 *value2 = (short)op2->__anon1.uc;
2253 else if(op2->kind == 6)
2254 *value2 = (short)op2->__anon1.f;
2255 else if(op2->kind == 7)
2256 *value2 = (short)op2->__anon1.d;
2257 else if(op2->kind == 13)
2258 *value2 = (short)op2->__anon1.ui64;
2259 else
2260 return 0;
2261 return 1;
2262 }
2263
2264 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2265 {
2266 if(op2->kind == 3 && op2->type->isSigned)
2267 *value2 = (unsigned short)op2->__anon1.i;
2268 else if(op2->kind == 3)
2269 *value2 = (unsigned short)op2->__anon1.ui;
2270 else if(op2->kind == 4 && op2->type->isSigned)
2271 *value2 = (unsigned short)op2->__anon1.i64;
2272 else if(op2->kind == 4)
2273 *value2 = (unsigned short)op2->__anon1.ui64;
2274 else if(op2->kind == 23 && op2->type->isSigned)
2275 *value2 = (unsigned short)op2->__anon1.i64;
2276 else if(op2->kind == 23)
2277 *value2 = (unsigned short)op2->__anon1.ui64;
2278 else if(op2->kind == 22 && op2->type->isSigned)
2279 *value2 = (unsigned short)op2->__anon1.i64;
2280 else if(op2->kind == 22)
2281 *value2 = (unsigned short)op2->__anon1.ui64;
2282 else if(op2->kind == 2 && op2->type->isSigned)
2283 *value2 = (unsigned short)op2->__anon1.s;
2284 else if(op2->kind == 2)
2285 *value2 = op2->__anon1.us;
2286 else if(op2->kind == 1 && op2->type->isSigned)
2287 *value2 = (unsigned short)op2->__anon1.c;
2288 else if(op2->kind == 24 || op2->kind == 1)
2289 *value2 = (unsigned short)op2->__anon1.uc;
2290 else if(op2->kind == 6)
2291 *value2 = (unsigned short)op2->__anon1.f;
2292 else if(op2->kind == 7)
2293 *value2 = (unsigned short)op2->__anon1.d;
2294 else if(op2->kind == 13)
2295 *value2 = (unsigned short)op2->__anon1.ui64;
2296 else
2297 return 0;
2298 return 1;
2299 }
2300
2301 unsigned int GetOpChar(struct Operand * op2, char * value2)
2302 {
2303 if(op2->kind == 3 && op2->type->isSigned)
2304 *value2 = (char)op2->__anon1.i;
2305 else if(op2->kind == 3)
2306 *value2 = (char)op2->__anon1.ui;
2307 else if(op2->kind == 4 && op2->type->isSigned)
2308 *value2 = (char)op2->__anon1.i64;
2309 else if(op2->kind == 4)
2310 *value2 = (char)op2->__anon1.ui64;
2311 else if(op2->kind == 23 && op2->type->isSigned)
2312 *value2 = (char)op2->__anon1.i64;
2313 else if(op2->kind == 23)
2314 *value2 = (char)op2->__anon1.ui64;
2315 else if(op2->kind == 22 && op2->type->isSigned)
2316 *value2 = (char)op2->__anon1.i64;
2317 else if(op2->kind == 22)
2318 *value2 = (char)op2->__anon1.ui64;
2319 else if(op2->kind == 2 && op2->type->isSigned)
2320 *value2 = (char)op2->__anon1.s;
2321 else if(op2->kind == 2)
2322 *value2 = (char)op2->__anon1.us;
2323 else if(op2->kind == 1 && op2->type->isSigned)
2324 *value2 = op2->__anon1.c;
2325 else if(op2->kind == 24 || op2->kind == 1)
2326 *value2 = (char)op2->__anon1.uc;
2327 else if(op2->kind == 6)
2328 *value2 = (char)op2->__anon1.f;
2329 else if(op2->kind == 7)
2330 *value2 = (char)op2->__anon1.d;
2331 else if(op2->kind == 13)
2332 *value2 = (char)op2->__anon1.ui64;
2333 else
2334 return 0;
2335 return 1;
2336 }
2337
2338 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2339 {
2340 if(op2->kind == 3 && op2->type->isSigned)
2341 *value2 = (unsigned char)op2->__anon1.i;
2342 else if(op2->kind == 3)
2343 *value2 = (unsigned char)op2->__anon1.ui;
2344 else if(op2->kind == 4 && op2->type->isSigned)
2345 *value2 = (unsigned char)op2->__anon1.i64;
2346 else if(op2->kind == 4)
2347 *value2 = (unsigned char)op2->__anon1.ui64;
2348 else if(op2->kind == 23 && op2->type->isSigned)
2349 *value2 = (unsigned char)op2->__anon1.i64;
2350 else if(op2->kind == 23)
2351 *value2 = (unsigned char)op2->__anon1.ui64;
2352 else if(op2->kind == 22 && op2->type->isSigned)
2353 *value2 = (unsigned char)op2->__anon1.i64;
2354 else if(op2->kind == 22)
2355 *value2 = (unsigned char)op2->__anon1.ui64;
2356 else if(op2->kind == 2 && op2->type->isSigned)
2357 *value2 = (unsigned char)op2->__anon1.s;
2358 else if(op2->kind == 2)
2359 *value2 = (unsigned char)op2->__anon1.us;
2360 else if(op2->kind == 1 && op2->type->isSigned)
2361 *value2 = (unsigned char)op2->__anon1.c;
2362 else if(op2->kind == 24 || op2->kind == 1)
2363 *value2 = op2->__anon1.uc;
2364 else if(op2->kind == 6)
2365 *value2 = (unsigned char)op2->__anon1.f;
2366 else if(op2->kind == 7)
2367 *value2 = (unsigned char)op2->__anon1.d;
2368 else if(op2->kind == 13)
2369 *value2 = (unsigned char)op2->__anon1.ui64;
2370 else
2371 return 0;
2372 return 1;
2373 }
2374
2375 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2376 {
2377 if(op2->kind == 3 && op2->type->isSigned)
2378 *value2 = (float)(float)op2->__anon1.i;
2379 else if(op2->kind == 3)
2380 *value2 = (float)(float)op2->__anon1.ui;
2381 else if(op2->kind == 4 && op2->type->isSigned)
2382 *value2 = (float)(float)op2->__anon1.i64;
2383 else if(op2->kind == 4)
2384 *value2 = (float)(float)op2->__anon1.ui64;
2385 else if(op2->kind == 23 && op2->type->isSigned)
2386 *value2 = (float)(float)op2->__anon1.i64;
2387 else if(op2->kind == 23)
2388 *value2 = (float)(float)op2->__anon1.ui64;
2389 else if(op2->kind == 22 && op2->type->isSigned)
2390 *value2 = (float)(float)op2->__anon1.i64;
2391 else if(op2->kind == 22)
2392 *value2 = (float)(float)op2->__anon1.ui64;
2393 else if(op2->kind == 2 && op2->type->isSigned)
2394 *value2 = (float)(float)op2->__anon1.s;
2395 else if(op2->kind == 2)
2396 *value2 = (float)(float)op2->__anon1.us;
2397 else if(op2->kind == 1 && op2->type->isSigned)
2398 *value2 = (float)(float)op2->__anon1.c;
2399 else if(op2->kind == 24 || op2->kind == 1)
2400 *value2 = (float)(float)op2->__anon1.uc;
2401 else if(op2->kind == 6)
2402 *value2 = (float)op2->__anon1.f;
2403 else if(op2->kind == 7)
2404 *value2 = (float)op2->__anon1.d;
2405 else if(op2->kind == 13)
2406 *value2 = (float)(float)op2->__anon1.ui64;
2407 else
2408 return 0;
2409 return 1;
2410 }
2411
2412 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2413 {
2414 if(op2->kind == 3 && op2->type->isSigned)
2415 *value2 = (double)(double)op2->__anon1.i;
2416 else if(op2->kind == 3)
2417 *value2 = (double)(double)op2->__anon1.ui;
2418 else if(op2->kind == 4 && op2->type->isSigned)
2419 *value2 = (double)(double)op2->__anon1.i64;
2420 else if(op2->kind == 4)
2421 *value2 = (double)(double)op2->__anon1.ui64;
2422 else if(op2->kind == 23 && op2->type->isSigned)
2423 *value2 = (double)(double)op2->__anon1.i64;
2424 else if(op2->kind == 23)
2425 *value2 = (double)(double)op2->__anon1.ui64;
2426 else if(op2->kind == 22 && op2->type->isSigned)
2427 *value2 = (double)(double)op2->__anon1.i64;
2428 else if(op2->kind == 22)
2429 *value2 = (double)(double)op2->__anon1.ui64;
2430 else if(op2->kind == 2 && op2->type->isSigned)
2431 *value2 = (double)(double)op2->__anon1.s;
2432 else if(op2->kind == 2)
2433 *value2 = (double)(double)op2->__anon1.us;
2434 else if(op2->kind == 1 && op2->type->isSigned)
2435 *value2 = (double)(double)op2->__anon1.c;
2436 else if(op2->kind == 24 || op2->kind == 1)
2437 *value2 = (double)(double)op2->__anon1.uc;
2438 else if(op2->kind == 6)
2439 *value2 = (double)op2->__anon1.f;
2440 else if(op2->kind == 7)
2441 *value2 = (double)op2->__anon1.d;
2442 else if(op2->kind == 13)
2443 *value2 = (double)(double)op2->__anon1.ui64;
2444 else
2445 return 0;
2446 return 1;
2447 }
2448
2449 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2450 {
2451 int value2 = op2->__anon1.i;
2452
2453 exp->type = 2;
2454 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
2455 if(!exp->expType)
2456 {
2457 exp->expType = op1->type;
2458 if(op1->type)
2459 op1->type->refCount++;
2460 }
2461 return 1;
2462 }
2463
2464 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2465 {
2466 unsigned int value2 = op2->__anon1.ui;
2467
2468 exp->type = 2;
2469 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
2470 if(!exp->expType)
2471 {
2472 exp->expType = op1->type;
2473 if(op1->type)
2474 op1->type->refCount++;
2475 }
2476 return 1;
2477 }
2478
2479 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2480 {
2481 long long value2 = op2->__anon1.i64;
2482
2483 exp->type = 2;
2484 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
2485 if(!exp->expType)
2486 {
2487 exp->expType = op1->type;
2488 if(op1->type)
2489 op1->type->refCount++;
2490 }
2491 return 1;
2492 }
2493
2494 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2495 {
2496 uint64 value2 = op2->__anon1.ui64;
2497
2498 exp->type = 2;
2499 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
2500 if(!exp->expType)
2501 {
2502 exp->expType = op1->type;
2503 if(op1->type)
2504 op1->type->refCount++;
2505 }
2506 return 1;
2507 }
2508
2509 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2510 {
2511 short value2 = op2->__anon1.s;
2512
2513 exp->type = 2;
2514 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
2515 if(!exp->expType)
2516 {
2517 exp->expType = op1->type;
2518 if(op1->type)
2519 op1->type->refCount++;
2520 }
2521 return 1;
2522 }
2523
2524 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2525 {
2526 unsigned short value2 = op2->__anon1.us;
2527
2528 exp->type = 2;
2529 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
2530 if(!exp->expType)
2531 {
2532 exp->expType = op1->type;
2533 if(op1->type)
2534 op1->type->refCount++;
2535 }
2536 return 1;
2537 }
2538
2539 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2540 {
2541 char value2 = op2->__anon1.c;
2542
2543 exp->type = 2;
2544 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
2545 if(!exp->expType)
2546 {
2547 exp->expType = op1->type;
2548 if(op1->type)
2549 op1->type->refCount++;
2550 }
2551 return 1;
2552 }
2553
2554 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2555 {
2556 unsigned char value2 = op2->__anon1.uc;
2557
2558 exp->type = 2;
2559 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
2560 if(!exp->expType)
2561 {
2562 exp->expType = op1->type;
2563 if(op1->type)
2564 op1->type->refCount++;
2565 }
2566 return 1;
2567 }
2568
2569 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2570 {
2571 float value2 = op2->__anon1.f;
2572
2573 exp->type = 2;
2574 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
2575 if(!exp->expType)
2576 {
2577 exp->expType = op1->type;
2578 if(op1->type)
2579 op1->type->refCount++;
2580 }
2581 return 1;
2582 }
2583
2584 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2585 {
2586 double value2 = op2->__anon1.d;
2587
2588 exp->type = 2;
2589 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
2590 if(!exp->expType)
2591 {
2592 exp->expType = op1->type;
2593 if(op1->type)
2594 op1->type->refCount++;
2595 }
2596 return 1;
2597 }
2598
2599 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2600 {
2601 int value2 = op2->__anon1.i;
2602
2603 exp->type = 2;
2604 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
2605 if(!exp->expType)
2606 {
2607 exp->expType = op1->type;
2608 if(op1->type)
2609 op1->type->refCount++;
2610 }
2611 return 1;
2612 }
2613
2614 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2615 {
2616 unsigned int value2 = op2->__anon1.ui;
2617
2618 exp->type = 2;
2619 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
2620 if(!exp->expType)
2621 {
2622 exp->expType = op1->type;
2623 if(op1->type)
2624 op1->type->refCount++;
2625 }
2626 return 1;
2627 }
2628
2629 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2630 {
2631 long long value2 = op2->__anon1.i64;
2632
2633 exp->type = 2;
2634 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
2635 if(!exp->expType)
2636 {
2637 exp->expType = op1->type;
2638 if(op1->type)
2639 op1->type->refCount++;
2640 }
2641 return 1;
2642 }
2643
2644 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2645 {
2646 uint64 value2 = op2->__anon1.ui64;
2647
2648 exp->type = 2;
2649 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
2650 if(!exp->expType)
2651 {
2652 exp->expType = op1->type;
2653 if(op1->type)
2654 op1->type->refCount++;
2655 }
2656 return 1;
2657 }
2658
2659 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2660 {
2661 short value2 = op2->__anon1.s;
2662
2663 exp->type = 2;
2664 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
2665 if(!exp->expType)
2666 {
2667 exp->expType = op1->type;
2668 if(op1->type)
2669 op1->type->refCount++;
2670 }
2671 return 1;
2672 }
2673
2674 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2675 {
2676 unsigned short value2 = op2->__anon1.us;
2677
2678 exp->type = 2;
2679 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
2680 if(!exp->expType)
2681 {
2682 exp->expType = op1->type;
2683 if(op1->type)
2684 op1->type->refCount++;
2685 }
2686 return 1;
2687 }
2688
2689 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2690 {
2691 char value2 = op2->__anon1.c;
2692
2693 exp->type = 2;
2694 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
2695 if(!exp->expType)
2696 {
2697 exp->expType = op1->type;
2698 if(op1->type)
2699 op1->type->refCount++;
2700 }
2701 return 1;
2702 }
2703
2704 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2705 {
2706 unsigned char value2 = op2->__anon1.uc;
2707
2708 exp->type = 2;
2709 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
2710 if(!exp->expType)
2711 {
2712 exp->expType = op1->type;
2713 if(op1->type)
2714 op1->type->refCount++;
2715 }
2716 return 1;
2717 }
2718
2719 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2720 {
2721 float value2 = op2->__anon1.f;
2722
2723 exp->type = 2;
2724 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
2725 if(!exp->expType)
2726 {
2727 exp->expType = op1->type;
2728 if(op1->type)
2729 op1->type->refCount++;
2730 }
2731 return 1;
2732 }
2733
2734 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2735 {
2736 double value2 = op2->__anon1.d;
2737
2738 exp->type = 2;
2739 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
2740 if(!exp->expType)
2741 {
2742 exp->expType = op1->type;
2743 if(op1->type)
2744 op1->type->refCount++;
2745 }
2746 return 1;
2747 }
2748
2749 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2750 {
2751 int value2 = op2->__anon1.i;
2752
2753 exp->type = 2;
2754 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
2755 if(!exp->expType)
2756 {
2757 exp->expType = op1->type;
2758 if(op1->type)
2759 op1->type->refCount++;
2760 }
2761 return 1;
2762 }
2763
2764 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2765 {
2766 unsigned int value2 = op2->__anon1.ui;
2767
2768 exp->type = 2;
2769 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
2770 if(!exp->expType)
2771 {
2772 exp->expType = op1->type;
2773 if(op1->type)
2774 op1->type->refCount++;
2775 }
2776 return 1;
2777 }
2778
2779 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2780 {
2781 long long value2 = op2->__anon1.i64;
2782
2783 exp->type = 2;
2784 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
2785 if(!exp->expType)
2786 {
2787 exp->expType = op1->type;
2788 if(op1->type)
2789 op1->type->refCount++;
2790 }
2791 return 1;
2792 }
2793
2794 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2795 {
2796 uint64 value2 = op2->__anon1.ui64;
2797
2798 exp->type = 2;
2799 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
2800 if(!exp->expType)
2801 {
2802 exp->expType = op1->type;
2803 if(op1->type)
2804 op1->type->refCount++;
2805 }
2806 return 1;
2807 }
2808
2809 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2810 {
2811 short value2 = op2->__anon1.s;
2812
2813 exp->type = 2;
2814 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
2815 if(!exp->expType)
2816 {
2817 exp->expType = op1->type;
2818 if(op1->type)
2819 op1->type->refCount++;
2820 }
2821 return 1;
2822 }
2823
2824 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2825 {
2826 unsigned short value2 = op2->__anon1.us;
2827
2828 exp->type = 2;
2829 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
2830 if(!exp->expType)
2831 {
2832 exp->expType = op1->type;
2833 if(op1->type)
2834 op1->type->refCount++;
2835 }
2836 return 1;
2837 }
2838
2839 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2840 {
2841 char value2 = op2->__anon1.c;
2842
2843 exp->type = 2;
2844 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
2845 if(!exp->expType)
2846 {
2847 exp->expType = op1->type;
2848 if(op1->type)
2849 op1->type->refCount++;
2850 }
2851 return 1;
2852 }
2853
2854 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2855 {
2856 unsigned char value2 = op2->__anon1.uc;
2857
2858 exp->type = 2;
2859 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
2860 if(!exp->expType)
2861 {
2862 exp->expType = op1->type;
2863 if(op1->type)
2864 op1->type->refCount++;
2865 }
2866 return 1;
2867 }
2868
2869 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2870 {
2871 float value2 = op2->__anon1.f;
2872
2873 exp->type = 2;
2874 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
2875 if(!exp->expType)
2876 {
2877 exp->expType = op1->type;
2878 if(op1->type)
2879 op1->type->refCount++;
2880 }
2881 return 1;
2882 }
2883
2884 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2885 {
2886 double value2 = op2->__anon1.d;
2887
2888 exp->type = 2;
2889 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
2890 if(!exp->expType)
2891 {
2892 exp->expType = op1->type;
2893 if(op1->type)
2894 op1->type->refCount++;
2895 }
2896 return 1;
2897 }
2898
2899 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2900 {
2901 int value2 = op2->__anon1.i;
2902
2903 exp->type = 2;
2904 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
2905 if(!exp->expType)
2906 {
2907 exp->expType = op1->type;
2908 if(op1->type)
2909 op1->type->refCount++;
2910 }
2911 return 1;
2912 }
2913
2914 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2915 {
2916 unsigned int value2 = op2->__anon1.ui;
2917
2918 exp->type = 2;
2919 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
2920 if(!exp->expType)
2921 {
2922 exp->expType = op1->type;
2923 if(op1->type)
2924 op1->type->refCount++;
2925 }
2926 return 1;
2927 }
2928
2929 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2930 {
2931 long long value2 = op2->__anon1.i64;
2932
2933 exp->type = 2;
2934 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
2935 if(!exp->expType)
2936 {
2937 exp->expType = op1->type;
2938 if(op1->type)
2939 op1->type->refCount++;
2940 }
2941 return 1;
2942 }
2943
2944 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2945 {
2946 uint64 value2 = op2->__anon1.ui64;
2947
2948 exp->type = 2;
2949 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
2950 if(!exp->expType)
2951 {
2952 exp->expType = op1->type;
2953 if(op1->type)
2954 op1->type->refCount++;
2955 }
2956 return 1;
2957 }
2958
2959 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2960 {
2961 short value2 = op2->__anon1.s;
2962
2963 exp->type = 2;
2964 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
2965 if(!exp->expType)
2966 {
2967 exp->expType = op1->type;
2968 if(op1->type)
2969 op1->type->refCount++;
2970 }
2971 return 1;
2972 }
2973
2974 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2975 {
2976 unsigned short value2 = op2->__anon1.us;
2977
2978 exp->type = 2;
2979 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
2980 if(!exp->expType)
2981 {
2982 exp->expType = op1->type;
2983 if(op1->type)
2984 op1->type->refCount++;
2985 }
2986 return 1;
2987 }
2988
2989 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2990 {
2991 char value2 = op2->__anon1.c;
2992
2993 exp->type = 2;
2994 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
2995 if(!exp->expType)
2996 {
2997 exp->expType = op1->type;
2998 if(op1->type)
2999 op1->type->refCount++;
3000 }
3001 return 1;
3002 }
3003
3004 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3005 {
3006 unsigned char value2 = op2->__anon1.uc;
3007
3008 exp->type = 2;
3009 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
3010 if(!exp->expType)
3011 {
3012 exp->expType = op1->type;
3013 if(op1->type)
3014 op1->type->refCount++;
3015 }
3016 return 1;
3017 }
3018
3019 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3020 {
3021 float value2 = op2->__anon1.f;
3022
3023 exp->type = 2;
3024 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
3025 if(!exp->expType)
3026 {
3027 exp->expType = op1->type;
3028 if(op1->type)
3029 op1->type->refCount++;
3030 }
3031 return 1;
3032 }
3033
3034 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3035 {
3036 double value2 = op2->__anon1.d;
3037
3038 exp->type = 2;
3039 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
3040 if(!exp->expType)
3041 {
3042 exp->expType = op1->type;
3043 if(op1->type)
3044 op1->type->refCount++;
3045 }
3046 return 1;
3047 }
3048
3049 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3050 {
3051 int value2 = op2->__anon1.i;
3052
3053 exp->type = 2;
3054 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
3055 if(!exp->expType)
3056 {
3057 exp->expType = op1->type;
3058 if(op1->type)
3059 op1->type->refCount++;
3060 }
3061 return 1;
3062 }
3063
3064 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3065 {
3066 unsigned int value2 = op2->__anon1.ui;
3067
3068 exp->type = 2;
3069 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
3070 if(!exp->expType)
3071 {
3072 exp->expType = op1->type;
3073 if(op1->type)
3074 op1->type->refCount++;
3075 }
3076 return 1;
3077 }
3078
3079 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3080 {
3081 long long value2 = op2->__anon1.i64;
3082
3083 exp->type = 2;
3084 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
3085 if(!exp->expType)
3086 {
3087 exp->expType = op1->type;
3088 if(op1->type)
3089 op1->type->refCount++;
3090 }
3091 return 1;
3092 }
3093
3094 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3095 {
3096 uint64 value2 = op2->__anon1.ui64;
3097
3098 exp->type = 2;
3099 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
3100 if(!exp->expType)
3101 {
3102 exp->expType = op1->type;
3103 if(op1->type)
3104 op1->type->refCount++;
3105 }
3106 return 1;
3107 }
3108
3109 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3110 {
3111 short value2 = op2->__anon1.s;
3112
3113 exp->type = 2;
3114 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
3115 if(!exp->expType)
3116 {
3117 exp->expType = op1->type;
3118 if(op1->type)
3119 op1->type->refCount++;
3120 }
3121 return 1;
3122 }
3123
3124 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3125 {
3126 unsigned short value2 = op2->__anon1.us;
3127
3128 exp->type = 2;
3129 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
3130 if(!exp->expType)
3131 {
3132 exp->expType = op1->type;
3133 if(op1->type)
3134 op1->type->refCount++;
3135 }
3136 return 1;
3137 }
3138
3139 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3140 {
3141 char value2 = op2->__anon1.c;
3142
3143 exp->type = 2;
3144 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
3145 if(!exp->expType)
3146 {
3147 exp->expType = op1->type;
3148 if(op1->type)
3149 op1->type->refCount++;
3150 }
3151 return 1;
3152 }
3153
3154 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3155 {
3156 unsigned char value2 = op2->__anon1.uc;
3157
3158 exp->type = 2;
3159 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
3160 if(!exp->expType)
3161 {
3162 exp->expType = op1->type;
3163 if(op1->type)
3164 op1->type->refCount++;
3165 }
3166 return 1;
3167 }
3168
3169 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
3170 {
3171 exp->type = 2;
3172 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
3173 if(!exp->expType)
3174 {
3175 exp->expType = op1->type;
3176 if(op1->type)
3177 op1->type->refCount++;
3178 }
3179 return 1;
3180 }
3181
3182 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
3183 {
3184 exp->type = 2;
3185 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
3186 if(!exp->expType)
3187 {
3188 exp->expType = op1->type;
3189 if(op1->type)
3190 op1->type->refCount++;
3191 }
3192 return 1;
3193 }
3194
3195 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
3196 {
3197 exp->type = 2;
3198 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
3199 if(!exp->expType)
3200 {
3201 exp->expType = op1->type;
3202 if(op1->type)
3203 op1->type->refCount++;
3204 }
3205 return 1;
3206 }
3207
3208 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
3209 {
3210 exp->type = 2;
3211 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
3212 if(!exp->expType)
3213 {
3214 exp->expType = op1->type;
3215 if(op1->type)
3216 op1->type->refCount++;
3217 }
3218 return 1;
3219 }
3220
3221 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
3222 {
3223 exp->type = 2;
3224 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
3225 if(!exp->expType)
3226 {
3227 exp->expType = op1->type;
3228 if(op1->type)
3229 op1->type->refCount++;
3230 }
3231 return 1;
3232 }
3233
3234 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
3235 {
3236 exp->type = 2;
3237 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
3238 if(!exp->expType)
3239 {
3240 exp->expType = op1->type;
3241 if(op1->type)
3242 op1->type->refCount++;
3243 }
3244 return 1;
3245 }
3246
3247 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
3248 {
3249 exp->type = 2;
3250 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
3251 if(!exp->expType)
3252 {
3253 exp->expType = op1->type;
3254 if(op1->type)
3255 op1->type->refCount++;
3256 }
3257 return 1;
3258 }
3259
3260 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
3261 {
3262 exp->type = 2;
3263 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
3264 if(!exp->expType)
3265 {
3266 exp->expType = op1->type;
3267 if(op1->type)
3268 op1->type->refCount++;
3269 }
3270 return 1;
3271 }
3272
3273 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
3274 {
3275 exp->type = 2;
3276 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
3277 if(!exp->expType)
3278 {
3279 exp->expType = op1->type;
3280 if(op1->type)
3281 op1->type->refCount++;
3282 }
3283 return 1;
3284 }
3285
3286 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
3287 {
3288 exp->type = 2;
3289 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
3290 if(!exp->expType)
3291 {
3292 exp->expType = op1->type;
3293 if(op1->type)
3294 op1->type->refCount++;
3295 }
3296 return 1;
3297 }
3298
3299 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
3300 {
3301 exp->type = 2;
3302 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
3303 if(!exp->expType)
3304 {
3305 exp->expType = op1->type;
3306 if(op1->type)
3307 op1->type->refCount++;
3308 }
3309 return 1;
3310 }
3311
3312 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
3313 {
3314 exp->type = 2;
3315 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
3316 if(!exp->expType)
3317 {
3318 exp->expType = op1->type;
3319 if(op1->type)
3320 op1->type->refCount++;
3321 }
3322 return 1;
3323 }
3324
3325 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
3326 {
3327 exp->type = 2;
3328 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
3329 if(!exp->expType)
3330 {
3331 exp->expType = op1->type;
3332 if(op1->type)
3333 op1->type->refCount++;
3334 }
3335 return 1;
3336 }
3337
3338 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
3339 {
3340 exp->type = 2;
3341 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
3342 if(!exp->expType)
3343 {
3344 exp->expType = op1->type;
3345 if(op1->type)
3346 op1->type->refCount++;
3347 }
3348 return 1;
3349 }
3350
3351 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
3352 {
3353 exp->type = 2;
3354 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
3355 if(!exp->expType)
3356 {
3357 exp->expType = op1->type;
3358 if(op1->type)
3359 op1->type->refCount++;
3360 }
3361 return 1;
3362 }
3363
3364 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
3365 {
3366 exp->type = 2;
3367 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
3368 if(!exp->expType)
3369 {
3370 exp->expType = op1->type;
3371 if(op1->type)
3372 op1->type->refCount++;
3373 }
3374 return 1;
3375 }
3376
3377 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
3378 {
3379 exp->type = 2;
3380 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
3381 if(!exp->expType)
3382 {
3383 exp->expType = op1->type;
3384 if(op1->type)
3385 op1->type->refCount++;
3386 }
3387 return 1;
3388 }
3389
3390 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
3391 {
3392 exp->type = 2;
3393 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
3394 if(!exp->expType)
3395 {
3396 exp->expType = op1->type;
3397 if(op1->type)
3398 op1->type->refCount++;
3399 }
3400 return 1;
3401 }
3402
3403 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
3404 {
3405 exp->type = 2;
3406 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
3407 if(!exp->expType)
3408 {
3409 exp->expType = op1->type;
3410 if(op1->type)
3411 op1->type->refCount++;
3412 }
3413 return 1;
3414 }
3415
3416 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
3417 {
3418 exp->type = 2;
3419 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
3420 if(!exp->expType)
3421 {
3422 exp->expType = op1->type;
3423 if(op1->type)
3424 op1->type->refCount++;
3425 }
3426 return 1;
3427 }
3428
3429 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
3430 {
3431 exp->type = 2;
3432 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
3433 if(!exp->expType)
3434 {
3435 exp->expType = op1->type;
3436 if(op1->type)
3437 op1->type->refCount++;
3438 }
3439 return 1;
3440 }
3441
3442 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
3443 {
3444 exp->type = 2;
3445 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
3446 if(!exp->expType)
3447 {
3448 exp->expType = op1->type;
3449 if(op1->type)
3450 op1->type->refCount++;
3451 }
3452 return 1;
3453 }
3454
3455 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
3456 {
3457 exp->type = 2;
3458 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
3459 if(!exp->expType)
3460 {
3461 exp->expType = op1->type;
3462 if(op1->type)
3463 op1->type->refCount++;
3464 }
3465 return 1;
3466 }
3467
3468 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
3469 {
3470 exp->type = 2;
3471 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
3472 if(!exp->expType)
3473 {
3474 exp->expType = op1->type;
3475 if(op1->type)
3476 op1->type->refCount++;
3477 }
3478 return 1;
3479 }
3480
3481 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
3482 {
3483 exp->type = 2;
3484 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
3485 if(!exp->expType)
3486 {
3487 exp->expType = op1->type;
3488 if(op1->type)
3489 op1->type->refCount++;
3490 }
3491 return 1;
3492 }
3493
3494 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
3495 {
3496 exp->type = 2;
3497 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
3498 if(!exp->expType)
3499 {
3500 exp->expType = op1->type;
3501 if(op1->type)
3502 op1->type->refCount++;
3503 }
3504 return 1;
3505 }
3506
3507 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
3508 {
3509 exp->type = 2;
3510 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
3511 if(!exp->expType)
3512 {
3513 exp->expType = op1->type;
3514 if(op1->type)
3515 op1->type->refCount++;
3516 }
3517 return 1;
3518 }
3519
3520 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
3521 {
3522 exp->type = 2;
3523 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
3524 if(!exp->expType)
3525 {
3526 exp->expType = op1->type;
3527 if(op1->type)
3528 op1->type->refCount++;
3529 }
3530 return 1;
3531 }
3532
3533 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
3534 {
3535 exp->type = 2;
3536 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
3537 if(!exp->expType)
3538 {
3539 exp->expType = op1->type;
3540 if(op1->type)
3541 op1->type->refCount++;
3542 }
3543 return 1;
3544 }
3545
3546 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
3547 {
3548 exp->type = 2;
3549 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
3550 if(!exp->expType)
3551 {
3552 exp->expType = op1->type;
3553 if(op1->type)
3554 op1->type->refCount++;
3555 }
3556 return 1;
3557 }
3558
3559 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3560 {
3561 int value2 = op2->__anon1.i;
3562
3563 exp->type = 2;
3564 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
3565 if(!exp->expType)
3566 {
3567 exp->expType = op1->type;
3568 if(op1->type)
3569 op1->type->refCount++;
3570 }
3571 return 1;
3572 }
3573
3574 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3575 {
3576 unsigned int value2 = op2->__anon1.ui;
3577
3578 exp->type = 2;
3579 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
3580 if(!exp->expType)
3581 {
3582 exp->expType = op1->type;
3583 if(op1->type)
3584 op1->type->refCount++;
3585 }
3586 return 1;
3587 }
3588
3589 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3590 {
3591 long long value2 = op2->__anon1.i64;
3592
3593 exp->type = 2;
3594 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
3595 if(!exp->expType)
3596 {
3597 exp->expType = op1->type;
3598 if(op1->type)
3599 op1->type->refCount++;
3600 }
3601 return 1;
3602 }
3603
3604 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3605 {
3606 uint64 value2 = op2->__anon1.ui64;
3607
3608 exp->type = 2;
3609 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
3610 if(!exp->expType)
3611 {
3612 exp->expType = op1->type;
3613 if(op1->type)
3614 op1->type->refCount++;
3615 }
3616 return 1;
3617 }
3618
3619 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3620 {
3621 short value2 = op2->__anon1.s;
3622
3623 exp->type = 2;
3624 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
3625 if(!exp->expType)
3626 {
3627 exp->expType = op1->type;
3628 if(op1->type)
3629 op1->type->refCount++;
3630 }
3631 return 1;
3632 }
3633
3634 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3635 {
3636 unsigned short value2 = op2->__anon1.us;
3637
3638 exp->type = 2;
3639 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
3640 if(!exp->expType)
3641 {
3642 exp->expType = op1->type;
3643 if(op1->type)
3644 op1->type->refCount++;
3645 }
3646 return 1;
3647 }
3648
3649 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3650 {
3651 char value2 = op2->__anon1.c;
3652
3653 exp->type = 2;
3654 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
3655 if(!exp->expType)
3656 {
3657 exp->expType = op1->type;
3658 if(op1->type)
3659 op1->type->refCount++;
3660 }
3661 return 1;
3662 }
3663
3664 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3665 {
3666 unsigned char value2 = op2->__anon1.uc;
3667
3668 exp->type = 2;
3669 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
3670 if(!exp->expType)
3671 {
3672 exp->expType = op1->type;
3673 if(op1->type)
3674 op1->type->refCount++;
3675 }
3676 return 1;
3677 }
3678
3679 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3680 {
3681 float value2 = op2->__anon1.f;
3682
3683 exp->type = 2;
3684 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
3685 if(!exp->expType)
3686 {
3687 exp->expType = op1->type;
3688 if(op1->type)
3689 op1->type->refCount++;
3690 }
3691 return 1;
3692 }
3693
3694 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3695 {
3696 double value2 = op2->__anon1.d;
3697
3698 exp->type = 2;
3699 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
3700 if(!exp->expType)
3701 {
3702 exp->expType = op1->type;
3703 if(op1->type)
3704 op1->type->refCount++;
3705 }
3706 return 1;
3707 }
3708
3709 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3710 {
3711 int value2 = op2->__anon1.i;
3712
3713 exp->type = 2;
3714 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
3715 if(!exp->expType)
3716 {
3717 exp->expType = op1->type;
3718 if(op1->type)
3719 op1->type->refCount++;
3720 }
3721 return 1;
3722 }
3723
3724 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3725 {
3726 unsigned int value2 = op2->__anon1.ui;
3727
3728 exp->type = 2;
3729 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
3730 if(!exp->expType)
3731 {
3732 exp->expType = op1->type;
3733 if(op1->type)
3734 op1->type->refCount++;
3735 }
3736 return 1;
3737 }
3738
3739 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3740 {
3741 long long value2 = op2->__anon1.i64;
3742
3743 exp->type = 2;
3744 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
3745 if(!exp->expType)
3746 {
3747 exp->expType = op1->type;
3748 if(op1->type)
3749 op1->type->refCount++;
3750 }
3751 return 1;
3752 }
3753
3754 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3755 {
3756 uint64 value2 = op2->__anon1.ui64;
3757
3758 exp->type = 2;
3759 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
3760 if(!exp->expType)
3761 {
3762 exp->expType = op1->type;
3763 if(op1->type)
3764 op1->type->refCount++;
3765 }
3766 return 1;
3767 }
3768
3769 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3770 {
3771 short value2 = op2->__anon1.s;
3772
3773 exp->type = 2;
3774 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
3775 if(!exp->expType)
3776 {
3777 exp->expType = op1->type;
3778 if(op1->type)
3779 op1->type->refCount++;
3780 }
3781 return 1;
3782 }
3783
3784 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3785 {
3786 unsigned short value2 = op2->__anon1.us;
3787
3788 exp->type = 2;
3789 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
3790 if(!exp->expType)
3791 {
3792 exp->expType = op1->type;
3793 if(op1->type)
3794 op1->type->refCount++;
3795 }
3796 return 1;
3797 }
3798
3799 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3800 {
3801 char value2 = op2->__anon1.c;
3802
3803 exp->type = 2;
3804 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
3805 if(!exp->expType)
3806 {
3807 exp->expType = op1->type;
3808 if(op1->type)
3809 op1->type->refCount++;
3810 }
3811 return 1;
3812 }
3813
3814 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3815 {
3816 unsigned char value2 = op2->__anon1.uc;
3817
3818 exp->type = 2;
3819 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
3820 if(!exp->expType)
3821 {
3822 exp->expType = op1->type;
3823 if(op1->type)
3824 op1->type->refCount++;
3825 }
3826 return 1;
3827 }
3828
3829 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3830 {
3831 float value2 = op2->__anon1.f;
3832
3833 exp->type = 2;
3834 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
3835 if(!exp->expType)
3836 {
3837 exp->expType = op1->type;
3838 if(op1->type)
3839 op1->type->refCount++;
3840 }
3841 return 1;
3842 }
3843
3844 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3845 {
3846 double value2 = op2->__anon1.d;
3847
3848 exp->type = 2;
3849 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
3850 if(!exp->expType)
3851 {
3852 exp->expType = op1->type;
3853 if(op1->type)
3854 op1->type->refCount++;
3855 }
3856 return 1;
3857 }
3858
3859 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3860 {
3861 int value2 = op2->__anon1.i;
3862
3863 exp->type = 2;
3864 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
3865 if(!exp->expType)
3866 {
3867 exp->expType = op1->type;
3868 if(op1->type)
3869 op1->type->refCount++;
3870 }
3871 return 1;
3872 }
3873
3874 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3875 {
3876 unsigned int value2 = op2->__anon1.ui;
3877
3878 exp->type = 2;
3879 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
3880 if(!exp->expType)
3881 {
3882 exp->expType = op1->type;
3883 if(op1->type)
3884 op1->type->refCount++;
3885 }
3886 return 1;
3887 }
3888
3889 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3890 {
3891 long long value2 = op2->__anon1.i64;
3892
3893 exp->type = 2;
3894 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
3895 if(!exp->expType)
3896 {
3897 exp->expType = op1->type;
3898 if(op1->type)
3899 op1->type->refCount++;
3900 }
3901 return 1;
3902 }
3903
3904 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3905 {
3906 uint64 value2 = op2->__anon1.ui64;
3907
3908 exp->type = 2;
3909 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
3910 if(!exp->expType)
3911 {
3912 exp->expType = op1->type;
3913 if(op1->type)
3914 op1->type->refCount++;
3915 }
3916 return 1;
3917 }
3918
3919 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3920 {
3921 short value2 = op2->__anon1.s;
3922
3923 exp->type = 2;
3924 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
3925 if(!exp->expType)
3926 {
3927 exp->expType = op1->type;
3928 if(op1->type)
3929 op1->type->refCount++;
3930 }
3931 return 1;
3932 }
3933
3934 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3935 {
3936 unsigned short value2 = op2->__anon1.us;
3937
3938 exp->type = 2;
3939 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
3940 if(!exp->expType)
3941 {
3942 exp->expType = op1->type;
3943 if(op1->type)
3944 op1->type->refCount++;
3945 }
3946 return 1;
3947 }
3948
3949 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3950 {
3951 char value2 = op2->__anon1.c;
3952
3953 exp->type = 2;
3954 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
3955 if(!exp->expType)
3956 {
3957 exp->expType = op1->type;
3958 if(op1->type)
3959 op1->type->refCount++;
3960 }
3961 return 1;
3962 }
3963
3964 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3965 {
3966 unsigned char value2 = op2->__anon1.uc;
3967
3968 exp->type = 2;
3969 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
3970 if(!exp->expType)
3971 {
3972 exp->expType = op1->type;
3973 if(op1->type)
3974 op1->type->refCount++;
3975 }
3976 return 1;
3977 }
3978
3979 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3980 {
3981 float value2 = op2->__anon1.f;
3982
3983 exp->type = 2;
3984 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
3985 if(!exp->expType)
3986 {
3987 exp->expType = op1->type;
3988 if(op1->type)
3989 op1->type->refCount++;
3990 }
3991 return 1;
3992 }
3993
3994 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3995 {
3996 double value2 = op2->__anon1.d;
3997
3998 exp->type = 2;
3999 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
4000 if(!exp->expType)
4001 {
4002 exp->expType = op1->type;
4003 if(op1->type)
4004 op1->type->refCount++;
4005 }
4006 return 1;
4007 }
4008
4009 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4010 {
4011 int value2 = op2->__anon1.i;
4012
4013 exp->type = 2;
4014 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
4015 if(!exp->expType)
4016 {
4017 exp->expType = op1->type;
4018 if(op1->type)
4019 op1->type->refCount++;
4020 }
4021 return 1;
4022 }
4023
4024 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4025 {
4026 unsigned int value2 = op2->__anon1.ui;
4027
4028 exp->type = 2;
4029 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
4030 if(!exp->expType)
4031 {
4032 exp->expType = op1->type;
4033 if(op1->type)
4034 op1->type->refCount++;
4035 }
4036 return 1;
4037 }
4038
4039 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4040 {
4041 long long value2 = op2->__anon1.i64;
4042
4043 exp->type = 2;
4044 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
4045 if(!exp->expType)
4046 {
4047 exp->expType = op1->type;
4048 if(op1->type)
4049 op1->type->refCount++;
4050 }
4051 return 1;
4052 }
4053
4054 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4055 {
4056 uint64 value2 = op2->__anon1.ui64;
4057
4058 exp->type = 2;
4059 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
4060 if(!exp->expType)
4061 {
4062 exp->expType = op1->type;
4063 if(op1->type)
4064 op1->type->refCount++;
4065 }
4066 return 1;
4067 }
4068
4069 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4070 {
4071 short value2 = op2->__anon1.s;
4072
4073 exp->type = 2;
4074 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
4075 if(!exp->expType)
4076 {
4077 exp->expType = op1->type;
4078 if(op1->type)
4079 op1->type->refCount++;
4080 }
4081 return 1;
4082 }
4083
4084 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4085 {
4086 unsigned short value2 = op2->__anon1.us;
4087
4088 exp->type = 2;
4089 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
4090 if(!exp->expType)
4091 {
4092 exp->expType = op1->type;
4093 if(op1->type)
4094 op1->type->refCount++;
4095 }
4096 return 1;
4097 }
4098
4099 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4100 {
4101 char value2 = op2->__anon1.c;
4102
4103 exp->type = 2;
4104 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
4105 if(!exp->expType)
4106 {
4107 exp->expType = op1->type;
4108 if(op1->type)
4109 op1->type->refCount++;
4110 }
4111 return 1;
4112 }
4113
4114 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4115 {
4116 unsigned char value2 = op2->__anon1.uc;
4117
4118 exp->type = 2;
4119 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
4120 if(!exp->expType)
4121 {
4122 exp->expType = op1->type;
4123 if(op1->type)
4124 op1->type->refCount++;
4125 }
4126 return 1;
4127 }
4128
4129 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4130 {
4131 float value2 = op2->__anon1.f;
4132
4133 exp->type = 2;
4134 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
4135 if(!exp->expType)
4136 {
4137 exp->expType = op1->type;
4138 if(op1->type)
4139 op1->type->refCount++;
4140 }
4141 return 1;
4142 }
4143
4144 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4145 {
4146 double value2 = op2->__anon1.d;
4147
4148 exp->type = 2;
4149 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
4150 if(!exp->expType)
4151 {
4152 exp->expType = op1->type;
4153 if(op1->type)
4154 op1->type->refCount++;
4155 }
4156 return 1;
4157 }
4158
4159 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4160 {
4161 int value2 = op2->__anon1.i;
4162
4163 exp->type = 2;
4164 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
4165 if(!exp->expType)
4166 {
4167 exp->expType = op1->type;
4168 if(op1->type)
4169 op1->type->refCount++;
4170 }
4171 return 1;
4172 }
4173
4174 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4175 {
4176 unsigned int value2 = op2->__anon1.ui;
4177
4178 exp->type = 2;
4179 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
4180 if(!exp->expType)
4181 {
4182 exp->expType = op1->type;
4183 if(op1->type)
4184 op1->type->refCount++;
4185 }
4186 return 1;
4187 }
4188
4189 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4190 {
4191 long long value2 = op2->__anon1.i64;
4192
4193 exp->type = 2;
4194 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
4195 if(!exp->expType)
4196 {
4197 exp->expType = op1->type;
4198 if(op1->type)
4199 op1->type->refCount++;
4200 }
4201 return 1;
4202 }
4203
4204 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4205 {
4206 uint64 value2 = op2->__anon1.ui64;
4207
4208 exp->type = 2;
4209 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
4210 if(!exp->expType)
4211 {
4212 exp->expType = op1->type;
4213 if(op1->type)
4214 op1->type->refCount++;
4215 }
4216 return 1;
4217 }
4218
4219 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4220 {
4221 short value2 = op2->__anon1.s;
4222
4223 exp->type = 2;
4224 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
4225 if(!exp->expType)
4226 {
4227 exp->expType = op1->type;
4228 if(op1->type)
4229 op1->type->refCount++;
4230 }
4231 return 1;
4232 }
4233
4234 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4235 {
4236 unsigned short value2 = op2->__anon1.us;
4237
4238 exp->type = 2;
4239 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
4240 if(!exp->expType)
4241 {
4242 exp->expType = op1->type;
4243 if(op1->type)
4244 op1->type->refCount++;
4245 }
4246 return 1;
4247 }
4248
4249 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4250 {
4251 char value2 = op2->__anon1.c;
4252
4253 exp->type = 2;
4254 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
4255 if(!exp->expType)
4256 {
4257 exp->expType = op1->type;
4258 if(op1->type)
4259 op1->type->refCount++;
4260 }
4261 return 1;
4262 }
4263
4264 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4265 {
4266 unsigned char value2 = op2->__anon1.uc;
4267
4268 exp->type = 2;
4269 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
4270 if(!exp->expType)
4271 {
4272 exp->expType = op1->type;
4273 if(op1->type)
4274 op1->type->refCount++;
4275 }
4276 return 1;
4277 }
4278
4279 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4280 {
4281 float value2 = op2->__anon1.f;
4282
4283 exp->type = 2;
4284 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
4285 if(!exp->expType)
4286 {
4287 exp->expType = op1->type;
4288 if(op1->type)
4289 op1->type->refCount++;
4290 }
4291 return 1;
4292 }
4293
4294 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4295 {
4296 double value2 = op2->__anon1.d;
4297
4298 exp->type = 2;
4299 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
4300 if(!exp->expType)
4301 {
4302 exp->expType = op1->type;
4303 if(op1->type)
4304 op1->type->refCount++;
4305 }
4306 return 1;
4307 }
4308
4309 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4310 {
4311 int value2 = op2->__anon1.i;
4312
4313 exp->type = 2;
4314 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
4315 if(!exp->expType)
4316 {
4317 exp->expType = op1->type;
4318 if(op1->type)
4319 op1->type->refCount++;
4320 }
4321 return 1;
4322 }
4323
4324 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4325 {
4326 unsigned int value2 = op2->__anon1.ui;
4327
4328 exp->type = 2;
4329 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
4330 if(!exp->expType)
4331 {
4332 exp->expType = op1->type;
4333 if(op1->type)
4334 op1->type->refCount++;
4335 }
4336 return 1;
4337 }
4338
4339 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4340 {
4341 long long value2 = op2->__anon1.i64;
4342
4343 exp->type = 2;
4344 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
4345 if(!exp->expType)
4346 {
4347 exp->expType = op1->type;
4348 if(op1->type)
4349 op1->type->refCount++;
4350 }
4351 return 1;
4352 }
4353
4354 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4355 {
4356 uint64 value2 = op2->__anon1.ui64;
4357
4358 exp->type = 2;
4359 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
4360 if(!exp->expType)
4361 {
4362 exp->expType = op1->type;
4363 if(op1->type)
4364 op1->type->refCount++;
4365 }
4366 return 1;
4367 }
4368
4369 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4370 {
4371 short value2 = op2->__anon1.s;
4372
4373 exp->type = 2;
4374 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
4375 if(!exp->expType)
4376 {
4377 exp->expType = op1->type;
4378 if(op1->type)
4379 op1->type->refCount++;
4380 }
4381 return 1;
4382 }
4383
4384 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4385 {
4386 unsigned short value2 = op2->__anon1.us;
4387
4388 exp->type = 2;
4389 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
4390 if(!exp->expType)
4391 {
4392 exp->expType = op1->type;
4393 if(op1->type)
4394 op1->type->refCount++;
4395 }
4396 return 1;
4397 }
4398
4399 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4400 {
4401 char value2 = op2->__anon1.c;
4402
4403 exp->type = 2;
4404 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
4405 if(!exp->expType)
4406 {
4407 exp->expType = op1->type;
4408 if(op1->type)
4409 op1->type->refCount++;
4410 }
4411 return 1;
4412 }
4413
4414 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4415 {
4416 unsigned char value2 = op2->__anon1.uc;
4417
4418 exp->type = 2;
4419 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
4420 if(!exp->expType)
4421 {
4422 exp->expType = op1->type;
4423 if(op1->type)
4424 op1->type->refCount++;
4425 }
4426 return 1;
4427 }
4428
4429 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4430 {
4431 int value2 = op2->__anon1.i;
4432
4433 exp->type = 2;
4434 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
4435 if(!exp->expType)
4436 {
4437 exp->expType = op1->type;
4438 if(op1->type)
4439 op1->type->refCount++;
4440 }
4441 return 1;
4442 }
4443
4444 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4445 {
4446 unsigned int value2 = op2->__anon1.ui;
4447
4448 exp->type = 2;
4449 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
4450 if(!exp->expType)
4451 {
4452 exp->expType = op1->type;
4453 if(op1->type)
4454 op1->type->refCount++;
4455 }
4456 return 1;
4457 }
4458
4459 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4460 {
4461 long long value2 = op2->__anon1.i64;
4462
4463 exp->type = 2;
4464 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
4465 if(!exp->expType)
4466 {
4467 exp->expType = op1->type;
4468 if(op1->type)
4469 op1->type->refCount++;
4470 }
4471 return 1;
4472 }
4473
4474 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4475 {
4476 uint64 value2 = op2->__anon1.ui64;
4477
4478 exp->type = 2;
4479 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
4480 if(!exp->expType)
4481 {
4482 exp->expType = op1->type;
4483 if(op1->type)
4484 op1->type->refCount++;
4485 }
4486 return 1;
4487 }
4488
4489 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4490 {
4491 short value2 = op2->__anon1.s;
4492
4493 exp->type = 2;
4494 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
4495 if(!exp->expType)
4496 {
4497 exp->expType = op1->type;
4498 if(op1->type)
4499 op1->type->refCount++;
4500 }
4501 return 1;
4502 }
4503
4504 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4505 {
4506 unsigned short value2 = op2->__anon1.us;
4507
4508 exp->type = 2;
4509 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
4510 if(!exp->expType)
4511 {
4512 exp->expType = op1->type;
4513 if(op1->type)
4514 op1->type->refCount++;
4515 }
4516 return 1;
4517 }
4518
4519 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4520 {
4521 char value2 = op2->__anon1.c;
4522
4523 exp->type = 2;
4524 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
4525 if(!exp->expType)
4526 {
4527 exp->expType = op1->type;
4528 if(op1->type)
4529 op1->type->refCount++;
4530 }
4531 return 1;
4532 }
4533
4534 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4535 {
4536 unsigned char value2 = op2->__anon1.uc;
4537
4538 exp->type = 2;
4539 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
4540 if(!exp->expType)
4541 {
4542 exp->expType = op1->type;
4543 if(op1->type)
4544 op1->type->refCount++;
4545 }
4546 return 1;
4547 }
4548
4549 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4550 {
4551 int value2 = op2->__anon1.i;
4552
4553 exp->type = 2;
4554 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
4555 if(!exp->expType)
4556 {
4557 exp->expType = op1->type;
4558 if(op1->type)
4559 op1->type->refCount++;
4560 }
4561 return 1;
4562 }
4563
4564 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4565 {
4566 unsigned int value2 = op2->__anon1.ui;
4567
4568 exp->type = 2;
4569 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
4570 if(!exp->expType)
4571 {
4572 exp->expType = op1->type;
4573 if(op1->type)
4574 op1->type->refCount++;
4575 }
4576 return 1;
4577 }
4578
4579 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4580 {
4581 long long value2 = op2->__anon1.i64;
4582
4583 exp->type = 2;
4584 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
4585 if(!exp->expType)
4586 {
4587 exp->expType = op1->type;
4588 if(op1->type)
4589 op1->type->refCount++;
4590 }
4591 return 1;
4592 }
4593
4594 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4595 {
4596 uint64 value2 = op2->__anon1.ui64;
4597
4598 exp->type = 2;
4599 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
4600 if(!exp->expType)
4601 {
4602 exp->expType = op1->type;
4603 if(op1->type)
4604 op1->type->refCount++;
4605 }
4606 return 1;
4607 }
4608
4609 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4610 {
4611 short value2 = op2->__anon1.s;
4612
4613 exp->type = 2;
4614 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
4615 if(!exp->expType)
4616 {
4617 exp->expType = op1->type;
4618 if(op1->type)
4619 op1->type->refCount++;
4620 }
4621 return 1;
4622 }
4623
4624 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4625 {
4626 unsigned short value2 = op2->__anon1.us;
4627
4628 exp->type = 2;
4629 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
4630 if(!exp->expType)
4631 {
4632 exp->expType = op1->type;
4633 if(op1->type)
4634 op1->type->refCount++;
4635 }
4636 return 1;
4637 }
4638
4639 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4640 {
4641 char value2 = op2->__anon1.c;
4642
4643 exp->type = 2;
4644 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
4645 if(!exp->expType)
4646 {
4647 exp->expType = op1->type;
4648 if(op1->type)
4649 op1->type->refCount++;
4650 }
4651 return 1;
4652 }
4653
4654 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4655 {
4656 unsigned char value2 = op2->__anon1.uc;
4657
4658 exp->type = 2;
4659 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
4660 if(!exp->expType)
4661 {
4662 exp->expType = op1->type;
4663 if(op1->type)
4664 op1->type->refCount++;
4665 }
4666 return 1;
4667 }
4668
4669 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4670 {
4671 int value2 = op2->__anon1.i;
4672
4673 exp->type = 2;
4674 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
4675 if(!exp->expType)
4676 {
4677 exp->expType = op1->type;
4678 if(op1->type)
4679 op1->type->refCount++;
4680 }
4681 return 1;
4682 }
4683
4684 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4685 {
4686 unsigned int value2 = op2->__anon1.ui;
4687
4688 exp->type = 2;
4689 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
4690 if(!exp->expType)
4691 {
4692 exp->expType = op1->type;
4693 if(op1->type)
4694 op1->type->refCount++;
4695 }
4696 return 1;
4697 }
4698
4699 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4700 {
4701 long long value2 = op2->__anon1.i64;
4702
4703 exp->type = 2;
4704 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
4705 if(!exp->expType)
4706 {
4707 exp->expType = op1->type;
4708 if(op1->type)
4709 op1->type->refCount++;
4710 }
4711 return 1;
4712 }
4713
4714 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4715 {
4716 uint64 value2 = op2->__anon1.ui64;
4717
4718 exp->type = 2;
4719 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
4720 if(!exp->expType)
4721 {
4722 exp->expType = op1->type;
4723 if(op1->type)
4724 op1->type->refCount++;
4725 }
4726 return 1;
4727 }
4728
4729 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4730 {
4731 short value2 = op2->__anon1.s;
4732
4733 exp->type = 2;
4734 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
4735 if(!exp->expType)
4736 {
4737 exp->expType = op1->type;
4738 if(op1->type)
4739 op1->type->refCount++;
4740 }
4741 return 1;
4742 }
4743
4744 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4745 {
4746 unsigned short value2 = op2->__anon1.us;
4747
4748 exp->type = 2;
4749 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
4750 if(!exp->expType)
4751 {
4752 exp->expType = op1->type;
4753 if(op1->type)
4754 op1->type->refCount++;
4755 }
4756 return 1;
4757 }
4758
4759 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4760 {
4761 char value2 = op2->__anon1.c;
4762
4763 exp->type = 2;
4764 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
4765 if(!exp->expType)
4766 {
4767 exp->expType = op1->type;
4768 if(op1->type)
4769 op1->type->refCount++;
4770 }
4771 return 1;
4772 }
4773
4774 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4775 {
4776 unsigned char value2 = op2->__anon1.uc;
4777
4778 exp->type = 2;
4779 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
4780 if(!exp->expType)
4781 {
4782 exp->expType = op1->type;
4783 if(op1->type)
4784 op1->type->refCount++;
4785 }
4786 return 1;
4787 }
4788
4789 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4790 {
4791 int value2 = op2->__anon1.i;
4792
4793 exp->type = 2;
4794 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
4795 if(!exp->expType)
4796 {
4797 exp->expType = op1->type;
4798 if(op1->type)
4799 op1->type->refCount++;
4800 }
4801 return 1;
4802 }
4803
4804 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4805 {
4806 unsigned int value2 = op2->__anon1.ui;
4807
4808 exp->type = 2;
4809 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
4810 if(!exp->expType)
4811 {
4812 exp->expType = op1->type;
4813 if(op1->type)
4814 op1->type->refCount++;
4815 }
4816 return 1;
4817 }
4818
4819 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4820 {
4821 long long value2 = op2->__anon1.i64;
4822
4823 exp->type = 2;
4824 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
4825 if(!exp->expType)
4826 {
4827 exp->expType = op1->type;
4828 if(op1->type)
4829 op1->type->refCount++;
4830 }
4831 return 1;
4832 }
4833
4834 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4835 {
4836 uint64 value2 = op2->__anon1.ui64;
4837
4838 exp->type = 2;
4839 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
4840 if(!exp->expType)
4841 {
4842 exp->expType = op1->type;
4843 if(op1->type)
4844 op1->type->refCount++;
4845 }
4846 return 1;
4847 }
4848
4849 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4850 {
4851 short value2 = op2->__anon1.s;
4852
4853 exp->type = 2;
4854 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
4855 if(!exp->expType)
4856 {
4857 exp->expType = op1->type;
4858 if(op1->type)
4859 op1->type->refCount++;
4860 }
4861 return 1;
4862 }
4863
4864 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4865 {
4866 unsigned short value2 = op2->__anon1.us;
4867
4868 exp->type = 2;
4869 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
4870 if(!exp->expType)
4871 {
4872 exp->expType = op1->type;
4873 if(op1->type)
4874 op1->type->refCount++;
4875 }
4876 return 1;
4877 }
4878
4879 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4880 {
4881 char value2 = op2->__anon1.c;
4882
4883 exp->type = 2;
4884 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
4885 if(!exp->expType)
4886 {
4887 exp->expType = op1->type;
4888 if(op1->type)
4889 op1->type->refCount++;
4890 }
4891 return 1;
4892 }
4893
4894 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4895 {
4896 unsigned char value2 = op2->__anon1.uc;
4897
4898 exp->type = 2;
4899 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
4900 if(!exp->expType)
4901 {
4902 exp->expType = op1->type;
4903 if(op1->type)
4904 op1->type->refCount++;
4905 }
4906 return 1;
4907 }
4908
4909 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4910 {
4911 int value2 = op2->__anon1.i;
4912
4913 exp->type = 2;
4914 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
4915 if(!exp->expType)
4916 {
4917 exp->expType = op1->type;
4918 if(op1->type)
4919 op1->type->refCount++;
4920 }
4921 return 1;
4922 }
4923
4924 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4925 {
4926 unsigned int value2 = op2->__anon1.ui;
4927
4928 exp->type = 2;
4929 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
4930 if(!exp->expType)
4931 {
4932 exp->expType = op1->type;
4933 if(op1->type)
4934 op1->type->refCount++;
4935 }
4936 return 1;
4937 }
4938
4939 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4940 {
4941 long long value2 = op2->__anon1.i64;
4942
4943 exp->type = 2;
4944 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
4945 if(!exp->expType)
4946 {
4947 exp->expType = op1->type;
4948 if(op1->type)
4949 op1->type->refCount++;
4950 }
4951 return 1;
4952 }
4953
4954 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4955 {
4956 uint64 value2 = op2->__anon1.ui64;
4957
4958 exp->type = 2;
4959 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
4960 if(!exp->expType)
4961 {
4962 exp->expType = op1->type;
4963 if(op1->type)
4964 op1->type->refCount++;
4965 }
4966 return 1;
4967 }
4968
4969 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4970 {
4971 short value2 = op2->__anon1.s;
4972
4973 exp->type = 2;
4974 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
4975 if(!exp->expType)
4976 {
4977 exp->expType = op1->type;
4978 if(op1->type)
4979 op1->type->refCount++;
4980 }
4981 return 1;
4982 }
4983
4984 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4985 {
4986 unsigned short value2 = op2->__anon1.us;
4987
4988 exp->type = 2;
4989 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
4990 if(!exp->expType)
4991 {
4992 exp->expType = op1->type;
4993 if(op1->type)
4994 op1->type->refCount++;
4995 }
4996 return 1;
4997 }
4998
4999 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5000 {
5001 char value2 = op2->__anon1.c;
5002
5003 exp->type = 2;
5004 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
5005 if(!exp->expType)
5006 {
5007 exp->expType = op1->type;
5008 if(op1->type)
5009 op1->type->refCount++;
5010 }
5011 return 1;
5012 }
5013
5014 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5015 {
5016 unsigned char value2 = op2->__anon1.uc;
5017
5018 exp->type = 2;
5019 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
5020 if(!exp->expType)
5021 {
5022 exp->expType = op1->type;
5023 if(op1->type)
5024 op1->type->refCount++;
5025 }
5026 return 1;
5027 }
5028
5029 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
5030 {
5031 exp->type = 2;
5032 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
5033 if(!exp->expType)
5034 {
5035 exp->expType = op1->type;
5036 if(op1->type)
5037 op1->type->refCount++;
5038 }
5039 return 1;
5040 }
5041
5042 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
5043 {
5044 exp->type = 2;
5045 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
5046 if(!exp->expType)
5047 {
5048 exp->expType = op1->type;
5049 if(op1->type)
5050 op1->type->refCount++;
5051 }
5052 return 1;
5053 }
5054
5055 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
5056 {
5057 exp->type = 2;
5058 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
5059 if(!exp->expType)
5060 {
5061 exp->expType = op1->type;
5062 if(op1->type)
5063 op1->type->refCount++;
5064 }
5065 return 1;
5066 }
5067
5068 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
5069 {
5070 exp->type = 2;
5071 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
5072 if(!exp->expType)
5073 {
5074 exp->expType = op1->type;
5075 if(op1->type)
5076 op1->type->refCount++;
5077 }
5078 return 1;
5079 }
5080
5081 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
5082 {
5083 exp->type = 2;
5084 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
5085 if(!exp->expType)
5086 {
5087 exp->expType = op1->type;
5088 if(op1->type)
5089 op1->type->refCount++;
5090 }
5091 return 1;
5092 }
5093
5094 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
5095 {
5096 exp->type = 2;
5097 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
5098 if(!exp->expType)
5099 {
5100 exp->expType = op1->type;
5101 if(op1->type)
5102 op1->type->refCount++;
5103 }
5104 return 1;
5105 }
5106
5107 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
5108 {
5109 exp->type = 2;
5110 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
5111 if(!exp->expType)
5112 {
5113 exp->expType = op1->type;
5114 if(op1->type)
5115 op1->type->refCount++;
5116 }
5117 return 1;
5118 }
5119
5120 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
5121 {
5122 exp->type = 2;
5123 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
5124 if(!exp->expType)
5125 {
5126 exp->expType = op1->type;
5127 if(op1->type)
5128 op1->type->refCount++;
5129 }
5130 return 1;
5131 }
5132
5133 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5134 {
5135 int value2 = op2->__anon1.i;
5136
5137 exp->type = 2;
5138 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
5139 if(!exp->expType)
5140 {
5141 exp->expType = op1->type;
5142 if(op1->type)
5143 op1->type->refCount++;
5144 }
5145 return 1;
5146 }
5147
5148 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5149 {
5150 unsigned int value2 = op2->__anon1.ui;
5151
5152 exp->type = 2;
5153 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
5154 if(!exp->expType)
5155 {
5156 exp->expType = op1->type;
5157 if(op1->type)
5158 op1->type->refCount++;
5159 }
5160 return 1;
5161 }
5162
5163 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5164 {
5165 long long value2 = op2->__anon1.i64;
5166
5167 exp->type = 2;
5168 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
5169 if(!exp->expType)
5170 {
5171 exp->expType = op1->type;
5172 if(op1->type)
5173 op1->type->refCount++;
5174 }
5175 return 1;
5176 }
5177
5178 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5179 {
5180 uint64 value2 = op2->__anon1.ui64;
5181
5182 exp->type = 2;
5183 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
5184 if(!exp->expType)
5185 {
5186 exp->expType = op1->type;
5187 if(op1->type)
5188 op1->type->refCount++;
5189 }
5190 return 1;
5191 }
5192
5193 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5194 {
5195 short value2 = op2->__anon1.s;
5196
5197 exp->type = 2;
5198 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
5199 if(!exp->expType)
5200 {
5201 exp->expType = op1->type;
5202 if(op1->type)
5203 op1->type->refCount++;
5204 }
5205 return 1;
5206 }
5207
5208 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5209 {
5210 unsigned short value2 = op2->__anon1.us;
5211
5212 exp->type = 2;
5213 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
5214 if(!exp->expType)
5215 {
5216 exp->expType = op1->type;
5217 if(op1->type)
5218 op1->type->refCount++;
5219 }
5220 return 1;
5221 }
5222
5223 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5224 {
5225 char value2 = op2->__anon1.c;
5226
5227 exp->type = 2;
5228 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
5229 if(!exp->expType)
5230 {
5231 exp->expType = op1->type;
5232 if(op1->type)
5233 op1->type->refCount++;
5234 }
5235 return 1;
5236 }
5237
5238 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5239 {
5240 unsigned char value2 = op2->__anon1.uc;
5241
5242 exp->type = 2;
5243 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
5244 if(!exp->expType)
5245 {
5246 exp->expType = op1->type;
5247 if(op1->type)
5248 op1->type->refCount++;
5249 }
5250 return 1;
5251 }
5252
5253 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5254 {
5255 int value2 = op2->__anon1.i;
5256
5257 exp->type = 2;
5258 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
5259 if(!exp->expType)
5260 {
5261 exp->expType = op1->type;
5262 if(op1->type)
5263 op1->type->refCount++;
5264 }
5265 return 1;
5266 }
5267
5268 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5269 {
5270 unsigned int value2 = op2->__anon1.ui;
5271
5272 exp->type = 2;
5273 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
5274 if(!exp->expType)
5275 {
5276 exp->expType = op1->type;
5277 if(op1->type)
5278 op1->type->refCount++;
5279 }
5280 return 1;
5281 }
5282
5283 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5284 {
5285 long long value2 = op2->__anon1.i64;
5286
5287 exp->type = 2;
5288 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
5289 if(!exp->expType)
5290 {
5291 exp->expType = op1->type;
5292 if(op1->type)
5293 op1->type->refCount++;
5294 }
5295 return 1;
5296 }
5297
5298 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5299 {
5300 uint64 value2 = op2->__anon1.ui64;
5301
5302 exp->type = 2;
5303 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
5304 if(!exp->expType)
5305 {
5306 exp->expType = op1->type;
5307 if(op1->type)
5308 op1->type->refCount++;
5309 }
5310 return 1;
5311 }
5312
5313 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5314 {
5315 short value2 = op2->__anon1.s;
5316
5317 exp->type = 2;
5318 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
5319 if(!exp->expType)
5320 {
5321 exp->expType = op1->type;
5322 if(op1->type)
5323 op1->type->refCount++;
5324 }
5325 return 1;
5326 }
5327
5328 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5329 {
5330 unsigned short value2 = op2->__anon1.us;
5331
5332 exp->type = 2;
5333 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
5334 if(!exp->expType)
5335 {
5336 exp->expType = op1->type;
5337 if(op1->type)
5338 op1->type->refCount++;
5339 }
5340 return 1;
5341 }
5342
5343 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5344 {
5345 char value2 = op2->__anon1.c;
5346
5347 exp->type = 2;
5348 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
5349 if(!exp->expType)
5350 {
5351 exp->expType = op1->type;
5352 if(op1->type)
5353 op1->type->refCount++;
5354 }
5355 return 1;
5356 }
5357
5358 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5359 {
5360 unsigned char value2 = op2->__anon1.uc;
5361
5362 exp->type = 2;
5363 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
5364 if(!exp->expType)
5365 {
5366 exp->expType = op1->type;
5367 if(op1->type)
5368 op1->type->refCount++;
5369 }
5370 return 1;
5371 }
5372
5373 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5374 {
5375 int value2 = op2->__anon1.i;
5376
5377 exp->type = 2;
5378 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
5379 if(!exp->expType)
5380 {
5381 exp->expType = op1->type;
5382 if(op1->type)
5383 op1->type->refCount++;
5384 }
5385 return 1;
5386 }
5387
5388 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5389 {
5390 unsigned int value2 = op2->__anon1.ui;
5391
5392 exp->type = 2;
5393 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
5394 if(!exp->expType)
5395 {
5396 exp->expType = op1->type;
5397 if(op1->type)
5398 op1->type->refCount++;
5399 }
5400 return 1;
5401 }
5402
5403 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5404 {
5405 long long value2 = op2->__anon1.i64;
5406
5407 exp->type = 2;
5408 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
5409 if(!exp->expType)
5410 {
5411 exp->expType = op1->type;
5412 if(op1->type)
5413 op1->type->refCount++;
5414 }
5415 return 1;
5416 }
5417
5418 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5419 {
5420 uint64 value2 = op2->__anon1.ui64;
5421
5422 exp->type = 2;
5423 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
5424 if(!exp->expType)
5425 {
5426 exp->expType = op1->type;
5427 if(op1->type)
5428 op1->type->refCount++;
5429 }
5430 return 1;
5431 }
5432
5433 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5434 {
5435 short value2 = op2->__anon1.s;
5436
5437 exp->type = 2;
5438 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
5439 if(!exp->expType)
5440 {
5441 exp->expType = op1->type;
5442 if(op1->type)
5443 op1->type->refCount++;
5444 }
5445 return 1;
5446 }
5447
5448 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5449 {
5450 unsigned short value2 = op2->__anon1.us;
5451
5452 exp->type = 2;
5453 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
5454 if(!exp->expType)
5455 {
5456 exp->expType = op1->type;
5457 if(op1->type)
5458 op1->type->refCount++;
5459 }
5460 return 1;
5461 }
5462
5463 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5464 {
5465 char value2 = op2->__anon1.c;
5466
5467 exp->type = 2;
5468 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
5469 if(!exp->expType)
5470 {
5471 exp->expType = op1->type;
5472 if(op1->type)
5473 op1->type->refCount++;
5474 }
5475 return 1;
5476 }
5477
5478 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5479 {
5480 unsigned char value2 = op2->__anon1.uc;
5481
5482 exp->type = 2;
5483 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
5484 if(!exp->expType)
5485 {
5486 exp->expType = op1->type;
5487 if(op1->type)
5488 op1->type->refCount++;
5489 }
5490 return 1;
5491 }
5492
5493 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5494 {
5495 int value2 = op2->__anon1.i;
5496
5497 exp->type = 2;
5498 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
5499 if(!exp->expType)
5500 {
5501 exp->expType = op1->type;
5502 if(op1->type)
5503 op1->type->refCount++;
5504 }
5505 return 1;
5506 }
5507
5508 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5509 {
5510 unsigned int value2 = op2->__anon1.ui;
5511
5512 exp->type = 2;
5513 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
5514 if(!exp->expType)
5515 {
5516 exp->expType = op1->type;
5517 if(op1->type)
5518 op1->type->refCount++;
5519 }
5520 return 1;
5521 }
5522
5523 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5524 {
5525 long long value2 = op2->__anon1.i64;
5526
5527 exp->type = 2;
5528 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
5529 if(!exp->expType)
5530 {
5531 exp->expType = op1->type;
5532 if(op1->type)
5533 op1->type->refCount++;
5534 }
5535 return 1;
5536 }
5537
5538 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5539 {
5540 uint64 value2 = op2->__anon1.ui64;
5541
5542 exp->type = 2;
5543 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
5544 if(!exp->expType)
5545 {
5546 exp->expType = op1->type;
5547 if(op1->type)
5548 op1->type->refCount++;
5549 }
5550 return 1;
5551 }
5552
5553 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5554 {
5555 short value2 = op2->__anon1.s;
5556
5557 exp->type = 2;
5558 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
5559 if(!exp->expType)
5560 {
5561 exp->expType = op1->type;
5562 if(op1->type)
5563 op1->type->refCount++;
5564 }
5565 return 1;
5566 }
5567
5568 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5569 {
5570 unsigned short value2 = op2->__anon1.us;
5571
5572 exp->type = 2;
5573 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
5574 if(!exp->expType)
5575 {
5576 exp->expType = op1->type;
5577 if(op1->type)
5578 op1->type->refCount++;
5579 }
5580 return 1;
5581 }
5582
5583 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5584 {
5585 char value2 = op2->__anon1.c;
5586
5587 exp->type = 2;
5588 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
5589 if(!exp->expType)
5590 {
5591 exp->expType = op1->type;
5592 if(op1->type)
5593 op1->type->refCount++;
5594 }
5595 return 1;
5596 }
5597
5598 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5599 {
5600 unsigned char value2 = op2->__anon1.uc;
5601
5602 exp->type = 2;
5603 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
5604 if(!exp->expType)
5605 {
5606 exp->expType = op1->type;
5607 if(op1->type)
5608 op1->type->refCount++;
5609 }
5610 return 1;
5611 }
5612
5613 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5614 {
5615 int value2 = op2->__anon1.i;
5616
5617 exp->type = 2;
5618 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
5619 if(!exp->expType)
5620 {
5621 exp->expType = op1->type;
5622 if(op1->type)
5623 op1->type->refCount++;
5624 }
5625 return 1;
5626 }
5627
5628 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5629 {
5630 unsigned int value2 = op2->__anon1.ui;
5631
5632 exp->type = 2;
5633 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
5634 if(!exp->expType)
5635 {
5636 exp->expType = op1->type;
5637 if(op1->type)
5638 op1->type->refCount++;
5639 }
5640 return 1;
5641 }
5642
5643 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5644 {
5645 long long value2 = op2->__anon1.i64;
5646
5647 exp->type = 2;
5648 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
5649 if(!exp->expType)
5650 {
5651 exp->expType = op1->type;
5652 if(op1->type)
5653 op1->type->refCount++;
5654 }
5655 return 1;
5656 }
5657
5658 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5659 {
5660 uint64 value2 = op2->__anon1.ui64;
5661
5662 exp->type = 2;
5663 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
5664 if(!exp->expType)
5665 {
5666 exp->expType = op1->type;
5667 if(op1->type)
5668 op1->type->refCount++;
5669 }
5670 return 1;
5671 }
5672
5673 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5674 {
5675 short value2 = op2->__anon1.s;
5676
5677 exp->type = 2;
5678 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
5679 if(!exp->expType)
5680 {
5681 exp->expType = op1->type;
5682 if(op1->type)
5683 op1->type->refCount++;
5684 }
5685 return 1;
5686 }
5687
5688 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5689 {
5690 unsigned short value2 = op2->__anon1.us;
5691
5692 exp->type = 2;
5693 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
5694 if(!exp->expType)
5695 {
5696 exp->expType = op1->type;
5697 if(op1->type)
5698 op1->type->refCount++;
5699 }
5700 return 1;
5701 }
5702
5703 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5704 {
5705 char value2 = op2->__anon1.c;
5706
5707 exp->type = 2;
5708 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
5709 if(!exp->expType)
5710 {
5711 exp->expType = op1->type;
5712 if(op1->type)
5713 op1->type->refCount++;
5714 }
5715 return 1;
5716 }
5717
5718 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5719 {
5720 unsigned char value2 = op2->__anon1.uc;
5721
5722 exp->type = 2;
5723 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
5724 if(!exp->expType)
5725 {
5726 exp->expType = op1->type;
5727 if(op1->type)
5728 op1->type->refCount++;
5729 }
5730 return 1;
5731 }
5732
5733 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
5734 {
5735 exp->type = 2;
5736 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
5737 if(!exp->expType)
5738 {
5739 exp->expType = op1->type;
5740 if(op1->type)
5741 op1->type->refCount++;
5742 }
5743 return 1;
5744 }
5745
5746 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
5747 {
5748 exp->type = 2;
5749 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
5750 if(!exp->expType)
5751 {
5752 exp->expType = op1->type;
5753 if(op1->type)
5754 op1->type->refCount++;
5755 }
5756 return 1;
5757 }
5758
5759 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
5760 {
5761 exp->type = 2;
5762 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
5763 if(!exp->expType)
5764 {
5765 exp->expType = op1->type;
5766 if(op1->type)
5767 op1->type->refCount++;
5768 }
5769 return 1;
5770 }
5771
5772 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
5773 {
5774 exp->type = 2;
5775 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
5776 if(!exp->expType)
5777 {
5778 exp->expType = op1->type;
5779 if(op1->type)
5780 op1->type->refCount++;
5781 }
5782 return 1;
5783 }
5784
5785 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
5786 {
5787 exp->type = 2;
5788 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
5789 if(!exp->expType)
5790 {
5791 exp->expType = op1->type;
5792 if(op1->type)
5793 op1->type->refCount++;
5794 }
5795 return 1;
5796 }
5797
5798 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
5799 {
5800 exp->type = 2;
5801 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
5802 if(!exp->expType)
5803 {
5804 exp->expType = op1->type;
5805 if(op1->type)
5806 op1->type->refCount++;
5807 }
5808 return 1;
5809 }
5810
5811 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
5812 {
5813 exp->type = 2;
5814 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
5815 if(!exp->expType)
5816 {
5817 exp->expType = op1->type;
5818 if(op1->type)
5819 op1->type->refCount++;
5820 }
5821 return 1;
5822 }
5823
5824 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
5825 {
5826 exp->type = 2;
5827 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
5828 if(!exp->expType)
5829 {
5830 exp->expType = op1->type;
5831 if(op1->type)
5832 op1->type->refCount++;
5833 }
5834 return 1;
5835 }
5836
5837 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5838 {
5839 int value2 = op2->__anon1.i;
5840
5841 exp->type = 2;
5842 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
5843 if(!exp->expType)
5844 {
5845 exp->expType = op1->type;
5846 if(op1->type)
5847 op1->type->refCount++;
5848 }
5849 return 1;
5850 }
5851
5852 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5853 {
5854 unsigned int value2 = op2->__anon1.ui;
5855
5856 exp->type = 2;
5857 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
5858 if(!exp->expType)
5859 {
5860 exp->expType = op1->type;
5861 if(op1->type)
5862 op1->type->refCount++;
5863 }
5864 return 1;
5865 }
5866
5867 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5868 {
5869 long long value2 = op2->__anon1.i64;
5870
5871 exp->type = 2;
5872 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
5873 if(!exp->expType)
5874 {
5875 exp->expType = op1->type;
5876 if(op1->type)
5877 op1->type->refCount++;
5878 }
5879 return 1;
5880 }
5881
5882 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5883 {
5884 uint64 value2 = op2->__anon1.ui64;
5885
5886 exp->type = 2;
5887 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
5888 if(!exp->expType)
5889 {
5890 exp->expType = op1->type;
5891 if(op1->type)
5892 op1->type->refCount++;
5893 }
5894 return 1;
5895 }
5896
5897 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5898 {
5899 short value2 = op2->__anon1.s;
5900
5901 exp->type = 2;
5902 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
5903 if(!exp->expType)
5904 {
5905 exp->expType = op1->type;
5906 if(op1->type)
5907 op1->type->refCount++;
5908 }
5909 return 1;
5910 }
5911
5912 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5913 {
5914 unsigned short value2 = op2->__anon1.us;
5915
5916 exp->type = 2;
5917 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
5918 if(!exp->expType)
5919 {
5920 exp->expType = op1->type;
5921 if(op1->type)
5922 op1->type->refCount++;
5923 }
5924 return 1;
5925 }
5926
5927 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5928 {
5929 char value2 = op2->__anon1.c;
5930
5931 exp->type = 2;
5932 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
5933 if(!exp->expType)
5934 {
5935 exp->expType = op1->type;
5936 if(op1->type)
5937 op1->type->refCount++;
5938 }
5939 return 1;
5940 }
5941
5942 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5943 {
5944 unsigned char value2 = op2->__anon1.uc;
5945
5946 exp->type = 2;
5947 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
5948 if(!exp->expType)
5949 {
5950 exp->expType = op1->type;
5951 if(op1->type)
5952 op1->type->refCount++;
5953 }
5954 return 1;
5955 }
5956
5957 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5958 {
5959 float value2 = op2->__anon1.f;
5960
5961 exp->type = 2;
5962 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
5963 if(!exp->expType)
5964 {
5965 exp->expType = op1->type;
5966 if(op1->type)
5967 op1->type->refCount++;
5968 }
5969 return 1;
5970 }
5971
5972 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5973 {
5974 double value2 = op2->__anon1.d;
5975
5976 exp->type = 2;
5977 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
5978 if(!exp->expType)
5979 {
5980 exp->expType = op1->type;
5981 if(op1->type)
5982 op1->type->refCount++;
5983 }
5984 return 1;
5985 }
5986
5987 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5988 {
5989 int value2 = op2->__anon1.i;
5990
5991 exp->type = 2;
5992 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
5993 if(!exp->expType)
5994 {
5995 exp->expType = op1->type;
5996 if(op1->type)
5997 op1->type->refCount++;
5998 }
5999 return 1;
6000 }
6001
6002 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6003 {
6004 unsigned int value2 = op2->__anon1.ui;
6005
6006 exp->type = 2;
6007 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
6008 if(!exp->expType)
6009 {
6010 exp->expType = op1->type;
6011 if(op1->type)
6012 op1->type->refCount++;
6013 }
6014 return 1;
6015 }
6016
6017 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6018 {
6019 long long value2 = op2->__anon1.i64;
6020
6021 exp->type = 2;
6022 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
6023 if(!exp->expType)
6024 {
6025 exp->expType = op1->type;
6026 if(op1->type)
6027 op1->type->refCount++;
6028 }
6029 return 1;
6030 }
6031
6032 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6033 {
6034 uint64 value2 = op2->__anon1.ui64;
6035
6036 exp->type = 2;
6037 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
6038 if(!exp->expType)
6039 {
6040 exp->expType = op1->type;
6041 if(op1->type)
6042 op1->type->refCount++;
6043 }
6044 return 1;
6045 }
6046
6047 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6048 {
6049 short value2 = op2->__anon1.s;
6050
6051 exp->type = 2;
6052 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
6053 if(!exp->expType)
6054 {
6055 exp->expType = op1->type;
6056 if(op1->type)
6057 op1->type->refCount++;
6058 }
6059 return 1;
6060 }
6061
6062 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6063 {
6064 unsigned short value2 = op2->__anon1.us;
6065
6066 exp->type = 2;
6067 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
6068 if(!exp->expType)
6069 {
6070 exp->expType = op1->type;
6071 if(op1->type)
6072 op1->type->refCount++;
6073 }
6074 return 1;
6075 }
6076
6077 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6078 {
6079 char value2 = op2->__anon1.c;
6080
6081 exp->type = 2;
6082 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
6083 if(!exp->expType)
6084 {
6085 exp->expType = op1->type;
6086 if(op1->type)
6087 op1->type->refCount++;
6088 }
6089 return 1;
6090 }
6091
6092 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6093 {
6094 unsigned char value2 = op2->__anon1.uc;
6095
6096 exp->type = 2;
6097 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
6098 if(!exp->expType)
6099 {
6100 exp->expType = op1->type;
6101 if(op1->type)
6102 op1->type->refCount++;
6103 }
6104 return 1;
6105 }
6106
6107 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6108 {
6109 float value2 = op2->__anon1.f;
6110
6111 exp->type = 2;
6112 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
6113 if(!exp->expType)
6114 {
6115 exp->expType = op1->type;
6116 if(op1->type)
6117 op1->type->refCount++;
6118 }
6119 return 1;
6120 }
6121
6122 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6123 {
6124 double value2 = op2->__anon1.d;
6125
6126 exp->type = 2;
6127 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
6128 if(!exp->expType)
6129 {
6130 exp->expType = op1->type;
6131 if(op1->type)
6132 op1->type->refCount++;
6133 }
6134 return 1;
6135 }
6136
6137 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6138 {
6139 int value2 = op2->__anon1.i;
6140
6141 exp->type = 2;
6142 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
6143 if(!exp->expType)
6144 {
6145 exp->expType = op1->type;
6146 if(op1->type)
6147 op1->type->refCount++;
6148 }
6149 return 1;
6150 }
6151
6152 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6153 {
6154 unsigned int value2 = op2->__anon1.ui;
6155
6156 exp->type = 2;
6157 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
6158 if(!exp->expType)
6159 {
6160 exp->expType = op1->type;
6161 if(op1->type)
6162 op1->type->refCount++;
6163 }
6164 return 1;
6165 }
6166
6167 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6168 {
6169 long long value2 = op2->__anon1.i64;
6170
6171 exp->type = 2;
6172 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
6173 if(!exp->expType)
6174 {
6175 exp->expType = op1->type;
6176 if(op1->type)
6177 op1->type->refCount++;
6178 }
6179 return 1;
6180 }
6181
6182 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6183 {
6184 uint64 value2 = op2->__anon1.ui64;
6185
6186 exp->type = 2;
6187 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
6188 if(!exp->expType)
6189 {
6190 exp->expType = op1->type;
6191 if(op1->type)
6192 op1->type->refCount++;
6193 }
6194 return 1;
6195 }
6196
6197 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6198 {
6199 short value2 = op2->__anon1.s;
6200
6201 exp->type = 2;
6202 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
6203 if(!exp->expType)
6204 {
6205 exp->expType = op1->type;
6206 if(op1->type)
6207 op1->type->refCount++;
6208 }
6209 return 1;
6210 }
6211
6212 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6213 {
6214 unsigned short value2 = op2->__anon1.us;
6215
6216 exp->type = 2;
6217 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
6218 if(!exp->expType)
6219 {
6220 exp->expType = op1->type;
6221 if(op1->type)
6222 op1->type->refCount++;
6223 }
6224 return 1;
6225 }
6226
6227 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6228 {
6229 char value2 = op2->__anon1.c;
6230
6231 exp->type = 2;
6232 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
6233 if(!exp->expType)
6234 {
6235 exp->expType = op1->type;
6236 if(op1->type)
6237 op1->type->refCount++;
6238 }
6239 return 1;
6240 }
6241
6242 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6243 {
6244 unsigned char value2 = op2->__anon1.uc;
6245
6246 exp->type = 2;
6247 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
6248 if(!exp->expType)
6249 {
6250 exp->expType = op1->type;
6251 if(op1->type)
6252 op1->type->refCount++;
6253 }
6254 return 1;
6255 }
6256
6257 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6258 {
6259 float value2 = op2->__anon1.f;
6260
6261 exp->type = 2;
6262 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
6263 if(!exp->expType)
6264 {
6265 exp->expType = op1->type;
6266 if(op1->type)
6267 op1->type->refCount++;
6268 }
6269 return 1;
6270 }
6271
6272 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6273 {
6274 double value2 = op2->__anon1.d;
6275
6276 exp->type = 2;
6277 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
6278 if(!exp->expType)
6279 {
6280 exp->expType = op1->type;
6281 if(op1->type)
6282 op1->type->refCount++;
6283 }
6284 return 1;
6285 }
6286
6287 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6288 {
6289 int value2 = op2->__anon1.i;
6290
6291 exp->type = 2;
6292 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
6293 if(!exp->expType)
6294 {
6295 exp->expType = op1->type;
6296 if(op1->type)
6297 op1->type->refCount++;
6298 }
6299 return 1;
6300 }
6301
6302 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6303 {
6304 unsigned int value2 = op2->__anon1.ui;
6305
6306 exp->type = 2;
6307 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
6308 if(!exp->expType)
6309 {
6310 exp->expType = op1->type;
6311 if(op1->type)
6312 op1->type->refCount++;
6313 }
6314 return 1;
6315 }
6316
6317 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6318 {
6319 long long value2 = op2->__anon1.i64;
6320
6321 exp->type = 2;
6322 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
6323 if(!exp->expType)
6324 {
6325 exp->expType = op1->type;
6326 if(op1->type)
6327 op1->type->refCount++;
6328 }
6329 return 1;
6330 }
6331
6332 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6333 {
6334 uint64 value2 = op2->__anon1.ui64;
6335
6336 exp->type = 2;
6337 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
6338 if(!exp->expType)
6339 {
6340 exp->expType = op1->type;
6341 if(op1->type)
6342 op1->type->refCount++;
6343 }
6344 return 1;
6345 }
6346
6347 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6348 {
6349 short value2 = op2->__anon1.s;
6350
6351 exp->type = 2;
6352 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
6353 if(!exp->expType)
6354 {
6355 exp->expType = op1->type;
6356 if(op1->type)
6357 op1->type->refCount++;
6358 }
6359 return 1;
6360 }
6361
6362 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6363 {
6364 unsigned short value2 = op2->__anon1.us;
6365
6366 exp->type = 2;
6367 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
6368 if(!exp->expType)
6369 {
6370 exp->expType = op1->type;
6371 if(op1->type)
6372 op1->type->refCount++;
6373 }
6374 return 1;
6375 }
6376
6377 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6378 {
6379 char value2 = op2->__anon1.c;
6380
6381 exp->type = 2;
6382 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
6383 if(!exp->expType)
6384 {
6385 exp->expType = op1->type;
6386 if(op1->type)
6387 op1->type->refCount++;
6388 }
6389 return 1;
6390 }
6391
6392 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6393 {
6394 unsigned char value2 = op2->__anon1.uc;
6395
6396 exp->type = 2;
6397 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
6398 if(!exp->expType)
6399 {
6400 exp->expType = op1->type;
6401 if(op1->type)
6402 op1->type->refCount++;
6403 }
6404 return 1;
6405 }
6406
6407 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6408 {
6409 float value2 = op2->__anon1.f;
6410
6411 exp->type = 2;
6412 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
6413 if(!exp->expType)
6414 {
6415 exp->expType = op1->type;
6416 if(op1->type)
6417 op1->type->refCount++;
6418 }
6419 return 1;
6420 }
6421
6422 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6423 {
6424 double value2 = op2->__anon1.d;
6425
6426 exp->type = 2;
6427 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
6428 if(!exp->expType)
6429 {
6430 exp->expType = op1->type;
6431 if(op1->type)
6432 op1->type->refCount++;
6433 }
6434 return 1;
6435 }
6436
6437 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6438 {
6439 int value2 = op2->__anon1.i;
6440
6441 exp->type = 2;
6442 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
6443 if(!exp->expType)
6444 {
6445 exp->expType = op1->type;
6446 if(op1->type)
6447 op1->type->refCount++;
6448 }
6449 return 1;
6450 }
6451
6452 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6453 {
6454 unsigned int value2 = op2->__anon1.ui;
6455
6456 exp->type = 2;
6457 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
6458 if(!exp->expType)
6459 {
6460 exp->expType = op1->type;
6461 if(op1->type)
6462 op1->type->refCount++;
6463 }
6464 return 1;
6465 }
6466
6467 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6468 {
6469 long long value2 = op2->__anon1.i64;
6470
6471 exp->type = 2;
6472 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
6473 if(!exp->expType)
6474 {
6475 exp->expType = op1->type;
6476 if(op1->type)
6477 op1->type->refCount++;
6478 }
6479 return 1;
6480 }
6481
6482 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6483 {
6484 uint64 value2 = op2->__anon1.ui64;
6485
6486 exp->type = 2;
6487 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
6488 if(!exp->expType)
6489 {
6490 exp->expType = op1->type;
6491 if(op1->type)
6492 op1->type->refCount++;
6493 }
6494 return 1;
6495 }
6496
6497 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6498 {
6499 short value2 = op2->__anon1.s;
6500
6501 exp->type = 2;
6502 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
6503 if(!exp->expType)
6504 {
6505 exp->expType = op1->type;
6506 if(op1->type)
6507 op1->type->refCount++;
6508 }
6509 return 1;
6510 }
6511
6512 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6513 {
6514 unsigned short value2 = op2->__anon1.us;
6515
6516 exp->type = 2;
6517 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
6518 if(!exp->expType)
6519 {
6520 exp->expType = op1->type;
6521 if(op1->type)
6522 op1->type->refCount++;
6523 }
6524 return 1;
6525 }
6526
6527 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6528 {
6529 char value2 = op2->__anon1.c;
6530
6531 exp->type = 2;
6532 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
6533 if(!exp->expType)
6534 {
6535 exp->expType = op1->type;
6536 if(op1->type)
6537 op1->type->refCount++;
6538 }
6539 return 1;
6540 }
6541
6542 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6543 {
6544 unsigned char value2 = op2->__anon1.uc;
6545
6546 exp->type = 2;
6547 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
6548 if(!exp->expType)
6549 {
6550 exp->expType = op1->type;
6551 if(op1->type)
6552 op1->type->refCount++;
6553 }
6554 return 1;
6555 }
6556
6557 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6558 {
6559 float value2 = op2->__anon1.f;
6560
6561 exp->type = 2;
6562 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
6563 if(!exp->expType)
6564 {
6565 exp->expType = op1->type;
6566 if(op1->type)
6567 op1->type->refCount++;
6568 }
6569 return 1;
6570 }
6571
6572 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6573 {
6574 double value2 = op2->__anon1.d;
6575
6576 exp->type = 2;
6577 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
6578 if(!exp->expType)
6579 {
6580 exp->expType = op1->type;
6581 if(op1->type)
6582 op1->type->refCount++;
6583 }
6584 return 1;
6585 }
6586
6587 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6588 {
6589 int value2 = op2->__anon1.i;
6590
6591 exp->type = 2;
6592 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
6593 if(!exp->expType)
6594 {
6595 exp->expType = op1->type;
6596 if(op1->type)
6597 op1->type->refCount++;
6598 }
6599 return 1;
6600 }
6601
6602 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6603 {
6604 unsigned int value2 = op2->__anon1.ui;
6605
6606 exp->type = 2;
6607 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
6608 if(!exp->expType)
6609 {
6610 exp->expType = op1->type;
6611 if(op1->type)
6612 op1->type->refCount++;
6613 }
6614 return 1;
6615 }
6616
6617 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6618 {
6619 long long value2 = op2->__anon1.i64;
6620
6621 exp->type = 2;
6622 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
6623 if(!exp->expType)
6624 {
6625 exp->expType = op1->type;
6626 if(op1->type)
6627 op1->type->refCount++;
6628 }
6629 return 1;
6630 }
6631
6632 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6633 {
6634 uint64 value2 = op2->__anon1.ui64;
6635
6636 exp->type = 2;
6637 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
6638 if(!exp->expType)
6639 {
6640 exp->expType = op1->type;
6641 if(op1->type)
6642 op1->type->refCount++;
6643 }
6644 return 1;
6645 }
6646
6647 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6648 {
6649 short value2 = op2->__anon1.s;
6650
6651 exp->type = 2;
6652 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
6653 if(!exp->expType)
6654 {
6655 exp->expType = op1->type;
6656 if(op1->type)
6657 op1->type->refCount++;
6658 }
6659 return 1;
6660 }
6661
6662 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6663 {
6664 unsigned short value2 = op2->__anon1.us;
6665
6666 exp->type = 2;
6667 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
6668 if(!exp->expType)
6669 {
6670 exp->expType = op1->type;
6671 if(op1->type)
6672 op1->type->refCount++;
6673 }
6674 return 1;
6675 }
6676
6677 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6678 {
6679 char value2 = op2->__anon1.c;
6680
6681 exp->type = 2;
6682 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
6683 if(!exp->expType)
6684 {
6685 exp->expType = op1->type;
6686 if(op1->type)
6687 op1->type->refCount++;
6688 }
6689 return 1;
6690 }
6691
6692 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6693 {
6694 unsigned char value2 = op2->__anon1.uc;
6695
6696 exp->type = 2;
6697 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
6698 if(!exp->expType)
6699 {
6700 exp->expType = op1->type;
6701 if(op1->type)
6702 op1->type->refCount++;
6703 }
6704 return 1;
6705 }
6706
6707 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6708 {
6709 float value2 = op2->__anon1.f;
6710
6711 exp->type = 2;
6712 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
6713 if(!exp->expType)
6714 {
6715 exp->expType = op1->type;
6716 if(op1->type)
6717 op1->type->refCount++;
6718 }
6719 return 1;
6720 }
6721
6722 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6723 {
6724 double value2 = op2->__anon1.d;
6725
6726 exp->type = 2;
6727 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
6728 if(!exp->expType)
6729 {
6730 exp->expType = op1->type;
6731 if(op1->type)
6732 op1->type->refCount++;
6733 }
6734 return 1;
6735 }
6736
6737 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6738 {
6739 int value2 = op2->__anon1.i;
6740
6741 exp->type = 2;
6742 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
6743 if(!exp->expType)
6744 {
6745 exp->expType = op1->type;
6746 if(op1->type)
6747 op1->type->refCount++;
6748 }
6749 return 1;
6750 }
6751
6752 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6753 {
6754 unsigned int value2 = op2->__anon1.ui;
6755
6756 exp->type = 2;
6757 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
6758 if(!exp->expType)
6759 {
6760 exp->expType = op1->type;
6761 if(op1->type)
6762 op1->type->refCount++;
6763 }
6764 return 1;
6765 }
6766
6767 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6768 {
6769 long long value2 = op2->__anon1.i64;
6770
6771 exp->type = 2;
6772 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
6773 if(!exp->expType)
6774 {
6775 exp->expType = op1->type;
6776 if(op1->type)
6777 op1->type->refCount++;
6778 }
6779 return 1;
6780 }
6781
6782 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6783 {
6784 uint64 value2 = op2->__anon1.ui64;
6785
6786 exp->type = 2;
6787 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
6788 if(!exp->expType)
6789 {
6790 exp->expType = op1->type;
6791 if(op1->type)
6792 op1->type->refCount++;
6793 }
6794 return 1;
6795 }
6796
6797 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6798 {
6799 short value2 = op2->__anon1.s;
6800
6801 exp->type = 2;
6802 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
6803 if(!exp->expType)
6804 {
6805 exp->expType = op1->type;
6806 if(op1->type)
6807 op1->type->refCount++;
6808 }
6809 return 1;
6810 }
6811
6812 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6813 {
6814 unsigned short value2 = op2->__anon1.us;
6815
6816 exp->type = 2;
6817 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
6818 if(!exp->expType)
6819 {
6820 exp->expType = op1->type;
6821 if(op1->type)
6822 op1->type->refCount++;
6823 }
6824 return 1;
6825 }
6826
6827 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6828 {
6829 char value2 = op2->__anon1.c;
6830
6831 exp->type = 2;
6832 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
6833 if(!exp->expType)
6834 {
6835 exp->expType = op1->type;
6836 if(op1->type)
6837 op1->type->refCount++;
6838 }
6839 return 1;
6840 }
6841
6842 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6843 {
6844 unsigned char value2 = op2->__anon1.uc;
6845
6846 exp->type = 2;
6847 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
6848 if(!exp->expType)
6849 {
6850 exp->expType = op1->type;
6851 if(op1->type)
6852 op1->type->refCount++;
6853 }
6854 return 1;
6855 }
6856
6857 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6858 {
6859 float value2 = op2->__anon1.f;
6860
6861 exp->type = 2;
6862 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
6863 if(!exp->expType)
6864 {
6865 exp->expType = op1->type;
6866 if(op1->type)
6867 op1->type->refCount++;
6868 }
6869 return 1;
6870 }
6871
6872 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6873 {
6874 double value2 = op2->__anon1.d;
6875
6876 exp->type = 2;
6877 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
6878 if(!exp->expType)
6879 {
6880 exp->expType = op1->type;
6881 if(op1->type)
6882 op1->type->refCount++;
6883 }
6884 return 1;
6885 }
6886
6887 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6888 {
6889 int value2 = op2->__anon1.i;
6890
6891 exp->type = 2;
6892 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
6893 if(!exp->expType)
6894 {
6895 exp->expType = op1->type;
6896 if(op1->type)
6897 op1->type->refCount++;
6898 }
6899 return 1;
6900 }
6901
6902 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6903 {
6904 unsigned int value2 = op2->__anon1.ui;
6905
6906 exp->type = 2;
6907 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
6908 if(!exp->expType)
6909 {
6910 exp->expType = op1->type;
6911 if(op1->type)
6912 op1->type->refCount++;
6913 }
6914 return 1;
6915 }
6916
6917 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6918 {
6919 long long value2 = op2->__anon1.i64;
6920
6921 exp->type = 2;
6922 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
6923 if(!exp->expType)
6924 {
6925 exp->expType = op1->type;
6926 if(op1->type)
6927 op1->type->refCount++;
6928 }
6929 return 1;
6930 }
6931
6932 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6933 {
6934 uint64 value2 = op2->__anon1.ui64;
6935
6936 exp->type = 2;
6937 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
6938 if(!exp->expType)
6939 {
6940 exp->expType = op1->type;
6941 if(op1->type)
6942 op1->type->refCount++;
6943 }
6944 return 1;
6945 }
6946
6947 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6948 {
6949 short value2 = op2->__anon1.s;
6950
6951 exp->type = 2;
6952 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
6953 if(!exp->expType)
6954 {
6955 exp->expType = op1->type;
6956 if(op1->type)
6957 op1->type->refCount++;
6958 }
6959 return 1;
6960 }
6961
6962 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6963 {
6964 unsigned short value2 = op2->__anon1.us;
6965
6966 exp->type = 2;
6967 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
6968 if(!exp->expType)
6969 {
6970 exp->expType = op1->type;
6971 if(op1->type)
6972 op1->type->refCount++;
6973 }
6974 return 1;
6975 }
6976
6977 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6978 {
6979 char value2 = op2->__anon1.c;
6980
6981 exp->type = 2;
6982 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
6983 if(!exp->expType)
6984 {
6985 exp->expType = op1->type;
6986 if(op1->type)
6987 op1->type->refCount++;
6988 }
6989 return 1;
6990 }
6991
6992 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6993 {
6994 unsigned char value2 = op2->__anon1.uc;
6995
6996 exp->type = 2;
6997 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
6998 if(!exp->expType)
6999 {
7000 exp->expType = op1->type;
7001 if(op1->type)
7002 op1->type->refCount++;
7003 }
7004 return 1;
7005 }
7006
7007 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7008 {
7009 float value2 = op2->__anon1.f;
7010
7011 exp->type = 2;
7012 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
7013 if(!exp->expType)
7014 {
7015 exp->expType = op1->type;
7016 if(op1->type)
7017 op1->type->refCount++;
7018 }
7019 return 1;
7020 }
7021
7022 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7023 {
7024 double value2 = op2->__anon1.d;
7025
7026 exp->type = 2;
7027 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
7028 if(!exp->expType)
7029 {
7030 exp->expType = op1->type;
7031 if(op1->type)
7032 op1->type->refCount++;
7033 }
7034 return 1;
7035 }
7036
7037 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7038 {
7039 exp->type = 2;
7040 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
7041 if(!exp->expType)
7042 {
7043 exp->expType = op1->type;
7044 if(op1->type)
7045 op1->type->refCount++;
7046 }
7047 return 1;
7048 }
7049
7050 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7051 {
7052 exp->type = 2;
7053 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
7054 if(!exp->expType)
7055 {
7056 exp->expType = op1->type;
7057 if(op1->type)
7058 op1->type->refCount++;
7059 }
7060 return 1;
7061 }
7062
7063 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7064 {
7065 exp->type = 2;
7066 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
7067 if(!exp->expType)
7068 {
7069 exp->expType = op1->type;
7070 if(op1->type)
7071 op1->type->refCount++;
7072 }
7073 return 1;
7074 }
7075
7076 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7077 {
7078 exp->type = 2;
7079 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
7080 if(!exp->expType)
7081 {
7082 exp->expType = op1->type;
7083 if(op1->type)
7084 op1->type->refCount++;
7085 }
7086 return 1;
7087 }
7088
7089 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7090 {
7091 exp->type = 2;
7092 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
7093 if(!exp->expType)
7094 {
7095 exp->expType = op1->type;
7096 if(op1->type)
7097 op1->type->refCount++;
7098 }
7099 return 1;
7100 }
7101
7102 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7103 {
7104 exp->type = 2;
7105 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
7106 if(!exp->expType)
7107 {
7108 exp->expType = op1->type;
7109 if(op1->type)
7110 op1->type->refCount++;
7111 }
7112 return 1;
7113 }
7114
7115 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7116 {
7117 exp->type = 2;
7118 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
7119 if(!exp->expType)
7120 {
7121 exp->expType = op1->type;
7122 if(op1->type)
7123 op1->type->refCount++;
7124 }
7125 return 1;
7126 }
7127
7128 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7129 {
7130 exp->type = 2;
7131 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
7132 if(!exp->expType)
7133 {
7134 exp->expType = op1->type;
7135 if(op1->type)
7136 op1->type->refCount++;
7137 }
7138 return 1;
7139 }
7140
7141 static void PrintName(struct Type * type, char * string, unsigned int fullName)
7142 {
7143 if(type->name && type->name[0])
7144 {
7145 if(fullName)
7146 strcat(string, type->name);
7147 else
7148 {
7149 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
7150
7151 if(name)
7152 name += 2;
7153 else
7154 name = type->name;
7155 strcat(string, name);
7156 }
7157 }
7158 }
7159
7160 static void PrintAttribs(struct Type * type, char * string)
7161 {
7162 if(type)
7163 {
7164 if(type->dllExport)
7165 strcat(string, "dllexport ");
7166 if(type->attrStdcall)
7167 strcat(string, "stdcall ");
7168 }
7169 }
7170
7171 static struct Type * FindMember(struct Type * type, char * string)
7172 {
7173 struct Type * memberType;
7174
7175 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7176 {
7177 if(!memberType->name)
7178 {
7179 struct Type * subType = FindMember(memberType, string);
7180
7181 if(subType)
7182 return subType;
7183 }
7184 else if(!strcmp(memberType->name, string))
7185 return memberType;
7186 }
7187 return (((void *)0));
7188 }
7189
7190 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
7191
7192 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
7193
7194 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
7195 {
7196 unsigned int result = 0;
7197
7198 switch(kind)
7199 {
7200 case 2:
7201 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
7202 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
7203 break;
7204 case 3:
7205 case 5:
7206 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
7207 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7208 break;
7209 case 4:
7210 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)
7211 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7212 break;
7213 case 6:
7214 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)
7215 result = GetOpFloat(op, &op->__anon1.f);
7216 break;
7217 case 7:
7218 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)
7219 result = GetOpDouble(op, &op->__anon1.d);
7220 break;
7221 case 13:
7222 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)
7223 result = GetOpUInt64(op, &op->__anon1.ui64);
7224 break;
7225 case 15:
7226 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)
7227 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7228 break;
7229 case 22:
7230 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7231 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7232 break;
7233 case 23:
7234 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7235 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7236 break;
7237 }
7238 return result;
7239 }
7240
7241 struct OpTable floatOps =
7242 {
7243 (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)
7244 };
7245
7246 struct OpTable doubleOps =
7247 {
7248 (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)
7249 };
7250
7251 struct OpTable intOps =
7252 {
7253 (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)
7254 };
7255
7256 struct OpTable uintOps =
7257 {
7258 (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)
7259 };
7260
7261 struct OpTable int64Ops =
7262 {
7263 (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)
7264 };
7265
7266 struct OpTable uint64Ops =
7267 {
7268 (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)
7269 };
7270
7271 struct OpTable shortOps =
7272 {
7273 (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)
7274 };
7275
7276 struct OpTable ushortOps =
7277 {
7278 (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)
7279 };
7280
7281 struct OpTable charOps =
7282 {
7283 (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)
7284 };
7285
7286 struct OpTable ucharOps =
7287 {
7288 (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)
7289 };
7290
7291 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
7292 {
7293 struct Type * memberType;
7294
7295 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7296 {
7297 if(!memberType->name)
7298 {
7299 struct Type * subType = FindMember(memberType, string);
7300
7301 if(subType)
7302 {
7303 *offset += memberType->offset;
7304 return subType;
7305 }
7306 }
7307 else if(!strcmp(memberType->name, string))
7308 {
7309 *offset += memberType->offset;
7310 return memberType;
7311 }
7312 }
7313 return (((void *)0));
7314 }
7315
7316 struct __ecereNameSpace__ecere__com__Module;
7317
7318 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);
7319
7320 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
7321
7322 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);
7323
7324 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);
7325
7326 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
7327
7328 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7329
7330 struct GlobalData
7331 {
7332 uintptr_t key;
7333 struct __ecereNameSpace__ecere__sys__BTNode * parent;
7334 struct __ecereNameSpace__ecere__sys__BTNode * left;
7335 struct __ecereNameSpace__ecere__sys__BTNode * right;
7336 int depth;
7337 struct __ecereNameSpace__ecere__com__Instance * module;
7338 char *  dataTypeString;
7339 struct Type * dataType;
7340 void *  symbol;
7341 char *  fullName;
7342 } __attribute__ ((gcc_struct));
7343
7344 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);
7345
7346 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
7347
7348 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);
7349
7350 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
7351
7352 struct __ecereNameSpace__ecere__com__DefinedExpression;
7353
7354 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7355
7356 struct __ecereNameSpace__ecere__com__DefinedExpression
7357 {
7358 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
7359 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
7360 const char *  name;
7361 const char *  value;
7362 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7363 } __attribute__ ((gcc_struct));
7364
7365 struct __ecereNameSpace__ecere__sys__BinaryTree;
7366
7367 struct __ecereNameSpace__ecere__sys__BinaryTree
7368 {
7369 struct __ecereNameSpace__ecere__sys__BTNode * root;
7370 int count;
7371 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
7372 void (*  FreeKey)(void *  key);
7373 } __attribute__ ((gcc_struct));
7374
7375 struct __ecereNameSpace__ecere__com__Class
7376 {
7377 struct __ecereNameSpace__ecere__com__Class * prev;
7378 struct __ecereNameSpace__ecere__com__Class * next;
7379 const char *  name;
7380 int offset;
7381 int structSize;
7382 void * *  _vTbl;
7383 int vTblSize;
7384 unsigned int (*  Constructor)(void * );
7385 void (*  Destructor)(void * );
7386 int offsetClass;
7387 int sizeClass;
7388 struct __ecereNameSpace__ecere__com__Class * base;
7389 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
7390 struct __ecereNameSpace__ecere__sys__BinaryTree members;
7391 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
7392 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
7393 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
7394 struct __ecereNameSpace__ecere__sys__OldList derivatives;
7395 int memberID;
7396 int startMemberID;
7397 int type;
7398 struct __ecereNameSpace__ecere__com__Instance * module;
7399 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7400 const char *  dataTypeString;
7401 struct Type * dataType;
7402 int typeSize;
7403 int defaultAlignment;
7404 void (*  Initialize)();
7405 int memberOffset;
7406 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
7407 const char *  designerClass;
7408 unsigned int noExpansion;
7409 const char *  defaultProperty;
7410 unsigned int comRedefinition;
7411 int count;
7412 int isRemote;
7413 unsigned int internalDecl;
7414 void *  data;
7415 unsigned int computeSize;
7416 short structAlignment;
7417 short pointerAlignment;
7418 int destructionWatchOffset;
7419 unsigned int fixed;
7420 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
7421 int inheritanceAccess;
7422 const char *  fullName;
7423 void *  symbol;
7424 struct __ecereNameSpace__ecere__sys__OldList conversions;
7425 struct __ecereNameSpace__ecere__sys__OldList templateParams;
7426 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
7427 struct __ecereNameSpace__ecere__com__Class * templateClass;
7428 struct __ecereNameSpace__ecere__sys__OldList templatized;
7429 int numParams;
7430 unsigned int isInstanceClass;
7431 unsigned int byValueSystemClass;
7432 } __attribute__ ((gcc_struct));
7433
7434 struct __ecereNameSpace__ecere__com__NameSpace
7435 {
7436 const char *  name;
7437 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
7438 struct __ecereNameSpace__ecere__com__NameSpace *  left;
7439 struct __ecereNameSpace__ecere__com__NameSpace *  right;
7440 int depth;
7441 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
7442 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
7443 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
7444 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
7445 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
7446 } __attribute__ ((gcc_struct));
7447
7448 struct __ecereNameSpace__ecere__com__DataMember
7449 {
7450 struct __ecereNameSpace__ecere__com__DataMember * prev;
7451 struct __ecereNameSpace__ecere__com__DataMember * next;
7452 const char *  name;
7453 unsigned int isProperty;
7454 int memberAccess;
7455 int id;
7456 struct __ecereNameSpace__ecere__com__Class * _class;
7457 const char *  dataTypeString;
7458 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
7459 struct Type * dataType;
7460 int type;
7461 int offset;
7462 int memberID;
7463 struct __ecereNameSpace__ecere__sys__OldList members;
7464 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
7465 int memberOffset;
7466 short structAlignment;
7467 short pointerAlignment;
7468 } __attribute__ ((gcc_struct));
7469
7470 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7471
7472 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7473
7474 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
7475
7476 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7477
7478 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7479
7480 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
7481
7482 static void _DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl)
7483 {
7484 if(inCompiler)
7485 {
7486 if(type->kind == 11)
7487 {
7488 struct Type * param;
7489
7490 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
7491 _DeclareType(neededFor, param, forFunctionDef, 0, fwdDecl);
7492 _DeclareType(neededFor, type->__anon1.__anon2.returnType, forFunctionDef, 0, fwdDecl);
7493 }
7494 else if(type->kind == 13)
7495 _DeclareType(neededFor, type->__anon1.type, 0, 0, fwdDecl);
7496 else if(type->kind == 8)
7497 {
7498 struct __ecereNameSpace__ecere__com__Class * c = type->__anon1._class->__anon1.registered;
7499
7500 _DeclareStruct(neededFor, c ? c->fullName : "ecere::com::Instance", c ? c->type == 5 : 0, needDereference && c && c->type == 1, fwdDecl);
7501 }
7502 else if(type->kind == 9 || type->kind == 10)
7503 {
7504 struct Type * member;
7505
7506 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7507 _DeclareType(neededFor, member, needDereference, forFunctionDef, fwdDecl);
7508 }
7509 else if(type->kind == 12)
7510 _DeclareType(neededFor, type->__anon1.__anon4.arrayType, 1, 0, fwdDecl);
7511 }
7512 }
7513
7514 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
7515 {
7516 unsigned int status = 1;
7517
7518 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))
7519 {
7520 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
7521 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
7522
7523 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
7524 {
7525 struct Type * sourceType = source, * destType = dest;
7526
7527 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
7528 sourceType = sourceType->__anon1.type;
7529 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
7530 destType = destType->__anon1.type;
7531 if(!destType->constant && sourceType->constant)
7532 {
7533 status = 0;
7534 if(warn)
7535 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
7536 }
7537 }
7538 }
7539 return status;
7540 }
7541
7542 struct Operand GetOperand(struct Expression * exp)
7543 {
7544 struct Operand op =
7545 {
7546 0, 0, 0,
7547 .__anon1 = {
7548 .c = 0
7549 },
7550 {
7551 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7552 }
7553 };
7554 struct Type * type = exp->expType;
7555
7556 if(type)
7557 {
7558 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))
7559 {
7560 if(!type->__anon1._class->__anon1.registered->dataType)
7561 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7562 type = type->__anon1._class->__anon1.registered->dataType;
7563 }
7564 if(exp->type == 3 && op.kind == 13)
7565 {
7566 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
7567 op.kind = 13;
7568 op.ops = uint64Ops;
7569 }
7570 else if(exp->isConstant && exp->type == 2)
7571 {
7572 op.kind = type->kind;
7573 op.type = type;
7574 switch(op.kind)
7575 {
7576 case 24:
7577 case 1:
7578 {
7579 if(exp->__anon1.__anon1.constant[0] == '\'')
7580 {
7581 op.__anon1.c = exp->__anon1.__anon1.constant[1];
7582 op.ops = charOps;
7583 }
7584 else if(type->isSigned)
7585 {
7586 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7587 op.ops = charOps;
7588 }
7589 else
7590 {
7591 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7592 op.ops = ucharOps;
7593 }
7594 break;
7595 }
7596 case 2:
7597 if(type->isSigned)
7598 {
7599 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7600 op.ops = shortOps;
7601 }
7602 else
7603 {
7604 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7605 op.ops = ushortOps;
7606 }
7607 break;
7608 case 3:
7609 case 5:
7610 if(type->isSigned)
7611 {
7612 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7613 op.ops = intOps;
7614 }
7615 else
7616 {
7617 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7618 op.ops = uintOps;
7619 }
7620 op.kind = 3;
7621 break;
7622 case 4:
7623 if(type->isSigned)
7624 {
7625 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7626 op.ops = int64Ops;
7627 }
7628 else
7629 {
7630 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7631 op.ops = uint64Ops;
7632 }
7633 op.kind = 4;
7634 break;
7635 case 22:
7636 if(type->isSigned)
7637 {
7638 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7639 op.ops = int64Ops;
7640 }
7641 else
7642 {
7643 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7644 op.ops = uint64Ops;
7645 }
7646 op.kind = 4;
7647 break;
7648 case 23:
7649 if(type->isSigned)
7650 {
7651 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7652 op.ops = int64Ops;
7653 }
7654 else
7655 {
7656 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7657 op.ops = uint64Ops;
7658 }
7659 op.kind = 4;
7660 break;
7661 case 6:
7662 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7663 op.__anon1.f = __ecereMethod_float_inf();
7664 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7665 op.__anon1.f = -__ecereMethod_float_inf();
7666 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7667 op.__anon1.f = __ecereMethod_float_nan();
7668 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7669 op.__anon1.f = -__ecereMethod_float_nan();
7670 else
7671 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7672 op.ops = floatOps;
7673 break;
7674 case 7:
7675 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7676 op.__anon1.d = __ecereMethod_double_inf();
7677 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7678 op.__anon1.d = -__ecereMethod_double_inf();
7679 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7680 op.__anon1.d = __ecereMethod_double_nan();
7681 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7682 op.__anon1.d = -__ecereMethod_double_nan();
7683 else
7684 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7685 op.ops = doubleOps;
7686 break;
7687 case 12:
7688 case 13:
7689 case 8:
7690 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7691 op.kind = 13;
7692 op.ops = uint64Ops;
7693 break;
7694 }
7695 }
7696 }
7697 return op;
7698 }
7699
7700 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
7701 {
7702 long long v = 0;
7703
7704 switch(_class->typeSize)
7705 {
7706 case 8:
7707 if(!strcmp(_class->dataTypeString, "uint64"))
7708 v = (long long)*(uint64 *)ptr;
7709 else
7710 v = *(long long *)ptr;
7711 break;
7712 case 4:
7713 if(!strcmp(_class->dataTypeString, "uint"))
7714 v = (long long)*(unsigned int *)ptr;
7715 else
7716 v = (long long)*(int *)ptr;
7717 break;
7718 case 2:
7719 if(!strcmp(_class->dataTypeString, "uint16"))
7720 v = (long long)*(unsigned short *)ptr;
7721 else
7722 v = (long long)*(short *)ptr;
7723 break;
7724 case 1:
7725 if(!strcmp(_class->dataTypeString, "byte"))
7726 v = (long long)*(unsigned char *)ptr;
7727 else
7728 v = (long long)*(char *)ptr;
7729 break;
7730 }
7731 return v;
7732 }
7733
7734 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
7735 {
7736 if(!type->isSigned && type->kind != 22 && type->kind != 23)
7737 ListAdd(specs, MkSpecifier(UNSIGNED));
7738 switch(type->kind)
7739 {
7740 case 8:
7741 {
7742 if(type->__anon1._class->__anon1.registered)
7743 {
7744 if(!type->__anon1._class->__anon1.registered->dataType)
7745 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7746 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
7747 }
7748 break;
7749 }
7750 case 7:
7751 ListAdd(specs, MkSpecifier(DOUBLE));
7752 break;
7753 case 6:
7754 ListAdd(specs, MkSpecifier(FLOAT));
7755 break;
7756 case 1:
7757 ListAdd(specs, MkSpecifier(CHAR));
7758 break;
7759 case 24:
7760 ListAdd(specs, MkSpecifier(_BOOL));
7761 break;
7762 case 2:
7763 ListAdd(specs, MkSpecifier(SHORT));
7764 break;
7765 case 4:
7766 ListAdd(specs, MkSpecifier(INT64));
7767 break;
7768 case 22:
7769 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
7770 break;
7771 case 23:
7772 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
7773 break;
7774 case 3:
7775 default:
7776 ListAdd(specs, MkSpecifier(INT));
7777 break;
7778 }
7779 }
7780
7781 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
7782 {
7783 if(type)
7784 {
7785 if(printConst && type->constant)
7786 strcat(string, "const ");
7787 switch(type->kind)
7788 {
7789 case 8:
7790 {
7791 struct Symbol * c = type->__anon1._class;
7792 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
7793
7794 if(type->classObjectType == 2 && isObjectBaseClass)
7795 strcat(string, "typed_object");
7796 else if(type->classObjectType == 3 && isObjectBaseClass)
7797 strcat(string, "any_object");
7798 else
7799 {
7800 if(c && c->string)
7801 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
7802 }
7803 if(type->byReference)
7804 strcat(string, " &");
7805 break;
7806 }
7807 case 0:
7808 strcat(string, "void");
7809 break;
7810 case 3:
7811 strcat(string, type->isSigned ? "int" : "uint");
7812 break;
7813 case 4:
7814 strcat(string, type->isSigned ? "int64" : "uint64");
7815 break;
7816 case 22:
7817 strcat(string, type->isSigned ? "intptr" : "uintptr");
7818 break;
7819 case 23:
7820 strcat(string, type->isSigned ? "intsize" : "uintsize");
7821 break;
7822 case 1:
7823 strcat(string, type->isSigned ? "char" : "byte");
7824 break;
7825 case 24:
7826 strcat(string, "_Bool");
7827 break;
7828 case 2:
7829 strcat(string, type->isSigned ? "short" : "uint16");
7830 break;
7831 case 6:
7832 strcat(string, "float");
7833 break;
7834 case 7:
7835 strcat(string, "double");
7836 break;
7837 case 9:
7838 if(type->__anon1.__anon1.enumName)
7839 {
7840 strcat(string, "struct ");
7841 strcat(string, type->__anon1.__anon1.enumName);
7842 }
7843 else if(type->typeName)
7844 strcat(string, type->typeName);
7845 else
7846 {
7847 struct Type * member;
7848
7849 strcat(string, "struct { ");
7850 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7851 {
7852 PrintType(member, string, 1, fullName);
7853 strcat(string, "; ");
7854 }
7855 strcat(string, "}");
7856 }
7857 break;
7858 case 10:
7859 if(type->__anon1.__anon1.enumName)
7860 {
7861 strcat(string, "union ");
7862 strcat(string, type->__anon1.__anon1.enumName);
7863 }
7864 else if(type->typeName)
7865 strcat(string, type->typeName);
7866 else
7867 {
7868 strcat(string, "union ");
7869 strcat(string, "(unnamed)");
7870 }
7871 break;
7872 case 15:
7873 if(type->__anon1.__anon1.enumName)
7874 {
7875 strcat(string, "enum ");
7876 strcat(string, type->__anon1.__anon1.enumName);
7877 }
7878 else if(type->typeName)
7879 strcat(string, type->typeName);
7880 else
7881 strcat(string, "int");
7882 break;
7883 case 14:
7884 strcat(string, "...");
7885 break;
7886 case 19:
7887 strcat(string, "subclass(");
7888 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
7889 strcat(string, ")");
7890 break;
7891 case 20:
7892 strcat(string, type->__anon1.templateParameter->identifier->string);
7893 break;
7894 case 21:
7895 strcat(string, "thisclass");
7896 break;
7897 case 17:
7898 strcat(string, "__builtin_va_list");
7899 break;
7900 }
7901 }
7902 }
7903
7904 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
7905
7906 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
7907
7908 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
7909
7910 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
7911
7912 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
7913
7914 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
7915
7916 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
7917
7918 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
7919
7920 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
7921
7922 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
7923
7924 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
7925
7926 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
7927
7928 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
7929
7930 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
7931
7932 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
7933
7934 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
7935
7936 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
7937
7938 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
7939
7940 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
7941
7942 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
7943
7944 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
7945
7946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
7947
7948 struct __ecereNameSpace__ecere__com__Application
7949 {
7950 int argc;
7951 const char * *  argv;
7952 int exitCode;
7953 unsigned int isGUIApp;
7954 struct __ecereNameSpace__ecere__sys__OldList allModules;
7955 char *  parsedCommand;
7956 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
7957 } __attribute__ ((gcc_struct));
7958
7959 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)
7960 {
7961 if(*curMember)
7962 {
7963 *curMember = (*curMember)->next;
7964 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
7965 {
7966 *curMember = subMemberStack[--(*subMemberStackPos)];
7967 *curMember = (*curMember)->next;
7968 }
7969 while((*curMember) && (*curMember)->isProperty)
7970 *curMember = (*curMember)->next;
7971 if(subMemberStackPos)
7972 {
7973 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
7974 {
7975 subMemberStack[(*subMemberStackPos)++] = *curMember;
7976 *curMember = (*curMember)->members.first;
7977 while(*curMember && (*curMember)->isProperty)
7978 *curMember = (*curMember)->next;
7979 }
7980 }
7981 }
7982 while(!*curMember)
7983 {
7984 if(!*curMember)
7985 {
7986 if(subMemberStackPos && *subMemberStackPos)
7987 {
7988 *curMember = subMemberStack[--(*subMemberStackPos)];
7989 *curMember = (*curMember)->next;
7990 }
7991 else
7992 {
7993 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
7994
7995 if(*curClass == _class)
7996 break;
7997 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
7998 ;
7999 *curMember = (*curClass)->membersAndProperties.first;
8000 }
8001 while((*curMember) && (*curMember)->isProperty)
8002 *curMember = (*curMember)->next;
8003 if(subMemberStackPos)
8004 {
8005 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8006 {
8007 subMemberStack[(*subMemberStackPos)++] = *curMember;
8008 *curMember = (*curMember)->members.first;
8009 while(*curMember && (*curMember)->isProperty)
8010 *curMember = (*curMember)->next;
8011 }
8012 }
8013 }
8014 }
8015 }
8016
8017 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
8018 {
8019 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
8020 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
8021 struct __ecereNameSpace__ecere__com__NameSpace * child;
8022
8023 if(!data)
8024 {
8025 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)))
8026 {
8027 data = ScanGlobalData(child, name);
8028 if(data)
8029 break;
8030 }
8031 }
8032 return data;
8033 }
8034
8035 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
8036 {
8037 int nsLen = strlen(nameSpace);
8038 struct Symbol * symbol;
8039
8040 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)))
8041 {
8042 char * s = symbol->string;
8043
8044 if(!strncmp(s, nameSpace, nsLen))
8045 {
8046 int c;
8047 char * namePart;
8048
8049 for(c = strlen(s) - 1; c >= 0; c--)
8050 if(s[c] == ':')
8051 break;
8052 namePart = s + c + 1;
8053 if(!strcmp(namePart, name))
8054 {
8055 return symbol;
8056 }
8057 }
8058 else
8059 break;
8060 }
8061 return (((void *)0));
8062 }
8063
8064 unsigned int GetInt(struct Expression * exp, int * value2)
8065 {
8066 struct Operand op2 = GetOperand(exp);
8067
8068 return GetOpInt(&op2, value2);
8069 }
8070
8071 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
8072 {
8073 struct Operand op2 = GetOperand(exp);
8074
8075 return GetOpUInt(&op2, value2);
8076 }
8077
8078 unsigned int GetInt64(struct Expression * exp, long long * value2)
8079 {
8080 struct Operand op2 = GetOperand(exp);
8081
8082 return GetOpInt64(&op2, value2);
8083 }
8084
8085 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
8086 {
8087 struct Operand op2 = GetOperand(exp);
8088
8089 return GetOpUInt64(&op2, value2);
8090 }
8091
8092 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
8093 {
8094 struct Operand op2 = GetOperand(exp);
8095
8096 return GetOpIntPtr(&op2, value2);
8097 }
8098
8099 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
8100 {
8101 struct Operand op2 = GetOperand(exp);
8102
8103 return GetOpUIntPtr(&op2, value2);
8104 }
8105
8106 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
8107 {
8108 struct Operand op2 = GetOperand(exp);
8109
8110 return GetOpIntSize(&op2, value2);
8111 }
8112
8113 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
8114 {
8115 struct Operand op2 = GetOperand(exp);
8116
8117 return GetOpUIntSize(&op2, value2);
8118 }
8119
8120 unsigned int GetShort(struct Expression * exp, short * value2)
8121 {
8122 struct Operand op2 = GetOperand(exp);
8123
8124 return GetOpShort(&op2, value2);
8125 }
8126
8127 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
8128 {
8129 struct Operand op2 = GetOperand(exp);
8130
8131 return GetOpUShort(&op2, value2);
8132 }
8133
8134 unsigned int GetChar(struct Expression * exp, char * value2)
8135 {
8136 struct Operand op2 = GetOperand(exp);
8137
8138 return GetOpChar(&op2, value2);
8139 }
8140
8141 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
8142 {
8143 struct Operand op2 = GetOperand(exp);
8144
8145 return GetOpUChar(&op2, value2);
8146 }
8147
8148 unsigned int GetFloat(struct Expression * exp, float * value2)
8149 {
8150 struct Operand op2 = GetOperand(exp);
8151
8152 return GetOpFloat(&op2, value2);
8153 }
8154
8155 unsigned int GetDouble(struct Expression * exp, double * value2)
8156 {
8157 struct Operand op2 = GetOperand(exp);
8158
8159 return GetOpDouble(&op2, value2);
8160 }
8161
8162 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
8163 {
8164 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8165 {
8166 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
8167 PrintAttribs(type, string);
8168 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
8169 strcat(string, " const");
8170 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
8171 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8172 strcat(string, " (");
8173 if(type->kind == 13)
8174 {
8175 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
8176 PrintAttribs(type->__anon1.type, string);
8177 }
8178 if(type->kind == 13)
8179 {
8180 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
8181 strcat(string, "*");
8182 else
8183 strcat(string, " *");
8184 }
8185 if(printConst && type->constant && type->kind == 13)
8186 strcat(string, " const");
8187 }
8188 else
8189 PrintTypeSpecs(type, string, fullName, printConst);
8190 }
8191
8192 void PrintExpression(struct Expression * exp, char * string)
8193 {
8194 {
8195 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8196 int count;
8197 unsigned int backOutputLineNumbers = outputLineNumbers;
8198
8199 outputLineNumbers = 0;
8200 if(exp)
8201 OutputExpression(exp, f);
8202 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8203 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8204
8205 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8206 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
8207 count = strlen(string);
8208 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8209 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8210
8211 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8212 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
8213 string[count] = '\0';
8214 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
8215 outputLineNumbers = backOutputLineNumbers;
8216 }
8217 }
8218
8219 struct Type * Dereference(struct Type * source)
8220 {
8221 struct Type * type = (((void *)0));
8222
8223 if(source)
8224 {
8225 if(source->kind == 13 || source->kind == 12)
8226 {
8227 type = source->__anon1.type;
8228 source->__anon1.type->refCount++;
8229 }
8230 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
8231 {
8232 type = __extension__ ({
8233 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8234
8235 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
8236 });
8237 }
8238 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
8239 {
8240 type = source;
8241 source->refCount++;
8242 }
8243 else
8244 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
8245 }
8246 return type;
8247 }
8248
8249 static struct Type * Reference(struct Type * source)
8250 {
8251 struct Type * type = (((void *)0));
8252
8253 if(source)
8254 {
8255 type = __extension__ ({
8256 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8257
8258 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
8259 });
8260 source->refCount++;
8261 }
8262 return type;
8263 }
8264
8265 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
8266 {
8267 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
8268
8269 FreeExpContents(checkedExp);
8270 FreeType(checkedExp->expType);
8271 FreeType(checkedExp->destType);
8272 *checkedExp = *newExp;
8273 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
8274 checkedExp->prev = prev;
8275 checkedExp->next = next;
8276 }
8277
8278 void FinishTemplatesContext(struct Context * context)
8279 {
8280 PopContext(context);
8281 FreeContext(context);
8282 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
8283 }
8284
8285 static __attribute__((unused)) void UnusedFunction()
8286 {
8287 int a;
8288
8289 ((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);
8290 }
8291
8292 struct Expression * ParseExpressionString(char * expression)
8293 {
8294 parseError = 0;
8295 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8296 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8297 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8298
8299 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8300 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
8301 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8302 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8303
8304 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8305 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
8306 echoOn = 0;
8307 parsedExpression = (((void *)0));
8308 resetScanner();
8309 expression_yyparse();
8310 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
8311 return parsedExpression;
8312 }
8313
8314 struct __ecereNameSpace__ecere__com__Module
8315 {
8316 struct __ecereNameSpace__ecere__com__Instance * application;
8317 struct __ecereNameSpace__ecere__sys__OldList classes;
8318 struct __ecereNameSpace__ecere__sys__OldList defines;
8319 struct __ecereNameSpace__ecere__sys__OldList functions;
8320 struct __ecereNameSpace__ecere__sys__OldList modules;
8321 struct __ecereNameSpace__ecere__com__Instance * prev;
8322 struct __ecereNameSpace__ecere__com__Instance * next;
8323 const char *  name;
8324 void *  library;
8325 void *  Unload;
8326 int importType;
8327 int origImportType;
8328 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
8329 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
8330 } __attribute__ ((gcc_struct));
8331
8332 static struct GlobalData * FindGlobalData(char * name)
8333 {
8334 int start = 0, c;
8335 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
8336
8337 nameSpace = globalData;
8338 for(c = 0; name[c]; c++)
8339 {
8340 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
8341 {
8342 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
8343 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
8344
8345 strncpy(spaceName, name + start, c - start);
8346 spaceName[c - start] = '\0';
8347 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
8348 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
8349 if(!newSpace)
8350 return (((void *)0));
8351 nameSpace = newSpace;
8352 if(name[c] == ':')
8353 c++;
8354 start = c + 1;
8355 }
8356 }
8357 if(c - start)
8358 {
8359 return ScanGlobalData(nameSpace, name + start);
8360 }
8361 return (((void *)0));
8362 }
8363
8364 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
8365 {
8366 int c;
8367 char nameSpace[1024];
8368 const char * namePart;
8369 unsigned int gotColon = 0;
8370
8371 nameSpace[0] = '\0';
8372 for(c = strlen(name) - 1; c >= 0; c--)
8373 if(name[c] == ':')
8374 {
8375 gotColon = 1;
8376 break;
8377 }
8378 namePart = name + c + 1;
8379 while(c >= 0 && name[c] == ':')
8380 c--;
8381 if(c >= 0)
8382 {
8383 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
8384
8385 if(symbol)
8386 return symbol;
8387 memcpy(nameSpace, name, c + 1);
8388 nameSpace[c + 1] = (char)0;
8389 return ScanWithNameSpace(tree, nameSpace, namePart);
8390 }
8391 else if(gotColon)
8392 {
8393 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8394
8395 return symbol;
8396 }
8397 else
8398 {
8399 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8400
8401 if(symbol)
8402 return symbol;
8403 return ScanWithNameSpace(tree, "", namePart);
8404 }
8405 return (((void *)0));
8406 }
8407
8408 static void PrintArraySize(struct Type * arrayType, char * string)
8409 {
8410 char size[256];
8411
8412 size[0] = '\0';
8413 strcat(size, "[");
8414 if(arrayType->__anon1.__anon4.enumClass)
8415 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
8416 else if(arrayType->__anon1.__anon4.arraySizeExp)
8417 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
8418 strcat(size, "]");
8419 strcat(string, size);
8420 }
8421
8422 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
8423 {
8424
8425 }
8426
8427 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
8428 {
8429 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8430 strcat(string, ")");
8431 if(type->kind == 12)
8432 PrintArraySize(type, string);
8433 else if(type->kind == 11)
8434 {
8435 struct Type * param;
8436
8437 strcat(string, "(");
8438 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
8439 {
8440 PrintType(param, string, 1, fullName);
8441 if(param->next)
8442 strcat(string, ", ");
8443 }
8444 strcat(string, ")");
8445 }
8446 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8447 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
8448 }
8449
8450 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
8451 {
8452 PrePrintType(type, string, fullName, (((void *)0)), printConst);
8453 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
8454 strcat(string, " ");
8455 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
8456 {
8457 struct Symbol * _class = type->__anon1.__anon2.thisClass;
8458
8459 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
8460 {
8461 if(type->classObjectType == 1)
8462 strcat(string, "class");
8463 else
8464 strcat(string, type->byReference ? "typed_object&" : "typed_object");
8465 }
8466 else if(_class && _class->string)
8467 {
8468 char * s = _class->string;
8469
8470 if(fullName)
8471 strcat(string, s);
8472 else
8473 {
8474 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
8475
8476 if(name)
8477 name += 2;
8478 else
8479 name = s;
8480 strcat(string, name);
8481 }
8482 }
8483 strcat(string, "::");
8484 }
8485 if(printName && type->name)
8486 PrintName(type, string, fullName);
8487 PostPrintType(type, string, fullName);
8488 if(type->bitFieldCount)
8489 {
8490 char count[100];
8491
8492 sprintf(count, ":%d", type->bitFieldCount);
8493 strcat(string, count);
8494 }
8495 }
8496
8497 struct Conversion;
8498
8499 struct Conversion
8500 {
8501 struct Conversion * prev, * next;
8502 struct __ecereNameSpace__ecere__com__Property * convert;
8503 unsigned int isGet;
8504 struct Type * resultType;
8505 } __attribute__ ((gcc_struct));
8506
8507 static void FreeConvert(struct Conversion * convert)
8508 {
8509 if(convert->resultType)
8510 FreeType(convert->resultType);
8511 }
8512
8513 struct Enumerator;
8514
8515 struct Enumerator
8516 {
8517 struct Enumerator * prev;
8518 struct Enumerator * next;
8519 struct Location loc;
8520 struct Identifier * id;
8521 struct Expression * exp;
8522 } __attribute__ ((gcc_struct));
8523
8524 struct AsmField;
8525
8526 struct AsmField
8527 {
8528 struct AsmField * prev;
8529 struct AsmField * next;
8530 struct Location loc;
8531 char *  command;
8532 struct Expression * expression;
8533 struct Identifier * symbolic;
8534 } __attribute__ ((gcc_struct));
8535
8536 struct ClassDefinition;
8537
8538 struct Context
8539 {
8540 struct Context * parent;
8541 struct __ecereNameSpace__ecere__sys__BinaryTree types;
8542 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
8543 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
8544 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
8545 int nextID;
8546 int simpleID;
8547 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
8548 struct ClassDefinition * classDef;
8549 unsigned int templateTypesOnly;
8550 unsigned int hasNameSpace;
8551 } __attribute__ ((gcc_struct));
8552
8553 struct External
8554 {
8555 struct External * prev;
8556 struct External * next;
8557 struct Location loc;
8558 int type;
8559 struct Symbol * symbol;
8560 union
8561 {
8562 struct FunctionDefinition * function;
8563 struct ClassDefinition * _class;
8564 struct Declaration * declaration;
8565 char *  importString;
8566 struct Identifier * id;
8567 struct DBTableDef * table;
8568 } __attribute__ ((gcc_struct)) __anon1;
8569 int importType;
8570 struct External * fwdDecl;
8571 struct __ecereNameSpace__ecere__com__Instance * outgoing;
8572 struct __ecereNameSpace__ecere__com__Instance * incoming;
8573 int nonBreakableIncoming;
8574 } __attribute__ ((gcc_struct));
8575
8576 struct ClassDefinition
8577 {
8578 struct ClassDefinition * prev;
8579 struct ClassDefinition * next;
8580 struct Location loc;
8581 struct Specifier * _class;
8582 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
8583 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
8584 struct Symbol * symbol;
8585 struct Location blockStart;
8586 struct Location nameLoc;
8587 int declMode;
8588 unsigned int deleteWatchable;
8589 } __attribute__ ((gcc_struct));
8590
8591 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
8592
8593 void __ecereMethod_External_CreateEdge(struct External * this, struct External * from, unsigned int soft);
8594
8595 void DeclareGlobalData(struct External * neededFor, struct GlobalData * data)
8596 {
8597 struct Symbol * symbol = data->symbol;
8598
8599 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
8600 {
8601 if(inCompiler)
8602 {
8603 if(!symbol)
8604 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
8605 }
8606 if(!data->dataType)
8607 data->dataType = ProcessTypeString(data->dataTypeString, 0);
8608 if(inCompiler)
8609 {
8610 struct Declaration * decl;
8611 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
8612 struct Declarator * d;
8613 struct External * external;
8614
8615 specifiers = MkList();
8616 declarators = MkList();
8617 ListAdd(specifiers, MkSpecifier(EXTERN));
8618 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
8619 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
8620 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
8621 decl = MkDeclaration(specifiers, declarators);
8622 external = MkExternalDeclaration(decl);
8623 if(curExternal)
8624 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
8625 external->symbol = symbol;
8626 symbol->__anon2.__anon1.pointerExternal = external;
8627 DeclareType(external, data->dataType, 1, 1);
8628 }
8629 }
8630 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
8631 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, 0);
8632 }
8633
8634 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
8635 {
8636 struct Context * ctx;
8637 struct Symbol * symbol = (((void *)0));
8638
8639 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
8640 {
8641 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
8642 {
8643 symbol = (((void *)0));
8644 if(thisNameSpace)
8645 {
8646 char curName[1024];
8647
8648 strcpy(curName, thisNameSpace);
8649 strcat(curName, "::");
8650 strcat(curName, name);
8651 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
8652 }
8653 if(!symbol)
8654 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
8655 }
8656 else
8657 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
8658 if(symbol || ctx == endContext)
8659 break;
8660 }
8661 if(inCompiler && symbol && ctx == globalContext && symbol->__anon2.__anon1.pointerExternal && curExternal && symbol->__anon2.__anon1.pointerExternal != curExternal)
8662 __ecereMethod_External_CreateUniqueEdge(curExternal, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
8663 return symbol;
8664 }
8665
8666 struct PropertyDef;
8667
8668 struct ClassDef
8669 {
8670 struct ClassDef * prev;
8671 struct ClassDef * next;
8672 struct Location loc;
8673 int type;
8674 union
8675 {
8676 struct Declaration * decl;
8677 struct ClassFunction * function;
8678 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
8679 struct PropertyDef * propertyDef;
8680 struct PropertyWatch * propertyWatch;
8681 char *  designer;
8682 struct Identifier * defaultProperty;
8683 struct
8684 {
8685 struct Identifier * id;
8686 struct Initializer * initializer;
8687 } __attribute__ ((gcc_struct)) __anon1;
8688 } __attribute__ ((gcc_struct)) __anon1;
8689 int memberAccess;
8690 void *  object;
8691 } __attribute__ ((gcc_struct));
8692
8693 struct PropertyDef
8694 {
8695 struct PropertyDef * prev;
8696 struct PropertyDef * next;
8697 struct Location loc;
8698 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
8699 struct Declarator * declarator;
8700 struct Identifier * id;
8701 struct Statement * getStmt;
8702 struct Statement * setStmt;
8703 struct Statement * issetStmt;
8704 struct Symbol * symbol;
8705 struct Expression * category;
8706 struct
8707 {
8708 unsigned int conversion : 1;
8709 unsigned int isWatchable : 1;
8710 unsigned int isDBProp : 1;
8711 } __attribute__ ((gcc_struct)) __anon1;
8712 } __attribute__ ((gcc_struct));
8713
8714 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
8715 {
8716 struct ClassDef * def;
8717 int anonID = 1;
8718
8719 for(def = (*definitions).first; def; def = def->next)
8720 {
8721 if(def->type == 2)
8722 {
8723 struct Declaration * decl = def->__anon1.decl;
8724
8725 if(decl && decl->__anon1.__anon1.specifiers)
8726 {
8727 struct Specifier * spec;
8728 unsigned int isStruct = 0;
8729
8730 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
8731 {
8732 if(spec->type == 3 || spec->type == 4)
8733 {
8734 if(spec->__anon1.__anon2.definitions)
8735 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
8736 isStruct = 1;
8737 }
8738 }
8739 if(isStruct)
8740 {
8741 struct Declarator * d = (((void *)0));
8742
8743 if(decl->__anon1.__anon1.declarators)
8744 {
8745 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
8746 {
8747 struct Identifier * idDecl = GetDeclId(d);
8748
8749 if(idDecl)
8750 break;
8751 }
8752 }
8753 if(!d)
8754 {
8755 char id[100];
8756
8757 sprintf(id, "__anon%d", anonID++);
8758 if(!decl->__anon1.__anon1.declarators)
8759 decl->__anon1.__anon1.declarators = MkList();
8760 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
8761 }
8762 }
8763 }
8764 }
8765 }
8766 }
8767
8768 struct MemberInit;
8769
8770 typedef union YYSTYPE
8771 {
8772 int specifierType;
8773 int i;
8774 int declMode;
8775 struct Identifier * id;
8776 struct Expression * exp;
8777 struct Specifier * specifier;
8778 struct __ecereNameSpace__ecere__sys__OldList * list;
8779 struct Enumerator * enumerator;
8780 struct Declarator * declarator;
8781 struct Pointer * pointer;
8782 struct Initializer * initializer;
8783 struct InitDeclarator * initDeclarator;
8784 struct TypeName * typeName;
8785 struct Declaration * declaration;
8786 struct Statement * stmt;
8787 struct FunctionDefinition * function;
8788 struct External * external;
8789 struct Context * context;
8790 struct AsmField * asmField;
8791 struct Attrib * attrib;
8792 struct ExtDecl * extDecl;
8793 struct Attribute * attribute;
8794 struct Instantiation * instance;
8795 struct MembersInit * membersInit;
8796 struct MemberInit * memberInit;
8797 struct ClassFunction * classFunction;
8798 struct ClassDefinition * _class;
8799 struct ClassDef * classDef;
8800 struct PropertyDef * prop;
8801 char * string;
8802 struct Symbol * symbol;
8803 struct PropertyWatch * propertyWatch;
8804 struct TemplateParameter * templateParameter;
8805 struct TemplateArgument * templateArgument;
8806 struct TemplateDatatype * templateDatatype;
8807 struct DBTableEntry * dbtableEntry;
8808 struct DBIndexItem * dbindexItem;
8809 struct DBTableDef * dbtableDef;
8810 } __attribute__ ((gcc_struct)) YYSTYPE;
8811
8812 extern YYSTYPE yylval;
8813
8814 struct MemberInit
8815 {
8816 struct MemberInit * prev;
8817 struct MemberInit * next;
8818 struct Location loc;
8819 struct Location realLoc;
8820 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
8821 struct Initializer * initializer;
8822 unsigned int used;
8823 unsigned int variable;
8824 unsigned int takeOutExp;
8825 } __attribute__ ((gcc_struct));
8826
8827 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
8828
8829 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
8830
8831 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
8832 {
8833 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
8834 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
8835 const char *  name;
8836 int type;
8837 union
8838 {
8839 const char *  dataTypeString;
8840 int memberType;
8841 } __attribute__ ((gcc_struct)) __anon1;
8842 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
8843 void *  param;
8844 } __attribute__ ((gcc_struct));
8845
8846 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
8847 {
8848 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
8849 int id = 0;
8850 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
8851 struct __ecereNameSpace__ecere__com__Class * sClass;
8852
8853 for(sClass = _class; sClass; sClass = sClass->base)
8854 {
8855 id = 0;
8856 if(sClass->templateClass)
8857 sClass = sClass->templateClass;
8858 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
8859 {
8860 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
8861 {
8862 for(sClass = sClass->base; sClass; sClass = sClass->base)
8863 {
8864 if(sClass->templateClass)
8865 sClass = sClass->templateClass;
8866 id += sClass->templateParams.count;
8867 }
8868 break;
8869 }
8870 id++;
8871 }
8872 if(curParam)
8873 break;
8874 }
8875 if(curParam)
8876 {
8877 arg = &_class->templateArgs[id];
8878 if(arg && param->type == 0)
8879 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
8880 }
8881 return arg;
8882 }
8883
8884 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
8885 {
8886 struct Context * context = PushContext();
8887
8888 context->templateTypesOnly = 1;
8889 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
8890 {
8891 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
8892
8893 for(; param; param = param->next)
8894 {
8895 if(param->type == 0 && param->identifier)
8896 {
8897 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
8898
8899 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8900 }
8901 }
8902 }
8903 else if(_class)
8904 {
8905 struct __ecereNameSpace__ecere__com__Class * sClass;
8906
8907 for(sClass = _class; sClass; sClass = sClass->base)
8908 {
8909 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
8910
8911 for(p = sClass->templateParams.first; p; p = p->next)
8912 {
8913 if(p->type == 0)
8914 {
8915 struct TemplateParameter * param = p->param;
8916 struct TemplatedType * type;
8917
8918 if(!param)
8919 {
8920 p->param = param = __extension__ ({
8921 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
8922
8923 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
8924 });
8925 }
8926 type = __extension__ ({
8927 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
8928
8929 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
8930 });
8931 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8932 }
8933 }
8934 }
8935 }
8936 return context;
8937 }
8938
8939 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
8940 {
8941 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8942 {
8943 unsigned int first = 1;
8944 int p = 0;
8945 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8946 int lastParam = -1;
8947 char className[1024];
8948
8949 strcpy(className, _class->fullName);
8950 for(param = _class->templateParams.first; param; param = param->next)
8951 {
8952 {
8953 if(first)
8954 strcat(className, "<");
8955 if(!first)
8956 strcat(className, ", ");
8957 if(lastParam + 1 != p)
8958 {
8959 strcat(className, param->name);
8960 strcat(className, " = ");
8961 }
8962 strcat(className, param->name);
8963 first = 0;
8964 lastParam = p;
8965 }
8966 p++;
8967 }
8968 if(!first)
8969 {
8970 int len = strlen(className);
8971
8972 if(className[len - 1] == '>')
8973 className[len++] = ' ';
8974 className[len++] = '>';
8975 className[len++] = '\0';
8976 }
8977 return __ecereNameSpace__ecere__sys__CopyString(className);
8978 }
8979 else
8980 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
8981 }
8982
8983 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
8984 {
8985 struct Type * type;
8986
8987 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8988 {
8989 unsigned int first = 1;
8990 int p = 0;
8991 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8992 int lastParam = -1;
8993 char className[1024];
8994
8995 strcpy(className, _class->fullName);
8996 for(param = _class->templateParams.first; param; param = param->next)
8997 {
8998 {
8999 if(first)
9000 strcat(className, "<");
9001 if(!first)
9002 strcat(className, ", ");
9003 if(lastParam + 1 != p)
9004 {
9005 strcat(className, param->name);
9006 strcat(className, " = ");
9007 }
9008 strcat(className, param->name);
9009 first = 0;
9010 lastParam = p;
9011 }
9012 p++;
9013 }
9014 if(!first)
9015 {
9016 int len = strlen(className);
9017
9018 if(className[len - 1] == '>')
9019 className[len++] = ' ';
9020 className[len++] = '>';
9021 className[len++] = '\0';
9022 }
9023 type = MkClassType(className);
9024 }
9025 else
9026 {
9027 type = MkClassType(_class->fullName);
9028 }
9029 return type;
9030 }
9031
9032 static int DeclareMembers(struct External * neededBy, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9033 {
9034 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9035 struct __ecereNameSpace__ecere__com__DataMember * member;
9036 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9037
9038 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
9039 DeclareMembers(neededBy, _class->base, 0);
9040 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
9041 {
9042 if(!member->isProperty)
9043 {
9044 switch(member->type)
9045 {
9046 case 0:
9047 {
9048 if(!member->dataType && member->dataTypeString)
9049 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9050 if(member->dataType)
9051 DeclareType(neededBy, member->dataType, 1, 0);
9052 break;
9053 }
9054 case 1:
9055 case 2:
9056 {
9057 DeclareMembers(neededBy, (struct __ecereNameSpace__ecere__com__Class *)member, 1);
9058 break;
9059 }
9060 }
9061 }
9062 }
9063 if(context)
9064 FinishTemplatesContext(context);
9065 return topMember ? topMember->memberID : _class->memberID;
9066 }
9067
9068 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
9069 {
9070 if(!method->dataType)
9071 {
9072 struct Context * context = SetupTemplatesContext(method->_class);
9073
9074 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9075 FinishTemplatesContext(context);
9076 if(method->type != 1 && method->dataType)
9077 {
9078 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
9079 {
9080 if(!method->_class->symbol)
9081 method->_class->symbol = FindClass(method->_class->fullName);
9082 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
9083 }
9084 }
9085 }
9086 }
9087
9088 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
9089 {
9090 if(!prop->dataType)
9091 {
9092 struct Context * context = SetupTemplatesContext(prop->_class);
9093
9094 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
9095 FinishTemplatesContext(context);
9096 }
9097 }
9098
9099 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
9100 {
9101 if(specs != (((void *)0)) && _class)
9102 {
9103 struct Specifier * spec;
9104
9105 for(spec = specs->first; spec; spec = spec->next)
9106 {
9107 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
9108 {
9109 spec->type = 1;
9110 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
9111 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
9112 }
9113 }
9114 }
9115 }
9116
9117 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
9118 {
9119 struct Identifier * id = exp->__anon1.__anon1.identifier;
9120 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9121 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9122 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9123 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9124
9125 if(_class && _class->type == 4)
9126 {
9127 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
9128 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9129
9130 if(enumClass)
9131 {
9132 struct __ecereNameSpace__ecere__com__Class * baseClass;
9133
9134 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
9135 {
9136 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
9137
9138 for(value = e->values.first; value; value = value->next)
9139 {
9140 if(!strcmp(value->name, id->string))
9141 break;
9142 }
9143 if(value)
9144 {
9145 exp->isConstant = 1;
9146 if(inCompiler || inPreCompiler || inDebugger)
9147 {
9148 char constant[256];
9149
9150 FreeExpContents(exp);
9151 exp->type = 2;
9152 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
9153 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
9154 else
9155 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
9156 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9157 }
9158 exp->expType = MkClassType(baseClass->fullName);
9159 break;
9160 }
9161 }
9162 }
9163 if(value)
9164 return 1;
9165 }
9166 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
9167 {
9168 ProcessMethodType(method);
9169 exp->expType = __extension__ ({
9170 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
9171
9172 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
9173 });
9174 return 1;
9175 }
9176 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
9177 {
9178 if(!prop->dataType)
9179 ProcessPropertyType(prop);
9180 exp->expType = prop->dataType;
9181 if(prop->dataType)
9182 prop->dataType->refCount++;
9183 return 1;
9184 }
9185 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
9186 {
9187 if(!member->dataType)
9188 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9189 exp->expType = member->dataType;
9190 if(member->dataType)
9191 member->dataType->refCount++;
9192 return 1;
9193 }
9194 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
9195 {
9196 if(!classProp->dataType)
9197 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
9198 if(classProp->constant)
9199 {
9200 FreeExpContents(exp);
9201 exp->isConstant = 1;
9202 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
9203 {
9204 exp->type = 3;
9205 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
9206 }
9207 else
9208 {
9209 char constant[256];
9210
9211 exp->type = 2;
9212 sprintf(constant, "%d", (int)classProp->Get(_class));
9213 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9214 }
9215 }
9216 else
9217 {
9218 }
9219 exp->expType = classProp->dataType;
9220 if(classProp->dataType)
9221 classProp->dataType->refCount++;
9222 return 1;
9223 }
9224 return 0;
9225 }
9226
9227 void DeclareProperty(struct External * neededBy, struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
9228 {
9229 struct Symbol * symbol = prop->symbol;
9230 unsigned int imported = 0;
9231 unsigned int dllImport = 0;
9232 struct External * structExternal = (((void *)0));
9233 struct External * instExternal = (((void *)0));
9234
9235 strcpy(setName, "__ecereProp_");
9236 FullClassNameCat(setName, prop->_class->fullName, 0);
9237 strcat(setName, "_Set_");
9238 FullClassNameCat(setName, prop->name, 1);
9239 strcpy(getName, "__ecereProp_");
9240 FullClassNameCat(getName, prop->_class->fullName, 0);
9241 strcat(getName, "_Get_");
9242 FullClassNameCat(getName, prop->name, 1);
9243 if(!symbol || symbol->_import)
9244 {
9245 if(!symbol)
9246 {
9247 struct Symbol * classSym;
9248
9249 if(!prop->_class->symbol)
9250 prop->_class->symbol = FindClass(prop->_class->fullName);
9251 classSym = prop->_class->symbol;
9252 if(classSym && !classSym->_import)
9253 {
9254 struct ModuleImport * module;
9255
9256 if(prop->_class->module)
9257 module = FindModule(prop->_class->module);
9258 else
9259 module = mainModule;
9260 classSym->_import = __extension__ ({
9261 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9262
9263 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
9264 });
9265 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9266 }
9267 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9268 symbol->_import = (struct ClassImport *)__extension__ ({
9269 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
9270
9271 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
9272 });
9273 if(classSym)
9274 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
9275 }
9276 imported = 1;
9277 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)
9278 dllImport = 1;
9279 }
9280 if(!symbol->type)
9281 {
9282 struct Context * context = SetupTemplatesContext(prop->_class);
9283
9284 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
9285 FinishTemplatesContext(context);
9286 }
9287 if((prop->Get && !symbol->__anon2.__anon2.externalGet) || (prop->Set && !symbol->__anon2.__anon2.externalSet))
9288 {
9289 if(prop->_class->type == 0 && prop->_class->structSize)
9290 instExternal = DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
9291 structExternal = DeclareStruct((((void *)0)), prop->_class->fullName, prop->_class->type != 1, 0);
9292 }
9293 if(prop->Get && !symbol->__anon2.__anon2.externalGet)
9294 {
9295 struct Declaration * decl;
9296 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9297 struct Declarator * d;
9298 struct __ecereNameSpace__ecere__sys__OldList * params;
9299 struct Specifier * spec = (((void *)0));
9300 struct External * external;
9301 struct Declarator * typeDecl;
9302 unsigned int simple = 0;
9303 unsigned int needReference;
9304
9305 specifiers = MkList();
9306 declarators = MkList();
9307 params = MkList();
9308 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9309 d = MkDeclaratorIdentifier(MkIdentifier(getName));
9310 if(dllImport)
9311 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9312 {
9313 struct Context * context = SetupTemplatesContext(prop->_class);
9314
9315 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
9316 FinishTemplatesContext(context);
9317 }
9318 needReference = !typeDecl || typeDecl->type == 1;
9319 for(spec = (*specifiers).first; spec; spec = spec->next)
9320 {
9321 if(spec->type == 1)
9322 {
9323 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9324
9325 if(needReference)
9326 {
9327 symbol->_class = classSym->__anon1.registered;
9328 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
9329 simple = 1;
9330 }
9331 break;
9332 }
9333 }
9334 if(!simple)
9335 d = PlugDeclarator(typeDecl, d);
9336 else
9337 {
9338 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
9339 specifiers = MkList();
9340 }
9341 d = MkDeclaratorFunction(d, params);
9342 if(dllImport)
9343 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9344 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9345 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9346 if(simple)
9347 ListAdd(specifiers, MkSpecifier(VOID));
9348 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9349 decl = MkDeclaration(specifiers, declarators);
9350 external = MkExternalDeclaration(decl);
9351 if(structExternal)
9352 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9353 if(instExternal)
9354 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9355 if(spec)
9356 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9357 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9358 external->symbol = symbol;
9359 symbol->__anon2.__anon2.externalGet = external;
9360 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9361 if(typeDecl)
9362 FreeDeclarator(typeDecl);
9363 }
9364 if(prop->Set && !symbol->__anon2.__anon2.externalSet)
9365 {
9366 struct Declaration * decl;
9367 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9368 struct Declarator * d;
9369 struct __ecereNameSpace__ecere__sys__OldList * params;
9370 struct Specifier * spec = (((void *)0));
9371 struct External * external;
9372 struct Declarator * typeDecl;
9373 unsigned int needReference;
9374
9375 declarators = MkList();
9376 params = MkList();
9377 if(!prop->conversion || prop->_class->type == 1)
9378 {
9379 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9380 }
9381 specifiers = MkList();
9382 {
9383 struct Context * context = SetupTemplatesContext(prop->_class);
9384
9385 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
9386 FinishTemplatesContext(context);
9387 }
9388 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
9389 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
9390 ListAdd(params, MkTypeName(specifiers, d));
9391 d = MkDeclaratorIdentifier(MkIdentifier(setName));
9392 if(dllImport)
9393 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9394 d = MkDeclaratorFunction(d, params);
9395 needReference = !typeDecl || typeDecl->type == 1;
9396 for(spec = (*specifiers).first; spec; spec = spec->next)
9397 {
9398 if(spec->type == 1)
9399 {
9400 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9401
9402 if(needReference)
9403 symbol->_class = classSym->__anon1.registered;
9404 break;
9405 }
9406 }
9407 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9408 specifiers = MkList();
9409 if(dllImport)
9410 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9411 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9412 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9413 if(!prop->conversion || prop->_class->type == 1)
9414 ListAdd(specifiers, MkSpecifier(VOID));
9415 else
9416 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
9417 decl = MkDeclaration(specifiers, declarators);
9418 external = MkExternalDeclaration(decl);
9419 if(structExternal)
9420 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9421 if(instExternal)
9422 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9423 if(spec)
9424 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9425 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9426 external->symbol = symbol;
9427 symbol->__anon2.__anon2.externalSet = external;
9428 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9429 }
9430 if(!symbol->__anon2.__anon2.externalPtr)
9431 {
9432 struct Declaration * decl;
9433 struct External * external;
9434 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
9435 char propName[1024];
9436
9437 if(imported)
9438 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9439 else
9440 {
9441 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
9443 }
9444 ListAdd(specifiers, MkSpecifierName("Property"));
9445 strcpy(propName, "__ecereProp_");
9446 FullClassNameCat(propName, prop->_class->fullName, 0);
9447 strcat(propName, "_");
9448 FullClassNameCat(propName, prop->name, 1);
9449 {
9450 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
9451
9452 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9453 if(!imported)
9454 {
9455 strcpy(propName, "__ecerePropM_");
9456 FullClassNameCat(propName, prop->_class->fullName, 0);
9457 strcat(propName, "_");
9458 FullClassNameCat(propName, prop->name, 1);
9459 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9460 }
9461 decl = MkDeclaration(specifiers, list);
9462 }
9463 external = MkExternalDeclaration(decl);
9464 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
9465 external->symbol = symbol;
9466 symbol->__anon2.__anon2.externalPtr = external;
9467 }
9468 if(inCompiler && neededBy)
9469 {
9470 if(symbol->__anon2.__anon2.externalPtr)
9471 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalPtr, 0);
9472 if(symbol->__anon2.__anon2.externalGet)
9473 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalGet, symbol->__anon2.__anon2.externalGet->type == 0);
9474 if(symbol->__anon2.__anon2.externalSet)
9475 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalSet, symbol->__anon2.__anon2.externalSet->type == 0);
9476 }
9477 }
9478
9479 static void ProcessDeclarator(struct Declarator *  decl, unsigned int isFunction);
9480
9481 void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char * name)
9482 {
9483 struct Symbol * symbol = method->symbol;
9484
9485 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && (!symbol->__anon2.__anon3.methodCodeExternal || method->type == 1)))
9486 {
9487 unsigned int dllImport = 0;
9488
9489 if(!method->dataType)
9490 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9491 {
9492 if(!symbol || method->type == 1)
9493 {
9494 struct Symbol * classSym;
9495
9496 if(!method->_class->symbol)
9497 method->_class->symbol = FindClass(method->_class->fullName);
9498 classSym = method->_class->symbol;
9499 if(!classSym->_import)
9500 {
9501 struct ModuleImport * module;
9502
9503 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->name)
9504 module = FindModule(method->_class->module);
9505 else
9506 module = mainModule;
9507 classSym->_import = __extension__ ({
9508 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9509
9510 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
9511 });
9512 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9513 }
9514 if(!symbol)
9515 {
9516 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9517 }
9518 if(!symbol->_import)
9519 {
9520 symbol->_import = (struct ClassImport *)__extension__ ({
9521 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
9522
9523 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
9524 });
9525 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
9526 }
9527 if(!symbol)
9528 {
9529 symbol->type = method->dataType;
9530 if(symbol->type)
9531 symbol->type->refCount++;
9532 }
9533 }
9534 if(!method->dataType->dllExport)
9535 {
9536 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)
9537 dllImport = 1;
9538 }
9539 }
9540 if(inCompiler)
9541 {
9542 struct Declaration * decl;
9543 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9544 struct Declarator * d;
9545 struct Declarator * funcDecl;
9546 struct External * external;
9547
9548 specifiers = MkList();
9549 declarators = MkList();
9550 if(dllImport)
9551 ListAdd(specifiers, MkSpecifier(EXTERN));
9552 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
9553 ListAdd(specifiers, MkSpecifier(STATIC));
9554 if(method->type == 1)
9555 {
9556 ListAdd(specifiers, MkSpecifier(INT));
9557 d = MkDeclaratorIdentifier(MkIdentifier(name));
9558 }
9559 else
9560 {
9561 d = MkDeclaratorIdentifier(MkIdentifier(name));
9562 if(dllImport)
9563 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9564 {
9565 struct Context * context = SetupTemplatesContext(method->_class);
9566
9567 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
9568 FinishTemplatesContext(context);
9569 }
9570 funcDecl = GetFuncDecl(d);
9571 if(dllImport)
9572 {
9573 struct Specifier * spec, * next;
9574
9575 for(spec = (*specifiers).first; spec; spec = next)
9576 {
9577 next = spec->next;
9578 if(spec->type == 5)
9579 {
9580 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9581 FreeSpecifier(spec);
9582 }
9583 }
9584 }
9585 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
9586 {
9587 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
9588 {
9589 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
9590 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")));
9591 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
9592 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
9593
9594 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
9595 {
9596 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
9597
9598 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
9599 FreeTypeName(param);
9600 }
9601 if(!funcDecl->__anon1.function.parameters)
9602 funcDecl->__anon1.function.parameters = MkList();
9603 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
9604 }
9605 }
9606 }
9607 ProcessDeclarator(d, 1);
9608 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9609 decl = MkDeclaration(specifiers, declarators);
9610 ReplaceThisClassSpecifiers(specifiers, method->_class);
9611 external = MkExternalDeclaration(decl);
9612 external->symbol = symbol;
9613 symbol->__anon2.__anon1.pointerExternal = external;
9614 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9615 DeclareStruct(external, method->_class->fullName, 1, 1);
9616 if(method->dataType)
9617 DeclareType(external, method->dataType, 1, 1);
9618 }
9619 }
9620 if(inCompiler && neededFor)
9621 {
9622 struct External * external = symbol->__anon2.__anon1.pointerExternal ? symbol->__anon2.__anon1.pointerExternal : symbol->__anon2.__anon3.methodCodeExternal;
9623
9624 __ecereMethod_External_CreateUniqueEdge(neededFor, external, external->type == 0);
9625 }
9626 }
9627
9628 struct __ecereNameSpace__ecere__com__GlobalFunction;
9629
9630 struct __ecereNameSpace__ecere__com__GlobalFunction
9631 {
9632 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
9633 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
9634 const char *  name;
9635 int (*  function)();
9636 struct __ecereNameSpace__ecere__com__Instance * module;
9637 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
9638 const char *  dataTypeString;
9639 struct Type * dataType;
9640 void *  symbol;
9641 } __attribute__ ((gcc_struct));
9642
9643 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
9644
9645 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);
9646
9647 unsigned int DeclareFunction(struct External * neededFor, struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
9648 {
9649 struct Symbol * symbol = function->symbol;
9650
9651 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
9652 {
9653 unsigned int imported = 0;
9654 unsigned int dllImport = 0;
9655
9656 if(!function->dataType)
9657 {
9658 function->dataType = ProcessTypeString(function->dataTypeString, 0);
9659 if(!function->dataType->__anon1.__anon2.thisClass)
9660 function->dataType->__anon1.__anon2.staticMethod = 1;
9661 }
9662 if(inCompiler)
9663 {
9664 if(!symbol)
9665 {
9666 struct ModuleImport * module = FindModule(function->module);
9667
9668 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9669 if(module->name)
9670 {
9671 if(!function->dataType->dllExport)
9672 {
9673 symbol->_import = (struct ClassImport *)__extension__ ({
9674 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
9675
9676 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
9677 });
9678 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
9679 }
9680 }
9681 {
9682 symbol->type = ProcessTypeString(function->dataTypeString, 0);
9683 if(!symbol->type->__anon1.__anon2.thisClass)
9684 symbol->type->__anon1.__anon2.staticMethod = 1;
9685 }
9686 }
9687 imported = symbol->_import ? 1 : 0;
9688 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9689 dllImport = 1;
9690 }
9691 if(inCompiler)
9692 {
9693 {
9694 struct Declaration * decl;
9695 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9696 struct Declarator * d;
9697 struct Declarator * funcDecl;
9698 struct External * external;
9699
9700 specifiers = MkList();
9701 declarators = MkList();
9702 ListAdd(specifiers, MkSpecifier(EXTERN));
9703 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
9704 if(dllImport)
9705 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9706 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
9707 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType == 1)
9708 {
9709 struct Specifier * spec;
9710
9711 for(spec = (*specifiers).first; spec; spec = spec->next)
9712 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
9713 {
9714 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9715 FreeSpecifier(spec);
9716 break;
9717 }
9718 }
9719 funcDecl = GetFuncDecl(d);
9720 if(funcDecl && !funcDecl->__anon1.function.parameters)
9721 {
9722 funcDecl->__anon1.function.parameters = MkList();
9723 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
9724 }
9725 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9726 {
9727 struct Context * oldCtx = curContext;
9728
9729 curContext = globalContext;
9730 decl = MkDeclaration(specifiers, declarators);
9731 curContext = oldCtx;
9732 }
9733 external = MkExternalDeclaration(decl);
9734 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9735 external->symbol = symbol;
9736 symbol->__anon2.__anon1.pointerExternal = external;
9737 DeclareType(external, function->dataType, 1, 1);
9738 }
9739 }
9740 }
9741 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
9742 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
9743 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;
9744 }
9745
9746 void DeclareFunctionUtil(struct External * neededBy, const char * s)
9747 {
9748 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
9749
9750 if(function)
9751 {
9752 char name[1024];
9753
9754 name[0] = (char)0;
9755 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
9756 strcpy(name, "__ecereFunction_");
9757 FullClassNameCat(name, s, 0);
9758 DeclareFunction(neededBy, function, name);
9759 }
9760 else if(neededBy)
9761 FindSymbol(s, globalContext, globalContext, 0, 0);
9762 }
9763
9764 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
9765 {
9766 char propName[1024], propNameM[1024];
9767 char getName[1024], setName[1024];
9768 struct __ecereNameSpace__ecere__sys__OldList * args;
9769
9770 DeclareProperty(curExternal, prop, setName, getName);
9771 strcpy(propName, "__ecereProp_");
9772 FullClassNameCat(propName, prop->_class->fullName, 0);
9773 strcat(propName, "_");
9774 FullClassNameCat(propName, prop->name, 1);
9775 strcpy(propNameM, "__ecerePropM_");
9776 FullClassNameCat(propNameM, prop->_class->fullName, 0);
9777 strcat(propNameM, "_");
9778 FullClassNameCat(propNameM, prop->name, 1);
9779 if(prop->isWatchable)
9780 {
9781 args = MkList();
9782 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9783 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9784 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9785 args = MkList();
9786 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9787 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9788 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9789 DeclareFunctionUtil(curExternal, "eInstance_FireWatchers");
9790 }
9791 {
9792 args = MkList();
9793 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9794 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9795 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9796 args = MkList();
9797 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9798 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9799 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9800 DeclareFunctionUtil(curExternal, "eInstance_FireSelfWatchers");
9801 }
9802 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
9803 curFunction->propSet->fireWatchersDone = 1;
9804 }
9805
9806 struct __ecereNameSpace__ecere__com__SubModule;
9807
9808 struct __ecereNameSpace__ecere__com__SubModule
9809 {
9810 struct __ecereNameSpace__ecere__com__SubModule * prev;
9811 struct __ecereNameSpace__ecere__com__SubModule * next;
9812 struct __ecereNameSpace__ecere__com__Instance * module;
9813 int importMode;
9814 } __attribute__ ((gcc_struct));
9815
9816 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
9817 {
9818 struct __ecereNameSpace__ecere__com__SubModule * subModule;
9819
9820 if(searchFor == searchIn)
9821 return 1;
9822 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
9823 {
9824 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
9825 {
9826 if(ModuleVisibility(subModule->module, searchFor))
9827 return 1;
9828 }
9829 }
9830 return 0;
9831 }
9832
9833 void ProcessExpressionType(struct Expression *  exp);
9834
9835 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
9836 {
9837 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
9838 {
9839 struct Identifier * id = exp->__anon1.__anon1.identifier;
9840 struct Context * ctx;
9841 struct Symbol * symbol = (((void *)0));
9842
9843 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
9844 {
9845 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
9846 {
9847 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
9848 if(symbol)
9849 break;
9850 }
9851 }
9852 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))))
9853 {
9854 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
9855 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9856 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9857 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9858
9859 if(!prop)
9860 {
9861 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
9862 }
9863 if(!prop && !method)
9864 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
9865 if(!prop && !method && !member)
9866 {
9867 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
9868 }
9869 if(prop || method || member || classProp)
9870 {
9871 exp->type = 8;
9872 exp->__anon1.member.member = id;
9873 exp->__anon1.member.memberType = 0;
9874 exp->__anon1.member.exp = QMkExpId("this");
9875 exp->addedThis = 1;
9876 }
9877 else if(_class && _class->templateParams.first)
9878 {
9879 struct __ecereNameSpace__ecere__com__Class * sClass;
9880
9881 for(sClass = _class; sClass; sClass = sClass->base)
9882 {
9883 if(sClass->templateParams.first)
9884 {
9885 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9886
9887 for(param = sClass->templateParams.first; param; param = param->next)
9888 {
9889 if(param->type == 2 && !strcmp(param->name, id->string))
9890 {
9891 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
9892
9893 if(argExp)
9894 {
9895 struct Declarator * decl;
9896 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
9897
9898 FreeIdentifier(exp->__anon1.member.member);
9899 ProcessExpressionType(argExp);
9900 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
9901 exp->expType = ProcessType(specs, decl);
9902 exp->type = 5;
9903 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
9904 }
9905 }
9906 }
9907 }
9908 }
9909 }
9910 }
9911 }
9912 }
9913
9914 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9915 {
9916 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9917
9918 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9919 {
9920 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9921 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9922 else
9923 {
9924 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9925 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9926 struct Type * type;
9927 void * ptr = inst->data + dataMember->offset + offset;
9928 char * result = (((void *)0));
9929
9930 exp->loc = member->loc = inst->loc;
9931 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9932 if(!dataMember->dataType)
9933 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
9934 type = dataMember->dataType;
9935 if(type->kind == 8)
9936 {
9937 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
9938
9939 if(_class->type == 4)
9940 {
9941 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9942
9943 if(enumClass)
9944 {
9945 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9946 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
9947
9948 for(item = e->values.first; item; item = item->next)
9949 {
9950 if(item->data == GetEnumValue(_class, ptr))
9951 {
9952 result = item->name;
9953 break;
9954 }
9955 }
9956 if(result)
9957 {
9958 exp->__anon1.__anon1.identifier = MkIdentifier(result);
9959 exp->type = 0;
9960 exp->destType = MkClassType(_class->fullName);
9961 ProcessExpressionType(exp);
9962 }
9963 }
9964 }
9965 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9966 {
9967 if(!_class->dataType)
9968 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
9969 type = _class->dataType;
9970 }
9971 }
9972 if(!result)
9973 {
9974 switch(type->kind)
9975 {
9976 case 6:
9977 {
9978 FreeExpContents(exp);
9979 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
9980 exp->type = 2;
9981 break;
9982 }
9983 case 7:
9984 {
9985 FreeExpContents(exp);
9986 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
9987 exp->type = 2;
9988 break;
9989 }
9990 case 3:
9991 {
9992 FreeExpContents(exp);
9993 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
9994 exp->type = 2;
9995 break;
9996 }
9997 case 4:
9998 {
9999 FreeExpContents(exp);
10000 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10001 exp->type = 2;
10002 break;
10003 }
10004 case 22:
10005 {
10006 FreeExpContents(exp);
10007 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10008 exp->type = 2;
10009 break;
10010 }
10011 case 23:
10012 {
10013 FreeExpContents(exp);
10014 exp->__anon1.__anon1.constant = PrintInt64((long long)*(ssize_t *)ptr);
10015 exp->type = 2;
10016 break;
10017 }
10018 default:
10019 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10020 }
10021 }
10022 ListAdd(memberList, member);
10023 }
10024 if(parentDataMember->type == 1)
10025 break;
10026 }
10027 }
10028
10029 void CheckTemplateTypes(struct Expression * exp)
10030 {
10031 struct Expression * nbExp = GetNonBracketsExp(exp);
10032
10033 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
10034 {
10035 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10036 struct Context * context;
10037 int kind = exp->expType->kind;
10038
10039 *newExp = *exp;
10040 if(exp->destType)
10041 exp->destType->refCount++;
10042 if(exp->expType)
10043 exp->expType->refCount++;
10044 newExp->prev = (((void *)0));
10045 newExp->next = (((void *)0));
10046 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10047 {
10048 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10049
10050 if(c->type == 2 || c->type == 4 || c->type == 3)
10051 {
10052 if(!c->dataType)
10053 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10054 kind = c->dataType->kind;
10055 }
10056 }
10057 switch(kind)
10058 {
10059 case 7:
10060 if(exp->destType->classObjectType)
10061 {
10062 if(exp->destType)
10063 exp->destType->refCount--;
10064 if(exp->expType)
10065 exp->expType->refCount--;
10066 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10067 }
10068 else
10069 {
10070 struct __ecereNameSpace__ecere__sys__OldList * specs;
10071 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10072 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10073
10074 context = PushContext();
10075 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10076 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10077 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10078 exp->type = 23;
10079 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10080 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10081 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10082 exp->__anon1.compound->__anon1.compound.context = context;
10083 PopContext(context);
10084 }
10085 break;
10086 default:
10087 exp->type = 11;
10088 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10089 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))
10090 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
10091 else
10092 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10093 exp->needCast = 1;
10094 break;
10095 }
10096 }
10097 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10098 {
10099 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10100 struct Context * context;
10101 int kind = exp->expType->kind;
10102
10103 *newExp = *exp;
10104 if(exp->destType)
10105 exp->destType->refCount++;
10106 if(exp->expType)
10107 exp->expType->refCount++;
10108 newExp->prev = (((void *)0));
10109 newExp->next = (((void *)0));
10110 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10111 {
10112 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10113
10114 if(c->type == 2 || c->type == 4 || c->type == 3)
10115 {
10116 if(!c->dataType)
10117 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10118 kind = c->dataType->kind;
10119 }
10120 }
10121 switch(kind)
10122 {
10123 case 7:
10124 if(exp->destType->classObjectType)
10125 {
10126 if(exp->destType)
10127 exp->destType->refCount--;
10128 if(exp->expType)
10129 exp->expType->refCount--;
10130 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10131 }
10132 else
10133 {
10134 struct __ecereNameSpace__ecere__sys__OldList * specs;
10135 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10136 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10137
10138 context = PushContext();
10139 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10140 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10141 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10142 exp->type = 23;
10143 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10144 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10145 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10146 exp->__anon1.compound->__anon1.compound.context = context;
10147 PopContext(context);
10148 }
10149 break;
10150 case 8:
10151 {
10152 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
10153 {
10154 exp->type = 5;
10155 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10156 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)));
10157 ProcessExpressionType((*exp->__anon1.list).first);
10158 break;
10159 }
10160 else
10161 {
10162 exp->type = 5;
10163 if(__ecereProp_Type_Get_isPointerType(exp->expType))
10164 {
10165 exp->needTemplateCast = 2;
10166 newExp->needCast = 1;
10167 newExp->needTemplateCast = 2;
10168 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10169 }
10170 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
10171 exp->needTemplateCast = 2;
10172 newExp->needCast = 1;
10173 newExp->needTemplateCast = 2;
10174 ProcessExpressionType((*exp->__anon1.list).first);
10175 break;
10176 }
10177 }
10178 default:
10179 {
10180 if(exp->expType->kind == 20)
10181 {
10182 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
10183
10184 if(type)
10185 {
10186 FreeType(exp->destType);
10187 FreeType(exp->expType);
10188 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10189 break;
10190 }
10191 }
10192 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
10193 {
10194 exp->type = 4;
10195 exp->__anon1.op.op = '*';
10196 exp->__anon1.op.exp1 = (((void *)0));
10197 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
10198 }
10199 else
10200 {
10201 char typeString[1024];
10202 struct Declarator * decl;
10203 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10204
10205 typeString[0] = '\0';
10206 PrintType(exp->expType, typeString, 0, 0);
10207 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10208 exp->type = 11;
10209 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
10210 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10211 exp->__anon1.cast.exp->needCast = 1;
10212 }
10213 break;
10214 }
10215 }
10216 }
10217 }
10218
10219 static void ProcessInitializer(struct Initializer * init, struct Type * type)
10220 {
10221 switch(init->type)
10222 {
10223 case 0:
10224 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
10225 {
10226 if(init->__anon1.exp && !init->__anon1.exp->destType)
10227 {
10228 FreeType(init->__anon1.exp->destType);
10229 init->__anon1.exp->destType = type;
10230 if(type)
10231 type->refCount++;
10232 }
10233 if(init->__anon1.exp)
10234 {
10235 ProcessExpressionType(init->__anon1.exp);
10236 init->isConstant = init->__anon1.exp->isConstant;
10237 }
10238 break;
10239 }
10240 else
10241 {
10242 struct Expression * exp = init->__anon1.exp;
10243 struct Instantiation * inst = exp->__anon1.instance;
10244 struct MembersInit * members;
10245
10246 init->type = 1;
10247 init->__anon1.list = MkList();
10248 if(inst->members)
10249 {
10250 for(members = (*inst->members).first; members; members = members->next)
10251 {
10252 if(members->type == 0)
10253 {
10254 struct MemberInit * member;
10255
10256 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
10257 {
10258 ListAdd(init->__anon1.list, member->initializer);
10259 member->initializer = (((void *)0));
10260 }
10261 }
10262 }
10263 }
10264 FreeExpression(exp);
10265 }
10266 case 1:
10267 {
10268 struct Initializer * i;
10269 struct Type * initializerType = (((void *)0));
10270 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10271 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10272 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10273 int subMemberStackPos = 0;
10274
10275 if(type && type->kind == 12)
10276 initializerType = Dereference(type);
10277 else if(type && (type->kind == 9 || type->kind == 10))
10278 initializerType = type->__anon1.__anon1.members.first;
10279 for(i = (*init->__anon1.list).first; i; i = i->next)
10280 {
10281 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
10282 {
10283 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10284 if(curMember)
10285 {
10286 if(!curMember->dataType)
10287 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
10288 initializerType = curMember->dataType;
10289 }
10290 }
10291 ProcessInitializer(i, initializerType);
10292 if(initializerType && type && (type->kind == 9 || type->kind == 10))
10293 initializerType = initializerType->next;
10294 if(!i->isConstant)
10295 init->isConstant = 0;
10296 }
10297 if(type && type->kind == 12)
10298 FreeType(initializerType);
10299 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))
10300 {
10301 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
10302 }
10303 break;
10304 }
10305 }
10306 }
10307
10308 void PopulateInstance(struct Instantiation * inst)
10309 {
10310 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
10311 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
10312 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10313 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10314
10315 if(!inst->members)
10316 inst->members = MkListOne(MkMembersInitList(memberList));
10317 else
10318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10319 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10320 {
10321 if(!dataMember->isProperty)
10322 {
10323 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10324 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10325 else
10326 {
10327 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10328 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10329 struct Type * type;
10330 void * ptr = inst->data + dataMember->offset;
10331 char * result = (((void *)0));
10332
10333 exp->loc = member->loc = inst->loc;
10334 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10335 if(!dataMember->dataType)
10336 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10337 type = dataMember->dataType;
10338 if(type->kind == 8)
10339 {
10340 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
10341
10342 if(_class->type == 4)
10343 {
10344 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10345
10346 if(enumClass)
10347 {
10348 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10349 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
10350
10351 for(item = e->values.first; item; item = item->next)
10352 {
10353 if(item->data == GetEnumValue(_class, ptr))
10354 {
10355 result = item->name;
10356 break;
10357 }
10358 }
10359 }
10360 if(result)
10361 {
10362 exp->__anon1.__anon1.identifier = MkIdentifier(result);
10363 exp->type = 0;
10364 exp->destType = MkClassType(_class->fullName);
10365 ProcessExpressionType(exp);
10366 }
10367 }
10368 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10369 {
10370 if(!_class->dataType)
10371 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
10372 type = _class->dataType;
10373 }
10374 }
10375 if(!result)
10376 {
10377 switch(type->kind)
10378 {
10379 case 6:
10380 {
10381 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10382 exp->type = 2;
10383 break;
10384 }
10385 case 7:
10386 {
10387 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10388 exp->type = 2;
10389 break;
10390 }
10391 case 3:
10392 {
10393 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10394 exp->type = 2;
10395 break;
10396 }
10397 case 4:
10398 {
10399 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10400 exp->type = 2;
10401 break;
10402 }
10403 case 22:
10404 {
10405 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10406 exp->type = 2;
10407 break;
10408 }
10409 default:
10410 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10411 }
10412 }
10413 ListAdd(memberList, member);
10414 }
10415 }
10416 }
10417 }
10418
10419 int ComputeTypeSize(struct Type *  type);
10420
10421 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
10422 {
10423 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10424 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10425
10426 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))
10427 {
10428 int unionMemberOffset = 0;
10429 int bitFields = 0;
10430
10431 if(member)
10432 {
10433 member->memberOffset = 0;
10434 if(targetBits < sizeof(void *) * 8)
10435 member->structAlignment = (short)0;
10436 }
10437 else if(targetBits < sizeof(void *) * 8)
10438 _class->structAlignment = (short)0;
10439 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
10440 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
10441 if(!member && _class->destructionWatchOffset)
10442 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10443 {
10444 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10445
10446 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10447 {
10448 if(!dataMember->isProperty)
10449 {
10450 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
10451 {
10452 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10453 }
10454 }
10455 }
10456 }
10457 {
10458 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10459
10460 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10461 {
10462 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
10463 {
10464 if(!isMember && _class->type == 2 && dataMember->dataType)
10465 {
10466 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10467 uint64 mask = 0;
10468 int d;
10469
10470 ComputeTypeSize(dataMember->dataType);
10471 if(bitMember->pos == -1)
10472 bitMember->pos = _class->memberOffset;
10473 if(!bitMember->size)
10474 bitMember->size = dataMember->dataType->size * 8;
10475 _class->memberOffset = bitMember->pos + bitMember->size;
10476 for(d = 0; d < bitMember->size; d++)
10477 {
10478 if(d)
10479 mask <<= 1;
10480 mask |= 1;
10481 }
10482 bitMember->mask = mask << bitMember->pos;
10483 }
10484 else if(dataMember->type == 0 && dataMember->dataType)
10485 {
10486 int size;
10487 int alignment = 0;
10488
10489 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)))
10490 ComputeTypeSize(dataMember->dataType);
10491 if(dataMember->dataType->bitFieldCount)
10492 {
10493 bitFields += dataMember->dataType->bitFieldCount;
10494 size = 0;
10495 }
10496 else
10497 {
10498 if(bitFields)
10499 {
10500 int size = (bitFields + 7) / 8;
10501
10502 if(isMember)
10503 {
10504 int __simpleStruct0;
10505
10506 if(alignment)
10507 {
10508 short __simpleStruct0;
10509
10510 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10511 if(member->memberOffset % alignment)
10512 member->memberOffset += alignment - (member->memberOffset % alignment);
10513 }
10514 dataMember->offset = member->memberOffset;
10515 if(member->type == 1)
10516 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10517 else
10518 {
10519 member->memberOffset += size;
10520 }
10521 }
10522 else
10523 {
10524 if(alignment)
10525 {
10526 short __simpleStruct0;
10527
10528 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10529 if(_class->memberOffset % alignment)
10530 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10531 }
10532 dataMember->offset = _class->memberOffset;
10533 _class->memberOffset += size;
10534 }
10535 bitFields = 0;
10536 }
10537 size = dataMember->dataType->size;
10538 alignment = dataMember->dataType->alignment;
10539 }
10540 if(isMember)
10541 {
10542 int __simpleStruct0;
10543
10544 if(alignment)
10545 {
10546 short __simpleStruct0;
10547
10548 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10549 if(member->memberOffset % alignment)
10550 member->memberOffset += alignment - (member->memberOffset % alignment);
10551 }
10552 dataMember->offset = member->memberOffset;
10553 if(member->type == 1)
10554 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10555 else
10556 {
10557 member->memberOffset += size;
10558 }
10559 }
10560 else
10561 {
10562 if(alignment)
10563 {
10564 short __simpleStruct0;
10565
10566 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10567 if(_class->memberOffset % alignment)
10568 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10569 }
10570 dataMember->offset = _class->memberOffset;
10571 _class->memberOffset += size;
10572 }
10573 }
10574 else
10575 {
10576 int alignment;
10577
10578 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
10579 alignment = dataMember->structAlignment;
10580 if(isMember)
10581 {
10582 int __simpleStruct0;
10583
10584 if(alignment)
10585 {
10586 short __simpleStruct0;
10587
10588 if(member->memberOffset % alignment)
10589 member->memberOffset += alignment - (member->memberOffset % alignment);
10590 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10591 }
10592 dataMember->offset = member->memberOffset;
10593 if(member->type == 1)
10594 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10595 else
10596 member->memberOffset += dataMember->memberOffset;
10597 }
10598 else
10599 {
10600 if(alignment)
10601 {
10602 short __simpleStruct0;
10603
10604 if(_class->memberOffset % alignment)
10605 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10606 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10607 }
10608 dataMember->offset = _class->memberOffset;
10609 _class->memberOffset += dataMember->memberOffset;
10610 }
10611 }
10612 }
10613 }
10614 if(bitFields)
10615 {
10616 int alignment = 0;
10617 int size = (bitFields + 7) / 8;
10618
10619 if(isMember)
10620 {
10621 int __simpleStruct0;
10622
10623 if(alignment)
10624 {
10625 short __simpleStruct0;
10626
10627 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10628 if(member->memberOffset % alignment)
10629 member->memberOffset += alignment - (member->memberOffset % alignment);
10630 }
10631 if(member->type == 1)
10632 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10633 else
10634 {
10635 member->memberOffset += size;
10636 }
10637 }
10638 else
10639 {
10640 if(alignment)
10641 {
10642 short __simpleStruct0;
10643
10644 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10645 if(_class->memberOffset % alignment)
10646 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10647 }
10648 _class->memberOffset += size;
10649 }
10650 bitFields = 0;
10651 }
10652 }
10653 if(member && member->type == 1)
10654 {
10655 member->memberOffset = unionMemberOffset;
10656 }
10657 if(!isMember)
10658 {
10659 if(_class->type != 2)
10660 {
10661 int extra = 0;
10662
10663 if(_class->structAlignment)
10664 {
10665 if(_class->memberOffset % _class->structAlignment)
10666 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
10667 }
10668 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
10669 if(!member)
10670 {
10671 struct __ecereNameSpace__ecere__com__Property * prop;
10672
10673 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
10674 {
10675 if(prop->isProperty && prop->isWatchable)
10676 {
10677 prop->watcherOffset = _class->structSize;
10678 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10679 }
10680 }
10681 }
10682 {
10683 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
10684
10685 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
10686 {
10687 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
10688
10689 if(deriv->computeSize)
10690 {
10691 deriv->offset = _class->structSize;
10692 deriv->memberOffset = 0;
10693 deriv->structSize = deriv->offset;
10694 ComputeClassMembers(deriv, 0);
10695 }
10696 }
10697 }
10698 }
10699 }
10700 }
10701 if(context)
10702 FinishTemplatesContext(context);
10703 }
10704
10705 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)
10706 {
10707 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10708 unsigned int totalSize = 0;
10709 unsigned int maxSize = 0;
10710 int alignment;
10711 unsigned int size;
10712 struct __ecereNameSpace__ecere__com__DataMember * member;
10713 int anonID = 1;
10714 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10715
10716 if(addedPadding)
10717 *addedPadding = 0;
10718 if(!isMember && _class->base)
10719 {
10720 maxSize = _class->structSize;
10721 {
10722 if(_class->type == 1 || _class->type == 5)
10723 AddMembers(neededBy, declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
10724 else
10725 {
10726 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
10727
10728 if(maxSize > baseSize)
10729 maxSize -= baseSize;
10730 else
10731 maxSize = 0;
10732 }
10733 }
10734 }
10735 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
10736 {
10737 if(!member->isProperty)
10738 {
10739 switch(member->type)
10740 {
10741 case 0:
10742 {
10743 if(member->dataTypeString)
10744 {
10745 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
10746 struct Declarator * decl;
10747
10748 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
10749 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
10750 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
10751 if(!member->dataType)
10752 member->dataType = ProcessType(specs, decl);
10753 ReplaceThisClassSpecifiers(specs, topClass);
10754 {
10755 struct Type * type = ProcessType(specs, decl);
10756
10757 DeclareType(neededBy, member->dataType, 1, 0);
10758 FreeType(type);
10759 }
10760 ComputeTypeSize(member->dataType);
10761 size = member->dataType->size;
10762 alignment = member->dataType->alignment;
10763 if(alignment)
10764 {
10765 if(totalSize % alignment)
10766 totalSize += alignment - (totalSize % alignment);
10767 }
10768 totalSize += size;
10769 }
10770 break;
10771 }
10772 case 1:
10773 case 2:
10774 {
10775 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
10776 char id[100];
10777
10778 sprintf(id, "__anon%d", anonID++);
10779 size = 0;
10780 AddMembers(neededBy, list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
10781 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
10782 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
10783 alignment = member->structAlignment;
10784 if(alignment)
10785 {
10786 if(totalSize % alignment)
10787 totalSize += alignment - (totalSize % alignment);
10788 }
10789 totalSize += size;
10790 break;
10791 }
10792 }
10793 }
10794 }
10795 if(retSize)
10796 {
10797 unsigned int __simpleStruct0;
10798
10799 if(topMember && topMember->type == 1)
10800 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
10801 else
10802 *retSize += totalSize;
10803 }
10804 else if(totalSize < maxSize && _class->type != 1000)
10805 {
10806 int autoPadding = 0;
10807
10808 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
10809 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
10810 if(totalSize + autoPadding < maxSize)
10811 {
10812 char sizeString[50];
10813
10814 sprintf(sizeString, "%d", maxSize - totalSize);
10815 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
10816 if(addedPadding)
10817 *addedPadding = 1;
10818 }
10819 }
10820 if(context)
10821 FinishTemplatesContext(context);
10822 return topMember ? topMember->memberID : _class->memberID;
10823 }
10824
10825 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)
10826 {
10827 if(source && dest)
10828 {
10829 if(warnConst)
10830 CheckConstCompatibility(source, dest, 1);
10831 if(source->kind == 20 && dest->kind != 20)
10832 {
10833 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
10834
10835 if(type)
10836 source = type;
10837 }
10838 if(dest->kind == 20 && source->kind != 20)
10839 {
10840 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
10841
10842 if(type)
10843 dest = type;
10844 }
10845 if(dest->classObjectType == 2 && dest->kind != 11)
10846 {
10847 if(source->classObjectType != 3)
10848 return 1;
10849 else
10850 {
10851 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
10852 {
10853 return 1;
10854 }
10855 }
10856 }
10857 else
10858 {
10859 if(source->kind != 11 && source->classObjectType == 3)
10860 return 1;
10861 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
10862 return 1;
10863 }
10864 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
10865 {
10866 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))
10867 return 1;
10868 }
10869 if(dest->kind == 14 && source->kind != 0)
10870 return 1;
10871 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))
10872 return 1;
10873 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))
10874 return 1;
10875 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
10876 {
10877 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
10878 {
10879 if(conversions != (((void *)0)))
10880 {
10881 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
10882 return 1;
10883 }
10884 else
10885 {
10886 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
10887
10888 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
10889 ;
10890 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
10891 ;
10892 if(sourceBase == destBase)
10893 return 1;
10894 }
10895 }
10896 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))
10897 return 1;
10898 else
10899 {
10900 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))
10901 {
10902 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
10903 {
10904 return 1;
10905 }
10906 }
10907 }
10908 }
10909 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
10910 return 1;
10911 if(doConversion)
10912 {
10913 if(source->kind == 8)
10914 {
10915 struct __ecereNameSpace__ecere__com__Class * _class;
10916
10917 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10918 {
10919 struct __ecereNameSpace__ecere__com__Property * convert;
10920
10921 for(convert = _class->conversions.first; convert; convert = convert->next)
10922 {
10923 if(convert->memberAccess == 1 || _class->module == privateModule)
10924 {
10925 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10926
10927 if(!convert->dataType)
10928 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10929 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))
10930 {
10931 if(!conversions && !convert->Get)
10932 return 1;
10933 else if(conversions != (((void *)0)))
10934 {
10935 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))
10936 return 1;
10937 else
10938 {
10939 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10940
10941 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10942 return 1;
10943 }
10944 }
10945 }
10946 }
10947 }
10948 }
10949 }
10950 if(dest->kind == 8)
10951 {
10952 struct __ecereNameSpace__ecere__com__Class * _class;
10953
10954 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10955 {
10956 struct __ecereNameSpace__ecere__com__Property * convert;
10957
10958 for(convert = _class->conversions.first; convert; convert = convert->next)
10959 {
10960 if(convert->memberAccess == 1 || _class->module == privateModule)
10961 {
10962 struct Type * constType = (((void *)0));
10963 unsigned int success = 0;
10964
10965 if(!convert->dataType)
10966 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10967 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
10968 {
10969 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10970
10971 constType = __extension__ ({
10972 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10973
10974 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
10975 });
10976 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
10977 ptrType->constant = 1;
10978 }
10979 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
10980 {
10981 if(!conversions && !convert->Set)
10982 success = 1;
10983 else if(conversions != (((void *)0)))
10984 {
10985 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))
10986 success = 1;
10987 else
10988 {
10989 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
10990
10991 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
10992 success = 1;
10993 }
10994 }
10995 }
10996 if(constType)
10997 FreeType(constType);
10998 if(success)
10999 return 1;
11000 }
11001 }
11002 }
11003 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
11004 {
11005 if(!dest->__anon1._class->__anon1.registered->dataType)
11006 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
11007 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
11008 {
11009 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))
11010 {
11011 return 1;
11012 }
11013 }
11014 }
11015 }
11016 if(source->kind == 8)
11017 {
11018 struct __ecereNameSpace__ecere__com__Class * _class;
11019
11020 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
11021 {
11022 struct __ecereNameSpace__ecere__com__Property * convert;
11023
11024 for(convert = _class->conversions.first; convert; convert = convert->next)
11025 {
11026 if(convert->memberAccess == 1 || _class->module == privateModule)
11027 {
11028 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
11029
11030 if(!convert->dataType)
11031 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
11032 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))
11033 {
11034 if(!conversions && !convert->Get)
11035 return 1;
11036 else if(conversions != (((void *)0)))
11037 {
11038 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))
11039 return 1;
11040 else
11041 {
11042 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
11043
11044 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
11045 return 1;
11046 }
11047 }
11048 }
11049 }
11050 }
11051 }
11052 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
11053 {
11054 if(!source->__anon1._class->__anon1.registered->dataType)
11055 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
11056 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
11057 {
11058 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))
11059 return 1;
11060 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
11061 return 1;
11062 }
11063 }
11064 }
11065 }
11066 if(source->kind == 8 || source->kind == 19)
11067 ;
11068 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
11069 return 1;
11070 else if(dest->kind == 7 && source->kind == 6)
11071 return 1;
11072 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
11073 return 1;
11074 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
11075 return 1;
11076 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
11077 return 1;
11078 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
11079 return 1;
11080 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
11081 return 1;
11082 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))
11083 return 1;
11084 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))
11085 return 1;
11086 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)))
11087 {
11088 struct Type * paramSource, * paramDest;
11089
11090 if(dest->kind == 16)
11091 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
11092 if(source->kind == 16)
11093 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
11094 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
11095 dest = dest->__anon1.type;
11096 if(source->kind == 13 && source->__anon1.type->kind == 11)
11097 source = source->__anon1.type;
11098 if(dest->kind == 16)
11099 dest = dest->__anon1.__anon3.method->dataType;
11100 if(source->kind == 16)
11101 source = source->__anon1.__anon3.method->dataType;
11102 paramSource = source->__anon1.__anon2.params.first;
11103 if(paramSource && paramSource->kind == 0)
11104 paramSource = (((void *)0));
11105 paramDest = dest->__anon1.__anon2.params.first;
11106 if(paramDest && paramDest->kind == 0)
11107 paramDest = (((void *)0));
11108 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11109 {
11110 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))))
11111 {
11112 if(paramDest && paramDest->kind == 8)
11113 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
11114 else
11115 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
11116 return 0;
11117 }
11118 paramDest = paramDest->next;
11119 }
11120 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
11121 {
11122 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11123 {
11124 if(dest->__anon1.__anon2.thisClass)
11125 {
11126 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
11127 {
11128 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11129 return 0;
11130 }
11131 }
11132 else
11133 {
11134 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
11135 {
11136 if(owningClassDest)
11137 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
11138 else
11139 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
11140 return 0;
11141 }
11142 }
11143 paramSource = paramSource->next;
11144 }
11145 else
11146 {
11147 if(dest->__anon1.__anon2.thisClass)
11148 {
11149 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
11150 {
11151 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11152 return 0;
11153 }
11154 }
11155 else
11156 {
11157 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
11158 {
11159 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
11160 return 0;
11161 }
11162 }
11163 }
11164 }
11165 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
11166 {
11167 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
11168 return 0;
11169 }
11170 else
11171 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
11172 for(; paramDest; paramDest = paramDest->next)
11173 {
11174 if(!paramSource)
11175 {
11176 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
11177 return 0;
11178 }
11179 {
11180 struct Type * paramDestType = paramDest;
11181 struct Type * paramSourceType = paramSource;
11182 struct Type * type = paramDestType;
11183
11184 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
11185 {
11186 int id = 0;
11187 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
11188 struct __ecereNameSpace__ecere__com__Class * sClass;
11189
11190 for(sClass = owningClassSource; sClass; sClass = sClass->base)
11191 {
11192 id = 0;
11193 if(sClass->templateClass)
11194 sClass = sClass->templateClass;
11195 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
11196 {
11197 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
11198 {
11199 for(sClass = sClass->base; sClass; sClass = sClass->base)
11200 {
11201 if(sClass->templateClass)
11202 sClass = sClass->templateClass;
11203 id += sClass->templateParams.count;
11204 }
11205 break;
11206 }
11207 id++;
11208 }
11209 if(curParam)
11210 break;
11211 }
11212 if(curParam)
11213 {
11214 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
11215
11216 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
11217 }
11218 }
11219 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)))
11220 {
11221 char type[1024];
11222
11223 type[0] = (char)0;
11224 PrintType(paramDest, type, 0, 1);
11225 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
11226 if(paramDestType != paramDest)
11227 FreeType(paramDestType);
11228 return 0;
11229 }
11230 if(paramDestType != paramDest)
11231 FreeType(paramDestType);
11232 }
11233 paramSource = paramSource->next;
11234 }
11235 if(paramSource)
11236 {
11237 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
11238 return 0;
11239 }
11240 return 1;
11241 }
11242 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
11243 {
11244 return 1;
11245 }
11246 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
11247 {
11248 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))
11249 {
11250 ComputeTypeSize(source->__anon1.type);
11251 ComputeTypeSize(dest->__anon1.type);
11252 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))
11253 return 1;
11254 }
11255 }
11256 }
11257 return 0;
11258 }
11259
11260 void ComputeInstantiation(struct Expression * exp)
11261 {
11262 struct Instantiation * inst = exp->__anon1.instance;
11263 struct MembersInit * members;
11264 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11265 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11266 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11267 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11268 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11269 int subMemberStackPos = 0;
11270 uint64 bits = 0;
11271
11272 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11273 {
11274 if(inst->data)
11275 return ;
11276 if(_class->type == 0 || _class->type == 5)
11277 {
11278 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11279 if(_class->type == 0)
11280 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11281 }
11282 else
11283 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11284 }
11285 if(inst->members)
11286 {
11287 for(members = (*inst->members).first; members; members = members->next)
11288 {
11289 switch(members->type)
11290 {
11291 case 0:
11292 {
11293 if(members->__anon1.dataMembers)
11294 {
11295 struct MemberInit * member;
11296
11297 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11298 {
11299 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11300 unsigned int found = 0;
11301 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11302 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11303 unsigned int dataMemberOffset;
11304
11305 if(!ident)
11306 {
11307 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11308 if(curMember)
11309 {
11310 if(curMember->isProperty)
11311 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11312 else
11313 {
11314 dataMember = curMember;
11315 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11316 if(_class->type == 0)
11317 dataMemberOffset += _class->base->structSize;
11318 }
11319 found = 1;
11320 }
11321 }
11322 else
11323 {
11324 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11325 if(prop)
11326 {
11327 found = 1;
11328 if(prop->memberAccess == 1)
11329 {
11330 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11331 curClass = prop->_class;
11332 }
11333 }
11334 else
11335 {
11336 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11337 int _subMemberStackPos = 0;
11338
11339 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11340 if(dataMember)
11341 {
11342 found = 1;
11343 if(dataMember->memberAccess == 1)
11344 {
11345 curMember = dataMember;
11346 curClass = dataMember->_class;
11347 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11348 subMemberStackPos = _subMemberStackPos;
11349 }
11350 }
11351 }
11352 }
11353 if(found && member->initializer && member->initializer->type == 0)
11354 {
11355 struct Expression * value = member->initializer->__anon1.exp;
11356 struct Type * type = (((void *)0));
11357 unsigned int deepMember = 0;
11358
11359 if(prop)
11360 {
11361 type = prop->dataType;
11362 }
11363 else if(dataMember)
11364 {
11365 if(!dataMember->dataType)
11366 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11367 type = dataMember->dataType;
11368 }
11369 if(ident && ident->next)
11370 {
11371 deepMember = 1;
11372 for(ident = ident->next; ident && type; ident = ident->next)
11373 {
11374 if(type->kind == 8)
11375 {
11376 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11377 if(prop)
11378 type = prop->dataType;
11379 else
11380 {
11381 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11382 if(dataMember)
11383 type = dataMember->dataType;
11384 }
11385 }
11386 else if(type->kind == 9 || type->kind == 10)
11387 {
11388 struct Type * memberType;
11389
11390 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11391 {
11392 if(!strcmp(memberType->name, ident->string))
11393 {
11394 type = memberType;
11395 break;
11396 }
11397 }
11398 }
11399 }
11400 }
11401 if(value)
11402 {
11403 FreeType(value->destType);
11404 value->destType = type;
11405 if(type)
11406 type->refCount++;
11407 ComputeExpression(value);
11408 }
11409 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11410 {
11411 if(type->kind == 8)
11412 {
11413 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11414
11415 if(_class && (_class->type == 2 || _class->type == 3 || _class->type == 4))
11416 {
11417 if(!_class->dataType)
11418 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11419 type = _class->dataType;
11420 }
11421 }
11422 if(dataMember)
11423 {
11424 void * ptr = inst->data + dataMemberOffset;
11425
11426 if(value->type == 2)
11427 {
11428 switch(type->kind)
11429 {
11430 case 3:
11431 {
11432 GetInt(value, (int *)ptr);
11433 break;
11434 }
11435 case 4:
11436 {
11437 GetInt64(value, (long long *)ptr);
11438 break;
11439 }
11440 case 22:
11441 {
11442 GetIntPtr(value, (intptr_t *)ptr);
11443 break;
11444 }
11445 case 23:
11446 {
11447 GetIntSize(value, (ssize_t *)ptr);
11448 break;
11449 }
11450 case 6:
11451 {
11452 GetFloat(value, (float *)ptr);
11453 break;
11454 }
11455 case 7:
11456 {
11457 GetDouble(value, (double *)ptr);
11458 break;
11459 }
11460 }
11461 }
11462 else if(value->type == 1)
11463 {
11464 if(type->kind == 8)
11465 {
11466 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11467
11468 if(_class->type == 1)
11469 {
11470 ComputeTypeSize(type);
11471 if(value->__anon1.instance->data)
11472 memcpy(ptr, value->__anon1.instance->data, type->size);
11473 }
11474 }
11475 }
11476 }
11477 else if(prop && prop->Set != (void *)(intptr_t)1)
11478 {
11479 if(value->type == 1 && value->__anon1.instance->data)
11480 {
11481 if(type->kind == 8)
11482 {
11483 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11484
11485 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)))
11486 {
11487 void (* Set)(void *, void *) = (void *)prop->Set;
11488
11489 Set(inst->data, value->__anon1.instance->data);
11490 PopulateInstance(inst);
11491 }
11492 }
11493 }
11494 else if(value->type == 2)
11495 {
11496 switch(type->kind)
11497 {
11498 case 7:
11499 {
11500 void (* Set)(void *, double) = (void *)prop->Set;
11501
11502 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11503 break;
11504 }
11505 case 6:
11506 {
11507 void (* Set)(void *, float) = (void *)prop->Set;
11508
11509 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11510 break;
11511 }
11512 case 3:
11513 {
11514 void (* Set)(void *, int) = (void *)prop->Set;
11515
11516 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11517 break;
11518 }
11519 case 4:
11520 {
11521 void (* Set)(void *, long long) = (void *)prop->Set;
11522
11523 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11524 break;
11525 }
11526 case 22:
11527 {
11528 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11529
11530 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11531 break;
11532 }
11533 case 23:
11534 {
11535 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11536
11537 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11538 break;
11539 }
11540 }
11541 }
11542 else if(value->type == 3)
11543 {
11544 char temp[1024];
11545
11546 ReadString(temp, value->__anon1.__anon2.string);
11547 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11548 }
11549 }
11550 }
11551 else if(!deepMember && type && _class->type == 3)
11552 {
11553 if(prop)
11554 {
11555 if(value->type == 2)
11556 {
11557 if(type->kind == 8)
11558 {
11559 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11560
11561 if(_class->type == 3)
11562 {
11563 if(!_class->dataType)
11564 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11565 type = _class->dataType;
11566 }
11567 }
11568 switch(type->kind)
11569 {
11570 case 6:
11571 {
11572 float fValue;
11573 float (* Set)(float) = (void *)prop->Set;
11574
11575 GetFloat(member->initializer->__anon1.exp, &fValue);
11576 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11577 exp->type = 2;
11578 break;
11579 }
11580 case 7:
11581 {
11582 double dValue;
11583 double (* Set)(double) = (void *)prop->Set;
11584
11585 GetDouble(member->initializer->__anon1.exp, &dValue);
11586 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11587 exp->type = 2;
11588 break;
11589 }
11590 }
11591 }
11592 }
11593 }
11594 else if(!deepMember && type && _class->type == 2)
11595 {
11596 if(prop)
11597 {
11598 if(value->type == 1 && value->__anon1.instance->data)
11599 {
11600 unsigned int (* Set)(void *) = (void *)prop->Set;
11601
11602 bits = Set(value->__anon1.instance->data);
11603 }
11604 else if(value->type == 2)
11605 {
11606 }
11607 }
11608 else if(dataMember)
11609 {
11610 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11611 struct Type * type;
11612 uint64 part = 0;
11613
11614 bits = (bits & ~bitMember->mask);
11615 if(!bitMember->dataType)
11616 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11617 type = bitMember->dataType;
11618 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11619 {
11620 if(!type->__anon1._class->__anon1.registered->dataType)
11621 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11622 type = type->__anon1._class->__anon1.registered->dataType;
11623 }
11624 switch(type->kind)
11625 {
11626 case 24:
11627 case 1:
11628 {
11629 unsigned char v;
11630
11631 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11632 part = (uint64)v;
11633 break;
11634 }
11635 case 2:
11636 {
11637 unsigned short v;
11638
11639 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11640 part = (uint64)v;
11641 break;
11642 }
11643 case 3:
11644 case 5:
11645 {
11646 unsigned int v;
11647
11648 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11649 part = (uint64)v;
11650 break;
11651 }
11652 case 4:
11653 {
11654 uint64 v;
11655
11656 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11657 part = v;
11658 break;
11659 }
11660 case 22:
11661 {
11662 uintptr_t v;
11663
11664 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11665 part = (uint64)v;
11666 break;
11667 }
11668 case 23:
11669 {
11670 size_t v;
11671
11672 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11673 part = (uint64)v;
11674 break;
11675 }
11676 }
11677 bits |= part << bitMember->pos;
11678 }
11679 }
11680 }
11681 else
11682 {
11683 if(_class && _class->type == 3)
11684 {
11685 ComputeExpression(member->initializer->__anon1.exp);
11686 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11687 exp->type = 2;
11688 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11689 }
11690 }
11691 }
11692 }
11693 break;
11694 }
11695 }
11696 }
11697 }
11698 if(_class && _class->type == 2)
11699 {
11700 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11701 exp->type = 2;
11702 }
11703 if(exp->type != 1)
11704 {
11705 FreeInstance(inst);
11706 }
11707 }
11708
11709 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11710 {
11711 if(exp->__anon1.op.op == SIZEOF)
11712 {
11713 FreeExpContents(exp);
11714 exp->type = 2;
11715 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11716 }
11717 else
11718 {
11719 if(!exp->__anon1.op.exp1)
11720 {
11721 switch(exp->__anon1.op.op)
11722 {
11723 case '+':
11724 {
11725 struct Expression * exp2 = exp->__anon1.op.exp2;
11726
11727 exp->__anon1.op.exp2 = (((void *)0));
11728 FreeExpContents(exp);
11729 FreeType(exp->expType);
11730 FreeType(exp->destType);
11731 *exp = *exp2;
11732 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11733 break;
11734 }
11735 case '-':
11736 if(op1->ops.Neg)
11737 {
11738 FreeExpContents(exp);
11739 op1->ops.Neg(exp, op1);
11740 }
11741 break;
11742 case '~':
11743 if(op1->ops.BitNot)
11744 {
11745 FreeExpContents(exp);
11746 op1->ops.BitNot(exp, op1);
11747 }
11748 break;
11749 case '!':
11750 if(op1->ops.Not)
11751 {
11752 FreeExpContents(exp);
11753 op1->ops.Not(exp, op1);
11754 }
11755 break;
11756 }
11757 }
11758 else
11759 {
11760 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11761 {
11762 if(Promote(op2, op1->kind, op1->type->isSigned))
11763 op2->kind = op1->kind, op2->ops = op1->ops;
11764 else if(Promote(op1, op2->kind, op2->type->isSigned))
11765 op1->kind = op2->kind, op1->ops = op2->ops;
11766 }
11767 switch(exp->__anon1.op.op)
11768 {
11769 case '+':
11770 if(op1->ops.Add)
11771 {
11772 FreeExpContents(exp);
11773 op1->ops.Add(exp, op1, op2);
11774 }
11775 break;
11776 case '-':
11777 if(op1->ops.Sub)
11778 {
11779 FreeExpContents(exp);
11780 op1->ops.Sub(exp, op1, op2);
11781 }
11782 break;
11783 case '*':
11784 if(op1->ops.Mul)
11785 {
11786 FreeExpContents(exp);
11787 op1->ops.Mul(exp, op1, op2);
11788 }
11789 break;
11790 case '/':
11791 if(op1->ops.Div)
11792 {
11793 FreeExpContents(exp);
11794 op1->ops.Div(exp, op1, op2);
11795 }
11796 break;
11797 case '%':
11798 if(op1->ops.Mod)
11799 {
11800 FreeExpContents(exp);
11801 op1->ops.Mod(exp, op1, op2);
11802 }
11803 break;
11804 case '&':
11805 if(exp->__anon1.op.exp2)
11806 {
11807 if(op1->ops.BitAnd)
11808 {
11809 FreeExpContents(exp);
11810 op1->ops.BitAnd(exp, op1, op2);
11811 }
11812 }
11813 break;
11814 case '|':
11815 if(op1->ops.BitOr)
11816 {
11817 FreeExpContents(exp);
11818 op1->ops.BitOr(exp, op1, op2);
11819 }
11820 break;
11821 case '^':
11822 if(op1->ops.BitXor)
11823 {
11824 FreeExpContents(exp);
11825 op1->ops.BitXor(exp, op1, op2);
11826 }
11827 break;
11828 case LEFT_OP:
11829 if(op1->ops.LShift)
11830 {
11831 FreeExpContents(exp);
11832 op1->ops.LShift(exp, op1, op2);
11833 }
11834 break;
11835 case RIGHT_OP:
11836 if(op1->ops.RShift)
11837 {
11838 FreeExpContents(exp);
11839 op1->ops.RShift(exp, op1, op2);
11840 }
11841 break;
11842 case EQ_OP:
11843 if(op1->ops.Equ)
11844 {
11845 FreeExpContents(exp);
11846 op1->ops.Equ(exp, op1, op2);
11847 }
11848 break;
11849 case NE_OP:
11850 if(op1->ops.Nqu)
11851 {
11852 FreeExpContents(exp);
11853 op1->ops.Nqu(exp, op1, op2);
11854 }
11855 break;
11856 case AND_OP:
11857 if(op1->ops.And)
11858 {
11859 FreeExpContents(exp);
11860 op1->ops.And(exp, op1, op2);
11861 }
11862 break;
11863 case OR_OP:
11864 if(op1->ops.Or)
11865 {
11866 FreeExpContents(exp);
11867 op1->ops.Or(exp, op1, op2);
11868 }
11869 break;
11870 case '>':
11871 if(op1->ops.Grt)
11872 {
11873 FreeExpContents(exp);
11874 op1->ops.Grt(exp, op1, op2);
11875 }
11876 break;
11877 case '<':
11878 if(op1->ops.Sma)
11879 {
11880 FreeExpContents(exp);
11881 op1->ops.Sma(exp, op1, op2);
11882 }
11883 break;
11884 case GE_OP:
11885 if(op1->ops.GrtEqu)
11886 {
11887 FreeExpContents(exp);
11888 op1->ops.GrtEqu(exp, op1, op2);
11889 }
11890 break;
11891 case LE_OP:
11892 if(op1->ops.SmaEqu)
11893 {
11894 FreeExpContents(exp);
11895 op1->ops.SmaEqu(exp, op1, op2);
11896 }
11897 break;
11898 }
11899 }
11900 }
11901 }
11902
11903 void ApplyAnyObjectLogic(struct Expression * e)
11904 {
11905 struct Type * destType = e->destType;
11906
11907 if(destType && (destType->classObjectType == 3))
11908 {
11909 if(e && e->expType)
11910 {
11911 struct Type * type = e->expType;
11912 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11913
11914 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11915 {
11916 _class = type->__anon1._class->__anon1.registered;
11917 }
11918 else if(type->kind == 19)
11919 {
11920 _class = FindClass("ecere::com::Class")->__anon1.registered;
11921 }
11922 else
11923 {
11924 char string[1024] = "";
11925 struct Symbol * classSym;
11926
11927 PrintTypeNoConst(type, string, 0, 1);
11928 classSym = FindClass(string);
11929 if(classSym)
11930 _class = classSym->__anon1.registered;
11931 }
11932 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)))
11933 {
11934 if(!_class || strcmp(_class->fullName, "char *"))
11935 {
11936 struct Expression * checkedExp = e, * newExp;
11937
11938 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11939 {
11940 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11941 {
11942 if(checkedExp->type == 23)
11943 {
11944 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11945 }
11946 else
11947 checkedExp = (*checkedExp->__anon1.list).last;
11948 }
11949 else if(checkedExp->type == 11)
11950 checkedExp = checkedExp->__anon1.cast.exp;
11951 }
11952 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
11953 {
11954 newExp = checkedExp->__anon1.op.exp2;
11955 checkedExp->__anon1.op.exp2 = (((void *)0));
11956 FreeExpContents(checkedExp);
11957 if(e->expType && e->expType->passAsTemplate)
11958 {
11959 char size[100];
11960
11961 ComputeTypeSize(e->expType);
11962 sprintf(size, "%d", e->expType->size);
11963 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))))));
11964 }
11965 ReplaceExpContents(checkedExp, newExp);
11966 e->byReference = 1;
11967 }
11968 else if(!e->byReference || (_class && _class->type == 5))
11969 {
11970 struct Expression * checkedExp;
11971
11972 {
11973 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;
11974
11975 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11976 {
11977 struct Context * context = PushContext();
11978 struct Declarator * decl;
11979 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11980 char typeString[1024];
11981 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11982
11983 typeString[0] = '\0';
11984 *newExp = *e;
11985 newExp->prev = (((void *)0));
11986 newExp->next = (((void *)0));
11987 newExp->expType = (((void *)0));
11988 PrintTypeNoConst(e->expType, typeString, 0, 1);
11989 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11990 newExp->destType = ProcessType(specs, decl);
11991 curContext = context;
11992 if(curCompound)
11993 {
11994 char name[100];
11995 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11996
11997 e->type = 23;
11998 sprintf(name, "__internalValue%03X", internalValueCounter++);
11999 if(!curCompound->__anon1.compound.declarations)
12000 curCompound->__anon1.compound.declarations = MkList();
12001 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12002 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12003 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12004 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
12005 }
12006 else
12007 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12008 {
12009 struct Type * type = e->destType;
12010
12011 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12012 CopyTypeInto(e->destType, type);
12013 e->destType->refCount = 1;
12014 e->destType->classObjectType = 0;
12015 FreeType(type);
12016 }
12017 e->__anon1.compound->__anon1.compound.context = context;
12018 PopContext(context);
12019 curContext = context->parent;
12020 }
12021 }
12022 checkedExp = e;
12023 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
12024 {
12025 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
12026 {
12027 if(checkedExp->type == 23)
12028 {
12029 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12030 }
12031 else
12032 checkedExp = (*checkedExp->__anon1.list).last;
12033 }
12034 else if(checkedExp->type == 11)
12035 checkedExp = checkedExp->__anon1.cast.exp;
12036 }
12037 {
12038 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12039
12040 *operand = *checkedExp;
12041 __ecereMethod_Expression_Clear(checkedExp);
12042 checkedExp->destType = ProcessTypeString("void *", 0);
12043 checkedExp->expType = checkedExp->destType;
12044 checkedExp->destType->refCount++;
12045 checkedExp->type = 4;
12046 checkedExp->__anon1.op.op = '&';
12047 checkedExp->__anon1.op.exp1 = (((void *)0));
12048 checkedExp->__anon1.op.exp2 = operand;
12049 }
12050 }
12051 }
12052 }
12053 }
12054 }
12055 {
12056 }
12057 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))))
12058 {
12059 if(e->expType->classObjectType && destType && destType->classObjectType)
12060 {
12061 return ;
12062 }
12063 else
12064 {
12065 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12066
12067 *thisExp = *e;
12068 thisExp->prev = (((void *)0));
12069 thisExp->next = (((void *)0));
12070 __ecereMethod_Expression_Clear(e);
12071 e->type = 5;
12072 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12073 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
12074 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
12075 {
12076 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12077 CopyTypeInto(e->expType, thisExp->expType);
12078 e->expType->byReference = 0;
12079 e->expType->refCount = 1;
12080 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))
12081 {
12082 e->expType->classObjectType = 0;
12083 }
12084 }
12085 }
12086 }
12087 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12088 {
12089 if(destType->kind == 14)
12090 {
12091 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
12092 }
12093 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))
12094 {
12095 unsigned int byReference = e->expType->byReference;
12096 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12097 struct Declarator * decl;
12098 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12099 char typeString[1024];
12100 struct Type * type;
12101 int backupClassObjectType;
12102 unsigned int backupByReference;
12103
12104 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
12105 type = e->expType;
12106 else
12107 type = destType;
12108 backupClassObjectType = type->classObjectType;
12109 backupByReference = type->byReference;
12110 type->classObjectType = 0;
12111 type->byReference = 0;
12112 typeString[0] = '\0';
12113 PrintType(type, typeString, 0, 1);
12114 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12115 type->classObjectType = backupClassObjectType;
12116 type->byReference = backupByReference;
12117 *thisExp = *e;
12118 thisExp->prev = (((void *)0));
12119 thisExp->next = (((void *)0));
12120 __ecereMethod_Expression_Clear(e);
12121 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)))
12122 {
12123 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
12124 struct Type * t;
12125
12126 destType->refCount++;
12127 e->type = 4;
12128 e->__anon1.op.op = '*';
12129 e->__anon1.op.exp1 = (((void *)0));
12130 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12131 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12132 CopyTypeInto(t, thisExp->destType);
12133 t->passAsTemplate = 0;
12134 FreeType(thisExp->destType);
12135 thisExp->destType = t;
12136 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12137 CopyTypeInto(t, destType);
12138 t->passAsTemplate = passAsTemplate;
12139 FreeType(destType);
12140 destType = t;
12141 destType->refCount = 0;
12142 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12143 CopyTypeInto(e->expType, type);
12144 if(type->passAsTemplate)
12145 {
12146 e->expType->classObjectType = 0;
12147 e->expType->passAsTemplate = 0;
12148 }
12149 e->expType->byReference = 0;
12150 e->expType->refCount = 1;
12151 }
12152 else
12153 {
12154 e->type = 11;
12155 e->__anon1.cast.typeName = MkTypeName(specs, decl);
12156 e->__anon1.cast.exp = thisExp;
12157 e->byReference = 1;
12158 e->expType = type;
12159 type->refCount++;
12160 }
12161 if(e->destType)
12162 FreeType(e->destType);
12163 e->destType = destType;
12164 destType->refCount++;
12165 }
12166 }
12167 }
12168
12169 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
12170 {
12171 struct __ecereNameSpace__ecere__com__Class * _class;
12172 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
12173
12174 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
12175 ComputeModuleClasses(subModule->data);
12176 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->classes.first; _class; _class = _class->next)
12177 ComputeClassMembers(_class, 0);
12178 }
12179
12180 int ComputeTypeSize(struct Type * type)
12181 {
12182 unsigned int size = type ? type->size : 0;
12183
12184 if(!size && type && !type->computing)
12185 {
12186 type->computing = 1;
12187 switch(type->kind)
12188 {
12189 case 24:
12190 type->alignment = size = sizeof(char);
12191 break;
12192 case 1:
12193 type->alignment = size = sizeof(char);
12194 break;
12195 case 3:
12196 type->alignment = size = sizeof(int);
12197 break;
12198 case 4:
12199 type->alignment = size = sizeof(long long);
12200 break;
12201 case 22:
12202 type->alignment = size = targetBits / 8;
12203 type->pointerAlignment = 1;
12204 break;
12205 case 23:
12206 type->alignment = size = targetBits / 8;
12207 type->pointerAlignment = 1;
12208 break;
12209 case 5:
12210 type->alignment = size = sizeof(long);
12211 break;
12212 case 2:
12213 type->alignment = size = sizeof(short);
12214 break;
12215 case 6:
12216 type->alignment = size = sizeof(float);
12217 break;
12218 case 7:
12219 type->alignment = size = sizeof(double);
12220 break;
12221 case 8:
12222 {
12223 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
12224
12225 if(_class && _class->type == 1)
12226 {
12227 ComputeClassMembers(_class, 0);
12228 type->alignment = _class->structAlignment;
12229 type->pointerAlignment = (unsigned int)_class->pointerAlignment;
12230 size = _class->structSize;
12231 if(type->alignment && size % type->alignment)
12232 size += type->alignment - (size % type->alignment);
12233 }
12234 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
12235 {
12236 if(!_class->dataType)
12237 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12238 size = type->alignment = ComputeTypeSize(_class->dataType);
12239 }
12240 else
12241 {
12242 size = type->alignment = targetBits / 8;
12243 type->pointerAlignment = 1;
12244 }
12245 break;
12246 }
12247 case 13:
12248 case 19:
12249 size = type->alignment = targetBits / 8;
12250 type->pointerAlignment = 1;
12251 break;
12252 case 12:
12253 if(type->__anon1.__anon4.arraySizeExp)
12254 {
12255 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
12256 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
12257 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)))
12258 {
12259 struct Location oldLoc = yylloc;
12260 char expression[10240];
12261
12262 expression[0] = '\0';
12263 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
12264 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
12265 if(inCompiler)
12266 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
12267 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
12268 yylloc = oldLoc;
12269 }
12270 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
12271 }
12272 else if(type->__anon1.__anon4.enumClass)
12273 {
12274 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
12275 {
12276 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
12277 }
12278 else
12279 type->__anon1.__anon4.arraySize = 0;
12280 }
12281 else
12282 {
12283 type->__anon1.__anon4.arraySize = 0;
12284 }
12285 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
12286 if(type->__anon1.type)
12287 {
12288 type->alignment = type->__anon1.type->alignment;
12289 type->pointerAlignment = type->__anon1.type->pointerAlignment;
12290 }
12291 break;
12292 case 9:
12293 {
12294 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12295 {
12296 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12297
12298 if(symbol && symbol->type)
12299 {
12300 ComputeTypeSize(symbol->type);
12301 size = symbol->type->size;
12302 }
12303 }
12304 else
12305 {
12306 struct Type * member;
12307
12308 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12309 {
12310 int __simpleStruct0, __simpleStruct1;
12311 unsigned int addSize = ComputeTypeSize(member);
12312
12313 member->offset = size;
12314 if(member->alignment && size % member->alignment)
12315 member->offset += member->alignment - (size % member->alignment);
12316 size = member->offset;
12317 if(member->pointerAlignment && type->size <= 4)
12318 type->pointerAlignment = 1;
12319 else if(!member->pointerAlignment && member->alignment >= 8)
12320 type->pointerAlignment = 0;
12321 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12322 size += addSize;
12323 }
12324 if(type->alignment && size % type->alignment)
12325 size += type->alignment - (size % type->alignment);
12326 }
12327 break;
12328 }
12329 case 10:
12330 {
12331 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12332 {
12333 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12334
12335 if(symbol && symbol->type)
12336 {
12337 ComputeTypeSize(symbol->type);
12338 size = symbol->type->size;
12339 type->alignment = symbol->type->alignment;
12340 }
12341 }
12342 else
12343 {
12344 struct Type * member;
12345
12346 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12347 {
12348 int __simpleStruct0, __simpleStruct1;
12349 unsigned int addSize = ComputeTypeSize(member);
12350
12351 member->offset = size;
12352 if(member->alignment && size % member->alignment)
12353 member->offset += member->alignment - (size % member->alignment);
12354 size = member->offset;
12355 if(member->pointerAlignment && type->size <= 4)
12356 type->pointerAlignment = 1;
12357 else if(!member->pointerAlignment && member->alignment >= 8)
12358 type->pointerAlignment = 0;
12359 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12360 size = ((size > addSize) ? size : addSize);
12361 }
12362 if(type->alignment && size % type->alignment)
12363 size += type->alignment - (size % type->alignment);
12364 }
12365 break;
12366 }
12367 case 20:
12368 {
12369 struct TemplateParameter * param = type->__anon1.templateParameter;
12370 struct Type * baseType = ProcessTemplateParameterType(param);
12371
12372 if(baseType)
12373 {
12374 size = ComputeTypeSize(baseType);
12375 type->alignment = baseType->alignment;
12376 type->pointerAlignment = baseType->pointerAlignment;
12377 }
12378 else
12379 type->alignment = size = sizeof(uint64);
12380 break;
12381 }
12382 case 15:
12383 {
12384 type->alignment = size = sizeof(enum
12385 {
12386 test
12387 });
12388 break;
12389 }
12390 case 21:
12391 {
12392 type->alignment = size = targetBits / 8;
12393 type->pointerAlignment = 1;
12394 break;
12395 }
12396 }
12397 type->size = size;
12398 type->computing = 0;
12399 }
12400 return size;
12401 }
12402
12403 struct External * _DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl)
12404 {
12405 struct External * external = (((void *)0));
12406 struct Symbol * classSym = FindClass(name);
12407 struct __ecereNameSpace__ecere__sys__OldList * curDeclarations = (((void *)0));
12408 struct Specifier * curSpec = (((void *)0));
12409
12410 if(!inCompiler || !classSym)
12411 return (((void *)0));
12412 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
12413 return (((void *)0));
12414 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
12415 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
12416 external = classSym->__anon2.__anon1.structExternal;
12417 if(external && external->__anon1.declaration)
12418 {
12419 struct Specifier * spec;
12420
12421 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12422 if(spec->type == 3 || spec->type == 4)
12423 {
12424 curSpec = spec;
12425 curDeclarations = spec->__anon1.__anon2.definitions;
12426 break;
12427 }
12428 }
12429 if(classSym->__anon1.registered && !classSym->declaring && classSym->imported && (!classSym->declaredStructSym || (classSym->__anon1.registered->type == 5 && !skipNoHead && external && !curDeclarations)))
12430 {
12431 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12432 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
12433 char structName[1024];
12434 unsigned int addedPadding = 0;
12435
12436 classSym->declaring++;
12437 if(strchr(classSym->string, '<'))
12438 {
12439 if(classSym->__anon1.registered->templateClass)
12440 {
12441 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
12442 classSym->declaring--;
12443 }
12444 return external;
12445 }
12446 structName[0] = (char)0;
12447 FullClassNameCat(structName, name, 0);
12448 classSym->declaredStructSym = 1;
12449 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
12450 {
12451 unsigned int add = 0;
12452
12453 if(!external)
12454 {
12455 external = MkExternalDeclaration((((void *)0)));
12456 classSym->__anon2.__anon1.structExternal = external;
12457 external->symbol = classSym;
12458 add = 1;
12459 }
12460 if(!skipNoHead)
12461 {
12462 declarations = MkList();
12463 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
12464 }
12465 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
12466 {
12467 FreeList(declarations, (void *)(FreeClassDef));
12468 declarations = (((void *)0));
12469 }
12470 if(classSym->__anon1.registered->type != 5 && !declarations)
12471 {
12472 FreeExternal(external);
12473 external = (((void *)0));
12474 classSym->__anon2.__anon1.structExternal = (((void *)0));
12475 }
12476 else
12477 {
12478 if(curSpec)
12479 curSpec->__anon1.__anon2.definitions = declarations;
12480 else
12481 {
12482 char className[1024];
12483
12484 strcpy(className, "__ecereClass_");
12485 FullClassNameCat(className, classSym->string, 1);
12486 specifiers = MkList();
12487 declarators = MkList();
12488 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
12489 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12490 }
12491 if(add)
12492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12493 }
12494 }
12495 classSym->declaring--;
12496 }
12497 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
12498 {
12499 classSym->declaredStructSym = 1;
12500 if(classSym->__anon1.registered)
12501 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
12502 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
12503 {
12504 struct Specifier * spec;
12505
12506 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
12507 {
12508 if(spec->__anon1.__anon2.definitions)
12509 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
12510 }
12511 }
12512 }
12513 if(inCompiler && neededBy && (external || !classSym->imported))
12514 {
12515 if(!external)
12516 {
12517 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
12518 external->symbol = classSym;
12519 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12520 }
12521 if(fwdDecl)
12522 {
12523 struct External * e = external->fwdDecl ? external->fwdDecl : external;
12524
12525 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
12526 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
12527 }
12528 else
12529 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
12530 }
12531 return external;
12532 }
12533
12534 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)
12535 {
12536 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
12537 unsigned int found = 0;
12538 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
12539 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12540 unsigned int freeType = 0;
12541
12542 yylloc = member->loc;
12543 if(!ident)
12544 {
12545 if(curMember)
12546 {
12547 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
12548 if(*curMember)
12549 {
12550 found = 1;
12551 dataMember = *curMember;
12552 }
12553 }
12554 }
12555 else
12556 {
12557 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
12558 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
12559 int _subMemberStackPos = 0;
12560
12561 if(!thisMember)
12562 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
12563 if(thisMember)
12564 {
12565 dataMember = thisMember;
12566 if(curMember && thisMember->memberAccess == 1)
12567 {
12568 *curMember = thisMember;
12569 *curClass = thisMember->_class;
12570 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
12571 *subMemberStackPos = _subMemberStackPos;
12572 }
12573 found = 1;
12574 }
12575 else
12576 {
12577 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
12578 if(method && method->type == 1)
12579 found = 1;
12580 else
12581 method = (((void *)0));
12582 }
12583 }
12584 if(found)
12585 {
12586 struct Type * type = (((void *)0));
12587
12588 if(dataMember)
12589 {
12590 if(!dataMember->dataType && dataMember->dataTypeString)
12591 {
12592 struct Context * context = SetupTemplatesContext(_class);
12593
12594 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12595 FinishTemplatesContext(context);
12596 }
12597 type = dataMember->dataType;
12598 }
12599 else if(method)
12600 {
12601 if(!method->dataType)
12602 ProcessMethodType(method);
12603 type = method->dataType;
12604 }
12605 if(ident && ident->next)
12606 {
12607 for(ident = ident->next; ident && type; ident = ident->next)
12608 {
12609 if(type->kind == 8)
12610 {
12611 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
12612 if(!dataMember)
12613 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
12614 if(dataMember)
12615 type = dataMember->dataType;
12616 }
12617 else if(type->kind == 9 || type->kind == 10)
12618 {
12619 struct Type * memberType;
12620
12621 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
12622 {
12623 if(!strcmp(memberType->name, ident->string))
12624 {
12625 type = memberType;
12626 break;
12627 }
12628 }
12629 }
12630 }
12631 }
12632 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
12633 {
12634 int id = 0;
12635 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
12636 struct __ecereNameSpace__ecere__com__Class * sClass;
12637
12638 for(sClass = _class; sClass; sClass = sClass->base)
12639 {
12640 id = 0;
12641 if(sClass->templateClass)
12642 sClass = sClass->templateClass;
12643 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
12644 {
12645 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
12646 {
12647 for(sClass = sClass->base; sClass; sClass = sClass->base)
12648 {
12649 if(sClass->templateClass)
12650 sClass = sClass->templateClass;
12651 id += sClass->templateParams.count;
12652 }
12653 break;
12654 }
12655 id++;
12656 }
12657 if(curParam)
12658 break;
12659 }
12660 if(curParam)
12661 {
12662 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
12663
12664 if(arg.__anon1.__anon1.dataTypeString)
12665 {
12666 unsigned int constant = type->constant;
12667
12668 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
12669 if(type->kind == 8 && constant)
12670 type->constant = 1;
12671 else if(type->kind == 13)
12672 {
12673 struct Type * t = type->__anon1.type;
12674
12675 while(t->kind == 13)
12676 t = t->__anon1.type;
12677 if(constant)
12678 t->constant = constant;
12679 }
12680 freeType = 1;
12681 if(type && _class->templateClass)
12682 type->passAsTemplate = 1;
12683 if(type)
12684 {
12685 }
12686 }
12687 }
12688 }
12689 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
12690 {
12691 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
12692 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
12693 int paramCount = 0;
12694 int lastParam = -1;
12695 char templateString[1024];
12696 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
12697
12698 sprintf(templateString, "%s<", expClass->templateClass->fullName);
12699 for(cClass = expClass; cClass; cClass = cClass->base)
12700 {
12701 int p = 0;
12702
12703 if(cClass->templateClass)
12704 cClass = cClass->templateClass;
12705 for(param = cClass->templateParams.first; param; param = param->next)
12706 {
12707 int id = p;
12708 struct __ecereNameSpace__ecere__com__Class * sClass;
12709 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
12710
12711 for(sClass = cClass->base; sClass; sClass = sClass->base)
12712 {
12713 if(sClass->templateClass)
12714 sClass = sClass->templateClass;
12715 id += sClass->templateParams.count;
12716 }
12717 arg = expClass->templateArgs[id];
12718 for(sClass = _class; sClass; sClass = sClass->base)
12719 {
12720 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
12721 int p = 0;
12722 struct __ecereNameSpace__ecere__com__Class * nextClass;
12723
12724 if(sClass->templateClass)
12725 sClass = sClass->templateClass;
12726 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
12727 {
12728 if(nextClass->templateClass)
12729 nextClass = nextClass->templateClass;
12730 p += nextClass->templateParams.count;
12731 }
12732 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
12733 {
12734 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
12735 {
12736 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12737 {
12738 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
12739 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
12740 break;
12741 }
12742 }
12743 }
12744 }
12745 {
12746 char argument[256];
12747
12748 argument[0] = '\0';
12749 switch(param->type)
12750 {
12751 case 2:
12752 {
12753 char expString[1024];
12754 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12755 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
12756 struct Expression * exp;
12757 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
12758
12759 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
12760 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
12761 ProcessExpressionType(exp);
12762 ComputeExpression(exp);
12763 expString[0] = '\0';
12764 PrintExpression(exp, expString);
12765 strcat(argument, expString);
12766 FreeExpression(exp);
12767 break;
12768 }
12769 case 1:
12770 {
12771 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
12772 break;
12773 }
12774 case 0:
12775 {
12776 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12777 strcat(argument, arg.__anon1.__anon1.dataTypeString);
12778 break;
12779 }
12780 }
12781 if(argument[0])
12782 {
12783 if(paramCount)
12784 strcat(templateString, ", ");
12785 if(lastParam != p - 1)
12786 {
12787 strcat(templateString, param->name);
12788 strcat(templateString, " = ");
12789 }
12790 strcat(templateString, argument);
12791 paramCount++;
12792 lastParam = p;
12793 }
12794 p++;
12795 }
12796 }
12797 }
12798 {
12799 int len = strlen(templateString);
12800
12801 if(templateString[len - 1] == '<')
12802 len--;
12803 else
12804 {
12805 if(templateString[len - 1] == '>')
12806 templateString[len++] = ' ';
12807 templateString[len++] = '>';
12808 }
12809 templateString[len++] = '\0';
12810 }
12811 {
12812 struct Context * context = SetupTemplatesContext(_class);
12813
12814 if(freeType)
12815 FreeType(type);
12816 type = ProcessTypeString(templateString, 0);
12817 freeType = 1;
12818 FinishTemplatesContext(context);
12819 }
12820 }
12821 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
12822 {
12823 ProcessExpressionType(member->initializer->__anon1.exp);
12824 if(!member->initializer->__anon1.exp->expType)
12825 {
12826 if(inCompiler)
12827 {
12828 char expString[10240];
12829
12830 expString[0] = '\0';
12831 PrintExpression(member->initializer->__anon1.exp, expString);
12832 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12833 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
12834 }
12835 }
12836 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
12837 {
12838 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
12839 }
12840 }
12841 else if(member->initializer)
12842 {
12843 ProcessInitializer(member->initializer, type);
12844 }
12845 if(freeType)
12846 FreeType(type);
12847 }
12848 else
12849 {
12850 if(_class && _class->type == 3)
12851 {
12852 if(member->initializer)
12853 {
12854 struct Type * type = MkClassType(_class->fullName);
12855
12856 ProcessInitializer(member->initializer, type);
12857 FreeType(type);
12858 }
12859 }
12860 else
12861 {
12862 if(member->initializer)
12863 {
12864 ProcessInitializer(member->initializer, (((void *)0)));
12865 }
12866 if(ident)
12867 {
12868 if(method)
12869 {
12870 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12871 }
12872 else if(_class)
12873 {
12874 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12875 if(inCompiler)
12876 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
12877 }
12878 }
12879 else if(_class)
12880 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
12881 }
12882 }
12883 }
12884
12885 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
12886 {
12887 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
12888
12889 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)))
12890 {
12891 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
12892
12893 if(_class->type == 4)
12894 {
12895 struct __ecereNameSpace__ecere__sys__OldList converts =
12896 {
12897 0, 0, 0, 0, 0
12898 };
12899 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12900
12901 type->kind = 8;
12902 if(!_class->symbol)
12903 _class->symbol = FindClass(_class->fullName);
12904 type->__anon1._class = _class->symbol;
12905 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))
12906 {
12907 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12908 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12909
12910 if(enumClass)
12911 {
12912 struct __ecereNameSpace__ecere__com__Class * baseClass;
12913
12914 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12915 {
12916 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12917
12918 for(value = e->values.first; value; value = value->next)
12919 {
12920 if(!strcmp(value->name, string))
12921 break;
12922 }
12923 if(value)
12924 {
12925 FreeType(sourceExp->expType);
12926 sourceExp->isConstant = 1;
12927 sourceExp->expType = MkClassType(baseClass->fullName);
12928 if(inCompiler || inPreCompiler || inDebugger)
12929 {
12930 char constant[256];
12931
12932 FreeExpContents(sourceExp);
12933 sourceExp->type = 2;
12934 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
12935 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
12936 else
12937 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
12938 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12939 }
12940 while(converts.first)
12941 {
12942 struct Conversion * convert = converts.first;
12943
12944 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
12945 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
12946 }
12947 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12948 return 1;
12949 }
12950 }
12951 }
12952 }
12953 if(converts.first)
12954 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12955 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12956 }
12957 }
12958 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)))
12959 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
12960 return 1;
12961 return 0;
12962 }
12963
12964 void ComputeExpression(struct Expression * exp)
12965 {
12966 switch(exp->type)
12967 {
12968 case 0:
12969 {
12970 struct Identifier * id = exp->__anon1.__anon1.identifier;
12971
12972 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
12973 {
12974 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
12975
12976 if(c && c->type == 4)
12977 {
12978 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12979
12980 if(enumClass)
12981 {
12982 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12983 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
12984
12985 for(value = e->values.first; value; value = value->next)
12986 {
12987 if(!strcmp(value->name, id->string))
12988 break;
12989 }
12990 if(value)
12991 {
12992 const char * dts = c->dataTypeString;
12993
12994 FreeExpContents(exp);
12995 exp->type = 2;
12996 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
12997 }
12998 }
12999 }
13000 }
13001 break;
13002 }
13003 case 1:
13004 {
13005 ComputeInstantiation(exp);
13006 break;
13007 }
13008 case 4:
13009 {
13010 struct Expression * exp1, * exp2 = (((void *)0));
13011 struct Operand op1 =
13012 {
13013 0, 0, 0,
13014 .__anon1 = {
13015 .c = 0
13016 },
13017 {
13018 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13019 }
13020 };
13021 struct Operand op2 =
13022 {
13023 0, 0, 0,
13024 .__anon1 = {
13025 .c = 0
13026 },
13027 {
13028 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13029 }
13030 };
13031
13032 if(exp->__anon1.op.exp2)
13033 {
13034 struct Expression * e = exp->__anon1.op.exp2;
13035
13036 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13037 {
13038 if(e->type == 5 || e->type == 32 || e->type == 23)
13039 {
13040 if(e->type == 23)
13041 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13042 else
13043 e = (*e->__anon1.list).last;
13044 }
13045 }
13046 if(exp->__anon1.op.op == 261 && e && e->expType)
13047 {
13048 if(e->type == 3 && e->__anon1.__anon2.string)
13049 {
13050 char * string = e->__anon1.__anon2.string;
13051 int len = strlen(string);
13052 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13053
13054 len = UnescapeString(tmp, string + 1, len - 2);
13055 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13056 FreeExpContents(exp);
13057 exp->type = 2;
13058 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13059 }
13060 else
13061 {
13062 struct Type * type = e->expType;
13063
13064 type->refCount++;
13065 FreeExpContents(exp);
13066 exp->type = 2;
13067 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13068 FreeType(type);
13069 }
13070 break;
13071 }
13072 else
13073 ComputeExpression(exp->__anon1.op.exp2);
13074 }
13075 if(exp->__anon1.op.exp1)
13076 {
13077 ComputeExpression(exp->__anon1.op.exp1);
13078 exp1 = exp->__anon1.op.exp1;
13079 exp2 = exp->__anon1.op.exp2;
13080 op1 = GetOperand(exp1);
13081 if(op1.type)
13082 op1.type->refCount++;
13083 if(exp2)
13084 {
13085 op2 = GetOperand(exp2);
13086 if(op2.type)
13087 op2.type->refCount++;
13088 }
13089 }
13090 else
13091 {
13092 exp1 = exp->__anon1.op.exp2;
13093 op1 = GetOperand(exp1);
13094 if(op1.type)
13095 op1.type->refCount++;
13096 }
13097 CallOperator(exp, exp1, exp2, &op1, &op2);
13098 if(op1.type)
13099 FreeType(op1.type);
13100 if(op2.type)
13101 FreeType(op2.type);
13102 break;
13103 }
13104 case 5:
13105 case 32:
13106 {
13107 struct Expression * e, * n;
13108
13109 for(e = (*exp->__anon1.list).first; e; e = n)
13110 {
13111 n = e->next;
13112 if(!n)
13113 {
13114 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13115 struct Expression * prev = exp->prev;
13116 struct Expression * next = exp->next;
13117
13118 ComputeExpression(e);
13119 FreeType(exp->expType);
13120 FreeType(exp->destType);
13121 *exp = *e;
13122 exp->prev = prev;
13123 exp->next = next;
13124 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13125 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13126 }
13127 else
13128 {
13129 FreeExpression(e);
13130 }
13131 }
13132 break;
13133 }
13134 case 8:
13135 {
13136 struct Expression * memberExp = exp->__anon1.member.exp;
13137 struct Identifier * memberID = exp->__anon1.member.member;
13138 struct Type * type;
13139
13140 ComputeExpression(exp->__anon1.member.exp);
13141 type = exp->__anon1.member.exp->expType;
13142 if(type)
13143 {
13144 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)));
13145 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13146 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13147 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
13148
13149 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
13150 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13151 if(!_class)
13152 {
13153 char string[256];
13154 struct Symbol * classSym;
13155
13156 string[0] = '\0';
13157 PrintTypeNoConst(type, string, 0, 1);
13158 classSym = FindClass(string);
13159 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13160 }
13161 if(exp->__anon1.member.member)
13162 {
13163 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
13164 if(!prop)
13165 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
13166 }
13167 if(!prop && !member && _class && exp->__anon1.member.member)
13168 {
13169 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
13170
13171 convertTo = _class;
13172 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13173 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
13174 }
13175 if(prop)
13176 {
13177 if(prop->compiled)
13178 {
13179 struct Type * type = prop->dataType;
13180
13181 if(_class->type == 3)
13182 {
13183 if(type->kind == 8)
13184 {
13185 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13186
13187 if(_class->type == 3)
13188 {
13189 if(!_class->dataType)
13190 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13191 type = _class->dataType;
13192 }
13193 }
13194 switch(type->kind)
13195 {
13196 case 6:
13197 {
13198 float value;
13199 float (* Get)(float) = (void *)prop->Get;
13200
13201 GetFloat(exp->__anon1.member.exp, &value);
13202 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
13203 exp->type = 2;
13204 break;
13205 }
13206 case 7:
13207 {
13208 double value;
13209 double (* Get)(double);
13210
13211 GetDouble(exp->__anon1.member.exp, &value);
13212 if(convertTo)
13213 Get = (void *)prop->Set;
13214 else
13215 Get = (void *)prop->Get;
13216 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
13217 exp->type = 2;
13218 break;
13219 }
13220 }
13221 }
13222 else
13223 {
13224 if(convertTo)
13225 {
13226 struct Expression * value = exp->__anon1.member.exp;
13227 struct Type * type;
13228
13229 if(!prop->dataType)
13230 ProcessPropertyType(prop);
13231 type = prop->dataType;
13232 if(!type)
13233 {
13234 }
13235 else if(_class->type == 1)
13236 {
13237 switch(type->kind)
13238 {
13239 case 8:
13240 {
13241 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13242
13243 if(propertyClass->type == 1 && value->type == 1)
13244 {
13245 void (* Set)(void *, void *) = (void *)prop->Set;
13246
13247 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13248 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13249 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13250 exp->__anon1.instance->loc = exp->loc;
13251 exp->type = 1;
13252 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
13253 PopulateInstance(exp->__anon1.instance);
13254 }
13255 break;
13256 }
13257 case 3:
13258 {
13259 int intValue;
13260 void (* Set)(void *, int) = (void *)prop->Set;
13261
13262 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13263 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13264 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13265 exp->__anon1.instance->loc = exp->loc;
13266 exp->type = 1;
13267 GetInt(value, &intValue);
13268 Set(exp->__anon1.instance->data, intValue);
13269 PopulateInstance(exp->__anon1.instance);
13270 break;
13271 }
13272 case 4:
13273 {
13274 long long intValue;
13275 void (* Set)(void *, long long) = (void *)prop->Set;
13276
13277 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13278 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13279 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13280 exp->__anon1.instance->loc = exp->loc;
13281 exp->type = 1;
13282 GetInt64(value, &intValue);
13283 Set(exp->__anon1.instance->data, intValue);
13284 PopulateInstance(exp->__anon1.instance);
13285 break;
13286 }
13287 case 22:
13288 {
13289 intptr_t intValue;
13290 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13291
13292 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13293 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13294 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13295 exp->__anon1.instance->loc = exp->loc;
13296 exp->type = 1;
13297 GetIntPtr(value, &intValue);
13298 Set(exp->__anon1.instance->data, intValue);
13299 PopulateInstance(exp->__anon1.instance);
13300 break;
13301 }
13302 case 23:
13303 {
13304 ssize_t intValue;
13305 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13306
13307 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13308 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13309 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13310 exp->__anon1.instance->loc = exp->loc;
13311 exp->type = 1;
13312 GetIntSize(value, &intValue);
13313 Set(exp->__anon1.instance->data, intValue);
13314 PopulateInstance(exp->__anon1.instance);
13315 break;
13316 }
13317 case 6:
13318 {
13319 float floatValue;
13320 void (* Set)(void *, float) = (void *)prop->Set;
13321
13322 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13323 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13324 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13325 exp->__anon1.instance->loc = exp->loc;
13326 exp->type = 1;
13327 GetFloat(value, &floatValue);
13328 Set(exp->__anon1.instance->data, floatValue);
13329 PopulateInstance(exp->__anon1.instance);
13330 break;
13331 }
13332 case 7:
13333 {
13334 double doubleValue;
13335 void (* Set)(void *, double) = (void *)prop->Set;
13336
13337 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13338 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13339 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13340 exp->__anon1.instance->loc = exp->loc;
13341 exp->type = 1;
13342 GetDouble(value, &doubleValue);
13343 Set(exp->__anon1.instance->data, doubleValue);
13344 PopulateInstance(exp->__anon1.instance);
13345 break;
13346 }
13347 }
13348 }
13349 else if(_class->type == 2)
13350 {
13351 switch(type->kind)
13352 {
13353 case 8:
13354 {
13355 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13356
13357 if(propertyClass->type == 1 && value->__anon1.instance->data)
13358 {
13359 unsigned int (* Set)(void *) = (void *)prop->Set;
13360 unsigned int bits = Set(value->__anon1.instance->data);
13361
13362 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13363 exp->type = 2;
13364 break;
13365 }
13366 else if(_class->type == 2)
13367 {
13368 unsigned int value;
13369 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
13370 unsigned int bits;
13371
13372 GetUInt(exp->__anon1.member.exp, &value);
13373 bits = Set(value);
13374 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13375 exp->type = 2;
13376 }
13377 }
13378 }
13379 }
13380 }
13381 else
13382 {
13383 if(_class->type == 2)
13384 {
13385 unsigned int value;
13386
13387 GetUInt(exp->__anon1.member.exp, &value);
13388 switch(type->kind)
13389 {
13390 case 8:
13391 {
13392 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13393
13394 if(_class->type == 1)
13395 {
13396 void (* Get)(unsigned int, void *) = (void *)prop->Get;
13397
13398 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13399 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13400 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13401 exp->__anon1.instance->loc = exp->loc;
13402 exp->type = 1;
13403 Get(value, exp->__anon1.instance->data);
13404 PopulateInstance(exp->__anon1.instance);
13405 }
13406 else if(_class->type == 2)
13407 {
13408 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
13409 uint64 bits = Get(value);
13410
13411 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
13412 exp->type = 2;
13413 }
13414 break;
13415 }
13416 }
13417 }
13418 else if(_class->type == 1)
13419 {
13420 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
13421
13422 switch(type->kind)
13423 {
13424 case 8:
13425 {
13426 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13427
13428 if(_class->type == 1 && value)
13429 {
13430 void (* Get)(void *, void *) = (void *)prop->Get;
13431
13432 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13433 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13434 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13435 exp->__anon1.instance->loc = exp->loc;
13436 exp->type = 1;
13437 Get(value, exp->__anon1.instance->data);
13438 PopulateInstance(exp->__anon1.instance);
13439 }
13440 break;
13441 }
13442 }
13443 }
13444 }
13445 }
13446 }
13447 else
13448 {
13449 exp->isConstant = 0;
13450 }
13451 }
13452 else if(member)
13453 {
13454 }
13455 }
13456 if(exp->type != 8)
13457 {
13458 FreeExpression(memberExp);
13459 FreeIdentifier(memberID);
13460 }
13461 break;
13462 }
13463 case 10:
13464 {
13465 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
13466
13467 FreeExpContents(exp);
13468 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13469 exp->type = 2;
13470 FreeType(type);
13471 break;
13472 }
13473 case 15:
13474 {
13475 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
13476
13477 if(classSym && classSym->__anon1.registered)
13478 {
13479 if(classSym->__anon1.registered->fixed)
13480 {
13481 FreeSpecifier(exp->__anon1._class);
13482 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
13483 exp->type = 2;
13484 }
13485 else
13486 {
13487 char className[1024];
13488
13489 strcpy(className, "__ecereClass_");
13490 FullClassNameCat(className, classSym->string, 1);
13491 DeclareClass(curExternal, classSym, className);
13492 FreeExpContents(exp);
13493 exp->type = 9;
13494 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
13495 exp->__anon1.member.member = MkIdentifier("structSize");
13496 }
13497 }
13498 break;
13499 }
13500 case 11:
13501 {
13502 struct Type * type;
13503 struct Expression * e = exp;
13504
13505 if(exp->type == 11)
13506 {
13507 if(exp->__anon1.cast.exp)
13508 ComputeExpression(exp->__anon1.cast.exp);
13509 e = exp->__anon1.cast.exp;
13510 }
13511 if(e && exp->expType)
13512 {
13513 type = exp->expType;
13514 if(type->kind == 8)
13515 {
13516 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13517
13518 if(_class && (_class->type == 3 || _class->type == 2))
13519 {
13520 if(!_class->dataType)
13521 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13522 type = _class->dataType;
13523 }
13524 }
13525 switch(type->kind)
13526 {
13527 case 24:
13528 case 1:
13529 if(type->isSigned)
13530 {
13531 char value = (char)0;
13532
13533 if(GetChar(e, &value))
13534 {
13535 FreeExpContents(exp);
13536 exp->__anon1.__anon1.constant = PrintChar(value);
13537 exp->type = 2;
13538 }
13539 }
13540 else
13541 {
13542 unsigned char value = (unsigned char)0;
13543
13544 if(GetUChar(e, &value))
13545 {
13546 FreeExpContents(exp);
13547 exp->__anon1.__anon1.constant = PrintUChar(value);
13548 exp->type = 2;
13549 }
13550 }
13551 break;
13552 case 2:
13553 if(type->isSigned)
13554 {
13555 short value = (short)0;
13556
13557 if(GetShort(e, &value))
13558 {
13559 FreeExpContents(exp);
13560 exp->__anon1.__anon1.constant = PrintShort(value);
13561 exp->type = 2;
13562 }
13563 }
13564 else
13565 {
13566 unsigned short value = (unsigned short)0;
13567
13568 if(GetUShort(e, &value))
13569 {
13570 FreeExpContents(exp);
13571 exp->__anon1.__anon1.constant = PrintUShort(value);
13572 exp->type = 2;
13573 }
13574 }
13575 break;
13576 case 3:
13577 if(type->isSigned)
13578 {
13579 int value = 0;
13580
13581 if(GetInt(e, &value))
13582 {
13583 FreeExpContents(exp);
13584 exp->__anon1.__anon1.constant = PrintInt(value);
13585 exp->type = 2;
13586 }
13587 }
13588 else
13589 {
13590 unsigned int value = 0;
13591
13592 if(GetUInt(e, &value))
13593 {
13594 FreeExpContents(exp);
13595 exp->__anon1.__anon1.constant = PrintUInt(value);
13596 exp->type = 2;
13597 }
13598 }
13599 break;
13600 case 4:
13601 if(type->isSigned)
13602 {
13603 long long value = 0;
13604
13605 if(GetInt64(e, &value))
13606 {
13607 FreeExpContents(exp);
13608 exp->__anon1.__anon1.constant = PrintInt64(value);
13609 exp->type = 2;
13610 }
13611 }
13612 else
13613 {
13614 uint64 value = 0;
13615
13616 if(GetUInt64(e, &value))
13617 {
13618 FreeExpContents(exp);
13619 exp->__anon1.__anon1.constant = PrintUInt64(value);
13620 exp->type = 2;
13621 }
13622 }
13623 break;
13624 case 22:
13625 if(type->isSigned)
13626 {
13627 intptr_t value = 0;
13628
13629 if(GetIntPtr(e, &value))
13630 {
13631 FreeExpContents(exp);
13632 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13633 exp->type = 2;
13634 }
13635 }
13636 else
13637 {
13638 uintptr_t value = 0;
13639
13640 if(GetUIntPtr(e, &value))
13641 {
13642 FreeExpContents(exp);
13643 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13644 exp->type = 2;
13645 }
13646 }
13647 break;
13648 case 23:
13649 if(type->isSigned)
13650 {
13651 ssize_t value = 0;
13652
13653 if(GetIntSize(e, &value))
13654 {
13655 FreeExpContents(exp);
13656 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13657 exp->type = 2;
13658 }
13659 }
13660 else
13661 {
13662 size_t value = 0;
13663
13664 if(GetUIntSize(e, &value))
13665 {
13666 FreeExpContents(exp);
13667 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13668 exp->type = 2;
13669 }
13670 }
13671 break;
13672 case 6:
13673 {
13674 float value = 0;
13675
13676 if(GetFloat(e, &value))
13677 {
13678 FreeExpContents(exp);
13679 exp->__anon1.__anon1.constant = PrintFloat(value);
13680 exp->type = 2;
13681 }
13682 break;
13683 }
13684 case 7:
13685 {
13686 double value = 0;
13687
13688 if(GetDouble(e, &value))
13689 {
13690 FreeExpContents(exp);
13691 exp->__anon1.__anon1.constant = PrintDouble(value);
13692 exp->type = 2;
13693 }
13694 break;
13695 }
13696 }
13697 }
13698 break;
13699 }
13700 case 12:
13701 {
13702 struct Operand op1 =
13703 {
13704 0, 0, 0,
13705 .__anon1 = {
13706 .c = 0
13707 },
13708 {
13709 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13710 }
13711 };
13712 struct Operand op2 =
13713 {
13714 0, 0, 0,
13715 .__anon1 = {
13716 .c = 0
13717 },
13718 {
13719 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13720 }
13721 };
13722 struct Operand op3 =
13723 {
13724 0, 0, 0,
13725 .__anon1 = {
13726 .c = 0
13727 },
13728 {
13729 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13730 }
13731 };
13732
13733 if(exp->__anon1.cond.exp)
13734 ComputeExpression((*exp->__anon1.cond.exp).last);
13735 if(exp->__anon1.cond.elseExp)
13736 ComputeExpression(exp->__anon1.cond.elseExp);
13737 if(exp->__anon1.cond.cond)
13738 ComputeExpression(exp->__anon1.cond.cond);
13739 op1 = GetOperand(exp->__anon1.cond.cond);
13740 if(op1.type)
13741 op1.type->refCount++;
13742 op2 = GetOperand((*exp->__anon1.cond.exp).last);
13743 if(op2.type)
13744 op2.type->refCount++;
13745 op3 = GetOperand(exp->__anon1.cond.elseExp);
13746 if(op3.type)
13747 op3.type->refCount++;
13748 if(op1.ops.Cond)
13749 {
13750 FreeExpContents(exp);
13751 op1.ops.Cond(exp, &op1, &op2, &op3);
13752 }
13753 if(op1.type)
13754 FreeType(op1.type);
13755 if(op2.type)
13756 FreeType(op2.type);
13757 if(op3.type)
13758 FreeType(op3.type);
13759 break;
13760 }
13761 }
13762 }
13763
13764 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
13765 {
13766 struct __ecereNameSpace__ecere__com__Instance * module;
13767
13768 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))
13769 return 1;
13770 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))
13771 return 1;
13772 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))
13773 return 1;
13774 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)
13775 {
13776 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
13777 return 1;
13778 }
13779 return 0;
13780 }
13781
13782 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
13783 {
13784 struct Type * source;
13785 struct Type * realDest = dest;
13786 struct Type * backupSourceExpType = (((void *)0));
13787 struct Expression * computedExp = sourceExp;
13788
13789 dest->refCount++;
13790 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)
13791 {
13792 computedExp = CopyExpression(sourceExp);
13793 ComputeExpression(computedExp);
13794 }
13795 source = sourceExp->expType;
13796 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
13797 {
13798 if(computedExp != sourceExp)
13799 {
13800 FreeExpression(computedExp);
13801 computedExp = sourceExp;
13802 }
13803 FreeType(dest);
13804 return 1;
13805 }
13806 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
13807 {
13808 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
13809 {
13810 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
13811
13812 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
13813 ;
13814 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
13815 ;
13816 if(sourceBase == destBase)
13817 {
13818 if(computedExp != sourceExp)
13819 {
13820 FreeExpression(computedExp);
13821 computedExp = sourceExp;
13822 }
13823 FreeType(dest);
13824 return 1;
13825 }
13826 }
13827 }
13828 if(source)
13829 {
13830 struct __ecereNameSpace__ecere__sys__OldList * specs;
13831 unsigned int flag = 0;
13832 long long value = (((int)0x7fffffff));
13833
13834 source->refCount++;
13835 if(computedExp->type == 2)
13836 {
13837 if(source->isSigned)
13838 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13839 else
13840 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13841 }
13842 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
13843 {
13844 if(source->isSigned)
13845 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13846 else
13847 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13848 }
13849 if(computedExp != sourceExp)
13850 {
13851 FreeExpression(computedExp);
13852 computedExp = sourceExp;
13853 }
13854 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "ecere::com::unichar"))
13855 {
13856 FreeType(source);
13857 source = __extension__ ({
13858 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13859
13860 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
13861 });
13862 }
13863 if(dest->kind == 8)
13864 {
13865 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13866
13867 if(_class && _class->type == 3)
13868 {
13869 if(source->kind != 8)
13870 {
13871 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13872 struct Type * tempDest, * tempSource;
13873
13874 for(; _class->base->type != 1000; _class = _class->base)
13875 ;
13876 tempSource = dest;
13877 tempDest = tempType;
13878 tempType->kind = 8;
13879 if(!_class->symbol)
13880 _class->symbol = FindClass(_class->fullName);
13881 tempType->__anon1._class = _class->symbol;
13882 tempType->truth = dest->truth;
13883 if(tempType->__anon1._class)
13884 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13885 backupSourceExpType = sourceExp->expType;
13886 if(dest->passAsTemplate)
13887 {
13888 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13889 CopyTypeInto(sourceExp->expType, dest);
13890 sourceExp->expType->passAsTemplate = 0;
13891 }
13892 else
13893 {
13894 sourceExp->expType = dest;
13895 dest->refCount++;
13896 }
13897 flag = 1;
13898 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13899 }
13900 }
13901 if(_class && _class->type == 2 && source->kind != 8)
13902 {
13903 if(!dest->__anon1._class->__anon1.registered->dataType)
13904 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
13905 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13906 {
13907 FreeType(source);
13908 FreeType(sourceExp->expType);
13909 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
13910 source->refCount++;
13911 }
13912 }
13913 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
13914 {
13915 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13916 struct Declarator * decl;
13917 char string[1024];
13918
13919 ReadString(string, sourceExp->__anon1.__anon2.string);
13920 decl = SpecDeclFromString(string, specs, (((void *)0)));
13921 FreeExpContents(sourceExp);
13922 FreeType(sourceExp->expType);
13923 sourceExp->type = 24;
13924 sourceExp->__anon1._classExp.specifiers = specs;
13925 sourceExp->__anon1._classExp.decl = decl;
13926 sourceExp->expType = dest;
13927 dest->refCount++;
13928 FreeType(source);
13929 FreeType(dest);
13930 if(backupSourceExpType)
13931 FreeType(backupSourceExpType);
13932 return 1;
13933 }
13934 }
13935 else if(source->kind == 8)
13936 {
13937 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
13938
13939 if(_class && (_class->type == 3 || _class->type == 2))
13940 {
13941 if(dest->kind != 8)
13942 {
13943 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13944 struct Type * tempDest, * tempSource;
13945
13946 if(!source->__anon1._class->__anon1.registered->dataType)
13947 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
13948 for(; _class->base->type != 1000; _class = _class->base)
13949 ;
13950 tempDest = source;
13951 tempSource = tempType;
13952 tempType->kind = 8;
13953 tempType->__anon1._class = FindClass(_class->fullName);
13954 tempType->truth = source->truth;
13955 tempType->classObjectType = source->classObjectType;
13956 if(tempType->__anon1._class)
13957 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13958 if(conversions && conversions->last)
13959 {
13960 ((struct Conversion *)conversions->last)->resultType = dest;
13961 dest->refCount++;
13962 }
13963 FreeType(sourceExp->expType);
13964 sourceExp->expType = MkClassType(_class->fullName);
13965 sourceExp->expType->truth = source->truth;
13966 sourceExp->expType->classObjectType = source->classObjectType;
13967 if(!sourceExp->destType)
13968 {
13969 FreeType(sourceExp->destType);
13970 sourceExp->destType = sourceExp->expType;
13971 if(sourceExp->expType)
13972 sourceExp->expType->refCount++;
13973 }
13974 if(!_class->dataType)
13975 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13976 FreeType(dest);
13977 dest = MkClassType(source->__anon1._class->string);
13978 dest->truth = source->truth;
13979 dest->classObjectType = source->classObjectType;
13980 FreeType(source);
13981 source = _class->dataType;
13982 source->refCount++;
13983 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13984 }
13985 }
13986 }
13987 if(!flag)
13988 {
13989 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13990 {
13991 FreeType(source);
13992 FreeType(dest);
13993 return 1;
13994 }
13995 }
13996 if(dest->kind == 8)
13997 {
13998 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13999 unsigned int fittingValue = 0;
14000
14001 if(_class && _class->type == 4)
14002 {
14003 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14004 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14005
14006 if(c && value >= 0 && value <= c->largest)
14007 fittingValue = 1;
14008 }
14009 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
14010 {
14011 if(_class->type == 0 || _class->type == 5)
14012 {
14013 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14014
14015 *newExp = *sourceExp;
14016 if(sourceExp->destType)
14017 sourceExp->destType->refCount++;
14018 if(sourceExp->expType)
14019 sourceExp->expType->refCount++;
14020 sourceExp->type = 11;
14021 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
14022 sourceExp->__anon1.cast.exp = newExp;
14023 FreeType(sourceExp->expType);
14024 sourceExp->expType = (((void *)0));
14025 ProcessExpressionType(sourceExp);
14026 if(!inCompiler)
14027 {
14028 FreeType(sourceExp->expType);
14029 sourceExp->expType = dest;
14030 }
14031 FreeType(source);
14032 if(inCompiler)
14033 FreeType(dest);
14034 if(backupSourceExpType)
14035 FreeType(backupSourceExpType);
14036 return 1;
14037 }
14038 if(!_class->dataType)
14039 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14040 FreeType(dest);
14041 dest = _class->dataType;
14042 dest->refCount++;
14043 }
14044 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))
14045 {
14046 specs = MkListOne(MkSpecifier(DOUBLE));
14047 }
14048 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))
14049 {
14050 specs = MkListOne(MkSpecifier(FLOAT));
14051 }
14052 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))
14053 {
14054 specs = MkList();
14055 if(!dest->isSigned)
14056 ListAdd(specs, MkSpecifier(UNSIGNED));
14057 ListAdd(specs, MkSpecifier(INT64));
14058 }
14059 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
14060 {
14061 specs = MkList();
14062 if(!dest->isSigned)
14063 ListAdd(specs, MkSpecifier(UNSIGNED));
14064 ListAdd(specs, MkSpecifier(INT));
14065 }
14066 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14067 {
14068 specs = MkList();
14069 if(!dest->isSigned)
14070 ListAdd(specs, MkSpecifier(UNSIGNED));
14071 ListAdd(specs, MkSpecifier(SHORT));
14072 }
14073 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14074 {
14075 specs = MkList();
14076 if(!dest->isSigned)
14077 ListAdd(specs, MkSpecifier(UNSIGNED));
14078 ListAdd(specs, MkSpecifier(CHAR));
14079 }
14080 else
14081 {
14082 FreeType(source);
14083 FreeType(dest);
14084 if(backupSourceExpType)
14085 {
14086 if(sourceExp->expType)
14087 FreeType(sourceExp->expType);
14088 sourceExp->expType = backupSourceExpType;
14089 }
14090 return 0;
14091 }
14092 }
14093 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))
14094 {
14095 specs = MkListOne(MkSpecifier(DOUBLE));
14096 }
14097 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))
14098 {
14099 specs = MkListOne(MkSpecifier(FLOAT));
14100 }
14101 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
14102 {
14103 specs = MkList();
14104 ListAdd(specs, MkSpecifier(BOOL));
14105 }
14106 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)))
14107 {
14108 specs = MkList();
14109 if(!dest->isSigned)
14110 ListAdd(specs, MkSpecifier(UNSIGNED));
14111 ListAdd(specs, MkSpecifier(CHAR));
14112 }
14113 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)))))
14114 {
14115 specs = MkList();
14116 if(!dest->isSigned)
14117 ListAdd(specs, MkSpecifier(UNSIGNED));
14118 ListAdd(specs, MkSpecifier(SHORT));
14119 }
14120 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
14121 {
14122 specs = MkList();
14123 if(!dest->isSigned)
14124 ListAdd(specs, MkSpecifier(UNSIGNED));
14125 ListAdd(specs, MkSpecifier(INT));
14126 }
14127 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
14128 {
14129 specs = MkList();
14130 if(!dest->isSigned)
14131 ListAdd(specs, MkSpecifier(UNSIGNED));
14132 ListAdd(specs, MkSpecifier(INT64));
14133 }
14134 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
14135 {
14136 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
14137 }
14138 else
14139 {
14140 FreeType(source);
14141 FreeType(dest);
14142 if(backupSourceExpType)
14143 {
14144 if(sourceExp->expType)
14145 FreeType(sourceExp->expType);
14146 sourceExp->expType = backupSourceExpType;
14147 }
14148 return 0;
14149 }
14150 if(!flag && !sourceExp->opDestType)
14151 {
14152 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14153
14154 *newExp = *sourceExp;
14155 newExp->prev = (((void *)0));
14156 newExp->next = (((void *)0));
14157 if(sourceExp->destType)
14158 sourceExp->destType->refCount++;
14159 if(sourceExp->expType)
14160 sourceExp->expType->refCount++;
14161 sourceExp->type = 11;
14162 if(realDest->kind == 8)
14163 {
14164 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
14165 FreeList(specs, (void *)(FreeSpecifier));
14166 }
14167 else
14168 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
14169 if(newExp->type == 4)
14170 {
14171 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
14172 }
14173 else
14174 sourceExp->__anon1.cast.exp = newExp;
14175 FreeType(sourceExp->expType);
14176 sourceExp->expType = (((void *)0));
14177 ProcessExpressionType(sourceExp);
14178 }
14179 else
14180 FreeList(specs, (void *)(FreeSpecifier));
14181 FreeType(dest);
14182 FreeType(source);
14183 if(backupSourceExpType)
14184 FreeType(backupSourceExpType);
14185 return 1;
14186 }
14187 else
14188 {
14189 if(computedExp != sourceExp)
14190 {
14191 FreeExpression(computedExp);
14192 computedExp = sourceExp;
14193 }
14194 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
14195 sourceExp = (*sourceExp->__anon1.list).last;
14196 if(sourceExp->type == 0)
14197 {
14198 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
14199
14200 if(dest->kind == 8)
14201 {
14202 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
14203 {
14204 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
14205 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14206
14207 if(enumClass)
14208 {
14209 for(; _class && _class->type == 4; _class = _class->base)
14210 {
14211 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
14212 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14213
14214 for(value = e->values.first; value; value = value->next)
14215 {
14216 if(!strcmp(value->name, id->string))
14217 break;
14218 }
14219 if(value)
14220 {
14221 FreeType(sourceExp->expType);
14222 sourceExp->isConstant = 1;
14223 sourceExp->expType = MkClassType(_class->fullName);
14224 if(inCompiler || inPreCompiler || inDebugger)
14225 {
14226 FreeExpContents(sourceExp);
14227 sourceExp->type = 2;
14228 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
14229 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
14230 else
14231 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
14232 }
14233 FreeType(dest);
14234 return 1;
14235 }
14236 }
14237 }
14238 }
14239 }
14240 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
14241 {
14242 FreeType(dest);
14243 return 1;
14244 }
14245 }
14246 FreeType(dest);
14247 }
14248 return 0;
14249 }
14250
14251 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
14252 {
14253 unsigned int result = 1;
14254
14255 if(destType)
14256 {
14257 struct __ecereNameSpace__ecere__sys__OldList converts =
14258 {
14259 0, 0, 0, 0, 0
14260 };
14261 struct Conversion * convert;
14262
14263 if(destType->kind == 0)
14264 return 0;
14265 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
14266 result = 0;
14267 if(converts.count)
14268 {
14269 for(convert = converts.first; convert; convert = convert->next)
14270 {
14271 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
14272
14273 if(!empty)
14274 {
14275 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14276 int objectType = exp->expType ? exp->expType->classObjectType : 0;
14277
14278 *newExp = *exp;
14279 newExp->prev = (((void *)0));
14280 newExp->next = (((void *)0));
14281 newExp->destType = (((void *)0));
14282 if(convert->isGet)
14283 {
14284 exp->type = 8;
14285 exp->addedThis = 1;
14286 exp->__anon1.member.exp = newExp;
14287 FreeType(exp->__anon1.member.exp->expType);
14288 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
14289 exp->__anon1.member.exp->expType->classObjectType = objectType;
14290 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
14291 exp->__anon1.member.memberType = 1;
14292 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14293 exp->needCast = 1;
14294 if(exp->expType)
14295 exp->expType->refCount++;
14296 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14297 }
14298 else
14299 {
14300 {
14301 exp->type = 8;
14302 exp->addedThis = 1;
14303 exp->__anon1.member.exp = newExp;
14304 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)
14305 {
14306 newExp->byReference = 1;
14307 }
14308 FreeType(exp->__anon1.member.exp->expType);
14309 exp->__anon1.member.exp->expType = (((void *)0));
14310 if(convert->convert->dataType)
14311 {
14312 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14313 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
14314 exp->__anon1.member.exp->expType->refCount = 1;
14315 exp->__anon1.member.exp->expType->classObjectType = objectType;
14316 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14317 }
14318 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
14319 exp->__anon1.member.memberType = 4;
14320 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14321 exp->needCast = 1;
14322 if(convert->resultType)
14323 convert->resultType->refCount++;
14324 }
14325 }
14326 }
14327 else
14328 {
14329 FreeType(exp->expType);
14330 if(convert->isGet)
14331 {
14332 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14333 if(exp->destType->casted)
14334 exp->needCast = 1;
14335 if(exp->expType)
14336 exp->expType->refCount++;
14337 }
14338 else
14339 {
14340 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14341 if(exp->destType->casted)
14342 exp->needCast = 1;
14343 if(convert->resultType)
14344 convert->resultType->refCount++;
14345 }
14346 }
14347 }
14348 if(exp->isConstant && inCompiler)
14349 ComputeExpression(exp);
14350 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
14351 }
14352 if(!result && exp->expType && converts.count)
14353 {
14354 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14355 }
14356 if(!result && exp->expType && exp->destType)
14357 {
14358 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))
14359 result = 1;
14360 }
14361 }
14362 return result;
14363 }
14364
14365 static void ProcessFunction(struct FunctionDefinition *  function);
14366
14367 void ProcessInstantiationType(struct Instantiation * inst)
14368 {
14369 yylloc = inst->loc;
14370 if(inst->_class)
14371 {
14372 struct MembersInit * members;
14373 struct Symbol * classSym;
14374 struct __ecereNameSpace__ecere__com__Class * _class;
14375
14376 classSym = inst->_class->__anon1.__anon1.symbol;
14377 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14378 if(!_class || _class->type != 5)
14379 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14380 afterExternal = afterExternal ? afterExternal : curExternal;
14381 if(inst->exp)
14382 ProcessExpressionType(inst->exp);
14383 inst->isConstant = 1;
14384 if(inst->members)
14385 {
14386 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14387 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14388 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14389 int subMemberStackPos = 0;
14390
14391 for(members = (*inst->members).first; members; members = members->next)
14392 {
14393 switch(members->type)
14394 {
14395 case 1:
14396 {
14397 char name[1024];
14398 static unsigned int instMethodID = 0;
14399 struct External * external = curExternal;
14400 struct Context * context = curContext;
14401 struct Declarator * declarator = members->__anon1.function->declarator;
14402 struct Identifier * nameID = GetDeclId(declarator);
14403 char * unmangled = nameID ? nameID->string : (((void *)0));
14404 struct Expression * exp;
14405 struct External * createdExternal = (((void *)0));
14406
14407 if(inCompiler)
14408 {
14409 char number[16];
14410
14411 strcpy(name, "__ecereInstMeth_");
14412 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14413 strcat(name, "_");
14414 strcat(name, nameID->string);
14415 strcat(name, "_");
14416 sprintf(number, "_%08d", instMethodID++);
14417 strcat(name, number);
14418 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14419 }
14420 if(declarator)
14421 {
14422 struct Symbol * symbol = declarator->symbol;
14423 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14424
14425 if(method && method->type == 1)
14426 {
14427 symbol->__anon1.method = method;
14428 ProcessMethodType(method);
14429 if(!symbol->type->__anon1.__anon2.thisClass)
14430 {
14431 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14432 {
14433 if(!currentClass->symbol)
14434 currentClass->symbol = FindClass(currentClass->fullName);
14435 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14436 }
14437 else
14438 {
14439 if(!_class->symbol)
14440 _class->symbol = FindClass(_class->fullName);
14441 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14442 }
14443 }
14444 DeclareType(curExternal, symbol->type, 1, 1);
14445 }
14446 else if(classSym)
14447 {
14448 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14449 }
14450 }
14451 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14452 if(nameID)
14453 {
14454 FreeSpecifier(nameID->_class);
14455 nameID->_class = (((void *)0));
14456 }
14457 curExternal = createdExternal;
14458 if(inCompiler)
14459 {
14460 if(createdExternal->__anon1.function)
14461 ProcessFunction(createdExternal->__anon1.function);
14462 }
14463 else if(declarator)
14464 {
14465 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14466 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14467 }
14468 curExternal = external;
14469 curContext = context;
14470 if(inCompiler)
14471 {
14472 FreeClassFunction(members->__anon1.function);
14473 exp = QMkExpId(name);
14474 members->type = 0;
14475 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14476 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14477 }
14478 break;
14479 }
14480 case 0:
14481 {
14482 if(members->__anon1.dataMembers && classSym)
14483 {
14484 struct MemberInit * member;
14485 struct Location oldyyloc = yylloc;
14486
14487 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14488 {
14489 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14490 if(member->initializer && !member->initializer->isConstant)
14491 inst->isConstant = 0;
14492 }
14493 yylloc = oldyyloc;
14494 }
14495 break;
14496 }
14497 }
14498 }
14499 }
14500 }
14501 }
14502
14503 static void ProcessStatement(struct Statement * stmt)
14504 {
14505 yylloc = stmt->loc;
14506 switch(stmt->type)
14507 {
14508 case 0:
14509 ProcessStatement(stmt->__anon1.labeled.stmt);
14510 break;
14511 case 1:
14512 if(stmt->__anon1.caseStmt.exp)
14513 {
14514 FreeType(stmt->__anon1.caseStmt.exp->destType);
14515 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
14516 if(curSwitchType)
14517 curSwitchType->refCount++;
14518 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
14519 ComputeExpression(stmt->__anon1.caseStmt.exp);
14520 }
14521 if(stmt->__anon1.caseStmt.stmt)
14522 ProcessStatement(stmt->__anon1.caseStmt.stmt);
14523 break;
14524 case 2:
14525 {
14526 if(stmt->__anon1.compound.context)
14527 {
14528 struct Declaration * decl;
14529 struct Statement * s;
14530 struct Statement * prevCompound = curCompound;
14531 struct Context * prevContext = curContext;
14532
14533 if(!stmt->__anon1.compound.isSwitch)
14534 curCompound = stmt;
14535 curContext = stmt->__anon1.compound.context;
14536 if(stmt->__anon1.compound.declarations)
14537 {
14538 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
14539 ProcessDeclaration(decl);
14540 }
14541 if(stmt->__anon1.compound.statements)
14542 {
14543 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
14544 ProcessStatement(s);
14545 }
14546 curContext = prevContext;
14547 curCompound = prevCompound;
14548 }
14549 break;
14550 }
14551 case 3:
14552 {
14553 struct Expression * exp;
14554
14555 if(stmt->__anon1.expressions)
14556 {
14557 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14558 ProcessExpressionType(exp);
14559 }
14560 break;
14561 }
14562 case 4:
14563 {
14564 struct Expression * exp;
14565
14566 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
14567 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
14568 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
14569 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
14570 {
14571 ProcessExpressionType(exp);
14572 }
14573 if(stmt->__anon1.ifStmt.stmt)
14574 ProcessStatement(stmt->__anon1.ifStmt.stmt);
14575 if(stmt->__anon1.ifStmt.elseStmt)
14576 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
14577 break;
14578 }
14579 case 5:
14580 {
14581 struct Type * oldSwitchType = curSwitchType;
14582
14583 if(stmt->__anon1.switchStmt.exp)
14584 {
14585 struct Expression * exp;
14586
14587 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
14588 {
14589 if(!exp->next)
14590 {
14591 ProcessExpressionType(exp);
14592 }
14593 if(!exp->next)
14594 curSwitchType = exp->expType;
14595 }
14596 }
14597 ProcessStatement(stmt->__anon1.switchStmt.stmt);
14598 curSwitchType = oldSwitchType;
14599 break;
14600 }
14601 case 6:
14602 {
14603 if(stmt->__anon1.whileStmt.exp)
14604 {
14605 struct Expression * exp;
14606
14607 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
14608 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
14609 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
14610 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
14611 {
14612 ProcessExpressionType(exp);
14613 }
14614 }
14615 if(stmt->__anon1.whileStmt.stmt)
14616 ProcessStatement(stmt->__anon1.whileStmt.stmt);
14617 break;
14618 }
14619 case 7:
14620 {
14621 if(stmt->__anon1.doWhile.exp)
14622 {
14623 struct Expression * exp;
14624
14625 if((*stmt->__anon1.doWhile.exp).last)
14626 {
14627 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
14628 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
14629 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
14630 }
14631 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
14632 {
14633 ProcessExpressionType(exp);
14634 }
14635 }
14636 if(stmt->__anon1.doWhile.stmt)
14637 ProcessStatement(stmt->__anon1.doWhile.stmt);
14638 break;
14639 }
14640 case 8:
14641 {
14642 struct Expression * exp;
14643
14644 if(stmt->__anon1.forStmt.init)
14645 ProcessStatement(stmt->__anon1.forStmt.init);
14646 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
14647 {
14648 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
14649 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
14650 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
14651 }
14652 if(stmt->__anon1.forStmt.check)
14653 ProcessStatement(stmt->__anon1.forStmt.check);
14654 if(stmt->__anon1.forStmt.increment)
14655 {
14656 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
14657 ProcessExpressionType(exp);
14658 }
14659 if(stmt->__anon1.forStmt.stmt)
14660 ProcessStatement(stmt->__anon1.forStmt.stmt);
14661 break;
14662 }
14663 case 18:
14664 {
14665 struct Identifier * id = stmt->__anon1.forEachStmt.id;
14666 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
14667 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
14668 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
14669 char iteratorType[1024];
14670 struct Type * source;
14671 struct Expression * e;
14672 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));
14673 struct Expression * arrayExp;
14674 const char * typeString = (((void *)0));
14675 int builtinCount = 0;
14676
14677 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
14678 {
14679 if(!e->next)
14680 {
14681 FreeType(e->destType);
14682 e->destType = ProcessTypeString("Container", 0);
14683 }
14684 if(!isBuiltin || e->next)
14685 ProcessExpressionType(e);
14686 }
14687 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
14688 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)))
14689 {
14690 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
14691 struct Symbol * symbol;
14692 struct Expression * expIt = (((void *)0));
14693 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
14694 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
14695 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
14696 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
14697
14698 if(inCompiler)
14699 {
14700 stmt->type = 2;
14701 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
14702 stmt->__anon1.compound.context->parent = curContext;
14703 curContext = stmt->__anon1.compound.context;
14704 }
14705 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
14706 {
14707 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
14708
14709 isCustomAVLTree = 1;
14710 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
14711 isMap = 1;
14712 }
14713 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
14714 isArray = 1;
14715 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
14716 {
14717 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
14718
14719 isLinkList = 1;
14720 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
14721 }
14722 if(inCompiler && isArray)
14723 {
14724 struct Declarator * decl;
14725 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14726
14727 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
14728 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
14729 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
14730 }
14731 else if(isBuiltin)
14732 {
14733 struct Type * type = (((void *)0));
14734 char typeStringBuf[1024];
14735
14736 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
14737 if(((struct Expression *)(*exp).last)->type == 11)
14738 {
14739 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
14740
14741 if(typeName)
14742 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
14743 }
14744 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)
14745 {
14746 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
14747
14748 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
14749 }
14750 else if(arrayExp->__anon1.list)
14751 {
14752 struct Expression * e;
14753
14754 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
14755 {
14756 ProcessExpressionType(e);
14757 if(e->expType)
14758 {
14759 if(!type)
14760 {
14761 type = e->expType;
14762 type->refCount++;
14763 }
14764 else
14765 {
14766 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
14767 {
14768 FreeType(type);
14769 type = e->expType;
14770 e->expType = (((void *)0));
14771 e = (*arrayExp->__anon1.list).first;
14772 ProcessExpressionType(e);
14773 if(e->expType)
14774 {
14775 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
14776 {
14777 FreeType(e->expType);
14778 e->expType = (((void *)0));
14779 FreeType(type);
14780 type = (((void *)0));
14781 break;
14782 }
14783 }
14784 }
14785 }
14786 if(e->expType)
14787 {
14788 FreeType(e->expType);
14789 e->expType = (((void *)0));
14790 }
14791 }
14792 }
14793 if(type)
14794 {
14795 typeStringBuf[0] = '\0';
14796 PrintType(type, typeStringBuf, 0, 1);
14797 typeString = typeStringBuf;
14798 FreeType(type);
14799 }
14800 }
14801 if(typeString)
14802 {
14803 if(inCompiler)
14804 {
14805 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14806 struct Declarator * decl;
14807 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14808
14809 if(arrayExp->__anon1.list)
14810 {
14811 struct Expression * e;
14812
14813 builtinCount = (*arrayExp->__anon1.list).count;
14814 type = ProcessTypeString(typeString, 0);
14815 while((e = (*arrayExp->__anon1.list).first))
14816 {
14817 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
14818 e->destType = type;
14819 type->refCount++;
14820 ProcessExpressionType(e);
14821 if(inCompiler)
14822 ListAdd(initializers, MkInitializerAssignment(e));
14823 }
14824 FreeType(type);
14825 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
14826 }
14827 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
14828 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
14829 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
14830 FreeList(exp, (void *)(FreeExpression));
14831 }
14832 else if(arrayExp->__anon1.list)
14833 {
14834 struct Expression * e;
14835
14836 type = ProcessTypeString(typeString, 0);
14837 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
14838 {
14839 e->destType = type;
14840 type->refCount++;
14841 ProcessExpressionType(e);
14842 }
14843 FreeType(type);
14844 }
14845 }
14846 else
14847 {
14848 arrayExp->expType = ProcessTypeString("Container", 0);
14849 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
14850 }
14851 }
14852 else if(inCompiler && isLinkList && !isList)
14853 {
14854 struct Declarator * decl;
14855 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14856
14857 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
14858 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
14859 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
14860 }
14861 else if(inCompiler && _class->templateArgs)
14862 {
14863 if(isMap)
14864 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
14865 else
14866 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
14867 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)))))))));
14868 }
14869 if(inCompiler)
14870 {
14871 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
14872 if(block)
14873 {
14874 switch(block->type)
14875 {
14876 case 2:
14877 if(block->__anon1.compound.context)
14878 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
14879 break;
14880 case 4:
14881 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
14882 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
14883 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
14884 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
14885 break;
14886 case 5:
14887 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
14888 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
14889 break;
14890 case 6:
14891 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
14892 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
14893 break;
14894 case 7:
14895 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
14896 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
14897 break;
14898 case 8:
14899 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
14900 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
14901 break;
14902 case 18:
14903 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
14904 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
14905 break;
14906 }
14907 }
14908 if(filter)
14909 {
14910 block = MkIfStmt(filter, block, (((void *)0)));
14911 }
14912 if(isArray)
14913 {
14914 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));
14915 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
14916 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
14917 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
14918 }
14919 else if(isBuiltin)
14920 {
14921 char count[128];
14922
14923 sprintf(count, "%d", builtinCount);
14924 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));
14925 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
14926 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
14927 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
14928 }
14929 else if(isLinkList && !isList)
14930 {
14931 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
14932 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
14933
14934 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
14935 {
14936 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));
14937 }
14938 else
14939 {
14940 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14941 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
14942
14943 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));
14944 }
14945 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
14946 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
14947 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
14948 }
14949 else
14950 {
14951 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
14952 }
14953 ProcessExpressionType(expIt);
14954 if((*stmt->__anon1.compound.declarations).first)
14955 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
14956 if(symbol)
14957 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
14958 ProcessStatement(stmt);
14959 }
14960 else
14961 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
14962 if(inCompiler)
14963 curContext = stmt->__anon1.compound.context->parent;
14964 break;
14965 }
14966 else
14967 {
14968 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
14969 }
14970 break;
14971 }
14972 case 9:
14973 break;
14974 case 10:
14975 break;
14976 case 11:
14977 break;
14978 case 12:
14979 {
14980 struct Expression * exp;
14981
14982 if(stmt->__anon1.expressions)
14983 {
14984 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14985 {
14986 if(!exp->next)
14987 {
14988 if(curFunction && !curFunction->type)
14989 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
14990 FreeType(exp->destType);
14991 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
14992 if(exp->destType)
14993 exp->destType->refCount++;
14994 }
14995 ProcessExpressionType(exp);
14996 }
14997 }
14998 break;
14999 }
15000 case 14:
15001 {
15002 ProcessDeclaration(stmt->__anon1.decl);
15003 break;
15004 }
15005 case 13:
15006 {
15007 struct AsmField * field;
15008
15009 if(stmt->__anon1.asmStmt.inputFields)
15010 {
15011 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15012 if(field->expression)
15013 ProcessExpressionType(field->expression);
15014 }
15015 if(stmt->__anon1.asmStmt.outputFields)
15016 {
15017 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15018 if(field->expression)
15019 ProcessExpressionType(field->expression);
15020 }
15021 if(stmt->__anon1.asmStmt.clobberedFields)
15022 {
15023 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15024 {
15025 if(field->expression)
15026 ProcessExpressionType(field->expression);
15027 }
15028 }
15029 break;
15030 }
15031 case 17:
15032 {
15033 struct PropertyWatch * propWatch;
15034 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15035 struct Expression * object = stmt->__anon1._watch.object;
15036 struct Expression * watcher = stmt->__anon1._watch.watcher;
15037
15038 if(watcher)
15039 ProcessExpressionType(watcher);
15040 if(object)
15041 ProcessExpressionType(object);
15042 if(inCompiler)
15043 {
15044 if(watcher || thisClass)
15045 {
15046 struct External * external = curExternal;
15047 struct Context * context = curContext;
15048
15049 stmt->type = 3;
15050 stmt->__anon1.expressions = MkList();
15051 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15052 {
15053 struct ClassFunction * func;
15054 char watcherName[1024];
15055 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;
15056 struct External * createdExternal;
15057
15058 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15059 if(propWatch->deleteWatch)
15060 strcat(watcherName, "_delete");
15061 else
15062 {
15063 struct Identifier * propID;
15064
15065 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15066 {
15067 strcat(watcherName, "_");
15068 strcat(watcherName, propID->string);
15069 }
15070 }
15071 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15072 {
15073 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)));
15074 ProcessClassFunctionBody(func, propWatch->compound);
15075 propWatch->compound = (((void *)0));
15076 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15077 curExternal = createdExternal;
15078 ProcessFunction(createdExternal->__anon1.function);
15079 if(propWatch->deleteWatch)
15080 {
15081 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15082
15083 ListAdd(args, CopyExpression(object));
15084 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15085 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15086 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15087 }
15088 else
15089 {
15090 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15091 struct Identifier * propID;
15092
15093 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15094 {
15095 char propName[1024];
15096 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15097
15098 if(prop)
15099 {
15100 char getName[1024], setName[1024];
15101 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15102
15103 DeclareProperty(createdExternal, prop, setName, getName);
15104 strcpy(propName, "__ecereProp_");
15105 FullClassNameCat(propName, prop->_class->fullName, 0);
15106 strcat(propName, "_");
15107 FullClassNameCat(propName, prop->name, 1);
15108 ListAdd(args, CopyExpression(object));
15109 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15110 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15111 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15112 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15113 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15114 }
15115 else
15116 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15117 }
15118 }
15119 }
15120 else
15121 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15122 }
15123 curExternal = external;
15124 curContext = context;
15125 if(watcher)
15126 FreeExpression(watcher);
15127 if(object)
15128 FreeExpression(object);
15129 FreeList(watches, (void *)(FreePropertyWatch));
15130 }
15131 else
15132 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15133 }
15134 else
15135 {
15136 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15137 {
15138 ProcessStatement(propWatch->compound);
15139 }
15140 }
15141 break;
15142 }
15143 case 15:
15144 {
15145 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15146 struct Expression * object = stmt->__anon1._watch.object;
15147 struct __ecereNameSpace__ecere__com__Class * _class;
15148
15149 if(object)
15150 ProcessExpressionType(object);
15151 if(inCompiler)
15152 {
15153 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15154 if(_class)
15155 {
15156 struct Identifier * propID;
15157
15158 stmt->type = 3;
15159 stmt->__anon1.expressions = MkList();
15160 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15161 {
15162 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15163 }
15164 else if(!watches)
15165 {
15166 }
15167 if(watches)
15168 {
15169 for(propID = (*watches).first; propID; propID = propID->next)
15170 {
15171 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15172
15173 if(prop)
15174 {
15175 CreateFireWatcher(prop, object, stmt);
15176 }
15177 else
15178 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15179 }
15180 }
15181 else
15182 {
15183 struct __ecereNameSpace__ecere__com__Property * prop;
15184 struct __ecereNameSpace__ecere__com__Class * base;
15185
15186 for(base = _class; base; base = base->base)
15187 {
15188 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15189 {
15190 if(prop->isProperty && prop->isWatchable)
15191 {
15192 CreateFireWatcher(prop, object, stmt);
15193 }
15194 }
15195 }
15196 }
15197 if(object)
15198 FreeExpression(object);
15199 FreeList(watches, (void *)(FreeIdentifier));
15200 }
15201 else
15202 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15203 }
15204 break;
15205 }
15206 case 16:
15207 {
15208 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15209 struct Expression * object = stmt->__anon1._watch.object;
15210 struct Expression * watcher = stmt->__anon1._watch.watcher;
15211 struct __ecereNameSpace__ecere__com__Class * _class;
15212
15213 if(object)
15214 ProcessExpressionType(object);
15215 if(watcher)
15216 ProcessExpressionType(watcher);
15217 if(inCompiler)
15218 {
15219 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15220 if(watcher || thisClass)
15221 {
15222 if(_class)
15223 {
15224 struct Identifier * propID;
15225
15226 stmt->type = 3;
15227 stmt->__anon1.expressions = MkList();
15228 if(!watches)
15229 {
15230 struct __ecereNameSpace__ecere__sys__OldList * args;
15231
15232 args = MkList();
15233 ListAdd(args, CopyExpression(object));
15234 ListAdd(args, MkExpConstant("0"));
15235 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15236 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15237 }
15238 else
15239 {
15240 for(propID = (*watches).first; propID; propID = propID->next)
15241 {
15242 char propName[1024];
15243 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15244
15245 if(prop)
15246 {
15247 char getName[1024], setName[1024];
15248 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15249
15250 DeclareProperty(curExternal, prop, setName, getName);
15251 strcpy(propName, "__ecereProp_");
15252 FullClassNameCat(propName, prop->_class->fullName, 0);
15253 strcat(propName, "_");
15254 FullClassNameCat(propName, prop->name, 1);
15255 ListAdd(args, CopyExpression(object));
15256 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15257 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15258 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15259 }
15260 else
15261 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15262 }
15263 }
15264 if(object)
15265 FreeExpression(object);
15266 if(watcher)
15267 FreeExpression(watcher);
15268 FreeList(watches, (void *)(FreeIdentifier));
15269 }
15270 else
15271 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15272 }
15273 else
15274 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15275 }
15276 break;
15277 }
15278 }
15279 }
15280
15281 void ProcessExpressionType(struct Expression * exp)
15282 {
15283 unsigned int unresolved = 0;
15284 struct Location oldyylloc = yylloc;
15285 unsigned int notByReference = 0;
15286
15287 if(!exp || exp->expType)
15288 return ;
15289 yylloc = exp->loc;
15290 switch(exp->type)
15291 {
15292 case 0:
15293 {
15294 struct Identifier * id = exp->__anon1.__anon1.identifier;
15295
15296 if(!id || !topContext)
15297 return ;
15298 if(id->_class && id->_class->__anon1.__anon1.name)
15299 {
15300 id->classSym = id->_class->__anon1.__anon1.symbol;
15301 }
15302 if(!strcmp(id->string, "__runtimePlatform"))
15303 {
15304 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15305 break;
15306 }
15307 else if(strstr(id->string, "__ecereClass") == id->string)
15308 {
15309 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15310 break;
15311 }
15312 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15313 {
15314 ReplaceClassMembers(exp, thisClass);
15315 if(exp->type != 0)
15316 {
15317 ProcessExpressionType(exp);
15318 break;
15319 }
15320 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15321 break;
15322 }
15323 else
15324 {
15325 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15326
15327 if(!symbol)
15328 {
15329 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15330 break;
15331 else
15332 {
15333 if(thisClass)
15334 {
15335 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15336 if(exp->type != 0)
15337 {
15338 ProcessExpressionType(exp);
15339 break;
15340 }
15341 }
15342 else if(currentClass && !id->_class)
15343 {
15344 if(ResolveIdWithClass(exp, currentClass, 1))
15345 break;
15346 }
15347 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15348 }
15349 }
15350 if(symbol)
15351 {
15352 struct Type * type = symbol->type;
15353 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15354
15355 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15356 {
15357 struct Context * context = SetupTemplatesContext(_class);
15358
15359 type = ReplaceThisClassType(_class);
15360 FinishTemplatesContext(context);
15361 if(type)
15362 type->refCount = 0;
15363 }
15364 FreeSpecifier(id->_class);
15365 id->_class = (((void *)0));
15366 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15367 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
15368 id->classSym = (((void *)0));
15369 exp->expType = type;
15370 if(type)
15371 type->refCount++;
15372 if(type && (type->kind == 15))
15373 exp->isConstant = 1;
15374 if(symbol->isParam || !strcmp(id->string, "this"))
15375 {
15376 if(_class && _class->type == 1 && !type->declaredWithStruct)
15377 exp->byReference = 1;
15378 }
15379 if(symbol->isIterator)
15380 {
15381 if(symbol->isIterator == 3)
15382 {
15383 exp->type = 5;
15384 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
15385 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
15386 exp->expType = (((void *)0));
15387 ProcessExpressionType(exp);
15388 }
15389 else if(symbol->isIterator != 4)
15390 {
15391 exp->type = 8;
15392 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
15393 exp->__anon1.member.exp->expType = exp->expType;
15394 exp->__anon1.member.member = MkIdentifier("data");
15395 exp->expType = (((void *)0));
15396 ProcessExpressionType(exp);
15397 }
15398 }
15399 break;
15400 }
15401 else
15402 {
15403 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
15404
15405 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15406 {
15407 char name[1024];
15408
15409 strcpy(name, thisNameSpace);
15410 strcat(name, "::");
15411 strcat(name, id->string);
15412 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
15413 }
15414 if(!definedExp)
15415 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
15416 if(definedExp)
15417 {
15418 int c;
15419
15420 for(c = 0; c < definedExpStackPos; c++)
15421 if(definedExpStack[c] == definedExp)
15422 break;
15423 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
15424 {
15425 struct Location backupYylloc = yylloc;
15426 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
15427
15428 definedExpStack[definedExpStackPos++] = definedExp;
15429 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
15430 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
15431 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15432
15433 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15434 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
15435 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
15436 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15437
15438 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15439 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
15440 echoOn = 0;
15441 parsedExpression = (((void *)0));
15442 resetScanner();
15443 expression_yyparse();
15444 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
15445 if(backInput)
15446 fileInput = backInput;
15447 yylloc = backupYylloc;
15448 if(parsedExpression)
15449 {
15450 FreeIdentifier(id);
15451 exp->type = 5;
15452 exp->__anon1.list = MkListOne(parsedExpression);
15453 ApplyLocation(parsedExpression, &yylloc);
15454 ProcessExpressionType(exp);
15455 definedExpStackPos--;
15456 return ;
15457 }
15458 definedExpStackPos--;
15459 }
15460 else
15461 {
15462 if(inCompiler)
15463 {
15464 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
15465 }
15466 }
15467 }
15468 else
15469 {
15470 struct GlobalData * data = (((void *)0));
15471
15472 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15473 {
15474 char name[1024];
15475
15476 strcpy(name, thisNameSpace);
15477 strcat(name, "::");
15478 strcat(name, id->string);
15479 data = FindGlobalData(name);
15480 }
15481 if(!data)
15482 data = FindGlobalData(id->string);
15483 if(data)
15484 {
15485 DeclareGlobalData(curExternal, data);
15486 exp->expType = data->dataType;
15487 if(data->dataType)
15488 data->dataType->refCount++;
15489 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15490 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
15491 FreeSpecifier(id->_class);
15492 id->_class = (((void *)0));
15493 break;
15494 }
15495 else
15496 {
15497 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
15498
15499 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15500 {
15501 char name[1024];
15502
15503 strcpy(name, thisNameSpace);
15504 strcat(name, "::");
15505 strcat(name, id->string);
15506 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
15507 }
15508 if(!function)
15509 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
15510 if(function)
15511 {
15512 char name[1024];
15513
15514 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15515 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
15516 name[0] = (char)0;
15517 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
15518 strcpy(name, "__ecereFunction_");
15519 FullClassNameCat(name, id->string, 0);
15520 if(DeclareFunction(curExternal, function, name))
15521 {
15522 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15523 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
15524 }
15525 exp->expType = function->dataType;
15526 if(function->dataType)
15527 function->dataType->refCount++;
15528 FreeSpecifier(id->_class);
15529 id->_class = (((void *)0));
15530 break;
15531 }
15532 }
15533 }
15534 }
15535 }
15536 unresolved = 1;
15537 break;
15538 }
15539 case 1:
15540 {
15541 if(!exp->__anon1.instance->_class)
15542 {
15543 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
15544 {
15545 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
15546 }
15547 }
15548 ProcessInstantiationType(exp->__anon1.instance);
15549 exp->isConstant = exp->__anon1.instance->isConstant;
15550 if(exp->__anon1.instance->_class)
15551 {
15552 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
15553 }
15554 break;
15555 }
15556 case 2:
15557 {
15558 if(!exp->expType)
15559 {
15560 char * constant = exp->__anon1.__anon1.constant;
15561 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
15562
15563 exp->expType = type;
15564 if(constant[0] == '\'')
15565 {
15566 if((int)((unsigned char *)constant)[1] > 127)
15567 {
15568 int nb;
15569 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
15570
15571 if(nb < 2)
15572 ch = constant[1];
15573 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
15574 exp->__anon1.__anon1.constant = PrintUInt(ch);
15575 type->kind = 8;
15576 type->__anon1._class = FindClass("unichar");
15577 type->isSigned = 0;
15578 }
15579 else
15580 {
15581 type->kind = 1;
15582 type->isSigned = 1;
15583 }
15584 }
15585 else
15586 {
15587 char * dot = strchr(constant, '.');
15588 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
15589 char * exponent;
15590
15591 if(isHex)
15592 {
15593 exponent = strchr(constant, 'p');
15594 if(!exponent)
15595 exponent = strchr(constant, 'P');
15596 }
15597 else
15598 {
15599 exponent = strchr(constant, 'e');
15600 if(!exponent)
15601 exponent = strchr(constant, 'E');
15602 }
15603 if(dot || exponent)
15604 {
15605 if(strchr(constant, 'f') || strchr(constant, 'F'))
15606 type->kind = 6;
15607 else
15608 type->kind = 7;
15609 type->isSigned = 1;
15610 }
15611 else
15612 {
15613 unsigned int isSigned = constant[0] == '-';
15614 char * endP = (((void *)0));
15615 long long i64 = strtoll(constant, &endP, 0);
15616 uint64 ui64 = strtoull(constant, &endP, 0);
15617 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
15618
15619 if(isSigned)
15620 {
15621 if(i64 < (((int)0x80000000)))
15622 is64Bit = 1;
15623 }
15624 else
15625 {
15626 if(ui64 > (((int)0x7fffffff)))
15627 {
15628 if(ui64 > (0xffffffff))
15629 {
15630 is64Bit = 1;
15631 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
15632 isSigned = 1;
15633 }
15634 }
15635 else if(constant[0] != '0' || !constant[1])
15636 isSigned = 1;
15637 }
15638 type->kind = is64Bit ? 4 : 3;
15639 type->isSigned = isSigned;
15640 }
15641 }
15642 exp->isConstant = 1;
15643 if(exp->destType && exp->destType->kind == 7)
15644 type->kind = 7;
15645 else if(exp->destType && exp->destType->kind == 6)
15646 type->kind = 6;
15647 else if(exp->destType && exp->destType->kind == 4)
15648 type->kind = 4;
15649 }
15650 break;
15651 }
15652 case 3:
15653 {
15654 exp->isConstant = 1;
15655 exp->expType = __extension__ ({
15656 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15657
15658 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
15659 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15660
15661 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
15662 }), __ecereInstance2;
15663 });
15664 break;
15665 }
15666 case 13:
15667 case 26:
15668 ProcessExpressionType(exp->__anon1._new.size);
15669 exp->expType = __extension__ ({
15670 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15671
15672 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
15673 });
15674 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
15675 break;
15676 case 14:
15677 case 27:
15678 ProcessExpressionType(exp->__anon1._renew.size);
15679 ProcessExpressionType(exp->__anon1._renew.exp);
15680 exp->expType = __extension__ ({
15681 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15682
15683 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
15684 });
15685 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
15686 break;
15687 case 4:
15688 {
15689 unsigned int assign = 0, boolResult = 0, boolOps = 0;
15690 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
15691 unsigned int useDestType = 0, useSideType = 0;
15692 struct Location oldyylloc = yylloc;
15693 unsigned int useSideUnit = 0;
15694 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
15695 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15696
15697 switch(exp->__anon1.op.op)
15698 {
15699 case '=':
15700 case MUL_ASSIGN:
15701 case DIV_ASSIGN:
15702 case MOD_ASSIGN:
15703 case ADD_ASSIGN:
15704 case SUB_ASSIGN:
15705 case LEFT_ASSIGN:
15706 case RIGHT_ASSIGN:
15707 case AND_ASSIGN:
15708 case XOR_ASSIGN:
15709 case OR_ASSIGN:
15710 assign = 1;
15711 break;
15712 case '!':
15713 break;
15714 case AND_OP:
15715 case OR_OP:
15716 boolOps = 1;
15717 boolResult = 1;
15718 break;
15719 case EQ_OP:
15720 case '<':
15721 case '>':
15722 case LE_OP:
15723 case GE_OP:
15724 case NE_OP:
15725 boolResult = 1;
15726 useSideType = 1;
15727 break;
15728 case '+':
15729 case '-':
15730 useSideUnit = 1;
15731 useSideType = 1;
15732 useDestType = 1;
15733 break;
15734 case LEFT_OP:
15735 case RIGHT_OP:
15736 useSideType = 1;
15737 useDestType = 1;
15738 break;
15739 case '|':
15740 case '^':
15741 useSideType = 1;
15742 useDestType = 1;
15743 break;
15744 case '/':
15745 case '%':
15746 useSideType = 1;
15747 useDestType = 1;
15748 break;
15749 case '&':
15750 case '*':
15751 if(exp->__anon1.op.exp1)
15752 {
15753 useSideType = 1;
15754 useDestType = 1;
15755 }
15756 break;
15757 }
15758 if(exp->__anon1.op.op == '&')
15759 {
15760 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
15761 {
15762 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
15763 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15764
15765 if(symbol && symbol->isIterator == 2)
15766 {
15767 exp->type = 8;
15768 exp->__anon1.member.exp = exp->__anon1.op.exp2;
15769 exp->__anon1.member.member = MkIdentifier("key");
15770 exp->expType = (((void *)0));
15771 exp->__anon1.op.exp2->expType = symbol->type;
15772 symbol->type->refCount++;
15773 ProcessExpressionType(exp);
15774 FreeType(dummy);
15775 break;
15776 }
15777 }
15778 }
15779 if(exp->__anon1.op.exp1)
15780 {
15781 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
15782 useDestType = 0;
15783 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
15784 {
15785 if(exp->__anon1.op.exp1->destType)
15786 FreeType(exp->__anon1.op.exp1->destType);
15787 exp->__anon1.op.exp1->destType = exp->destType;
15788 exp->__anon1.op.exp1->opDestType = 1;
15789 if(exp->destType)
15790 exp->destType->refCount++;
15791 }
15792 else if(!assign)
15793 {
15794 if(exp->__anon1.op.exp1->destType)
15795 FreeType(exp->__anon1.op.exp1->destType);
15796 exp->__anon1.op.exp1->destType = dummy;
15797 dummy->refCount++;
15798 }
15799 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
15800 exp->__anon1.op.exp1->destType->count++;
15801 ProcessExpressionType(exp->__anon1.op.exp1);
15802 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
15803 exp->__anon1.op.exp1->destType->count--;
15804 exp->__anon1.op.exp1->opDestType = 0;
15805 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)
15806 {
15807 exp->__anon1.op.exp2 = MkExpConstant("1");
15808 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
15809 assign = 1;
15810 }
15811 if(exp->__anon1.op.exp1->destType == dummy)
15812 {
15813 FreeType(dummy);
15814 exp->__anon1.op.exp1->destType = (((void *)0));
15815 }
15816 type1 = exp->__anon1.op.exp1->expType;
15817 }
15818 if(exp->__anon1.op.exp2)
15819 {
15820 char expString[10240];
15821
15822 expString[0] = '\0';
15823 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
15824 {
15825 if(exp->__anon1.op.exp1)
15826 {
15827 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
15828 if(exp->__anon1.op.exp1->expType)
15829 exp->__anon1.op.exp1->expType->refCount++;
15830 }
15831 else
15832 {
15833 exp->__anon1.op.exp2->destType = exp->destType;
15834 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
15835 exp->__anon1.op.exp2->opDestType = 1;
15836 if(exp->destType)
15837 exp->destType->refCount++;
15838 }
15839 if(type1)
15840 type1->refCount++;
15841 exp->expType = type1;
15842 }
15843 else if(assign)
15844 {
15845 if(inCompiler)
15846 PrintExpression(exp->__anon1.op.exp2, expString);
15847 if(type1 && type1->kind == 13)
15848 {
15849 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)
15850 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
15851 else if(exp->__anon1.op.op == '=')
15852 {
15853 if(exp->__anon1.op.exp2->destType)
15854 FreeType(exp->__anon1.op.exp2->destType);
15855 exp->__anon1.op.exp2->destType = type1;
15856 if(type1)
15857 type1->refCount++;
15858 }
15859 }
15860 else
15861 {
15862 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)
15863 ;
15864 else
15865 {
15866 if(exp->__anon1.op.exp2->destType)
15867 FreeType(exp->__anon1.op.exp2->destType);
15868 exp->__anon1.op.exp2->destType = type1;
15869 if(type1)
15870 type1->refCount++;
15871 }
15872 }
15873 if(type1)
15874 type1->refCount++;
15875 exp->expType = type1;
15876 }
15877 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
15878 {
15879 if(exp->__anon1.op.exp2->destType)
15880 FreeType(exp->__anon1.op.exp2->destType);
15881 exp->__anon1.op.exp2->destType = exp->destType;
15882 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
15883 exp->__anon1.op.exp2->opDestType = 1;
15884 if(exp->destType)
15885 exp->destType->refCount++;
15886 }
15887 else
15888 {
15889 if(exp->__anon1.op.exp2->destType)
15890 FreeType(exp->__anon1.op.exp2->destType);
15891 exp->__anon1.op.exp2->destType = dummy;
15892 dummy->refCount++;
15893 }
15894 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))
15895 {
15896 FreeType(exp->__anon1.op.exp2->destType);
15897 exp->__anon1.op.exp2->destType = type1;
15898 type1->refCount++;
15899 }
15900 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
15901 exp->__anon1.op.exp2->destType->count++;
15902 if(exp->__anon1.op.op == SIZEOF)
15903 {
15904 struct Expression * e = exp->__anon1.op.exp2;
15905
15906 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
15907 {
15908 if(e->type == 5 || e->type == 32 || e->type == 23)
15909 {
15910 if(e->type == 23)
15911 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
15912 else
15913 e = (*e->__anon1.list).last;
15914 }
15915 }
15916 if(e->type == 11 && e->__anon1.cast.exp)
15917 e->__anon1.cast.exp->needCast = 1;
15918 }
15919 ProcessExpressionType(exp->__anon1.op.exp2);
15920 exp->__anon1.op.exp2->opDestType = 0;
15921 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
15922 exp->__anon1.op.exp2->destType->count--;
15923 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
15924 {
15925 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)
15926 {
15927 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
15928 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
15929 }
15930 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)))
15931 {
15932 if(exp->__anon1.op.op == ADD_ASSIGN)
15933 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
15934 }
15935 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))
15936 {
15937 if(exp->__anon1.op.op == ADD_ASSIGN)
15938 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
15939 }
15940 else if(inCompiler)
15941 {
15942 char type1String[1024];
15943 char type2String[1024];
15944
15945 type1String[0] = '\0';
15946 type2String[0] = '\0';
15947 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
15948 PrintType(type1, type2String, 0, 1);
15949 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15950 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
15951 }
15952 }
15953 if(exp->__anon1.op.exp2->destType == dummy)
15954 {
15955 FreeType(dummy);
15956 exp->__anon1.op.exp2->destType = (((void *)0));
15957 }
15958 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
15959 {
15960 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15961 type2->refCount = 1;
15962 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
15963 type2->isSigned = 1;
15964 }
15965 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))
15966 {
15967 type2 = __extension__ ({
15968 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15969
15970 __ecereInstance1->kind = 3, __ecereInstance1;
15971 });
15972 type2->refCount = 1;
15973 type2->isSigned = 1;
15974 }
15975 else
15976 {
15977 type2 = exp->__anon1.op.exp2->expType;
15978 if(type2)
15979 type2->refCount++;
15980 }
15981 }
15982 dummy->kind = 0;
15983 if(exp->__anon1.op.op == SIZEOF)
15984 {
15985 exp->expType = __extension__ ({
15986 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15987
15988 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
15989 });
15990 exp->isConstant = 1;
15991 }
15992 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
15993 {
15994 exp->expType = Dereference(type2);
15995 if(type2 && type2->kind == 8)
15996 notByReference = 1;
15997 }
15998 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
15999 exp->expType = Reference(type2);
16000 else if(!assign)
16001 {
16002 if(boolOps)
16003 {
16004 if(exp->__anon1.op.exp1)
16005 {
16006 if(exp->__anon1.op.exp1->destType)
16007 FreeType(exp->__anon1.op.exp1->destType);
16008 exp->__anon1.op.exp1->destType = MkClassType("bool");
16009 exp->__anon1.op.exp1->destType->truth = 1;
16010 if(!exp->__anon1.op.exp1->expType)
16011 ProcessExpressionType(exp->__anon1.op.exp1);
16012 else
16013 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16014 FreeType(exp->__anon1.op.exp1->expType);
16015 exp->__anon1.op.exp1->expType = MkClassType("bool");
16016 exp->__anon1.op.exp1->expType->truth = 1;
16017 }
16018 if(exp->__anon1.op.exp2)
16019 {
16020 if(exp->__anon1.op.exp2->destType)
16021 FreeType(exp->__anon1.op.exp2->destType);
16022 exp->__anon1.op.exp2->destType = MkClassType("bool");
16023 exp->__anon1.op.exp2->destType->truth = 1;
16024 if(!exp->__anon1.op.exp2->expType)
16025 ProcessExpressionType(exp->__anon1.op.exp2);
16026 else
16027 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16028 FreeType(exp->__anon1.op.exp2->expType);
16029 exp->__anon1.op.exp2->expType = MkClassType("bool");
16030 exp->__anon1.op.exp2->expType->truth = 1;
16031 }
16032 }
16033 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")))))
16034 {
16035 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"))))
16036 {
16037 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)))
16038 {
16039 struct Type * intType;
16040
16041 if(!type1->__anon1._class->__anon1.registered->dataType)
16042 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16043 if(!type2->__anon1._class->__anon1.registered->dataType)
16044 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16045 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
16046 if(exp->__anon1.op.exp1->destType)
16047 FreeType(exp->__anon1.op.exp1->destType);
16048 if(exp->__anon1.op.exp2->destType)
16049 FreeType(exp->__anon1.op.exp2->destType);
16050 exp->__anon1.op.exp1->destType = intType;
16051 exp->__anon1.op.exp2->destType = intType;
16052 intType->refCount++;
16053 }
16054 else
16055 {
16056 if(exp->__anon1.op.exp2->destType)
16057 FreeType(exp->__anon1.op.exp2->destType);
16058 exp->__anon1.op.exp2->destType = type1;
16059 type1->refCount++;
16060 if(exp->__anon1.op.exp1->destType)
16061 FreeType(exp->__anon1.op.exp1->destType);
16062 exp->__anon1.op.exp1->destType = type2;
16063 type2->refCount++;
16064 }
16065 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)
16066 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);
16067 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16068 {
16069 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16070
16071 if(argExp)
16072 {
16073 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16074
16075 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16076 ProcessExpressionType(exp->__anon1.op.exp1);
16077 if(type2->kind != 13)
16078 {
16079 ProcessExpressionType(classExp);
16080 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16081 if(!exp->__anon1.op.exp2->expType)
16082 {
16083 if(type2)
16084 FreeType(type2);
16085 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16086 type2->refCount++;
16087 }
16088 ProcessExpressionType(exp->__anon1.op.exp2);
16089 }
16090 }
16091 }
16092 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)))
16093 {
16094 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16095 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16096 exp->expType = type1;
16097 if(type1)
16098 type1->refCount++;
16099 }
16100 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)))
16101 {
16102 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16103 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16104 exp->expType = type2;
16105 if(type2)
16106 type2->refCount++;
16107 }
16108 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))
16109 {
16110 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16111 }
16112 else
16113 {
16114 unsigned int success = 0;
16115
16116 if(type1->kind == 13 && type2->kind == 13)
16117 {
16118 if(exp->__anon1.op.op == '+')
16119 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16120 else if(exp->__anon1.op.op == '-')
16121 {
16122 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16123 {
16124 exp->expType = __extension__ ({
16125 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16126
16127 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16128 });
16129 success = 1;
16130 if(type1->__anon1.type->kind == 20)
16131 {
16132 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16133
16134 if(argExp)
16135 {
16136 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16137
16138 ProcessExpressionType(classExp);
16139 exp->type = 5;
16140 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"))));
16141 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16142 FreeType(dummy);
16143 return ;
16144 }
16145 }
16146 }
16147 }
16148 }
16149 if(!success && exp->__anon1.op.exp1->type == 2)
16150 {
16151 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16152 {
16153 if(exp->expType)
16154 FreeType(exp->expType);
16155 exp->expType = exp->__anon1.op.exp1->destType;
16156 if(exp->__anon1.op.exp1->destType)
16157 exp->__anon1.op.exp1->destType->refCount++;
16158 success = 1;
16159 }
16160 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16161 {
16162 if(exp->expType)
16163 FreeType(exp->expType);
16164 exp->expType = exp->__anon1.op.exp2->destType;
16165 if(exp->__anon1.op.exp2->destType)
16166 exp->__anon1.op.exp2->destType->refCount++;
16167 success = 1;
16168 }
16169 }
16170 else if(!success)
16171 {
16172 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16173 {
16174 if(exp->expType)
16175 FreeType(exp->expType);
16176 exp->expType = exp->__anon1.op.exp2->destType;
16177 if(exp->__anon1.op.exp2->destType)
16178 exp->__anon1.op.exp2->destType->refCount++;
16179 success = 1;
16180 }
16181 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16182 {
16183 if(exp->expType)
16184 FreeType(exp->expType);
16185 exp->expType = exp->__anon1.op.exp1->destType;
16186 if(exp->__anon1.op.exp1->destType)
16187 exp->__anon1.op.exp1->destType->refCount++;
16188 success = 1;
16189 }
16190 }
16191 if(!success)
16192 {
16193 char expString1[10240];
16194 char expString2[10240];
16195 char type1[1024];
16196 char type2[1024];
16197
16198 expString1[0] = '\0';
16199 expString2[0] = '\0';
16200 type1[0] = '\0';
16201 type2[0] = '\0';
16202 if(inCompiler)
16203 {
16204 PrintExpression(exp->__anon1.op.exp1, expString1);
16205 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16206 PrintExpression(exp->__anon1.op.exp2, expString2);
16207 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16208 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16209 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16210 }
16211 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16212 }
16213 }
16214 }
16215 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)
16216 {
16217 if(exp->__anon1.op.exp1->destType)
16218 FreeType(exp->__anon1.op.exp1->destType);
16219 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16220 if(type2->__anon1._class->__anon1.registered->dataType)
16221 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16222 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16223 exp->expType = type2;
16224 if(type2)
16225 type2->refCount++;
16226 }
16227 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)
16228 {
16229 if(exp->__anon1.op.exp2->destType)
16230 FreeType(exp->__anon1.op.exp2->destType);
16231 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16232 if(type1->__anon1._class->__anon1.registered->dataType)
16233 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16234 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16235 exp->expType = type1;
16236 if(type1)
16237 type1->refCount++;
16238 }
16239 else if(type1)
16240 {
16241 unsigned int valid = 0;
16242
16243 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
16244 {
16245 if(exp->__anon1.op.exp2->destType)
16246 FreeType(exp->__anon1.op.exp2->destType);
16247 if(!type1->__anon1._class->__anon1.registered->dataType)
16248 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16249 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16250 exp->__anon1.op.exp2->destType->refCount++;
16251 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16252 if(type2)
16253 FreeType(type2);
16254 type2 = exp->__anon1.op.exp2->destType;
16255 if(type2)
16256 type2->refCount++;
16257 exp->expType = type2;
16258 type2->refCount++;
16259 }
16260 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
16261 {
16262 if(exp->__anon1.op.exp1->destType)
16263 FreeType(exp->__anon1.op.exp1->destType);
16264 if(!type2->__anon1._class->__anon1.registered->dataType)
16265 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16266 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16267 exp->__anon1.op.exp1->destType->refCount++;
16268 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16269 type1 = exp->__anon1.op.exp1->destType;
16270 exp->expType = type1;
16271 type1->refCount++;
16272 }
16273 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
16274 {
16275 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
16276 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
16277
16278 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
16279 {
16280 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16281 {
16282 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16283 {
16284 if(exp->expType)
16285 FreeType(exp->expType);
16286 exp->expType = exp->__anon1.op.exp2->expType;
16287 if(exp->__anon1.op.exp2->expType)
16288 exp->__anon1.op.exp2->expType->refCount++;
16289 valid = 1;
16290 }
16291 }
16292 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16293 {
16294 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16295 {
16296 if(exp->expType)
16297 FreeType(exp->expType);
16298 exp->expType = exp->__anon1.op.exp1->expType;
16299 if(exp->__anon1.op.exp1->expType)
16300 exp->__anon1.op.exp1->expType->refCount++;
16301 valid = 1;
16302 }
16303 }
16304 }
16305 else
16306 {
16307 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16308 {
16309 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16310 {
16311 if(exp->expType)
16312 FreeType(exp->expType);
16313 exp->expType = exp->__anon1.op.exp1->expType;
16314 if(exp->__anon1.op.exp1->expType)
16315 exp->__anon1.op.exp1->expType->refCount++;
16316 valid = 1;
16317 }
16318 }
16319 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16320 {
16321 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16322 {
16323 if(exp->expType)
16324 FreeType(exp->expType);
16325 exp->expType = exp->__anon1.op.exp2->expType;
16326 if(exp->__anon1.op.exp2->expType)
16327 exp->__anon1.op.exp2->expType->refCount++;
16328 valid = 1;
16329 }
16330 }
16331 }
16332 }
16333 if(!valid)
16334 {
16335 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))
16336 {
16337 if(exp->__anon1.op.exp1->destType)
16338 FreeType(exp->__anon1.op.exp1->destType);
16339 exp->__anon1.op.exp1->destType = type2;
16340 type2->refCount++;
16341 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16342 {
16343 if(exp->expType)
16344 FreeType(exp->expType);
16345 exp->expType = exp->__anon1.op.exp1->destType;
16346 if(exp->__anon1.op.exp1->destType)
16347 exp->__anon1.op.exp1->destType->refCount++;
16348 }
16349 }
16350 else
16351 {
16352 if(exp->__anon1.op.exp2->destType)
16353 FreeType(exp->__anon1.op.exp2->destType);
16354 exp->__anon1.op.exp2->destType = type1;
16355 type1->refCount++;
16356 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16357 {
16358 if(exp->expType)
16359 FreeType(exp->expType);
16360 exp->expType = exp->__anon1.op.exp2->destType;
16361 if(exp->__anon1.op.exp2->destType)
16362 exp->__anon1.op.exp2->destType->refCount++;
16363 }
16364 else if(type1 && type2)
16365 {
16366 char expString1[10240];
16367 char expString2[10240];
16368 char type1String[1024];
16369 char type2String[1024];
16370
16371 expString1[0] = '\0';
16372 expString2[0] = '\0';
16373 type1String[0] = '\0';
16374 type2String[0] = '\0';
16375 if(inCompiler)
16376 {
16377 PrintExpression(exp->__anon1.op.exp1, expString1);
16378 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16379 PrintExpression(exp->__anon1.op.exp2, expString2);
16380 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16381 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
16382 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
16383 }
16384 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
16385 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
16386 {
16387 exp->expType = exp->__anon1.op.exp1->expType;
16388 if(exp->__anon1.op.exp1->expType)
16389 exp->__anon1.op.exp1->expType->refCount++;
16390 }
16391 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16392 {
16393 exp->expType = exp->__anon1.op.exp2->expType;
16394 if(exp->__anon1.op.exp2->expType)
16395 exp->__anon1.op.exp2->expType->refCount++;
16396 }
16397 }
16398 }
16399 }
16400 }
16401 else if(type2)
16402 {
16403 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16404 {
16405 struct Type * oldType = exp->__anon1.op.exp1->expType;
16406
16407 exp->__anon1.op.exp1->expType = (((void *)0));
16408 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16409 FreeType(oldType);
16410 else
16411 exp->__anon1.op.exp1->expType = oldType;
16412 }
16413 if(exp->__anon1.op.exp1->destType)
16414 FreeType(exp->__anon1.op.exp1->destType);
16415 exp->__anon1.op.exp1->destType = type2;
16416 type2->refCount++;
16417 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16418 {
16419 if(exp->expType)
16420 FreeType(exp->expType);
16421 exp->expType = exp->__anon1.op.exp1->destType;
16422 if(exp->__anon1.op.exp1->destType)
16423 exp->__anon1.op.exp1->destType->refCount++;
16424 }
16425 }
16426 }
16427 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
16428 {
16429 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16430 {
16431 if(exp->__anon1.op.exp1->destType)
16432 FreeType(exp->__anon1.op.exp1->destType);
16433 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16434 if(type2->__anon1._class->__anon1.registered->dataType)
16435 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16436 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16437 }
16438 if(exp->__anon1.op.op == '!')
16439 {
16440 exp->expType = MkClassType("bool");
16441 exp->expType->truth = 1;
16442 }
16443 else
16444 {
16445 exp->expType = type2;
16446 if(type2)
16447 type2->refCount++;
16448 }
16449 }
16450 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
16451 {
16452 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16453 {
16454 if(exp->__anon1.op.exp2->destType)
16455 FreeType(exp->__anon1.op.exp2->destType);
16456 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16457 if(type1->__anon1._class->__anon1.registered->dataType)
16458 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16459 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16460 }
16461 exp->expType = type1;
16462 if(type1)
16463 type1->refCount++;
16464 }
16465 }
16466 yylloc = exp->loc;
16467 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
16468 {
16469 char expString[10000];
16470
16471 expString[0] = '\0';
16472 if(inCompiler)
16473 {
16474 PrintExpression(exp->__anon1.op.exp1, expString);
16475 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16476 }
16477 if(expString[0])
16478 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16479 }
16480 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
16481 {
16482 char expString[10240];
16483
16484 expString[0] = '\0';
16485 if(inCompiler)
16486 {
16487 PrintExpression(exp->__anon1.op.exp2, expString);
16488 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16489 }
16490 if(expString[0])
16491 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16492 }
16493 if(boolResult)
16494 {
16495 FreeType(exp->expType);
16496 exp->expType = MkClassType("bool");
16497 exp->expType->truth = 1;
16498 }
16499 if(exp->__anon1.op.op != SIZEOF)
16500 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
16501 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
16502 {
16503 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
16504 }
16505 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
16506 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
16507 yylloc = oldyylloc;
16508 FreeType(dummy);
16509 if(type2)
16510 FreeType(type2);
16511 break;
16512 }
16513 case 5:
16514 case 32:
16515 {
16516 struct Expression * e;
16517
16518 exp->isConstant = 1;
16519 for(e = (*exp->__anon1.list).first; e; e = e->next)
16520 {
16521 if(!e->next)
16522 {
16523 FreeType(e->destType);
16524 e->opDestType = exp->opDestType;
16525 e->destType = exp->destType;
16526 if(e->destType)
16527 {
16528 exp->destType->refCount++;
16529 }
16530 }
16531 ProcessExpressionType(e);
16532 if(!exp->expType && !e->next)
16533 {
16534 exp->expType = e->expType;
16535 if(e->expType)
16536 e->expType->refCount++;
16537 }
16538 if(!e->isConstant)
16539 exp->isConstant = 0;
16540 }
16541 e = (*exp->__anon1.list).first;
16542 if(!e->next && e->type == 8)
16543 {
16544 struct Expression * next = exp->next, * prev = exp->prev;
16545
16546 FreeType(exp->expType);
16547 FreeType(exp->destType);
16548 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16549 *exp = *e;
16550 exp->prev = prev;
16551 exp->next = next;
16552 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
16553 ProcessExpressionType(exp);
16554 }
16555 break;
16556 }
16557 case 6:
16558 {
16559 struct Expression * e;
16560
16561 exp->isConstant = 1;
16562 ProcessExpressionType(exp->__anon1.index.exp);
16563 if(!exp->__anon1.index.exp->isConstant)
16564 exp->isConstant = 0;
16565 if(exp->__anon1.index.exp->expType)
16566 {
16567 struct Type * source = exp->__anon1.index.exp->expType;
16568
16569 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
16570 {
16571 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
16572 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
16573
16574 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
16575 {
16576 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
16577 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
16578 {
16579 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
16580
16581 if(type->kind == 8)
16582 type->constant = 1;
16583 else if(type->kind == 13)
16584 {
16585 struct Type * t = type;
16586
16587 while(t->kind == 13)
16588 t = t->__anon1.type;
16589 t->constant = 1;
16590 }
16591 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
16592 }
16593 }
16594 }
16595 }
16596 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
16597 {
16598 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
16599 {
16600 if(e->destType)
16601 FreeType(e->destType);
16602 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
16603 }
16604 ProcessExpressionType(e);
16605 if(!e->next)
16606 {
16607 }
16608 if(!e->isConstant)
16609 exp->isConstant = 0;
16610 }
16611 if(!exp->expType)
16612 exp->expType = Dereference(exp->__anon1.index.exp->expType);
16613 if(exp->expType)
16614 DeclareType(curExternal, exp->expType, 1, 0);
16615 break;
16616 }
16617 case 7:
16618 {
16619 struct Expression * e;
16620 struct Type * functionType;
16621 struct Type * methodType = (((void *)0));
16622 char name[1024];
16623
16624 name[0] = '\0';
16625 if(inCompiler)
16626 {
16627 PrintExpression(exp->__anon1.call.exp, name);
16628 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
16629 {
16630 PrintExpression(exp->__anon1.call.exp, name);
16631 }
16632 }
16633 if(exp->__anon1.call.exp->type == 0)
16634 {
16635 struct Expression * idExp = exp->__anon1.call.exp;
16636 struct Identifier * id = idExp->__anon1.__anon1.identifier;
16637
16638 if(!strcmp(id->string, "__builtin_frame_address"))
16639 {
16640 exp->expType = ProcessTypeString("void *", 1);
16641 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
16642 ProcessExpressionType((*exp->__anon1.call.arguments).first);
16643 break;
16644 }
16645 else if(!strcmp(id->string, "__ENDIAN_PAD"))
16646 {
16647 exp->expType = ProcessTypeString("int", 1);
16648 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
16649 ProcessExpressionType((*exp->__anon1.call.arguments).first);
16650 break;
16651 }
16652 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
16653 {
16654 struct Expression * a = (((void *)0));
16655 struct Expression * b = (((void *)0));
16656 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
16657
16658 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
16659 {
16660 a = (*exp->__anon1.call.arguments).first;
16661 b = (*exp->__anon1.call.arguments).last;
16662 tempExp1 = a;
16663 tempExp2 = b;
16664 }
16665 else if((*exp->__anon1.call.arguments).count == 1)
16666 {
16667 a = (*exp->__anon1.call.arguments).first;
16668 tempExp1 = a;
16669 }
16670 if(a)
16671 {
16672 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
16673 idExp->__anon1.__anon1.identifier = (((void *)0));
16674 FreeExpContents(exp);
16675 ProcessExpressionType(a);
16676 if(b)
16677 ProcessExpressionType(b);
16678 exp->type = 5;
16679 exp->__anon1.list = MkList();
16680 if(a->expType && (!b || b->expType))
16681 {
16682 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
16683 {
16684 if(inCompiler)
16685 {
16686 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16687 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
16688 struct Declaration * decl;
16689 char temp1[1024], temp2[1024];
16690
16691 GetTypeSpecs(a->expType, specs);
16692 if(a && !a->isConstant && a->type != 0)
16693 {
16694 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
16695 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
16696 tempExp1 = QMkExpId(temp1);
16697 tempExp1->expType = a->expType;
16698 if(a->expType)
16699 a->expType->refCount++;
16700 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
16701 }
16702 if(b && !b->isConstant && b->type != 0)
16703 {
16704 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
16705 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
16706 tempExp2 = QMkExpId(temp2);
16707 tempExp2->expType = b->expType;
16708 if(b->expType)
16709 b->expType->refCount++;
16710 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
16711 }
16712 decl = MkDeclaration(specs, decls);
16713 if(!curCompound->__anon1.compound.declarations)
16714 curCompound->__anon1.compound.declarations = MkList();
16715 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
16716 }
16717 }
16718 }
16719 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
16720 {
16721 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
16722
16723 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
16724 exp->expType = a->expType;
16725 if(a->expType)
16726 a->expType->refCount++;
16727 }
16728 else if(!strcmp(id->string, "Abs"))
16729 {
16730 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
16731 exp->expType = a->expType;
16732 if(a->expType)
16733 a->expType->refCount++;
16734 }
16735 else if(!strcmp(id->string, "Sgn"))
16736 {
16737 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"))))));
16738 exp->expType = ProcessTypeString("int", 0);
16739 }
16740 FreeExpression(tempExp1);
16741 if(tempExp2)
16742 FreeExpression(tempExp2);
16743 FreeIdentifier(id);
16744 break;
16745 }
16746 }
16747 }
16748 {
16749 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16750
16751 if(!exp->__anon1.call.exp->destType)
16752 {
16753 exp->__anon1.call.exp->destType = dummy;
16754 dummy->refCount++;
16755 }
16756 ProcessExpressionType(exp->__anon1.call.exp);
16757 if(exp->__anon1.call.exp->destType == dummy)
16758 {
16759 FreeType(dummy);
16760 exp->__anon1.call.exp->destType = (((void *)0));
16761 }
16762 FreeType(dummy);
16763 }
16764 functionType = exp->__anon1.call.exp->expType;
16765 if(functionType && functionType->kind == 16)
16766 {
16767 methodType = functionType;
16768 functionType = methodType->__anon1.__anon3.method->dataType;
16769 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
16770 {
16771 char typeString[1024];
16772
16773 typeString[0] = '\0';
16774 {
16775 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
16776
16777 functionType->__anon1.__anon2.thisClass = (((void *)0));
16778 PrintType(functionType, typeString, 1, 1);
16779 functionType->__anon1.__anon2.thisClass = back;
16780 }
16781 if(strstr(typeString, "thisclass"))
16782 {
16783 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16784 struct Declarator * decl;
16785
16786 {
16787 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
16788
16789 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16790 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))
16791 thisClassParams = 0;
16792 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
16793 {
16794 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
16795
16796 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
16797 ProcessDeclarator(decl, 1);
16798 thisClass = backupThisClass;
16799 }
16800 thisClassParams = 1;
16801 functionType = ProcessType(specs, decl);
16802 functionType->refCount = 0;
16803 FinishTemplatesContext(context);
16804 }
16805 FreeList(specs, (void *)(FreeSpecifier));
16806 FreeDeclarator(decl);
16807 }
16808 }
16809 }
16810 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
16811 {
16812 struct Type * type = functionType->__anon1.type;
16813
16814 if(!functionType->refCount)
16815 {
16816 functionType->__anon1.type = (((void *)0));
16817 FreeType(functionType);
16818 }
16819 functionType = type;
16820 }
16821 if(functionType && functionType->kind != 11)
16822 {
16823 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
16824 }
16825 else if(functionType)
16826 {
16827 unsigned int emptyParams = 0, noParams = 0;
16828 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
16829 struct Type * type = functionType->__anon1.__anon2.params.first;
16830 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
16831 int extra = 0;
16832 struct Location oldyylloc = yylloc;
16833
16834 if(!type)
16835 emptyParams = 1;
16836 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
16837 {
16838 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
16839 e = e->next;
16840 }
16841 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
16842 {
16843 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)
16844 {
16845 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
16846 if(e)
16847 {
16848 e->destType = type;
16849 e = e->next;
16850 type = functionType->__anon1.__anon2.params.first;
16851 }
16852 else
16853 type->refCount = 0;
16854 }
16855 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
16856 {
16857 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
16858 type->byReference = functionType->byReference;
16859 type->typedByReference = functionType->typedByReference;
16860 if(e)
16861 {
16862 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
16863 e = e->next;
16864 e->destType = type;
16865 e = e->next;
16866 type = functionType->__anon1.__anon2.params.first;
16867 }
16868 else
16869 type->refCount = 0;
16870 }
16871 }
16872 if(type && type->kind == 0)
16873 {
16874 noParams = 1;
16875 if(!type->refCount)
16876 FreeType(type);
16877 type = (((void *)0));
16878 }
16879 for(; e; e = e->next)
16880 {
16881 if(!type && !emptyParams)
16882 {
16883 yylloc = e->loc;
16884 if(methodType && methodType->__anon1.__anon3.methodClass)
16885 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);
16886 else
16887 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);
16888 break;
16889 }
16890 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
16891 {
16892 struct Type * templatedType = (((void *)0));
16893 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
16894 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16895 int id = 0;
16896
16897 if(_class && _class->templateArgs)
16898 {
16899 struct __ecereNameSpace__ecere__com__Class * sClass;
16900
16901 for(sClass = _class; sClass; sClass = sClass->base)
16902 {
16903 if(sClass->templateClass)
16904 sClass = sClass->templateClass;
16905 id = 0;
16906 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16907 {
16908 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
16909 {
16910 struct __ecereNameSpace__ecere__com__Class * nextClass;
16911
16912 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16913 {
16914 if(nextClass->templateClass)
16915 nextClass = nextClass->templateClass;
16916 id += nextClass->templateParams.count;
16917 }
16918 break;
16919 }
16920 id++;
16921 }
16922 if(curParam)
16923 break;
16924 }
16925 }
16926 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
16927 {
16928 unsigned int constant = type->constant;
16929 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
16930
16931 {
16932 struct Context * context = SetupTemplatesContext(_class);
16933
16934 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16935 FinishTemplatesContext(context);
16936 }
16937 if(templatedType->kind == 8 && constant)
16938 templatedType->constant = 1;
16939 else if(templatedType->kind == 13)
16940 {
16941 struct Type * t = templatedType->__anon1.type;
16942
16943 while(t->kind == 13)
16944 t = t->__anon1.type;
16945 if(constant)
16946 t->constant = constant;
16947 }
16948 e->destType = templatedType;
16949 if(templatedType)
16950 {
16951 templatedType->passAsTemplate = 1;
16952 }
16953 }
16954 else
16955 {
16956 e->destType = type;
16957 if(type)
16958 type->refCount++;
16959 }
16960 }
16961 else
16962 {
16963 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
16964 {
16965 e->destType = type->prev;
16966 e->destType->refCount++;
16967 }
16968 else
16969 {
16970 e->destType = type;
16971 if(type)
16972 type->refCount++;
16973 }
16974 }
16975 if(type && type->kind != 14)
16976 {
16977 struct Type * next = type->next;
16978
16979 if(!type->refCount)
16980 FreeType(type);
16981 type = next;
16982 }
16983 }
16984 if(type && type->kind != 14)
16985 {
16986 if(methodType && methodType->__anon1.__anon3.methodClass)
16987 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);
16988 else
16989 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);
16990 }
16991 yylloc = oldyylloc;
16992 if(type && !type->refCount)
16993 FreeType(type);
16994 }
16995 else
16996 {
16997 functionType = __extension__ ({
16998 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16999
17000 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17001 });
17002 if(exp->__anon1.call.exp->type == 0)
17003 {
17004 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17005
17006 if(inCompiler)
17007 {
17008 struct Symbol * symbol;
17009 struct Location oldyylloc = yylloc;
17010
17011 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17012 if(strstr(string, "__builtin_") == string)
17013 {
17014 if(exp->destType)
17015 {
17016 functionType->__anon1.__anon2.returnType = exp->destType;
17017 exp->destType->refCount++;
17018 }
17019 }
17020 else
17021 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17022 symbol = __extension__ ({
17023 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17024
17025 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17026 });
17027 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17028 if(strstr(symbol->string, "::"))
17029 globalContext->hasNameSpace = 1;
17030 yylloc = oldyylloc;
17031 }
17032 }
17033 else if(exp->__anon1.call.exp->type == 8)
17034 {
17035 }
17036 else
17037 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17038 if(!functionType->__anon1.__anon2.returnType)
17039 {
17040 functionType->__anon1.__anon2.returnType = __extension__ ({
17041 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17042
17043 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17044 });
17045 }
17046 }
17047 if(functionType && functionType->kind == 11)
17048 {
17049 exp->expType = functionType->__anon1.__anon2.returnType;
17050 if(functionType->__anon1.__anon2.returnType)
17051 functionType->__anon1.__anon2.returnType->refCount++;
17052 if(!functionType->refCount)
17053 FreeType(functionType);
17054 }
17055 if(exp->__anon1.call.arguments)
17056 {
17057 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17058 ProcessExpressionType(e);
17059 }
17060 break;
17061 }
17062 case 8:
17063 {
17064 struct Type * type;
17065 struct Location oldyylloc = yylloc;
17066 unsigned int thisPtr;
17067 struct Expression * checkExp = exp->__anon1.member.exp;
17068
17069 while(checkExp)
17070 {
17071 if(checkExp->type == 11)
17072 checkExp = checkExp->__anon1.cast.exp;
17073 else if(checkExp->type == 5)
17074 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17075 else
17076 break;
17077 }
17078 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17079 exp->thisPtr = thisPtr;
17080 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17081 {
17082 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17083 }
17084 ProcessExpressionType(exp->__anon1.member.exp);
17085 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)
17086 {
17087 exp->isConstant = 0;
17088 }
17089 else
17090 exp->isConstant = exp->__anon1.member.exp->isConstant;
17091 type = exp->__anon1.member.exp->expType;
17092 yylloc = exp->loc;
17093 if(type && (type->kind == 20))
17094 {
17095 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17096 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17097
17098 if(_class)
17099 {
17100 for(param = _class->templateParams.first; param; param = param->next)
17101 {
17102 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17103 break;
17104 }
17105 }
17106 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17107 {
17108 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17109
17110 if(argExp)
17111 {
17112 struct Expression * expMember = exp->__anon1.member.exp;
17113 struct Declarator * decl;
17114 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17115 char thisClassTypeString[1024];
17116
17117 FreeIdentifier(exp->__anon1.member.member);
17118 ProcessExpressionType(argExp);
17119 {
17120 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17121
17122 if(colon)
17123 {
17124 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17125 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17126 }
17127 else
17128 strcpy(thisClassTypeString, _class->fullName);
17129 }
17130 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17131 exp->expType = ProcessType(specs, decl);
17132 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17133 {
17134 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17135 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17136 int paramCount = 0;
17137 int lastParam = -1;
17138 char templateString[1024];
17139 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17140
17141 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17142 for(cClass = expClass; cClass; cClass = cClass->base)
17143 {
17144 int p = 0;
17145
17146 for(param = cClass->templateParams.first; param; param = param->next)
17147 {
17148 int id = p;
17149 struct __ecereNameSpace__ecere__com__Class * sClass;
17150 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17151
17152 for(sClass = cClass->base; sClass; sClass = sClass->base)
17153 id += sClass->templateParams.count;
17154 arg = expClass->templateArgs[id];
17155 for(sClass = _class; sClass; sClass = sClass->base)
17156 {
17157 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17158 int p = 0;
17159 struct __ecereNameSpace__ecere__com__Class * nextClass;
17160
17161 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17162 p += nextClass->templateParams.count;
17163 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17164 {
17165 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17166 {
17167 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17168 {
17169 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17170 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17171 break;
17172 }
17173 }
17174 }
17175 }
17176 {
17177 char argument[256];
17178
17179 argument[0] = '\0';
17180 switch(param->type)
17181 {
17182 case 2:
17183 {
17184 char expString[1024];
17185 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17186 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17187 struct Expression * exp;
17188 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17189
17190 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17191 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17192 ProcessExpressionType(exp);
17193 ComputeExpression(exp);
17194 expString[0] = '\0';
17195 PrintExpression(exp, expString);
17196 strcat(argument, expString);
17197 FreeExpression(exp);
17198 break;
17199 }
17200 case 1:
17201 {
17202 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17203 break;
17204 }
17205 case 0:
17206 {
17207 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17208 {
17209 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17210 strcat(argument, thisClassTypeString);
17211 else
17212 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17213 }
17214 break;
17215 }
17216 }
17217 if(argument[0])
17218 {
17219 if(paramCount)
17220 strcat(templateString, ", ");
17221 if(lastParam != p - 1)
17222 {
17223 strcat(templateString, param->name);
17224 strcat(templateString, " = ");
17225 }
17226 strcat(templateString, argument);
17227 paramCount++;
17228 lastParam = p;
17229 }
17230 p++;
17231 }
17232 }
17233 }
17234 {
17235 int len = strlen(templateString);
17236
17237 if(templateString[len - 1] == '>')
17238 templateString[len++] = ' ';
17239 templateString[len++] = '>';
17240 templateString[len++] = '\0';
17241 }
17242 {
17243 struct Context * context = SetupTemplatesContext(_class);
17244
17245 FreeType(exp->expType);
17246 exp->expType = ProcessTypeString(templateString, 0);
17247 FinishTemplatesContext(context);
17248 }
17249 }
17250 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
17251 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
17252 exp->type = 5;
17253 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")))))))));
17254 }
17255 }
17256 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
17257 {
17258 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
17259 }
17260 }
17261 if(type && (type->kind == 20))
17262 ;
17263 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)))
17264 {
17265 struct Identifier * id = exp->__anon1.member.member;
17266 int typeKind = type->kind;
17267 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));
17268
17269 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
17270 {
17271 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
17272 typeKind = 8;
17273 }
17274 if(id)
17275 {
17276 if(typeKind == 3 || typeKind == 15)
17277 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
17278 else if(!_class)
17279 {
17280 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17281 {
17282 _class = type->__anon1._class->__anon1.registered;
17283 }
17284 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
17285 {
17286 _class = FindClass("char *")->__anon1.registered;
17287 }
17288 else if(type->kind == 13)
17289 {
17290 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
17291 FreeType(exp->expType);
17292 exp->expType = ProcessTypeString("uintptr", 0);
17293 exp->byReference = 1;
17294 }
17295 else
17296 {
17297 char string[1024] = "";
17298 struct Symbol * classSym;
17299
17300 PrintTypeNoConst(type, string, 0, 1);
17301 classSym = FindClass(string);
17302 if(classSym)
17303 _class = classSym->__anon1.registered;
17304 }
17305 }
17306 }
17307 if(_class && id)
17308 {
17309 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
17310 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
17311 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17312 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
17313 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
17314
17315 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
17316 exp->__anon1.member.memberType = 1;
17317 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
17318 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
17319 if(typeKind != 19)
17320 {
17321 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
17322 {
17323 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17324 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
17325 {
17326 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17327 if(prop)
17328 member = (((void *)0));
17329 }
17330 if(!member && !prop)
17331 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17332 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
17333 exp->__anon1.member.thisPtr = 1;
17334 }
17335 else
17336 {
17337 unsigned int useMemberForNonConst = 0;
17338
17339 if(!id->classSym)
17340 {
17341 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
17342 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);
17343 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17344 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
17345 }
17346 if((!prop || useMemberForNonConst) && !member)
17347 {
17348 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
17349 if(!method)
17350 {
17351 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17352 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);
17353 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17354 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17355 }
17356 }
17357 if(member && prop)
17358 {
17359 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
17360 prop = (((void *)0));
17361 else
17362 member = (((void *)0));
17363 }
17364 }
17365 }
17366 if(!prop && !member && !method)
17367 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
17368 if(!prop && !member && !method)
17369 {
17370 if(typeKind == 19)
17371 {
17372 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
17373 if(classProp)
17374 {
17375 exp->__anon1.member.memberType = 5;
17376 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
17377 }
17378 else
17379 {
17380 char structName[1024];
17381 struct Identifier * id = exp->__anon1.member.member;
17382 struct Expression * classExp = exp->__anon1.member.exp;
17383
17384 type->refCount++;
17385 FreeType(classExp->expType);
17386 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
17387 strcpy(structName, "__ecereClassData_");
17388 FullClassNameCat(structName, type->__anon1._class->string, 0);
17389 exp->type = 9;
17390 exp->__anon1.member.member = id;
17391 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"))))))));
17392 FreeType(type);
17393 ProcessExpressionType(exp);
17394 return ;
17395 }
17396 }
17397 else
17398 {
17399 struct Symbol * classSym = FindClass(id->string);
17400
17401 if(classSym)
17402 {
17403 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
17404
17405 if(convertClass)
17406 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
17407 }
17408 }
17409 }
17410 if(exp->__anon1.member.exp->destType)
17411 FreeType(exp->__anon1.member.exp->destType);
17412 {
17413 if(method && !method->_class->symbol)
17414 method->_class->symbol = FindClass(method->_class->fullName);
17415 if(prop && !prop->_class->symbol)
17416 prop->_class->symbol = FindClass(prop->_class->fullName);
17417 exp->__anon1.member.exp->destType = __extension__ ({
17418 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17419
17420 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
17421 });
17422 }
17423 if(prop)
17424 {
17425 exp->__anon1.member.memberType = 1;
17426 if(!prop->dataType)
17427 ProcessPropertyType(prop);
17428 exp->expType = prop->dataType;
17429 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
17430 {
17431 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17432
17433 CopyTypeInto(type, exp->expType);
17434 type->refCount = 1;
17435 type->constant = 1;
17436 exp->expType = type;
17437 }
17438 else if(prop->dataType)
17439 prop->dataType->refCount++;
17440 }
17441 else if(member)
17442 {
17443 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17444 {
17445 FreeExpContents(exp);
17446 exp->type = 0;
17447 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17448 ProcessExpressionType(exp);
17449 return ;
17450 }
17451 exp->__anon1.member.memberType = 3;
17452 DeclareStruct(curExternal, _class->fullName, 0, 1);
17453 if(member->_class != _class)
17454 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
17455 if(!member->dataType)
17456 {
17457 struct Context * context = SetupTemplatesContext(_class);
17458
17459 member->dataType = ProcessTypeString(member->dataTypeString, 0);
17460 FinishTemplatesContext(context);
17461 }
17462 exp->expType = member->dataType;
17463 if(member->dataType)
17464 member->dataType->refCount++;
17465 }
17466 else if(revConvert)
17467 {
17468 exp->__anon1.member.memberType = 4;
17469 exp->expType = MkClassType(revConvert->_class->fullName);
17470 }
17471 else if(method)
17472 {
17473 {
17474 exp->__anon1.member.memberType = 2;
17475 }
17476 if(!method->dataType)
17477 ProcessMethodType(method);
17478 exp->expType = __extension__ ({
17479 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17480
17481 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
17482 });
17483 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
17484 exp->expType->__anon1.__anon3.usedClass = _class;
17485 }
17486 else if(!classProp)
17487 {
17488 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17489 {
17490 FreeExpContents(exp);
17491 exp->type = 0;
17492 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17493 FreeType(exp->expType);
17494 exp->expType = MkClassType("ecere::com::Class");
17495 return ;
17496 }
17497 yylloc = exp->__anon1.member.member->loc;
17498 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
17499 if(inCompiler)
17500 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
17501 }
17502 if(_class && exp->expType)
17503 {
17504 struct __ecereNameSpace__ecere__com__Class * tClass;
17505
17506 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
17507 while(tClass && !tClass->templateClass)
17508 tClass = tClass->base;
17509 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
17510 {
17511 int id = 0;
17512 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17513 struct __ecereNameSpace__ecere__com__Class * sClass;
17514
17515 for(sClass = tClass; sClass; sClass = sClass->base)
17516 {
17517 id = 0;
17518 if(sClass->templateClass)
17519 sClass = sClass->templateClass;
17520 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17521 {
17522 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
17523 {
17524 for(sClass = sClass->base; sClass; sClass = sClass->base)
17525 id += sClass->templateParams.count;
17526 break;
17527 }
17528 id++;
17529 }
17530 if(curParam)
17531 break;
17532 }
17533 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
17534 {
17535 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
17536 struct Context * context = SetupTemplatesContext(tClass);
17537 unsigned int constant = exp->expType->constant;
17538
17539 FreeType(exp->expType);
17540 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17541 if(exp->expType->kind == 8 && constant)
17542 exp->expType->constant = 1;
17543 else if(exp->expType->kind == 13)
17544 {
17545 struct Type * t = exp->expType->__anon1.type;
17546
17547 while(t->kind == 13)
17548 t = t->__anon1.type;
17549 if(constant)
17550 t->constant = constant;
17551 }
17552 if(exp->expType)
17553 {
17554 if(exp->expType->kind == 21)
17555 {
17556 FreeType(exp->expType);
17557 exp->expType = ReplaceThisClassType(_class);
17558 }
17559 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
17560 exp->expType->passAsTemplate = 1;
17561 if(!exp->destType)
17562 {
17563 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17564 if(exp->destType->kind == 8 && constant)
17565 exp->destType->constant = 1;
17566 else if(exp->destType->kind == 13)
17567 {
17568 struct Type * t = exp->destType->__anon1.type;
17569
17570 while(t->kind == 13)
17571 t = t->__anon1.type;
17572 if(constant)
17573 t->constant = constant;
17574 }
17575 if(exp->destType->kind == 21)
17576 {
17577 FreeType(exp->destType);
17578 exp->destType = ReplaceThisClassType(_class);
17579 }
17580 }
17581 }
17582 FinishTemplatesContext(context);
17583 }
17584 }
17585 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)
17586 {
17587 int id = 0;
17588 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17589 struct __ecereNameSpace__ecere__com__Class * sClass;
17590
17591 for(sClass = tClass; sClass; sClass = sClass->base)
17592 {
17593 id = 0;
17594 if(sClass->templateClass)
17595 sClass = sClass->templateClass;
17596 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17597 {
17598 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
17599 {
17600 for(sClass = sClass->base; sClass; sClass = sClass->base)
17601 id += sClass->templateParams.count;
17602 break;
17603 }
17604 id++;
17605 }
17606 if(curParam)
17607 break;
17608 }
17609 if(curParam)
17610 {
17611 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
17612 struct Context * context = SetupTemplatesContext(tClass);
17613 struct Type * basicType;
17614
17615 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17616 if(basicType)
17617 {
17618 if(basicType->kind == 21)
17619 {
17620 FreeType(basicType);
17621 basicType = ReplaceThisClassType(_class);
17622 }
17623 FreeType(exp->expType);
17624 exp->expType = __extension__ ({
17625 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17626
17627 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
17628 });
17629 if(!exp->destType)
17630 {
17631 exp->destType = exp->expType;
17632 exp->destType->refCount++;
17633 }
17634 {
17635 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17636 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17637 struct Declarator * decl;
17638
17639 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
17640 *newExp = *exp;
17641 if(exp->destType)
17642 exp->destType->refCount++;
17643 if(exp->expType)
17644 exp->expType->refCount++;
17645 exp->type = 11;
17646 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
17647 exp->__anon1.cast.exp = newExp;
17648 }
17649 }
17650 FinishTemplatesContext(context);
17651 }
17652 }
17653 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
17654 {
17655 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17656
17657 if(expClass)
17658 {
17659 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17660 int p = 0;
17661 int paramCount = 0;
17662 int lastParam = -1;
17663 char templateString[1024];
17664 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17665
17666 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17667 while(cClass != expClass)
17668 {
17669 struct __ecereNameSpace__ecere__com__Class * sClass;
17670
17671 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
17672 ;
17673 cClass = sClass;
17674 for(param = cClass->templateParams.first; param; param = param->next)
17675 {
17676 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
17677 int cp = 0;
17678 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
17679 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17680
17681 while(cClassCur != tClass && !paramCur)
17682 {
17683 struct __ecereNameSpace__ecere__com__Class * sClassCur;
17684
17685 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
17686 ;
17687 cClassCur = sClassCur;
17688 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
17689 {
17690 if(!strcmp(paramCur->name, param->name))
17691 {
17692 break;
17693 }
17694 cp++;
17695 }
17696 }
17697 if(paramCur && paramCur->type == 0)
17698 arg = tClass->templateArgs[cp];
17699 else
17700 arg = expClass->templateArgs[p];
17701 {
17702 char argument[256];
17703
17704 argument[0] = '\0';
17705 switch(param->type)
17706 {
17707 case 2:
17708 {
17709 char expString[1024];
17710 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17711 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17712 struct Expression * exp;
17713 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17714
17715 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17716 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17717 ProcessExpressionType(exp);
17718 ComputeExpression(exp);
17719 expString[0] = '\0';
17720 PrintExpression(exp, expString);
17721 strcat(argument, expString);
17722 FreeExpression(exp);
17723 break;
17724 }
17725 case 1:
17726 {
17727 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17728 break;
17729 }
17730 case 0:
17731 {
17732 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17733 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17734 break;
17735 }
17736 }
17737 if(argument[0])
17738 {
17739 if(paramCount)
17740 strcat(templateString, ", ");
17741 if(lastParam != p - 1)
17742 {
17743 strcat(templateString, param->name);
17744 strcat(templateString, " = ");
17745 }
17746 strcat(templateString, argument);
17747 paramCount++;
17748 lastParam = p;
17749 }
17750 }
17751 p++;
17752 }
17753 }
17754 {
17755 int len = strlen(templateString);
17756
17757 if(templateString[len - 1] == '>')
17758 templateString[len++] = ' ';
17759 templateString[len++] = '>';
17760 templateString[len++] = '\0';
17761 }
17762 FreeType(exp->expType);
17763 {
17764 struct Context * context = SetupTemplatesContext(tClass);
17765
17766 exp->expType = ProcessTypeString(templateString, 0);
17767 FinishTemplatesContext(context);
17768 }
17769 }
17770 }
17771 }
17772 }
17773 else
17774 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)");
17775 }
17776 else if(type && (type->kind == 9 || type->kind == 10))
17777 {
17778 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
17779
17780 if(memberType)
17781 {
17782 exp->expType = memberType;
17783 if(memberType)
17784 memberType->refCount++;
17785 }
17786 }
17787 else
17788 {
17789 char expString[10240];
17790
17791 expString[0] = '\0';
17792 if(inCompiler)
17793 {
17794 PrintExpression(exp, expString);
17795 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17796 }
17797 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
17798 }
17799 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
17800 {
17801 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
17802 {
17803 struct Identifier * id = exp->__anon1.member.member;
17804 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));
17805
17806 if(_class)
17807 {
17808 FreeType(exp->expType);
17809 exp->expType = ReplaceThisClassType(_class);
17810 }
17811 }
17812 }
17813 yylloc = oldyylloc;
17814 break;
17815 }
17816 case 9:
17817 {
17818 struct Type * destType = exp->destType;
17819
17820 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17821 {
17822 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17823 }
17824 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
17825 exp->type = 8;
17826 if(destType)
17827 destType->count++;
17828 ProcessExpressionType(exp);
17829 if(destType)
17830 destType->count--;
17831 break;
17832 }
17833 case 15:
17834 {
17835 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
17836
17837 if(classSym && classSym->__anon1.registered)
17838 {
17839 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
17840 {
17841 char name[1024];
17842 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
17843
17844 name[0] = '\0';
17845 DeclareStruct(curExternal, classSym->string, 0, 1);
17846 FreeSpecifier(exp->__anon1._class);
17847 FullClassNameCat(name, classSym->string, 0);
17848 if(b->offset == 0)
17849 {
17850 exp->type = 10;
17851 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
17852 }
17853 else
17854 {
17855 struct Expression * e;
17856
17857 exp->type = 4;
17858 if(b->structSize == b->offset)
17859 exp->__anon1.op.exp1 = MkExpConstant("0");
17860 else
17861 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
17862 exp->__anon1.op.op = '+';
17863 e = exp;
17864 while(b->offset != 0)
17865 {
17866 struct Symbol * sym;
17867 struct Expression * typeSize;
17868
17869 b = b->base;
17870 sym = FindClass(b->fullName);
17871 name[0] = '\0';
17872 DeclareStruct(curExternal, sym->string, 0, 1);
17873 FullClassNameCat(name, sym->string, 0);
17874 if(b->structSize == b->offset)
17875 typeSize = MkExpConstant("0");
17876 else
17877 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
17878 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
17879 e = e->__anon1.op.exp2;
17880 }
17881 }
17882 }
17883 else
17884 {
17885 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
17886 {
17887 FreeSpecifier(exp->__anon1._class);
17888 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
17889 exp->type = 2;
17890 }
17891 else
17892 {
17893 char className[1024];
17894
17895 strcpy(className, "__ecereClass_");
17896 FullClassNameCat(className, classSym->string, 1);
17897 DeclareClass(curExternal, classSym, className);
17898 FreeExpContents(exp);
17899 exp->type = 9;
17900 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
17901 exp->__anon1.member.member = MkIdentifier("structSize");
17902 }
17903 }
17904 }
17905 exp->expType = __extension__ ({
17906 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17907
17908 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
17909 });
17910 break;
17911 }
17912 case 10:
17913 {
17914 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
17915
17916 exp->expType = __extension__ ({
17917 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17918
17919 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
17920 });
17921 exp->isConstant = 1;
17922 DeclareType(curExternal, type, 1, 0);
17923 FreeType(type);
17924 break;
17925 }
17926 case 11:
17927 {
17928 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
17929
17930 type->count = 1;
17931 FreeType(exp->__anon1.cast.exp->destType);
17932 exp->__anon1.cast.exp->destType = type;
17933 type->refCount++;
17934 type->casted = 1;
17935 ProcessExpressionType(exp->__anon1.cast.exp);
17936 type->casted = 0;
17937 type->count = 0;
17938 exp->expType = type;
17939 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
17940 {
17941 void * prev = exp->prev, * next = exp->next;
17942 struct Type * expType = exp->__anon1.cast.exp->destType;
17943 struct Expression * castExp = exp->__anon1.cast.exp;
17944 struct Type * destType = exp->destType;
17945
17946 if(expType)
17947 expType->refCount++;
17948 FreeType(exp->expType);
17949 FreeTypeName(exp->__anon1.cast.typeName);
17950 *exp = *castExp;
17951 FreeType(exp->expType);
17952 FreeType(exp->destType);
17953 exp->expType = expType;
17954 exp->destType = destType;
17955 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
17956 exp->prev = prev;
17957 exp->next = next;
17958 }
17959 else
17960 {
17961 exp->isConstant = exp->__anon1.cast.exp->isConstant;
17962 }
17963 break;
17964 }
17965 case 33:
17966 {
17967 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
17968
17969 exp->expType = type;
17970 break;
17971 }
17972 case 34:
17973 {
17974 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
17975
17976 ProcessExpressionType(exp->__anon1.vaArg.exp);
17977 exp->expType = type;
17978 break;
17979 }
17980 case 12:
17981 {
17982 struct Expression * e;
17983 struct Type * t = exp->destType;
17984
17985 if(t && !exp->destType->casted)
17986 {
17987 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17988 CopyTypeInto(t, exp->destType);
17989 t->count = 0;
17990 }
17991 else if(t)
17992 t->refCount++;
17993 exp->isConstant = 1;
17994 FreeType(exp->__anon1.cond.cond->destType);
17995 exp->__anon1.cond.cond->destType = MkClassType("bool");
17996 exp->__anon1.cond.cond->destType->truth = 1;
17997 ProcessExpressionType(exp->__anon1.cond.cond);
17998 if(!exp->__anon1.cond.cond->isConstant)
17999 exp->isConstant = 0;
18000 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18001 {
18002 if(!e->next)
18003 {
18004 FreeType(e->destType);
18005 e->destType = t;
18006 if(e->destType)
18007 e->destType->refCount++;
18008 }
18009 ProcessExpressionType(e);
18010 if(!e->next)
18011 {
18012 exp->expType = e->expType;
18013 if(e->expType)
18014 e->expType->refCount++;
18015 }
18016 if(!e->isConstant)
18017 exp->isConstant = 0;
18018 }
18019 FreeType(exp->__anon1.cond.elseExp->destType);
18020 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18021 if(exp->__anon1.cond.elseExp->destType)
18022 exp->__anon1.cond.elseExp->destType->refCount++;
18023 ProcessExpressionType(exp->__anon1.cond.elseExp);
18024 if(!exp->__anon1.cond.elseExp->isConstant)
18025 exp->isConstant = 0;
18026 FreeType(t);
18027 break;
18028 }
18029 case 23:
18030 {
18031 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18032 {
18033 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18034
18035 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18036 {
18037 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18038 if(exp->destType)
18039 exp->destType->refCount++;
18040 }
18041 ProcessStatement(exp->__anon1.compound);
18042 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18043 if(exp->expType)
18044 exp->expType->refCount++;
18045 }
18046 break;
18047 }
18048 case 24:
18049 {
18050 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18051
18052 if(spec && spec->type == 1)
18053 {
18054 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18055 exp->expType->kind = 19;
18056 exp->byReference = 1;
18057 }
18058 else
18059 {
18060 exp->expType = MkClassType("ecere::com::Class");
18061 exp->byReference = 1;
18062 }
18063 break;
18064 }
18065 case 25:
18066 {
18067 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18068
18069 if(_class)
18070 {
18071 struct Identifier * id = exp->__anon1.classData.id;
18072 char structName[1024];
18073 struct Expression * classExp;
18074
18075 strcpy(structName, "__ecereClassData_");
18076 FullClassNameCat(structName, _class->fullName, 0);
18077 exp->type = 9;
18078 exp->__anon1.member.member = id;
18079 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18080 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18081 else
18082 classExp = MkExpIdentifier(MkIdentifier("class"));
18083 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"))))))));
18084 ProcessExpressionType(exp);
18085 return ;
18086 }
18087 break;
18088 }
18089 case 35:
18090 {
18091 struct Type * type = (((void *)0));
18092 const char * typeString = (((void *)0));
18093 char typeStringBuf[1024];
18094
18095 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))
18096 {
18097 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18098
18099 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18100 }
18101 else if(exp->__anon1.list)
18102 {
18103 struct Expression * e;
18104
18105 for(e = (*exp->__anon1.list).first; e; e = e->next)
18106 {
18107 ProcessExpressionType(e);
18108 if(e->expType)
18109 {
18110 if(!type)
18111 {
18112 type = e->expType;
18113 type->refCount++;
18114 }
18115 else
18116 {
18117 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18118 {
18119 FreeType(type);
18120 type = e->expType;
18121 e->expType = (((void *)0));
18122 e = (*exp->__anon1.list).first;
18123 ProcessExpressionType(e);
18124 if(e->expType)
18125 {
18126 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18127 {
18128 FreeType(e->expType);
18129 e->expType = (((void *)0));
18130 FreeType(type);
18131 type = (((void *)0));
18132 break;
18133 }
18134 }
18135 }
18136 }
18137 if(e->expType)
18138 {
18139 FreeType(e->expType);
18140 e->expType = (((void *)0));
18141 }
18142 }
18143 }
18144 if(type)
18145 {
18146 typeStringBuf[0] = '\0';
18147 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18148 typeString = typeStringBuf;
18149 FreeType(type);
18150 type = (((void *)0));
18151 }
18152 }
18153 if(typeString)
18154 {
18155 char templateString[1024];
18156 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18157 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18158 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18159 struct Expression * expExt;
18160 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18161
18162 sprintf(templateString, "Container<%s>", typeString);
18163 if(exp->__anon1.list)
18164 {
18165 struct Expression * e;
18166
18167 type = ProcessTypeString(typeString, 0);
18168 while((e = (*exp->__anon1.list).first))
18169 {
18170 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18171 e->destType = type;
18172 type->refCount++;
18173 ProcessExpressionType(e);
18174 ListAdd(initializers, MkInitializerAssignment(e));
18175 }
18176 FreeType(type);
18177 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18178 }
18179 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18180 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18181 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18182 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18183 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18184 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18185 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18186 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18187 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18188 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18189 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18190
18191 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18192 })));
18193 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18194 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18195 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18196 exp->expType = ProcessTypeString(templateString, 0);
18197 exp->type = 5;
18198 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18199 ProcessExpressionType(expExt);
18200 }
18201 else
18202 {
18203 exp->expType = ProcessTypeString("Container", 0);
18204 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18205 }
18206 break;
18207 }
18208 }
18209 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18210 {
18211 FreeType(exp->expType);
18212 exp->expType = ReplaceThisClassType(thisClass);
18213 }
18214 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)
18215 {
18216 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
18217
18218 if(symbol)
18219 {
18220 if(exp->expType->kind != 15)
18221 {
18222 struct Type * member;
18223 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
18224
18225 FreeType(exp->expType);
18226 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18227 exp->expType->kind = symbol->type->kind;
18228 exp->expType->refCount++;
18229 exp->expType->__anon1.__anon1.enumName = enumName;
18230 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
18231 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18232 member->refCount++;
18233 }
18234 else
18235 {
18236 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
18237
18238 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18239 {
18240 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);
18241
18242 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
18243 }
18244 }
18245 }
18246 }
18247 yylloc = exp->loc;
18248 if(exp->destType && (exp->destType->kind == 18))
18249 ;
18250 else if(exp->destType && !exp->destType->keepCast)
18251 {
18252 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
18253 exp->needTemplateCast = 1;
18254 if(exp->destType->kind == 0)
18255 ;
18256 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
18257 {
18258 unsigned int invalidCast = 0;
18259
18260 if(inCompiler && exp->destType->count && exp->expType)
18261 {
18262 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
18263 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
18264
18265 if(c1 && c1->type != 1)
18266 c1 = (((void *)0));
18267 if(c2 && c2->type != 1)
18268 c2 = (((void *)0));
18269 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
18270 invalidCast = 1;
18271 }
18272 if(!exp->destType->count || unresolved || invalidCast)
18273 {
18274 if(!exp->expType)
18275 {
18276 yylloc = exp->loc;
18277 if(exp->destType->kind != 14)
18278 {
18279 char type2[1024];
18280
18281 type2[0] = '\0';
18282 if(inCompiler)
18283 {
18284 char expString[10240];
18285
18286 expString[0] = '\0';
18287 PrintType(exp->destType, type2, 0, 1);
18288 if(inCompiler)
18289 {
18290 PrintExpression(exp, expString);
18291 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18292 }
18293 if(unresolved)
18294 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
18295 else if(exp->type != 16)
18296 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
18297 }
18298 }
18299 else
18300 {
18301 char expString[10240];
18302
18303 expString[0] = '\0';
18304 if(inCompiler)
18305 {
18306 PrintExpression(exp, expString);
18307 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18308 }
18309 if(unresolved)
18310 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
18311 else if(exp->type != 16)
18312 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18313 }
18314 }
18315 else
18316 {
18317 char type1[1024];
18318 char type2[1024];
18319
18320 type1[0] = '\0';
18321 type2[0] = '\0';
18322 if(inCompiler)
18323 {
18324 PrintType(exp->expType, type1, 0, 1);
18325 PrintType(exp->destType, type2, 0, 1);
18326 }
18327 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)))
18328 ;
18329 else
18330 {
18331 char expString[10240];
18332
18333 expString[0] = '\0';
18334 if(inCompiler)
18335 {
18336 PrintExpression(exp, expString);
18337 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18338 }
18339 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")))
18340 {
18341 if(invalidCast)
18342 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18343 else
18344 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18345 }
18346 if(!inCompiler)
18347 {
18348 FreeType(exp->expType);
18349 exp->destType->refCount++;
18350 exp->expType = exp->destType;
18351 }
18352 }
18353 }
18354 }
18355 }
18356 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))
18357 {
18358 struct Expression * nbExp = GetNonBracketsExp(exp);
18359
18360 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
18361 {
18362 struct Expression * e = MoveExpContents(exp);
18363
18364 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
18365 exp->type = 11;
18366 exp->__anon1.cast.exp->destType = exp->destType;
18367 if(exp->destType)
18368 exp->destType->refCount++;
18369 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
18370 }
18371 }
18372 }
18373 else if(unresolved)
18374 {
18375 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
18376 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);
18377 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
18378 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
18379 }
18380 else if(!exp->expType && exp->type != 16)
18381 {
18382 char expString[10240];
18383
18384 expString[0] = '\0';
18385 if(inCompiler)
18386 {
18387 PrintExpression(exp, expString);
18388 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18389 }
18390 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18391 }
18392 if(inCompiler)
18393 ApplyAnyObjectLogic(exp);
18394 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)))
18395 {
18396 exp->byReference = 1;
18397 }
18398 yylloc = oldyylloc;
18399 }
18400
18401 static void ProcessFunction(struct FunctionDefinition * function)
18402 {
18403 struct Identifier * id = GetDeclId(function->declarator);
18404 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18405 struct Type * type = symbol ? symbol->type : (((void *)0));
18406 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18407 struct Context * oldTopContext = topContext;
18408
18409 yylloc = function->loc;
18410 if(type && type->__anon1.__anon2.thisClass)
18411 {
18412 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18413 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18414 char className[1024];
18415 char structName[1024];
18416 struct Declarator * funcDecl;
18417 struct Symbol * thisSymbol;
18418 unsigned int typedObject = 0;
18419
18420 if(_class && !_class->base)
18421 {
18422 _class = currentClass;
18423 if(_class && !_class->symbol)
18424 _class->symbol = FindClass(_class->fullName);
18425 classSym = _class ? _class->symbol : (((void *)0));
18426 typedObject = 1;
18427 }
18428 thisClass = _class;
18429 if(inCompiler && _class)
18430 {
18431 if(type->kind == 11)
18432 {
18433 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18434 {
18435 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18436
18437 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18438 FreeType(param);
18439 }
18440 if(type->classObjectType != 1)
18441 {
18442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18443 symbol->type->__anon1.__anon2.staticMethod = 1;
18444 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18445 symbol->type->extraParam = 0;
18446 }
18447 }
18448 strcpy(className, "__ecereClass_");
18449 FullClassNameCat(className, _class->fullName, 1);
18450 structName[0] = (char)0;
18451 FullClassNameCat(structName, _class->fullName, 0);
18452 funcDecl = GetFuncDecl(function->declarator);
18453 if(funcDecl)
18454 {
18455 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18456 {
18457 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18458
18459 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18460 {
18461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18462 FreeTypeName(param);
18463 }
18464 }
18465 if(!function->propertyNoThis)
18466 {
18467 struct TypeName * thisParam = (((void *)0));
18468
18469 if(type->classObjectType != 1)
18470 {
18471 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18472 if(!funcDecl->__anon1.function.parameters)
18473 funcDecl->__anon1.function.parameters = MkList();
18474 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18475 }
18476 if(typedObject)
18477 {
18478 if(type->classObjectType != 1)
18479 {
18480 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18481 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18482 }
18483 thisParam = __extension__ ({
18484 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18485
18486 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18487 });
18488 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
18489 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18490 }
18491 }
18492 }
18493 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18494 {
18495 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18496
18497 funcDecl = GetFuncDecl(initDecl->declarator);
18498 if(funcDecl)
18499 {
18500 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18501 {
18502 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18503
18504 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18505 {
18506 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18507 FreeTypeName(param);
18508 }
18509 }
18510 if(type->classObjectType != 1)
18511 {
18512 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18513 {
18514 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18515
18516 if(!funcDecl->__anon1.function.parameters)
18517 funcDecl->__anon1.function.parameters = MkList();
18518 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18519 }
18520 }
18521 }
18522 }
18523 }
18524 if(function->body)
18525 {
18526 if(type->classObjectType != 1)
18527 {
18528 thisSymbol = __extension__ ({
18529 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18530
18531 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18532 });
18533 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18534 if(typedObject && thisSymbol->type)
18535 {
18536 thisSymbol->type->classObjectType = 2;
18537 thisSymbol->type->byReference = type->byReference;
18538 thisSymbol->type->typedByReference = type->byReference;
18539 }
18540 }
18541 }
18542 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
18543 {
18544 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18545
18546 {
18547 struct __ecereNameSpace__ecere__com__Class * base;
18548
18549 for(base = _class; base && base->type != 1000; base = base->next)
18550 {
18551 for(member = base->membersAndProperties.first; member; member = member->next)
18552 if(!member->isProperty)
18553 break;
18554 if(member)
18555 break;
18556 }
18557 }
18558 for(member = _class->membersAndProperties.first; member; member = member->next)
18559 if(!member->isProperty)
18560 break;
18561 if(member)
18562 {
18563 char pointerName[1024];
18564 struct Declaration * decl;
18565 struct Initializer * initializer;
18566 struct Expression * exp, * bytePtr;
18567
18568 strcpy(pointerName, "__ecerePointer_");
18569 FullClassNameCat(pointerName, _class->fullName, 0);
18570 {
18571 char className[1024];
18572
18573 strcpy(className, "__ecereClass_");
18574 FullClassNameCat(className, classSym->string, 1);
18575 DeclareClass(curExternal, classSym, className);
18576 }
18577 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18578 if(_class->fixed)
18579 {
18580 struct Expression * e;
18581
18582 if(_class->offset && _class->offset == _class->base->structSize)
18583 {
18584 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
18585 ProcessExpressionType(e);
18586 }
18587 else
18588 {
18589 char string[256];
18590
18591 sprintf(string, "%d", _class->offset);
18592 e = MkExpConstant(string);
18593 }
18594 exp = QBrackets(MkExpOp(bytePtr, '+', e));
18595 }
18596 else
18597 {
18598 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18599 }
18600 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18601 exp->expType = __extension__ ({
18602 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18603
18604 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18605 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18606
18607 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18608 }), __ecereInstance2;
18609 });
18610 if(function->body)
18611 {
18612 yylloc = function->body->loc;
18613 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18614 {
18615 struct Context * prevContext = curContext;
18616 struct __ecereNameSpace__ecere__sys__OldList * list;
18617
18618 curContext = function->body->__anon1.compound.context;
18619 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18620 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
18621 curContext = prevContext;
18622 }
18623 decl->symbol = (((void *)0));
18624 if(!function->body->__anon1.compound.declarations)
18625 function->body->__anon1.compound.declarations = MkList();
18626 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18627 }
18628 }
18629 }
18630 }
18631 else
18632 thisClass = (((void *)0));
18633 if(id)
18634 {
18635 FreeSpecifier(id->_class);
18636 id->_class = (((void *)0));
18637 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18638 {
18639 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18640
18641 id = GetDeclId(initDecl->declarator);
18642 FreeSpecifier(id->_class);
18643 id->_class = (((void *)0));
18644 }
18645 }
18646 if(function->body)
18647 topContext = function->body->__anon1.compound.context;
18648 {
18649 struct FunctionDefinition * oldFunction = curFunction;
18650
18651 curFunction = function;
18652 if(function->body)
18653 ProcessStatement(function->body);
18654 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18655 {
18656 struct Statement * prevCompound = curCompound;
18657 struct Context * prevContext = curContext;
18658 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18659
18660 if(!function->body->__anon1.compound.statements)
18661 function->body->__anon1.compound.statements = MkList();
18662 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18663 curCompound = function->body;
18664 curContext = function->body->__anon1.compound.context;
18665 ProcessStatement(fireWatchers);
18666 curContext = prevContext;
18667 curCompound = prevCompound;
18668 }
18669 curFunction = oldFunction;
18670 }
18671 if(function->declarator)
18672 {
18673 ProcessDeclarator(function->declarator, 1);
18674 }
18675 topContext = oldTopContext;
18676 thisClass = oldThisClass;
18677 }
18678
18679 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18680 {
18681 struct ClassDef * def;
18682 struct External * external = curExternal;
18683 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18684
18685 for(def = definitions->first; def; def = def->next)
18686 {
18687 if(def->type == 0)
18688 {
18689 if(def->__anon1.function->declarator)
18690 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18691 else
18692 curExternal = external;
18693 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18694 }
18695 else if(def->type == 2)
18696 {
18697 if(def->__anon1.decl->type == 2)
18698 {
18699 thisClass = regClass;
18700 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18701 thisClass = (((void *)0));
18702 }
18703 else
18704 {
18705 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18706
18707 if(regClass)
18708 thisClass = regClass;
18709 ProcessDeclaration(def->__anon1.decl);
18710 thisClass = backThisClass;
18711 }
18712 }
18713 else if(def->type == 1 && def->__anon1.defProperties)
18714 {
18715 struct MemberInit * defProperty;
18716 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);
18717
18718 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18719 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18720 {
18721 thisClass = regClass;
18722 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18723 thisClass = (((void *)0));
18724 }
18725 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18726 FreeSymbol(thisSymbol);
18727 }
18728 else if(def->type == 3 && def->__anon1.propertyDef)
18729 {
18730 struct PropertyDef * prop = def->__anon1.propertyDef;
18731
18732 thisClass = regClass;
18733 if(prop->setStmt)
18734 {
18735 if(regClass)
18736 {
18737 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18738
18739 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18740 }
18741 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18742 ProcessStatement(prop->setStmt);
18743 }
18744 if(prop->getStmt)
18745 {
18746 if(regClass)
18747 {
18748 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18749
18750 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18751 }
18752 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18753 ProcessStatement(prop->getStmt);
18754 }
18755 if(prop->issetStmt)
18756 {
18757 if(regClass)
18758 {
18759 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18760
18761 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18762 }
18763 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18764 ProcessStatement(prop->issetStmt);
18765 }
18766 thisClass = (((void *)0));
18767 }
18768 else if(def->type == 4 && def->__anon1.propertyWatch)
18769 {
18770 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18771
18772 thisClass = regClass;
18773 if(propertyWatch->compound)
18774 {
18775 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);
18776
18777 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18778 curExternal = (((void *)0));
18779 ProcessStatement(propertyWatch->compound);
18780 }
18781 thisClass = (((void *)0));
18782 }
18783 }
18784 }
18785
18786 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
18787 {
18788 switch(spec->type)
18789 {
18790 case 0:
18791 {
18792 if(spec->__anon1.specifier == THISCLASS)
18793 {
18794 if(thisClass)
18795 {
18796 spec->type = 1;
18797 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
18798 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
18799 ProcessSpecifier(spec, declareStruct);
18800 }
18801 }
18802 break;
18803 }
18804 case 1:
18805 {
18806 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
18807
18808 if(symbol)
18809 DeclareType(curExternal, symbol->type, 1, 1);
18810 else if(spec->__anon1.__anon1.symbol)
18811 {
18812 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
18813
18814 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
18815 }
18816 break;
18817 }
18818 case 2:
18819 {
18820 struct Enumerator * e;
18821
18822 if(spec->__anon1.__anon2.list)
18823 {
18824 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
18825 {
18826 if(e->exp)
18827 ProcessExpressionType(e->exp);
18828 }
18829 }
18830 if(inCompiler)
18831 break;
18832 }
18833 case 3:
18834 case 4:
18835 {
18836 if(spec->__anon1.__anon2.definitions)
18837 {
18838 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
18839
18840 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
18841 }
18842 break;
18843 }
18844 }
18845 }
18846
18847 void ComputeDataTypes()
18848 {
18849 struct External * external;
18850
18851 currentClass = (((void *)0));
18852 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18853 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
18854 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
18855 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
18856 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
18857 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
18858 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
18859 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
18860 DeclareFunctionUtil((((void *)0)), "eSystem_New");
18861 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
18862 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
18863 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
18864 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
18865 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
18866 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
18867 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
18868 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
18869 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
18870 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
18871 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
18872 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
18873 for(external = (*ast).first; external; external = external->next)
18874 {
18875 afterExternal = curExternal = external;
18876 if(external->type == 0)
18877 {
18878 if(memoryGuard)
18879 {
18880 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
18881 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
18882 }
18883 currentClass = external->__anon1.function->_class;
18884 ProcessFunction(external->__anon1.function);
18885 }
18886 else if(external->type == 1)
18887 {
18888 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
18889 {
18890 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
18891 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
18892 }
18893 currentClass = (((void *)0));
18894 if(external->__anon1.declaration)
18895 ProcessDeclaration(external->__anon1.declaration);
18896 }
18897 else if(external->type == 2)
18898 {
18899 struct ClassDefinition * _class = external->__anon1._class;
18900
18901 currentClass = external->symbol->__anon1.registered;
18902 if(memoryGuard)
18903 {
18904 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
18905 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
18906 }
18907 if(_class->definitions)
18908 {
18909 ProcessClass(_class->definitions, _class->symbol);
18910 }
18911 if(inCompiler)
18912 {
18913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18914 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18915 }
18916 }
18917 else if(external->type == 4)
18918 {
18919 thisNameSpace = external->__anon1.id->string;
18920 }
18921 }
18922 currentClass = (((void *)0));
18923 thisNameSpace = (((void *)0));
18924 curExternal = (((void *)0));
18925 }
18926
18927 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
18928 {
18929 switch(decl->type)
18930 {
18931 case 1:
18932 if(decl->__anon1.identifier->classSym)
18933 {
18934 FreeSpecifier(decl->__anon1.identifier->_class);
18935 decl->__anon1.identifier->_class = (((void *)0));
18936 }
18937 break;
18938 case 3:
18939 if(decl->__anon1.array.exp)
18940 ProcessExpressionType(decl->__anon1.array.exp);
18941 case 0:
18942 case 2:
18943 case 4:
18944 case 5:
18945 case 6:
18946 case 7:
18947 {
18948 struct Identifier * id = (((void *)0));
18949 struct Specifier * classSpec = (((void *)0));
18950
18951 if(decl->type == 4)
18952 {
18953 id = GetDeclId(decl);
18954 if(id && id->_class)
18955 {
18956 classSpec = id->_class;
18957 id->_class = (((void *)0));
18958 }
18959 }
18960 if(decl->declarator)
18961 ProcessDeclarator(decl->declarator, isFunction);
18962 if(decl->type == 4)
18963 {
18964 if(classSpec)
18965 {
18966 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
18967
18968 if(!decl->__anon1.function.parameters)
18969 decl->__anon1.function.parameters = MkList();
18970 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
18971 }
18972 if(decl->__anon1.function.parameters)
18973 {
18974 struct TypeName * param;
18975
18976 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
18977 {
18978 if(param->qualifiers)
18979 {
18980 struct Specifier * spec;
18981
18982 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
18983 {
18984 if(spec->type == 0)
18985 {
18986 if(spec->__anon1.specifier == TYPED_OBJECT)
18987 {
18988 struct Declarator * d = param->declarator;
18989 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);
18990
18991 if(d->type != 5)
18992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
18993 FreeList(param->qualifiers, (void *)(FreeSpecifier));
18994 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
18995 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
18996 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
18997 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
18998 param = newParam;
18999 break;
19000 }
19001 else if(spec->__anon1.specifier == ANY_OBJECT)
19002 {
19003 struct Declarator * d = param->declarator;
19004
19005 FreeList(param->qualifiers, (void *)(FreeSpecifier));
19006 param->qualifiers = MkListOne(MkSpecifier(VOID));
19007 if(d->type != 5)
19008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
19009 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
19010 break;
19011 }
19012 else if(spec->__anon1.specifier == THISCLASS)
19013 {
19014 if(thisClass)
19015 {
19016 spec->type = 1;
19017 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
19018 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
19019 ProcessSpecifier(spec, 0);
19020 }
19021 break;
19022 }
19023 }
19024 else if(spec->type == 1)
19025 {
19026 ProcessSpecifier(spec, isFunction);
19027 }
19028 }
19029 }
19030 if(param->declarator)
19031 ProcessDeclarator(param->declarator, 0);
19032 }
19033 }
19034 }
19035 break;
19036 }
19037 }
19038 }
19039
19040 static void ProcessDeclaration(struct Declaration * decl)
19041 {
19042 yylloc = decl->loc;
19043 switch(decl->type)
19044 {
19045 case 1:
19046 {
19047 unsigned int declareStruct = 0;
19048
19049 if(decl->__anon1.__anon1.declarators)
19050 {
19051 struct InitDeclarator * d;
19052
19053 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
19054 {
19055 struct Type * type, * subType;
19056
19057 ProcessDeclarator(d->declarator, 0);
19058 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
19059 if(d->initializer)
19060 {
19061 ProcessInitializer(d->initializer, type);
19062 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
19063 {
19064 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
19065 {
19066 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
19067
19068 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
19069 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
19070 if(decl->__anon1.__anon1.specifiers)
19071 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
19072 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
19073 d = (((void *)0));
19074 decl->type = 2;
19075 decl->__anon1.inst = inst;
19076 }
19077 }
19078 }
19079 for(subType = type; subType; )
19080 {
19081 if(subType->kind == 8)
19082 {
19083 declareStruct = 1;
19084 break;
19085 }
19086 else if(subType->kind == 13)
19087 break;
19088 else if(subType->kind == 12)
19089 subType = subType->__anon1.__anon4.arrayType;
19090 else
19091 break;
19092 }
19093 FreeType(type);
19094 if(!d)
19095 break;
19096 }
19097 }
19098 if(decl->__anon1.__anon1.specifiers)
19099 {
19100 struct Specifier * s;
19101
19102 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
19103 {
19104 ProcessSpecifier(s, declareStruct);
19105 }
19106 }
19107 break;
19108 }
19109 case 2:
19110 {
19111 ProcessInstantiationType(decl->__anon1.inst);
19112 break;
19113 }
19114 case 0:
19115 {
19116 struct Specifier * spec;
19117 struct Declarator * d;
19118 unsigned int declareStruct = 0;
19119
19120 if(decl->__anon1.__anon1.declarators)
19121 {
19122 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
19123 {
19124 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
19125 struct Type * subType;
19126
19127 ProcessDeclarator(d, 0);
19128 for(subType = type; subType; )
19129 {
19130 if(subType->kind == 8)
19131 {
19132 declareStruct = 1;
19133 break;
19134 }
19135 else if(subType->kind == 13)
19136 break;
19137 else if(subType->kind == 12)
19138 subType = subType->__anon1.__anon4.arrayType;
19139 else
19140 break;
19141 }
19142 FreeType(type);
19143 }
19144 }
19145 if(decl->__anon1.__anon1.specifiers)
19146 {
19147 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
19148 ProcessSpecifier(spec, declareStruct);
19149 }
19150 break;
19151 }
19152 }
19153 }
19154
19155 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19156 {
19157 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19158
19159 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19160 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19161 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19162 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19163 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19164 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19165 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19166 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19167 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19168 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19169 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19170 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19171 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19172 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19173 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19174 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19175 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19176 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19177 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19178 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19179 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19180 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19181 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19182 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19183 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19184 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19185 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19186 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19187 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19188 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19189 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19190 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19191 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19192 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19193 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19194 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19195 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19196 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19197 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19198 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19199 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19200 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19201 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19202 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19203 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19204 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19205 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19206 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19207 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19208 __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);
19209 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19210 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19211 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19212 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19213 __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);
19214 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19215 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19216 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19217 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19218 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19219 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19220 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19221 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19222 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19223 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19224 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19225 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19226 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19227 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19228 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19229 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)
19230 __ecereClass_Conversion = class;
19231 __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);
19232 __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);
19233 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19234 __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);
19235 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19236 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19237 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19238 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19239 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19240 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19241 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19242 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19243 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19244 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19245 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19246 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19247 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19248 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19249 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19250 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19251 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19252 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19253 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19254 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19255 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19256 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19257 }
19258