compiler/bootstrap: Fully automated (make updatebootstrap)
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #if defined(_WIN32)
39 #   if defined(__GNUC__) || defined(__TINYC__)
40 #      define stdcall __attribute__((__stdcall__))
41 #   else
42 #      define stdcall __stdcall
43 #   endif
44 #else
45 #   define stdcall
46 #endif
47 #include <stdint.h>
48 #include <sys/types.h>
49 enum yytokentype
50 {
51 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
52 };
53
54 extern int returnCode;
55
56 extern unsigned int yydebug;
57
58 extern unsigned int echoOn;
59
60 void resetScanner();
61
62 int propWatcherID;
63
64 int expression_yyparse();
65
66 static char * thisNameSpace;
67
68 unsigned int thisClassParams = 1;
69
70 unsigned int internalValueCounter;
71
72 extern unsigned int outputLineNumbers;
73
74 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isInf;
75
76 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_signBit;
77
78 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isNan;
79
80 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isInf;
81
82 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_signBit;
83
84 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isNan;
85
86 extern int targetBits;
87
88 extern unsigned int inCompiler;
89
90 extern unsigned int inPreCompiler;
91
92 extern unsigned int inDebugger;
93
94 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
95
96 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
97
98 int UnescapeString(char * d, char * s, int len)
99 {
100 int j = 0, k = 0;
101 char ch;
102
103 while(j < len && (ch = s[j]))
104 {
105 switch(ch)
106 {
107 case '\\':
108 switch((ch = s[++j]))
109 {
110 case 'n':
111 d[k] = '\n';
112 break;
113 case 't':
114 d[k] = '\t';
115 break;
116 case 'a':
117 d[k] = '\a';
118 break;
119 case 'b':
120 d[k] = '\b';
121 break;
122 case 'f':
123 d[k] = '\f';
124 break;
125 case 'r':
126 d[k] = '\r';
127 break;
128 case 'v':
129 d[k] = '\v';
130 break;
131 case '\\':
132 d[k] = '\\';
133 break;
134 case '\"':
135 d[k] = '\"';
136 break;
137 case '\'':
138 d[k] = '\'';
139 break;
140 default:
141 d[k] = '\\';
142 d[k] = ch;
143 }
144 break;
145 default:
146 d[k] = ch;
147 }
148 j++, k++;
149 }
150 d[k] = '\0';
151 return k;
152 }
153
154 char * OffsetEscapedString(char * s, int len, int offset)
155 {
156 char ch;
157 int j = 0, k = 0;
158
159 while(j < len && k < offset && (ch = s[j]))
160 {
161 if(ch == '\\')
162 ++j;
163 j++, k++;
164 }
165 return (k == offset) ? s + j : (((void *)0));
166 }
167
168 extern int __ecereVMethodID_class_OnGetString;
169
170 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
171
172 extern unsigned int parseError;
173
174 static int definedExpStackPos;
175
176 static void * definedExpStack[512];
177
178 extern const char *  sourceFile;
179
180 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
181
182 extern unsigned int memoryGuard;
183
184 struct __ecereNameSpace__ecere__sys__OldList
185 {
186 void *  first;
187 void *  last;
188 int count;
189 unsigned int offset;
190 unsigned int circ;
191 } __attribute__ ((gcc_struct));
192
193 struct __ecereNameSpace__ecere__com__DataValue
194 {
195 union
196 {
197 char c;
198 unsigned char uc;
199 short s;
200 unsigned short us;
201 int i;
202 unsigned int ui;
203 void *  p;
204 float f;
205 double d;
206 long long i64;
207 uint64 ui64;
208 } __attribute__ ((gcc_struct)) __anon1;
209 } __attribute__ ((gcc_struct));
210
211 struct __ecereNameSpace__ecere__com__SerialBuffer
212 {
213 unsigned char *  _buffer;
214 unsigned int count;
215 unsigned int _size;
216 unsigned int pos;
217 } __attribute__ ((gcc_struct));
218
219 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
220
221 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
222
223 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
224
225 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
226
227 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
228
229 struct Pointer;
230
231 struct Attrib;
232
233 struct Attribute;
234
235 struct TemplateArgument;
236
237 struct DBTableEntry;
238
239 struct DBIndexItem;
240
241 struct DBTableDef;
242
243 struct CodePosition
244 {
245 int line;
246 int charPos;
247 int pos;
248 int included;
249 } __attribute__ ((gcc_struct));
250
251 extern size_t strlen(const char * );
252
253 extern int strcmp(const char * , const char * );
254
255 extern int sprintf(char * , const char * , ...);
256
257 extern char *  strcat(char * , const char * );
258
259 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
260
261 extern int isprint(int c);
262
263 extern char *  strcpy(char * , const char * );
264
265 extern void Compiler_Error(const char *  format, ...);
266
267 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
268
269 struct __ecereNameSpace__ecere__com__LinkList
270 {
271 void * first;
272 void * last;
273 int count;
274 } __attribute__ ((gcc_struct));
275
276 extern char *  strchr(const char * , int);
277
278 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
279
280 extern void *  memcpy(void * , const void * , size_t size);
281
282 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
283
284 extern void Compiler_Warning(const char *  format, ...);
285
286 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
287
288 extern long long strtoll(const char *  nptr, char * *  endptr, int base);
289
290 extern uint64 strtoull(const char *  nptr, char * *  endptr, int base);
291
292 extern int strtol(const char * , char * * , int base);
293
294 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
295
296 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
297
298 extern double strtod(const char * , char * * );
299
300 extern int strncmp(const char * , const char * , size_t n);
301
302 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
303
304 extern char *  QMkString(const char *  source);
305
306 extern char *  strncpy(char * , const char * , size_t n);
307
308 extern int printf(const char * , ...);
309
310 extern char *  strstr(const char * , const char * );
311
312 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
313
314 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
315
316 extern int (* __ecereProp_float_Get_signBit)(float this);
317
318 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
319
320 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
321
322 extern int (* __ecereProp_double_Get_signBit)(double this);
323
324 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
325
326 extern float (* __ecereMethod_float_inf)(void);
327
328 extern float (* __ecereMethod_float_nan)(void);
329
330 extern double (* __ecereMethod_double_inf)(void);
331
332 extern double (* __ecereMethod_double_nan)(void);
333
334 int __ecereVMethodID_class_OnGetString;
335
336 void SetYydebug(unsigned int b)
337 {
338 yydebug = b;
339 }
340
341 unsigned int GetParseError()
342 {
343 return parseError;
344 }
345
346 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
347
348 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
349
350 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
351
352 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
353
354 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
355
356 struct __ecereNameSpace__ecere__com__EnumClassData
357 {
358 struct __ecereNameSpace__ecere__sys__OldList values;
359 long long largest;
360 } __attribute__ ((gcc_struct));
361
362 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
363
364 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
365
366 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
367
368 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
369
370 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
371
372 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
373
374 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
375
376 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
377
378 struct Location
379 {
380 struct CodePosition start;
381 struct CodePosition end;
382 } __attribute__ ((gcc_struct));
383
384 void ReadString(char * output, char * string)
385 {
386 int len = strlen(string);
387 int c, d = 0;
388 unsigned int quoted = 0, escaped = 0;
389
390 for(c = 0; c < len; c++)
391 {
392 char ch = string[c];
393
394 if(escaped)
395 {
396 switch(ch)
397 {
398 case 'n':
399 output[d] = '\n';
400 break;
401 case 't':
402 output[d] = '\t';
403 break;
404 case 'a':
405 output[d] = '\a';
406 break;
407 case 'b':
408 output[d] = '\b';
409 break;
410 case 'f':
411 output[d] = '\f';
412 break;
413 case 'r':
414 output[d] = '\r';
415 break;
416 case 'v':
417 output[d] = '\v';
418 break;
419 case '\\':
420 output[d] = '\\';
421 break;
422 case '\"':
423 output[d] = '\"';
424 break;
425 case '\'':
426 output[d] = '\'';
427 break;
428 default:
429 output[d] = ch;
430 }
431 d++;
432 escaped = 0;
433 }
434 else
435 {
436 if(ch == '\"')
437 quoted ^= 1;
438 else if(quoted)
439 {
440 if(ch == '\\')
441 escaped = 1;
442 else
443 output[d++] = ch;
444 }
445 }
446 }
447 output[d] = '\0';
448 }
449
450 char * PrintInt(long long result)
451 {
452 char temp[100];
453
454 if(result > (((int)0x7fffffff)))
455 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
456 else
457 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
458 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
459 strcat(temp, "LL");
460 return __ecereNameSpace__ecere__sys__CopyString(temp);
461 }
462
463 char * PrintUInt(uint64 result)
464 {
465 char temp[100];
466
467 if(result > (0xffffffff))
468 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
469 else if(result > (((int)0x7fffffff)))
470 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
471 else
472 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
473 return __ecereNameSpace__ecere__sys__CopyString(temp);
474 }
475
476 char * PrintInt64(long long result)
477 {
478 char temp[100];
479
480 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
481 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
482 else
483 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
484 return __ecereNameSpace__ecere__sys__CopyString(temp);
485 }
486
487 char * PrintUInt64(uint64 result)
488 {
489 char temp[100];
490
491 if(result > (0xffffffff))
492 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
493 else if(result > (((int)0x7fffffff)))
494 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
495 else
496 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
497 return __ecereNameSpace__ecere__sys__CopyString(temp);
498 }
499
500 char * PrintHexUInt(uint64 result)
501 {
502 char temp[100];
503
504 if(result > (0xffffffff))
505 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
506 else
507 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
508 if(result > (0xffffffff))
509 strcat(temp, "LL");
510 return __ecereNameSpace__ecere__sys__CopyString(temp);
511 }
512
513 char * PrintHexUInt64(uint64 result)
514 {
515 char temp[100];
516
517 if(result > (0xffffffff))
518 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
519 else
520 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
521 return __ecereNameSpace__ecere__sys__CopyString(temp);
522 }
523
524 char * PrintShort(short result)
525 {
526 char temp[100];
527
528 sprintf(temp, "%d", (unsigned short)result);
529 return __ecereNameSpace__ecere__sys__CopyString(temp);
530 }
531
532 char * PrintUShort(unsigned short result)
533 {
534 char temp[100];
535
536 if(result > (unsigned short)32767)
537 sprintf(temp, "0x%X", (int)result);
538 else
539 sprintf(temp, "%d", (int)result);
540 return __ecereNameSpace__ecere__sys__CopyString(temp);
541 }
542
543 char * PrintUChar(unsigned char result)
544 {
545 char temp[100];
546
547 sprintf(temp, "0x%X", result);
548 return __ecereNameSpace__ecere__sys__CopyString(temp);
549 }
550
551 char * PrintChar(char result)
552 {
553 char temp[100];
554
555 if(result > (char)0 && isprint(result))
556 sprintf(temp, "'%c'", result);
557 else if(result < (char)0)
558 sprintf(temp, "%d", (int)result);
559 else
560 sprintf(temp, "0x%X", (unsigned char)result);
561 return __ecereNameSpace__ecere__sys__CopyString(temp);
562 }
563
564 char * PrintFloat(float result)
565 {
566 char temp[350];
567
568 if(__ecereProp_float_Get_isInf(result))
569 {
570 if(__ecereProp_float_Get_signBit(result))
571 strcpy(temp, "-inf");
572 else
573 strcpy(temp, "inf");
574 }
575 else if(__ecereProp_float_Get_isNan(result))
576 {
577 if(__ecereProp_float_Get_signBit(result))
578 strcpy(temp, "-nan");
579 else
580 strcpy(temp, "nan");
581 }
582 else
583 sprintf(temp, "%.16ff", result);
584 return __ecereNameSpace__ecere__sys__CopyString(temp);
585 }
586
587 char * PrintDouble(double result)
588 {
589 char temp[350];
590
591 if(__ecereProp_double_Get_isInf(result))
592 {
593 if(__ecereProp_double_Get_signBit(result))
594 strcpy(temp, "-inf");
595 else
596 strcpy(temp, "inf");
597 }
598 else if(__ecereProp_double_Get_isNan(result))
599 {
600 if(__ecereProp_double_Get_signBit(result))
601 strcpy(temp, "-nan");
602 else
603 strcpy(temp, "nan");
604 }
605 else
606 sprintf(temp, "%.16f", result);
607 return __ecereNameSpace__ecere__sys__CopyString(temp);
608 }
609
610 extern struct Location yylloc;
611
612 struct ExtDecl
613 {
614 struct Location loc;
615 int type;
616 union
617 {
618 char * s;
619 struct Attrib * attr;
620 } __attribute__ ((gcc_struct)) __anon1;
621 } __attribute__ ((gcc_struct));
622
623 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
624
625 struct Expression;
626
627 extern struct Expression * parsedExpression;
628
629 extern struct Expression * QMkExpId(const char *  id);
630
631 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
632
633 void ComputeExpression(struct Expression * exp);
634
635 extern struct Expression * MkExpConstant(const char *  string);
636
637 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
638
639 extern void FreeExpression(struct Expression * exp);
640
641 extern void FreeExpContents(struct Expression * exp);
642
643 extern struct Expression * CopyExpression(struct Expression * exp);
644
645 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
646
647 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
648
649 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
650
651 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
652
653 extern struct Expression * MoveExpContents(struct Expression * exp);
654
655 extern struct Expression * QBrackets(struct Expression * exp);
656
657 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
658
659 struct Statement;
660
661 static struct Statement * curCompound;
662
663 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
664
665 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
666
667 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
668
669 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
670
671 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
672
673 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
674
675 struct External;
676
677 struct External * curExternal, * afterExternal;
678
679 extern void FreeExternal(struct External * external);
680
681 struct Type;
682
683 static struct Type * curSwitchType;
684
685 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
686
687 extern void FreeType(struct Type * type);
688
689 extern struct Type * MkClassType(const char *  name);
690
691 extern void CopyTypeInto(struct Type * type, struct Type * src);
692
693 struct __ecereNameSpace__ecere__com__Class;
694
695 struct __ecereNameSpace__ecere__com__Instance
696 {
697 void * *  _vTbl;
698 struct __ecereNameSpace__ecere__com__Class * _class;
699 int _refCount;
700 } __attribute__ ((gcc_struct));
701
702 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
703
704 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
705
706 static struct __ecereNameSpace__ecere__com__Class * currentClass;
707
708 struct __ecereNameSpace__ecere__com__Class * thisClass;
709
710 struct __ecereNameSpace__ecere__com__Class * containerClass;
711
712 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
713
714 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
715
716 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
717
718 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
719
720 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
721
722 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
723
724 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
725
726 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
727
728 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
729
730 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
731
732 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
733
734 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
735 {
736 thisClass = c;
737 }
738
739 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
740 {
741 return thisClass;
742 }
743
744 struct Context;
745
746 extern struct Context * curContext;
747
748 extern struct Context * topContext;
749
750 extern struct Context * PushContext(void);
751
752 extern void PopContext(struct Context * ctx);
753
754 extern void FreeContext(struct Context * context);
755
756 extern struct Context * globalContext;
757
758 struct ModuleImport;
759
760 extern struct ModuleImport * mainModule;
761
762 struct ModuleImport
763 {
764 struct ModuleImport * prev;
765 struct ModuleImport * next;
766 char *  name;
767 struct __ecereNameSpace__ecere__sys__OldList classes;
768 struct __ecereNameSpace__ecere__sys__OldList functions;
769 int importType;
770 int importAccess;
771 } __attribute__ ((gcc_struct));
772
773 struct __ecereNameSpace__ecere__com__NameSpace;
774
775 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
776
777 struct FunctionDefinition;
778
779 static struct FunctionDefinition * curFunction;
780
781 struct __ecereNameSpace__ecere__sys__BTNode;
782
783 struct __ecereNameSpace__ecere__sys__BTNode
784 {
785 uintptr_t key;
786 struct __ecereNameSpace__ecere__sys__BTNode * parent;
787 struct __ecereNameSpace__ecere__sys__BTNode * left;
788 struct __ecereNameSpace__ecere__sys__BTNode * right;
789 int depth;
790 } __attribute__ ((gcc_struct));
791
792 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
793
794 struct __ecereNameSpace__ecere__com__Property;
795
796 struct __ecereNameSpace__ecere__com__Property
797 {
798 struct __ecereNameSpace__ecere__com__Property * prev;
799 struct __ecereNameSpace__ecere__com__Property * next;
800 const char *  name;
801 unsigned int isProperty;
802 int memberAccess;
803 int id;
804 struct __ecereNameSpace__ecere__com__Class * _class;
805 const char *  dataTypeString;
806 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
807 struct Type * dataType;
808 void (*  Set)(void * , int);
809 int (*  Get)(void * );
810 unsigned int (*  IsSet)(void * );
811 void *  data;
812 void *  symbol;
813 int vid;
814 unsigned int conversion;
815 unsigned int watcherOffset;
816 const char *  category;
817 unsigned int compiled;
818 unsigned int selfWatchable;
819 unsigned int isWatchable;
820 } __attribute__ ((gcc_struct));
821
822 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
823
824 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);
825
826 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
827
828 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
829
830 struct Identifier;
831
832 extern void FreeIdentifier(struct Identifier * id);
833
834 extern struct Identifier * MkIdentifier(const char *  string);
835
836 extern struct Expression * MkExpIdentifier(struct Identifier * id);
837
838 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
839
840 extern struct Identifier * CopyIdentifier(struct Identifier * id);
841
842 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
843
844 struct __ecereNameSpace__ecere__sys__OldLink;
845
846 struct __ecereNameSpace__ecere__sys__OldLink
847 {
848 struct __ecereNameSpace__ecere__sys__OldLink * prev;
849 struct __ecereNameSpace__ecere__sys__OldLink * next;
850 void *  data;
851 } __attribute__ ((gcc_struct));
852
853 struct Declaration;
854
855 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
856
857 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
858
859 struct Specifier;
860
861 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
862
863 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
864
865 extern struct Specifier * MkSpecifier(int specifier);
866
867 extern struct Specifier * MkSpecifierName(const char *  name);
868
869 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
870
871 extern void FreeSpecifier(struct Specifier * spec);
872
873 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
874
875 struct Statement
876 {
877 struct Statement * prev;
878 struct Statement * next;
879 struct Location loc;
880 int type;
881 union
882 {
883 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
884 struct
885 {
886 struct Identifier * id;
887 struct Statement * stmt;
888 } __attribute__ ((gcc_struct)) labeled;
889 struct
890 {
891 struct Expression * exp;
892 struct Statement * stmt;
893 } __attribute__ ((gcc_struct)) caseStmt;
894 struct
895 {
896 struct __ecereNameSpace__ecere__sys__OldList * declarations;
897 struct __ecereNameSpace__ecere__sys__OldList * statements;
898 struct Context * context;
899 unsigned int isSwitch;
900 } __attribute__ ((gcc_struct)) compound;
901 struct
902 {
903 struct __ecereNameSpace__ecere__sys__OldList * exp;
904 struct Statement * stmt;
905 struct Statement * elseStmt;
906 } __attribute__ ((gcc_struct)) ifStmt;
907 struct
908 {
909 struct __ecereNameSpace__ecere__sys__OldList * exp;
910 struct Statement * stmt;
911 } __attribute__ ((gcc_struct)) switchStmt;
912 struct
913 {
914 struct __ecereNameSpace__ecere__sys__OldList * exp;
915 struct Statement * stmt;
916 } __attribute__ ((gcc_struct)) whileStmt;
917 struct
918 {
919 struct __ecereNameSpace__ecere__sys__OldList * exp;
920 struct Statement * stmt;
921 } __attribute__ ((gcc_struct)) doWhile;
922 struct
923 {
924 struct Statement * init;
925 struct Statement * check;
926 struct __ecereNameSpace__ecere__sys__OldList * increment;
927 struct Statement * stmt;
928 } __attribute__ ((gcc_struct)) forStmt;
929 struct
930 {
931 struct Identifier * id;
932 } __attribute__ ((gcc_struct)) gotoStmt;
933 struct
934 {
935 struct Specifier * spec;
936 char * statements;
937 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
938 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
939 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
940 } __attribute__ ((gcc_struct)) asmStmt;
941 struct
942 {
943 struct Expression * watcher;
944 struct Expression * object;
945 struct __ecereNameSpace__ecere__sys__OldList * watches;
946 } __attribute__ ((gcc_struct)) _watch;
947 struct
948 {
949 struct Identifier * id;
950 struct __ecereNameSpace__ecere__sys__OldList * exp;
951 struct __ecereNameSpace__ecere__sys__OldList * filter;
952 struct Statement * stmt;
953 } __attribute__ ((gcc_struct)) forEachStmt;
954 struct Declaration * decl;
955 } __attribute__ ((gcc_struct)) __anon1;
956 } __attribute__ ((gcc_struct));
957
958 extern struct Specifier * CopySpecifier(struct Specifier * spec);
959
960 extern struct Expression * MkExpClassSize(struct Specifier * _class);
961
962 struct Symbol;
963
964 struct Identifier
965 {
966 struct Identifier * prev;
967 struct Identifier * next;
968 struct Location loc;
969 struct Symbol * classSym;
970 struct Specifier * _class;
971 char *  string;
972 struct Identifier * badID;
973 } __attribute__ ((gcc_struct));
974
975 extern struct Symbol * FindStruct(struct Context * ctx, const char *  name);
976
977 extern struct Symbol * FindClass(const char *  name);
978
979 extern void DeclareClass(struct External * neededFor, struct Symbol * classSym, const char *  className);
980
981 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
982
983 extern void FreeSymbol(struct Symbol * symbol);
984
985 struct ClassDef;
986
987 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
988
989 extern void FreeClassDef(struct ClassDef * def);
990
991 struct Declarator;
992
993 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
994
995 struct TemplateDatatype
996 {
997 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
998 struct Declarator * decl;
999 } __attribute__ ((gcc_struct));
1000
1001 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1002
1003 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1004
1005 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1006
1007 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
1008
1009 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
1010
1011 struct Declarator
1012 {
1013 struct Declarator * prev;
1014 struct Declarator * next;
1015 struct Location loc;
1016 int type;
1017 struct Symbol * symbol;
1018 struct Declarator * declarator;
1019 union
1020 {
1021 struct Identifier * identifier;
1022 struct
1023 {
1024 struct Expression * exp;
1025 struct Expression * posExp;
1026 struct Attrib * attrib;
1027 } __attribute__ ((gcc_struct)) structDecl;
1028 struct
1029 {
1030 struct Expression * exp;
1031 struct Specifier * enumClass;
1032 } __attribute__ ((gcc_struct)) array;
1033 struct
1034 {
1035 struct __ecereNameSpace__ecere__sys__OldList * parameters;
1036 } __attribute__ ((gcc_struct)) function;
1037 struct
1038 {
1039 struct Pointer * pointer;
1040 } __attribute__ ((gcc_struct)) pointer;
1041 struct
1042 {
1043 struct ExtDecl * extended;
1044 } __attribute__ ((gcc_struct)) extended;
1045 } __attribute__ ((gcc_struct)) __anon1;
1046 } __attribute__ ((gcc_struct));
1047
1048 extern struct Identifier * GetDeclId(struct Declarator * decl);
1049
1050 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
1051
1052 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1053
1054 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1055
1056 extern void FreeDeclarator(struct Declarator * decl);
1057
1058 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1059
1060 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
1061
1062 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1063
1064 struct FunctionDefinition
1065 {
1066 struct FunctionDefinition * prev;
1067 struct FunctionDefinition * next;
1068 struct Location loc;
1069 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1070 struct Declarator * declarator;
1071 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1072 struct Statement * body;
1073 struct __ecereNameSpace__ecere__com__Class * _class;
1074 struct __ecereNameSpace__ecere__sys__OldList attached;
1075 int declMode;
1076 struct Type * type;
1077 struct Symbol * propSet;
1078 int tempCount;
1079 unsigned int propertyNoThis;
1080 } __attribute__ ((gcc_struct));
1081
1082 extern struct Declarator * QMkPtrDecl(const char *  id);
1083
1084 struct ClassFunction;
1085
1086 struct ClassFunction
1087 {
1088 struct ClassFunction * prev;
1089 struct ClassFunction * next;
1090 struct Location loc;
1091 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1092 struct Declarator * declarator;
1093 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1094 struct Statement * body;
1095 struct __ecereNameSpace__ecere__com__Class * _class;
1096 struct __ecereNameSpace__ecere__sys__OldList attached;
1097 int declMode;
1098 struct Type * type;
1099 struct Symbol * propSet;
1100 unsigned int isVirtual;
1101 unsigned int isConstructor;
1102 unsigned int isDestructor;
1103 unsigned int dontMangle;
1104 int id;
1105 int idCode;
1106 } __attribute__ ((gcc_struct));
1107
1108 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);
1109
1110 extern void FreeClassFunction(struct ClassFunction * func);
1111
1112 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1113
1114 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1115
1116 struct TypeName;
1117
1118 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1119
1120 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1121
1122 struct TypeName
1123 {
1124 struct TypeName * prev;
1125 struct TypeName * next;
1126 struct Location loc;
1127 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
1128 struct Declarator * declarator;
1129 int classObjectType;
1130 struct Expression * bitCount;
1131 } __attribute__ ((gcc_struct));
1132
1133 extern void FreeTypeName(struct TypeName * typeName);
1134
1135 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
1136
1137 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
1138
1139 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
1140
1141 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
1142
1143 struct __ecereNameSpace__ecere__com__BTNamedLink;
1144
1145 struct __ecereNameSpace__ecere__com__BTNamedLink
1146 {
1147 const char *  name;
1148 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1149 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1150 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1151 int depth;
1152 void *  data;
1153 } __attribute__ ((gcc_struct));
1154
1155 struct __ecereNameSpace__ecere__sys__NamedLink64;
1156
1157 struct __ecereNameSpace__ecere__sys__NamedLink64
1158 {
1159 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
1160 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
1161 char *  name;
1162 long long data;
1163 } __attribute__ ((gcc_struct));
1164
1165 struct Instantiation;
1166
1167 struct Declaration
1168 {
1169 struct Declaration * prev;
1170 struct Declaration * next;
1171 struct Location loc;
1172 int type;
1173 union
1174 {
1175 struct
1176 {
1177 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1178 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1179 } __attribute__ ((gcc_struct)) __anon1;
1180 struct Instantiation * inst;
1181 struct
1182 {
1183 struct Identifier * id;
1184 struct Expression * exp;
1185 } __attribute__ ((gcc_struct)) __anon2;
1186 } __attribute__ ((gcc_struct)) __anon1;
1187 struct Specifier * extStorage;
1188 struct Symbol * symbol;
1189 int declMode;
1190 } __attribute__ ((gcc_struct));
1191
1192 struct Instantiation
1193 {
1194 struct Instantiation * prev;
1195 struct Instantiation * next;
1196 struct Location loc;
1197 struct Specifier * _class;
1198 struct Expression * exp;
1199 struct __ecereNameSpace__ecere__sys__OldList *  members;
1200 struct Symbol * symbol;
1201 unsigned int fullSet;
1202 unsigned int isConstant;
1203 unsigned char *  data;
1204 struct Location nameLoc;
1205 struct Location insideLoc;
1206 unsigned int built;
1207 } __attribute__ ((gcc_struct));
1208
1209 extern void FreeInstance(struct Instantiation * inst);
1210
1211 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
1212
1213 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
1214
1215 struct InitDeclarator;
1216
1217 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1218
1219 struct PropertyWatch;
1220
1221 struct PropertyWatch
1222 {
1223 struct PropertyWatch * prev;
1224 struct PropertyWatch * next;
1225 struct Location loc;
1226 struct Statement * compound;
1227 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1228 unsigned int deleteWatch;
1229 } __attribute__ ((gcc_struct));
1230
1231 extern void FreePropertyWatch(struct PropertyWatch * watcher);
1232
1233 struct PropertyImport;
1234
1235 struct PropertyImport
1236 {
1237 struct PropertyImport * prev;
1238 struct PropertyImport * next;
1239 char *  name;
1240 unsigned int isVirtual;
1241 unsigned int hasSet;
1242 unsigned int hasGet;
1243 } __attribute__ ((gcc_struct));
1244
1245 struct MethodImport;
1246
1247 struct MethodImport
1248 {
1249 struct MethodImport * prev;
1250 struct MethodImport * next;
1251 char *  name;
1252 unsigned int isVirtual;
1253 } __attribute__ ((gcc_struct));
1254
1255 struct FunctionImport;
1256
1257 struct FunctionImport
1258 {
1259 struct FunctionImport * prev;
1260 struct FunctionImport * next;
1261 char *  name;
1262 } __attribute__ ((gcc_struct));
1263
1264 struct ClassImport;
1265
1266 struct ClassImport
1267 {
1268 struct ClassImport * prev;
1269 struct ClassImport * next;
1270 char *  name;
1271 struct __ecereNameSpace__ecere__sys__OldList methods;
1272 struct __ecereNameSpace__ecere__sys__OldList properties;
1273 unsigned int itself;
1274 int isRemote;
1275 } __attribute__ ((gcc_struct));
1276
1277 struct Initializer;
1278
1279 struct Expression
1280 {
1281 struct Expression * prev;
1282 struct Expression * next;
1283 struct Location loc;
1284 int type;
1285 union
1286 {
1287 struct
1288 {
1289 char *  constant;
1290 struct Identifier * identifier;
1291 } __attribute__ ((gcc_struct)) __anon1;
1292 struct Statement * compound;
1293 struct Instantiation * instance;
1294 struct
1295 {
1296 char *  string;
1297 unsigned int intlString;
1298 unsigned int wideString;
1299 } __attribute__ ((gcc_struct)) __anon2;
1300 struct __ecereNameSpace__ecere__sys__OldList *  list;
1301 struct
1302 {
1303 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1304 struct Declarator * decl;
1305 } __attribute__ ((gcc_struct)) _classExp;
1306 struct
1307 {
1308 struct Identifier * id;
1309 } __attribute__ ((gcc_struct)) classData;
1310 struct
1311 {
1312 struct Expression * exp;
1313 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1314 struct Location argLoc;
1315 } __attribute__ ((gcc_struct)) call;
1316 struct
1317 {
1318 struct Expression * exp;
1319 struct __ecereNameSpace__ecere__sys__OldList * index;
1320 } __attribute__ ((gcc_struct)) index;
1321 struct
1322 {
1323 struct Expression * exp;
1324 struct Identifier * member;
1325 int memberType;
1326 unsigned int thisPtr;
1327 } __attribute__ ((gcc_struct)) member;
1328 struct
1329 {
1330 int op;
1331 struct Expression * exp1;
1332 struct Expression * exp2;
1333 } __attribute__ ((gcc_struct)) op;
1334 struct TypeName * typeName;
1335 struct Specifier * _class;
1336 struct
1337 {
1338 struct TypeName * typeName;
1339 struct Expression * exp;
1340 } __attribute__ ((gcc_struct)) cast;
1341 struct
1342 {
1343 struct Expression * cond;
1344 struct __ecereNameSpace__ecere__sys__OldList * exp;
1345 struct Expression * elseExp;
1346 } __attribute__ ((gcc_struct)) cond;
1347 struct
1348 {
1349 struct TypeName * typeName;
1350 struct Expression * size;
1351 } __attribute__ ((gcc_struct)) _new;
1352 struct
1353 {
1354 struct TypeName * typeName;
1355 struct Expression * size;
1356 struct Expression * exp;
1357 } __attribute__ ((gcc_struct)) _renew;
1358 struct
1359 {
1360 char * table;
1361 struct Identifier * id;
1362 } __attribute__ ((gcc_struct)) db;
1363 struct
1364 {
1365 struct Expression * ds;
1366 struct Expression * name;
1367 } __attribute__ ((gcc_struct)) dbopen;
1368 struct
1369 {
1370 struct TypeName * typeName;
1371 struct Initializer * initializer;
1372 } __attribute__ ((gcc_struct)) initializer;
1373 struct
1374 {
1375 struct Expression * exp;
1376 struct TypeName * typeName;
1377 } __attribute__ ((gcc_struct)) vaArg;
1378 } __attribute__ ((gcc_struct)) __anon1;
1379 unsigned int debugValue;
1380 struct __ecereNameSpace__ecere__com__DataValue val;
1381 uint64 address;
1382 unsigned int hasAddress;
1383 struct Type * expType;
1384 struct Type * destType;
1385 unsigned int usage;
1386 int tempCount;
1387 unsigned int byReference;
1388 unsigned int isConstant;
1389 unsigned int addedThis;
1390 unsigned int needCast;
1391 unsigned int thisPtr;
1392 unsigned int opDestType;
1393 unsigned int needTemplateCast;
1394 } __attribute__ ((gcc_struct));
1395
1396 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1397
1398 struct Initializer
1399 {
1400 struct Initializer * prev;
1401 struct Initializer * next;
1402 struct Location loc;
1403 int type;
1404 union
1405 {
1406 struct Expression * exp;
1407 struct __ecereNameSpace__ecere__sys__OldList *  list;
1408 } __attribute__ ((gcc_struct)) __anon1;
1409 unsigned int isConstant;
1410 struct Identifier * id;
1411 } __attribute__ ((gcc_struct));
1412
1413 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1414
1415 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
1416
1417 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
1418
1419 struct InitDeclarator
1420 {
1421 struct InitDeclarator * prev;
1422 struct InitDeclarator * next;
1423 struct Location loc;
1424 struct Declarator * declarator;
1425 struct Initializer * initializer;
1426 } __attribute__ ((gcc_struct));
1427
1428 void ApplyLocation(struct Expression * exp, struct Location * loc)
1429 {
1430 exp->loc = *loc;
1431 switch(exp->type)
1432 {
1433 case 4:
1434 if(exp->__anon1.op.exp1)
1435 ApplyLocation(exp->__anon1.op.exp1, loc);
1436 if(exp->__anon1.op.exp2)
1437 ApplyLocation(exp->__anon1.op.exp2, loc);
1438 break;
1439 case 5:
1440 if(exp->__anon1.list)
1441 {
1442 struct Expression * e;
1443
1444 for(e = (*exp->__anon1.list).first; e; e = e->next)
1445 ApplyLocation(e, loc);
1446 }
1447 break;
1448 case 6:
1449 if(exp->__anon1.index.index)
1450 {
1451 struct Expression * e;
1452
1453 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1454 ApplyLocation(e, loc);
1455 }
1456 if(exp->__anon1.index.exp)
1457 ApplyLocation(exp->__anon1.index.exp, loc);
1458 break;
1459 case 7:
1460 if(exp->__anon1.call.arguments)
1461 {
1462 struct Expression * arg;
1463
1464 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1465 ApplyLocation(arg, loc);
1466 }
1467 if(exp->__anon1.call.exp)
1468 ApplyLocation(exp->__anon1.call.exp, loc);
1469 break;
1470 case 8:
1471 case 9:
1472 if(exp->__anon1.member.exp)
1473 ApplyLocation(exp->__anon1.member.exp, loc);
1474 break;
1475 case 11:
1476 if(exp->__anon1.cast.exp)
1477 ApplyLocation(exp->__anon1.cast.exp, loc);
1478 break;
1479 case 12:
1480 if(exp->__anon1.cond.exp)
1481 {
1482 struct Expression * e;
1483
1484 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1485 ApplyLocation(e, loc);
1486 }
1487 if(exp->__anon1.cond.cond)
1488 ApplyLocation(exp->__anon1.cond.cond, loc);
1489 if(exp->__anon1.cond.elseExp)
1490 ApplyLocation(exp->__anon1.cond.elseExp, loc);
1491 break;
1492 case 34:
1493 if(exp->__anon1.vaArg.exp)
1494 ApplyLocation(exp->__anon1.vaArg.exp, loc);
1495 break;
1496 default:
1497 break;
1498 }
1499 }
1500
1501 void __ecereMethod_Expression_Clear();
1502
1503 struct MembersInit;
1504
1505 struct MembersInit
1506 {
1507 struct MembersInit * prev;
1508 struct MembersInit * next;
1509 struct Location loc;
1510 int type;
1511 union
1512 {
1513 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1514 struct ClassFunction * function;
1515 } __attribute__ ((gcc_struct)) __anon1;
1516 } __attribute__ ((gcc_struct));
1517
1518 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
1519
1520 struct Operand;
1521
1522 struct OpTable
1523 {
1524 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1525 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1526 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1527 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1528 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1529 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1530 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1531 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1532 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1533 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1534 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1535 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1536 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1537 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1538 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1539 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1540 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1541 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1542 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1543 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1544 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1545 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1546 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1547 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1548 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1549 unsigned int (*  Not)(struct Expression *, struct Operand *);
1550 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1551 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1552 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1553 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1554 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1555 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1556 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1557 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1558 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1559 } __attribute__ ((gcc_struct));
1560
1561 struct Operand
1562 {
1563 int kind;
1564 struct Type * type;
1565 unsigned int ptrSize;
1566 union
1567 {
1568 char c;
1569 unsigned char uc;
1570 short s;
1571 unsigned short us;
1572 int i;
1573 unsigned int ui;
1574 float f;
1575 double d;
1576 long long i64;
1577 uint64 ui64;
1578 } __attribute__ ((gcc_struct)) __anon1;
1579 struct OpTable ops;
1580 } __attribute__ ((gcc_struct));
1581
1582 struct External *  _DeclareStruct(struct External *  neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl);
1583
1584 struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference)
1585 {
1586 return _DeclareStruct(neededBy, name, skipNoHead, needDereference, 0);
1587 }
1588
1589 static void _DeclareType(struct External *  neededFor, struct Type *  type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl);
1590
1591 void DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1592 {
1593 _DeclareType(neededFor, type, needDereference, forFunctionDef, 0);
1594 }
1595
1596 void DeclareTypeForwardDeclare(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1597 {
1598 _DeclareType(neededFor, type, needDereference, forFunctionDef, 1);
1599 }
1600
1601 static void _PrintType(struct Type *  type, char *  string, unsigned int printName, unsigned int fullName, unsigned int printConst);
1602
1603 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1604 {
1605 _PrintType(type, string, printName, fullName, 1);
1606 }
1607
1608 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1609 {
1610 _PrintType(type, string, printName, fullName, 0);
1611 }
1612
1613 struct __ecereNameSpace__ecere__com__Method;
1614
1615 struct __ecereNameSpace__ecere__com__Method
1616 {
1617 const char *  name;
1618 struct __ecereNameSpace__ecere__com__Method * parent;
1619 struct __ecereNameSpace__ecere__com__Method * left;
1620 struct __ecereNameSpace__ecere__com__Method * right;
1621 int depth;
1622 int (*  function)();
1623 int vid;
1624 int type;
1625 struct __ecereNameSpace__ecere__com__Class * _class;
1626 void *  symbol;
1627 const char *  dataTypeString;
1628 struct Type * dataType;
1629 int memberAccess;
1630 } __attribute__ ((gcc_struct));
1631
1632 struct Symbol
1633 {
1634 char *  string;
1635 struct Symbol * parent;
1636 struct Symbol * left;
1637 struct Symbol * right;
1638 int depth;
1639 struct Type * type;
1640 union
1641 {
1642 struct __ecereNameSpace__ecere__com__Method * method;
1643 struct __ecereNameSpace__ecere__com__Property * _property;
1644 struct __ecereNameSpace__ecere__com__Class * registered;
1645 } __attribute__ ((gcc_struct)) __anon1;
1646 unsigned int notYetDeclared;
1647 union
1648 {
1649 struct
1650 {
1651 struct External * pointerExternal;
1652 struct External * structExternal;
1653 } __attribute__ ((gcc_struct)) __anon1;
1654 struct
1655 {
1656 struct External * externalGet;
1657 struct External * externalSet;
1658 struct External * externalPtr;
1659 struct External * externalIsSet;
1660 } __attribute__ ((gcc_struct)) __anon2;
1661 struct
1662 {
1663 struct External * methodExternal;
1664 struct External * methodCodeExternal;
1665 } __attribute__ ((gcc_struct)) __anon3;
1666 } __attribute__ ((gcc_struct)) __anon2;
1667 unsigned int imported;
1668 unsigned int declaredStructSym;
1669 struct __ecereNameSpace__ecere__com__Class * _class;
1670 unsigned int declaredStruct;
1671 unsigned int needConstructor;
1672 unsigned int needDestructor;
1673 char *  constructorName;
1674 char *  structName;
1675 char *  className;
1676 char *  destructorName;
1677 struct ModuleImport * module;
1678 struct ClassImport * _import;
1679 struct Location nameLoc;
1680 unsigned int isParam;
1681 unsigned int isRemote;
1682 unsigned int isStruct;
1683 unsigned int fireWatchersDone;
1684 int declaring;
1685 unsigned int classData;
1686 unsigned int isStatic;
1687 char *  shortName;
1688 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
1689 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
1690 struct Context * ctx;
1691 int isIterator;
1692 struct Expression * propCategory;
1693 unsigned int mustRegister;
1694 } __attribute__ ((gcc_struct));
1695
1696 struct __ecereNameSpace__ecere__com__ClassProperty;
1697
1698 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1699
1700 struct __ecereNameSpace__ecere__com__ClassProperty
1701 {
1702 const char *  name;
1703 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1704 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1705 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1706 int depth;
1707 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1708 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1709 const char *  dataTypeString;
1710 struct Type * dataType;
1711 unsigned int constant;
1712 } __attribute__ ((gcc_struct));
1713
1714 struct __ecereNameSpace__ecere__com__BitMember;
1715
1716 struct __ecereNameSpace__ecere__com__BitMember
1717 {
1718 struct __ecereNameSpace__ecere__com__BitMember * prev;
1719 struct __ecereNameSpace__ecere__com__BitMember * next;
1720 const char *  name;
1721 unsigned int isProperty;
1722 int memberAccess;
1723 int id;
1724 struct __ecereNameSpace__ecere__com__Class * _class;
1725 const char *  dataTypeString;
1726 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1727 struct Type * dataType;
1728 int type;
1729 int size;
1730 int pos;
1731 uint64 mask;
1732 } __attribute__ ((gcc_struct));
1733
1734 struct __ecereNameSpace__ecere__com__DataMember;
1735
1736 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1737 {
1738 union
1739 {
1740 struct
1741 {
1742 const char *  dataTypeString;
1743 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1744 } __attribute__ ((gcc_struct)) __anon1;
1745 struct __ecereNameSpace__ecere__com__DataValue expression;
1746 struct
1747 {
1748 const char *  memberString;
1749 union
1750 {
1751 struct __ecereNameSpace__ecere__com__DataMember * member;
1752 struct __ecereNameSpace__ecere__com__Property * prop;
1753 struct __ecereNameSpace__ecere__com__Method * method;
1754 } __attribute__ ((gcc_struct)) __anon1;
1755 } __attribute__ ((gcc_struct)) __anon2;
1756 } __attribute__ ((gcc_struct)) __anon1;
1757 } __attribute__ ((gcc_struct));
1758
1759 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);
1760
1761 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);
1762
1763 struct TemplateParameter;
1764
1765 struct TemplateParameter
1766 {
1767 struct TemplateParameter * prev;
1768 struct TemplateParameter * next;
1769 struct Location loc;
1770 int type;
1771 struct Identifier * identifier;
1772 union
1773 {
1774 struct TemplateDatatype * dataType;
1775 int memberType;
1776 } __attribute__ ((gcc_struct)) __anon1;
1777 struct TemplateArgument * defaultArgument;
1778 const char *  dataTypeString;
1779 struct Type * baseType;
1780 } __attribute__ ((gcc_struct));
1781
1782 struct Type
1783 {
1784 struct Type * prev;
1785 struct Type * next;
1786 int refCount;
1787 union
1788 {
1789 struct Symbol * _class;
1790 struct
1791 {
1792 struct __ecereNameSpace__ecere__sys__OldList members;
1793 char *  enumName;
1794 } __attribute__ ((gcc_struct)) __anon1;
1795 struct
1796 {
1797 struct Type * returnType;
1798 struct __ecereNameSpace__ecere__sys__OldList params;
1799 struct Symbol * thisClass;
1800 unsigned int staticMethod;
1801 struct TemplateParameter * thisClassTemplate;
1802 } __attribute__ ((gcc_struct)) __anon2;
1803 struct
1804 {
1805 struct __ecereNameSpace__ecere__com__Method * method;
1806 struct __ecereNameSpace__ecere__com__Class * methodClass;
1807 struct __ecereNameSpace__ecere__com__Class * usedClass;
1808 } __attribute__ ((gcc_struct)) __anon3;
1809 struct
1810 {
1811 struct Type * arrayType;
1812 int arraySize;
1813 struct Expression * arraySizeExp;
1814 unsigned int freeExp;
1815 struct Symbol * enumClass;
1816 } __attribute__ ((gcc_struct)) __anon4;
1817 struct Type * type;
1818 struct TemplateParameter * templateParameter;
1819 } __attribute__ ((gcc_struct)) __anon1;
1820 int kind;
1821 unsigned int size;
1822 char *  name;
1823 char *  typeName;
1824 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1825 int classObjectType;
1826 int alignment;
1827 unsigned int offset;
1828 int bitFieldCount;
1829 int count;
1830 unsigned int isSigned : 1;
1831 unsigned int constant : 1;
1832 unsigned int truth : 1;
1833 unsigned int byReference : 1;
1834 unsigned int extraParam : 1;
1835 unsigned int directClassAccess : 1;
1836 unsigned int computing : 1;
1837 unsigned int keepCast : 1;
1838 unsigned int passAsTemplate : 1;
1839 unsigned int dllExport : 1;
1840 unsigned int attrStdcall : 1;
1841 unsigned int declaredWithStruct : 1;
1842 unsigned int typedByReference : 1;
1843 unsigned int casted : 1;
1844 unsigned int pointerAlignment : 1;
1845 unsigned int isLong : 1;
1846 } __attribute__ ((gcc_struct));
1847
1848 struct Specifier
1849 {
1850 struct Specifier * prev;
1851 struct Specifier * next;
1852 struct Location loc;
1853 int type;
1854 union
1855 {
1856 int specifier;
1857 struct
1858 {
1859 struct ExtDecl * extDecl;
1860 char *  name;
1861 struct Symbol * symbol;
1862 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
1863 struct Specifier * nsSpec;
1864 } __attribute__ ((gcc_struct)) __anon1;
1865 struct
1866 {
1867 struct Identifier * id;
1868 struct __ecereNameSpace__ecere__sys__OldList *  list;
1869 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
1870 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
1871 unsigned int addNameSpace;
1872 struct Context * ctx;
1873 struct ExtDecl * extDeclStruct;
1874 } __attribute__ ((gcc_struct)) __anon2;
1875 struct Expression * expression;
1876 struct Specifier * _class;
1877 struct TemplateParameter * templateParameter;
1878 } __attribute__ ((gcc_struct)) __anon1;
1879 } __attribute__ ((gcc_struct));
1880
1881 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
1882
1883 struct TemplatedType
1884 {
1885 uintptr_t key;
1886 struct __ecereNameSpace__ecere__sys__BTNode * parent;
1887 struct __ecereNameSpace__ecere__sys__BTNode * left;
1888 struct __ecereNameSpace__ecere__sys__BTNode * right;
1889 int depth;
1890 struct TemplateParameter * param;
1891 } __attribute__ ((gcc_struct));
1892
1893 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1894 {
1895 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1896 {
1897 if(!param->baseType)
1898 {
1899 if(param->dataTypeString)
1900 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1901 else
1902 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1903 }
1904 return param->baseType;
1905 }
1906 return (((void *)0));
1907 }
1908
1909 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1910 {
1911 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1912 return 1;
1913 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1914 {
1915 return 0;
1916 }
1917 if(type1->kind == type2->kind && type1->isLong == type2->isLong)
1918 {
1919 switch(type1->kind)
1920 {
1921 case 24:
1922 case 1:
1923 case 2:
1924 case 3:
1925 case 4:
1926 case 22:
1927 case 23:
1928 if(type1->passAsTemplate && !type2->passAsTemplate)
1929 return 1;
1930 return type1->isSigned != type2->isSigned;
1931 case 8:
1932 return type1->__anon1._class != type2->__anon1._class;
1933 case 13:
1934 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1935 default:
1936 return 1;
1937 }
1938 }
1939 return 1;
1940 }
1941
1942 unsigned int GetOpInt(struct Operand * op2, int * value2)
1943 {
1944 if(op2->kind == 3 && op2->type->isSigned)
1945 *value2 = op2->__anon1.i;
1946 else if(op2->kind == 3)
1947 *value2 = (int)op2->__anon1.ui;
1948 else if(op2->kind == 4 && op2->type->isSigned)
1949 *value2 = (int)op2->__anon1.i64;
1950 else if(op2->kind == 4)
1951 *value2 = (int)op2->__anon1.ui64;
1952 else if(op2->kind == 23 && op2->type->isSigned)
1953 *value2 = (int)op2->__anon1.i64;
1954 else if(op2->kind == 23)
1955 *value2 = (int)op2->__anon1.ui64;
1956 else if(op2->kind == 22 && op2->type->isSigned)
1957 *value2 = (int)op2->__anon1.i64;
1958 else if(op2->kind == 22)
1959 *value2 = (int)op2->__anon1.ui64;
1960 else if(op2->kind == 2 && op2->type->isSigned)
1961 *value2 = (int)op2->__anon1.s;
1962 else if(op2->kind == 2)
1963 *value2 = (int)op2->__anon1.us;
1964 else if(op2->kind == 1 && op2->type->isSigned)
1965 *value2 = (int)op2->__anon1.c;
1966 else if(op2->kind == 24 || op2->kind == 1)
1967 *value2 = (int)op2->__anon1.uc;
1968 else if(op2->kind == 6)
1969 *value2 = (int)op2->__anon1.f;
1970 else if(op2->kind == 7)
1971 *value2 = (int)op2->__anon1.d;
1972 else if(op2->kind == 13)
1973 *value2 = (int)op2->__anon1.ui64;
1974 else
1975 return 0;
1976 return 1;
1977 }
1978
1979 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1980 {
1981 if(op2->kind == 3 && op2->type->isSigned)
1982 *value2 = (unsigned int)op2->__anon1.i;
1983 else if(op2->kind == 3)
1984 *value2 = op2->__anon1.ui;
1985 else if(op2->kind == 4 && op2->type->isSigned)
1986 *value2 = (unsigned int)op2->__anon1.i64;
1987 else if(op2->kind == 4)
1988 *value2 = (unsigned int)op2->__anon1.ui64;
1989 else if(op2->kind == 23 && op2->type->isSigned)
1990 *value2 = (unsigned int)op2->__anon1.i64;
1991 else if(op2->kind == 23)
1992 *value2 = (unsigned int)op2->__anon1.ui64;
1993 else if(op2->kind == 22 && op2->type->isSigned)
1994 *value2 = (unsigned int)op2->__anon1.i64;
1995 else if(op2->kind == 22)
1996 *value2 = (unsigned int)op2->__anon1.ui64;
1997 else if(op2->kind == 2 && op2->type->isSigned)
1998 *value2 = (unsigned int)op2->__anon1.s;
1999 else if(op2->kind == 2)
2000 *value2 = (unsigned int)op2->__anon1.us;
2001 else if(op2->kind == 1 && op2->type->isSigned)
2002 *value2 = (unsigned int)op2->__anon1.c;
2003 else if(op2->kind == 24 || op2->kind == 1)
2004 *value2 = (unsigned int)op2->__anon1.uc;
2005 else if(op2->kind == 6)
2006 *value2 = (unsigned int)op2->__anon1.f;
2007 else if(op2->kind == 7)
2008 *value2 = (unsigned int)op2->__anon1.d;
2009 else if(op2->kind == 13)
2010 *value2 = (unsigned int)op2->__anon1.ui64;
2011 else
2012 return 0;
2013 return 1;
2014 }
2015
2016 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
2017 {
2018 if(op2->kind == 3 && op2->type->isSigned)
2019 *value2 = (long long)op2->__anon1.i;
2020 else if(op2->kind == 3)
2021 *value2 = (long long)op2->__anon1.ui;
2022 else if(op2->kind == 4 && op2->type->isSigned)
2023 *value2 = op2->__anon1.i64;
2024 else if(op2->kind == 4)
2025 *value2 = (long long)op2->__anon1.ui64;
2026 else if(op2->kind == 23 && op2->type->isSigned)
2027 *value2 = op2->__anon1.i64;
2028 else if(op2->kind == 23)
2029 *value2 = (long long)op2->__anon1.ui64;
2030 else if(op2->kind == 22 && op2->type->isSigned)
2031 *value2 = op2->__anon1.i64;
2032 else if(op2->kind == 22)
2033 *value2 = (long long)op2->__anon1.ui64;
2034 else if(op2->kind == 2 && op2->type->isSigned)
2035 *value2 = (long long)op2->__anon1.s;
2036 else if(op2->kind == 2)
2037 *value2 = (long long)op2->__anon1.us;
2038 else if(op2->kind == 1 && op2->type->isSigned)
2039 *value2 = (long long)op2->__anon1.c;
2040 else if(op2->kind == 24 || op2->kind == 1)
2041 *value2 = (long long)op2->__anon1.uc;
2042 else if(op2->kind == 6)
2043 *value2 = (long long)op2->__anon1.f;
2044 else if(op2->kind == 7)
2045 *value2 = (long long)op2->__anon1.d;
2046 else if(op2->kind == 13)
2047 *value2 = (long long)op2->__anon1.ui64;
2048 else
2049 return 0;
2050 return 1;
2051 }
2052
2053 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
2054 {
2055 if(op2->kind == 3 && op2->type->isSigned)
2056 *value2 = (uint64)op2->__anon1.i;
2057 else if(op2->kind == 3)
2058 *value2 = (uint64)op2->__anon1.ui;
2059 else if(op2->kind == 4 && op2->type->isSigned)
2060 *value2 = (uint64)op2->__anon1.i64;
2061 else if(op2->kind == 4)
2062 *value2 = op2->__anon1.ui64;
2063 else if(op2->kind == 23 && op2->type->isSigned)
2064 *value2 = (uint64)op2->__anon1.i64;
2065 else if(op2->kind == 23)
2066 *value2 = op2->__anon1.ui64;
2067 else if(op2->kind == 22 && op2->type->isSigned)
2068 *value2 = (uint64)op2->__anon1.i64;
2069 else if(op2->kind == 22)
2070 *value2 = op2->__anon1.ui64;
2071 else if(op2->kind == 2 && op2->type->isSigned)
2072 *value2 = (uint64)op2->__anon1.s;
2073 else if(op2->kind == 2)
2074 *value2 = (uint64)op2->__anon1.us;
2075 else if(op2->kind == 1 && op2->type->isSigned)
2076 *value2 = (uint64)op2->__anon1.c;
2077 else if(op2->kind == 24 || op2->kind == 1)
2078 *value2 = (uint64)op2->__anon1.uc;
2079 else if(op2->kind == 6)
2080 *value2 = (uint64)op2->__anon1.f;
2081 else if(op2->kind == 7)
2082 *value2 = (uint64)op2->__anon1.d;
2083 else if(op2->kind == 13)
2084 *value2 = op2->__anon1.ui64;
2085 else
2086 return 0;
2087 return 1;
2088 }
2089
2090 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
2091 {
2092 if(op2->kind == 3 && op2->type->isSigned)
2093 *value2 = (intptr_t)op2->__anon1.i;
2094 else if(op2->kind == 3)
2095 *value2 = (intptr_t)op2->__anon1.ui;
2096 else if(op2->kind == 4 && op2->type->isSigned)
2097 *value2 = (intptr_t)op2->__anon1.i64;
2098 else if(op2->kind == 4)
2099 *value2 = (intptr_t)op2->__anon1.ui64;
2100 else if(op2->kind == 23 && op2->type->isSigned)
2101 *value2 = (intptr_t)op2->__anon1.i64;
2102 else if(op2->kind == 23)
2103 *value2 = (intptr_t)op2->__anon1.ui64;
2104 else if(op2->kind == 22 && op2->type->isSigned)
2105 *value2 = (intptr_t)op2->__anon1.i64;
2106 else if(op2->kind == 22)
2107 *value2 = (intptr_t)op2->__anon1.ui64;
2108 else if(op2->kind == 2 && op2->type->isSigned)
2109 *value2 = (intptr_t)op2->__anon1.s;
2110 else if(op2->kind == 2)
2111 *value2 = (intptr_t)op2->__anon1.us;
2112 else if(op2->kind == 1 && op2->type->isSigned)
2113 *value2 = (intptr_t)op2->__anon1.c;
2114 else if(op2->kind == 24 || op2->kind == 1)
2115 *value2 = (intptr_t)op2->__anon1.uc;
2116 else if(op2->kind == 6)
2117 *value2 = (intptr_t)op2->__anon1.f;
2118 else if(op2->kind == 7)
2119 *value2 = (intptr_t)op2->__anon1.d;
2120 else if(op2->kind == 13)
2121 *value2 = (intptr_t)op2->__anon1.ui64;
2122 else
2123 return 0;
2124 return 1;
2125 }
2126
2127 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
2128 {
2129 if(op2->kind == 3 && op2->type->isSigned)
2130 *value2 = (uintptr_t)op2->__anon1.i;
2131 else if(op2->kind == 3)
2132 *value2 = (uintptr_t)op2->__anon1.ui;
2133 else if(op2->kind == 4 && op2->type->isSigned)
2134 *value2 = (uintptr_t)op2->__anon1.i64;
2135 else if(op2->kind == 4)
2136 *value2 = (uintptr_t)op2->__anon1.ui64;
2137 else if(op2->kind == 23 && op2->type->isSigned)
2138 *value2 = (uintptr_t)op2->__anon1.i64;
2139 else if(op2->kind == 23)
2140 *value2 = (uintptr_t)op2->__anon1.ui64;
2141 else if(op2->kind == 22 && op2->type->isSigned)
2142 *value2 = (uintptr_t)op2->__anon1.i64;
2143 else if(op2->kind == 22)
2144 *value2 = (uintptr_t)op2->__anon1.ui64;
2145 else if(op2->kind == 2 && op2->type->isSigned)
2146 *value2 = (uintptr_t)op2->__anon1.s;
2147 else if(op2->kind == 2)
2148 *value2 = (uintptr_t)op2->__anon1.us;
2149 else if(op2->kind == 1 && op2->type->isSigned)
2150 *value2 = (uintptr_t)op2->__anon1.c;
2151 else if(op2->kind == 24 || op2->kind == 1)
2152 *value2 = (uintptr_t)op2->__anon1.uc;
2153 else if(op2->kind == 6)
2154 *value2 = (uintptr_t)op2->__anon1.f;
2155 else if(op2->kind == 7)
2156 *value2 = (uintptr_t)op2->__anon1.d;
2157 else if(op2->kind == 13)
2158 *value2 = (uintptr_t)op2->__anon1.ui64;
2159 else
2160 return 0;
2161 return 1;
2162 }
2163
2164 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2165 {
2166 if(op2->kind == 3 && op2->type->isSigned)
2167 *value2 = (ssize_t)op2->__anon1.i;
2168 else if(op2->kind == 3)
2169 *value2 = (ssize_t)op2->__anon1.ui;
2170 else if(op2->kind == 4 && op2->type->isSigned)
2171 *value2 = (ssize_t)op2->__anon1.i64;
2172 else if(op2->kind == 4)
2173 *value2 = (ssize_t)op2->__anon1.ui64;
2174 else if(op2->kind == 23 && op2->type->isSigned)
2175 *value2 = (ssize_t)op2->__anon1.i64;
2176 else if(op2->kind == 23)
2177 *value2 = (ssize_t)op2->__anon1.ui64;
2178 else if(op2->kind == 22 && op2->type->isSigned)
2179 *value2 = (ssize_t)op2->__anon1.i64;
2180 else if(op2->kind == 22)
2181 *value2 = (ssize_t)op2->__anon1.ui64;
2182 else if(op2->kind == 2 && op2->type->isSigned)
2183 *value2 = (ssize_t)op2->__anon1.s;
2184 else if(op2->kind == 2)
2185 *value2 = (ssize_t)op2->__anon1.us;
2186 else if(op2->kind == 1 && op2->type->isSigned)
2187 *value2 = (ssize_t)op2->__anon1.c;
2188 else if(op2->kind == 24 || op2->kind == 1)
2189 *value2 = (ssize_t)op2->__anon1.uc;
2190 else if(op2->kind == 6)
2191 *value2 = (ssize_t)op2->__anon1.f;
2192 else if(op2->kind == 7)
2193 *value2 = (ssize_t)op2->__anon1.d;
2194 else if(op2->kind == 13)
2195 *value2 = (ssize_t)op2->__anon1.ui64;
2196 else
2197 return 0;
2198 return 1;
2199 }
2200
2201 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2202 {
2203 if(op2->kind == 3 && op2->type->isSigned)
2204 *value2 = (size_t)op2->__anon1.i;
2205 else if(op2->kind == 3)
2206 *value2 = (size_t)op2->__anon1.ui;
2207 else if(op2->kind == 4 && op2->type->isSigned)
2208 *value2 = (size_t)op2->__anon1.i64;
2209 else if(op2->kind == 4)
2210 *value2 = (size_t)op2->__anon1.ui64;
2211 else if(op2->kind == 23 && op2->type->isSigned)
2212 *value2 = (size_t)op2->__anon1.i64;
2213 else if(op2->kind == 23)
2214 *value2 = (size_t)op2->__anon1.ui64;
2215 else if(op2->kind == 22 && op2->type->isSigned)
2216 *value2 = (size_t)op2->__anon1.i64;
2217 else if(op2->kind == 22)
2218 *value2 = (size_t)op2->__anon1.ui64;
2219 else if(op2->kind == 2 && op2->type->isSigned)
2220 *value2 = (size_t)op2->__anon1.s;
2221 else if(op2->kind == 2)
2222 *value2 = (size_t)op2->__anon1.us;
2223 else if(op2->kind == 1 && op2->type->isSigned)
2224 *value2 = (size_t)op2->__anon1.c;
2225 else if(op2->kind == 24 || op2->kind == 1)
2226 *value2 = (size_t)op2->__anon1.uc;
2227 else if(op2->kind == 6)
2228 *value2 = (size_t)op2->__anon1.f;
2229 else if(op2->kind == 7)
2230 *value2 = (size_t)op2->__anon1.d;
2231 else if(op2->kind == 13)
2232 *value2 = (size_t)op2->__anon1.ui64;
2233 else
2234 return 0;
2235 return 1;
2236 }
2237
2238 unsigned int GetOpShort(struct Operand * op2, short * value2)
2239 {
2240 if(op2->kind == 3 && op2->type->isSigned)
2241 *value2 = (short)op2->__anon1.i;
2242 else if(op2->kind == 3)
2243 *value2 = (short)op2->__anon1.ui;
2244 else if(op2->kind == 4 && op2->type->isSigned)
2245 *value2 = (short)op2->__anon1.i64;
2246 else if(op2->kind == 4)
2247 *value2 = (short)op2->__anon1.ui64;
2248 else if(op2->kind == 23 && op2->type->isSigned)
2249 *value2 = (short)op2->__anon1.i64;
2250 else if(op2->kind == 23)
2251 *value2 = (short)op2->__anon1.ui64;
2252 else if(op2->kind == 22 && op2->type->isSigned)
2253 *value2 = (short)op2->__anon1.i64;
2254 else if(op2->kind == 22)
2255 *value2 = (short)op2->__anon1.ui64;
2256 else if(op2->kind == 2 && op2->type->isSigned)
2257 *value2 = op2->__anon1.s;
2258 else if(op2->kind == 2)
2259 *value2 = (short)op2->__anon1.us;
2260 else if(op2->kind == 1 && op2->type->isSigned)
2261 *value2 = (short)op2->__anon1.c;
2262 else if(op2->kind == 24 || op2->kind == 1)
2263 *value2 = (short)op2->__anon1.uc;
2264 else if(op2->kind == 6)
2265 *value2 = (short)op2->__anon1.f;
2266 else if(op2->kind == 7)
2267 *value2 = (short)op2->__anon1.d;
2268 else if(op2->kind == 13)
2269 *value2 = (short)op2->__anon1.ui64;
2270 else
2271 return 0;
2272 return 1;
2273 }
2274
2275 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2276 {
2277 if(op2->kind == 3 && op2->type->isSigned)
2278 *value2 = (unsigned short)op2->__anon1.i;
2279 else if(op2->kind == 3)
2280 *value2 = (unsigned short)op2->__anon1.ui;
2281 else if(op2->kind == 4 && op2->type->isSigned)
2282 *value2 = (unsigned short)op2->__anon1.i64;
2283 else if(op2->kind == 4)
2284 *value2 = (unsigned short)op2->__anon1.ui64;
2285 else if(op2->kind == 23 && op2->type->isSigned)
2286 *value2 = (unsigned short)op2->__anon1.i64;
2287 else if(op2->kind == 23)
2288 *value2 = (unsigned short)op2->__anon1.ui64;
2289 else if(op2->kind == 22 && op2->type->isSigned)
2290 *value2 = (unsigned short)op2->__anon1.i64;
2291 else if(op2->kind == 22)
2292 *value2 = (unsigned short)op2->__anon1.ui64;
2293 else if(op2->kind == 2 && op2->type->isSigned)
2294 *value2 = (unsigned short)op2->__anon1.s;
2295 else if(op2->kind == 2)
2296 *value2 = op2->__anon1.us;
2297 else if(op2->kind == 1 && op2->type->isSigned)
2298 *value2 = (unsigned short)op2->__anon1.c;
2299 else if(op2->kind == 24 || op2->kind == 1)
2300 *value2 = (unsigned short)op2->__anon1.uc;
2301 else if(op2->kind == 6)
2302 *value2 = (unsigned short)op2->__anon1.f;
2303 else if(op2->kind == 7)
2304 *value2 = (unsigned short)op2->__anon1.d;
2305 else if(op2->kind == 13)
2306 *value2 = (unsigned short)op2->__anon1.ui64;
2307 else
2308 return 0;
2309 return 1;
2310 }
2311
2312 unsigned int GetOpChar(struct Operand * op2, char * value2)
2313 {
2314 if(op2->kind == 3 && op2->type->isSigned)
2315 *value2 = (char)op2->__anon1.i;
2316 else if(op2->kind == 3)
2317 *value2 = (char)op2->__anon1.ui;
2318 else if(op2->kind == 4 && op2->type->isSigned)
2319 *value2 = (char)op2->__anon1.i64;
2320 else if(op2->kind == 4)
2321 *value2 = (char)op2->__anon1.ui64;
2322 else if(op2->kind == 23 && op2->type->isSigned)
2323 *value2 = (char)op2->__anon1.i64;
2324 else if(op2->kind == 23)
2325 *value2 = (char)op2->__anon1.ui64;
2326 else if(op2->kind == 22 && op2->type->isSigned)
2327 *value2 = (char)op2->__anon1.i64;
2328 else if(op2->kind == 22)
2329 *value2 = (char)op2->__anon1.ui64;
2330 else if(op2->kind == 2 && op2->type->isSigned)
2331 *value2 = (char)op2->__anon1.s;
2332 else if(op2->kind == 2)
2333 *value2 = (char)op2->__anon1.us;
2334 else if(op2->kind == 1 && op2->type->isSigned)
2335 *value2 = op2->__anon1.c;
2336 else if(op2->kind == 24 || op2->kind == 1)
2337 *value2 = (char)op2->__anon1.uc;
2338 else if(op2->kind == 6)
2339 *value2 = (char)op2->__anon1.f;
2340 else if(op2->kind == 7)
2341 *value2 = (char)op2->__anon1.d;
2342 else if(op2->kind == 13)
2343 *value2 = (char)op2->__anon1.ui64;
2344 else
2345 return 0;
2346 return 1;
2347 }
2348
2349 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2350 {
2351 if(op2->kind == 3 && op2->type->isSigned)
2352 *value2 = (unsigned char)op2->__anon1.i;
2353 else if(op2->kind == 3)
2354 *value2 = (unsigned char)op2->__anon1.ui;
2355 else if(op2->kind == 4 && op2->type->isSigned)
2356 *value2 = (unsigned char)op2->__anon1.i64;
2357 else if(op2->kind == 4)
2358 *value2 = (unsigned char)op2->__anon1.ui64;
2359 else if(op2->kind == 23 && op2->type->isSigned)
2360 *value2 = (unsigned char)op2->__anon1.i64;
2361 else if(op2->kind == 23)
2362 *value2 = (unsigned char)op2->__anon1.ui64;
2363 else if(op2->kind == 22 && op2->type->isSigned)
2364 *value2 = (unsigned char)op2->__anon1.i64;
2365 else if(op2->kind == 22)
2366 *value2 = (unsigned char)op2->__anon1.ui64;
2367 else if(op2->kind == 2 && op2->type->isSigned)
2368 *value2 = (unsigned char)op2->__anon1.s;
2369 else if(op2->kind == 2)
2370 *value2 = (unsigned char)op2->__anon1.us;
2371 else if(op2->kind == 1 && op2->type->isSigned)
2372 *value2 = (unsigned char)op2->__anon1.c;
2373 else if(op2->kind == 24 || op2->kind == 1)
2374 *value2 = op2->__anon1.uc;
2375 else if(op2->kind == 6)
2376 *value2 = (unsigned char)op2->__anon1.f;
2377 else if(op2->kind == 7)
2378 *value2 = (unsigned char)op2->__anon1.d;
2379 else if(op2->kind == 13)
2380 *value2 = (unsigned char)op2->__anon1.ui64;
2381 else
2382 return 0;
2383 return 1;
2384 }
2385
2386 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2387 {
2388 if(op2->kind == 3 && op2->type->isSigned)
2389 *value2 = (float)(float)op2->__anon1.i;
2390 else if(op2->kind == 3)
2391 *value2 = (float)(float)op2->__anon1.ui;
2392 else if(op2->kind == 4 && op2->type->isSigned)
2393 *value2 = (float)(float)op2->__anon1.i64;
2394 else if(op2->kind == 4)
2395 *value2 = (float)(float)op2->__anon1.ui64;
2396 else if(op2->kind == 23 && op2->type->isSigned)
2397 *value2 = (float)(float)op2->__anon1.i64;
2398 else if(op2->kind == 23)
2399 *value2 = (float)(float)op2->__anon1.ui64;
2400 else if(op2->kind == 22 && op2->type->isSigned)
2401 *value2 = (float)(float)op2->__anon1.i64;
2402 else if(op2->kind == 22)
2403 *value2 = (float)(float)op2->__anon1.ui64;
2404 else if(op2->kind == 2 && op2->type->isSigned)
2405 *value2 = (float)(float)op2->__anon1.s;
2406 else if(op2->kind == 2)
2407 *value2 = (float)(float)op2->__anon1.us;
2408 else if(op2->kind == 1 && op2->type->isSigned)
2409 *value2 = (float)(float)op2->__anon1.c;
2410 else if(op2->kind == 24 || op2->kind == 1)
2411 *value2 = (float)(float)op2->__anon1.uc;
2412 else if(op2->kind == 6)
2413 *value2 = (float)op2->__anon1.f;
2414 else if(op2->kind == 7)
2415 *value2 = (float)op2->__anon1.d;
2416 else if(op2->kind == 13)
2417 *value2 = (float)(float)op2->__anon1.ui64;
2418 else
2419 return 0;
2420 return 1;
2421 }
2422
2423 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2424 {
2425 if(op2->kind == 3 && op2->type->isSigned)
2426 *value2 = (double)(double)op2->__anon1.i;
2427 else if(op2->kind == 3)
2428 *value2 = (double)(double)op2->__anon1.ui;
2429 else if(op2->kind == 4 && op2->type->isSigned)
2430 *value2 = (double)(double)op2->__anon1.i64;
2431 else if(op2->kind == 4)
2432 *value2 = (double)(double)op2->__anon1.ui64;
2433 else if(op2->kind == 23 && op2->type->isSigned)
2434 *value2 = (double)(double)op2->__anon1.i64;
2435 else if(op2->kind == 23)
2436 *value2 = (double)(double)op2->__anon1.ui64;
2437 else if(op2->kind == 22 && op2->type->isSigned)
2438 *value2 = (double)(double)op2->__anon1.i64;
2439 else if(op2->kind == 22)
2440 *value2 = (double)(double)op2->__anon1.ui64;
2441 else if(op2->kind == 2 && op2->type->isSigned)
2442 *value2 = (double)(double)op2->__anon1.s;
2443 else if(op2->kind == 2)
2444 *value2 = (double)(double)op2->__anon1.us;
2445 else if(op2->kind == 1 && op2->type->isSigned)
2446 *value2 = (double)(double)op2->__anon1.c;
2447 else if(op2->kind == 24 || op2->kind == 1)
2448 *value2 = (double)(double)op2->__anon1.uc;
2449 else if(op2->kind == 6)
2450 *value2 = (double)op2->__anon1.f;
2451 else if(op2->kind == 7)
2452 *value2 = (double)op2->__anon1.d;
2453 else if(op2->kind == 13)
2454 *value2 = (double)(double)op2->__anon1.ui64;
2455 else
2456 return 0;
2457 return 1;
2458 }
2459
2460 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2461 {
2462 int value2 = op2->__anon1.i;
2463
2464 exp->type = 2;
2465 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
2466 if(!exp->expType)
2467 {
2468 exp->expType = op1->type;
2469 if(op1->type)
2470 op1->type->refCount++;
2471 }
2472 return 1;
2473 }
2474
2475 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2476 {
2477 unsigned int value2 = op2->__anon1.ui;
2478
2479 exp->type = 2;
2480 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
2481 if(!exp->expType)
2482 {
2483 exp->expType = op1->type;
2484 if(op1->type)
2485 op1->type->refCount++;
2486 }
2487 return 1;
2488 }
2489
2490 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2491 {
2492 long long value2 = op2->__anon1.i64;
2493
2494 exp->type = 2;
2495 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
2496 if(!exp->expType)
2497 {
2498 exp->expType = op1->type;
2499 if(op1->type)
2500 op1->type->refCount++;
2501 }
2502 return 1;
2503 }
2504
2505 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2506 {
2507 uint64 value2 = op2->__anon1.ui64;
2508
2509 exp->type = 2;
2510 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
2511 if(!exp->expType)
2512 {
2513 exp->expType = op1->type;
2514 if(op1->type)
2515 op1->type->refCount++;
2516 }
2517 return 1;
2518 }
2519
2520 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2521 {
2522 short value2 = op2->__anon1.s;
2523
2524 exp->type = 2;
2525 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
2526 if(!exp->expType)
2527 {
2528 exp->expType = op1->type;
2529 if(op1->type)
2530 op1->type->refCount++;
2531 }
2532 return 1;
2533 }
2534
2535 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2536 {
2537 unsigned short value2 = op2->__anon1.us;
2538
2539 exp->type = 2;
2540 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
2541 if(!exp->expType)
2542 {
2543 exp->expType = op1->type;
2544 if(op1->type)
2545 op1->type->refCount++;
2546 }
2547 return 1;
2548 }
2549
2550 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2551 {
2552 char value2 = op2->__anon1.c;
2553
2554 exp->type = 2;
2555 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
2556 if(!exp->expType)
2557 {
2558 exp->expType = op1->type;
2559 if(op1->type)
2560 op1->type->refCount++;
2561 }
2562 return 1;
2563 }
2564
2565 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2566 {
2567 unsigned char value2 = op2->__anon1.uc;
2568
2569 exp->type = 2;
2570 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
2571 if(!exp->expType)
2572 {
2573 exp->expType = op1->type;
2574 if(op1->type)
2575 op1->type->refCount++;
2576 }
2577 return 1;
2578 }
2579
2580 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2581 {
2582 float value2 = op2->__anon1.f;
2583
2584 exp->type = 2;
2585 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
2586 if(!exp->expType)
2587 {
2588 exp->expType = op1->type;
2589 if(op1->type)
2590 op1->type->refCount++;
2591 }
2592 return 1;
2593 }
2594
2595 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2596 {
2597 double value2 = op2->__anon1.d;
2598
2599 exp->type = 2;
2600 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
2601 if(!exp->expType)
2602 {
2603 exp->expType = op1->type;
2604 if(op1->type)
2605 op1->type->refCount++;
2606 }
2607 return 1;
2608 }
2609
2610 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2611 {
2612 int value2 = op2->__anon1.i;
2613
2614 exp->type = 2;
2615 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
2616 if(!exp->expType)
2617 {
2618 exp->expType = op1->type;
2619 if(op1->type)
2620 op1->type->refCount++;
2621 }
2622 return 1;
2623 }
2624
2625 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2626 {
2627 unsigned int value2 = op2->__anon1.ui;
2628
2629 exp->type = 2;
2630 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
2631 if(!exp->expType)
2632 {
2633 exp->expType = op1->type;
2634 if(op1->type)
2635 op1->type->refCount++;
2636 }
2637 return 1;
2638 }
2639
2640 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2641 {
2642 long long value2 = op2->__anon1.i64;
2643
2644 exp->type = 2;
2645 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
2646 if(!exp->expType)
2647 {
2648 exp->expType = op1->type;
2649 if(op1->type)
2650 op1->type->refCount++;
2651 }
2652 return 1;
2653 }
2654
2655 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2656 {
2657 uint64 value2 = op2->__anon1.ui64;
2658
2659 exp->type = 2;
2660 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
2661 if(!exp->expType)
2662 {
2663 exp->expType = op1->type;
2664 if(op1->type)
2665 op1->type->refCount++;
2666 }
2667 return 1;
2668 }
2669
2670 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2671 {
2672 short value2 = op2->__anon1.s;
2673
2674 exp->type = 2;
2675 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
2676 if(!exp->expType)
2677 {
2678 exp->expType = op1->type;
2679 if(op1->type)
2680 op1->type->refCount++;
2681 }
2682 return 1;
2683 }
2684
2685 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2686 {
2687 unsigned short value2 = op2->__anon1.us;
2688
2689 exp->type = 2;
2690 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
2691 if(!exp->expType)
2692 {
2693 exp->expType = op1->type;
2694 if(op1->type)
2695 op1->type->refCount++;
2696 }
2697 return 1;
2698 }
2699
2700 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2701 {
2702 char value2 = op2->__anon1.c;
2703
2704 exp->type = 2;
2705 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
2706 if(!exp->expType)
2707 {
2708 exp->expType = op1->type;
2709 if(op1->type)
2710 op1->type->refCount++;
2711 }
2712 return 1;
2713 }
2714
2715 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2716 {
2717 unsigned char value2 = op2->__anon1.uc;
2718
2719 exp->type = 2;
2720 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
2721 if(!exp->expType)
2722 {
2723 exp->expType = op1->type;
2724 if(op1->type)
2725 op1->type->refCount++;
2726 }
2727 return 1;
2728 }
2729
2730 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2731 {
2732 float value2 = op2->__anon1.f;
2733
2734 exp->type = 2;
2735 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
2736 if(!exp->expType)
2737 {
2738 exp->expType = op1->type;
2739 if(op1->type)
2740 op1->type->refCount++;
2741 }
2742 return 1;
2743 }
2744
2745 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2746 {
2747 double value2 = op2->__anon1.d;
2748
2749 exp->type = 2;
2750 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
2751 if(!exp->expType)
2752 {
2753 exp->expType = op1->type;
2754 if(op1->type)
2755 op1->type->refCount++;
2756 }
2757 return 1;
2758 }
2759
2760 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2761 {
2762 int value2 = op2->__anon1.i;
2763
2764 exp->type = 2;
2765 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
2766 if(!exp->expType)
2767 {
2768 exp->expType = op1->type;
2769 if(op1->type)
2770 op1->type->refCount++;
2771 }
2772 return 1;
2773 }
2774
2775 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2776 {
2777 unsigned int value2 = op2->__anon1.ui;
2778
2779 exp->type = 2;
2780 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
2781 if(!exp->expType)
2782 {
2783 exp->expType = op1->type;
2784 if(op1->type)
2785 op1->type->refCount++;
2786 }
2787 return 1;
2788 }
2789
2790 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2791 {
2792 long long value2 = op2->__anon1.i64;
2793
2794 exp->type = 2;
2795 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
2796 if(!exp->expType)
2797 {
2798 exp->expType = op1->type;
2799 if(op1->type)
2800 op1->type->refCount++;
2801 }
2802 return 1;
2803 }
2804
2805 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2806 {
2807 uint64 value2 = op2->__anon1.ui64;
2808
2809 exp->type = 2;
2810 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
2811 if(!exp->expType)
2812 {
2813 exp->expType = op1->type;
2814 if(op1->type)
2815 op1->type->refCount++;
2816 }
2817 return 1;
2818 }
2819
2820 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2821 {
2822 short value2 = op2->__anon1.s;
2823
2824 exp->type = 2;
2825 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
2826 if(!exp->expType)
2827 {
2828 exp->expType = op1->type;
2829 if(op1->type)
2830 op1->type->refCount++;
2831 }
2832 return 1;
2833 }
2834
2835 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2836 {
2837 unsigned short value2 = op2->__anon1.us;
2838
2839 exp->type = 2;
2840 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
2841 if(!exp->expType)
2842 {
2843 exp->expType = op1->type;
2844 if(op1->type)
2845 op1->type->refCount++;
2846 }
2847 return 1;
2848 }
2849
2850 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2851 {
2852 char value2 = op2->__anon1.c;
2853
2854 exp->type = 2;
2855 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
2856 if(!exp->expType)
2857 {
2858 exp->expType = op1->type;
2859 if(op1->type)
2860 op1->type->refCount++;
2861 }
2862 return 1;
2863 }
2864
2865 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2866 {
2867 unsigned char value2 = op2->__anon1.uc;
2868
2869 exp->type = 2;
2870 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
2871 if(!exp->expType)
2872 {
2873 exp->expType = op1->type;
2874 if(op1->type)
2875 op1->type->refCount++;
2876 }
2877 return 1;
2878 }
2879
2880 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2881 {
2882 float value2 = op2->__anon1.f;
2883
2884 exp->type = 2;
2885 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
2886 if(!exp->expType)
2887 {
2888 exp->expType = op1->type;
2889 if(op1->type)
2890 op1->type->refCount++;
2891 }
2892 return 1;
2893 }
2894
2895 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2896 {
2897 double value2 = op2->__anon1.d;
2898
2899 exp->type = 2;
2900 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
2901 if(!exp->expType)
2902 {
2903 exp->expType = op1->type;
2904 if(op1->type)
2905 op1->type->refCount++;
2906 }
2907 return 1;
2908 }
2909
2910 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2911 {
2912 int value2 = op2->__anon1.i;
2913
2914 exp->type = 2;
2915 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
2916 if(!exp->expType)
2917 {
2918 exp->expType = op1->type;
2919 if(op1->type)
2920 op1->type->refCount++;
2921 }
2922 return 1;
2923 }
2924
2925 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2926 {
2927 unsigned int value2 = op2->__anon1.ui;
2928
2929 exp->type = 2;
2930 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
2931 if(!exp->expType)
2932 {
2933 exp->expType = op1->type;
2934 if(op1->type)
2935 op1->type->refCount++;
2936 }
2937 return 1;
2938 }
2939
2940 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2941 {
2942 long long value2 = op2->__anon1.i64;
2943
2944 exp->type = 2;
2945 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
2946 if(!exp->expType)
2947 {
2948 exp->expType = op1->type;
2949 if(op1->type)
2950 op1->type->refCount++;
2951 }
2952 return 1;
2953 }
2954
2955 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2956 {
2957 uint64 value2 = op2->__anon1.ui64;
2958
2959 exp->type = 2;
2960 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
2961 if(!exp->expType)
2962 {
2963 exp->expType = op1->type;
2964 if(op1->type)
2965 op1->type->refCount++;
2966 }
2967 return 1;
2968 }
2969
2970 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2971 {
2972 short value2 = op2->__anon1.s;
2973
2974 exp->type = 2;
2975 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
2976 if(!exp->expType)
2977 {
2978 exp->expType = op1->type;
2979 if(op1->type)
2980 op1->type->refCount++;
2981 }
2982 return 1;
2983 }
2984
2985 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2986 {
2987 unsigned short value2 = op2->__anon1.us;
2988
2989 exp->type = 2;
2990 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
2991 if(!exp->expType)
2992 {
2993 exp->expType = op1->type;
2994 if(op1->type)
2995 op1->type->refCount++;
2996 }
2997 return 1;
2998 }
2999
3000 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3001 {
3002 char value2 = op2->__anon1.c;
3003
3004 exp->type = 2;
3005 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
3006 if(!exp->expType)
3007 {
3008 exp->expType = op1->type;
3009 if(op1->type)
3010 op1->type->refCount++;
3011 }
3012 return 1;
3013 }
3014
3015 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3016 {
3017 unsigned char value2 = op2->__anon1.uc;
3018
3019 exp->type = 2;
3020 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
3021 if(!exp->expType)
3022 {
3023 exp->expType = op1->type;
3024 if(op1->type)
3025 op1->type->refCount++;
3026 }
3027 return 1;
3028 }
3029
3030 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3031 {
3032 float value2 = op2->__anon1.f;
3033
3034 exp->type = 2;
3035 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
3036 if(!exp->expType)
3037 {
3038 exp->expType = op1->type;
3039 if(op1->type)
3040 op1->type->refCount++;
3041 }
3042 return 1;
3043 }
3044
3045 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3046 {
3047 double value2 = op2->__anon1.d;
3048
3049 exp->type = 2;
3050 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
3051 if(!exp->expType)
3052 {
3053 exp->expType = op1->type;
3054 if(op1->type)
3055 op1->type->refCount++;
3056 }
3057 return 1;
3058 }
3059
3060 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3061 {
3062 int value2 = op2->__anon1.i;
3063
3064 exp->type = 2;
3065 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
3066 if(!exp->expType)
3067 {
3068 exp->expType = op1->type;
3069 if(op1->type)
3070 op1->type->refCount++;
3071 }
3072 return 1;
3073 }
3074
3075 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3076 {
3077 unsigned int value2 = op2->__anon1.ui;
3078
3079 exp->type = 2;
3080 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
3081 if(!exp->expType)
3082 {
3083 exp->expType = op1->type;
3084 if(op1->type)
3085 op1->type->refCount++;
3086 }
3087 return 1;
3088 }
3089
3090 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3091 {
3092 long long value2 = op2->__anon1.i64;
3093
3094 exp->type = 2;
3095 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
3096 if(!exp->expType)
3097 {
3098 exp->expType = op1->type;
3099 if(op1->type)
3100 op1->type->refCount++;
3101 }
3102 return 1;
3103 }
3104
3105 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3106 {
3107 uint64 value2 = op2->__anon1.ui64;
3108
3109 exp->type = 2;
3110 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
3111 if(!exp->expType)
3112 {
3113 exp->expType = op1->type;
3114 if(op1->type)
3115 op1->type->refCount++;
3116 }
3117 return 1;
3118 }
3119
3120 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3121 {
3122 short value2 = op2->__anon1.s;
3123
3124 exp->type = 2;
3125 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
3126 if(!exp->expType)
3127 {
3128 exp->expType = op1->type;
3129 if(op1->type)
3130 op1->type->refCount++;
3131 }
3132 return 1;
3133 }
3134
3135 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3136 {
3137 unsigned short value2 = op2->__anon1.us;
3138
3139 exp->type = 2;
3140 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
3141 if(!exp->expType)
3142 {
3143 exp->expType = op1->type;
3144 if(op1->type)
3145 op1->type->refCount++;
3146 }
3147 return 1;
3148 }
3149
3150 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3151 {
3152 char value2 = op2->__anon1.c;
3153
3154 exp->type = 2;
3155 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
3156 if(!exp->expType)
3157 {
3158 exp->expType = op1->type;
3159 if(op1->type)
3160 op1->type->refCount++;
3161 }
3162 return 1;
3163 }
3164
3165 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3166 {
3167 unsigned char value2 = op2->__anon1.uc;
3168
3169 exp->type = 2;
3170 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
3171 if(!exp->expType)
3172 {
3173 exp->expType = op1->type;
3174 if(op1->type)
3175 op1->type->refCount++;
3176 }
3177 return 1;
3178 }
3179
3180 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
3181 {
3182 exp->type = 2;
3183 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
3184 if(!exp->expType)
3185 {
3186 exp->expType = op1->type;
3187 if(op1->type)
3188 op1->type->refCount++;
3189 }
3190 return 1;
3191 }
3192
3193 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
3194 {
3195 exp->type = 2;
3196 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
3197 if(!exp->expType)
3198 {
3199 exp->expType = op1->type;
3200 if(op1->type)
3201 op1->type->refCount++;
3202 }
3203 return 1;
3204 }
3205
3206 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
3207 {
3208 exp->type = 2;
3209 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
3210 if(!exp->expType)
3211 {
3212 exp->expType = op1->type;
3213 if(op1->type)
3214 op1->type->refCount++;
3215 }
3216 return 1;
3217 }
3218
3219 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
3220 {
3221 exp->type = 2;
3222 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
3223 if(!exp->expType)
3224 {
3225 exp->expType = op1->type;
3226 if(op1->type)
3227 op1->type->refCount++;
3228 }
3229 return 1;
3230 }
3231
3232 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
3233 {
3234 exp->type = 2;
3235 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
3236 if(!exp->expType)
3237 {
3238 exp->expType = op1->type;
3239 if(op1->type)
3240 op1->type->refCount++;
3241 }
3242 return 1;
3243 }
3244
3245 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
3246 {
3247 exp->type = 2;
3248 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
3249 if(!exp->expType)
3250 {
3251 exp->expType = op1->type;
3252 if(op1->type)
3253 op1->type->refCount++;
3254 }
3255 return 1;
3256 }
3257
3258 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
3259 {
3260 exp->type = 2;
3261 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
3262 if(!exp->expType)
3263 {
3264 exp->expType = op1->type;
3265 if(op1->type)
3266 op1->type->refCount++;
3267 }
3268 return 1;
3269 }
3270
3271 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
3272 {
3273 exp->type = 2;
3274 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
3275 if(!exp->expType)
3276 {
3277 exp->expType = op1->type;
3278 if(op1->type)
3279 op1->type->refCount++;
3280 }
3281 return 1;
3282 }
3283
3284 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
3285 {
3286 exp->type = 2;
3287 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
3288 if(!exp->expType)
3289 {
3290 exp->expType = op1->type;
3291 if(op1->type)
3292 op1->type->refCount++;
3293 }
3294 return 1;
3295 }
3296
3297 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
3298 {
3299 exp->type = 2;
3300 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
3301 if(!exp->expType)
3302 {
3303 exp->expType = op1->type;
3304 if(op1->type)
3305 op1->type->refCount++;
3306 }
3307 return 1;
3308 }
3309
3310 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
3311 {
3312 exp->type = 2;
3313 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
3314 if(!exp->expType)
3315 {
3316 exp->expType = op1->type;
3317 if(op1->type)
3318 op1->type->refCount++;
3319 }
3320 return 1;
3321 }
3322
3323 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
3324 {
3325 exp->type = 2;
3326 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
3327 if(!exp->expType)
3328 {
3329 exp->expType = op1->type;
3330 if(op1->type)
3331 op1->type->refCount++;
3332 }
3333 return 1;
3334 }
3335
3336 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
3337 {
3338 exp->type = 2;
3339 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
3340 if(!exp->expType)
3341 {
3342 exp->expType = op1->type;
3343 if(op1->type)
3344 op1->type->refCount++;
3345 }
3346 return 1;
3347 }
3348
3349 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
3350 {
3351 exp->type = 2;
3352 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
3353 if(!exp->expType)
3354 {
3355 exp->expType = op1->type;
3356 if(op1->type)
3357 op1->type->refCount++;
3358 }
3359 return 1;
3360 }
3361
3362 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
3363 {
3364 exp->type = 2;
3365 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
3366 if(!exp->expType)
3367 {
3368 exp->expType = op1->type;
3369 if(op1->type)
3370 op1->type->refCount++;
3371 }
3372 return 1;
3373 }
3374
3375 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
3376 {
3377 exp->type = 2;
3378 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
3379 if(!exp->expType)
3380 {
3381 exp->expType = op1->type;
3382 if(op1->type)
3383 op1->type->refCount++;
3384 }
3385 return 1;
3386 }
3387
3388 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
3389 {
3390 exp->type = 2;
3391 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
3392 if(!exp->expType)
3393 {
3394 exp->expType = op1->type;
3395 if(op1->type)
3396 op1->type->refCount++;
3397 }
3398 return 1;
3399 }
3400
3401 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
3402 {
3403 exp->type = 2;
3404 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
3405 if(!exp->expType)
3406 {
3407 exp->expType = op1->type;
3408 if(op1->type)
3409 op1->type->refCount++;
3410 }
3411 return 1;
3412 }
3413
3414 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
3415 {
3416 exp->type = 2;
3417 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
3418 if(!exp->expType)
3419 {
3420 exp->expType = op1->type;
3421 if(op1->type)
3422 op1->type->refCount++;
3423 }
3424 return 1;
3425 }
3426
3427 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
3428 {
3429 exp->type = 2;
3430 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
3431 if(!exp->expType)
3432 {
3433 exp->expType = op1->type;
3434 if(op1->type)
3435 op1->type->refCount++;
3436 }
3437 return 1;
3438 }
3439
3440 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
3441 {
3442 exp->type = 2;
3443 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
3444 if(!exp->expType)
3445 {
3446 exp->expType = op1->type;
3447 if(op1->type)
3448 op1->type->refCount++;
3449 }
3450 return 1;
3451 }
3452
3453 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
3454 {
3455 exp->type = 2;
3456 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
3457 if(!exp->expType)
3458 {
3459 exp->expType = op1->type;
3460 if(op1->type)
3461 op1->type->refCount++;
3462 }
3463 return 1;
3464 }
3465
3466 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
3467 {
3468 exp->type = 2;
3469 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
3470 if(!exp->expType)
3471 {
3472 exp->expType = op1->type;
3473 if(op1->type)
3474 op1->type->refCount++;
3475 }
3476 return 1;
3477 }
3478
3479 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
3480 {
3481 exp->type = 2;
3482 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
3483 if(!exp->expType)
3484 {
3485 exp->expType = op1->type;
3486 if(op1->type)
3487 op1->type->refCount++;
3488 }
3489 return 1;
3490 }
3491
3492 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
3493 {
3494 exp->type = 2;
3495 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
3496 if(!exp->expType)
3497 {
3498 exp->expType = op1->type;
3499 if(op1->type)
3500 op1->type->refCount++;
3501 }
3502 return 1;
3503 }
3504
3505 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
3506 {
3507 exp->type = 2;
3508 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
3509 if(!exp->expType)
3510 {
3511 exp->expType = op1->type;
3512 if(op1->type)
3513 op1->type->refCount++;
3514 }
3515 return 1;
3516 }
3517
3518 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
3519 {
3520 exp->type = 2;
3521 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
3522 if(!exp->expType)
3523 {
3524 exp->expType = op1->type;
3525 if(op1->type)
3526 op1->type->refCount++;
3527 }
3528 return 1;
3529 }
3530
3531 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
3532 {
3533 exp->type = 2;
3534 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
3535 if(!exp->expType)
3536 {
3537 exp->expType = op1->type;
3538 if(op1->type)
3539 op1->type->refCount++;
3540 }
3541 return 1;
3542 }
3543
3544 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
3545 {
3546 exp->type = 2;
3547 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
3548 if(!exp->expType)
3549 {
3550 exp->expType = op1->type;
3551 if(op1->type)
3552 op1->type->refCount++;
3553 }
3554 return 1;
3555 }
3556
3557 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
3558 {
3559 exp->type = 2;
3560 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
3561 if(!exp->expType)
3562 {
3563 exp->expType = op1->type;
3564 if(op1->type)
3565 op1->type->refCount++;
3566 }
3567 return 1;
3568 }
3569
3570 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3571 {
3572 int value2 = op2->__anon1.i;
3573
3574 exp->type = 2;
3575 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
3576 if(!exp->expType)
3577 {
3578 exp->expType = op1->type;
3579 if(op1->type)
3580 op1->type->refCount++;
3581 }
3582 return 1;
3583 }
3584
3585 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3586 {
3587 unsigned int value2 = op2->__anon1.ui;
3588
3589 exp->type = 2;
3590 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
3591 if(!exp->expType)
3592 {
3593 exp->expType = op1->type;
3594 if(op1->type)
3595 op1->type->refCount++;
3596 }
3597 return 1;
3598 }
3599
3600 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3601 {
3602 long long value2 = op2->__anon1.i64;
3603
3604 exp->type = 2;
3605 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
3606 if(!exp->expType)
3607 {
3608 exp->expType = op1->type;
3609 if(op1->type)
3610 op1->type->refCount++;
3611 }
3612 return 1;
3613 }
3614
3615 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3616 {
3617 uint64 value2 = op2->__anon1.ui64;
3618
3619 exp->type = 2;
3620 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
3621 if(!exp->expType)
3622 {
3623 exp->expType = op1->type;
3624 if(op1->type)
3625 op1->type->refCount++;
3626 }
3627 return 1;
3628 }
3629
3630 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3631 {
3632 short value2 = op2->__anon1.s;
3633
3634 exp->type = 2;
3635 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
3636 if(!exp->expType)
3637 {
3638 exp->expType = op1->type;
3639 if(op1->type)
3640 op1->type->refCount++;
3641 }
3642 return 1;
3643 }
3644
3645 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3646 {
3647 unsigned short value2 = op2->__anon1.us;
3648
3649 exp->type = 2;
3650 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
3651 if(!exp->expType)
3652 {
3653 exp->expType = op1->type;
3654 if(op1->type)
3655 op1->type->refCount++;
3656 }
3657 return 1;
3658 }
3659
3660 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3661 {
3662 char value2 = op2->__anon1.c;
3663
3664 exp->type = 2;
3665 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
3666 if(!exp->expType)
3667 {
3668 exp->expType = op1->type;
3669 if(op1->type)
3670 op1->type->refCount++;
3671 }
3672 return 1;
3673 }
3674
3675 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3676 {
3677 unsigned char value2 = op2->__anon1.uc;
3678
3679 exp->type = 2;
3680 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
3681 if(!exp->expType)
3682 {
3683 exp->expType = op1->type;
3684 if(op1->type)
3685 op1->type->refCount++;
3686 }
3687 return 1;
3688 }
3689
3690 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3691 {
3692 float value2 = op2->__anon1.f;
3693
3694 exp->type = 2;
3695 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
3696 if(!exp->expType)
3697 {
3698 exp->expType = op1->type;
3699 if(op1->type)
3700 op1->type->refCount++;
3701 }
3702 return 1;
3703 }
3704
3705 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3706 {
3707 double value2 = op2->__anon1.d;
3708
3709 exp->type = 2;
3710 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
3711 if(!exp->expType)
3712 {
3713 exp->expType = op1->type;
3714 if(op1->type)
3715 op1->type->refCount++;
3716 }
3717 return 1;
3718 }
3719
3720 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3721 {
3722 int value2 = op2->__anon1.i;
3723
3724 exp->type = 2;
3725 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
3726 if(!exp->expType)
3727 {
3728 exp->expType = op1->type;
3729 if(op1->type)
3730 op1->type->refCount++;
3731 }
3732 return 1;
3733 }
3734
3735 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3736 {
3737 unsigned int value2 = op2->__anon1.ui;
3738
3739 exp->type = 2;
3740 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
3741 if(!exp->expType)
3742 {
3743 exp->expType = op1->type;
3744 if(op1->type)
3745 op1->type->refCount++;
3746 }
3747 return 1;
3748 }
3749
3750 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3751 {
3752 long long value2 = op2->__anon1.i64;
3753
3754 exp->type = 2;
3755 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
3756 if(!exp->expType)
3757 {
3758 exp->expType = op1->type;
3759 if(op1->type)
3760 op1->type->refCount++;
3761 }
3762 return 1;
3763 }
3764
3765 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3766 {
3767 uint64 value2 = op2->__anon1.ui64;
3768
3769 exp->type = 2;
3770 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
3771 if(!exp->expType)
3772 {
3773 exp->expType = op1->type;
3774 if(op1->type)
3775 op1->type->refCount++;
3776 }
3777 return 1;
3778 }
3779
3780 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3781 {
3782 short value2 = op2->__anon1.s;
3783
3784 exp->type = 2;
3785 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
3786 if(!exp->expType)
3787 {
3788 exp->expType = op1->type;
3789 if(op1->type)
3790 op1->type->refCount++;
3791 }
3792 return 1;
3793 }
3794
3795 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3796 {
3797 unsigned short value2 = op2->__anon1.us;
3798
3799 exp->type = 2;
3800 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
3801 if(!exp->expType)
3802 {
3803 exp->expType = op1->type;
3804 if(op1->type)
3805 op1->type->refCount++;
3806 }
3807 return 1;
3808 }
3809
3810 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3811 {
3812 char value2 = op2->__anon1.c;
3813
3814 exp->type = 2;
3815 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
3816 if(!exp->expType)
3817 {
3818 exp->expType = op1->type;
3819 if(op1->type)
3820 op1->type->refCount++;
3821 }
3822 return 1;
3823 }
3824
3825 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3826 {
3827 unsigned char value2 = op2->__anon1.uc;
3828
3829 exp->type = 2;
3830 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
3831 if(!exp->expType)
3832 {
3833 exp->expType = op1->type;
3834 if(op1->type)
3835 op1->type->refCount++;
3836 }
3837 return 1;
3838 }
3839
3840 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3841 {
3842 float value2 = op2->__anon1.f;
3843
3844 exp->type = 2;
3845 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
3846 if(!exp->expType)
3847 {
3848 exp->expType = op1->type;
3849 if(op1->type)
3850 op1->type->refCount++;
3851 }
3852 return 1;
3853 }
3854
3855 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3856 {
3857 double value2 = op2->__anon1.d;
3858
3859 exp->type = 2;
3860 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
3861 if(!exp->expType)
3862 {
3863 exp->expType = op1->type;
3864 if(op1->type)
3865 op1->type->refCount++;
3866 }
3867 return 1;
3868 }
3869
3870 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3871 {
3872 int value2 = op2->__anon1.i;
3873
3874 exp->type = 2;
3875 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
3876 if(!exp->expType)
3877 {
3878 exp->expType = op1->type;
3879 if(op1->type)
3880 op1->type->refCount++;
3881 }
3882 return 1;
3883 }
3884
3885 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3886 {
3887 unsigned int value2 = op2->__anon1.ui;
3888
3889 exp->type = 2;
3890 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
3891 if(!exp->expType)
3892 {
3893 exp->expType = op1->type;
3894 if(op1->type)
3895 op1->type->refCount++;
3896 }
3897 return 1;
3898 }
3899
3900 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3901 {
3902 long long value2 = op2->__anon1.i64;
3903
3904 exp->type = 2;
3905 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
3906 if(!exp->expType)
3907 {
3908 exp->expType = op1->type;
3909 if(op1->type)
3910 op1->type->refCount++;
3911 }
3912 return 1;
3913 }
3914
3915 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3916 {
3917 uint64 value2 = op2->__anon1.ui64;
3918
3919 exp->type = 2;
3920 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
3921 if(!exp->expType)
3922 {
3923 exp->expType = op1->type;
3924 if(op1->type)
3925 op1->type->refCount++;
3926 }
3927 return 1;
3928 }
3929
3930 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3931 {
3932 short value2 = op2->__anon1.s;
3933
3934 exp->type = 2;
3935 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
3936 if(!exp->expType)
3937 {
3938 exp->expType = op1->type;
3939 if(op1->type)
3940 op1->type->refCount++;
3941 }
3942 return 1;
3943 }
3944
3945 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3946 {
3947 unsigned short value2 = op2->__anon1.us;
3948
3949 exp->type = 2;
3950 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
3951 if(!exp->expType)
3952 {
3953 exp->expType = op1->type;
3954 if(op1->type)
3955 op1->type->refCount++;
3956 }
3957 return 1;
3958 }
3959
3960 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3961 {
3962 char value2 = op2->__anon1.c;
3963
3964 exp->type = 2;
3965 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
3966 if(!exp->expType)
3967 {
3968 exp->expType = op1->type;
3969 if(op1->type)
3970 op1->type->refCount++;
3971 }
3972 return 1;
3973 }
3974
3975 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3976 {
3977 unsigned char value2 = op2->__anon1.uc;
3978
3979 exp->type = 2;
3980 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
3981 if(!exp->expType)
3982 {
3983 exp->expType = op1->type;
3984 if(op1->type)
3985 op1->type->refCount++;
3986 }
3987 return 1;
3988 }
3989
3990 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3991 {
3992 float value2 = op2->__anon1.f;
3993
3994 exp->type = 2;
3995 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
3996 if(!exp->expType)
3997 {
3998 exp->expType = op1->type;
3999 if(op1->type)
4000 op1->type->refCount++;
4001 }
4002 return 1;
4003 }
4004
4005 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4006 {
4007 double value2 = op2->__anon1.d;
4008
4009 exp->type = 2;
4010 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
4011 if(!exp->expType)
4012 {
4013 exp->expType = op1->type;
4014 if(op1->type)
4015 op1->type->refCount++;
4016 }
4017 return 1;
4018 }
4019
4020 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4021 {
4022 int value2 = op2->__anon1.i;
4023
4024 exp->type = 2;
4025 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
4026 if(!exp->expType)
4027 {
4028 exp->expType = op1->type;
4029 if(op1->type)
4030 op1->type->refCount++;
4031 }
4032 return 1;
4033 }
4034
4035 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4036 {
4037 unsigned int value2 = op2->__anon1.ui;
4038
4039 exp->type = 2;
4040 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
4041 if(!exp->expType)
4042 {
4043 exp->expType = op1->type;
4044 if(op1->type)
4045 op1->type->refCount++;
4046 }
4047 return 1;
4048 }
4049
4050 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4051 {
4052 long long value2 = op2->__anon1.i64;
4053
4054 exp->type = 2;
4055 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
4056 if(!exp->expType)
4057 {
4058 exp->expType = op1->type;
4059 if(op1->type)
4060 op1->type->refCount++;
4061 }
4062 return 1;
4063 }
4064
4065 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4066 {
4067 uint64 value2 = op2->__anon1.ui64;
4068
4069 exp->type = 2;
4070 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
4071 if(!exp->expType)
4072 {
4073 exp->expType = op1->type;
4074 if(op1->type)
4075 op1->type->refCount++;
4076 }
4077 return 1;
4078 }
4079
4080 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4081 {
4082 short value2 = op2->__anon1.s;
4083
4084 exp->type = 2;
4085 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
4086 if(!exp->expType)
4087 {
4088 exp->expType = op1->type;
4089 if(op1->type)
4090 op1->type->refCount++;
4091 }
4092 return 1;
4093 }
4094
4095 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4096 {
4097 unsigned short value2 = op2->__anon1.us;
4098
4099 exp->type = 2;
4100 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
4101 if(!exp->expType)
4102 {
4103 exp->expType = op1->type;
4104 if(op1->type)
4105 op1->type->refCount++;
4106 }
4107 return 1;
4108 }
4109
4110 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4111 {
4112 char value2 = op2->__anon1.c;
4113
4114 exp->type = 2;
4115 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
4116 if(!exp->expType)
4117 {
4118 exp->expType = op1->type;
4119 if(op1->type)
4120 op1->type->refCount++;
4121 }
4122 return 1;
4123 }
4124
4125 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4126 {
4127 unsigned char value2 = op2->__anon1.uc;
4128
4129 exp->type = 2;
4130 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
4131 if(!exp->expType)
4132 {
4133 exp->expType = op1->type;
4134 if(op1->type)
4135 op1->type->refCount++;
4136 }
4137 return 1;
4138 }
4139
4140 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4141 {
4142 float value2 = op2->__anon1.f;
4143
4144 exp->type = 2;
4145 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
4146 if(!exp->expType)
4147 {
4148 exp->expType = op1->type;
4149 if(op1->type)
4150 op1->type->refCount++;
4151 }
4152 return 1;
4153 }
4154
4155 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4156 {
4157 double value2 = op2->__anon1.d;
4158
4159 exp->type = 2;
4160 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
4161 if(!exp->expType)
4162 {
4163 exp->expType = op1->type;
4164 if(op1->type)
4165 op1->type->refCount++;
4166 }
4167 return 1;
4168 }
4169
4170 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4171 {
4172 int value2 = op2->__anon1.i;
4173
4174 exp->type = 2;
4175 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
4176 if(!exp->expType)
4177 {
4178 exp->expType = op1->type;
4179 if(op1->type)
4180 op1->type->refCount++;
4181 }
4182 return 1;
4183 }
4184
4185 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4186 {
4187 unsigned int value2 = op2->__anon1.ui;
4188
4189 exp->type = 2;
4190 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
4191 if(!exp->expType)
4192 {
4193 exp->expType = op1->type;
4194 if(op1->type)
4195 op1->type->refCount++;
4196 }
4197 return 1;
4198 }
4199
4200 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4201 {
4202 long long value2 = op2->__anon1.i64;
4203
4204 exp->type = 2;
4205 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
4206 if(!exp->expType)
4207 {
4208 exp->expType = op1->type;
4209 if(op1->type)
4210 op1->type->refCount++;
4211 }
4212 return 1;
4213 }
4214
4215 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4216 {
4217 uint64 value2 = op2->__anon1.ui64;
4218
4219 exp->type = 2;
4220 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
4221 if(!exp->expType)
4222 {
4223 exp->expType = op1->type;
4224 if(op1->type)
4225 op1->type->refCount++;
4226 }
4227 return 1;
4228 }
4229
4230 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4231 {
4232 short value2 = op2->__anon1.s;
4233
4234 exp->type = 2;
4235 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
4236 if(!exp->expType)
4237 {
4238 exp->expType = op1->type;
4239 if(op1->type)
4240 op1->type->refCount++;
4241 }
4242 return 1;
4243 }
4244
4245 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4246 {
4247 unsigned short value2 = op2->__anon1.us;
4248
4249 exp->type = 2;
4250 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
4251 if(!exp->expType)
4252 {
4253 exp->expType = op1->type;
4254 if(op1->type)
4255 op1->type->refCount++;
4256 }
4257 return 1;
4258 }
4259
4260 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4261 {
4262 char value2 = op2->__anon1.c;
4263
4264 exp->type = 2;
4265 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
4266 if(!exp->expType)
4267 {
4268 exp->expType = op1->type;
4269 if(op1->type)
4270 op1->type->refCount++;
4271 }
4272 return 1;
4273 }
4274
4275 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4276 {
4277 unsigned char value2 = op2->__anon1.uc;
4278
4279 exp->type = 2;
4280 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
4281 if(!exp->expType)
4282 {
4283 exp->expType = op1->type;
4284 if(op1->type)
4285 op1->type->refCount++;
4286 }
4287 return 1;
4288 }
4289
4290 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4291 {
4292 float value2 = op2->__anon1.f;
4293
4294 exp->type = 2;
4295 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
4296 if(!exp->expType)
4297 {
4298 exp->expType = op1->type;
4299 if(op1->type)
4300 op1->type->refCount++;
4301 }
4302 return 1;
4303 }
4304
4305 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4306 {
4307 double value2 = op2->__anon1.d;
4308
4309 exp->type = 2;
4310 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
4311 if(!exp->expType)
4312 {
4313 exp->expType = op1->type;
4314 if(op1->type)
4315 op1->type->refCount++;
4316 }
4317 return 1;
4318 }
4319
4320 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4321 {
4322 int value2 = op2->__anon1.i;
4323
4324 exp->type = 2;
4325 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
4326 if(!exp->expType)
4327 {
4328 exp->expType = op1->type;
4329 if(op1->type)
4330 op1->type->refCount++;
4331 }
4332 return 1;
4333 }
4334
4335 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4336 {
4337 unsigned int value2 = op2->__anon1.ui;
4338
4339 exp->type = 2;
4340 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
4341 if(!exp->expType)
4342 {
4343 exp->expType = op1->type;
4344 if(op1->type)
4345 op1->type->refCount++;
4346 }
4347 return 1;
4348 }
4349
4350 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4351 {
4352 long long value2 = op2->__anon1.i64;
4353
4354 exp->type = 2;
4355 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
4356 if(!exp->expType)
4357 {
4358 exp->expType = op1->type;
4359 if(op1->type)
4360 op1->type->refCount++;
4361 }
4362 return 1;
4363 }
4364
4365 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4366 {
4367 uint64 value2 = op2->__anon1.ui64;
4368
4369 exp->type = 2;
4370 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
4371 if(!exp->expType)
4372 {
4373 exp->expType = op1->type;
4374 if(op1->type)
4375 op1->type->refCount++;
4376 }
4377 return 1;
4378 }
4379
4380 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4381 {
4382 short value2 = op2->__anon1.s;
4383
4384 exp->type = 2;
4385 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
4386 if(!exp->expType)
4387 {
4388 exp->expType = op1->type;
4389 if(op1->type)
4390 op1->type->refCount++;
4391 }
4392 return 1;
4393 }
4394
4395 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4396 {
4397 unsigned short value2 = op2->__anon1.us;
4398
4399 exp->type = 2;
4400 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
4401 if(!exp->expType)
4402 {
4403 exp->expType = op1->type;
4404 if(op1->type)
4405 op1->type->refCount++;
4406 }
4407 return 1;
4408 }
4409
4410 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4411 {
4412 char value2 = op2->__anon1.c;
4413
4414 exp->type = 2;
4415 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
4416 if(!exp->expType)
4417 {
4418 exp->expType = op1->type;
4419 if(op1->type)
4420 op1->type->refCount++;
4421 }
4422 return 1;
4423 }
4424
4425 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4426 {
4427 unsigned char value2 = op2->__anon1.uc;
4428
4429 exp->type = 2;
4430 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
4431 if(!exp->expType)
4432 {
4433 exp->expType = op1->type;
4434 if(op1->type)
4435 op1->type->refCount++;
4436 }
4437 return 1;
4438 }
4439
4440 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4441 {
4442 int value2 = op2->__anon1.i;
4443
4444 exp->type = 2;
4445 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
4446 if(!exp->expType)
4447 {
4448 exp->expType = op1->type;
4449 if(op1->type)
4450 op1->type->refCount++;
4451 }
4452 return 1;
4453 }
4454
4455 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4456 {
4457 unsigned int value2 = op2->__anon1.ui;
4458
4459 exp->type = 2;
4460 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
4461 if(!exp->expType)
4462 {
4463 exp->expType = op1->type;
4464 if(op1->type)
4465 op1->type->refCount++;
4466 }
4467 return 1;
4468 }
4469
4470 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4471 {
4472 long long value2 = op2->__anon1.i64;
4473
4474 exp->type = 2;
4475 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
4476 if(!exp->expType)
4477 {
4478 exp->expType = op1->type;
4479 if(op1->type)
4480 op1->type->refCount++;
4481 }
4482 return 1;
4483 }
4484
4485 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4486 {
4487 uint64 value2 = op2->__anon1.ui64;
4488
4489 exp->type = 2;
4490 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
4491 if(!exp->expType)
4492 {
4493 exp->expType = op1->type;
4494 if(op1->type)
4495 op1->type->refCount++;
4496 }
4497 return 1;
4498 }
4499
4500 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4501 {
4502 short value2 = op2->__anon1.s;
4503
4504 exp->type = 2;
4505 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
4506 if(!exp->expType)
4507 {
4508 exp->expType = op1->type;
4509 if(op1->type)
4510 op1->type->refCount++;
4511 }
4512 return 1;
4513 }
4514
4515 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4516 {
4517 unsigned short value2 = op2->__anon1.us;
4518
4519 exp->type = 2;
4520 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
4521 if(!exp->expType)
4522 {
4523 exp->expType = op1->type;
4524 if(op1->type)
4525 op1->type->refCount++;
4526 }
4527 return 1;
4528 }
4529
4530 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4531 {
4532 char value2 = op2->__anon1.c;
4533
4534 exp->type = 2;
4535 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
4536 if(!exp->expType)
4537 {
4538 exp->expType = op1->type;
4539 if(op1->type)
4540 op1->type->refCount++;
4541 }
4542 return 1;
4543 }
4544
4545 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4546 {
4547 unsigned char value2 = op2->__anon1.uc;
4548
4549 exp->type = 2;
4550 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
4551 if(!exp->expType)
4552 {
4553 exp->expType = op1->type;
4554 if(op1->type)
4555 op1->type->refCount++;
4556 }
4557 return 1;
4558 }
4559
4560 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4561 {
4562 int value2 = op2->__anon1.i;
4563
4564 exp->type = 2;
4565 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
4566 if(!exp->expType)
4567 {
4568 exp->expType = op1->type;
4569 if(op1->type)
4570 op1->type->refCount++;
4571 }
4572 return 1;
4573 }
4574
4575 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4576 {
4577 unsigned int value2 = op2->__anon1.ui;
4578
4579 exp->type = 2;
4580 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
4581 if(!exp->expType)
4582 {
4583 exp->expType = op1->type;
4584 if(op1->type)
4585 op1->type->refCount++;
4586 }
4587 return 1;
4588 }
4589
4590 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4591 {
4592 long long value2 = op2->__anon1.i64;
4593
4594 exp->type = 2;
4595 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
4596 if(!exp->expType)
4597 {
4598 exp->expType = op1->type;
4599 if(op1->type)
4600 op1->type->refCount++;
4601 }
4602 return 1;
4603 }
4604
4605 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4606 {
4607 uint64 value2 = op2->__anon1.ui64;
4608
4609 exp->type = 2;
4610 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
4611 if(!exp->expType)
4612 {
4613 exp->expType = op1->type;
4614 if(op1->type)
4615 op1->type->refCount++;
4616 }
4617 return 1;
4618 }
4619
4620 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4621 {
4622 short value2 = op2->__anon1.s;
4623
4624 exp->type = 2;
4625 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
4626 if(!exp->expType)
4627 {
4628 exp->expType = op1->type;
4629 if(op1->type)
4630 op1->type->refCount++;
4631 }
4632 return 1;
4633 }
4634
4635 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4636 {
4637 unsigned short value2 = op2->__anon1.us;
4638
4639 exp->type = 2;
4640 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
4641 if(!exp->expType)
4642 {
4643 exp->expType = op1->type;
4644 if(op1->type)
4645 op1->type->refCount++;
4646 }
4647 return 1;
4648 }
4649
4650 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4651 {
4652 char value2 = op2->__anon1.c;
4653
4654 exp->type = 2;
4655 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
4656 if(!exp->expType)
4657 {
4658 exp->expType = op1->type;
4659 if(op1->type)
4660 op1->type->refCount++;
4661 }
4662 return 1;
4663 }
4664
4665 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4666 {
4667 unsigned char value2 = op2->__anon1.uc;
4668
4669 exp->type = 2;
4670 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
4671 if(!exp->expType)
4672 {
4673 exp->expType = op1->type;
4674 if(op1->type)
4675 op1->type->refCount++;
4676 }
4677 return 1;
4678 }
4679
4680 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4681 {
4682 int value2 = op2->__anon1.i;
4683
4684 exp->type = 2;
4685 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
4686 if(!exp->expType)
4687 {
4688 exp->expType = op1->type;
4689 if(op1->type)
4690 op1->type->refCount++;
4691 }
4692 return 1;
4693 }
4694
4695 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4696 {
4697 unsigned int value2 = op2->__anon1.ui;
4698
4699 exp->type = 2;
4700 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
4701 if(!exp->expType)
4702 {
4703 exp->expType = op1->type;
4704 if(op1->type)
4705 op1->type->refCount++;
4706 }
4707 return 1;
4708 }
4709
4710 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4711 {
4712 long long value2 = op2->__anon1.i64;
4713
4714 exp->type = 2;
4715 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
4716 if(!exp->expType)
4717 {
4718 exp->expType = op1->type;
4719 if(op1->type)
4720 op1->type->refCount++;
4721 }
4722 return 1;
4723 }
4724
4725 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4726 {
4727 uint64 value2 = op2->__anon1.ui64;
4728
4729 exp->type = 2;
4730 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
4731 if(!exp->expType)
4732 {
4733 exp->expType = op1->type;
4734 if(op1->type)
4735 op1->type->refCount++;
4736 }
4737 return 1;
4738 }
4739
4740 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4741 {
4742 short value2 = op2->__anon1.s;
4743
4744 exp->type = 2;
4745 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
4746 if(!exp->expType)
4747 {
4748 exp->expType = op1->type;
4749 if(op1->type)
4750 op1->type->refCount++;
4751 }
4752 return 1;
4753 }
4754
4755 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4756 {
4757 unsigned short value2 = op2->__anon1.us;
4758
4759 exp->type = 2;
4760 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
4761 if(!exp->expType)
4762 {
4763 exp->expType = op1->type;
4764 if(op1->type)
4765 op1->type->refCount++;
4766 }
4767 return 1;
4768 }
4769
4770 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4771 {
4772 char value2 = op2->__anon1.c;
4773
4774 exp->type = 2;
4775 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
4776 if(!exp->expType)
4777 {
4778 exp->expType = op1->type;
4779 if(op1->type)
4780 op1->type->refCount++;
4781 }
4782 return 1;
4783 }
4784
4785 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4786 {
4787 unsigned char value2 = op2->__anon1.uc;
4788
4789 exp->type = 2;
4790 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
4791 if(!exp->expType)
4792 {
4793 exp->expType = op1->type;
4794 if(op1->type)
4795 op1->type->refCount++;
4796 }
4797 return 1;
4798 }
4799
4800 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4801 {
4802 int value2 = op2->__anon1.i;
4803
4804 exp->type = 2;
4805 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
4806 if(!exp->expType)
4807 {
4808 exp->expType = op1->type;
4809 if(op1->type)
4810 op1->type->refCount++;
4811 }
4812 return 1;
4813 }
4814
4815 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4816 {
4817 unsigned int value2 = op2->__anon1.ui;
4818
4819 exp->type = 2;
4820 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
4821 if(!exp->expType)
4822 {
4823 exp->expType = op1->type;
4824 if(op1->type)
4825 op1->type->refCount++;
4826 }
4827 return 1;
4828 }
4829
4830 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4831 {
4832 long long value2 = op2->__anon1.i64;
4833
4834 exp->type = 2;
4835 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
4836 if(!exp->expType)
4837 {
4838 exp->expType = op1->type;
4839 if(op1->type)
4840 op1->type->refCount++;
4841 }
4842 return 1;
4843 }
4844
4845 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4846 {
4847 uint64 value2 = op2->__anon1.ui64;
4848
4849 exp->type = 2;
4850 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
4851 if(!exp->expType)
4852 {
4853 exp->expType = op1->type;
4854 if(op1->type)
4855 op1->type->refCount++;
4856 }
4857 return 1;
4858 }
4859
4860 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4861 {
4862 short value2 = op2->__anon1.s;
4863
4864 exp->type = 2;
4865 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
4866 if(!exp->expType)
4867 {
4868 exp->expType = op1->type;
4869 if(op1->type)
4870 op1->type->refCount++;
4871 }
4872 return 1;
4873 }
4874
4875 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4876 {
4877 unsigned short value2 = op2->__anon1.us;
4878
4879 exp->type = 2;
4880 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
4881 if(!exp->expType)
4882 {
4883 exp->expType = op1->type;
4884 if(op1->type)
4885 op1->type->refCount++;
4886 }
4887 return 1;
4888 }
4889
4890 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4891 {
4892 char value2 = op2->__anon1.c;
4893
4894 exp->type = 2;
4895 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
4896 if(!exp->expType)
4897 {
4898 exp->expType = op1->type;
4899 if(op1->type)
4900 op1->type->refCount++;
4901 }
4902 return 1;
4903 }
4904
4905 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4906 {
4907 unsigned char value2 = op2->__anon1.uc;
4908
4909 exp->type = 2;
4910 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
4911 if(!exp->expType)
4912 {
4913 exp->expType = op1->type;
4914 if(op1->type)
4915 op1->type->refCount++;
4916 }
4917 return 1;
4918 }
4919
4920 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4921 {
4922 int value2 = op2->__anon1.i;
4923
4924 exp->type = 2;
4925 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
4926 if(!exp->expType)
4927 {
4928 exp->expType = op1->type;
4929 if(op1->type)
4930 op1->type->refCount++;
4931 }
4932 return 1;
4933 }
4934
4935 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4936 {
4937 unsigned int value2 = op2->__anon1.ui;
4938
4939 exp->type = 2;
4940 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
4941 if(!exp->expType)
4942 {
4943 exp->expType = op1->type;
4944 if(op1->type)
4945 op1->type->refCount++;
4946 }
4947 return 1;
4948 }
4949
4950 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4951 {
4952 long long value2 = op2->__anon1.i64;
4953
4954 exp->type = 2;
4955 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
4956 if(!exp->expType)
4957 {
4958 exp->expType = op1->type;
4959 if(op1->type)
4960 op1->type->refCount++;
4961 }
4962 return 1;
4963 }
4964
4965 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4966 {
4967 uint64 value2 = op2->__anon1.ui64;
4968
4969 exp->type = 2;
4970 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
4971 if(!exp->expType)
4972 {
4973 exp->expType = op1->type;
4974 if(op1->type)
4975 op1->type->refCount++;
4976 }
4977 return 1;
4978 }
4979
4980 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4981 {
4982 short value2 = op2->__anon1.s;
4983
4984 exp->type = 2;
4985 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
4986 if(!exp->expType)
4987 {
4988 exp->expType = op1->type;
4989 if(op1->type)
4990 op1->type->refCount++;
4991 }
4992 return 1;
4993 }
4994
4995 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4996 {
4997 unsigned short value2 = op2->__anon1.us;
4998
4999 exp->type = 2;
5000 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
5001 if(!exp->expType)
5002 {
5003 exp->expType = op1->type;
5004 if(op1->type)
5005 op1->type->refCount++;
5006 }
5007 return 1;
5008 }
5009
5010 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5011 {
5012 char value2 = op2->__anon1.c;
5013
5014 exp->type = 2;
5015 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
5016 if(!exp->expType)
5017 {
5018 exp->expType = op1->type;
5019 if(op1->type)
5020 op1->type->refCount++;
5021 }
5022 return 1;
5023 }
5024
5025 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5026 {
5027 unsigned char value2 = op2->__anon1.uc;
5028
5029 exp->type = 2;
5030 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
5031 if(!exp->expType)
5032 {
5033 exp->expType = op1->type;
5034 if(op1->type)
5035 op1->type->refCount++;
5036 }
5037 return 1;
5038 }
5039
5040 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
5041 {
5042 exp->type = 2;
5043 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
5044 if(!exp->expType)
5045 {
5046 exp->expType = op1->type;
5047 if(op1->type)
5048 op1->type->refCount++;
5049 }
5050 return 1;
5051 }
5052
5053 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
5054 {
5055 exp->type = 2;
5056 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
5057 if(!exp->expType)
5058 {
5059 exp->expType = op1->type;
5060 if(op1->type)
5061 op1->type->refCount++;
5062 }
5063 return 1;
5064 }
5065
5066 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
5067 {
5068 exp->type = 2;
5069 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
5070 if(!exp->expType)
5071 {
5072 exp->expType = op1->type;
5073 if(op1->type)
5074 op1->type->refCount++;
5075 }
5076 return 1;
5077 }
5078
5079 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
5080 {
5081 exp->type = 2;
5082 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
5083 if(!exp->expType)
5084 {
5085 exp->expType = op1->type;
5086 if(op1->type)
5087 op1->type->refCount++;
5088 }
5089 return 1;
5090 }
5091
5092 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
5093 {
5094 exp->type = 2;
5095 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
5096 if(!exp->expType)
5097 {
5098 exp->expType = op1->type;
5099 if(op1->type)
5100 op1->type->refCount++;
5101 }
5102 return 1;
5103 }
5104
5105 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
5106 {
5107 exp->type = 2;
5108 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
5109 if(!exp->expType)
5110 {
5111 exp->expType = op1->type;
5112 if(op1->type)
5113 op1->type->refCount++;
5114 }
5115 return 1;
5116 }
5117
5118 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
5119 {
5120 exp->type = 2;
5121 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
5122 if(!exp->expType)
5123 {
5124 exp->expType = op1->type;
5125 if(op1->type)
5126 op1->type->refCount++;
5127 }
5128 return 1;
5129 }
5130
5131 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
5132 {
5133 exp->type = 2;
5134 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
5135 if(!exp->expType)
5136 {
5137 exp->expType = op1->type;
5138 if(op1->type)
5139 op1->type->refCount++;
5140 }
5141 return 1;
5142 }
5143
5144 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5145 {
5146 int value2 = op2->__anon1.i;
5147
5148 exp->type = 2;
5149 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
5150 if(!exp->expType)
5151 {
5152 exp->expType = op1->type;
5153 if(op1->type)
5154 op1->type->refCount++;
5155 }
5156 return 1;
5157 }
5158
5159 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5160 {
5161 unsigned int value2 = op2->__anon1.ui;
5162
5163 exp->type = 2;
5164 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
5165 if(!exp->expType)
5166 {
5167 exp->expType = op1->type;
5168 if(op1->type)
5169 op1->type->refCount++;
5170 }
5171 return 1;
5172 }
5173
5174 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5175 {
5176 long long value2 = op2->__anon1.i64;
5177
5178 exp->type = 2;
5179 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
5180 if(!exp->expType)
5181 {
5182 exp->expType = op1->type;
5183 if(op1->type)
5184 op1->type->refCount++;
5185 }
5186 return 1;
5187 }
5188
5189 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5190 {
5191 uint64 value2 = op2->__anon1.ui64;
5192
5193 exp->type = 2;
5194 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
5195 if(!exp->expType)
5196 {
5197 exp->expType = op1->type;
5198 if(op1->type)
5199 op1->type->refCount++;
5200 }
5201 return 1;
5202 }
5203
5204 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5205 {
5206 short value2 = op2->__anon1.s;
5207
5208 exp->type = 2;
5209 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
5210 if(!exp->expType)
5211 {
5212 exp->expType = op1->type;
5213 if(op1->type)
5214 op1->type->refCount++;
5215 }
5216 return 1;
5217 }
5218
5219 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5220 {
5221 unsigned short value2 = op2->__anon1.us;
5222
5223 exp->type = 2;
5224 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
5225 if(!exp->expType)
5226 {
5227 exp->expType = op1->type;
5228 if(op1->type)
5229 op1->type->refCount++;
5230 }
5231 return 1;
5232 }
5233
5234 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5235 {
5236 char value2 = op2->__anon1.c;
5237
5238 exp->type = 2;
5239 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
5240 if(!exp->expType)
5241 {
5242 exp->expType = op1->type;
5243 if(op1->type)
5244 op1->type->refCount++;
5245 }
5246 return 1;
5247 }
5248
5249 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5250 {
5251 unsigned char value2 = op2->__anon1.uc;
5252
5253 exp->type = 2;
5254 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
5255 if(!exp->expType)
5256 {
5257 exp->expType = op1->type;
5258 if(op1->type)
5259 op1->type->refCount++;
5260 }
5261 return 1;
5262 }
5263
5264 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5265 {
5266 int value2 = op2->__anon1.i;
5267
5268 exp->type = 2;
5269 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
5270 if(!exp->expType)
5271 {
5272 exp->expType = op1->type;
5273 if(op1->type)
5274 op1->type->refCount++;
5275 }
5276 return 1;
5277 }
5278
5279 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5280 {
5281 unsigned int value2 = op2->__anon1.ui;
5282
5283 exp->type = 2;
5284 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
5285 if(!exp->expType)
5286 {
5287 exp->expType = op1->type;
5288 if(op1->type)
5289 op1->type->refCount++;
5290 }
5291 return 1;
5292 }
5293
5294 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5295 {
5296 long long value2 = op2->__anon1.i64;
5297
5298 exp->type = 2;
5299 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
5300 if(!exp->expType)
5301 {
5302 exp->expType = op1->type;
5303 if(op1->type)
5304 op1->type->refCount++;
5305 }
5306 return 1;
5307 }
5308
5309 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5310 {
5311 uint64 value2 = op2->__anon1.ui64;
5312
5313 exp->type = 2;
5314 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
5315 if(!exp->expType)
5316 {
5317 exp->expType = op1->type;
5318 if(op1->type)
5319 op1->type->refCount++;
5320 }
5321 return 1;
5322 }
5323
5324 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5325 {
5326 short value2 = op2->__anon1.s;
5327
5328 exp->type = 2;
5329 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
5330 if(!exp->expType)
5331 {
5332 exp->expType = op1->type;
5333 if(op1->type)
5334 op1->type->refCount++;
5335 }
5336 return 1;
5337 }
5338
5339 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5340 {
5341 unsigned short value2 = op2->__anon1.us;
5342
5343 exp->type = 2;
5344 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
5345 if(!exp->expType)
5346 {
5347 exp->expType = op1->type;
5348 if(op1->type)
5349 op1->type->refCount++;
5350 }
5351 return 1;
5352 }
5353
5354 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5355 {
5356 char value2 = op2->__anon1.c;
5357
5358 exp->type = 2;
5359 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
5360 if(!exp->expType)
5361 {
5362 exp->expType = op1->type;
5363 if(op1->type)
5364 op1->type->refCount++;
5365 }
5366 return 1;
5367 }
5368
5369 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5370 {
5371 unsigned char value2 = op2->__anon1.uc;
5372
5373 exp->type = 2;
5374 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
5375 if(!exp->expType)
5376 {
5377 exp->expType = op1->type;
5378 if(op1->type)
5379 op1->type->refCount++;
5380 }
5381 return 1;
5382 }
5383
5384 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5385 {
5386 int value2 = op2->__anon1.i;
5387
5388 exp->type = 2;
5389 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
5390 if(!exp->expType)
5391 {
5392 exp->expType = op1->type;
5393 if(op1->type)
5394 op1->type->refCount++;
5395 }
5396 return 1;
5397 }
5398
5399 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5400 {
5401 unsigned int value2 = op2->__anon1.ui;
5402
5403 exp->type = 2;
5404 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
5405 if(!exp->expType)
5406 {
5407 exp->expType = op1->type;
5408 if(op1->type)
5409 op1->type->refCount++;
5410 }
5411 return 1;
5412 }
5413
5414 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5415 {
5416 long long value2 = op2->__anon1.i64;
5417
5418 exp->type = 2;
5419 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
5420 if(!exp->expType)
5421 {
5422 exp->expType = op1->type;
5423 if(op1->type)
5424 op1->type->refCount++;
5425 }
5426 return 1;
5427 }
5428
5429 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5430 {
5431 uint64 value2 = op2->__anon1.ui64;
5432
5433 exp->type = 2;
5434 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
5435 if(!exp->expType)
5436 {
5437 exp->expType = op1->type;
5438 if(op1->type)
5439 op1->type->refCount++;
5440 }
5441 return 1;
5442 }
5443
5444 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5445 {
5446 short value2 = op2->__anon1.s;
5447
5448 exp->type = 2;
5449 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
5450 if(!exp->expType)
5451 {
5452 exp->expType = op1->type;
5453 if(op1->type)
5454 op1->type->refCount++;
5455 }
5456 return 1;
5457 }
5458
5459 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5460 {
5461 unsigned short value2 = op2->__anon1.us;
5462
5463 exp->type = 2;
5464 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
5465 if(!exp->expType)
5466 {
5467 exp->expType = op1->type;
5468 if(op1->type)
5469 op1->type->refCount++;
5470 }
5471 return 1;
5472 }
5473
5474 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5475 {
5476 char value2 = op2->__anon1.c;
5477
5478 exp->type = 2;
5479 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
5480 if(!exp->expType)
5481 {
5482 exp->expType = op1->type;
5483 if(op1->type)
5484 op1->type->refCount++;
5485 }
5486 return 1;
5487 }
5488
5489 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5490 {
5491 unsigned char value2 = op2->__anon1.uc;
5492
5493 exp->type = 2;
5494 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
5495 if(!exp->expType)
5496 {
5497 exp->expType = op1->type;
5498 if(op1->type)
5499 op1->type->refCount++;
5500 }
5501 return 1;
5502 }
5503
5504 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5505 {
5506 int value2 = op2->__anon1.i;
5507
5508 exp->type = 2;
5509 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
5510 if(!exp->expType)
5511 {
5512 exp->expType = op1->type;
5513 if(op1->type)
5514 op1->type->refCount++;
5515 }
5516 return 1;
5517 }
5518
5519 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5520 {
5521 unsigned int value2 = op2->__anon1.ui;
5522
5523 exp->type = 2;
5524 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
5525 if(!exp->expType)
5526 {
5527 exp->expType = op1->type;
5528 if(op1->type)
5529 op1->type->refCount++;
5530 }
5531 return 1;
5532 }
5533
5534 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5535 {
5536 long long value2 = op2->__anon1.i64;
5537
5538 exp->type = 2;
5539 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
5540 if(!exp->expType)
5541 {
5542 exp->expType = op1->type;
5543 if(op1->type)
5544 op1->type->refCount++;
5545 }
5546 return 1;
5547 }
5548
5549 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5550 {
5551 uint64 value2 = op2->__anon1.ui64;
5552
5553 exp->type = 2;
5554 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
5555 if(!exp->expType)
5556 {
5557 exp->expType = op1->type;
5558 if(op1->type)
5559 op1->type->refCount++;
5560 }
5561 return 1;
5562 }
5563
5564 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5565 {
5566 short value2 = op2->__anon1.s;
5567
5568 exp->type = 2;
5569 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
5570 if(!exp->expType)
5571 {
5572 exp->expType = op1->type;
5573 if(op1->type)
5574 op1->type->refCount++;
5575 }
5576 return 1;
5577 }
5578
5579 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5580 {
5581 unsigned short value2 = op2->__anon1.us;
5582
5583 exp->type = 2;
5584 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
5585 if(!exp->expType)
5586 {
5587 exp->expType = op1->type;
5588 if(op1->type)
5589 op1->type->refCount++;
5590 }
5591 return 1;
5592 }
5593
5594 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5595 {
5596 char value2 = op2->__anon1.c;
5597
5598 exp->type = 2;
5599 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
5600 if(!exp->expType)
5601 {
5602 exp->expType = op1->type;
5603 if(op1->type)
5604 op1->type->refCount++;
5605 }
5606 return 1;
5607 }
5608
5609 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5610 {
5611 unsigned char value2 = op2->__anon1.uc;
5612
5613 exp->type = 2;
5614 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
5615 if(!exp->expType)
5616 {
5617 exp->expType = op1->type;
5618 if(op1->type)
5619 op1->type->refCount++;
5620 }
5621 return 1;
5622 }
5623
5624 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5625 {
5626 int value2 = op2->__anon1.i;
5627
5628 exp->type = 2;
5629 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
5630 if(!exp->expType)
5631 {
5632 exp->expType = op1->type;
5633 if(op1->type)
5634 op1->type->refCount++;
5635 }
5636 return 1;
5637 }
5638
5639 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5640 {
5641 unsigned int value2 = op2->__anon1.ui;
5642
5643 exp->type = 2;
5644 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
5645 if(!exp->expType)
5646 {
5647 exp->expType = op1->type;
5648 if(op1->type)
5649 op1->type->refCount++;
5650 }
5651 return 1;
5652 }
5653
5654 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5655 {
5656 long long value2 = op2->__anon1.i64;
5657
5658 exp->type = 2;
5659 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
5660 if(!exp->expType)
5661 {
5662 exp->expType = op1->type;
5663 if(op1->type)
5664 op1->type->refCount++;
5665 }
5666 return 1;
5667 }
5668
5669 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5670 {
5671 uint64 value2 = op2->__anon1.ui64;
5672
5673 exp->type = 2;
5674 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
5675 if(!exp->expType)
5676 {
5677 exp->expType = op1->type;
5678 if(op1->type)
5679 op1->type->refCount++;
5680 }
5681 return 1;
5682 }
5683
5684 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5685 {
5686 short value2 = op2->__anon1.s;
5687
5688 exp->type = 2;
5689 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
5690 if(!exp->expType)
5691 {
5692 exp->expType = op1->type;
5693 if(op1->type)
5694 op1->type->refCount++;
5695 }
5696 return 1;
5697 }
5698
5699 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5700 {
5701 unsigned short value2 = op2->__anon1.us;
5702
5703 exp->type = 2;
5704 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
5705 if(!exp->expType)
5706 {
5707 exp->expType = op1->type;
5708 if(op1->type)
5709 op1->type->refCount++;
5710 }
5711 return 1;
5712 }
5713
5714 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5715 {
5716 char value2 = op2->__anon1.c;
5717
5718 exp->type = 2;
5719 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
5720 if(!exp->expType)
5721 {
5722 exp->expType = op1->type;
5723 if(op1->type)
5724 op1->type->refCount++;
5725 }
5726 return 1;
5727 }
5728
5729 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5730 {
5731 unsigned char value2 = op2->__anon1.uc;
5732
5733 exp->type = 2;
5734 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
5735 if(!exp->expType)
5736 {
5737 exp->expType = op1->type;
5738 if(op1->type)
5739 op1->type->refCount++;
5740 }
5741 return 1;
5742 }
5743
5744 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
5745 {
5746 exp->type = 2;
5747 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
5748 if(!exp->expType)
5749 {
5750 exp->expType = op1->type;
5751 if(op1->type)
5752 op1->type->refCount++;
5753 }
5754 return 1;
5755 }
5756
5757 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
5758 {
5759 exp->type = 2;
5760 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
5761 if(!exp->expType)
5762 {
5763 exp->expType = op1->type;
5764 if(op1->type)
5765 op1->type->refCount++;
5766 }
5767 return 1;
5768 }
5769
5770 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
5771 {
5772 exp->type = 2;
5773 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
5774 if(!exp->expType)
5775 {
5776 exp->expType = op1->type;
5777 if(op1->type)
5778 op1->type->refCount++;
5779 }
5780 return 1;
5781 }
5782
5783 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
5784 {
5785 exp->type = 2;
5786 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
5787 if(!exp->expType)
5788 {
5789 exp->expType = op1->type;
5790 if(op1->type)
5791 op1->type->refCount++;
5792 }
5793 return 1;
5794 }
5795
5796 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
5797 {
5798 exp->type = 2;
5799 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
5800 if(!exp->expType)
5801 {
5802 exp->expType = op1->type;
5803 if(op1->type)
5804 op1->type->refCount++;
5805 }
5806 return 1;
5807 }
5808
5809 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
5810 {
5811 exp->type = 2;
5812 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
5813 if(!exp->expType)
5814 {
5815 exp->expType = op1->type;
5816 if(op1->type)
5817 op1->type->refCount++;
5818 }
5819 return 1;
5820 }
5821
5822 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
5823 {
5824 exp->type = 2;
5825 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
5826 if(!exp->expType)
5827 {
5828 exp->expType = op1->type;
5829 if(op1->type)
5830 op1->type->refCount++;
5831 }
5832 return 1;
5833 }
5834
5835 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
5836 {
5837 exp->type = 2;
5838 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
5839 if(!exp->expType)
5840 {
5841 exp->expType = op1->type;
5842 if(op1->type)
5843 op1->type->refCount++;
5844 }
5845 return 1;
5846 }
5847
5848 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5849 {
5850 int value2 = op2->__anon1.i;
5851
5852 exp->type = 2;
5853 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
5854 if(!exp->expType)
5855 {
5856 exp->expType = op1->type;
5857 if(op1->type)
5858 op1->type->refCount++;
5859 }
5860 return 1;
5861 }
5862
5863 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5864 {
5865 unsigned int value2 = op2->__anon1.ui;
5866
5867 exp->type = 2;
5868 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
5869 if(!exp->expType)
5870 {
5871 exp->expType = op1->type;
5872 if(op1->type)
5873 op1->type->refCount++;
5874 }
5875 return 1;
5876 }
5877
5878 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5879 {
5880 long long value2 = op2->__anon1.i64;
5881
5882 exp->type = 2;
5883 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
5884 if(!exp->expType)
5885 {
5886 exp->expType = op1->type;
5887 if(op1->type)
5888 op1->type->refCount++;
5889 }
5890 return 1;
5891 }
5892
5893 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5894 {
5895 uint64 value2 = op2->__anon1.ui64;
5896
5897 exp->type = 2;
5898 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
5899 if(!exp->expType)
5900 {
5901 exp->expType = op1->type;
5902 if(op1->type)
5903 op1->type->refCount++;
5904 }
5905 return 1;
5906 }
5907
5908 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5909 {
5910 short value2 = op2->__anon1.s;
5911
5912 exp->type = 2;
5913 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
5914 if(!exp->expType)
5915 {
5916 exp->expType = op1->type;
5917 if(op1->type)
5918 op1->type->refCount++;
5919 }
5920 return 1;
5921 }
5922
5923 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5924 {
5925 unsigned short value2 = op2->__anon1.us;
5926
5927 exp->type = 2;
5928 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
5929 if(!exp->expType)
5930 {
5931 exp->expType = op1->type;
5932 if(op1->type)
5933 op1->type->refCount++;
5934 }
5935 return 1;
5936 }
5937
5938 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5939 {
5940 char value2 = op2->__anon1.c;
5941
5942 exp->type = 2;
5943 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
5944 if(!exp->expType)
5945 {
5946 exp->expType = op1->type;
5947 if(op1->type)
5948 op1->type->refCount++;
5949 }
5950 return 1;
5951 }
5952
5953 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5954 {
5955 unsigned char value2 = op2->__anon1.uc;
5956
5957 exp->type = 2;
5958 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
5959 if(!exp->expType)
5960 {
5961 exp->expType = op1->type;
5962 if(op1->type)
5963 op1->type->refCount++;
5964 }
5965 return 1;
5966 }
5967
5968 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5969 {
5970 float value2 = op2->__anon1.f;
5971
5972 exp->type = 2;
5973 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
5974 if(!exp->expType)
5975 {
5976 exp->expType = op1->type;
5977 if(op1->type)
5978 op1->type->refCount++;
5979 }
5980 return 1;
5981 }
5982
5983 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5984 {
5985 double value2 = op2->__anon1.d;
5986
5987 exp->type = 2;
5988 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
5989 if(!exp->expType)
5990 {
5991 exp->expType = op1->type;
5992 if(op1->type)
5993 op1->type->refCount++;
5994 }
5995 return 1;
5996 }
5997
5998 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5999 {
6000 int value2 = op2->__anon1.i;
6001
6002 exp->type = 2;
6003 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
6004 if(!exp->expType)
6005 {
6006 exp->expType = op1->type;
6007 if(op1->type)
6008 op1->type->refCount++;
6009 }
6010 return 1;
6011 }
6012
6013 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6014 {
6015 unsigned int value2 = op2->__anon1.ui;
6016
6017 exp->type = 2;
6018 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
6019 if(!exp->expType)
6020 {
6021 exp->expType = op1->type;
6022 if(op1->type)
6023 op1->type->refCount++;
6024 }
6025 return 1;
6026 }
6027
6028 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6029 {
6030 long long value2 = op2->__anon1.i64;
6031
6032 exp->type = 2;
6033 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
6034 if(!exp->expType)
6035 {
6036 exp->expType = op1->type;
6037 if(op1->type)
6038 op1->type->refCount++;
6039 }
6040 return 1;
6041 }
6042
6043 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6044 {
6045 uint64 value2 = op2->__anon1.ui64;
6046
6047 exp->type = 2;
6048 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
6049 if(!exp->expType)
6050 {
6051 exp->expType = op1->type;
6052 if(op1->type)
6053 op1->type->refCount++;
6054 }
6055 return 1;
6056 }
6057
6058 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6059 {
6060 short value2 = op2->__anon1.s;
6061
6062 exp->type = 2;
6063 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
6064 if(!exp->expType)
6065 {
6066 exp->expType = op1->type;
6067 if(op1->type)
6068 op1->type->refCount++;
6069 }
6070 return 1;
6071 }
6072
6073 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6074 {
6075 unsigned short value2 = op2->__anon1.us;
6076
6077 exp->type = 2;
6078 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
6079 if(!exp->expType)
6080 {
6081 exp->expType = op1->type;
6082 if(op1->type)
6083 op1->type->refCount++;
6084 }
6085 return 1;
6086 }
6087
6088 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6089 {
6090 char value2 = op2->__anon1.c;
6091
6092 exp->type = 2;
6093 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
6094 if(!exp->expType)
6095 {
6096 exp->expType = op1->type;
6097 if(op1->type)
6098 op1->type->refCount++;
6099 }
6100 return 1;
6101 }
6102
6103 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6104 {
6105 unsigned char value2 = op2->__anon1.uc;
6106
6107 exp->type = 2;
6108 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
6109 if(!exp->expType)
6110 {
6111 exp->expType = op1->type;
6112 if(op1->type)
6113 op1->type->refCount++;
6114 }
6115 return 1;
6116 }
6117
6118 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6119 {
6120 float value2 = op2->__anon1.f;
6121
6122 exp->type = 2;
6123 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
6124 if(!exp->expType)
6125 {
6126 exp->expType = op1->type;
6127 if(op1->type)
6128 op1->type->refCount++;
6129 }
6130 return 1;
6131 }
6132
6133 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6134 {
6135 double value2 = op2->__anon1.d;
6136
6137 exp->type = 2;
6138 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
6139 if(!exp->expType)
6140 {
6141 exp->expType = op1->type;
6142 if(op1->type)
6143 op1->type->refCount++;
6144 }
6145 return 1;
6146 }
6147
6148 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6149 {
6150 int value2 = op2->__anon1.i;
6151
6152 exp->type = 2;
6153 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
6154 if(!exp->expType)
6155 {
6156 exp->expType = op1->type;
6157 if(op1->type)
6158 op1->type->refCount++;
6159 }
6160 return 1;
6161 }
6162
6163 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6164 {
6165 unsigned int value2 = op2->__anon1.ui;
6166
6167 exp->type = 2;
6168 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
6169 if(!exp->expType)
6170 {
6171 exp->expType = op1->type;
6172 if(op1->type)
6173 op1->type->refCount++;
6174 }
6175 return 1;
6176 }
6177
6178 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6179 {
6180 long long value2 = op2->__anon1.i64;
6181
6182 exp->type = 2;
6183 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
6184 if(!exp->expType)
6185 {
6186 exp->expType = op1->type;
6187 if(op1->type)
6188 op1->type->refCount++;
6189 }
6190 return 1;
6191 }
6192
6193 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6194 {
6195 uint64 value2 = op2->__anon1.ui64;
6196
6197 exp->type = 2;
6198 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
6199 if(!exp->expType)
6200 {
6201 exp->expType = op1->type;
6202 if(op1->type)
6203 op1->type->refCount++;
6204 }
6205 return 1;
6206 }
6207
6208 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6209 {
6210 short value2 = op2->__anon1.s;
6211
6212 exp->type = 2;
6213 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
6214 if(!exp->expType)
6215 {
6216 exp->expType = op1->type;
6217 if(op1->type)
6218 op1->type->refCount++;
6219 }
6220 return 1;
6221 }
6222
6223 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6224 {
6225 unsigned short value2 = op2->__anon1.us;
6226
6227 exp->type = 2;
6228 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
6229 if(!exp->expType)
6230 {
6231 exp->expType = op1->type;
6232 if(op1->type)
6233 op1->type->refCount++;
6234 }
6235 return 1;
6236 }
6237
6238 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6239 {
6240 char value2 = op2->__anon1.c;
6241
6242 exp->type = 2;
6243 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
6244 if(!exp->expType)
6245 {
6246 exp->expType = op1->type;
6247 if(op1->type)
6248 op1->type->refCount++;
6249 }
6250 return 1;
6251 }
6252
6253 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6254 {
6255 unsigned char value2 = op2->__anon1.uc;
6256
6257 exp->type = 2;
6258 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
6259 if(!exp->expType)
6260 {
6261 exp->expType = op1->type;
6262 if(op1->type)
6263 op1->type->refCount++;
6264 }
6265 return 1;
6266 }
6267
6268 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6269 {
6270 float value2 = op2->__anon1.f;
6271
6272 exp->type = 2;
6273 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
6274 if(!exp->expType)
6275 {
6276 exp->expType = op1->type;
6277 if(op1->type)
6278 op1->type->refCount++;
6279 }
6280 return 1;
6281 }
6282
6283 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6284 {
6285 double value2 = op2->__anon1.d;
6286
6287 exp->type = 2;
6288 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
6289 if(!exp->expType)
6290 {
6291 exp->expType = op1->type;
6292 if(op1->type)
6293 op1->type->refCount++;
6294 }
6295 return 1;
6296 }
6297
6298 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6299 {
6300 int value2 = op2->__anon1.i;
6301
6302 exp->type = 2;
6303 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
6304 if(!exp->expType)
6305 {
6306 exp->expType = op1->type;
6307 if(op1->type)
6308 op1->type->refCount++;
6309 }
6310 return 1;
6311 }
6312
6313 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6314 {
6315 unsigned int value2 = op2->__anon1.ui;
6316
6317 exp->type = 2;
6318 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
6319 if(!exp->expType)
6320 {
6321 exp->expType = op1->type;
6322 if(op1->type)
6323 op1->type->refCount++;
6324 }
6325 return 1;
6326 }
6327
6328 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6329 {
6330 long long value2 = op2->__anon1.i64;
6331
6332 exp->type = 2;
6333 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
6334 if(!exp->expType)
6335 {
6336 exp->expType = op1->type;
6337 if(op1->type)
6338 op1->type->refCount++;
6339 }
6340 return 1;
6341 }
6342
6343 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6344 {
6345 uint64 value2 = op2->__anon1.ui64;
6346
6347 exp->type = 2;
6348 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
6349 if(!exp->expType)
6350 {
6351 exp->expType = op1->type;
6352 if(op1->type)
6353 op1->type->refCount++;
6354 }
6355 return 1;
6356 }
6357
6358 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6359 {
6360 short value2 = op2->__anon1.s;
6361
6362 exp->type = 2;
6363 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
6364 if(!exp->expType)
6365 {
6366 exp->expType = op1->type;
6367 if(op1->type)
6368 op1->type->refCount++;
6369 }
6370 return 1;
6371 }
6372
6373 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6374 {
6375 unsigned short value2 = op2->__anon1.us;
6376
6377 exp->type = 2;
6378 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
6379 if(!exp->expType)
6380 {
6381 exp->expType = op1->type;
6382 if(op1->type)
6383 op1->type->refCount++;
6384 }
6385 return 1;
6386 }
6387
6388 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6389 {
6390 char value2 = op2->__anon1.c;
6391
6392 exp->type = 2;
6393 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
6394 if(!exp->expType)
6395 {
6396 exp->expType = op1->type;
6397 if(op1->type)
6398 op1->type->refCount++;
6399 }
6400 return 1;
6401 }
6402
6403 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6404 {
6405 unsigned char value2 = op2->__anon1.uc;
6406
6407 exp->type = 2;
6408 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
6409 if(!exp->expType)
6410 {
6411 exp->expType = op1->type;
6412 if(op1->type)
6413 op1->type->refCount++;
6414 }
6415 return 1;
6416 }
6417
6418 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6419 {
6420 float value2 = op2->__anon1.f;
6421
6422 exp->type = 2;
6423 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
6424 if(!exp->expType)
6425 {
6426 exp->expType = op1->type;
6427 if(op1->type)
6428 op1->type->refCount++;
6429 }
6430 return 1;
6431 }
6432
6433 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6434 {
6435 double value2 = op2->__anon1.d;
6436
6437 exp->type = 2;
6438 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
6439 if(!exp->expType)
6440 {
6441 exp->expType = op1->type;
6442 if(op1->type)
6443 op1->type->refCount++;
6444 }
6445 return 1;
6446 }
6447
6448 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6449 {
6450 int value2 = op2->__anon1.i;
6451
6452 exp->type = 2;
6453 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
6454 if(!exp->expType)
6455 {
6456 exp->expType = op1->type;
6457 if(op1->type)
6458 op1->type->refCount++;
6459 }
6460 return 1;
6461 }
6462
6463 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6464 {
6465 unsigned int value2 = op2->__anon1.ui;
6466
6467 exp->type = 2;
6468 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
6469 if(!exp->expType)
6470 {
6471 exp->expType = op1->type;
6472 if(op1->type)
6473 op1->type->refCount++;
6474 }
6475 return 1;
6476 }
6477
6478 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6479 {
6480 long long value2 = op2->__anon1.i64;
6481
6482 exp->type = 2;
6483 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
6484 if(!exp->expType)
6485 {
6486 exp->expType = op1->type;
6487 if(op1->type)
6488 op1->type->refCount++;
6489 }
6490 return 1;
6491 }
6492
6493 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6494 {
6495 uint64 value2 = op2->__anon1.ui64;
6496
6497 exp->type = 2;
6498 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
6499 if(!exp->expType)
6500 {
6501 exp->expType = op1->type;
6502 if(op1->type)
6503 op1->type->refCount++;
6504 }
6505 return 1;
6506 }
6507
6508 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6509 {
6510 short value2 = op2->__anon1.s;
6511
6512 exp->type = 2;
6513 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
6514 if(!exp->expType)
6515 {
6516 exp->expType = op1->type;
6517 if(op1->type)
6518 op1->type->refCount++;
6519 }
6520 return 1;
6521 }
6522
6523 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6524 {
6525 unsigned short value2 = op2->__anon1.us;
6526
6527 exp->type = 2;
6528 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
6529 if(!exp->expType)
6530 {
6531 exp->expType = op1->type;
6532 if(op1->type)
6533 op1->type->refCount++;
6534 }
6535 return 1;
6536 }
6537
6538 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6539 {
6540 char value2 = op2->__anon1.c;
6541
6542 exp->type = 2;
6543 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
6544 if(!exp->expType)
6545 {
6546 exp->expType = op1->type;
6547 if(op1->type)
6548 op1->type->refCount++;
6549 }
6550 return 1;
6551 }
6552
6553 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6554 {
6555 unsigned char value2 = op2->__anon1.uc;
6556
6557 exp->type = 2;
6558 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
6559 if(!exp->expType)
6560 {
6561 exp->expType = op1->type;
6562 if(op1->type)
6563 op1->type->refCount++;
6564 }
6565 return 1;
6566 }
6567
6568 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6569 {
6570 float value2 = op2->__anon1.f;
6571
6572 exp->type = 2;
6573 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
6574 if(!exp->expType)
6575 {
6576 exp->expType = op1->type;
6577 if(op1->type)
6578 op1->type->refCount++;
6579 }
6580 return 1;
6581 }
6582
6583 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6584 {
6585 double value2 = op2->__anon1.d;
6586
6587 exp->type = 2;
6588 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
6589 if(!exp->expType)
6590 {
6591 exp->expType = op1->type;
6592 if(op1->type)
6593 op1->type->refCount++;
6594 }
6595 return 1;
6596 }
6597
6598 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6599 {
6600 int value2 = op2->__anon1.i;
6601
6602 exp->type = 2;
6603 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
6604 if(!exp->expType)
6605 {
6606 exp->expType = op1->type;
6607 if(op1->type)
6608 op1->type->refCount++;
6609 }
6610 return 1;
6611 }
6612
6613 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6614 {
6615 unsigned int value2 = op2->__anon1.ui;
6616
6617 exp->type = 2;
6618 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
6619 if(!exp->expType)
6620 {
6621 exp->expType = op1->type;
6622 if(op1->type)
6623 op1->type->refCount++;
6624 }
6625 return 1;
6626 }
6627
6628 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6629 {
6630 long long value2 = op2->__anon1.i64;
6631
6632 exp->type = 2;
6633 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
6634 if(!exp->expType)
6635 {
6636 exp->expType = op1->type;
6637 if(op1->type)
6638 op1->type->refCount++;
6639 }
6640 return 1;
6641 }
6642
6643 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6644 {
6645 uint64 value2 = op2->__anon1.ui64;
6646
6647 exp->type = 2;
6648 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
6649 if(!exp->expType)
6650 {
6651 exp->expType = op1->type;
6652 if(op1->type)
6653 op1->type->refCount++;
6654 }
6655 return 1;
6656 }
6657
6658 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6659 {
6660 short value2 = op2->__anon1.s;
6661
6662 exp->type = 2;
6663 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
6664 if(!exp->expType)
6665 {
6666 exp->expType = op1->type;
6667 if(op1->type)
6668 op1->type->refCount++;
6669 }
6670 return 1;
6671 }
6672
6673 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6674 {
6675 unsigned short value2 = op2->__anon1.us;
6676
6677 exp->type = 2;
6678 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
6679 if(!exp->expType)
6680 {
6681 exp->expType = op1->type;
6682 if(op1->type)
6683 op1->type->refCount++;
6684 }
6685 return 1;
6686 }
6687
6688 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6689 {
6690 char value2 = op2->__anon1.c;
6691
6692 exp->type = 2;
6693 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
6694 if(!exp->expType)
6695 {
6696 exp->expType = op1->type;
6697 if(op1->type)
6698 op1->type->refCount++;
6699 }
6700 return 1;
6701 }
6702
6703 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6704 {
6705 unsigned char value2 = op2->__anon1.uc;
6706
6707 exp->type = 2;
6708 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
6709 if(!exp->expType)
6710 {
6711 exp->expType = op1->type;
6712 if(op1->type)
6713 op1->type->refCount++;
6714 }
6715 return 1;
6716 }
6717
6718 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6719 {
6720 float value2 = op2->__anon1.f;
6721
6722 exp->type = 2;
6723 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
6724 if(!exp->expType)
6725 {
6726 exp->expType = op1->type;
6727 if(op1->type)
6728 op1->type->refCount++;
6729 }
6730 return 1;
6731 }
6732
6733 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6734 {
6735 double value2 = op2->__anon1.d;
6736
6737 exp->type = 2;
6738 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
6739 if(!exp->expType)
6740 {
6741 exp->expType = op1->type;
6742 if(op1->type)
6743 op1->type->refCount++;
6744 }
6745 return 1;
6746 }
6747
6748 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6749 {
6750 int value2 = op2->__anon1.i;
6751
6752 exp->type = 2;
6753 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
6754 if(!exp->expType)
6755 {
6756 exp->expType = op1->type;
6757 if(op1->type)
6758 op1->type->refCount++;
6759 }
6760 return 1;
6761 }
6762
6763 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6764 {
6765 unsigned int value2 = op2->__anon1.ui;
6766
6767 exp->type = 2;
6768 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
6769 if(!exp->expType)
6770 {
6771 exp->expType = op1->type;
6772 if(op1->type)
6773 op1->type->refCount++;
6774 }
6775 return 1;
6776 }
6777
6778 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6779 {
6780 long long value2 = op2->__anon1.i64;
6781
6782 exp->type = 2;
6783 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
6784 if(!exp->expType)
6785 {
6786 exp->expType = op1->type;
6787 if(op1->type)
6788 op1->type->refCount++;
6789 }
6790 return 1;
6791 }
6792
6793 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6794 {
6795 uint64 value2 = op2->__anon1.ui64;
6796
6797 exp->type = 2;
6798 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
6799 if(!exp->expType)
6800 {
6801 exp->expType = op1->type;
6802 if(op1->type)
6803 op1->type->refCount++;
6804 }
6805 return 1;
6806 }
6807
6808 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6809 {
6810 short value2 = op2->__anon1.s;
6811
6812 exp->type = 2;
6813 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
6814 if(!exp->expType)
6815 {
6816 exp->expType = op1->type;
6817 if(op1->type)
6818 op1->type->refCount++;
6819 }
6820 return 1;
6821 }
6822
6823 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6824 {
6825 unsigned short value2 = op2->__anon1.us;
6826
6827 exp->type = 2;
6828 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
6829 if(!exp->expType)
6830 {
6831 exp->expType = op1->type;
6832 if(op1->type)
6833 op1->type->refCount++;
6834 }
6835 return 1;
6836 }
6837
6838 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6839 {
6840 char value2 = op2->__anon1.c;
6841
6842 exp->type = 2;
6843 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
6844 if(!exp->expType)
6845 {
6846 exp->expType = op1->type;
6847 if(op1->type)
6848 op1->type->refCount++;
6849 }
6850 return 1;
6851 }
6852
6853 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6854 {
6855 unsigned char value2 = op2->__anon1.uc;
6856
6857 exp->type = 2;
6858 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
6859 if(!exp->expType)
6860 {
6861 exp->expType = op1->type;
6862 if(op1->type)
6863 op1->type->refCount++;
6864 }
6865 return 1;
6866 }
6867
6868 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6869 {
6870 float value2 = op2->__anon1.f;
6871
6872 exp->type = 2;
6873 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
6874 if(!exp->expType)
6875 {
6876 exp->expType = op1->type;
6877 if(op1->type)
6878 op1->type->refCount++;
6879 }
6880 return 1;
6881 }
6882
6883 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6884 {
6885 double value2 = op2->__anon1.d;
6886
6887 exp->type = 2;
6888 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
6889 if(!exp->expType)
6890 {
6891 exp->expType = op1->type;
6892 if(op1->type)
6893 op1->type->refCount++;
6894 }
6895 return 1;
6896 }
6897
6898 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6899 {
6900 int value2 = op2->__anon1.i;
6901
6902 exp->type = 2;
6903 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
6904 if(!exp->expType)
6905 {
6906 exp->expType = op1->type;
6907 if(op1->type)
6908 op1->type->refCount++;
6909 }
6910 return 1;
6911 }
6912
6913 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6914 {
6915 unsigned int value2 = op2->__anon1.ui;
6916
6917 exp->type = 2;
6918 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
6919 if(!exp->expType)
6920 {
6921 exp->expType = op1->type;
6922 if(op1->type)
6923 op1->type->refCount++;
6924 }
6925 return 1;
6926 }
6927
6928 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6929 {
6930 long long value2 = op2->__anon1.i64;
6931
6932 exp->type = 2;
6933 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
6934 if(!exp->expType)
6935 {
6936 exp->expType = op1->type;
6937 if(op1->type)
6938 op1->type->refCount++;
6939 }
6940 return 1;
6941 }
6942
6943 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6944 {
6945 uint64 value2 = op2->__anon1.ui64;
6946
6947 exp->type = 2;
6948 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
6949 if(!exp->expType)
6950 {
6951 exp->expType = op1->type;
6952 if(op1->type)
6953 op1->type->refCount++;
6954 }
6955 return 1;
6956 }
6957
6958 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6959 {
6960 short value2 = op2->__anon1.s;
6961
6962 exp->type = 2;
6963 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
6964 if(!exp->expType)
6965 {
6966 exp->expType = op1->type;
6967 if(op1->type)
6968 op1->type->refCount++;
6969 }
6970 return 1;
6971 }
6972
6973 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6974 {
6975 unsigned short value2 = op2->__anon1.us;
6976
6977 exp->type = 2;
6978 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
6979 if(!exp->expType)
6980 {
6981 exp->expType = op1->type;
6982 if(op1->type)
6983 op1->type->refCount++;
6984 }
6985 return 1;
6986 }
6987
6988 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6989 {
6990 char value2 = op2->__anon1.c;
6991
6992 exp->type = 2;
6993 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
6994 if(!exp->expType)
6995 {
6996 exp->expType = op1->type;
6997 if(op1->type)
6998 op1->type->refCount++;
6999 }
7000 return 1;
7001 }
7002
7003 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7004 {
7005 unsigned char value2 = op2->__anon1.uc;
7006
7007 exp->type = 2;
7008 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
7009 if(!exp->expType)
7010 {
7011 exp->expType = op1->type;
7012 if(op1->type)
7013 op1->type->refCount++;
7014 }
7015 return 1;
7016 }
7017
7018 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7019 {
7020 float value2 = op2->__anon1.f;
7021
7022 exp->type = 2;
7023 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
7024 if(!exp->expType)
7025 {
7026 exp->expType = op1->type;
7027 if(op1->type)
7028 op1->type->refCount++;
7029 }
7030 return 1;
7031 }
7032
7033 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7034 {
7035 double value2 = op2->__anon1.d;
7036
7037 exp->type = 2;
7038 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
7039 if(!exp->expType)
7040 {
7041 exp->expType = op1->type;
7042 if(op1->type)
7043 op1->type->refCount++;
7044 }
7045 return 1;
7046 }
7047
7048 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7049 {
7050 exp->type = 2;
7051 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
7052 if(!exp->expType)
7053 {
7054 exp->expType = op1->type;
7055 if(op1->type)
7056 op1->type->refCount++;
7057 }
7058 return 1;
7059 }
7060
7061 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7062 {
7063 exp->type = 2;
7064 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
7065 if(!exp->expType)
7066 {
7067 exp->expType = op1->type;
7068 if(op1->type)
7069 op1->type->refCount++;
7070 }
7071 return 1;
7072 }
7073
7074 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7075 {
7076 exp->type = 2;
7077 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
7078 if(!exp->expType)
7079 {
7080 exp->expType = op1->type;
7081 if(op1->type)
7082 op1->type->refCount++;
7083 }
7084 return 1;
7085 }
7086
7087 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7088 {
7089 exp->type = 2;
7090 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
7091 if(!exp->expType)
7092 {
7093 exp->expType = op1->type;
7094 if(op1->type)
7095 op1->type->refCount++;
7096 }
7097 return 1;
7098 }
7099
7100 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7101 {
7102 exp->type = 2;
7103 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
7104 if(!exp->expType)
7105 {
7106 exp->expType = op1->type;
7107 if(op1->type)
7108 op1->type->refCount++;
7109 }
7110 return 1;
7111 }
7112
7113 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7114 {
7115 exp->type = 2;
7116 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
7117 if(!exp->expType)
7118 {
7119 exp->expType = op1->type;
7120 if(op1->type)
7121 op1->type->refCount++;
7122 }
7123 return 1;
7124 }
7125
7126 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7127 {
7128 exp->type = 2;
7129 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
7130 if(!exp->expType)
7131 {
7132 exp->expType = op1->type;
7133 if(op1->type)
7134 op1->type->refCount++;
7135 }
7136 return 1;
7137 }
7138
7139 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7140 {
7141 exp->type = 2;
7142 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
7143 if(!exp->expType)
7144 {
7145 exp->expType = op1->type;
7146 if(op1->type)
7147 op1->type->refCount++;
7148 }
7149 return 1;
7150 }
7151
7152 static void PrintName(struct Type * type, char * string, unsigned int fullName)
7153 {
7154 if(type->name && type->name[0])
7155 {
7156 if(fullName)
7157 strcat(string, type->name);
7158 else
7159 {
7160 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
7161
7162 if(name)
7163 name += 2;
7164 else
7165 name = type->name;
7166 strcat(string, name);
7167 }
7168 }
7169 }
7170
7171 static void PrintAttribs(struct Type * type, char * string)
7172 {
7173 if(type)
7174 {
7175 if(type->dllExport)
7176 strcat(string, "dllexport ");
7177 if(type->attrStdcall)
7178 strcat(string, "stdcall ");
7179 }
7180 }
7181
7182 static struct Type * FindMember(struct Type * type, char * string)
7183 {
7184 struct Type * memberType;
7185
7186 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7187 {
7188 if(!memberType->name)
7189 {
7190 struct Type * subType = FindMember(memberType, string);
7191
7192 if(subType)
7193 return subType;
7194 }
7195 else if(!strcmp(memberType->name, string))
7196 return memberType;
7197 }
7198 return (((void *)0));
7199 }
7200
7201 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
7202
7203 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
7204
7205 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
7206 {
7207 unsigned int result = 0;
7208
7209 switch(kind)
7210 {
7211 case 2:
7212 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
7213 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
7214 break;
7215 case 3:
7216 case 5:
7217 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
7218 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7219 break;
7220 case 4:
7221 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)
7222 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7223 break;
7224 case 6:
7225 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)
7226 result = GetOpFloat(op, &op->__anon1.f);
7227 break;
7228 case 7:
7229 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)
7230 result = GetOpDouble(op, &op->__anon1.d);
7231 break;
7232 case 13:
7233 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)
7234 result = GetOpUInt64(op, &op->__anon1.ui64);
7235 break;
7236 case 15:
7237 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)
7238 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7239 break;
7240 case 22:
7241 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7242 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7243 break;
7244 case 23:
7245 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7246 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7247 break;
7248 }
7249 return result;
7250 }
7251
7252 struct OpTable floatOps =
7253 {
7254 (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)
7255 };
7256
7257 struct OpTable doubleOps =
7258 {
7259 (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)
7260 };
7261
7262 struct OpTable intOps =
7263 {
7264 (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)
7265 };
7266
7267 struct OpTable uintOps =
7268 {
7269 (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)
7270 };
7271
7272 struct OpTable int64Ops =
7273 {
7274 (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)
7275 };
7276
7277 struct OpTable uint64Ops =
7278 {
7279 (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)
7280 };
7281
7282 struct OpTable shortOps =
7283 {
7284 (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)
7285 };
7286
7287 struct OpTable ushortOps =
7288 {
7289 (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)
7290 };
7291
7292 struct OpTable charOps =
7293 {
7294 (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)
7295 };
7296
7297 struct OpTable ucharOps =
7298 {
7299 (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)
7300 };
7301
7302 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
7303 {
7304 struct Type * memberType;
7305
7306 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7307 {
7308 if(!memberType->name)
7309 {
7310 struct Type * subType = FindMember(memberType, string);
7311
7312 if(subType)
7313 {
7314 *offset += memberType->offset;
7315 return subType;
7316 }
7317 }
7318 else if(!strcmp(memberType->name, string))
7319 {
7320 *offset += memberType->offset;
7321 return memberType;
7322 }
7323 }
7324 return (((void *)0));
7325 }
7326
7327 struct __ecereNameSpace__ecere__com__Module;
7328
7329 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);
7330
7331 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
7332
7333 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);
7334
7335 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);
7336
7337 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
7338
7339 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7340
7341 struct GlobalData
7342 {
7343 uintptr_t key;
7344 struct __ecereNameSpace__ecere__sys__BTNode * parent;
7345 struct __ecereNameSpace__ecere__sys__BTNode * left;
7346 struct __ecereNameSpace__ecere__sys__BTNode * right;
7347 int depth;
7348 struct __ecereNameSpace__ecere__com__Instance * module;
7349 char *  dataTypeString;
7350 struct Type * dataType;
7351 void *  symbol;
7352 char *  fullName;
7353 } __attribute__ ((gcc_struct));
7354
7355 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);
7356
7357 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
7358
7359 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);
7360
7361 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
7362
7363 struct __ecereNameSpace__ecere__com__DefinedExpression;
7364
7365 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7366
7367 struct __ecereNameSpace__ecere__com__DefinedExpression
7368 {
7369 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
7370 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
7371 const char *  name;
7372 const char *  value;
7373 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7374 } __attribute__ ((gcc_struct));
7375
7376 struct __ecereNameSpace__ecere__sys__BinaryTree;
7377
7378 struct __ecereNameSpace__ecere__sys__BinaryTree
7379 {
7380 struct __ecereNameSpace__ecere__sys__BTNode * root;
7381 int count;
7382 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
7383 void (*  FreeKey)(void *  key);
7384 } __attribute__ ((gcc_struct));
7385
7386 struct __ecereNameSpace__ecere__com__Class
7387 {
7388 struct __ecereNameSpace__ecere__com__Class * prev;
7389 struct __ecereNameSpace__ecere__com__Class * next;
7390 const char *  name;
7391 int offset;
7392 int structSize;
7393 void * *  _vTbl;
7394 int vTblSize;
7395 unsigned int (*  Constructor)(void * );
7396 void (*  Destructor)(void * );
7397 int offsetClass;
7398 int sizeClass;
7399 struct __ecereNameSpace__ecere__com__Class * base;
7400 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
7401 struct __ecereNameSpace__ecere__sys__BinaryTree members;
7402 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
7403 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
7404 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
7405 struct __ecereNameSpace__ecere__sys__OldList derivatives;
7406 int memberID;
7407 int startMemberID;
7408 int type;
7409 struct __ecereNameSpace__ecere__com__Instance * module;
7410 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7411 const char *  dataTypeString;
7412 struct Type * dataType;
7413 int typeSize;
7414 int defaultAlignment;
7415 void (*  Initialize)();
7416 int memberOffset;
7417 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
7418 const char *  designerClass;
7419 unsigned int noExpansion;
7420 const char *  defaultProperty;
7421 unsigned int comRedefinition;
7422 int count;
7423 int isRemote;
7424 unsigned int internalDecl;
7425 void *  data;
7426 unsigned int computeSize;
7427 short structAlignment;
7428 short pointerAlignment;
7429 int destructionWatchOffset;
7430 unsigned int fixed;
7431 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
7432 int inheritanceAccess;
7433 const char *  fullName;
7434 void *  symbol;
7435 struct __ecereNameSpace__ecere__sys__OldList conversions;
7436 struct __ecereNameSpace__ecere__sys__OldList templateParams;
7437 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
7438 struct __ecereNameSpace__ecere__com__Class * templateClass;
7439 struct __ecereNameSpace__ecere__sys__OldList templatized;
7440 int numParams;
7441 unsigned int isInstanceClass;
7442 unsigned int byValueSystemClass;
7443 } __attribute__ ((gcc_struct));
7444
7445 struct __ecereNameSpace__ecere__com__NameSpace
7446 {
7447 const char *  name;
7448 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
7449 struct __ecereNameSpace__ecere__com__NameSpace *  left;
7450 struct __ecereNameSpace__ecere__com__NameSpace *  right;
7451 int depth;
7452 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
7453 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
7454 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
7455 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
7456 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
7457 } __attribute__ ((gcc_struct));
7458
7459 struct __ecereNameSpace__ecere__com__DataMember
7460 {
7461 struct __ecereNameSpace__ecere__com__DataMember * prev;
7462 struct __ecereNameSpace__ecere__com__DataMember * next;
7463 const char *  name;
7464 unsigned int isProperty;
7465 int memberAccess;
7466 int id;
7467 struct __ecereNameSpace__ecere__com__Class * _class;
7468 const char *  dataTypeString;
7469 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
7470 struct Type * dataType;
7471 int type;
7472 int offset;
7473 int memberID;
7474 struct __ecereNameSpace__ecere__sys__OldList members;
7475 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
7476 int memberOffset;
7477 short structAlignment;
7478 short pointerAlignment;
7479 } __attribute__ ((gcc_struct));
7480
7481 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7482
7483 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7484
7485 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
7486
7487 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7488
7489 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7490
7491 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
7492
7493 static void _DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl)
7494 {
7495 if(inCompiler)
7496 {
7497 if(type->kind == 11)
7498 {
7499 struct Type * param;
7500
7501 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
7502 _DeclareType(neededFor, param, forFunctionDef, 0, fwdDecl);
7503 _DeclareType(neededFor, type->__anon1.__anon2.returnType, forFunctionDef, 0, fwdDecl);
7504 }
7505 else if(type->kind == 13)
7506 _DeclareType(neededFor, type->__anon1.type, 0, 0, fwdDecl);
7507 else if(type->kind == 8)
7508 {
7509 struct __ecereNameSpace__ecere__com__Class * c = type->__anon1._class->__anon1.registered;
7510
7511 _DeclareStruct(neededFor, c ? c->fullName : "ecere::com::Instance", c ? c->type == 5 : 0, needDereference && c && c->type == 1, fwdDecl);
7512 }
7513 else if(type->kind == 9 || type->kind == 10)
7514 {
7515 struct Type * member;
7516
7517 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7518 _DeclareType(neededFor, member, needDereference, forFunctionDef, fwdDecl);
7519 }
7520 else if(type->kind == 12)
7521 _DeclareType(neededFor, type->__anon1.__anon4.arrayType, 1, 0, fwdDecl);
7522 }
7523 }
7524
7525 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
7526 {
7527 unsigned int status = 1;
7528
7529 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))
7530 {
7531 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
7532 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
7533
7534 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
7535 {
7536 struct Type * sourceType = source, * destType = dest;
7537
7538 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
7539 sourceType = sourceType->__anon1.type;
7540 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
7541 destType = destType->__anon1.type;
7542 if(!destType->constant && sourceType->constant)
7543 {
7544 status = 0;
7545 if(warn)
7546 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
7547 }
7548 }
7549 }
7550 return status;
7551 }
7552
7553 struct Operand GetOperand(struct Expression * exp)
7554 {
7555 struct Operand op =
7556 {
7557 0, 0, 0,
7558 .__anon1 = {
7559 .c = 0
7560 },
7561 {
7562 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7563 }
7564 };
7565 struct Type * type = exp->expType;
7566
7567 if(type)
7568 {
7569 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))
7570 {
7571 if(!type->__anon1._class->__anon1.registered->dataType)
7572 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7573 type = type->__anon1._class->__anon1.registered->dataType;
7574 }
7575 if(exp->type == 3 && op.kind == 13)
7576 {
7577 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
7578 op.kind = 13;
7579 op.ops = uint64Ops;
7580 }
7581 else if(exp->isConstant && exp->type == 2)
7582 {
7583 op.kind = type->kind;
7584 op.type = type;
7585 switch(op.kind)
7586 {
7587 case 24:
7588 case 1:
7589 {
7590 if(exp->__anon1.__anon1.constant[0] == '\'')
7591 {
7592 op.__anon1.c = exp->__anon1.__anon1.constant[1];
7593 op.ops = charOps;
7594 }
7595 else if(type->isSigned)
7596 {
7597 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7598 op.ops = charOps;
7599 }
7600 else
7601 {
7602 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7603 op.ops = ucharOps;
7604 }
7605 break;
7606 }
7607 case 2:
7608 if(type->isSigned)
7609 {
7610 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7611 op.ops = shortOps;
7612 }
7613 else
7614 {
7615 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7616 op.ops = ushortOps;
7617 }
7618 break;
7619 case 3:
7620 case 5:
7621 if(type->isSigned)
7622 {
7623 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7624 op.ops = intOps;
7625 }
7626 else
7627 {
7628 op.__anon1.ui = (unsigned int)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7629 op.ops = uintOps;
7630 }
7631 op.kind = 3;
7632 break;
7633 case 4:
7634 if(type->isSigned)
7635 {
7636 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7637 op.ops = int64Ops;
7638 }
7639 else
7640 {
7641 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7642 op.ops = uint64Ops;
7643 }
7644 op.kind = 4;
7645 break;
7646 case 22:
7647 if(type->isSigned)
7648 {
7649 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7650 op.ops = int64Ops;
7651 }
7652 else
7653 {
7654 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7655 op.ops = uint64Ops;
7656 }
7657 op.kind = 4;
7658 break;
7659 case 23:
7660 if(type->isSigned)
7661 {
7662 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7663 op.ops = int64Ops;
7664 }
7665 else
7666 {
7667 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7668 op.ops = uint64Ops;
7669 }
7670 op.kind = 4;
7671 break;
7672 case 6:
7673 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7674 op.__anon1.f = __ecereMethod_float_inf();
7675 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7676 op.__anon1.f = -__ecereMethod_float_inf();
7677 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7678 op.__anon1.f = __ecereMethod_float_nan();
7679 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7680 op.__anon1.f = -__ecereMethod_float_nan();
7681 else
7682 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7683 op.ops = floatOps;
7684 break;
7685 case 7:
7686 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7687 op.__anon1.d = __ecereMethod_double_inf();
7688 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7689 op.__anon1.d = -__ecereMethod_double_inf();
7690 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7691 op.__anon1.d = __ecereMethod_double_nan();
7692 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7693 op.__anon1.d = -__ecereMethod_double_nan();
7694 else
7695 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7696 op.ops = doubleOps;
7697 break;
7698 case 12:
7699 case 13:
7700 case 8:
7701 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7702 op.kind = 13;
7703 op.ops = uint64Ops;
7704 break;
7705 }
7706 }
7707 }
7708 return op;
7709 }
7710
7711 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
7712 {
7713 long long v = 0;
7714
7715 switch(_class->typeSize)
7716 {
7717 case 8:
7718 if(!strcmp(_class->dataTypeString, "uint64"))
7719 v = (long long)*(uint64 *)ptr;
7720 else
7721 v = *(long long *)ptr;
7722 break;
7723 case 4:
7724 if(!strcmp(_class->dataTypeString, "uint"))
7725 v = (long long)*(unsigned int *)ptr;
7726 else
7727 v = (long long)*(int *)ptr;
7728 break;
7729 case 2:
7730 if(!strcmp(_class->dataTypeString, "uint16"))
7731 v = (long long)*(unsigned short *)ptr;
7732 else
7733 v = (long long)*(short *)ptr;
7734 break;
7735 case 1:
7736 if(!strcmp(_class->dataTypeString, "byte"))
7737 v = (long long)*(unsigned char *)ptr;
7738 else
7739 v = (long long)*(char *)ptr;
7740 break;
7741 }
7742 return v;
7743 }
7744
7745 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
7746 {
7747 if(!type->isSigned && type->kind != 22 && type->kind != 23)
7748 ListAdd(specs, MkSpecifier(UNSIGNED));
7749 switch(type->kind)
7750 {
7751 case 8:
7752 {
7753 if(type->__anon1._class->__anon1.registered)
7754 {
7755 if(!type->__anon1._class->__anon1.registered->dataType)
7756 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7757 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
7758 }
7759 break;
7760 }
7761 case 7:
7762 ListAdd(specs, MkSpecifier(DOUBLE));
7763 break;
7764 case 6:
7765 ListAdd(specs, MkSpecifier(FLOAT));
7766 break;
7767 case 1:
7768 ListAdd(specs, MkSpecifier(CHAR));
7769 break;
7770 case 24:
7771 ListAdd(specs, MkSpecifier(_BOOL));
7772 break;
7773 case 2:
7774 ListAdd(specs, MkSpecifier(SHORT));
7775 break;
7776 case 4:
7777 ListAdd(specs, MkSpecifier(INT64));
7778 break;
7779 case 22:
7780 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
7781 break;
7782 case 23:
7783 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
7784 break;
7785 case 3:
7786 default:
7787 ListAdd(specs, MkSpecifier(INT));
7788 break;
7789 }
7790 }
7791
7792 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
7793 {
7794 if(type)
7795 {
7796 if(printConst && type->constant)
7797 strcat(string, "const ");
7798 switch(type->kind)
7799 {
7800 case 8:
7801 {
7802 struct Symbol * c = type->__anon1._class;
7803 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
7804
7805 if(type->classObjectType == 2 && isObjectBaseClass)
7806 strcat(string, "typed_object");
7807 else if(type->classObjectType == 3 && isObjectBaseClass)
7808 strcat(string, "any_object");
7809 else
7810 {
7811 if(c && c->string)
7812 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
7813 }
7814 if(type->byReference)
7815 strcat(string, " &");
7816 break;
7817 }
7818 case 0:
7819 strcat(string, "void");
7820 break;
7821 case 3:
7822 strcat(string, type->isSigned ? "int" : "uint");
7823 break;
7824 case 4:
7825 strcat(string, type->isSigned ? "int64" : "uint64");
7826 break;
7827 case 22:
7828 strcat(string, type->isSigned ? "intptr" : "uintptr");
7829 break;
7830 case 23:
7831 strcat(string, type->isSigned ? "intsize" : "uintsize");
7832 break;
7833 case 1:
7834 strcat(string, type->isSigned ? "char" : "byte");
7835 break;
7836 case 24:
7837 strcat(string, "_Bool");
7838 break;
7839 case 2:
7840 strcat(string, type->isSigned ? "short" : "uint16");
7841 break;
7842 case 6:
7843 strcat(string, "float");
7844 break;
7845 case 7:
7846 strcat(string, "double");
7847 break;
7848 case 9:
7849 if(type->__anon1.__anon1.enumName)
7850 {
7851 strcat(string, "struct ");
7852 strcat(string, type->__anon1.__anon1.enumName);
7853 }
7854 else if(type->typeName)
7855 strcat(string, type->typeName);
7856 else
7857 {
7858 struct Type * member;
7859
7860 strcat(string, "struct { ");
7861 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7862 {
7863 PrintType(member, string, 1, fullName);
7864 strcat(string, "; ");
7865 }
7866 strcat(string, "}");
7867 }
7868 break;
7869 case 10:
7870 if(type->__anon1.__anon1.enumName)
7871 {
7872 strcat(string, "union ");
7873 strcat(string, type->__anon1.__anon1.enumName);
7874 }
7875 else if(type->typeName)
7876 strcat(string, type->typeName);
7877 else
7878 {
7879 strcat(string, "union ");
7880 strcat(string, "(unnamed)");
7881 }
7882 break;
7883 case 15:
7884 if(type->__anon1.__anon1.enumName)
7885 {
7886 strcat(string, "enum ");
7887 strcat(string, type->__anon1.__anon1.enumName);
7888 }
7889 else if(type->typeName)
7890 strcat(string, type->typeName);
7891 else
7892 strcat(string, "int");
7893 break;
7894 case 14:
7895 strcat(string, "...");
7896 break;
7897 case 19:
7898 strcat(string, "subclass(");
7899 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
7900 strcat(string, ")");
7901 break;
7902 case 20:
7903 strcat(string, type->__anon1.templateParameter->identifier->string);
7904 break;
7905 case 21:
7906 strcat(string, "thisclass");
7907 break;
7908 case 17:
7909 strcat(string, "__builtin_va_list");
7910 break;
7911 }
7912 }
7913 }
7914
7915 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
7916
7917 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
7918
7919 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
7920
7921 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
7922
7923 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
7924
7925 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
7926
7927 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
7928
7929 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
7930
7931 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
7932
7933 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
7934
7935 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
7936
7937 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
7938
7939 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
7940
7941 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
7942
7943 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
7944
7945 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
7946
7947 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
7948
7949 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
7950
7951 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
7952
7953 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
7954
7955 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
7956
7957 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
7958
7959 struct __ecereNameSpace__ecere__com__Application
7960 {
7961 int argc;
7962 const char * *  argv;
7963 int exitCode;
7964 unsigned int isGUIApp;
7965 struct __ecereNameSpace__ecere__sys__OldList allModules;
7966 char *  parsedCommand;
7967 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
7968 } __attribute__ ((gcc_struct));
7969
7970 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)
7971 {
7972 if(*curMember)
7973 {
7974 *curMember = (*curMember)->next;
7975 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
7976 {
7977 *curMember = subMemberStack[--(*subMemberStackPos)];
7978 *curMember = (*curMember)->next;
7979 }
7980 while((*curMember) && (*curMember)->isProperty)
7981 *curMember = (*curMember)->next;
7982 if(subMemberStackPos)
7983 {
7984 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
7985 {
7986 subMemberStack[(*subMemberStackPos)++] = *curMember;
7987 *curMember = (*curMember)->members.first;
7988 while(*curMember && (*curMember)->isProperty)
7989 *curMember = (*curMember)->next;
7990 }
7991 }
7992 }
7993 while(!*curMember)
7994 {
7995 if(!*curMember)
7996 {
7997 if(subMemberStackPos && *subMemberStackPos)
7998 {
7999 *curMember = subMemberStack[--(*subMemberStackPos)];
8000 *curMember = (*curMember)->next;
8001 }
8002 else
8003 {
8004 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
8005
8006 if(*curClass == _class)
8007 break;
8008 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
8009 ;
8010 *curMember = (*curClass)->membersAndProperties.first;
8011 }
8012 while((*curMember) && (*curMember)->isProperty)
8013 *curMember = (*curMember)->next;
8014 if(subMemberStackPos)
8015 {
8016 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8017 {
8018 subMemberStack[(*subMemberStackPos)++] = *curMember;
8019 *curMember = (*curMember)->members.first;
8020 while(*curMember && (*curMember)->isProperty)
8021 *curMember = (*curMember)->next;
8022 }
8023 }
8024 }
8025 }
8026 }
8027
8028 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
8029 {
8030 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
8031 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
8032 struct __ecereNameSpace__ecere__com__NameSpace * child;
8033
8034 if(!data)
8035 {
8036 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)))
8037 {
8038 data = ScanGlobalData(child, name);
8039 if(data)
8040 break;
8041 }
8042 }
8043 return data;
8044 }
8045
8046 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
8047 {
8048 int nsLen = strlen(nameSpace);
8049 struct Symbol * symbol;
8050
8051 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)))
8052 {
8053 char * s = symbol->string;
8054
8055 if(!strncmp(s, nameSpace, nsLen))
8056 {
8057 int c;
8058 char * namePart;
8059
8060 for(c = strlen(s) - 1; c >= 0; c--)
8061 if(s[c] == ':')
8062 break;
8063 namePart = s + c + 1;
8064 if(!strcmp(namePart, name))
8065 {
8066 return symbol;
8067 }
8068 }
8069 else
8070 break;
8071 }
8072 return (((void *)0));
8073 }
8074
8075 unsigned int GetInt(struct Expression * exp, int * value2)
8076 {
8077 struct Operand op2 = GetOperand(exp);
8078
8079 return GetOpInt(&op2, value2);
8080 }
8081
8082 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
8083 {
8084 struct Operand op2 = GetOperand(exp);
8085
8086 return GetOpUInt(&op2, value2);
8087 }
8088
8089 unsigned int GetInt64(struct Expression * exp, long long * value2)
8090 {
8091 struct Operand op2 = GetOperand(exp);
8092
8093 return GetOpInt64(&op2, value2);
8094 }
8095
8096 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
8097 {
8098 struct Operand op2 = GetOperand(exp);
8099
8100 return GetOpUInt64(&op2, value2);
8101 }
8102
8103 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
8104 {
8105 struct Operand op2 = GetOperand(exp);
8106
8107 return GetOpIntPtr(&op2, value2);
8108 }
8109
8110 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
8111 {
8112 struct Operand op2 = GetOperand(exp);
8113
8114 return GetOpUIntPtr(&op2, value2);
8115 }
8116
8117 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
8118 {
8119 struct Operand op2 = GetOperand(exp);
8120
8121 return GetOpIntSize(&op2, value2);
8122 }
8123
8124 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
8125 {
8126 struct Operand op2 = GetOperand(exp);
8127
8128 return GetOpUIntSize(&op2, value2);
8129 }
8130
8131 unsigned int GetShort(struct Expression * exp, short * value2)
8132 {
8133 struct Operand op2 = GetOperand(exp);
8134
8135 return GetOpShort(&op2, value2);
8136 }
8137
8138 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
8139 {
8140 struct Operand op2 = GetOperand(exp);
8141
8142 return GetOpUShort(&op2, value2);
8143 }
8144
8145 unsigned int GetChar(struct Expression * exp, char * value2)
8146 {
8147 struct Operand op2 = GetOperand(exp);
8148
8149 return GetOpChar(&op2, value2);
8150 }
8151
8152 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
8153 {
8154 struct Operand op2 = GetOperand(exp);
8155
8156 return GetOpUChar(&op2, value2);
8157 }
8158
8159 unsigned int GetFloat(struct Expression * exp, float * value2)
8160 {
8161 struct Operand op2 = GetOperand(exp);
8162
8163 return GetOpFloat(&op2, value2);
8164 }
8165
8166 unsigned int GetDouble(struct Expression * exp, double * value2)
8167 {
8168 struct Operand op2 = GetOperand(exp);
8169
8170 return GetOpDouble(&op2, value2);
8171 }
8172
8173 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
8174 {
8175 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8176 {
8177 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
8178 PrintAttribs(type, string);
8179 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
8180 strcat(string, " const");
8181 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
8182 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8183 strcat(string, " (");
8184 if(type->kind == 13)
8185 {
8186 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
8187 PrintAttribs(type->__anon1.type, string);
8188 }
8189 if(type->kind == 13)
8190 {
8191 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
8192 strcat(string, "*");
8193 else
8194 strcat(string, " *");
8195 }
8196 if(printConst && type->constant && type->kind == 13)
8197 strcat(string, " const");
8198 }
8199 else
8200 PrintTypeSpecs(type, string, fullName, printConst);
8201 }
8202
8203 void PrintExpression(struct Expression * exp, char * string)
8204 {
8205 {
8206 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8207 int count;
8208 unsigned int backOutputLineNumbers = outputLineNumbers;
8209
8210 outputLineNumbers = 0;
8211 if(exp)
8212 OutputExpression(exp, f);
8213 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8214 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8215
8216 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8217 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
8218 count = strlen(string);
8219 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8220 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8221
8222 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8223 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
8224 string[count] = '\0';
8225 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
8226 outputLineNumbers = backOutputLineNumbers;
8227 }
8228 }
8229
8230 struct Type * Dereference(struct Type * source)
8231 {
8232 struct Type * type = (((void *)0));
8233
8234 if(source)
8235 {
8236 if(source->kind == 13 || source->kind == 12)
8237 {
8238 type = source->__anon1.type;
8239 source->__anon1.type->refCount++;
8240 }
8241 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
8242 {
8243 type = __extension__ ({
8244 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8245
8246 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
8247 });
8248 }
8249 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
8250 {
8251 type = source;
8252 source->refCount++;
8253 }
8254 else
8255 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
8256 }
8257 return type;
8258 }
8259
8260 static struct Type * Reference(struct Type * source)
8261 {
8262 struct Type * type = (((void *)0));
8263
8264 if(source)
8265 {
8266 type = __extension__ ({
8267 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8268
8269 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
8270 });
8271 source->refCount++;
8272 }
8273 return type;
8274 }
8275
8276 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
8277 {
8278 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
8279
8280 FreeExpContents(checkedExp);
8281 FreeType(checkedExp->expType);
8282 FreeType(checkedExp->destType);
8283 *checkedExp = *newExp;
8284 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
8285 checkedExp->prev = prev;
8286 checkedExp->next = next;
8287 }
8288
8289 void FinishTemplatesContext(struct Context * context)
8290 {
8291 PopContext(context);
8292 FreeContext(context);
8293 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
8294 }
8295
8296 static __attribute__((unused)) void UnusedFunction()
8297 {
8298 int a;
8299
8300 ((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);
8301 }
8302
8303 struct Expression * ParseExpressionString(char * expression)
8304 {
8305 parseError = 0;
8306 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8307 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8308 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8309
8310 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8311 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
8312 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8313 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8314
8315 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8316 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
8317 echoOn = 0;
8318 parsedExpression = (((void *)0));
8319 resetScanner();
8320 expression_yyparse();
8321 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
8322 return parsedExpression;
8323 }
8324
8325 struct __ecereNameSpace__ecere__com__Module
8326 {
8327 struct __ecereNameSpace__ecere__com__Instance * application;
8328 struct __ecereNameSpace__ecere__sys__OldList classes;
8329 struct __ecereNameSpace__ecere__sys__OldList defines;
8330 struct __ecereNameSpace__ecere__sys__OldList functions;
8331 struct __ecereNameSpace__ecere__sys__OldList modules;
8332 struct __ecereNameSpace__ecere__com__Instance * prev;
8333 struct __ecereNameSpace__ecere__com__Instance * next;
8334 const char *  name;
8335 void *  library;
8336 void *  Unload;
8337 int importType;
8338 int origImportType;
8339 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
8340 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
8341 } __attribute__ ((gcc_struct));
8342
8343 static struct GlobalData * FindGlobalData(char * name)
8344 {
8345 int start = 0, c;
8346 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
8347
8348 nameSpace = globalData;
8349 for(c = 0; name[c]; c++)
8350 {
8351 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
8352 {
8353 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
8354 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
8355
8356 strncpy(spaceName, name + start, c - start);
8357 spaceName[c - start] = '\0';
8358 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
8359 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
8360 if(!newSpace)
8361 return (((void *)0));
8362 nameSpace = newSpace;
8363 if(name[c] == ':')
8364 c++;
8365 start = c + 1;
8366 }
8367 }
8368 if(c - start)
8369 {
8370 return ScanGlobalData(nameSpace, name + start);
8371 }
8372 return (((void *)0));
8373 }
8374
8375 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
8376 {
8377 int c;
8378 char nameSpace[1024];
8379 const char * namePart;
8380 unsigned int gotColon = 0;
8381
8382 nameSpace[0] = '\0';
8383 for(c = strlen(name) - 1; c >= 0; c--)
8384 if(name[c] == ':')
8385 {
8386 gotColon = 1;
8387 break;
8388 }
8389 namePart = name + c + 1;
8390 while(c >= 0 && name[c] == ':')
8391 c--;
8392 if(c >= 0)
8393 {
8394 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
8395
8396 if(symbol)
8397 return symbol;
8398 memcpy(nameSpace, name, c + 1);
8399 nameSpace[c + 1] = (char)0;
8400 return ScanWithNameSpace(tree, nameSpace, namePart);
8401 }
8402 else if(gotColon)
8403 {
8404 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8405
8406 return symbol;
8407 }
8408 else
8409 {
8410 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8411
8412 if(symbol)
8413 return symbol;
8414 return ScanWithNameSpace(tree, "", namePart);
8415 }
8416 return (((void *)0));
8417 }
8418
8419 static void PrintArraySize(struct Type * arrayType, char * string)
8420 {
8421 char size[256];
8422
8423 size[0] = '\0';
8424 strcat(size, "[");
8425 if(arrayType->__anon1.__anon4.enumClass)
8426 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
8427 else if(arrayType->__anon1.__anon4.arraySizeExp)
8428 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
8429 strcat(size, "]");
8430 strcat(string, size);
8431 }
8432
8433 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
8434 {
8435
8436 }
8437
8438 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
8439 {
8440 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8441 strcat(string, ")");
8442 if(type->kind == 12)
8443 PrintArraySize(type, string);
8444 else if(type->kind == 11)
8445 {
8446 struct Type * param;
8447
8448 strcat(string, "(");
8449 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
8450 {
8451 PrintType(param, string, 1, fullName);
8452 if(param->next)
8453 strcat(string, ", ");
8454 }
8455 strcat(string, ")");
8456 }
8457 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8458 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
8459 }
8460
8461 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
8462 {
8463 PrePrintType(type, string, fullName, (((void *)0)), printConst);
8464 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
8465 strcat(string, " ");
8466 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
8467 {
8468 struct Symbol * _class = type->__anon1.__anon2.thisClass;
8469
8470 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
8471 {
8472 if(type->classObjectType == 1)
8473 strcat(string, "class");
8474 else
8475 strcat(string, type->byReference ? "typed_object&" : "typed_object");
8476 }
8477 else if(_class && _class->string)
8478 {
8479 char * s = _class->string;
8480
8481 if(fullName)
8482 strcat(string, s);
8483 else
8484 {
8485 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
8486
8487 if(name)
8488 name += 2;
8489 else
8490 name = s;
8491 strcat(string, name);
8492 }
8493 }
8494 strcat(string, "::");
8495 }
8496 if(printName && type->name)
8497 PrintName(type, string, fullName);
8498 PostPrintType(type, string, fullName);
8499 if(type->bitFieldCount)
8500 {
8501 char count[100];
8502
8503 sprintf(count, ":%d", type->bitFieldCount);
8504 strcat(string, count);
8505 }
8506 }
8507
8508 struct Conversion;
8509
8510 struct Conversion
8511 {
8512 struct Conversion * prev, * next;
8513 struct __ecereNameSpace__ecere__com__Property * convert;
8514 unsigned int isGet;
8515 struct Type * resultType;
8516 } __attribute__ ((gcc_struct));
8517
8518 static void FreeConvert(struct Conversion * convert)
8519 {
8520 if(convert->resultType)
8521 FreeType(convert->resultType);
8522 }
8523
8524 struct Enumerator;
8525
8526 struct Enumerator
8527 {
8528 struct Enumerator * prev;
8529 struct Enumerator * next;
8530 struct Location loc;
8531 struct Identifier * id;
8532 struct Expression * exp;
8533 } __attribute__ ((gcc_struct));
8534
8535 struct AsmField;
8536
8537 struct AsmField
8538 {
8539 struct AsmField * prev;
8540 struct AsmField * next;
8541 struct Location loc;
8542 char *  command;
8543 struct Expression * expression;
8544 struct Identifier * symbolic;
8545 } __attribute__ ((gcc_struct));
8546
8547 struct ClassDefinition;
8548
8549 struct Context
8550 {
8551 struct Context * parent;
8552 struct __ecereNameSpace__ecere__sys__BinaryTree types;
8553 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
8554 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
8555 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
8556 int nextID;
8557 int simpleID;
8558 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
8559 struct ClassDefinition * classDef;
8560 unsigned int templateTypesOnly;
8561 unsigned int hasNameSpace;
8562 } __attribute__ ((gcc_struct));
8563
8564 struct External
8565 {
8566 struct External * prev;
8567 struct External * next;
8568 struct Location loc;
8569 int type;
8570 struct Symbol * symbol;
8571 union
8572 {
8573 struct FunctionDefinition * function;
8574 struct ClassDefinition * _class;
8575 struct Declaration * declaration;
8576 char *  importString;
8577 struct Identifier * id;
8578 struct DBTableDef * table;
8579 } __attribute__ ((gcc_struct)) __anon1;
8580 int importType;
8581 struct External * fwdDecl;
8582 struct __ecereNameSpace__ecere__com__Instance * outgoing;
8583 struct __ecereNameSpace__ecere__com__Instance * incoming;
8584 int nonBreakableIncoming;
8585 } __attribute__ ((gcc_struct));
8586
8587 struct ClassDefinition
8588 {
8589 struct ClassDefinition * prev;
8590 struct ClassDefinition * next;
8591 struct Location loc;
8592 struct Specifier * _class;
8593 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
8594 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
8595 struct Symbol * symbol;
8596 struct Location blockStart;
8597 struct Location nameLoc;
8598 int declMode;
8599 unsigned int deleteWatchable;
8600 } __attribute__ ((gcc_struct));
8601
8602 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
8603
8604 void __ecereMethod_External_CreateEdge(struct External * this, struct External * from, unsigned int soft);
8605
8606 void DeclareGlobalData(struct External * neededFor, struct GlobalData * data)
8607 {
8608 struct Symbol * symbol = data->symbol;
8609
8610 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
8611 {
8612 if(inCompiler)
8613 {
8614 if(!symbol)
8615 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
8616 }
8617 if(!data->dataType)
8618 data->dataType = ProcessTypeString(data->dataTypeString, 0);
8619 if(inCompiler)
8620 {
8621 struct Declaration * decl;
8622 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
8623 struct Declarator * d;
8624 struct External * external;
8625
8626 specifiers = MkList();
8627 declarators = MkList();
8628 ListAdd(specifiers, MkSpecifier(EXTERN));
8629 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
8630 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
8631 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
8632 decl = MkDeclaration(specifiers, declarators);
8633 external = MkExternalDeclaration(decl);
8634 if(curExternal)
8635 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
8636 external->symbol = symbol;
8637 symbol->__anon2.__anon1.pointerExternal = external;
8638 DeclareType(external, data->dataType, 1, 1);
8639 }
8640 }
8641 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
8642 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, 0);
8643 }
8644
8645 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
8646 {
8647 struct Context * ctx;
8648 struct Symbol * symbol = (((void *)0));
8649
8650 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
8651 {
8652 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
8653 {
8654 symbol = (((void *)0));
8655 if(thisNameSpace)
8656 {
8657 char curName[1024];
8658
8659 strcpy(curName, thisNameSpace);
8660 strcat(curName, "::");
8661 strcat(curName, name);
8662 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
8663 }
8664 if(!symbol)
8665 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
8666 }
8667 else
8668 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
8669 if(symbol || ctx == endContext)
8670 break;
8671 }
8672 if(inCompiler && symbol && ctx == globalContext && symbol->__anon2.__anon1.pointerExternal && curExternal && symbol->__anon2.__anon1.pointerExternal != curExternal)
8673 __ecereMethod_External_CreateUniqueEdge(curExternal, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
8674 return symbol;
8675 }
8676
8677 struct PropertyDef;
8678
8679 struct ClassDef
8680 {
8681 struct ClassDef * prev;
8682 struct ClassDef * next;
8683 struct Location loc;
8684 int type;
8685 union
8686 {
8687 struct Declaration * decl;
8688 struct ClassFunction * function;
8689 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
8690 struct PropertyDef * propertyDef;
8691 struct PropertyWatch * propertyWatch;
8692 char *  designer;
8693 struct Identifier * defaultProperty;
8694 struct
8695 {
8696 struct Identifier * id;
8697 struct Initializer * initializer;
8698 } __attribute__ ((gcc_struct)) __anon1;
8699 } __attribute__ ((gcc_struct)) __anon1;
8700 int memberAccess;
8701 void *  object;
8702 } __attribute__ ((gcc_struct));
8703
8704 struct PropertyDef
8705 {
8706 struct PropertyDef * prev;
8707 struct PropertyDef * next;
8708 struct Location loc;
8709 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
8710 struct Declarator * declarator;
8711 struct Identifier * id;
8712 struct Statement * getStmt;
8713 struct Statement * setStmt;
8714 struct Statement * issetStmt;
8715 struct Symbol * symbol;
8716 struct Expression * category;
8717 struct
8718 {
8719 unsigned int conversion : 1;
8720 unsigned int isWatchable : 1;
8721 unsigned int isDBProp : 1;
8722 } __attribute__ ((gcc_struct)) __anon1;
8723 } __attribute__ ((gcc_struct));
8724
8725 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
8726 {
8727 struct ClassDef * def;
8728 int anonID = 1;
8729
8730 for(def = (*definitions).first; def; def = def->next)
8731 {
8732 if(def->type == 2)
8733 {
8734 struct Declaration * decl = def->__anon1.decl;
8735
8736 if(decl && decl->__anon1.__anon1.specifiers)
8737 {
8738 struct Specifier * spec;
8739 unsigned int isStruct = 0;
8740
8741 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
8742 {
8743 if(spec->type == 3 || spec->type == 4)
8744 {
8745 if(spec->__anon1.__anon2.definitions)
8746 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
8747 isStruct = 1;
8748 }
8749 }
8750 if(isStruct)
8751 {
8752 struct Declarator * d = (((void *)0));
8753
8754 if(decl->__anon1.__anon1.declarators)
8755 {
8756 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
8757 {
8758 struct Identifier * idDecl = GetDeclId(d);
8759
8760 if(idDecl)
8761 break;
8762 }
8763 }
8764 if(!d)
8765 {
8766 char id[100];
8767
8768 sprintf(id, "__anon%d", anonID++);
8769 if(!decl->__anon1.__anon1.declarators)
8770 decl->__anon1.__anon1.declarators = MkList();
8771 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
8772 }
8773 }
8774 }
8775 }
8776 }
8777 }
8778
8779 struct MemberInit;
8780
8781 typedef union YYSTYPE
8782 {
8783 int specifierType;
8784 int i;
8785 int declMode;
8786 struct Identifier * id;
8787 struct Expression * exp;
8788 struct Specifier * specifier;
8789 struct __ecereNameSpace__ecere__sys__OldList * list;
8790 struct Enumerator * enumerator;
8791 struct Declarator * declarator;
8792 struct Pointer * pointer;
8793 struct Initializer * initializer;
8794 struct InitDeclarator * initDeclarator;
8795 struct TypeName * typeName;
8796 struct Declaration * declaration;
8797 struct Statement * stmt;
8798 struct FunctionDefinition * function;
8799 struct External * external;
8800 struct Context * context;
8801 struct AsmField * asmField;
8802 struct Attrib * attrib;
8803 struct ExtDecl * extDecl;
8804 struct Attribute * attribute;
8805 struct Instantiation * instance;
8806 struct MembersInit * membersInit;
8807 struct MemberInit * memberInit;
8808 struct ClassFunction * classFunction;
8809 struct ClassDefinition * _class;
8810 struct ClassDef * classDef;
8811 struct PropertyDef * prop;
8812 char * string;
8813 struct Symbol * symbol;
8814 struct PropertyWatch * propertyWatch;
8815 struct TemplateParameter * templateParameter;
8816 struct TemplateArgument * templateArgument;
8817 struct TemplateDatatype * templateDatatype;
8818 struct DBTableEntry * dbtableEntry;
8819 struct DBIndexItem * dbindexItem;
8820 struct DBTableDef * dbtableDef;
8821 } __attribute__ ((gcc_struct)) YYSTYPE;
8822
8823 extern YYSTYPE yylval;
8824
8825 struct MemberInit
8826 {
8827 struct MemberInit * prev;
8828 struct MemberInit * next;
8829 struct Location loc;
8830 struct Location realLoc;
8831 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
8832 struct Initializer * initializer;
8833 unsigned int used;
8834 unsigned int variable;
8835 unsigned int takeOutExp;
8836 } __attribute__ ((gcc_struct));
8837
8838 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
8839
8840 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
8841
8842 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
8843 {
8844 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
8845 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
8846 const char *  name;
8847 int type;
8848 union
8849 {
8850 const char *  dataTypeString;
8851 int memberType;
8852 } __attribute__ ((gcc_struct)) __anon1;
8853 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
8854 void *  param;
8855 } __attribute__ ((gcc_struct));
8856
8857 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
8858 {
8859 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
8860 int id = 0;
8861 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
8862 struct __ecereNameSpace__ecere__com__Class * sClass;
8863
8864 for(sClass = _class; sClass; sClass = sClass->base)
8865 {
8866 id = 0;
8867 if(sClass->templateClass)
8868 sClass = sClass->templateClass;
8869 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
8870 {
8871 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
8872 {
8873 for(sClass = sClass->base; sClass; sClass = sClass->base)
8874 {
8875 if(sClass->templateClass)
8876 sClass = sClass->templateClass;
8877 id += sClass->templateParams.count;
8878 }
8879 break;
8880 }
8881 id++;
8882 }
8883 if(curParam)
8884 break;
8885 }
8886 if(curParam)
8887 {
8888 arg = &_class->templateArgs[id];
8889 if(arg && param->type == 0)
8890 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
8891 }
8892 return arg;
8893 }
8894
8895 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
8896 {
8897 struct Context * context = PushContext();
8898
8899 context->templateTypesOnly = 1;
8900 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
8901 {
8902 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
8903
8904 for(; param; param = param->next)
8905 {
8906 if(param->type == 0 && param->identifier)
8907 {
8908 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
8909
8910 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8911 }
8912 }
8913 }
8914 else if(_class)
8915 {
8916 struct __ecereNameSpace__ecere__com__Class * sClass;
8917
8918 for(sClass = _class; sClass; sClass = sClass->base)
8919 {
8920 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
8921
8922 for(p = sClass->templateParams.first; p; p = p->next)
8923 {
8924 if(p->type == 0)
8925 {
8926 struct TemplateParameter * param = p->param;
8927 struct TemplatedType * type;
8928
8929 if(!param)
8930 {
8931 p->param = param = __extension__ ({
8932 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
8933
8934 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
8935 });
8936 }
8937 type = __extension__ ({
8938 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
8939
8940 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
8941 });
8942 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8943 }
8944 }
8945 }
8946 }
8947 return context;
8948 }
8949
8950 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
8951 {
8952 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8953 {
8954 unsigned int first = 1;
8955 int p = 0;
8956 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8957 int lastParam = -1;
8958 char className[1024];
8959
8960 strcpy(className, _class->fullName);
8961 for(param = _class->templateParams.first; param; param = param->next)
8962 {
8963 {
8964 if(first)
8965 strcat(className, "<");
8966 if(!first)
8967 strcat(className, ", ");
8968 if(lastParam + 1 != p)
8969 {
8970 strcat(className, param->name);
8971 strcat(className, " = ");
8972 }
8973 strcat(className, param->name);
8974 first = 0;
8975 lastParam = p;
8976 }
8977 p++;
8978 }
8979 if(!first)
8980 {
8981 int len = strlen(className);
8982
8983 if(className[len - 1] == '>')
8984 className[len++] = ' ';
8985 className[len++] = '>';
8986 className[len++] = '\0';
8987 }
8988 return __ecereNameSpace__ecere__sys__CopyString(className);
8989 }
8990 else
8991 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
8992 }
8993
8994 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
8995 {
8996 struct Type * type;
8997
8998 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8999 {
9000 unsigned int first = 1;
9001 int p = 0;
9002 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9003 int lastParam = -1;
9004 char className[1024];
9005
9006 strcpy(className, _class->fullName);
9007 for(param = _class->templateParams.first; param; param = param->next)
9008 {
9009 {
9010 if(first)
9011 strcat(className, "<");
9012 if(!first)
9013 strcat(className, ", ");
9014 if(lastParam + 1 != p)
9015 {
9016 strcat(className, param->name);
9017 strcat(className, " = ");
9018 }
9019 strcat(className, param->name);
9020 first = 0;
9021 lastParam = p;
9022 }
9023 p++;
9024 }
9025 if(!first)
9026 {
9027 int len = strlen(className);
9028
9029 if(className[len - 1] == '>')
9030 className[len++] = ' ';
9031 className[len++] = '>';
9032 className[len++] = '\0';
9033 }
9034 type = MkClassType(className);
9035 }
9036 else
9037 {
9038 type = MkClassType(_class->fullName);
9039 }
9040 return type;
9041 }
9042
9043 static int DeclareMembers(struct External * neededBy, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9044 {
9045 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9046 struct __ecereNameSpace__ecere__com__DataMember * member;
9047 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9048
9049 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
9050 DeclareMembers(neededBy, _class->base, 0);
9051 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
9052 {
9053 if(!member->isProperty)
9054 {
9055 switch(member->type)
9056 {
9057 case 0:
9058 {
9059 if(!member->dataType && member->dataTypeString)
9060 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9061 if(member->dataType)
9062 DeclareType(neededBy, member->dataType, 1, 0);
9063 break;
9064 }
9065 case 1:
9066 case 2:
9067 {
9068 DeclareMembers(neededBy, (struct __ecereNameSpace__ecere__com__Class *)member, 1);
9069 break;
9070 }
9071 }
9072 }
9073 }
9074 if(context)
9075 FinishTemplatesContext(context);
9076 return topMember ? topMember->memberID : _class->memberID;
9077 }
9078
9079 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
9080 {
9081 if(!method->dataType)
9082 {
9083 struct Context * context = SetupTemplatesContext(method->_class);
9084
9085 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9086 FinishTemplatesContext(context);
9087 if(method->type != 1 && method->dataType)
9088 {
9089 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
9090 {
9091 if(!method->_class->symbol)
9092 method->_class->symbol = FindClass(method->_class->fullName);
9093 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
9094 }
9095 }
9096 }
9097 }
9098
9099 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
9100 {
9101 if(!prop->dataType)
9102 {
9103 struct Context * context = SetupTemplatesContext(prop->_class);
9104
9105 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
9106 FinishTemplatesContext(context);
9107 }
9108 }
9109
9110 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
9111 {
9112 if(specs != (((void *)0)) && _class)
9113 {
9114 struct Specifier * spec;
9115
9116 for(spec = specs->first; spec; spec = spec->next)
9117 {
9118 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
9119 {
9120 spec->type = 1;
9121 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
9122 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
9123 }
9124 }
9125 }
9126 }
9127
9128 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
9129 {
9130 struct Identifier * id = exp->__anon1.__anon1.identifier;
9131 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9132 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9133 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9134 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9135
9136 if(_class && _class->type == 4)
9137 {
9138 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
9139 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9140
9141 if(enumClass)
9142 {
9143 struct __ecereNameSpace__ecere__com__Class * baseClass;
9144
9145 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
9146 {
9147 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
9148
9149 for(value = e->values.first; value; value = value->next)
9150 {
9151 if(!strcmp(value->name, id->string))
9152 break;
9153 }
9154 if(value)
9155 {
9156 exp->isConstant = 1;
9157 if(inCompiler || inPreCompiler || inDebugger)
9158 {
9159 char constant[256];
9160
9161 FreeExpContents(exp);
9162 exp->type = 2;
9163 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
9164 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
9165 else
9166 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
9167 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9168 }
9169 exp->expType = MkClassType(baseClass->fullName);
9170 break;
9171 }
9172 }
9173 }
9174 if(value)
9175 return 1;
9176 }
9177 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
9178 {
9179 ProcessMethodType(method);
9180 exp->expType = __extension__ ({
9181 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
9182
9183 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
9184 });
9185 return 1;
9186 }
9187 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
9188 {
9189 if(!prop->dataType)
9190 ProcessPropertyType(prop);
9191 exp->expType = prop->dataType;
9192 if(prop->dataType)
9193 prop->dataType->refCount++;
9194 return 1;
9195 }
9196 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
9197 {
9198 if(!member->dataType)
9199 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9200 exp->expType = member->dataType;
9201 if(member->dataType)
9202 member->dataType->refCount++;
9203 return 1;
9204 }
9205 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
9206 {
9207 if(!classProp->dataType)
9208 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
9209 if(classProp->constant)
9210 {
9211 FreeExpContents(exp);
9212 exp->isConstant = 1;
9213 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
9214 {
9215 exp->type = 3;
9216 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
9217 }
9218 else
9219 {
9220 char constant[256];
9221
9222 exp->type = 2;
9223 sprintf(constant, "%d", (int)classProp->Get(_class));
9224 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9225 }
9226 }
9227 else
9228 {
9229 }
9230 exp->expType = classProp->dataType;
9231 if(classProp->dataType)
9232 classProp->dataType->refCount++;
9233 return 1;
9234 }
9235 return 0;
9236 }
9237
9238 void DeclareProperty(struct External * neededBy, struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
9239 {
9240 struct Symbol * symbol = prop->symbol;
9241 unsigned int imported = 0;
9242 unsigned int dllImport = 0;
9243 struct External * structExternal = (((void *)0));
9244 struct External * instExternal = (((void *)0));
9245
9246 strcpy(setName, "__ecereProp_");
9247 FullClassNameCat(setName, prop->_class->fullName, 0);
9248 strcat(setName, "_Set_");
9249 FullClassNameCat(setName, prop->name, 1);
9250 strcpy(getName, "__ecereProp_");
9251 FullClassNameCat(getName, prop->_class->fullName, 0);
9252 strcat(getName, "_Get_");
9253 FullClassNameCat(getName, prop->name, 1);
9254 if(!symbol || symbol->_import)
9255 {
9256 if(!symbol)
9257 {
9258 struct Symbol * classSym;
9259
9260 if(!prop->_class->symbol)
9261 prop->_class->symbol = FindClass(prop->_class->fullName);
9262 classSym = prop->_class->symbol;
9263 if(classSym && !classSym->_import)
9264 {
9265 struct ModuleImport * module;
9266
9267 if(prop->_class->module)
9268 module = FindModule(prop->_class->module);
9269 else
9270 module = mainModule;
9271 classSym->_import = __extension__ ({
9272 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9273
9274 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
9275 });
9276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9277 }
9278 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9279 symbol->_import = (struct ClassImport *)__extension__ ({
9280 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
9281
9282 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
9283 });
9284 if(classSym)
9285 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
9286 }
9287 imported = 1;
9288 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)
9289 dllImport = 1;
9290 }
9291 if(!symbol->type)
9292 {
9293 struct Context * context = SetupTemplatesContext(prop->_class);
9294
9295 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
9296 FinishTemplatesContext(context);
9297 }
9298 if((prop->Get && !symbol->__anon2.__anon2.externalGet) || (prop->Set && !symbol->__anon2.__anon2.externalSet))
9299 {
9300 if(prop->_class->type == 0 && prop->_class->structSize)
9301 instExternal = DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
9302 structExternal = DeclareStruct((((void *)0)), prop->_class->fullName, prop->_class->type != 1, 0);
9303 }
9304 if(prop->Get && !symbol->__anon2.__anon2.externalGet)
9305 {
9306 struct Declaration * decl;
9307 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9308 struct Declarator * d;
9309 struct __ecereNameSpace__ecere__sys__OldList * params;
9310 struct Specifier * spec = (((void *)0));
9311 struct External * external;
9312 struct Declarator * typeDecl;
9313 unsigned int simple = 0;
9314 unsigned int needReference;
9315
9316 specifiers = MkList();
9317 declarators = MkList();
9318 params = MkList();
9319 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9320 d = MkDeclaratorIdentifier(MkIdentifier(getName));
9321 if(dllImport)
9322 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9323 {
9324 struct Context * context = SetupTemplatesContext(prop->_class);
9325
9326 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
9327 FinishTemplatesContext(context);
9328 }
9329 needReference = !typeDecl || typeDecl->type == 1;
9330 for(spec = (*specifiers).first; spec; spec = spec->next)
9331 {
9332 if(spec->type == 1)
9333 {
9334 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9335
9336 if(needReference)
9337 {
9338 symbol->_class = classSym->__anon1.registered;
9339 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
9340 simple = 1;
9341 }
9342 break;
9343 }
9344 }
9345 if(!simple)
9346 d = PlugDeclarator(typeDecl, d);
9347 else
9348 {
9349 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
9350 specifiers = MkList();
9351 }
9352 d = MkDeclaratorFunction(d, params);
9353 if(dllImport)
9354 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9355 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9356 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9357 if(simple)
9358 ListAdd(specifiers, MkSpecifier(VOID));
9359 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9360 decl = MkDeclaration(specifiers, declarators);
9361 external = MkExternalDeclaration(decl);
9362 if(structExternal)
9363 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9364 if(instExternal)
9365 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9366 if(spec)
9367 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9369 external->symbol = symbol;
9370 symbol->__anon2.__anon2.externalGet = external;
9371 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9372 if(typeDecl)
9373 FreeDeclarator(typeDecl);
9374 }
9375 if(prop->Set && !symbol->__anon2.__anon2.externalSet)
9376 {
9377 struct Declaration * decl;
9378 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9379 struct Declarator * d;
9380 struct __ecereNameSpace__ecere__sys__OldList * params;
9381 struct Specifier * spec = (((void *)0));
9382 struct External * external;
9383 struct Declarator * typeDecl;
9384 unsigned int needReference;
9385
9386 declarators = MkList();
9387 params = MkList();
9388 if(!prop->conversion || prop->_class->type == 1)
9389 {
9390 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9391 }
9392 specifiers = MkList();
9393 {
9394 struct Context * context = SetupTemplatesContext(prop->_class);
9395
9396 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
9397 FinishTemplatesContext(context);
9398 }
9399 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
9400 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
9401 ListAdd(params, MkTypeName(specifiers, d));
9402 d = MkDeclaratorIdentifier(MkIdentifier(setName));
9403 if(dllImport)
9404 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9405 d = MkDeclaratorFunction(d, params);
9406 needReference = !typeDecl || typeDecl->type == 1;
9407 for(spec = (*specifiers).first; spec; spec = spec->next)
9408 {
9409 if(spec->type == 1)
9410 {
9411 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9412
9413 if(needReference)
9414 symbol->_class = classSym->__anon1.registered;
9415 break;
9416 }
9417 }
9418 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9419 specifiers = MkList();
9420 if(dllImport)
9421 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9422 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9423 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9424 if(!prop->conversion || prop->_class->type == 1)
9425 ListAdd(specifiers, MkSpecifier(VOID));
9426 else
9427 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
9428 decl = MkDeclaration(specifiers, declarators);
9429 external = MkExternalDeclaration(decl);
9430 if(structExternal)
9431 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9432 if(instExternal)
9433 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9434 if(spec)
9435 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9436 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9437 external->symbol = symbol;
9438 symbol->__anon2.__anon2.externalSet = external;
9439 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9440 }
9441 if(!symbol->__anon2.__anon2.externalPtr)
9442 {
9443 struct Declaration * decl;
9444 struct External * external;
9445 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
9446 char propName[1024];
9447
9448 if(imported)
9449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9450 else
9451 {
9452 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9453 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
9454 }
9455 ListAdd(specifiers, MkSpecifierName("Property"));
9456 strcpy(propName, "__ecereProp_");
9457 FullClassNameCat(propName, prop->_class->fullName, 0);
9458 strcat(propName, "_");
9459 FullClassNameCat(propName, prop->name, 1);
9460 {
9461 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
9462
9463 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9464 if(!imported)
9465 {
9466 strcpy(propName, "__ecerePropM_");
9467 FullClassNameCat(propName, prop->_class->fullName, 0);
9468 strcat(propName, "_");
9469 FullClassNameCat(propName, prop->name, 1);
9470 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9471 }
9472 decl = MkDeclaration(specifiers, list);
9473 }
9474 external = MkExternalDeclaration(decl);
9475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
9476 external->symbol = symbol;
9477 symbol->__anon2.__anon2.externalPtr = external;
9478 }
9479 if(inCompiler && neededBy)
9480 {
9481 if(symbol->__anon2.__anon2.externalPtr)
9482 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalPtr, 0);
9483 if(symbol->__anon2.__anon2.externalGet)
9484 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalGet, symbol->__anon2.__anon2.externalGet->type == 0);
9485 if(symbol->__anon2.__anon2.externalSet)
9486 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalSet, symbol->__anon2.__anon2.externalSet->type == 0);
9487 }
9488 }
9489
9490 static void ProcessDeclarator(struct Declarator *  decl, unsigned int isFunction);
9491
9492 void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char * name)
9493 {
9494 struct Symbol * symbol = method->symbol;
9495
9496 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && (!symbol->__anon2.__anon3.methodCodeExternal || method->type == 1)))
9497 {
9498 unsigned int dllImport = 0;
9499
9500 if(!method->dataType)
9501 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9502 {
9503 if(!symbol || method->type == 1)
9504 {
9505 struct Symbol * classSym;
9506
9507 if(!method->_class->symbol)
9508 method->_class->symbol = FindClass(method->_class->fullName);
9509 classSym = method->_class->symbol;
9510 if(!classSym->_import)
9511 {
9512 struct ModuleImport * module;
9513
9514 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->name)
9515 module = FindModule(method->_class->module);
9516 else
9517 module = mainModule;
9518 classSym->_import = __extension__ ({
9519 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9520
9521 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
9522 });
9523 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9524 }
9525 if(!symbol)
9526 {
9527 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9528 }
9529 if(!symbol->_import)
9530 {
9531 symbol->_import = (struct ClassImport *)__extension__ ({
9532 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
9533
9534 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
9535 });
9536 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
9537 }
9538 if(!symbol)
9539 {
9540 symbol->type = method->dataType;
9541 if(symbol->type)
9542 symbol->type->refCount++;
9543 }
9544 }
9545 if(!method->dataType->dllExport)
9546 {
9547 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)
9548 dllImport = 1;
9549 }
9550 }
9551 if(inCompiler)
9552 {
9553 struct Declaration * decl;
9554 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9555 struct Declarator * d;
9556 struct Declarator * funcDecl;
9557 struct External * external;
9558
9559 specifiers = MkList();
9560 declarators = MkList();
9561 if(dllImport)
9562 ListAdd(specifiers, MkSpecifier(EXTERN));
9563 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
9564 ListAdd(specifiers, MkSpecifier(STATIC));
9565 if(method->type == 1)
9566 {
9567 ListAdd(specifiers, MkSpecifier(INT));
9568 d = MkDeclaratorIdentifier(MkIdentifier(name));
9569 }
9570 else
9571 {
9572 d = MkDeclaratorIdentifier(MkIdentifier(name));
9573 if(dllImport)
9574 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9575 {
9576 struct Context * context = SetupTemplatesContext(method->_class);
9577
9578 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
9579 FinishTemplatesContext(context);
9580 }
9581 funcDecl = GetFuncDecl(d);
9582 if(dllImport)
9583 {
9584 struct Specifier * spec, * next;
9585
9586 for(spec = (*specifiers).first; spec; spec = next)
9587 {
9588 next = spec->next;
9589 if(spec->type == 5)
9590 {
9591 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9592 FreeSpecifier(spec);
9593 }
9594 }
9595 }
9596 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
9597 {
9598 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
9599 {
9600 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
9601 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")));
9602 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
9603 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
9604
9605 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
9606 {
9607 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
9608
9609 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
9610 FreeTypeName(param);
9611 }
9612 if(!funcDecl->__anon1.function.parameters)
9613 funcDecl->__anon1.function.parameters = MkList();
9614 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
9615 }
9616 }
9617 }
9618 ProcessDeclarator(d, 1);
9619 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9620 decl = MkDeclaration(specifiers, declarators);
9621 ReplaceThisClassSpecifiers(specifiers, method->_class);
9622 external = MkExternalDeclaration(decl);
9623 external->symbol = symbol;
9624 symbol->__anon2.__anon1.pointerExternal = external;
9625 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9626 DeclareStruct(external, method->_class->fullName, 1, 1);
9627 if(method->dataType)
9628 DeclareType(external, method->dataType, 1, 1);
9629 }
9630 }
9631 if(inCompiler && neededFor)
9632 {
9633 struct External * external = symbol->__anon2.__anon1.pointerExternal ? symbol->__anon2.__anon1.pointerExternal : symbol->__anon2.__anon3.methodCodeExternal;
9634
9635 __ecereMethod_External_CreateUniqueEdge(neededFor, external, external->type == 0);
9636 }
9637 }
9638
9639 struct __ecereNameSpace__ecere__com__GlobalFunction;
9640
9641 struct __ecereNameSpace__ecere__com__GlobalFunction
9642 {
9643 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
9644 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
9645 const char *  name;
9646 int (*  function)();
9647 struct __ecereNameSpace__ecere__com__Instance * module;
9648 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
9649 const char *  dataTypeString;
9650 struct Type * dataType;
9651 void *  symbol;
9652 } __attribute__ ((gcc_struct));
9653
9654 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
9655
9656 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);
9657
9658 unsigned int DeclareFunction(struct External * neededFor, struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
9659 {
9660 struct Symbol * symbol = function->symbol;
9661
9662 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
9663 {
9664 unsigned int imported = 0;
9665 unsigned int dllImport = 0;
9666
9667 if(!function->dataType)
9668 {
9669 function->dataType = ProcessTypeString(function->dataTypeString, 0);
9670 if(!function->dataType->__anon1.__anon2.thisClass)
9671 function->dataType->__anon1.__anon2.staticMethod = 1;
9672 }
9673 if(inCompiler)
9674 {
9675 if(!symbol)
9676 {
9677 struct ModuleImport * module = FindModule(function->module);
9678
9679 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9680 if(module->name)
9681 {
9682 if(!function->dataType->dllExport)
9683 {
9684 symbol->_import = (struct ClassImport *)__extension__ ({
9685 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
9686
9687 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
9688 });
9689 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
9690 }
9691 }
9692 {
9693 symbol->type = ProcessTypeString(function->dataTypeString, 0);
9694 if(!symbol->type->__anon1.__anon2.thisClass)
9695 symbol->type->__anon1.__anon2.staticMethod = 1;
9696 }
9697 }
9698 imported = symbol->_import ? 1 : 0;
9699 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9700 dllImport = 1;
9701 }
9702 if(inCompiler)
9703 {
9704 {
9705 struct Declaration * decl;
9706 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9707 struct Declarator * d;
9708 struct Declarator * funcDecl;
9709 struct External * external;
9710
9711 specifiers = MkList();
9712 declarators = MkList();
9713 ListAdd(specifiers, MkSpecifier(EXTERN));
9714 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
9715 if(dllImport)
9716 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9717 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
9718 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType == 1)
9719 {
9720 struct Specifier * spec;
9721
9722 for(spec = (*specifiers).first; spec; spec = spec->next)
9723 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
9724 {
9725 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9726 FreeSpecifier(spec);
9727 break;
9728 }
9729 }
9730 funcDecl = GetFuncDecl(d);
9731 if(funcDecl && !funcDecl->__anon1.function.parameters)
9732 {
9733 funcDecl->__anon1.function.parameters = MkList();
9734 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
9735 }
9736 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9737 {
9738 struct Context * oldCtx = curContext;
9739
9740 curContext = globalContext;
9741 decl = MkDeclaration(specifiers, declarators);
9742 curContext = oldCtx;
9743 }
9744 external = MkExternalDeclaration(decl);
9745 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9746 external->symbol = symbol;
9747 symbol->__anon2.__anon1.pointerExternal = external;
9748 DeclareType(external, function->dataType, 1, 1);
9749 }
9750 }
9751 }
9752 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
9753 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
9754 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;
9755 }
9756
9757 void DeclareFunctionUtil(struct External * neededBy, const char * s)
9758 {
9759 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
9760
9761 if(function)
9762 {
9763 char name[1024];
9764
9765 name[0] = (char)0;
9766 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
9767 strcpy(name, "__ecereFunction_");
9768 FullClassNameCat(name, s, 0);
9769 DeclareFunction(neededBy, function, name);
9770 }
9771 else if(neededBy)
9772 FindSymbol(s, globalContext, globalContext, 0, 0);
9773 }
9774
9775 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
9776 {
9777 char propName[1024], propNameM[1024];
9778 char getName[1024], setName[1024];
9779 struct __ecereNameSpace__ecere__sys__OldList * args;
9780
9781 DeclareProperty(curExternal, prop, setName, getName);
9782 strcpy(propName, "__ecereProp_");
9783 FullClassNameCat(propName, prop->_class->fullName, 0);
9784 strcat(propName, "_");
9785 FullClassNameCat(propName, prop->name, 1);
9786 strcpy(propNameM, "__ecerePropM_");
9787 FullClassNameCat(propNameM, prop->_class->fullName, 0);
9788 strcat(propNameM, "_");
9789 FullClassNameCat(propNameM, prop->name, 1);
9790 if(prop->isWatchable)
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_FireWatchers")), 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_FireWatchers")), args));
9800 DeclareFunctionUtil(curExternal, "eInstance_FireWatchers");
9801 }
9802 {
9803 args = MkList();
9804 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9805 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9806 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9807 args = MkList();
9808 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9809 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9810 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9811 DeclareFunctionUtil(curExternal, "eInstance_FireSelfWatchers");
9812 }
9813 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
9814 curFunction->propSet->fireWatchersDone = 1;
9815 }
9816
9817 struct __ecereNameSpace__ecere__com__SubModule;
9818
9819 struct __ecereNameSpace__ecere__com__SubModule
9820 {
9821 struct __ecereNameSpace__ecere__com__SubModule * prev;
9822 struct __ecereNameSpace__ecere__com__SubModule * next;
9823 struct __ecereNameSpace__ecere__com__Instance * module;
9824 int importMode;
9825 } __attribute__ ((gcc_struct));
9826
9827 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
9828 {
9829 struct __ecereNameSpace__ecere__com__SubModule * subModule;
9830
9831 if(searchFor == searchIn)
9832 return 1;
9833 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
9834 {
9835 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
9836 {
9837 if(ModuleVisibility(subModule->module, searchFor))
9838 return 1;
9839 }
9840 }
9841 return 0;
9842 }
9843
9844 void ProcessExpressionType(struct Expression *  exp);
9845
9846 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
9847 {
9848 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
9849 {
9850 struct Identifier * id = exp->__anon1.__anon1.identifier;
9851 struct Context * ctx;
9852 struct Symbol * symbol = (((void *)0));
9853
9854 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
9855 {
9856 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
9857 {
9858 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
9859 if(symbol)
9860 break;
9861 }
9862 }
9863 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))))
9864 {
9865 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
9866 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9867 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9868 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9869
9870 if(!prop)
9871 {
9872 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
9873 }
9874 if(!prop && !method)
9875 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
9876 if(!prop && !method && !member)
9877 {
9878 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
9879 }
9880 if(prop || method || member || classProp)
9881 {
9882 exp->type = 8;
9883 exp->__anon1.member.member = id;
9884 exp->__anon1.member.memberType = 0;
9885 exp->__anon1.member.exp = QMkExpId("this");
9886 exp->addedThis = 1;
9887 }
9888 else if(_class && _class->templateParams.first)
9889 {
9890 struct __ecereNameSpace__ecere__com__Class * sClass;
9891
9892 for(sClass = _class; sClass; sClass = sClass->base)
9893 {
9894 if(sClass->templateParams.first)
9895 {
9896 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9897
9898 for(param = sClass->templateParams.first; param; param = param->next)
9899 {
9900 if(param->type == 2 && !strcmp(param->name, id->string))
9901 {
9902 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
9903
9904 if(argExp)
9905 {
9906 struct Declarator * decl;
9907 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
9908
9909 FreeIdentifier(exp->__anon1.member.member);
9910 ProcessExpressionType(argExp);
9911 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
9912 exp->expType = ProcessType(specs, decl);
9913 exp->type = 5;
9914 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
9915 }
9916 }
9917 }
9918 }
9919 }
9920 }
9921 }
9922 }
9923 }
9924
9925 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9926 {
9927 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9928
9929 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9930 {
9931 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9932 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9933 else
9934 {
9935 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9936 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9937 struct Type * type;
9938 void * ptr = inst->data + dataMember->offset + offset;
9939 char * result = (((void *)0));
9940
9941 exp->loc = member->loc = inst->loc;
9942 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9943 if(!dataMember->dataType)
9944 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
9945 type = dataMember->dataType;
9946 if(type->kind == 8)
9947 {
9948 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
9949
9950 if(_class->type == 4)
9951 {
9952 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9953
9954 if(enumClass)
9955 {
9956 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9957 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
9958
9959 for(item = e->values.first; item; item = item->next)
9960 {
9961 if(item->data == GetEnumValue(_class, ptr))
9962 {
9963 result = item->name;
9964 break;
9965 }
9966 }
9967 if(result)
9968 {
9969 exp->__anon1.__anon1.identifier = MkIdentifier(result);
9970 exp->type = 0;
9971 exp->destType = MkClassType(_class->fullName);
9972 ProcessExpressionType(exp);
9973 }
9974 }
9975 }
9976 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9977 {
9978 if(!_class->dataType)
9979 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
9980 type = _class->dataType;
9981 }
9982 }
9983 if(!result)
9984 {
9985 switch(type->kind)
9986 {
9987 case 6:
9988 {
9989 FreeExpContents(exp);
9990 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
9991 exp->type = 2;
9992 break;
9993 }
9994 case 7:
9995 {
9996 FreeExpContents(exp);
9997 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
9998 exp->type = 2;
9999 break;
10000 }
10001 case 3:
10002 {
10003 FreeExpContents(exp);
10004 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10005 exp->type = 2;
10006 break;
10007 }
10008 case 4:
10009 {
10010 FreeExpContents(exp);
10011 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10012 exp->type = 2;
10013 break;
10014 }
10015 case 22:
10016 {
10017 FreeExpContents(exp);
10018 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10019 exp->type = 2;
10020 break;
10021 }
10022 case 23:
10023 {
10024 FreeExpContents(exp);
10025 exp->__anon1.__anon1.constant = PrintInt64((long long)*(ssize_t *)ptr);
10026 exp->type = 2;
10027 break;
10028 }
10029 default:
10030 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10031 }
10032 }
10033 ListAdd(memberList, member);
10034 }
10035 if(parentDataMember->type == 1)
10036 break;
10037 }
10038 }
10039
10040 void CheckTemplateTypes(struct Expression * exp)
10041 {
10042 struct Expression * nbExp = GetNonBracketsExp(exp);
10043
10044 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
10045 {
10046 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10047 struct Context * context;
10048 int kind = exp->expType->kind;
10049
10050 *newExp = *exp;
10051 if(exp->destType)
10052 exp->destType->refCount++;
10053 if(exp->expType)
10054 exp->expType->refCount++;
10055 newExp->prev = (((void *)0));
10056 newExp->next = (((void *)0));
10057 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10058 {
10059 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10060
10061 if(c->type == 2 || c->type == 4 || c->type == 3)
10062 {
10063 if(!c->dataType)
10064 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10065 kind = c->dataType->kind;
10066 }
10067 }
10068 switch(kind)
10069 {
10070 case 7:
10071 if(exp->destType->classObjectType)
10072 {
10073 if(exp->destType)
10074 exp->destType->refCount--;
10075 if(exp->expType)
10076 exp->expType->refCount--;
10077 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10078 }
10079 else
10080 {
10081 struct __ecereNameSpace__ecere__sys__OldList * specs;
10082 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10083 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10084
10085 context = PushContext();
10086 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10087 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10088 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10089 exp->type = 23;
10090 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10091 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10092 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10093 exp->__anon1.compound->__anon1.compound.context = context;
10094 PopContext(context);
10095 }
10096 break;
10097 default:
10098 exp->type = 11;
10099 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10100 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))
10101 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
10102 else
10103 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10104 exp->needCast = 1;
10105 break;
10106 }
10107 }
10108 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10109 {
10110 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10111 struct Context * context;
10112 int kind = exp->expType->kind;
10113
10114 *newExp = *exp;
10115 if(exp->destType)
10116 exp->destType->refCount++;
10117 if(exp->expType)
10118 exp->expType->refCount++;
10119 newExp->prev = (((void *)0));
10120 newExp->next = (((void *)0));
10121 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10122 {
10123 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10124
10125 if(c->type == 2 || c->type == 4 || c->type == 3)
10126 {
10127 if(!c->dataType)
10128 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10129 kind = c->dataType->kind;
10130 }
10131 }
10132 switch(kind)
10133 {
10134 case 7:
10135 if(exp->destType->classObjectType)
10136 {
10137 if(exp->destType)
10138 exp->destType->refCount--;
10139 if(exp->expType)
10140 exp->expType->refCount--;
10141 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10142 }
10143 else
10144 {
10145 struct __ecereNameSpace__ecere__sys__OldList * specs;
10146 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10147 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10148
10149 context = PushContext();
10150 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10151 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10152 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10153 exp->type = 23;
10154 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10155 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10156 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10157 exp->__anon1.compound->__anon1.compound.context = context;
10158 PopContext(context);
10159 }
10160 break;
10161 case 8:
10162 {
10163 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
10164 {
10165 exp->type = 5;
10166 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10167 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)));
10168 ProcessExpressionType((*exp->__anon1.list).first);
10169 break;
10170 }
10171 else
10172 {
10173 exp->type = 5;
10174 if(__ecereProp_Type_Get_isPointerType(exp->expType))
10175 {
10176 exp->needTemplateCast = 2;
10177 newExp->needCast = 1;
10178 newExp->needTemplateCast = 2;
10179 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10180 }
10181 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
10182 exp->needTemplateCast = 2;
10183 newExp->needCast = 1;
10184 newExp->needTemplateCast = 2;
10185 ProcessExpressionType((*exp->__anon1.list).first);
10186 break;
10187 }
10188 }
10189 default:
10190 {
10191 if(exp->expType->kind == 20)
10192 {
10193 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
10194
10195 if(type)
10196 {
10197 FreeType(exp->destType);
10198 FreeType(exp->expType);
10199 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10200 break;
10201 }
10202 }
10203 {
10204 char typeString[1024];
10205 struct Declarator * decl;
10206 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10207
10208 typeString[0] = '\0';
10209 PrintType(exp->expType, typeString, 0, 0);
10210 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10211 exp->type = 11;
10212 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
10213 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10214 exp->__anon1.cast.exp->needCast = 1;
10215 exp->needTemplateCast = 2;
10216 newExp->needTemplateCast = 2;
10217 }
10218 break;
10219 }
10220 }
10221 }
10222 }
10223
10224 static void ProcessInitializer(struct Initializer * init, struct Type * type)
10225 {
10226 switch(init->type)
10227 {
10228 case 0:
10229 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
10230 {
10231 if(init->__anon1.exp && !init->__anon1.exp->destType)
10232 {
10233 FreeType(init->__anon1.exp->destType);
10234 init->__anon1.exp->destType = type;
10235 if(type)
10236 type->refCount++;
10237 }
10238 if(init->__anon1.exp)
10239 {
10240 ProcessExpressionType(init->__anon1.exp);
10241 init->isConstant = init->__anon1.exp->isConstant;
10242 }
10243 break;
10244 }
10245 else
10246 {
10247 struct Expression * exp = init->__anon1.exp;
10248 struct Instantiation * inst = exp->__anon1.instance;
10249 struct MembersInit * members;
10250
10251 init->type = 1;
10252 init->__anon1.list = MkList();
10253 if(inst->members)
10254 {
10255 for(members = (*inst->members).first; members; members = members->next)
10256 {
10257 if(members->type == 0)
10258 {
10259 struct MemberInit * member;
10260
10261 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
10262 {
10263 ListAdd(init->__anon1.list, member->initializer);
10264 member->initializer = (((void *)0));
10265 }
10266 }
10267 }
10268 }
10269 FreeExpression(exp);
10270 }
10271 case 1:
10272 {
10273 struct Initializer * i;
10274 struct Type * initializerType = (((void *)0));
10275 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10276 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10277 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10278 int subMemberStackPos = 0;
10279
10280 if(type && type->kind == 12)
10281 initializerType = Dereference(type);
10282 else if(type && (type->kind == 9 || type->kind == 10))
10283 initializerType = type->__anon1.__anon1.members.first;
10284 for(i = (*init->__anon1.list).first; i; i = i->next)
10285 {
10286 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
10287 {
10288 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10289 if(curMember)
10290 {
10291 if(!curMember->dataType)
10292 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
10293 initializerType = curMember->dataType;
10294 }
10295 }
10296 ProcessInitializer(i, initializerType);
10297 if(initializerType && type && (type->kind == 9 || type->kind == 10))
10298 initializerType = initializerType->next;
10299 if(!i->isConstant)
10300 init->isConstant = 0;
10301 }
10302 if(type && type->kind == 12)
10303 FreeType(initializerType);
10304 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))
10305 {
10306 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
10307 }
10308 break;
10309 }
10310 }
10311 }
10312
10313 void PopulateInstance(struct Instantiation * inst)
10314 {
10315 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
10316 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
10317 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10318 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10319
10320 if(!inst->members)
10321 inst->members = MkListOne(MkMembersInitList(memberList));
10322 else
10323 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10324 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10325 {
10326 if(!dataMember->isProperty)
10327 {
10328 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10329 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10330 else
10331 {
10332 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10333 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10334 struct Type * type;
10335 void * ptr = inst->data + dataMember->offset;
10336 char * result = (((void *)0));
10337
10338 exp->loc = member->loc = inst->loc;
10339 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10340 if(!dataMember->dataType)
10341 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10342 type = dataMember->dataType;
10343 if(type->kind == 8)
10344 {
10345 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
10346
10347 if(_class->type == 4)
10348 {
10349 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10350
10351 if(enumClass)
10352 {
10353 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10354 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
10355
10356 for(item = e->values.first; item; item = item->next)
10357 {
10358 if(item->data == GetEnumValue(_class, ptr))
10359 {
10360 result = item->name;
10361 break;
10362 }
10363 }
10364 }
10365 if(result)
10366 {
10367 exp->__anon1.__anon1.identifier = MkIdentifier(result);
10368 exp->type = 0;
10369 exp->destType = MkClassType(_class->fullName);
10370 ProcessExpressionType(exp);
10371 }
10372 }
10373 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10374 {
10375 if(!_class->dataType)
10376 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
10377 type = _class->dataType;
10378 }
10379 }
10380 if(!result)
10381 {
10382 switch(type->kind)
10383 {
10384 case 6:
10385 {
10386 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10387 exp->type = 2;
10388 break;
10389 }
10390 case 7:
10391 {
10392 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10393 exp->type = 2;
10394 break;
10395 }
10396 case 3:
10397 {
10398 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10399 exp->type = 2;
10400 break;
10401 }
10402 case 4:
10403 {
10404 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10405 exp->type = 2;
10406 break;
10407 }
10408 case 22:
10409 {
10410 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10411 exp->type = 2;
10412 break;
10413 }
10414 default:
10415 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10416 }
10417 }
10418 ListAdd(memberList, member);
10419 }
10420 }
10421 }
10422 }
10423
10424 int ComputeTypeSize(struct Type *  type);
10425
10426 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
10427 {
10428 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10429 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10430
10431 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))
10432 {
10433 int unionMemberOffset = 0;
10434 int bitFields = 0;
10435
10436 if(member)
10437 {
10438 member->memberOffset = 0;
10439 if(targetBits < sizeof(void *) * 8)
10440 member->structAlignment = (short)0;
10441 }
10442 else if(targetBits < sizeof(void *) * 8)
10443 _class->structAlignment = (short)0;
10444 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
10445 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
10446 if(!member && _class->destructionWatchOffset)
10447 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10448 {
10449 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10450
10451 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10452 {
10453 if(!dataMember->isProperty)
10454 {
10455 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
10456 {
10457 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10458 }
10459 }
10460 }
10461 }
10462 {
10463 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10464
10465 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10466 {
10467 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
10468 {
10469 if(!isMember && _class->type == 2 && dataMember->dataType)
10470 {
10471 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10472 uint64 mask = 0;
10473 int d;
10474
10475 ComputeTypeSize(dataMember->dataType);
10476 if(bitMember->pos == -1)
10477 bitMember->pos = _class->memberOffset;
10478 if(!bitMember->size)
10479 bitMember->size = dataMember->dataType->size * 8;
10480 _class->memberOffset = bitMember->pos + bitMember->size;
10481 for(d = 0; d < bitMember->size; d++)
10482 {
10483 if(d)
10484 mask <<= 1;
10485 mask |= 1;
10486 }
10487 bitMember->mask = mask << bitMember->pos;
10488 }
10489 else if(dataMember->type == 0 && dataMember->dataType)
10490 {
10491 int size;
10492 int alignment = 0;
10493
10494 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)))
10495 ComputeTypeSize(dataMember->dataType);
10496 if(dataMember->dataType->bitFieldCount)
10497 {
10498 bitFields += dataMember->dataType->bitFieldCount;
10499 size = 0;
10500 }
10501 else
10502 {
10503 if(bitFields)
10504 {
10505 int size = (bitFields + 7) / 8;
10506
10507 if(isMember)
10508 {
10509 int __simpleStruct0;
10510
10511 if(alignment)
10512 {
10513 short __simpleStruct0;
10514
10515 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10516 if(member->memberOffset % alignment)
10517 member->memberOffset += alignment - (member->memberOffset % alignment);
10518 }
10519 dataMember->offset = member->memberOffset;
10520 if(member->type == 1)
10521 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10522 else
10523 {
10524 member->memberOffset += size;
10525 }
10526 }
10527 else
10528 {
10529 if(alignment)
10530 {
10531 short __simpleStruct0;
10532
10533 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10534 if(_class->memberOffset % alignment)
10535 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10536 }
10537 dataMember->offset = _class->memberOffset;
10538 _class->memberOffset += size;
10539 }
10540 bitFields = 0;
10541 }
10542 size = dataMember->dataType->size;
10543 alignment = dataMember->dataType->alignment;
10544 }
10545 if(isMember)
10546 {
10547 int __simpleStruct0;
10548
10549 if(alignment)
10550 {
10551 short __simpleStruct0;
10552
10553 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10554 if(member->memberOffset % alignment)
10555 member->memberOffset += alignment - (member->memberOffset % alignment);
10556 }
10557 dataMember->offset = member->memberOffset;
10558 if(member->type == 1)
10559 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10560 else
10561 {
10562 member->memberOffset += size;
10563 }
10564 }
10565 else
10566 {
10567 if(alignment)
10568 {
10569 short __simpleStruct0;
10570
10571 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10572 if(_class->memberOffset % alignment)
10573 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10574 }
10575 dataMember->offset = _class->memberOffset;
10576 _class->memberOffset += size;
10577 }
10578 }
10579 else
10580 {
10581 int alignment;
10582
10583 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
10584 alignment = dataMember->structAlignment;
10585 if(isMember)
10586 {
10587 int __simpleStruct0;
10588
10589 if(alignment)
10590 {
10591 short __simpleStruct0;
10592
10593 if(member->memberOffset % alignment)
10594 member->memberOffset += alignment - (member->memberOffset % alignment);
10595 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10596 }
10597 dataMember->offset = member->memberOffset;
10598 if(member->type == 1)
10599 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10600 else
10601 member->memberOffset += dataMember->memberOffset;
10602 }
10603 else
10604 {
10605 if(alignment)
10606 {
10607 short __simpleStruct0;
10608
10609 if(_class->memberOffset % alignment)
10610 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10611 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10612 }
10613 dataMember->offset = _class->memberOffset;
10614 _class->memberOffset += dataMember->memberOffset;
10615 }
10616 }
10617 }
10618 }
10619 if(bitFields)
10620 {
10621 int alignment = 0;
10622 int size = (bitFields + 7) / 8;
10623
10624 if(isMember)
10625 {
10626 int __simpleStruct0;
10627
10628 if(alignment)
10629 {
10630 short __simpleStruct0;
10631
10632 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10633 if(member->memberOffset % alignment)
10634 member->memberOffset += alignment - (member->memberOffset % alignment);
10635 }
10636 if(member->type == 1)
10637 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10638 else
10639 {
10640 member->memberOffset += size;
10641 }
10642 }
10643 else
10644 {
10645 if(alignment)
10646 {
10647 short __simpleStruct0;
10648
10649 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10650 if(_class->memberOffset % alignment)
10651 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10652 }
10653 _class->memberOffset += size;
10654 }
10655 bitFields = 0;
10656 }
10657 }
10658 if(member && member->type == 1)
10659 {
10660 member->memberOffset = unionMemberOffset;
10661 }
10662 if(!isMember)
10663 {
10664 if(_class->type != 2)
10665 {
10666 int extra = 0;
10667
10668 if(_class->structAlignment)
10669 {
10670 if(_class->memberOffset % _class->structAlignment)
10671 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
10672 }
10673 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
10674 if(!member)
10675 {
10676 struct __ecereNameSpace__ecere__com__Property * prop;
10677
10678 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
10679 {
10680 if(prop->isProperty && prop->isWatchable)
10681 {
10682 prop->watcherOffset = _class->structSize;
10683 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10684 }
10685 }
10686 }
10687 {
10688 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
10689
10690 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
10691 {
10692 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
10693
10694 if(deriv->computeSize)
10695 {
10696 deriv->offset = _class->structSize;
10697 deriv->memberOffset = 0;
10698 deriv->structSize = deriv->offset;
10699 ComputeClassMembers(deriv, 0);
10700 }
10701 }
10702 }
10703 }
10704 }
10705 }
10706 if(context)
10707 FinishTemplatesContext(context);
10708 }
10709
10710 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)
10711 {
10712 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10713 unsigned int totalSize = 0;
10714 unsigned int maxSize = 0;
10715 int alignment;
10716 unsigned int size;
10717 struct __ecereNameSpace__ecere__com__DataMember * member;
10718 int anonID = 1;
10719 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10720
10721 if(addedPadding)
10722 *addedPadding = 0;
10723 if(!isMember && _class->base)
10724 {
10725 maxSize = _class->structSize;
10726 {
10727 if(_class->type == 1 || _class->type == 5)
10728 AddMembers(neededBy, declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
10729 else
10730 {
10731 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
10732
10733 if(maxSize > baseSize)
10734 maxSize -= baseSize;
10735 else
10736 maxSize = 0;
10737 }
10738 }
10739 }
10740 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
10741 {
10742 if(!member->isProperty)
10743 {
10744 switch(member->type)
10745 {
10746 case 0:
10747 {
10748 if(member->dataTypeString)
10749 {
10750 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
10751 struct Declarator * decl;
10752
10753 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
10754 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
10755 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
10756 if(!member->dataType)
10757 member->dataType = ProcessType(specs, decl);
10758 ReplaceThisClassSpecifiers(specs, topClass);
10759 {
10760 struct Type * type = ProcessType(specs, decl);
10761
10762 DeclareType(neededBy, member->dataType, 1, 0);
10763 FreeType(type);
10764 }
10765 ComputeTypeSize(member->dataType);
10766 size = member->dataType->size;
10767 alignment = member->dataType->alignment;
10768 if(alignment)
10769 {
10770 if(totalSize % alignment)
10771 totalSize += alignment - (totalSize % alignment);
10772 }
10773 totalSize += size;
10774 }
10775 break;
10776 }
10777 case 1:
10778 case 2:
10779 {
10780 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
10781 char id[100];
10782
10783 sprintf(id, "__anon%d", anonID++);
10784 size = 0;
10785 AddMembers(neededBy, list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
10786 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
10787 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
10788 alignment = member->structAlignment;
10789 if(alignment)
10790 {
10791 if(totalSize % alignment)
10792 totalSize += alignment - (totalSize % alignment);
10793 }
10794 totalSize += size;
10795 break;
10796 }
10797 }
10798 }
10799 }
10800 if(retSize)
10801 {
10802 unsigned int __simpleStruct0;
10803
10804 if(topMember && topMember->type == 1)
10805 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
10806 else
10807 *retSize += totalSize;
10808 }
10809 else if(totalSize < maxSize && _class->type != 1000)
10810 {
10811 int autoPadding = 0;
10812
10813 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
10814 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
10815 if(totalSize + autoPadding < maxSize)
10816 {
10817 char sizeString[50];
10818
10819 sprintf(sizeString, "%d", maxSize - totalSize);
10820 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
10821 if(addedPadding)
10822 *addedPadding = 1;
10823 }
10824 }
10825 if(context)
10826 FinishTemplatesContext(context);
10827 return topMember ? topMember->memberID : _class->memberID;
10828 }
10829
10830 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)
10831 {
10832 if(source && dest)
10833 {
10834 if(warnConst)
10835 CheckConstCompatibility(source, dest, 1);
10836 if(source->kind == 20 && dest->kind != 20)
10837 {
10838 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
10839
10840 if(type)
10841 source = type;
10842 }
10843 if(dest->kind == 20 && source->kind != 20)
10844 {
10845 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
10846
10847 if(type)
10848 dest = type;
10849 }
10850 if(dest->classObjectType == 2 && dest->kind != 11)
10851 {
10852 if(source->classObjectType != 3)
10853 return 1;
10854 else
10855 {
10856 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
10857 {
10858 return 1;
10859 }
10860 }
10861 }
10862 else
10863 {
10864 if(source->kind != 11 && source->classObjectType == 3)
10865 return 1;
10866 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
10867 return 1;
10868 }
10869 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
10870 {
10871 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))
10872 return 1;
10873 }
10874 if(dest->kind == 14 && source->kind != 0)
10875 return 1;
10876 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))
10877 return 1;
10878 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))
10879 return 1;
10880 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
10881 {
10882 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
10883 {
10884 if(conversions != (((void *)0)))
10885 {
10886 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
10887 return 1;
10888 }
10889 else
10890 {
10891 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
10892
10893 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
10894 ;
10895 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
10896 ;
10897 if(sourceBase == destBase)
10898 return 1;
10899 }
10900 }
10901 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))
10902 return 1;
10903 else
10904 {
10905 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))
10906 {
10907 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
10908 {
10909 return 1;
10910 }
10911 }
10912 }
10913 }
10914 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
10915 return 1;
10916 if(doConversion)
10917 {
10918 if(source->kind == 8)
10919 {
10920 struct __ecereNameSpace__ecere__com__Class * _class;
10921
10922 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10923 {
10924 struct __ecereNameSpace__ecere__com__Property * convert;
10925
10926 for(convert = _class->conversions.first; convert; convert = convert->next)
10927 {
10928 if(convert->memberAccess == 1 || _class->module == privateModule)
10929 {
10930 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10931
10932 if(!convert->dataType)
10933 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10934 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))
10935 {
10936 if(!conversions && !convert->Get)
10937 return 1;
10938 else if(conversions != (((void *)0)))
10939 {
10940 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))
10941 return 1;
10942 else
10943 {
10944 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10945
10946 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10947 return 1;
10948 }
10949 }
10950 }
10951 }
10952 }
10953 }
10954 }
10955 if(dest->kind == 8)
10956 {
10957 struct __ecereNameSpace__ecere__com__Class * _class;
10958
10959 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10960 {
10961 struct __ecereNameSpace__ecere__com__Property * convert;
10962
10963 for(convert = _class->conversions.first; convert; convert = convert->next)
10964 {
10965 if(convert->memberAccess == 1 || _class->module == privateModule)
10966 {
10967 struct Type * constType = (((void *)0));
10968 unsigned int success = 0;
10969
10970 if(!convert->dataType)
10971 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10972 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
10973 {
10974 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10975
10976 constType = __extension__ ({
10977 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10978
10979 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
10980 });
10981 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
10982 ptrType->constant = 1;
10983 }
10984 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
10985 {
10986 if(!conversions && !convert->Set)
10987 success = 1;
10988 else if(conversions != (((void *)0)))
10989 {
10990 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))
10991 success = 1;
10992 else
10993 {
10994 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
10995
10996 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
10997 success = 1;
10998 }
10999 }
11000 }
11001 if(constType)
11002 FreeType(constType);
11003 if(success)
11004 return 1;
11005 }
11006 }
11007 }
11008 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
11009 {
11010 if(!dest->__anon1._class->__anon1.registered->dataType)
11011 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
11012 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
11013 {
11014 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))
11015 {
11016 return 1;
11017 }
11018 }
11019 }
11020 }
11021 if(source->kind == 8)
11022 {
11023 struct __ecereNameSpace__ecere__com__Class * _class;
11024
11025 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
11026 {
11027 struct __ecereNameSpace__ecere__com__Property * convert;
11028
11029 for(convert = _class->conversions.first; convert; convert = convert->next)
11030 {
11031 if(convert->memberAccess == 1 || _class->module == privateModule)
11032 {
11033 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
11034
11035 if(!convert->dataType)
11036 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
11037 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))
11038 {
11039 if(!conversions && !convert->Get)
11040 return 1;
11041 else if(conversions != (((void *)0)))
11042 {
11043 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))
11044 return 1;
11045 else
11046 {
11047 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
11048
11049 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
11050 return 1;
11051 }
11052 }
11053 }
11054 }
11055 }
11056 }
11057 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
11058 {
11059 if(!source->__anon1._class->__anon1.registered->dataType)
11060 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
11061 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
11062 {
11063 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))
11064 return 1;
11065 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
11066 return 1;
11067 }
11068 }
11069 }
11070 }
11071 if(source->kind == 8 || source->kind == 19)
11072 ;
11073 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
11074 return 1;
11075 else if(dest->kind == 7 && source->kind == 6)
11076 return 1;
11077 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
11078 return 1;
11079 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
11080 return 1;
11081 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
11082 return 1;
11083 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
11084 return 1;
11085 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
11086 return 1;
11087 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))
11088 return 1;
11089 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))
11090 return 1;
11091 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)))
11092 {
11093 struct Type * paramSource, * paramDest;
11094
11095 if(dest->kind == 16)
11096 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
11097 if(source->kind == 16)
11098 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
11099 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
11100 dest = dest->__anon1.type;
11101 if(source->kind == 13 && source->__anon1.type->kind == 11)
11102 source = source->__anon1.type;
11103 if(dest->kind == 16)
11104 dest = dest->__anon1.__anon3.method->dataType;
11105 if(source->kind == 16)
11106 source = source->__anon1.__anon3.method->dataType;
11107 paramSource = source->__anon1.__anon2.params.first;
11108 if(paramSource && paramSource->kind == 0)
11109 paramSource = (((void *)0));
11110 paramDest = dest->__anon1.__anon2.params.first;
11111 if(paramDest && paramDest->kind == 0)
11112 paramDest = (((void *)0));
11113 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11114 {
11115 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))))
11116 {
11117 if(paramDest && paramDest->kind == 8)
11118 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
11119 else
11120 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
11121 return 0;
11122 }
11123 paramDest = paramDest->next;
11124 }
11125 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
11126 {
11127 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11128 {
11129 if(dest->__anon1.__anon2.thisClass)
11130 {
11131 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
11132 {
11133 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11134 return 0;
11135 }
11136 }
11137 else
11138 {
11139 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
11140 {
11141 if(owningClassDest)
11142 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
11143 else
11144 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
11145 return 0;
11146 }
11147 }
11148 paramSource = paramSource->next;
11149 }
11150 else
11151 {
11152 if(dest->__anon1.__anon2.thisClass)
11153 {
11154 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
11155 {
11156 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11157 return 0;
11158 }
11159 }
11160 else
11161 {
11162 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
11163 {
11164 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
11165 return 0;
11166 }
11167 }
11168 }
11169 }
11170 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
11171 {
11172 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
11173 return 0;
11174 }
11175 else
11176 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
11177 for(; paramDest; paramDest = paramDest->next)
11178 {
11179 if(!paramSource)
11180 {
11181 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
11182 return 0;
11183 }
11184 {
11185 struct Type * paramDestType = paramDest;
11186 struct Type * paramSourceType = paramSource;
11187 struct Type * type = paramDestType;
11188
11189 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
11190 {
11191 int id = 0;
11192 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
11193 struct __ecereNameSpace__ecere__com__Class * sClass;
11194
11195 for(sClass = owningClassSource; sClass; sClass = sClass->base)
11196 {
11197 id = 0;
11198 if(sClass->templateClass)
11199 sClass = sClass->templateClass;
11200 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
11201 {
11202 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
11203 {
11204 for(sClass = sClass->base; sClass; sClass = sClass->base)
11205 {
11206 if(sClass->templateClass)
11207 sClass = sClass->templateClass;
11208 id += sClass->templateParams.count;
11209 }
11210 break;
11211 }
11212 id++;
11213 }
11214 if(curParam)
11215 break;
11216 }
11217 if(curParam)
11218 {
11219 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
11220
11221 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
11222 }
11223 }
11224 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)))
11225 {
11226 char type[1024];
11227
11228 type[0] = (char)0;
11229 PrintType(paramDest, type, 0, 1);
11230 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
11231 if(paramDestType != paramDest)
11232 FreeType(paramDestType);
11233 return 0;
11234 }
11235 if(paramDestType != paramDest)
11236 FreeType(paramDestType);
11237 }
11238 paramSource = paramSource->next;
11239 }
11240 if(paramSource)
11241 {
11242 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
11243 return 0;
11244 }
11245 return 1;
11246 }
11247 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
11248 {
11249 return 1;
11250 }
11251 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
11252 {
11253 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))
11254 {
11255 ComputeTypeSize(source->__anon1.type);
11256 ComputeTypeSize(dest->__anon1.type);
11257 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))
11258 return 1;
11259 }
11260 }
11261 }
11262 return 0;
11263 }
11264
11265 void ComputeInstantiation(struct Expression * exp)
11266 {
11267 struct Instantiation * inst = exp->__anon1.instance;
11268 struct MembersInit * members;
11269 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11270 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11271 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11272 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11273 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11274 int subMemberStackPos = 0;
11275 uint64 bits = 0;
11276
11277 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11278 {
11279 if(inst->data)
11280 return ;
11281 if(_class->type == 0 || _class->type == 5)
11282 {
11283 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11284 if(_class->type == 0)
11285 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11286 }
11287 else
11288 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11289 }
11290 if(inst->members)
11291 {
11292 for(members = (*inst->members).first; members; members = members->next)
11293 {
11294 switch(members->type)
11295 {
11296 case 0:
11297 {
11298 if(members->__anon1.dataMembers)
11299 {
11300 struct MemberInit * member;
11301
11302 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11303 {
11304 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11305 unsigned int found = 0;
11306 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11307 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11308 unsigned int dataMemberOffset;
11309
11310 if(!ident)
11311 {
11312 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11313 if(curMember)
11314 {
11315 if(curMember->isProperty)
11316 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11317 else
11318 {
11319 dataMember = curMember;
11320 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11321 if(_class->type == 0)
11322 dataMemberOffset += _class->base->structSize;
11323 }
11324 found = 1;
11325 }
11326 }
11327 else
11328 {
11329 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11330 if(prop)
11331 {
11332 found = 1;
11333 if(prop->memberAccess == 1)
11334 {
11335 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11336 curClass = prop->_class;
11337 }
11338 }
11339 else
11340 {
11341 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11342 int _subMemberStackPos = 0;
11343
11344 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11345 if(dataMember)
11346 {
11347 found = 1;
11348 if(dataMember->memberAccess == 1)
11349 {
11350 curMember = dataMember;
11351 curClass = dataMember->_class;
11352 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11353 subMemberStackPos = _subMemberStackPos;
11354 }
11355 }
11356 }
11357 }
11358 if(found && member->initializer && member->initializer->type == 0)
11359 {
11360 struct Expression * value = member->initializer->__anon1.exp;
11361 struct Type * type = (((void *)0));
11362 unsigned int deepMember = 0;
11363
11364 if(prop)
11365 {
11366 type = prop->dataType;
11367 }
11368 else if(dataMember)
11369 {
11370 if(!dataMember->dataType)
11371 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11372 type = dataMember->dataType;
11373 }
11374 if(ident && ident->next)
11375 {
11376 deepMember = 1;
11377 for(ident = ident->next; ident && type; ident = ident->next)
11378 {
11379 if(type->kind == 8)
11380 {
11381 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11382 if(prop)
11383 type = prop->dataType;
11384 else
11385 {
11386 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11387 if(dataMember)
11388 type = dataMember->dataType;
11389 }
11390 }
11391 else if(type->kind == 9 || type->kind == 10)
11392 {
11393 struct Type * memberType;
11394
11395 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11396 {
11397 if(!strcmp(memberType->name, ident->string))
11398 {
11399 type = memberType;
11400 break;
11401 }
11402 }
11403 }
11404 }
11405 }
11406 if(value)
11407 {
11408 FreeType(value->destType);
11409 value->destType = type;
11410 if(type)
11411 type->refCount++;
11412 ComputeExpression(value);
11413 }
11414 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11415 {
11416 if(type->kind == 8)
11417 {
11418 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11419
11420 if(_class && (_class->type == 2 || _class->type == 3 || _class->type == 4))
11421 {
11422 if(!_class->dataType)
11423 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11424 type = _class->dataType;
11425 }
11426 }
11427 if(dataMember)
11428 {
11429 void * ptr = inst->data + dataMemberOffset;
11430
11431 if(value->type == 2)
11432 {
11433 switch(type->kind)
11434 {
11435 case 3:
11436 {
11437 GetInt(value, (int *)ptr);
11438 break;
11439 }
11440 case 4:
11441 {
11442 GetInt64(value, (long long *)ptr);
11443 break;
11444 }
11445 case 22:
11446 {
11447 GetIntPtr(value, (intptr_t *)ptr);
11448 break;
11449 }
11450 case 23:
11451 {
11452 GetIntSize(value, (ssize_t *)ptr);
11453 break;
11454 }
11455 case 6:
11456 {
11457 GetFloat(value, (float *)ptr);
11458 break;
11459 }
11460 case 7:
11461 {
11462 GetDouble(value, (double *)ptr);
11463 break;
11464 }
11465 }
11466 }
11467 else if(value->type == 1)
11468 {
11469 if(type->kind == 8)
11470 {
11471 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11472
11473 if(_class->type == 1)
11474 {
11475 ComputeTypeSize(type);
11476 if(value->__anon1.instance->data)
11477 memcpy(ptr, value->__anon1.instance->data, type->size);
11478 }
11479 }
11480 }
11481 }
11482 else if(prop && prop->Set != (void *)(intptr_t)1)
11483 {
11484 if(value->type == 1 && value->__anon1.instance->data)
11485 {
11486 if(type->kind == 8)
11487 {
11488 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11489
11490 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)))
11491 {
11492 void (* Set)(void *, void *) = (void *)prop->Set;
11493
11494 Set(inst->data, value->__anon1.instance->data);
11495 PopulateInstance(inst);
11496 }
11497 }
11498 }
11499 else if(value->type == 2)
11500 {
11501 switch(type->kind)
11502 {
11503 case 7:
11504 {
11505 void (* Set)(void *, double) = (void *)prop->Set;
11506
11507 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11508 break;
11509 }
11510 case 6:
11511 {
11512 void (* Set)(void *, float) = (void *)prop->Set;
11513
11514 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11515 break;
11516 }
11517 case 3:
11518 {
11519 void (* Set)(void *, int) = (void *)prop->Set;
11520
11521 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11522 break;
11523 }
11524 case 4:
11525 {
11526 void (* Set)(void *, long long) = (void *)prop->Set;
11527
11528 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11529 break;
11530 }
11531 case 22:
11532 {
11533 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11534
11535 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11536 break;
11537 }
11538 case 23:
11539 {
11540 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11541
11542 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11543 break;
11544 }
11545 }
11546 }
11547 else if(value->type == 3)
11548 {
11549 char temp[1024];
11550
11551 ReadString(temp, value->__anon1.__anon2.string);
11552 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11553 }
11554 }
11555 }
11556 else if(!deepMember && type && _class->type == 3)
11557 {
11558 if(prop)
11559 {
11560 if(value->type == 2)
11561 {
11562 if(type->kind == 8)
11563 {
11564 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11565
11566 if(_class->type == 3)
11567 {
11568 if(!_class->dataType)
11569 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11570 type = _class->dataType;
11571 }
11572 }
11573 switch(type->kind)
11574 {
11575 case 6:
11576 {
11577 float fValue;
11578 float (* Set)(float) = (void *)prop->Set;
11579
11580 GetFloat(member->initializer->__anon1.exp, &fValue);
11581 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11582 exp->type = 2;
11583 break;
11584 }
11585 case 7:
11586 {
11587 double dValue;
11588 double (* Set)(double) = (void *)prop->Set;
11589
11590 GetDouble(member->initializer->__anon1.exp, &dValue);
11591 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11592 exp->type = 2;
11593 break;
11594 }
11595 }
11596 }
11597 }
11598 }
11599 else if(!deepMember && type && _class->type == 2)
11600 {
11601 if(prop)
11602 {
11603 if(value->type == 1 && value->__anon1.instance->data)
11604 {
11605 unsigned int (* Set)(void *) = (void *)prop->Set;
11606
11607 bits = Set(value->__anon1.instance->data);
11608 }
11609 else if(value->type == 2)
11610 {
11611 }
11612 }
11613 else if(dataMember)
11614 {
11615 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11616 struct Type * type;
11617 uint64 part = 0;
11618
11619 bits = (bits & ~bitMember->mask);
11620 if(!bitMember->dataType)
11621 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11622 type = bitMember->dataType;
11623 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11624 {
11625 if(!type->__anon1._class->__anon1.registered->dataType)
11626 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11627 type = type->__anon1._class->__anon1.registered->dataType;
11628 }
11629 switch(type->kind)
11630 {
11631 case 24:
11632 case 1:
11633 {
11634 unsigned char v;
11635
11636 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11637 part = (uint64)v;
11638 break;
11639 }
11640 case 2:
11641 {
11642 unsigned short v;
11643
11644 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11645 part = (uint64)v;
11646 break;
11647 }
11648 case 3:
11649 case 5:
11650 {
11651 unsigned int v;
11652
11653 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11654 part = (uint64)v;
11655 break;
11656 }
11657 case 4:
11658 {
11659 uint64 v;
11660
11661 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11662 part = v;
11663 break;
11664 }
11665 case 22:
11666 {
11667 uintptr_t v;
11668
11669 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11670 part = (uint64)v;
11671 break;
11672 }
11673 case 23:
11674 {
11675 size_t v;
11676
11677 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11678 part = (uint64)v;
11679 break;
11680 }
11681 }
11682 bits |= part << bitMember->pos;
11683 }
11684 }
11685 }
11686 else
11687 {
11688 if(_class && _class->type == 3)
11689 {
11690 ComputeExpression(member->initializer->__anon1.exp);
11691 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11692 exp->type = 2;
11693 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11694 }
11695 }
11696 }
11697 }
11698 break;
11699 }
11700 }
11701 }
11702 }
11703 if(_class && _class->type == 2)
11704 {
11705 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11706 exp->type = 2;
11707 }
11708 if(exp->type != 1)
11709 {
11710 FreeInstance(inst);
11711 }
11712 }
11713
11714 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11715 {
11716 if(exp->__anon1.op.op == SIZEOF)
11717 {
11718 FreeExpContents(exp);
11719 exp->type = 2;
11720 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11721 }
11722 else
11723 {
11724 if(!exp->__anon1.op.exp1)
11725 {
11726 switch(exp->__anon1.op.op)
11727 {
11728 case '+':
11729 {
11730 struct Expression * exp2 = exp->__anon1.op.exp2;
11731
11732 exp->__anon1.op.exp2 = (((void *)0));
11733 FreeExpContents(exp);
11734 FreeType(exp->expType);
11735 FreeType(exp->destType);
11736 *exp = *exp2;
11737 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11738 break;
11739 }
11740 case '-':
11741 if(op1->ops.Neg)
11742 {
11743 FreeExpContents(exp);
11744 op1->ops.Neg(exp, op1);
11745 }
11746 break;
11747 case '~':
11748 if(op1->ops.BitNot)
11749 {
11750 FreeExpContents(exp);
11751 op1->ops.BitNot(exp, op1);
11752 }
11753 break;
11754 case '!':
11755 if(op1->ops.Not)
11756 {
11757 FreeExpContents(exp);
11758 op1->ops.Not(exp, op1);
11759 }
11760 break;
11761 }
11762 }
11763 else
11764 {
11765 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11766 {
11767 if(Promote(op2, op1->kind, op1->type->isSigned))
11768 op2->kind = op1->kind, op2->ops = op1->ops;
11769 else if(Promote(op1, op2->kind, op2->type->isSigned))
11770 op1->kind = op2->kind, op1->ops = op2->ops;
11771 }
11772 switch(exp->__anon1.op.op)
11773 {
11774 case '+':
11775 if(op1->ops.Add)
11776 {
11777 FreeExpContents(exp);
11778 op1->ops.Add(exp, op1, op2);
11779 }
11780 break;
11781 case '-':
11782 if(op1->ops.Sub)
11783 {
11784 FreeExpContents(exp);
11785 op1->ops.Sub(exp, op1, op2);
11786 }
11787 break;
11788 case '*':
11789 if(op1->ops.Mul)
11790 {
11791 FreeExpContents(exp);
11792 op1->ops.Mul(exp, op1, op2);
11793 }
11794 break;
11795 case '/':
11796 if(op1->ops.Div)
11797 {
11798 FreeExpContents(exp);
11799 op1->ops.Div(exp, op1, op2);
11800 }
11801 break;
11802 case '%':
11803 if(op1->ops.Mod)
11804 {
11805 FreeExpContents(exp);
11806 op1->ops.Mod(exp, op1, op2);
11807 }
11808 break;
11809 case '&':
11810 if(exp->__anon1.op.exp2)
11811 {
11812 if(op1->ops.BitAnd)
11813 {
11814 FreeExpContents(exp);
11815 op1->ops.BitAnd(exp, op1, op2);
11816 }
11817 }
11818 break;
11819 case '|':
11820 if(op1->ops.BitOr)
11821 {
11822 FreeExpContents(exp);
11823 op1->ops.BitOr(exp, op1, op2);
11824 }
11825 break;
11826 case '^':
11827 if(op1->ops.BitXor)
11828 {
11829 FreeExpContents(exp);
11830 op1->ops.BitXor(exp, op1, op2);
11831 }
11832 break;
11833 case LEFT_OP:
11834 if(op1->ops.LShift)
11835 {
11836 FreeExpContents(exp);
11837 op1->ops.LShift(exp, op1, op2);
11838 }
11839 break;
11840 case RIGHT_OP:
11841 if(op1->ops.RShift)
11842 {
11843 FreeExpContents(exp);
11844 op1->ops.RShift(exp, op1, op2);
11845 }
11846 break;
11847 case EQ_OP:
11848 if(op1->ops.Equ)
11849 {
11850 FreeExpContents(exp);
11851 op1->ops.Equ(exp, op1, op2);
11852 }
11853 break;
11854 case NE_OP:
11855 if(op1->ops.Nqu)
11856 {
11857 FreeExpContents(exp);
11858 op1->ops.Nqu(exp, op1, op2);
11859 }
11860 break;
11861 case AND_OP:
11862 if(op1->ops.And)
11863 {
11864 FreeExpContents(exp);
11865 op1->ops.And(exp, op1, op2);
11866 }
11867 break;
11868 case OR_OP:
11869 if(op1->ops.Or)
11870 {
11871 FreeExpContents(exp);
11872 op1->ops.Or(exp, op1, op2);
11873 }
11874 break;
11875 case '>':
11876 if(op1->ops.Grt)
11877 {
11878 FreeExpContents(exp);
11879 op1->ops.Grt(exp, op1, op2);
11880 }
11881 break;
11882 case '<':
11883 if(op1->ops.Sma)
11884 {
11885 FreeExpContents(exp);
11886 op1->ops.Sma(exp, op1, op2);
11887 }
11888 break;
11889 case GE_OP:
11890 if(op1->ops.GrtEqu)
11891 {
11892 FreeExpContents(exp);
11893 op1->ops.GrtEqu(exp, op1, op2);
11894 }
11895 break;
11896 case LE_OP:
11897 if(op1->ops.SmaEqu)
11898 {
11899 FreeExpContents(exp);
11900 op1->ops.SmaEqu(exp, op1, op2);
11901 }
11902 break;
11903 }
11904 }
11905 }
11906 }
11907
11908 void ApplyAnyObjectLogic(struct Expression * e)
11909 {
11910 struct Type * destType = e->destType;
11911
11912 if(destType && (destType->classObjectType == 3))
11913 {
11914 if(e && e->expType)
11915 {
11916 struct Type * type = e->expType;
11917 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11918
11919 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11920 {
11921 _class = type->__anon1._class->__anon1.registered;
11922 }
11923 else if(type->kind == 19)
11924 {
11925 _class = FindClass("ecere::com::Class")->__anon1.registered;
11926 }
11927 else
11928 {
11929 char string[1024] = "";
11930 struct Symbol * classSym;
11931
11932 PrintTypeNoConst(type, string, 0, 1);
11933 classSym = FindClass(string);
11934 if(classSym)
11935 _class = classSym->__anon1.registered;
11936 }
11937 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)))
11938 {
11939 if(!_class || strcmp(_class->fullName, "char *"))
11940 {
11941 struct Expression * checkedExp = e, * newExp;
11942
11943 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11944 {
11945 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11946 {
11947 if(checkedExp->type == 23)
11948 {
11949 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11950 }
11951 else
11952 checkedExp = (*checkedExp->__anon1.list).last;
11953 }
11954 else if(checkedExp->type == 11)
11955 checkedExp = checkedExp->__anon1.cast.exp;
11956 }
11957 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
11958 {
11959 newExp = checkedExp->__anon1.op.exp2;
11960 checkedExp->__anon1.op.exp2 = (((void *)0));
11961 FreeExpContents(checkedExp);
11962 if(e->expType && e->expType->passAsTemplate)
11963 {
11964 char size[100];
11965
11966 ComputeTypeSize(e->expType);
11967 sprintf(size, "%d", e->expType->size);
11968 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))))));
11969 }
11970 ReplaceExpContents(checkedExp, newExp);
11971 e->byReference = 1;
11972 }
11973 else if(!e->byReference || (_class && _class->type == 5))
11974 {
11975 struct Expression * checkedExp;
11976
11977 {
11978 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;
11979
11980 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11981 {
11982 struct Context * context = PushContext();
11983 struct Declarator * decl;
11984 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11985 char typeString[1024];
11986 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11987
11988 typeString[0] = '\0';
11989 *newExp = *e;
11990 newExp->prev = (((void *)0));
11991 newExp->next = (((void *)0));
11992 newExp->expType = (((void *)0));
11993 PrintTypeNoConst(e->expType, typeString, 0, 1);
11994 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11995 newExp->destType = ProcessType(specs, decl);
11996 curContext = context;
11997 if(curCompound)
11998 {
11999 char name[100];
12000 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12001
12002 e->type = 23;
12003 sprintf(name, "__internalValue%03X", internalValueCounter++);
12004 if(!curCompound->__anon1.compound.declarations)
12005 curCompound->__anon1.compound.declarations = MkList();
12006 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12007 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12008 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12009 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
12010 }
12011 else
12012 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12013 {
12014 struct Type * type = e->destType;
12015
12016 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12017 CopyTypeInto(e->destType, type);
12018 e->destType->refCount = 1;
12019 e->destType->classObjectType = 0;
12020 FreeType(type);
12021 }
12022 e->__anon1.compound->__anon1.compound.context = context;
12023 PopContext(context);
12024 curContext = context->parent;
12025 }
12026 }
12027 checkedExp = e;
12028 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
12029 {
12030 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
12031 {
12032 if(checkedExp->type == 23)
12033 {
12034 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12035 }
12036 else
12037 checkedExp = (*checkedExp->__anon1.list).last;
12038 }
12039 else if(checkedExp->type == 11)
12040 checkedExp = checkedExp->__anon1.cast.exp;
12041 }
12042 {
12043 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12044
12045 *operand = *checkedExp;
12046 __ecereMethod_Expression_Clear(checkedExp);
12047 checkedExp->destType = ProcessTypeString("void *", 0);
12048 checkedExp->expType = checkedExp->destType;
12049 checkedExp->destType->refCount++;
12050 checkedExp->type = 4;
12051 checkedExp->__anon1.op.op = '&';
12052 checkedExp->__anon1.op.exp1 = (((void *)0));
12053 checkedExp->__anon1.op.exp2 = operand;
12054 }
12055 }
12056 }
12057 }
12058 }
12059 }
12060 {
12061 }
12062 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))))
12063 {
12064 if(e->expType->classObjectType && destType && destType->classObjectType)
12065 {
12066 return ;
12067 }
12068 else
12069 {
12070 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12071
12072 *thisExp = *e;
12073 thisExp->prev = (((void *)0));
12074 thisExp->next = (((void *)0));
12075 __ecereMethod_Expression_Clear(e);
12076 e->type = 5;
12077 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12078 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
12079 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
12080 {
12081 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12082 CopyTypeInto(e->expType, thisExp->expType);
12083 e->expType->byReference = 0;
12084 e->expType->refCount = 1;
12085 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))
12086 {
12087 e->expType->classObjectType = 0;
12088 }
12089 }
12090 }
12091 }
12092 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12093 {
12094 if(destType->kind == 14)
12095 {
12096 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
12097 }
12098 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))
12099 {
12100 unsigned int byReference = e->expType->byReference;
12101 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12102 struct Declarator * decl;
12103 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12104 char typeString[1024];
12105 struct Type * type;
12106 int backupClassObjectType;
12107 unsigned int backupByReference;
12108
12109 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
12110 type = e->expType;
12111 else
12112 type = destType;
12113 backupClassObjectType = type->classObjectType;
12114 backupByReference = type->byReference;
12115 type->classObjectType = 0;
12116 type->byReference = 0;
12117 typeString[0] = '\0';
12118 PrintType(type, typeString, 0, 1);
12119 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12120 type->classObjectType = backupClassObjectType;
12121 type->byReference = backupByReference;
12122 *thisExp = *e;
12123 thisExp->prev = (((void *)0));
12124 thisExp->next = (((void *)0));
12125 __ecereMethod_Expression_Clear(e);
12126 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)))
12127 {
12128 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
12129 struct Type * t;
12130
12131 destType->refCount++;
12132 e->type = 4;
12133 e->__anon1.op.op = '*';
12134 e->__anon1.op.exp1 = (((void *)0));
12135 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12136 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12137 CopyTypeInto(t, thisExp->destType);
12138 t->passAsTemplate = 0;
12139 FreeType(thisExp->destType);
12140 thisExp->destType = t;
12141 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12142 CopyTypeInto(t, destType);
12143 t->passAsTemplate = passAsTemplate;
12144 FreeType(destType);
12145 destType = t;
12146 destType->refCount = 0;
12147 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12148 CopyTypeInto(e->expType, type);
12149 if(type->passAsTemplate)
12150 {
12151 e->expType->classObjectType = 0;
12152 e->expType->passAsTemplate = 0;
12153 }
12154 e->expType->byReference = 0;
12155 e->expType->refCount = 1;
12156 }
12157 else
12158 {
12159 e->type = 11;
12160 e->__anon1.cast.typeName = MkTypeName(specs, decl);
12161 e->__anon1.cast.exp = thisExp;
12162 e->byReference = 1;
12163 e->expType = type;
12164 type->refCount++;
12165 }
12166 if(e->destType)
12167 FreeType(e->destType);
12168 e->destType = destType;
12169 destType->refCount++;
12170 }
12171 }
12172 }
12173
12174 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
12175 {
12176 struct __ecereNameSpace__ecere__com__Class * _class;
12177 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
12178
12179 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
12180 ComputeModuleClasses(subModule->data);
12181 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->classes.first; _class; _class = _class->next)
12182 ComputeClassMembers(_class, 0);
12183 }
12184
12185 int ComputeTypeSize(struct Type * type)
12186 {
12187 unsigned int size = type ? type->size : 0;
12188
12189 if(!size && type && !type->computing)
12190 {
12191 type->computing = 1;
12192 switch(type->kind)
12193 {
12194 case 24:
12195 type->alignment = size = sizeof(char);
12196 break;
12197 case 1:
12198 type->alignment = size = sizeof(char);
12199 break;
12200 case 3:
12201 type->alignment = size = sizeof(int);
12202 break;
12203 case 4:
12204 type->alignment = size = sizeof(long long);
12205 break;
12206 case 22:
12207 type->alignment = size = targetBits / 8;
12208 type->pointerAlignment = 1;
12209 break;
12210 case 23:
12211 type->alignment = size = targetBits / 8;
12212 type->pointerAlignment = 1;
12213 break;
12214 case 5:
12215 type->alignment = size = sizeof(long);
12216 break;
12217 case 2:
12218 type->alignment = size = sizeof(short);
12219 break;
12220 case 6:
12221 type->alignment = size = sizeof(float);
12222 break;
12223 case 7:
12224 type->alignment = size = sizeof(double);
12225 break;
12226 case 8:
12227 {
12228 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
12229
12230 if(_class && _class->type == 1)
12231 {
12232 ComputeClassMembers(_class, 0);
12233 type->alignment = _class->structAlignment;
12234 type->pointerAlignment = (unsigned int)_class->pointerAlignment;
12235 size = _class->structSize;
12236 if(type->alignment && size % type->alignment)
12237 size += type->alignment - (size % type->alignment);
12238 }
12239 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
12240 {
12241 if(!_class->dataType)
12242 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12243 size = type->alignment = ComputeTypeSize(_class->dataType);
12244 }
12245 else
12246 {
12247 size = type->alignment = targetBits / 8;
12248 type->pointerAlignment = 1;
12249 }
12250 break;
12251 }
12252 case 13:
12253 case 19:
12254 size = type->alignment = targetBits / 8;
12255 type->pointerAlignment = 1;
12256 break;
12257 case 12:
12258 if(type->__anon1.__anon4.arraySizeExp)
12259 {
12260 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
12261 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
12262 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)))
12263 {
12264 struct Location oldLoc = yylloc;
12265 char expression[10240];
12266
12267 expression[0] = '\0';
12268 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
12269 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
12270 if(inCompiler)
12271 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
12272 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
12273 yylloc = oldLoc;
12274 }
12275 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
12276 }
12277 else if(type->__anon1.__anon4.enumClass)
12278 {
12279 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
12280 {
12281 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
12282 }
12283 else
12284 type->__anon1.__anon4.arraySize = 0;
12285 }
12286 else
12287 {
12288 type->__anon1.__anon4.arraySize = 0;
12289 }
12290 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
12291 if(type->__anon1.type)
12292 {
12293 type->alignment = type->__anon1.type->alignment;
12294 type->pointerAlignment = type->__anon1.type->pointerAlignment;
12295 }
12296 break;
12297 case 9:
12298 {
12299 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12300 {
12301 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12302
12303 if(symbol && symbol->type)
12304 {
12305 ComputeTypeSize(symbol->type);
12306 size = symbol->type->size;
12307 }
12308 }
12309 else
12310 {
12311 struct Type * member;
12312
12313 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12314 {
12315 int __simpleStruct0, __simpleStruct1;
12316 unsigned int addSize = ComputeTypeSize(member);
12317
12318 member->offset = size;
12319 if(member->alignment && size % member->alignment)
12320 member->offset += member->alignment - (size % member->alignment);
12321 size = member->offset;
12322 if(member->pointerAlignment && type->size <= 4)
12323 type->pointerAlignment = 1;
12324 else if(!member->pointerAlignment && member->alignment >= 8)
12325 type->pointerAlignment = 0;
12326 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12327 size += addSize;
12328 }
12329 if(type->alignment && size % type->alignment)
12330 size += type->alignment - (size % type->alignment);
12331 }
12332 break;
12333 }
12334 case 10:
12335 {
12336 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12337 {
12338 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12339
12340 if(symbol && symbol->type)
12341 {
12342 ComputeTypeSize(symbol->type);
12343 size = symbol->type->size;
12344 type->alignment = symbol->type->alignment;
12345 }
12346 }
12347 else
12348 {
12349 struct Type * member;
12350
12351 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12352 {
12353 int __simpleStruct0, __simpleStruct1;
12354 unsigned int addSize = ComputeTypeSize(member);
12355
12356 member->offset = size;
12357 if(member->alignment && size % member->alignment)
12358 member->offset += member->alignment - (size % member->alignment);
12359 size = member->offset;
12360 if(member->pointerAlignment && type->size <= 4)
12361 type->pointerAlignment = 1;
12362 else if(!member->pointerAlignment && member->alignment >= 8)
12363 type->pointerAlignment = 0;
12364 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12365 size = ((size > addSize) ? size : addSize);
12366 }
12367 if(type->alignment && size % type->alignment)
12368 size += type->alignment - (size % type->alignment);
12369 }
12370 break;
12371 }
12372 case 20:
12373 {
12374 struct TemplateParameter * param = type->__anon1.templateParameter;
12375 struct Type * baseType = ProcessTemplateParameterType(param);
12376
12377 if(baseType)
12378 {
12379 size = ComputeTypeSize(baseType);
12380 type->alignment = baseType->alignment;
12381 type->pointerAlignment = baseType->pointerAlignment;
12382 }
12383 else
12384 type->alignment = size = sizeof(uint64);
12385 break;
12386 }
12387 case 15:
12388 {
12389 type->alignment = size = sizeof(enum
12390 {
12391 test
12392 });
12393 break;
12394 }
12395 case 21:
12396 {
12397 type->alignment = size = targetBits / 8;
12398 type->pointerAlignment = 1;
12399 break;
12400 }
12401 }
12402 type->size = size;
12403 type->computing = 0;
12404 }
12405 return size;
12406 }
12407
12408 struct External * _DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl)
12409 {
12410 struct External * external = (((void *)0));
12411 struct Symbol * classSym = FindClass(name);
12412 struct __ecereNameSpace__ecere__sys__OldList * curDeclarations = (((void *)0));
12413 struct Specifier * curSpec = (((void *)0));
12414
12415 if(!inCompiler || !classSym)
12416 return (((void *)0));
12417 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
12418 return (((void *)0));
12419 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
12420 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
12421 external = classSym->__anon2.__anon1.structExternal;
12422 if(external && external->__anon1.declaration)
12423 {
12424 struct Specifier * spec;
12425
12426 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12427 if(spec->type == 3 || spec->type == 4)
12428 {
12429 curSpec = spec;
12430 curDeclarations = spec->__anon1.__anon2.definitions;
12431 break;
12432 }
12433 }
12434 if(classSym->__anon1.registered && !classSym->declaring && classSym->imported && (!classSym->declaredStructSym || (classSym->__anon1.registered->type == 5 && !skipNoHead && external && !curDeclarations)))
12435 {
12436 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12437 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
12438 char structName[1024];
12439 unsigned int addedPadding = 0;
12440
12441 classSym->declaring++;
12442 if(strchr(classSym->string, '<'))
12443 {
12444 if(classSym->__anon1.registered->templateClass)
12445 {
12446 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
12447 classSym->declaring--;
12448 }
12449 return external;
12450 }
12451 structName[0] = (char)0;
12452 FullClassNameCat(structName, name, 0);
12453 classSym->declaredStructSym = 1;
12454 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
12455 {
12456 unsigned int add = 0;
12457
12458 if(!external)
12459 {
12460 external = MkExternalDeclaration((((void *)0)));
12461 classSym->__anon2.__anon1.structExternal = external;
12462 external->symbol = classSym;
12463 add = 1;
12464 }
12465 if(!skipNoHead)
12466 {
12467 declarations = MkList();
12468 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
12469 }
12470 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
12471 {
12472 FreeList(declarations, (void *)(FreeClassDef));
12473 declarations = (((void *)0));
12474 }
12475 if(classSym->__anon1.registered->type != 5 && !declarations)
12476 {
12477 FreeExternal(external);
12478 external = (((void *)0));
12479 classSym->__anon2.__anon1.structExternal = (((void *)0));
12480 }
12481 else
12482 {
12483 if(curSpec)
12484 curSpec->__anon1.__anon2.definitions = declarations;
12485 else
12486 {
12487 char className[1024];
12488
12489 strcpy(className, "__ecereClass_");
12490 FullClassNameCat(className, classSym->string, 1);
12491 specifiers = MkList();
12492 declarators = MkList();
12493 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
12494 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12495 }
12496 if(add)
12497 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12498 }
12499 }
12500 classSym->declaring--;
12501 }
12502 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
12503 {
12504 classSym->declaredStructSym = 1;
12505 if(classSym->__anon1.registered)
12506 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
12507 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
12508 {
12509 struct Specifier * spec;
12510
12511 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
12512 {
12513 if(spec->__anon1.__anon2.definitions)
12514 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
12515 }
12516 }
12517 }
12518 if(inCompiler && neededBy && (external || !classSym->imported))
12519 {
12520 if(!external)
12521 {
12522 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
12523 external->symbol = classSym;
12524 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12525 }
12526 if(fwdDecl)
12527 {
12528 struct External * e = external->fwdDecl ? external->fwdDecl : external;
12529
12530 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
12531 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
12532 }
12533 else
12534 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
12535 }
12536 return external;
12537 }
12538
12539 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)
12540 {
12541 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
12542 unsigned int found = 0;
12543 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
12544 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12545 unsigned int freeType = 0;
12546
12547 yylloc = member->loc;
12548 if(!ident)
12549 {
12550 if(curMember)
12551 {
12552 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
12553 if(*curMember)
12554 {
12555 found = 1;
12556 dataMember = *curMember;
12557 }
12558 }
12559 }
12560 else
12561 {
12562 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
12563 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
12564 int _subMemberStackPos = 0;
12565
12566 if(!thisMember)
12567 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
12568 if(thisMember)
12569 {
12570 dataMember = thisMember;
12571 if(curMember && thisMember->memberAccess == 1)
12572 {
12573 *curMember = thisMember;
12574 *curClass = thisMember->_class;
12575 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
12576 *subMemberStackPos = _subMemberStackPos;
12577 }
12578 found = 1;
12579 }
12580 else
12581 {
12582 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
12583 if(method && method->type == 1)
12584 found = 1;
12585 else
12586 method = (((void *)0));
12587 }
12588 }
12589 if(found)
12590 {
12591 struct Type * type = (((void *)0));
12592
12593 if(dataMember)
12594 {
12595 if(!dataMember->dataType && dataMember->dataTypeString)
12596 {
12597 struct Context * context = SetupTemplatesContext(_class);
12598
12599 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12600 FinishTemplatesContext(context);
12601 }
12602 type = dataMember->dataType;
12603 }
12604 else if(method)
12605 {
12606 if(!method->dataType)
12607 ProcessMethodType(method);
12608 type = method->dataType;
12609 }
12610 if(ident && ident->next)
12611 {
12612 for(ident = ident->next; ident && type; ident = ident->next)
12613 {
12614 if(type->kind == 8)
12615 {
12616 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
12617 if(!dataMember)
12618 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
12619 if(dataMember)
12620 type = dataMember->dataType;
12621 }
12622 else if(type->kind == 9 || type->kind == 10)
12623 {
12624 struct Type * memberType;
12625
12626 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
12627 {
12628 if(!strcmp(memberType->name, ident->string))
12629 {
12630 type = memberType;
12631 break;
12632 }
12633 }
12634 }
12635 }
12636 }
12637 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
12638 {
12639 int id = 0;
12640 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
12641 struct __ecereNameSpace__ecere__com__Class * sClass;
12642
12643 for(sClass = _class; sClass; sClass = sClass->base)
12644 {
12645 id = 0;
12646 if(sClass->templateClass)
12647 sClass = sClass->templateClass;
12648 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
12649 {
12650 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
12651 {
12652 for(sClass = sClass->base; sClass; sClass = sClass->base)
12653 {
12654 if(sClass->templateClass)
12655 sClass = sClass->templateClass;
12656 id += sClass->templateParams.count;
12657 }
12658 break;
12659 }
12660 id++;
12661 }
12662 if(curParam)
12663 break;
12664 }
12665 if(curParam)
12666 {
12667 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
12668
12669 if(arg.__anon1.__anon1.dataTypeString)
12670 {
12671 unsigned int constant = type->constant;
12672
12673 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
12674 if(type->kind == 8 && constant)
12675 type->constant = 1;
12676 else if(type->kind == 13)
12677 {
12678 struct Type * t = type->__anon1.type;
12679
12680 while(t->kind == 13)
12681 t = t->__anon1.type;
12682 if(constant)
12683 t->constant = constant;
12684 }
12685 freeType = 1;
12686 if(type && _class->templateClass)
12687 type->passAsTemplate = 1;
12688 if(type)
12689 {
12690 }
12691 }
12692 }
12693 }
12694 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
12695 {
12696 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
12697 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
12698 int paramCount = 0;
12699 int lastParam = -1;
12700 char templateString[1024];
12701 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
12702
12703 sprintf(templateString, "%s<", expClass->templateClass->fullName);
12704 for(cClass = expClass; cClass; cClass = cClass->base)
12705 {
12706 int p = 0;
12707
12708 if(cClass->templateClass)
12709 cClass = cClass->templateClass;
12710 for(param = cClass->templateParams.first; param; param = param->next)
12711 {
12712 int id = p;
12713 struct __ecereNameSpace__ecere__com__Class * sClass;
12714 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
12715
12716 for(sClass = cClass->base; sClass; sClass = sClass->base)
12717 {
12718 if(sClass->templateClass)
12719 sClass = sClass->templateClass;
12720 id += sClass->templateParams.count;
12721 }
12722 arg = expClass->templateArgs[id];
12723 for(sClass = _class; sClass; sClass = sClass->base)
12724 {
12725 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
12726 int p = 0;
12727 struct __ecereNameSpace__ecere__com__Class * nextClass;
12728
12729 if(sClass->templateClass)
12730 sClass = sClass->templateClass;
12731 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
12732 {
12733 if(nextClass->templateClass)
12734 nextClass = nextClass->templateClass;
12735 p += nextClass->templateParams.count;
12736 }
12737 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
12738 {
12739 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
12740 {
12741 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12742 {
12743 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
12744 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
12745 break;
12746 }
12747 }
12748 }
12749 }
12750 {
12751 char argument[256];
12752
12753 argument[0] = '\0';
12754 switch(param->type)
12755 {
12756 case 2:
12757 {
12758 char expString[1024];
12759 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12760 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
12761 struct Expression * exp;
12762 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
12763
12764 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
12765 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
12766 ProcessExpressionType(exp);
12767 ComputeExpression(exp);
12768 expString[0] = '\0';
12769 PrintExpression(exp, expString);
12770 strcat(argument, expString);
12771 FreeExpression(exp);
12772 break;
12773 }
12774 case 1:
12775 {
12776 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
12777 break;
12778 }
12779 case 0:
12780 {
12781 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12782 strcat(argument, arg.__anon1.__anon1.dataTypeString);
12783 break;
12784 }
12785 }
12786 if(argument[0])
12787 {
12788 if(paramCount)
12789 strcat(templateString, ", ");
12790 if(lastParam != p - 1)
12791 {
12792 strcat(templateString, param->name);
12793 strcat(templateString, " = ");
12794 }
12795 strcat(templateString, argument);
12796 paramCount++;
12797 lastParam = p;
12798 }
12799 p++;
12800 }
12801 }
12802 }
12803 {
12804 int len = strlen(templateString);
12805
12806 if(templateString[len - 1] == '<')
12807 len--;
12808 else
12809 {
12810 if(templateString[len - 1] == '>')
12811 templateString[len++] = ' ';
12812 templateString[len++] = '>';
12813 }
12814 templateString[len++] = '\0';
12815 }
12816 {
12817 struct Context * context = SetupTemplatesContext(_class);
12818
12819 if(freeType)
12820 FreeType(type);
12821 type = ProcessTypeString(templateString, 0);
12822 freeType = 1;
12823 FinishTemplatesContext(context);
12824 }
12825 }
12826 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
12827 {
12828 ProcessExpressionType(member->initializer->__anon1.exp);
12829 if(!member->initializer->__anon1.exp->expType)
12830 {
12831 if(inCompiler)
12832 {
12833 char expString[10240];
12834
12835 expString[0] = '\0';
12836 PrintExpression(member->initializer->__anon1.exp, expString);
12837 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12838 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
12839 }
12840 }
12841 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
12842 {
12843 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
12844 }
12845 }
12846 else if(member->initializer)
12847 {
12848 ProcessInitializer(member->initializer, type);
12849 }
12850 if(freeType)
12851 FreeType(type);
12852 }
12853 else
12854 {
12855 if(_class && _class->type == 3)
12856 {
12857 if(member->initializer)
12858 {
12859 struct Type * type = MkClassType(_class->fullName);
12860
12861 ProcessInitializer(member->initializer, type);
12862 FreeType(type);
12863 }
12864 }
12865 else
12866 {
12867 if(member->initializer)
12868 {
12869 ProcessInitializer(member->initializer, (((void *)0)));
12870 }
12871 if(ident)
12872 {
12873 if(method)
12874 {
12875 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12876 }
12877 else if(_class)
12878 {
12879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12880 if(inCompiler)
12881 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
12882 }
12883 }
12884 else if(_class)
12885 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
12886 }
12887 }
12888 }
12889
12890 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
12891 {
12892 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
12893
12894 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)))
12895 {
12896 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
12897
12898 if(_class->type == 4)
12899 {
12900 struct __ecereNameSpace__ecere__sys__OldList converts =
12901 {
12902 0, 0, 0, 0, 0
12903 };
12904 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12905
12906 type->kind = 8;
12907 if(!_class->symbol)
12908 _class->symbol = FindClass(_class->fullName);
12909 type->__anon1._class = _class->symbol;
12910 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))
12911 {
12912 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12913 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12914
12915 if(enumClass)
12916 {
12917 struct __ecereNameSpace__ecere__com__Class * baseClass;
12918
12919 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12920 {
12921 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12922
12923 for(value = e->values.first; value; value = value->next)
12924 {
12925 if(!strcmp(value->name, string))
12926 break;
12927 }
12928 if(value)
12929 {
12930 FreeType(sourceExp->expType);
12931 sourceExp->isConstant = 1;
12932 sourceExp->expType = MkClassType(baseClass->fullName);
12933 if(inCompiler || inPreCompiler || inDebugger)
12934 {
12935 char constant[256];
12936
12937 FreeExpContents(sourceExp);
12938 sourceExp->type = 2;
12939 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
12940 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
12941 else
12942 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
12943 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12944 }
12945 while(converts.first)
12946 {
12947 struct Conversion * convert = converts.first;
12948
12949 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
12950 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
12951 }
12952 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12953 return 1;
12954 }
12955 }
12956 }
12957 }
12958 if(converts.first)
12959 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12960 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12961 }
12962 }
12963 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)))
12964 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
12965 return 1;
12966 return 0;
12967 }
12968
12969 void ComputeExpression(struct Expression * exp)
12970 {
12971 switch(exp->type)
12972 {
12973 case 0:
12974 {
12975 struct Identifier * id = exp->__anon1.__anon1.identifier;
12976
12977 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
12978 {
12979 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
12980
12981 if(c && c->type == 4)
12982 {
12983 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12984
12985 if(enumClass)
12986 {
12987 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12988 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
12989
12990 for(value = e->values.first; value; value = value->next)
12991 {
12992 if(!strcmp(value->name, id->string))
12993 break;
12994 }
12995 if(value)
12996 {
12997 const char * dts = c->dataTypeString;
12998
12999 FreeExpContents(exp);
13000 exp->type = 2;
13001 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
13002 }
13003 }
13004 }
13005 }
13006 break;
13007 }
13008 case 1:
13009 {
13010 ComputeInstantiation(exp);
13011 break;
13012 }
13013 case 4:
13014 {
13015 struct Expression * exp1, * exp2 = (((void *)0));
13016 struct Operand op1 =
13017 {
13018 0, 0, 0,
13019 .__anon1 = {
13020 .c = 0
13021 },
13022 {
13023 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13024 }
13025 };
13026 struct Operand op2 =
13027 {
13028 0, 0, 0,
13029 .__anon1 = {
13030 .c = 0
13031 },
13032 {
13033 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13034 }
13035 };
13036
13037 if(exp->__anon1.op.exp2)
13038 {
13039 struct Expression * e = exp->__anon1.op.exp2;
13040
13041 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13042 {
13043 if(e->type == 5 || e->type == 32 || e->type == 23)
13044 {
13045 if(e->type == 23)
13046 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13047 else
13048 e = (*e->__anon1.list).last;
13049 }
13050 }
13051 if(exp->__anon1.op.op == 261 && e && e->expType)
13052 {
13053 if(e->type == 3 && e->__anon1.__anon2.string)
13054 {
13055 char * string = e->__anon1.__anon2.string;
13056 int len = strlen(string);
13057 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13058
13059 len = UnescapeString(tmp, string + 1, len - 2);
13060 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13061 FreeExpContents(exp);
13062 exp->type = 2;
13063 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13064 }
13065 else
13066 {
13067 struct Type * type = e->expType;
13068
13069 type->refCount++;
13070 FreeExpContents(exp);
13071 exp->type = 2;
13072 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13073 FreeType(type);
13074 }
13075 break;
13076 }
13077 else
13078 ComputeExpression(exp->__anon1.op.exp2);
13079 }
13080 if(exp->__anon1.op.exp1)
13081 {
13082 ComputeExpression(exp->__anon1.op.exp1);
13083 exp1 = exp->__anon1.op.exp1;
13084 exp2 = exp->__anon1.op.exp2;
13085 op1 = GetOperand(exp1);
13086 if(op1.type)
13087 op1.type->refCount++;
13088 if(exp2)
13089 {
13090 op2 = GetOperand(exp2);
13091 if(op2.type)
13092 op2.type->refCount++;
13093 }
13094 }
13095 else
13096 {
13097 exp1 = exp->__anon1.op.exp2;
13098 op1 = GetOperand(exp1);
13099 if(op1.type)
13100 op1.type->refCount++;
13101 }
13102 CallOperator(exp, exp1, exp2, &op1, &op2);
13103 if(op1.type)
13104 FreeType(op1.type);
13105 if(op2.type)
13106 FreeType(op2.type);
13107 break;
13108 }
13109 case 5:
13110 case 32:
13111 {
13112 struct Expression * e, * n;
13113
13114 for(e = (*exp->__anon1.list).first; e; e = n)
13115 {
13116 n = e->next;
13117 if(!n)
13118 {
13119 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13120 struct Expression * prev = exp->prev;
13121 struct Expression * next = exp->next;
13122
13123 ComputeExpression(e);
13124 FreeType(exp->expType);
13125 FreeType(exp->destType);
13126 *exp = *e;
13127 exp->prev = prev;
13128 exp->next = next;
13129 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13130 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13131 }
13132 else
13133 {
13134 FreeExpression(e);
13135 }
13136 }
13137 break;
13138 }
13139 case 8:
13140 {
13141 struct Expression * memberExp = exp->__anon1.member.exp;
13142 struct Identifier * memberID = exp->__anon1.member.member;
13143 struct Type * type;
13144
13145 ComputeExpression(exp->__anon1.member.exp);
13146 type = exp->__anon1.member.exp->expType;
13147 if(type)
13148 {
13149 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)));
13150 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13151 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13152 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
13153
13154 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
13155 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13156 if(!_class)
13157 {
13158 char string[256];
13159 struct Symbol * classSym;
13160
13161 string[0] = '\0';
13162 PrintTypeNoConst(type, string, 0, 1);
13163 classSym = FindClass(string);
13164 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13165 }
13166 if(exp->__anon1.member.member)
13167 {
13168 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
13169 if(!prop)
13170 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
13171 }
13172 if(!prop && !member && _class && exp->__anon1.member.member)
13173 {
13174 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
13175
13176 convertTo = _class;
13177 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13178 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
13179 }
13180 if(prop)
13181 {
13182 if(prop->compiled)
13183 {
13184 struct Type * type = prop->dataType;
13185
13186 if(_class->type == 3)
13187 {
13188 if(type->kind == 8)
13189 {
13190 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13191
13192 if(_class->type == 3)
13193 {
13194 if(!_class->dataType)
13195 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13196 type = _class->dataType;
13197 }
13198 }
13199 switch(type->kind)
13200 {
13201 case 6:
13202 {
13203 float value;
13204 float (* Get)(float) = (void *)prop->Get;
13205
13206 GetFloat(exp->__anon1.member.exp, &value);
13207 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
13208 exp->type = 2;
13209 break;
13210 }
13211 case 7:
13212 {
13213 double value;
13214 double (* Get)(double);
13215
13216 GetDouble(exp->__anon1.member.exp, &value);
13217 if(convertTo)
13218 Get = (void *)prop->Set;
13219 else
13220 Get = (void *)prop->Get;
13221 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
13222 exp->type = 2;
13223 break;
13224 }
13225 }
13226 }
13227 else
13228 {
13229 if(convertTo)
13230 {
13231 struct Expression * value = exp->__anon1.member.exp;
13232 struct Type * type;
13233
13234 if(!prop->dataType)
13235 ProcessPropertyType(prop);
13236 type = prop->dataType;
13237 if(!type)
13238 {
13239 }
13240 else if(_class->type == 1)
13241 {
13242 switch(type->kind)
13243 {
13244 case 8:
13245 {
13246 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13247
13248 if(propertyClass->type == 1 && value->type == 1)
13249 {
13250 void (* Set)(void *, void *) = (void *)prop->Set;
13251
13252 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13253 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13254 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13255 exp->__anon1.instance->loc = exp->loc;
13256 exp->type = 1;
13257 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
13258 PopulateInstance(exp->__anon1.instance);
13259 }
13260 break;
13261 }
13262 case 3:
13263 {
13264 int intValue;
13265 void (* Set)(void *, int) = (void *)prop->Set;
13266
13267 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13268 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13269 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13270 exp->__anon1.instance->loc = exp->loc;
13271 exp->type = 1;
13272 GetInt(value, &intValue);
13273 Set(exp->__anon1.instance->data, intValue);
13274 PopulateInstance(exp->__anon1.instance);
13275 break;
13276 }
13277 case 4:
13278 {
13279 long long intValue;
13280 void (* Set)(void *, long long) = (void *)prop->Set;
13281
13282 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13283 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13284 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13285 exp->__anon1.instance->loc = exp->loc;
13286 exp->type = 1;
13287 GetInt64(value, &intValue);
13288 Set(exp->__anon1.instance->data, intValue);
13289 PopulateInstance(exp->__anon1.instance);
13290 break;
13291 }
13292 case 22:
13293 {
13294 intptr_t intValue;
13295 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13296
13297 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13298 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13299 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13300 exp->__anon1.instance->loc = exp->loc;
13301 exp->type = 1;
13302 GetIntPtr(value, &intValue);
13303 Set(exp->__anon1.instance->data, intValue);
13304 PopulateInstance(exp->__anon1.instance);
13305 break;
13306 }
13307 case 23:
13308 {
13309 ssize_t intValue;
13310 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13311
13312 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13313 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13314 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13315 exp->__anon1.instance->loc = exp->loc;
13316 exp->type = 1;
13317 GetIntSize(value, &intValue);
13318 Set(exp->__anon1.instance->data, intValue);
13319 PopulateInstance(exp->__anon1.instance);
13320 break;
13321 }
13322 case 6:
13323 {
13324 float floatValue;
13325 void (* Set)(void *, float) = (void *)prop->Set;
13326
13327 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13328 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13329 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13330 exp->__anon1.instance->loc = exp->loc;
13331 exp->type = 1;
13332 GetFloat(value, &floatValue);
13333 Set(exp->__anon1.instance->data, floatValue);
13334 PopulateInstance(exp->__anon1.instance);
13335 break;
13336 }
13337 case 7:
13338 {
13339 double doubleValue;
13340 void (* Set)(void *, double) = (void *)prop->Set;
13341
13342 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13343 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13344 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13345 exp->__anon1.instance->loc = exp->loc;
13346 exp->type = 1;
13347 GetDouble(value, &doubleValue);
13348 Set(exp->__anon1.instance->data, doubleValue);
13349 PopulateInstance(exp->__anon1.instance);
13350 break;
13351 }
13352 }
13353 }
13354 else if(_class->type == 2)
13355 {
13356 switch(type->kind)
13357 {
13358 case 8:
13359 {
13360 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13361
13362 if(propertyClass->type == 1 && value->__anon1.instance->data)
13363 {
13364 unsigned int (* Set)(void *) = (void *)prop->Set;
13365 unsigned int bits = Set(value->__anon1.instance->data);
13366
13367 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13368 exp->type = 2;
13369 break;
13370 }
13371 else if(_class->type == 2)
13372 {
13373 unsigned int value;
13374 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
13375 unsigned int bits;
13376
13377 GetUInt(exp->__anon1.member.exp, &value);
13378 bits = Set(value);
13379 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13380 exp->type = 2;
13381 }
13382 }
13383 }
13384 }
13385 }
13386 else
13387 {
13388 if(_class->type == 2)
13389 {
13390 unsigned int value;
13391
13392 GetUInt(exp->__anon1.member.exp, &value);
13393 switch(type->kind)
13394 {
13395 case 8:
13396 {
13397 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13398
13399 if(_class->type == 1)
13400 {
13401 void (* Get)(unsigned int, void *) = (void *)prop->Get;
13402
13403 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13404 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13405 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13406 exp->__anon1.instance->loc = exp->loc;
13407 exp->type = 1;
13408 Get(value, exp->__anon1.instance->data);
13409 PopulateInstance(exp->__anon1.instance);
13410 }
13411 else if(_class->type == 2)
13412 {
13413 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
13414 uint64 bits = Get(value);
13415
13416 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
13417 exp->type = 2;
13418 }
13419 break;
13420 }
13421 }
13422 }
13423 else if(_class->type == 1)
13424 {
13425 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
13426
13427 switch(type->kind)
13428 {
13429 case 8:
13430 {
13431 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13432
13433 if(_class->type == 1 && value)
13434 {
13435 void (* Get)(void *, void *) = (void *)prop->Get;
13436
13437 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13438 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13439 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13440 exp->__anon1.instance->loc = exp->loc;
13441 exp->type = 1;
13442 Get(value, exp->__anon1.instance->data);
13443 PopulateInstance(exp->__anon1.instance);
13444 }
13445 break;
13446 }
13447 }
13448 }
13449 }
13450 }
13451 }
13452 else
13453 {
13454 exp->isConstant = 0;
13455 }
13456 }
13457 else if(member)
13458 {
13459 }
13460 }
13461 if(exp->type != 8)
13462 {
13463 FreeExpression(memberExp);
13464 FreeIdentifier(memberID);
13465 }
13466 break;
13467 }
13468 case 10:
13469 {
13470 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
13471
13472 FreeExpContents(exp);
13473 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13474 exp->type = 2;
13475 FreeType(type);
13476 break;
13477 }
13478 case 15:
13479 {
13480 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
13481
13482 if(classSym && classSym->__anon1.registered)
13483 {
13484 if(classSym->__anon1.registered->fixed)
13485 {
13486 FreeSpecifier(exp->__anon1._class);
13487 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
13488 exp->type = 2;
13489 }
13490 else
13491 {
13492 char className[1024];
13493
13494 strcpy(className, "__ecereClass_");
13495 FullClassNameCat(className, classSym->string, 1);
13496 DeclareClass(curExternal, classSym, className);
13497 FreeExpContents(exp);
13498 exp->type = 9;
13499 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
13500 exp->__anon1.member.member = MkIdentifier("structSize");
13501 }
13502 }
13503 break;
13504 }
13505 case 11:
13506 {
13507 struct Type * type;
13508 struct Expression * e = exp;
13509
13510 if(exp->type == 11)
13511 {
13512 if(exp->__anon1.cast.exp)
13513 ComputeExpression(exp->__anon1.cast.exp);
13514 e = exp->__anon1.cast.exp;
13515 }
13516 if(e && exp->expType)
13517 {
13518 type = exp->expType;
13519 if(type->kind == 8)
13520 {
13521 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13522
13523 if(_class && (_class->type == 3 || _class->type == 2))
13524 {
13525 if(!_class->dataType)
13526 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13527 type = _class->dataType;
13528 }
13529 }
13530 switch(type->kind)
13531 {
13532 case 24:
13533 case 1:
13534 if(type->isSigned)
13535 {
13536 char value = (char)0;
13537
13538 if(GetChar(e, &value))
13539 {
13540 FreeExpContents(exp);
13541 exp->__anon1.__anon1.constant = PrintChar(value);
13542 exp->type = 2;
13543 }
13544 }
13545 else
13546 {
13547 unsigned char value = (unsigned char)0;
13548
13549 if(GetUChar(e, &value))
13550 {
13551 FreeExpContents(exp);
13552 exp->__anon1.__anon1.constant = PrintUChar(value);
13553 exp->type = 2;
13554 }
13555 }
13556 break;
13557 case 2:
13558 if(type->isSigned)
13559 {
13560 short value = (short)0;
13561
13562 if(GetShort(e, &value))
13563 {
13564 FreeExpContents(exp);
13565 exp->__anon1.__anon1.constant = PrintShort(value);
13566 exp->type = 2;
13567 }
13568 }
13569 else
13570 {
13571 unsigned short value = (unsigned short)0;
13572
13573 if(GetUShort(e, &value))
13574 {
13575 FreeExpContents(exp);
13576 exp->__anon1.__anon1.constant = PrintUShort(value);
13577 exp->type = 2;
13578 }
13579 }
13580 break;
13581 case 3:
13582 if(type->isSigned)
13583 {
13584 int value = 0;
13585
13586 if(GetInt(e, &value))
13587 {
13588 FreeExpContents(exp);
13589 exp->__anon1.__anon1.constant = PrintInt(value);
13590 exp->type = 2;
13591 }
13592 }
13593 else
13594 {
13595 unsigned int value = 0;
13596
13597 if(GetUInt(e, &value))
13598 {
13599 FreeExpContents(exp);
13600 exp->__anon1.__anon1.constant = PrintUInt(value);
13601 exp->type = 2;
13602 }
13603 }
13604 break;
13605 case 4:
13606 if(type->isSigned)
13607 {
13608 long long value = 0;
13609
13610 if(GetInt64(e, &value))
13611 {
13612 FreeExpContents(exp);
13613 exp->__anon1.__anon1.constant = PrintInt64(value);
13614 exp->type = 2;
13615 }
13616 }
13617 else
13618 {
13619 uint64 value = 0;
13620
13621 if(GetUInt64(e, &value))
13622 {
13623 FreeExpContents(exp);
13624 exp->__anon1.__anon1.constant = PrintUInt64(value);
13625 exp->type = 2;
13626 }
13627 }
13628 break;
13629 case 22:
13630 if(type->isSigned)
13631 {
13632 intptr_t value = 0;
13633
13634 if(GetIntPtr(e, &value))
13635 {
13636 FreeExpContents(exp);
13637 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13638 exp->type = 2;
13639 }
13640 }
13641 else
13642 {
13643 uintptr_t value = 0;
13644
13645 if(GetUIntPtr(e, &value))
13646 {
13647 FreeExpContents(exp);
13648 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13649 exp->type = 2;
13650 }
13651 }
13652 break;
13653 case 23:
13654 if(type->isSigned)
13655 {
13656 ssize_t value = 0;
13657
13658 if(GetIntSize(e, &value))
13659 {
13660 FreeExpContents(exp);
13661 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13662 exp->type = 2;
13663 }
13664 }
13665 else
13666 {
13667 size_t value = 0;
13668
13669 if(GetUIntSize(e, &value))
13670 {
13671 FreeExpContents(exp);
13672 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13673 exp->type = 2;
13674 }
13675 }
13676 break;
13677 case 6:
13678 {
13679 float value = 0;
13680
13681 if(GetFloat(e, &value))
13682 {
13683 FreeExpContents(exp);
13684 exp->__anon1.__anon1.constant = PrintFloat(value);
13685 exp->type = 2;
13686 }
13687 break;
13688 }
13689 case 7:
13690 {
13691 double value = 0;
13692
13693 if(GetDouble(e, &value))
13694 {
13695 FreeExpContents(exp);
13696 exp->__anon1.__anon1.constant = PrintDouble(value);
13697 exp->type = 2;
13698 }
13699 break;
13700 }
13701 }
13702 }
13703 break;
13704 }
13705 case 12:
13706 {
13707 struct Operand op1 =
13708 {
13709 0, 0, 0,
13710 .__anon1 = {
13711 .c = 0
13712 },
13713 {
13714 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13715 }
13716 };
13717 struct Operand op2 =
13718 {
13719 0, 0, 0,
13720 .__anon1 = {
13721 .c = 0
13722 },
13723 {
13724 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13725 }
13726 };
13727 struct Operand op3 =
13728 {
13729 0, 0, 0,
13730 .__anon1 = {
13731 .c = 0
13732 },
13733 {
13734 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13735 }
13736 };
13737
13738 if(exp->__anon1.cond.exp)
13739 ComputeExpression((*exp->__anon1.cond.exp).last);
13740 if(exp->__anon1.cond.elseExp)
13741 ComputeExpression(exp->__anon1.cond.elseExp);
13742 if(exp->__anon1.cond.cond)
13743 ComputeExpression(exp->__anon1.cond.cond);
13744 op1 = GetOperand(exp->__anon1.cond.cond);
13745 if(op1.type)
13746 op1.type->refCount++;
13747 op2 = GetOperand((*exp->__anon1.cond.exp).last);
13748 if(op2.type)
13749 op2.type->refCount++;
13750 op3 = GetOperand(exp->__anon1.cond.elseExp);
13751 if(op3.type)
13752 op3.type->refCount++;
13753 if(op1.ops.Cond)
13754 {
13755 FreeExpContents(exp);
13756 op1.ops.Cond(exp, &op1, &op2, &op3);
13757 }
13758 if(op1.type)
13759 FreeType(op1.type);
13760 if(op2.type)
13761 FreeType(op2.type);
13762 if(op3.type)
13763 FreeType(op3.type);
13764 break;
13765 }
13766 }
13767 }
13768
13769 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
13770 {
13771 struct __ecereNameSpace__ecere__com__Instance * module;
13772
13773 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))
13774 return 1;
13775 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))
13776 return 1;
13777 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))
13778 return 1;
13779 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)
13780 {
13781 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
13782 return 1;
13783 }
13784 return 0;
13785 }
13786
13787 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
13788 {
13789 struct Type * source;
13790 struct Type * realDest = dest;
13791 struct Type * backupSourceExpType = (((void *)0));
13792 struct Expression * computedExp = sourceExp;
13793
13794 dest->refCount++;
13795 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)
13796 {
13797 computedExp = CopyExpression(sourceExp);
13798 ComputeExpression(computedExp);
13799 }
13800 source = sourceExp->expType;
13801 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
13802 {
13803 if(computedExp != sourceExp)
13804 {
13805 FreeExpression(computedExp);
13806 computedExp = sourceExp;
13807 }
13808 FreeType(dest);
13809 return 1;
13810 }
13811 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
13812 {
13813 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
13814 {
13815 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
13816
13817 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
13818 ;
13819 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
13820 ;
13821 if(sourceBase == destBase)
13822 {
13823 if(computedExp != sourceExp)
13824 {
13825 FreeExpression(computedExp);
13826 computedExp = sourceExp;
13827 }
13828 FreeType(dest);
13829 return 1;
13830 }
13831 }
13832 }
13833 if(source)
13834 {
13835 struct __ecereNameSpace__ecere__sys__OldList * specs;
13836 unsigned int flag = 0;
13837 long long value = (((int)0x7fffffff));
13838
13839 source->refCount++;
13840 if(computedExp->type == 2)
13841 {
13842 if(source->isSigned)
13843 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13844 else
13845 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13846 }
13847 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
13848 {
13849 if(source->isSigned)
13850 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13851 else
13852 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13853 }
13854 if(computedExp != sourceExp)
13855 {
13856 FreeExpression(computedExp);
13857 computedExp = sourceExp;
13858 }
13859 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
13860 {
13861 FreeType(source);
13862 source = __extension__ ({
13863 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13864
13865 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
13866 });
13867 }
13868 if(dest->kind == 8)
13869 {
13870 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13871
13872 if(_class && _class->type == 3)
13873 {
13874 if(source->kind != 8)
13875 {
13876 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13877 struct Type * tempDest, * tempSource;
13878
13879 for(; _class->base->type != 1000; _class = _class->base)
13880 ;
13881 tempSource = dest;
13882 tempDest = tempType;
13883 tempType->kind = 8;
13884 if(!_class->symbol)
13885 _class->symbol = FindClass(_class->fullName);
13886 tempType->__anon1._class = _class->symbol;
13887 tempType->truth = dest->truth;
13888 if(tempType->__anon1._class)
13889 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13890 backupSourceExpType = sourceExp->expType;
13891 if(dest->passAsTemplate)
13892 {
13893 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13894 CopyTypeInto(sourceExp->expType, dest);
13895 sourceExp->expType->passAsTemplate = 0;
13896 }
13897 else
13898 {
13899 sourceExp->expType = dest;
13900 dest->refCount++;
13901 }
13902 flag = 1;
13903 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13904 }
13905 }
13906 if(_class && _class->type == 2 && source->kind != 8)
13907 {
13908 if(!dest->__anon1._class->__anon1.registered->dataType)
13909 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
13910 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13911 {
13912 FreeType(source);
13913 FreeType(sourceExp->expType);
13914 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
13915 source->refCount++;
13916 }
13917 }
13918 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
13919 {
13920 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13921 struct Declarator * decl;
13922 char string[1024];
13923
13924 ReadString(string, sourceExp->__anon1.__anon2.string);
13925 decl = SpecDeclFromString(string, specs, (((void *)0)));
13926 FreeExpContents(sourceExp);
13927 FreeType(sourceExp->expType);
13928 sourceExp->type = 24;
13929 sourceExp->__anon1._classExp.specifiers = specs;
13930 sourceExp->__anon1._classExp.decl = decl;
13931 sourceExp->expType = dest;
13932 dest->refCount++;
13933 FreeType(source);
13934 FreeType(dest);
13935 if(backupSourceExpType)
13936 FreeType(backupSourceExpType);
13937 return 1;
13938 }
13939 }
13940 else if(source->kind == 8)
13941 {
13942 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
13943
13944 if(_class && (_class->type == 3 || _class->type == 2))
13945 {
13946 if(dest->kind != 8)
13947 {
13948 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13949 struct Type * tempDest, * tempSource;
13950
13951 if(!source->__anon1._class->__anon1.registered->dataType)
13952 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
13953 for(; _class->base->type != 1000; _class = _class->base)
13954 ;
13955 tempDest = source;
13956 tempSource = tempType;
13957 tempType->kind = 8;
13958 tempType->__anon1._class = FindClass(_class->fullName);
13959 tempType->truth = source->truth;
13960 tempType->classObjectType = source->classObjectType;
13961 if(tempType->__anon1._class)
13962 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13963 if(conversions && conversions->last)
13964 {
13965 ((struct Conversion *)conversions->last)->resultType = dest;
13966 dest->refCount++;
13967 }
13968 FreeType(sourceExp->expType);
13969 sourceExp->expType = MkClassType(_class->fullName);
13970 sourceExp->expType->truth = source->truth;
13971 sourceExp->expType->classObjectType = source->classObjectType;
13972 if(!sourceExp->destType)
13973 {
13974 FreeType(sourceExp->destType);
13975 sourceExp->destType = sourceExp->expType;
13976 if(sourceExp->expType)
13977 sourceExp->expType->refCount++;
13978 }
13979 if(!_class->dataType)
13980 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13981 FreeType(dest);
13982 dest = MkClassType(source->__anon1._class->string);
13983 dest->truth = source->truth;
13984 dest->classObjectType = source->classObjectType;
13985 FreeType(source);
13986 source = _class->dataType;
13987 source->refCount++;
13988 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13989 }
13990 }
13991 }
13992 if(!flag)
13993 {
13994 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13995 {
13996 FreeType(source);
13997 FreeType(dest);
13998 return 1;
13999 }
14000 }
14001 if(dest->kind == 8)
14002 {
14003 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
14004 unsigned int fittingValue = 0;
14005
14006 if(_class && _class->type == 4)
14007 {
14008 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14009 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14010
14011 if(c && value >= 0 && value <= c->largest)
14012 fittingValue = 1;
14013 }
14014 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
14015 {
14016 if(_class->type == 0 || _class->type == 5)
14017 {
14018 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14019
14020 *newExp = *sourceExp;
14021 if(sourceExp->destType)
14022 sourceExp->destType->refCount++;
14023 if(sourceExp->expType)
14024 sourceExp->expType->refCount++;
14025 sourceExp->type = 11;
14026 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
14027 sourceExp->__anon1.cast.exp = newExp;
14028 FreeType(sourceExp->expType);
14029 sourceExp->expType = (((void *)0));
14030 ProcessExpressionType(sourceExp);
14031 if(!inCompiler)
14032 {
14033 FreeType(sourceExp->expType);
14034 sourceExp->expType = dest;
14035 }
14036 FreeType(source);
14037 if(inCompiler)
14038 FreeType(dest);
14039 if(backupSourceExpType)
14040 FreeType(backupSourceExpType);
14041 return 1;
14042 }
14043 if(!_class->dataType)
14044 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14045 FreeType(dest);
14046 dest = _class->dataType;
14047 dest->refCount++;
14048 }
14049 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))
14050 {
14051 specs = MkListOne(MkSpecifier(DOUBLE));
14052 }
14053 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))
14054 {
14055 specs = MkListOne(MkSpecifier(FLOAT));
14056 }
14057 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))
14058 {
14059 specs = MkList();
14060 if(!dest->isSigned)
14061 ListAdd(specs, MkSpecifier(UNSIGNED));
14062 ListAdd(specs, MkSpecifier(INT64));
14063 }
14064 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
14065 {
14066 specs = MkList();
14067 if(!dest->isSigned)
14068 ListAdd(specs, MkSpecifier(UNSIGNED));
14069 ListAdd(specs, MkSpecifier(INT));
14070 }
14071 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14072 {
14073 specs = MkList();
14074 if(!dest->isSigned)
14075 ListAdd(specs, MkSpecifier(UNSIGNED));
14076 ListAdd(specs, MkSpecifier(SHORT));
14077 }
14078 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14079 {
14080 specs = MkList();
14081 if(!dest->isSigned)
14082 ListAdd(specs, MkSpecifier(UNSIGNED));
14083 ListAdd(specs, MkSpecifier(CHAR));
14084 }
14085 else
14086 {
14087 FreeType(source);
14088 FreeType(dest);
14089 if(backupSourceExpType)
14090 {
14091 if(sourceExp->expType)
14092 FreeType(sourceExp->expType);
14093 sourceExp->expType = backupSourceExpType;
14094 }
14095 return 0;
14096 }
14097 }
14098 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))
14099 {
14100 specs = MkListOne(MkSpecifier(DOUBLE));
14101 }
14102 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))
14103 {
14104 specs = MkListOne(MkSpecifier(FLOAT));
14105 }
14106 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
14107 {
14108 specs = MkList();
14109 ListAdd(specs, MkSpecifier(BOOL));
14110 }
14111 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)))
14112 {
14113 specs = MkList();
14114 if(!dest->isSigned)
14115 ListAdd(specs, MkSpecifier(UNSIGNED));
14116 ListAdd(specs, MkSpecifier(CHAR));
14117 }
14118 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)))))
14119 {
14120 specs = MkList();
14121 if(!dest->isSigned)
14122 ListAdd(specs, MkSpecifier(UNSIGNED));
14123 ListAdd(specs, MkSpecifier(SHORT));
14124 }
14125 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
14126 {
14127 specs = MkList();
14128 if(!dest->isSigned)
14129 ListAdd(specs, MkSpecifier(UNSIGNED));
14130 ListAdd(specs, MkSpecifier(INT));
14131 }
14132 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
14133 {
14134 specs = MkList();
14135 if(!dest->isSigned)
14136 ListAdd(specs, MkSpecifier(UNSIGNED));
14137 ListAdd(specs, MkSpecifier(INT64));
14138 }
14139 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
14140 {
14141 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
14142 }
14143 else
14144 {
14145 FreeType(source);
14146 FreeType(dest);
14147 if(backupSourceExpType)
14148 {
14149 if(sourceExp->expType)
14150 FreeType(sourceExp->expType);
14151 sourceExp->expType = backupSourceExpType;
14152 }
14153 return 0;
14154 }
14155 if(!flag && !sourceExp->opDestType)
14156 {
14157 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14158
14159 *newExp = *sourceExp;
14160 newExp->prev = (((void *)0));
14161 newExp->next = (((void *)0));
14162 if(sourceExp->destType)
14163 sourceExp->destType->refCount++;
14164 if(sourceExp->expType)
14165 sourceExp->expType->refCount++;
14166 sourceExp->type = 11;
14167 if(realDest->kind == 8)
14168 {
14169 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
14170 FreeList(specs, (void *)(FreeSpecifier));
14171 }
14172 else
14173 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
14174 if(newExp->type == 4)
14175 {
14176 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
14177 }
14178 else
14179 sourceExp->__anon1.cast.exp = newExp;
14180 FreeType(sourceExp->expType);
14181 sourceExp->expType = (((void *)0));
14182 ProcessExpressionType(sourceExp);
14183 }
14184 else
14185 FreeList(specs, (void *)(FreeSpecifier));
14186 FreeType(dest);
14187 FreeType(source);
14188 if(backupSourceExpType)
14189 FreeType(backupSourceExpType);
14190 return 1;
14191 }
14192 else
14193 {
14194 if(computedExp != sourceExp)
14195 {
14196 FreeExpression(computedExp);
14197 computedExp = sourceExp;
14198 }
14199 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
14200 sourceExp = (*sourceExp->__anon1.list).last;
14201 if(sourceExp->type == 0)
14202 {
14203 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
14204
14205 if(dest->kind == 8)
14206 {
14207 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
14208 {
14209 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
14210 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14211
14212 if(enumClass)
14213 {
14214 for(; _class && _class->type == 4; _class = _class->base)
14215 {
14216 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
14217 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14218
14219 for(value = e->values.first; value; value = value->next)
14220 {
14221 if(!strcmp(value->name, id->string))
14222 break;
14223 }
14224 if(value)
14225 {
14226 FreeType(sourceExp->expType);
14227 sourceExp->isConstant = 1;
14228 sourceExp->expType = MkClassType(_class->fullName);
14229 if(inCompiler || inPreCompiler || inDebugger)
14230 {
14231 FreeExpContents(sourceExp);
14232 sourceExp->type = 2;
14233 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
14234 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
14235 else
14236 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
14237 }
14238 FreeType(dest);
14239 return 1;
14240 }
14241 }
14242 }
14243 }
14244 }
14245 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
14246 {
14247 FreeType(dest);
14248 return 1;
14249 }
14250 }
14251 FreeType(dest);
14252 }
14253 return 0;
14254 }
14255
14256 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
14257 {
14258 unsigned int result = 1;
14259
14260 if(destType)
14261 {
14262 struct __ecereNameSpace__ecere__sys__OldList converts =
14263 {
14264 0, 0, 0, 0, 0
14265 };
14266 struct Conversion * convert;
14267
14268 if(destType->kind == 0)
14269 return 0;
14270 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
14271 result = 0;
14272 if(converts.count)
14273 {
14274 for(convert = converts.first; convert; convert = convert->next)
14275 {
14276 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
14277
14278 if(!empty)
14279 {
14280 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14281 int objectType = exp->expType ? exp->expType->classObjectType : 0;
14282
14283 *newExp = *exp;
14284 newExp->prev = (((void *)0));
14285 newExp->next = (((void *)0));
14286 newExp->destType = (((void *)0));
14287 if(convert->isGet)
14288 {
14289 exp->type = 8;
14290 exp->addedThis = 1;
14291 exp->__anon1.member.exp = newExp;
14292 FreeType(exp->__anon1.member.exp->expType);
14293 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
14294 exp->__anon1.member.exp->expType->classObjectType = objectType;
14295 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
14296 exp->__anon1.member.memberType = 1;
14297 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14298 exp->needCast = 1;
14299 if(exp->expType)
14300 exp->expType->refCount++;
14301 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14302 }
14303 else
14304 {
14305 {
14306 exp->type = 8;
14307 exp->addedThis = 1;
14308 exp->__anon1.member.exp = newExp;
14309 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)
14310 {
14311 newExp->byReference = 1;
14312 }
14313 FreeType(exp->__anon1.member.exp->expType);
14314 exp->__anon1.member.exp->expType = (((void *)0));
14315 if(convert->convert->dataType)
14316 {
14317 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14318 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
14319 exp->__anon1.member.exp->expType->refCount = 1;
14320 exp->__anon1.member.exp->expType->classObjectType = objectType;
14321 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14322 }
14323 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
14324 exp->__anon1.member.memberType = 4;
14325 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14326 exp->needCast = 1;
14327 if(convert->resultType)
14328 convert->resultType->refCount++;
14329 }
14330 }
14331 }
14332 else
14333 {
14334 FreeType(exp->expType);
14335 if(convert->isGet)
14336 {
14337 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14338 if(exp->destType->casted)
14339 exp->needCast = 1;
14340 if(exp->expType)
14341 exp->expType->refCount++;
14342 }
14343 else
14344 {
14345 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14346 if(exp->destType->casted)
14347 exp->needCast = 1;
14348 if(convert->resultType)
14349 convert->resultType->refCount++;
14350 }
14351 }
14352 }
14353 if(exp->isConstant && inCompiler)
14354 ComputeExpression(exp);
14355 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
14356 }
14357 if(!result && exp->expType && converts.count)
14358 {
14359 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14360 }
14361 if(!result && exp->expType && exp->destType)
14362 {
14363 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))
14364 result = 1;
14365 }
14366 }
14367 return result;
14368 }
14369
14370 static void ProcessFunction(struct FunctionDefinition *  function);
14371
14372 void ProcessInstantiationType(struct Instantiation * inst)
14373 {
14374 yylloc = inst->loc;
14375 if(inst->_class)
14376 {
14377 struct MembersInit * members;
14378 struct Symbol * classSym;
14379 struct __ecereNameSpace__ecere__com__Class * _class;
14380
14381 classSym = inst->_class->__anon1.__anon1.symbol;
14382 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14383 if(!_class || _class->type != 5)
14384 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14385 afterExternal = afterExternal ? afterExternal : curExternal;
14386 if(inst->exp)
14387 ProcessExpressionType(inst->exp);
14388 inst->isConstant = 1;
14389 if(inst->members)
14390 {
14391 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14392 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14393 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14394 int subMemberStackPos = 0;
14395
14396 for(members = (*inst->members).first; members; members = members->next)
14397 {
14398 switch(members->type)
14399 {
14400 case 1:
14401 {
14402 char name[1024];
14403 static unsigned int instMethodID = 0;
14404 struct External * external = curExternal;
14405 struct Context * context = curContext;
14406 struct Declarator * declarator = members->__anon1.function->declarator;
14407 struct Identifier * nameID = GetDeclId(declarator);
14408 char * unmangled = nameID ? nameID->string : (((void *)0));
14409 struct Expression * exp;
14410 struct External * createdExternal = (((void *)0));
14411
14412 if(inCompiler)
14413 {
14414 char number[16];
14415
14416 strcpy(name, "__ecereInstMeth_");
14417 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14418 strcat(name, "_");
14419 strcat(name, nameID->string);
14420 strcat(name, "_");
14421 sprintf(number, "_%08d", instMethodID++);
14422 strcat(name, number);
14423 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14424 }
14425 if(declarator)
14426 {
14427 struct Symbol * symbol = declarator->symbol;
14428 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14429
14430 if(method && method->type == 1)
14431 {
14432 symbol->__anon1.method = method;
14433 ProcessMethodType(method);
14434 if(!symbol->type->__anon1.__anon2.thisClass)
14435 {
14436 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14437 {
14438 if(!currentClass->symbol)
14439 currentClass->symbol = FindClass(currentClass->fullName);
14440 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14441 }
14442 else
14443 {
14444 if(!_class->symbol)
14445 _class->symbol = FindClass(_class->fullName);
14446 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14447 }
14448 }
14449 DeclareType(curExternal, symbol->type, 1, 1);
14450 }
14451 else if(classSym)
14452 {
14453 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14454 }
14455 }
14456 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14457 if(nameID)
14458 {
14459 FreeSpecifier(nameID->_class);
14460 nameID->_class = (((void *)0));
14461 }
14462 curExternal = createdExternal;
14463 if(inCompiler)
14464 {
14465 if(createdExternal->__anon1.function)
14466 ProcessFunction(createdExternal->__anon1.function);
14467 }
14468 else if(declarator)
14469 {
14470 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14471 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14472 }
14473 curExternal = external;
14474 curContext = context;
14475 if(inCompiler)
14476 {
14477 FreeClassFunction(members->__anon1.function);
14478 exp = QMkExpId(name);
14479 members->type = 0;
14480 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14481 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14482 }
14483 break;
14484 }
14485 case 0:
14486 {
14487 if(members->__anon1.dataMembers && classSym)
14488 {
14489 struct MemberInit * member;
14490 struct Location oldyyloc = yylloc;
14491
14492 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14493 {
14494 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14495 if(member->initializer && !member->initializer->isConstant)
14496 inst->isConstant = 0;
14497 }
14498 yylloc = oldyyloc;
14499 }
14500 break;
14501 }
14502 }
14503 }
14504 }
14505 }
14506 }
14507
14508 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14509
14510 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14511 {
14512 switch(spec->type)
14513 {
14514 case 0:
14515 {
14516 if(spec->__anon1.specifier == THISCLASS)
14517 {
14518 if(thisClass)
14519 {
14520 spec->type = 1;
14521 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14522 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14523 ProcessSpecifier(spec, declareStruct, 0);
14524 }
14525 }
14526 break;
14527 }
14528 case 1:
14529 {
14530 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14531
14532 if(symbol)
14533 DeclareType(curExternal, symbol->type, 1, 1);
14534 else if(spec->__anon1.__anon1.symbol)
14535 {
14536 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14537
14538 if(warnClasses && !c)
14539 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14540 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14541 }
14542 break;
14543 }
14544 case 2:
14545 {
14546 struct Enumerator * e;
14547
14548 if(spec->__anon1.__anon2.list)
14549 {
14550 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14551 {
14552 if(e->exp)
14553 ProcessExpressionType(e->exp);
14554 }
14555 }
14556 if(inCompiler)
14557 break;
14558 }
14559 case 3:
14560 case 4:
14561 {
14562 if(spec->__anon1.__anon2.definitions)
14563 {
14564 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14565
14566 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14567 }
14568 break;
14569 }
14570 }
14571 }
14572
14573 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14574 {
14575 switch(decl->type)
14576 {
14577 case 1:
14578 if(decl->__anon1.identifier->classSym)
14579 {
14580 FreeSpecifier(decl->__anon1.identifier->_class);
14581 decl->__anon1.identifier->_class = (((void *)0));
14582 }
14583 break;
14584 case 3:
14585 if(decl->__anon1.array.exp)
14586 ProcessExpressionType(decl->__anon1.array.exp);
14587 case 0:
14588 case 2:
14589 case 4:
14590 case 5:
14591 case 6:
14592 case 7:
14593 {
14594 struct Identifier * id = (((void *)0));
14595 struct Specifier * classSpec = (((void *)0));
14596
14597 if(decl->type == 4)
14598 {
14599 id = GetDeclId(decl);
14600 if(id && id->_class)
14601 {
14602 classSpec = id->_class;
14603 id->_class = (((void *)0));
14604 }
14605 }
14606 if(decl->declarator)
14607 ProcessDeclarator(decl->declarator, isFunction);
14608 if(decl->type == 4)
14609 {
14610 if(classSpec)
14611 {
14612 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14613
14614 if(!decl->__anon1.function.parameters)
14615 decl->__anon1.function.parameters = MkList();
14616 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14617 }
14618 if(decl->__anon1.function.parameters)
14619 {
14620 struct TypeName * param;
14621
14622 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14623 {
14624 if(param->qualifiers)
14625 {
14626 struct Specifier * spec;
14627
14628 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14629 {
14630 if(spec->type == 0)
14631 {
14632 if(spec->__anon1.specifier == TYPED_OBJECT)
14633 {
14634 struct Declarator * d = param->declarator;
14635 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);
14636
14637 if(d->type != 5)
14638 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14639 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14640 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14641 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14642 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14643 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14644 param = newParam;
14645 break;
14646 }
14647 else if(spec->__anon1.specifier == ANY_OBJECT)
14648 {
14649 struct Declarator * d = param->declarator;
14650
14651 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14652 param->qualifiers = MkListOne(MkSpecifier(VOID));
14653 if(d->type != 5)
14654 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14655 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14656 break;
14657 }
14658 else if(spec->__anon1.specifier == THISCLASS)
14659 {
14660 if(thisClass)
14661 {
14662 spec->type = 1;
14663 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14664 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14665 ProcessSpecifier(spec, 0, 0);
14666 }
14667 break;
14668 }
14669 }
14670 else if(spec->type == 1)
14671 {
14672 ProcessSpecifier(spec, isFunction, 1);
14673 }
14674 }
14675 }
14676 if(param->declarator)
14677 ProcessDeclarator(param->declarator, 0);
14678 }
14679 }
14680 }
14681 break;
14682 }
14683 }
14684 }
14685
14686 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14687 {
14688 yylloc = decl->loc;
14689 switch(decl->type)
14690 {
14691 case 1:
14692 {
14693 unsigned int declareStruct = 0;
14694
14695 if(decl->__anon1.__anon1.declarators)
14696 {
14697 struct InitDeclarator * d;
14698
14699 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14700 {
14701 struct Type * type, * subType;
14702
14703 ProcessDeclarator(d->declarator, 0);
14704 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14705 if(d->initializer)
14706 {
14707 ProcessInitializer(d->initializer, type);
14708 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14709 {
14710 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14711 {
14712 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14713
14714 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14715 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14716 if(decl->__anon1.__anon1.specifiers)
14717 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14718 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14719 d = (((void *)0));
14720 decl->type = 2;
14721 decl->__anon1.inst = inst;
14722 }
14723 }
14724 }
14725 for(subType = type; subType; )
14726 {
14727 if(subType->kind == 8)
14728 {
14729 declareStruct = 1;
14730 break;
14731 }
14732 else if(subType->kind == 13)
14733 break;
14734 else if(subType->kind == 12)
14735 subType = subType->__anon1.__anon4.arrayType;
14736 else
14737 break;
14738 }
14739 FreeType(type);
14740 if(!d)
14741 break;
14742 }
14743 }
14744 if(decl->__anon1.__anon1.specifiers)
14745 {
14746 struct Specifier * s;
14747
14748 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
14749 {
14750 ProcessSpecifier(s, declareStruct, 1);
14751 }
14752 }
14753 break;
14754 }
14755 case 2:
14756 {
14757 ProcessInstantiationType(decl->__anon1.inst);
14758 break;
14759 }
14760 case 0:
14761 {
14762 struct Specifier * spec;
14763 struct Declarator * d;
14764 unsigned int declareStruct = 0;
14765
14766 if(decl->__anon1.__anon1.declarators)
14767 {
14768 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14769 {
14770 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14771 struct Type * subType;
14772
14773 ProcessDeclarator(d, 0);
14774 for(subType = type; subType; )
14775 {
14776 if(subType->kind == 8)
14777 {
14778 declareStruct = 1;
14779 break;
14780 }
14781 else if(subType->kind == 13)
14782 break;
14783 else if(subType->kind == 12)
14784 subType = subType->__anon1.__anon4.arrayType;
14785 else
14786 break;
14787 }
14788 FreeType(type);
14789 }
14790 }
14791 if(decl->__anon1.__anon1.specifiers)
14792 {
14793 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
14794 ProcessSpecifier(spec, declareStruct, warnClasses);
14795 }
14796 break;
14797 }
14798 }
14799 }
14800
14801 static void ProcessStatement(struct Statement * stmt)
14802 {
14803 yylloc = stmt->loc;
14804 switch(stmt->type)
14805 {
14806 case 0:
14807 ProcessStatement(stmt->__anon1.labeled.stmt);
14808 break;
14809 case 1:
14810 if(stmt->__anon1.caseStmt.exp)
14811 {
14812 FreeType(stmt->__anon1.caseStmt.exp->destType);
14813 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
14814 if(curSwitchType)
14815 curSwitchType->refCount++;
14816 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
14817 ComputeExpression(stmt->__anon1.caseStmt.exp);
14818 }
14819 if(stmt->__anon1.caseStmt.stmt)
14820 ProcessStatement(stmt->__anon1.caseStmt.stmt);
14821 break;
14822 case 2:
14823 {
14824 if(stmt->__anon1.compound.context)
14825 {
14826 struct Declaration * decl;
14827 struct Statement * s;
14828 struct Statement * prevCompound = curCompound;
14829 struct Context * prevContext = curContext;
14830
14831 if(!stmt->__anon1.compound.isSwitch)
14832 curCompound = stmt;
14833 curContext = stmt->__anon1.compound.context;
14834 if(stmt->__anon1.compound.declarations)
14835 {
14836 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
14837 ProcessDeclaration(decl, 1);
14838 }
14839 if(stmt->__anon1.compound.statements)
14840 {
14841 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
14842 ProcessStatement(s);
14843 }
14844 curContext = prevContext;
14845 curCompound = prevCompound;
14846 }
14847 break;
14848 }
14849 case 3:
14850 {
14851 struct Expression * exp;
14852
14853 if(stmt->__anon1.expressions)
14854 {
14855 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14856 ProcessExpressionType(exp);
14857 }
14858 break;
14859 }
14860 case 4:
14861 {
14862 struct Expression * exp;
14863
14864 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
14865 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
14866 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
14867 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
14868 {
14869 ProcessExpressionType(exp);
14870 }
14871 if(stmt->__anon1.ifStmt.stmt)
14872 ProcessStatement(stmt->__anon1.ifStmt.stmt);
14873 if(stmt->__anon1.ifStmt.elseStmt)
14874 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
14875 break;
14876 }
14877 case 5:
14878 {
14879 struct Type * oldSwitchType = curSwitchType;
14880
14881 if(stmt->__anon1.switchStmt.exp)
14882 {
14883 struct Expression * exp;
14884
14885 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
14886 {
14887 if(!exp->next)
14888 {
14889 ProcessExpressionType(exp);
14890 }
14891 if(!exp->next)
14892 curSwitchType = exp->expType;
14893 }
14894 }
14895 ProcessStatement(stmt->__anon1.switchStmt.stmt);
14896 curSwitchType = oldSwitchType;
14897 break;
14898 }
14899 case 6:
14900 {
14901 if(stmt->__anon1.whileStmt.exp)
14902 {
14903 struct Expression * exp;
14904
14905 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
14906 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
14907 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
14908 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
14909 {
14910 ProcessExpressionType(exp);
14911 }
14912 }
14913 if(stmt->__anon1.whileStmt.stmt)
14914 ProcessStatement(stmt->__anon1.whileStmt.stmt);
14915 break;
14916 }
14917 case 7:
14918 {
14919 if(stmt->__anon1.doWhile.exp)
14920 {
14921 struct Expression * exp;
14922
14923 if((*stmt->__anon1.doWhile.exp).last)
14924 {
14925 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
14926 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
14927 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
14928 }
14929 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
14930 {
14931 ProcessExpressionType(exp);
14932 }
14933 }
14934 if(stmt->__anon1.doWhile.stmt)
14935 ProcessStatement(stmt->__anon1.doWhile.stmt);
14936 break;
14937 }
14938 case 8:
14939 {
14940 struct Expression * exp;
14941
14942 if(stmt->__anon1.forStmt.init)
14943 ProcessStatement(stmt->__anon1.forStmt.init);
14944 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
14945 {
14946 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
14947 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
14948 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
14949 }
14950 if(stmt->__anon1.forStmt.check)
14951 ProcessStatement(stmt->__anon1.forStmt.check);
14952 if(stmt->__anon1.forStmt.increment)
14953 {
14954 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
14955 ProcessExpressionType(exp);
14956 }
14957 if(stmt->__anon1.forStmt.stmt)
14958 ProcessStatement(stmt->__anon1.forStmt.stmt);
14959 break;
14960 }
14961 case 18:
14962 {
14963 struct Identifier * id = stmt->__anon1.forEachStmt.id;
14964 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
14965 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
14966 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
14967 char iteratorType[1024];
14968 struct Type * source;
14969 struct Expression * e;
14970 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));
14971 struct Expression * arrayExp;
14972 const char * typeString = (((void *)0));
14973 int builtinCount = 0;
14974
14975 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
14976 {
14977 if(!e->next)
14978 {
14979 FreeType(e->destType);
14980 e->destType = ProcessTypeString("Container", 0);
14981 }
14982 if(!isBuiltin || e->next)
14983 ProcessExpressionType(e);
14984 }
14985 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
14986 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)))
14987 {
14988 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
14989 struct Symbol * symbol;
14990 struct Expression * expIt = (((void *)0));
14991 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
14992 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
14993 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
14994 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
14995
14996 if(inCompiler)
14997 {
14998 stmt->type = 2;
14999 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15000 stmt->__anon1.compound.context->parent = curContext;
15001 curContext = stmt->__anon1.compound.context;
15002 }
15003 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
15004 {
15005 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15006
15007 isCustomAVLTree = 1;
15008 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
15009 isMap = 1;
15010 }
15011 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15012 isArray = 1;
15013 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15014 {
15015 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15016
15017 isLinkList = 1;
15018 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15019 }
15020 if(inCompiler && isArray)
15021 {
15022 struct Declarator * decl;
15023 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15024
15025 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15026 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15027 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15028 }
15029 else if(isBuiltin)
15030 {
15031 struct Type * type = (((void *)0));
15032 char typeStringBuf[1024];
15033
15034 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15035 if(((struct Expression *)(*exp).last)->type == 11)
15036 {
15037 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15038
15039 if(typeName)
15040 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15041 }
15042 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)
15043 {
15044 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15045
15046 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15047 }
15048 else if(arrayExp->__anon1.list)
15049 {
15050 struct Expression * e;
15051
15052 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15053 {
15054 ProcessExpressionType(e);
15055 if(e->expType)
15056 {
15057 if(!type)
15058 {
15059 type = e->expType;
15060 type->refCount++;
15061 }
15062 else
15063 {
15064 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15065 {
15066 FreeType(type);
15067 type = e->expType;
15068 e->expType = (((void *)0));
15069 e = (*arrayExp->__anon1.list).first;
15070 ProcessExpressionType(e);
15071 if(e->expType)
15072 {
15073 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15074 {
15075 FreeType(e->expType);
15076 e->expType = (((void *)0));
15077 FreeType(type);
15078 type = (((void *)0));
15079 break;
15080 }
15081 }
15082 }
15083 }
15084 if(e->expType)
15085 {
15086 FreeType(e->expType);
15087 e->expType = (((void *)0));
15088 }
15089 }
15090 }
15091 if(type)
15092 {
15093 typeStringBuf[0] = '\0';
15094 PrintType(type, typeStringBuf, 0, 1);
15095 typeString = typeStringBuf;
15096 FreeType(type);
15097 }
15098 }
15099 if(typeString)
15100 {
15101 if(inCompiler)
15102 {
15103 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15104 struct Declarator * decl;
15105 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15106
15107 if(arrayExp->__anon1.list)
15108 {
15109 struct Expression * e;
15110
15111 builtinCount = (*arrayExp->__anon1.list).count;
15112 type = ProcessTypeString(typeString, 0);
15113 while((e = (*arrayExp->__anon1.list).first))
15114 {
15115 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15116 e->destType = type;
15117 type->refCount++;
15118 ProcessExpressionType(e);
15119 if(inCompiler)
15120 ListAdd(initializers, MkInitializerAssignment(e));
15121 }
15122 FreeType(type);
15123 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15124 }
15125 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15126 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15127 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15128 FreeList(exp, (void *)(FreeExpression));
15129 }
15130 else if(arrayExp->__anon1.list)
15131 {
15132 struct Expression * e;
15133
15134 type = ProcessTypeString(typeString, 0);
15135 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15136 {
15137 e->destType = type;
15138 type->refCount++;
15139 ProcessExpressionType(e);
15140 }
15141 FreeType(type);
15142 }
15143 }
15144 else
15145 {
15146 arrayExp->expType = ProcessTypeString("Container", 0);
15147 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15148 }
15149 }
15150 else if(inCompiler && isLinkList && !isList)
15151 {
15152 struct Declarator * decl;
15153 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15154
15155 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15156 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15157 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15158 }
15159 else if(inCompiler && _class->templateArgs)
15160 {
15161 if(isMap)
15162 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15163 else
15164 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15165 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)))))))));
15166 }
15167 if(inCompiler)
15168 {
15169 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15170 if(block)
15171 {
15172 switch(block->type)
15173 {
15174 case 2:
15175 if(block->__anon1.compound.context)
15176 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15177 break;
15178 case 4:
15179 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15180 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15181 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15182 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15183 break;
15184 case 5:
15185 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15186 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15187 break;
15188 case 6:
15189 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15190 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15191 break;
15192 case 7:
15193 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15194 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15195 break;
15196 case 8:
15197 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15198 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15199 break;
15200 case 18:
15201 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15202 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15203 break;
15204 }
15205 }
15206 if(filter)
15207 {
15208 block = MkIfStmt(filter, block, (((void *)0)));
15209 }
15210 if(isArray)
15211 {
15212 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));
15213 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15214 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15215 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15216 }
15217 else if(isBuiltin)
15218 {
15219 char count[128];
15220
15221 sprintf(count, "%d", builtinCount);
15222 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));
15223 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15224 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15225 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15226 }
15227 else if(isLinkList && !isList)
15228 {
15229 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15230 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15231
15232 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15233 {
15234 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));
15235 }
15236 else
15237 {
15238 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15239 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15240
15241 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));
15242 }
15243 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15244 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15245 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15246 }
15247 else
15248 {
15249 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15250 }
15251 ProcessExpressionType(expIt);
15252 if((*stmt->__anon1.compound.declarations).first)
15253 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15254 if(symbol)
15255 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15256 ProcessStatement(stmt);
15257 }
15258 else
15259 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15260 if(inCompiler)
15261 curContext = stmt->__anon1.compound.context->parent;
15262 break;
15263 }
15264 else
15265 {
15266 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15267 }
15268 break;
15269 }
15270 case 9:
15271 break;
15272 case 10:
15273 break;
15274 case 11:
15275 break;
15276 case 12:
15277 {
15278 struct Expression * exp;
15279
15280 if(stmt->__anon1.expressions)
15281 {
15282 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15283 {
15284 if(!exp->next)
15285 {
15286 if(curFunction && !curFunction->type)
15287 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15288 FreeType(exp->destType);
15289 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15290 if(exp->destType)
15291 exp->destType->refCount++;
15292 }
15293 ProcessExpressionType(exp);
15294 }
15295 }
15296 break;
15297 }
15298 case 14:
15299 {
15300 ProcessDeclaration(stmt->__anon1.decl, 1);
15301 break;
15302 }
15303 case 13:
15304 {
15305 struct AsmField * field;
15306
15307 if(stmt->__anon1.asmStmt.inputFields)
15308 {
15309 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15310 if(field->expression)
15311 ProcessExpressionType(field->expression);
15312 }
15313 if(stmt->__anon1.asmStmt.outputFields)
15314 {
15315 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15316 if(field->expression)
15317 ProcessExpressionType(field->expression);
15318 }
15319 if(stmt->__anon1.asmStmt.clobberedFields)
15320 {
15321 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15322 {
15323 if(field->expression)
15324 ProcessExpressionType(field->expression);
15325 }
15326 }
15327 break;
15328 }
15329 case 17:
15330 {
15331 struct PropertyWatch * propWatch;
15332 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15333 struct Expression * object = stmt->__anon1._watch.object;
15334 struct Expression * watcher = stmt->__anon1._watch.watcher;
15335
15336 if(watcher)
15337 ProcessExpressionType(watcher);
15338 if(object)
15339 ProcessExpressionType(object);
15340 if(inCompiler)
15341 {
15342 if(watcher || thisClass)
15343 {
15344 struct External * external = curExternal;
15345 struct Context * context = curContext;
15346
15347 stmt->type = 3;
15348 stmt->__anon1.expressions = MkList();
15349 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15350 {
15351 struct ClassFunction * func;
15352 char watcherName[1024];
15353 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;
15354 struct External * createdExternal;
15355
15356 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15357 if(propWatch->deleteWatch)
15358 strcat(watcherName, "_delete");
15359 else
15360 {
15361 struct Identifier * propID;
15362
15363 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15364 {
15365 strcat(watcherName, "_");
15366 strcat(watcherName, propID->string);
15367 }
15368 }
15369 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15370 {
15371 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)));
15372 ProcessClassFunctionBody(func, propWatch->compound);
15373 propWatch->compound = (((void *)0));
15374 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15375 FreeClassFunction(func);
15376 curExternal = createdExternal;
15377 ProcessFunction(createdExternal->__anon1.function);
15378 if(propWatch->deleteWatch)
15379 {
15380 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15381
15382 ListAdd(args, CopyExpression(object));
15383 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15384 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15385 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15386 }
15387 else
15388 {
15389 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15390 struct Identifier * propID;
15391
15392 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15393 {
15394 char propName[1024];
15395 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15396
15397 if(prop)
15398 {
15399 char getName[1024], setName[1024];
15400 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15401
15402 DeclareProperty(createdExternal, prop, setName, getName);
15403 strcpy(propName, "__ecereProp_");
15404 FullClassNameCat(propName, prop->_class->fullName, 0);
15405 strcat(propName, "_");
15406 FullClassNameCat(propName, prop->name, 1);
15407 ListAdd(args, CopyExpression(object));
15408 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15409 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15410 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15411 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15412 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15413 }
15414 else
15415 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15416 }
15417 }
15418 }
15419 else
15420 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15421 }
15422 curExternal = external;
15423 curContext = context;
15424 if(watcher)
15425 FreeExpression(watcher);
15426 if(object)
15427 FreeExpression(object);
15428 FreeList(watches, (void *)(FreePropertyWatch));
15429 }
15430 else
15431 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15432 }
15433 else
15434 {
15435 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15436 {
15437 ProcessStatement(propWatch->compound);
15438 }
15439 }
15440 break;
15441 }
15442 case 15:
15443 {
15444 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15445 struct Expression * object = stmt->__anon1._watch.object;
15446 struct __ecereNameSpace__ecere__com__Class * _class;
15447
15448 if(object)
15449 ProcessExpressionType(object);
15450 if(inCompiler)
15451 {
15452 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15453 if(_class)
15454 {
15455 struct Identifier * propID;
15456
15457 stmt->type = 3;
15458 stmt->__anon1.expressions = MkList();
15459 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15460 {
15461 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15462 }
15463 else if(!watches)
15464 {
15465 }
15466 if(watches)
15467 {
15468 for(propID = (*watches).first; propID; propID = propID->next)
15469 {
15470 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15471
15472 if(prop)
15473 {
15474 CreateFireWatcher(prop, object, stmt);
15475 }
15476 else
15477 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15478 }
15479 }
15480 else
15481 {
15482 struct __ecereNameSpace__ecere__com__Property * prop;
15483 struct __ecereNameSpace__ecere__com__Class * base;
15484
15485 for(base = _class; base; base = base->base)
15486 {
15487 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15488 {
15489 if(prop->isProperty && prop->isWatchable)
15490 {
15491 CreateFireWatcher(prop, object, stmt);
15492 }
15493 }
15494 }
15495 }
15496 if(object)
15497 FreeExpression(object);
15498 FreeList(watches, (void *)(FreeIdentifier));
15499 }
15500 else
15501 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15502 }
15503 break;
15504 }
15505 case 16:
15506 {
15507 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15508 struct Expression * object = stmt->__anon1._watch.object;
15509 struct Expression * watcher = stmt->__anon1._watch.watcher;
15510 struct __ecereNameSpace__ecere__com__Class * _class;
15511
15512 if(object)
15513 ProcessExpressionType(object);
15514 if(watcher)
15515 ProcessExpressionType(watcher);
15516 if(inCompiler)
15517 {
15518 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15519 if(watcher || thisClass)
15520 {
15521 if(_class)
15522 {
15523 struct Identifier * propID;
15524
15525 stmt->type = 3;
15526 stmt->__anon1.expressions = MkList();
15527 if(!watches)
15528 {
15529 struct __ecereNameSpace__ecere__sys__OldList * args;
15530
15531 args = MkList();
15532 ListAdd(args, CopyExpression(object));
15533 ListAdd(args, MkExpConstant("0"));
15534 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15535 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15536 }
15537 else
15538 {
15539 for(propID = (*watches).first; propID; propID = propID->next)
15540 {
15541 char propName[1024];
15542 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15543
15544 if(prop)
15545 {
15546 char getName[1024], setName[1024];
15547 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15548
15549 DeclareProperty(curExternal, prop, setName, getName);
15550 strcpy(propName, "__ecereProp_");
15551 FullClassNameCat(propName, prop->_class->fullName, 0);
15552 strcat(propName, "_");
15553 FullClassNameCat(propName, prop->name, 1);
15554 ListAdd(args, CopyExpression(object));
15555 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15556 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15557 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15558 }
15559 else
15560 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15561 }
15562 }
15563 if(object)
15564 FreeExpression(object);
15565 if(watcher)
15566 FreeExpression(watcher);
15567 FreeList(watches, (void *)(FreeIdentifier));
15568 }
15569 else
15570 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15571 }
15572 else
15573 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15574 }
15575 break;
15576 }
15577 }
15578 }
15579
15580 void ComputeDataTypes()
15581 {
15582 struct External * external;
15583
15584 currentClass = (((void *)0));
15585 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15586 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15587 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15588 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15589 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15590 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15591 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15592 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15593 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15594 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15595 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15596 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15597 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15598 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15599 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15600 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15601 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15602 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15603 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15604 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15605 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15606 for(external = (*ast).first; external; external = external->next)
15607 {
15608 afterExternal = curExternal = external;
15609 if(external->type == 0)
15610 {
15611 if(memoryGuard)
15612 {
15613 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15614 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15615 }
15616 currentClass = external->__anon1.function->_class;
15617 ProcessFunction(external->__anon1.function);
15618 }
15619 else if(external->type == 1)
15620 {
15621 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15622 {
15623 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15624 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15625 }
15626 currentClass = (((void *)0));
15627 if(external->__anon1.declaration)
15628 ProcessDeclaration(external->__anon1.declaration, 1);
15629 }
15630 else if(external->type == 2)
15631 {
15632 struct ClassDefinition * _class = external->__anon1._class;
15633
15634 currentClass = external->symbol->__anon1.registered;
15635 if(memoryGuard)
15636 {
15637 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15638 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15639 }
15640 if(_class->definitions)
15641 {
15642 ProcessClass(_class->definitions, _class->symbol);
15643 }
15644 if(inCompiler)
15645 {
15646 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15647 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
15648 }
15649 }
15650 else if(external->type == 4)
15651 {
15652 thisNameSpace = external->__anon1.id->string;
15653 }
15654 }
15655 currentClass = (((void *)0));
15656 thisNameSpace = (((void *)0));
15657 curExternal = (((void *)0));
15658 }
15659
15660 void ProcessExpressionType(struct Expression * exp)
15661 {
15662 unsigned int unresolved = 0;
15663 struct Location oldyylloc = yylloc;
15664 unsigned int notByReference = 0;
15665
15666 if(!exp || exp->expType)
15667 return ;
15668 yylloc = exp->loc;
15669 switch(exp->type)
15670 {
15671 case 0:
15672 {
15673 struct Identifier * id = exp->__anon1.__anon1.identifier;
15674
15675 if(!id || !topContext)
15676 return ;
15677 if(id->_class && id->_class->__anon1.__anon1.name)
15678 {
15679 id->classSym = id->_class->__anon1.__anon1.symbol;
15680 }
15681 if(!strcmp(id->string, "__runtimePlatform"))
15682 {
15683 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15684 break;
15685 }
15686 else if(strstr(id->string, "__ecereClass") == id->string)
15687 {
15688 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15689 break;
15690 }
15691 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15692 {
15693 ReplaceClassMembers(exp, thisClass);
15694 if(exp->type != 0)
15695 {
15696 ProcessExpressionType(exp);
15697 break;
15698 }
15699 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15700 break;
15701 }
15702 else
15703 {
15704 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15705
15706 if(!symbol)
15707 {
15708 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15709 break;
15710 else
15711 {
15712 if(thisClass)
15713 {
15714 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15715 if(exp->type != 0)
15716 {
15717 ProcessExpressionType(exp);
15718 break;
15719 }
15720 }
15721 else if(currentClass && !id->_class)
15722 {
15723 if(ResolveIdWithClass(exp, currentClass, 1))
15724 break;
15725 }
15726 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15727 }
15728 }
15729 if(symbol)
15730 {
15731 struct Type * type = symbol->type;
15732 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15733
15734 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15735 {
15736 struct Context * context = SetupTemplatesContext(_class);
15737
15738 type = ReplaceThisClassType(_class);
15739 FinishTemplatesContext(context);
15740 if(type)
15741 type->refCount = 0;
15742 }
15743 FreeSpecifier(id->_class);
15744 id->_class = (((void *)0));
15745 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15746 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
15747 id->classSym = (((void *)0));
15748 exp->expType = type;
15749 if(type)
15750 type->refCount++;
15751 if(type && (type->kind == 15))
15752 exp->isConstant = 1;
15753 if(symbol->isParam || !strcmp(id->string, "this"))
15754 {
15755 if(_class && _class->type == 1 && !type->declaredWithStruct)
15756 exp->byReference = 1;
15757 }
15758 if(symbol->isIterator)
15759 {
15760 if(symbol->isIterator == 3)
15761 {
15762 exp->type = 5;
15763 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
15764 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
15765 exp->expType = (((void *)0));
15766 ProcessExpressionType(exp);
15767 }
15768 else if(symbol->isIterator != 4)
15769 {
15770 exp->type = 8;
15771 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
15772 exp->__anon1.member.exp->expType = exp->expType;
15773 exp->__anon1.member.member = MkIdentifier("data");
15774 exp->expType = (((void *)0));
15775 ProcessExpressionType(exp);
15776 }
15777 }
15778 break;
15779 }
15780 else
15781 {
15782 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
15783
15784 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15785 {
15786 char name[1024];
15787
15788 strcpy(name, thisNameSpace);
15789 strcat(name, "::");
15790 strcat(name, id->string);
15791 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
15792 }
15793 if(!definedExp)
15794 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
15795 if(definedExp)
15796 {
15797 int c;
15798
15799 for(c = 0; c < definedExpStackPos; c++)
15800 if(definedExpStack[c] == definedExp)
15801 break;
15802 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
15803 {
15804 struct Location backupYylloc = yylloc;
15805 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
15806
15807 definedExpStack[definedExpStackPos++] = definedExp;
15808 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
15809 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
15810 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15811
15812 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15813 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
15814 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
15815 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15816
15817 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15818 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
15819 echoOn = 0;
15820 parsedExpression = (((void *)0));
15821 resetScanner();
15822 expression_yyparse();
15823 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
15824 if(backInput)
15825 fileInput = backInput;
15826 yylloc = backupYylloc;
15827 if(parsedExpression)
15828 {
15829 FreeIdentifier(id);
15830 exp->type = 5;
15831 exp->__anon1.list = MkListOne(parsedExpression);
15832 ApplyLocation(parsedExpression, &yylloc);
15833 ProcessExpressionType(exp);
15834 definedExpStackPos--;
15835 return ;
15836 }
15837 definedExpStackPos--;
15838 }
15839 else
15840 {
15841 if(inCompiler)
15842 {
15843 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
15844 }
15845 }
15846 }
15847 else
15848 {
15849 struct GlobalData * data = (((void *)0));
15850
15851 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15852 {
15853 char name[1024];
15854
15855 strcpy(name, thisNameSpace);
15856 strcat(name, "::");
15857 strcat(name, id->string);
15858 data = FindGlobalData(name);
15859 }
15860 if(!data)
15861 data = FindGlobalData(id->string);
15862 if(data)
15863 {
15864 DeclareGlobalData(curExternal, data);
15865 exp->expType = data->dataType;
15866 if(data->dataType)
15867 data->dataType->refCount++;
15868 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15869 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
15870 FreeSpecifier(id->_class);
15871 id->_class = (((void *)0));
15872 break;
15873 }
15874 else
15875 {
15876 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
15877
15878 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15879 {
15880 char name[1024];
15881
15882 strcpy(name, thisNameSpace);
15883 strcat(name, "::");
15884 strcat(name, id->string);
15885 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
15886 }
15887 if(!function)
15888 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
15889 if(function)
15890 {
15891 char name[1024];
15892
15893 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15894 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
15895 name[0] = (char)0;
15896 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
15897 strcpy(name, "__ecereFunction_");
15898 FullClassNameCat(name, id->string, 0);
15899 if(DeclareFunction(curExternal, function, name))
15900 {
15901 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15902 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
15903 }
15904 exp->expType = function->dataType;
15905 if(function->dataType)
15906 function->dataType->refCount++;
15907 FreeSpecifier(id->_class);
15908 id->_class = (((void *)0));
15909 break;
15910 }
15911 }
15912 }
15913 }
15914 }
15915 unresolved = 1;
15916 break;
15917 }
15918 case 1:
15919 {
15920 if(!exp->__anon1.instance->_class)
15921 {
15922 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
15923 {
15924 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
15925 }
15926 }
15927 ProcessInstantiationType(exp->__anon1.instance);
15928 exp->isConstant = exp->__anon1.instance->isConstant;
15929 if(exp->__anon1.instance->_class)
15930 {
15931 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
15932 }
15933 break;
15934 }
15935 case 2:
15936 {
15937 if(!exp->expType)
15938 {
15939 char * constant = exp->__anon1.__anon1.constant;
15940 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
15941
15942 exp->expType = type;
15943 if(constant[0] == '\'')
15944 {
15945 if((int)((unsigned char *)constant)[1] > 127)
15946 {
15947 int nb;
15948 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
15949
15950 if(nb < 2)
15951 ch = constant[1];
15952 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
15953 exp->__anon1.__anon1.constant = PrintUInt(ch);
15954 type->kind = 8;
15955 type->__anon1._class = FindClass("unichar");
15956 type->isSigned = 0;
15957 }
15958 else
15959 {
15960 type->kind = 1;
15961 type->isSigned = 1;
15962 }
15963 }
15964 else
15965 {
15966 char * dot = strchr(constant, '.');
15967 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
15968 char * exponent;
15969
15970 if(isHex)
15971 {
15972 exponent = strchr(constant, 'p');
15973 if(!exponent)
15974 exponent = strchr(constant, 'P');
15975 }
15976 else
15977 {
15978 exponent = strchr(constant, 'e');
15979 if(!exponent)
15980 exponent = strchr(constant, 'E');
15981 }
15982 if(dot || exponent)
15983 {
15984 if(strchr(constant, 'f') || strchr(constant, 'F'))
15985 type->kind = 6;
15986 else
15987 type->kind = 7;
15988 type->isSigned = 1;
15989 }
15990 else
15991 {
15992 unsigned int isSigned = constant[0] == '-';
15993 char * endP = (((void *)0));
15994 long long i64 = strtoll(constant, &endP, 0);
15995 uint64 ui64 = strtoull(constant, &endP, 0);
15996 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
15997 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
15998
15999 if(isSigned)
16000 {
16001 if(i64 < (((int)0x80000000)))
16002 is64Bit = 1;
16003 }
16004 else
16005 {
16006 if(ui64 > (((int)0x7fffffff)))
16007 {
16008 if(ui64 > (0xffffffff))
16009 {
16010 is64Bit = 1;
16011 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16012 isSigned = 1;
16013 }
16014 }
16015 else if(constant[0] != '0' || !constant[1])
16016 isSigned = 1;
16017 }
16018 if(forceUnsigned)
16019 isSigned = 0;
16020 type->kind = is64Bit ? 4 : 3;
16021 type->isSigned = isSigned;
16022 }
16023 }
16024 exp->isConstant = 1;
16025 if(exp->destType && exp->destType->kind == 7)
16026 type->kind = 7;
16027 else if(exp->destType && exp->destType->kind == 6)
16028 type->kind = 6;
16029 else if(exp->destType && exp->destType->kind == 4)
16030 type->kind = 4;
16031 }
16032 break;
16033 }
16034 case 3:
16035 {
16036 exp->isConstant = 1;
16037 exp->expType = __extension__ ({
16038 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16039
16040 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16041 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16042
16043 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16044 }), __ecereInstance2;
16045 });
16046 break;
16047 }
16048 case 13:
16049 case 26:
16050 ProcessExpressionType(exp->__anon1._new.size);
16051 exp->expType = __extension__ ({
16052 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16053
16054 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16055 });
16056 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16057 break;
16058 case 14:
16059 case 27:
16060 ProcessExpressionType(exp->__anon1._renew.size);
16061 ProcessExpressionType(exp->__anon1._renew.exp);
16062 exp->expType = __extension__ ({
16063 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16064
16065 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16066 });
16067 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16068 break;
16069 case 4:
16070 {
16071 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16072 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16073 unsigned int useDestType = 0, useSideType = 0;
16074 struct Location oldyylloc = yylloc;
16075 unsigned int useSideUnit = 0;
16076 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16077 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16078
16079 switch(exp->__anon1.op.op)
16080 {
16081 case '=':
16082 case MUL_ASSIGN:
16083 case DIV_ASSIGN:
16084 case MOD_ASSIGN:
16085 case ADD_ASSIGN:
16086 case SUB_ASSIGN:
16087 case LEFT_ASSIGN:
16088 case RIGHT_ASSIGN:
16089 case AND_ASSIGN:
16090 case XOR_ASSIGN:
16091 case OR_ASSIGN:
16092 assign = 1;
16093 break;
16094 case '!':
16095 break;
16096 case AND_OP:
16097 case OR_OP:
16098 boolOps = 1;
16099 boolResult = 1;
16100 break;
16101 case EQ_OP:
16102 case '<':
16103 case '>':
16104 case LE_OP:
16105 case GE_OP:
16106 case NE_OP:
16107 boolResult = 1;
16108 useSideType = 1;
16109 break;
16110 case '+':
16111 case '-':
16112 useSideUnit = 1;
16113 useSideType = 1;
16114 useDestType = 1;
16115 break;
16116 case LEFT_OP:
16117 case RIGHT_OP:
16118 useSideType = 1;
16119 useDestType = 1;
16120 break;
16121 case '|':
16122 case '^':
16123 useSideType = 1;
16124 useDestType = 1;
16125 break;
16126 case '/':
16127 case '%':
16128 useSideType = 1;
16129 useDestType = 1;
16130 break;
16131 case '&':
16132 case '*':
16133 if(exp->__anon1.op.exp1)
16134 {
16135 useSideType = 1;
16136 useDestType = 1;
16137 }
16138 break;
16139 }
16140 if(exp->__anon1.op.op == '&')
16141 {
16142 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16143 {
16144 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16145 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16146
16147 if(symbol && symbol->isIterator == 2)
16148 {
16149 exp->type = 8;
16150 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16151 exp->__anon1.member.member = MkIdentifier("key");
16152 exp->expType = (((void *)0));
16153 exp->__anon1.op.exp2->expType = symbol->type;
16154 symbol->type->refCount++;
16155 ProcessExpressionType(exp);
16156 FreeType(dummy);
16157 break;
16158 }
16159 }
16160 }
16161 if(exp->__anon1.op.exp1)
16162 {
16163 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16164 useDestType = 0;
16165 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16166 {
16167 if(exp->__anon1.op.exp1->destType)
16168 FreeType(exp->__anon1.op.exp1->destType);
16169 exp->__anon1.op.exp1->destType = exp->destType;
16170 exp->__anon1.op.exp1->opDestType = 1;
16171 if(exp->destType)
16172 exp->destType->refCount++;
16173 }
16174 else if(!assign)
16175 {
16176 if(exp->__anon1.op.exp1->destType)
16177 FreeType(exp->__anon1.op.exp1->destType);
16178 exp->__anon1.op.exp1->destType = dummy;
16179 dummy->refCount++;
16180 }
16181 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16182 exp->__anon1.op.exp1->destType->count++;
16183 ProcessExpressionType(exp->__anon1.op.exp1);
16184 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16185 exp->__anon1.op.exp1->destType->count--;
16186 exp->__anon1.op.exp1->opDestType = 0;
16187 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)
16188 {
16189 exp->__anon1.op.exp2 = MkExpConstant("1");
16190 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16191 assign = 1;
16192 }
16193 if(exp->__anon1.op.exp1->destType == dummy)
16194 {
16195 FreeType(dummy);
16196 exp->__anon1.op.exp1->destType = (((void *)0));
16197 }
16198 type1 = exp->__anon1.op.exp1->expType;
16199 }
16200 if(exp->__anon1.op.exp2)
16201 {
16202 char expString[10240];
16203
16204 expString[0] = '\0';
16205 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16206 {
16207 if(exp->__anon1.op.exp1)
16208 {
16209 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16210 if(exp->__anon1.op.exp1->expType)
16211 exp->__anon1.op.exp1->expType->refCount++;
16212 }
16213 else
16214 {
16215 exp->__anon1.op.exp2->destType = exp->destType;
16216 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16217 exp->__anon1.op.exp2->opDestType = 1;
16218 if(exp->destType)
16219 exp->destType->refCount++;
16220 }
16221 if(type1)
16222 type1->refCount++;
16223 exp->expType = type1;
16224 }
16225 else if(assign)
16226 {
16227 if(inCompiler)
16228 PrintExpression(exp->__anon1.op.exp2, expString);
16229 if(type1 && type1->kind == 13)
16230 {
16231 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)
16232 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16233 else if(exp->__anon1.op.op == '=')
16234 {
16235 if(exp->__anon1.op.exp2->destType)
16236 FreeType(exp->__anon1.op.exp2->destType);
16237 exp->__anon1.op.exp2->destType = type1;
16238 if(type1)
16239 type1->refCount++;
16240 }
16241 }
16242 else
16243 {
16244 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)
16245 ;
16246 else
16247 {
16248 if(exp->__anon1.op.exp2->destType)
16249 FreeType(exp->__anon1.op.exp2->destType);
16250 exp->__anon1.op.exp2->destType = type1;
16251 if(type1)
16252 type1->refCount++;
16253 }
16254 }
16255 if(type1)
16256 type1->refCount++;
16257 exp->expType = type1;
16258 }
16259 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16260 {
16261 if(exp->__anon1.op.exp2->destType)
16262 FreeType(exp->__anon1.op.exp2->destType);
16263 exp->__anon1.op.exp2->destType = exp->destType;
16264 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16265 exp->__anon1.op.exp2->opDestType = 1;
16266 if(exp->destType)
16267 exp->destType->refCount++;
16268 }
16269 else
16270 {
16271 if(exp->__anon1.op.exp2->destType)
16272 FreeType(exp->__anon1.op.exp2->destType);
16273 exp->__anon1.op.exp2->destType = dummy;
16274 dummy->refCount++;
16275 }
16276 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))
16277 {
16278 FreeType(exp->__anon1.op.exp2->destType);
16279 exp->__anon1.op.exp2->destType = type1;
16280 type1->refCount++;
16281 }
16282 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16283 exp->__anon1.op.exp2->destType->count++;
16284 if(exp->__anon1.op.op == SIZEOF)
16285 {
16286 struct Expression * e = exp->__anon1.op.exp2;
16287
16288 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16289 {
16290 if(e->type == 5 || e->type == 32 || e->type == 23)
16291 {
16292 if(e->type == 23)
16293 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16294 else
16295 e = (*e->__anon1.list).last;
16296 }
16297 }
16298 if(e->type == 11 && e->__anon1.cast.exp)
16299 e->__anon1.cast.exp->needCast = 1;
16300 }
16301 ProcessExpressionType(exp->__anon1.op.exp2);
16302 exp->__anon1.op.exp2->opDestType = 0;
16303 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16304 exp->__anon1.op.exp2->destType->count--;
16305 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16306 {
16307 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)
16308 {
16309 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16310 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16311 }
16312 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)))
16313 {
16314 if(exp->__anon1.op.op == ADD_ASSIGN)
16315 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16316 }
16317 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))
16318 {
16319 if(exp->__anon1.op.op == ADD_ASSIGN)
16320 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16321 }
16322 else if(inCompiler)
16323 {
16324 char type1String[1024];
16325 char type2String[1024];
16326
16327 type1String[0] = '\0';
16328 type2String[0] = '\0';
16329 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16330 PrintType(type1, type2String, 0, 1);
16331 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16332 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16333 }
16334 }
16335 if(exp->__anon1.op.exp2->destType == dummy)
16336 {
16337 FreeType(dummy);
16338 exp->__anon1.op.exp2->destType = (((void *)0));
16339 }
16340 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16341 {
16342 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16343 type2->refCount = 1;
16344 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16345 type2->isSigned = 1;
16346 }
16347 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))
16348 {
16349 type2 = __extension__ ({
16350 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16351
16352 __ecereInstance1->kind = 3, __ecereInstance1;
16353 });
16354 type2->refCount = 1;
16355 type2->isSigned = 1;
16356 }
16357 else
16358 {
16359 type2 = exp->__anon1.op.exp2->expType;
16360 if(type2)
16361 type2->refCount++;
16362 }
16363 }
16364 dummy->kind = 0;
16365 if(exp->__anon1.op.op == SIZEOF)
16366 {
16367 exp->expType = __extension__ ({
16368 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16369
16370 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16371 });
16372 exp->isConstant = 1;
16373 }
16374 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16375 {
16376 exp->expType = Dereference(type2);
16377 if(type2 && type2->kind == 8)
16378 notByReference = 1;
16379 }
16380 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16381 exp->expType = Reference(type2);
16382 else if(!assign)
16383 {
16384 if(boolOps)
16385 {
16386 if(exp->__anon1.op.exp1)
16387 {
16388 if(exp->__anon1.op.exp1->destType)
16389 FreeType(exp->__anon1.op.exp1->destType);
16390 exp->__anon1.op.exp1->destType = MkClassType("bool");
16391 exp->__anon1.op.exp1->destType->truth = 1;
16392 if(!exp->__anon1.op.exp1->expType)
16393 ProcessExpressionType(exp->__anon1.op.exp1);
16394 else
16395 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16396 FreeType(exp->__anon1.op.exp1->expType);
16397 exp->__anon1.op.exp1->expType = MkClassType("bool");
16398 exp->__anon1.op.exp1->expType->truth = 1;
16399 }
16400 if(exp->__anon1.op.exp2)
16401 {
16402 if(exp->__anon1.op.exp2->destType)
16403 FreeType(exp->__anon1.op.exp2->destType);
16404 exp->__anon1.op.exp2->destType = MkClassType("bool");
16405 exp->__anon1.op.exp2->destType->truth = 1;
16406 if(!exp->__anon1.op.exp2->expType)
16407 ProcessExpressionType(exp->__anon1.op.exp2);
16408 else
16409 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16410 FreeType(exp->__anon1.op.exp2->expType);
16411 exp->__anon1.op.exp2->expType = MkClassType("bool");
16412 exp->__anon1.op.exp2->expType->truth = 1;
16413 }
16414 }
16415 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")))))
16416 {
16417 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"))))
16418 {
16419 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)))
16420 {
16421 struct Type * intType;
16422
16423 if(!type1->__anon1._class->__anon1.registered->dataType)
16424 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16425 if(!type2->__anon1._class->__anon1.registered->dataType)
16426 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16427 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
16428 if(exp->__anon1.op.exp1->destType)
16429 FreeType(exp->__anon1.op.exp1->destType);
16430 if(exp->__anon1.op.exp2->destType)
16431 FreeType(exp->__anon1.op.exp2->destType);
16432 exp->__anon1.op.exp1->destType = intType;
16433 exp->__anon1.op.exp2->destType = intType;
16434 intType->refCount++;
16435 }
16436 else
16437 {
16438 if(exp->__anon1.op.exp2->destType)
16439 FreeType(exp->__anon1.op.exp2->destType);
16440 exp->__anon1.op.exp2->destType = type1;
16441 type1->refCount++;
16442 if(exp->__anon1.op.exp1->destType)
16443 FreeType(exp->__anon1.op.exp1->destType);
16444 exp->__anon1.op.exp1->destType = type2;
16445 type2->refCount++;
16446 }
16447 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)
16448 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);
16449 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16450 {
16451 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16452
16453 if(argExp)
16454 {
16455 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16456
16457 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16458 ProcessExpressionType(exp->__anon1.op.exp1);
16459 if(type2->kind != 13)
16460 {
16461 ProcessExpressionType(classExp);
16462 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16463 if(!exp->__anon1.op.exp2->expType)
16464 {
16465 if(type2)
16466 FreeType(type2);
16467 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16468 type2->refCount++;
16469 }
16470 ProcessExpressionType(exp->__anon1.op.exp2);
16471 }
16472 }
16473 }
16474 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)))
16475 {
16476 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16477 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16478 exp->expType = type1;
16479 if(type1)
16480 type1->refCount++;
16481 }
16482 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)))
16483 {
16484 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16485 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16486 exp->expType = type2;
16487 if(type2)
16488 type2->refCount++;
16489 }
16490 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))
16491 {
16492 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16493 }
16494 else
16495 {
16496 unsigned int success = 0;
16497
16498 if(type1->kind == 13 && type2->kind == 13)
16499 {
16500 if(exp->__anon1.op.op == '+')
16501 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16502 else if(exp->__anon1.op.op == '-')
16503 {
16504 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16505 {
16506 exp->expType = __extension__ ({
16507 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16508
16509 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16510 });
16511 success = 1;
16512 if(type1->__anon1.type->kind == 20)
16513 {
16514 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16515
16516 if(argExp)
16517 {
16518 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16519
16520 ProcessExpressionType(classExp);
16521 exp->type = 5;
16522 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"))));
16523 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16524 FreeType(dummy);
16525 return ;
16526 }
16527 }
16528 }
16529 }
16530 }
16531 if(!success && exp->__anon1.op.exp1->type == 2)
16532 {
16533 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16534 {
16535 if(exp->expType)
16536 FreeType(exp->expType);
16537 exp->expType = exp->__anon1.op.exp1->destType;
16538 if(exp->__anon1.op.exp1->destType)
16539 exp->__anon1.op.exp1->destType->refCount++;
16540 success = 1;
16541 }
16542 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16543 {
16544 if(exp->expType)
16545 FreeType(exp->expType);
16546 exp->expType = exp->__anon1.op.exp2->destType;
16547 if(exp->__anon1.op.exp2->destType)
16548 exp->__anon1.op.exp2->destType->refCount++;
16549 success = 1;
16550 }
16551 }
16552 else if(!success)
16553 {
16554 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16555 {
16556 if(exp->expType)
16557 FreeType(exp->expType);
16558 exp->expType = exp->__anon1.op.exp2->destType;
16559 if(exp->__anon1.op.exp2->destType)
16560 exp->__anon1.op.exp2->destType->refCount++;
16561 success = 1;
16562 }
16563 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16564 {
16565 if(exp->expType)
16566 FreeType(exp->expType);
16567 exp->expType = exp->__anon1.op.exp1->destType;
16568 if(exp->__anon1.op.exp1->destType)
16569 exp->__anon1.op.exp1->destType->refCount++;
16570 success = 1;
16571 }
16572 }
16573 if(!success)
16574 {
16575 char expString1[10240];
16576 char expString2[10240];
16577 char type1[1024];
16578 char type2[1024];
16579
16580 expString1[0] = '\0';
16581 expString2[0] = '\0';
16582 type1[0] = '\0';
16583 type2[0] = '\0';
16584 if(inCompiler)
16585 {
16586 PrintExpression(exp->__anon1.op.exp1, expString1);
16587 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16588 PrintExpression(exp->__anon1.op.exp2, expString2);
16589 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16590 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16591 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16592 }
16593 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16594 }
16595 }
16596 }
16597 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)
16598 {
16599 if(exp->__anon1.op.exp1->destType)
16600 FreeType(exp->__anon1.op.exp1->destType);
16601 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16602 if(type2->__anon1._class->__anon1.registered->dataType)
16603 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16604 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16605 exp->expType = type2;
16606 if(type2)
16607 type2->refCount++;
16608 }
16609 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)
16610 {
16611 if(exp->__anon1.op.exp2->destType)
16612 FreeType(exp->__anon1.op.exp2->destType);
16613 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16614 if(type1->__anon1._class->__anon1.registered->dataType)
16615 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16616 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16617 exp->expType = type1;
16618 if(type1)
16619 type1->refCount++;
16620 }
16621 else if(type1)
16622 {
16623 unsigned int valid = 0;
16624
16625 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
16626 {
16627 if(exp->__anon1.op.exp2->destType)
16628 FreeType(exp->__anon1.op.exp2->destType);
16629 if(!type1->__anon1._class->__anon1.registered->dataType)
16630 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16631 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16632 exp->__anon1.op.exp2->destType->refCount++;
16633 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16634 if(type2)
16635 FreeType(type2);
16636 type2 = exp->__anon1.op.exp2->destType;
16637 if(type2)
16638 type2->refCount++;
16639 exp->expType = type2;
16640 type2->refCount++;
16641 }
16642 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
16643 {
16644 if(exp->__anon1.op.exp1->destType)
16645 FreeType(exp->__anon1.op.exp1->destType);
16646 if(!type2->__anon1._class->__anon1.registered->dataType)
16647 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16648 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16649 exp->__anon1.op.exp1->destType->refCount++;
16650 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16651 type1 = exp->__anon1.op.exp1->destType;
16652 exp->expType = type1;
16653 type1->refCount++;
16654 }
16655 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
16656 {
16657 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
16658 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
16659
16660 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
16661 {
16662 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16663 {
16664 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16665 {
16666 if(exp->expType)
16667 FreeType(exp->expType);
16668 exp->expType = exp->__anon1.op.exp2->expType;
16669 if(exp->__anon1.op.exp2->expType)
16670 exp->__anon1.op.exp2->expType->refCount++;
16671 valid = 1;
16672 }
16673 }
16674 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16675 {
16676 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16677 {
16678 if(exp->expType)
16679 FreeType(exp->expType);
16680 exp->expType = exp->__anon1.op.exp1->expType;
16681 if(exp->__anon1.op.exp1->expType)
16682 exp->__anon1.op.exp1->expType->refCount++;
16683 valid = 1;
16684 }
16685 }
16686 }
16687 else
16688 {
16689 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16690 {
16691 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16692 {
16693 if(exp->expType)
16694 FreeType(exp->expType);
16695 exp->expType = exp->__anon1.op.exp1->expType;
16696 if(exp->__anon1.op.exp1->expType)
16697 exp->__anon1.op.exp1->expType->refCount++;
16698 valid = 1;
16699 }
16700 }
16701 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16702 {
16703 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16704 {
16705 if(exp->expType)
16706 FreeType(exp->expType);
16707 exp->expType = exp->__anon1.op.exp2->expType;
16708 if(exp->__anon1.op.exp2->expType)
16709 exp->__anon1.op.exp2->expType->refCount++;
16710 valid = 1;
16711 }
16712 }
16713 }
16714 }
16715 if(!valid)
16716 {
16717 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))
16718 {
16719 if(exp->__anon1.op.exp1->destType)
16720 FreeType(exp->__anon1.op.exp1->destType);
16721 exp->__anon1.op.exp1->destType = type2;
16722 type2->refCount++;
16723 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16724 {
16725 if(exp->expType)
16726 FreeType(exp->expType);
16727 exp->expType = exp->__anon1.op.exp1->destType;
16728 if(exp->__anon1.op.exp1->destType)
16729 exp->__anon1.op.exp1->destType->refCount++;
16730 }
16731 }
16732 else
16733 {
16734 if(exp->__anon1.op.exp2->destType)
16735 FreeType(exp->__anon1.op.exp2->destType);
16736 exp->__anon1.op.exp2->destType = type1;
16737 type1->refCount++;
16738 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16739 {
16740 if(exp->expType)
16741 FreeType(exp->expType);
16742 exp->expType = exp->__anon1.op.exp2->destType;
16743 if(exp->__anon1.op.exp2->destType)
16744 exp->__anon1.op.exp2->destType->refCount++;
16745 }
16746 else if(type1 && type2)
16747 {
16748 char expString1[10240];
16749 char expString2[10240];
16750 char type1String[1024];
16751 char type2String[1024];
16752
16753 expString1[0] = '\0';
16754 expString2[0] = '\0';
16755 type1String[0] = '\0';
16756 type2String[0] = '\0';
16757 if(inCompiler)
16758 {
16759 PrintExpression(exp->__anon1.op.exp1, expString1);
16760 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16761 PrintExpression(exp->__anon1.op.exp2, expString2);
16762 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16763 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
16764 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
16765 }
16766 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
16767 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
16768 {
16769 exp->expType = exp->__anon1.op.exp1->expType;
16770 if(exp->__anon1.op.exp1->expType)
16771 exp->__anon1.op.exp1->expType->refCount++;
16772 }
16773 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16774 {
16775 exp->expType = exp->__anon1.op.exp2->expType;
16776 if(exp->__anon1.op.exp2->expType)
16777 exp->__anon1.op.exp2->expType->refCount++;
16778 }
16779 }
16780 }
16781 }
16782 }
16783 else if(type2)
16784 {
16785 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16786 {
16787 struct Type * oldType = exp->__anon1.op.exp1->expType;
16788
16789 exp->__anon1.op.exp1->expType = (((void *)0));
16790 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16791 FreeType(oldType);
16792 else
16793 exp->__anon1.op.exp1->expType = oldType;
16794 }
16795 if(exp->__anon1.op.exp1->destType)
16796 FreeType(exp->__anon1.op.exp1->destType);
16797 exp->__anon1.op.exp1->destType = type2;
16798 type2->refCount++;
16799 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16800 {
16801 if(exp->expType)
16802 FreeType(exp->expType);
16803 exp->expType = exp->__anon1.op.exp1->destType;
16804 if(exp->__anon1.op.exp1->destType)
16805 exp->__anon1.op.exp1->destType->refCount++;
16806 }
16807 }
16808 }
16809 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
16810 {
16811 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16812 {
16813 if(exp->__anon1.op.exp1->destType)
16814 FreeType(exp->__anon1.op.exp1->destType);
16815 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16816 if(type2->__anon1._class->__anon1.registered->dataType)
16817 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16818 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16819 }
16820 if(exp->__anon1.op.op == '!')
16821 {
16822 exp->expType = MkClassType("bool");
16823 exp->expType->truth = 1;
16824 }
16825 else
16826 {
16827 exp->expType = type2;
16828 if(type2)
16829 type2->refCount++;
16830 }
16831 }
16832 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
16833 {
16834 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16835 {
16836 if(exp->__anon1.op.exp2->destType)
16837 FreeType(exp->__anon1.op.exp2->destType);
16838 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16839 if(type1->__anon1._class->__anon1.registered->dataType)
16840 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16841 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16842 }
16843 exp->expType = type1;
16844 if(type1)
16845 type1->refCount++;
16846 }
16847 }
16848 yylloc = exp->loc;
16849 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
16850 {
16851 char expString[10000];
16852
16853 expString[0] = '\0';
16854 if(inCompiler)
16855 {
16856 PrintExpression(exp->__anon1.op.exp1, expString);
16857 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16858 }
16859 if(expString[0])
16860 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16861 }
16862 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
16863 {
16864 char expString[10240];
16865
16866 expString[0] = '\0';
16867 if(inCompiler)
16868 {
16869 PrintExpression(exp->__anon1.op.exp2, expString);
16870 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16871 }
16872 if(expString[0])
16873 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16874 }
16875 if(boolResult)
16876 {
16877 FreeType(exp->expType);
16878 exp->expType = MkClassType("bool");
16879 exp->expType->truth = 1;
16880 }
16881 if(exp->__anon1.op.op != SIZEOF)
16882 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
16883 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
16884 {
16885 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
16886 }
16887 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
16888 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
16889 yylloc = oldyylloc;
16890 FreeType(dummy);
16891 if(type2)
16892 FreeType(type2);
16893 break;
16894 }
16895 case 5:
16896 case 32:
16897 {
16898 struct Expression * e;
16899
16900 exp->isConstant = 1;
16901 for(e = (*exp->__anon1.list).first; e; e = e->next)
16902 {
16903 if(!e->next)
16904 {
16905 FreeType(e->destType);
16906 e->opDestType = exp->opDestType;
16907 e->destType = exp->destType;
16908 if(e->destType)
16909 {
16910 exp->destType->refCount++;
16911 }
16912 }
16913 ProcessExpressionType(e);
16914 if(!exp->expType && !e->next)
16915 {
16916 exp->expType = e->expType;
16917 if(e->expType)
16918 e->expType->refCount++;
16919 }
16920 if(!e->isConstant)
16921 exp->isConstant = 0;
16922 }
16923 e = (*exp->__anon1.list).first;
16924 if(!e->next && e->type == 8)
16925 {
16926 struct Expression * next = exp->next, * prev = exp->prev;
16927
16928 FreeType(exp->expType);
16929 FreeType(exp->destType);
16930 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16931 *exp = *e;
16932 exp->prev = prev;
16933 exp->next = next;
16934 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
16935 ProcessExpressionType(exp);
16936 }
16937 break;
16938 }
16939 case 6:
16940 {
16941 struct Expression * e;
16942
16943 exp->isConstant = 1;
16944 ProcessExpressionType(exp->__anon1.index.exp);
16945 if(!exp->__anon1.index.exp->isConstant)
16946 exp->isConstant = 0;
16947 if(exp->__anon1.index.exp->expType)
16948 {
16949 struct Type * source = exp->__anon1.index.exp->expType;
16950
16951 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
16952 {
16953 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
16954 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
16955
16956 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
16957 {
16958 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
16959 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
16960 {
16961 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
16962
16963 if(type->kind == 8)
16964 type->constant = 1;
16965 else if(type->kind == 13)
16966 {
16967 struct Type * t = type;
16968
16969 while(t->kind == 13)
16970 t = t->__anon1.type;
16971 t->constant = 1;
16972 }
16973 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
16974 }
16975 }
16976 }
16977 }
16978 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
16979 {
16980 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
16981 {
16982 if(e->destType)
16983 FreeType(e->destType);
16984 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
16985 }
16986 ProcessExpressionType(e);
16987 if(!e->next)
16988 {
16989 }
16990 if(!e->isConstant)
16991 exp->isConstant = 0;
16992 }
16993 if(!exp->expType)
16994 exp->expType = Dereference(exp->__anon1.index.exp->expType);
16995 if(exp->expType)
16996 DeclareType(curExternal, exp->expType, 1, 0);
16997 break;
16998 }
16999 case 7:
17000 {
17001 struct Expression * e;
17002 struct Type * functionType;
17003 struct Type * methodType = (((void *)0));
17004 char name[1024];
17005
17006 name[0] = '\0';
17007 if(inCompiler)
17008 {
17009 PrintExpression(exp->__anon1.call.exp, name);
17010 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17011 {
17012 PrintExpression(exp->__anon1.call.exp, name);
17013 }
17014 }
17015 if(exp->__anon1.call.exp->type == 0)
17016 {
17017 struct Expression * idExp = exp->__anon1.call.exp;
17018 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17019
17020 if(!strcmp(id->string, "__builtin_frame_address"))
17021 {
17022 exp->expType = ProcessTypeString("void *", 1);
17023 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17024 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17025 break;
17026 }
17027 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17028 {
17029 exp->expType = ProcessTypeString("int", 1);
17030 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17031 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17032 break;
17033 }
17034 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17035 {
17036 struct Expression * a = (((void *)0));
17037 struct Expression * b = (((void *)0));
17038 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17039
17040 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17041 {
17042 a = (*exp->__anon1.call.arguments).first;
17043 b = (*exp->__anon1.call.arguments).last;
17044 tempExp1 = a;
17045 tempExp2 = b;
17046 }
17047 else if((*exp->__anon1.call.arguments).count == 1)
17048 {
17049 a = (*exp->__anon1.call.arguments).first;
17050 tempExp1 = a;
17051 }
17052 if(a)
17053 {
17054 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17055 idExp->__anon1.__anon1.identifier = (((void *)0));
17056 FreeExpContents(exp);
17057 ProcessExpressionType(a);
17058 if(b)
17059 ProcessExpressionType(b);
17060 exp->type = 5;
17061 exp->__anon1.list = MkList();
17062 if(a->expType && (!b || b->expType))
17063 {
17064 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17065 {
17066 if(inCompiler)
17067 {
17068 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17069 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17070 struct Declaration * decl;
17071 char temp1[1024], temp2[1024];
17072
17073 GetTypeSpecs(a->expType, specs);
17074 if(a && !a->isConstant && a->type != 0)
17075 {
17076 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17077 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17078 tempExp1 = QMkExpId(temp1);
17079 tempExp1->expType = a->expType;
17080 if(a->expType)
17081 a->expType->refCount++;
17082 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17083 }
17084 if(b && !b->isConstant && b->type != 0)
17085 {
17086 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17087 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17088 tempExp2 = QMkExpId(temp2);
17089 tempExp2->expType = b->expType;
17090 if(b->expType)
17091 b->expType->refCount++;
17092 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17093 }
17094 decl = MkDeclaration(specs, decls);
17095 if(!curCompound->__anon1.compound.declarations)
17096 curCompound->__anon1.compound.declarations = MkList();
17097 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17098 }
17099 }
17100 }
17101 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17102 {
17103 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17104
17105 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17106 exp->expType = a->expType;
17107 if(a->expType)
17108 a->expType->refCount++;
17109 }
17110 else if(!strcmp(id->string, "Abs"))
17111 {
17112 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17113 exp->expType = a->expType;
17114 if(a->expType)
17115 a->expType->refCount++;
17116 }
17117 else if(!strcmp(id->string, "Sgn"))
17118 {
17119 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"))))));
17120 exp->expType = ProcessTypeString("int", 0);
17121 }
17122 FreeExpression(tempExp1);
17123 if(tempExp2)
17124 FreeExpression(tempExp2);
17125 FreeIdentifier(id);
17126 break;
17127 }
17128 }
17129 }
17130 {
17131 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17132
17133 if(!exp->__anon1.call.exp->destType)
17134 {
17135 exp->__anon1.call.exp->destType = dummy;
17136 dummy->refCount++;
17137 }
17138 ProcessExpressionType(exp->__anon1.call.exp);
17139 if(exp->__anon1.call.exp->destType == dummy)
17140 {
17141 FreeType(dummy);
17142 exp->__anon1.call.exp->destType = (((void *)0));
17143 }
17144 FreeType(dummy);
17145 }
17146 functionType = exp->__anon1.call.exp->expType;
17147 if(functionType && functionType->kind == 16)
17148 {
17149 methodType = functionType;
17150 functionType = methodType->__anon1.__anon3.method->dataType;
17151 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17152 {
17153 char typeString[1024];
17154
17155 typeString[0] = '\0';
17156 {
17157 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17158
17159 functionType->__anon1.__anon2.thisClass = (((void *)0));
17160 PrintType(functionType, typeString, 1, 1);
17161 functionType->__anon1.__anon2.thisClass = back;
17162 }
17163 if(strstr(typeString, "thisclass"))
17164 {
17165 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17166 struct Declarator * decl;
17167
17168 {
17169 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17170
17171 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17172 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))
17173 thisClassParams = 0;
17174 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17175 {
17176 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17177
17178 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17179 ProcessDeclarator(decl, 1);
17180 thisClass = backupThisClass;
17181 }
17182 thisClassParams = 1;
17183 functionType = ProcessType(specs, decl);
17184 functionType->refCount = 0;
17185 FinishTemplatesContext(context);
17186 {
17187 struct Type * p, * op;
17188
17189 for(p = functionType->__anon1.__anon2.params.first, op = methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.params.first; p && op; p = p->next, op = op->next)
17190 {
17191 if(op->kind == 21)
17192 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17193 }
17194 }
17195 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17196 {
17197 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17198 }
17199 }
17200 FreeList(specs, (void *)(FreeSpecifier));
17201 FreeDeclarator(decl);
17202 }
17203 }
17204 }
17205 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17206 {
17207 struct Type * type = functionType->__anon1.type;
17208
17209 if(!functionType->refCount)
17210 {
17211 functionType->__anon1.type = (((void *)0));
17212 FreeType(functionType);
17213 }
17214 functionType = type;
17215 }
17216 if(functionType && functionType->kind != 11)
17217 {
17218 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17219 }
17220 else if(functionType)
17221 {
17222 unsigned int emptyParams = 0, noParams = 0;
17223 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17224 struct Type * type = functionType->__anon1.__anon2.params.first;
17225 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17226 int extra = 0;
17227 struct Location oldyylloc = yylloc;
17228
17229 if(!type)
17230 emptyParams = 1;
17231 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17232 {
17233 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17234 e = e->next;
17235 }
17236 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17237 {
17238 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)
17239 {
17240 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17241 if(e)
17242 {
17243 e->destType = type;
17244 e = e->next;
17245 type = functionType->__anon1.__anon2.params.first;
17246 }
17247 else
17248 type->refCount = 0;
17249 }
17250 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17251 {
17252 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17253 type->byReference = functionType->byReference;
17254 type->typedByReference = functionType->typedByReference;
17255 if(e)
17256 {
17257 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17258 e = e->next;
17259 e->destType = type;
17260 e = e->next;
17261 type = functionType->__anon1.__anon2.params.first;
17262 }
17263 else
17264 type->refCount = 0;
17265 }
17266 }
17267 if(type && type->kind == 0)
17268 {
17269 noParams = 1;
17270 if(!type->refCount)
17271 FreeType(type);
17272 type = (((void *)0));
17273 }
17274 for(; e; e = e->next)
17275 {
17276 if(!type && !emptyParams)
17277 {
17278 yylloc = e->loc;
17279 if(methodType && methodType->__anon1.__anon3.methodClass)
17280 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);
17281 else
17282 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);
17283 break;
17284 }
17285 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17286 {
17287 struct Type * templatedType = (((void *)0));
17288 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17289 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17290 int id = 0;
17291
17292 if(_class && _class->templateArgs)
17293 {
17294 struct __ecereNameSpace__ecere__com__Class * sClass;
17295
17296 for(sClass = _class; sClass; sClass = sClass->base)
17297 {
17298 if(sClass->templateClass)
17299 sClass = sClass->templateClass;
17300 id = 0;
17301 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17302 {
17303 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17304 {
17305 struct __ecereNameSpace__ecere__com__Class * nextClass;
17306
17307 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17308 {
17309 if(nextClass->templateClass)
17310 nextClass = nextClass->templateClass;
17311 id += nextClass->templateParams.count;
17312 }
17313 break;
17314 }
17315 id++;
17316 }
17317 if(curParam)
17318 break;
17319 }
17320 }
17321 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17322 {
17323 unsigned int constant = type->constant;
17324 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17325
17326 {
17327 struct Context * context = SetupTemplatesContext(_class);
17328
17329 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17330 FinishTemplatesContext(context);
17331 }
17332 if(templatedType->kind == 8 && constant)
17333 templatedType->constant = 1;
17334 else if(templatedType->kind == 13)
17335 {
17336 struct Type * t = templatedType->__anon1.type;
17337
17338 while(t->kind == 13)
17339 t = t->__anon1.type;
17340 if(constant)
17341 t->constant = constant;
17342 }
17343 e->destType = templatedType;
17344 if(templatedType)
17345 {
17346 templatedType->passAsTemplate = 1;
17347 }
17348 }
17349 else
17350 {
17351 e->destType = type;
17352 if(type)
17353 type->refCount++;
17354 }
17355 }
17356 else
17357 {
17358 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17359 {
17360 e->destType = type->prev;
17361 e->destType->refCount++;
17362 }
17363 else
17364 {
17365 e->destType = type;
17366 if(type)
17367 type->refCount++;
17368 }
17369 }
17370 if(type && type->kind != 14)
17371 {
17372 struct Type * next = type->next;
17373
17374 if(!type->refCount)
17375 FreeType(type);
17376 type = next;
17377 }
17378 }
17379 if(type && type->kind != 14)
17380 {
17381 if(methodType && methodType->__anon1.__anon3.methodClass)
17382 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);
17383 else
17384 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);
17385 }
17386 yylloc = oldyylloc;
17387 if(type && !type->refCount)
17388 FreeType(type);
17389 }
17390 else
17391 {
17392 functionType = __extension__ ({
17393 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17394
17395 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17396 });
17397 if(exp->__anon1.call.exp->type == 0)
17398 {
17399 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17400
17401 if(inCompiler)
17402 {
17403 struct Symbol * symbol;
17404 struct Location oldyylloc = yylloc;
17405
17406 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17407 if(strstr(string, "__builtin_") == string)
17408 {
17409 if(exp->destType)
17410 {
17411 functionType->__anon1.__anon2.returnType = exp->destType;
17412 exp->destType->refCount++;
17413 }
17414 }
17415 else
17416 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17417 symbol = __extension__ ({
17418 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17419
17420 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17421 });
17422 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17423 if(strstr(symbol->string, "::"))
17424 globalContext->hasNameSpace = 1;
17425 yylloc = oldyylloc;
17426 }
17427 }
17428 else if(exp->__anon1.call.exp->type == 8)
17429 {
17430 }
17431 else
17432 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17433 if(!functionType->__anon1.__anon2.returnType)
17434 {
17435 functionType->__anon1.__anon2.returnType = __extension__ ({
17436 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17437
17438 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17439 });
17440 }
17441 }
17442 if(functionType && functionType->kind == 11)
17443 {
17444 exp->expType = functionType->__anon1.__anon2.returnType;
17445 if(functionType->__anon1.__anon2.returnType)
17446 functionType->__anon1.__anon2.returnType->refCount++;
17447 if(!functionType->refCount)
17448 FreeType(functionType);
17449 }
17450 if(exp->__anon1.call.arguments)
17451 {
17452 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17453 ProcessExpressionType(e);
17454 }
17455 break;
17456 }
17457 case 8:
17458 {
17459 struct Type * type;
17460 struct Location oldyylloc = yylloc;
17461 unsigned int thisPtr;
17462 struct Expression * checkExp = exp->__anon1.member.exp;
17463
17464 while(checkExp)
17465 {
17466 if(checkExp->type == 11)
17467 checkExp = checkExp->__anon1.cast.exp;
17468 else if(checkExp->type == 5)
17469 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17470 else
17471 break;
17472 }
17473 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17474 exp->thisPtr = thisPtr;
17475 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17476 {
17477 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17478 }
17479 ProcessExpressionType(exp->__anon1.member.exp);
17480 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)
17481 {
17482 exp->isConstant = 0;
17483 }
17484 else
17485 exp->isConstant = exp->__anon1.member.exp->isConstant;
17486 type = exp->__anon1.member.exp->expType;
17487 yylloc = exp->loc;
17488 if(type && (type->kind == 20))
17489 {
17490 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17491 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17492
17493 if(_class)
17494 {
17495 for(param = _class->templateParams.first; param; param = param->next)
17496 {
17497 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17498 break;
17499 }
17500 }
17501 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17502 {
17503 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17504
17505 if(argExp)
17506 {
17507 struct Expression * expMember = exp->__anon1.member.exp;
17508 struct Declarator * decl;
17509 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17510 char thisClassTypeString[1024];
17511
17512 FreeIdentifier(exp->__anon1.member.member);
17513 ProcessExpressionType(argExp);
17514 {
17515 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17516
17517 if(colon)
17518 {
17519 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17520 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17521 }
17522 else
17523 strcpy(thisClassTypeString, _class->fullName);
17524 }
17525 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17526 exp->expType = ProcessType(specs, decl);
17527 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17528 {
17529 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17530 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17531 int paramCount = 0;
17532 int lastParam = -1;
17533 char templateString[1024];
17534 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17535
17536 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17537 for(cClass = expClass; cClass; cClass = cClass->base)
17538 {
17539 int p = 0;
17540
17541 for(param = cClass->templateParams.first; param; param = param->next)
17542 {
17543 int id = p;
17544 struct __ecereNameSpace__ecere__com__Class * sClass;
17545 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17546
17547 for(sClass = cClass->base; sClass; sClass = sClass->base)
17548 id += sClass->templateParams.count;
17549 arg = expClass->templateArgs[id];
17550 for(sClass = _class; sClass; sClass = sClass->base)
17551 {
17552 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17553 int p = 0;
17554 struct __ecereNameSpace__ecere__com__Class * nextClass;
17555
17556 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17557 p += nextClass->templateParams.count;
17558 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17559 {
17560 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17561 {
17562 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17563 {
17564 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17565 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17566 break;
17567 }
17568 }
17569 }
17570 }
17571 {
17572 char argument[256];
17573
17574 argument[0] = '\0';
17575 switch(param->type)
17576 {
17577 case 2:
17578 {
17579 char expString[1024];
17580 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17581 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17582 struct Expression * exp;
17583 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17584
17585 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17586 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17587 ProcessExpressionType(exp);
17588 ComputeExpression(exp);
17589 expString[0] = '\0';
17590 PrintExpression(exp, expString);
17591 strcat(argument, expString);
17592 FreeExpression(exp);
17593 break;
17594 }
17595 case 1:
17596 {
17597 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17598 break;
17599 }
17600 case 0:
17601 {
17602 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17603 {
17604 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17605 strcat(argument, thisClassTypeString);
17606 else
17607 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17608 }
17609 break;
17610 }
17611 }
17612 if(argument[0])
17613 {
17614 if(paramCount)
17615 strcat(templateString, ", ");
17616 if(lastParam != p - 1)
17617 {
17618 strcat(templateString, param->name);
17619 strcat(templateString, " = ");
17620 }
17621 strcat(templateString, argument);
17622 paramCount++;
17623 lastParam = p;
17624 }
17625 p++;
17626 }
17627 }
17628 }
17629 {
17630 int len = strlen(templateString);
17631
17632 if(templateString[len - 1] == '>')
17633 templateString[len++] = ' ';
17634 templateString[len++] = '>';
17635 templateString[len++] = '\0';
17636 }
17637 {
17638 struct Context * context = SetupTemplatesContext(_class);
17639
17640 FreeType(exp->expType);
17641 exp->expType = ProcessTypeString(templateString, 0);
17642 FinishTemplatesContext(context);
17643 }
17644 }
17645 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
17646 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
17647 exp->type = 5;
17648 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")))))))));
17649 }
17650 }
17651 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
17652 {
17653 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
17654 }
17655 }
17656 if(type && (type->kind == 20))
17657 ;
17658 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)))
17659 {
17660 struct Identifier * id = exp->__anon1.member.member;
17661 int typeKind = type->kind;
17662 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));
17663
17664 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
17665 {
17666 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
17667 typeKind = 8;
17668 }
17669 if(id)
17670 {
17671 if(typeKind == 3 || typeKind == 15)
17672 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
17673 else if(!_class)
17674 {
17675 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17676 {
17677 _class = type->__anon1._class->__anon1.registered;
17678 }
17679 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
17680 {
17681 _class = FindClass("char *")->__anon1.registered;
17682 }
17683 else if(type->kind == 13)
17684 {
17685 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
17686 FreeType(exp->expType);
17687 exp->expType = ProcessTypeString("uintptr", 0);
17688 exp->byReference = 1;
17689 }
17690 else
17691 {
17692 char string[1024] = "";
17693 struct Symbol * classSym;
17694
17695 PrintTypeNoConst(type, string, 0, 1);
17696 classSym = FindClass(string);
17697 if(classSym)
17698 _class = classSym->__anon1.registered;
17699 }
17700 }
17701 }
17702 if(_class && id)
17703 {
17704 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
17705 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
17706 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17707 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
17708 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
17709
17710 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
17711 exp->__anon1.member.memberType = 1;
17712 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
17713 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
17714 if(typeKind != 19)
17715 {
17716 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
17717 {
17718 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17719 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
17720 {
17721 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17722 if(prop)
17723 member = (((void *)0));
17724 }
17725 if(!member && !prop)
17726 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17727 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
17728 exp->__anon1.member.thisPtr = 1;
17729 }
17730 else
17731 {
17732 unsigned int useMemberForNonConst = 0;
17733
17734 if(!id->classSym)
17735 {
17736 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
17737 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);
17738 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17739 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
17740 }
17741 if((!prop || useMemberForNonConst) && !member)
17742 {
17743 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
17744 if(!method)
17745 {
17746 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17747 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);
17748 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17749 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17750 }
17751 }
17752 if(member && prop)
17753 {
17754 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
17755 prop = (((void *)0));
17756 else
17757 member = (((void *)0));
17758 }
17759 }
17760 }
17761 if(!prop && !member && !method)
17762 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
17763 if(!prop && !member && !method)
17764 {
17765 if(typeKind == 19)
17766 {
17767 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
17768 if(classProp)
17769 {
17770 exp->__anon1.member.memberType = 5;
17771 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
17772 }
17773 else
17774 {
17775 char structName[1024];
17776 struct Identifier * id = exp->__anon1.member.member;
17777 struct Expression * classExp = exp->__anon1.member.exp;
17778
17779 type->refCount++;
17780 FreeType(classExp->expType);
17781 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
17782 strcpy(structName, "__ecereClassData_");
17783 FullClassNameCat(structName, type->__anon1._class->string, 0);
17784 exp->type = 9;
17785 exp->__anon1.member.member = id;
17786 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"))))))));
17787 FreeType(type);
17788 ProcessExpressionType(exp);
17789 return ;
17790 }
17791 }
17792 else
17793 {
17794 struct Symbol * classSym = FindClass(id->string);
17795
17796 if(classSym)
17797 {
17798 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
17799
17800 if(convertClass)
17801 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
17802 }
17803 }
17804 }
17805 if(exp->__anon1.member.exp->destType)
17806 FreeType(exp->__anon1.member.exp->destType);
17807 {
17808 if(method && !method->_class->symbol)
17809 method->_class->symbol = FindClass(method->_class->fullName);
17810 if(prop && !prop->_class->symbol)
17811 prop->_class->symbol = FindClass(prop->_class->fullName);
17812 exp->__anon1.member.exp->destType = __extension__ ({
17813 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17814
17815 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1->thisClassFrom = type ? type->thisClassFrom : (((void *)0)), __ecereInstance1;
17816 });
17817 }
17818 if(prop)
17819 {
17820 exp->__anon1.member.memberType = 1;
17821 if(!prop->dataType)
17822 ProcessPropertyType(prop);
17823 exp->expType = prop->dataType;
17824 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
17825 {
17826 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17827
17828 CopyTypeInto(type, exp->expType);
17829 type->refCount = 1;
17830 type->constant = 1;
17831 exp->expType = type;
17832 }
17833 else if(prop->dataType)
17834 prop->dataType->refCount++;
17835 }
17836 else if(member)
17837 {
17838 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17839 {
17840 FreeExpContents(exp);
17841 exp->type = 0;
17842 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17843 ProcessExpressionType(exp);
17844 return ;
17845 }
17846 exp->__anon1.member.memberType = 3;
17847 DeclareStruct(curExternal, _class->fullName, 0, 1);
17848 if(member->_class != _class)
17849 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
17850 if(!member->dataType)
17851 {
17852 struct Context * context = SetupTemplatesContext(_class);
17853
17854 member->dataType = ProcessTypeString(member->dataTypeString, 0);
17855 FinishTemplatesContext(context);
17856 }
17857 exp->expType = member->dataType;
17858 if(member->dataType)
17859 member->dataType->refCount++;
17860 }
17861 else if(revConvert)
17862 {
17863 exp->__anon1.member.memberType = 4;
17864 exp->expType = MkClassType(revConvert->_class->fullName);
17865 }
17866 else if(method)
17867 {
17868 {
17869 exp->__anon1.member.memberType = 2;
17870 }
17871 if(!method->dataType)
17872 ProcessMethodType(method);
17873 exp->expType = __extension__ ({
17874 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17875
17876 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
17877 });
17878 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
17879 exp->expType->__anon1.__anon3.usedClass = _class;
17880 }
17881 else if(!classProp)
17882 {
17883 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17884 {
17885 FreeExpContents(exp);
17886 exp->type = 0;
17887 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17888 FreeType(exp->expType);
17889 exp->expType = MkClassType("ecere::com::Class");
17890 return ;
17891 }
17892 yylloc = exp->__anon1.member.member->loc;
17893 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
17894 if(inCompiler)
17895 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
17896 }
17897 if(_class && exp->expType)
17898 {
17899 struct __ecereNameSpace__ecere__com__Class * tClass;
17900
17901 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
17902 while(tClass && !tClass->templateClass)
17903 tClass = tClass->base;
17904 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
17905 {
17906 int id = 0;
17907 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17908 struct __ecereNameSpace__ecere__com__Class * sClass;
17909
17910 for(sClass = tClass; sClass; sClass = sClass->base)
17911 {
17912 id = 0;
17913 if(sClass->templateClass)
17914 sClass = sClass->templateClass;
17915 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17916 {
17917 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
17918 {
17919 for(sClass = sClass->base; sClass; sClass = sClass->base)
17920 id += sClass->templateParams.count;
17921 break;
17922 }
17923 id++;
17924 }
17925 if(curParam)
17926 break;
17927 }
17928 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
17929 {
17930 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
17931 struct Context * context = SetupTemplatesContext(tClass);
17932 unsigned int constant = exp->expType->constant;
17933 unsigned int passAsTemplate = 0;
17934 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
17935 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
17936
17937 if(t && t->kind == 8 && t->__anon1._class)
17938 thisClassFrom = t->__anon1._class->__anon1.registered;
17939 else
17940 thisClassFrom = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "class");
17941 FreeType(t);
17942 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
17943 FreeType(exp->expType);
17944 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17945 exp->expType->thisClassFrom = thisClassFrom;
17946 if(exp->expType->kind == 8 && constant)
17947 exp->expType->constant = 1;
17948 else if(exp->expType->kind == 13)
17949 {
17950 struct Type * t = exp->expType->__anon1.type;
17951
17952 while(t->kind == 13)
17953 t = t->__anon1.type;
17954 if(constant)
17955 t->constant = constant;
17956 }
17957 if(exp->expType)
17958 {
17959 if(exp->expType->kind == 21)
17960 {
17961 FreeType(exp->expType);
17962 exp->expType = ReplaceThisClassType(_class);
17963 }
17964 if(passAsTemplate)
17965 exp->expType->passAsTemplate = 1;
17966 if(!exp->destType)
17967 {
17968 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17969 if(exp->destType->kind == 8 && constant)
17970 exp->destType->constant = 1;
17971 else if(exp->destType->kind == 13)
17972 {
17973 struct Type * t = exp->destType->__anon1.type;
17974
17975 while(t->kind == 13)
17976 t = t->__anon1.type;
17977 if(constant)
17978 t->constant = constant;
17979 }
17980 if(exp->destType->kind == 21)
17981 {
17982 FreeType(exp->destType);
17983 exp->destType = ReplaceThisClassType(_class);
17984 }
17985 }
17986 }
17987 FinishTemplatesContext(context);
17988 }
17989 }
17990 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)
17991 {
17992 int id = 0;
17993 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17994 struct __ecereNameSpace__ecere__com__Class * sClass;
17995
17996 for(sClass = tClass; sClass; sClass = sClass->base)
17997 {
17998 id = 0;
17999 if(sClass->templateClass)
18000 sClass = sClass->templateClass;
18001 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18002 {
18003 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
18004 {
18005 for(sClass = sClass->base; sClass; sClass = sClass->base)
18006 id += sClass->templateParams.count;
18007 break;
18008 }
18009 id++;
18010 }
18011 if(curParam)
18012 break;
18013 }
18014 if(curParam)
18015 {
18016 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18017 struct Context * context = SetupTemplatesContext(tClass);
18018 struct Type * basicType;
18019
18020 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18021 if(basicType)
18022 {
18023 if(basicType->kind == 21)
18024 {
18025 FreeType(basicType);
18026 basicType = ReplaceThisClassType(_class);
18027 }
18028 FreeType(exp->expType);
18029 exp->expType = __extension__ ({
18030 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18031
18032 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18033 });
18034 if(!exp->destType)
18035 {
18036 exp->destType = exp->expType;
18037 exp->destType->refCount++;
18038 }
18039 {
18040 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18041 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18042 struct Declarator * decl;
18043
18044 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18045 *newExp = *exp;
18046 if(exp->destType)
18047 exp->destType->refCount++;
18048 if(exp->expType)
18049 exp->expType->refCount++;
18050 exp->type = 11;
18051 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18052 exp->__anon1.cast.exp = newExp;
18053 }
18054 }
18055 FinishTemplatesContext(context);
18056 }
18057 }
18058 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18059 {
18060 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18061
18062 if(expClass)
18063 {
18064 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18065 int p = 0;
18066 int paramCount = 0;
18067 int lastParam = -1;
18068 char templateString[1024];
18069 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18070
18071 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18072 while(cClass != expClass)
18073 {
18074 struct __ecereNameSpace__ecere__com__Class * sClass;
18075
18076 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18077 ;
18078 cClass = sClass;
18079 for(param = cClass->templateParams.first; param; param = param->next)
18080 {
18081 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18082 int cp = 0;
18083 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18084 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18085
18086 while(cClassCur != tClass && !paramCur)
18087 {
18088 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18089
18090 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18091 ;
18092 cClassCur = sClassCur;
18093 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18094 {
18095 if(!strcmp(paramCur->name, param->name))
18096 {
18097 break;
18098 }
18099 cp++;
18100 }
18101 }
18102 if(paramCur && paramCur->type == 0)
18103 arg = tClass->templateArgs[cp];
18104 else
18105 arg = expClass->templateArgs[p];
18106 {
18107 char argument[256];
18108
18109 argument[0] = '\0';
18110 switch(param->type)
18111 {
18112 case 2:
18113 {
18114 char expString[1024];
18115 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18116 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18117 struct Expression * exp;
18118 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18119
18120 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18121 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18122 ProcessExpressionType(exp);
18123 ComputeExpression(exp);
18124 expString[0] = '\0';
18125 PrintExpression(exp, expString);
18126 strcat(argument, expString);
18127 FreeExpression(exp);
18128 break;
18129 }
18130 case 1:
18131 {
18132 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18133 break;
18134 }
18135 case 0:
18136 {
18137 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18138 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18139 break;
18140 }
18141 }
18142 if(argument[0])
18143 {
18144 if(paramCount)
18145 strcat(templateString, ", ");
18146 if(lastParam != p - 1)
18147 {
18148 strcat(templateString, param->name);
18149 strcat(templateString, " = ");
18150 }
18151 strcat(templateString, argument);
18152 paramCount++;
18153 lastParam = p;
18154 }
18155 }
18156 p++;
18157 }
18158 }
18159 {
18160 int len = strlen(templateString);
18161
18162 if(templateString[len - 1] == '>')
18163 templateString[len++] = ' ';
18164 templateString[len++] = '>';
18165 templateString[len++] = '\0';
18166 }
18167 FreeType(exp->expType);
18168 {
18169 struct Context * context = SetupTemplatesContext(tClass);
18170
18171 exp->expType = ProcessTypeString(templateString, 0);
18172 FinishTemplatesContext(context);
18173 }
18174 }
18175 }
18176 }
18177 }
18178 else
18179 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)");
18180 }
18181 else if(type && (type->kind == 9 || type->kind == 10))
18182 {
18183 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18184
18185 if(memberType)
18186 {
18187 exp->expType = memberType;
18188 if(memberType)
18189 memberType->refCount++;
18190 }
18191 }
18192 else
18193 {
18194 char expString[10240];
18195
18196 expString[0] = '\0';
18197 if(inCompiler)
18198 {
18199 PrintExpression(exp, expString);
18200 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18201 }
18202 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18203 }
18204 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18205 {
18206 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18207 {
18208 struct Identifier * id = exp->__anon1.member.member;
18209 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));
18210
18211 if(_class)
18212 {
18213 FreeType(exp->expType);
18214 exp->expType = ReplaceThisClassType(_class);
18215 }
18216 }
18217 }
18218 yylloc = oldyylloc;
18219 break;
18220 }
18221 case 9:
18222 {
18223 struct Type * destType = exp->destType;
18224
18225 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18226 {
18227 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18228 }
18229 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18230 exp->type = 8;
18231 if(destType)
18232 destType->count++;
18233 ProcessExpressionType(exp);
18234 if(destType)
18235 destType->count--;
18236 break;
18237 }
18238 case 15:
18239 {
18240 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18241
18242 if(classSym && classSym->__anon1.registered)
18243 {
18244 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18245 {
18246 char name[1024];
18247 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18248
18249 name[0] = '\0';
18250 DeclareStruct(curExternal, classSym->string, 0, 1);
18251 FreeSpecifier(exp->__anon1._class);
18252 FullClassNameCat(name, classSym->string, 0);
18253 if(b->offset == 0)
18254 {
18255 exp->type = 10;
18256 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18257 }
18258 else
18259 {
18260 struct Expression * e;
18261
18262 exp->type = 4;
18263 if(b->structSize == b->offset)
18264 exp->__anon1.op.exp1 = MkExpConstant("0");
18265 else
18266 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18267 exp->__anon1.op.op = '+';
18268 e = exp;
18269 while(b->offset != 0)
18270 {
18271 struct Symbol * sym;
18272 struct Expression * typeSize;
18273
18274 b = b->base;
18275 sym = FindClass(b->fullName);
18276 name[0] = '\0';
18277 DeclareStruct(curExternal, sym->string, 0, 1);
18278 FullClassNameCat(name, sym->string, 0);
18279 if(b->structSize == b->offset)
18280 typeSize = MkExpConstant("0");
18281 else
18282 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18283 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18284 e = e->__anon1.op.exp2;
18285 }
18286 }
18287 }
18288 else
18289 {
18290 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18291 {
18292 FreeSpecifier(exp->__anon1._class);
18293 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18294 exp->type = 2;
18295 }
18296 else
18297 {
18298 char className[1024];
18299
18300 strcpy(className, "__ecereClass_");
18301 FullClassNameCat(className, classSym->string, 1);
18302 DeclareClass(curExternal, classSym, className);
18303 FreeExpContents(exp);
18304 exp->type = 9;
18305 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18306 exp->__anon1.member.member = MkIdentifier("structSize");
18307 }
18308 }
18309 }
18310 exp->expType = __extension__ ({
18311 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18312
18313 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18314 });
18315 break;
18316 }
18317 case 10:
18318 {
18319 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
18320
18321 exp->expType = __extension__ ({
18322 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18323
18324 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18325 });
18326 exp->isConstant = 1;
18327 DeclareType(curExternal, type, 1, 0);
18328 FreeType(type);
18329 break;
18330 }
18331 case 11:
18332 {
18333 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18334
18335 type->count = 1;
18336 FreeType(exp->__anon1.cast.exp->destType);
18337 exp->__anon1.cast.exp->destType = type;
18338 type->refCount++;
18339 type->casted = 1;
18340 ProcessExpressionType(exp->__anon1.cast.exp);
18341 type->casted = 0;
18342 type->count = 0;
18343 exp->expType = type;
18344 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18345 {
18346 void * prev = exp->prev, * next = exp->next;
18347 struct Type * expType = exp->__anon1.cast.exp->destType;
18348 struct Expression * castExp = exp->__anon1.cast.exp;
18349 struct Type * destType = exp->destType;
18350
18351 if(expType)
18352 expType->refCount++;
18353 FreeType(exp->expType);
18354 FreeTypeName(exp->__anon1.cast.typeName);
18355 *exp = *castExp;
18356 FreeType(exp->expType);
18357 FreeType(exp->destType);
18358 exp->expType = expType;
18359 exp->destType = destType;
18360 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
18361 exp->prev = prev;
18362 exp->next = next;
18363 }
18364 else
18365 {
18366 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18367 }
18368 break;
18369 }
18370 case 33:
18371 {
18372 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18373
18374 exp->expType = type;
18375 break;
18376 }
18377 case 34:
18378 {
18379 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18380
18381 ProcessExpressionType(exp->__anon1.vaArg.exp);
18382 exp->expType = type;
18383 break;
18384 }
18385 case 12:
18386 {
18387 struct Expression * e;
18388 struct Type * t = exp->destType;
18389
18390 if(t && !exp->destType->casted)
18391 {
18392 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18393 CopyTypeInto(t, exp->destType);
18394 t->count = 0;
18395 }
18396 else if(t)
18397 t->refCount++;
18398 exp->isConstant = 1;
18399 FreeType(exp->__anon1.cond.cond->destType);
18400 exp->__anon1.cond.cond->destType = MkClassType("bool");
18401 exp->__anon1.cond.cond->destType->truth = 1;
18402 ProcessExpressionType(exp->__anon1.cond.cond);
18403 if(!exp->__anon1.cond.cond->isConstant)
18404 exp->isConstant = 0;
18405 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18406 {
18407 if(!e->next)
18408 {
18409 FreeType(e->destType);
18410 e->destType = t;
18411 if(e->destType)
18412 e->destType->refCount++;
18413 }
18414 ProcessExpressionType(e);
18415 if(!e->next)
18416 {
18417 exp->expType = e->expType;
18418 if(e->expType)
18419 e->expType->refCount++;
18420 }
18421 if(!e->isConstant)
18422 exp->isConstant = 0;
18423 }
18424 FreeType(exp->__anon1.cond.elseExp->destType);
18425 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18426 if(exp->__anon1.cond.elseExp->destType)
18427 exp->__anon1.cond.elseExp->destType->refCount++;
18428 ProcessExpressionType(exp->__anon1.cond.elseExp);
18429 if(!exp->__anon1.cond.elseExp->isConstant)
18430 exp->isConstant = 0;
18431 FreeType(t);
18432 break;
18433 }
18434 case 23:
18435 {
18436 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18437 {
18438 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18439
18440 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18441 {
18442 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18443 if(exp->destType)
18444 exp->destType->refCount++;
18445 }
18446 ProcessStatement(exp->__anon1.compound);
18447 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18448 if(exp->expType)
18449 exp->expType->refCount++;
18450 }
18451 break;
18452 }
18453 case 24:
18454 {
18455 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18456
18457 if(spec && spec->type == 1)
18458 {
18459 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18460 exp->expType->kind = 19;
18461 exp->byReference = 1;
18462 }
18463 else
18464 {
18465 exp->expType = MkClassType("ecere::com::Class");
18466 exp->byReference = 1;
18467 }
18468 break;
18469 }
18470 case 25:
18471 {
18472 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18473
18474 if(_class)
18475 {
18476 struct Identifier * id = exp->__anon1.classData.id;
18477 char structName[1024];
18478 struct Expression * classExp;
18479
18480 strcpy(structName, "__ecereClassData_");
18481 FullClassNameCat(structName, _class->fullName, 0);
18482 exp->type = 9;
18483 exp->__anon1.member.member = id;
18484 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18485 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18486 else
18487 classExp = MkExpIdentifier(MkIdentifier("class"));
18488 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"))))))));
18489 ProcessExpressionType(exp);
18490 return ;
18491 }
18492 break;
18493 }
18494 case 35:
18495 {
18496 struct Type * type = (((void *)0));
18497 const char * typeString = (((void *)0));
18498 char typeStringBuf[1024];
18499
18500 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))
18501 {
18502 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18503
18504 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18505 }
18506 else if(exp->__anon1.list)
18507 {
18508 struct Expression * e;
18509
18510 for(e = (*exp->__anon1.list).first; e; e = e->next)
18511 {
18512 ProcessExpressionType(e);
18513 if(e->expType)
18514 {
18515 if(!type)
18516 {
18517 type = e->expType;
18518 type->refCount++;
18519 }
18520 else
18521 {
18522 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18523 {
18524 FreeType(type);
18525 type = e->expType;
18526 e->expType = (((void *)0));
18527 e = (*exp->__anon1.list).first;
18528 ProcessExpressionType(e);
18529 if(e->expType)
18530 {
18531 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18532 {
18533 FreeType(e->expType);
18534 e->expType = (((void *)0));
18535 FreeType(type);
18536 type = (((void *)0));
18537 break;
18538 }
18539 }
18540 }
18541 }
18542 if(e->expType)
18543 {
18544 FreeType(e->expType);
18545 e->expType = (((void *)0));
18546 }
18547 }
18548 }
18549 if(type)
18550 {
18551 typeStringBuf[0] = '\0';
18552 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18553 typeString = typeStringBuf;
18554 FreeType(type);
18555 type = (((void *)0));
18556 }
18557 }
18558 if(typeString)
18559 {
18560 char templateString[1024];
18561 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18562 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18563 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18564 struct Expression * expExt;
18565 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18566
18567 sprintf(templateString, "Container<%s>", typeString);
18568 if(exp->__anon1.list)
18569 {
18570 struct Expression * e;
18571
18572 type = ProcessTypeString(typeString, 0);
18573 while((e = (*exp->__anon1.list).first))
18574 {
18575 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18576 e->destType = type;
18577 type->refCount++;
18578 ProcessExpressionType(e);
18579 ListAdd(initializers, MkInitializerAssignment(e));
18580 }
18581 FreeType(type);
18582 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18583 }
18584 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18585 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18586 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18587 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18588 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18589 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18590 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18591 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18592 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18593 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18594 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18595
18596 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18597 })));
18598 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18599 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18600 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18601 exp->expType = ProcessTypeString(templateString, 0);
18602 exp->type = 5;
18603 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18604 ProcessExpressionType(expExt);
18605 }
18606 else
18607 {
18608 exp->expType = ProcessTypeString("Container", 0);
18609 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18610 }
18611 break;
18612 }
18613 }
18614 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18615 {
18616 FreeType(exp->expType);
18617 exp->expType = ReplaceThisClassType(thisClass);
18618 }
18619 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)
18620 {
18621 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
18622
18623 if(symbol)
18624 {
18625 if(exp->expType->kind != 15)
18626 {
18627 struct Type * member;
18628 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
18629
18630 FreeType(exp->expType);
18631 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18632 exp->expType->kind = symbol->type->kind;
18633 exp->expType->refCount++;
18634 exp->expType->__anon1.__anon1.enumName = enumName;
18635 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
18636 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18637 member->refCount++;
18638 }
18639 else
18640 {
18641 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
18642
18643 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18644 {
18645 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);
18646
18647 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
18648 }
18649 }
18650 }
18651 }
18652 yylloc = exp->loc;
18653 if(exp->destType && (exp->destType->kind == 18))
18654 ;
18655 else if(exp->destType && !exp->destType->keepCast)
18656 {
18657 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
18658 exp->needTemplateCast = 1;
18659 if(exp->destType->kind == 0)
18660 ;
18661 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
18662 {
18663 unsigned int invalidCast = 0;
18664
18665 if(inCompiler && exp->destType->count && exp->expType)
18666 {
18667 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
18668 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
18669
18670 if(c1 && c1->type != 1)
18671 c1 = (((void *)0));
18672 if(c2 && c2->type != 1)
18673 c2 = (((void *)0));
18674 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
18675 invalidCast = 1;
18676 }
18677 if(!exp->destType->count || unresolved || invalidCast)
18678 {
18679 if(!exp->expType)
18680 {
18681 yylloc = exp->loc;
18682 if(exp->destType->kind != 14)
18683 {
18684 char type2[1024];
18685
18686 type2[0] = '\0';
18687 if(inCompiler)
18688 {
18689 char expString[10240];
18690
18691 expString[0] = '\0';
18692 PrintType(exp->destType, type2, 0, 1);
18693 if(inCompiler)
18694 {
18695 PrintExpression(exp, expString);
18696 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18697 }
18698 if(unresolved)
18699 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
18700 else if(exp->type != 16)
18701 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
18702 }
18703 }
18704 else
18705 {
18706 char expString[10240];
18707
18708 expString[0] = '\0';
18709 if(inCompiler)
18710 {
18711 PrintExpression(exp, expString);
18712 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18713 }
18714 if(unresolved)
18715 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
18716 else if(exp->type != 16)
18717 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18718 }
18719 }
18720 else
18721 {
18722 char type1[1024];
18723 char type2[1024];
18724
18725 type1[0] = '\0';
18726 type2[0] = '\0';
18727 if(inCompiler)
18728 {
18729 PrintType(exp->expType, type1, 0, 1);
18730 PrintType(exp->destType, type2, 0, 1);
18731 }
18732 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)))
18733 ;
18734 else
18735 {
18736 char expString[10240];
18737
18738 expString[0] = '\0';
18739 if(inCompiler)
18740 {
18741 PrintExpression(exp, expString);
18742 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18743 }
18744 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")))
18745 {
18746 if(invalidCast)
18747 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18748 else
18749 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18750 }
18751 if(!inCompiler)
18752 {
18753 FreeType(exp->expType);
18754 exp->destType->refCount++;
18755 exp->expType = exp->destType;
18756 }
18757 }
18758 }
18759 }
18760 }
18761 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))
18762 {
18763 struct Expression * nbExp = GetNonBracketsExp(exp);
18764
18765 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
18766 {
18767 struct Expression * e = MoveExpContents(exp);
18768
18769 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
18770 exp->type = 11;
18771 exp->__anon1.cast.exp->destType = exp->destType;
18772 if(exp->destType)
18773 exp->destType->refCount++;
18774 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
18775 }
18776 }
18777 }
18778 else if(unresolved)
18779 {
18780 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
18781 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);
18782 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
18783 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
18784 }
18785 else if(!exp->expType && exp->type != 16)
18786 {
18787 char expString[10240];
18788
18789 expString[0] = '\0';
18790 if(inCompiler)
18791 {
18792 PrintExpression(exp, expString);
18793 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18794 }
18795 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18796 }
18797 if(inCompiler)
18798 ApplyAnyObjectLogic(exp);
18799 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)))
18800 {
18801 exp->byReference = 1;
18802 }
18803 yylloc = oldyylloc;
18804 }
18805
18806 static void ProcessFunction(struct FunctionDefinition * function)
18807 {
18808 struct Identifier * id = GetDeclId(function->declarator);
18809 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18810 struct Type * type = symbol ? symbol->type : (((void *)0));
18811 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18812 struct Context * oldTopContext = topContext;
18813
18814 yylloc = function->loc;
18815 if(type && type->__anon1.__anon2.thisClass)
18816 {
18817 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18818 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18819 char className[1024];
18820 char structName[1024];
18821 struct Declarator * funcDecl;
18822 struct Symbol * thisSymbol;
18823 unsigned int typedObject = 0;
18824
18825 if(_class && !_class->base)
18826 {
18827 _class = currentClass;
18828 if(_class && !_class->symbol)
18829 _class->symbol = FindClass(_class->fullName);
18830 classSym = _class ? _class->symbol : (((void *)0));
18831 typedObject = 1;
18832 }
18833 thisClass = _class;
18834 if(inCompiler && _class)
18835 {
18836 if(type->kind == 11)
18837 {
18838 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18839 {
18840 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18841
18842 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18843 FreeType(param);
18844 }
18845 if(type->classObjectType != 1)
18846 {
18847 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18848 symbol->type->__anon1.__anon2.staticMethod = 1;
18849 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18850 symbol->type->extraParam = 0;
18851 }
18852 }
18853 strcpy(className, "__ecereClass_");
18854 FullClassNameCat(className, _class->fullName, 1);
18855 structName[0] = (char)0;
18856 FullClassNameCat(structName, _class->fullName, 0);
18857 funcDecl = GetFuncDecl(function->declarator);
18858 if(funcDecl)
18859 {
18860 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18861 {
18862 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18863
18864 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18865 {
18866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18867 FreeTypeName(param);
18868 }
18869 }
18870 if(!function->propertyNoThis)
18871 {
18872 struct TypeName * thisParam = (((void *)0));
18873
18874 if(type->classObjectType != 1)
18875 {
18876 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18877 if(!funcDecl->__anon1.function.parameters)
18878 funcDecl->__anon1.function.parameters = MkList();
18879 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18880 }
18881 if(typedObject)
18882 {
18883 if(type->classObjectType != 1)
18884 {
18885 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18886 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18887 }
18888 thisParam = __extension__ ({
18889 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18890
18891 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18892 });
18893 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
18894 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18895 }
18896 }
18897 }
18898 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18899 {
18900 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18901
18902 funcDecl = GetFuncDecl(initDecl->declarator);
18903 if(funcDecl)
18904 {
18905 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18906 {
18907 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18908
18909 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18910 {
18911 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18912 FreeTypeName(param);
18913 }
18914 }
18915 if(type->classObjectType != 1)
18916 {
18917 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18918 {
18919 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18920
18921 if(!funcDecl->__anon1.function.parameters)
18922 funcDecl->__anon1.function.parameters = MkList();
18923 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18924 }
18925 }
18926 }
18927 }
18928 }
18929 if(function->body)
18930 {
18931 if(type->classObjectType != 1)
18932 {
18933 thisSymbol = __extension__ ({
18934 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18935
18936 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18937 });
18938 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18939 if(typedObject && thisSymbol->type)
18940 {
18941 thisSymbol->type->classObjectType = 2;
18942 thisSymbol->type->byReference = type->byReference;
18943 thisSymbol->type->typedByReference = type->byReference;
18944 }
18945 }
18946 }
18947 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
18948 {
18949 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18950
18951 {
18952 struct __ecereNameSpace__ecere__com__Class * base;
18953
18954 for(base = _class; base && base->type != 1000; base = base->next)
18955 {
18956 for(member = base->membersAndProperties.first; member; member = member->next)
18957 if(!member->isProperty)
18958 break;
18959 if(member)
18960 break;
18961 }
18962 }
18963 for(member = _class->membersAndProperties.first; member; member = member->next)
18964 if(!member->isProperty)
18965 break;
18966 if(member)
18967 {
18968 char pointerName[1024];
18969 struct Declaration * decl;
18970 struct Initializer * initializer;
18971 struct Expression * exp, * bytePtr;
18972
18973 strcpy(pointerName, "__ecerePointer_");
18974 FullClassNameCat(pointerName, _class->fullName, 0);
18975 {
18976 char className[1024];
18977
18978 strcpy(className, "__ecereClass_");
18979 FullClassNameCat(className, classSym->string, 1);
18980 DeclareClass(curExternal, classSym, className);
18981 }
18982 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18983 if(_class->fixed)
18984 {
18985 struct Expression * e;
18986
18987 if(_class->offset && _class->offset == _class->base->structSize)
18988 {
18989 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
18990 ProcessExpressionType(e);
18991 }
18992 else
18993 {
18994 char string[256];
18995
18996 sprintf(string, "%d", _class->offset);
18997 e = MkExpConstant(string);
18998 }
18999 exp = QBrackets(MkExpOp(bytePtr, '+', e));
19000 }
19001 else
19002 {
19003 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
19004 }
19005 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
19006 exp->expType = __extension__ ({
19007 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19008
19009 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
19010 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19011
19012 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19013 }), __ecereInstance2;
19014 });
19015 if(function->body)
19016 {
19017 yylloc = function->body->loc;
19018 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19019 {
19020 struct Context * prevContext = curContext;
19021 struct __ecereNameSpace__ecere__sys__OldList * list;
19022
19023 curContext = function->body->__anon1.compound.context;
19024 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19025 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19026 curContext = prevContext;
19027 }
19028 decl->symbol = (((void *)0));
19029 if(!function->body->__anon1.compound.declarations)
19030 function->body->__anon1.compound.declarations = MkList();
19031 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19032 }
19033 }
19034 }
19035 }
19036 else
19037 thisClass = (((void *)0));
19038 if(id)
19039 {
19040 FreeSpecifier(id->_class);
19041 id->_class = (((void *)0));
19042 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19043 {
19044 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19045
19046 id = GetDeclId(initDecl->declarator);
19047 FreeSpecifier(id->_class);
19048 id->_class = (((void *)0));
19049 }
19050 }
19051 if(function->body)
19052 topContext = function->body->__anon1.compound.context;
19053 {
19054 struct FunctionDefinition * oldFunction = curFunction;
19055
19056 curFunction = function;
19057 if(function->body)
19058 ProcessStatement(function->body);
19059 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19060 {
19061 struct Statement * prevCompound = curCompound;
19062 struct Context * prevContext = curContext;
19063 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19064
19065 if(!function->body->__anon1.compound.statements)
19066 function->body->__anon1.compound.statements = MkList();
19067 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19068 curCompound = function->body;
19069 curContext = function->body->__anon1.compound.context;
19070 ProcessStatement(fireWatchers);
19071 curContext = prevContext;
19072 curCompound = prevCompound;
19073 }
19074 curFunction = oldFunction;
19075 }
19076 if(function->declarator)
19077 {
19078 ProcessDeclarator(function->declarator, 1);
19079 }
19080 topContext = oldTopContext;
19081 thisClass = oldThisClass;
19082 }
19083
19084 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19085 {
19086 struct ClassDef * def;
19087 struct External * external = curExternal;
19088 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19089
19090 for(def = definitions->first; def; def = def->next)
19091 {
19092 if(def->type == 0)
19093 {
19094 if(def->__anon1.function->declarator)
19095 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19096 else
19097 curExternal = external;
19098 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19099 }
19100 else if(def->type == 2)
19101 {
19102 if(def->__anon1.decl->type == 2)
19103 {
19104 thisClass = regClass;
19105 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19106 thisClass = (((void *)0));
19107 }
19108 else
19109 {
19110 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19111
19112 if(regClass)
19113 thisClass = regClass;
19114 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19115 thisClass = backThisClass;
19116 }
19117 }
19118 else if(def->type == 1 && def->__anon1.defProperties)
19119 {
19120 struct MemberInit * defProperty;
19121 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);
19122
19123 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19124 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19125 {
19126 thisClass = regClass;
19127 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19128 thisClass = (((void *)0));
19129 }
19130 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19131 FreeSymbol(thisSymbol);
19132 }
19133 else if(def->type == 3 && def->__anon1.propertyDef)
19134 {
19135 struct PropertyDef * prop = def->__anon1.propertyDef;
19136
19137 thisClass = regClass;
19138 if(prop->setStmt)
19139 {
19140 if(regClass)
19141 {
19142 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19143
19144 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19145 }
19146 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19147 ProcessStatement(prop->setStmt);
19148 }
19149 if(prop->getStmt)
19150 {
19151 if(regClass)
19152 {
19153 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19154
19155 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19156 }
19157 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19158 ProcessStatement(prop->getStmt);
19159 }
19160 if(prop->issetStmt)
19161 {
19162 if(regClass)
19163 {
19164 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19165
19166 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19167 }
19168 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19169 ProcessStatement(prop->issetStmt);
19170 }
19171 thisClass = (((void *)0));
19172 }
19173 else if(def->type == 4 && def->__anon1.propertyWatch)
19174 {
19175 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19176
19177 thisClass = regClass;
19178 if(propertyWatch->compound)
19179 {
19180 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);
19181
19182 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19183 curExternal = (((void *)0));
19184 ProcessStatement(propertyWatch->compound);
19185 }
19186 thisClass = (((void *)0));
19187 }
19188 }
19189 }
19190
19191 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19192 {
19193 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19194
19195 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19196 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19197 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19198 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19199 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19200 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19201 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19202 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19203 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19204 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19205 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19206 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19207 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19208 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19209 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19210 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19211 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19212 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19213 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19214 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19215 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19216 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19217 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19218 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19219 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19220 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19221 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19222 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19223 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19224 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19225 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19226 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19227 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19228 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19229 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19230 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19231 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19232 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19233 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19234 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19235 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19236 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19237 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19238 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19239 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19240 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19241 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19242 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19243 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19244 __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);
19245 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19246 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19247 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19248 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19249 __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);
19250 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19251 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19252 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19253 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19254 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19255 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19256 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19257 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19258 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19259 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19260 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19261 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19262 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19263 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19264 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19265 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)
19266 __ecereClass_Conversion = class;
19267 __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);
19268 __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);
19269 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19270 __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);
19271 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19272 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19273 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19274 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19275 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19276 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19277 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19278 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19279 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19280 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19281 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19282 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19283 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19284 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19285 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19286 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19287 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19288 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19289 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19290 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19291 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19292 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19293 }
19294