compiler/libec: Fixed warning in call to Unserialize for struct parameter
[sdk] / compiler / bootstrap / libec / bootstrap / pass0.c
1 /* Code generated from eC source file: pass0.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 unsigned int inCompiler;
46
47 extern int declMode;
48
49 extern int structDeclMode;
50
51 extern const char *  sourceFile;
52
53 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
54
55 struct __ecereNameSpace__ecere__sys__OldList
56 {
57 void *  first;
58 void *  last;
59 int count;
60 unsigned int offset;
61 unsigned int circ;
62 } __attribute__ ((gcc_struct));
63
64 struct __ecereNameSpace__ecere__sys__BTNode;
65
66 struct __ecereNameSpace__ecere__com__DataValue
67 {
68 union
69 {
70 char c;
71 unsigned char uc;
72 short s;
73 unsigned short us;
74 int i;
75 unsigned int ui;
76 void *  p;
77 float f;
78 double d;
79 long long i64;
80 uint64 ui64;
81 } __attribute__ ((gcc_struct)) __anon1;
82 } __attribute__ ((gcc_struct));
83
84 struct __ecereNameSpace__ecere__com__SerialBuffer
85 {
86 unsigned char *  _buffer;
87 unsigned int count;
88 unsigned int _size;
89 unsigned int pos;
90 } __attribute__ ((gcc_struct));
91
92 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
93
94 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
95
96 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
97
98 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
99
100 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
101
102 struct Enumerator;
103
104 struct Pointer;
105
106 struct InitDeclarator;
107
108 struct AsmField;
109
110 struct Attrib;
111
112 struct ExtDecl;
113
114 struct Attribute;
115
116 struct PropertyWatch;
117
118 struct TemplateParameter;
119
120 struct TemplateArgument;
121
122 struct TemplateDatatype;
123
124 struct DBTableEntry;
125
126 struct DBIndexItem;
127
128 struct DBTableDef;
129
130 struct CodePosition
131 {
132 int line;
133 int charPos;
134 int pos;
135 int included;
136 } __attribute__ ((gcc_struct));
137
138 extern char *  strcat(char * , const char * );
139
140 extern size_t strlen(const char * );
141
142 extern int strncmp(const char * , const char * , size_t n);
143
144 struct ModuleImport;
145
146 struct ClassImport;
147
148 extern void Compiler_Error(const char *  format, ...);
149
150 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
151
152 struct __ecereNameSpace__ecere__com__LinkList
153 {
154 void * first;
155 void * last;
156 int count;
157 } __attribute__ ((gcc_struct));
158
159 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
160
161 extern char *  strcpy(char * , const char * );
162
163 struct __ecereNameSpace__ecere__com__LinkElement
164 {
165 void * prev;
166 void * next;
167 } __attribute__ ((gcc_struct));
168
169 extern char *  strstr(const char * , const char * );
170
171 extern void Compiler_Warning(const char *  format, ...);
172
173 extern int sprintf(char * , const char * , ...);
174
175 struct __ecereNameSpace__ecere__com__GlobalFunction;
176
177 struct __ecereNameSpace__ecere__com__IteratorPointer;
178
179 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
180
181 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
182
183 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
184
185 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
186
187 extern struct __ecereNameSpace__ecere__sys__OldList *  ast;
188
189 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
190
191 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
192
193 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
194
195 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
196
197 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
198
199 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
200
201 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
202
203 extern void FreeInitDeclarator(struct InitDeclarator * decl);
204
205 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
206
207 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
208
209 struct Location
210 {
211 struct CodePosition start;
212 struct CodePosition end;
213 } __attribute__ ((gcc_struct));
214
215 void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams)
216 {
217 int c;
218 char ch;
219 int len;
220
221 for(c = 0; (ch = className[c]) && ch != '<'; c++)
222 {
223 if(ch == ':')
224 {
225 strcat(output, "__ecereNameSpace__");
226 break;
227 }
228 }
229 len = strlen(output);
230 c = 0;
231 if(!strncmp(className, "const ", 6))
232 c += 6;
233 for(; (ch = className[c]); c++)
234 {
235 if(ch == ':')
236 output[len++] = '_';
237 else if(ch == ' ')
238 output[len++] = '_';
239 else if(ch == '*')
240 {
241 output[len++] = '_';
242 output[len++] = 'P';
243 output[len++] = 'T';
244 output[len++] = 'R';
245 output[len++] = '_';
246 }
247 else if(ch == '=')
248 {
249 output[len++] = '_';
250 output[len++] = 'E';
251 output[len++] = 'Q';
252 output[len++] = 'U';
253 output[len++] = '_';
254 }
255 else if(ch == '<')
256 {
257 if(!includeTemplateParams)
258 break;
259 if(!strncmp(className + c + 1, "const ", 6))
260 c += 6;
261 output[len++] = '_';
262 output[len++] = 'T';
263 output[len++] = 'P';
264 output[len++] = 'L';
265 output[len++] = '_';
266 }
267 else if(ch == '>')
268 {
269 output[len++] = '_';
270 }
271 else if(ch == ',')
272 {
273 if(!strncmp(className + c + 1, "const ", 6))
274 c += 6;
275 output[len++] = '_';
276 }
277 else
278 output[len++] = ch;
279 }
280 output[len++] = (char)0;
281 }
282
283 extern struct Location yylloc;
284
285 struct External;
286
287 extern struct External * curExternal;
288
289 struct TopoEdge
290 {
291 struct __ecereNameSpace__ecere__com__LinkElement in;
292 struct __ecereNameSpace__ecere__com__LinkElement out;
293 struct External * from;
294 struct External * to;
295 unsigned int breakable;
296 } __attribute__ ((gcc_struct));
297
298 extern void FreeExternal(struct External * external);
299
300 extern struct External * DeclareStruct(struct External * neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference);
301
302 struct Context;
303
304 extern struct Context * PushContext(void);
305
306 extern void PopContext(struct Context * ctx);
307
308 extern struct Context * curContext;
309
310 struct __ecereNameSpace__ecere__com__Class;
311
312 struct __ecereNameSpace__ecere__com__Instance
313 {
314 void * *  _vTbl;
315 struct __ecereNameSpace__ecere__com__Class * _class;
316 int _refCount;
317 } __attribute__ ((gcc_struct));
318
319 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
320
321 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
322
323 extern 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);
324
325 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
326
327 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
328
329 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
330
331 int __ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext;
332
333 struct __ecereNameSpace__ecere__com__Property;
334
335 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
336
337 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);
338
339 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
340
341 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
342
343 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_AddProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  dataType, void *  setStmt, void *  getStmt, int declMode);
344
345 struct Declarator;
346
347 extern void FreeDeclarator(struct Declarator * decl);
348
349 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
350
351 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
352
353 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
354
355 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
356
357 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
358
359 struct __ecereNameSpace__ecere__com__BTNamedLink;
360
361 struct __ecereNameSpace__ecere__com__BTNamedLink
362 {
363 const char *  name;
364 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
365 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
366 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
367 int depth;
368 void *  data;
369 } __attribute__ ((gcc_struct));
370
371 struct Symbol;
372
373 extern struct Symbol * FindClass(const char *  name);
374
375 struct Declaration;
376
377 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
378
379 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
380
381 struct Specifier;
382
383 extern struct Specifier * MkSpecifierName(const char *  name);
384
385 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
386
387 extern void FreeSpecifier(struct Specifier * spec);
388
389 extern struct Specifier * MkSpecifier(int specifier);
390
391 extern struct Specifier * CopySpecifier(struct Specifier * spec);
392
393 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
394
395 struct Identifier;
396
397 extern struct Identifier * GetDeclId(struct Declarator * decl);
398
399 struct Identifier
400 {
401 struct Identifier * prev;
402 struct Identifier * next;
403 struct Location loc;
404 struct Symbol * classSym;
405 struct Specifier * _class;
406 char *  string;
407 struct Identifier * badID;
408 } __attribute__ ((gcc_struct));
409
410 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
411
412 extern struct Identifier * MkIdentifier(const char *  string);
413
414 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
415
416 struct Expression;
417
418 struct Specifier
419 {
420 struct Specifier * prev;
421 struct Specifier * next;
422 struct Location loc;
423 int type;
424 union
425 {
426 int specifier;
427 struct
428 {
429 struct ExtDecl * extDecl;
430 char *  name;
431 struct Symbol * symbol;
432 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
433 } __attribute__ ((gcc_struct)) __anon1;
434 struct
435 {
436 struct Identifier * id;
437 struct __ecereNameSpace__ecere__sys__OldList *  list;
438 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
439 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
440 unsigned int addNameSpace;
441 struct Context * ctx;
442 struct ExtDecl * extDeclStruct;
443 } __attribute__ ((gcc_struct)) __anon2;
444 struct Expression * expression;
445 struct Specifier * _class;
446 struct TemplateParameter * templateParameter;
447 } __attribute__ ((gcc_struct)) __anon1;
448 } __attribute__ ((gcc_struct));
449
450 struct Declarator
451 {
452 struct Declarator * prev;
453 struct Declarator * next;
454 struct Location loc;
455 int type;
456 struct Symbol * symbol;
457 struct Declarator * declarator;
458 union
459 {
460 struct Identifier * identifier;
461 struct
462 {
463 struct Expression * exp;
464 struct Expression * posExp;
465 struct Attrib * attrib;
466 } __attribute__ ((gcc_struct)) structDecl;
467 struct
468 {
469 struct Expression * exp;
470 struct Specifier * enumClass;
471 } __attribute__ ((gcc_struct)) array;
472 struct
473 {
474 struct __ecereNameSpace__ecere__sys__OldList * parameters;
475 } __attribute__ ((gcc_struct)) function;
476 struct
477 {
478 struct Pointer * pointer;
479 } __attribute__ ((gcc_struct)) pointer;
480 struct
481 {
482 struct ExtDecl * extended;
483 } __attribute__ ((gcc_struct)) extended;
484 } __attribute__ ((gcc_struct)) __anon1;
485 } __attribute__ ((gcc_struct));
486
487 extern struct Expression * QMkExpId(const char *  id);
488
489 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
490
491 extern struct Expression * CopyExpression(struct Expression * exp);
492
493 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
494
495 extern struct Expression * MkExpIdentifier(struct Identifier * id);
496
497 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
498
499 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
500
501 struct Type;
502
503 struct __ecereNameSpace__ecere__com__Property
504 {
505 struct __ecereNameSpace__ecere__com__Property * prev;
506 struct __ecereNameSpace__ecere__com__Property * next;
507 const char *  name;
508 unsigned int isProperty;
509 int memberAccess;
510 int id;
511 struct __ecereNameSpace__ecere__com__Class * _class;
512 const char *  dataTypeString;
513 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
514 struct Type * dataType;
515 void (*  Set)(void * , int);
516 int (*  Get)(void * );
517 unsigned int (*  IsSet)(void * );
518 void *  data;
519 void *  symbol;
520 int vid;
521 unsigned int conversion;
522 unsigned int watcherOffset;
523 const char *  category;
524 unsigned int compiled;
525 unsigned int selfWatchable;
526 unsigned int isWatchable;
527 } __attribute__ ((gcc_struct));
528
529 extern struct Type * MkClassType(const char *  name);
530
531 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
532
533 extern void FreeType(struct Type * type);
534
535 struct ClassFunction;
536
537 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
538
539 struct Initializer;
540
541 struct Initializer
542 {
543 struct Initializer * prev;
544 struct Initializer * next;
545 struct Location loc;
546 int type;
547 union
548 {
549 struct Expression * exp;
550 struct __ecereNameSpace__ecere__sys__OldList *  list;
551 } __attribute__ ((gcc_struct)) __anon1;
552 unsigned int isConstant;
553 struct Identifier * id;
554 } __attribute__ ((gcc_struct));
555
556 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
557
558 extern void FreeInitializer(struct Initializer * initializer);
559
560 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
561
562 struct __ecereNameSpace__ecere__com__Method;
563
564 struct __ecereNameSpace__ecere__com__Method
565 {
566 const char *  name;
567 struct __ecereNameSpace__ecere__com__Method * parent;
568 struct __ecereNameSpace__ecere__com__Method * left;
569 struct __ecereNameSpace__ecere__com__Method * right;
570 int depth;
571 int (*  function)();
572 int vid;
573 int type;
574 struct __ecereNameSpace__ecere__com__Class * _class;
575 void *  symbol;
576 const char *  dataTypeString;
577 struct Type * dataType;
578 int memberAccess;
579 } __attribute__ ((gcc_struct));
580
581 struct Symbol
582 {
583 char *  string;
584 struct Symbol * parent;
585 struct Symbol * left;
586 struct Symbol * right;
587 int depth;
588 struct Type * type;
589 union
590 {
591 struct __ecereNameSpace__ecere__com__Method * method;
592 struct __ecereNameSpace__ecere__com__Property * _property;
593 struct __ecereNameSpace__ecere__com__Class * registered;
594 } __attribute__ ((gcc_struct)) __anon1;
595 unsigned int notYetDeclared;
596 union
597 {
598 struct
599 {
600 struct External * pointerExternal;
601 struct External * structExternal;
602 } __attribute__ ((gcc_struct)) __anon1;
603 struct
604 {
605 struct External * externalGet;
606 struct External * externalSet;
607 struct External * externalPtr;
608 struct External * externalIsSet;
609 } __attribute__ ((gcc_struct)) __anon2;
610 struct
611 {
612 struct External * methodExternal;
613 struct External * methodCodeExternal;
614 } __attribute__ ((gcc_struct)) __anon3;
615 } __attribute__ ((gcc_struct)) __anon2;
616 unsigned int imported;
617 unsigned int declaredStructSym;
618 struct __ecereNameSpace__ecere__com__Class * _class;
619 unsigned int declaredStruct;
620 unsigned int needConstructor;
621 unsigned int needDestructor;
622 char *  constructorName;
623 char *  structName;
624 char *  className;
625 char *  destructorName;
626 struct ModuleImport * module;
627 struct ClassImport * _import;
628 struct Location nameLoc;
629 unsigned int isParam;
630 unsigned int isRemote;
631 unsigned int isStruct;
632 unsigned int fireWatchersDone;
633 int declaring;
634 unsigned int classData;
635 unsigned int isStatic;
636 char *  shortName;
637 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
638 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
639 struct Context * ctx;
640 int isIterator;
641 struct Expression * propCategory;
642 } __attribute__ ((gcc_struct));
643
644 struct Type
645 {
646 struct Type * prev;
647 struct Type * next;
648 int refCount;
649 union
650 {
651 struct Symbol * _class;
652 struct
653 {
654 struct __ecereNameSpace__ecere__sys__OldList members;
655 char *  enumName;
656 } __attribute__ ((gcc_struct)) __anon1;
657 struct
658 {
659 struct Type * returnType;
660 struct __ecereNameSpace__ecere__sys__OldList params;
661 struct Symbol * thisClass;
662 unsigned int staticMethod;
663 struct TemplateParameter * thisClassTemplate;
664 } __attribute__ ((gcc_struct)) __anon2;
665 struct
666 {
667 struct __ecereNameSpace__ecere__com__Method * method;
668 struct __ecereNameSpace__ecere__com__Class * methodClass;
669 struct __ecereNameSpace__ecere__com__Class * usedClass;
670 } __attribute__ ((gcc_struct)) __anon3;
671 struct
672 {
673 struct Type * arrayType;
674 int arraySize;
675 struct Expression * arraySizeExp;
676 unsigned int freeExp;
677 struct Symbol * enumClass;
678 } __attribute__ ((gcc_struct)) __anon4;
679 struct Type * type;
680 struct TemplateParameter * templateParameter;
681 } __attribute__ ((gcc_struct)) __anon1;
682 int kind;
683 unsigned int size;
684 char *  name;
685 char *  typeName;
686 int classObjectType;
687 int alignment;
688 unsigned int offset;
689 int bitFieldCount;
690 int count;
691 unsigned int isSigned : 1;
692 unsigned int constant : 1;
693 unsigned int truth : 1;
694 unsigned int byReference : 1;
695 unsigned int extraParam : 1;
696 unsigned int directClassAccess : 1;
697 unsigned int computing : 1;
698 unsigned int keepCast : 1;
699 unsigned int passAsTemplate : 1;
700 unsigned int dllExport : 1;
701 unsigned int attrStdcall : 1;
702 unsigned int declaredWithStruct : 1;
703 unsigned int typedByReference : 1;
704 unsigned int casted : 1;
705 unsigned int pointerAlignment : 1;
706 } __attribute__ ((gcc_struct));
707
708 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, void *  function, int declMode);
709
710 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
711
712 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
713
714 struct Statement;
715
716 struct ClassFunction
717 {
718 struct ClassFunction * prev;
719 struct ClassFunction * next;
720 struct Location loc;
721 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
722 struct Declarator * declarator;
723 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
724 struct Statement * body;
725 struct __ecereNameSpace__ecere__com__Class * _class;
726 struct __ecereNameSpace__ecere__sys__OldList attached;
727 int declMode;
728 struct Type * type;
729 struct Symbol * propSet;
730 unsigned int isVirtual;
731 unsigned int isConstructor;
732 unsigned int isDestructor;
733 unsigned int dontMangle;
734 int id;
735 int idCode;
736 } __attribute__ ((gcc_struct));
737
738 struct Statement
739 {
740 struct Statement * prev;
741 struct Statement * next;
742 struct Location loc;
743 int type;
744 union
745 {
746 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
747 struct
748 {
749 struct Identifier * id;
750 struct Statement * stmt;
751 } __attribute__ ((gcc_struct)) labeled;
752 struct
753 {
754 struct Expression * exp;
755 struct Statement * stmt;
756 } __attribute__ ((gcc_struct)) caseStmt;
757 struct
758 {
759 struct __ecereNameSpace__ecere__sys__OldList * declarations;
760 struct __ecereNameSpace__ecere__sys__OldList * statements;
761 struct Context * context;
762 unsigned int isSwitch;
763 } __attribute__ ((gcc_struct)) compound;
764 struct
765 {
766 struct __ecereNameSpace__ecere__sys__OldList * exp;
767 struct Statement * stmt;
768 struct Statement * elseStmt;
769 } __attribute__ ((gcc_struct)) ifStmt;
770 struct
771 {
772 struct __ecereNameSpace__ecere__sys__OldList * exp;
773 struct Statement * stmt;
774 } __attribute__ ((gcc_struct)) switchStmt;
775 struct
776 {
777 struct __ecereNameSpace__ecere__sys__OldList * exp;
778 struct Statement * stmt;
779 } __attribute__ ((gcc_struct)) whileStmt;
780 struct
781 {
782 struct __ecereNameSpace__ecere__sys__OldList * exp;
783 struct Statement * stmt;
784 } __attribute__ ((gcc_struct)) doWhile;
785 struct
786 {
787 struct Statement * init;
788 struct Statement * check;
789 struct __ecereNameSpace__ecere__sys__OldList * increment;
790 struct Statement * stmt;
791 } __attribute__ ((gcc_struct)) forStmt;
792 struct
793 {
794 struct Identifier * id;
795 } __attribute__ ((gcc_struct)) gotoStmt;
796 struct
797 {
798 struct Specifier * spec;
799 char * statements;
800 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
801 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
802 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
803 } __attribute__ ((gcc_struct)) asmStmt;
804 struct
805 {
806 struct Expression * watcher;
807 struct Expression * object;
808 struct __ecereNameSpace__ecere__sys__OldList * watches;
809 } __attribute__ ((gcc_struct)) _watch;
810 struct
811 {
812 struct Identifier * id;
813 struct __ecereNameSpace__ecere__sys__OldList * exp;
814 struct __ecereNameSpace__ecere__sys__OldList * filter;
815 struct Statement * stmt;
816 } __attribute__ ((gcc_struct)) forEachStmt;
817 struct Declaration * decl;
818 } __attribute__ ((gcc_struct)) __anon1;
819 } __attribute__ ((gcc_struct));
820
821 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
822
823 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
824
825 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
826
827 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
828
829 struct __ecereNameSpace__ecere__sys__BinaryTree;
830
831 struct __ecereNameSpace__ecere__sys__BinaryTree
832 {
833 struct __ecereNameSpace__ecere__sys__BTNode * root;
834 int count;
835 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
836 void (*  FreeKey)(void *  key);
837 } __attribute__ ((gcc_struct));
838
839 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
840
841 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
842
843 struct __ecereNameSpace__ecere__com__DataMember;
844
845 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
846 {
847 union
848 {
849 struct
850 {
851 const char *  dataTypeString;
852 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
853 } __attribute__ ((gcc_struct)) __anon1;
854 struct __ecereNameSpace__ecere__com__DataValue expression;
855 struct
856 {
857 const char *  memberString;
858 union
859 {
860 struct __ecereNameSpace__ecere__com__DataMember * member;
861 struct __ecereNameSpace__ecere__com__Property * prop;
862 struct __ecereNameSpace__ecere__com__Method * method;
863 } __attribute__ ((gcc_struct)) __anon1;
864 } __attribute__ ((gcc_struct)) __anon2;
865 } __attribute__ ((gcc_struct)) __anon1;
866 } __attribute__ ((gcc_struct));
867
868 struct __ecereNameSpace__ecere__com__DataMember
869 {
870 struct __ecereNameSpace__ecere__com__DataMember * prev;
871 struct __ecereNameSpace__ecere__com__DataMember * next;
872 const char *  name;
873 unsigned int isProperty;
874 int memberAccess;
875 int id;
876 struct __ecereNameSpace__ecere__com__Class * _class;
877 const char *  dataTypeString;
878 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
879 struct Type * dataType;
880 int type;
881 int offset;
882 int memberID;
883 struct __ecereNameSpace__ecere__sys__OldList members;
884 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
885 int memberOffset;
886 short structAlignment;
887 short pointerAlignment;
888 } __attribute__ ((gcc_struct));
889
890 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);
891
892 struct __ecereNameSpace__ecere__com__Module;
893
894 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
895
896 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
897
898 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);
899
900 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
901
902 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);
903
904 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);
905
906 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);
907
908 struct TypeName;
909
910 struct TypeName
911 {
912 struct TypeName * prev;
913 struct TypeName * next;
914 struct Location loc;
915 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
916 struct Declarator * declarator;
917 int classObjectType;
918 struct Expression * bitCount;
919 } __attribute__ ((gcc_struct));
920
921 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
922
923 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
924
925 struct ClassDef;
926
927 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
928
929 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
930
931 struct ClassDefinition;
932
933 struct Context
934 {
935 struct Context * parent;
936 struct __ecereNameSpace__ecere__sys__BinaryTree types;
937 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
938 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
939 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
940 int nextID;
941 int simpleID;
942 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
943 struct ClassDefinition * classDef;
944 unsigned int templateTypesOnly;
945 unsigned int hasNameSpace;
946 } __attribute__ ((gcc_struct));
947
948 struct ClassDefinition
949 {
950 struct ClassDefinition * prev;
951 struct ClassDefinition * next;
952 struct Location loc;
953 struct Specifier * _class;
954 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
955 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
956 struct Symbol * symbol;
957 struct Location blockStart;
958 struct Location nameLoc;
959 int declMode;
960 unsigned int deleteWatchable;
961 } __attribute__ ((gcc_struct));
962
963 struct Instantiation;
964
965 struct Expression
966 {
967 struct Expression * prev;
968 struct Expression * next;
969 struct Location loc;
970 int type;
971 union
972 {
973 struct
974 {
975 char *  constant;
976 struct Identifier * identifier;
977 } __attribute__ ((gcc_struct)) __anon1;
978 struct Statement * compound;
979 struct Instantiation * instance;
980 struct
981 {
982 char *  string;
983 unsigned int intlString;
984 unsigned int wideString;
985 } __attribute__ ((gcc_struct)) __anon2;
986 struct __ecereNameSpace__ecere__sys__OldList *  list;
987 struct
988 {
989 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
990 struct Declarator * decl;
991 } __attribute__ ((gcc_struct)) _classExp;
992 struct
993 {
994 struct Identifier * id;
995 } __attribute__ ((gcc_struct)) classData;
996 struct
997 {
998 struct Expression * exp;
999 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1000 struct Location argLoc;
1001 } __attribute__ ((gcc_struct)) call;
1002 struct
1003 {
1004 struct Expression * exp;
1005 struct __ecereNameSpace__ecere__sys__OldList * index;
1006 } __attribute__ ((gcc_struct)) index;
1007 struct
1008 {
1009 struct Expression * exp;
1010 struct Identifier * member;
1011 int memberType;
1012 unsigned int thisPtr;
1013 } __attribute__ ((gcc_struct)) member;
1014 struct
1015 {
1016 int op;
1017 struct Expression * exp1;
1018 struct Expression * exp2;
1019 } __attribute__ ((gcc_struct)) op;
1020 struct TypeName * typeName;
1021 struct Specifier * _class;
1022 struct
1023 {
1024 struct TypeName * typeName;
1025 struct Expression * exp;
1026 } __attribute__ ((gcc_struct)) cast;
1027 struct
1028 {
1029 struct Expression * cond;
1030 struct __ecereNameSpace__ecere__sys__OldList * exp;
1031 struct Expression * elseExp;
1032 } __attribute__ ((gcc_struct)) cond;
1033 struct
1034 {
1035 struct TypeName * typeName;
1036 struct Expression * size;
1037 } __attribute__ ((gcc_struct)) _new;
1038 struct
1039 {
1040 struct TypeName * typeName;
1041 struct Expression * size;
1042 struct Expression * exp;
1043 } __attribute__ ((gcc_struct)) _renew;
1044 struct
1045 {
1046 char * table;
1047 struct Identifier * id;
1048 } __attribute__ ((gcc_struct)) db;
1049 struct
1050 {
1051 struct Expression * ds;
1052 struct Expression * name;
1053 } __attribute__ ((gcc_struct)) dbopen;
1054 struct
1055 {
1056 struct TypeName * typeName;
1057 struct Initializer * initializer;
1058 } __attribute__ ((gcc_struct)) initializer;
1059 struct
1060 {
1061 struct Expression * exp;
1062 struct TypeName * typeName;
1063 } __attribute__ ((gcc_struct)) vaArg;
1064 } __attribute__ ((gcc_struct)) __anon1;
1065 unsigned int debugValue;
1066 struct __ecereNameSpace__ecere__com__DataValue val;
1067 uint64 address;
1068 unsigned int hasAddress;
1069 struct Type * expType;
1070 struct Type * destType;
1071 unsigned int usage;
1072 int tempCount;
1073 unsigned int byReference;
1074 unsigned int isConstant;
1075 unsigned int addedThis;
1076 unsigned int needCast;
1077 unsigned int thisPtr;
1078 unsigned int opDestType;
1079 unsigned int needTemplateCast;
1080 } __attribute__ ((gcc_struct));
1081
1082 struct Instantiation
1083 {
1084 struct Instantiation * prev;
1085 struct Instantiation * next;
1086 struct Location loc;
1087 struct Specifier * _class;
1088 struct Expression * exp;
1089 struct __ecereNameSpace__ecere__sys__OldList *  members;
1090 struct Symbol * symbol;
1091 unsigned int fullSet;
1092 unsigned int isConstant;
1093 unsigned char *  data;
1094 struct Location nameLoc;
1095 struct Location insideLoc;
1096 unsigned int built;
1097 } __attribute__ ((gcc_struct));
1098
1099 struct Declaration
1100 {
1101 struct Declaration * prev;
1102 struct Declaration * next;
1103 struct Location loc;
1104 int type;
1105 union
1106 {
1107 struct
1108 {
1109 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1110 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1111 } __attribute__ ((gcc_struct)) __anon1;
1112 struct Instantiation * inst;
1113 struct
1114 {
1115 struct Identifier * id;
1116 struct Expression * exp;
1117 } __attribute__ ((gcc_struct)) __anon2;
1118 } __attribute__ ((gcc_struct)) __anon1;
1119 struct Specifier * extStorage;
1120 struct Symbol * symbol;
1121 int declMode;
1122 } __attribute__ ((gcc_struct));
1123
1124 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1125
1126 struct MembersInit;
1127
1128 struct MembersInit
1129 {
1130 struct MembersInit * prev;
1131 struct MembersInit * next;
1132 struct Location loc;
1133 int type;
1134 union
1135 {
1136 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1137 struct ClassFunction * function;
1138 } __attribute__ ((gcc_struct)) __anon1;
1139 } __attribute__ ((gcc_struct));
1140
1141 struct MemberInit;
1142
1143 struct MemberInit
1144 {
1145 struct MemberInit * prev;
1146 struct MemberInit * next;
1147 struct Location loc;
1148 struct Location realLoc;
1149 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1150 struct Initializer * initializer;
1151 unsigned int used;
1152 unsigned int variable;
1153 unsigned int takeOutExp;
1154 } __attribute__ ((gcc_struct));
1155
1156 static void CheckPublicExpression(struct Expression *  exp, int access);
1157
1158 static void CheckPublicInitializer(struct Initializer * init, int access)
1159 {
1160 switch(init->type)
1161 {
1162 case 0:
1163 CheckPublicExpression(init->__anon1.exp, access);
1164 break;
1165 case 1:
1166 {
1167 struct Initializer * i;
1168
1169 for(i = (*init->__anon1.list).first; i; i = i->next)
1170 CheckPublicInitializer(i, access);
1171 break;
1172 }
1173 }
1174 }
1175
1176 static void CheckPublicClass(struct Symbol *  classSym, int access, const char *  word);
1177
1178 static void CheckPublicTypeName(struct TypeName * type, int access)
1179 {
1180 if(type->qualifiers)
1181 {
1182 struct Specifier * spec;
1183
1184 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1185 {
1186 if(spec->type == 1)
1187 {
1188 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1189
1190 CheckPublicClass(classSym, access, "define");
1191 }
1192 }
1193 }
1194 }
1195
1196 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1197 {
1198 if(type)
1199 {
1200 switch(type->kind)
1201 {
1202 case 8:
1203 {
1204 CheckPublicClass(type->__anon1._class, access, word);
1205 break;
1206 }
1207 case 9:
1208 case 10:
1209 {
1210 break;
1211 }
1212 case 11:
1213 {
1214 struct Type * param;
1215
1216 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1217 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1218 CheckPublicDataType(param, access, word);
1219 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1220 break;
1221 }
1222 case 12:
1223 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1224 if(type->__anon1.__anon4.enumClass)
1225 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1226 break;
1227 case 13:
1228 {
1229 CheckPublicDataType(type->__anon1.type, access, word);
1230 break;
1231 }
1232 case 16:
1233 {
1234 break;
1235 }
1236 case 19:
1237 {
1238 CheckPublicClass(type->__anon1._class, access, word);
1239 break;
1240 }
1241 }
1242 }
1243 }
1244
1245 static void CheckPublicExpression(struct Expression * exp, int access)
1246 {
1247 if(exp)
1248 {
1249 switch(exp->type)
1250 {
1251 case 0:
1252 break;
1253 case 2:
1254 break;
1255 case 3:
1256 break;
1257 case 4:
1258 if(exp->__anon1.op.exp1)
1259 CheckPublicExpression(exp->__anon1.op.exp1, access);
1260 if(exp->__anon1.op.exp2)
1261 CheckPublicExpression(exp->__anon1.op.exp2, access);
1262 break;
1263 case 5:
1264 {
1265 struct Expression * e;
1266
1267 for(e = (*exp->__anon1.list).first; e; e = e->next)
1268 CheckPublicExpression(e, access);
1269 break;
1270 }
1271 case 6:
1272 {
1273 struct Expression * e;
1274
1275 CheckPublicExpression(exp->__anon1.index.exp, access);
1276 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1277 CheckPublicExpression(e, access);
1278 break;
1279 }
1280 case 7:
1281 {
1282 struct Expression * e;
1283
1284 CheckPublicExpression(exp->__anon1.call.exp, access);
1285 if(exp->__anon1.call.arguments)
1286 {
1287 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1288 CheckPublicExpression(e, access);
1289 }
1290 break;
1291 }
1292 case 8:
1293 {
1294 CheckPublicExpression(exp->__anon1.member.exp, access);
1295 break;
1296 }
1297 case 9:
1298 {
1299 CheckPublicExpression(exp->__anon1.member.exp, access);
1300 break;
1301 }
1302 case 10:
1303 CheckPublicTypeName(exp->__anon1.typeName, access);
1304 break;
1305 case 11:
1306 {
1307 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1308 if(exp->__anon1.cast.exp)
1309 CheckPublicExpression(exp->__anon1.cast.exp, access);
1310 break;
1311 }
1312 case 12:
1313 {
1314 struct Expression * e;
1315
1316 CheckPublicExpression(exp->__anon1.cond.cond, access);
1317 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1318 CheckPublicExpression(e, access);
1319 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1320 break;
1321 }
1322 case 13:
1323 case 26:
1324 CheckPublicExpression(exp->__anon1._new.size, access);
1325 break;
1326 case 14:
1327 case 27:
1328 CheckPublicExpression(exp->__anon1._renew.size, access);
1329 CheckPublicExpression(exp->__anon1._renew.exp, access);
1330 break;
1331 case 1:
1332 {
1333 struct MembersInit * members;
1334
1335 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1336 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1337 {
1338 if(members->type == 0)
1339 {
1340 struct MemberInit * member;
1341
1342 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1343 {
1344 CheckPublicInitializer(member->initializer, access);
1345 }
1346 }
1347 }
1348 break;
1349 }
1350 }
1351 }
1352 }
1353
1354 struct PropertyDef;
1355
1356 struct ClassDef
1357 {
1358 struct ClassDef * prev;
1359 struct ClassDef * next;
1360 struct Location loc;
1361 int type;
1362 union
1363 {
1364 struct Declaration * decl;
1365 struct ClassFunction * function;
1366 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1367 struct PropertyDef * propertyDef;
1368 struct PropertyWatch * propertyWatch;
1369 char *  designer;
1370 struct Identifier * defaultProperty;
1371 struct
1372 {
1373 struct Identifier * id;
1374 struct Initializer * initializer;
1375 } __attribute__ ((gcc_struct)) __anon1;
1376 } __attribute__ ((gcc_struct)) __anon1;
1377 int memberAccess;
1378 void *  object;
1379 } __attribute__ ((gcc_struct));
1380
1381 struct PropertyDef
1382 {
1383 struct PropertyDef * prev;
1384 struct PropertyDef * next;
1385 struct Location loc;
1386 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1387 struct Declarator * declarator;
1388 struct Identifier * id;
1389 struct Statement * getStmt;
1390 struct Statement * setStmt;
1391 struct Statement * issetStmt;
1392 struct Symbol * symbol;
1393 struct Expression * category;
1394 struct
1395 {
1396 unsigned int conversion : 1;
1397 unsigned int isWatchable : 1;
1398 unsigned int isDBProp : 1;
1399 } __attribute__ ((gcc_struct)) __anon1;
1400 } __attribute__ ((gcc_struct));
1401
1402 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1403 {
1404 if(definitions != (((void *)0)))
1405 {
1406 struct ClassDef * def;
1407
1408 for(def = definitions->first; def; def = def->next)
1409 {
1410 if(def->type == 2)
1411 {
1412 struct Declaration * decl = def->__anon1.decl;
1413 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1414
1415 yylloc = def->loc;
1416 if(decl->type == 0)
1417 {
1418 struct Declarator * d;
1419
1420 if(decl->__anon1.__anon1.declarators)
1421 {
1422 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1423 {
1424 struct Identifier * declId = GetDeclId(d);
1425
1426 if(declId)
1427 {
1428 if(member)
1429 {
1430 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1431
1432 dataMember = link ? link->data : (((void *)0));
1433 }
1434 else
1435 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1436 if(dataMember)
1437 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1438 }
1439 }
1440 }
1441 else if(decl->__anon1.__anon1.specifiers)
1442 {
1443 struct Specifier * spec;
1444
1445 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1446 {
1447 if(spec->type == 3 || spec->type == 4)
1448 {
1449 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1450 {
1451 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1452 }
1453 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1454 {
1455 if(member)
1456 {
1457 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1458
1459 dataMember = link ? link->data : (((void *)0));
1460 }
1461 else
1462 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1463 if(dataMember)
1464 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1465 }
1466 }
1467 }
1468 }
1469 }
1470 else if(decl->type == 2)
1471 {
1472 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1473 }
1474 }
1475 }
1476 }
1477 }
1478
1479 struct FunctionDefinition;
1480
1481 typedef union YYSTYPE
1482 {
1483 int specifierType;
1484 int i;
1485 int declMode;
1486 struct Identifier * id;
1487 struct Expression * exp;
1488 struct Specifier * specifier;
1489 struct __ecereNameSpace__ecere__sys__OldList * list;
1490 struct Enumerator * enumerator;
1491 struct Declarator * declarator;
1492 struct Pointer * pointer;
1493 struct Initializer * initializer;
1494 struct InitDeclarator * initDeclarator;
1495 struct TypeName * typeName;
1496 struct Declaration * declaration;
1497 struct Statement * stmt;
1498 struct FunctionDefinition * function;
1499 struct External * external;
1500 struct Context * context;
1501 struct AsmField * asmField;
1502 struct Attrib * attrib;
1503 struct ExtDecl * extDecl;
1504 struct Attribute * attribute;
1505 struct Instantiation * instance;
1506 struct MembersInit * membersInit;
1507 struct MemberInit * memberInit;
1508 struct ClassFunction * classFunction;
1509 struct ClassDefinition * _class;
1510 struct ClassDef * classDef;
1511 struct PropertyDef * prop;
1512 char * string;
1513 struct Symbol * symbol;
1514 struct PropertyWatch * propertyWatch;
1515 struct TemplateParameter * templateParameter;
1516 struct TemplateArgument * templateArgument;
1517 struct TemplateDatatype * templateDatatype;
1518 struct DBTableEntry * dbtableEntry;
1519 struct DBIndexItem * dbindexItem;
1520 struct DBTableDef * dbtableDef;
1521 } __attribute__ ((gcc_struct)) YYSTYPE;
1522
1523 extern YYSTYPE yylval;
1524
1525 struct External
1526 {
1527 struct External * prev;
1528 struct External * next;
1529 struct Location loc;
1530 int type;
1531 struct Symbol * symbol;
1532 union
1533 {
1534 struct FunctionDefinition * function;
1535 struct ClassDefinition * _class;
1536 struct Declaration * declaration;
1537 char *  importString;
1538 struct Identifier * id;
1539 struct DBTableDef * table;
1540 } __attribute__ ((gcc_struct)) __anon1;
1541 int importType;
1542 struct External * fwdDecl;
1543 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1544 struct __ecereNameSpace__ecere__com__Instance * incoming;
1545 int nonBreakableIncoming;
1546 } __attribute__ ((gcc_struct));
1547
1548 struct FunctionDefinition
1549 {
1550 struct FunctionDefinition * prev;
1551 struct FunctionDefinition * next;
1552 struct Location loc;
1553 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1554 struct Declarator * declarator;
1555 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1556 struct Statement * body;
1557 struct __ecereNameSpace__ecere__com__Class * _class;
1558 struct __ecereNameSpace__ecere__sys__OldList attached;
1559 int declMode;
1560 struct Type * type;
1561 struct Symbol * propSet;
1562 int tempCount;
1563 unsigned int propertyNoThis;
1564 } __attribute__ ((gcc_struct));
1565
1566 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
1567
1568 struct __ecereNameSpace__ecere__com__NameSpace;
1569
1570 struct __ecereNameSpace__ecere__com__NameSpace
1571 {
1572 const char *  name;
1573 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
1574 struct __ecereNameSpace__ecere__com__NameSpace *  left;
1575 struct __ecereNameSpace__ecere__com__NameSpace *  right;
1576 int depth;
1577 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
1578 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1579 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1580 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1581 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1582 } __attribute__ ((gcc_struct));
1583
1584 struct __ecereNameSpace__ecere__com__Class
1585 {
1586 struct __ecereNameSpace__ecere__com__Class * prev;
1587 struct __ecereNameSpace__ecere__com__Class * next;
1588 const char *  name;
1589 int offset;
1590 int structSize;
1591 void * *  _vTbl;
1592 int vTblSize;
1593 unsigned int (*  Constructor)(void * );
1594 void (*  Destructor)(void * );
1595 int offsetClass;
1596 int sizeClass;
1597 struct __ecereNameSpace__ecere__com__Class * base;
1598 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1599 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1600 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1601 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1602 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1603 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1604 int memberID;
1605 int startMemberID;
1606 int type;
1607 struct __ecereNameSpace__ecere__com__Instance * module;
1608 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
1609 const char *  dataTypeString;
1610 struct Type * dataType;
1611 int typeSize;
1612 int defaultAlignment;
1613 void (*  Initialize)();
1614 int memberOffset;
1615 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1616 const char *  designerClass;
1617 unsigned int noExpansion;
1618 const char *  defaultProperty;
1619 unsigned int comRedefinition;
1620 int count;
1621 int isRemote;
1622 unsigned int internalDecl;
1623 void *  data;
1624 unsigned int computeSize;
1625 short structAlignment;
1626 short pointerAlignment;
1627 int destructionWatchOffset;
1628 unsigned int fixed;
1629 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1630 int inheritanceAccess;
1631 const char *  fullName;
1632 void *  symbol;
1633 struct __ecereNameSpace__ecere__sys__OldList conversions;
1634 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1635 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
1636 struct __ecereNameSpace__ecere__com__Class * templateClass;
1637 struct __ecereNameSpace__ecere__sys__OldList templatized;
1638 int numParams;
1639 unsigned int isInstanceClass;
1640 unsigned int byValueSystemClass;
1641 } __attribute__ ((gcc_struct));
1642
1643 struct __ecereNameSpace__ecere__com__Application
1644 {
1645 int argc;
1646 const char * *  argv;
1647 int exitCode;
1648 unsigned int isGUIApp;
1649 struct __ecereNameSpace__ecere__sys__OldList allModules;
1650 char *  parsedCommand;
1651 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1652 } __attribute__ ((gcc_struct));
1653
1654 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1655 {
1656 if(ns == parent)
1657 return 1;
1658 else if((*ns).parent)
1659 return NameSpaceContained((*ns).parent, parent);
1660 else
1661 return 0;
1662 }
1663
1664 static void AddSimpleBaseMembers(struct External * external, struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1665 {
1666 if(_class->type != 1000)
1667 AddMembers(external, list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1668 }
1669
1670 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
1671
1672 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
1673
1674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1675
1676 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1677
1678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
1679
1680 struct __ecereNameSpace__ecere__com__Module
1681 {
1682 struct __ecereNameSpace__ecere__com__Instance * application;
1683 struct __ecereNameSpace__ecere__sys__OldList classes;
1684 struct __ecereNameSpace__ecere__sys__OldList defines;
1685 struct __ecereNameSpace__ecere__sys__OldList functions;
1686 struct __ecereNameSpace__ecere__sys__OldList modules;
1687 struct __ecereNameSpace__ecere__com__Instance * prev;
1688 struct __ecereNameSpace__ecere__com__Instance * next;
1689 const char *  name;
1690 void *  library;
1691 void *  Unload;
1692 int importType;
1693 int origImportType;
1694 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1695 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1696 } __attribute__ ((gcc_struct));
1697
1698 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
1699 {
1700
1701 }
1702
1703 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1704 {
1705 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1706
1707 if(regClass)
1708 {
1709 if(regClass->templateClass)
1710 regClass = regClass->templateClass;
1711 if(classSym->isStatic && access != 3)
1712 {
1713 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1714 }
1715 else if(access == 1)
1716 {
1717 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application + sizeof(struct __ecereNameSpace__ecere__com__Module) + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->systemNameSpace))
1718 {
1719 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1720 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1721 }
1722 }
1723 }
1724 }
1725
1726 static void ProcessClass(int classType, struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol, struct __ecereNameSpace__ecere__sys__OldList * baseSpecs, struct __ecereNameSpace__ecere__sys__OldList * enumValues, struct Location * loc, struct __ecereNameSpace__ecere__sys__OldList * defs, void * after, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators, struct ExtDecl * extDecl)
1727 {
1728 char structName[1024];
1729 char className[1024];
1730 char constructorName[1024];
1731 char destructorName[1024];
1732 struct __ecereNameSpace__ecere__com__Class * regClass;
1733 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1734 unsigned int isUnion = classType == 6;
1735 struct External * external = (((void *)0));
1736 struct ClassDef * def;
1737 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1738 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1739
1740 if(inCompiler)
1741 {
1742 list = MkList();
1743 classDataList = MkList();
1744 }
1745 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1746 if(!regClass)
1747 return ;
1748 classType = regClass->type;
1749 if(inCompiler)
1750 {
1751 yylloc = *loc;
1752 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && regClass->inheritanceAccess == 1)
1753 {
1754 if(!regClass->base->symbol)
1755 regClass->base->symbol = FindClass(regClass->base->fullName);
1756 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1757 }
1758 else if(!symbol->isStatic && regClass->base)
1759 {
1760 if(!regClass->base->symbol)
1761 regClass->base->symbol = FindClass(regClass->base->fullName);
1762 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1763 }
1764 }
1765 if(definitions != (((void *)0)))
1766 {
1767 for(def = definitions->first; def; def = def->next)
1768 {
1769 if(def->type == 13)
1770 {
1771 struct __ecereNameSpace__ecere__com__DataMember * member;
1772 struct __ecereNameSpace__ecere__com__Property * prop;
1773 struct __ecereNameSpace__ecere__com__Method * method;
1774
1775 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1776 {
1777 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1778 }
1779 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1780 {
1781 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1782 }
1783 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1784 {
1785 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1786 }
1787 else
1788 {
1789 yylloc = def->loc;
1790 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1791 }
1792 }
1793 }
1794 }
1795 if(inCompiler)
1796 {
1797 external = MkExternalDeclaration((((void *)0)));
1798 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1799 curExternal = external;
1800 curExternal->symbol = symbol;
1801 }
1802 if((classType == 1 || classType == 5) && inCompiler)
1803 {
1804 AddSimpleBaseMembers(external, list, regClass->base, regClass);
1805 }
1806 if(definitions != (((void *)0)))
1807 {
1808 if(inCompiler)
1809 {
1810 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
1811 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1812 else if(!symbol->isStatic)
1813 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1814 }
1815 for(def = definitions->first; def; def = def->next)
1816 {
1817 yylloc = def->loc;
1818 if(def->type == 2)
1819 {
1820 struct Declaration * decl = def->__anon1.decl;
1821
1822 yylloc = decl->loc;
1823 if(decl->type == 0)
1824 {
1825 if(inCompiler && classType != 2)
1826 {
1827 ListAdd(list, MkClassDefDeclaration(decl));
1828 def->__anon1.decl = (((void *)0));
1829 }
1830 }
1831 else if(decl->type == 2)
1832 {
1833 struct Instantiation * inst = decl->__anon1.inst;
1834 struct Expression * exp = inst->exp;
1835 struct Symbol * classSym;
1836
1837 if(exp)
1838 {
1839 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1840 struct Declarator * d;
1841
1842 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1843 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1844 if(inCompiler)
1845 {
1846 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1847
1848 ListAdd(declarators, d);
1849 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1850 ListAdd(list, MkClassDefDeclaration(decl));
1851 exp->type = 8;
1852 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1853 exp->__anon1.member.exp = QMkExpId("this");
1854 exp->__anon1.member.memberType = 3;
1855 exp->__anon1.member.thisPtr = 1;
1856 }
1857 else
1858 {
1859 FreeDeclarator(d);
1860 FreeList(specifiers, (void *)(FreeSpecifier));
1861 }
1862 }
1863 classSym = inst->_class->__anon1.__anon1.symbol;
1864 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1865 {
1866 if(inst->members && (*inst->members).count)
1867 symbol->needConstructor = 1;
1868 }
1869 else
1870 {
1871 symbol->needConstructor = 1;
1872 symbol->needDestructor = 1;
1873 }
1874 }
1875 }
1876 else if(def->type == 9)
1877 {
1878 struct Declaration * decl = def->__anon1.decl;
1879
1880 if(decl->type == 0)
1881 {
1882 if(inCompiler && classType != 2)
1883 {
1884 ListAdd(classDataList, MkClassDefDeclaration(decl));
1885 def->__anon1.decl = (((void *)0));
1886 }
1887 }
1888 }
1889 else if(def->type == 1)
1890 symbol->needConstructor = 1;
1891 else if(def->type == 4)
1892 symbol->needConstructor = 1;
1893 else if(def->type == 0)
1894 {
1895 struct ClassFunction * func = def->__anon1.function;
1896
1897 if(func->isDestructor)
1898 {
1899 if(destructor)
1900 {
1901 yylloc = *loc;
1902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1903 }
1904 else
1905 {
1906 symbol->needDestructor = 1;
1907 destructor = func;
1908 if(!inCompiler && func->body)
1909 {
1910 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1911
1912 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1913 }
1914 }
1915 }
1916 if(func->isConstructor)
1917 {
1918 if(constructor)
1919 {
1920 yylloc = *loc;
1921 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1922 }
1923 else
1924 {
1925 symbol->needConstructor = 1;
1926 constructor = func;
1927 if(!inCompiler && func->body)
1928 {
1929 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1930
1931 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1932 }
1933 }
1934 }
1935 }
1936 }
1937 }
1938 if(inCompiler)
1939 {
1940 external->symbol = (((void *)0));
1941 if((*list).count)
1942 {
1943 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1944
1945 initDeclarators = (((void *)0));
1946 strcpy(structName, symbol->string);
1947 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1948 {
1949 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1950
1951 spec->__anon1.__anon2.extDeclStruct = extDecl;
1952 ListAdd(specs, spec);
1953 }
1954 external->symbol = symbol;
1955 if(symbol->__anon2.__anon1.structExternal)
1956 {
1957 {
1958 struct TopoEdge * e;
1959 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->incoming;
1960
1961 for(e = ((struct TopoEdge *)(uintptr_t)((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first); e; e = (struct TopoEdge *)((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
1962 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1963
1964 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1965 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1966 __ecereMethod_External_CreateUniqueEdge(external, e->from, e->breakable);
1967 }
1968 {
1969 struct TopoEdge * e;
1970 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->outgoing;
1971
1972 for(e = ((struct TopoEdge *)(uintptr_t)((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first); e; e = (struct TopoEdge *)((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
1973 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1974
1975 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1976 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1977 __ecereMethod_External_CreateUniqueEdge(e->to, external, e->breakable);
1978 }
1979 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), symbol->__anon2.__anon1.structExternal);
1980 FreeExternal(symbol->__anon2.__anon1.structExternal);
1981 }
1982 symbol->__anon2.__anon1.structExternal = external;
1983 external->__anon1.declaration = MkDeclaration(specs, declarators);
1984 after = external;
1985 symbol->declaredStruct = 1;
1986 }
1987 else
1988 {
1989 curExternal = external->prev;
1990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1991 FreeExternal(external);
1992 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1993 }
1994 if((*classDataList).count)
1995 {
1996 char classDataStructName[1024];
1997 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1998 struct External * external;
1999
2000 strcpy(classDataStructName, "__ecereClassData_");
2001 FullClassNameCat(classDataStructName, symbol->string, 0);
2002 declMode = structDeclMode = 0;
2003 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
2004 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
2005 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
2006 after = external;
2007 symbol->classData = 1;
2008 }
2009 else
2010 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
2011 }
2012 if(inCompiler)
2013 {
2014 {
2015 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2016
2017 strcpy(className, "__ecereClass_");
2018 FullClassNameCat(className, symbol->string, 1);
2019 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2020 if(!strstr(sourceFile, ".main.ec"))
2021 ListAdd(specs, MkSpecifier(STATIC));
2022 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2023 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2024 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2025 DeclareStruct(symbol->__anon2.__anon1.pointerExternal, "ecere::com::Class", 0, 1);
2026 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon1.pointerExternal);
2027 after = symbol->__anon2.__anon3.methodExternal;
2028 }
2029 if(symbol->needDestructor)
2030 {
2031 struct ClassFunction * function;
2032 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2033 struct Declarator * decl;
2034 struct Statement * body;
2035 struct Context * context;
2036 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2037
2038 strcpy(destructorName, "__ecereDestructor_");
2039 FullClassNameCat(destructorName, symbol->string, 0);
2040 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2041 ListAdd(specs, MkSpecifier(VOID));
2042 context = PushContext();
2043 statements = MkList();
2044 if(definitions != (((void *)0)))
2045 {
2046 for(def = definitions->first; def; def = def->next)
2047 {
2048 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2049 {
2050 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2051 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2052
2053 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2054 {
2055 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2056
2057 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2058 }
2059 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2060 {
2061 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2062
2063 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2064 }
2065 }
2066 }
2067 }
2068 if(destructor && destructor->body)
2069 {
2070 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2071 destructor->body->__anon1.compound.context->parent = context;
2072 destructor->body = (((void *)0));
2073 }
2074 body = MkCompoundStmt(declarations, statements);
2075 PopContext(context);
2076 body->__anon1.compound.context = context;
2077 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2078 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2079 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2080 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2081 ProcessClassFunctionBody(function, body);
2082 function->dontMangle = 1;
2083 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2084 }
2085 if(symbol->needConstructor && inCompiler)
2086 {
2087 struct ClassFunction * function;
2088 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2089 struct Declarator * decl;
2090 struct Statement * body;
2091 struct Context * context;
2092 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2093
2094 strcpy(constructorName, "__ecereConstructor_");
2095 FullClassNameCat(constructorName, symbol->string, 0);
2096 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2097 ListAdd(specs, MkSpecifierName("bool"));
2098 context = PushContext();
2099 statements = MkList();
2100 if(definitions != (((void *)0)))
2101 {
2102 for(def = definitions->first; def; def = def->next)
2103 {
2104 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2105 {
2106 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2107 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2108
2109 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2110 {
2111 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2112
2113 *newInst = *inst;
2114 newInst->members = (((void *)0));
2115 newInst->exp = CopyExpression(inst->exp);
2116 newInst->_class = CopySpecifier(inst->_class);
2117 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2118 inst->built = 1;
2119 }
2120 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2121 {
2122 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2123 }
2124 }
2125 }
2126 for(def = definitions->first; def; def = def->next)
2127 {
2128 if(def->type == 1 && def->__anon1.defProperties)
2129 {
2130 struct MemberInit * propertyDef;
2131
2132 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2133 {
2134 struct Expression * memberExp;
2135 struct Identifier * id = (*propertyDef->identifiers).first;
2136
2137 if(id)
2138 {
2139 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2140 for(id = id->next; id; id = id->next)
2141 memberExp = MkExpMember(memberExp, id);
2142 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2143 }
2144 if(propertyDef->initializer)
2145 {
2146 if(propertyDef->initializer->type == 0)
2147 propertyDef->initializer->__anon1.exp = (((void *)0));
2148 FreeInitializer(propertyDef->initializer);
2149 }
2150 propertyDef->initializer = (((void *)0));
2151 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2152 }
2153 }
2154 }
2155 for(def = definitions->first; def; def = def->next)
2156 {
2157 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2158 {
2159 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2160 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2161
2162 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2163 {
2164 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2165 {
2166 def->__anon1.decl->__anon1.inst = (((void *)0));
2167 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2168 }
2169 }
2170 }
2171 }
2172 }
2173 if(constructor && constructor->body)
2174 {
2175 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2176 constructor->body->__anon1.compound.context->parent = context;
2177 constructor->body = (((void *)0));
2178 }
2179 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2180 body = MkCompoundStmt(declarations, statements);
2181 PopContext(context);
2182 body->__anon1.compound.context = context;
2183 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2184 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2185 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2186 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2187 ProcessClassFunctionBody(function, body);
2188 function->dontMangle = 1;
2189 if(definitions != (((void *)0)))
2190 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2191 }
2192 }
2193 if(definitions != (((void *)0)))
2194 {
2195 for(def = definitions->first; def; def = def->next)
2196 {
2197 if(def->type == 3 && def->__anon1.propertyDef)
2198 {
2199 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2200 struct ClassDef * after = def;
2201 struct ClassDef * newDef;
2202
2203 if(inCompiler)
2204 {
2205 yylloc = propertyDef->loc;
2206 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && def->memberAccess == 1)
2207 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2208 else if(!symbol->isStatic)
2209 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2210 }
2211 {
2212 {
2213 struct ClassFunction * func;
2214 struct Declarator * decl;
2215 char name[1024];
2216 struct __ecereNameSpace__ecere__sys__OldList * params;
2217
2218 if(propertyDef->getStmt && propertyDef->id)
2219 {
2220 strcpy(name, "__ecereProp_");
2221 FullClassNameCat(name, symbol->string, 0);
2222 strcat(name, "_Get_");
2223 FullClassNameCat(name, propertyDef->id->string, 1);
2224 params = MkList();
2225 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->__anon1._class && propertyDef->symbol->type->__anon1._class->__anon1.registered && propertyDef->symbol->type->__anon1._class->__anon1.registered->type == 1)
2226 {
2227 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2228 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2229 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2230 }
2231 else
2232 {
2233 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2234 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2235 }
2236 ProcessClassFunctionBody(func, propertyDef->getStmt);
2237 func->declarator->symbol = propertyDef->symbol;
2238 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2239 func->dontMangle = 1;
2240 newDef = MkClassDefFunction(func);
2241 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2242 after = newDef;
2243 if(inCompiler)
2244 propertyDef->getStmt = (((void *)0));
2245 else
2246 func->body = (((void *)0));
2247 }
2248 if(propertyDef->setStmt && propertyDef->id)
2249 {
2250 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2251
2252 strcpy(name, "__ecereProp_");
2253 FullClassNameCat(name, symbol->string, 0);
2254 strcat(name, "_Set_");
2255 FullClassNameCat(name, propertyDef->id->string, 1);
2256 params = MkList();
2257 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2258 if(propertyDef->__anon1.isDBProp)
2259 {
2260 struct Specifier * spec;
2261 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2262
2263 for(spec = (*specs).first; spec; spec = spec->next)
2264 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2265 break;
2266 if(!spec)
2267 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2268 }
2269 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2270 {
2271 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2272 unsigned int useVoid = 0;
2273
2274 switch(regClass->type)
2275 {
2276 case 1:
2277 case 6:
2278 useVoid = 1;
2279 break;
2280 case 5:
2281 case 0:
2282 useVoid = !isConversion;
2283 break;
2284 default:
2285 useVoid = !isConversion;
2286 if(useVoid && !propertyDef->__anon1.isDBProp)
2287 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2288 }
2289 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2290 }
2291 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2292 ProcessClassFunctionBody(func, propertyDef->setStmt);
2293 func->dontMangle = 1;
2294 func->declarator->symbol = propertyDef->symbol;
2295 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2296 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2297 func->propSet = propertyDef->symbol;
2298 newDef = MkClassDefFunction(func);
2299 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2300 after = newDef;
2301 if(inCompiler)
2302 propertyDef->setStmt = (((void *)0));
2303 else
2304 func->body = (((void *)0));
2305 }
2306 if(propertyDef->issetStmt && propertyDef->id)
2307 {
2308 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2309
2310 strcpy(name, "__ecereProp_");
2311 FullClassNameCat(name, symbol->string, 0);
2312 strcat(name, "_IsSet_");
2313 FullClassNameCat(name, propertyDef->id->string, 1);
2314 params = MkList();
2315 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2316 ListAdd(specifiers, MkSpecifierName("bool"));
2317 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2318 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2319 func->dontMangle = 1;
2320 func->declarator->symbol = propertyDef->symbol;
2321 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2322 newDef = MkClassDefFunction(func);
2323 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2324 after = newDef;
2325 if(inCompiler)
2326 propertyDef->issetStmt = (((void *)0));
2327 else
2328 func->body = (((void *)0));
2329 }
2330 if(propertyDef->id && inCompiler)
2331 {
2332 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2333 struct Declaration * decl;
2334 struct External * external;
2335 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2336
2337 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2338 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2339 ListAdd(specifiers, MkSpecifierName("Property"));
2340 strcpy(name, "__ecereProp_");
2341 FullClassNameCat(name, symbol->string, 0);
2342 strcat(name, "_");
2343 FullClassNameCat(name, propertyDef->id->string, 1);
2344 {
2345 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2346
2347 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2348 strcpy(name, "__ecerePropM_");
2349 FullClassNameCat(name, symbol->string, 0);
2350 strcat(name, "_");
2351 FullClassNameCat(name, propertyDef->id->string, 1);
2352 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2353 decl = MkDeclaration(specifiers, list);
2354 }
2355 external = MkExternalDeclaration(decl);
2356 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2357 external->symbol = propertyDef->symbol;
2358 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2359 if(inCompiler && prop && prop->symbol)
2360 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2361 }
2362 }
2363 }
2364 }
2365 else if(def->type == 10 && def->__anon1.propertyDef)
2366 {
2367 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2368 struct ClassDef * after = def;
2369 struct ClassDef * newDef;
2370
2371 {
2372 if(inCompiler)
2373 {
2374 yylloc = propertyDef->loc;
2375 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
2376 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2377 else if(!symbol->isStatic)
2378 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2379 }
2380 {
2381 struct ClassFunction * func;
2382 struct Declarator * decl;
2383 char name[1024];
2384 struct __ecereNameSpace__ecere__sys__OldList * params;
2385
2386 if(propertyDef->getStmt && propertyDef->id)
2387 {
2388 struct Declarator * declId;
2389
2390 sprintf(name, "class::__ecereClassProp_");
2391 FullClassNameCat(name, symbol->string, 0);
2392 strcat(name, "_Get_");
2393 strcat(name, propertyDef->id->string);
2394 params = MkList();
2395 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2396 {
2397 decl = MkDeclaratorFunction(declId, params);
2398 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2399 }
2400 ProcessClassFunctionBody(func, propertyDef->getStmt);
2401 func->declarator->symbol = propertyDef->symbol;
2402 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2403 func->dontMangle = 1;
2404 newDef = MkClassDefFunction(func);
2405 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2406 after = newDef;
2407 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2408 func->type = ProcessType(propertyDef->specifiers, decl);
2409 FreeDeclarator(decl);
2410 if(func->type->__anon1.__anon2.returnType->kind == 8 && func->type->__anon1.__anon2.returnType->__anon1._class && func->type->__anon1.__anon2.returnType->__anon1._class->__anon1.registered && func->type->__anon1.__anon2.returnType->__anon1._class->__anon1.registered->type == 1)
2411 func->type->__anon1.__anon2.returnType->byReference = 1;
2412 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2413 if(inCompiler)
2414 propertyDef->getStmt = (((void *)0));
2415 else
2416 func->body = (((void *)0));
2417 }
2418 if(propertyDef->setStmt && propertyDef->id)
2419 {
2420 struct Context * prevCurContext;
2421 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2422 struct Statement * body = propertyDef->setStmt;
2423 struct Declarator * ptrDecl;
2424 struct Expression * e;
2425
2426 strcpy(name, "class::__ecereClassProp_");
2427 FullClassNameCat(name, symbol->string, 0);
2428 strcat(name, "_Set_");
2429 strcat(name, propertyDef->id->string);
2430 params = MkList();
2431 prevCurContext = curContext;
2432 curContext = body->__anon1.compound.context;
2433 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2434 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2435 if(!body->__anon1.compound.declarations)
2436 body->__anon1.compound.declarations = MkList();
2437 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->__anon1._class && propertyDef->symbol->type->__anon1._class->__anon1.registered && propertyDef->symbol->type->__anon1._class->__anon1.registered->type == 1)
2438 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2439 else
2440 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2441 e = MkExpIdentifier(MkIdentifier("_value"));
2442 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2443 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2444 ListAdd(body->__anon1.compound.declarations, MkDeclaration(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(ptrDecl, MkInitializerAssignment(MkExpCast(MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), CopyDeclarator(propertyDef->declarator)), e))))));
2445 curContext = prevCurContext;
2446 {
2447 struct Symbol * sym = ptrDecl->symbol;
2448
2449 sym->isParam = 1;
2450 FreeType(sym->type);
2451 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2452 }
2453 ListAdd(specifiers, MkSpecifier(VOID));
2454 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2455 ProcessClassFunctionBody(func, propertyDef->setStmt);
2456 func->dontMangle = 1;
2457 func->declarator->symbol = propertyDef->symbol;
2458 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2459 newDef = MkClassDefFunction(func);
2460 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2461 after = newDef;
2462 if(inCompiler)
2463 propertyDef->setStmt = (((void *)0));
2464 else
2465 func->body = (((void *)0));
2466 }
2467 }
2468 }
2469 }
2470 else if(def->type == 0 && def->__anon1.function->declarator)
2471 {
2472 struct ClassFunction * func = def->__anon1.function;
2473
2474 func->_class = regClass;
2475 if(!func->dontMangle)
2476 {
2477 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2478 struct Identifier * id = GetDeclId(funcDecl);
2479 struct __ecereNameSpace__ecere__com__Method * method;
2480
2481 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2482 {
2483 if(!funcDecl->__anon1.function.parameters)
2484 funcDecl->__anon1.function.parameters = MkList();
2485 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2486 }
2487 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2488 FreeSpecifier(id->_class);
2489 id->_class = (((void *)0));
2490 if(inCompiler && method)
2491 {
2492 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2493
2494 newId[0] = '\0';
2495 ProcessMethodType(method);
2496 yylloc = def->loc;
2497 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && method->memberAccess == 1)
2498 CheckPublicDataType(method->dataType, 1, "class method");
2499 strcpy(newId, "__ecereMethod_");
2500 FullClassNameCat(newId, symbol->string, 0);
2501 strcat(newId, "_");
2502 strcat(newId, id->string);
2503 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2504 id->string = newId;
2505 if(method->type != 1)
2506 {
2507 if(method->symbol)
2508 {
2509 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2510 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2511 }
2512 }
2513 }
2514 }
2515 }
2516 }
2517 }
2518 if(initDeclarators != (((void *)0)))
2519 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2520 }
2521
2522 void PreProcessClassDefinitions()
2523 {
2524 struct External * external, * next;
2525
2526 curExternal = (((void *)0));
2527 if(ast)
2528 {
2529 for(external = (*ast).first; external; external = next)
2530 {
2531 next = external->next;
2532 curExternal = external;
2533 if(external->type == 2)
2534 {
2535 struct ClassDefinition * _class = external->__anon1._class;
2536
2537 if(_class->definitions)
2538 {
2539 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2540 }
2541 }
2542 else if(external->type == 1)
2543 {
2544 struct Declaration * declaration = external->__anon1.declaration;
2545
2546 if(declaration && declaration->type == 1)
2547 {
2548 if(declaration->__anon1.__anon1.specifiers)
2549 {
2550 struct Specifier * specifier;
2551
2552 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2553 {
2554 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->__anon1.__anon2.id && specifier->__anon1.__anon2.id->string && (declaration->declMode || specifier->__anon1.__anon2.baseSpecs || (specifier->type == 2 && specifier->__anon1.__anon2.definitions)))
2555 {
2556 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2557
2558 if(symbol)
2559 {
2560 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2561 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2562
2563 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2564 if(inCompiler)
2565 {
2566 initDeclarators = declaration->__anon1.__anon1.declarators;
2567 declaration->__anon1.__anon1.declarators = (((void *)0));
2568 }
2569 ProcessClass((specifier->type == 4) ? 6 : 0, specifier->__anon1.__anon2.definitions, symbol, specifier->__anon1.__anon2.baseSpecs, specifier->__anon1.__anon2.list, &specifier->loc, ast, external->prev, initDeclarators, extDecl);
2570 }
2571 }
2572 }
2573 }
2574 }
2575 else if(declaration && inCompiler && declaration->type == 3)
2576 {
2577 yylloc = declaration->loc;
2578 if(declaration->declMode == 1)
2579 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2580 else if(declaration->declMode != 3)
2581 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2582 }
2583 }
2584 else if(external->type == 3)
2585 {
2586 }
2587 else if(inCompiler && external->type == 0)
2588 {
2589 yylloc = external->__anon1.function->loc;
2590 if(!external->__anon1.function->type)
2591 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2592 if(external->__anon1.function->declMode == 1)
2593 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2594 else if(external->__anon1.function->declMode != 3)
2595 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2596 }
2597 }
2598 }
2599 }
2600
2601 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2602 {
2603 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2604
2605 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2606 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);
2607 }
2608