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