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