compiler/libec: (#307, #70) Warning on undeclared class; Overriding namespaces
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #include <stdint.h>
39 #include <sys/types.h>
40 enum yytokentype
41 {
42 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372, WIDE_STRING_LITERAL = 373
43 };
44
45 extern int returnCode;
46
47 extern unsigned int yydebug;
48
49 extern unsigned int echoOn;
50
51 void resetScanner();
52
53 int propWatcherID;
54
55 int expression_yyparse();
56
57 static char * thisNameSpace;
58
59 unsigned int thisClassParams = 1;
60
61 unsigned int internalValueCounter;
62
63 extern unsigned int outputLineNumbers;
64
65 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isInf;
66
67 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_signBit;
68
69 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isNan;
70
71 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isInf;
72
73 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_signBit;
74
75 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isNan;
76
77 extern int targetBits;
78
79 extern unsigned int inCompiler;
80
81 extern unsigned int inPreCompiler;
82
83 extern unsigned int inDebugger;
84
85 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
86
87 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
88
89 int UnescapeString(char * d, char * s, int len)
90 {
91 int j = 0, k = 0;
92 char ch;
93
94 while(j < len && (ch = s[j]))
95 {
96 switch(ch)
97 {
98 case '\\':
99 switch((ch = s[++j]))
100 {
101 case 'n':
102 d[k] = '\n';
103 break;
104 case 't':
105 d[k] = '\t';
106 break;
107 case 'a':
108 d[k] = '\a';
109 break;
110 case 'b':
111 d[k] = '\b';
112 break;
113 case 'f':
114 d[k] = '\f';
115 break;
116 case 'r':
117 d[k] = '\r';
118 break;
119 case 'v':
120 d[k] = '\v';
121 break;
122 case '\\':
123 d[k] = '\\';
124 break;
125 case '\"':
126 d[k] = '\"';
127 break;
128 case '\'':
129 d[k] = '\'';
130 break;
131 default:
132 d[k] = '\\';
133 d[k] = ch;
134 }
135 break;
136 default:
137 d[k] = ch;
138 }
139 j++, k++;
140 }
141 d[k] = '\0';
142 return k;
143 }
144
145 char * OffsetEscapedString(char * s, int len, int offset)
146 {
147 char ch;
148 int j = 0, k = 0;
149
150 while(j < len && k < offset && (ch = s[j]))
151 {
152 if(ch == '\\')
153 ++j;
154 j++, k++;
155 }
156 return (k == offset) ? s + j : (((void *)0));
157 }
158
159 extern int __ecereVMethodID_class_OnGetString;
160
161 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
162
163 extern unsigned int parseError;
164
165 static int definedExpStackPos;
166
167 static void * definedExpStack[512];
168
169 extern const char *  sourceFile;
170
171 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
172
173 extern unsigned int memoryGuard;
174
175 struct __ecereNameSpace__ecere__sys__OldList
176 {
177 void *  first;
178 void *  last;
179 int count;
180 unsigned int offset;
181 unsigned int circ;
182 } __attribute__ ((gcc_struct));
183
184 struct __ecereNameSpace__ecere__com__DataValue
185 {
186 union
187 {
188 char c;
189 unsigned char uc;
190 short s;
191 unsigned short us;
192 int i;
193 unsigned int ui;
194 void *  p;
195 float f;
196 double d;
197 long long i64;
198 uint64 ui64;
199 } __attribute__ ((gcc_struct)) __anon1;
200 } __attribute__ ((gcc_struct));
201
202 struct __ecereNameSpace__ecere__com__SerialBuffer
203 {
204 unsigned char *  _buffer;
205 unsigned int count;
206 unsigned int _size;
207 unsigned int pos;
208 } __attribute__ ((gcc_struct));
209
210 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
211
212 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
213
214 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
215
216 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
217
218 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
219
220 struct Pointer;
221
222 struct Attrib;
223
224 struct Attribute;
225
226 struct TemplateArgument;
227
228 struct DBTableEntry;
229
230 struct DBIndexItem;
231
232 struct DBTableDef;
233
234 struct CodePosition
235 {
236 int line;
237 int charPos;
238 int pos;
239 int included;
240 } __attribute__ ((gcc_struct));
241
242 extern size_t strlen(const char * );
243
244 extern int strcmp(const char * , const char * );
245
246 extern int sprintf(char * , const char * , ...);
247
248 extern char *  strcat(char * , const char * );
249
250 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
251
252 extern int isprint(int c);
253
254 extern char *  strcpy(char * , const char * );
255
256 extern void Compiler_Error(const char *  format, ...);
257
258 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
259
260 struct __ecereNameSpace__ecere__com__LinkList
261 {
262 void * first;
263 void * last;
264 int count;
265 } __attribute__ ((gcc_struct));
266
267 extern char *  strchr(const char * , int);
268
269 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
270
271 extern void *  memcpy(void * , const void * , size_t size);
272
273 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
274
275 extern void Compiler_Warning(const char *  format, ...);
276
277 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
278
279 extern long long strtoll(const char *  nptr, char * *  endptr, int base);
280
281 extern uint64 strtoull(const char *  nptr, char * *  endptr, int base);
282
283 extern int strtol(const char * , char * * , int base);
284
285 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
286
287 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
288
289 extern double strtod(const char * , char * * );
290
291 extern int strncmp(const char * , const char * , size_t n);
292
293 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
294
295 extern char *  QMkString(const char *  source);
296
297 extern char *  strncpy(char * , const char * , size_t n);
298
299 extern int printf(const char * , ...);
300
301 extern char *  strstr(const char * , const char * );
302
303 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
304
305 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
306
307 extern int (* __ecereProp_float_Get_signBit)(float this);
308
309 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
310
311 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
312
313 extern int (* __ecereProp_double_Get_signBit)(double this);
314
315 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
316
317 extern float (* __ecereMethod_float_inf)(void);
318
319 extern float (* __ecereMethod_float_nan)(void);
320
321 extern double (* __ecereMethod_double_inf)(void);
322
323 extern double (* __ecereMethod_double_nan)(void);
324
325 int __ecereVMethodID_class_OnGetString;
326
327 void SetYydebug(unsigned int b)
328 {
329 yydebug = b;
330 }
331
332 unsigned int GetParseError()
333 {
334 return parseError;
335 }
336
337 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
338
339 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
340
341 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
342
343 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
344
345 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
346
347 struct __ecereNameSpace__ecere__com__EnumClassData
348 {
349 struct __ecereNameSpace__ecere__sys__OldList values;
350 long long largest;
351 } __attribute__ ((gcc_struct));
352
353 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
354
355 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
356
357 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
358
359 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
360
361 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
362
363 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
364
365 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
366
367 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
368
369 struct Location
370 {
371 struct CodePosition start;
372 struct CodePosition end;
373 } __attribute__ ((gcc_struct));
374
375 void ReadString(char * output, char * string)
376 {
377 int len = strlen(string);
378 int c, d = 0;
379 unsigned int quoted = 0, escaped = 0;
380
381 for(c = 0; c < len; c++)
382 {
383 char ch = string[c];
384
385 if(escaped)
386 {
387 switch(ch)
388 {
389 case 'n':
390 output[d] = '\n';
391 break;
392 case 't':
393 output[d] = '\t';
394 break;
395 case 'a':
396 output[d] = '\a';
397 break;
398 case 'b':
399 output[d] = '\b';
400 break;
401 case 'f':
402 output[d] = '\f';
403 break;
404 case 'r':
405 output[d] = '\r';
406 break;
407 case 'v':
408 output[d] = '\v';
409 break;
410 case '\\':
411 output[d] = '\\';
412 break;
413 case '\"':
414 output[d] = '\"';
415 break;
416 case '\'':
417 output[d] = '\'';
418 break;
419 default:
420 output[d] = ch;
421 }
422 d++;
423 escaped = 0;
424 }
425 else
426 {
427 if(ch == '\"')
428 quoted ^= 1;
429 else if(quoted)
430 {
431 if(ch == '\\')
432 escaped = 1;
433 else
434 output[d++] = ch;
435 }
436 }
437 }
438 output[d] = '\0';
439 }
440
441 char * PrintInt(long long result)
442 {
443 char temp[100];
444
445 if(result > (((int)0x7fffffff)))
446 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
447 else
448 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
449 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
450 strcat(temp, "LL");
451 return __ecereNameSpace__ecere__sys__CopyString(temp);
452 }
453
454 char * PrintUInt(uint64 result)
455 {
456 char temp[100];
457
458 if(result > (0xffffffff))
459 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
460 else if(result > (((int)0x7fffffff)))
461 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
462 else
463 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
464 return __ecereNameSpace__ecere__sys__CopyString(temp);
465 }
466
467 char * PrintInt64(long long result)
468 {
469 char temp[100];
470
471 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
472 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
473 else
474 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
475 return __ecereNameSpace__ecere__sys__CopyString(temp);
476 }
477
478 char * PrintUInt64(uint64 result)
479 {
480 char temp[100];
481
482 if(result > (0xffffffff))
483 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
484 else if(result > (((int)0x7fffffff)))
485 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
486 else
487 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
488 return __ecereNameSpace__ecere__sys__CopyString(temp);
489 }
490
491 char * PrintHexUInt(uint64 result)
492 {
493 char temp[100];
494
495 if(result > (0xffffffff))
496 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
497 else
498 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
499 if(result > (0xffffffff))
500 strcat(temp, "LL");
501 return __ecereNameSpace__ecere__sys__CopyString(temp);
502 }
503
504 char * PrintHexUInt64(uint64 result)
505 {
506 char temp[100];
507
508 if(result > (0xffffffff))
509 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
510 else
511 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
512 return __ecereNameSpace__ecere__sys__CopyString(temp);
513 }
514
515 char * PrintShort(short result)
516 {
517 char temp[100];
518
519 sprintf(temp, "%d", (unsigned short)result);
520 return __ecereNameSpace__ecere__sys__CopyString(temp);
521 }
522
523 char * PrintUShort(unsigned short result)
524 {
525 char temp[100];
526
527 if(result > (unsigned short)32767)
528 sprintf(temp, "0x%X", (int)result);
529 else
530 sprintf(temp, "%d", (int)result);
531 return __ecereNameSpace__ecere__sys__CopyString(temp);
532 }
533
534 char * PrintUChar(unsigned char result)
535 {
536 char temp[100];
537
538 sprintf(temp, "0x%X", result);
539 return __ecereNameSpace__ecere__sys__CopyString(temp);
540 }
541
542 char * PrintChar(char result)
543 {
544 char temp[100];
545
546 if(result > (char)0 && isprint(result))
547 sprintf(temp, "'%c'", result);
548 else if(result < (char)0)
549 sprintf(temp, "%d", (int)result);
550 else
551 sprintf(temp, "0x%X", (unsigned char)result);
552 return __ecereNameSpace__ecere__sys__CopyString(temp);
553 }
554
555 char * PrintFloat(float result)
556 {
557 char temp[350];
558
559 if(__ecereProp_float_Get_isInf(result))
560 {
561 if(__ecereProp_float_Get_signBit(result))
562 strcpy(temp, "-inf");
563 else
564 strcpy(temp, "inf");
565 }
566 else if(__ecereProp_float_Get_isNan(result))
567 {
568 if(__ecereProp_float_Get_signBit(result))
569 strcpy(temp, "-nan");
570 else
571 strcpy(temp, "nan");
572 }
573 else
574 sprintf(temp, "%.16ff", result);
575 return __ecereNameSpace__ecere__sys__CopyString(temp);
576 }
577
578 char * PrintDouble(double result)
579 {
580 char temp[350];
581
582 if(__ecereProp_double_Get_isInf(result))
583 {
584 if(__ecereProp_double_Get_signBit(result))
585 strcpy(temp, "-inf");
586 else
587 strcpy(temp, "inf");
588 }
589 else if(__ecereProp_double_Get_isNan(result))
590 {
591 if(__ecereProp_double_Get_signBit(result))
592 strcpy(temp, "-nan");
593 else
594 strcpy(temp, "nan");
595 }
596 else
597 sprintf(temp, "%.16f", result);
598 return __ecereNameSpace__ecere__sys__CopyString(temp);
599 }
600
601 extern struct Location yylloc;
602
603 struct ExtDecl
604 {
605 struct Location loc;
606 int type;
607 union
608 {
609 char * s;
610 struct Attrib * attr;
611 } __attribute__ ((gcc_struct)) __anon1;
612 } __attribute__ ((gcc_struct));
613
614 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
615
616 struct Expression;
617
618 extern struct Expression * parsedExpression;
619
620 extern struct Expression * QMkExpId(const char *  id);
621
622 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
623
624 void ComputeExpression(struct Expression * exp);
625
626 extern struct Expression * MkExpConstant(const char *  string);
627
628 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
629
630 extern void FreeExpression(struct Expression * exp);
631
632 extern void FreeExpContents(struct Expression * exp);
633
634 extern struct Expression * CopyExpression(struct Expression * exp);
635
636 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
637
638 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
639
640 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
641
642 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
643
644 extern struct Expression * MoveExpContents(struct Expression * exp);
645
646 extern struct Expression * QBrackets(struct Expression * exp);
647
648 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
649
650 struct Statement;
651
652 static struct Statement * curCompound;
653
654 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
655
656 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
657
658 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
659
660 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
661
662 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
663
664 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
665
666 struct External;
667
668 struct External * curExternal, * afterExternal;
669
670 extern void FreeExternal(struct External * external);
671
672 struct Type;
673
674 static struct Type * curSwitchType;
675
676 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
677
678 extern void FreeType(struct Type * type);
679
680 extern struct Type * MkClassType(const char *  name);
681
682 extern void CopyTypeInto(struct Type * type, struct Type * src);
683
684 struct __ecereNameSpace__ecere__com__Class;
685
686 struct __ecereNameSpace__ecere__com__Instance
687 {
688 void * *  _vTbl;
689 struct __ecereNameSpace__ecere__com__Class * _class;
690 int _refCount;
691 } __attribute__ ((gcc_struct));
692
693 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
694
695 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
696
697 static struct __ecereNameSpace__ecere__com__Class * currentClass;
698
699 struct __ecereNameSpace__ecere__com__Class * thisClass;
700
701 struct __ecereNameSpace__ecere__com__Class * containerClass;
702
703 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
704
705 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
706
707 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
708
709 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
710
711 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
712
713 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
714
715 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
716
717 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
718
719 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
720
721 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
722
723 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
724
725 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
726 {
727 thisClass = c;
728 }
729
730 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
731 {
732 return thisClass;
733 }
734
735 struct Context;
736
737 extern struct Context * curContext;
738
739 extern struct Context * topContext;
740
741 extern struct Context * PushContext(void);
742
743 extern void PopContext(struct Context * ctx);
744
745 extern void FreeContext(struct Context * context);
746
747 extern struct Context * globalContext;
748
749 struct ModuleImport;
750
751 extern struct ModuleImport * mainModule;
752
753 struct ModuleImport
754 {
755 struct ModuleImport * prev;
756 struct ModuleImport * next;
757 char *  name;
758 struct __ecereNameSpace__ecere__sys__OldList classes;
759 struct __ecereNameSpace__ecere__sys__OldList functions;
760 int importType;
761 int importAccess;
762 } __attribute__ ((gcc_struct));
763
764 struct __ecereNameSpace__ecere__com__NameSpace;
765
766 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
767
768 struct FunctionDefinition;
769
770 static struct FunctionDefinition * curFunction;
771
772 struct __ecereNameSpace__ecere__sys__BTNode;
773
774 struct __ecereNameSpace__ecere__sys__BTNode
775 {
776 uintptr_t key;
777 struct __ecereNameSpace__ecere__sys__BTNode * parent;
778 struct __ecereNameSpace__ecere__sys__BTNode * left;
779 struct __ecereNameSpace__ecere__sys__BTNode * right;
780 int depth;
781 } __attribute__ ((gcc_struct));
782
783 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
784
785 struct __ecereNameSpace__ecere__com__Property;
786
787 struct __ecereNameSpace__ecere__com__Property
788 {
789 struct __ecereNameSpace__ecere__com__Property * prev;
790 struct __ecereNameSpace__ecere__com__Property * next;
791 const char *  name;
792 unsigned int isProperty;
793 int memberAccess;
794 int id;
795 struct __ecereNameSpace__ecere__com__Class * _class;
796 const char *  dataTypeString;
797 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
798 struct Type * dataType;
799 void (*  Set)(void * , int);
800 int (*  Get)(void * );
801 unsigned int (*  IsSet)(void * );
802 void *  data;
803 void *  symbol;
804 int vid;
805 unsigned int conversion;
806 unsigned int watcherOffset;
807 const char *  category;
808 unsigned int compiled;
809 unsigned int selfWatchable;
810 unsigned int isWatchable;
811 } __attribute__ ((gcc_struct));
812
813 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
814
815 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
816
817 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
818
819 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
820
821 struct Identifier;
822
823 extern void FreeIdentifier(struct Identifier * id);
824
825 extern struct Identifier * MkIdentifier(const char *  string);
826
827 extern struct Expression * MkExpIdentifier(struct Identifier * id);
828
829 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
830
831 extern struct Identifier * CopyIdentifier(struct Identifier * id);
832
833 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
834
835 struct __ecereNameSpace__ecere__sys__OldLink;
836
837 struct __ecereNameSpace__ecere__sys__OldLink
838 {
839 struct __ecereNameSpace__ecere__sys__OldLink * prev;
840 struct __ecereNameSpace__ecere__sys__OldLink * next;
841 void *  data;
842 } __attribute__ ((gcc_struct));
843
844 struct Declaration;
845
846 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
847
848 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
849
850 struct Specifier;
851
852 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
853
854 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
855
856 extern struct Specifier * MkSpecifier(int specifier);
857
858 extern struct Specifier * MkSpecifierName(const char *  name);
859
860 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
861
862 extern void FreeSpecifier(struct Specifier * spec);
863
864 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
865
866 struct Statement
867 {
868 struct Statement * prev;
869 struct Statement * next;
870 struct Location loc;
871 int type;
872 union
873 {
874 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
875 struct
876 {
877 struct Identifier * id;
878 struct Statement * stmt;
879 } __attribute__ ((gcc_struct)) labeled;
880 struct
881 {
882 struct Expression * exp;
883 struct Statement * stmt;
884 } __attribute__ ((gcc_struct)) caseStmt;
885 struct
886 {
887 struct __ecereNameSpace__ecere__sys__OldList * declarations;
888 struct __ecereNameSpace__ecere__sys__OldList * statements;
889 struct Context * context;
890 unsigned int isSwitch;
891 } __attribute__ ((gcc_struct)) compound;
892 struct
893 {
894 struct __ecereNameSpace__ecere__sys__OldList * exp;
895 struct Statement * stmt;
896 struct Statement * elseStmt;
897 } __attribute__ ((gcc_struct)) ifStmt;
898 struct
899 {
900 struct __ecereNameSpace__ecere__sys__OldList * exp;
901 struct Statement * stmt;
902 } __attribute__ ((gcc_struct)) switchStmt;
903 struct
904 {
905 struct __ecereNameSpace__ecere__sys__OldList * exp;
906 struct Statement * stmt;
907 } __attribute__ ((gcc_struct)) whileStmt;
908 struct
909 {
910 struct __ecereNameSpace__ecere__sys__OldList * exp;
911 struct Statement * stmt;
912 } __attribute__ ((gcc_struct)) doWhile;
913 struct
914 {
915 struct Statement * init;
916 struct Statement * check;
917 struct __ecereNameSpace__ecere__sys__OldList * increment;
918 struct Statement * stmt;
919 } __attribute__ ((gcc_struct)) forStmt;
920 struct
921 {
922 struct Identifier * id;
923 } __attribute__ ((gcc_struct)) gotoStmt;
924 struct
925 {
926 struct Specifier * spec;
927 char * statements;
928 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
929 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
930 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
931 } __attribute__ ((gcc_struct)) asmStmt;
932 struct
933 {
934 struct Expression * watcher;
935 struct Expression * object;
936 struct __ecereNameSpace__ecere__sys__OldList * watches;
937 } __attribute__ ((gcc_struct)) _watch;
938 struct
939 {
940 struct Identifier * id;
941 struct __ecereNameSpace__ecere__sys__OldList * exp;
942 struct __ecereNameSpace__ecere__sys__OldList * filter;
943 struct Statement * stmt;
944 } __attribute__ ((gcc_struct)) forEachStmt;
945 struct Declaration * decl;
946 } __attribute__ ((gcc_struct)) __anon1;
947 } __attribute__ ((gcc_struct));
948
949 extern struct Specifier * CopySpecifier(struct Specifier * spec);
950
951 extern struct Expression * MkExpClassSize(struct Specifier * _class);
952
953 struct Symbol;
954
955 struct Identifier
956 {
957 struct Identifier * prev;
958 struct Identifier * next;
959 struct Location loc;
960 struct Symbol * classSym;
961 struct Specifier * _class;
962 char *  string;
963 struct Identifier * badID;
964 } __attribute__ ((gcc_struct));
965
966 extern struct Symbol * FindStruct(struct Context * ctx, const char *  name);
967
968 extern struct Symbol * FindClass(const char *  name);
969
970 extern void DeclareClass(struct External * neededFor, struct Symbol * classSym, const char *  className);
971
972 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
973
974 extern void FreeSymbol(struct Symbol * symbol);
975
976 struct ClassDef;
977
978 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
979
980 extern void FreeClassDef(struct ClassDef * def);
981
982 struct Declarator;
983
984 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
985
986 struct TemplateDatatype
987 {
988 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
989 struct Declarator * decl;
990 } __attribute__ ((gcc_struct));
991
992 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
993
994 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
995
996 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
997
998 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
999
1000 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
1001
1002 struct Declarator
1003 {
1004 struct Declarator * prev;
1005 struct Declarator * next;
1006 struct Location loc;
1007 int type;
1008 struct Symbol * symbol;
1009 struct Declarator * declarator;
1010 union
1011 {
1012 struct Identifier * identifier;
1013 struct
1014 {
1015 struct Expression * exp;
1016 struct Expression * posExp;
1017 struct Attrib * attrib;
1018 } __attribute__ ((gcc_struct)) structDecl;
1019 struct
1020 {
1021 struct Expression * exp;
1022 struct Specifier * enumClass;
1023 } __attribute__ ((gcc_struct)) array;
1024 struct
1025 {
1026 struct __ecereNameSpace__ecere__sys__OldList * parameters;
1027 } __attribute__ ((gcc_struct)) function;
1028 struct
1029 {
1030 struct Pointer * pointer;
1031 } __attribute__ ((gcc_struct)) pointer;
1032 struct
1033 {
1034 struct ExtDecl * extended;
1035 } __attribute__ ((gcc_struct)) extended;
1036 } __attribute__ ((gcc_struct)) __anon1;
1037 } __attribute__ ((gcc_struct));
1038
1039 extern struct Identifier * GetDeclId(struct Declarator * decl);
1040
1041 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
1042
1043 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1044
1045 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1046
1047 extern void FreeDeclarator(struct Declarator * decl);
1048
1049 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1050
1051 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
1052
1053 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1054
1055 struct FunctionDefinition
1056 {
1057 struct FunctionDefinition * prev;
1058 struct FunctionDefinition * next;
1059 struct Location loc;
1060 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1061 struct Declarator * declarator;
1062 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1063 struct Statement * body;
1064 struct __ecereNameSpace__ecere__com__Class * _class;
1065 struct __ecereNameSpace__ecere__sys__OldList attached;
1066 int declMode;
1067 struct Type * type;
1068 struct Symbol * propSet;
1069 int tempCount;
1070 unsigned int propertyNoThis;
1071 } __attribute__ ((gcc_struct));
1072
1073 extern struct Declarator * QMkPtrDecl(const char *  id);
1074
1075 struct ClassFunction;
1076
1077 struct ClassFunction
1078 {
1079 struct ClassFunction * prev;
1080 struct ClassFunction * next;
1081 struct Location loc;
1082 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1083 struct Declarator * declarator;
1084 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1085 struct Statement * body;
1086 struct __ecereNameSpace__ecere__com__Class * _class;
1087 struct __ecereNameSpace__ecere__sys__OldList attached;
1088 int declMode;
1089 struct Type * type;
1090 struct Symbol * propSet;
1091 unsigned int isVirtual;
1092 unsigned int isConstructor;
1093 unsigned int isDestructor;
1094 unsigned int dontMangle;
1095 int id;
1096 int idCode;
1097 } __attribute__ ((gcc_struct));
1098
1099 extern struct External * ProcessClassFunction(struct __ecereNameSpace__ecere__com__Class * owningClass, struct ClassFunction * func, struct __ecereNameSpace__ecere__sys__OldList * defs, struct External * after, unsigned int makeStatic);
1100
1101 extern void FreeClassFunction(struct ClassFunction * func);
1102
1103 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1104
1105 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1106
1107 struct TypeName;
1108
1109 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1110
1111 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1112
1113 struct TypeName
1114 {
1115 struct TypeName * prev;
1116 struct TypeName * next;
1117 struct Location loc;
1118 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
1119 struct Declarator * declarator;
1120 int classObjectType;
1121 struct Expression * bitCount;
1122 } __attribute__ ((gcc_struct));
1123
1124 extern void FreeTypeName(struct TypeName * typeName);
1125
1126 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
1127
1128 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
1129
1130 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
1131
1132 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
1133
1134 struct __ecereNameSpace__ecere__com__BTNamedLink;
1135
1136 struct __ecereNameSpace__ecere__com__BTNamedLink
1137 {
1138 const char *  name;
1139 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1140 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1141 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1142 int depth;
1143 void *  data;
1144 } __attribute__ ((gcc_struct));
1145
1146 struct __ecereNameSpace__ecere__sys__NamedLink64;
1147
1148 struct __ecereNameSpace__ecere__sys__NamedLink64
1149 {
1150 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
1151 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
1152 char *  name;
1153 long long data;
1154 } __attribute__ ((gcc_struct));
1155
1156 struct Instantiation;
1157
1158 struct Declaration
1159 {
1160 struct Declaration * prev;
1161 struct Declaration * next;
1162 struct Location loc;
1163 int type;
1164 union
1165 {
1166 struct
1167 {
1168 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1169 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1170 } __attribute__ ((gcc_struct)) __anon1;
1171 struct Instantiation * inst;
1172 struct
1173 {
1174 struct Identifier * id;
1175 struct Expression * exp;
1176 } __attribute__ ((gcc_struct)) __anon2;
1177 } __attribute__ ((gcc_struct)) __anon1;
1178 struct Specifier * extStorage;
1179 struct Symbol * symbol;
1180 int declMode;
1181 } __attribute__ ((gcc_struct));
1182
1183 struct Instantiation
1184 {
1185 struct Instantiation * prev;
1186 struct Instantiation * next;
1187 struct Location loc;
1188 struct Specifier * _class;
1189 struct Expression * exp;
1190 struct __ecereNameSpace__ecere__sys__OldList *  members;
1191 struct Symbol * symbol;
1192 unsigned int fullSet;
1193 unsigned int isConstant;
1194 unsigned char *  data;
1195 struct Location nameLoc;
1196 struct Location insideLoc;
1197 unsigned int built;
1198 } __attribute__ ((gcc_struct));
1199
1200 extern void FreeInstance(struct Instantiation * inst);
1201
1202 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
1203
1204 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
1205
1206 struct InitDeclarator;
1207
1208 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1209
1210 struct PropertyWatch;
1211
1212 struct PropertyWatch
1213 {
1214 struct PropertyWatch * prev;
1215 struct PropertyWatch * next;
1216 struct Location loc;
1217 struct Statement * compound;
1218 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1219 unsigned int deleteWatch;
1220 } __attribute__ ((gcc_struct));
1221
1222 extern void FreePropertyWatch(struct PropertyWatch * watcher);
1223
1224 struct PropertyImport;
1225
1226 struct PropertyImport
1227 {
1228 struct PropertyImport * prev;
1229 struct PropertyImport * next;
1230 char *  name;
1231 unsigned int isVirtual;
1232 unsigned int hasSet;
1233 unsigned int hasGet;
1234 } __attribute__ ((gcc_struct));
1235
1236 struct MethodImport;
1237
1238 struct MethodImport
1239 {
1240 struct MethodImport * prev;
1241 struct MethodImport * next;
1242 char *  name;
1243 unsigned int isVirtual;
1244 } __attribute__ ((gcc_struct));
1245
1246 struct FunctionImport;
1247
1248 struct FunctionImport
1249 {
1250 struct FunctionImport * prev;
1251 struct FunctionImport * next;
1252 char *  name;
1253 } __attribute__ ((gcc_struct));
1254
1255 struct ClassImport;
1256
1257 struct ClassImport
1258 {
1259 struct ClassImport * prev;
1260 struct ClassImport * next;
1261 char *  name;
1262 struct __ecereNameSpace__ecere__sys__OldList methods;
1263 struct __ecereNameSpace__ecere__sys__OldList properties;
1264 unsigned int itself;
1265 int isRemote;
1266 } __attribute__ ((gcc_struct));
1267
1268 struct Initializer;
1269
1270 struct Expression
1271 {
1272 struct Expression * prev;
1273 struct Expression * next;
1274 struct Location loc;
1275 int type;
1276 union
1277 {
1278 struct
1279 {
1280 char *  constant;
1281 struct Identifier * identifier;
1282 } __attribute__ ((gcc_struct)) __anon1;
1283 struct Statement * compound;
1284 struct Instantiation * instance;
1285 struct
1286 {
1287 char *  string;
1288 unsigned int intlString;
1289 unsigned int wideString;
1290 } __attribute__ ((gcc_struct)) __anon2;
1291 struct __ecereNameSpace__ecere__sys__OldList *  list;
1292 struct
1293 {
1294 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1295 struct Declarator * decl;
1296 } __attribute__ ((gcc_struct)) _classExp;
1297 struct
1298 {
1299 struct Identifier * id;
1300 } __attribute__ ((gcc_struct)) classData;
1301 struct
1302 {
1303 struct Expression * exp;
1304 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1305 struct Location argLoc;
1306 } __attribute__ ((gcc_struct)) call;
1307 struct
1308 {
1309 struct Expression * exp;
1310 struct __ecereNameSpace__ecere__sys__OldList * index;
1311 } __attribute__ ((gcc_struct)) index;
1312 struct
1313 {
1314 struct Expression * exp;
1315 struct Identifier * member;
1316 int memberType;
1317 unsigned int thisPtr;
1318 } __attribute__ ((gcc_struct)) member;
1319 struct
1320 {
1321 int op;
1322 struct Expression * exp1;
1323 struct Expression * exp2;
1324 } __attribute__ ((gcc_struct)) op;
1325 struct TypeName * typeName;
1326 struct Specifier * _class;
1327 struct
1328 {
1329 struct TypeName * typeName;
1330 struct Expression * exp;
1331 } __attribute__ ((gcc_struct)) cast;
1332 struct
1333 {
1334 struct Expression * cond;
1335 struct __ecereNameSpace__ecere__sys__OldList * exp;
1336 struct Expression * elseExp;
1337 } __attribute__ ((gcc_struct)) cond;
1338 struct
1339 {
1340 struct TypeName * typeName;
1341 struct Expression * size;
1342 } __attribute__ ((gcc_struct)) _new;
1343 struct
1344 {
1345 struct TypeName * typeName;
1346 struct Expression * size;
1347 struct Expression * exp;
1348 } __attribute__ ((gcc_struct)) _renew;
1349 struct
1350 {
1351 char * table;
1352 struct Identifier * id;
1353 } __attribute__ ((gcc_struct)) db;
1354 struct
1355 {
1356 struct Expression * ds;
1357 struct Expression * name;
1358 } __attribute__ ((gcc_struct)) dbopen;
1359 struct
1360 {
1361 struct TypeName * typeName;
1362 struct Initializer * initializer;
1363 } __attribute__ ((gcc_struct)) initializer;
1364 struct
1365 {
1366 struct Expression * exp;
1367 struct TypeName * typeName;
1368 } __attribute__ ((gcc_struct)) vaArg;
1369 } __attribute__ ((gcc_struct)) __anon1;
1370 unsigned int debugValue;
1371 struct __ecereNameSpace__ecere__com__DataValue val;
1372 uint64 address;
1373 unsigned int hasAddress;
1374 struct Type * expType;
1375 struct Type * destType;
1376 unsigned int usage;
1377 int tempCount;
1378 unsigned int byReference;
1379 unsigned int isConstant;
1380 unsigned int addedThis;
1381 unsigned int needCast;
1382 unsigned int thisPtr;
1383 unsigned int opDestType;
1384 unsigned int needTemplateCast;
1385 } __attribute__ ((gcc_struct));
1386
1387 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1388
1389 struct Initializer
1390 {
1391 struct Initializer * prev;
1392 struct Initializer * next;
1393 struct Location loc;
1394 int type;
1395 union
1396 {
1397 struct Expression * exp;
1398 struct __ecereNameSpace__ecere__sys__OldList *  list;
1399 } __attribute__ ((gcc_struct)) __anon1;
1400 unsigned int isConstant;
1401 struct Identifier * id;
1402 } __attribute__ ((gcc_struct));
1403
1404 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1405
1406 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
1407
1408 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
1409
1410 struct InitDeclarator
1411 {
1412 struct InitDeclarator * prev;
1413 struct InitDeclarator * next;
1414 struct Location loc;
1415 struct Declarator * declarator;
1416 struct Initializer * initializer;
1417 } __attribute__ ((gcc_struct));
1418
1419 void ApplyLocation(struct Expression * exp, struct Location * loc)
1420 {
1421 exp->loc = *loc;
1422 switch(exp->type)
1423 {
1424 case 4:
1425 if(exp->__anon1.op.exp1)
1426 ApplyLocation(exp->__anon1.op.exp1, loc);
1427 if(exp->__anon1.op.exp2)
1428 ApplyLocation(exp->__anon1.op.exp2, loc);
1429 break;
1430 case 5:
1431 if(exp->__anon1.list)
1432 {
1433 struct Expression * e;
1434
1435 for(e = (*exp->__anon1.list).first; e; e = e->next)
1436 ApplyLocation(e, loc);
1437 }
1438 break;
1439 case 6:
1440 if(exp->__anon1.index.index)
1441 {
1442 struct Expression * e;
1443
1444 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1445 ApplyLocation(e, loc);
1446 }
1447 if(exp->__anon1.index.exp)
1448 ApplyLocation(exp->__anon1.index.exp, loc);
1449 break;
1450 case 7:
1451 if(exp->__anon1.call.arguments)
1452 {
1453 struct Expression * arg;
1454
1455 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1456 ApplyLocation(arg, loc);
1457 }
1458 if(exp->__anon1.call.exp)
1459 ApplyLocation(exp->__anon1.call.exp, loc);
1460 break;
1461 case 8:
1462 case 9:
1463 if(exp->__anon1.member.exp)
1464 ApplyLocation(exp->__anon1.member.exp, loc);
1465 break;
1466 case 11:
1467 if(exp->__anon1.cast.exp)
1468 ApplyLocation(exp->__anon1.cast.exp, loc);
1469 break;
1470 case 12:
1471 if(exp->__anon1.cond.exp)
1472 {
1473 struct Expression * e;
1474
1475 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1476 ApplyLocation(e, loc);
1477 }
1478 if(exp->__anon1.cond.cond)
1479 ApplyLocation(exp->__anon1.cond.cond, loc);
1480 if(exp->__anon1.cond.elseExp)
1481 ApplyLocation(exp->__anon1.cond.elseExp, loc);
1482 break;
1483 case 34:
1484 if(exp->__anon1.vaArg.exp)
1485 ApplyLocation(exp->__anon1.vaArg.exp, loc);
1486 break;
1487 default:
1488 break;
1489 }
1490 }
1491
1492 void __ecereMethod_Expression_Clear();
1493
1494 struct MembersInit;
1495
1496 struct MembersInit
1497 {
1498 struct MembersInit * prev;
1499 struct MembersInit * next;
1500 struct Location loc;
1501 int type;
1502 union
1503 {
1504 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1505 struct ClassFunction * function;
1506 } __attribute__ ((gcc_struct)) __anon1;
1507 } __attribute__ ((gcc_struct));
1508
1509 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
1510
1511 struct Operand;
1512
1513 struct OpTable
1514 {
1515 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1516 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1517 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1518 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1519 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1520 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1521 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1522 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1523 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1524 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1525 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1526 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1527 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1528 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1529 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1530 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1531 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1532 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1533 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1534 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1535 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1536 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1537 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1538 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1539 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1540 unsigned int (*  Not)(struct Expression *, struct Operand *);
1541 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1542 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1543 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1544 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1545 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1546 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1547 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1548 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1549 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1550 } __attribute__ ((gcc_struct));
1551
1552 struct Operand
1553 {
1554 int kind;
1555 struct Type * type;
1556 unsigned int ptrSize;
1557 union
1558 {
1559 char c;
1560 unsigned char uc;
1561 short s;
1562 unsigned short us;
1563 int i;
1564 unsigned int ui;
1565 float f;
1566 double d;
1567 long long i64;
1568 uint64 ui64;
1569 } __attribute__ ((gcc_struct)) __anon1;
1570 struct OpTable ops;
1571 } __attribute__ ((gcc_struct));
1572
1573 struct External *  _DeclareStruct(struct External *  neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl);
1574
1575 struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference)
1576 {
1577 return _DeclareStruct(neededBy, name, skipNoHead, needDereference, 0);
1578 }
1579
1580 static void _DeclareType(struct External *  neededFor, struct Type *  type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl);
1581
1582 void DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1583 {
1584 _DeclareType(neededFor, type, needDereference, forFunctionDef, 0);
1585 }
1586
1587 void DeclareTypeForwardDeclare(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1588 {
1589 _DeclareType(neededFor, type, needDereference, forFunctionDef, 1);
1590 }
1591
1592 static void _PrintType(struct Type *  type, char *  string, unsigned int printName, unsigned int fullName, unsigned int printConst);
1593
1594 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1595 {
1596 _PrintType(type, string, printName, fullName, 1);
1597 }
1598
1599 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1600 {
1601 _PrintType(type, string, printName, fullName, 0);
1602 }
1603
1604 struct __ecereNameSpace__ecere__com__Method;
1605
1606 struct __ecereNameSpace__ecere__com__Method
1607 {
1608 const char *  name;
1609 struct __ecereNameSpace__ecere__com__Method * parent;
1610 struct __ecereNameSpace__ecere__com__Method * left;
1611 struct __ecereNameSpace__ecere__com__Method * right;
1612 int depth;
1613 int (*  function)();
1614 int vid;
1615 int type;
1616 struct __ecereNameSpace__ecere__com__Class * _class;
1617 void *  symbol;
1618 const char *  dataTypeString;
1619 struct Type * dataType;
1620 int memberAccess;
1621 } __attribute__ ((gcc_struct));
1622
1623 struct Symbol
1624 {
1625 char *  string;
1626 struct Symbol * parent;
1627 struct Symbol * left;
1628 struct Symbol * right;
1629 int depth;
1630 struct Type * type;
1631 union
1632 {
1633 struct __ecereNameSpace__ecere__com__Method * method;
1634 struct __ecereNameSpace__ecere__com__Property * _property;
1635 struct __ecereNameSpace__ecere__com__Class * registered;
1636 } __attribute__ ((gcc_struct)) __anon1;
1637 unsigned int notYetDeclared;
1638 union
1639 {
1640 struct
1641 {
1642 struct External * pointerExternal;
1643 struct External * structExternal;
1644 } __attribute__ ((gcc_struct)) __anon1;
1645 struct
1646 {
1647 struct External * externalGet;
1648 struct External * externalSet;
1649 struct External * externalPtr;
1650 struct External * externalIsSet;
1651 } __attribute__ ((gcc_struct)) __anon2;
1652 struct
1653 {
1654 struct External * methodExternal;
1655 struct External * methodCodeExternal;
1656 } __attribute__ ((gcc_struct)) __anon3;
1657 } __attribute__ ((gcc_struct)) __anon2;
1658 unsigned int imported;
1659 unsigned int declaredStructSym;
1660 struct __ecereNameSpace__ecere__com__Class * _class;
1661 unsigned int declaredStruct;
1662 unsigned int needConstructor;
1663 unsigned int needDestructor;
1664 char *  constructorName;
1665 char *  structName;
1666 char *  className;
1667 char *  destructorName;
1668 struct ModuleImport * module;
1669 struct ClassImport * _import;
1670 struct Location nameLoc;
1671 unsigned int isParam;
1672 unsigned int isRemote;
1673 unsigned int isStruct;
1674 unsigned int fireWatchersDone;
1675 int declaring;
1676 unsigned int classData;
1677 unsigned int isStatic;
1678 char *  shortName;
1679 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
1680 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
1681 struct Context * ctx;
1682 int isIterator;
1683 struct Expression * propCategory;
1684 unsigned int mustRegister;
1685 } __attribute__ ((gcc_struct));
1686
1687 struct __ecereNameSpace__ecere__com__ClassProperty;
1688
1689 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1690
1691 struct __ecereNameSpace__ecere__com__ClassProperty
1692 {
1693 const char *  name;
1694 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1695 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1696 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1697 int depth;
1698 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1699 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1700 const char *  dataTypeString;
1701 struct Type * dataType;
1702 unsigned int constant;
1703 } __attribute__ ((gcc_struct));
1704
1705 struct __ecereNameSpace__ecere__com__BitMember;
1706
1707 struct __ecereNameSpace__ecere__com__BitMember
1708 {
1709 struct __ecereNameSpace__ecere__com__BitMember * prev;
1710 struct __ecereNameSpace__ecere__com__BitMember * next;
1711 const char *  name;
1712 unsigned int isProperty;
1713 int memberAccess;
1714 int id;
1715 struct __ecereNameSpace__ecere__com__Class * _class;
1716 const char *  dataTypeString;
1717 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1718 struct Type * dataType;
1719 int type;
1720 int size;
1721 int pos;
1722 uint64 mask;
1723 } __attribute__ ((gcc_struct));
1724
1725 struct __ecereNameSpace__ecere__com__DataMember;
1726
1727 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1728 {
1729 union
1730 {
1731 struct
1732 {
1733 const char *  dataTypeString;
1734 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1735 } __attribute__ ((gcc_struct)) __anon1;
1736 struct __ecereNameSpace__ecere__com__DataValue expression;
1737 struct
1738 {
1739 const char *  memberString;
1740 union
1741 {
1742 struct __ecereNameSpace__ecere__com__DataMember * member;
1743 struct __ecereNameSpace__ecere__com__Property * prop;
1744 struct __ecereNameSpace__ecere__com__Method * method;
1745 } __attribute__ ((gcc_struct)) __anon1;
1746 } __attribute__ ((gcc_struct)) __anon2;
1747 } __attribute__ ((gcc_struct)) __anon1;
1748 } __attribute__ ((gcc_struct));
1749
1750 extern void __ecereNameSpace__ecere__com__eClass_FindNextMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class **  curClass, struct __ecereNameSpace__ecere__com__DataMember **  curMember, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
1751
1752 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, unsigned int size, unsigned int alignment, int declMode);
1753
1754 struct TemplateParameter;
1755
1756 struct TemplateParameter
1757 {
1758 struct TemplateParameter * prev;
1759 struct TemplateParameter * next;
1760 struct Location loc;
1761 int type;
1762 struct Identifier * identifier;
1763 union
1764 {
1765 struct TemplateDatatype * dataType;
1766 int memberType;
1767 } __attribute__ ((gcc_struct)) __anon1;
1768 struct TemplateArgument * defaultArgument;
1769 const char *  dataTypeString;
1770 struct Type * baseType;
1771 } __attribute__ ((gcc_struct));
1772
1773 struct Type
1774 {
1775 struct Type * prev;
1776 struct Type * next;
1777 int refCount;
1778 union
1779 {
1780 struct Symbol * _class;
1781 struct
1782 {
1783 struct __ecereNameSpace__ecere__sys__OldList members;
1784 char *  enumName;
1785 } __attribute__ ((gcc_struct)) __anon1;
1786 struct
1787 {
1788 struct Type * returnType;
1789 struct __ecereNameSpace__ecere__sys__OldList params;
1790 struct Symbol * thisClass;
1791 unsigned int staticMethod;
1792 struct TemplateParameter * thisClassTemplate;
1793 } __attribute__ ((gcc_struct)) __anon2;
1794 struct
1795 {
1796 struct __ecereNameSpace__ecere__com__Method * method;
1797 struct __ecereNameSpace__ecere__com__Class * methodClass;
1798 struct __ecereNameSpace__ecere__com__Class * usedClass;
1799 } __attribute__ ((gcc_struct)) __anon3;
1800 struct
1801 {
1802 struct Type * arrayType;
1803 int arraySize;
1804 struct Expression * arraySizeExp;
1805 unsigned int freeExp;
1806 struct Symbol * enumClass;
1807 } __attribute__ ((gcc_struct)) __anon4;
1808 struct Type * type;
1809 struct TemplateParameter * templateParameter;
1810 } __attribute__ ((gcc_struct)) __anon1;
1811 int kind;
1812 unsigned int size;
1813 char *  name;
1814 char *  typeName;
1815 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1816 int classObjectType;
1817 int alignment;
1818 unsigned int offset;
1819 int bitFieldCount;
1820 int count;
1821 unsigned int isSigned : 1;
1822 unsigned int constant : 1;
1823 unsigned int truth : 1;
1824 unsigned int byReference : 1;
1825 unsigned int extraParam : 1;
1826 unsigned int directClassAccess : 1;
1827 unsigned int computing : 1;
1828 unsigned int keepCast : 1;
1829 unsigned int passAsTemplate : 1;
1830 unsigned int dllExport : 1;
1831 unsigned int attrStdcall : 1;
1832 unsigned int declaredWithStruct : 1;
1833 unsigned int typedByReference : 1;
1834 unsigned int casted : 1;
1835 unsigned int pointerAlignment : 1;
1836 } __attribute__ ((gcc_struct));
1837
1838 struct Specifier
1839 {
1840 struct Specifier * prev;
1841 struct Specifier * next;
1842 struct Location loc;
1843 int type;
1844 union
1845 {
1846 int specifier;
1847 struct
1848 {
1849 struct ExtDecl * extDecl;
1850 char *  name;
1851 struct Symbol * symbol;
1852 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
1853 struct Specifier * nsSpec;
1854 } __attribute__ ((gcc_struct)) __anon1;
1855 struct
1856 {
1857 struct Identifier * id;
1858 struct __ecereNameSpace__ecere__sys__OldList *  list;
1859 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
1860 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
1861 unsigned int addNameSpace;
1862 struct Context * ctx;
1863 struct ExtDecl * extDeclStruct;
1864 } __attribute__ ((gcc_struct)) __anon2;
1865 struct Expression * expression;
1866 struct Specifier * _class;
1867 struct TemplateParameter * templateParameter;
1868 } __attribute__ ((gcc_struct)) __anon1;
1869 } __attribute__ ((gcc_struct));
1870
1871 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
1872
1873 struct TemplatedType
1874 {
1875 uintptr_t key;
1876 struct __ecereNameSpace__ecere__sys__BTNode * parent;
1877 struct __ecereNameSpace__ecere__sys__BTNode * left;
1878 struct __ecereNameSpace__ecere__sys__BTNode * right;
1879 int depth;
1880 struct TemplateParameter * param;
1881 } __attribute__ ((gcc_struct));
1882
1883 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1884 {
1885 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1886 {
1887 if(!param->baseType)
1888 {
1889 if(param->dataTypeString)
1890 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1891 else
1892 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1893 }
1894 return param->baseType;
1895 }
1896 return (((void *)0));
1897 }
1898
1899 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1900 {
1901 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1902 return 1;
1903 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1904 {
1905 return 0;
1906 }
1907 if(type1->kind == type2->kind)
1908 {
1909 switch(type1->kind)
1910 {
1911 case 24:
1912 case 1:
1913 case 2:
1914 case 3:
1915 case 4:
1916 case 22:
1917 case 23:
1918 if(type1->passAsTemplate && !type2->passAsTemplate)
1919 return 1;
1920 return type1->isSigned != type2->isSigned;
1921 case 8:
1922 return type1->__anon1._class != type2->__anon1._class;
1923 case 13:
1924 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1925 default:
1926 return 1;
1927 }
1928 }
1929 return 1;
1930 }
1931
1932 unsigned int GetOpInt(struct Operand * op2, int * value2)
1933 {
1934 if(op2->kind == 3 && op2->type->isSigned)
1935 *value2 = op2->__anon1.i;
1936 else if(op2->kind == 3)
1937 *value2 = (int)op2->__anon1.ui;
1938 else if(op2->kind == 4 && op2->type->isSigned)
1939 *value2 = (int)op2->__anon1.i64;
1940 else if(op2->kind == 4)
1941 *value2 = (int)op2->__anon1.ui64;
1942 else if(op2->kind == 23 && op2->type->isSigned)
1943 *value2 = (int)op2->__anon1.i64;
1944 else if(op2->kind == 23)
1945 *value2 = (int)op2->__anon1.ui64;
1946 else if(op2->kind == 22 && op2->type->isSigned)
1947 *value2 = (int)op2->__anon1.i64;
1948 else if(op2->kind == 22)
1949 *value2 = (int)op2->__anon1.ui64;
1950 else if(op2->kind == 2 && op2->type->isSigned)
1951 *value2 = (int)op2->__anon1.s;
1952 else if(op2->kind == 2)
1953 *value2 = (int)op2->__anon1.us;
1954 else if(op2->kind == 1 && op2->type->isSigned)
1955 *value2 = (int)op2->__anon1.c;
1956 else if(op2->kind == 24 || op2->kind == 1)
1957 *value2 = (int)op2->__anon1.uc;
1958 else if(op2->kind == 6)
1959 *value2 = (int)op2->__anon1.f;
1960 else if(op2->kind == 7)
1961 *value2 = (int)op2->__anon1.d;
1962 else if(op2->kind == 13)
1963 *value2 = (int)op2->__anon1.ui64;
1964 else
1965 return 0;
1966 return 1;
1967 }
1968
1969 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1970 {
1971 if(op2->kind == 3 && op2->type->isSigned)
1972 *value2 = (unsigned int)op2->__anon1.i;
1973 else if(op2->kind == 3)
1974 *value2 = op2->__anon1.ui;
1975 else if(op2->kind == 4 && op2->type->isSigned)
1976 *value2 = (unsigned int)op2->__anon1.i64;
1977 else if(op2->kind == 4)
1978 *value2 = (unsigned int)op2->__anon1.ui64;
1979 else if(op2->kind == 23 && op2->type->isSigned)
1980 *value2 = (unsigned int)op2->__anon1.i64;
1981 else if(op2->kind == 23)
1982 *value2 = (unsigned int)op2->__anon1.ui64;
1983 else if(op2->kind == 22 && op2->type->isSigned)
1984 *value2 = (unsigned int)op2->__anon1.i64;
1985 else if(op2->kind == 22)
1986 *value2 = (unsigned int)op2->__anon1.ui64;
1987 else if(op2->kind == 2 && op2->type->isSigned)
1988 *value2 = (unsigned int)op2->__anon1.s;
1989 else if(op2->kind == 2)
1990 *value2 = (unsigned int)op2->__anon1.us;
1991 else if(op2->kind == 1 && op2->type->isSigned)
1992 *value2 = (unsigned int)op2->__anon1.c;
1993 else if(op2->kind == 24 || op2->kind == 1)
1994 *value2 = (unsigned int)op2->__anon1.uc;
1995 else if(op2->kind == 6)
1996 *value2 = (unsigned int)op2->__anon1.f;
1997 else if(op2->kind == 7)
1998 *value2 = (unsigned int)op2->__anon1.d;
1999 else if(op2->kind == 13)
2000 *value2 = (unsigned int)op2->__anon1.ui64;
2001 else
2002 return 0;
2003 return 1;
2004 }
2005
2006 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
2007 {
2008 if(op2->kind == 3 && op2->type->isSigned)
2009 *value2 = (long long)op2->__anon1.i;
2010 else if(op2->kind == 3)
2011 *value2 = (long long)op2->__anon1.ui;
2012 else if(op2->kind == 4 && op2->type->isSigned)
2013 *value2 = op2->__anon1.i64;
2014 else if(op2->kind == 4)
2015 *value2 = (long long)op2->__anon1.ui64;
2016 else if(op2->kind == 23 && op2->type->isSigned)
2017 *value2 = op2->__anon1.i64;
2018 else if(op2->kind == 23)
2019 *value2 = (long long)op2->__anon1.ui64;
2020 else if(op2->kind == 22 && op2->type->isSigned)
2021 *value2 = op2->__anon1.i64;
2022 else if(op2->kind == 22)
2023 *value2 = (long long)op2->__anon1.ui64;
2024 else if(op2->kind == 2 && op2->type->isSigned)
2025 *value2 = (long long)op2->__anon1.s;
2026 else if(op2->kind == 2)
2027 *value2 = (long long)op2->__anon1.us;
2028 else if(op2->kind == 1 && op2->type->isSigned)
2029 *value2 = (long long)op2->__anon1.c;
2030 else if(op2->kind == 24 || op2->kind == 1)
2031 *value2 = (long long)op2->__anon1.uc;
2032 else if(op2->kind == 6)
2033 *value2 = (long long)op2->__anon1.f;
2034 else if(op2->kind == 7)
2035 *value2 = (long long)op2->__anon1.d;
2036 else if(op2->kind == 13)
2037 *value2 = (long long)op2->__anon1.ui64;
2038 else
2039 return 0;
2040 return 1;
2041 }
2042
2043 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
2044 {
2045 if(op2->kind == 3 && op2->type->isSigned)
2046 *value2 = (uint64)op2->__anon1.i;
2047 else if(op2->kind == 3)
2048 *value2 = (uint64)op2->__anon1.ui;
2049 else if(op2->kind == 4 && op2->type->isSigned)
2050 *value2 = (uint64)op2->__anon1.i64;
2051 else if(op2->kind == 4)
2052 *value2 = op2->__anon1.ui64;
2053 else if(op2->kind == 23 && op2->type->isSigned)
2054 *value2 = (uint64)op2->__anon1.i64;
2055 else if(op2->kind == 23)
2056 *value2 = op2->__anon1.ui64;
2057 else if(op2->kind == 22 && op2->type->isSigned)
2058 *value2 = (uint64)op2->__anon1.i64;
2059 else if(op2->kind == 22)
2060 *value2 = op2->__anon1.ui64;
2061 else if(op2->kind == 2 && op2->type->isSigned)
2062 *value2 = (uint64)op2->__anon1.s;
2063 else if(op2->kind == 2)
2064 *value2 = (uint64)op2->__anon1.us;
2065 else if(op2->kind == 1 && op2->type->isSigned)
2066 *value2 = (uint64)op2->__anon1.c;
2067 else if(op2->kind == 24 || op2->kind == 1)
2068 *value2 = (uint64)op2->__anon1.uc;
2069 else if(op2->kind == 6)
2070 *value2 = (uint64)op2->__anon1.f;
2071 else if(op2->kind == 7)
2072 *value2 = (uint64)op2->__anon1.d;
2073 else if(op2->kind == 13)
2074 *value2 = op2->__anon1.ui64;
2075 else
2076 return 0;
2077 return 1;
2078 }
2079
2080 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
2081 {
2082 if(op2->kind == 3 && op2->type->isSigned)
2083 *value2 = (intptr_t)op2->__anon1.i;
2084 else if(op2->kind == 3)
2085 *value2 = (intptr_t)op2->__anon1.ui;
2086 else if(op2->kind == 4 && op2->type->isSigned)
2087 *value2 = (intptr_t)op2->__anon1.i64;
2088 else if(op2->kind == 4)
2089 *value2 = (intptr_t)op2->__anon1.ui64;
2090 else if(op2->kind == 23 && op2->type->isSigned)
2091 *value2 = (intptr_t)op2->__anon1.i64;
2092 else if(op2->kind == 23)
2093 *value2 = (intptr_t)op2->__anon1.ui64;
2094 else if(op2->kind == 22 && op2->type->isSigned)
2095 *value2 = (intptr_t)op2->__anon1.i64;
2096 else if(op2->kind == 22)
2097 *value2 = (intptr_t)op2->__anon1.ui64;
2098 else if(op2->kind == 2 && op2->type->isSigned)
2099 *value2 = (intptr_t)op2->__anon1.s;
2100 else if(op2->kind == 2)
2101 *value2 = (intptr_t)op2->__anon1.us;
2102 else if(op2->kind == 1 && op2->type->isSigned)
2103 *value2 = (intptr_t)op2->__anon1.c;
2104 else if(op2->kind == 24 || op2->kind == 1)
2105 *value2 = (intptr_t)op2->__anon1.uc;
2106 else if(op2->kind == 6)
2107 *value2 = (intptr_t)op2->__anon1.f;
2108 else if(op2->kind == 7)
2109 *value2 = (intptr_t)op2->__anon1.d;
2110 else if(op2->kind == 13)
2111 *value2 = (intptr_t)op2->__anon1.ui64;
2112 else
2113 return 0;
2114 return 1;
2115 }
2116
2117 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
2118 {
2119 if(op2->kind == 3 && op2->type->isSigned)
2120 *value2 = (uintptr_t)op2->__anon1.i;
2121 else if(op2->kind == 3)
2122 *value2 = (uintptr_t)op2->__anon1.ui;
2123 else if(op2->kind == 4 && op2->type->isSigned)
2124 *value2 = (uintptr_t)op2->__anon1.i64;
2125 else if(op2->kind == 4)
2126 *value2 = (uintptr_t)op2->__anon1.ui64;
2127 else if(op2->kind == 23 && op2->type->isSigned)
2128 *value2 = (uintptr_t)op2->__anon1.i64;
2129 else if(op2->kind == 23)
2130 *value2 = (uintptr_t)op2->__anon1.ui64;
2131 else if(op2->kind == 22 && op2->type->isSigned)
2132 *value2 = (uintptr_t)op2->__anon1.i64;
2133 else if(op2->kind == 22)
2134 *value2 = (uintptr_t)op2->__anon1.ui64;
2135 else if(op2->kind == 2 && op2->type->isSigned)
2136 *value2 = (uintptr_t)op2->__anon1.s;
2137 else if(op2->kind == 2)
2138 *value2 = (uintptr_t)op2->__anon1.us;
2139 else if(op2->kind == 1 && op2->type->isSigned)
2140 *value2 = (uintptr_t)op2->__anon1.c;
2141 else if(op2->kind == 24 || op2->kind == 1)
2142 *value2 = (uintptr_t)op2->__anon1.uc;
2143 else if(op2->kind == 6)
2144 *value2 = (uintptr_t)op2->__anon1.f;
2145 else if(op2->kind == 7)
2146 *value2 = (uintptr_t)op2->__anon1.d;
2147 else if(op2->kind == 13)
2148 *value2 = (uintptr_t)op2->__anon1.ui64;
2149 else
2150 return 0;
2151 return 1;
2152 }
2153
2154 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2155 {
2156 if(op2->kind == 3 && op2->type->isSigned)
2157 *value2 = (ssize_t)op2->__anon1.i;
2158 else if(op2->kind == 3)
2159 *value2 = (ssize_t)op2->__anon1.ui;
2160 else if(op2->kind == 4 && op2->type->isSigned)
2161 *value2 = (ssize_t)op2->__anon1.i64;
2162 else if(op2->kind == 4)
2163 *value2 = (ssize_t)op2->__anon1.ui64;
2164 else if(op2->kind == 23 && op2->type->isSigned)
2165 *value2 = (ssize_t)op2->__anon1.i64;
2166 else if(op2->kind == 23)
2167 *value2 = (ssize_t)op2->__anon1.ui64;
2168 else if(op2->kind == 22 && op2->type->isSigned)
2169 *value2 = (ssize_t)op2->__anon1.i64;
2170 else if(op2->kind == 22)
2171 *value2 = (ssize_t)op2->__anon1.ui64;
2172 else if(op2->kind == 2 && op2->type->isSigned)
2173 *value2 = (ssize_t)op2->__anon1.s;
2174 else if(op2->kind == 2)
2175 *value2 = (ssize_t)op2->__anon1.us;
2176 else if(op2->kind == 1 && op2->type->isSigned)
2177 *value2 = (ssize_t)op2->__anon1.c;
2178 else if(op2->kind == 24 || op2->kind == 1)
2179 *value2 = (ssize_t)op2->__anon1.uc;
2180 else if(op2->kind == 6)
2181 *value2 = (ssize_t)op2->__anon1.f;
2182 else if(op2->kind == 7)
2183 *value2 = (ssize_t)op2->__anon1.d;
2184 else if(op2->kind == 13)
2185 *value2 = (ssize_t)op2->__anon1.ui64;
2186 else
2187 return 0;
2188 return 1;
2189 }
2190
2191 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2192 {
2193 if(op2->kind == 3 && op2->type->isSigned)
2194 *value2 = (size_t)op2->__anon1.i;
2195 else if(op2->kind == 3)
2196 *value2 = (size_t)op2->__anon1.ui;
2197 else if(op2->kind == 4 && op2->type->isSigned)
2198 *value2 = (size_t)op2->__anon1.i64;
2199 else if(op2->kind == 4)
2200 *value2 = (size_t)op2->__anon1.ui64;
2201 else if(op2->kind == 23 && op2->type->isSigned)
2202 *value2 = (size_t)op2->__anon1.i64;
2203 else if(op2->kind == 23)
2204 *value2 = (size_t)op2->__anon1.ui64;
2205 else if(op2->kind == 22 && op2->type->isSigned)
2206 *value2 = (size_t)op2->__anon1.i64;
2207 else if(op2->kind == 22)
2208 *value2 = (size_t)op2->__anon1.ui64;
2209 else if(op2->kind == 2 && op2->type->isSigned)
2210 *value2 = (size_t)op2->__anon1.s;
2211 else if(op2->kind == 2)
2212 *value2 = (size_t)op2->__anon1.us;
2213 else if(op2->kind == 1 && op2->type->isSigned)
2214 *value2 = (size_t)op2->__anon1.c;
2215 else if(op2->kind == 24 || op2->kind == 1)
2216 *value2 = (size_t)op2->__anon1.uc;
2217 else if(op2->kind == 6)
2218 *value2 = (size_t)op2->__anon1.f;
2219 else if(op2->kind == 7)
2220 *value2 = (size_t)op2->__anon1.d;
2221 else if(op2->kind == 13)
2222 *value2 = (size_t)op2->__anon1.ui64;
2223 else
2224 return 0;
2225 return 1;
2226 }
2227
2228 unsigned int GetOpShort(struct Operand * op2, short * value2)
2229 {
2230 if(op2->kind == 3 && op2->type->isSigned)
2231 *value2 = (short)op2->__anon1.i;
2232 else if(op2->kind == 3)
2233 *value2 = (short)op2->__anon1.ui;
2234 else if(op2->kind == 4 && op2->type->isSigned)
2235 *value2 = (short)op2->__anon1.i64;
2236 else if(op2->kind == 4)
2237 *value2 = (short)op2->__anon1.ui64;
2238 else if(op2->kind == 23 && op2->type->isSigned)
2239 *value2 = (short)op2->__anon1.i64;
2240 else if(op2->kind == 23)
2241 *value2 = (short)op2->__anon1.ui64;
2242 else if(op2->kind == 22 && op2->type->isSigned)
2243 *value2 = (short)op2->__anon1.i64;
2244 else if(op2->kind == 22)
2245 *value2 = (short)op2->__anon1.ui64;
2246 else if(op2->kind == 2 && op2->type->isSigned)
2247 *value2 = op2->__anon1.s;
2248 else if(op2->kind == 2)
2249 *value2 = (short)op2->__anon1.us;
2250 else if(op2->kind == 1 && op2->type->isSigned)
2251 *value2 = (short)op2->__anon1.c;
2252 else if(op2->kind == 24 || op2->kind == 1)
2253 *value2 = (short)op2->__anon1.uc;
2254 else if(op2->kind == 6)
2255 *value2 = (short)op2->__anon1.f;
2256 else if(op2->kind == 7)
2257 *value2 = (short)op2->__anon1.d;
2258 else if(op2->kind == 13)
2259 *value2 = (short)op2->__anon1.ui64;
2260 else
2261 return 0;
2262 return 1;
2263 }
2264
2265 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2266 {
2267 if(op2->kind == 3 && op2->type->isSigned)
2268 *value2 = (unsigned short)op2->__anon1.i;
2269 else if(op2->kind == 3)
2270 *value2 = (unsigned short)op2->__anon1.ui;
2271 else if(op2->kind == 4 && op2->type->isSigned)
2272 *value2 = (unsigned short)op2->__anon1.i64;
2273 else if(op2->kind == 4)
2274 *value2 = (unsigned short)op2->__anon1.ui64;
2275 else if(op2->kind == 23 && op2->type->isSigned)
2276 *value2 = (unsigned short)op2->__anon1.i64;
2277 else if(op2->kind == 23)
2278 *value2 = (unsigned short)op2->__anon1.ui64;
2279 else if(op2->kind == 22 && op2->type->isSigned)
2280 *value2 = (unsigned short)op2->__anon1.i64;
2281 else if(op2->kind == 22)
2282 *value2 = (unsigned short)op2->__anon1.ui64;
2283 else if(op2->kind == 2 && op2->type->isSigned)
2284 *value2 = (unsigned short)op2->__anon1.s;
2285 else if(op2->kind == 2)
2286 *value2 = op2->__anon1.us;
2287 else if(op2->kind == 1 && op2->type->isSigned)
2288 *value2 = (unsigned short)op2->__anon1.c;
2289 else if(op2->kind == 24 || op2->kind == 1)
2290 *value2 = (unsigned short)op2->__anon1.uc;
2291 else if(op2->kind == 6)
2292 *value2 = (unsigned short)op2->__anon1.f;
2293 else if(op2->kind == 7)
2294 *value2 = (unsigned short)op2->__anon1.d;
2295 else if(op2->kind == 13)
2296 *value2 = (unsigned short)op2->__anon1.ui64;
2297 else
2298 return 0;
2299 return 1;
2300 }
2301
2302 unsigned int GetOpChar(struct Operand * op2, char * value2)
2303 {
2304 if(op2->kind == 3 && op2->type->isSigned)
2305 *value2 = (char)op2->__anon1.i;
2306 else if(op2->kind == 3)
2307 *value2 = (char)op2->__anon1.ui;
2308 else if(op2->kind == 4 && op2->type->isSigned)
2309 *value2 = (char)op2->__anon1.i64;
2310 else if(op2->kind == 4)
2311 *value2 = (char)op2->__anon1.ui64;
2312 else if(op2->kind == 23 && op2->type->isSigned)
2313 *value2 = (char)op2->__anon1.i64;
2314 else if(op2->kind == 23)
2315 *value2 = (char)op2->__anon1.ui64;
2316 else if(op2->kind == 22 && op2->type->isSigned)
2317 *value2 = (char)op2->__anon1.i64;
2318 else if(op2->kind == 22)
2319 *value2 = (char)op2->__anon1.ui64;
2320 else if(op2->kind == 2 && op2->type->isSigned)
2321 *value2 = (char)op2->__anon1.s;
2322 else if(op2->kind == 2)
2323 *value2 = (char)op2->__anon1.us;
2324 else if(op2->kind == 1 && op2->type->isSigned)
2325 *value2 = op2->__anon1.c;
2326 else if(op2->kind == 24 || op2->kind == 1)
2327 *value2 = (char)op2->__anon1.uc;
2328 else if(op2->kind == 6)
2329 *value2 = (char)op2->__anon1.f;
2330 else if(op2->kind == 7)
2331 *value2 = (char)op2->__anon1.d;
2332 else if(op2->kind == 13)
2333 *value2 = (char)op2->__anon1.ui64;
2334 else
2335 return 0;
2336 return 1;
2337 }
2338
2339 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2340 {
2341 if(op2->kind == 3 && op2->type->isSigned)
2342 *value2 = (unsigned char)op2->__anon1.i;
2343 else if(op2->kind == 3)
2344 *value2 = (unsigned char)op2->__anon1.ui;
2345 else if(op2->kind == 4 && op2->type->isSigned)
2346 *value2 = (unsigned char)op2->__anon1.i64;
2347 else if(op2->kind == 4)
2348 *value2 = (unsigned char)op2->__anon1.ui64;
2349 else if(op2->kind == 23 && op2->type->isSigned)
2350 *value2 = (unsigned char)op2->__anon1.i64;
2351 else if(op2->kind == 23)
2352 *value2 = (unsigned char)op2->__anon1.ui64;
2353 else if(op2->kind == 22 && op2->type->isSigned)
2354 *value2 = (unsigned char)op2->__anon1.i64;
2355 else if(op2->kind == 22)
2356 *value2 = (unsigned char)op2->__anon1.ui64;
2357 else if(op2->kind == 2 && op2->type->isSigned)
2358 *value2 = (unsigned char)op2->__anon1.s;
2359 else if(op2->kind == 2)
2360 *value2 = (unsigned char)op2->__anon1.us;
2361 else if(op2->kind == 1 && op2->type->isSigned)
2362 *value2 = (unsigned char)op2->__anon1.c;
2363 else if(op2->kind == 24 || op2->kind == 1)
2364 *value2 = op2->__anon1.uc;
2365 else if(op2->kind == 6)
2366 *value2 = (unsigned char)op2->__anon1.f;
2367 else if(op2->kind == 7)
2368 *value2 = (unsigned char)op2->__anon1.d;
2369 else if(op2->kind == 13)
2370 *value2 = (unsigned char)op2->__anon1.ui64;
2371 else
2372 return 0;
2373 return 1;
2374 }
2375
2376 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2377 {
2378 if(op2->kind == 3 && op2->type->isSigned)
2379 *value2 = (float)(float)op2->__anon1.i;
2380 else if(op2->kind == 3)
2381 *value2 = (float)(float)op2->__anon1.ui;
2382 else if(op2->kind == 4 && op2->type->isSigned)
2383 *value2 = (float)(float)op2->__anon1.i64;
2384 else if(op2->kind == 4)
2385 *value2 = (float)(float)op2->__anon1.ui64;
2386 else if(op2->kind == 23 && op2->type->isSigned)
2387 *value2 = (float)(float)op2->__anon1.i64;
2388 else if(op2->kind == 23)
2389 *value2 = (float)(float)op2->__anon1.ui64;
2390 else if(op2->kind == 22 && op2->type->isSigned)
2391 *value2 = (float)(float)op2->__anon1.i64;
2392 else if(op2->kind == 22)
2393 *value2 = (float)(float)op2->__anon1.ui64;
2394 else if(op2->kind == 2 && op2->type->isSigned)
2395 *value2 = (float)(float)op2->__anon1.s;
2396 else if(op2->kind == 2)
2397 *value2 = (float)(float)op2->__anon1.us;
2398 else if(op2->kind == 1 && op2->type->isSigned)
2399 *value2 = (float)(float)op2->__anon1.c;
2400 else if(op2->kind == 24 || op2->kind == 1)
2401 *value2 = (float)(float)op2->__anon1.uc;
2402 else if(op2->kind == 6)
2403 *value2 = (float)op2->__anon1.f;
2404 else if(op2->kind == 7)
2405 *value2 = (float)op2->__anon1.d;
2406 else if(op2->kind == 13)
2407 *value2 = (float)(float)op2->__anon1.ui64;
2408 else
2409 return 0;
2410 return 1;
2411 }
2412
2413 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2414 {
2415 if(op2->kind == 3 && op2->type->isSigned)
2416 *value2 = (double)(double)op2->__anon1.i;
2417 else if(op2->kind == 3)
2418 *value2 = (double)(double)op2->__anon1.ui;
2419 else if(op2->kind == 4 && op2->type->isSigned)
2420 *value2 = (double)(double)op2->__anon1.i64;
2421 else if(op2->kind == 4)
2422 *value2 = (double)(double)op2->__anon1.ui64;
2423 else if(op2->kind == 23 && op2->type->isSigned)
2424 *value2 = (double)(double)op2->__anon1.i64;
2425 else if(op2->kind == 23)
2426 *value2 = (double)(double)op2->__anon1.ui64;
2427 else if(op2->kind == 22 && op2->type->isSigned)
2428 *value2 = (double)(double)op2->__anon1.i64;
2429 else if(op2->kind == 22)
2430 *value2 = (double)(double)op2->__anon1.ui64;
2431 else if(op2->kind == 2 && op2->type->isSigned)
2432 *value2 = (double)(double)op2->__anon1.s;
2433 else if(op2->kind == 2)
2434 *value2 = (double)(double)op2->__anon1.us;
2435 else if(op2->kind == 1 && op2->type->isSigned)
2436 *value2 = (double)(double)op2->__anon1.c;
2437 else if(op2->kind == 24 || op2->kind == 1)
2438 *value2 = (double)(double)op2->__anon1.uc;
2439 else if(op2->kind == 6)
2440 *value2 = (double)op2->__anon1.f;
2441 else if(op2->kind == 7)
2442 *value2 = (double)op2->__anon1.d;
2443 else if(op2->kind == 13)
2444 *value2 = (double)(double)op2->__anon1.ui64;
2445 else
2446 return 0;
2447 return 1;
2448 }
2449
2450 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2451 {
2452 int value2 = op2->__anon1.i;
2453
2454 exp->type = 2;
2455 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
2456 if(!exp->expType)
2457 {
2458 exp->expType = op1->type;
2459 if(op1->type)
2460 op1->type->refCount++;
2461 }
2462 return 1;
2463 }
2464
2465 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2466 {
2467 unsigned int value2 = op2->__anon1.ui;
2468
2469 exp->type = 2;
2470 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
2471 if(!exp->expType)
2472 {
2473 exp->expType = op1->type;
2474 if(op1->type)
2475 op1->type->refCount++;
2476 }
2477 return 1;
2478 }
2479
2480 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2481 {
2482 long long value2 = op2->__anon1.i64;
2483
2484 exp->type = 2;
2485 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
2486 if(!exp->expType)
2487 {
2488 exp->expType = op1->type;
2489 if(op1->type)
2490 op1->type->refCount++;
2491 }
2492 return 1;
2493 }
2494
2495 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2496 {
2497 uint64 value2 = op2->__anon1.ui64;
2498
2499 exp->type = 2;
2500 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
2501 if(!exp->expType)
2502 {
2503 exp->expType = op1->type;
2504 if(op1->type)
2505 op1->type->refCount++;
2506 }
2507 return 1;
2508 }
2509
2510 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2511 {
2512 short value2 = op2->__anon1.s;
2513
2514 exp->type = 2;
2515 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
2516 if(!exp->expType)
2517 {
2518 exp->expType = op1->type;
2519 if(op1->type)
2520 op1->type->refCount++;
2521 }
2522 return 1;
2523 }
2524
2525 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2526 {
2527 unsigned short value2 = op2->__anon1.us;
2528
2529 exp->type = 2;
2530 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
2531 if(!exp->expType)
2532 {
2533 exp->expType = op1->type;
2534 if(op1->type)
2535 op1->type->refCount++;
2536 }
2537 return 1;
2538 }
2539
2540 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2541 {
2542 char value2 = op2->__anon1.c;
2543
2544 exp->type = 2;
2545 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
2546 if(!exp->expType)
2547 {
2548 exp->expType = op1->type;
2549 if(op1->type)
2550 op1->type->refCount++;
2551 }
2552 return 1;
2553 }
2554
2555 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2556 {
2557 unsigned char value2 = op2->__anon1.uc;
2558
2559 exp->type = 2;
2560 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
2561 if(!exp->expType)
2562 {
2563 exp->expType = op1->type;
2564 if(op1->type)
2565 op1->type->refCount++;
2566 }
2567 return 1;
2568 }
2569
2570 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2571 {
2572 float value2 = op2->__anon1.f;
2573
2574 exp->type = 2;
2575 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
2576 if(!exp->expType)
2577 {
2578 exp->expType = op1->type;
2579 if(op1->type)
2580 op1->type->refCount++;
2581 }
2582 return 1;
2583 }
2584
2585 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2586 {
2587 double value2 = op2->__anon1.d;
2588
2589 exp->type = 2;
2590 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
2591 if(!exp->expType)
2592 {
2593 exp->expType = op1->type;
2594 if(op1->type)
2595 op1->type->refCount++;
2596 }
2597 return 1;
2598 }
2599
2600 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2601 {
2602 int value2 = op2->__anon1.i;
2603
2604 exp->type = 2;
2605 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
2606 if(!exp->expType)
2607 {
2608 exp->expType = op1->type;
2609 if(op1->type)
2610 op1->type->refCount++;
2611 }
2612 return 1;
2613 }
2614
2615 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2616 {
2617 unsigned int value2 = op2->__anon1.ui;
2618
2619 exp->type = 2;
2620 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
2621 if(!exp->expType)
2622 {
2623 exp->expType = op1->type;
2624 if(op1->type)
2625 op1->type->refCount++;
2626 }
2627 return 1;
2628 }
2629
2630 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2631 {
2632 long long value2 = op2->__anon1.i64;
2633
2634 exp->type = 2;
2635 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
2636 if(!exp->expType)
2637 {
2638 exp->expType = op1->type;
2639 if(op1->type)
2640 op1->type->refCount++;
2641 }
2642 return 1;
2643 }
2644
2645 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2646 {
2647 uint64 value2 = op2->__anon1.ui64;
2648
2649 exp->type = 2;
2650 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
2651 if(!exp->expType)
2652 {
2653 exp->expType = op1->type;
2654 if(op1->type)
2655 op1->type->refCount++;
2656 }
2657 return 1;
2658 }
2659
2660 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2661 {
2662 short value2 = op2->__anon1.s;
2663
2664 exp->type = 2;
2665 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
2666 if(!exp->expType)
2667 {
2668 exp->expType = op1->type;
2669 if(op1->type)
2670 op1->type->refCount++;
2671 }
2672 return 1;
2673 }
2674
2675 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2676 {
2677 unsigned short value2 = op2->__anon1.us;
2678
2679 exp->type = 2;
2680 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
2681 if(!exp->expType)
2682 {
2683 exp->expType = op1->type;
2684 if(op1->type)
2685 op1->type->refCount++;
2686 }
2687 return 1;
2688 }
2689
2690 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2691 {
2692 char value2 = op2->__anon1.c;
2693
2694 exp->type = 2;
2695 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
2696 if(!exp->expType)
2697 {
2698 exp->expType = op1->type;
2699 if(op1->type)
2700 op1->type->refCount++;
2701 }
2702 return 1;
2703 }
2704
2705 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2706 {
2707 unsigned char value2 = op2->__anon1.uc;
2708
2709 exp->type = 2;
2710 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
2711 if(!exp->expType)
2712 {
2713 exp->expType = op1->type;
2714 if(op1->type)
2715 op1->type->refCount++;
2716 }
2717 return 1;
2718 }
2719
2720 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2721 {
2722 float value2 = op2->__anon1.f;
2723
2724 exp->type = 2;
2725 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
2726 if(!exp->expType)
2727 {
2728 exp->expType = op1->type;
2729 if(op1->type)
2730 op1->type->refCount++;
2731 }
2732 return 1;
2733 }
2734
2735 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2736 {
2737 double value2 = op2->__anon1.d;
2738
2739 exp->type = 2;
2740 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
2741 if(!exp->expType)
2742 {
2743 exp->expType = op1->type;
2744 if(op1->type)
2745 op1->type->refCount++;
2746 }
2747 return 1;
2748 }
2749
2750 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2751 {
2752 int value2 = op2->__anon1.i;
2753
2754 exp->type = 2;
2755 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
2756 if(!exp->expType)
2757 {
2758 exp->expType = op1->type;
2759 if(op1->type)
2760 op1->type->refCount++;
2761 }
2762 return 1;
2763 }
2764
2765 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2766 {
2767 unsigned int value2 = op2->__anon1.ui;
2768
2769 exp->type = 2;
2770 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
2771 if(!exp->expType)
2772 {
2773 exp->expType = op1->type;
2774 if(op1->type)
2775 op1->type->refCount++;
2776 }
2777 return 1;
2778 }
2779
2780 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2781 {
2782 long long value2 = op2->__anon1.i64;
2783
2784 exp->type = 2;
2785 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
2786 if(!exp->expType)
2787 {
2788 exp->expType = op1->type;
2789 if(op1->type)
2790 op1->type->refCount++;
2791 }
2792 return 1;
2793 }
2794
2795 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2796 {
2797 uint64 value2 = op2->__anon1.ui64;
2798
2799 exp->type = 2;
2800 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
2801 if(!exp->expType)
2802 {
2803 exp->expType = op1->type;
2804 if(op1->type)
2805 op1->type->refCount++;
2806 }
2807 return 1;
2808 }
2809
2810 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2811 {
2812 short value2 = op2->__anon1.s;
2813
2814 exp->type = 2;
2815 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
2816 if(!exp->expType)
2817 {
2818 exp->expType = op1->type;
2819 if(op1->type)
2820 op1->type->refCount++;
2821 }
2822 return 1;
2823 }
2824
2825 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2826 {
2827 unsigned short value2 = op2->__anon1.us;
2828
2829 exp->type = 2;
2830 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
2831 if(!exp->expType)
2832 {
2833 exp->expType = op1->type;
2834 if(op1->type)
2835 op1->type->refCount++;
2836 }
2837 return 1;
2838 }
2839
2840 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2841 {
2842 char value2 = op2->__anon1.c;
2843
2844 exp->type = 2;
2845 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
2846 if(!exp->expType)
2847 {
2848 exp->expType = op1->type;
2849 if(op1->type)
2850 op1->type->refCount++;
2851 }
2852 return 1;
2853 }
2854
2855 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2856 {
2857 unsigned char value2 = op2->__anon1.uc;
2858
2859 exp->type = 2;
2860 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
2861 if(!exp->expType)
2862 {
2863 exp->expType = op1->type;
2864 if(op1->type)
2865 op1->type->refCount++;
2866 }
2867 return 1;
2868 }
2869
2870 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2871 {
2872 float value2 = op2->__anon1.f;
2873
2874 exp->type = 2;
2875 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
2876 if(!exp->expType)
2877 {
2878 exp->expType = op1->type;
2879 if(op1->type)
2880 op1->type->refCount++;
2881 }
2882 return 1;
2883 }
2884
2885 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2886 {
2887 double value2 = op2->__anon1.d;
2888
2889 exp->type = 2;
2890 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
2891 if(!exp->expType)
2892 {
2893 exp->expType = op1->type;
2894 if(op1->type)
2895 op1->type->refCount++;
2896 }
2897 return 1;
2898 }
2899
2900 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2901 {
2902 int value2 = op2->__anon1.i;
2903
2904 exp->type = 2;
2905 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
2906 if(!exp->expType)
2907 {
2908 exp->expType = op1->type;
2909 if(op1->type)
2910 op1->type->refCount++;
2911 }
2912 return 1;
2913 }
2914
2915 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2916 {
2917 unsigned int value2 = op2->__anon1.ui;
2918
2919 exp->type = 2;
2920 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
2921 if(!exp->expType)
2922 {
2923 exp->expType = op1->type;
2924 if(op1->type)
2925 op1->type->refCount++;
2926 }
2927 return 1;
2928 }
2929
2930 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2931 {
2932 long long value2 = op2->__anon1.i64;
2933
2934 exp->type = 2;
2935 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
2936 if(!exp->expType)
2937 {
2938 exp->expType = op1->type;
2939 if(op1->type)
2940 op1->type->refCount++;
2941 }
2942 return 1;
2943 }
2944
2945 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2946 {
2947 uint64 value2 = op2->__anon1.ui64;
2948
2949 exp->type = 2;
2950 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
2951 if(!exp->expType)
2952 {
2953 exp->expType = op1->type;
2954 if(op1->type)
2955 op1->type->refCount++;
2956 }
2957 return 1;
2958 }
2959
2960 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2961 {
2962 short value2 = op2->__anon1.s;
2963
2964 exp->type = 2;
2965 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
2966 if(!exp->expType)
2967 {
2968 exp->expType = op1->type;
2969 if(op1->type)
2970 op1->type->refCount++;
2971 }
2972 return 1;
2973 }
2974
2975 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2976 {
2977 unsigned short value2 = op2->__anon1.us;
2978
2979 exp->type = 2;
2980 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
2981 if(!exp->expType)
2982 {
2983 exp->expType = op1->type;
2984 if(op1->type)
2985 op1->type->refCount++;
2986 }
2987 return 1;
2988 }
2989
2990 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2991 {
2992 char value2 = op2->__anon1.c;
2993
2994 exp->type = 2;
2995 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
2996 if(!exp->expType)
2997 {
2998 exp->expType = op1->type;
2999 if(op1->type)
3000 op1->type->refCount++;
3001 }
3002 return 1;
3003 }
3004
3005 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3006 {
3007 unsigned char value2 = op2->__anon1.uc;
3008
3009 exp->type = 2;
3010 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
3011 if(!exp->expType)
3012 {
3013 exp->expType = op1->type;
3014 if(op1->type)
3015 op1->type->refCount++;
3016 }
3017 return 1;
3018 }
3019
3020 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3021 {
3022 float value2 = op2->__anon1.f;
3023
3024 exp->type = 2;
3025 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
3026 if(!exp->expType)
3027 {
3028 exp->expType = op1->type;
3029 if(op1->type)
3030 op1->type->refCount++;
3031 }
3032 return 1;
3033 }
3034
3035 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3036 {
3037 double value2 = op2->__anon1.d;
3038
3039 exp->type = 2;
3040 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
3041 if(!exp->expType)
3042 {
3043 exp->expType = op1->type;
3044 if(op1->type)
3045 op1->type->refCount++;
3046 }
3047 return 1;
3048 }
3049
3050 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3051 {
3052 int value2 = op2->__anon1.i;
3053
3054 exp->type = 2;
3055 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
3056 if(!exp->expType)
3057 {
3058 exp->expType = op1->type;
3059 if(op1->type)
3060 op1->type->refCount++;
3061 }
3062 return 1;
3063 }
3064
3065 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3066 {
3067 unsigned int value2 = op2->__anon1.ui;
3068
3069 exp->type = 2;
3070 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
3071 if(!exp->expType)
3072 {
3073 exp->expType = op1->type;
3074 if(op1->type)
3075 op1->type->refCount++;
3076 }
3077 return 1;
3078 }
3079
3080 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3081 {
3082 long long value2 = op2->__anon1.i64;
3083
3084 exp->type = 2;
3085 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
3086 if(!exp->expType)
3087 {
3088 exp->expType = op1->type;
3089 if(op1->type)
3090 op1->type->refCount++;
3091 }
3092 return 1;
3093 }
3094
3095 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3096 {
3097 uint64 value2 = op2->__anon1.ui64;
3098
3099 exp->type = 2;
3100 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
3101 if(!exp->expType)
3102 {
3103 exp->expType = op1->type;
3104 if(op1->type)
3105 op1->type->refCount++;
3106 }
3107 return 1;
3108 }
3109
3110 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3111 {
3112 short value2 = op2->__anon1.s;
3113
3114 exp->type = 2;
3115 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
3116 if(!exp->expType)
3117 {
3118 exp->expType = op1->type;
3119 if(op1->type)
3120 op1->type->refCount++;
3121 }
3122 return 1;
3123 }
3124
3125 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3126 {
3127 unsigned short value2 = op2->__anon1.us;
3128
3129 exp->type = 2;
3130 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
3131 if(!exp->expType)
3132 {
3133 exp->expType = op1->type;
3134 if(op1->type)
3135 op1->type->refCount++;
3136 }
3137 return 1;
3138 }
3139
3140 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3141 {
3142 char value2 = op2->__anon1.c;
3143
3144 exp->type = 2;
3145 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
3146 if(!exp->expType)
3147 {
3148 exp->expType = op1->type;
3149 if(op1->type)
3150 op1->type->refCount++;
3151 }
3152 return 1;
3153 }
3154
3155 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3156 {
3157 unsigned char value2 = op2->__anon1.uc;
3158
3159 exp->type = 2;
3160 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
3161 if(!exp->expType)
3162 {
3163 exp->expType = op1->type;
3164 if(op1->type)
3165 op1->type->refCount++;
3166 }
3167 return 1;
3168 }
3169
3170 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
3171 {
3172 exp->type = 2;
3173 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
3174 if(!exp->expType)
3175 {
3176 exp->expType = op1->type;
3177 if(op1->type)
3178 op1->type->refCount++;
3179 }
3180 return 1;
3181 }
3182
3183 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
3184 {
3185 exp->type = 2;
3186 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
3187 if(!exp->expType)
3188 {
3189 exp->expType = op1->type;
3190 if(op1->type)
3191 op1->type->refCount++;
3192 }
3193 return 1;
3194 }
3195
3196 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
3197 {
3198 exp->type = 2;
3199 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
3200 if(!exp->expType)
3201 {
3202 exp->expType = op1->type;
3203 if(op1->type)
3204 op1->type->refCount++;
3205 }
3206 return 1;
3207 }
3208
3209 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
3210 {
3211 exp->type = 2;
3212 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
3213 if(!exp->expType)
3214 {
3215 exp->expType = op1->type;
3216 if(op1->type)
3217 op1->type->refCount++;
3218 }
3219 return 1;
3220 }
3221
3222 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
3223 {
3224 exp->type = 2;
3225 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
3226 if(!exp->expType)
3227 {
3228 exp->expType = op1->type;
3229 if(op1->type)
3230 op1->type->refCount++;
3231 }
3232 return 1;
3233 }
3234
3235 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
3236 {
3237 exp->type = 2;
3238 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
3239 if(!exp->expType)
3240 {
3241 exp->expType = op1->type;
3242 if(op1->type)
3243 op1->type->refCount++;
3244 }
3245 return 1;
3246 }
3247
3248 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
3249 {
3250 exp->type = 2;
3251 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
3252 if(!exp->expType)
3253 {
3254 exp->expType = op1->type;
3255 if(op1->type)
3256 op1->type->refCount++;
3257 }
3258 return 1;
3259 }
3260
3261 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
3262 {
3263 exp->type = 2;
3264 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
3265 if(!exp->expType)
3266 {
3267 exp->expType = op1->type;
3268 if(op1->type)
3269 op1->type->refCount++;
3270 }
3271 return 1;
3272 }
3273
3274 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
3275 {
3276 exp->type = 2;
3277 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
3278 if(!exp->expType)
3279 {
3280 exp->expType = op1->type;
3281 if(op1->type)
3282 op1->type->refCount++;
3283 }
3284 return 1;
3285 }
3286
3287 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
3288 {
3289 exp->type = 2;
3290 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
3291 if(!exp->expType)
3292 {
3293 exp->expType = op1->type;
3294 if(op1->type)
3295 op1->type->refCount++;
3296 }
3297 return 1;
3298 }
3299
3300 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
3301 {
3302 exp->type = 2;
3303 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
3304 if(!exp->expType)
3305 {
3306 exp->expType = op1->type;
3307 if(op1->type)
3308 op1->type->refCount++;
3309 }
3310 return 1;
3311 }
3312
3313 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
3314 {
3315 exp->type = 2;
3316 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
3317 if(!exp->expType)
3318 {
3319 exp->expType = op1->type;
3320 if(op1->type)
3321 op1->type->refCount++;
3322 }
3323 return 1;
3324 }
3325
3326 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
3327 {
3328 exp->type = 2;
3329 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
3330 if(!exp->expType)
3331 {
3332 exp->expType = op1->type;
3333 if(op1->type)
3334 op1->type->refCount++;
3335 }
3336 return 1;
3337 }
3338
3339 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
3340 {
3341 exp->type = 2;
3342 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
3343 if(!exp->expType)
3344 {
3345 exp->expType = op1->type;
3346 if(op1->type)
3347 op1->type->refCount++;
3348 }
3349 return 1;
3350 }
3351
3352 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
3353 {
3354 exp->type = 2;
3355 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
3356 if(!exp->expType)
3357 {
3358 exp->expType = op1->type;
3359 if(op1->type)
3360 op1->type->refCount++;
3361 }
3362 return 1;
3363 }
3364
3365 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
3366 {
3367 exp->type = 2;
3368 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
3369 if(!exp->expType)
3370 {
3371 exp->expType = op1->type;
3372 if(op1->type)
3373 op1->type->refCount++;
3374 }
3375 return 1;
3376 }
3377
3378 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
3379 {
3380 exp->type = 2;
3381 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
3382 if(!exp->expType)
3383 {
3384 exp->expType = op1->type;
3385 if(op1->type)
3386 op1->type->refCount++;
3387 }
3388 return 1;
3389 }
3390
3391 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
3392 {
3393 exp->type = 2;
3394 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
3395 if(!exp->expType)
3396 {
3397 exp->expType = op1->type;
3398 if(op1->type)
3399 op1->type->refCount++;
3400 }
3401 return 1;
3402 }
3403
3404 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
3405 {
3406 exp->type = 2;
3407 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
3408 if(!exp->expType)
3409 {
3410 exp->expType = op1->type;
3411 if(op1->type)
3412 op1->type->refCount++;
3413 }
3414 return 1;
3415 }
3416
3417 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
3418 {
3419 exp->type = 2;
3420 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
3421 if(!exp->expType)
3422 {
3423 exp->expType = op1->type;
3424 if(op1->type)
3425 op1->type->refCount++;
3426 }
3427 return 1;
3428 }
3429
3430 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
3431 {
3432 exp->type = 2;
3433 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
3434 if(!exp->expType)
3435 {
3436 exp->expType = op1->type;
3437 if(op1->type)
3438 op1->type->refCount++;
3439 }
3440 return 1;
3441 }
3442
3443 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
3444 {
3445 exp->type = 2;
3446 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
3447 if(!exp->expType)
3448 {
3449 exp->expType = op1->type;
3450 if(op1->type)
3451 op1->type->refCount++;
3452 }
3453 return 1;
3454 }
3455
3456 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
3457 {
3458 exp->type = 2;
3459 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
3460 if(!exp->expType)
3461 {
3462 exp->expType = op1->type;
3463 if(op1->type)
3464 op1->type->refCount++;
3465 }
3466 return 1;
3467 }
3468
3469 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
3470 {
3471 exp->type = 2;
3472 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
3473 if(!exp->expType)
3474 {
3475 exp->expType = op1->type;
3476 if(op1->type)
3477 op1->type->refCount++;
3478 }
3479 return 1;
3480 }
3481
3482 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
3483 {
3484 exp->type = 2;
3485 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
3486 if(!exp->expType)
3487 {
3488 exp->expType = op1->type;
3489 if(op1->type)
3490 op1->type->refCount++;
3491 }
3492 return 1;
3493 }
3494
3495 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
3496 {
3497 exp->type = 2;
3498 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
3499 if(!exp->expType)
3500 {
3501 exp->expType = op1->type;
3502 if(op1->type)
3503 op1->type->refCount++;
3504 }
3505 return 1;
3506 }
3507
3508 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
3509 {
3510 exp->type = 2;
3511 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
3512 if(!exp->expType)
3513 {
3514 exp->expType = op1->type;
3515 if(op1->type)
3516 op1->type->refCount++;
3517 }
3518 return 1;
3519 }
3520
3521 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
3522 {
3523 exp->type = 2;
3524 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
3525 if(!exp->expType)
3526 {
3527 exp->expType = op1->type;
3528 if(op1->type)
3529 op1->type->refCount++;
3530 }
3531 return 1;
3532 }
3533
3534 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
3535 {
3536 exp->type = 2;
3537 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
3538 if(!exp->expType)
3539 {
3540 exp->expType = op1->type;
3541 if(op1->type)
3542 op1->type->refCount++;
3543 }
3544 return 1;
3545 }
3546
3547 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
3548 {
3549 exp->type = 2;
3550 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
3551 if(!exp->expType)
3552 {
3553 exp->expType = op1->type;
3554 if(op1->type)
3555 op1->type->refCount++;
3556 }
3557 return 1;
3558 }
3559
3560 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3561 {
3562 int value2 = op2->__anon1.i;
3563
3564 exp->type = 2;
3565 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
3566 if(!exp->expType)
3567 {
3568 exp->expType = op1->type;
3569 if(op1->type)
3570 op1->type->refCount++;
3571 }
3572 return 1;
3573 }
3574
3575 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3576 {
3577 unsigned int value2 = op2->__anon1.ui;
3578
3579 exp->type = 2;
3580 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
3581 if(!exp->expType)
3582 {
3583 exp->expType = op1->type;
3584 if(op1->type)
3585 op1->type->refCount++;
3586 }
3587 return 1;
3588 }
3589
3590 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3591 {
3592 long long value2 = op2->__anon1.i64;
3593
3594 exp->type = 2;
3595 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
3596 if(!exp->expType)
3597 {
3598 exp->expType = op1->type;
3599 if(op1->type)
3600 op1->type->refCount++;
3601 }
3602 return 1;
3603 }
3604
3605 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3606 {
3607 uint64 value2 = op2->__anon1.ui64;
3608
3609 exp->type = 2;
3610 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
3611 if(!exp->expType)
3612 {
3613 exp->expType = op1->type;
3614 if(op1->type)
3615 op1->type->refCount++;
3616 }
3617 return 1;
3618 }
3619
3620 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3621 {
3622 short value2 = op2->__anon1.s;
3623
3624 exp->type = 2;
3625 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
3626 if(!exp->expType)
3627 {
3628 exp->expType = op1->type;
3629 if(op1->type)
3630 op1->type->refCount++;
3631 }
3632 return 1;
3633 }
3634
3635 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3636 {
3637 unsigned short value2 = op2->__anon1.us;
3638
3639 exp->type = 2;
3640 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
3641 if(!exp->expType)
3642 {
3643 exp->expType = op1->type;
3644 if(op1->type)
3645 op1->type->refCount++;
3646 }
3647 return 1;
3648 }
3649
3650 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3651 {
3652 char value2 = op2->__anon1.c;
3653
3654 exp->type = 2;
3655 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
3656 if(!exp->expType)
3657 {
3658 exp->expType = op1->type;
3659 if(op1->type)
3660 op1->type->refCount++;
3661 }
3662 return 1;
3663 }
3664
3665 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3666 {
3667 unsigned char value2 = op2->__anon1.uc;
3668
3669 exp->type = 2;
3670 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
3671 if(!exp->expType)
3672 {
3673 exp->expType = op1->type;
3674 if(op1->type)
3675 op1->type->refCount++;
3676 }
3677 return 1;
3678 }
3679
3680 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3681 {
3682 float value2 = op2->__anon1.f;
3683
3684 exp->type = 2;
3685 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
3686 if(!exp->expType)
3687 {
3688 exp->expType = op1->type;
3689 if(op1->type)
3690 op1->type->refCount++;
3691 }
3692 return 1;
3693 }
3694
3695 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3696 {
3697 double value2 = op2->__anon1.d;
3698
3699 exp->type = 2;
3700 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
3701 if(!exp->expType)
3702 {
3703 exp->expType = op1->type;
3704 if(op1->type)
3705 op1->type->refCount++;
3706 }
3707 return 1;
3708 }
3709
3710 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3711 {
3712 int value2 = op2->__anon1.i;
3713
3714 exp->type = 2;
3715 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
3716 if(!exp->expType)
3717 {
3718 exp->expType = op1->type;
3719 if(op1->type)
3720 op1->type->refCount++;
3721 }
3722 return 1;
3723 }
3724
3725 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3726 {
3727 unsigned int value2 = op2->__anon1.ui;
3728
3729 exp->type = 2;
3730 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
3731 if(!exp->expType)
3732 {
3733 exp->expType = op1->type;
3734 if(op1->type)
3735 op1->type->refCount++;
3736 }
3737 return 1;
3738 }
3739
3740 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3741 {
3742 long long value2 = op2->__anon1.i64;
3743
3744 exp->type = 2;
3745 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
3746 if(!exp->expType)
3747 {
3748 exp->expType = op1->type;
3749 if(op1->type)
3750 op1->type->refCount++;
3751 }
3752 return 1;
3753 }
3754
3755 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3756 {
3757 uint64 value2 = op2->__anon1.ui64;
3758
3759 exp->type = 2;
3760 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
3761 if(!exp->expType)
3762 {
3763 exp->expType = op1->type;
3764 if(op1->type)
3765 op1->type->refCount++;
3766 }
3767 return 1;
3768 }
3769
3770 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3771 {
3772 short value2 = op2->__anon1.s;
3773
3774 exp->type = 2;
3775 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
3776 if(!exp->expType)
3777 {
3778 exp->expType = op1->type;
3779 if(op1->type)
3780 op1->type->refCount++;
3781 }
3782 return 1;
3783 }
3784
3785 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3786 {
3787 unsigned short value2 = op2->__anon1.us;
3788
3789 exp->type = 2;
3790 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
3791 if(!exp->expType)
3792 {
3793 exp->expType = op1->type;
3794 if(op1->type)
3795 op1->type->refCount++;
3796 }
3797 return 1;
3798 }
3799
3800 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3801 {
3802 char value2 = op2->__anon1.c;
3803
3804 exp->type = 2;
3805 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
3806 if(!exp->expType)
3807 {
3808 exp->expType = op1->type;
3809 if(op1->type)
3810 op1->type->refCount++;
3811 }
3812 return 1;
3813 }
3814
3815 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3816 {
3817 unsigned char value2 = op2->__anon1.uc;
3818
3819 exp->type = 2;
3820 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
3821 if(!exp->expType)
3822 {
3823 exp->expType = op1->type;
3824 if(op1->type)
3825 op1->type->refCount++;
3826 }
3827 return 1;
3828 }
3829
3830 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3831 {
3832 float value2 = op2->__anon1.f;
3833
3834 exp->type = 2;
3835 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
3836 if(!exp->expType)
3837 {
3838 exp->expType = op1->type;
3839 if(op1->type)
3840 op1->type->refCount++;
3841 }
3842 return 1;
3843 }
3844
3845 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3846 {
3847 double value2 = op2->__anon1.d;
3848
3849 exp->type = 2;
3850 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
3851 if(!exp->expType)
3852 {
3853 exp->expType = op1->type;
3854 if(op1->type)
3855 op1->type->refCount++;
3856 }
3857 return 1;
3858 }
3859
3860 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3861 {
3862 int value2 = op2->__anon1.i;
3863
3864 exp->type = 2;
3865 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
3866 if(!exp->expType)
3867 {
3868 exp->expType = op1->type;
3869 if(op1->type)
3870 op1->type->refCount++;
3871 }
3872 return 1;
3873 }
3874
3875 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3876 {
3877 unsigned int value2 = op2->__anon1.ui;
3878
3879 exp->type = 2;
3880 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
3881 if(!exp->expType)
3882 {
3883 exp->expType = op1->type;
3884 if(op1->type)
3885 op1->type->refCount++;
3886 }
3887 return 1;
3888 }
3889
3890 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3891 {
3892 long long value2 = op2->__anon1.i64;
3893
3894 exp->type = 2;
3895 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
3896 if(!exp->expType)
3897 {
3898 exp->expType = op1->type;
3899 if(op1->type)
3900 op1->type->refCount++;
3901 }
3902 return 1;
3903 }
3904
3905 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3906 {
3907 uint64 value2 = op2->__anon1.ui64;
3908
3909 exp->type = 2;
3910 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
3911 if(!exp->expType)
3912 {
3913 exp->expType = op1->type;
3914 if(op1->type)
3915 op1->type->refCount++;
3916 }
3917 return 1;
3918 }
3919
3920 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3921 {
3922 short value2 = op2->__anon1.s;
3923
3924 exp->type = 2;
3925 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
3926 if(!exp->expType)
3927 {
3928 exp->expType = op1->type;
3929 if(op1->type)
3930 op1->type->refCount++;
3931 }
3932 return 1;
3933 }
3934
3935 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3936 {
3937 unsigned short value2 = op2->__anon1.us;
3938
3939 exp->type = 2;
3940 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
3941 if(!exp->expType)
3942 {
3943 exp->expType = op1->type;
3944 if(op1->type)
3945 op1->type->refCount++;
3946 }
3947 return 1;
3948 }
3949
3950 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3951 {
3952 char value2 = op2->__anon1.c;
3953
3954 exp->type = 2;
3955 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
3956 if(!exp->expType)
3957 {
3958 exp->expType = op1->type;
3959 if(op1->type)
3960 op1->type->refCount++;
3961 }
3962 return 1;
3963 }
3964
3965 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3966 {
3967 unsigned char value2 = op2->__anon1.uc;
3968
3969 exp->type = 2;
3970 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
3971 if(!exp->expType)
3972 {
3973 exp->expType = op1->type;
3974 if(op1->type)
3975 op1->type->refCount++;
3976 }
3977 return 1;
3978 }
3979
3980 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3981 {
3982 float value2 = op2->__anon1.f;
3983
3984 exp->type = 2;
3985 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
3986 if(!exp->expType)
3987 {
3988 exp->expType = op1->type;
3989 if(op1->type)
3990 op1->type->refCount++;
3991 }
3992 return 1;
3993 }
3994
3995 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3996 {
3997 double value2 = op2->__anon1.d;
3998
3999 exp->type = 2;
4000 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
4001 if(!exp->expType)
4002 {
4003 exp->expType = op1->type;
4004 if(op1->type)
4005 op1->type->refCount++;
4006 }
4007 return 1;
4008 }
4009
4010 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4011 {
4012 int value2 = op2->__anon1.i;
4013
4014 exp->type = 2;
4015 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
4016 if(!exp->expType)
4017 {
4018 exp->expType = op1->type;
4019 if(op1->type)
4020 op1->type->refCount++;
4021 }
4022 return 1;
4023 }
4024
4025 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4026 {
4027 unsigned int value2 = op2->__anon1.ui;
4028
4029 exp->type = 2;
4030 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
4031 if(!exp->expType)
4032 {
4033 exp->expType = op1->type;
4034 if(op1->type)
4035 op1->type->refCount++;
4036 }
4037 return 1;
4038 }
4039
4040 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4041 {
4042 long long value2 = op2->__anon1.i64;
4043
4044 exp->type = 2;
4045 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
4046 if(!exp->expType)
4047 {
4048 exp->expType = op1->type;
4049 if(op1->type)
4050 op1->type->refCount++;
4051 }
4052 return 1;
4053 }
4054
4055 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4056 {
4057 uint64 value2 = op2->__anon1.ui64;
4058
4059 exp->type = 2;
4060 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
4061 if(!exp->expType)
4062 {
4063 exp->expType = op1->type;
4064 if(op1->type)
4065 op1->type->refCount++;
4066 }
4067 return 1;
4068 }
4069
4070 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4071 {
4072 short value2 = op2->__anon1.s;
4073
4074 exp->type = 2;
4075 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
4076 if(!exp->expType)
4077 {
4078 exp->expType = op1->type;
4079 if(op1->type)
4080 op1->type->refCount++;
4081 }
4082 return 1;
4083 }
4084
4085 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4086 {
4087 unsigned short value2 = op2->__anon1.us;
4088
4089 exp->type = 2;
4090 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
4091 if(!exp->expType)
4092 {
4093 exp->expType = op1->type;
4094 if(op1->type)
4095 op1->type->refCount++;
4096 }
4097 return 1;
4098 }
4099
4100 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4101 {
4102 char value2 = op2->__anon1.c;
4103
4104 exp->type = 2;
4105 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
4106 if(!exp->expType)
4107 {
4108 exp->expType = op1->type;
4109 if(op1->type)
4110 op1->type->refCount++;
4111 }
4112 return 1;
4113 }
4114
4115 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4116 {
4117 unsigned char value2 = op2->__anon1.uc;
4118
4119 exp->type = 2;
4120 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
4121 if(!exp->expType)
4122 {
4123 exp->expType = op1->type;
4124 if(op1->type)
4125 op1->type->refCount++;
4126 }
4127 return 1;
4128 }
4129
4130 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4131 {
4132 float value2 = op2->__anon1.f;
4133
4134 exp->type = 2;
4135 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
4136 if(!exp->expType)
4137 {
4138 exp->expType = op1->type;
4139 if(op1->type)
4140 op1->type->refCount++;
4141 }
4142 return 1;
4143 }
4144
4145 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4146 {
4147 double value2 = op2->__anon1.d;
4148
4149 exp->type = 2;
4150 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
4151 if(!exp->expType)
4152 {
4153 exp->expType = op1->type;
4154 if(op1->type)
4155 op1->type->refCount++;
4156 }
4157 return 1;
4158 }
4159
4160 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4161 {
4162 int value2 = op2->__anon1.i;
4163
4164 exp->type = 2;
4165 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
4166 if(!exp->expType)
4167 {
4168 exp->expType = op1->type;
4169 if(op1->type)
4170 op1->type->refCount++;
4171 }
4172 return 1;
4173 }
4174
4175 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4176 {
4177 unsigned int value2 = op2->__anon1.ui;
4178
4179 exp->type = 2;
4180 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
4181 if(!exp->expType)
4182 {
4183 exp->expType = op1->type;
4184 if(op1->type)
4185 op1->type->refCount++;
4186 }
4187 return 1;
4188 }
4189
4190 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4191 {
4192 long long value2 = op2->__anon1.i64;
4193
4194 exp->type = 2;
4195 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
4196 if(!exp->expType)
4197 {
4198 exp->expType = op1->type;
4199 if(op1->type)
4200 op1->type->refCount++;
4201 }
4202 return 1;
4203 }
4204
4205 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4206 {
4207 uint64 value2 = op2->__anon1.ui64;
4208
4209 exp->type = 2;
4210 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
4211 if(!exp->expType)
4212 {
4213 exp->expType = op1->type;
4214 if(op1->type)
4215 op1->type->refCount++;
4216 }
4217 return 1;
4218 }
4219
4220 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4221 {
4222 short value2 = op2->__anon1.s;
4223
4224 exp->type = 2;
4225 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
4226 if(!exp->expType)
4227 {
4228 exp->expType = op1->type;
4229 if(op1->type)
4230 op1->type->refCount++;
4231 }
4232 return 1;
4233 }
4234
4235 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4236 {
4237 unsigned short value2 = op2->__anon1.us;
4238
4239 exp->type = 2;
4240 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
4241 if(!exp->expType)
4242 {
4243 exp->expType = op1->type;
4244 if(op1->type)
4245 op1->type->refCount++;
4246 }
4247 return 1;
4248 }
4249
4250 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4251 {
4252 char value2 = op2->__anon1.c;
4253
4254 exp->type = 2;
4255 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
4256 if(!exp->expType)
4257 {
4258 exp->expType = op1->type;
4259 if(op1->type)
4260 op1->type->refCount++;
4261 }
4262 return 1;
4263 }
4264
4265 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4266 {
4267 unsigned char value2 = op2->__anon1.uc;
4268
4269 exp->type = 2;
4270 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
4271 if(!exp->expType)
4272 {
4273 exp->expType = op1->type;
4274 if(op1->type)
4275 op1->type->refCount++;
4276 }
4277 return 1;
4278 }
4279
4280 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4281 {
4282 float value2 = op2->__anon1.f;
4283
4284 exp->type = 2;
4285 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
4286 if(!exp->expType)
4287 {
4288 exp->expType = op1->type;
4289 if(op1->type)
4290 op1->type->refCount++;
4291 }
4292 return 1;
4293 }
4294
4295 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4296 {
4297 double value2 = op2->__anon1.d;
4298
4299 exp->type = 2;
4300 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
4301 if(!exp->expType)
4302 {
4303 exp->expType = op1->type;
4304 if(op1->type)
4305 op1->type->refCount++;
4306 }
4307 return 1;
4308 }
4309
4310 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4311 {
4312 int value2 = op2->__anon1.i;
4313
4314 exp->type = 2;
4315 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
4316 if(!exp->expType)
4317 {
4318 exp->expType = op1->type;
4319 if(op1->type)
4320 op1->type->refCount++;
4321 }
4322 return 1;
4323 }
4324
4325 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4326 {
4327 unsigned int value2 = op2->__anon1.ui;
4328
4329 exp->type = 2;
4330 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
4331 if(!exp->expType)
4332 {
4333 exp->expType = op1->type;
4334 if(op1->type)
4335 op1->type->refCount++;
4336 }
4337 return 1;
4338 }
4339
4340 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4341 {
4342 long long value2 = op2->__anon1.i64;
4343
4344 exp->type = 2;
4345 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
4346 if(!exp->expType)
4347 {
4348 exp->expType = op1->type;
4349 if(op1->type)
4350 op1->type->refCount++;
4351 }
4352 return 1;
4353 }
4354
4355 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4356 {
4357 uint64 value2 = op2->__anon1.ui64;
4358
4359 exp->type = 2;
4360 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
4361 if(!exp->expType)
4362 {
4363 exp->expType = op1->type;
4364 if(op1->type)
4365 op1->type->refCount++;
4366 }
4367 return 1;
4368 }
4369
4370 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4371 {
4372 short value2 = op2->__anon1.s;
4373
4374 exp->type = 2;
4375 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
4376 if(!exp->expType)
4377 {
4378 exp->expType = op1->type;
4379 if(op1->type)
4380 op1->type->refCount++;
4381 }
4382 return 1;
4383 }
4384
4385 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4386 {
4387 unsigned short value2 = op2->__anon1.us;
4388
4389 exp->type = 2;
4390 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
4391 if(!exp->expType)
4392 {
4393 exp->expType = op1->type;
4394 if(op1->type)
4395 op1->type->refCount++;
4396 }
4397 return 1;
4398 }
4399
4400 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4401 {
4402 char value2 = op2->__anon1.c;
4403
4404 exp->type = 2;
4405 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
4406 if(!exp->expType)
4407 {
4408 exp->expType = op1->type;
4409 if(op1->type)
4410 op1->type->refCount++;
4411 }
4412 return 1;
4413 }
4414
4415 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4416 {
4417 unsigned char value2 = op2->__anon1.uc;
4418
4419 exp->type = 2;
4420 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
4421 if(!exp->expType)
4422 {
4423 exp->expType = op1->type;
4424 if(op1->type)
4425 op1->type->refCount++;
4426 }
4427 return 1;
4428 }
4429
4430 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4431 {
4432 int value2 = op2->__anon1.i;
4433
4434 exp->type = 2;
4435 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
4436 if(!exp->expType)
4437 {
4438 exp->expType = op1->type;
4439 if(op1->type)
4440 op1->type->refCount++;
4441 }
4442 return 1;
4443 }
4444
4445 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4446 {
4447 unsigned int value2 = op2->__anon1.ui;
4448
4449 exp->type = 2;
4450 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
4451 if(!exp->expType)
4452 {
4453 exp->expType = op1->type;
4454 if(op1->type)
4455 op1->type->refCount++;
4456 }
4457 return 1;
4458 }
4459
4460 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4461 {
4462 long long value2 = op2->__anon1.i64;
4463
4464 exp->type = 2;
4465 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
4466 if(!exp->expType)
4467 {
4468 exp->expType = op1->type;
4469 if(op1->type)
4470 op1->type->refCount++;
4471 }
4472 return 1;
4473 }
4474
4475 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4476 {
4477 uint64 value2 = op2->__anon1.ui64;
4478
4479 exp->type = 2;
4480 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
4481 if(!exp->expType)
4482 {
4483 exp->expType = op1->type;
4484 if(op1->type)
4485 op1->type->refCount++;
4486 }
4487 return 1;
4488 }
4489
4490 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4491 {
4492 short value2 = op2->__anon1.s;
4493
4494 exp->type = 2;
4495 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
4496 if(!exp->expType)
4497 {
4498 exp->expType = op1->type;
4499 if(op1->type)
4500 op1->type->refCount++;
4501 }
4502 return 1;
4503 }
4504
4505 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4506 {
4507 unsigned short value2 = op2->__anon1.us;
4508
4509 exp->type = 2;
4510 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
4511 if(!exp->expType)
4512 {
4513 exp->expType = op1->type;
4514 if(op1->type)
4515 op1->type->refCount++;
4516 }
4517 return 1;
4518 }
4519
4520 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4521 {
4522 char value2 = op2->__anon1.c;
4523
4524 exp->type = 2;
4525 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
4526 if(!exp->expType)
4527 {
4528 exp->expType = op1->type;
4529 if(op1->type)
4530 op1->type->refCount++;
4531 }
4532 return 1;
4533 }
4534
4535 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4536 {
4537 unsigned char value2 = op2->__anon1.uc;
4538
4539 exp->type = 2;
4540 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
4541 if(!exp->expType)
4542 {
4543 exp->expType = op1->type;
4544 if(op1->type)
4545 op1->type->refCount++;
4546 }
4547 return 1;
4548 }
4549
4550 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4551 {
4552 int value2 = op2->__anon1.i;
4553
4554 exp->type = 2;
4555 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
4556 if(!exp->expType)
4557 {
4558 exp->expType = op1->type;
4559 if(op1->type)
4560 op1->type->refCount++;
4561 }
4562 return 1;
4563 }
4564
4565 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4566 {
4567 unsigned int value2 = op2->__anon1.ui;
4568
4569 exp->type = 2;
4570 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
4571 if(!exp->expType)
4572 {
4573 exp->expType = op1->type;
4574 if(op1->type)
4575 op1->type->refCount++;
4576 }
4577 return 1;
4578 }
4579
4580 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4581 {
4582 long long value2 = op2->__anon1.i64;
4583
4584 exp->type = 2;
4585 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
4586 if(!exp->expType)
4587 {
4588 exp->expType = op1->type;
4589 if(op1->type)
4590 op1->type->refCount++;
4591 }
4592 return 1;
4593 }
4594
4595 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4596 {
4597 uint64 value2 = op2->__anon1.ui64;
4598
4599 exp->type = 2;
4600 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
4601 if(!exp->expType)
4602 {
4603 exp->expType = op1->type;
4604 if(op1->type)
4605 op1->type->refCount++;
4606 }
4607 return 1;
4608 }
4609
4610 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4611 {
4612 short value2 = op2->__anon1.s;
4613
4614 exp->type = 2;
4615 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
4616 if(!exp->expType)
4617 {
4618 exp->expType = op1->type;
4619 if(op1->type)
4620 op1->type->refCount++;
4621 }
4622 return 1;
4623 }
4624
4625 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4626 {
4627 unsigned short value2 = op2->__anon1.us;
4628
4629 exp->type = 2;
4630 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
4631 if(!exp->expType)
4632 {
4633 exp->expType = op1->type;
4634 if(op1->type)
4635 op1->type->refCount++;
4636 }
4637 return 1;
4638 }
4639
4640 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4641 {
4642 char value2 = op2->__anon1.c;
4643
4644 exp->type = 2;
4645 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
4646 if(!exp->expType)
4647 {
4648 exp->expType = op1->type;
4649 if(op1->type)
4650 op1->type->refCount++;
4651 }
4652 return 1;
4653 }
4654
4655 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4656 {
4657 unsigned char value2 = op2->__anon1.uc;
4658
4659 exp->type = 2;
4660 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
4661 if(!exp->expType)
4662 {
4663 exp->expType = op1->type;
4664 if(op1->type)
4665 op1->type->refCount++;
4666 }
4667 return 1;
4668 }
4669
4670 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4671 {
4672 int value2 = op2->__anon1.i;
4673
4674 exp->type = 2;
4675 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
4676 if(!exp->expType)
4677 {
4678 exp->expType = op1->type;
4679 if(op1->type)
4680 op1->type->refCount++;
4681 }
4682 return 1;
4683 }
4684
4685 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4686 {
4687 unsigned int value2 = op2->__anon1.ui;
4688
4689 exp->type = 2;
4690 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
4691 if(!exp->expType)
4692 {
4693 exp->expType = op1->type;
4694 if(op1->type)
4695 op1->type->refCount++;
4696 }
4697 return 1;
4698 }
4699
4700 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4701 {
4702 long long value2 = op2->__anon1.i64;
4703
4704 exp->type = 2;
4705 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
4706 if(!exp->expType)
4707 {
4708 exp->expType = op1->type;
4709 if(op1->type)
4710 op1->type->refCount++;
4711 }
4712 return 1;
4713 }
4714
4715 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4716 {
4717 uint64 value2 = op2->__anon1.ui64;
4718
4719 exp->type = 2;
4720 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
4721 if(!exp->expType)
4722 {
4723 exp->expType = op1->type;
4724 if(op1->type)
4725 op1->type->refCount++;
4726 }
4727 return 1;
4728 }
4729
4730 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4731 {
4732 short value2 = op2->__anon1.s;
4733
4734 exp->type = 2;
4735 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
4736 if(!exp->expType)
4737 {
4738 exp->expType = op1->type;
4739 if(op1->type)
4740 op1->type->refCount++;
4741 }
4742 return 1;
4743 }
4744
4745 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4746 {
4747 unsigned short value2 = op2->__anon1.us;
4748
4749 exp->type = 2;
4750 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
4751 if(!exp->expType)
4752 {
4753 exp->expType = op1->type;
4754 if(op1->type)
4755 op1->type->refCount++;
4756 }
4757 return 1;
4758 }
4759
4760 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4761 {
4762 char value2 = op2->__anon1.c;
4763
4764 exp->type = 2;
4765 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
4766 if(!exp->expType)
4767 {
4768 exp->expType = op1->type;
4769 if(op1->type)
4770 op1->type->refCount++;
4771 }
4772 return 1;
4773 }
4774
4775 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4776 {
4777 unsigned char value2 = op2->__anon1.uc;
4778
4779 exp->type = 2;
4780 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
4781 if(!exp->expType)
4782 {
4783 exp->expType = op1->type;
4784 if(op1->type)
4785 op1->type->refCount++;
4786 }
4787 return 1;
4788 }
4789
4790 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4791 {
4792 int value2 = op2->__anon1.i;
4793
4794 exp->type = 2;
4795 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
4796 if(!exp->expType)
4797 {
4798 exp->expType = op1->type;
4799 if(op1->type)
4800 op1->type->refCount++;
4801 }
4802 return 1;
4803 }
4804
4805 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4806 {
4807 unsigned int value2 = op2->__anon1.ui;
4808
4809 exp->type = 2;
4810 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
4811 if(!exp->expType)
4812 {
4813 exp->expType = op1->type;
4814 if(op1->type)
4815 op1->type->refCount++;
4816 }
4817 return 1;
4818 }
4819
4820 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4821 {
4822 long long value2 = op2->__anon1.i64;
4823
4824 exp->type = 2;
4825 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
4826 if(!exp->expType)
4827 {
4828 exp->expType = op1->type;
4829 if(op1->type)
4830 op1->type->refCount++;
4831 }
4832 return 1;
4833 }
4834
4835 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4836 {
4837 uint64 value2 = op2->__anon1.ui64;
4838
4839 exp->type = 2;
4840 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
4841 if(!exp->expType)
4842 {
4843 exp->expType = op1->type;
4844 if(op1->type)
4845 op1->type->refCount++;
4846 }
4847 return 1;
4848 }
4849
4850 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4851 {
4852 short value2 = op2->__anon1.s;
4853
4854 exp->type = 2;
4855 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
4856 if(!exp->expType)
4857 {
4858 exp->expType = op1->type;
4859 if(op1->type)
4860 op1->type->refCount++;
4861 }
4862 return 1;
4863 }
4864
4865 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4866 {
4867 unsigned short value2 = op2->__anon1.us;
4868
4869 exp->type = 2;
4870 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
4871 if(!exp->expType)
4872 {
4873 exp->expType = op1->type;
4874 if(op1->type)
4875 op1->type->refCount++;
4876 }
4877 return 1;
4878 }
4879
4880 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4881 {
4882 char value2 = op2->__anon1.c;
4883
4884 exp->type = 2;
4885 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
4886 if(!exp->expType)
4887 {
4888 exp->expType = op1->type;
4889 if(op1->type)
4890 op1->type->refCount++;
4891 }
4892 return 1;
4893 }
4894
4895 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4896 {
4897 unsigned char value2 = op2->__anon1.uc;
4898
4899 exp->type = 2;
4900 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
4901 if(!exp->expType)
4902 {
4903 exp->expType = op1->type;
4904 if(op1->type)
4905 op1->type->refCount++;
4906 }
4907 return 1;
4908 }
4909
4910 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4911 {
4912 int value2 = op2->__anon1.i;
4913
4914 exp->type = 2;
4915 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
4916 if(!exp->expType)
4917 {
4918 exp->expType = op1->type;
4919 if(op1->type)
4920 op1->type->refCount++;
4921 }
4922 return 1;
4923 }
4924
4925 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4926 {
4927 unsigned int value2 = op2->__anon1.ui;
4928
4929 exp->type = 2;
4930 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
4931 if(!exp->expType)
4932 {
4933 exp->expType = op1->type;
4934 if(op1->type)
4935 op1->type->refCount++;
4936 }
4937 return 1;
4938 }
4939
4940 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4941 {
4942 long long value2 = op2->__anon1.i64;
4943
4944 exp->type = 2;
4945 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
4946 if(!exp->expType)
4947 {
4948 exp->expType = op1->type;
4949 if(op1->type)
4950 op1->type->refCount++;
4951 }
4952 return 1;
4953 }
4954
4955 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4956 {
4957 uint64 value2 = op2->__anon1.ui64;
4958
4959 exp->type = 2;
4960 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
4961 if(!exp->expType)
4962 {
4963 exp->expType = op1->type;
4964 if(op1->type)
4965 op1->type->refCount++;
4966 }
4967 return 1;
4968 }
4969
4970 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4971 {
4972 short value2 = op2->__anon1.s;
4973
4974 exp->type = 2;
4975 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
4976 if(!exp->expType)
4977 {
4978 exp->expType = op1->type;
4979 if(op1->type)
4980 op1->type->refCount++;
4981 }
4982 return 1;
4983 }
4984
4985 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4986 {
4987 unsigned short value2 = op2->__anon1.us;
4988
4989 exp->type = 2;
4990 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
4991 if(!exp->expType)
4992 {
4993 exp->expType = op1->type;
4994 if(op1->type)
4995 op1->type->refCount++;
4996 }
4997 return 1;
4998 }
4999
5000 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5001 {
5002 char value2 = op2->__anon1.c;
5003
5004 exp->type = 2;
5005 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
5006 if(!exp->expType)
5007 {
5008 exp->expType = op1->type;
5009 if(op1->type)
5010 op1->type->refCount++;
5011 }
5012 return 1;
5013 }
5014
5015 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5016 {
5017 unsigned char value2 = op2->__anon1.uc;
5018
5019 exp->type = 2;
5020 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
5021 if(!exp->expType)
5022 {
5023 exp->expType = op1->type;
5024 if(op1->type)
5025 op1->type->refCount++;
5026 }
5027 return 1;
5028 }
5029
5030 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
5031 {
5032 exp->type = 2;
5033 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
5034 if(!exp->expType)
5035 {
5036 exp->expType = op1->type;
5037 if(op1->type)
5038 op1->type->refCount++;
5039 }
5040 return 1;
5041 }
5042
5043 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
5044 {
5045 exp->type = 2;
5046 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
5047 if(!exp->expType)
5048 {
5049 exp->expType = op1->type;
5050 if(op1->type)
5051 op1->type->refCount++;
5052 }
5053 return 1;
5054 }
5055
5056 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
5057 {
5058 exp->type = 2;
5059 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
5060 if(!exp->expType)
5061 {
5062 exp->expType = op1->type;
5063 if(op1->type)
5064 op1->type->refCount++;
5065 }
5066 return 1;
5067 }
5068
5069 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
5070 {
5071 exp->type = 2;
5072 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
5073 if(!exp->expType)
5074 {
5075 exp->expType = op1->type;
5076 if(op1->type)
5077 op1->type->refCount++;
5078 }
5079 return 1;
5080 }
5081
5082 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
5083 {
5084 exp->type = 2;
5085 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
5086 if(!exp->expType)
5087 {
5088 exp->expType = op1->type;
5089 if(op1->type)
5090 op1->type->refCount++;
5091 }
5092 return 1;
5093 }
5094
5095 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
5096 {
5097 exp->type = 2;
5098 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
5099 if(!exp->expType)
5100 {
5101 exp->expType = op1->type;
5102 if(op1->type)
5103 op1->type->refCount++;
5104 }
5105 return 1;
5106 }
5107
5108 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
5109 {
5110 exp->type = 2;
5111 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
5112 if(!exp->expType)
5113 {
5114 exp->expType = op1->type;
5115 if(op1->type)
5116 op1->type->refCount++;
5117 }
5118 return 1;
5119 }
5120
5121 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
5122 {
5123 exp->type = 2;
5124 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
5125 if(!exp->expType)
5126 {
5127 exp->expType = op1->type;
5128 if(op1->type)
5129 op1->type->refCount++;
5130 }
5131 return 1;
5132 }
5133
5134 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5135 {
5136 int value2 = op2->__anon1.i;
5137
5138 exp->type = 2;
5139 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
5140 if(!exp->expType)
5141 {
5142 exp->expType = op1->type;
5143 if(op1->type)
5144 op1->type->refCount++;
5145 }
5146 return 1;
5147 }
5148
5149 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5150 {
5151 unsigned int value2 = op2->__anon1.ui;
5152
5153 exp->type = 2;
5154 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
5155 if(!exp->expType)
5156 {
5157 exp->expType = op1->type;
5158 if(op1->type)
5159 op1->type->refCount++;
5160 }
5161 return 1;
5162 }
5163
5164 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5165 {
5166 long long value2 = op2->__anon1.i64;
5167
5168 exp->type = 2;
5169 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
5170 if(!exp->expType)
5171 {
5172 exp->expType = op1->type;
5173 if(op1->type)
5174 op1->type->refCount++;
5175 }
5176 return 1;
5177 }
5178
5179 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5180 {
5181 uint64 value2 = op2->__anon1.ui64;
5182
5183 exp->type = 2;
5184 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
5185 if(!exp->expType)
5186 {
5187 exp->expType = op1->type;
5188 if(op1->type)
5189 op1->type->refCount++;
5190 }
5191 return 1;
5192 }
5193
5194 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5195 {
5196 short value2 = op2->__anon1.s;
5197
5198 exp->type = 2;
5199 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
5200 if(!exp->expType)
5201 {
5202 exp->expType = op1->type;
5203 if(op1->type)
5204 op1->type->refCount++;
5205 }
5206 return 1;
5207 }
5208
5209 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5210 {
5211 unsigned short value2 = op2->__anon1.us;
5212
5213 exp->type = 2;
5214 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
5215 if(!exp->expType)
5216 {
5217 exp->expType = op1->type;
5218 if(op1->type)
5219 op1->type->refCount++;
5220 }
5221 return 1;
5222 }
5223
5224 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5225 {
5226 char value2 = op2->__anon1.c;
5227
5228 exp->type = 2;
5229 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
5230 if(!exp->expType)
5231 {
5232 exp->expType = op1->type;
5233 if(op1->type)
5234 op1->type->refCount++;
5235 }
5236 return 1;
5237 }
5238
5239 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5240 {
5241 unsigned char value2 = op2->__anon1.uc;
5242
5243 exp->type = 2;
5244 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
5245 if(!exp->expType)
5246 {
5247 exp->expType = op1->type;
5248 if(op1->type)
5249 op1->type->refCount++;
5250 }
5251 return 1;
5252 }
5253
5254 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5255 {
5256 int value2 = op2->__anon1.i;
5257
5258 exp->type = 2;
5259 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
5260 if(!exp->expType)
5261 {
5262 exp->expType = op1->type;
5263 if(op1->type)
5264 op1->type->refCount++;
5265 }
5266 return 1;
5267 }
5268
5269 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5270 {
5271 unsigned int value2 = op2->__anon1.ui;
5272
5273 exp->type = 2;
5274 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
5275 if(!exp->expType)
5276 {
5277 exp->expType = op1->type;
5278 if(op1->type)
5279 op1->type->refCount++;
5280 }
5281 return 1;
5282 }
5283
5284 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5285 {
5286 long long value2 = op2->__anon1.i64;
5287
5288 exp->type = 2;
5289 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
5290 if(!exp->expType)
5291 {
5292 exp->expType = op1->type;
5293 if(op1->type)
5294 op1->type->refCount++;
5295 }
5296 return 1;
5297 }
5298
5299 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5300 {
5301 uint64 value2 = op2->__anon1.ui64;
5302
5303 exp->type = 2;
5304 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
5305 if(!exp->expType)
5306 {
5307 exp->expType = op1->type;
5308 if(op1->type)
5309 op1->type->refCount++;
5310 }
5311 return 1;
5312 }
5313
5314 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5315 {
5316 short value2 = op2->__anon1.s;
5317
5318 exp->type = 2;
5319 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
5320 if(!exp->expType)
5321 {
5322 exp->expType = op1->type;
5323 if(op1->type)
5324 op1->type->refCount++;
5325 }
5326 return 1;
5327 }
5328
5329 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5330 {
5331 unsigned short value2 = op2->__anon1.us;
5332
5333 exp->type = 2;
5334 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
5335 if(!exp->expType)
5336 {
5337 exp->expType = op1->type;
5338 if(op1->type)
5339 op1->type->refCount++;
5340 }
5341 return 1;
5342 }
5343
5344 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5345 {
5346 char value2 = op2->__anon1.c;
5347
5348 exp->type = 2;
5349 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
5350 if(!exp->expType)
5351 {
5352 exp->expType = op1->type;
5353 if(op1->type)
5354 op1->type->refCount++;
5355 }
5356 return 1;
5357 }
5358
5359 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5360 {
5361 unsigned char value2 = op2->__anon1.uc;
5362
5363 exp->type = 2;
5364 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
5365 if(!exp->expType)
5366 {
5367 exp->expType = op1->type;
5368 if(op1->type)
5369 op1->type->refCount++;
5370 }
5371 return 1;
5372 }
5373
5374 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5375 {
5376 int value2 = op2->__anon1.i;
5377
5378 exp->type = 2;
5379 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
5380 if(!exp->expType)
5381 {
5382 exp->expType = op1->type;
5383 if(op1->type)
5384 op1->type->refCount++;
5385 }
5386 return 1;
5387 }
5388
5389 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5390 {
5391 unsigned int value2 = op2->__anon1.ui;
5392
5393 exp->type = 2;
5394 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
5395 if(!exp->expType)
5396 {
5397 exp->expType = op1->type;
5398 if(op1->type)
5399 op1->type->refCount++;
5400 }
5401 return 1;
5402 }
5403
5404 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5405 {
5406 long long value2 = op2->__anon1.i64;
5407
5408 exp->type = 2;
5409 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
5410 if(!exp->expType)
5411 {
5412 exp->expType = op1->type;
5413 if(op1->type)
5414 op1->type->refCount++;
5415 }
5416 return 1;
5417 }
5418
5419 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5420 {
5421 uint64 value2 = op2->__anon1.ui64;
5422
5423 exp->type = 2;
5424 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
5425 if(!exp->expType)
5426 {
5427 exp->expType = op1->type;
5428 if(op1->type)
5429 op1->type->refCount++;
5430 }
5431 return 1;
5432 }
5433
5434 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5435 {
5436 short value2 = op2->__anon1.s;
5437
5438 exp->type = 2;
5439 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
5440 if(!exp->expType)
5441 {
5442 exp->expType = op1->type;
5443 if(op1->type)
5444 op1->type->refCount++;
5445 }
5446 return 1;
5447 }
5448
5449 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5450 {
5451 unsigned short value2 = op2->__anon1.us;
5452
5453 exp->type = 2;
5454 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
5455 if(!exp->expType)
5456 {
5457 exp->expType = op1->type;
5458 if(op1->type)
5459 op1->type->refCount++;
5460 }
5461 return 1;
5462 }
5463
5464 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5465 {
5466 char value2 = op2->__anon1.c;
5467
5468 exp->type = 2;
5469 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
5470 if(!exp->expType)
5471 {
5472 exp->expType = op1->type;
5473 if(op1->type)
5474 op1->type->refCount++;
5475 }
5476 return 1;
5477 }
5478
5479 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5480 {
5481 unsigned char value2 = op2->__anon1.uc;
5482
5483 exp->type = 2;
5484 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
5485 if(!exp->expType)
5486 {
5487 exp->expType = op1->type;
5488 if(op1->type)
5489 op1->type->refCount++;
5490 }
5491 return 1;
5492 }
5493
5494 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5495 {
5496 int value2 = op2->__anon1.i;
5497
5498 exp->type = 2;
5499 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
5500 if(!exp->expType)
5501 {
5502 exp->expType = op1->type;
5503 if(op1->type)
5504 op1->type->refCount++;
5505 }
5506 return 1;
5507 }
5508
5509 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5510 {
5511 unsigned int value2 = op2->__anon1.ui;
5512
5513 exp->type = 2;
5514 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
5515 if(!exp->expType)
5516 {
5517 exp->expType = op1->type;
5518 if(op1->type)
5519 op1->type->refCount++;
5520 }
5521 return 1;
5522 }
5523
5524 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5525 {
5526 long long value2 = op2->__anon1.i64;
5527
5528 exp->type = 2;
5529 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
5530 if(!exp->expType)
5531 {
5532 exp->expType = op1->type;
5533 if(op1->type)
5534 op1->type->refCount++;
5535 }
5536 return 1;
5537 }
5538
5539 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5540 {
5541 uint64 value2 = op2->__anon1.ui64;
5542
5543 exp->type = 2;
5544 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
5545 if(!exp->expType)
5546 {
5547 exp->expType = op1->type;
5548 if(op1->type)
5549 op1->type->refCount++;
5550 }
5551 return 1;
5552 }
5553
5554 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5555 {
5556 short value2 = op2->__anon1.s;
5557
5558 exp->type = 2;
5559 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
5560 if(!exp->expType)
5561 {
5562 exp->expType = op1->type;
5563 if(op1->type)
5564 op1->type->refCount++;
5565 }
5566 return 1;
5567 }
5568
5569 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5570 {
5571 unsigned short value2 = op2->__anon1.us;
5572
5573 exp->type = 2;
5574 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
5575 if(!exp->expType)
5576 {
5577 exp->expType = op1->type;
5578 if(op1->type)
5579 op1->type->refCount++;
5580 }
5581 return 1;
5582 }
5583
5584 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5585 {
5586 char value2 = op2->__anon1.c;
5587
5588 exp->type = 2;
5589 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
5590 if(!exp->expType)
5591 {
5592 exp->expType = op1->type;
5593 if(op1->type)
5594 op1->type->refCount++;
5595 }
5596 return 1;
5597 }
5598
5599 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5600 {
5601 unsigned char value2 = op2->__anon1.uc;
5602
5603 exp->type = 2;
5604 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
5605 if(!exp->expType)
5606 {
5607 exp->expType = op1->type;
5608 if(op1->type)
5609 op1->type->refCount++;
5610 }
5611 return 1;
5612 }
5613
5614 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5615 {
5616 int value2 = op2->__anon1.i;
5617
5618 exp->type = 2;
5619 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
5620 if(!exp->expType)
5621 {
5622 exp->expType = op1->type;
5623 if(op1->type)
5624 op1->type->refCount++;
5625 }
5626 return 1;
5627 }
5628
5629 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5630 {
5631 unsigned int value2 = op2->__anon1.ui;
5632
5633 exp->type = 2;
5634 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
5635 if(!exp->expType)
5636 {
5637 exp->expType = op1->type;
5638 if(op1->type)
5639 op1->type->refCount++;
5640 }
5641 return 1;
5642 }
5643
5644 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5645 {
5646 long long value2 = op2->__anon1.i64;
5647
5648 exp->type = 2;
5649 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
5650 if(!exp->expType)
5651 {
5652 exp->expType = op1->type;
5653 if(op1->type)
5654 op1->type->refCount++;
5655 }
5656 return 1;
5657 }
5658
5659 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5660 {
5661 uint64 value2 = op2->__anon1.ui64;
5662
5663 exp->type = 2;
5664 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
5665 if(!exp->expType)
5666 {
5667 exp->expType = op1->type;
5668 if(op1->type)
5669 op1->type->refCount++;
5670 }
5671 return 1;
5672 }
5673
5674 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5675 {
5676 short value2 = op2->__anon1.s;
5677
5678 exp->type = 2;
5679 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
5680 if(!exp->expType)
5681 {
5682 exp->expType = op1->type;
5683 if(op1->type)
5684 op1->type->refCount++;
5685 }
5686 return 1;
5687 }
5688
5689 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5690 {
5691 unsigned short value2 = op2->__anon1.us;
5692
5693 exp->type = 2;
5694 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
5695 if(!exp->expType)
5696 {
5697 exp->expType = op1->type;
5698 if(op1->type)
5699 op1->type->refCount++;
5700 }
5701 return 1;
5702 }
5703
5704 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5705 {
5706 char value2 = op2->__anon1.c;
5707
5708 exp->type = 2;
5709 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
5710 if(!exp->expType)
5711 {
5712 exp->expType = op1->type;
5713 if(op1->type)
5714 op1->type->refCount++;
5715 }
5716 return 1;
5717 }
5718
5719 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5720 {
5721 unsigned char value2 = op2->__anon1.uc;
5722
5723 exp->type = 2;
5724 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
5725 if(!exp->expType)
5726 {
5727 exp->expType = op1->type;
5728 if(op1->type)
5729 op1->type->refCount++;
5730 }
5731 return 1;
5732 }
5733
5734 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
5735 {
5736 exp->type = 2;
5737 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
5738 if(!exp->expType)
5739 {
5740 exp->expType = op1->type;
5741 if(op1->type)
5742 op1->type->refCount++;
5743 }
5744 return 1;
5745 }
5746
5747 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
5748 {
5749 exp->type = 2;
5750 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
5751 if(!exp->expType)
5752 {
5753 exp->expType = op1->type;
5754 if(op1->type)
5755 op1->type->refCount++;
5756 }
5757 return 1;
5758 }
5759
5760 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
5761 {
5762 exp->type = 2;
5763 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
5764 if(!exp->expType)
5765 {
5766 exp->expType = op1->type;
5767 if(op1->type)
5768 op1->type->refCount++;
5769 }
5770 return 1;
5771 }
5772
5773 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
5774 {
5775 exp->type = 2;
5776 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
5777 if(!exp->expType)
5778 {
5779 exp->expType = op1->type;
5780 if(op1->type)
5781 op1->type->refCount++;
5782 }
5783 return 1;
5784 }
5785
5786 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
5787 {
5788 exp->type = 2;
5789 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
5790 if(!exp->expType)
5791 {
5792 exp->expType = op1->type;
5793 if(op1->type)
5794 op1->type->refCount++;
5795 }
5796 return 1;
5797 }
5798
5799 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
5800 {
5801 exp->type = 2;
5802 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
5803 if(!exp->expType)
5804 {
5805 exp->expType = op1->type;
5806 if(op1->type)
5807 op1->type->refCount++;
5808 }
5809 return 1;
5810 }
5811
5812 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
5813 {
5814 exp->type = 2;
5815 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
5816 if(!exp->expType)
5817 {
5818 exp->expType = op1->type;
5819 if(op1->type)
5820 op1->type->refCount++;
5821 }
5822 return 1;
5823 }
5824
5825 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
5826 {
5827 exp->type = 2;
5828 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
5829 if(!exp->expType)
5830 {
5831 exp->expType = op1->type;
5832 if(op1->type)
5833 op1->type->refCount++;
5834 }
5835 return 1;
5836 }
5837
5838 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5839 {
5840 int value2 = op2->__anon1.i;
5841
5842 exp->type = 2;
5843 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
5844 if(!exp->expType)
5845 {
5846 exp->expType = op1->type;
5847 if(op1->type)
5848 op1->type->refCount++;
5849 }
5850 return 1;
5851 }
5852
5853 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5854 {
5855 unsigned int value2 = op2->__anon1.ui;
5856
5857 exp->type = 2;
5858 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
5859 if(!exp->expType)
5860 {
5861 exp->expType = op1->type;
5862 if(op1->type)
5863 op1->type->refCount++;
5864 }
5865 return 1;
5866 }
5867
5868 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5869 {
5870 long long value2 = op2->__anon1.i64;
5871
5872 exp->type = 2;
5873 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
5874 if(!exp->expType)
5875 {
5876 exp->expType = op1->type;
5877 if(op1->type)
5878 op1->type->refCount++;
5879 }
5880 return 1;
5881 }
5882
5883 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5884 {
5885 uint64 value2 = op2->__anon1.ui64;
5886
5887 exp->type = 2;
5888 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
5889 if(!exp->expType)
5890 {
5891 exp->expType = op1->type;
5892 if(op1->type)
5893 op1->type->refCount++;
5894 }
5895 return 1;
5896 }
5897
5898 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5899 {
5900 short value2 = op2->__anon1.s;
5901
5902 exp->type = 2;
5903 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
5904 if(!exp->expType)
5905 {
5906 exp->expType = op1->type;
5907 if(op1->type)
5908 op1->type->refCount++;
5909 }
5910 return 1;
5911 }
5912
5913 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5914 {
5915 unsigned short value2 = op2->__anon1.us;
5916
5917 exp->type = 2;
5918 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
5919 if(!exp->expType)
5920 {
5921 exp->expType = op1->type;
5922 if(op1->type)
5923 op1->type->refCount++;
5924 }
5925 return 1;
5926 }
5927
5928 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5929 {
5930 char value2 = op2->__anon1.c;
5931
5932 exp->type = 2;
5933 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
5934 if(!exp->expType)
5935 {
5936 exp->expType = op1->type;
5937 if(op1->type)
5938 op1->type->refCount++;
5939 }
5940 return 1;
5941 }
5942
5943 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5944 {
5945 unsigned char value2 = op2->__anon1.uc;
5946
5947 exp->type = 2;
5948 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
5949 if(!exp->expType)
5950 {
5951 exp->expType = op1->type;
5952 if(op1->type)
5953 op1->type->refCount++;
5954 }
5955 return 1;
5956 }
5957
5958 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5959 {
5960 float value2 = op2->__anon1.f;
5961
5962 exp->type = 2;
5963 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
5964 if(!exp->expType)
5965 {
5966 exp->expType = op1->type;
5967 if(op1->type)
5968 op1->type->refCount++;
5969 }
5970 return 1;
5971 }
5972
5973 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5974 {
5975 double value2 = op2->__anon1.d;
5976
5977 exp->type = 2;
5978 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
5979 if(!exp->expType)
5980 {
5981 exp->expType = op1->type;
5982 if(op1->type)
5983 op1->type->refCount++;
5984 }
5985 return 1;
5986 }
5987
5988 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5989 {
5990 int value2 = op2->__anon1.i;
5991
5992 exp->type = 2;
5993 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
5994 if(!exp->expType)
5995 {
5996 exp->expType = op1->type;
5997 if(op1->type)
5998 op1->type->refCount++;
5999 }
6000 return 1;
6001 }
6002
6003 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6004 {
6005 unsigned int value2 = op2->__anon1.ui;
6006
6007 exp->type = 2;
6008 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
6009 if(!exp->expType)
6010 {
6011 exp->expType = op1->type;
6012 if(op1->type)
6013 op1->type->refCount++;
6014 }
6015 return 1;
6016 }
6017
6018 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6019 {
6020 long long value2 = op2->__anon1.i64;
6021
6022 exp->type = 2;
6023 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
6024 if(!exp->expType)
6025 {
6026 exp->expType = op1->type;
6027 if(op1->type)
6028 op1->type->refCount++;
6029 }
6030 return 1;
6031 }
6032
6033 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6034 {
6035 uint64 value2 = op2->__anon1.ui64;
6036
6037 exp->type = 2;
6038 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
6039 if(!exp->expType)
6040 {
6041 exp->expType = op1->type;
6042 if(op1->type)
6043 op1->type->refCount++;
6044 }
6045 return 1;
6046 }
6047
6048 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6049 {
6050 short value2 = op2->__anon1.s;
6051
6052 exp->type = 2;
6053 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
6054 if(!exp->expType)
6055 {
6056 exp->expType = op1->type;
6057 if(op1->type)
6058 op1->type->refCount++;
6059 }
6060 return 1;
6061 }
6062
6063 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6064 {
6065 unsigned short value2 = op2->__anon1.us;
6066
6067 exp->type = 2;
6068 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
6069 if(!exp->expType)
6070 {
6071 exp->expType = op1->type;
6072 if(op1->type)
6073 op1->type->refCount++;
6074 }
6075 return 1;
6076 }
6077
6078 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6079 {
6080 char value2 = op2->__anon1.c;
6081
6082 exp->type = 2;
6083 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
6084 if(!exp->expType)
6085 {
6086 exp->expType = op1->type;
6087 if(op1->type)
6088 op1->type->refCount++;
6089 }
6090 return 1;
6091 }
6092
6093 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6094 {
6095 unsigned char value2 = op2->__anon1.uc;
6096
6097 exp->type = 2;
6098 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
6099 if(!exp->expType)
6100 {
6101 exp->expType = op1->type;
6102 if(op1->type)
6103 op1->type->refCount++;
6104 }
6105 return 1;
6106 }
6107
6108 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6109 {
6110 float value2 = op2->__anon1.f;
6111
6112 exp->type = 2;
6113 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
6114 if(!exp->expType)
6115 {
6116 exp->expType = op1->type;
6117 if(op1->type)
6118 op1->type->refCount++;
6119 }
6120 return 1;
6121 }
6122
6123 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6124 {
6125 double value2 = op2->__anon1.d;
6126
6127 exp->type = 2;
6128 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
6129 if(!exp->expType)
6130 {
6131 exp->expType = op1->type;
6132 if(op1->type)
6133 op1->type->refCount++;
6134 }
6135 return 1;
6136 }
6137
6138 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6139 {
6140 int value2 = op2->__anon1.i;
6141
6142 exp->type = 2;
6143 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
6144 if(!exp->expType)
6145 {
6146 exp->expType = op1->type;
6147 if(op1->type)
6148 op1->type->refCount++;
6149 }
6150 return 1;
6151 }
6152
6153 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6154 {
6155 unsigned int value2 = op2->__anon1.ui;
6156
6157 exp->type = 2;
6158 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
6159 if(!exp->expType)
6160 {
6161 exp->expType = op1->type;
6162 if(op1->type)
6163 op1->type->refCount++;
6164 }
6165 return 1;
6166 }
6167
6168 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6169 {
6170 long long value2 = op2->__anon1.i64;
6171
6172 exp->type = 2;
6173 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
6174 if(!exp->expType)
6175 {
6176 exp->expType = op1->type;
6177 if(op1->type)
6178 op1->type->refCount++;
6179 }
6180 return 1;
6181 }
6182
6183 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6184 {
6185 uint64 value2 = op2->__anon1.ui64;
6186
6187 exp->type = 2;
6188 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
6189 if(!exp->expType)
6190 {
6191 exp->expType = op1->type;
6192 if(op1->type)
6193 op1->type->refCount++;
6194 }
6195 return 1;
6196 }
6197
6198 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6199 {
6200 short value2 = op2->__anon1.s;
6201
6202 exp->type = 2;
6203 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
6204 if(!exp->expType)
6205 {
6206 exp->expType = op1->type;
6207 if(op1->type)
6208 op1->type->refCount++;
6209 }
6210 return 1;
6211 }
6212
6213 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6214 {
6215 unsigned short value2 = op2->__anon1.us;
6216
6217 exp->type = 2;
6218 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
6219 if(!exp->expType)
6220 {
6221 exp->expType = op1->type;
6222 if(op1->type)
6223 op1->type->refCount++;
6224 }
6225 return 1;
6226 }
6227
6228 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6229 {
6230 char value2 = op2->__anon1.c;
6231
6232 exp->type = 2;
6233 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
6234 if(!exp->expType)
6235 {
6236 exp->expType = op1->type;
6237 if(op1->type)
6238 op1->type->refCount++;
6239 }
6240 return 1;
6241 }
6242
6243 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6244 {
6245 unsigned char value2 = op2->__anon1.uc;
6246
6247 exp->type = 2;
6248 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
6249 if(!exp->expType)
6250 {
6251 exp->expType = op1->type;
6252 if(op1->type)
6253 op1->type->refCount++;
6254 }
6255 return 1;
6256 }
6257
6258 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6259 {
6260 float value2 = op2->__anon1.f;
6261
6262 exp->type = 2;
6263 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
6264 if(!exp->expType)
6265 {
6266 exp->expType = op1->type;
6267 if(op1->type)
6268 op1->type->refCount++;
6269 }
6270 return 1;
6271 }
6272
6273 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6274 {
6275 double value2 = op2->__anon1.d;
6276
6277 exp->type = 2;
6278 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
6279 if(!exp->expType)
6280 {
6281 exp->expType = op1->type;
6282 if(op1->type)
6283 op1->type->refCount++;
6284 }
6285 return 1;
6286 }
6287
6288 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6289 {
6290 int value2 = op2->__anon1.i;
6291
6292 exp->type = 2;
6293 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
6294 if(!exp->expType)
6295 {
6296 exp->expType = op1->type;
6297 if(op1->type)
6298 op1->type->refCount++;
6299 }
6300 return 1;
6301 }
6302
6303 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6304 {
6305 unsigned int value2 = op2->__anon1.ui;
6306
6307 exp->type = 2;
6308 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
6309 if(!exp->expType)
6310 {
6311 exp->expType = op1->type;
6312 if(op1->type)
6313 op1->type->refCount++;
6314 }
6315 return 1;
6316 }
6317
6318 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6319 {
6320 long long value2 = op2->__anon1.i64;
6321
6322 exp->type = 2;
6323 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
6324 if(!exp->expType)
6325 {
6326 exp->expType = op1->type;
6327 if(op1->type)
6328 op1->type->refCount++;
6329 }
6330 return 1;
6331 }
6332
6333 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6334 {
6335 uint64 value2 = op2->__anon1.ui64;
6336
6337 exp->type = 2;
6338 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
6339 if(!exp->expType)
6340 {
6341 exp->expType = op1->type;
6342 if(op1->type)
6343 op1->type->refCount++;
6344 }
6345 return 1;
6346 }
6347
6348 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6349 {
6350 short value2 = op2->__anon1.s;
6351
6352 exp->type = 2;
6353 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
6354 if(!exp->expType)
6355 {
6356 exp->expType = op1->type;
6357 if(op1->type)
6358 op1->type->refCount++;
6359 }
6360 return 1;
6361 }
6362
6363 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6364 {
6365 unsigned short value2 = op2->__anon1.us;
6366
6367 exp->type = 2;
6368 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
6369 if(!exp->expType)
6370 {
6371 exp->expType = op1->type;
6372 if(op1->type)
6373 op1->type->refCount++;
6374 }
6375 return 1;
6376 }
6377
6378 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6379 {
6380 char value2 = op2->__anon1.c;
6381
6382 exp->type = 2;
6383 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
6384 if(!exp->expType)
6385 {
6386 exp->expType = op1->type;
6387 if(op1->type)
6388 op1->type->refCount++;
6389 }
6390 return 1;
6391 }
6392
6393 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6394 {
6395 unsigned char value2 = op2->__anon1.uc;
6396
6397 exp->type = 2;
6398 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
6399 if(!exp->expType)
6400 {
6401 exp->expType = op1->type;
6402 if(op1->type)
6403 op1->type->refCount++;
6404 }
6405 return 1;
6406 }
6407
6408 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6409 {
6410 float value2 = op2->__anon1.f;
6411
6412 exp->type = 2;
6413 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
6414 if(!exp->expType)
6415 {
6416 exp->expType = op1->type;
6417 if(op1->type)
6418 op1->type->refCount++;
6419 }
6420 return 1;
6421 }
6422
6423 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6424 {
6425 double value2 = op2->__anon1.d;
6426
6427 exp->type = 2;
6428 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
6429 if(!exp->expType)
6430 {
6431 exp->expType = op1->type;
6432 if(op1->type)
6433 op1->type->refCount++;
6434 }
6435 return 1;
6436 }
6437
6438 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6439 {
6440 int value2 = op2->__anon1.i;
6441
6442 exp->type = 2;
6443 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
6444 if(!exp->expType)
6445 {
6446 exp->expType = op1->type;
6447 if(op1->type)
6448 op1->type->refCount++;
6449 }
6450 return 1;
6451 }
6452
6453 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6454 {
6455 unsigned int value2 = op2->__anon1.ui;
6456
6457 exp->type = 2;
6458 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
6459 if(!exp->expType)
6460 {
6461 exp->expType = op1->type;
6462 if(op1->type)
6463 op1->type->refCount++;
6464 }
6465 return 1;
6466 }
6467
6468 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6469 {
6470 long long value2 = op2->__anon1.i64;
6471
6472 exp->type = 2;
6473 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
6474 if(!exp->expType)
6475 {
6476 exp->expType = op1->type;
6477 if(op1->type)
6478 op1->type->refCount++;
6479 }
6480 return 1;
6481 }
6482
6483 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6484 {
6485 uint64 value2 = op2->__anon1.ui64;
6486
6487 exp->type = 2;
6488 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
6489 if(!exp->expType)
6490 {
6491 exp->expType = op1->type;
6492 if(op1->type)
6493 op1->type->refCount++;
6494 }
6495 return 1;
6496 }
6497
6498 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6499 {
6500 short value2 = op2->__anon1.s;
6501
6502 exp->type = 2;
6503 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
6504 if(!exp->expType)
6505 {
6506 exp->expType = op1->type;
6507 if(op1->type)
6508 op1->type->refCount++;
6509 }
6510 return 1;
6511 }
6512
6513 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6514 {
6515 unsigned short value2 = op2->__anon1.us;
6516
6517 exp->type = 2;
6518 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
6519 if(!exp->expType)
6520 {
6521 exp->expType = op1->type;
6522 if(op1->type)
6523 op1->type->refCount++;
6524 }
6525 return 1;
6526 }
6527
6528 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6529 {
6530 char value2 = op2->__anon1.c;
6531
6532 exp->type = 2;
6533 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
6534 if(!exp->expType)
6535 {
6536 exp->expType = op1->type;
6537 if(op1->type)
6538 op1->type->refCount++;
6539 }
6540 return 1;
6541 }
6542
6543 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6544 {
6545 unsigned char value2 = op2->__anon1.uc;
6546
6547 exp->type = 2;
6548 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
6549 if(!exp->expType)
6550 {
6551 exp->expType = op1->type;
6552 if(op1->type)
6553 op1->type->refCount++;
6554 }
6555 return 1;
6556 }
6557
6558 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6559 {
6560 float value2 = op2->__anon1.f;
6561
6562 exp->type = 2;
6563 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
6564 if(!exp->expType)
6565 {
6566 exp->expType = op1->type;
6567 if(op1->type)
6568 op1->type->refCount++;
6569 }
6570 return 1;
6571 }
6572
6573 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6574 {
6575 double value2 = op2->__anon1.d;
6576
6577 exp->type = 2;
6578 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
6579 if(!exp->expType)
6580 {
6581 exp->expType = op1->type;
6582 if(op1->type)
6583 op1->type->refCount++;
6584 }
6585 return 1;
6586 }
6587
6588 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6589 {
6590 int value2 = op2->__anon1.i;
6591
6592 exp->type = 2;
6593 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
6594 if(!exp->expType)
6595 {
6596 exp->expType = op1->type;
6597 if(op1->type)
6598 op1->type->refCount++;
6599 }
6600 return 1;
6601 }
6602
6603 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6604 {
6605 unsigned int value2 = op2->__anon1.ui;
6606
6607 exp->type = 2;
6608 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
6609 if(!exp->expType)
6610 {
6611 exp->expType = op1->type;
6612 if(op1->type)
6613 op1->type->refCount++;
6614 }
6615 return 1;
6616 }
6617
6618 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6619 {
6620 long long value2 = op2->__anon1.i64;
6621
6622 exp->type = 2;
6623 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
6624 if(!exp->expType)
6625 {
6626 exp->expType = op1->type;
6627 if(op1->type)
6628 op1->type->refCount++;
6629 }
6630 return 1;
6631 }
6632
6633 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6634 {
6635 uint64 value2 = op2->__anon1.ui64;
6636
6637 exp->type = 2;
6638 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
6639 if(!exp->expType)
6640 {
6641 exp->expType = op1->type;
6642 if(op1->type)
6643 op1->type->refCount++;
6644 }
6645 return 1;
6646 }
6647
6648 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6649 {
6650 short value2 = op2->__anon1.s;
6651
6652 exp->type = 2;
6653 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
6654 if(!exp->expType)
6655 {
6656 exp->expType = op1->type;
6657 if(op1->type)
6658 op1->type->refCount++;
6659 }
6660 return 1;
6661 }
6662
6663 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6664 {
6665 unsigned short value2 = op2->__anon1.us;
6666
6667 exp->type = 2;
6668 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
6669 if(!exp->expType)
6670 {
6671 exp->expType = op1->type;
6672 if(op1->type)
6673 op1->type->refCount++;
6674 }
6675 return 1;
6676 }
6677
6678 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6679 {
6680 char value2 = op2->__anon1.c;
6681
6682 exp->type = 2;
6683 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
6684 if(!exp->expType)
6685 {
6686 exp->expType = op1->type;
6687 if(op1->type)
6688 op1->type->refCount++;
6689 }
6690 return 1;
6691 }
6692
6693 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6694 {
6695 unsigned char value2 = op2->__anon1.uc;
6696
6697 exp->type = 2;
6698 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
6699 if(!exp->expType)
6700 {
6701 exp->expType = op1->type;
6702 if(op1->type)
6703 op1->type->refCount++;
6704 }
6705 return 1;
6706 }
6707
6708 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6709 {
6710 float value2 = op2->__anon1.f;
6711
6712 exp->type = 2;
6713 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
6714 if(!exp->expType)
6715 {
6716 exp->expType = op1->type;
6717 if(op1->type)
6718 op1->type->refCount++;
6719 }
6720 return 1;
6721 }
6722
6723 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6724 {
6725 double value2 = op2->__anon1.d;
6726
6727 exp->type = 2;
6728 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
6729 if(!exp->expType)
6730 {
6731 exp->expType = op1->type;
6732 if(op1->type)
6733 op1->type->refCount++;
6734 }
6735 return 1;
6736 }
6737
6738 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6739 {
6740 int value2 = op2->__anon1.i;
6741
6742 exp->type = 2;
6743 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
6744 if(!exp->expType)
6745 {
6746 exp->expType = op1->type;
6747 if(op1->type)
6748 op1->type->refCount++;
6749 }
6750 return 1;
6751 }
6752
6753 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6754 {
6755 unsigned int value2 = op2->__anon1.ui;
6756
6757 exp->type = 2;
6758 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
6759 if(!exp->expType)
6760 {
6761 exp->expType = op1->type;
6762 if(op1->type)
6763 op1->type->refCount++;
6764 }
6765 return 1;
6766 }
6767
6768 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6769 {
6770 long long value2 = op2->__anon1.i64;
6771
6772 exp->type = 2;
6773 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
6774 if(!exp->expType)
6775 {
6776 exp->expType = op1->type;
6777 if(op1->type)
6778 op1->type->refCount++;
6779 }
6780 return 1;
6781 }
6782
6783 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6784 {
6785 uint64 value2 = op2->__anon1.ui64;
6786
6787 exp->type = 2;
6788 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
6789 if(!exp->expType)
6790 {
6791 exp->expType = op1->type;
6792 if(op1->type)
6793 op1->type->refCount++;
6794 }
6795 return 1;
6796 }
6797
6798 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6799 {
6800 short value2 = op2->__anon1.s;
6801
6802 exp->type = 2;
6803 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
6804 if(!exp->expType)
6805 {
6806 exp->expType = op1->type;
6807 if(op1->type)
6808 op1->type->refCount++;
6809 }
6810 return 1;
6811 }
6812
6813 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6814 {
6815 unsigned short value2 = op2->__anon1.us;
6816
6817 exp->type = 2;
6818 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
6819 if(!exp->expType)
6820 {
6821 exp->expType = op1->type;
6822 if(op1->type)
6823 op1->type->refCount++;
6824 }
6825 return 1;
6826 }
6827
6828 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6829 {
6830 char value2 = op2->__anon1.c;
6831
6832 exp->type = 2;
6833 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
6834 if(!exp->expType)
6835 {
6836 exp->expType = op1->type;
6837 if(op1->type)
6838 op1->type->refCount++;
6839 }
6840 return 1;
6841 }
6842
6843 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6844 {
6845 unsigned char value2 = op2->__anon1.uc;
6846
6847 exp->type = 2;
6848 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
6849 if(!exp->expType)
6850 {
6851 exp->expType = op1->type;
6852 if(op1->type)
6853 op1->type->refCount++;
6854 }
6855 return 1;
6856 }
6857
6858 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6859 {
6860 float value2 = op2->__anon1.f;
6861
6862 exp->type = 2;
6863 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
6864 if(!exp->expType)
6865 {
6866 exp->expType = op1->type;
6867 if(op1->type)
6868 op1->type->refCount++;
6869 }
6870 return 1;
6871 }
6872
6873 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6874 {
6875 double value2 = op2->__anon1.d;
6876
6877 exp->type = 2;
6878 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
6879 if(!exp->expType)
6880 {
6881 exp->expType = op1->type;
6882 if(op1->type)
6883 op1->type->refCount++;
6884 }
6885 return 1;
6886 }
6887
6888 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6889 {
6890 int value2 = op2->__anon1.i;
6891
6892 exp->type = 2;
6893 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
6894 if(!exp->expType)
6895 {
6896 exp->expType = op1->type;
6897 if(op1->type)
6898 op1->type->refCount++;
6899 }
6900 return 1;
6901 }
6902
6903 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6904 {
6905 unsigned int value2 = op2->__anon1.ui;
6906
6907 exp->type = 2;
6908 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
6909 if(!exp->expType)
6910 {
6911 exp->expType = op1->type;
6912 if(op1->type)
6913 op1->type->refCount++;
6914 }
6915 return 1;
6916 }
6917
6918 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6919 {
6920 long long value2 = op2->__anon1.i64;
6921
6922 exp->type = 2;
6923 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
6924 if(!exp->expType)
6925 {
6926 exp->expType = op1->type;
6927 if(op1->type)
6928 op1->type->refCount++;
6929 }
6930 return 1;
6931 }
6932
6933 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6934 {
6935 uint64 value2 = op2->__anon1.ui64;
6936
6937 exp->type = 2;
6938 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
6939 if(!exp->expType)
6940 {
6941 exp->expType = op1->type;
6942 if(op1->type)
6943 op1->type->refCount++;
6944 }
6945 return 1;
6946 }
6947
6948 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6949 {
6950 short value2 = op2->__anon1.s;
6951
6952 exp->type = 2;
6953 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
6954 if(!exp->expType)
6955 {
6956 exp->expType = op1->type;
6957 if(op1->type)
6958 op1->type->refCount++;
6959 }
6960 return 1;
6961 }
6962
6963 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6964 {
6965 unsigned short value2 = op2->__anon1.us;
6966
6967 exp->type = 2;
6968 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
6969 if(!exp->expType)
6970 {
6971 exp->expType = op1->type;
6972 if(op1->type)
6973 op1->type->refCount++;
6974 }
6975 return 1;
6976 }
6977
6978 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6979 {
6980 char value2 = op2->__anon1.c;
6981
6982 exp->type = 2;
6983 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
6984 if(!exp->expType)
6985 {
6986 exp->expType = op1->type;
6987 if(op1->type)
6988 op1->type->refCount++;
6989 }
6990 return 1;
6991 }
6992
6993 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6994 {
6995 unsigned char value2 = op2->__anon1.uc;
6996
6997 exp->type = 2;
6998 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
6999 if(!exp->expType)
7000 {
7001 exp->expType = op1->type;
7002 if(op1->type)
7003 op1->type->refCount++;
7004 }
7005 return 1;
7006 }
7007
7008 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7009 {
7010 float value2 = op2->__anon1.f;
7011
7012 exp->type = 2;
7013 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
7014 if(!exp->expType)
7015 {
7016 exp->expType = op1->type;
7017 if(op1->type)
7018 op1->type->refCount++;
7019 }
7020 return 1;
7021 }
7022
7023 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7024 {
7025 double value2 = op2->__anon1.d;
7026
7027 exp->type = 2;
7028 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
7029 if(!exp->expType)
7030 {
7031 exp->expType = op1->type;
7032 if(op1->type)
7033 op1->type->refCount++;
7034 }
7035 return 1;
7036 }
7037
7038 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7039 {
7040 exp->type = 2;
7041 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
7042 if(!exp->expType)
7043 {
7044 exp->expType = op1->type;
7045 if(op1->type)
7046 op1->type->refCount++;
7047 }
7048 return 1;
7049 }
7050
7051 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7052 {
7053 exp->type = 2;
7054 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
7055 if(!exp->expType)
7056 {
7057 exp->expType = op1->type;
7058 if(op1->type)
7059 op1->type->refCount++;
7060 }
7061 return 1;
7062 }
7063
7064 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7065 {
7066 exp->type = 2;
7067 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
7068 if(!exp->expType)
7069 {
7070 exp->expType = op1->type;
7071 if(op1->type)
7072 op1->type->refCount++;
7073 }
7074 return 1;
7075 }
7076
7077 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7078 {
7079 exp->type = 2;
7080 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
7081 if(!exp->expType)
7082 {
7083 exp->expType = op1->type;
7084 if(op1->type)
7085 op1->type->refCount++;
7086 }
7087 return 1;
7088 }
7089
7090 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7091 {
7092 exp->type = 2;
7093 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
7094 if(!exp->expType)
7095 {
7096 exp->expType = op1->type;
7097 if(op1->type)
7098 op1->type->refCount++;
7099 }
7100 return 1;
7101 }
7102
7103 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7104 {
7105 exp->type = 2;
7106 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
7107 if(!exp->expType)
7108 {
7109 exp->expType = op1->type;
7110 if(op1->type)
7111 op1->type->refCount++;
7112 }
7113 return 1;
7114 }
7115
7116 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7117 {
7118 exp->type = 2;
7119 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
7120 if(!exp->expType)
7121 {
7122 exp->expType = op1->type;
7123 if(op1->type)
7124 op1->type->refCount++;
7125 }
7126 return 1;
7127 }
7128
7129 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7130 {
7131 exp->type = 2;
7132 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
7133 if(!exp->expType)
7134 {
7135 exp->expType = op1->type;
7136 if(op1->type)
7137 op1->type->refCount++;
7138 }
7139 return 1;
7140 }
7141
7142 static void PrintName(struct Type * type, char * string, unsigned int fullName)
7143 {
7144 if(type->name && type->name[0])
7145 {
7146 if(fullName)
7147 strcat(string, type->name);
7148 else
7149 {
7150 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
7151
7152 if(name)
7153 name += 2;
7154 else
7155 name = type->name;
7156 strcat(string, name);
7157 }
7158 }
7159 }
7160
7161 static void PrintAttribs(struct Type * type, char * string)
7162 {
7163 if(type)
7164 {
7165 if(type->dllExport)
7166 strcat(string, "dllexport ");
7167 if(type->attrStdcall)
7168 strcat(string, "stdcall ");
7169 }
7170 }
7171
7172 static struct Type * FindMember(struct Type * type, char * string)
7173 {
7174 struct Type * memberType;
7175
7176 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7177 {
7178 if(!memberType->name)
7179 {
7180 struct Type * subType = FindMember(memberType, string);
7181
7182 if(subType)
7183 return subType;
7184 }
7185 else if(!strcmp(memberType->name, string))
7186 return memberType;
7187 }
7188 return (((void *)0));
7189 }
7190
7191 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
7192
7193 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
7194
7195 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
7196 {
7197 unsigned int result = 0;
7198
7199 switch(kind)
7200 {
7201 case 2:
7202 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
7203 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
7204 break;
7205 case 3:
7206 case 5:
7207 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
7208 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7209 break;
7210 case 4:
7211 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)
7212 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7213 break;
7214 case 6:
7215 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)
7216 result = GetOpFloat(op, &op->__anon1.f);
7217 break;
7218 case 7:
7219 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)
7220 result = GetOpDouble(op, &op->__anon1.d);
7221 break;
7222 case 13:
7223 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)
7224 result = GetOpUInt64(op, &op->__anon1.ui64);
7225 break;
7226 case 15:
7227 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
7228 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7229 break;
7230 case 22:
7231 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7232 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7233 break;
7234 case 23:
7235 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7236 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7237 break;
7238 }
7239 return result;
7240 }
7241
7242 struct OpTable floatOps =
7243 {
7244 (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)
7245 };
7246
7247 struct OpTable doubleOps =
7248 {
7249 (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)
7250 };
7251
7252 struct OpTable intOps =
7253 {
7254 (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)
7255 };
7256
7257 struct OpTable uintOps =
7258 {
7259 (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)
7260 };
7261
7262 struct OpTable int64Ops =
7263 {
7264 (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)
7265 };
7266
7267 struct OpTable uint64Ops =
7268 {
7269 (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)
7270 };
7271
7272 struct OpTable shortOps =
7273 {
7274 (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)
7275 };
7276
7277 struct OpTable ushortOps =
7278 {
7279 (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)
7280 };
7281
7282 struct OpTable charOps =
7283 {
7284 (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)
7285 };
7286
7287 struct OpTable ucharOps =
7288 {
7289 (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)
7290 };
7291
7292 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
7293 {
7294 struct Type * memberType;
7295
7296 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7297 {
7298 if(!memberType->name)
7299 {
7300 struct Type * subType = FindMember(memberType, string);
7301
7302 if(subType)
7303 {
7304 *offset += memberType->offset;
7305 return subType;
7306 }
7307 }
7308 else if(!strcmp(memberType->name, string))
7309 {
7310 *offset += memberType->offset;
7311 return memberType;
7312 }
7313 }
7314 return (((void *)0));
7315 }
7316
7317 struct __ecereNameSpace__ecere__com__Module;
7318
7319 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);
7320
7321 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
7322
7323 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);
7324
7325 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);
7326
7327 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
7328
7329 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7330
7331 struct GlobalData
7332 {
7333 uintptr_t key;
7334 struct __ecereNameSpace__ecere__sys__BTNode * parent;
7335 struct __ecereNameSpace__ecere__sys__BTNode * left;
7336 struct __ecereNameSpace__ecere__sys__BTNode * right;
7337 int depth;
7338 struct __ecereNameSpace__ecere__com__Instance * module;
7339 char *  dataTypeString;
7340 struct Type * dataType;
7341 void *  symbol;
7342 char *  fullName;
7343 } __attribute__ ((gcc_struct));
7344
7345 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);
7346
7347 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
7348
7349 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);
7350
7351 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
7352
7353 struct __ecereNameSpace__ecere__com__DefinedExpression;
7354
7355 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7356
7357 struct __ecereNameSpace__ecere__com__DefinedExpression
7358 {
7359 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
7360 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
7361 const char *  name;
7362 const char *  value;
7363 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7364 } __attribute__ ((gcc_struct));
7365
7366 struct __ecereNameSpace__ecere__sys__BinaryTree;
7367
7368 struct __ecereNameSpace__ecere__sys__BinaryTree
7369 {
7370 struct __ecereNameSpace__ecere__sys__BTNode * root;
7371 int count;
7372 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
7373 void (*  FreeKey)(void *  key);
7374 } __attribute__ ((gcc_struct));
7375
7376 struct __ecereNameSpace__ecere__com__Class
7377 {
7378 struct __ecereNameSpace__ecere__com__Class * prev;
7379 struct __ecereNameSpace__ecere__com__Class * next;
7380 const char *  name;
7381 int offset;
7382 int structSize;
7383 void * *  _vTbl;
7384 int vTblSize;
7385 unsigned int (*  Constructor)(void * );
7386 void (*  Destructor)(void * );
7387 int offsetClass;
7388 int sizeClass;
7389 struct __ecereNameSpace__ecere__com__Class * base;
7390 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
7391 struct __ecereNameSpace__ecere__sys__BinaryTree members;
7392 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
7393 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
7394 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
7395 struct __ecereNameSpace__ecere__sys__OldList derivatives;
7396 int memberID;
7397 int startMemberID;
7398 int type;
7399 struct __ecereNameSpace__ecere__com__Instance * module;
7400 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7401 const char *  dataTypeString;
7402 struct Type * dataType;
7403 int typeSize;
7404 int defaultAlignment;
7405 void (*  Initialize)();
7406 int memberOffset;
7407 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
7408 const char *  designerClass;
7409 unsigned int noExpansion;
7410 const char *  defaultProperty;
7411 unsigned int comRedefinition;
7412 int count;
7413 int isRemote;
7414 unsigned int internalDecl;
7415 void *  data;
7416 unsigned int computeSize;
7417 short structAlignment;
7418 short pointerAlignment;
7419 int destructionWatchOffset;
7420 unsigned int fixed;
7421 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
7422 int inheritanceAccess;
7423 const char *  fullName;
7424 void *  symbol;
7425 struct __ecereNameSpace__ecere__sys__OldList conversions;
7426 struct __ecereNameSpace__ecere__sys__OldList templateParams;
7427 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
7428 struct __ecereNameSpace__ecere__com__Class * templateClass;
7429 struct __ecereNameSpace__ecere__sys__OldList templatized;
7430 int numParams;
7431 unsigned int isInstanceClass;
7432 unsigned int byValueSystemClass;
7433 } __attribute__ ((gcc_struct));
7434
7435 struct __ecereNameSpace__ecere__com__NameSpace
7436 {
7437 const char *  name;
7438 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
7439 struct __ecereNameSpace__ecere__com__NameSpace *  left;
7440 struct __ecereNameSpace__ecere__com__NameSpace *  right;
7441 int depth;
7442 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
7443 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
7444 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
7445 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
7446 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
7447 } __attribute__ ((gcc_struct));
7448
7449 struct __ecereNameSpace__ecere__com__DataMember
7450 {
7451 struct __ecereNameSpace__ecere__com__DataMember * prev;
7452 struct __ecereNameSpace__ecere__com__DataMember * next;
7453 const char *  name;
7454 unsigned int isProperty;
7455 int memberAccess;
7456 int id;
7457 struct __ecereNameSpace__ecere__com__Class * _class;
7458 const char *  dataTypeString;
7459 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
7460 struct Type * dataType;
7461 int type;
7462 int offset;
7463 int memberID;
7464 struct __ecereNameSpace__ecere__sys__OldList members;
7465 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
7466 int memberOffset;
7467 short structAlignment;
7468 short pointerAlignment;
7469 } __attribute__ ((gcc_struct));
7470
7471 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7472
7473 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7474
7475 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
7476
7477 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7478
7479 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7480
7481 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
7482
7483 static void _DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl)
7484 {
7485 if(inCompiler)
7486 {
7487 if(type->kind == 11)
7488 {
7489 struct Type * param;
7490
7491 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
7492 _DeclareType(neededFor, param, forFunctionDef, 0, fwdDecl);
7493 _DeclareType(neededFor, type->__anon1.__anon2.returnType, forFunctionDef, 0, fwdDecl);
7494 }
7495 else if(type->kind == 13)
7496 _DeclareType(neededFor, type->__anon1.type, 0, 0, fwdDecl);
7497 else if(type->kind == 8)
7498 {
7499 struct __ecereNameSpace__ecere__com__Class * c = type->__anon1._class->__anon1.registered;
7500
7501 _DeclareStruct(neededFor, c ? c->fullName : "ecere::com::Instance", c ? c->type == 5 : 0, needDereference && c && c->type == 1, fwdDecl);
7502 }
7503 else if(type->kind == 9 || type->kind == 10)
7504 {
7505 struct Type * member;
7506
7507 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7508 _DeclareType(neededFor, member, needDereference, forFunctionDef, fwdDecl);
7509 }
7510 else if(type->kind == 12)
7511 _DeclareType(neededFor, type->__anon1.__anon4.arrayType, 1, 0, fwdDecl);
7512 }
7513 }
7514
7515 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
7516 {
7517 unsigned int status = 1;
7518
7519 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))
7520 {
7521 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
7522 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
7523
7524 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
7525 {
7526 struct Type * sourceType = source, * destType = dest;
7527
7528 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
7529 sourceType = sourceType->__anon1.type;
7530 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
7531 destType = destType->__anon1.type;
7532 if(!destType->constant && sourceType->constant)
7533 {
7534 status = 0;
7535 if(warn)
7536 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
7537 }
7538 }
7539 }
7540 return status;
7541 }
7542
7543 struct Operand GetOperand(struct Expression * exp)
7544 {
7545 struct Operand op =
7546 {
7547 0, 0, 0,
7548 .__anon1 = {
7549 .c = 0
7550 },
7551 {
7552 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7553 }
7554 };
7555 struct Type * type = exp->expType;
7556
7557 if(type)
7558 {
7559 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))
7560 {
7561 if(!type->__anon1._class->__anon1.registered->dataType)
7562 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7563 type = type->__anon1._class->__anon1.registered->dataType;
7564 }
7565 if(exp->type == 3 && op.kind == 13)
7566 {
7567 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
7568 op.kind = 13;
7569 op.ops = uint64Ops;
7570 }
7571 else if(exp->isConstant && exp->type == 2)
7572 {
7573 op.kind = type->kind;
7574 op.type = type;
7575 switch(op.kind)
7576 {
7577 case 24:
7578 case 1:
7579 {
7580 if(exp->__anon1.__anon1.constant[0] == '\'')
7581 {
7582 op.__anon1.c = exp->__anon1.__anon1.constant[1];
7583 op.ops = charOps;
7584 }
7585 else if(type->isSigned)
7586 {
7587 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7588 op.ops = charOps;
7589 }
7590 else
7591 {
7592 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7593 op.ops = ucharOps;
7594 }
7595 break;
7596 }
7597 case 2:
7598 if(type->isSigned)
7599 {
7600 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7601 op.ops = shortOps;
7602 }
7603 else
7604 {
7605 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7606 op.ops = ushortOps;
7607 }
7608 break;
7609 case 3:
7610 case 5:
7611 if(type->isSigned)
7612 {
7613 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7614 op.ops = intOps;
7615 }
7616 else
7617 {
7618 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7619 op.ops = uintOps;
7620 }
7621 op.kind = 3;
7622 break;
7623 case 4:
7624 if(type->isSigned)
7625 {
7626 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7627 op.ops = int64Ops;
7628 }
7629 else
7630 {
7631 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7632 op.ops = uint64Ops;
7633 }
7634 op.kind = 4;
7635 break;
7636 case 22:
7637 if(type->isSigned)
7638 {
7639 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7640 op.ops = int64Ops;
7641 }
7642 else
7643 {
7644 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7645 op.ops = uint64Ops;
7646 }
7647 op.kind = 4;
7648 break;
7649 case 23:
7650 if(type->isSigned)
7651 {
7652 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7653 op.ops = int64Ops;
7654 }
7655 else
7656 {
7657 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7658 op.ops = uint64Ops;
7659 }
7660 op.kind = 4;
7661 break;
7662 case 6:
7663 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7664 op.__anon1.f = __ecereMethod_float_inf();
7665 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7666 op.__anon1.f = -__ecereMethod_float_inf();
7667 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7668 op.__anon1.f = __ecereMethod_float_nan();
7669 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7670 op.__anon1.f = -__ecereMethod_float_nan();
7671 else
7672 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7673 op.ops = floatOps;
7674 break;
7675 case 7:
7676 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7677 op.__anon1.d = __ecereMethod_double_inf();
7678 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7679 op.__anon1.d = -__ecereMethod_double_inf();
7680 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7681 op.__anon1.d = __ecereMethod_double_nan();
7682 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7683 op.__anon1.d = -__ecereMethod_double_nan();
7684 else
7685 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7686 op.ops = doubleOps;
7687 break;
7688 case 12:
7689 case 13:
7690 case 8:
7691 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7692 op.kind = 13;
7693 op.ops = uint64Ops;
7694 break;
7695 }
7696 }
7697 }
7698 return op;
7699 }
7700
7701 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
7702 {
7703 long long v = 0;
7704
7705 switch(_class->typeSize)
7706 {
7707 case 8:
7708 if(!strcmp(_class->dataTypeString, "uint64"))
7709 v = (long long)*(uint64 *)ptr;
7710 else
7711 v = *(long long *)ptr;
7712 break;
7713 case 4:
7714 if(!strcmp(_class->dataTypeString, "uint"))
7715 v = (long long)*(unsigned int *)ptr;
7716 else
7717 v = (long long)*(int *)ptr;
7718 break;
7719 case 2:
7720 if(!strcmp(_class->dataTypeString, "uint16"))
7721 v = (long long)*(unsigned short *)ptr;
7722 else
7723 v = (long long)*(short *)ptr;
7724 break;
7725 case 1:
7726 if(!strcmp(_class->dataTypeString, "byte"))
7727 v = (long long)*(unsigned char *)ptr;
7728 else
7729 v = (long long)*(char *)ptr;
7730 break;
7731 }
7732 return v;
7733 }
7734
7735 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
7736 {
7737 if(!type->isSigned && type->kind != 22 && type->kind != 23)
7738 ListAdd(specs, MkSpecifier(UNSIGNED));
7739 switch(type->kind)
7740 {
7741 case 8:
7742 {
7743 if(type->__anon1._class->__anon1.registered)
7744 {
7745 if(!type->__anon1._class->__anon1.registered->dataType)
7746 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7747 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
7748 }
7749 break;
7750 }
7751 case 7:
7752 ListAdd(specs, MkSpecifier(DOUBLE));
7753 break;
7754 case 6:
7755 ListAdd(specs, MkSpecifier(FLOAT));
7756 break;
7757 case 1:
7758 ListAdd(specs, MkSpecifier(CHAR));
7759 break;
7760 case 24:
7761 ListAdd(specs, MkSpecifier(_BOOL));
7762 break;
7763 case 2:
7764 ListAdd(specs, MkSpecifier(SHORT));
7765 break;
7766 case 4:
7767 ListAdd(specs, MkSpecifier(INT64));
7768 break;
7769 case 22:
7770 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
7771 break;
7772 case 23:
7773 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
7774 break;
7775 case 3:
7776 default:
7777 ListAdd(specs, MkSpecifier(INT));
7778 break;
7779 }
7780 }
7781
7782 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
7783 {
7784 if(type)
7785 {
7786 if(printConst && type->constant)
7787 strcat(string, "const ");
7788 switch(type->kind)
7789 {
7790 case 8:
7791 {
7792 struct Symbol * c = type->__anon1._class;
7793 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
7794
7795 if(type->classObjectType == 2 && isObjectBaseClass)
7796 strcat(string, "typed_object");
7797 else if(type->classObjectType == 3 && isObjectBaseClass)
7798 strcat(string, "any_object");
7799 else
7800 {
7801 if(c && c->string)
7802 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
7803 }
7804 if(type->byReference)
7805 strcat(string, " &");
7806 break;
7807 }
7808 case 0:
7809 strcat(string, "void");
7810 break;
7811 case 3:
7812 strcat(string, type->isSigned ? "int" : "uint");
7813 break;
7814 case 4:
7815 strcat(string, type->isSigned ? "int64" : "uint64");
7816 break;
7817 case 22:
7818 strcat(string, type->isSigned ? "intptr" : "uintptr");
7819 break;
7820 case 23:
7821 strcat(string, type->isSigned ? "intsize" : "uintsize");
7822 break;
7823 case 1:
7824 strcat(string, type->isSigned ? "char" : "byte");
7825 break;
7826 case 24:
7827 strcat(string, "_Bool");
7828 break;
7829 case 2:
7830 strcat(string, type->isSigned ? "short" : "uint16");
7831 break;
7832 case 6:
7833 strcat(string, "float");
7834 break;
7835 case 7:
7836 strcat(string, "double");
7837 break;
7838 case 9:
7839 if(type->__anon1.__anon1.enumName)
7840 {
7841 strcat(string, "struct ");
7842 strcat(string, type->__anon1.__anon1.enumName);
7843 }
7844 else if(type->typeName)
7845 strcat(string, type->typeName);
7846 else
7847 {
7848 struct Type * member;
7849
7850 strcat(string, "struct { ");
7851 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7852 {
7853 PrintType(member, string, 1, fullName);
7854 strcat(string, "; ");
7855 }
7856 strcat(string, "}");
7857 }
7858 break;
7859 case 10:
7860 if(type->__anon1.__anon1.enumName)
7861 {
7862 strcat(string, "union ");
7863 strcat(string, type->__anon1.__anon1.enumName);
7864 }
7865 else if(type->typeName)
7866 strcat(string, type->typeName);
7867 else
7868 {
7869 strcat(string, "union ");
7870 strcat(string, "(unnamed)");
7871 }
7872 break;
7873 case 15:
7874 if(type->__anon1.__anon1.enumName)
7875 {
7876 strcat(string, "enum ");
7877 strcat(string, type->__anon1.__anon1.enumName);
7878 }
7879 else if(type->typeName)
7880 strcat(string, type->typeName);
7881 else
7882 strcat(string, "int");
7883 break;
7884 case 14:
7885 strcat(string, "...");
7886 break;
7887 case 19:
7888 strcat(string, "subclass(");
7889 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
7890 strcat(string, ")");
7891 break;
7892 case 20:
7893 strcat(string, type->__anon1.templateParameter->identifier->string);
7894 break;
7895 case 21:
7896 strcat(string, "thisclass");
7897 break;
7898 case 17:
7899 strcat(string, "__builtin_va_list");
7900 break;
7901 }
7902 }
7903 }
7904
7905 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
7906
7907 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
7908
7909 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
7910
7911 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
7912
7913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
7914
7915 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
7916
7917 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
7918
7919 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
7920
7921 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
7922
7923 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
7924
7925 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
7926
7927 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
7928
7929 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
7930
7931 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
7932
7933 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
7934
7935 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
7936
7937 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
7938
7939 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
7940
7941 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
7942
7943 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
7944
7945 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
7946
7947 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
7948
7949 struct __ecereNameSpace__ecere__com__Application
7950 {
7951 int argc;
7952 const char * *  argv;
7953 int exitCode;
7954 unsigned int isGUIApp;
7955 struct __ecereNameSpace__ecere__sys__OldList allModules;
7956 char *  parsedCommand;
7957 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
7958 } __attribute__ ((gcc_struct));
7959
7960 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)
7961 {
7962 if(*curMember)
7963 {
7964 *curMember = (*curMember)->next;
7965 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
7966 {
7967 *curMember = subMemberStack[--(*subMemberStackPos)];
7968 *curMember = (*curMember)->next;
7969 }
7970 while((*curMember) && (*curMember)->isProperty)
7971 *curMember = (*curMember)->next;
7972 if(subMemberStackPos)
7973 {
7974 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
7975 {
7976 subMemberStack[(*subMemberStackPos)++] = *curMember;
7977 *curMember = (*curMember)->members.first;
7978 while(*curMember && (*curMember)->isProperty)
7979 *curMember = (*curMember)->next;
7980 }
7981 }
7982 }
7983 while(!*curMember)
7984 {
7985 if(!*curMember)
7986 {
7987 if(subMemberStackPos && *subMemberStackPos)
7988 {
7989 *curMember = subMemberStack[--(*subMemberStackPos)];
7990 *curMember = (*curMember)->next;
7991 }
7992 else
7993 {
7994 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
7995
7996 if(*curClass == _class)
7997 break;
7998 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
7999 ;
8000 *curMember = (*curClass)->membersAndProperties.first;
8001 }
8002 while((*curMember) && (*curMember)->isProperty)
8003 *curMember = (*curMember)->next;
8004 if(subMemberStackPos)
8005 {
8006 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8007 {
8008 subMemberStack[(*subMemberStackPos)++] = *curMember;
8009 *curMember = (*curMember)->members.first;
8010 while(*curMember && (*curMember)->isProperty)
8011 *curMember = (*curMember)->next;
8012 }
8013 }
8014 }
8015 }
8016 }
8017
8018 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
8019 {
8020 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
8021 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
8022 struct __ecereNameSpace__ecere__com__NameSpace * child;
8023
8024 if(!data)
8025 {
8026 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)))
8027 {
8028 data = ScanGlobalData(child, name);
8029 if(data)
8030 break;
8031 }
8032 }
8033 return data;
8034 }
8035
8036 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
8037 {
8038 int nsLen = strlen(nameSpace);
8039 struct Symbol * symbol;
8040
8041 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)))
8042 {
8043 char * s = symbol->string;
8044
8045 if(!strncmp(s, nameSpace, nsLen))
8046 {
8047 int c;
8048 char * namePart;
8049
8050 for(c = strlen(s) - 1; c >= 0; c--)
8051 if(s[c] == ':')
8052 break;
8053 namePart = s + c + 1;
8054 if(!strcmp(namePart, name))
8055 {
8056 return symbol;
8057 }
8058 }
8059 else
8060 break;
8061 }
8062 return (((void *)0));
8063 }
8064
8065 unsigned int GetInt(struct Expression * exp, int * value2)
8066 {
8067 struct Operand op2 = GetOperand(exp);
8068
8069 return GetOpInt(&op2, value2);
8070 }
8071
8072 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
8073 {
8074 struct Operand op2 = GetOperand(exp);
8075
8076 return GetOpUInt(&op2, value2);
8077 }
8078
8079 unsigned int GetInt64(struct Expression * exp, long long * value2)
8080 {
8081 struct Operand op2 = GetOperand(exp);
8082
8083 return GetOpInt64(&op2, value2);
8084 }
8085
8086 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
8087 {
8088 struct Operand op2 = GetOperand(exp);
8089
8090 return GetOpUInt64(&op2, value2);
8091 }
8092
8093 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
8094 {
8095 struct Operand op2 = GetOperand(exp);
8096
8097 return GetOpIntPtr(&op2, value2);
8098 }
8099
8100 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
8101 {
8102 struct Operand op2 = GetOperand(exp);
8103
8104 return GetOpUIntPtr(&op2, value2);
8105 }
8106
8107 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
8108 {
8109 struct Operand op2 = GetOperand(exp);
8110
8111 return GetOpIntSize(&op2, value2);
8112 }
8113
8114 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
8115 {
8116 struct Operand op2 = GetOperand(exp);
8117
8118 return GetOpUIntSize(&op2, value2);
8119 }
8120
8121 unsigned int GetShort(struct Expression * exp, short * value2)
8122 {
8123 struct Operand op2 = GetOperand(exp);
8124
8125 return GetOpShort(&op2, value2);
8126 }
8127
8128 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
8129 {
8130 struct Operand op2 = GetOperand(exp);
8131
8132 return GetOpUShort(&op2, value2);
8133 }
8134
8135 unsigned int GetChar(struct Expression * exp, char * value2)
8136 {
8137 struct Operand op2 = GetOperand(exp);
8138
8139 return GetOpChar(&op2, value2);
8140 }
8141
8142 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
8143 {
8144 struct Operand op2 = GetOperand(exp);
8145
8146 return GetOpUChar(&op2, value2);
8147 }
8148
8149 unsigned int GetFloat(struct Expression * exp, float * value2)
8150 {
8151 struct Operand op2 = GetOperand(exp);
8152
8153 return GetOpFloat(&op2, value2);
8154 }
8155
8156 unsigned int GetDouble(struct Expression * exp, double * value2)
8157 {
8158 struct Operand op2 = GetOperand(exp);
8159
8160 return GetOpDouble(&op2, value2);
8161 }
8162
8163 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
8164 {
8165 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8166 {
8167 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
8168 PrintAttribs(type, string);
8169 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
8170 strcat(string, " const");
8171 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
8172 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8173 strcat(string, " (");
8174 if(type->kind == 13)
8175 {
8176 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
8177 PrintAttribs(type->__anon1.type, string);
8178 }
8179 if(type->kind == 13)
8180 {
8181 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
8182 strcat(string, "*");
8183 else
8184 strcat(string, " *");
8185 }
8186 if(printConst && type->constant && type->kind == 13)
8187 strcat(string, " const");
8188 }
8189 else
8190 PrintTypeSpecs(type, string, fullName, printConst);
8191 }
8192
8193 void PrintExpression(struct Expression * exp, char * string)
8194 {
8195 {
8196 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8197 int count;
8198 unsigned int backOutputLineNumbers = outputLineNumbers;
8199
8200 outputLineNumbers = 0;
8201 if(exp)
8202 OutputExpression(exp, f);
8203 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8204 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8205
8206 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8207 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
8208 count = strlen(string);
8209 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8210 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8211
8212 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8213 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
8214 string[count] = '\0';
8215 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
8216 outputLineNumbers = backOutputLineNumbers;
8217 }
8218 }
8219
8220 struct Type * Dereference(struct Type * source)
8221 {
8222 struct Type * type = (((void *)0));
8223
8224 if(source)
8225 {
8226 if(source->kind == 13 || source->kind == 12)
8227 {
8228 type = source->__anon1.type;
8229 source->__anon1.type->refCount++;
8230 }
8231 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
8232 {
8233 type = __extension__ ({
8234 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8235
8236 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
8237 });
8238 }
8239 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
8240 {
8241 type = source;
8242 source->refCount++;
8243 }
8244 else
8245 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
8246 }
8247 return type;
8248 }
8249
8250 static struct Type * Reference(struct Type * source)
8251 {
8252 struct Type * type = (((void *)0));
8253
8254 if(source)
8255 {
8256 type = __extension__ ({
8257 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8258
8259 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
8260 });
8261 source->refCount++;
8262 }
8263 return type;
8264 }
8265
8266 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
8267 {
8268 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
8269
8270 FreeExpContents(checkedExp);
8271 FreeType(checkedExp->expType);
8272 FreeType(checkedExp->destType);
8273 *checkedExp = *newExp;
8274 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
8275 checkedExp->prev = prev;
8276 checkedExp->next = next;
8277 }
8278
8279 void FinishTemplatesContext(struct Context * context)
8280 {
8281 PopContext(context);
8282 FreeContext(context);
8283 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
8284 }
8285
8286 static __attribute__((unused)) void UnusedFunction()
8287 {
8288 int a;
8289
8290 ((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);
8291 }
8292
8293 struct Expression * ParseExpressionString(char * expression)
8294 {
8295 parseError = 0;
8296 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8297 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8298 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8299
8300 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8301 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
8302 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8303 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8304
8305 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8306 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
8307 echoOn = 0;
8308 parsedExpression = (((void *)0));
8309 resetScanner();
8310 expression_yyparse();
8311 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
8312 return parsedExpression;
8313 }
8314
8315 struct __ecereNameSpace__ecere__com__Module
8316 {
8317 struct __ecereNameSpace__ecere__com__Instance * application;
8318 struct __ecereNameSpace__ecere__sys__OldList classes;
8319 struct __ecereNameSpace__ecere__sys__OldList defines;
8320 struct __ecereNameSpace__ecere__sys__OldList functions;
8321 struct __ecereNameSpace__ecere__sys__OldList modules;
8322 struct __ecereNameSpace__ecere__com__Instance * prev;
8323 struct __ecereNameSpace__ecere__com__Instance * next;
8324 const char *  name;
8325 void *  library;
8326 void *  Unload;
8327 int importType;
8328 int origImportType;
8329 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
8330 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
8331 } __attribute__ ((gcc_struct));
8332
8333 static struct GlobalData * FindGlobalData(char * name)
8334 {
8335 int start = 0, c;
8336 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
8337
8338 nameSpace = globalData;
8339 for(c = 0; name[c]; c++)
8340 {
8341 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
8342 {
8343 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
8344 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
8345
8346 strncpy(spaceName, name + start, c - start);
8347 spaceName[c - start] = '\0';
8348 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
8349 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
8350 if(!newSpace)
8351 return (((void *)0));
8352 nameSpace = newSpace;
8353 if(name[c] == ':')
8354 c++;
8355 start = c + 1;
8356 }
8357 }
8358 if(c - start)
8359 {
8360 return ScanGlobalData(nameSpace, name + start);
8361 }
8362 return (((void *)0));
8363 }
8364
8365 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
8366 {
8367 int c;
8368 char nameSpace[1024];
8369 const char * namePart;
8370 unsigned int gotColon = 0;
8371
8372 nameSpace[0] = '\0';
8373 for(c = strlen(name) - 1; c >= 0; c--)
8374 if(name[c] == ':')
8375 {
8376 gotColon = 1;
8377 break;
8378 }
8379 namePart = name + c + 1;
8380 while(c >= 0 && name[c] == ':')
8381 c--;
8382 if(c >= 0)
8383 {
8384 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
8385
8386 if(symbol)
8387 return symbol;
8388 memcpy(nameSpace, name, c + 1);
8389 nameSpace[c + 1] = (char)0;
8390 return ScanWithNameSpace(tree, nameSpace, namePart);
8391 }
8392 else if(gotColon)
8393 {
8394 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8395
8396 return symbol;
8397 }
8398 else
8399 {
8400 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8401
8402 if(symbol)
8403 return symbol;
8404 return ScanWithNameSpace(tree, "", namePart);
8405 }
8406 return (((void *)0));
8407 }
8408
8409 static void PrintArraySize(struct Type * arrayType, char * string)
8410 {
8411 char size[256];
8412
8413 size[0] = '\0';
8414 strcat(size, "[");
8415 if(arrayType->__anon1.__anon4.enumClass)
8416 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
8417 else if(arrayType->__anon1.__anon4.arraySizeExp)
8418 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
8419 strcat(size, "]");
8420 strcat(string, size);
8421 }
8422
8423 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
8424 {
8425
8426 }
8427
8428 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
8429 {
8430 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8431 strcat(string, ")");
8432 if(type->kind == 12)
8433 PrintArraySize(type, string);
8434 else if(type->kind == 11)
8435 {
8436 struct Type * param;
8437
8438 strcat(string, "(");
8439 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
8440 {
8441 PrintType(param, string, 1, fullName);
8442 if(param->next)
8443 strcat(string, ", ");
8444 }
8445 strcat(string, ")");
8446 }
8447 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8448 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
8449 }
8450
8451 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
8452 {
8453 PrePrintType(type, string, fullName, (((void *)0)), printConst);
8454 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
8455 strcat(string, " ");
8456 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
8457 {
8458 struct Symbol * _class = type->__anon1.__anon2.thisClass;
8459
8460 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
8461 {
8462 if(type->classObjectType == 1)
8463 strcat(string, "class");
8464 else
8465 strcat(string, type->byReference ? "typed_object&" : "typed_object");
8466 }
8467 else if(_class && _class->string)
8468 {
8469 char * s = _class->string;
8470
8471 if(fullName)
8472 strcat(string, s);
8473 else
8474 {
8475 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
8476
8477 if(name)
8478 name += 2;
8479 else
8480 name = s;
8481 strcat(string, name);
8482 }
8483 }
8484 strcat(string, "::");
8485 }
8486 if(printName && type->name)
8487 PrintName(type, string, fullName);
8488 PostPrintType(type, string, fullName);
8489 if(type->bitFieldCount)
8490 {
8491 char count[100];
8492
8493 sprintf(count, ":%d", type->bitFieldCount);
8494 strcat(string, count);
8495 }
8496 }
8497
8498 struct Conversion;
8499
8500 struct Conversion
8501 {
8502 struct Conversion * prev, * next;
8503 struct __ecereNameSpace__ecere__com__Property * convert;
8504 unsigned int isGet;
8505 struct Type * resultType;
8506 } __attribute__ ((gcc_struct));
8507
8508 static void FreeConvert(struct Conversion * convert)
8509 {
8510 if(convert->resultType)
8511 FreeType(convert->resultType);
8512 }
8513
8514 struct Enumerator;
8515
8516 struct Enumerator
8517 {
8518 struct Enumerator * prev;
8519 struct Enumerator * next;
8520 struct Location loc;
8521 struct Identifier * id;
8522 struct Expression * exp;
8523 } __attribute__ ((gcc_struct));
8524
8525 struct AsmField;
8526
8527 struct AsmField
8528 {
8529 struct AsmField * prev;
8530 struct AsmField * next;
8531 struct Location loc;
8532 char *  command;
8533 struct Expression * expression;
8534 struct Identifier * symbolic;
8535 } __attribute__ ((gcc_struct));
8536
8537 struct ClassDefinition;
8538
8539 struct Context
8540 {
8541 struct Context * parent;
8542 struct __ecereNameSpace__ecere__sys__BinaryTree types;
8543 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
8544 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
8545 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
8546 int nextID;
8547 int simpleID;
8548 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
8549 struct ClassDefinition * classDef;
8550 unsigned int templateTypesOnly;
8551 unsigned int hasNameSpace;
8552 } __attribute__ ((gcc_struct));
8553
8554 struct External
8555 {
8556 struct External * prev;
8557 struct External * next;
8558 struct Location loc;
8559 int type;
8560 struct Symbol * symbol;
8561 union
8562 {
8563 struct FunctionDefinition * function;
8564 struct ClassDefinition * _class;
8565 struct Declaration * declaration;
8566 char *  importString;
8567 struct Identifier * id;
8568 struct DBTableDef * table;
8569 } __attribute__ ((gcc_struct)) __anon1;
8570 int importType;
8571 struct External * fwdDecl;
8572 struct __ecereNameSpace__ecere__com__Instance * outgoing;
8573 struct __ecereNameSpace__ecere__com__Instance * incoming;
8574 int nonBreakableIncoming;
8575 } __attribute__ ((gcc_struct));
8576
8577 struct ClassDefinition
8578 {
8579 struct ClassDefinition * prev;
8580 struct ClassDefinition * next;
8581 struct Location loc;
8582 struct Specifier * _class;
8583 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
8584 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
8585 struct Symbol * symbol;
8586 struct Location blockStart;
8587 struct Location nameLoc;
8588 int declMode;
8589 unsigned int deleteWatchable;
8590 } __attribute__ ((gcc_struct));
8591
8592 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
8593
8594 void __ecereMethod_External_CreateEdge(struct External * this, struct External * from, unsigned int soft);
8595
8596 void DeclareGlobalData(struct External * neededFor, struct GlobalData * data)
8597 {
8598 struct Symbol * symbol = data->symbol;
8599
8600 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
8601 {
8602 if(inCompiler)
8603 {
8604 if(!symbol)
8605 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
8606 }
8607 if(!data->dataType)
8608 data->dataType = ProcessTypeString(data->dataTypeString, 0);
8609 if(inCompiler)
8610 {
8611 struct Declaration * decl;
8612 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
8613 struct Declarator * d;
8614 struct External * external;
8615
8616 specifiers = MkList();
8617 declarators = MkList();
8618 ListAdd(specifiers, MkSpecifier(EXTERN));
8619 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
8620 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
8621 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
8622 decl = MkDeclaration(specifiers, declarators);
8623 external = MkExternalDeclaration(decl);
8624 if(curExternal)
8625 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
8626 external->symbol = symbol;
8627 symbol->__anon2.__anon1.pointerExternal = external;
8628 DeclareType(external, data->dataType, 1, 1);
8629 }
8630 }
8631 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
8632 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, 0);
8633 }
8634
8635 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
8636 {
8637 struct Context * ctx;
8638 struct Symbol * symbol = (((void *)0));
8639
8640 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
8641 {
8642 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
8643 {
8644 symbol = (((void *)0));
8645 if(thisNameSpace)
8646 {
8647 char curName[1024];
8648
8649 strcpy(curName, thisNameSpace);
8650 strcat(curName, "::");
8651 strcat(curName, name);
8652 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
8653 }
8654 if(!symbol)
8655 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
8656 }
8657 else
8658 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
8659 if(symbol || ctx == endContext)
8660 break;
8661 }
8662 if(inCompiler && symbol && ctx == globalContext && symbol->__anon2.__anon1.pointerExternal && curExternal && symbol->__anon2.__anon1.pointerExternal != curExternal)
8663 __ecereMethod_External_CreateUniqueEdge(curExternal, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
8664 return symbol;
8665 }
8666
8667 struct PropertyDef;
8668
8669 struct ClassDef
8670 {
8671 struct ClassDef * prev;
8672 struct ClassDef * next;
8673 struct Location loc;
8674 int type;
8675 union
8676 {
8677 struct Declaration * decl;
8678 struct ClassFunction * function;
8679 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
8680 struct PropertyDef * propertyDef;
8681 struct PropertyWatch * propertyWatch;
8682 char *  designer;
8683 struct Identifier * defaultProperty;
8684 struct
8685 {
8686 struct Identifier * id;
8687 struct Initializer * initializer;
8688 } __attribute__ ((gcc_struct)) __anon1;
8689 } __attribute__ ((gcc_struct)) __anon1;
8690 int memberAccess;
8691 void *  object;
8692 } __attribute__ ((gcc_struct));
8693
8694 struct PropertyDef
8695 {
8696 struct PropertyDef * prev;
8697 struct PropertyDef * next;
8698 struct Location loc;
8699 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
8700 struct Declarator * declarator;
8701 struct Identifier * id;
8702 struct Statement * getStmt;
8703 struct Statement * setStmt;
8704 struct Statement * issetStmt;
8705 struct Symbol * symbol;
8706 struct Expression * category;
8707 struct
8708 {
8709 unsigned int conversion : 1;
8710 unsigned int isWatchable : 1;
8711 unsigned int isDBProp : 1;
8712 } __attribute__ ((gcc_struct)) __anon1;
8713 } __attribute__ ((gcc_struct));
8714
8715 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
8716 {
8717 struct ClassDef * def;
8718 int anonID = 1;
8719
8720 for(def = (*definitions).first; def; def = def->next)
8721 {
8722 if(def->type == 2)
8723 {
8724 struct Declaration * decl = def->__anon1.decl;
8725
8726 if(decl && decl->__anon1.__anon1.specifiers)
8727 {
8728 struct Specifier * spec;
8729 unsigned int isStruct = 0;
8730
8731 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
8732 {
8733 if(spec->type == 3 || spec->type == 4)
8734 {
8735 if(spec->__anon1.__anon2.definitions)
8736 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
8737 isStruct = 1;
8738 }
8739 }
8740 if(isStruct)
8741 {
8742 struct Declarator * d = (((void *)0));
8743
8744 if(decl->__anon1.__anon1.declarators)
8745 {
8746 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
8747 {
8748 struct Identifier * idDecl = GetDeclId(d);
8749
8750 if(idDecl)
8751 break;
8752 }
8753 }
8754 if(!d)
8755 {
8756 char id[100];
8757
8758 sprintf(id, "__anon%d", anonID++);
8759 if(!decl->__anon1.__anon1.declarators)
8760 decl->__anon1.__anon1.declarators = MkList();
8761 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
8762 }
8763 }
8764 }
8765 }
8766 }
8767 }
8768
8769 struct MemberInit;
8770
8771 typedef union YYSTYPE
8772 {
8773 int specifierType;
8774 int i;
8775 int declMode;
8776 struct Identifier * id;
8777 struct Expression * exp;
8778 struct Specifier * specifier;
8779 struct __ecereNameSpace__ecere__sys__OldList * list;
8780 struct Enumerator * enumerator;
8781 struct Declarator * declarator;
8782 struct Pointer * pointer;
8783 struct Initializer * initializer;
8784 struct InitDeclarator * initDeclarator;
8785 struct TypeName * typeName;
8786 struct Declaration * declaration;
8787 struct Statement * stmt;
8788 struct FunctionDefinition * function;
8789 struct External * external;
8790 struct Context * context;
8791 struct AsmField * asmField;
8792 struct Attrib * attrib;
8793 struct ExtDecl * extDecl;
8794 struct Attribute * attribute;
8795 struct Instantiation * instance;
8796 struct MembersInit * membersInit;
8797 struct MemberInit * memberInit;
8798 struct ClassFunction * classFunction;
8799 struct ClassDefinition * _class;
8800 struct ClassDef * classDef;
8801 struct PropertyDef * prop;
8802 char * string;
8803 struct Symbol * symbol;
8804 struct PropertyWatch * propertyWatch;
8805 struct TemplateParameter * templateParameter;
8806 struct TemplateArgument * templateArgument;
8807 struct TemplateDatatype * templateDatatype;
8808 struct DBTableEntry * dbtableEntry;
8809 struct DBIndexItem * dbindexItem;
8810 struct DBTableDef * dbtableDef;
8811 } __attribute__ ((gcc_struct)) YYSTYPE;
8812
8813 extern YYSTYPE yylval;
8814
8815 struct MemberInit
8816 {
8817 struct MemberInit * prev;
8818 struct MemberInit * next;
8819 struct Location loc;
8820 struct Location realLoc;
8821 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
8822 struct Initializer * initializer;
8823 unsigned int used;
8824 unsigned int variable;
8825 unsigned int takeOutExp;
8826 } __attribute__ ((gcc_struct));
8827
8828 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
8829
8830 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
8831
8832 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
8833 {
8834 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
8835 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
8836 const char *  name;
8837 int type;
8838 union
8839 {
8840 const char *  dataTypeString;
8841 int memberType;
8842 } __attribute__ ((gcc_struct)) __anon1;
8843 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
8844 void *  param;
8845 } __attribute__ ((gcc_struct));
8846
8847 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
8848 {
8849 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
8850 int id = 0;
8851 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
8852 struct __ecereNameSpace__ecere__com__Class * sClass;
8853
8854 for(sClass = _class; sClass; sClass = sClass->base)
8855 {
8856 id = 0;
8857 if(sClass->templateClass)
8858 sClass = sClass->templateClass;
8859 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
8860 {
8861 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
8862 {
8863 for(sClass = sClass->base; sClass; sClass = sClass->base)
8864 {
8865 if(sClass->templateClass)
8866 sClass = sClass->templateClass;
8867 id += sClass->templateParams.count;
8868 }
8869 break;
8870 }
8871 id++;
8872 }
8873 if(curParam)
8874 break;
8875 }
8876 if(curParam)
8877 {
8878 arg = &_class->templateArgs[id];
8879 if(arg && param->type == 0)
8880 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
8881 }
8882 return arg;
8883 }
8884
8885 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
8886 {
8887 struct Context * context = PushContext();
8888
8889 context->templateTypesOnly = 1;
8890 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
8891 {
8892 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
8893
8894 for(; param; param = param->next)
8895 {
8896 if(param->type == 0 && param->identifier)
8897 {
8898 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
8899
8900 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8901 }
8902 }
8903 }
8904 else if(_class)
8905 {
8906 struct __ecereNameSpace__ecere__com__Class * sClass;
8907
8908 for(sClass = _class; sClass; sClass = sClass->base)
8909 {
8910 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
8911
8912 for(p = sClass->templateParams.first; p; p = p->next)
8913 {
8914 if(p->type == 0)
8915 {
8916 struct TemplateParameter * param = p->param;
8917 struct TemplatedType * type;
8918
8919 if(!param)
8920 {
8921 p->param = param = __extension__ ({
8922 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
8923
8924 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
8925 });
8926 }
8927 type = __extension__ ({
8928 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
8929
8930 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
8931 });
8932 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8933 }
8934 }
8935 }
8936 }
8937 return context;
8938 }
8939
8940 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
8941 {
8942 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8943 {
8944 unsigned int first = 1;
8945 int p = 0;
8946 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8947 int lastParam = -1;
8948 char className[1024];
8949
8950 strcpy(className, _class->fullName);
8951 for(param = _class->templateParams.first; param; param = param->next)
8952 {
8953 {
8954 if(first)
8955 strcat(className, "<");
8956 if(!first)
8957 strcat(className, ", ");
8958 if(lastParam + 1 != p)
8959 {
8960 strcat(className, param->name);
8961 strcat(className, " = ");
8962 }
8963 strcat(className, param->name);
8964 first = 0;
8965 lastParam = p;
8966 }
8967 p++;
8968 }
8969 if(!first)
8970 {
8971 int len = strlen(className);
8972
8973 if(className[len - 1] == '>')
8974 className[len++] = ' ';
8975 className[len++] = '>';
8976 className[len++] = '\0';
8977 }
8978 return __ecereNameSpace__ecere__sys__CopyString(className);
8979 }
8980 else
8981 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
8982 }
8983
8984 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
8985 {
8986 struct Type * type;
8987
8988 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8989 {
8990 unsigned int first = 1;
8991 int p = 0;
8992 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8993 int lastParam = -1;
8994 char className[1024];
8995
8996 strcpy(className, _class->fullName);
8997 for(param = _class->templateParams.first; param; param = param->next)
8998 {
8999 {
9000 if(first)
9001 strcat(className, "<");
9002 if(!first)
9003 strcat(className, ", ");
9004 if(lastParam + 1 != p)
9005 {
9006 strcat(className, param->name);
9007 strcat(className, " = ");
9008 }
9009 strcat(className, param->name);
9010 first = 0;
9011 lastParam = p;
9012 }
9013 p++;
9014 }
9015 if(!first)
9016 {
9017 int len = strlen(className);
9018
9019 if(className[len - 1] == '>')
9020 className[len++] = ' ';
9021 className[len++] = '>';
9022 className[len++] = '\0';
9023 }
9024 type = MkClassType(className);
9025 }
9026 else
9027 {
9028 type = MkClassType(_class->fullName);
9029 }
9030 return type;
9031 }
9032
9033 static int DeclareMembers(struct External * neededBy, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9034 {
9035 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9036 struct __ecereNameSpace__ecere__com__DataMember * member;
9037 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9038
9039 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
9040 DeclareMembers(neededBy, _class->base, 0);
9041 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
9042 {
9043 if(!member->isProperty)
9044 {
9045 switch(member->type)
9046 {
9047 case 0:
9048 {
9049 if(!member->dataType && member->dataTypeString)
9050 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9051 if(member->dataType)
9052 DeclareType(neededBy, member->dataType, 1, 0);
9053 break;
9054 }
9055 case 1:
9056 case 2:
9057 {
9058 DeclareMembers(neededBy, (struct __ecereNameSpace__ecere__com__Class *)member, 1);
9059 break;
9060 }
9061 }
9062 }
9063 }
9064 if(context)
9065 FinishTemplatesContext(context);
9066 return topMember ? topMember->memberID : _class->memberID;
9067 }
9068
9069 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
9070 {
9071 if(!method->dataType)
9072 {
9073 struct Context * context = SetupTemplatesContext(method->_class);
9074
9075 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9076 FinishTemplatesContext(context);
9077 if(method->type != 1 && method->dataType)
9078 {
9079 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
9080 {
9081 if(!method->_class->symbol)
9082 method->_class->symbol = FindClass(method->_class->fullName);
9083 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
9084 }
9085 }
9086 }
9087 }
9088
9089 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
9090 {
9091 if(!prop->dataType)
9092 {
9093 struct Context * context = SetupTemplatesContext(prop->_class);
9094
9095 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
9096 FinishTemplatesContext(context);
9097 }
9098 }
9099
9100 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
9101 {
9102 if(specs != (((void *)0)) && _class)
9103 {
9104 struct Specifier * spec;
9105
9106 for(spec = specs->first; spec; spec = spec->next)
9107 {
9108 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
9109 {
9110 spec->type = 1;
9111 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
9112 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
9113 }
9114 }
9115 }
9116 }
9117
9118 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
9119 {
9120 struct Identifier * id = exp->__anon1.__anon1.identifier;
9121 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9122 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9123 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9124 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9125
9126 if(_class && _class->type == 4)
9127 {
9128 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
9129 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9130
9131 if(enumClass)
9132 {
9133 struct __ecereNameSpace__ecere__com__Class * baseClass;
9134
9135 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
9136 {
9137 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
9138
9139 for(value = e->values.first; value; value = value->next)
9140 {
9141 if(!strcmp(value->name, id->string))
9142 break;
9143 }
9144 if(value)
9145 {
9146 exp->isConstant = 1;
9147 if(inCompiler || inPreCompiler || inDebugger)
9148 {
9149 char constant[256];
9150
9151 FreeExpContents(exp);
9152 exp->type = 2;
9153 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
9154 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
9155 else
9156 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
9157 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9158 }
9159 exp->expType = MkClassType(baseClass->fullName);
9160 break;
9161 }
9162 }
9163 }
9164 if(value)
9165 return 1;
9166 }
9167 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
9168 {
9169 ProcessMethodType(method);
9170 exp->expType = __extension__ ({
9171 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
9172
9173 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
9174 });
9175 return 1;
9176 }
9177 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
9178 {
9179 if(!prop->dataType)
9180 ProcessPropertyType(prop);
9181 exp->expType = prop->dataType;
9182 if(prop->dataType)
9183 prop->dataType->refCount++;
9184 return 1;
9185 }
9186 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
9187 {
9188 if(!member->dataType)
9189 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9190 exp->expType = member->dataType;
9191 if(member->dataType)
9192 member->dataType->refCount++;
9193 return 1;
9194 }
9195 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
9196 {
9197 if(!classProp->dataType)
9198 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
9199 if(classProp->constant)
9200 {
9201 FreeExpContents(exp);
9202 exp->isConstant = 1;
9203 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
9204 {
9205 exp->type = 3;
9206 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
9207 }
9208 else
9209 {
9210 char constant[256];
9211
9212 exp->type = 2;
9213 sprintf(constant, "%d", (int)classProp->Get(_class));
9214 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9215 }
9216 }
9217 else
9218 {
9219 }
9220 exp->expType = classProp->dataType;
9221 if(classProp->dataType)
9222 classProp->dataType->refCount++;
9223 return 1;
9224 }
9225 return 0;
9226 }
9227
9228 void DeclareProperty(struct External * neededBy, struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
9229 {
9230 struct Symbol * symbol = prop->symbol;
9231 unsigned int imported = 0;
9232 unsigned int dllImport = 0;
9233 struct External * structExternal = (((void *)0));
9234 struct External * instExternal = (((void *)0));
9235
9236 strcpy(setName, "__ecereProp_");
9237 FullClassNameCat(setName, prop->_class->fullName, 0);
9238 strcat(setName, "_Set_");
9239 FullClassNameCat(setName, prop->name, 1);
9240 strcpy(getName, "__ecereProp_");
9241 FullClassNameCat(getName, prop->_class->fullName, 0);
9242 strcat(getName, "_Get_");
9243 FullClassNameCat(getName, prop->name, 1);
9244 if(!symbol || symbol->_import)
9245 {
9246 if(!symbol)
9247 {
9248 struct Symbol * classSym;
9249
9250 if(!prop->_class->symbol)
9251 prop->_class->symbol = FindClass(prop->_class->fullName);
9252 classSym = prop->_class->symbol;
9253 if(classSym && !classSym->_import)
9254 {
9255 struct ModuleImport * module;
9256
9257 if(prop->_class->module)
9258 module = FindModule(prop->_class->module);
9259 else
9260 module = mainModule;
9261 classSym->_import = __extension__ ({
9262 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9263
9264 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
9265 });
9266 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9267 }
9268 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9269 symbol->_import = (struct ClassImport *)__extension__ ({
9270 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
9271
9272 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
9273 });
9274 if(classSym)
9275 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
9276 }
9277 imported = 1;
9278 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)
9279 dllImport = 1;
9280 }
9281 if(!symbol->type)
9282 {
9283 struct Context * context = SetupTemplatesContext(prop->_class);
9284
9285 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
9286 FinishTemplatesContext(context);
9287 }
9288 if((prop->Get && !symbol->__anon2.__anon2.externalGet) || (prop->Set && !symbol->__anon2.__anon2.externalSet))
9289 {
9290 if(prop->_class->type == 0 && prop->_class->structSize)
9291 instExternal = DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
9292 structExternal = DeclareStruct((((void *)0)), prop->_class->fullName, prop->_class->type != 1, 0);
9293 }
9294 if(prop->Get && !symbol->__anon2.__anon2.externalGet)
9295 {
9296 struct Declaration * decl;
9297 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9298 struct Declarator * d;
9299 struct __ecereNameSpace__ecere__sys__OldList * params;
9300 struct Specifier * spec = (((void *)0));
9301 struct External * external;
9302 struct Declarator * typeDecl;
9303 unsigned int simple = 0;
9304 unsigned int needReference;
9305
9306 specifiers = MkList();
9307 declarators = MkList();
9308 params = MkList();
9309 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9310 d = MkDeclaratorIdentifier(MkIdentifier(getName));
9311 if(dllImport)
9312 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9313 {
9314 struct Context * context = SetupTemplatesContext(prop->_class);
9315
9316 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
9317 FinishTemplatesContext(context);
9318 }
9319 needReference = !typeDecl || typeDecl->type == 1;
9320 for(spec = (*specifiers).first; spec; spec = spec->next)
9321 {
9322 if(spec->type == 1)
9323 {
9324 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9325
9326 if(needReference)
9327 {
9328 symbol->_class = classSym->__anon1.registered;
9329 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
9330 simple = 1;
9331 }
9332 break;
9333 }
9334 }
9335 if(!simple)
9336 d = PlugDeclarator(typeDecl, d);
9337 else
9338 {
9339 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
9340 specifiers = MkList();
9341 }
9342 d = MkDeclaratorFunction(d, params);
9343 if(dllImport)
9344 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9345 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9346 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9347 if(simple)
9348 ListAdd(specifiers, MkSpecifier(VOID));
9349 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9350 decl = MkDeclaration(specifiers, declarators);
9351 external = MkExternalDeclaration(decl);
9352 if(structExternal)
9353 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9354 if(instExternal)
9355 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9356 if(spec)
9357 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9358 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9359 external->symbol = symbol;
9360 symbol->__anon2.__anon2.externalGet = external;
9361 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9362 if(typeDecl)
9363 FreeDeclarator(typeDecl);
9364 }
9365 if(prop->Set && !symbol->__anon2.__anon2.externalSet)
9366 {
9367 struct Declaration * decl;
9368 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9369 struct Declarator * d;
9370 struct __ecereNameSpace__ecere__sys__OldList * params;
9371 struct Specifier * spec = (((void *)0));
9372 struct External * external;
9373 struct Declarator * typeDecl;
9374 unsigned int needReference;
9375
9376 declarators = MkList();
9377 params = MkList();
9378 if(!prop->conversion || prop->_class->type == 1)
9379 {
9380 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9381 }
9382 specifiers = MkList();
9383 {
9384 struct Context * context = SetupTemplatesContext(prop->_class);
9385
9386 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
9387 FinishTemplatesContext(context);
9388 }
9389 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
9390 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
9391 ListAdd(params, MkTypeName(specifiers, d));
9392 d = MkDeclaratorIdentifier(MkIdentifier(setName));
9393 if(dllImport)
9394 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9395 d = MkDeclaratorFunction(d, params);
9396 needReference = !typeDecl || typeDecl->type == 1;
9397 for(spec = (*specifiers).first; spec; spec = spec->next)
9398 {
9399 if(spec->type == 1)
9400 {
9401 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9402
9403 if(needReference)
9404 symbol->_class = classSym->__anon1.registered;
9405 break;
9406 }
9407 }
9408 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9409 specifiers = MkList();
9410 if(dllImport)
9411 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9412 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9413 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9414 if(!prop->conversion || prop->_class->type == 1)
9415 ListAdd(specifiers, MkSpecifier(VOID));
9416 else
9417 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
9418 decl = MkDeclaration(specifiers, declarators);
9419 external = MkExternalDeclaration(decl);
9420 if(structExternal)
9421 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9422 if(instExternal)
9423 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9424 if(spec)
9425 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9426 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9427 external->symbol = symbol;
9428 symbol->__anon2.__anon2.externalSet = external;
9429 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9430 }
9431 if(!symbol->__anon2.__anon2.externalPtr)
9432 {
9433 struct Declaration * decl;
9434 struct External * external;
9435 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
9436 char propName[1024];
9437
9438 if(imported)
9439 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9440 else
9441 {
9442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9443 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
9444 }
9445 ListAdd(specifiers, MkSpecifierName("Property"));
9446 strcpy(propName, "__ecereProp_");
9447 FullClassNameCat(propName, prop->_class->fullName, 0);
9448 strcat(propName, "_");
9449 FullClassNameCat(propName, prop->name, 1);
9450 {
9451 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
9452
9453 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9454 if(!imported)
9455 {
9456 strcpy(propName, "__ecerePropM_");
9457 FullClassNameCat(propName, prop->_class->fullName, 0);
9458 strcat(propName, "_");
9459 FullClassNameCat(propName, prop->name, 1);
9460 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9461 }
9462 decl = MkDeclaration(specifiers, list);
9463 }
9464 external = MkExternalDeclaration(decl);
9465 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
9466 external->symbol = symbol;
9467 symbol->__anon2.__anon2.externalPtr = external;
9468 }
9469 if(inCompiler && neededBy)
9470 {
9471 if(symbol->__anon2.__anon2.externalPtr)
9472 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalPtr, 0);
9473 if(symbol->__anon2.__anon2.externalGet)
9474 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalGet, symbol->__anon2.__anon2.externalGet->type == 0);
9475 if(symbol->__anon2.__anon2.externalSet)
9476 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalSet, symbol->__anon2.__anon2.externalSet->type == 0);
9477 }
9478 }
9479
9480 static void ProcessDeclarator(struct Declarator *  decl, unsigned int isFunction);
9481
9482 void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char * name)
9483 {
9484 struct Symbol * symbol = method->symbol;
9485
9486 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && (!symbol->__anon2.__anon3.methodCodeExternal || method->type == 1)))
9487 {
9488 unsigned int dllImport = 0;
9489
9490 if(!method->dataType)
9491 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9492 {
9493 if(!symbol || method->type == 1)
9494 {
9495 struct Symbol * classSym;
9496
9497 if(!method->_class->symbol)
9498 method->_class->symbol = FindClass(method->_class->fullName);
9499 classSym = method->_class->symbol;
9500 if(!classSym->_import)
9501 {
9502 struct ModuleImport * module;
9503
9504 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->name)
9505 module = FindModule(method->_class->module);
9506 else
9507 module = mainModule;
9508 classSym->_import = __extension__ ({
9509 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9510
9511 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
9512 });
9513 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9514 }
9515 if(!symbol)
9516 {
9517 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9518 }
9519 if(!symbol->_import)
9520 {
9521 symbol->_import = (struct ClassImport *)__extension__ ({
9522 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
9523
9524 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
9525 });
9526 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
9527 }
9528 if(!symbol)
9529 {
9530 symbol->type = method->dataType;
9531 if(symbol->type)
9532 symbol->type->refCount++;
9533 }
9534 }
9535 if(!method->dataType->dllExport)
9536 {
9537 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)
9538 dllImport = 1;
9539 }
9540 }
9541 if(inCompiler)
9542 {
9543 struct Declaration * decl;
9544 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9545 struct Declarator * d;
9546 struct Declarator * funcDecl;
9547 struct External * external;
9548
9549 specifiers = MkList();
9550 declarators = MkList();
9551 if(dllImport)
9552 ListAdd(specifiers, MkSpecifier(EXTERN));
9553 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
9554 ListAdd(specifiers, MkSpecifier(STATIC));
9555 if(method->type == 1)
9556 {
9557 ListAdd(specifiers, MkSpecifier(INT));
9558 d = MkDeclaratorIdentifier(MkIdentifier(name));
9559 }
9560 else
9561 {
9562 d = MkDeclaratorIdentifier(MkIdentifier(name));
9563 if(dllImport)
9564 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9565 {
9566 struct Context * context = SetupTemplatesContext(method->_class);
9567
9568 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
9569 FinishTemplatesContext(context);
9570 }
9571 funcDecl = GetFuncDecl(d);
9572 if(dllImport)
9573 {
9574 struct Specifier * spec, * next;
9575
9576 for(spec = (*specifiers).first; spec; spec = next)
9577 {
9578 next = spec->next;
9579 if(spec->type == 5)
9580 {
9581 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9582 FreeSpecifier(spec);
9583 }
9584 }
9585 }
9586 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
9587 {
9588 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
9589 {
9590 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
9591 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")));
9592 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
9593 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
9594
9595 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
9596 {
9597 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
9598
9599 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
9600 FreeTypeName(param);
9601 }
9602 if(!funcDecl->__anon1.function.parameters)
9603 funcDecl->__anon1.function.parameters = MkList();
9604 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
9605 }
9606 }
9607 }
9608 ProcessDeclarator(d, 1);
9609 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9610 decl = MkDeclaration(specifiers, declarators);
9611 ReplaceThisClassSpecifiers(specifiers, method->_class);
9612 external = MkExternalDeclaration(decl);
9613 external->symbol = symbol;
9614 symbol->__anon2.__anon1.pointerExternal = external;
9615 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9616 DeclareStruct(external, method->_class->fullName, 1, 1);
9617 if(method->dataType)
9618 DeclareType(external, method->dataType, 1, 1);
9619 }
9620 }
9621 if(inCompiler && neededFor)
9622 {
9623 struct External * external = symbol->__anon2.__anon1.pointerExternal ? symbol->__anon2.__anon1.pointerExternal : symbol->__anon2.__anon3.methodCodeExternal;
9624
9625 __ecereMethod_External_CreateUniqueEdge(neededFor, external, external->type == 0);
9626 }
9627 }
9628
9629 struct __ecereNameSpace__ecere__com__GlobalFunction;
9630
9631 struct __ecereNameSpace__ecere__com__GlobalFunction
9632 {
9633 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
9634 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
9635 const char *  name;
9636 int (*  function)();
9637 struct __ecereNameSpace__ecere__com__Instance * module;
9638 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
9639 const char *  dataTypeString;
9640 struct Type * dataType;
9641 void *  symbol;
9642 } __attribute__ ((gcc_struct));
9643
9644 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
9645
9646 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);
9647
9648 unsigned int DeclareFunction(struct External * neededFor, struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
9649 {
9650 struct Symbol * symbol = function->symbol;
9651
9652 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
9653 {
9654 unsigned int imported = 0;
9655 unsigned int dllImport = 0;
9656
9657 if(!function->dataType)
9658 {
9659 function->dataType = ProcessTypeString(function->dataTypeString, 0);
9660 if(!function->dataType->__anon1.__anon2.thisClass)
9661 function->dataType->__anon1.__anon2.staticMethod = 1;
9662 }
9663 if(inCompiler)
9664 {
9665 if(!symbol)
9666 {
9667 struct ModuleImport * module = FindModule(function->module);
9668
9669 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9670 if(module->name)
9671 {
9672 if(!function->dataType->dllExport)
9673 {
9674 symbol->_import = (struct ClassImport *)__extension__ ({
9675 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
9676
9677 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
9678 });
9679 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
9680 }
9681 }
9682 {
9683 symbol->type = ProcessTypeString(function->dataTypeString, 0);
9684 if(!symbol->type->__anon1.__anon2.thisClass)
9685 symbol->type->__anon1.__anon2.staticMethod = 1;
9686 }
9687 }
9688 imported = symbol->_import ? 1 : 0;
9689 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9690 dllImport = 1;
9691 }
9692 if(inCompiler)
9693 {
9694 {
9695 struct Declaration * decl;
9696 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9697 struct Declarator * d;
9698 struct Declarator * funcDecl;
9699 struct External * external;
9700
9701 specifiers = MkList();
9702 declarators = MkList();
9703 ListAdd(specifiers, MkSpecifier(EXTERN));
9704 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
9705 if(dllImport)
9706 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9707 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
9708 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType == 1)
9709 {
9710 struct Specifier * spec;
9711
9712 for(spec = (*specifiers).first; spec; spec = spec->next)
9713 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
9714 {
9715 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9716 FreeSpecifier(spec);
9717 break;
9718 }
9719 }
9720 funcDecl = GetFuncDecl(d);
9721 if(funcDecl && !funcDecl->__anon1.function.parameters)
9722 {
9723 funcDecl->__anon1.function.parameters = MkList();
9724 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
9725 }
9726 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9727 {
9728 struct Context * oldCtx = curContext;
9729
9730 curContext = globalContext;
9731 decl = MkDeclaration(specifiers, declarators);
9732 curContext = oldCtx;
9733 }
9734 external = MkExternalDeclaration(decl);
9735 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9736 external->symbol = symbol;
9737 symbol->__anon2.__anon1.pointerExternal = external;
9738 DeclareType(external, function->dataType, 1, 1);
9739 }
9740 }
9741 }
9742 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
9743 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
9744 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;
9745 }
9746
9747 void DeclareFunctionUtil(struct External * neededBy, const char * s)
9748 {
9749 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
9750
9751 if(function)
9752 {
9753 char name[1024];
9754
9755 name[0] = (char)0;
9756 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
9757 strcpy(name, "__ecereFunction_");
9758 FullClassNameCat(name, s, 0);
9759 DeclareFunction(neededBy, function, name);
9760 }
9761 else if(neededBy)
9762 FindSymbol(s, globalContext, globalContext, 0, 0);
9763 }
9764
9765 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
9766 {
9767 char propName[1024], propNameM[1024];
9768 char getName[1024], setName[1024];
9769 struct __ecereNameSpace__ecere__sys__OldList * args;
9770
9771 DeclareProperty(curExternal, prop, setName, getName);
9772 strcpy(propName, "__ecereProp_");
9773 FullClassNameCat(propName, prop->_class->fullName, 0);
9774 strcat(propName, "_");
9775 FullClassNameCat(propName, prop->name, 1);
9776 strcpy(propNameM, "__ecerePropM_");
9777 FullClassNameCat(propNameM, prop->_class->fullName, 0);
9778 strcat(propNameM, "_");
9779 FullClassNameCat(propNameM, prop->name, 1);
9780 if(prop->isWatchable)
9781 {
9782 args = MkList();
9783 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9784 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9785 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9786 args = MkList();
9787 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9788 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9789 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9790 DeclareFunctionUtil(curExternal, "eInstance_FireWatchers");
9791 }
9792 {
9793 args = MkList();
9794 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9795 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9796 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9797 args = MkList();
9798 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9799 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9800 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9801 DeclareFunctionUtil(curExternal, "eInstance_FireSelfWatchers");
9802 }
9803 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
9804 curFunction->propSet->fireWatchersDone = 1;
9805 }
9806
9807 struct __ecereNameSpace__ecere__com__SubModule;
9808
9809 struct __ecereNameSpace__ecere__com__SubModule
9810 {
9811 struct __ecereNameSpace__ecere__com__SubModule * prev;
9812 struct __ecereNameSpace__ecere__com__SubModule * next;
9813 struct __ecereNameSpace__ecere__com__Instance * module;
9814 int importMode;
9815 } __attribute__ ((gcc_struct));
9816
9817 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
9818 {
9819 struct __ecereNameSpace__ecere__com__SubModule * subModule;
9820
9821 if(searchFor == searchIn)
9822 return 1;
9823 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
9824 {
9825 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
9826 {
9827 if(ModuleVisibility(subModule->module, searchFor))
9828 return 1;
9829 }
9830 }
9831 return 0;
9832 }
9833
9834 void ProcessExpressionType(struct Expression *  exp);
9835
9836 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
9837 {
9838 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
9839 {
9840 struct Identifier * id = exp->__anon1.__anon1.identifier;
9841 struct Context * ctx;
9842 struct Symbol * symbol = (((void *)0));
9843
9844 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
9845 {
9846 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
9847 {
9848 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
9849 if(symbol)
9850 break;
9851 }
9852 }
9853 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))))
9854 {
9855 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
9856 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9857 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9858 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9859
9860 if(!prop)
9861 {
9862 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
9863 }
9864 if(!prop && !method)
9865 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
9866 if(!prop && !method && !member)
9867 {
9868 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
9869 }
9870 if(prop || method || member || classProp)
9871 {
9872 exp->type = 8;
9873 exp->__anon1.member.member = id;
9874 exp->__anon1.member.memberType = 0;
9875 exp->__anon1.member.exp = QMkExpId("this");
9876 exp->addedThis = 1;
9877 }
9878 else if(_class && _class->templateParams.first)
9879 {
9880 struct __ecereNameSpace__ecere__com__Class * sClass;
9881
9882 for(sClass = _class; sClass; sClass = sClass->base)
9883 {
9884 if(sClass->templateParams.first)
9885 {
9886 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9887
9888 for(param = sClass->templateParams.first; param; param = param->next)
9889 {
9890 if(param->type == 2 && !strcmp(param->name, id->string))
9891 {
9892 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
9893
9894 if(argExp)
9895 {
9896 struct Declarator * decl;
9897 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
9898
9899 FreeIdentifier(exp->__anon1.member.member);
9900 ProcessExpressionType(argExp);
9901 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
9902 exp->expType = ProcessType(specs, decl);
9903 exp->type = 5;
9904 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
9905 }
9906 }
9907 }
9908 }
9909 }
9910 }
9911 }
9912 }
9913 }
9914
9915 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9916 {
9917 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9918
9919 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9920 {
9921 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9922 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9923 else
9924 {
9925 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9926 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9927 struct Type * type;
9928 void * ptr = inst->data + dataMember->offset + offset;
9929 char * result = (((void *)0));
9930
9931 exp->loc = member->loc = inst->loc;
9932 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9933 if(!dataMember->dataType)
9934 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
9935 type = dataMember->dataType;
9936 if(type->kind == 8)
9937 {
9938 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
9939
9940 if(_class->type == 4)
9941 {
9942 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9943
9944 if(enumClass)
9945 {
9946 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9947 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
9948
9949 for(item = e->values.first; item; item = item->next)
9950 {
9951 if(item->data == GetEnumValue(_class, ptr))
9952 {
9953 result = item->name;
9954 break;
9955 }
9956 }
9957 if(result)
9958 {
9959 exp->__anon1.__anon1.identifier = MkIdentifier(result);
9960 exp->type = 0;
9961 exp->destType = MkClassType(_class->fullName);
9962 ProcessExpressionType(exp);
9963 }
9964 }
9965 }
9966 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9967 {
9968 if(!_class->dataType)
9969 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
9970 type = _class->dataType;
9971 }
9972 }
9973 if(!result)
9974 {
9975 switch(type->kind)
9976 {
9977 case 6:
9978 {
9979 FreeExpContents(exp);
9980 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
9981 exp->type = 2;
9982 break;
9983 }
9984 case 7:
9985 {
9986 FreeExpContents(exp);
9987 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
9988 exp->type = 2;
9989 break;
9990 }
9991 case 3:
9992 {
9993 FreeExpContents(exp);
9994 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
9995 exp->type = 2;
9996 break;
9997 }
9998 case 4:
9999 {
10000 FreeExpContents(exp);
10001 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10002 exp->type = 2;
10003 break;
10004 }
10005 case 22:
10006 {
10007 FreeExpContents(exp);
10008 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10009 exp->type = 2;
10010 break;
10011 }
10012 case 23:
10013 {
10014 FreeExpContents(exp);
10015 exp->__anon1.__anon1.constant = PrintInt64((long long)*(ssize_t *)ptr);
10016 exp->type = 2;
10017 break;
10018 }
10019 default:
10020 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10021 }
10022 }
10023 ListAdd(memberList, member);
10024 }
10025 if(parentDataMember->type == 1)
10026 break;
10027 }
10028 }
10029
10030 void CheckTemplateTypes(struct Expression * exp)
10031 {
10032 struct Expression * nbExp = GetNonBracketsExp(exp);
10033
10034 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
10035 {
10036 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10037 struct Context * context;
10038 int kind = exp->expType->kind;
10039
10040 *newExp = *exp;
10041 if(exp->destType)
10042 exp->destType->refCount++;
10043 if(exp->expType)
10044 exp->expType->refCount++;
10045 newExp->prev = (((void *)0));
10046 newExp->next = (((void *)0));
10047 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10048 {
10049 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10050
10051 if(c->type == 2 || c->type == 4 || c->type == 3)
10052 {
10053 if(!c->dataType)
10054 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10055 kind = c->dataType->kind;
10056 }
10057 }
10058 switch(kind)
10059 {
10060 case 7:
10061 if(exp->destType->classObjectType)
10062 {
10063 if(exp->destType)
10064 exp->destType->refCount--;
10065 if(exp->expType)
10066 exp->expType->refCount--;
10067 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10068 }
10069 else
10070 {
10071 struct __ecereNameSpace__ecere__sys__OldList * specs;
10072 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10073 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10074
10075 context = PushContext();
10076 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10077 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10078 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10079 exp->type = 23;
10080 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10081 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10082 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10083 exp->__anon1.compound->__anon1.compound.context = context;
10084 PopContext(context);
10085 }
10086 break;
10087 default:
10088 exp->type = 11;
10089 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10090 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))
10091 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
10092 else
10093 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10094 exp->needCast = 1;
10095 break;
10096 }
10097 }
10098 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10099 {
10100 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10101 struct Context * context;
10102 int kind = exp->expType->kind;
10103
10104 *newExp = *exp;
10105 if(exp->destType)
10106 exp->destType->refCount++;
10107 if(exp->expType)
10108 exp->expType->refCount++;
10109 newExp->prev = (((void *)0));
10110 newExp->next = (((void *)0));
10111 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10112 {
10113 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10114
10115 if(c->type == 2 || c->type == 4 || c->type == 3)
10116 {
10117 if(!c->dataType)
10118 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10119 kind = c->dataType->kind;
10120 }
10121 }
10122 switch(kind)
10123 {
10124 case 7:
10125 if(exp->destType->classObjectType)
10126 {
10127 if(exp->destType)
10128 exp->destType->refCount--;
10129 if(exp->expType)
10130 exp->expType->refCount--;
10131 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10132 }
10133 else
10134 {
10135 struct __ecereNameSpace__ecere__sys__OldList * specs;
10136 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10137 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10138
10139 context = PushContext();
10140 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10141 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10142 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10143 exp->type = 23;
10144 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10145 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10146 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10147 exp->__anon1.compound->__anon1.compound.context = context;
10148 PopContext(context);
10149 }
10150 break;
10151 case 8:
10152 {
10153 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
10154 {
10155 exp->type = 5;
10156 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10157 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)));
10158 ProcessExpressionType((*exp->__anon1.list).first);
10159 break;
10160 }
10161 else
10162 {
10163 exp->type = 5;
10164 if(__ecereProp_Type_Get_isPointerType(exp->expType))
10165 {
10166 exp->needTemplateCast = 2;
10167 newExp->needCast = 1;
10168 newExp->needTemplateCast = 2;
10169 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10170 }
10171 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
10172 exp->needTemplateCast = 2;
10173 newExp->needCast = 1;
10174 newExp->needTemplateCast = 2;
10175 ProcessExpressionType((*exp->__anon1.list).first);
10176 break;
10177 }
10178 }
10179 default:
10180 {
10181 if(exp->expType->kind == 20)
10182 {
10183 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
10184
10185 if(type)
10186 {
10187 FreeType(exp->destType);
10188 FreeType(exp->expType);
10189 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10190 break;
10191 }
10192 }
10193 {
10194 char typeString[1024];
10195 struct Declarator * decl;
10196 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10197
10198 typeString[0] = '\0';
10199 PrintType(exp->expType, typeString, 0, 0);
10200 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10201 exp->type = 11;
10202 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
10203 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10204 exp->__anon1.cast.exp->needCast = 1;
10205 exp->needTemplateCast = 2;
10206 newExp->needTemplateCast = 2;
10207 }
10208 break;
10209 }
10210 }
10211 }
10212 }
10213
10214 static void ProcessInitializer(struct Initializer * init, struct Type * type)
10215 {
10216 switch(init->type)
10217 {
10218 case 0:
10219 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
10220 {
10221 if(init->__anon1.exp && !init->__anon1.exp->destType)
10222 {
10223 FreeType(init->__anon1.exp->destType);
10224 init->__anon1.exp->destType = type;
10225 if(type)
10226 type->refCount++;
10227 }
10228 if(init->__anon1.exp)
10229 {
10230 ProcessExpressionType(init->__anon1.exp);
10231 init->isConstant = init->__anon1.exp->isConstant;
10232 }
10233 break;
10234 }
10235 else
10236 {
10237 struct Expression * exp = init->__anon1.exp;
10238 struct Instantiation * inst = exp->__anon1.instance;
10239 struct MembersInit * members;
10240
10241 init->type = 1;
10242 init->__anon1.list = MkList();
10243 if(inst->members)
10244 {
10245 for(members = (*inst->members).first; members; members = members->next)
10246 {
10247 if(members->type == 0)
10248 {
10249 struct MemberInit * member;
10250
10251 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
10252 {
10253 ListAdd(init->__anon1.list, member->initializer);
10254 member->initializer = (((void *)0));
10255 }
10256 }
10257 }
10258 }
10259 FreeExpression(exp);
10260 }
10261 case 1:
10262 {
10263 struct Initializer * i;
10264 struct Type * initializerType = (((void *)0));
10265 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10266 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10267 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10268 int subMemberStackPos = 0;
10269
10270 if(type && type->kind == 12)
10271 initializerType = Dereference(type);
10272 else if(type && (type->kind == 9 || type->kind == 10))
10273 initializerType = type->__anon1.__anon1.members.first;
10274 for(i = (*init->__anon1.list).first; i; i = i->next)
10275 {
10276 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
10277 {
10278 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10279 if(curMember)
10280 {
10281 if(!curMember->dataType)
10282 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
10283 initializerType = curMember->dataType;
10284 }
10285 }
10286 ProcessInitializer(i, initializerType);
10287 if(initializerType && type && (type->kind == 9 || type->kind == 10))
10288 initializerType = initializerType->next;
10289 if(!i->isConstant)
10290 init->isConstant = 0;
10291 }
10292 if(type && type->kind == 12)
10293 FreeType(initializerType);
10294 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))
10295 {
10296 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
10297 }
10298 break;
10299 }
10300 }
10301 }
10302
10303 void PopulateInstance(struct Instantiation * inst)
10304 {
10305 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
10306 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
10307 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10308 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10309
10310 if(!inst->members)
10311 inst->members = MkListOne(MkMembersInitList(memberList));
10312 else
10313 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10314 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10315 {
10316 if(!dataMember->isProperty)
10317 {
10318 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10319 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10320 else
10321 {
10322 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10323 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10324 struct Type * type;
10325 void * ptr = inst->data + dataMember->offset;
10326 char * result = (((void *)0));
10327
10328 exp->loc = member->loc = inst->loc;
10329 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10330 if(!dataMember->dataType)
10331 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10332 type = dataMember->dataType;
10333 if(type->kind == 8)
10334 {
10335 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
10336
10337 if(_class->type == 4)
10338 {
10339 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10340
10341 if(enumClass)
10342 {
10343 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10344 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
10345
10346 for(item = e->values.first; item; item = item->next)
10347 {
10348 if(item->data == GetEnumValue(_class, ptr))
10349 {
10350 result = item->name;
10351 break;
10352 }
10353 }
10354 }
10355 if(result)
10356 {
10357 exp->__anon1.__anon1.identifier = MkIdentifier(result);
10358 exp->type = 0;
10359 exp->destType = MkClassType(_class->fullName);
10360 ProcessExpressionType(exp);
10361 }
10362 }
10363 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10364 {
10365 if(!_class->dataType)
10366 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
10367 type = _class->dataType;
10368 }
10369 }
10370 if(!result)
10371 {
10372 switch(type->kind)
10373 {
10374 case 6:
10375 {
10376 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10377 exp->type = 2;
10378 break;
10379 }
10380 case 7:
10381 {
10382 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10383 exp->type = 2;
10384 break;
10385 }
10386 case 3:
10387 {
10388 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10389 exp->type = 2;
10390 break;
10391 }
10392 case 4:
10393 {
10394 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10395 exp->type = 2;
10396 break;
10397 }
10398 case 22:
10399 {
10400 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10401 exp->type = 2;
10402 break;
10403 }
10404 default:
10405 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10406 }
10407 }
10408 ListAdd(memberList, member);
10409 }
10410 }
10411 }
10412 }
10413
10414 int ComputeTypeSize(struct Type *  type);
10415
10416 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
10417 {
10418 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10419 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10420
10421 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))
10422 {
10423 int unionMemberOffset = 0;
10424 int bitFields = 0;
10425
10426 if(member)
10427 {
10428 member->memberOffset = 0;
10429 if(targetBits < sizeof(void *) * 8)
10430 member->structAlignment = (short)0;
10431 }
10432 else if(targetBits < sizeof(void *) * 8)
10433 _class->structAlignment = (short)0;
10434 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
10435 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
10436 if(!member && _class->destructionWatchOffset)
10437 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10438 {
10439 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10440
10441 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10442 {
10443 if(!dataMember->isProperty)
10444 {
10445 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
10446 {
10447 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10448 }
10449 }
10450 }
10451 }
10452 {
10453 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10454
10455 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10456 {
10457 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
10458 {
10459 if(!isMember && _class->type == 2 && dataMember->dataType)
10460 {
10461 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10462 uint64 mask = 0;
10463 int d;
10464
10465 ComputeTypeSize(dataMember->dataType);
10466 if(bitMember->pos == -1)
10467 bitMember->pos = _class->memberOffset;
10468 if(!bitMember->size)
10469 bitMember->size = dataMember->dataType->size * 8;
10470 _class->memberOffset = bitMember->pos + bitMember->size;
10471 for(d = 0; d < bitMember->size; d++)
10472 {
10473 if(d)
10474 mask <<= 1;
10475 mask |= 1;
10476 }
10477 bitMember->mask = mask << bitMember->pos;
10478 }
10479 else if(dataMember->type == 0 && dataMember->dataType)
10480 {
10481 int size;
10482 int alignment = 0;
10483
10484 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)))
10485 ComputeTypeSize(dataMember->dataType);
10486 if(dataMember->dataType->bitFieldCount)
10487 {
10488 bitFields += dataMember->dataType->bitFieldCount;
10489 size = 0;
10490 }
10491 else
10492 {
10493 if(bitFields)
10494 {
10495 int size = (bitFields + 7) / 8;
10496
10497 if(isMember)
10498 {
10499 int __simpleStruct0;
10500
10501 if(alignment)
10502 {
10503 short __simpleStruct0;
10504
10505 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10506 if(member->memberOffset % alignment)
10507 member->memberOffset += alignment - (member->memberOffset % alignment);
10508 }
10509 dataMember->offset = member->memberOffset;
10510 if(member->type == 1)
10511 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10512 else
10513 {
10514 member->memberOffset += size;
10515 }
10516 }
10517 else
10518 {
10519 if(alignment)
10520 {
10521 short __simpleStruct0;
10522
10523 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10524 if(_class->memberOffset % alignment)
10525 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10526 }
10527 dataMember->offset = _class->memberOffset;
10528 _class->memberOffset += size;
10529 }
10530 bitFields = 0;
10531 }
10532 size = dataMember->dataType->size;
10533 alignment = dataMember->dataType->alignment;
10534 }
10535 if(isMember)
10536 {
10537 int __simpleStruct0;
10538
10539 if(alignment)
10540 {
10541 short __simpleStruct0;
10542
10543 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10544 if(member->memberOffset % alignment)
10545 member->memberOffset += alignment - (member->memberOffset % alignment);
10546 }
10547 dataMember->offset = member->memberOffset;
10548 if(member->type == 1)
10549 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10550 else
10551 {
10552 member->memberOffset += size;
10553 }
10554 }
10555 else
10556 {
10557 if(alignment)
10558 {
10559 short __simpleStruct0;
10560
10561 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10562 if(_class->memberOffset % alignment)
10563 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10564 }
10565 dataMember->offset = _class->memberOffset;
10566 _class->memberOffset += size;
10567 }
10568 }
10569 else
10570 {
10571 int alignment;
10572
10573 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
10574 alignment = dataMember->structAlignment;
10575 if(isMember)
10576 {
10577 int __simpleStruct0;
10578
10579 if(alignment)
10580 {
10581 short __simpleStruct0;
10582
10583 if(member->memberOffset % alignment)
10584 member->memberOffset += alignment - (member->memberOffset % alignment);
10585 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10586 }
10587 dataMember->offset = member->memberOffset;
10588 if(member->type == 1)
10589 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10590 else
10591 member->memberOffset += dataMember->memberOffset;
10592 }
10593 else
10594 {
10595 if(alignment)
10596 {
10597 short __simpleStruct0;
10598
10599 if(_class->memberOffset % alignment)
10600 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10601 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10602 }
10603 dataMember->offset = _class->memberOffset;
10604 _class->memberOffset += dataMember->memberOffset;
10605 }
10606 }
10607 }
10608 }
10609 if(bitFields)
10610 {
10611 int alignment = 0;
10612 int size = (bitFields + 7) / 8;
10613
10614 if(isMember)
10615 {
10616 int __simpleStruct0;
10617
10618 if(alignment)
10619 {
10620 short __simpleStruct0;
10621
10622 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10623 if(member->memberOffset % alignment)
10624 member->memberOffset += alignment - (member->memberOffset % alignment);
10625 }
10626 if(member->type == 1)
10627 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10628 else
10629 {
10630 member->memberOffset += size;
10631 }
10632 }
10633 else
10634 {
10635 if(alignment)
10636 {
10637 short __simpleStruct0;
10638
10639 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10640 if(_class->memberOffset % alignment)
10641 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10642 }
10643 _class->memberOffset += size;
10644 }
10645 bitFields = 0;
10646 }
10647 }
10648 if(member && member->type == 1)
10649 {
10650 member->memberOffset = unionMemberOffset;
10651 }
10652 if(!isMember)
10653 {
10654 if(_class->type != 2)
10655 {
10656 int extra = 0;
10657
10658 if(_class->structAlignment)
10659 {
10660 if(_class->memberOffset % _class->structAlignment)
10661 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
10662 }
10663 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
10664 if(!member)
10665 {
10666 struct __ecereNameSpace__ecere__com__Property * prop;
10667
10668 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
10669 {
10670 if(prop->isProperty && prop->isWatchable)
10671 {
10672 prop->watcherOffset = _class->structSize;
10673 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10674 }
10675 }
10676 }
10677 {
10678 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
10679
10680 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
10681 {
10682 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
10683
10684 if(deriv->computeSize)
10685 {
10686 deriv->offset = _class->structSize;
10687 deriv->memberOffset = 0;
10688 deriv->structSize = deriv->offset;
10689 ComputeClassMembers(deriv, 0);
10690 }
10691 }
10692 }
10693 }
10694 }
10695 }
10696 if(context)
10697 FinishTemplatesContext(context);
10698 }
10699
10700 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)
10701 {
10702 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10703 unsigned int totalSize = 0;
10704 unsigned int maxSize = 0;
10705 int alignment;
10706 unsigned int size;
10707 struct __ecereNameSpace__ecere__com__DataMember * member;
10708 int anonID = 1;
10709 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10710
10711 if(addedPadding)
10712 *addedPadding = 0;
10713 if(!isMember && _class->base)
10714 {
10715 maxSize = _class->structSize;
10716 {
10717 if(_class->type == 1 || _class->type == 5)
10718 AddMembers(neededBy, declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
10719 else
10720 {
10721 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
10722
10723 if(maxSize > baseSize)
10724 maxSize -= baseSize;
10725 else
10726 maxSize = 0;
10727 }
10728 }
10729 }
10730 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
10731 {
10732 if(!member->isProperty)
10733 {
10734 switch(member->type)
10735 {
10736 case 0:
10737 {
10738 if(member->dataTypeString)
10739 {
10740 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
10741 struct Declarator * decl;
10742
10743 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
10744 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
10745 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
10746 if(!member->dataType)
10747 member->dataType = ProcessType(specs, decl);
10748 ReplaceThisClassSpecifiers(specs, topClass);
10749 {
10750 struct Type * type = ProcessType(specs, decl);
10751
10752 DeclareType(neededBy, member->dataType, 1, 0);
10753 FreeType(type);
10754 }
10755 ComputeTypeSize(member->dataType);
10756 size = member->dataType->size;
10757 alignment = member->dataType->alignment;
10758 if(alignment)
10759 {
10760 if(totalSize % alignment)
10761 totalSize += alignment - (totalSize % alignment);
10762 }
10763 totalSize += size;
10764 }
10765 break;
10766 }
10767 case 1:
10768 case 2:
10769 {
10770 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
10771 char id[100];
10772
10773 sprintf(id, "__anon%d", anonID++);
10774 size = 0;
10775 AddMembers(neededBy, list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
10776 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
10777 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
10778 alignment = member->structAlignment;
10779 if(alignment)
10780 {
10781 if(totalSize % alignment)
10782 totalSize += alignment - (totalSize % alignment);
10783 }
10784 totalSize += size;
10785 break;
10786 }
10787 }
10788 }
10789 }
10790 if(retSize)
10791 {
10792 unsigned int __simpleStruct0;
10793
10794 if(topMember && topMember->type == 1)
10795 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
10796 else
10797 *retSize += totalSize;
10798 }
10799 else if(totalSize < maxSize && _class->type != 1000)
10800 {
10801 int autoPadding = 0;
10802
10803 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
10804 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
10805 if(totalSize + autoPadding < maxSize)
10806 {
10807 char sizeString[50];
10808
10809 sprintf(sizeString, "%d", maxSize - totalSize);
10810 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
10811 if(addedPadding)
10812 *addedPadding = 1;
10813 }
10814 }
10815 if(context)
10816 FinishTemplatesContext(context);
10817 return topMember ? topMember->memberID : _class->memberID;
10818 }
10819
10820 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)
10821 {
10822 if(source && dest)
10823 {
10824 if(warnConst)
10825 CheckConstCompatibility(source, dest, 1);
10826 if(source->kind == 20 && dest->kind != 20)
10827 {
10828 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
10829
10830 if(type)
10831 source = type;
10832 }
10833 if(dest->kind == 20 && source->kind != 20)
10834 {
10835 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
10836
10837 if(type)
10838 dest = type;
10839 }
10840 if(dest->classObjectType == 2 && dest->kind != 11)
10841 {
10842 if(source->classObjectType != 3)
10843 return 1;
10844 else
10845 {
10846 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
10847 {
10848 return 1;
10849 }
10850 }
10851 }
10852 else
10853 {
10854 if(source->kind != 11 && source->classObjectType == 3)
10855 return 1;
10856 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
10857 return 1;
10858 }
10859 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
10860 {
10861 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))
10862 return 1;
10863 }
10864 if(dest->kind == 14 && source->kind != 0)
10865 return 1;
10866 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))
10867 return 1;
10868 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))
10869 return 1;
10870 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
10871 {
10872 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
10873 {
10874 if(conversions != (((void *)0)))
10875 {
10876 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
10877 return 1;
10878 }
10879 else
10880 {
10881 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
10882
10883 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
10884 ;
10885 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
10886 ;
10887 if(sourceBase == destBase)
10888 return 1;
10889 }
10890 }
10891 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))
10892 return 1;
10893 else
10894 {
10895 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))
10896 {
10897 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
10898 {
10899 return 1;
10900 }
10901 }
10902 }
10903 }
10904 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
10905 return 1;
10906 if(doConversion)
10907 {
10908 if(source->kind == 8)
10909 {
10910 struct __ecereNameSpace__ecere__com__Class * _class;
10911
10912 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10913 {
10914 struct __ecereNameSpace__ecere__com__Property * convert;
10915
10916 for(convert = _class->conversions.first; convert; convert = convert->next)
10917 {
10918 if(convert->memberAccess == 1 || _class->module == privateModule)
10919 {
10920 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10921
10922 if(!convert->dataType)
10923 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10924 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))
10925 {
10926 if(!conversions && !convert->Get)
10927 return 1;
10928 else if(conversions != (((void *)0)))
10929 {
10930 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))
10931 return 1;
10932 else
10933 {
10934 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10935
10936 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10937 return 1;
10938 }
10939 }
10940 }
10941 }
10942 }
10943 }
10944 }
10945 if(dest->kind == 8)
10946 {
10947 struct __ecereNameSpace__ecere__com__Class * _class;
10948
10949 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10950 {
10951 struct __ecereNameSpace__ecere__com__Property * convert;
10952
10953 for(convert = _class->conversions.first; convert; convert = convert->next)
10954 {
10955 if(convert->memberAccess == 1 || _class->module == privateModule)
10956 {
10957 struct Type * constType = (((void *)0));
10958 unsigned int success = 0;
10959
10960 if(!convert->dataType)
10961 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10962 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
10963 {
10964 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10965
10966 constType = __extension__ ({
10967 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10968
10969 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
10970 });
10971 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
10972 ptrType->constant = 1;
10973 }
10974 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
10975 {
10976 if(!conversions && !convert->Set)
10977 success = 1;
10978 else if(conversions != (((void *)0)))
10979 {
10980 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))
10981 success = 1;
10982 else
10983 {
10984 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
10985
10986 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
10987 success = 1;
10988 }
10989 }
10990 }
10991 if(constType)
10992 FreeType(constType);
10993 if(success)
10994 return 1;
10995 }
10996 }
10997 }
10998 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
10999 {
11000 if(!dest->__anon1._class->__anon1.registered->dataType)
11001 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
11002 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
11003 {
11004 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))
11005 {
11006 return 1;
11007 }
11008 }
11009 }
11010 }
11011 if(source->kind == 8)
11012 {
11013 struct __ecereNameSpace__ecere__com__Class * _class;
11014
11015 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
11016 {
11017 struct __ecereNameSpace__ecere__com__Property * convert;
11018
11019 for(convert = _class->conversions.first; convert; convert = convert->next)
11020 {
11021 if(convert->memberAccess == 1 || _class->module == privateModule)
11022 {
11023 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
11024
11025 if(!convert->dataType)
11026 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
11027 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))
11028 {
11029 if(!conversions && !convert->Get)
11030 return 1;
11031 else if(conversions != (((void *)0)))
11032 {
11033 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))
11034 return 1;
11035 else
11036 {
11037 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
11038
11039 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
11040 return 1;
11041 }
11042 }
11043 }
11044 }
11045 }
11046 }
11047 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
11048 {
11049 if(!source->__anon1._class->__anon1.registered->dataType)
11050 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
11051 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
11052 {
11053 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))
11054 return 1;
11055 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
11056 return 1;
11057 }
11058 }
11059 }
11060 }
11061 if(source->kind == 8 || source->kind == 19)
11062 ;
11063 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
11064 return 1;
11065 else if(dest->kind == 7 && source->kind == 6)
11066 return 1;
11067 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
11068 return 1;
11069 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
11070 return 1;
11071 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
11072 return 1;
11073 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
11074 return 1;
11075 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
11076 return 1;
11077 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))
11078 return 1;
11079 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))
11080 return 1;
11081 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)))
11082 {
11083 struct Type * paramSource, * paramDest;
11084
11085 if(dest->kind == 16)
11086 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
11087 if(source->kind == 16)
11088 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
11089 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
11090 dest = dest->__anon1.type;
11091 if(source->kind == 13 && source->__anon1.type->kind == 11)
11092 source = source->__anon1.type;
11093 if(dest->kind == 16)
11094 dest = dest->__anon1.__anon3.method->dataType;
11095 if(source->kind == 16)
11096 source = source->__anon1.__anon3.method->dataType;
11097 paramSource = source->__anon1.__anon2.params.first;
11098 if(paramSource && paramSource->kind == 0)
11099 paramSource = (((void *)0));
11100 paramDest = dest->__anon1.__anon2.params.first;
11101 if(paramDest && paramDest->kind == 0)
11102 paramDest = (((void *)0));
11103 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11104 {
11105 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))))
11106 {
11107 if(paramDest && paramDest->kind == 8)
11108 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
11109 else
11110 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
11111 return 0;
11112 }
11113 paramDest = paramDest->next;
11114 }
11115 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
11116 {
11117 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11118 {
11119 if(dest->__anon1.__anon2.thisClass)
11120 {
11121 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
11122 {
11123 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11124 return 0;
11125 }
11126 }
11127 else
11128 {
11129 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
11130 {
11131 if(owningClassDest)
11132 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
11133 else
11134 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
11135 return 0;
11136 }
11137 }
11138 paramSource = paramSource->next;
11139 }
11140 else
11141 {
11142 if(dest->__anon1.__anon2.thisClass)
11143 {
11144 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
11145 {
11146 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11147 return 0;
11148 }
11149 }
11150 else
11151 {
11152 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
11153 {
11154 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
11155 return 0;
11156 }
11157 }
11158 }
11159 }
11160 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
11161 {
11162 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
11163 return 0;
11164 }
11165 else
11166 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
11167 for(; paramDest; paramDest = paramDest->next)
11168 {
11169 if(!paramSource)
11170 {
11171 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
11172 return 0;
11173 }
11174 {
11175 struct Type * paramDestType = paramDest;
11176 struct Type * paramSourceType = paramSource;
11177 struct Type * type = paramDestType;
11178
11179 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
11180 {
11181 int id = 0;
11182 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
11183 struct __ecereNameSpace__ecere__com__Class * sClass;
11184
11185 for(sClass = owningClassSource; sClass; sClass = sClass->base)
11186 {
11187 id = 0;
11188 if(sClass->templateClass)
11189 sClass = sClass->templateClass;
11190 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
11191 {
11192 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
11193 {
11194 for(sClass = sClass->base; sClass; sClass = sClass->base)
11195 {
11196 if(sClass->templateClass)
11197 sClass = sClass->templateClass;
11198 id += sClass->templateParams.count;
11199 }
11200 break;
11201 }
11202 id++;
11203 }
11204 if(curParam)
11205 break;
11206 }
11207 if(curParam)
11208 {
11209 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
11210
11211 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
11212 }
11213 }
11214 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)))
11215 {
11216 char type[1024];
11217
11218 type[0] = (char)0;
11219 PrintType(paramDest, type, 0, 1);
11220 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
11221 if(paramDestType != paramDest)
11222 FreeType(paramDestType);
11223 return 0;
11224 }
11225 if(paramDestType != paramDest)
11226 FreeType(paramDestType);
11227 }
11228 paramSource = paramSource->next;
11229 }
11230 if(paramSource)
11231 {
11232 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
11233 return 0;
11234 }
11235 return 1;
11236 }
11237 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
11238 {
11239 return 1;
11240 }
11241 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
11242 {
11243 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))
11244 {
11245 ComputeTypeSize(source->__anon1.type);
11246 ComputeTypeSize(dest->__anon1.type);
11247 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))
11248 return 1;
11249 }
11250 }
11251 }
11252 return 0;
11253 }
11254
11255 void ComputeInstantiation(struct Expression * exp)
11256 {
11257 struct Instantiation * inst = exp->__anon1.instance;
11258 struct MembersInit * members;
11259 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11260 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11261 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11262 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11263 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11264 int subMemberStackPos = 0;
11265 uint64 bits = 0;
11266
11267 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11268 {
11269 if(inst->data)
11270 return ;
11271 if(_class->type == 0 || _class->type == 5)
11272 {
11273 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11274 if(_class->type == 0)
11275 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11276 }
11277 else
11278 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11279 }
11280 if(inst->members)
11281 {
11282 for(members = (*inst->members).first; members; members = members->next)
11283 {
11284 switch(members->type)
11285 {
11286 case 0:
11287 {
11288 if(members->__anon1.dataMembers)
11289 {
11290 struct MemberInit * member;
11291
11292 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11293 {
11294 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11295 unsigned int found = 0;
11296 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11297 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11298 unsigned int dataMemberOffset;
11299
11300 if(!ident)
11301 {
11302 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11303 if(curMember)
11304 {
11305 if(curMember->isProperty)
11306 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11307 else
11308 {
11309 dataMember = curMember;
11310 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11311 if(_class->type == 0)
11312 dataMemberOffset += _class->base->structSize;
11313 }
11314 found = 1;
11315 }
11316 }
11317 else
11318 {
11319 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11320 if(prop)
11321 {
11322 found = 1;
11323 if(prop->memberAccess == 1)
11324 {
11325 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11326 curClass = prop->_class;
11327 }
11328 }
11329 else
11330 {
11331 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11332 int _subMemberStackPos = 0;
11333
11334 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11335 if(dataMember)
11336 {
11337 found = 1;
11338 if(dataMember->memberAccess == 1)
11339 {
11340 curMember = dataMember;
11341 curClass = dataMember->_class;
11342 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11343 subMemberStackPos = _subMemberStackPos;
11344 }
11345 }
11346 }
11347 }
11348 if(found && member->initializer && member->initializer->type == 0)
11349 {
11350 struct Expression * value = member->initializer->__anon1.exp;
11351 struct Type * type = (((void *)0));
11352 unsigned int deepMember = 0;
11353
11354 if(prop)
11355 {
11356 type = prop->dataType;
11357 }
11358 else if(dataMember)
11359 {
11360 if(!dataMember->dataType)
11361 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11362 type = dataMember->dataType;
11363 }
11364 if(ident && ident->next)
11365 {
11366 deepMember = 1;
11367 for(ident = ident->next; ident && type; ident = ident->next)
11368 {
11369 if(type->kind == 8)
11370 {
11371 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11372 if(prop)
11373 type = prop->dataType;
11374 else
11375 {
11376 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11377 if(dataMember)
11378 type = dataMember->dataType;
11379 }
11380 }
11381 else if(type->kind == 9 || type->kind == 10)
11382 {
11383 struct Type * memberType;
11384
11385 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11386 {
11387 if(!strcmp(memberType->name, ident->string))
11388 {
11389 type = memberType;
11390 break;
11391 }
11392 }
11393 }
11394 }
11395 }
11396 if(value)
11397 {
11398 FreeType(value->destType);
11399 value->destType = type;
11400 if(type)
11401 type->refCount++;
11402 ComputeExpression(value);
11403 }
11404 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11405 {
11406 if(type->kind == 8)
11407 {
11408 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11409
11410 if(_class && (_class->type == 2 || _class->type == 3 || _class->type == 4))
11411 {
11412 if(!_class->dataType)
11413 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11414 type = _class->dataType;
11415 }
11416 }
11417 if(dataMember)
11418 {
11419 void * ptr = inst->data + dataMemberOffset;
11420
11421 if(value->type == 2)
11422 {
11423 switch(type->kind)
11424 {
11425 case 3:
11426 {
11427 GetInt(value, (int *)ptr);
11428 break;
11429 }
11430 case 4:
11431 {
11432 GetInt64(value, (long long *)ptr);
11433 break;
11434 }
11435 case 22:
11436 {
11437 GetIntPtr(value, (intptr_t *)ptr);
11438 break;
11439 }
11440 case 23:
11441 {
11442 GetIntSize(value, (ssize_t *)ptr);
11443 break;
11444 }
11445 case 6:
11446 {
11447 GetFloat(value, (float *)ptr);
11448 break;
11449 }
11450 case 7:
11451 {
11452 GetDouble(value, (double *)ptr);
11453 break;
11454 }
11455 }
11456 }
11457 else if(value->type == 1)
11458 {
11459 if(type->kind == 8)
11460 {
11461 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11462
11463 if(_class->type == 1)
11464 {
11465 ComputeTypeSize(type);
11466 if(value->__anon1.instance->data)
11467 memcpy(ptr, value->__anon1.instance->data, type->size);
11468 }
11469 }
11470 }
11471 }
11472 else if(prop && prop->Set != (void *)(intptr_t)1)
11473 {
11474 if(value->type == 1 && value->__anon1.instance->data)
11475 {
11476 if(type->kind == 8)
11477 {
11478 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11479
11480 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)))
11481 {
11482 void (* Set)(void *, void *) = (void *)prop->Set;
11483
11484 Set(inst->data, value->__anon1.instance->data);
11485 PopulateInstance(inst);
11486 }
11487 }
11488 }
11489 else if(value->type == 2)
11490 {
11491 switch(type->kind)
11492 {
11493 case 7:
11494 {
11495 void (* Set)(void *, double) = (void *)prop->Set;
11496
11497 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11498 break;
11499 }
11500 case 6:
11501 {
11502 void (* Set)(void *, float) = (void *)prop->Set;
11503
11504 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11505 break;
11506 }
11507 case 3:
11508 {
11509 void (* Set)(void *, int) = (void *)prop->Set;
11510
11511 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11512 break;
11513 }
11514 case 4:
11515 {
11516 void (* Set)(void *, long long) = (void *)prop->Set;
11517
11518 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11519 break;
11520 }
11521 case 22:
11522 {
11523 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11524
11525 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11526 break;
11527 }
11528 case 23:
11529 {
11530 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11531
11532 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11533 break;
11534 }
11535 }
11536 }
11537 else if(value->type == 3)
11538 {
11539 char temp[1024];
11540
11541 ReadString(temp, value->__anon1.__anon2.string);
11542 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11543 }
11544 }
11545 }
11546 else if(!deepMember && type && _class->type == 3)
11547 {
11548 if(prop)
11549 {
11550 if(value->type == 2)
11551 {
11552 if(type->kind == 8)
11553 {
11554 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11555
11556 if(_class->type == 3)
11557 {
11558 if(!_class->dataType)
11559 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11560 type = _class->dataType;
11561 }
11562 }
11563 switch(type->kind)
11564 {
11565 case 6:
11566 {
11567 float fValue;
11568 float (* Set)(float) = (void *)prop->Set;
11569
11570 GetFloat(member->initializer->__anon1.exp, &fValue);
11571 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11572 exp->type = 2;
11573 break;
11574 }
11575 case 7:
11576 {
11577 double dValue;
11578 double (* Set)(double) = (void *)prop->Set;
11579
11580 GetDouble(member->initializer->__anon1.exp, &dValue);
11581 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11582 exp->type = 2;
11583 break;
11584 }
11585 }
11586 }
11587 }
11588 }
11589 else if(!deepMember && type && _class->type == 2)
11590 {
11591 if(prop)
11592 {
11593 if(value->type == 1 && value->__anon1.instance->data)
11594 {
11595 unsigned int (* Set)(void *) = (void *)prop->Set;
11596
11597 bits = Set(value->__anon1.instance->data);
11598 }
11599 else if(value->type == 2)
11600 {
11601 }
11602 }
11603 else if(dataMember)
11604 {
11605 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11606 struct Type * type;
11607 uint64 part = 0;
11608
11609 bits = (bits & ~bitMember->mask);
11610 if(!bitMember->dataType)
11611 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11612 type = bitMember->dataType;
11613 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11614 {
11615 if(!type->__anon1._class->__anon1.registered->dataType)
11616 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11617 type = type->__anon1._class->__anon1.registered->dataType;
11618 }
11619 switch(type->kind)
11620 {
11621 case 24:
11622 case 1:
11623 {
11624 unsigned char v;
11625
11626 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11627 part = (uint64)v;
11628 break;
11629 }
11630 case 2:
11631 {
11632 unsigned short v;
11633
11634 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11635 part = (uint64)v;
11636 break;
11637 }
11638 case 3:
11639 case 5:
11640 {
11641 unsigned int v;
11642
11643 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11644 part = (uint64)v;
11645 break;
11646 }
11647 case 4:
11648 {
11649 uint64 v;
11650
11651 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11652 part = v;
11653 break;
11654 }
11655 case 22:
11656 {
11657 uintptr_t v;
11658
11659 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11660 part = (uint64)v;
11661 break;
11662 }
11663 case 23:
11664 {
11665 size_t v;
11666
11667 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11668 part = (uint64)v;
11669 break;
11670 }
11671 }
11672 bits |= part << bitMember->pos;
11673 }
11674 }
11675 }
11676 else
11677 {
11678 if(_class && _class->type == 3)
11679 {
11680 ComputeExpression(member->initializer->__anon1.exp);
11681 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11682 exp->type = 2;
11683 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11684 }
11685 }
11686 }
11687 }
11688 break;
11689 }
11690 }
11691 }
11692 }
11693 if(_class && _class->type == 2)
11694 {
11695 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11696 exp->type = 2;
11697 }
11698 if(exp->type != 1)
11699 {
11700 FreeInstance(inst);
11701 }
11702 }
11703
11704 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11705 {
11706 if(exp->__anon1.op.op == SIZEOF)
11707 {
11708 FreeExpContents(exp);
11709 exp->type = 2;
11710 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11711 }
11712 else
11713 {
11714 if(!exp->__anon1.op.exp1)
11715 {
11716 switch(exp->__anon1.op.op)
11717 {
11718 case '+':
11719 {
11720 struct Expression * exp2 = exp->__anon1.op.exp2;
11721
11722 exp->__anon1.op.exp2 = (((void *)0));
11723 FreeExpContents(exp);
11724 FreeType(exp->expType);
11725 FreeType(exp->destType);
11726 *exp = *exp2;
11727 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11728 break;
11729 }
11730 case '-':
11731 if(op1->ops.Neg)
11732 {
11733 FreeExpContents(exp);
11734 op1->ops.Neg(exp, op1);
11735 }
11736 break;
11737 case '~':
11738 if(op1->ops.BitNot)
11739 {
11740 FreeExpContents(exp);
11741 op1->ops.BitNot(exp, op1);
11742 }
11743 break;
11744 case '!':
11745 if(op1->ops.Not)
11746 {
11747 FreeExpContents(exp);
11748 op1->ops.Not(exp, op1);
11749 }
11750 break;
11751 }
11752 }
11753 else
11754 {
11755 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11756 {
11757 if(Promote(op2, op1->kind, op1->type->isSigned))
11758 op2->kind = op1->kind, op2->ops = op1->ops;
11759 else if(Promote(op1, op2->kind, op2->type->isSigned))
11760 op1->kind = op2->kind, op1->ops = op2->ops;
11761 }
11762 switch(exp->__anon1.op.op)
11763 {
11764 case '+':
11765 if(op1->ops.Add)
11766 {
11767 FreeExpContents(exp);
11768 op1->ops.Add(exp, op1, op2);
11769 }
11770 break;
11771 case '-':
11772 if(op1->ops.Sub)
11773 {
11774 FreeExpContents(exp);
11775 op1->ops.Sub(exp, op1, op2);
11776 }
11777 break;
11778 case '*':
11779 if(op1->ops.Mul)
11780 {
11781 FreeExpContents(exp);
11782 op1->ops.Mul(exp, op1, op2);
11783 }
11784 break;
11785 case '/':
11786 if(op1->ops.Div)
11787 {
11788 FreeExpContents(exp);
11789 op1->ops.Div(exp, op1, op2);
11790 }
11791 break;
11792 case '%':
11793 if(op1->ops.Mod)
11794 {
11795 FreeExpContents(exp);
11796 op1->ops.Mod(exp, op1, op2);
11797 }
11798 break;
11799 case '&':
11800 if(exp->__anon1.op.exp2)
11801 {
11802 if(op1->ops.BitAnd)
11803 {
11804 FreeExpContents(exp);
11805 op1->ops.BitAnd(exp, op1, op2);
11806 }
11807 }
11808 break;
11809 case '|':
11810 if(op1->ops.BitOr)
11811 {
11812 FreeExpContents(exp);
11813 op1->ops.BitOr(exp, op1, op2);
11814 }
11815 break;
11816 case '^':
11817 if(op1->ops.BitXor)
11818 {
11819 FreeExpContents(exp);
11820 op1->ops.BitXor(exp, op1, op2);
11821 }
11822 break;
11823 case LEFT_OP:
11824 if(op1->ops.LShift)
11825 {
11826 FreeExpContents(exp);
11827 op1->ops.LShift(exp, op1, op2);
11828 }
11829 break;
11830 case RIGHT_OP:
11831 if(op1->ops.RShift)
11832 {
11833 FreeExpContents(exp);
11834 op1->ops.RShift(exp, op1, op2);
11835 }
11836 break;
11837 case EQ_OP:
11838 if(op1->ops.Equ)
11839 {
11840 FreeExpContents(exp);
11841 op1->ops.Equ(exp, op1, op2);
11842 }
11843 break;
11844 case NE_OP:
11845 if(op1->ops.Nqu)
11846 {
11847 FreeExpContents(exp);
11848 op1->ops.Nqu(exp, op1, op2);
11849 }
11850 break;
11851 case AND_OP:
11852 if(op1->ops.And)
11853 {
11854 FreeExpContents(exp);
11855 op1->ops.And(exp, op1, op2);
11856 }
11857 break;
11858 case OR_OP:
11859 if(op1->ops.Or)
11860 {
11861 FreeExpContents(exp);
11862 op1->ops.Or(exp, op1, op2);
11863 }
11864 break;
11865 case '>':
11866 if(op1->ops.Grt)
11867 {
11868 FreeExpContents(exp);
11869 op1->ops.Grt(exp, op1, op2);
11870 }
11871 break;
11872 case '<':
11873 if(op1->ops.Sma)
11874 {
11875 FreeExpContents(exp);
11876 op1->ops.Sma(exp, op1, op2);
11877 }
11878 break;
11879 case GE_OP:
11880 if(op1->ops.GrtEqu)
11881 {
11882 FreeExpContents(exp);
11883 op1->ops.GrtEqu(exp, op1, op2);
11884 }
11885 break;
11886 case LE_OP:
11887 if(op1->ops.SmaEqu)
11888 {
11889 FreeExpContents(exp);
11890 op1->ops.SmaEqu(exp, op1, op2);
11891 }
11892 break;
11893 }
11894 }
11895 }
11896 }
11897
11898 void ApplyAnyObjectLogic(struct Expression * e)
11899 {
11900 struct Type * destType = e->destType;
11901
11902 if(destType && (destType->classObjectType == 3))
11903 {
11904 if(e && e->expType)
11905 {
11906 struct Type * type = e->expType;
11907 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11908
11909 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11910 {
11911 _class = type->__anon1._class->__anon1.registered;
11912 }
11913 else if(type->kind == 19)
11914 {
11915 _class = FindClass("ecere::com::Class")->__anon1.registered;
11916 }
11917 else
11918 {
11919 char string[1024] = "";
11920 struct Symbol * classSym;
11921
11922 PrintTypeNoConst(type, string, 0, 1);
11923 classSym = FindClass(string);
11924 if(classSym)
11925 _class = classSym->__anon1.registered;
11926 }
11927 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)))
11928 {
11929 if(!_class || strcmp(_class->fullName, "char *"))
11930 {
11931 struct Expression * checkedExp = e, * newExp;
11932
11933 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11934 {
11935 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11936 {
11937 if(checkedExp->type == 23)
11938 {
11939 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11940 }
11941 else
11942 checkedExp = (*checkedExp->__anon1.list).last;
11943 }
11944 else if(checkedExp->type == 11)
11945 checkedExp = checkedExp->__anon1.cast.exp;
11946 }
11947 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
11948 {
11949 newExp = checkedExp->__anon1.op.exp2;
11950 checkedExp->__anon1.op.exp2 = (((void *)0));
11951 FreeExpContents(checkedExp);
11952 if(e->expType && e->expType->passAsTemplate)
11953 {
11954 char size[100];
11955
11956 ComputeTypeSize(e->expType);
11957 sprintf(size, "%d", e->expType->size);
11958 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))))));
11959 }
11960 ReplaceExpContents(checkedExp, newExp);
11961 e->byReference = 1;
11962 }
11963 else if(!e->byReference || (_class && _class->type == 5))
11964 {
11965 struct Expression * checkedExp;
11966
11967 {
11968 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;
11969
11970 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11971 {
11972 struct Context * context = PushContext();
11973 struct Declarator * decl;
11974 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11975 char typeString[1024];
11976 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11977
11978 typeString[0] = '\0';
11979 *newExp = *e;
11980 newExp->prev = (((void *)0));
11981 newExp->next = (((void *)0));
11982 newExp->expType = (((void *)0));
11983 PrintTypeNoConst(e->expType, typeString, 0, 1);
11984 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11985 newExp->destType = ProcessType(specs, decl);
11986 curContext = context;
11987 if(curCompound)
11988 {
11989 char name[100];
11990 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11991
11992 e->type = 23;
11993 sprintf(name, "__internalValue%03X", internalValueCounter++);
11994 if(!curCompound->__anon1.compound.declarations)
11995 curCompound->__anon1.compound.declarations = MkList();
11996 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11997 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11998 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11999 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
12000 }
12001 else
12002 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12003 {
12004 struct Type * type = e->destType;
12005
12006 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12007 CopyTypeInto(e->destType, type);
12008 e->destType->refCount = 1;
12009 e->destType->classObjectType = 0;
12010 FreeType(type);
12011 }
12012 e->__anon1.compound->__anon1.compound.context = context;
12013 PopContext(context);
12014 curContext = context->parent;
12015 }
12016 }
12017 checkedExp = e;
12018 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
12019 {
12020 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
12021 {
12022 if(checkedExp->type == 23)
12023 {
12024 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12025 }
12026 else
12027 checkedExp = (*checkedExp->__anon1.list).last;
12028 }
12029 else if(checkedExp->type == 11)
12030 checkedExp = checkedExp->__anon1.cast.exp;
12031 }
12032 {
12033 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12034
12035 *operand = *checkedExp;
12036 __ecereMethod_Expression_Clear(checkedExp);
12037 checkedExp->destType = ProcessTypeString("void *", 0);
12038 checkedExp->expType = checkedExp->destType;
12039 checkedExp->destType->refCount++;
12040 checkedExp->type = 4;
12041 checkedExp->__anon1.op.op = '&';
12042 checkedExp->__anon1.op.exp1 = (((void *)0));
12043 checkedExp->__anon1.op.exp2 = operand;
12044 }
12045 }
12046 }
12047 }
12048 }
12049 }
12050 {
12051 }
12052 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))))
12053 {
12054 if(e->expType->classObjectType && destType && destType->classObjectType)
12055 {
12056 return ;
12057 }
12058 else
12059 {
12060 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12061
12062 *thisExp = *e;
12063 thisExp->prev = (((void *)0));
12064 thisExp->next = (((void *)0));
12065 __ecereMethod_Expression_Clear(e);
12066 e->type = 5;
12067 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12068 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
12069 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
12070 {
12071 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12072 CopyTypeInto(e->expType, thisExp->expType);
12073 e->expType->byReference = 0;
12074 e->expType->refCount = 1;
12075 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))
12076 {
12077 e->expType->classObjectType = 0;
12078 }
12079 }
12080 }
12081 }
12082 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12083 {
12084 if(destType->kind == 14)
12085 {
12086 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
12087 }
12088 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))
12089 {
12090 unsigned int byReference = e->expType->byReference;
12091 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12092 struct Declarator * decl;
12093 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12094 char typeString[1024];
12095 struct Type * type;
12096 int backupClassObjectType;
12097 unsigned int backupByReference;
12098
12099 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
12100 type = e->expType;
12101 else
12102 type = destType;
12103 backupClassObjectType = type->classObjectType;
12104 backupByReference = type->byReference;
12105 type->classObjectType = 0;
12106 type->byReference = 0;
12107 typeString[0] = '\0';
12108 PrintType(type, typeString, 0, 1);
12109 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12110 type->classObjectType = backupClassObjectType;
12111 type->byReference = backupByReference;
12112 *thisExp = *e;
12113 thisExp->prev = (((void *)0));
12114 thisExp->next = (((void *)0));
12115 __ecereMethod_Expression_Clear(e);
12116 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)))
12117 {
12118 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
12119 struct Type * t;
12120
12121 destType->refCount++;
12122 e->type = 4;
12123 e->__anon1.op.op = '*';
12124 e->__anon1.op.exp1 = (((void *)0));
12125 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12126 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12127 CopyTypeInto(t, thisExp->destType);
12128 t->passAsTemplate = 0;
12129 FreeType(thisExp->destType);
12130 thisExp->destType = t;
12131 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12132 CopyTypeInto(t, destType);
12133 t->passAsTemplate = passAsTemplate;
12134 FreeType(destType);
12135 destType = t;
12136 destType->refCount = 0;
12137 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12138 CopyTypeInto(e->expType, type);
12139 if(type->passAsTemplate)
12140 {
12141 e->expType->classObjectType = 0;
12142 e->expType->passAsTemplate = 0;
12143 }
12144 e->expType->byReference = 0;
12145 e->expType->refCount = 1;
12146 }
12147 else
12148 {
12149 e->type = 11;
12150 e->__anon1.cast.typeName = MkTypeName(specs, decl);
12151 e->__anon1.cast.exp = thisExp;
12152 e->byReference = 1;
12153 e->expType = type;
12154 type->refCount++;
12155 }
12156 if(e->destType)
12157 FreeType(e->destType);
12158 e->destType = destType;
12159 destType->refCount++;
12160 }
12161 }
12162 }
12163
12164 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
12165 {
12166 struct __ecereNameSpace__ecere__com__Class * _class;
12167 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
12168
12169 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
12170 ComputeModuleClasses(subModule->data);
12171 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->classes.first; _class; _class = _class->next)
12172 ComputeClassMembers(_class, 0);
12173 }
12174
12175 int ComputeTypeSize(struct Type * type)
12176 {
12177 unsigned int size = type ? type->size : 0;
12178
12179 if(!size && type && !type->computing)
12180 {
12181 type->computing = 1;
12182 switch(type->kind)
12183 {
12184 case 24:
12185 type->alignment = size = sizeof(char);
12186 break;
12187 case 1:
12188 type->alignment = size = sizeof(char);
12189 break;
12190 case 3:
12191 type->alignment = size = sizeof(int);
12192 break;
12193 case 4:
12194 type->alignment = size = sizeof(long long);
12195 break;
12196 case 22:
12197 type->alignment = size = targetBits / 8;
12198 type->pointerAlignment = 1;
12199 break;
12200 case 23:
12201 type->alignment = size = targetBits / 8;
12202 type->pointerAlignment = 1;
12203 break;
12204 case 5:
12205 type->alignment = size = sizeof(long);
12206 break;
12207 case 2:
12208 type->alignment = size = sizeof(short);
12209 break;
12210 case 6:
12211 type->alignment = size = sizeof(float);
12212 break;
12213 case 7:
12214 type->alignment = size = sizeof(double);
12215 break;
12216 case 8:
12217 {
12218 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
12219
12220 if(_class && _class->type == 1)
12221 {
12222 ComputeClassMembers(_class, 0);
12223 type->alignment = _class->structAlignment;
12224 type->pointerAlignment = (unsigned int)_class->pointerAlignment;
12225 size = _class->structSize;
12226 if(type->alignment && size % type->alignment)
12227 size += type->alignment - (size % type->alignment);
12228 }
12229 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
12230 {
12231 if(!_class->dataType)
12232 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12233 size = type->alignment = ComputeTypeSize(_class->dataType);
12234 }
12235 else
12236 {
12237 size = type->alignment = targetBits / 8;
12238 type->pointerAlignment = 1;
12239 }
12240 break;
12241 }
12242 case 13:
12243 case 19:
12244 size = type->alignment = targetBits / 8;
12245 type->pointerAlignment = 1;
12246 break;
12247 case 12:
12248 if(type->__anon1.__anon4.arraySizeExp)
12249 {
12250 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
12251 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
12252 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)))
12253 {
12254 struct Location oldLoc = yylloc;
12255 char expression[10240];
12256
12257 expression[0] = '\0';
12258 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
12259 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
12260 if(inCompiler)
12261 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
12262 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
12263 yylloc = oldLoc;
12264 }
12265 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
12266 }
12267 else if(type->__anon1.__anon4.enumClass)
12268 {
12269 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
12270 {
12271 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
12272 }
12273 else
12274 type->__anon1.__anon4.arraySize = 0;
12275 }
12276 else
12277 {
12278 type->__anon1.__anon4.arraySize = 0;
12279 }
12280 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
12281 if(type->__anon1.type)
12282 {
12283 type->alignment = type->__anon1.type->alignment;
12284 type->pointerAlignment = type->__anon1.type->pointerAlignment;
12285 }
12286 break;
12287 case 9:
12288 {
12289 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12290 {
12291 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12292
12293 if(symbol && symbol->type)
12294 {
12295 ComputeTypeSize(symbol->type);
12296 size = symbol->type->size;
12297 }
12298 }
12299 else
12300 {
12301 struct Type * member;
12302
12303 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12304 {
12305 int __simpleStruct0, __simpleStruct1;
12306 unsigned int addSize = ComputeTypeSize(member);
12307
12308 member->offset = size;
12309 if(member->alignment && size % member->alignment)
12310 member->offset += member->alignment - (size % member->alignment);
12311 size = member->offset;
12312 if(member->pointerAlignment && type->size <= 4)
12313 type->pointerAlignment = 1;
12314 else if(!member->pointerAlignment && member->alignment >= 8)
12315 type->pointerAlignment = 0;
12316 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12317 size += addSize;
12318 }
12319 if(type->alignment && size % type->alignment)
12320 size += type->alignment - (size % type->alignment);
12321 }
12322 break;
12323 }
12324 case 10:
12325 {
12326 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12327 {
12328 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12329
12330 if(symbol && symbol->type)
12331 {
12332 ComputeTypeSize(symbol->type);
12333 size = symbol->type->size;
12334 type->alignment = symbol->type->alignment;
12335 }
12336 }
12337 else
12338 {
12339 struct Type * member;
12340
12341 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12342 {
12343 int __simpleStruct0, __simpleStruct1;
12344 unsigned int addSize = ComputeTypeSize(member);
12345
12346 member->offset = size;
12347 if(member->alignment && size % member->alignment)
12348 member->offset += member->alignment - (size % member->alignment);
12349 size = member->offset;
12350 if(member->pointerAlignment && type->size <= 4)
12351 type->pointerAlignment = 1;
12352 else if(!member->pointerAlignment && member->alignment >= 8)
12353 type->pointerAlignment = 0;
12354 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12355 size = ((size > addSize) ? size : addSize);
12356 }
12357 if(type->alignment && size % type->alignment)
12358 size += type->alignment - (size % type->alignment);
12359 }
12360 break;
12361 }
12362 case 20:
12363 {
12364 struct TemplateParameter * param = type->__anon1.templateParameter;
12365 struct Type * baseType = ProcessTemplateParameterType(param);
12366
12367 if(baseType)
12368 {
12369 size = ComputeTypeSize(baseType);
12370 type->alignment = baseType->alignment;
12371 type->pointerAlignment = baseType->pointerAlignment;
12372 }
12373 else
12374 type->alignment = size = sizeof(uint64);
12375 break;
12376 }
12377 case 15:
12378 {
12379 type->alignment = size = sizeof(enum
12380 {
12381 test
12382 });
12383 break;
12384 }
12385 case 21:
12386 {
12387 type->alignment = size = targetBits / 8;
12388 type->pointerAlignment = 1;
12389 break;
12390 }
12391 }
12392 type->size = size;
12393 type->computing = 0;
12394 }
12395 return size;
12396 }
12397
12398 struct External * _DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl)
12399 {
12400 struct External * external = (((void *)0));
12401 struct Symbol * classSym = FindClass(name);
12402 struct __ecereNameSpace__ecere__sys__OldList * curDeclarations = (((void *)0));
12403 struct Specifier * curSpec = (((void *)0));
12404
12405 if(!inCompiler || !classSym)
12406 return (((void *)0));
12407 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
12408 return (((void *)0));
12409 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
12410 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
12411 external = classSym->__anon2.__anon1.structExternal;
12412 if(external && external->__anon1.declaration)
12413 {
12414 struct Specifier * spec;
12415
12416 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12417 if(spec->type == 3 || spec->type == 4)
12418 {
12419 curSpec = spec;
12420 curDeclarations = spec->__anon1.__anon2.definitions;
12421 break;
12422 }
12423 }
12424 if(classSym->__anon1.registered && !classSym->declaring && classSym->imported && (!classSym->declaredStructSym || (classSym->__anon1.registered->type == 5 && !skipNoHead && external && !curDeclarations)))
12425 {
12426 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12427 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
12428 char structName[1024];
12429 unsigned int addedPadding = 0;
12430
12431 classSym->declaring++;
12432 if(strchr(classSym->string, '<'))
12433 {
12434 if(classSym->__anon1.registered->templateClass)
12435 {
12436 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
12437 classSym->declaring--;
12438 }
12439 return external;
12440 }
12441 structName[0] = (char)0;
12442 FullClassNameCat(structName, name, 0);
12443 classSym->declaredStructSym = 1;
12444 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
12445 {
12446 unsigned int add = 0;
12447
12448 if(!external)
12449 {
12450 external = MkExternalDeclaration((((void *)0)));
12451 classSym->__anon2.__anon1.structExternal = external;
12452 external->symbol = classSym;
12453 add = 1;
12454 }
12455 if(!skipNoHead)
12456 {
12457 declarations = MkList();
12458 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
12459 }
12460 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
12461 {
12462 FreeList(declarations, (void *)(FreeClassDef));
12463 declarations = (((void *)0));
12464 }
12465 if(classSym->__anon1.registered->type != 5 && !declarations)
12466 {
12467 FreeExternal(external);
12468 external = (((void *)0));
12469 classSym->__anon2.__anon1.structExternal = (((void *)0));
12470 }
12471 else
12472 {
12473 if(curSpec)
12474 curSpec->__anon1.__anon2.definitions = declarations;
12475 else
12476 {
12477 char className[1024];
12478
12479 strcpy(className, "__ecereClass_");
12480 FullClassNameCat(className, classSym->string, 1);
12481 specifiers = MkList();
12482 declarators = MkList();
12483 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
12484 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12485 }
12486 if(add)
12487 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12488 }
12489 }
12490 classSym->declaring--;
12491 }
12492 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
12493 {
12494 classSym->declaredStructSym = 1;
12495 if(classSym->__anon1.registered)
12496 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
12497 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
12498 {
12499 struct Specifier * spec;
12500
12501 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
12502 {
12503 if(spec->__anon1.__anon2.definitions)
12504 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
12505 }
12506 }
12507 }
12508 if(inCompiler && neededBy && (external || !classSym->imported))
12509 {
12510 if(!external)
12511 {
12512 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
12513 external->symbol = classSym;
12514 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12515 }
12516 if(fwdDecl)
12517 {
12518 struct External * e = external->fwdDecl ? external->fwdDecl : external;
12519
12520 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
12521 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
12522 }
12523 else
12524 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
12525 }
12526 return external;
12527 }
12528
12529 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)
12530 {
12531 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
12532 unsigned int found = 0;
12533 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
12534 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12535 unsigned int freeType = 0;
12536
12537 yylloc = member->loc;
12538 if(!ident)
12539 {
12540 if(curMember)
12541 {
12542 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
12543 if(*curMember)
12544 {
12545 found = 1;
12546 dataMember = *curMember;
12547 }
12548 }
12549 }
12550 else
12551 {
12552 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
12553 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
12554 int _subMemberStackPos = 0;
12555
12556 if(!thisMember)
12557 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
12558 if(thisMember)
12559 {
12560 dataMember = thisMember;
12561 if(curMember && thisMember->memberAccess == 1)
12562 {
12563 *curMember = thisMember;
12564 *curClass = thisMember->_class;
12565 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
12566 *subMemberStackPos = _subMemberStackPos;
12567 }
12568 found = 1;
12569 }
12570 else
12571 {
12572 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
12573 if(method && method->type == 1)
12574 found = 1;
12575 else
12576 method = (((void *)0));
12577 }
12578 }
12579 if(found)
12580 {
12581 struct Type * type = (((void *)0));
12582
12583 if(dataMember)
12584 {
12585 if(!dataMember->dataType && dataMember->dataTypeString)
12586 {
12587 struct Context * context = SetupTemplatesContext(_class);
12588
12589 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12590 FinishTemplatesContext(context);
12591 }
12592 type = dataMember->dataType;
12593 }
12594 else if(method)
12595 {
12596 if(!method->dataType)
12597 ProcessMethodType(method);
12598 type = method->dataType;
12599 }
12600 if(ident && ident->next)
12601 {
12602 for(ident = ident->next; ident && type; ident = ident->next)
12603 {
12604 if(type->kind == 8)
12605 {
12606 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
12607 if(!dataMember)
12608 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
12609 if(dataMember)
12610 type = dataMember->dataType;
12611 }
12612 else if(type->kind == 9 || type->kind == 10)
12613 {
12614 struct Type * memberType;
12615
12616 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
12617 {
12618 if(!strcmp(memberType->name, ident->string))
12619 {
12620 type = memberType;
12621 break;
12622 }
12623 }
12624 }
12625 }
12626 }
12627 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
12628 {
12629 int id = 0;
12630 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
12631 struct __ecereNameSpace__ecere__com__Class * sClass;
12632
12633 for(sClass = _class; sClass; sClass = sClass->base)
12634 {
12635 id = 0;
12636 if(sClass->templateClass)
12637 sClass = sClass->templateClass;
12638 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
12639 {
12640 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
12641 {
12642 for(sClass = sClass->base; sClass; sClass = sClass->base)
12643 {
12644 if(sClass->templateClass)
12645 sClass = sClass->templateClass;
12646 id += sClass->templateParams.count;
12647 }
12648 break;
12649 }
12650 id++;
12651 }
12652 if(curParam)
12653 break;
12654 }
12655 if(curParam)
12656 {
12657 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
12658
12659 if(arg.__anon1.__anon1.dataTypeString)
12660 {
12661 unsigned int constant = type->constant;
12662
12663 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
12664 if(type->kind == 8 && constant)
12665 type->constant = 1;
12666 else if(type->kind == 13)
12667 {
12668 struct Type * t = type->__anon1.type;
12669
12670 while(t->kind == 13)
12671 t = t->__anon1.type;
12672 if(constant)
12673 t->constant = constant;
12674 }
12675 freeType = 1;
12676 if(type && _class->templateClass)
12677 type->passAsTemplate = 1;
12678 if(type)
12679 {
12680 }
12681 }
12682 }
12683 }
12684 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
12685 {
12686 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
12687 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
12688 int paramCount = 0;
12689 int lastParam = -1;
12690 char templateString[1024];
12691 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
12692
12693 sprintf(templateString, "%s<", expClass->templateClass->fullName);
12694 for(cClass = expClass; cClass; cClass = cClass->base)
12695 {
12696 int p = 0;
12697
12698 if(cClass->templateClass)
12699 cClass = cClass->templateClass;
12700 for(param = cClass->templateParams.first; param; param = param->next)
12701 {
12702 int id = p;
12703 struct __ecereNameSpace__ecere__com__Class * sClass;
12704 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
12705
12706 for(sClass = cClass->base; sClass; sClass = sClass->base)
12707 {
12708 if(sClass->templateClass)
12709 sClass = sClass->templateClass;
12710 id += sClass->templateParams.count;
12711 }
12712 arg = expClass->templateArgs[id];
12713 for(sClass = _class; sClass; sClass = sClass->base)
12714 {
12715 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
12716 int p = 0;
12717 struct __ecereNameSpace__ecere__com__Class * nextClass;
12718
12719 if(sClass->templateClass)
12720 sClass = sClass->templateClass;
12721 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
12722 {
12723 if(nextClass->templateClass)
12724 nextClass = nextClass->templateClass;
12725 p += nextClass->templateParams.count;
12726 }
12727 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
12728 {
12729 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
12730 {
12731 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12732 {
12733 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
12734 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
12735 break;
12736 }
12737 }
12738 }
12739 }
12740 {
12741 char argument[256];
12742
12743 argument[0] = '\0';
12744 switch(param->type)
12745 {
12746 case 2:
12747 {
12748 char expString[1024];
12749 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12750 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
12751 struct Expression * exp;
12752 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
12753
12754 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
12755 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
12756 ProcessExpressionType(exp);
12757 ComputeExpression(exp);
12758 expString[0] = '\0';
12759 PrintExpression(exp, expString);
12760 strcat(argument, expString);
12761 FreeExpression(exp);
12762 break;
12763 }
12764 case 1:
12765 {
12766 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
12767 break;
12768 }
12769 case 0:
12770 {
12771 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12772 strcat(argument, arg.__anon1.__anon1.dataTypeString);
12773 break;
12774 }
12775 }
12776 if(argument[0])
12777 {
12778 if(paramCount)
12779 strcat(templateString, ", ");
12780 if(lastParam != p - 1)
12781 {
12782 strcat(templateString, param->name);
12783 strcat(templateString, " = ");
12784 }
12785 strcat(templateString, argument);
12786 paramCount++;
12787 lastParam = p;
12788 }
12789 p++;
12790 }
12791 }
12792 }
12793 {
12794 int len = strlen(templateString);
12795
12796 if(templateString[len - 1] == '<')
12797 len--;
12798 else
12799 {
12800 if(templateString[len - 1] == '>')
12801 templateString[len++] = ' ';
12802 templateString[len++] = '>';
12803 }
12804 templateString[len++] = '\0';
12805 }
12806 {
12807 struct Context * context = SetupTemplatesContext(_class);
12808
12809 if(freeType)
12810 FreeType(type);
12811 type = ProcessTypeString(templateString, 0);
12812 freeType = 1;
12813 FinishTemplatesContext(context);
12814 }
12815 }
12816 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
12817 {
12818 ProcessExpressionType(member->initializer->__anon1.exp);
12819 if(!member->initializer->__anon1.exp->expType)
12820 {
12821 if(inCompiler)
12822 {
12823 char expString[10240];
12824
12825 expString[0] = '\0';
12826 PrintExpression(member->initializer->__anon1.exp, expString);
12827 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12828 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
12829 }
12830 }
12831 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
12832 {
12833 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
12834 }
12835 }
12836 else if(member->initializer)
12837 {
12838 ProcessInitializer(member->initializer, type);
12839 }
12840 if(freeType)
12841 FreeType(type);
12842 }
12843 else
12844 {
12845 if(_class && _class->type == 3)
12846 {
12847 if(member->initializer)
12848 {
12849 struct Type * type = MkClassType(_class->fullName);
12850
12851 ProcessInitializer(member->initializer, type);
12852 FreeType(type);
12853 }
12854 }
12855 else
12856 {
12857 if(member->initializer)
12858 {
12859 ProcessInitializer(member->initializer, (((void *)0)));
12860 }
12861 if(ident)
12862 {
12863 if(method)
12864 {
12865 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12866 }
12867 else if(_class)
12868 {
12869 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12870 if(inCompiler)
12871 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
12872 }
12873 }
12874 else if(_class)
12875 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
12876 }
12877 }
12878 }
12879
12880 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
12881 {
12882 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
12883
12884 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)))
12885 {
12886 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
12887
12888 if(_class->type == 4)
12889 {
12890 struct __ecereNameSpace__ecere__sys__OldList converts =
12891 {
12892 0, 0, 0, 0, 0
12893 };
12894 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12895
12896 type->kind = 8;
12897 if(!_class->symbol)
12898 _class->symbol = FindClass(_class->fullName);
12899 type->__anon1._class = _class->symbol;
12900 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))
12901 {
12902 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12903 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12904
12905 if(enumClass)
12906 {
12907 struct __ecereNameSpace__ecere__com__Class * baseClass;
12908
12909 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12910 {
12911 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12912
12913 for(value = e->values.first; value; value = value->next)
12914 {
12915 if(!strcmp(value->name, string))
12916 break;
12917 }
12918 if(value)
12919 {
12920 FreeType(sourceExp->expType);
12921 sourceExp->isConstant = 1;
12922 sourceExp->expType = MkClassType(baseClass->fullName);
12923 if(inCompiler || inPreCompiler || inDebugger)
12924 {
12925 char constant[256];
12926
12927 FreeExpContents(sourceExp);
12928 sourceExp->type = 2;
12929 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
12930 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
12931 else
12932 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
12933 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12934 }
12935 while(converts.first)
12936 {
12937 struct Conversion * convert = converts.first;
12938
12939 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
12940 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
12941 }
12942 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12943 return 1;
12944 }
12945 }
12946 }
12947 }
12948 if(converts.first)
12949 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12950 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12951 }
12952 }
12953 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)))
12954 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
12955 return 1;
12956 return 0;
12957 }
12958
12959 void ComputeExpression(struct Expression * exp)
12960 {
12961 switch(exp->type)
12962 {
12963 case 0:
12964 {
12965 struct Identifier * id = exp->__anon1.__anon1.identifier;
12966
12967 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
12968 {
12969 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
12970
12971 if(c && c->type == 4)
12972 {
12973 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12974
12975 if(enumClass)
12976 {
12977 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12978 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
12979
12980 for(value = e->values.first; value; value = value->next)
12981 {
12982 if(!strcmp(value->name, id->string))
12983 break;
12984 }
12985 if(value)
12986 {
12987 const char * dts = c->dataTypeString;
12988
12989 FreeExpContents(exp);
12990 exp->type = 2;
12991 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
12992 }
12993 }
12994 }
12995 }
12996 break;
12997 }
12998 case 1:
12999 {
13000 ComputeInstantiation(exp);
13001 break;
13002 }
13003 case 4:
13004 {
13005 struct Expression * exp1, * exp2 = (((void *)0));
13006 struct Operand op1 =
13007 {
13008 0, 0, 0,
13009 .__anon1 = {
13010 .c = 0
13011 },
13012 {
13013 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13014 }
13015 };
13016 struct Operand op2 =
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
13027 if(exp->__anon1.op.exp2)
13028 {
13029 struct Expression * e = exp->__anon1.op.exp2;
13030
13031 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13032 {
13033 if(e->type == 5 || e->type == 32 || e->type == 23)
13034 {
13035 if(e->type == 23)
13036 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13037 else
13038 e = (*e->__anon1.list).last;
13039 }
13040 }
13041 if(exp->__anon1.op.op == 261 && e && e->expType)
13042 {
13043 if(e->type == 3 && e->__anon1.__anon2.string)
13044 {
13045 char * string = e->__anon1.__anon2.string;
13046 int len = strlen(string);
13047 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13048
13049 len = UnescapeString(tmp, string + 1, len - 2);
13050 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13051 FreeExpContents(exp);
13052 exp->type = 2;
13053 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13054 }
13055 else
13056 {
13057 struct Type * type = e->expType;
13058
13059 type->refCount++;
13060 FreeExpContents(exp);
13061 exp->type = 2;
13062 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13063 FreeType(type);
13064 }
13065 break;
13066 }
13067 else
13068 ComputeExpression(exp->__anon1.op.exp2);
13069 }
13070 if(exp->__anon1.op.exp1)
13071 {
13072 ComputeExpression(exp->__anon1.op.exp1);
13073 exp1 = exp->__anon1.op.exp1;
13074 exp2 = exp->__anon1.op.exp2;
13075 op1 = GetOperand(exp1);
13076 if(op1.type)
13077 op1.type->refCount++;
13078 if(exp2)
13079 {
13080 op2 = GetOperand(exp2);
13081 if(op2.type)
13082 op2.type->refCount++;
13083 }
13084 }
13085 else
13086 {
13087 exp1 = exp->__anon1.op.exp2;
13088 op1 = GetOperand(exp1);
13089 if(op1.type)
13090 op1.type->refCount++;
13091 }
13092 CallOperator(exp, exp1, exp2, &op1, &op2);
13093 if(op1.type)
13094 FreeType(op1.type);
13095 if(op2.type)
13096 FreeType(op2.type);
13097 break;
13098 }
13099 case 5:
13100 case 32:
13101 {
13102 struct Expression * e, * n;
13103
13104 for(e = (*exp->__anon1.list).first; e; e = n)
13105 {
13106 n = e->next;
13107 if(!n)
13108 {
13109 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13110 struct Expression * prev = exp->prev;
13111 struct Expression * next = exp->next;
13112
13113 ComputeExpression(e);
13114 FreeType(exp->expType);
13115 FreeType(exp->destType);
13116 *exp = *e;
13117 exp->prev = prev;
13118 exp->next = next;
13119 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13120 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13121 }
13122 else
13123 {
13124 FreeExpression(e);
13125 }
13126 }
13127 break;
13128 }
13129 case 8:
13130 {
13131 struct Expression * memberExp = exp->__anon1.member.exp;
13132 struct Identifier * memberID = exp->__anon1.member.member;
13133 struct Type * type;
13134
13135 ComputeExpression(exp->__anon1.member.exp);
13136 type = exp->__anon1.member.exp->expType;
13137 if(type)
13138 {
13139 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)));
13140 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13141 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13142 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
13143
13144 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
13145 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13146 if(!_class)
13147 {
13148 char string[256];
13149 struct Symbol * classSym;
13150
13151 string[0] = '\0';
13152 PrintTypeNoConst(type, string, 0, 1);
13153 classSym = FindClass(string);
13154 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13155 }
13156 if(exp->__anon1.member.member)
13157 {
13158 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
13159 if(!prop)
13160 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
13161 }
13162 if(!prop && !member && _class && exp->__anon1.member.member)
13163 {
13164 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
13165
13166 convertTo = _class;
13167 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13168 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
13169 }
13170 if(prop)
13171 {
13172 if(prop->compiled)
13173 {
13174 struct Type * type = prop->dataType;
13175
13176 if(_class->type == 3)
13177 {
13178 if(type->kind == 8)
13179 {
13180 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13181
13182 if(_class->type == 3)
13183 {
13184 if(!_class->dataType)
13185 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13186 type = _class->dataType;
13187 }
13188 }
13189 switch(type->kind)
13190 {
13191 case 6:
13192 {
13193 float value;
13194 float (* Get)(float) = (void *)prop->Get;
13195
13196 GetFloat(exp->__anon1.member.exp, &value);
13197 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
13198 exp->type = 2;
13199 break;
13200 }
13201 case 7:
13202 {
13203 double value;
13204 double (* Get)(double);
13205
13206 GetDouble(exp->__anon1.member.exp, &value);
13207 if(convertTo)
13208 Get = (void *)prop->Set;
13209 else
13210 Get = (void *)prop->Get;
13211 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
13212 exp->type = 2;
13213 break;
13214 }
13215 }
13216 }
13217 else
13218 {
13219 if(convertTo)
13220 {
13221 struct Expression * value = exp->__anon1.member.exp;
13222 struct Type * type;
13223
13224 if(!prop->dataType)
13225 ProcessPropertyType(prop);
13226 type = prop->dataType;
13227 if(!type)
13228 {
13229 }
13230 else if(_class->type == 1)
13231 {
13232 switch(type->kind)
13233 {
13234 case 8:
13235 {
13236 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13237
13238 if(propertyClass->type == 1 && value->type == 1)
13239 {
13240 void (* Set)(void *, void *) = (void *)prop->Set;
13241
13242 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13243 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13244 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13245 exp->__anon1.instance->loc = exp->loc;
13246 exp->type = 1;
13247 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
13248 PopulateInstance(exp->__anon1.instance);
13249 }
13250 break;
13251 }
13252 case 3:
13253 {
13254 int intValue;
13255 void (* Set)(void *, int) = (void *)prop->Set;
13256
13257 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13258 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13259 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13260 exp->__anon1.instance->loc = exp->loc;
13261 exp->type = 1;
13262 GetInt(value, &intValue);
13263 Set(exp->__anon1.instance->data, intValue);
13264 PopulateInstance(exp->__anon1.instance);
13265 break;
13266 }
13267 case 4:
13268 {
13269 long long intValue;
13270 void (* Set)(void *, long long) = (void *)prop->Set;
13271
13272 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13273 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13274 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13275 exp->__anon1.instance->loc = exp->loc;
13276 exp->type = 1;
13277 GetInt64(value, &intValue);
13278 Set(exp->__anon1.instance->data, intValue);
13279 PopulateInstance(exp->__anon1.instance);
13280 break;
13281 }
13282 case 22:
13283 {
13284 intptr_t intValue;
13285 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13286
13287 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13288 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13289 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13290 exp->__anon1.instance->loc = exp->loc;
13291 exp->type = 1;
13292 GetIntPtr(value, &intValue);
13293 Set(exp->__anon1.instance->data, intValue);
13294 PopulateInstance(exp->__anon1.instance);
13295 break;
13296 }
13297 case 23:
13298 {
13299 ssize_t intValue;
13300 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13301
13302 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13303 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13304 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13305 exp->__anon1.instance->loc = exp->loc;
13306 exp->type = 1;
13307 GetIntSize(value, &intValue);
13308 Set(exp->__anon1.instance->data, intValue);
13309 PopulateInstance(exp->__anon1.instance);
13310 break;
13311 }
13312 case 6:
13313 {
13314 float floatValue;
13315 void (* Set)(void *, float) = (void *)prop->Set;
13316
13317 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13318 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13319 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13320 exp->__anon1.instance->loc = exp->loc;
13321 exp->type = 1;
13322 GetFloat(value, &floatValue);
13323 Set(exp->__anon1.instance->data, floatValue);
13324 PopulateInstance(exp->__anon1.instance);
13325 break;
13326 }
13327 case 7:
13328 {
13329 double doubleValue;
13330 void (* Set)(void *, double) = (void *)prop->Set;
13331
13332 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13333 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13334 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13335 exp->__anon1.instance->loc = exp->loc;
13336 exp->type = 1;
13337 GetDouble(value, &doubleValue);
13338 Set(exp->__anon1.instance->data, doubleValue);
13339 PopulateInstance(exp->__anon1.instance);
13340 break;
13341 }
13342 }
13343 }
13344 else if(_class->type == 2)
13345 {
13346 switch(type->kind)
13347 {
13348 case 8:
13349 {
13350 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13351
13352 if(propertyClass->type == 1 && value->__anon1.instance->data)
13353 {
13354 unsigned int (* Set)(void *) = (void *)prop->Set;
13355 unsigned int bits = Set(value->__anon1.instance->data);
13356
13357 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13358 exp->type = 2;
13359 break;
13360 }
13361 else if(_class->type == 2)
13362 {
13363 unsigned int value;
13364 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
13365 unsigned int bits;
13366
13367 GetUInt(exp->__anon1.member.exp, &value);
13368 bits = Set(value);
13369 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13370 exp->type = 2;
13371 }
13372 }
13373 }
13374 }
13375 }
13376 else
13377 {
13378 if(_class->type == 2)
13379 {
13380 unsigned int value;
13381
13382 GetUInt(exp->__anon1.member.exp, &value);
13383 switch(type->kind)
13384 {
13385 case 8:
13386 {
13387 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13388
13389 if(_class->type == 1)
13390 {
13391 void (* Get)(unsigned int, void *) = (void *)prop->Get;
13392
13393 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13394 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13395 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13396 exp->__anon1.instance->loc = exp->loc;
13397 exp->type = 1;
13398 Get(value, exp->__anon1.instance->data);
13399 PopulateInstance(exp->__anon1.instance);
13400 }
13401 else if(_class->type == 2)
13402 {
13403 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
13404 uint64 bits = Get(value);
13405
13406 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
13407 exp->type = 2;
13408 }
13409 break;
13410 }
13411 }
13412 }
13413 else if(_class->type == 1)
13414 {
13415 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
13416
13417 switch(type->kind)
13418 {
13419 case 8:
13420 {
13421 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13422
13423 if(_class->type == 1 && value)
13424 {
13425 void (* Get)(void *, void *) = (void *)prop->Get;
13426
13427 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13428 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13429 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13430 exp->__anon1.instance->loc = exp->loc;
13431 exp->type = 1;
13432 Get(value, exp->__anon1.instance->data);
13433 PopulateInstance(exp->__anon1.instance);
13434 }
13435 break;
13436 }
13437 }
13438 }
13439 }
13440 }
13441 }
13442 else
13443 {
13444 exp->isConstant = 0;
13445 }
13446 }
13447 else if(member)
13448 {
13449 }
13450 }
13451 if(exp->type != 8)
13452 {
13453 FreeExpression(memberExp);
13454 FreeIdentifier(memberID);
13455 }
13456 break;
13457 }
13458 case 10:
13459 {
13460 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
13461
13462 FreeExpContents(exp);
13463 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13464 exp->type = 2;
13465 FreeType(type);
13466 break;
13467 }
13468 case 15:
13469 {
13470 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
13471
13472 if(classSym && classSym->__anon1.registered)
13473 {
13474 if(classSym->__anon1.registered->fixed)
13475 {
13476 FreeSpecifier(exp->__anon1._class);
13477 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
13478 exp->type = 2;
13479 }
13480 else
13481 {
13482 char className[1024];
13483
13484 strcpy(className, "__ecereClass_");
13485 FullClassNameCat(className, classSym->string, 1);
13486 DeclareClass(curExternal, classSym, className);
13487 FreeExpContents(exp);
13488 exp->type = 9;
13489 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
13490 exp->__anon1.member.member = MkIdentifier("structSize");
13491 }
13492 }
13493 break;
13494 }
13495 case 11:
13496 {
13497 struct Type * type;
13498 struct Expression * e = exp;
13499
13500 if(exp->type == 11)
13501 {
13502 if(exp->__anon1.cast.exp)
13503 ComputeExpression(exp->__anon1.cast.exp);
13504 e = exp->__anon1.cast.exp;
13505 }
13506 if(e && exp->expType)
13507 {
13508 type = exp->expType;
13509 if(type->kind == 8)
13510 {
13511 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13512
13513 if(_class && (_class->type == 3 || _class->type == 2))
13514 {
13515 if(!_class->dataType)
13516 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13517 type = _class->dataType;
13518 }
13519 }
13520 switch(type->kind)
13521 {
13522 case 24:
13523 case 1:
13524 if(type->isSigned)
13525 {
13526 char value = (char)0;
13527
13528 if(GetChar(e, &value))
13529 {
13530 FreeExpContents(exp);
13531 exp->__anon1.__anon1.constant = PrintChar(value);
13532 exp->type = 2;
13533 }
13534 }
13535 else
13536 {
13537 unsigned char value = (unsigned char)0;
13538
13539 if(GetUChar(e, &value))
13540 {
13541 FreeExpContents(exp);
13542 exp->__anon1.__anon1.constant = PrintUChar(value);
13543 exp->type = 2;
13544 }
13545 }
13546 break;
13547 case 2:
13548 if(type->isSigned)
13549 {
13550 short value = (short)0;
13551
13552 if(GetShort(e, &value))
13553 {
13554 FreeExpContents(exp);
13555 exp->__anon1.__anon1.constant = PrintShort(value);
13556 exp->type = 2;
13557 }
13558 }
13559 else
13560 {
13561 unsigned short value = (unsigned short)0;
13562
13563 if(GetUShort(e, &value))
13564 {
13565 FreeExpContents(exp);
13566 exp->__anon1.__anon1.constant = PrintUShort(value);
13567 exp->type = 2;
13568 }
13569 }
13570 break;
13571 case 3:
13572 if(type->isSigned)
13573 {
13574 int value = 0;
13575
13576 if(GetInt(e, &value))
13577 {
13578 FreeExpContents(exp);
13579 exp->__anon1.__anon1.constant = PrintInt(value);
13580 exp->type = 2;
13581 }
13582 }
13583 else
13584 {
13585 unsigned int value = 0;
13586
13587 if(GetUInt(e, &value))
13588 {
13589 FreeExpContents(exp);
13590 exp->__anon1.__anon1.constant = PrintUInt(value);
13591 exp->type = 2;
13592 }
13593 }
13594 break;
13595 case 4:
13596 if(type->isSigned)
13597 {
13598 long long value = 0;
13599
13600 if(GetInt64(e, &value))
13601 {
13602 FreeExpContents(exp);
13603 exp->__anon1.__anon1.constant = PrintInt64(value);
13604 exp->type = 2;
13605 }
13606 }
13607 else
13608 {
13609 uint64 value = 0;
13610
13611 if(GetUInt64(e, &value))
13612 {
13613 FreeExpContents(exp);
13614 exp->__anon1.__anon1.constant = PrintUInt64(value);
13615 exp->type = 2;
13616 }
13617 }
13618 break;
13619 case 22:
13620 if(type->isSigned)
13621 {
13622 intptr_t value = 0;
13623
13624 if(GetIntPtr(e, &value))
13625 {
13626 FreeExpContents(exp);
13627 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13628 exp->type = 2;
13629 }
13630 }
13631 else
13632 {
13633 uintptr_t value = 0;
13634
13635 if(GetUIntPtr(e, &value))
13636 {
13637 FreeExpContents(exp);
13638 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13639 exp->type = 2;
13640 }
13641 }
13642 break;
13643 case 23:
13644 if(type->isSigned)
13645 {
13646 ssize_t value = 0;
13647
13648 if(GetIntSize(e, &value))
13649 {
13650 FreeExpContents(exp);
13651 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13652 exp->type = 2;
13653 }
13654 }
13655 else
13656 {
13657 size_t value = 0;
13658
13659 if(GetUIntSize(e, &value))
13660 {
13661 FreeExpContents(exp);
13662 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13663 exp->type = 2;
13664 }
13665 }
13666 break;
13667 case 6:
13668 {
13669 float value = 0;
13670
13671 if(GetFloat(e, &value))
13672 {
13673 FreeExpContents(exp);
13674 exp->__anon1.__anon1.constant = PrintFloat(value);
13675 exp->type = 2;
13676 }
13677 break;
13678 }
13679 case 7:
13680 {
13681 double value = 0;
13682
13683 if(GetDouble(e, &value))
13684 {
13685 FreeExpContents(exp);
13686 exp->__anon1.__anon1.constant = PrintDouble(value);
13687 exp->type = 2;
13688 }
13689 break;
13690 }
13691 }
13692 }
13693 break;
13694 }
13695 case 12:
13696 {
13697 struct Operand op1 =
13698 {
13699 0, 0, 0,
13700 .__anon1 = {
13701 .c = 0
13702 },
13703 {
13704 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13705 }
13706 };
13707 struct Operand op2 =
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 op3 =
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
13728 if(exp->__anon1.cond.exp)
13729 ComputeExpression((*exp->__anon1.cond.exp).last);
13730 if(exp->__anon1.cond.elseExp)
13731 ComputeExpression(exp->__anon1.cond.elseExp);
13732 if(exp->__anon1.cond.cond)
13733 ComputeExpression(exp->__anon1.cond.cond);
13734 op1 = GetOperand(exp->__anon1.cond.cond);
13735 if(op1.type)
13736 op1.type->refCount++;
13737 op2 = GetOperand((*exp->__anon1.cond.exp).last);
13738 if(op2.type)
13739 op2.type->refCount++;
13740 op3 = GetOperand(exp->__anon1.cond.elseExp);
13741 if(op3.type)
13742 op3.type->refCount++;
13743 if(op1.ops.Cond)
13744 {
13745 FreeExpContents(exp);
13746 op1.ops.Cond(exp, &op1, &op2, &op3);
13747 }
13748 if(op1.type)
13749 FreeType(op1.type);
13750 if(op2.type)
13751 FreeType(op2.type);
13752 if(op3.type)
13753 FreeType(op3.type);
13754 break;
13755 }
13756 }
13757 }
13758
13759 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
13760 {
13761 struct __ecereNameSpace__ecere__com__Instance * module;
13762
13763 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))
13764 return 1;
13765 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))
13766 return 1;
13767 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))
13768 return 1;
13769 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)
13770 {
13771 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
13772 return 1;
13773 }
13774 return 0;
13775 }
13776
13777 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
13778 {
13779 struct Type * source;
13780 struct Type * realDest = dest;
13781 struct Type * backupSourceExpType = (((void *)0));
13782 struct Expression * computedExp = sourceExp;
13783
13784 dest->refCount++;
13785 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)
13786 {
13787 computedExp = CopyExpression(sourceExp);
13788 ComputeExpression(computedExp);
13789 }
13790 source = sourceExp->expType;
13791 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
13792 {
13793 if(computedExp != sourceExp)
13794 {
13795 FreeExpression(computedExp);
13796 computedExp = sourceExp;
13797 }
13798 FreeType(dest);
13799 return 1;
13800 }
13801 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
13802 {
13803 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
13804 {
13805 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
13806
13807 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
13808 ;
13809 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
13810 ;
13811 if(sourceBase == destBase)
13812 {
13813 if(computedExp != sourceExp)
13814 {
13815 FreeExpression(computedExp);
13816 computedExp = sourceExp;
13817 }
13818 FreeType(dest);
13819 return 1;
13820 }
13821 }
13822 }
13823 if(source)
13824 {
13825 struct __ecereNameSpace__ecere__sys__OldList * specs;
13826 unsigned int flag = 0;
13827 long long value = (((int)0x7fffffff));
13828
13829 source->refCount++;
13830 if(computedExp->type == 2)
13831 {
13832 if(source->isSigned)
13833 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13834 else
13835 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13836 }
13837 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
13838 {
13839 if(source->isSigned)
13840 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13841 else
13842 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13843 }
13844 if(computedExp != sourceExp)
13845 {
13846 FreeExpression(computedExp);
13847 computedExp = sourceExp;
13848 }
13849 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
13850 {
13851 FreeType(source);
13852 source = __extension__ ({
13853 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13854
13855 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
13856 });
13857 }
13858 if(dest->kind == 8)
13859 {
13860 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13861
13862 if(_class && _class->type == 3)
13863 {
13864 if(source->kind != 8)
13865 {
13866 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13867 struct Type * tempDest, * tempSource;
13868
13869 for(; _class->base->type != 1000; _class = _class->base)
13870 ;
13871 tempSource = dest;
13872 tempDest = tempType;
13873 tempType->kind = 8;
13874 if(!_class->symbol)
13875 _class->symbol = FindClass(_class->fullName);
13876 tempType->__anon1._class = _class->symbol;
13877 tempType->truth = dest->truth;
13878 if(tempType->__anon1._class)
13879 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13880 backupSourceExpType = sourceExp->expType;
13881 if(dest->passAsTemplate)
13882 {
13883 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13884 CopyTypeInto(sourceExp->expType, dest);
13885 sourceExp->expType->passAsTemplate = 0;
13886 }
13887 else
13888 {
13889 sourceExp->expType = dest;
13890 dest->refCount++;
13891 }
13892 flag = 1;
13893 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13894 }
13895 }
13896 if(_class && _class->type == 2 && source->kind != 8)
13897 {
13898 if(!dest->__anon1._class->__anon1.registered->dataType)
13899 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
13900 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13901 {
13902 FreeType(source);
13903 FreeType(sourceExp->expType);
13904 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
13905 source->refCount++;
13906 }
13907 }
13908 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
13909 {
13910 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13911 struct Declarator * decl;
13912 char string[1024];
13913
13914 ReadString(string, sourceExp->__anon1.__anon2.string);
13915 decl = SpecDeclFromString(string, specs, (((void *)0)));
13916 FreeExpContents(sourceExp);
13917 FreeType(sourceExp->expType);
13918 sourceExp->type = 24;
13919 sourceExp->__anon1._classExp.specifiers = specs;
13920 sourceExp->__anon1._classExp.decl = decl;
13921 sourceExp->expType = dest;
13922 dest->refCount++;
13923 FreeType(source);
13924 FreeType(dest);
13925 if(backupSourceExpType)
13926 FreeType(backupSourceExpType);
13927 return 1;
13928 }
13929 }
13930 else if(source->kind == 8)
13931 {
13932 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
13933
13934 if(_class && (_class->type == 3 || _class->type == 2))
13935 {
13936 if(dest->kind != 8)
13937 {
13938 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13939 struct Type * tempDest, * tempSource;
13940
13941 if(!source->__anon1._class->__anon1.registered->dataType)
13942 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
13943 for(; _class->base->type != 1000; _class = _class->base)
13944 ;
13945 tempDest = source;
13946 tempSource = tempType;
13947 tempType->kind = 8;
13948 tempType->__anon1._class = FindClass(_class->fullName);
13949 tempType->truth = source->truth;
13950 tempType->classObjectType = source->classObjectType;
13951 if(tempType->__anon1._class)
13952 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13953 if(conversions && conversions->last)
13954 {
13955 ((struct Conversion *)conversions->last)->resultType = dest;
13956 dest->refCount++;
13957 }
13958 FreeType(sourceExp->expType);
13959 sourceExp->expType = MkClassType(_class->fullName);
13960 sourceExp->expType->truth = source->truth;
13961 sourceExp->expType->classObjectType = source->classObjectType;
13962 if(!sourceExp->destType)
13963 {
13964 FreeType(sourceExp->destType);
13965 sourceExp->destType = sourceExp->expType;
13966 if(sourceExp->expType)
13967 sourceExp->expType->refCount++;
13968 }
13969 if(!_class->dataType)
13970 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13971 FreeType(dest);
13972 dest = MkClassType(source->__anon1._class->string);
13973 dest->truth = source->truth;
13974 dest->classObjectType = source->classObjectType;
13975 FreeType(source);
13976 source = _class->dataType;
13977 source->refCount++;
13978 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13979 }
13980 }
13981 }
13982 if(!flag)
13983 {
13984 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13985 {
13986 FreeType(source);
13987 FreeType(dest);
13988 return 1;
13989 }
13990 }
13991 if(dest->kind == 8)
13992 {
13993 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13994 unsigned int fittingValue = 0;
13995
13996 if(_class && _class->type == 4)
13997 {
13998 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13999 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14000
14001 if(c && value >= 0 && value <= c->largest)
14002 fittingValue = 1;
14003 }
14004 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
14005 {
14006 if(_class->type == 0 || _class->type == 5)
14007 {
14008 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14009
14010 *newExp = *sourceExp;
14011 if(sourceExp->destType)
14012 sourceExp->destType->refCount++;
14013 if(sourceExp->expType)
14014 sourceExp->expType->refCount++;
14015 sourceExp->type = 11;
14016 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
14017 sourceExp->__anon1.cast.exp = newExp;
14018 FreeType(sourceExp->expType);
14019 sourceExp->expType = (((void *)0));
14020 ProcessExpressionType(sourceExp);
14021 if(!inCompiler)
14022 {
14023 FreeType(sourceExp->expType);
14024 sourceExp->expType = dest;
14025 }
14026 FreeType(source);
14027 if(inCompiler)
14028 FreeType(dest);
14029 if(backupSourceExpType)
14030 FreeType(backupSourceExpType);
14031 return 1;
14032 }
14033 if(!_class->dataType)
14034 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14035 FreeType(dest);
14036 dest = _class->dataType;
14037 dest->refCount++;
14038 }
14039 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))
14040 {
14041 specs = MkListOne(MkSpecifier(DOUBLE));
14042 }
14043 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))
14044 {
14045 specs = MkListOne(MkSpecifier(FLOAT));
14046 }
14047 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))
14048 {
14049 specs = MkList();
14050 if(!dest->isSigned)
14051 ListAdd(specs, MkSpecifier(UNSIGNED));
14052 ListAdd(specs, MkSpecifier(INT64));
14053 }
14054 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
14055 {
14056 specs = MkList();
14057 if(!dest->isSigned)
14058 ListAdd(specs, MkSpecifier(UNSIGNED));
14059 ListAdd(specs, MkSpecifier(INT));
14060 }
14061 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14062 {
14063 specs = MkList();
14064 if(!dest->isSigned)
14065 ListAdd(specs, MkSpecifier(UNSIGNED));
14066 ListAdd(specs, MkSpecifier(SHORT));
14067 }
14068 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14069 {
14070 specs = MkList();
14071 if(!dest->isSigned)
14072 ListAdd(specs, MkSpecifier(UNSIGNED));
14073 ListAdd(specs, MkSpecifier(CHAR));
14074 }
14075 else
14076 {
14077 FreeType(source);
14078 FreeType(dest);
14079 if(backupSourceExpType)
14080 {
14081 if(sourceExp->expType)
14082 FreeType(sourceExp->expType);
14083 sourceExp->expType = backupSourceExpType;
14084 }
14085 return 0;
14086 }
14087 }
14088 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))
14089 {
14090 specs = MkListOne(MkSpecifier(DOUBLE));
14091 }
14092 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))
14093 {
14094 specs = MkListOne(MkSpecifier(FLOAT));
14095 }
14096 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
14097 {
14098 specs = MkList();
14099 ListAdd(specs, MkSpecifier(BOOL));
14100 }
14101 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)))
14102 {
14103 specs = MkList();
14104 if(!dest->isSigned)
14105 ListAdd(specs, MkSpecifier(UNSIGNED));
14106 ListAdd(specs, MkSpecifier(CHAR));
14107 }
14108 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)))))
14109 {
14110 specs = MkList();
14111 if(!dest->isSigned)
14112 ListAdd(specs, MkSpecifier(UNSIGNED));
14113 ListAdd(specs, MkSpecifier(SHORT));
14114 }
14115 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
14116 {
14117 specs = MkList();
14118 if(!dest->isSigned)
14119 ListAdd(specs, MkSpecifier(UNSIGNED));
14120 ListAdd(specs, MkSpecifier(INT));
14121 }
14122 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
14123 {
14124 specs = MkList();
14125 if(!dest->isSigned)
14126 ListAdd(specs, MkSpecifier(UNSIGNED));
14127 ListAdd(specs, MkSpecifier(INT64));
14128 }
14129 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
14130 {
14131 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
14132 }
14133 else
14134 {
14135 FreeType(source);
14136 FreeType(dest);
14137 if(backupSourceExpType)
14138 {
14139 if(sourceExp->expType)
14140 FreeType(sourceExp->expType);
14141 sourceExp->expType = backupSourceExpType;
14142 }
14143 return 0;
14144 }
14145 if(!flag && !sourceExp->opDestType)
14146 {
14147 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14148
14149 *newExp = *sourceExp;
14150 newExp->prev = (((void *)0));
14151 newExp->next = (((void *)0));
14152 if(sourceExp->destType)
14153 sourceExp->destType->refCount++;
14154 if(sourceExp->expType)
14155 sourceExp->expType->refCount++;
14156 sourceExp->type = 11;
14157 if(realDest->kind == 8)
14158 {
14159 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
14160 FreeList(specs, (void *)(FreeSpecifier));
14161 }
14162 else
14163 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
14164 if(newExp->type == 4)
14165 {
14166 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
14167 }
14168 else
14169 sourceExp->__anon1.cast.exp = newExp;
14170 FreeType(sourceExp->expType);
14171 sourceExp->expType = (((void *)0));
14172 ProcessExpressionType(sourceExp);
14173 }
14174 else
14175 FreeList(specs, (void *)(FreeSpecifier));
14176 FreeType(dest);
14177 FreeType(source);
14178 if(backupSourceExpType)
14179 FreeType(backupSourceExpType);
14180 return 1;
14181 }
14182 else
14183 {
14184 if(computedExp != sourceExp)
14185 {
14186 FreeExpression(computedExp);
14187 computedExp = sourceExp;
14188 }
14189 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
14190 sourceExp = (*sourceExp->__anon1.list).last;
14191 if(sourceExp->type == 0)
14192 {
14193 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
14194
14195 if(dest->kind == 8)
14196 {
14197 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
14198 {
14199 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
14200 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14201
14202 if(enumClass)
14203 {
14204 for(; _class && _class->type == 4; _class = _class->base)
14205 {
14206 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
14207 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14208
14209 for(value = e->values.first; value; value = value->next)
14210 {
14211 if(!strcmp(value->name, id->string))
14212 break;
14213 }
14214 if(value)
14215 {
14216 FreeType(sourceExp->expType);
14217 sourceExp->isConstant = 1;
14218 sourceExp->expType = MkClassType(_class->fullName);
14219 if(inCompiler || inPreCompiler || inDebugger)
14220 {
14221 FreeExpContents(sourceExp);
14222 sourceExp->type = 2;
14223 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
14224 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
14225 else
14226 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
14227 }
14228 FreeType(dest);
14229 return 1;
14230 }
14231 }
14232 }
14233 }
14234 }
14235 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
14236 {
14237 FreeType(dest);
14238 return 1;
14239 }
14240 }
14241 FreeType(dest);
14242 }
14243 return 0;
14244 }
14245
14246 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
14247 {
14248 unsigned int result = 1;
14249
14250 if(destType)
14251 {
14252 struct __ecereNameSpace__ecere__sys__OldList converts =
14253 {
14254 0, 0, 0, 0, 0
14255 };
14256 struct Conversion * convert;
14257
14258 if(destType->kind == 0)
14259 return 0;
14260 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
14261 result = 0;
14262 if(converts.count)
14263 {
14264 for(convert = converts.first; convert; convert = convert->next)
14265 {
14266 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
14267
14268 if(!empty)
14269 {
14270 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14271 int objectType = exp->expType ? exp->expType->classObjectType : 0;
14272
14273 *newExp = *exp;
14274 newExp->prev = (((void *)0));
14275 newExp->next = (((void *)0));
14276 newExp->destType = (((void *)0));
14277 if(convert->isGet)
14278 {
14279 exp->type = 8;
14280 exp->addedThis = 1;
14281 exp->__anon1.member.exp = newExp;
14282 FreeType(exp->__anon1.member.exp->expType);
14283 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
14284 exp->__anon1.member.exp->expType->classObjectType = objectType;
14285 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
14286 exp->__anon1.member.memberType = 1;
14287 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14288 exp->needCast = 1;
14289 if(exp->expType)
14290 exp->expType->refCount++;
14291 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14292 }
14293 else
14294 {
14295 {
14296 exp->type = 8;
14297 exp->addedThis = 1;
14298 exp->__anon1.member.exp = newExp;
14299 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)
14300 {
14301 newExp->byReference = 1;
14302 }
14303 FreeType(exp->__anon1.member.exp->expType);
14304 exp->__anon1.member.exp->expType = (((void *)0));
14305 if(convert->convert->dataType)
14306 {
14307 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14308 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
14309 exp->__anon1.member.exp->expType->refCount = 1;
14310 exp->__anon1.member.exp->expType->classObjectType = objectType;
14311 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14312 }
14313 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
14314 exp->__anon1.member.memberType = 4;
14315 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14316 exp->needCast = 1;
14317 if(convert->resultType)
14318 convert->resultType->refCount++;
14319 }
14320 }
14321 }
14322 else
14323 {
14324 FreeType(exp->expType);
14325 if(convert->isGet)
14326 {
14327 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14328 if(exp->destType->casted)
14329 exp->needCast = 1;
14330 if(exp->expType)
14331 exp->expType->refCount++;
14332 }
14333 else
14334 {
14335 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14336 if(exp->destType->casted)
14337 exp->needCast = 1;
14338 if(convert->resultType)
14339 convert->resultType->refCount++;
14340 }
14341 }
14342 }
14343 if(exp->isConstant && inCompiler)
14344 ComputeExpression(exp);
14345 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
14346 }
14347 if(!result && exp->expType && converts.count)
14348 {
14349 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14350 }
14351 if(!result && exp->expType && exp->destType)
14352 {
14353 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))
14354 result = 1;
14355 }
14356 }
14357 return result;
14358 }
14359
14360 static void ProcessFunction(struct FunctionDefinition *  function);
14361
14362 void ProcessInstantiationType(struct Instantiation * inst)
14363 {
14364 yylloc = inst->loc;
14365 if(inst->_class)
14366 {
14367 struct MembersInit * members;
14368 struct Symbol * classSym;
14369 struct __ecereNameSpace__ecere__com__Class * _class;
14370
14371 classSym = inst->_class->__anon1.__anon1.symbol;
14372 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14373 if(!_class || _class->type != 5)
14374 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14375 afterExternal = afterExternal ? afterExternal : curExternal;
14376 if(inst->exp)
14377 ProcessExpressionType(inst->exp);
14378 inst->isConstant = 1;
14379 if(inst->members)
14380 {
14381 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14382 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14383 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14384 int subMemberStackPos = 0;
14385
14386 for(members = (*inst->members).first; members; members = members->next)
14387 {
14388 switch(members->type)
14389 {
14390 case 1:
14391 {
14392 char name[1024];
14393 static unsigned int instMethodID = 0;
14394 struct External * external = curExternal;
14395 struct Context * context = curContext;
14396 struct Declarator * declarator = members->__anon1.function->declarator;
14397 struct Identifier * nameID = GetDeclId(declarator);
14398 char * unmangled = nameID ? nameID->string : (((void *)0));
14399 struct Expression * exp;
14400 struct External * createdExternal = (((void *)0));
14401
14402 if(inCompiler)
14403 {
14404 char number[16];
14405
14406 strcpy(name, "__ecereInstMeth_");
14407 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14408 strcat(name, "_");
14409 strcat(name, nameID->string);
14410 strcat(name, "_");
14411 sprintf(number, "_%08d", instMethodID++);
14412 strcat(name, number);
14413 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14414 }
14415 if(declarator)
14416 {
14417 struct Symbol * symbol = declarator->symbol;
14418 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14419
14420 if(method && method->type == 1)
14421 {
14422 symbol->__anon1.method = method;
14423 ProcessMethodType(method);
14424 if(!symbol->type->__anon1.__anon2.thisClass)
14425 {
14426 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14427 {
14428 if(!currentClass->symbol)
14429 currentClass->symbol = FindClass(currentClass->fullName);
14430 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14431 }
14432 else
14433 {
14434 if(!_class->symbol)
14435 _class->symbol = FindClass(_class->fullName);
14436 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14437 }
14438 }
14439 DeclareType(curExternal, symbol->type, 1, 1);
14440 }
14441 else if(classSym)
14442 {
14443 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14444 }
14445 }
14446 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14447 if(nameID)
14448 {
14449 FreeSpecifier(nameID->_class);
14450 nameID->_class = (((void *)0));
14451 }
14452 curExternal = createdExternal;
14453 if(inCompiler)
14454 {
14455 if(createdExternal->__anon1.function)
14456 ProcessFunction(createdExternal->__anon1.function);
14457 }
14458 else if(declarator)
14459 {
14460 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14461 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14462 }
14463 curExternal = external;
14464 curContext = context;
14465 if(inCompiler)
14466 {
14467 FreeClassFunction(members->__anon1.function);
14468 exp = QMkExpId(name);
14469 members->type = 0;
14470 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14471 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14472 }
14473 break;
14474 }
14475 case 0:
14476 {
14477 if(members->__anon1.dataMembers && classSym)
14478 {
14479 struct MemberInit * member;
14480 struct Location oldyyloc = yylloc;
14481
14482 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14483 {
14484 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14485 if(member->initializer && !member->initializer->isConstant)
14486 inst->isConstant = 0;
14487 }
14488 yylloc = oldyyloc;
14489 }
14490 break;
14491 }
14492 }
14493 }
14494 }
14495 }
14496 }
14497
14498 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14499
14500 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14501 {
14502 switch(spec->type)
14503 {
14504 case 0:
14505 {
14506 if(spec->__anon1.specifier == THISCLASS)
14507 {
14508 if(thisClass)
14509 {
14510 spec->type = 1;
14511 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14512 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14513 ProcessSpecifier(spec, declareStruct, 0);
14514 }
14515 }
14516 break;
14517 }
14518 case 1:
14519 {
14520 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14521
14522 if(symbol)
14523 DeclareType(curExternal, symbol->type, 1, 1);
14524 else if(spec->__anon1.__anon1.symbol)
14525 {
14526 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14527
14528 if(warnClasses && !c)
14529 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14530 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14531 }
14532 break;
14533 }
14534 case 2:
14535 {
14536 struct Enumerator * e;
14537
14538 if(spec->__anon1.__anon2.list)
14539 {
14540 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14541 {
14542 if(e->exp)
14543 ProcessExpressionType(e->exp);
14544 }
14545 }
14546 if(inCompiler)
14547 break;
14548 }
14549 case 3:
14550 case 4:
14551 {
14552 if(spec->__anon1.__anon2.definitions)
14553 {
14554 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14555
14556 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14557 }
14558 break;
14559 }
14560 }
14561 }
14562
14563 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14564 {
14565 switch(decl->type)
14566 {
14567 case 1:
14568 if(decl->__anon1.identifier->classSym)
14569 {
14570 FreeSpecifier(decl->__anon1.identifier->_class);
14571 decl->__anon1.identifier->_class = (((void *)0));
14572 }
14573 break;
14574 case 3:
14575 if(decl->__anon1.array.exp)
14576 ProcessExpressionType(decl->__anon1.array.exp);
14577 case 0:
14578 case 2:
14579 case 4:
14580 case 5:
14581 case 6:
14582 case 7:
14583 {
14584 struct Identifier * id = (((void *)0));
14585 struct Specifier * classSpec = (((void *)0));
14586
14587 if(decl->type == 4)
14588 {
14589 id = GetDeclId(decl);
14590 if(id && id->_class)
14591 {
14592 classSpec = id->_class;
14593 id->_class = (((void *)0));
14594 }
14595 }
14596 if(decl->declarator)
14597 ProcessDeclarator(decl->declarator, isFunction);
14598 if(decl->type == 4)
14599 {
14600 if(classSpec)
14601 {
14602 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14603
14604 if(!decl->__anon1.function.parameters)
14605 decl->__anon1.function.parameters = MkList();
14606 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14607 }
14608 if(decl->__anon1.function.parameters)
14609 {
14610 struct TypeName * param;
14611
14612 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14613 {
14614 if(param->qualifiers)
14615 {
14616 struct Specifier * spec;
14617
14618 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14619 {
14620 if(spec->type == 0)
14621 {
14622 if(spec->__anon1.specifier == TYPED_OBJECT)
14623 {
14624 struct Declarator * d = param->declarator;
14625 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);
14626
14627 if(d->type != 5)
14628 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14629 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14630 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14631 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14632 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14633 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14634 param = newParam;
14635 break;
14636 }
14637 else if(spec->__anon1.specifier == ANY_OBJECT)
14638 {
14639 struct Declarator * d = param->declarator;
14640
14641 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14642 param->qualifiers = MkListOne(MkSpecifier(VOID));
14643 if(d->type != 5)
14644 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14645 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14646 break;
14647 }
14648 else if(spec->__anon1.specifier == THISCLASS)
14649 {
14650 if(thisClass)
14651 {
14652 spec->type = 1;
14653 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14654 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14655 ProcessSpecifier(spec, 0, 0);
14656 }
14657 break;
14658 }
14659 }
14660 else if(spec->type == 1)
14661 {
14662 ProcessSpecifier(spec, isFunction, 1);
14663 }
14664 }
14665 }
14666 if(param->declarator)
14667 ProcessDeclarator(param->declarator, 0);
14668 }
14669 }
14670 }
14671 break;
14672 }
14673 }
14674 }
14675
14676 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14677 {
14678 yylloc = decl->loc;
14679 switch(decl->type)
14680 {
14681 case 1:
14682 {
14683 unsigned int declareStruct = 0;
14684
14685 if(decl->__anon1.__anon1.declarators)
14686 {
14687 struct InitDeclarator * d;
14688
14689 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14690 {
14691 struct Type * type, * subType;
14692
14693 ProcessDeclarator(d->declarator, 0);
14694 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14695 if(d->initializer)
14696 {
14697 ProcessInitializer(d->initializer, type);
14698 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14699 {
14700 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14701 {
14702 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14703
14704 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14705 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14706 if(decl->__anon1.__anon1.specifiers)
14707 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14708 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14709 d = (((void *)0));
14710 decl->type = 2;
14711 decl->__anon1.inst = inst;
14712 }
14713 }
14714 }
14715 for(subType = type; subType; )
14716 {
14717 if(subType->kind == 8)
14718 {
14719 declareStruct = 1;
14720 break;
14721 }
14722 else if(subType->kind == 13)
14723 break;
14724 else if(subType->kind == 12)
14725 subType = subType->__anon1.__anon4.arrayType;
14726 else
14727 break;
14728 }
14729 FreeType(type);
14730 if(!d)
14731 break;
14732 }
14733 }
14734 if(decl->__anon1.__anon1.specifiers)
14735 {
14736 struct Specifier * s;
14737
14738 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
14739 {
14740 ProcessSpecifier(s, declareStruct, 1);
14741 }
14742 }
14743 break;
14744 }
14745 case 2:
14746 {
14747 ProcessInstantiationType(decl->__anon1.inst);
14748 break;
14749 }
14750 case 0:
14751 {
14752 struct Specifier * spec;
14753 struct Declarator * d;
14754 unsigned int declareStruct = 0;
14755
14756 if(decl->__anon1.__anon1.declarators)
14757 {
14758 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14759 {
14760 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14761 struct Type * subType;
14762
14763 ProcessDeclarator(d, 0);
14764 for(subType = type; subType; )
14765 {
14766 if(subType->kind == 8)
14767 {
14768 declareStruct = 1;
14769 break;
14770 }
14771 else if(subType->kind == 13)
14772 break;
14773 else if(subType->kind == 12)
14774 subType = subType->__anon1.__anon4.arrayType;
14775 else
14776 break;
14777 }
14778 FreeType(type);
14779 }
14780 }
14781 if(decl->__anon1.__anon1.specifiers)
14782 {
14783 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
14784 ProcessSpecifier(spec, declareStruct, warnClasses);
14785 }
14786 break;
14787 }
14788 }
14789 }
14790
14791 static void ProcessStatement(struct Statement * stmt)
14792 {
14793 yylloc = stmt->loc;
14794 switch(stmt->type)
14795 {
14796 case 0:
14797 ProcessStatement(stmt->__anon1.labeled.stmt);
14798 break;
14799 case 1:
14800 if(stmt->__anon1.caseStmt.exp)
14801 {
14802 FreeType(stmt->__anon1.caseStmt.exp->destType);
14803 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
14804 if(curSwitchType)
14805 curSwitchType->refCount++;
14806 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
14807 ComputeExpression(stmt->__anon1.caseStmt.exp);
14808 }
14809 if(stmt->__anon1.caseStmt.stmt)
14810 ProcessStatement(stmt->__anon1.caseStmt.stmt);
14811 break;
14812 case 2:
14813 {
14814 if(stmt->__anon1.compound.context)
14815 {
14816 struct Declaration * decl;
14817 struct Statement * s;
14818 struct Statement * prevCompound = curCompound;
14819 struct Context * prevContext = curContext;
14820
14821 if(!stmt->__anon1.compound.isSwitch)
14822 curCompound = stmt;
14823 curContext = stmt->__anon1.compound.context;
14824 if(stmt->__anon1.compound.declarations)
14825 {
14826 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
14827 ProcessDeclaration(decl, 1);
14828 }
14829 if(stmt->__anon1.compound.statements)
14830 {
14831 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
14832 ProcessStatement(s);
14833 }
14834 curContext = prevContext;
14835 curCompound = prevCompound;
14836 }
14837 break;
14838 }
14839 case 3:
14840 {
14841 struct Expression * exp;
14842
14843 if(stmt->__anon1.expressions)
14844 {
14845 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14846 ProcessExpressionType(exp);
14847 }
14848 break;
14849 }
14850 case 4:
14851 {
14852 struct Expression * exp;
14853
14854 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
14855 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
14856 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
14857 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
14858 {
14859 ProcessExpressionType(exp);
14860 }
14861 if(stmt->__anon1.ifStmt.stmt)
14862 ProcessStatement(stmt->__anon1.ifStmt.stmt);
14863 if(stmt->__anon1.ifStmt.elseStmt)
14864 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
14865 break;
14866 }
14867 case 5:
14868 {
14869 struct Type * oldSwitchType = curSwitchType;
14870
14871 if(stmt->__anon1.switchStmt.exp)
14872 {
14873 struct Expression * exp;
14874
14875 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
14876 {
14877 if(!exp->next)
14878 {
14879 ProcessExpressionType(exp);
14880 }
14881 if(!exp->next)
14882 curSwitchType = exp->expType;
14883 }
14884 }
14885 ProcessStatement(stmt->__anon1.switchStmt.stmt);
14886 curSwitchType = oldSwitchType;
14887 break;
14888 }
14889 case 6:
14890 {
14891 if(stmt->__anon1.whileStmt.exp)
14892 {
14893 struct Expression * exp;
14894
14895 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
14896 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
14897 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
14898 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
14899 {
14900 ProcessExpressionType(exp);
14901 }
14902 }
14903 if(stmt->__anon1.whileStmt.stmt)
14904 ProcessStatement(stmt->__anon1.whileStmt.stmt);
14905 break;
14906 }
14907 case 7:
14908 {
14909 if(stmt->__anon1.doWhile.exp)
14910 {
14911 struct Expression * exp;
14912
14913 if((*stmt->__anon1.doWhile.exp).last)
14914 {
14915 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
14916 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
14917 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
14918 }
14919 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
14920 {
14921 ProcessExpressionType(exp);
14922 }
14923 }
14924 if(stmt->__anon1.doWhile.stmt)
14925 ProcessStatement(stmt->__anon1.doWhile.stmt);
14926 break;
14927 }
14928 case 8:
14929 {
14930 struct Expression * exp;
14931
14932 if(stmt->__anon1.forStmt.init)
14933 ProcessStatement(stmt->__anon1.forStmt.init);
14934 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
14935 {
14936 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
14937 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
14938 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
14939 }
14940 if(stmt->__anon1.forStmt.check)
14941 ProcessStatement(stmt->__anon1.forStmt.check);
14942 if(stmt->__anon1.forStmt.increment)
14943 {
14944 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
14945 ProcessExpressionType(exp);
14946 }
14947 if(stmt->__anon1.forStmt.stmt)
14948 ProcessStatement(stmt->__anon1.forStmt.stmt);
14949 break;
14950 }
14951 case 18:
14952 {
14953 struct Identifier * id = stmt->__anon1.forEachStmt.id;
14954 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
14955 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
14956 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
14957 char iteratorType[1024];
14958 struct Type * source;
14959 struct Expression * e;
14960 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));
14961 struct Expression * arrayExp;
14962 const char * typeString = (((void *)0));
14963 int builtinCount = 0;
14964
14965 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
14966 {
14967 if(!e->next)
14968 {
14969 FreeType(e->destType);
14970 e->destType = ProcessTypeString("Container", 0);
14971 }
14972 if(!isBuiltin || e->next)
14973 ProcessExpressionType(e);
14974 }
14975 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
14976 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)))
14977 {
14978 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
14979 struct Symbol * symbol;
14980 struct Expression * expIt = (((void *)0));
14981 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
14982 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
14983 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
14984 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
14985
14986 if(inCompiler)
14987 {
14988 stmt->type = 2;
14989 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
14990 stmt->__anon1.compound.context->parent = curContext;
14991 curContext = stmt->__anon1.compound.context;
14992 }
14993 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
14994 {
14995 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
14996
14997 isCustomAVLTree = 1;
14998 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
14999 isMap = 1;
15000 }
15001 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15002 isArray = 1;
15003 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15004 {
15005 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15006
15007 isLinkList = 1;
15008 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15009 }
15010 if(inCompiler && isArray)
15011 {
15012 struct Declarator * decl;
15013 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15014
15015 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15016 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15017 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15018 }
15019 else if(isBuiltin)
15020 {
15021 struct Type * type = (((void *)0));
15022 char typeStringBuf[1024];
15023
15024 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15025 if(((struct Expression *)(*exp).last)->type == 11)
15026 {
15027 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15028
15029 if(typeName)
15030 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15031 }
15032 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)
15033 {
15034 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15035
15036 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15037 }
15038 else if(arrayExp->__anon1.list)
15039 {
15040 struct Expression * e;
15041
15042 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15043 {
15044 ProcessExpressionType(e);
15045 if(e->expType)
15046 {
15047 if(!type)
15048 {
15049 type = e->expType;
15050 type->refCount++;
15051 }
15052 else
15053 {
15054 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15055 {
15056 FreeType(type);
15057 type = e->expType;
15058 e->expType = (((void *)0));
15059 e = (*arrayExp->__anon1.list).first;
15060 ProcessExpressionType(e);
15061 if(e->expType)
15062 {
15063 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15064 {
15065 FreeType(e->expType);
15066 e->expType = (((void *)0));
15067 FreeType(type);
15068 type = (((void *)0));
15069 break;
15070 }
15071 }
15072 }
15073 }
15074 if(e->expType)
15075 {
15076 FreeType(e->expType);
15077 e->expType = (((void *)0));
15078 }
15079 }
15080 }
15081 if(type)
15082 {
15083 typeStringBuf[0] = '\0';
15084 PrintType(type, typeStringBuf, 0, 1);
15085 typeString = typeStringBuf;
15086 FreeType(type);
15087 }
15088 }
15089 if(typeString)
15090 {
15091 if(inCompiler)
15092 {
15093 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15094 struct Declarator * decl;
15095 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15096
15097 if(arrayExp->__anon1.list)
15098 {
15099 struct Expression * e;
15100
15101 builtinCount = (*arrayExp->__anon1.list).count;
15102 type = ProcessTypeString(typeString, 0);
15103 while((e = (*arrayExp->__anon1.list).first))
15104 {
15105 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15106 e->destType = type;
15107 type->refCount++;
15108 ProcessExpressionType(e);
15109 if(inCompiler)
15110 ListAdd(initializers, MkInitializerAssignment(e));
15111 }
15112 FreeType(type);
15113 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15114 }
15115 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15116 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15117 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15118 FreeList(exp, (void *)(FreeExpression));
15119 }
15120 else if(arrayExp->__anon1.list)
15121 {
15122 struct Expression * e;
15123
15124 type = ProcessTypeString(typeString, 0);
15125 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15126 {
15127 e->destType = type;
15128 type->refCount++;
15129 ProcessExpressionType(e);
15130 }
15131 FreeType(type);
15132 }
15133 }
15134 else
15135 {
15136 arrayExp->expType = ProcessTypeString("Container", 0);
15137 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15138 }
15139 }
15140 else if(inCompiler && isLinkList && !isList)
15141 {
15142 struct Declarator * decl;
15143 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15144
15145 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15146 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15147 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15148 }
15149 else if(inCompiler && _class->templateArgs)
15150 {
15151 if(isMap)
15152 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15153 else
15154 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15155 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)))))))));
15156 }
15157 if(inCompiler)
15158 {
15159 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15160 if(block)
15161 {
15162 switch(block->type)
15163 {
15164 case 2:
15165 if(block->__anon1.compound.context)
15166 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15167 break;
15168 case 4:
15169 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15170 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15171 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15172 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15173 break;
15174 case 5:
15175 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15176 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15177 break;
15178 case 6:
15179 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15180 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15181 break;
15182 case 7:
15183 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15184 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15185 break;
15186 case 8:
15187 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15188 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15189 break;
15190 case 18:
15191 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15192 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15193 break;
15194 }
15195 }
15196 if(filter)
15197 {
15198 block = MkIfStmt(filter, block, (((void *)0)));
15199 }
15200 if(isArray)
15201 {
15202 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));
15203 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15204 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15205 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15206 }
15207 else if(isBuiltin)
15208 {
15209 char count[128];
15210
15211 sprintf(count, "%d", builtinCount);
15212 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));
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(isLinkList && !isList)
15218 {
15219 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15220 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15221
15222 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15223 {
15224 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));
15225 }
15226 else
15227 {
15228 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15229 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15230
15231 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));
15232 }
15233 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15234 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15235 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15236 }
15237 else
15238 {
15239 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15240 }
15241 ProcessExpressionType(expIt);
15242 if((*stmt->__anon1.compound.declarations).first)
15243 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15244 if(symbol)
15245 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15246 ProcessStatement(stmt);
15247 }
15248 else
15249 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15250 if(inCompiler)
15251 curContext = stmt->__anon1.compound.context->parent;
15252 break;
15253 }
15254 else
15255 {
15256 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15257 }
15258 break;
15259 }
15260 case 9:
15261 break;
15262 case 10:
15263 break;
15264 case 11:
15265 break;
15266 case 12:
15267 {
15268 struct Expression * exp;
15269
15270 if(stmt->__anon1.expressions)
15271 {
15272 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15273 {
15274 if(!exp->next)
15275 {
15276 if(curFunction && !curFunction->type)
15277 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15278 FreeType(exp->destType);
15279 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15280 if(exp->destType)
15281 exp->destType->refCount++;
15282 }
15283 ProcessExpressionType(exp);
15284 }
15285 }
15286 break;
15287 }
15288 case 14:
15289 {
15290 ProcessDeclaration(stmt->__anon1.decl, 1);
15291 break;
15292 }
15293 case 13:
15294 {
15295 struct AsmField * field;
15296
15297 if(stmt->__anon1.asmStmt.inputFields)
15298 {
15299 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15300 if(field->expression)
15301 ProcessExpressionType(field->expression);
15302 }
15303 if(stmt->__anon1.asmStmt.outputFields)
15304 {
15305 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15306 if(field->expression)
15307 ProcessExpressionType(field->expression);
15308 }
15309 if(stmt->__anon1.asmStmt.clobberedFields)
15310 {
15311 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15312 {
15313 if(field->expression)
15314 ProcessExpressionType(field->expression);
15315 }
15316 }
15317 break;
15318 }
15319 case 17:
15320 {
15321 struct PropertyWatch * propWatch;
15322 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15323 struct Expression * object = stmt->__anon1._watch.object;
15324 struct Expression * watcher = stmt->__anon1._watch.watcher;
15325
15326 if(watcher)
15327 ProcessExpressionType(watcher);
15328 if(object)
15329 ProcessExpressionType(object);
15330 if(inCompiler)
15331 {
15332 if(watcher || thisClass)
15333 {
15334 struct External * external = curExternal;
15335 struct Context * context = curContext;
15336
15337 stmt->type = 3;
15338 stmt->__anon1.expressions = MkList();
15339 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15340 {
15341 struct ClassFunction * func;
15342 char watcherName[1024];
15343 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;
15344 struct External * createdExternal;
15345
15346 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15347 if(propWatch->deleteWatch)
15348 strcat(watcherName, "_delete");
15349 else
15350 {
15351 struct Identifier * propID;
15352
15353 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15354 {
15355 strcat(watcherName, "_");
15356 strcat(watcherName, propID->string);
15357 }
15358 }
15359 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15360 {
15361 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)));
15362 ProcessClassFunctionBody(func, propWatch->compound);
15363 propWatch->compound = (((void *)0));
15364 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15365 curExternal = createdExternal;
15366 ProcessFunction(createdExternal->__anon1.function);
15367 if(propWatch->deleteWatch)
15368 {
15369 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15370
15371 ListAdd(args, CopyExpression(object));
15372 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15373 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15374 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15375 }
15376 else
15377 {
15378 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15379 struct Identifier * propID;
15380
15381 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15382 {
15383 char propName[1024];
15384 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15385
15386 if(prop)
15387 {
15388 char getName[1024], setName[1024];
15389 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15390
15391 DeclareProperty(createdExternal, prop, setName, getName);
15392 strcpy(propName, "__ecereProp_");
15393 FullClassNameCat(propName, prop->_class->fullName, 0);
15394 strcat(propName, "_");
15395 FullClassNameCat(propName, prop->name, 1);
15396 ListAdd(args, CopyExpression(object));
15397 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15398 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15399 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15400 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15401 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15402 }
15403 else
15404 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15405 }
15406 }
15407 }
15408 else
15409 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15410 }
15411 curExternal = external;
15412 curContext = context;
15413 if(watcher)
15414 FreeExpression(watcher);
15415 if(object)
15416 FreeExpression(object);
15417 FreeList(watches, (void *)(FreePropertyWatch));
15418 }
15419 else
15420 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15421 }
15422 else
15423 {
15424 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15425 {
15426 ProcessStatement(propWatch->compound);
15427 }
15428 }
15429 break;
15430 }
15431 case 15:
15432 {
15433 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15434 struct Expression * object = stmt->__anon1._watch.object;
15435 struct __ecereNameSpace__ecere__com__Class * _class;
15436
15437 if(object)
15438 ProcessExpressionType(object);
15439 if(inCompiler)
15440 {
15441 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15442 if(_class)
15443 {
15444 struct Identifier * propID;
15445
15446 stmt->type = 3;
15447 stmt->__anon1.expressions = MkList();
15448 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15449 {
15450 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15451 }
15452 else if(!watches)
15453 {
15454 }
15455 if(watches)
15456 {
15457 for(propID = (*watches).first; propID; propID = propID->next)
15458 {
15459 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15460
15461 if(prop)
15462 {
15463 CreateFireWatcher(prop, object, stmt);
15464 }
15465 else
15466 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15467 }
15468 }
15469 else
15470 {
15471 struct __ecereNameSpace__ecere__com__Property * prop;
15472 struct __ecereNameSpace__ecere__com__Class * base;
15473
15474 for(base = _class; base; base = base->base)
15475 {
15476 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15477 {
15478 if(prop->isProperty && prop->isWatchable)
15479 {
15480 CreateFireWatcher(prop, object, stmt);
15481 }
15482 }
15483 }
15484 }
15485 if(object)
15486 FreeExpression(object);
15487 FreeList(watches, (void *)(FreeIdentifier));
15488 }
15489 else
15490 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15491 }
15492 break;
15493 }
15494 case 16:
15495 {
15496 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15497 struct Expression * object = stmt->__anon1._watch.object;
15498 struct Expression * watcher = stmt->__anon1._watch.watcher;
15499 struct __ecereNameSpace__ecere__com__Class * _class;
15500
15501 if(object)
15502 ProcessExpressionType(object);
15503 if(watcher)
15504 ProcessExpressionType(watcher);
15505 if(inCompiler)
15506 {
15507 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15508 if(watcher || thisClass)
15509 {
15510 if(_class)
15511 {
15512 struct Identifier * propID;
15513
15514 stmt->type = 3;
15515 stmt->__anon1.expressions = MkList();
15516 if(!watches)
15517 {
15518 struct __ecereNameSpace__ecere__sys__OldList * args;
15519
15520 args = MkList();
15521 ListAdd(args, CopyExpression(object));
15522 ListAdd(args, MkExpConstant("0"));
15523 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15524 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15525 }
15526 else
15527 {
15528 for(propID = (*watches).first; propID; propID = propID->next)
15529 {
15530 char propName[1024];
15531 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15532
15533 if(prop)
15534 {
15535 char getName[1024], setName[1024];
15536 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15537
15538 DeclareProperty(curExternal, prop, setName, getName);
15539 strcpy(propName, "__ecereProp_");
15540 FullClassNameCat(propName, prop->_class->fullName, 0);
15541 strcat(propName, "_");
15542 FullClassNameCat(propName, prop->name, 1);
15543 ListAdd(args, CopyExpression(object));
15544 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15545 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15546 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15547 }
15548 else
15549 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15550 }
15551 }
15552 if(object)
15553 FreeExpression(object);
15554 if(watcher)
15555 FreeExpression(watcher);
15556 FreeList(watches, (void *)(FreeIdentifier));
15557 }
15558 else
15559 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15560 }
15561 else
15562 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15563 }
15564 break;
15565 }
15566 }
15567 }
15568
15569 void ComputeDataTypes()
15570 {
15571 struct External * external;
15572
15573 currentClass = (((void *)0));
15574 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15575 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15576 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15577 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15578 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15579 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15580 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15581 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15582 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15583 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15584 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15585 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15586 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15587 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15588 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15589 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15590 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15591 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15592 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15593 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15594 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15595 for(external = (*ast).first; external; external = external->next)
15596 {
15597 afterExternal = curExternal = external;
15598 if(external->type == 0)
15599 {
15600 if(memoryGuard)
15601 {
15602 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15603 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15604 }
15605 currentClass = external->__anon1.function->_class;
15606 ProcessFunction(external->__anon1.function);
15607 }
15608 else if(external->type == 1)
15609 {
15610 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15611 {
15612 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15613 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15614 }
15615 currentClass = (((void *)0));
15616 if(external->__anon1.declaration)
15617 ProcessDeclaration(external->__anon1.declaration, 1);
15618 }
15619 else if(external->type == 2)
15620 {
15621 struct ClassDefinition * _class = external->__anon1._class;
15622
15623 currentClass = external->symbol->__anon1.registered;
15624 if(memoryGuard)
15625 {
15626 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15627 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15628 }
15629 if(_class->definitions)
15630 {
15631 ProcessClass(_class->definitions, _class->symbol);
15632 }
15633 if(inCompiler)
15634 {
15635 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15636 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
15637 }
15638 }
15639 else if(external->type == 4)
15640 {
15641 thisNameSpace = external->__anon1.id->string;
15642 }
15643 }
15644 currentClass = (((void *)0));
15645 thisNameSpace = (((void *)0));
15646 curExternal = (((void *)0));
15647 }
15648
15649 void ProcessExpressionType(struct Expression * exp)
15650 {
15651 unsigned int unresolved = 0;
15652 struct Location oldyylloc = yylloc;
15653 unsigned int notByReference = 0;
15654
15655 if(!exp || exp->expType)
15656 return ;
15657 yylloc = exp->loc;
15658 switch(exp->type)
15659 {
15660 case 0:
15661 {
15662 struct Identifier * id = exp->__anon1.__anon1.identifier;
15663
15664 if(!id || !topContext)
15665 return ;
15666 if(id->_class && id->_class->__anon1.__anon1.name)
15667 {
15668 id->classSym = id->_class->__anon1.__anon1.symbol;
15669 }
15670 if(!strcmp(id->string, "__runtimePlatform"))
15671 {
15672 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15673 break;
15674 }
15675 else if(strstr(id->string, "__ecereClass") == id->string)
15676 {
15677 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15678 break;
15679 }
15680 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15681 {
15682 ReplaceClassMembers(exp, thisClass);
15683 if(exp->type != 0)
15684 {
15685 ProcessExpressionType(exp);
15686 break;
15687 }
15688 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15689 break;
15690 }
15691 else
15692 {
15693 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15694
15695 if(!symbol)
15696 {
15697 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15698 break;
15699 else
15700 {
15701 if(thisClass)
15702 {
15703 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15704 if(exp->type != 0)
15705 {
15706 ProcessExpressionType(exp);
15707 break;
15708 }
15709 }
15710 else if(currentClass && !id->_class)
15711 {
15712 if(ResolveIdWithClass(exp, currentClass, 1))
15713 break;
15714 }
15715 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15716 }
15717 }
15718 if(symbol)
15719 {
15720 struct Type * type = symbol->type;
15721 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15722
15723 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15724 {
15725 struct Context * context = SetupTemplatesContext(_class);
15726
15727 type = ReplaceThisClassType(_class);
15728 FinishTemplatesContext(context);
15729 if(type)
15730 type->refCount = 0;
15731 }
15732 FreeSpecifier(id->_class);
15733 id->_class = (((void *)0));
15734 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15735 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
15736 id->classSym = (((void *)0));
15737 exp->expType = type;
15738 if(type)
15739 type->refCount++;
15740 if(type && (type->kind == 15))
15741 exp->isConstant = 1;
15742 if(symbol->isParam || !strcmp(id->string, "this"))
15743 {
15744 if(_class && _class->type == 1 && !type->declaredWithStruct)
15745 exp->byReference = 1;
15746 }
15747 if(symbol->isIterator)
15748 {
15749 if(symbol->isIterator == 3)
15750 {
15751 exp->type = 5;
15752 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
15753 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
15754 exp->expType = (((void *)0));
15755 ProcessExpressionType(exp);
15756 }
15757 else if(symbol->isIterator != 4)
15758 {
15759 exp->type = 8;
15760 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
15761 exp->__anon1.member.exp->expType = exp->expType;
15762 exp->__anon1.member.member = MkIdentifier("data");
15763 exp->expType = (((void *)0));
15764 ProcessExpressionType(exp);
15765 }
15766 }
15767 break;
15768 }
15769 else
15770 {
15771 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
15772
15773 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15774 {
15775 char name[1024];
15776
15777 strcpy(name, thisNameSpace);
15778 strcat(name, "::");
15779 strcat(name, id->string);
15780 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
15781 }
15782 if(!definedExp)
15783 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
15784 if(definedExp)
15785 {
15786 int c;
15787
15788 for(c = 0; c < definedExpStackPos; c++)
15789 if(definedExpStack[c] == definedExp)
15790 break;
15791 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
15792 {
15793 struct Location backupYylloc = yylloc;
15794 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
15795
15796 definedExpStack[definedExpStackPos++] = definedExp;
15797 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
15798 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
15799 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15800
15801 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15802 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
15803 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
15804 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15805
15806 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15807 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
15808 echoOn = 0;
15809 parsedExpression = (((void *)0));
15810 resetScanner();
15811 expression_yyparse();
15812 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
15813 if(backInput)
15814 fileInput = backInput;
15815 yylloc = backupYylloc;
15816 if(parsedExpression)
15817 {
15818 FreeIdentifier(id);
15819 exp->type = 5;
15820 exp->__anon1.list = MkListOne(parsedExpression);
15821 ApplyLocation(parsedExpression, &yylloc);
15822 ProcessExpressionType(exp);
15823 definedExpStackPos--;
15824 return ;
15825 }
15826 definedExpStackPos--;
15827 }
15828 else
15829 {
15830 if(inCompiler)
15831 {
15832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
15833 }
15834 }
15835 }
15836 else
15837 {
15838 struct GlobalData * data = (((void *)0));
15839
15840 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15841 {
15842 char name[1024];
15843
15844 strcpy(name, thisNameSpace);
15845 strcat(name, "::");
15846 strcat(name, id->string);
15847 data = FindGlobalData(name);
15848 }
15849 if(!data)
15850 data = FindGlobalData(id->string);
15851 if(data)
15852 {
15853 DeclareGlobalData(curExternal, data);
15854 exp->expType = data->dataType;
15855 if(data->dataType)
15856 data->dataType->refCount++;
15857 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15858 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
15859 FreeSpecifier(id->_class);
15860 id->_class = (((void *)0));
15861 break;
15862 }
15863 else
15864 {
15865 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
15866
15867 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15868 {
15869 char name[1024];
15870
15871 strcpy(name, thisNameSpace);
15872 strcat(name, "::");
15873 strcat(name, id->string);
15874 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
15875 }
15876 if(!function)
15877 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
15878 if(function)
15879 {
15880 char name[1024];
15881
15882 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15883 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
15884 name[0] = (char)0;
15885 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
15886 strcpy(name, "__ecereFunction_");
15887 FullClassNameCat(name, id->string, 0);
15888 if(DeclareFunction(curExternal, function, name))
15889 {
15890 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15891 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
15892 }
15893 exp->expType = function->dataType;
15894 if(function->dataType)
15895 function->dataType->refCount++;
15896 FreeSpecifier(id->_class);
15897 id->_class = (((void *)0));
15898 break;
15899 }
15900 }
15901 }
15902 }
15903 }
15904 unresolved = 1;
15905 break;
15906 }
15907 case 1:
15908 {
15909 if(!exp->__anon1.instance->_class)
15910 {
15911 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
15912 {
15913 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
15914 }
15915 }
15916 ProcessInstantiationType(exp->__anon1.instance);
15917 exp->isConstant = exp->__anon1.instance->isConstant;
15918 if(exp->__anon1.instance->_class)
15919 {
15920 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
15921 }
15922 break;
15923 }
15924 case 2:
15925 {
15926 if(!exp->expType)
15927 {
15928 char * constant = exp->__anon1.__anon1.constant;
15929 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
15930
15931 exp->expType = type;
15932 if(constant[0] == '\'')
15933 {
15934 if((int)((unsigned char *)constant)[1] > 127)
15935 {
15936 int nb;
15937 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
15938
15939 if(nb < 2)
15940 ch = constant[1];
15941 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
15942 exp->__anon1.__anon1.constant = PrintUInt(ch);
15943 type->kind = 8;
15944 type->__anon1._class = FindClass("unichar");
15945 type->isSigned = 0;
15946 }
15947 else
15948 {
15949 type->kind = 1;
15950 type->isSigned = 1;
15951 }
15952 }
15953 else
15954 {
15955 char * dot = strchr(constant, '.');
15956 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
15957 char * exponent;
15958
15959 if(isHex)
15960 {
15961 exponent = strchr(constant, 'p');
15962 if(!exponent)
15963 exponent = strchr(constant, 'P');
15964 }
15965 else
15966 {
15967 exponent = strchr(constant, 'e');
15968 if(!exponent)
15969 exponent = strchr(constant, 'E');
15970 }
15971 if(dot || exponent)
15972 {
15973 if(strchr(constant, 'f') || strchr(constant, 'F'))
15974 type->kind = 6;
15975 else
15976 type->kind = 7;
15977 type->isSigned = 1;
15978 }
15979 else
15980 {
15981 unsigned int isSigned = constant[0] == '-';
15982 char * endP = (((void *)0));
15983 long long i64 = strtoll(constant, &endP, 0);
15984 uint64 ui64 = strtoull(constant, &endP, 0);
15985 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
15986 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
15987
15988 if(isSigned)
15989 {
15990 if(i64 < (((int)0x80000000)))
15991 is64Bit = 1;
15992 }
15993 else
15994 {
15995 if(ui64 > (((int)0x7fffffff)))
15996 {
15997 if(ui64 > (0xffffffff))
15998 {
15999 is64Bit = 1;
16000 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16001 isSigned = 1;
16002 }
16003 }
16004 else if(constant[0] != '0' || !constant[1])
16005 isSigned = 1;
16006 }
16007 if(forceUnsigned)
16008 isSigned = 0;
16009 type->kind = is64Bit ? 4 : 3;
16010 type->isSigned = isSigned;
16011 }
16012 }
16013 exp->isConstant = 1;
16014 if(exp->destType && exp->destType->kind == 7)
16015 type->kind = 7;
16016 else if(exp->destType && exp->destType->kind == 6)
16017 type->kind = 6;
16018 else if(exp->destType && exp->destType->kind == 4)
16019 type->kind = 4;
16020 }
16021 break;
16022 }
16023 case 3:
16024 {
16025 exp->isConstant = 1;
16026 exp->expType = __extension__ ({
16027 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16028
16029 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16030 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16031
16032 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16033 }), __ecereInstance2;
16034 });
16035 break;
16036 }
16037 case 13:
16038 case 26:
16039 ProcessExpressionType(exp->__anon1._new.size);
16040 exp->expType = __extension__ ({
16041 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16042
16043 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16044 });
16045 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16046 break;
16047 case 14:
16048 case 27:
16049 ProcessExpressionType(exp->__anon1._renew.size);
16050 ProcessExpressionType(exp->__anon1._renew.exp);
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._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16055 });
16056 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16057 break;
16058 case 4:
16059 {
16060 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16061 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16062 unsigned int useDestType = 0, useSideType = 0;
16063 struct Location oldyylloc = yylloc;
16064 unsigned int useSideUnit = 0;
16065 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16066 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16067
16068 switch(exp->__anon1.op.op)
16069 {
16070 case '=':
16071 case MUL_ASSIGN:
16072 case DIV_ASSIGN:
16073 case MOD_ASSIGN:
16074 case ADD_ASSIGN:
16075 case SUB_ASSIGN:
16076 case LEFT_ASSIGN:
16077 case RIGHT_ASSIGN:
16078 case AND_ASSIGN:
16079 case XOR_ASSIGN:
16080 case OR_ASSIGN:
16081 assign = 1;
16082 break;
16083 case '!':
16084 break;
16085 case AND_OP:
16086 case OR_OP:
16087 boolOps = 1;
16088 boolResult = 1;
16089 break;
16090 case EQ_OP:
16091 case '<':
16092 case '>':
16093 case LE_OP:
16094 case GE_OP:
16095 case NE_OP:
16096 boolResult = 1;
16097 useSideType = 1;
16098 break;
16099 case '+':
16100 case '-':
16101 useSideUnit = 1;
16102 useSideType = 1;
16103 useDestType = 1;
16104 break;
16105 case LEFT_OP:
16106 case RIGHT_OP:
16107 useSideType = 1;
16108 useDestType = 1;
16109 break;
16110 case '|':
16111 case '^':
16112 useSideType = 1;
16113 useDestType = 1;
16114 break;
16115 case '/':
16116 case '%':
16117 useSideType = 1;
16118 useDestType = 1;
16119 break;
16120 case '&':
16121 case '*':
16122 if(exp->__anon1.op.exp1)
16123 {
16124 useSideType = 1;
16125 useDestType = 1;
16126 }
16127 break;
16128 }
16129 if(exp->__anon1.op.op == '&')
16130 {
16131 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16132 {
16133 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16134 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16135
16136 if(symbol && symbol->isIterator == 2)
16137 {
16138 exp->type = 8;
16139 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16140 exp->__anon1.member.member = MkIdentifier("key");
16141 exp->expType = (((void *)0));
16142 exp->__anon1.op.exp2->expType = symbol->type;
16143 symbol->type->refCount++;
16144 ProcessExpressionType(exp);
16145 FreeType(dummy);
16146 break;
16147 }
16148 }
16149 }
16150 if(exp->__anon1.op.exp1)
16151 {
16152 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16153 useDestType = 0;
16154 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16155 {
16156 if(exp->__anon1.op.exp1->destType)
16157 FreeType(exp->__anon1.op.exp1->destType);
16158 exp->__anon1.op.exp1->destType = exp->destType;
16159 exp->__anon1.op.exp1->opDestType = 1;
16160 if(exp->destType)
16161 exp->destType->refCount++;
16162 }
16163 else if(!assign)
16164 {
16165 if(exp->__anon1.op.exp1->destType)
16166 FreeType(exp->__anon1.op.exp1->destType);
16167 exp->__anon1.op.exp1->destType = dummy;
16168 dummy->refCount++;
16169 }
16170 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16171 exp->__anon1.op.exp1->destType->count++;
16172 ProcessExpressionType(exp->__anon1.op.exp1);
16173 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16174 exp->__anon1.op.exp1->destType->count--;
16175 exp->__anon1.op.exp1->opDestType = 0;
16176 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)
16177 {
16178 exp->__anon1.op.exp2 = MkExpConstant("1");
16179 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16180 assign = 1;
16181 }
16182 if(exp->__anon1.op.exp1->destType == dummy)
16183 {
16184 FreeType(dummy);
16185 exp->__anon1.op.exp1->destType = (((void *)0));
16186 }
16187 type1 = exp->__anon1.op.exp1->expType;
16188 }
16189 if(exp->__anon1.op.exp2)
16190 {
16191 char expString[10240];
16192
16193 expString[0] = '\0';
16194 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16195 {
16196 if(exp->__anon1.op.exp1)
16197 {
16198 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16199 if(exp->__anon1.op.exp1->expType)
16200 exp->__anon1.op.exp1->expType->refCount++;
16201 }
16202 else
16203 {
16204 exp->__anon1.op.exp2->destType = exp->destType;
16205 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16206 exp->__anon1.op.exp2->opDestType = 1;
16207 if(exp->destType)
16208 exp->destType->refCount++;
16209 }
16210 if(type1)
16211 type1->refCount++;
16212 exp->expType = type1;
16213 }
16214 else if(assign)
16215 {
16216 if(inCompiler)
16217 PrintExpression(exp->__anon1.op.exp2, expString);
16218 if(type1 && type1->kind == 13)
16219 {
16220 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)
16221 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16222 else if(exp->__anon1.op.op == '=')
16223 {
16224 if(exp->__anon1.op.exp2->destType)
16225 FreeType(exp->__anon1.op.exp2->destType);
16226 exp->__anon1.op.exp2->destType = type1;
16227 if(type1)
16228 type1->refCount++;
16229 }
16230 }
16231 else
16232 {
16233 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)
16234 ;
16235 else
16236 {
16237 if(exp->__anon1.op.exp2->destType)
16238 FreeType(exp->__anon1.op.exp2->destType);
16239 exp->__anon1.op.exp2->destType = type1;
16240 if(type1)
16241 type1->refCount++;
16242 }
16243 }
16244 if(type1)
16245 type1->refCount++;
16246 exp->expType = type1;
16247 }
16248 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16249 {
16250 if(exp->__anon1.op.exp2->destType)
16251 FreeType(exp->__anon1.op.exp2->destType);
16252 exp->__anon1.op.exp2->destType = exp->destType;
16253 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16254 exp->__anon1.op.exp2->opDestType = 1;
16255 if(exp->destType)
16256 exp->destType->refCount++;
16257 }
16258 else
16259 {
16260 if(exp->__anon1.op.exp2->destType)
16261 FreeType(exp->__anon1.op.exp2->destType);
16262 exp->__anon1.op.exp2->destType = dummy;
16263 dummy->refCount++;
16264 }
16265 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))
16266 {
16267 FreeType(exp->__anon1.op.exp2->destType);
16268 exp->__anon1.op.exp2->destType = type1;
16269 type1->refCount++;
16270 }
16271 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16272 exp->__anon1.op.exp2->destType->count++;
16273 if(exp->__anon1.op.op == SIZEOF)
16274 {
16275 struct Expression * e = exp->__anon1.op.exp2;
16276
16277 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16278 {
16279 if(e->type == 5 || e->type == 32 || e->type == 23)
16280 {
16281 if(e->type == 23)
16282 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16283 else
16284 e = (*e->__anon1.list).last;
16285 }
16286 }
16287 if(e->type == 11 && e->__anon1.cast.exp)
16288 e->__anon1.cast.exp->needCast = 1;
16289 }
16290 ProcessExpressionType(exp->__anon1.op.exp2);
16291 exp->__anon1.op.exp2->opDestType = 0;
16292 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16293 exp->__anon1.op.exp2->destType->count--;
16294 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16295 {
16296 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)
16297 {
16298 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16299 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16300 }
16301 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)))
16302 {
16303 if(exp->__anon1.op.op == ADD_ASSIGN)
16304 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16305 }
16306 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))
16307 {
16308 if(exp->__anon1.op.op == ADD_ASSIGN)
16309 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16310 }
16311 else if(inCompiler)
16312 {
16313 char type1String[1024];
16314 char type2String[1024];
16315
16316 type1String[0] = '\0';
16317 type2String[0] = '\0';
16318 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16319 PrintType(type1, type2String, 0, 1);
16320 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16321 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16322 }
16323 }
16324 if(exp->__anon1.op.exp2->destType == dummy)
16325 {
16326 FreeType(dummy);
16327 exp->__anon1.op.exp2->destType = (((void *)0));
16328 }
16329 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16330 {
16331 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16332 type2->refCount = 1;
16333 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16334 type2->isSigned = 1;
16335 }
16336 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))
16337 {
16338 type2 = __extension__ ({
16339 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16340
16341 __ecereInstance1->kind = 3, __ecereInstance1;
16342 });
16343 type2->refCount = 1;
16344 type2->isSigned = 1;
16345 }
16346 else
16347 {
16348 type2 = exp->__anon1.op.exp2->expType;
16349 if(type2)
16350 type2->refCount++;
16351 }
16352 }
16353 dummy->kind = 0;
16354 if(exp->__anon1.op.op == SIZEOF)
16355 {
16356 exp->expType = __extension__ ({
16357 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16358
16359 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16360 });
16361 exp->isConstant = 1;
16362 }
16363 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16364 {
16365 exp->expType = Dereference(type2);
16366 if(type2 && type2->kind == 8)
16367 notByReference = 1;
16368 }
16369 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16370 exp->expType = Reference(type2);
16371 else if(!assign)
16372 {
16373 if(boolOps)
16374 {
16375 if(exp->__anon1.op.exp1)
16376 {
16377 if(exp->__anon1.op.exp1->destType)
16378 FreeType(exp->__anon1.op.exp1->destType);
16379 exp->__anon1.op.exp1->destType = MkClassType("bool");
16380 exp->__anon1.op.exp1->destType->truth = 1;
16381 if(!exp->__anon1.op.exp1->expType)
16382 ProcessExpressionType(exp->__anon1.op.exp1);
16383 else
16384 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16385 FreeType(exp->__anon1.op.exp1->expType);
16386 exp->__anon1.op.exp1->expType = MkClassType("bool");
16387 exp->__anon1.op.exp1->expType->truth = 1;
16388 }
16389 if(exp->__anon1.op.exp2)
16390 {
16391 if(exp->__anon1.op.exp2->destType)
16392 FreeType(exp->__anon1.op.exp2->destType);
16393 exp->__anon1.op.exp2->destType = MkClassType("bool");
16394 exp->__anon1.op.exp2->destType->truth = 1;
16395 if(!exp->__anon1.op.exp2->expType)
16396 ProcessExpressionType(exp->__anon1.op.exp2);
16397 else
16398 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16399 FreeType(exp->__anon1.op.exp2->expType);
16400 exp->__anon1.op.exp2->expType = MkClassType("bool");
16401 exp->__anon1.op.exp2->expType->truth = 1;
16402 }
16403 }
16404 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")))))
16405 {
16406 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"))))
16407 {
16408 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)))
16409 {
16410 struct Type * intType;
16411
16412 if(!type1->__anon1._class->__anon1.registered->dataType)
16413 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16414 if(!type2->__anon1._class->__anon1.registered->dataType)
16415 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16416 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
16417 if(exp->__anon1.op.exp1->destType)
16418 FreeType(exp->__anon1.op.exp1->destType);
16419 if(exp->__anon1.op.exp2->destType)
16420 FreeType(exp->__anon1.op.exp2->destType);
16421 exp->__anon1.op.exp1->destType = intType;
16422 exp->__anon1.op.exp2->destType = intType;
16423 intType->refCount++;
16424 }
16425 else
16426 {
16427 if(exp->__anon1.op.exp2->destType)
16428 FreeType(exp->__anon1.op.exp2->destType);
16429 exp->__anon1.op.exp2->destType = type1;
16430 type1->refCount++;
16431 if(exp->__anon1.op.exp1->destType)
16432 FreeType(exp->__anon1.op.exp1->destType);
16433 exp->__anon1.op.exp1->destType = type2;
16434 type2->refCount++;
16435 }
16436 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)
16437 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);
16438 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16439 {
16440 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16441
16442 if(argExp)
16443 {
16444 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16445
16446 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16447 ProcessExpressionType(exp->__anon1.op.exp1);
16448 if(type2->kind != 13)
16449 {
16450 ProcessExpressionType(classExp);
16451 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16452 if(!exp->__anon1.op.exp2->expType)
16453 {
16454 if(type2)
16455 FreeType(type2);
16456 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16457 type2->refCount++;
16458 }
16459 ProcessExpressionType(exp->__anon1.op.exp2);
16460 }
16461 }
16462 }
16463 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)))
16464 {
16465 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16466 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16467 exp->expType = type1;
16468 if(type1)
16469 type1->refCount++;
16470 }
16471 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)))
16472 {
16473 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16474 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16475 exp->expType = type2;
16476 if(type2)
16477 type2->refCount++;
16478 }
16479 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))
16480 {
16481 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16482 }
16483 else
16484 {
16485 unsigned int success = 0;
16486
16487 if(type1->kind == 13 && type2->kind == 13)
16488 {
16489 if(exp->__anon1.op.op == '+')
16490 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16491 else if(exp->__anon1.op.op == '-')
16492 {
16493 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16494 {
16495 exp->expType = __extension__ ({
16496 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16497
16498 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16499 });
16500 success = 1;
16501 if(type1->__anon1.type->kind == 20)
16502 {
16503 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16504
16505 if(argExp)
16506 {
16507 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16508
16509 ProcessExpressionType(classExp);
16510 exp->type = 5;
16511 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"))));
16512 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16513 FreeType(dummy);
16514 return ;
16515 }
16516 }
16517 }
16518 }
16519 }
16520 if(!success && exp->__anon1.op.exp1->type == 2)
16521 {
16522 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16523 {
16524 if(exp->expType)
16525 FreeType(exp->expType);
16526 exp->expType = exp->__anon1.op.exp1->destType;
16527 if(exp->__anon1.op.exp1->destType)
16528 exp->__anon1.op.exp1->destType->refCount++;
16529 success = 1;
16530 }
16531 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16532 {
16533 if(exp->expType)
16534 FreeType(exp->expType);
16535 exp->expType = exp->__anon1.op.exp2->destType;
16536 if(exp->__anon1.op.exp2->destType)
16537 exp->__anon1.op.exp2->destType->refCount++;
16538 success = 1;
16539 }
16540 }
16541 else if(!success)
16542 {
16543 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16544 {
16545 if(exp->expType)
16546 FreeType(exp->expType);
16547 exp->expType = exp->__anon1.op.exp2->destType;
16548 if(exp->__anon1.op.exp2->destType)
16549 exp->__anon1.op.exp2->destType->refCount++;
16550 success = 1;
16551 }
16552 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16553 {
16554 if(exp->expType)
16555 FreeType(exp->expType);
16556 exp->expType = exp->__anon1.op.exp1->destType;
16557 if(exp->__anon1.op.exp1->destType)
16558 exp->__anon1.op.exp1->destType->refCount++;
16559 success = 1;
16560 }
16561 }
16562 if(!success)
16563 {
16564 char expString1[10240];
16565 char expString2[10240];
16566 char type1[1024];
16567 char type2[1024];
16568
16569 expString1[0] = '\0';
16570 expString2[0] = '\0';
16571 type1[0] = '\0';
16572 type2[0] = '\0';
16573 if(inCompiler)
16574 {
16575 PrintExpression(exp->__anon1.op.exp1, expString1);
16576 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16577 PrintExpression(exp->__anon1.op.exp2, expString2);
16578 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16579 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16580 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16581 }
16582 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16583 }
16584 }
16585 }
16586 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)
16587 {
16588 if(exp->__anon1.op.exp1->destType)
16589 FreeType(exp->__anon1.op.exp1->destType);
16590 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16591 if(type2->__anon1._class->__anon1.registered->dataType)
16592 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16593 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16594 exp->expType = type2;
16595 if(type2)
16596 type2->refCount++;
16597 }
16598 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)
16599 {
16600 if(exp->__anon1.op.exp2->destType)
16601 FreeType(exp->__anon1.op.exp2->destType);
16602 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16603 if(type1->__anon1._class->__anon1.registered->dataType)
16604 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16605 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16606 exp->expType = type1;
16607 if(type1)
16608 type1->refCount++;
16609 }
16610 else if(type1)
16611 {
16612 unsigned int valid = 0;
16613
16614 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
16615 {
16616 if(exp->__anon1.op.exp2->destType)
16617 FreeType(exp->__anon1.op.exp2->destType);
16618 if(!type1->__anon1._class->__anon1.registered->dataType)
16619 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16620 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16621 exp->__anon1.op.exp2->destType->refCount++;
16622 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16623 if(type2)
16624 FreeType(type2);
16625 type2 = exp->__anon1.op.exp2->destType;
16626 if(type2)
16627 type2->refCount++;
16628 exp->expType = type2;
16629 type2->refCount++;
16630 }
16631 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
16632 {
16633 if(exp->__anon1.op.exp1->destType)
16634 FreeType(exp->__anon1.op.exp1->destType);
16635 if(!type2->__anon1._class->__anon1.registered->dataType)
16636 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16637 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16638 exp->__anon1.op.exp1->destType->refCount++;
16639 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16640 type1 = exp->__anon1.op.exp1->destType;
16641 exp->expType = type1;
16642 type1->refCount++;
16643 }
16644 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
16645 {
16646 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
16647 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
16648
16649 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
16650 {
16651 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16652 {
16653 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16654 {
16655 if(exp->expType)
16656 FreeType(exp->expType);
16657 exp->expType = exp->__anon1.op.exp2->expType;
16658 if(exp->__anon1.op.exp2->expType)
16659 exp->__anon1.op.exp2->expType->refCount++;
16660 valid = 1;
16661 }
16662 }
16663 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16664 {
16665 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16666 {
16667 if(exp->expType)
16668 FreeType(exp->expType);
16669 exp->expType = exp->__anon1.op.exp1->expType;
16670 if(exp->__anon1.op.exp1->expType)
16671 exp->__anon1.op.exp1->expType->refCount++;
16672 valid = 1;
16673 }
16674 }
16675 }
16676 else
16677 {
16678 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16679 {
16680 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16681 {
16682 if(exp->expType)
16683 FreeType(exp->expType);
16684 exp->expType = exp->__anon1.op.exp1->expType;
16685 if(exp->__anon1.op.exp1->expType)
16686 exp->__anon1.op.exp1->expType->refCount++;
16687 valid = 1;
16688 }
16689 }
16690 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16691 {
16692 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16693 {
16694 if(exp->expType)
16695 FreeType(exp->expType);
16696 exp->expType = exp->__anon1.op.exp2->expType;
16697 if(exp->__anon1.op.exp2->expType)
16698 exp->__anon1.op.exp2->expType->refCount++;
16699 valid = 1;
16700 }
16701 }
16702 }
16703 }
16704 if(!valid)
16705 {
16706 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))
16707 {
16708 if(exp->__anon1.op.exp1->destType)
16709 FreeType(exp->__anon1.op.exp1->destType);
16710 exp->__anon1.op.exp1->destType = type2;
16711 type2->refCount++;
16712 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16713 {
16714 if(exp->expType)
16715 FreeType(exp->expType);
16716 exp->expType = exp->__anon1.op.exp1->destType;
16717 if(exp->__anon1.op.exp1->destType)
16718 exp->__anon1.op.exp1->destType->refCount++;
16719 }
16720 }
16721 else
16722 {
16723 if(exp->__anon1.op.exp2->destType)
16724 FreeType(exp->__anon1.op.exp2->destType);
16725 exp->__anon1.op.exp2->destType = type1;
16726 type1->refCount++;
16727 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16728 {
16729 if(exp->expType)
16730 FreeType(exp->expType);
16731 exp->expType = exp->__anon1.op.exp2->destType;
16732 if(exp->__anon1.op.exp2->destType)
16733 exp->__anon1.op.exp2->destType->refCount++;
16734 }
16735 else if(type1 && type2)
16736 {
16737 char expString1[10240];
16738 char expString2[10240];
16739 char type1String[1024];
16740 char type2String[1024];
16741
16742 expString1[0] = '\0';
16743 expString2[0] = '\0';
16744 type1String[0] = '\0';
16745 type2String[0] = '\0';
16746 if(inCompiler)
16747 {
16748 PrintExpression(exp->__anon1.op.exp1, expString1);
16749 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16750 PrintExpression(exp->__anon1.op.exp2, expString2);
16751 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16752 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
16753 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
16754 }
16755 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
16756 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
16757 {
16758 exp->expType = exp->__anon1.op.exp1->expType;
16759 if(exp->__anon1.op.exp1->expType)
16760 exp->__anon1.op.exp1->expType->refCount++;
16761 }
16762 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16763 {
16764 exp->expType = exp->__anon1.op.exp2->expType;
16765 if(exp->__anon1.op.exp2->expType)
16766 exp->__anon1.op.exp2->expType->refCount++;
16767 }
16768 }
16769 }
16770 }
16771 }
16772 else if(type2)
16773 {
16774 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16775 {
16776 struct Type * oldType = exp->__anon1.op.exp1->expType;
16777
16778 exp->__anon1.op.exp1->expType = (((void *)0));
16779 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16780 FreeType(oldType);
16781 else
16782 exp->__anon1.op.exp1->expType = oldType;
16783 }
16784 if(exp->__anon1.op.exp1->destType)
16785 FreeType(exp->__anon1.op.exp1->destType);
16786 exp->__anon1.op.exp1->destType = type2;
16787 type2->refCount++;
16788 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16789 {
16790 if(exp->expType)
16791 FreeType(exp->expType);
16792 exp->expType = exp->__anon1.op.exp1->destType;
16793 if(exp->__anon1.op.exp1->destType)
16794 exp->__anon1.op.exp1->destType->refCount++;
16795 }
16796 }
16797 }
16798 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
16799 {
16800 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16801 {
16802 if(exp->__anon1.op.exp1->destType)
16803 FreeType(exp->__anon1.op.exp1->destType);
16804 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16805 if(type2->__anon1._class->__anon1.registered->dataType)
16806 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16807 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16808 }
16809 if(exp->__anon1.op.op == '!')
16810 {
16811 exp->expType = MkClassType("bool");
16812 exp->expType->truth = 1;
16813 }
16814 else
16815 {
16816 exp->expType = type2;
16817 if(type2)
16818 type2->refCount++;
16819 }
16820 }
16821 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
16822 {
16823 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16824 {
16825 if(exp->__anon1.op.exp2->destType)
16826 FreeType(exp->__anon1.op.exp2->destType);
16827 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16828 if(type1->__anon1._class->__anon1.registered->dataType)
16829 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16830 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16831 }
16832 exp->expType = type1;
16833 if(type1)
16834 type1->refCount++;
16835 }
16836 }
16837 yylloc = exp->loc;
16838 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
16839 {
16840 char expString[10000];
16841
16842 expString[0] = '\0';
16843 if(inCompiler)
16844 {
16845 PrintExpression(exp->__anon1.op.exp1, expString);
16846 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16847 }
16848 if(expString[0])
16849 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16850 }
16851 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
16852 {
16853 char expString[10240];
16854
16855 expString[0] = '\0';
16856 if(inCompiler)
16857 {
16858 PrintExpression(exp->__anon1.op.exp2, expString);
16859 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16860 }
16861 if(expString[0])
16862 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16863 }
16864 if(boolResult)
16865 {
16866 FreeType(exp->expType);
16867 exp->expType = MkClassType("bool");
16868 exp->expType->truth = 1;
16869 }
16870 if(exp->__anon1.op.op != SIZEOF)
16871 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
16872 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
16873 {
16874 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
16875 }
16876 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
16877 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
16878 yylloc = oldyylloc;
16879 FreeType(dummy);
16880 if(type2)
16881 FreeType(type2);
16882 break;
16883 }
16884 case 5:
16885 case 32:
16886 {
16887 struct Expression * e;
16888
16889 exp->isConstant = 1;
16890 for(e = (*exp->__anon1.list).first; e; e = e->next)
16891 {
16892 if(!e->next)
16893 {
16894 FreeType(e->destType);
16895 e->opDestType = exp->opDestType;
16896 e->destType = exp->destType;
16897 if(e->destType)
16898 {
16899 exp->destType->refCount++;
16900 }
16901 }
16902 ProcessExpressionType(e);
16903 if(!exp->expType && !e->next)
16904 {
16905 exp->expType = e->expType;
16906 if(e->expType)
16907 e->expType->refCount++;
16908 }
16909 if(!e->isConstant)
16910 exp->isConstant = 0;
16911 }
16912 e = (*exp->__anon1.list).first;
16913 if(!e->next && e->type == 8)
16914 {
16915 struct Expression * next = exp->next, * prev = exp->prev;
16916
16917 FreeType(exp->expType);
16918 FreeType(exp->destType);
16919 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16920 *exp = *e;
16921 exp->prev = prev;
16922 exp->next = next;
16923 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
16924 ProcessExpressionType(exp);
16925 }
16926 break;
16927 }
16928 case 6:
16929 {
16930 struct Expression * e;
16931
16932 exp->isConstant = 1;
16933 ProcessExpressionType(exp->__anon1.index.exp);
16934 if(!exp->__anon1.index.exp->isConstant)
16935 exp->isConstant = 0;
16936 if(exp->__anon1.index.exp->expType)
16937 {
16938 struct Type * source = exp->__anon1.index.exp->expType;
16939
16940 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
16941 {
16942 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
16943 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
16944
16945 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
16946 {
16947 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
16948 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
16949 {
16950 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
16951
16952 if(type->kind == 8)
16953 type->constant = 1;
16954 else if(type->kind == 13)
16955 {
16956 struct Type * t = type;
16957
16958 while(t->kind == 13)
16959 t = t->__anon1.type;
16960 t->constant = 1;
16961 }
16962 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
16963 }
16964 }
16965 }
16966 }
16967 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
16968 {
16969 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
16970 {
16971 if(e->destType)
16972 FreeType(e->destType);
16973 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
16974 }
16975 ProcessExpressionType(e);
16976 if(!e->next)
16977 {
16978 }
16979 if(!e->isConstant)
16980 exp->isConstant = 0;
16981 }
16982 if(!exp->expType)
16983 exp->expType = Dereference(exp->__anon1.index.exp->expType);
16984 if(exp->expType)
16985 DeclareType(curExternal, exp->expType, 1, 0);
16986 break;
16987 }
16988 case 7:
16989 {
16990 struct Expression * e;
16991 struct Type * functionType;
16992 struct Type * methodType = (((void *)0));
16993 char name[1024];
16994
16995 name[0] = '\0';
16996 if(inCompiler)
16997 {
16998 PrintExpression(exp->__anon1.call.exp, name);
16999 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17000 {
17001 PrintExpression(exp->__anon1.call.exp, name);
17002 }
17003 }
17004 if(exp->__anon1.call.exp->type == 0)
17005 {
17006 struct Expression * idExp = exp->__anon1.call.exp;
17007 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17008
17009 if(!strcmp(id->string, "__builtin_frame_address"))
17010 {
17011 exp->expType = ProcessTypeString("void *", 1);
17012 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17013 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17014 break;
17015 }
17016 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17017 {
17018 exp->expType = ProcessTypeString("int", 1);
17019 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17020 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17021 break;
17022 }
17023 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17024 {
17025 struct Expression * a = (((void *)0));
17026 struct Expression * b = (((void *)0));
17027 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17028
17029 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17030 {
17031 a = (*exp->__anon1.call.arguments).first;
17032 b = (*exp->__anon1.call.arguments).last;
17033 tempExp1 = a;
17034 tempExp2 = b;
17035 }
17036 else if((*exp->__anon1.call.arguments).count == 1)
17037 {
17038 a = (*exp->__anon1.call.arguments).first;
17039 tempExp1 = a;
17040 }
17041 if(a)
17042 {
17043 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17044 idExp->__anon1.__anon1.identifier = (((void *)0));
17045 FreeExpContents(exp);
17046 ProcessExpressionType(a);
17047 if(b)
17048 ProcessExpressionType(b);
17049 exp->type = 5;
17050 exp->__anon1.list = MkList();
17051 if(a->expType && (!b || b->expType))
17052 {
17053 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17054 {
17055 if(inCompiler)
17056 {
17057 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17058 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17059 struct Declaration * decl;
17060 char temp1[1024], temp2[1024];
17061
17062 GetTypeSpecs(a->expType, specs);
17063 if(a && !a->isConstant && a->type != 0)
17064 {
17065 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17066 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17067 tempExp1 = QMkExpId(temp1);
17068 tempExp1->expType = a->expType;
17069 if(a->expType)
17070 a->expType->refCount++;
17071 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17072 }
17073 if(b && !b->isConstant && b->type != 0)
17074 {
17075 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17076 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17077 tempExp2 = QMkExpId(temp2);
17078 tempExp2->expType = b->expType;
17079 if(b->expType)
17080 b->expType->refCount++;
17081 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17082 }
17083 decl = MkDeclaration(specs, decls);
17084 if(!curCompound->__anon1.compound.declarations)
17085 curCompound->__anon1.compound.declarations = MkList();
17086 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17087 }
17088 }
17089 }
17090 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17091 {
17092 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17093
17094 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17095 exp->expType = a->expType;
17096 if(a->expType)
17097 a->expType->refCount++;
17098 }
17099 else if(!strcmp(id->string, "Abs"))
17100 {
17101 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17102 exp->expType = a->expType;
17103 if(a->expType)
17104 a->expType->refCount++;
17105 }
17106 else if(!strcmp(id->string, "Sgn"))
17107 {
17108 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"))))));
17109 exp->expType = ProcessTypeString("int", 0);
17110 }
17111 FreeExpression(tempExp1);
17112 if(tempExp2)
17113 FreeExpression(tempExp2);
17114 FreeIdentifier(id);
17115 break;
17116 }
17117 }
17118 }
17119 {
17120 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17121
17122 if(!exp->__anon1.call.exp->destType)
17123 {
17124 exp->__anon1.call.exp->destType = dummy;
17125 dummy->refCount++;
17126 }
17127 ProcessExpressionType(exp->__anon1.call.exp);
17128 if(exp->__anon1.call.exp->destType == dummy)
17129 {
17130 FreeType(dummy);
17131 exp->__anon1.call.exp->destType = (((void *)0));
17132 }
17133 FreeType(dummy);
17134 }
17135 functionType = exp->__anon1.call.exp->expType;
17136 if(functionType && functionType->kind == 16)
17137 {
17138 methodType = functionType;
17139 functionType = methodType->__anon1.__anon3.method->dataType;
17140 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17141 {
17142 char typeString[1024];
17143
17144 typeString[0] = '\0';
17145 {
17146 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17147
17148 functionType->__anon1.__anon2.thisClass = (((void *)0));
17149 PrintType(functionType, typeString, 1, 1);
17150 functionType->__anon1.__anon2.thisClass = back;
17151 }
17152 if(strstr(typeString, "thisclass"))
17153 {
17154 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17155 struct Declarator * decl;
17156
17157 {
17158 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17159
17160 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17161 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))
17162 thisClassParams = 0;
17163 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17164 {
17165 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17166
17167 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17168 ProcessDeclarator(decl, 1);
17169 thisClass = backupThisClass;
17170 }
17171 thisClassParams = 1;
17172 functionType = ProcessType(specs, decl);
17173 functionType->refCount = 0;
17174 FinishTemplatesContext(context);
17175 {
17176 struct Type * p, * op;
17177
17178 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)
17179 {
17180 if(op->kind == 21)
17181 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17182 }
17183 }
17184 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17185 {
17186 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17187 }
17188 }
17189 FreeList(specs, (void *)(FreeSpecifier));
17190 FreeDeclarator(decl);
17191 }
17192 }
17193 }
17194 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17195 {
17196 struct Type * type = functionType->__anon1.type;
17197
17198 if(!functionType->refCount)
17199 {
17200 functionType->__anon1.type = (((void *)0));
17201 FreeType(functionType);
17202 }
17203 functionType = type;
17204 }
17205 if(functionType && functionType->kind != 11)
17206 {
17207 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17208 }
17209 else if(functionType)
17210 {
17211 unsigned int emptyParams = 0, noParams = 0;
17212 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17213 struct Type * type = functionType->__anon1.__anon2.params.first;
17214 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17215 int extra = 0;
17216 struct Location oldyylloc = yylloc;
17217
17218 if(!type)
17219 emptyParams = 1;
17220 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17221 {
17222 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17223 e = e->next;
17224 }
17225 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17226 {
17227 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)
17228 {
17229 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17230 if(e)
17231 {
17232 e->destType = type;
17233 e = e->next;
17234 type = functionType->__anon1.__anon2.params.first;
17235 }
17236 else
17237 type->refCount = 0;
17238 }
17239 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17240 {
17241 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17242 type->byReference = functionType->byReference;
17243 type->typedByReference = functionType->typedByReference;
17244 if(e)
17245 {
17246 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17247 e = e->next;
17248 e->destType = type;
17249 e = e->next;
17250 type = functionType->__anon1.__anon2.params.first;
17251 }
17252 else
17253 type->refCount = 0;
17254 }
17255 }
17256 if(type && type->kind == 0)
17257 {
17258 noParams = 1;
17259 if(!type->refCount)
17260 FreeType(type);
17261 type = (((void *)0));
17262 }
17263 for(; e; e = e->next)
17264 {
17265 if(!type && !emptyParams)
17266 {
17267 yylloc = e->loc;
17268 if(methodType && methodType->__anon1.__anon3.methodClass)
17269 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);
17270 else
17271 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);
17272 break;
17273 }
17274 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17275 {
17276 struct Type * templatedType = (((void *)0));
17277 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17278 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17279 int id = 0;
17280
17281 if(_class && _class->templateArgs)
17282 {
17283 struct __ecereNameSpace__ecere__com__Class * sClass;
17284
17285 for(sClass = _class; sClass; sClass = sClass->base)
17286 {
17287 if(sClass->templateClass)
17288 sClass = sClass->templateClass;
17289 id = 0;
17290 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17291 {
17292 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17293 {
17294 struct __ecereNameSpace__ecere__com__Class * nextClass;
17295
17296 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17297 {
17298 if(nextClass->templateClass)
17299 nextClass = nextClass->templateClass;
17300 id += nextClass->templateParams.count;
17301 }
17302 break;
17303 }
17304 id++;
17305 }
17306 if(curParam)
17307 break;
17308 }
17309 }
17310 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17311 {
17312 unsigned int constant = type->constant;
17313 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17314
17315 {
17316 struct Context * context = SetupTemplatesContext(_class);
17317
17318 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17319 FinishTemplatesContext(context);
17320 }
17321 if(templatedType->kind == 8 && constant)
17322 templatedType->constant = 1;
17323 else if(templatedType->kind == 13)
17324 {
17325 struct Type * t = templatedType->__anon1.type;
17326
17327 while(t->kind == 13)
17328 t = t->__anon1.type;
17329 if(constant)
17330 t->constant = constant;
17331 }
17332 e->destType = templatedType;
17333 if(templatedType)
17334 {
17335 templatedType->passAsTemplate = 1;
17336 }
17337 }
17338 else
17339 {
17340 e->destType = type;
17341 if(type)
17342 type->refCount++;
17343 }
17344 }
17345 else
17346 {
17347 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17348 {
17349 e->destType = type->prev;
17350 e->destType->refCount++;
17351 }
17352 else
17353 {
17354 e->destType = type;
17355 if(type)
17356 type->refCount++;
17357 }
17358 }
17359 if(type && type->kind != 14)
17360 {
17361 struct Type * next = type->next;
17362
17363 if(!type->refCount)
17364 FreeType(type);
17365 type = next;
17366 }
17367 }
17368 if(type && type->kind != 14)
17369 {
17370 if(methodType && methodType->__anon1.__anon3.methodClass)
17371 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);
17372 else
17373 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);
17374 }
17375 yylloc = oldyylloc;
17376 if(type && !type->refCount)
17377 FreeType(type);
17378 }
17379 else
17380 {
17381 functionType = __extension__ ({
17382 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17383
17384 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17385 });
17386 if(exp->__anon1.call.exp->type == 0)
17387 {
17388 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17389
17390 if(inCompiler)
17391 {
17392 struct Symbol * symbol;
17393 struct Location oldyylloc = yylloc;
17394
17395 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17396 if(strstr(string, "__builtin_") == string)
17397 {
17398 if(exp->destType)
17399 {
17400 functionType->__anon1.__anon2.returnType = exp->destType;
17401 exp->destType->refCount++;
17402 }
17403 }
17404 else
17405 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17406 symbol = __extension__ ({
17407 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17408
17409 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17410 });
17411 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17412 if(strstr(symbol->string, "::"))
17413 globalContext->hasNameSpace = 1;
17414 yylloc = oldyylloc;
17415 }
17416 }
17417 else if(exp->__anon1.call.exp->type == 8)
17418 {
17419 }
17420 else
17421 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17422 if(!functionType->__anon1.__anon2.returnType)
17423 {
17424 functionType->__anon1.__anon2.returnType = __extension__ ({
17425 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17426
17427 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17428 });
17429 }
17430 }
17431 if(functionType && functionType->kind == 11)
17432 {
17433 exp->expType = functionType->__anon1.__anon2.returnType;
17434 if(functionType->__anon1.__anon2.returnType)
17435 functionType->__anon1.__anon2.returnType->refCount++;
17436 if(!functionType->refCount)
17437 FreeType(functionType);
17438 }
17439 if(exp->__anon1.call.arguments)
17440 {
17441 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17442 ProcessExpressionType(e);
17443 }
17444 break;
17445 }
17446 case 8:
17447 {
17448 struct Type * type;
17449 struct Location oldyylloc = yylloc;
17450 unsigned int thisPtr;
17451 struct Expression * checkExp = exp->__anon1.member.exp;
17452
17453 while(checkExp)
17454 {
17455 if(checkExp->type == 11)
17456 checkExp = checkExp->__anon1.cast.exp;
17457 else if(checkExp->type == 5)
17458 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17459 else
17460 break;
17461 }
17462 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17463 exp->thisPtr = thisPtr;
17464 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17465 {
17466 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17467 }
17468 ProcessExpressionType(exp->__anon1.member.exp);
17469 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)
17470 {
17471 exp->isConstant = 0;
17472 }
17473 else
17474 exp->isConstant = exp->__anon1.member.exp->isConstant;
17475 type = exp->__anon1.member.exp->expType;
17476 yylloc = exp->loc;
17477 if(type && (type->kind == 20))
17478 {
17479 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17480 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17481
17482 if(_class)
17483 {
17484 for(param = _class->templateParams.first; param; param = param->next)
17485 {
17486 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17487 break;
17488 }
17489 }
17490 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17491 {
17492 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17493
17494 if(argExp)
17495 {
17496 struct Expression * expMember = exp->__anon1.member.exp;
17497 struct Declarator * decl;
17498 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17499 char thisClassTypeString[1024];
17500
17501 FreeIdentifier(exp->__anon1.member.member);
17502 ProcessExpressionType(argExp);
17503 {
17504 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17505
17506 if(colon)
17507 {
17508 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17509 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17510 }
17511 else
17512 strcpy(thisClassTypeString, _class->fullName);
17513 }
17514 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17515 exp->expType = ProcessType(specs, decl);
17516 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17517 {
17518 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17519 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17520 int paramCount = 0;
17521 int lastParam = -1;
17522 char templateString[1024];
17523 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17524
17525 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17526 for(cClass = expClass; cClass; cClass = cClass->base)
17527 {
17528 int p = 0;
17529
17530 for(param = cClass->templateParams.first; param; param = param->next)
17531 {
17532 int id = p;
17533 struct __ecereNameSpace__ecere__com__Class * sClass;
17534 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17535
17536 for(sClass = cClass->base; sClass; sClass = sClass->base)
17537 id += sClass->templateParams.count;
17538 arg = expClass->templateArgs[id];
17539 for(sClass = _class; sClass; sClass = sClass->base)
17540 {
17541 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17542 int p = 0;
17543 struct __ecereNameSpace__ecere__com__Class * nextClass;
17544
17545 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17546 p += nextClass->templateParams.count;
17547 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17548 {
17549 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17550 {
17551 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17552 {
17553 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17554 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17555 break;
17556 }
17557 }
17558 }
17559 }
17560 {
17561 char argument[256];
17562
17563 argument[0] = '\0';
17564 switch(param->type)
17565 {
17566 case 2:
17567 {
17568 char expString[1024];
17569 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17570 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17571 struct Expression * exp;
17572 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17573
17574 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17575 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17576 ProcessExpressionType(exp);
17577 ComputeExpression(exp);
17578 expString[0] = '\0';
17579 PrintExpression(exp, expString);
17580 strcat(argument, expString);
17581 FreeExpression(exp);
17582 break;
17583 }
17584 case 1:
17585 {
17586 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17587 break;
17588 }
17589 case 0:
17590 {
17591 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17592 {
17593 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17594 strcat(argument, thisClassTypeString);
17595 else
17596 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17597 }
17598 break;
17599 }
17600 }
17601 if(argument[0])
17602 {
17603 if(paramCount)
17604 strcat(templateString, ", ");
17605 if(lastParam != p - 1)
17606 {
17607 strcat(templateString, param->name);
17608 strcat(templateString, " = ");
17609 }
17610 strcat(templateString, argument);
17611 paramCount++;
17612 lastParam = p;
17613 }
17614 p++;
17615 }
17616 }
17617 }
17618 {
17619 int len = strlen(templateString);
17620
17621 if(templateString[len - 1] == '>')
17622 templateString[len++] = ' ';
17623 templateString[len++] = '>';
17624 templateString[len++] = '\0';
17625 }
17626 {
17627 struct Context * context = SetupTemplatesContext(_class);
17628
17629 FreeType(exp->expType);
17630 exp->expType = ProcessTypeString(templateString, 0);
17631 FinishTemplatesContext(context);
17632 }
17633 }
17634 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
17635 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
17636 exp->type = 5;
17637 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")))))))));
17638 }
17639 }
17640 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
17641 {
17642 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
17643 }
17644 }
17645 if(type && (type->kind == 20))
17646 ;
17647 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)))
17648 {
17649 struct Identifier * id = exp->__anon1.member.member;
17650 int typeKind = type->kind;
17651 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));
17652
17653 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
17654 {
17655 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
17656 typeKind = 8;
17657 }
17658 if(id)
17659 {
17660 if(typeKind == 3 || typeKind == 15)
17661 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
17662 else if(!_class)
17663 {
17664 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17665 {
17666 _class = type->__anon1._class->__anon1.registered;
17667 }
17668 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
17669 {
17670 _class = FindClass("char *")->__anon1.registered;
17671 }
17672 else if(type->kind == 13)
17673 {
17674 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
17675 FreeType(exp->expType);
17676 exp->expType = ProcessTypeString("uintptr", 0);
17677 exp->byReference = 1;
17678 }
17679 else
17680 {
17681 char string[1024] = "";
17682 struct Symbol * classSym;
17683
17684 PrintTypeNoConst(type, string, 0, 1);
17685 classSym = FindClass(string);
17686 if(classSym)
17687 _class = classSym->__anon1.registered;
17688 }
17689 }
17690 }
17691 if(_class && id)
17692 {
17693 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
17694 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
17695 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17696 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
17697 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
17698
17699 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
17700 exp->__anon1.member.memberType = 1;
17701 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
17702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
17703 if(typeKind != 19)
17704 {
17705 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
17706 {
17707 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17708 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
17709 {
17710 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17711 if(prop)
17712 member = (((void *)0));
17713 }
17714 if(!member && !prop)
17715 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17716 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
17717 exp->__anon1.member.thisPtr = 1;
17718 }
17719 else
17720 {
17721 unsigned int useMemberForNonConst = 0;
17722
17723 if(!id->classSym)
17724 {
17725 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
17726 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);
17727 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17728 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
17729 }
17730 if((!prop || useMemberForNonConst) && !member)
17731 {
17732 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
17733 if(!method)
17734 {
17735 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17736 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);
17737 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17738 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17739 }
17740 }
17741 if(member && prop)
17742 {
17743 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
17744 prop = (((void *)0));
17745 else
17746 member = (((void *)0));
17747 }
17748 }
17749 }
17750 if(!prop && !member && !method)
17751 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
17752 if(!prop && !member && !method)
17753 {
17754 if(typeKind == 19)
17755 {
17756 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
17757 if(classProp)
17758 {
17759 exp->__anon1.member.memberType = 5;
17760 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
17761 }
17762 else
17763 {
17764 char structName[1024];
17765 struct Identifier * id = exp->__anon1.member.member;
17766 struct Expression * classExp = exp->__anon1.member.exp;
17767
17768 type->refCount++;
17769 FreeType(classExp->expType);
17770 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
17771 strcpy(structName, "__ecereClassData_");
17772 FullClassNameCat(structName, type->__anon1._class->string, 0);
17773 exp->type = 9;
17774 exp->__anon1.member.member = id;
17775 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"))))))));
17776 FreeType(type);
17777 ProcessExpressionType(exp);
17778 return ;
17779 }
17780 }
17781 else
17782 {
17783 struct Symbol * classSym = FindClass(id->string);
17784
17785 if(classSym)
17786 {
17787 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
17788
17789 if(convertClass)
17790 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
17791 }
17792 }
17793 }
17794 if(exp->__anon1.member.exp->destType)
17795 FreeType(exp->__anon1.member.exp->destType);
17796 {
17797 if(method && !method->_class->symbol)
17798 method->_class->symbol = FindClass(method->_class->fullName);
17799 if(prop && !prop->_class->symbol)
17800 prop->_class->symbol = FindClass(prop->_class->fullName);
17801 exp->__anon1.member.exp->destType = __extension__ ({
17802 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17803
17804 __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;
17805 });
17806 }
17807 if(prop)
17808 {
17809 exp->__anon1.member.memberType = 1;
17810 if(!prop->dataType)
17811 ProcessPropertyType(prop);
17812 exp->expType = prop->dataType;
17813 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
17814 {
17815 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17816
17817 CopyTypeInto(type, exp->expType);
17818 type->refCount = 1;
17819 type->constant = 1;
17820 exp->expType = type;
17821 }
17822 else if(prop->dataType)
17823 prop->dataType->refCount++;
17824 }
17825 else if(member)
17826 {
17827 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17828 {
17829 FreeExpContents(exp);
17830 exp->type = 0;
17831 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17832 ProcessExpressionType(exp);
17833 return ;
17834 }
17835 exp->__anon1.member.memberType = 3;
17836 DeclareStruct(curExternal, _class->fullName, 0, 1);
17837 if(member->_class != _class)
17838 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
17839 if(!member->dataType)
17840 {
17841 struct Context * context = SetupTemplatesContext(_class);
17842
17843 member->dataType = ProcessTypeString(member->dataTypeString, 0);
17844 FinishTemplatesContext(context);
17845 }
17846 exp->expType = member->dataType;
17847 if(member->dataType)
17848 member->dataType->refCount++;
17849 }
17850 else if(revConvert)
17851 {
17852 exp->__anon1.member.memberType = 4;
17853 exp->expType = MkClassType(revConvert->_class->fullName);
17854 }
17855 else if(method)
17856 {
17857 {
17858 exp->__anon1.member.memberType = 2;
17859 }
17860 if(!method->dataType)
17861 ProcessMethodType(method);
17862 exp->expType = __extension__ ({
17863 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17864
17865 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
17866 });
17867 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
17868 exp->expType->__anon1.__anon3.usedClass = _class;
17869 }
17870 else if(!classProp)
17871 {
17872 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17873 {
17874 FreeExpContents(exp);
17875 exp->type = 0;
17876 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17877 FreeType(exp->expType);
17878 exp->expType = MkClassType("ecere::com::Class");
17879 return ;
17880 }
17881 yylloc = exp->__anon1.member.member->loc;
17882 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
17883 if(inCompiler)
17884 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
17885 }
17886 if(_class && exp->expType)
17887 {
17888 struct __ecereNameSpace__ecere__com__Class * tClass;
17889
17890 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
17891 while(tClass && !tClass->templateClass)
17892 tClass = tClass->base;
17893 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
17894 {
17895 int id = 0;
17896 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17897 struct __ecereNameSpace__ecere__com__Class * sClass;
17898
17899 for(sClass = tClass; sClass; sClass = sClass->base)
17900 {
17901 id = 0;
17902 if(sClass->templateClass)
17903 sClass = sClass->templateClass;
17904 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17905 {
17906 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
17907 {
17908 for(sClass = sClass->base; sClass; sClass = sClass->base)
17909 id += sClass->templateParams.count;
17910 break;
17911 }
17912 id++;
17913 }
17914 if(curParam)
17915 break;
17916 }
17917 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
17918 {
17919 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
17920 struct Context * context = SetupTemplatesContext(tClass);
17921 unsigned int constant = exp->expType->constant;
17922 unsigned int passAsTemplate = 0;
17923 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
17924 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
17925
17926 if(t && t->kind == 8 && t->__anon1._class)
17927 thisClassFrom = t->__anon1._class->__anon1.registered;
17928 FreeType(t);
17929 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
17930 FreeType(exp->expType);
17931 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17932 exp->expType->thisClassFrom = thisClassFrom;
17933 if(exp->expType->kind == 8 && constant)
17934 exp->expType->constant = 1;
17935 else if(exp->expType->kind == 13)
17936 {
17937 struct Type * t = exp->expType->__anon1.type;
17938
17939 while(t->kind == 13)
17940 t = t->__anon1.type;
17941 if(constant)
17942 t->constant = constant;
17943 }
17944 if(exp->expType)
17945 {
17946 if(exp->expType->kind == 21)
17947 {
17948 FreeType(exp->expType);
17949 exp->expType = ReplaceThisClassType(_class);
17950 }
17951 if(passAsTemplate)
17952 exp->expType->passAsTemplate = 1;
17953 if(!exp->destType)
17954 {
17955 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17956 if(exp->destType->kind == 8 && constant)
17957 exp->destType->constant = 1;
17958 else if(exp->destType->kind == 13)
17959 {
17960 struct Type * t = exp->destType->__anon1.type;
17961
17962 while(t->kind == 13)
17963 t = t->__anon1.type;
17964 if(constant)
17965 t->constant = constant;
17966 }
17967 if(exp->destType->kind == 21)
17968 {
17969 FreeType(exp->destType);
17970 exp->destType = ReplaceThisClassType(_class);
17971 }
17972 }
17973 }
17974 FinishTemplatesContext(context);
17975 }
17976 }
17977 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)
17978 {
17979 int id = 0;
17980 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17981 struct __ecereNameSpace__ecere__com__Class * sClass;
17982
17983 for(sClass = tClass; sClass; sClass = sClass->base)
17984 {
17985 id = 0;
17986 if(sClass->templateClass)
17987 sClass = sClass->templateClass;
17988 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17989 {
17990 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
17991 {
17992 for(sClass = sClass->base; sClass; sClass = sClass->base)
17993 id += sClass->templateParams.count;
17994 break;
17995 }
17996 id++;
17997 }
17998 if(curParam)
17999 break;
18000 }
18001 if(curParam)
18002 {
18003 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18004 struct Context * context = SetupTemplatesContext(tClass);
18005 struct Type * basicType;
18006
18007 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18008 if(basicType)
18009 {
18010 if(basicType->kind == 21)
18011 {
18012 FreeType(basicType);
18013 basicType = ReplaceThisClassType(_class);
18014 }
18015 FreeType(exp->expType);
18016 exp->expType = __extension__ ({
18017 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18018
18019 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18020 });
18021 if(!exp->destType)
18022 {
18023 exp->destType = exp->expType;
18024 exp->destType->refCount++;
18025 }
18026 {
18027 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18028 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18029 struct Declarator * decl;
18030
18031 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18032 *newExp = *exp;
18033 if(exp->destType)
18034 exp->destType->refCount++;
18035 if(exp->expType)
18036 exp->expType->refCount++;
18037 exp->type = 11;
18038 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18039 exp->__anon1.cast.exp = newExp;
18040 }
18041 }
18042 FinishTemplatesContext(context);
18043 }
18044 }
18045 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18046 {
18047 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18048
18049 if(expClass)
18050 {
18051 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18052 int p = 0;
18053 int paramCount = 0;
18054 int lastParam = -1;
18055 char templateString[1024];
18056 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18057
18058 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18059 while(cClass != expClass)
18060 {
18061 struct __ecereNameSpace__ecere__com__Class * sClass;
18062
18063 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18064 ;
18065 cClass = sClass;
18066 for(param = cClass->templateParams.first; param; param = param->next)
18067 {
18068 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18069 int cp = 0;
18070 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18071 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18072
18073 while(cClassCur != tClass && !paramCur)
18074 {
18075 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18076
18077 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18078 ;
18079 cClassCur = sClassCur;
18080 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18081 {
18082 if(!strcmp(paramCur->name, param->name))
18083 {
18084 break;
18085 }
18086 cp++;
18087 }
18088 }
18089 if(paramCur && paramCur->type == 0)
18090 arg = tClass->templateArgs[cp];
18091 else
18092 arg = expClass->templateArgs[p];
18093 {
18094 char argument[256];
18095
18096 argument[0] = '\0';
18097 switch(param->type)
18098 {
18099 case 2:
18100 {
18101 char expString[1024];
18102 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18103 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18104 struct Expression * exp;
18105 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18106
18107 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18108 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18109 ProcessExpressionType(exp);
18110 ComputeExpression(exp);
18111 expString[0] = '\0';
18112 PrintExpression(exp, expString);
18113 strcat(argument, expString);
18114 FreeExpression(exp);
18115 break;
18116 }
18117 case 1:
18118 {
18119 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18120 break;
18121 }
18122 case 0:
18123 {
18124 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18125 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18126 break;
18127 }
18128 }
18129 if(argument[0])
18130 {
18131 if(paramCount)
18132 strcat(templateString, ", ");
18133 if(lastParam != p - 1)
18134 {
18135 strcat(templateString, param->name);
18136 strcat(templateString, " = ");
18137 }
18138 strcat(templateString, argument);
18139 paramCount++;
18140 lastParam = p;
18141 }
18142 }
18143 p++;
18144 }
18145 }
18146 {
18147 int len = strlen(templateString);
18148
18149 if(templateString[len - 1] == '>')
18150 templateString[len++] = ' ';
18151 templateString[len++] = '>';
18152 templateString[len++] = '\0';
18153 }
18154 FreeType(exp->expType);
18155 {
18156 struct Context * context = SetupTemplatesContext(tClass);
18157
18158 exp->expType = ProcessTypeString(templateString, 0);
18159 FinishTemplatesContext(context);
18160 }
18161 }
18162 }
18163 }
18164 }
18165 else
18166 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)");
18167 }
18168 else if(type && (type->kind == 9 || type->kind == 10))
18169 {
18170 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18171
18172 if(memberType)
18173 {
18174 exp->expType = memberType;
18175 if(memberType)
18176 memberType->refCount++;
18177 }
18178 }
18179 else
18180 {
18181 char expString[10240];
18182
18183 expString[0] = '\0';
18184 if(inCompiler)
18185 {
18186 PrintExpression(exp, expString);
18187 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18188 }
18189 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18190 }
18191 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18192 {
18193 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18194 {
18195 struct Identifier * id = exp->__anon1.member.member;
18196 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));
18197
18198 if(_class)
18199 {
18200 FreeType(exp->expType);
18201 exp->expType = ReplaceThisClassType(_class);
18202 }
18203 }
18204 }
18205 yylloc = oldyylloc;
18206 break;
18207 }
18208 case 9:
18209 {
18210 struct Type * destType = exp->destType;
18211
18212 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18213 {
18214 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18215 }
18216 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18217 exp->type = 8;
18218 if(destType)
18219 destType->count++;
18220 ProcessExpressionType(exp);
18221 if(destType)
18222 destType->count--;
18223 break;
18224 }
18225 case 15:
18226 {
18227 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18228
18229 if(classSym && classSym->__anon1.registered)
18230 {
18231 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18232 {
18233 char name[1024];
18234 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18235
18236 name[0] = '\0';
18237 DeclareStruct(curExternal, classSym->string, 0, 1);
18238 FreeSpecifier(exp->__anon1._class);
18239 FullClassNameCat(name, classSym->string, 0);
18240 if(b->offset == 0)
18241 {
18242 exp->type = 10;
18243 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18244 }
18245 else
18246 {
18247 struct Expression * e;
18248
18249 exp->type = 4;
18250 if(b->structSize == b->offset)
18251 exp->__anon1.op.exp1 = MkExpConstant("0");
18252 else
18253 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18254 exp->__anon1.op.op = '+';
18255 e = exp;
18256 while(b->offset != 0)
18257 {
18258 struct Symbol * sym;
18259 struct Expression * typeSize;
18260
18261 b = b->base;
18262 sym = FindClass(b->fullName);
18263 name[0] = '\0';
18264 DeclareStruct(curExternal, sym->string, 0, 1);
18265 FullClassNameCat(name, sym->string, 0);
18266 if(b->structSize == b->offset)
18267 typeSize = MkExpConstant("0");
18268 else
18269 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18270 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18271 e = e->__anon1.op.exp2;
18272 }
18273 }
18274 }
18275 else
18276 {
18277 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18278 {
18279 FreeSpecifier(exp->__anon1._class);
18280 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18281 exp->type = 2;
18282 }
18283 else
18284 {
18285 char className[1024];
18286
18287 strcpy(className, "__ecereClass_");
18288 FullClassNameCat(className, classSym->string, 1);
18289 DeclareClass(curExternal, classSym, className);
18290 FreeExpContents(exp);
18291 exp->type = 9;
18292 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18293 exp->__anon1.member.member = MkIdentifier("structSize");
18294 }
18295 }
18296 }
18297 exp->expType = __extension__ ({
18298 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18299
18300 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18301 });
18302 break;
18303 }
18304 case 10:
18305 {
18306 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
18307
18308 exp->expType = __extension__ ({
18309 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18310
18311 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18312 });
18313 exp->isConstant = 1;
18314 DeclareType(curExternal, type, 1, 0);
18315 FreeType(type);
18316 break;
18317 }
18318 case 11:
18319 {
18320 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18321
18322 type->count = 1;
18323 FreeType(exp->__anon1.cast.exp->destType);
18324 exp->__anon1.cast.exp->destType = type;
18325 type->refCount++;
18326 type->casted = 1;
18327 ProcessExpressionType(exp->__anon1.cast.exp);
18328 type->casted = 0;
18329 type->count = 0;
18330 exp->expType = type;
18331 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18332 {
18333 void * prev = exp->prev, * next = exp->next;
18334 struct Type * expType = exp->__anon1.cast.exp->destType;
18335 struct Expression * castExp = exp->__anon1.cast.exp;
18336 struct Type * destType = exp->destType;
18337
18338 if(expType)
18339 expType->refCount++;
18340 FreeType(exp->expType);
18341 FreeTypeName(exp->__anon1.cast.typeName);
18342 *exp = *castExp;
18343 FreeType(exp->expType);
18344 FreeType(exp->destType);
18345 exp->expType = expType;
18346 exp->destType = destType;
18347 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
18348 exp->prev = prev;
18349 exp->next = next;
18350 }
18351 else
18352 {
18353 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18354 }
18355 break;
18356 }
18357 case 33:
18358 {
18359 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18360
18361 exp->expType = type;
18362 break;
18363 }
18364 case 34:
18365 {
18366 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18367
18368 ProcessExpressionType(exp->__anon1.vaArg.exp);
18369 exp->expType = type;
18370 break;
18371 }
18372 case 12:
18373 {
18374 struct Expression * e;
18375 struct Type * t = exp->destType;
18376
18377 if(t && !exp->destType->casted)
18378 {
18379 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18380 CopyTypeInto(t, exp->destType);
18381 t->count = 0;
18382 }
18383 else if(t)
18384 t->refCount++;
18385 exp->isConstant = 1;
18386 FreeType(exp->__anon1.cond.cond->destType);
18387 exp->__anon1.cond.cond->destType = MkClassType("bool");
18388 exp->__anon1.cond.cond->destType->truth = 1;
18389 ProcessExpressionType(exp->__anon1.cond.cond);
18390 if(!exp->__anon1.cond.cond->isConstant)
18391 exp->isConstant = 0;
18392 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18393 {
18394 if(!e->next)
18395 {
18396 FreeType(e->destType);
18397 e->destType = t;
18398 if(e->destType)
18399 e->destType->refCount++;
18400 }
18401 ProcessExpressionType(e);
18402 if(!e->next)
18403 {
18404 exp->expType = e->expType;
18405 if(e->expType)
18406 e->expType->refCount++;
18407 }
18408 if(!e->isConstant)
18409 exp->isConstant = 0;
18410 }
18411 FreeType(exp->__anon1.cond.elseExp->destType);
18412 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18413 if(exp->__anon1.cond.elseExp->destType)
18414 exp->__anon1.cond.elseExp->destType->refCount++;
18415 ProcessExpressionType(exp->__anon1.cond.elseExp);
18416 if(!exp->__anon1.cond.elseExp->isConstant)
18417 exp->isConstant = 0;
18418 FreeType(t);
18419 break;
18420 }
18421 case 23:
18422 {
18423 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18424 {
18425 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18426
18427 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18428 {
18429 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18430 if(exp->destType)
18431 exp->destType->refCount++;
18432 }
18433 ProcessStatement(exp->__anon1.compound);
18434 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18435 if(exp->expType)
18436 exp->expType->refCount++;
18437 }
18438 break;
18439 }
18440 case 24:
18441 {
18442 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18443
18444 if(spec && spec->type == 1)
18445 {
18446 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18447 exp->expType->kind = 19;
18448 exp->byReference = 1;
18449 }
18450 else
18451 {
18452 exp->expType = MkClassType("ecere::com::Class");
18453 exp->byReference = 1;
18454 }
18455 break;
18456 }
18457 case 25:
18458 {
18459 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18460
18461 if(_class)
18462 {
18463 struct Identifier * id = exp->__anon1.classData.id;
18464 char structName[1024];
18465 struct Expression * classExp;
18466
18467 strcpy(structName, "__ecereClassData_");
18468 FullClassNameCat(structName, _class->fullName, 0);
18469 exp->type = 9;
18470 exp->__anon1.member.member = id;
18471 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18472 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18473 else
18474 classExp = MkExpIdentifier(MkIdentifier("class"));
18475 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"))))))));
18476 ProcessExpressionType(exp);
18477 return ;
18478 }
18479 break;
18480 }
18481 case 35:
18482 {
18483 struct Type * type = (((void *)0));
18484 const char * typeString = (((void *)0));
18485 char typeStringBuf[1024];
18486
18487 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))
18488 {
18489 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18490
18491 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18492 }
18493 else if(exp->__anon1.list)
18494 {
18495 struct Expression * e;
18496
18497 for(e = (*exp->__anon1.list).first; e; e = e->next)
18498 {
18499 ProcessExpressionType(e);
18500 if(e->expType)
18501 {
18502 if(!type)
18503 {
18504 type = e->expType;
18505 type->refCount++;
18506 }
18507 else
18508 {
18509 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18510 {
18511 FreeType(type);
18512 type = e->expType;
18513 e->expType = (((void *)0));
18514 e = (*exp->__anon1.list).first;
18515 ProcessExpressionType(e);
18516 if(e->expType)
18517 {
18518 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18519 {
18520 FreeType(e->expType);
18521 e->expType = (((void *)0));
18522 FreeType(type);
18523 type = (((void *)0));
18524 break;
18525 }
18526 }
18527 }
18528 }
18529 if(e->expType)
18530 {
18531 FreeType(e->expType);
18532 e->expType = (((void *)0));
18533 }
18534 }
18535 }
18536 if(type)
18537 {
18538 typeStringBuf[0] = '\0';
18539 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18540 typeString = typeStringBuf;
18541 FreeType(type);
18542 type = (((void *)0));
18543 }
18544 }
18545 if(typeString)
18546 {
18547 char templateString[1024];
18548 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18549 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18550 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18551 struct Expression * expExt;
18552 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18553
18554 sprintf(templateString, "Container<%s>", typeString);
18555 if(exp->__anon1.list)
18556 {
18557 struct Expression * e;
18558
18559 type = ProcessTypeString(typeString, 0);
18560 while((e = (*exp->__anon1.list).first))
18561 {
18562 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18563 e->destType = type;
18564 type->refCount++;
18565 ProcessExpressionType(e);
18566 ListAdd(initializers, MkInitializerAssignment(e));
18567 }
18568 FreeType(type);
18569 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18570 }
18571 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18572 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18573 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18574 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18575 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18576 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18577 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18578 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18579 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18580 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18581 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18582
18583 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18584 })));
18585 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18586 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18587 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18588 exp->expType = ProcessTypeString(templateString, 0);
18589 exp->type = 5;
18590 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18591 ProcessExpressionType(expExt);
18592 }
18593 else
18594 {
18595 exp->expType = ProcessTypeString("Container", 0);
18596 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18597 }
18598 break;
18599 }
18600 }
18601 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18602 {
18603 FreeType(exp->expType);
18604 exp->expType = ReplaceThisClassType(thisClass);
18605 }
18606 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)
18607 {
18608 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
18609
18610 if(symbol)
18611 {
18612 if(exp->expType->kind != 15)
18613 {
18614 struct Type * member;
18615 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
18616
18617 FreeType(exp->expType);
18618 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18619 exp->expType->kind = symbol->type->kind;
18620 exp->expType->refCount++;
18621 exp->expType->__anon1.__anon1.enumName = enumName;
18622 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
18623 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18624 member->refCount++;
18625 }
18626 else
18627 {
18628 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
18629
18630 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18631 {
18632 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);
18633
18634 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
18635 }
18636 }
18637 }
18638 }
18639 yylloc = exp->loc;
18640 if(exp->destType && (exp->destType->kind == 18))
18641 ;
18642 else if(exp->destType && !exp->destType->keepCast)
18643 {
18644 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
18645 exp->needTemplateCast = 1;
18646 if(exp->destType->kind == 0)
18647 ;
18648 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
18649 {
18650 unsigned int invalidCast = 0;
18651
18652 if(inCompiler && exp->destType->count && exp->expType)
18653 {
18654 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
18655 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
18656
18657 if(c1 && c1->type != 1)
18658 c1 = (((void *)0));
18659 if(c2 && c2->type != 1)
18660 c2 = (((void *)0));
18661 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
18662 invalidCast = 1;
18663 }
18664 if(!exp->destType->count || unresolved || invalidCast)
18665 {
18666 if(!exp->expType)
18667 {
18668 yylloc = exp->loc;
18669 if(exp->destType->kind != 14)
18670 {
18671 char type2[1024];
18672
18673 type2[0] = '\0';
18674 if(inCompiler)
18675 {
18676 char expString[10240];
18677
18678 expString[0] = '\0';
18679 PrintType(exp->destType, type2, 0, 1);
18680 if(inCompiler)
18681 {
18682 PrintExpression(exp, expString);
18683 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18684 }
18685 if(unresolved)
18686 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
18687 else if(exp->type != 16)
18688 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
18689 }
18690 }
18691 else
18692 {
18693 char expString[10240];
18694
18695 expString[0] = '\0';
18696 if(inCompiler)
18697 {
18698 PrintExpression(exp, expString);
18699 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18700 }
18701 if(unresolved)
18702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
18703 else if(exp->type != 16)
18704 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18705 }
18706 }
18707 else
18708 {
18709 char type1[1024];
18710 char type2[1024];
18711
18712 type1[0] = '\0';
18713 type2[0] = '\0';
18714 if(inCompiler)
18715 {
18716 PrintType(exp->expType, type1, 0, 1);
18717 PrintType(exp->destType, type2, 0, 1);
18718 }
18719 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)))
18720 ;
18721 else
18722 {
18723 char expString[10240];
18724
18725 expString[0] = '\0';
18726 if(inCompiler)
18727 {
18728 PrintExpression(exp, expString);
18729 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18730 }
18731 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")))
18732 {
18733 if(invalidCast)
18734 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18735 else
18736 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18737 }
18738 if(!inCompiler)
18739 {
18740 FreeType(exp->expType);
18741 exp->destType->refCount++;
18742 exp->expType = exp->destType;
18743 }
18744 }
18745 }
18746 }
18747 }
18748 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))
18749 {
18750 struct Expression * nbExp = GetNonBracketsExp(exp);
18751
18752 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
18753 {
18754 struct Expression * e = MoveExpContents(exp);
18755
18756 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
18757 exp->type = 11;
18758 exp->__anon1.cast.exp->destType = exp->destType;
18759 if(exp->destType)
18760 exp->destType->refCount++;
18761 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
18762 }
18763 }
18764 }
18765 else if(unresolved)
18766 {
18767 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
18768 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);
18769 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
18770 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
18771 }
18772 else if(!exp->expType && exp->type != 16)
18773 {
18774 char expString[10240];
18775
18776 expString[0] = '\0';
18777 if(inCompiler)
18778 {
18779 PrintExpression(exp, expString);
18780 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18781 }
18782 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18783 }
18784 if(inCompiler)
18785 ApplyAnyObjectLogic(exp);
18786 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)))
18787 {
18788 exp->byReference = 1;
18789 }
18790 yylloc = oldyylloc;
18791 }
18792
18793 static void ProcessFunction(struct FunctionDefinition * function)
18794 {
18795 struct Identifier * id = GetDeclId(function->declarator);
18796 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18797 struct Type * type = symbol ? symbol->type : (((void *)0));
18798 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18799 struct Context * oldTopContext = topContext;
18800
18801 yylloc = function->loc;
18802 if(type && type->__anon1.__anon2.thisClass)
18803 {
18804 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18805 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18806 char className[1024];
18807 char structName[1024];
18808 struct Declarator * funcDecl;
18809 struct Symbol * thisSymbol;
18810 unsigned int typedObject = 0;
18811
18812 if(_class && !_class->base)
18813 {
18814 _class = currentClass;
18815 if(_class && !_class->symbol)
18816 _class->symbol = FindClass(_class->fullName);
18817 classSym = _class ? _class->symbol : (((void *)0));
18818 typedObject = 1;
18819 }
18820 thisClass = _class;
18821 if(inCompiler && _class)
18822 {
18823 if(type->kind == 11)
18824 {
18825 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18826 {
18827 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18828
18829 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18830 FreeType(param);
18831 }
18832 if(type->classObjectType != 1)
18833 {
18834 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18835 symbol->type->__anon1.__anon2.staticMethod = 1;
18836 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18837 symbol->type->extraParam = 0;
18838 }
18839 }
18840 strcpy(className, "__ecereClass_");
18841 FullClassNameCat(className, _class->fullName, 1);
18842 structName[0] = (char)0;
18843 FullClassNameCat(structName, _class->fullName, 0);
18844 funcDecl = GetFuncDecl(function->declarator);
18845 if(funcDecl)
18846 {
18847 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18848 {
18849 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18850
18851 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18852 {
18853 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18854 FreeTypeName(param);
18855 }
18856 }
18857 if(!function->propertyNoThis)
18858 {
18859 struct TypeName * thisParam = (((void *)0));
18860
18861 if(type->classObjectType != 1)
18862 {
18863 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18864 if(!funcDecl->__anon1.function.parameters)
18865 funcDecl->__anon1.function.parameters = MkList();
18866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18867 }
18868 if(typedObject)
18869 {
18870 if(type->classObjectType != 1)
18871 {
18872 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18873 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18874 }
18875 thisParam = __extension__ ({
18876 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18877
18878 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18879 });
18880 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
18881 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18882 }
18883 }
18884 }
18885 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18886 {
18887 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18888
18889 funcDecl = GetFuncDecl(initDecl->declarator);
18890 if(funcDecl)
18891 {
18892 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18893 {
18894 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18895
18896 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18897 {
18898 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18899 FreeTypeName(param);
18900 }
18901 }
18902 if(type->classObjectType != 1)
18903 {
18904 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18905 {
18906 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18907
18908 if(!funcDecl->__anon1.function.parameters)
18909 funcDecl->__anon1.function.parameters = MkList();
18910 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18911 }
18912 }
18913 }
18914 }
18915 }
18916 if(function->body)
18917 {
18918 if(type->classObjectType != 1)
18919 {
18920 thisSymbol = __extension__ ({
18921 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18922
18923 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18924 });
18925 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18926 if(typedObject && thisSymbol->type)
18927 {
18928 thisSymbol->type->classObjectType = 2;
18929 thisSymbol->type->byReference = type->byReference;
18930 thisSymbol->type->typedByReference = type->byReference;
18931 }
18932 }
18933 }
18934 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
18935 {
18936 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18937
18938 {
18939 struct __ecereNameSpace__ecere__com__Class * base;
18940
18941 for(base = _class; base && base->type != 1000; base = base->next)
18942 {
18943 for(member = base->membersAndProperties.first; member; member = member->next)
18944 if(!member->isProperty)
18945 break;
18946 if(member)
18947 break;
18948 }
18949 }
18950 for(member = _class->membersAndProperties.first; member; member = member->next)
18951 if(!member->isProperty)
18952 break;
18953 if(member)
18954 {
18955 char pointerName[1024];
18956 struct Declaration * decl;
18957 struct Initializer * initializer;
18958 struct Expression * exp, * bytePtr;
18959
18960 strcpy(pointerName, "__ecerePointer_");
18961 FullClassNameCat(pointerName, _class->fullName, 0);
18962 {
18963 char className[1024];
18964
18965 strcpy(className, "__ecereClass_");
18966 FullClassNameCat(className, classSym->string, 1);
18967 DeclareClass(curExternal, classSym, className);
18968 }
18969 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18970 if(_class->fixed)
18971 {
18972 struct Expression * e;
18973
18974 if(_class->offset && _class->offset == _class->base->structSize)
18975 {
18976 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
18977 ProcessExpressionType(e);
18978 }
18979 else
18980 {
18981 char string[256];
18982
18983 sprintf(string, "%d", _class->offset);
18984 e = MkExpConstant(string);
18985 }
18986 exp = QBrackets(MkExpOp(bytePtr, '+', e));
18987 }
18988 else
18989 {
18990 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18991 }
18992 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18993 exp->expType = __extension__ ({
18994 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18995
18996 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18997 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18998
18999 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19000 }), __ecereInstance2;
19001 });
19002 if(function->body)
19003 {
19004 yylloc = function->body->loc;
19005 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19006 {
19007 struct Context * prevContext = curContext;
19008 struct __ecereNameSpace__ecere__sys__OldList * list;
19009
19010 curContext = function->body->__anon1.compound.context;
19011 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19013 curContext = prevContext;
19014 }
19015 decl->symbol = (((void *)0));
19016 if(!function->body->__anon1.compound.declarations)
19017 function->body->__anon1.compound.declarations = MkList();
19018 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19019 }
19020 }
19021 }
19022 }
19023 else
19024 thisClass = (((void *)0));
19025 if(id)
19026 {
19027 FreeSpecifier(id->_class);
19028 id->_class = (((void *)0));
19029 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19030 {
19031 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19032
19033 id = GetDeclId(initDecl->declarator);
19034 FreeSpecifier(id->_class);
19035 id->_class = (((void *)0));
19036 }
19037 }
19038 if(function->body)
19039 topContext = function->body->__anon1.compound.context;
19040 {
19041 struct FunctionDefinition * oldFunction = curFunction;
19042
19043 curFunction = function;
19044 if(function->body)
19045 ProcessStatement(function->body);
19046 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19047 {
19048 struct Statement * prevCompound = curCompound;
19049 struct Context * prevContext = curContext;
19050 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19051
19052 if(!function->body->__anon1.compound.statements)
19053 function->body->__anon1.compound.statements = MkList();
19054 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19055 curCompound = function->body;
19056 curContext = function->body->__anon1.compound.context;
19057 ProcessStatement(fireWatchers);
19058 curContext = prevContext;
19059 curCompound = prevCompound;
19060 }
19061 curFunction = oldFunction;
19062 }
19063 if(function->declarator)
19064 {
19065 ProcessDeclarator(function->declarator, 1);
19066 }
19067 topContext = oldTopContext;
19068 thisClass = oldThisClass;
19069 }
19070
19071 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19072 {
19073 struct ClassDef * def;
19074 struct External * external = curExternal;
19075 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19076
19077 for(def = definitions->first; def; def = def->next)
19078 {
19079 if(def->type == 0)
19080 {
19081 if(def->__anon1.function->declarator)
19082 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19083 else
19084 curExternal = external;
19085 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19086 }
19087 else if(def->type == 2)
19088 {
19089 if(def->__anon1.decl->type == 2)
19090 {
19091 thisClass = regClass;
19092 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19093 thisClass = (((void *)0));
19094 }
19095 else
19096 {
19097 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19098
19099 if(regClass)
19100 thisClass = regClass;
19101 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19102 thisClass = backThisClass;
19103 }
19104 }
19105 else if(def->type == 1 && def->__anon1.defProperties)
19106 {
19107 struct MemberInit * defProperty;
19108 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);
19109
19110 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19111 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19112 {
19113 thisClass = regClass;
19114 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19115 thisClass = (((void *)0));
19116 }
19117 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19118 FreeSymbol(thisSymbol);
19119 }
19120 else if(def->type == 3 && def->__anon1.propertyDef)
19121 {
19122 struct PropertyDef * prop = def->__anon1.propertyDef;
19123
19124 thisClass = regClass;
19125 if(prop->setStmt)
19126 {
19127 if(regClass)
19128 {
19129 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19130
19131 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19132 }
19133 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19134 ProcessStatement(prop->setStmt);
19135 }
19136 if(prop->getStmt)
19137 {
19138 if(regClass)
19139 {
19140 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19141
19142 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19143 }
19144 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19145 ProcessStatement(prop->getStmt);
19146 }
19147 if(prop->issetStmt)
19148 {
19149 if(regClass)
19150 {
19151 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19152
19153 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19154 }
19155 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19156 ProcessStatement(prop->issetStmt);
19157 }
19158 thisClass = (((void *)0));
19159 }
19160 else if(def->type == 4 && def->__anon1.propertyWatch)
19161 {
19162 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19163
19164 thisClass = regClass;
19165 if(propertyWatch->compound)
19166 {
19167 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);
19168
19169 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19170 curExternal = (((void *)0));
19171 ProcessStatement(propertyWatch->compound);
19172 }
19173 thisClass = (((void *)0));
19174 }
19175 }
19176 }
19177
19178 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19179 {
19180 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19181
19182 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19183 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19184 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19185 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19186 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19187 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19188 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19189 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19190 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19191 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19192 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19193 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19194 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19195 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19196 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19197 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19198 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19199 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19200 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19201 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19202 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19203 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19204 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19205 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19206 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19207 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19208 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19209 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19210 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19211 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19212 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19213 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19214 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19215 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19216 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19217 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19218 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19219 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19220 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19221 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19222 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19223 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19224 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19225 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19226 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19227 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19228 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19229 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19230 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19231 __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);
19232 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19233 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19234 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19235 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19236 __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);
19237 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19238 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19239 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19240 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19241 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19242 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19243 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19244 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19245 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19246 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19247 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19248 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19249 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19250 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19251 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19252 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)
19253 __ecereClass_Conversion = class;
19254 __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);
19255 __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);
19256 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19257 __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);
19258 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19259 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19260 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19261 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19262 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19263 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19264 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19265 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19266 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19267 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19268 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19269 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19270 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19271 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19272 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19273 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19274 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19275 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19276 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19277 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19278 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19279 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19280 }
19281