1 /* Code generated from eC source file: firstPass.ec */
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
7 #define __runtimePlatform 2
10 typedef long long int64;
11 typedef unsigned long long uint64;
15 #elif defined(__TINYC__)
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
27 typedef long long int64;
28 typedef unsigned long long uint64;
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
34 #define __ENDIAN_PAD(x) (8 - (x))
36 #define __ENDIAN_PAD(x) 0
39 #include <sys/types.h>
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
45 extern unsigned int inCompiler;
47 extern unsigned int buildingECERECOMModule;
49 struct __ecereNameSpace__ecere__sys__OldList
56 } __attribute__ ((gcc_struct));
58 struct __ecereNameSpace__ecere__sys__BTNode;
60 struct __ecereNameSpace__ecere__com__DataValue
75 } __attribute__ ((gcc_struct)) __anon1;
76 } __attribute__ ((gcc_struct));
78 struct __ecereNameSpace__ecere__com__SerialBuffer
80 unsigned char * _buffer;
84 } __attribute__ ((gcc_struct));
86 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
88 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
90 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
92 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
94 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
102 struct InitDeclarator;
108 struct FunctionDefinition;
122 struct PropertyWatch;
136 } __attribute__ ((gcc_struct));
138 extern int strtol(const char * , char * * , int base);
140 extern void Compiler_Error(const char * format, ...);
142 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
144 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
150 struct __ecereNameSpace__ecere__com__ClassProperty;
152 extern int strcmp(const char * , const char * );
154 extern char * strcpy(char * , const char * );
156 extern char * strcat(char * , const char * );
158 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
160 struct __ecereNameSpace__ecere__com__LinkList
165 } __attribute__ ((gcc_struct));
167 struct __ecereNameSpace__ecere__com__GlobalFunction;
169 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
171 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
173 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
175 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
177 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
181 struct CodePosition start;
182 struct CodePosition end;
183 } __attribute__ ((gcc_struct));
185 extern struct ModuleImport * mainModule;
187 extern struct Location yylloc;
191 extern void ProcessExpressionType(struct Expression * exp);
193 extern void ComputeExpression(struct Expression * exp);
195 extern void FreeExpression(struct Expression * exp);
199 extern struct Context * globalContext;
203 extern struct External * curExternal;
205 struct __ecereNameSpace__ecere__com__Class;
207 struct __ecereNameSpace__ecere__com__Instance
210 struct __ecereNameSpace__ecere__com__Class * _class;
212 } __attribute__ ((gcc_struct));
214 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
216 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
218 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_AddClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * dataType, void * setStmt, void * getStmt);
220 extern void __ecereNameSpace__ecere__com__eClass_DoneAddingTemplateParameters(struct __ecereNameSpace__ecere__com__Class * base);
222 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
224 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
226 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
228 struct __ecereNameSpace__ecere__com__Property;
230 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
232 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);
234 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
236 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
238 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);
240 extern void __ecereNameSpace__ecere__com__eProperty_Watchable(struct __ecereNameSpace__ecere__com__Property * _property);
244 extern char * StringFromSpecDecl(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
246 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
248 struct TemplateDatatype
250 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
251 struct Declarator * decl;
252 } __attribute__ ((gcc_struct));
256 struct __ecereNameSpace__ecere__com__Property
258 struct __ecereNameSpace__ecere__com__Property * prev;
259 struct __ecereNameSpace__ecere__com__Property * next;
261 unsigned int isProperty;
264 struct __ecereNameSpace__ecere__com__Class * _class;
265 const char * dataTypeString;
266 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
267 struct Type * dataType;
268 void (* Set)(void * , int);
269 int (* Get)(void * );
270 unsigned int (* IsSet)(void * );
274 unsigned int conversion;
275 unsigned int watcherOffset;
276 const char * category;
277 unsigned int compiled;
278 unsigned int selfWatchable;
279 unsigned int isWatchable;
280 } __attribute__ ((gcc_struct));
282 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
284 extern void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
286 extern void FreeType(struct Type * type);
288 struct __ecereNameSpace__ecere__com__DataMember;
290 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eMember_AddDataMember(struct __ecereNameSpace__ecere__com__DataMember * member, const char * name, const char * type, unsigned int size, unsigned int alignment, int declMode);
292 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);
294 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eMember_New(int type, int declMode);
296 extern unsigned int __ecereNameSpace__ecere__com__eMember_AddMember(struct __ecereNameSpace__ecere__com__DataMember * addTo, struct __ecereNameSpace__ecere__com__DataMember * dataMember);
298 extern unsigned int __ecereNameSpace__ecere__com__eClass_AddMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__DataMember * dataMember);
302 extern void FreeSpecifier(struct Specifier * spec);
306 extern struct Symbol * FindType(struct Context * ctx, const char * name);
308 extern struct Symbol * FindClass(const char * name);
310 struct __ecereNameSpace__ecere__sys__OldLink;
312 struct __ecereNameSpace__ecere__sys__OldLink
314 struct __ecereNameSpace__ecere__sys__OldLink * prev;
315 struct __ecereNameSpace__ecere__sys__OldLink * next;
317 } __attribute__ ((gcc_struct));
319 struct __ecereNameSpace__ecere__sys__BinaryTree;
321 struct __ecereNameSpace__ecere__sys__BinaryTree
323 struct __ecereNameSpace__ecere__sys__BTNode * root;
325 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
326 void (* FreeKey)(void * key);
327 } __attribute__ ((gcc_struct));
329 struct __ecereNameSpace__ecere__com__DataMember
331 struct __ecereNameSpace__ecere__com__DataMember * prev;
332 struct __ecereNameSpace__ecere__com__DataMember * next;
334 unsigned int isProperty;
337 struct __ecereNameSpace__ecere__com__Class * _class;
338 const char * dataTypeString;
339 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
340 struct Type * dataType;
344 struct __ecereNameSpace__ecere__sys__OldList members;
345 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
347 short structAlignment;
348 short pointerAlignment;
349 } __attribute__ ((gcc_struct));
351 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
359 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
360 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
361 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
362 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
363 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
364 unsigned int (* Neg)(struct Expression *, struct Operand *);
365 unsigned int (* Inc)(struct Expression *, struct Operand *);
366 unsigned int (* Dec)(struct Expression *, struct Operand *);
367 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
368 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
369 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
370 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
371 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
372 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
373 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
374 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
375 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
376 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
377 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
378 unsigned int (* BitNot)(struct Expression *, struct Operand *);
379 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
380 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
381 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
382 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
383 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
384 unsigned int (* Not)(struct Expression *, struct Operand *);
385 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
386 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
387 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
388 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
389 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
390 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
391 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
392 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
393 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
394 } __attribute__ ((gcc_struct));
400 unsigned int ptrSize;
413 } __attribute__ ((gcc_struct)) __anon1;
415 } __attribute__ ((gcc_struct));
417 extern struct Operand GetOperand(struct Expression * exp);
419 struct __ecereNameSpace__ecere__com__BitMember;
421 extern struct __ecereNameSpace__ecere__com__BitMember * __ecereNameSpace__ecere__com__eClass_AddBitMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, int bitSize, int bitPos, int declMode);
423 struct __ecereNameSpace__ecere__com__BitMember
425 struct __ecereNameSpace__ecere__com__BitMember * prev;
426 struct __ecereNameSpace__ecere__com__BitMember * next;
428 unsigned int isProperty;
431 struct __ecereNameSpace__ecere__com__Class * _class;
432 const char * dataTypeString;
433 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
434 struct Type * dataType;
439 } __attribute__ ((gcc_struct));
441 struct __ecereNameSpace__ecere__com__Method;
443 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
449 const char * dataTypeString;
450 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
451 } __attribute__ ((gcc_struct)) __anon1;
452 struct __ecereNameSpace__ecere__com__DataValue expression;
455 const char * memberString;
458 struct __ecereNameSpace__ecere__com__DataMember * member;
459 struct __ecereNameSpace__ecere__com__Property * prop;
460 struct __ecereNameSpace__ecere__com__Method * method;
461 } __attribute__ ((gcc_struct)) __anon1;
462 } __attribute__ ((gcc_struct)) __anon2;
463 } __attribute__ ((gcc_struct)) __anon1;
464 } __attribute__ ((gcc_struct));
466 struct __ecereNameSpace__ecere__com__Method
469 struct __ecereNameSpace__ecere__com__Method * parent;
470 struct __ecereNameSpace__ecere__com__Method * left;
471 struct __ecereNameSpace__ecere__com__Method * right;
476 struct __ecereNameSpace__ecere__com__Class * _class;
478 const char * dataTypeString;
479 struct Type * dataType;
481 } __attribute__ ((gcc_struct));
486 struct Symbol * parent;
487 struct Symbol * left;
488 struct Symbol * right;
493 struct __ecereNameSpace__ecere__com__Method * method;
494 struct __ecereNameSpace__ecere__com__Property * _property;
495 struct __ecereNameSpace__ecere__com__Class * registered;
496 } __attribute__ ((gcc_struct)) __anon1;
497 unsigned int notYetDeclared;
502 struct External * pointerExternal;
503 struct External * structExternal;
504 } __attribute__ ((gcc_struct)) __anon1;
507 struct External * externalGet;
508 struct External * externalSet;
509 struct External * externalPtr;
510 struct External * externalIsSet;
511 } __attribute__ ((gcc_struct)) __anon2;
514 struct External * methodExternal;
515 struct External * methodCodeExternal;
516 } __attribute__ ((gcc_struct)) __anon3;
517 } __attribute__ ((gcc_struct)) __anon2;
518 unsigned int imported;
519 unsigned int declaredStructSym;
520 struct __ecereNameSpace__ecere__com__Class * _class;
521 unsigned int declaredStruct;
522 unsigned int needConstructor;
523 unsigned int needDestructor;
524 char * constructorName;
527 char * destructorName;
528 struct ModuleImport * module;
529 struct ClassImport * _import;
530 struct Location nameLoc;
531 unsigned int isParam;
532 unsigned int isRemote;
533 unsigned int isStruct;
534 unsigned int fireWatchersDone;
536 unsigned int classData;
537 unsigned int isStatic;
539 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
540 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
541 struct Context * ctx;
543 struct Expression * propCategory;
544 unsigned int mustRegister;
545 } __attribute__ ((gcc_struct));
547 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddVirtualMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, void * function, int declMode);
549 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);
551 extern struct __ecereNameSpace__ecere__com__ClassTemplateParameter * __ecereNameSpace__ecere__com__eClass_AddTemplateParameter(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, int type, const void * info, struct __ecereNameSpace__ecere__com__ClassTemplateArgument * defaultArg);
553 struct __ecereNameSpace__ecere__com__Module;
555 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
557 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
559 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, const char * name, const char * baseName, int size, int sizeClass, unsigned int (* Constructor)(void * ), void (* Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
561 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);
567 struct Declarator * prev;
568 struct Declarator * next;
571 struct Symbol * symbol;
572 struct Declarator * declarator;
575 struct Identifier * identifier;
578 struct Expression * exp;
579 struct Expression * posExp;
580 struct Attrib * attrib;
581 } __attribute__ ((gcc_struct)) structDecl;
584 struct Expression * exp;
585 struct Specifier * enumClass;
586 } __attribute__ ((gcc_struct)) array;
589 struct __ecereNameSpace__ecere__sys__OldList * parameters;
590 } __attribute__ ((gcc_struct)) function;
593 struct Pointer * pointer;
594 } __attribute__ ((gcc_struct)) pointer;
597 struct ExtDecl * extended;
598 } __attribute__ ((gcc_struct)) extended;
599 } __attribute__ ((gcc_struct)) __anon1;
600 } __attribute__ ((gcc_struct));
602 extern struct Identifier * GetDeclId(struct Declarator * decl);
606 struct Identifier * prev;
607 struct Identifier * next;
609 struct Symbol * classSym;
610 struct Specifier * _class;
612 struct Identifier * badID;
613 } __attribute__ ((gcc_struct));
615 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
617 struct Instantiation;
621 struct Expression * prev;
622 struct Expression * next;
630 struct Identifier * identifier;
631 } __attribute__ ((gcc_struct)) __anon1;
632 struct Statement * compound;
633 struct Instantiation * instance;
637 unsigned int intlString;
638 unsigned int wideString;
639 } __attribute__ ((gcc_struct)) __anon2;
640 struct __ecereNameSpace__ecere__sys__OldList * list;
643 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
644 struct Declarator * decl;
645 } __attribute__ ((gcc_struct)) _classExp;
648 struct Identifier * id;
649 } __attribute__ ((gcc_struct)) classData;
652 struct Expression * exp;
653 struct __ecereNameSpace__ecere__sys__OldList * arguments;
654 struct Location argLoc;
655 } __attribute__ ((gcc_struct)) call;
658 struct Expression * exp;
659 struct __ecereNameSpace__ecere__sys__OldList * index;
660 } __attribute__ ((gcc_struct)) index;
663 struct Expression * exp;
664 struct Identifier * member;
666 unsigned int thisPtr;
667 } __attribute__ ((gcc_struct)) member;
671 struct Expression * exp1;
672 struct Expression * exp2;
673 } __attribute__ ((gcc_struct)) op;
674 struct TypeName * typeName;
675 struct Specifier * _class;
678 struct TypeName * typeName;
679 struct Expression * exp;
680 } __attribute__ ((gcc_struct)) cast;
683 struct Expression * cond;
684 struct __ecereNameSpace__ecere__sys__OldList * exp;
685 struct Expression * elseExp;
686 } __attribute__ ((gcc_struct)) cond;
689 struct TypeName * typeName;
690 struct Expression * size;
691 } __attribute__ ((gcc_struct)) _new;
694 struct TypeName * typeName;
695 struct Expression * size;
696 struct Expression * exp;
697 } __attribute__ ((gcc_struct)) _renew;
701 struct Identifier * id;
702 } __attribute__ ((gcc_struct)) db;
705 struct Expression * ds;
706 struct Expression * name;
707 } __attribute__ ((gcc_struct)) dbopen;
710 struct TypeName * typeName;
711 struct Initializer * initializer;
712 } __attribute__ ((gcc_struct)) initializer;
715 struct Expression * exp;
716 struct TypeName * typeName;
717 } __attribute__ ((gcc_struct)) vaArg;
718 } __attribute__ ((gcc_struct)) __anon1;
719 unsigned int debugValue;
720 struct __ecereNameSpace__ecere__com__DataValue val;
722 unsigned int hasAddress;
723 struct Type * expType;
724 struct Type * destType;
727 unsigned int byReference;
728 unsigned int isConstant;
729 unsigned int addedThis;
730 unsigned int needCast;
731 unsigned int thisPtr;
732 unsigned int opDestType;
733 unsigned int needTemplateCast;
734 } __attribute__ ((gcc_struct));
738 struct Instantiation * prev;
739 struct Instantiation * next;
741 struct Specifier * _class;
742 struct Expression * exp;
743 struct __ecereNameSpace__ecere__sys__OldList * members;
744 struct Symbol * symbol;
745 unsigned int fullSet;
746 unsigned int isConstant;
747 unsigned char * data;
748 struct Location nameLoc;
749 struct Location insideLoc;
751 } __attribute__ ((gcc_struct));
753 struct ClassFunction;
757 struct ClassFunction * prev;
758 struct ClassFunction * next;
760 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
761 struct Declarator * declarator;
762 struct __ecereNameSpace__ecere__sys__OldList * declarations;
763 struct Statement * body;
764 struct __ecereNameSpace__ecere__com__Class * _class;
765 struct __ecereNameSpace__ecere__sys__OldList attached;
768 struct Symbol * propSet;
769 unsigned int isVirtual;
770 unsigned int isConstructor;
771 unsigned int isDestructor;
772 unsigned int dontMangle;
775 } __attribute__ ((gcc_struct));
777 struct ClassDefinition;
781 struct Context * parent;
782 struct __ecereNameSpace__ecere__sys__BinaryTree types;
783 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
784 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
785 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
788 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
789 struct ClassDefinition * classDef;
790 unsigned int templateTypesOnly;
791 unsigned int hasNameSpace;
792 } __attribute__ ((gcc_struct));
794 struct ClassDefinition
796 struct ClassDefinition * prev;
797 struct ClassDefinition * next;
799 struct Specifier * _class;
800 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
801 struct __ecereNameSpace__ecere__sys__OldList * definitions;
802 struct Symbol * symbol;
803 struct Location blockStart;
804 struct Location nameLoc;
806 unsigned int deleteWatchable;
807 } __attribute__ ((gcc_struct));
809 struct __ecereNameSpace__ecere__com__NameSpace;
811 struct __ecereNameSpace__ecere__com__NameSpace
814 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
815 struct __ecereNameSpace__ecere__com__NameSpace * left;
816 struct __ecereNameSpace__ecere__com__NameSpace * right;
818 struct __ecereNameSpace__ecere__com__NameSpace * parent;
819 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
820 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
821 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
822 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
823 } __attribute__ ((gcc_struct));
825 struct __ecereNameSpace__ecere__com__Class
827 struct __ecereNameSpace__ecere__com__Class * prev;
828 struct __ecereNameSpace__ecere__com__Class * next;
834 unsigned int (* Constructor)(void * );
835 void (* Destructor)(void * );
838 struct __ecereNameSpace__ecere__com__Class * base;
839 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
840 struct __ecereNameSpace__ecere__sys__BinaryTree members;
841 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
842 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
843 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
844 struct __ecereNameSpace__ecere__sys__OldList derivatives;
848 struct __ecereNameSpace__ecere__com__Instance * module;
849 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
850 const char * dataTypeString;
851 struct Type * dataType;
853 int defaultAlignment;
854 void (* Initialize)();
856 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
857 const char * designerClass;
858 unsigned int noExpansion;
859 const char * defaultProperty;
860 unsigned int comRedefinition;
863 unsigned int internalDecl;
865 unsigned int computeSize;
866 short structAlignment;
867 short pointerAlignment;
868 int destructionWatchOffset;
870 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
871 int inheritanceAccess;
872 const char * fullName;
874 struct __ecereNameSpace__ecere__sys__OldList conversions;
875 struct __ecereNameSpace__ecere__sys__OldList templateParams;
876 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
877 struct __ecereNameSpace__ecere__com__Class * templateClass;
878 struct __ecereNameSpace__ecere__sys__OldList templatized;
880 unsigned int isInstanceClass;
881 unsigned int byValueSystemClass;
882 } __attribute__ ((gcc_struct));
884 struct __ecereNameSpace__ecere__com__Application
889 unsigned int isGUIApp;
890 struct __ecereNameSpace__ecere__sys__OldList allModules;
891 char * parsedCommand;
892 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
893 } __attribute__ ((gcc_struct));
895 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
897 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
899 struct __ecereNameSpace__ecere__com__Module
901 struct __ecereNameSpace__ecere__com__Instance * application;
902 struct __ecereNameSpace__ecere__sys__OldList classes;
903 struct __ecereNameSpace__ecere__sys__OldList defines;
904 struct __ecereNameSpace__ecere__sys__OldList functions;
905 struct __ecereNameSpace__ecere__sys__OldList modules;
906 struct __ecereNameSpace__ecere__com__Instance * prev;
907 struct __ecereNameSpace__ecere__com__Instance * next;
913 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
914 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
915 } __attribute__ ((gcc_struct));
917 void __ecereUnregisterModule_firstPass(struct __ecereNameSpace__ecere__com__Instance * module)
922 struct TemplateParameter;
926 struct Specifier * prev;
927 struct Specifier * next;
935 struct ExtDecl * extDecl;
937 struct Symbol * symbol;
938 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
939 struct Specifier * nsSpec;
940 } __attribute__ ((gcc_struct)) __anon1;
943 struct Identifier * id;
944 struct __ecereNameSpace__ecere__sys__OldList * list;
945 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
946 struct __ecereNameSpace__ecere__sys__OldList * definitions;
947 unsigned int addNameSpace;
948 struct Context * ctx;
949 struct ExtDecl * extDeclStruct;
950 } __attribute__ ((gcc_struct)) __anon2;
951 struct Expression * expression;
952 struct Specifier * _class;
953 struct TemplateParameter * templateParameter;
954 } __attribute__ ((gcc_struct)) __anon1;
955 } __attribute__ ((gcc_struct));
964 struct Symbol * _class;
967 struct __ecereNameSpace__ecere__sys__OldList members;
969 } __attribute__ ((gcc_struct)) __anon1;
972 struct Type * returnType;
973 struct __ecereNameSpace__ecere__sys__OldList params;
974 struct Symbol * thisClass;
975 unsigned int staticMethod;
976 struct TemplateParameter * thisClassTemplate;
977 } __attribute__ ((gcc_struct)) __anon2;
980 struct __ecereNameSpace__ecere__com__Method * method;
981 struct __ecereNameSpace__ecere__com__Class * methodClass;
982 struct __ecereNameSpace__ecere__com__Class * usedClass;
983 } __attribute__ ((gcc_struct)) __anon3;
986 struct Type * arrayType;
988 struct Expression * arraySizeExp;
989 unsigned int freeExp;
990 struct Symbol * enumClass;
991 } __attribute__ ((gcc_struct)) __anon4;
993 struct TemplateParameter * templateParameter;
994 } __attribute__ ((gcc_struct)) __anon1;
999 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1000 int classObjectType;
1002 unsigned int offset;
1005 unsigned int isSigned : 1;
1006 unsigned int constant : 1;
1007 unsigned int truth : 1;
1008 unsigned int byReference : 1;
1009 unsigned int extraParam : 1;
1010 unsigned int directClassAccess : 1;
1011 unsigned int computing : 1;
1012 unsigned int keepCast : 1;
1013 unsigned int passAsTemplate : 1;
1014 unsigned int dllExport : 1;
1015 unsigned int attrStdcall : 1;
1016 unsigned int declaredWithStruct : 1;
1017 unsigned int typedByReference : 1;
1018 unsigned int casted : 1;
1019 unsigned int pointerAlignment : 1;
1020 } __attribute__ ((gcc_struct));
1026 struct PropertyDef * prev;
1027 struct PropertyDef * next;
1028 struct Location loc;
1029 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1030 struct Declarator * declarator;
1031 struct Identifier * id;
1032 struct Statement * getStmt;
1033 struct Statement * setStmt;
1034 struct Statement * issetStmt;
1035 struct Symbol * symbol;
1036 struct Expression * category;
1039 unsigned int conversion : 1;
1040 unsigned int isWatchable : 1;
1041 unsigned int isDBProp : 1;
1042 } __attribute__ ((gcc_struct)) __anon1;
1043 } __attribute__ ((gcc_struct));
1045 struct TemplateArgument;
1047 struct TemplateParameter
1049 struct TemplateParameter * prev;
1050 struct TemplateParameter * next;
1051 struct Location loc;
1053 struct Identifier * identifier;
1056 struct TemplateDatatype * dataType;
1058 } __attribute__ ((gcc_struct)) __anon1;
1059 struct TemplateArgument * defaultArgument;
1060 const char * dataTypeString;
1061 struct Type * baseType;
1062 } __attribute__ ((gcc_struct));
1064 struct TemplateArgument
1066 struct TemplateArgument * prev;
1067 struct TemplateArgument * next;
1068 struct Location loc;
1069 struct Identifier * name;
1073 struct Expression * expression;
1074 struct Identifier * identifier;
1075 struct TemplateDatatype * templateDatatype;
1076 } __attribute__ ((gcc_struct)) __anon1;
1077 } __attribute__ ((gcc_struct));
1081 typedef union YYSTYPE
1086 struct Identifier * id;
1087 struct Expression * exp;
1088 struct Specifier * specifier;
1089 struct __ecereNameSpace__ecere__sys__OldList * list;
1090 struct Enumerator * enumerator;
1091 struct Declarator * declarator;
1092 struct Pointer * pointer;
1093 struct Initializer * initializer;
1094 struct InitDeclarator * initDeclarator;
1095 struct TypeName * typeName;
1096 struct Declaration * declaration;
1097 struct Statement * stmt;
1098 struct FunctionDefinition * function;
1099 struct External * external;
1100 struct Context * context;
1101 struct AsmField * asmField;
1102 struct Attrib * attrib;
1103 struct ExtDecl * extDecl;
1104 struct Attribute * attribute;
1105 struct Instantiation * instance;
1106 struct MembersInit * membersInit;
1107 struct MemberInit * memberInit;
1108 struct ClassFunction * classFunction;
1109 struct ClassDefinition * _class;
1110 struct ClassDef * classDef;
1111 struct PropertyDef * prop;
1113 struct Symbol * symbol;
1114 struct PropertyWatch * propertyWatch;
1115 struct TemplateParameter * templateParameter;
1116 struct TemplateArgument * templateArgument;
1117 struct TemplateDatatype * templateDatatype;
1118 struct DBTableEntry * dbtableEntry;
1119 struct DBIndexItem * dbindexItem;
1120 struct DBTableDef * dbtableDef;
1121 } __attribute__ ((gcc_struct)) YYSTYPE;
1123 extern YYSTYPE yylval;
1127 struct ClassDef * prev;
1128 struct ClassDef * next;
1129 struct Location loc;
1133 struct Declaration * decl;
1134 struct ClassFunction * function;
1135 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1136 struct PropertyDef * propertyDef;
1137 struct PropertyWatch * propertyWatch;
1139 struct Identifier * defaultProperty;
1142 struct Identifier * id;
1143 struct Initializer * initializer;
1144 } __attribute__ ((gcc_struct)) __anon1;
1145 } __attribute__ ((gcc_struct)) __anon1;
1148 } __attribute__ ((gcc_struct));
1152 struct Declaration * prev;
1153 struct Declaration * next;
1154 struct Location loc;
1160 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1161 struct __ecereNameSpace__ecere__sys__OldList * declarators;
1162 } __attribute__ ((gcc_struct)) __anon1;
1163 struct Instantiation * inst;
1166 struct Identifier * id;
1167 struct Expression * exp;
1168 } __attribute__ ((gcc_struct)) __anon2;
1169 } __attribute__ ((gcc_struct)) __anon1;
1170 struct Specifier * extStorage;
1171 struct Symbol * symbol;
1173 } __attribute__ ((gcc_struct));
1177 struct External * prev;
1178 struct External * next;
1179 struct Location loc;
1181 struct Symbol * symbol;
1184 struct FunctionDefinition * function;
1185 struct ClassDefinition * _class;
1186 struct Declaration * declaration;
1187 char * importString;
1188 struct Identifier * id;
1189 struct DBTableDef * table;
1190 } __attribute__ ((gcc_struct)) __anon1;
1192 struct External * fwdDecl;
1193 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1194 struct __ecereNameSpace__ecere__com__Instance * incoming;
1195 int nonBreakableIncoming;
1196 } __attribute__ ((gcc_struct));
1198 static void AddDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions)
1200 if(definitions != (((void *)0)))
1202 struct ClassDef * def;
1204 for(def = definitions->first; def; def = def->next)
1208 struct Declaration * decl = def->__anon1.decl;
1209 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
1210 struct Type * dataType;
1214 struct Declarator * d;
1216 if(decl->__anon1.__anon1.declarators)
1218 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1220 struct Identifier * declId = GetDeclId(d);
1224 if(regClass && regClass->type == 2)
1226 struct Expression * sizeExp = (d->type == 0) ? d->__anon1.structDecl.exp : (((void *)0));
1227 struct Expression * posExp = (d->type == 0) ? d->__anon1.structDecl.posExp : (((void *)0));
1228 int bitSize = 0, bitPos = -1;
1229 char dataTypeString[8192];
1231 dataTypeString[0] = (char)0;
1234 ProcessExpressionType(sizeExp);
1235 ComputeExpression(sizeExp);
1236 if(sizeExp->isConstant)
1237 bitSize = strtol(sizeExp->__anon1.__anon1.constant, (((void *)0)), 0);
1238 FreeExpression(sizeExp);
1242 ProcessExpressionType(posExp);
1243 ComputeExpression(posExp);
1244 if(posExp->isConstant)
1245 bitPos = strtol(posExp->__anon1.__anon1.constant, (((void *)0)), 0);
1246 FreeExpression(posExp);
1250 d->__anon1.structDecl.posExp = (((void *)0));
1251 d->__anon1.structDecl.exp = (((void *)0));
1253 dataType = ProcessType(decl->__anon1.__anon1.specifiers, d);
1254 PrintType(dataType, dataTypeString, 0, 1);
1256 struct __ecereNameSpace__ecere__com__BitMember * member = __ecereNameSpace__ecere__com__eClass_AddBitMember(regClass, declId->string, dataTypeString, 0, 0, def->memberAccess);
1260 member->size = bitSize;
1261 member->pos = bitPos;
1263 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)member;
1266 dataMember->dataType = dataType;
1269 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in class %s\n", (((void *)0))), declId->string, regClass->name);
1276 char typeString[8192];
1278 typeString[0] = (char)0;
1279 dataType = ProcessType(decl->__anon1.__anon1.specifiers, d);
1280 PrintType(dataType, typeString, 0, 1);
1283 dataMember = __ecereNameSpace__ecere__com__eMember_AddDataMember(member, declId->string, typeString, 0, 0, def->memberAccess);
1285 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in member %s\n", (((void *)0))), declId->string, member->name);
1289 dataMember = __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, declId->string, typeString, 0, 0, def->memberAccess);
1291 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in class %s\n", (((void *)0))), declId->string, regClass->name);
1294 dataMember->dataType = dataType;
1302 else if(decl->__anon1.__anon1.specifiers)
1304 struct Specifier * spec;
1306 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1308 if(spec->type == 3 || spec->type == 4)
1310 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1312 struct __ecereNameSpace__ecere__com__DataMember * dataMember = __ecereNameSpace__ecere__com__eMember_New((spec->type == 4) ? 1 : 2, def->memberAccess);
1314 AddDefinitions((((void *)0)), dataMember, spec->__anon1.__anon2.definitions);
1317 __ecereNameSpace__ecere__com__eMember_AddMember(member, dataMember);
1321 __ecereNameSpace__ecere__com__eClass_AddMember(regClass, dataMember);
1324 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1327 struct Identifier * id = spec->__anon1.__anon2.id;
1328 char typeString[8192];
1330 typeString[0] = (char)0;
1331 spec->__anon1.__anon2.id = (((void *)0));
1332 decl->__anon1.__anon1.declarators = MkListOne(MkDeclaratorIdentifier(id));
1333 dataType = ProcessType(decl->__anon1.__anon1.specifiers, (((void *)0)));
1334 PrintType(dataType, typeString, 0, 1);
1337 dataMember = __ecereNameSpace__ecere__com__eMember_AddDataMember(member, id->string, typeString, 0, 0, def->memberAccess);
1339 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in member %s\n", (((void *)0))), id->string, member->name);
1343 dataMember = __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, id->string, typeString, 0, 0, def->memberAccess);
1345 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in class %s\n", (((void *)0))), id->string, regClass->name);
1348 dataMember->dataType = dataType;
1357 else if(decl->type == 2)
1359 struct Instantiation * inst = decl->__anon1.inst;
1360 struct Expression * exp = inst->exp;
1364 char * string = exp->__anon1.__anon1.identifier->string;
1367 struct Type * dataType = (dataType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dataType->kind = 8, dataType->__anon1._class = inst->_class->__anon1.__anon1.symbol, dataType->refCount = 1, dataType);
1371 dataMember = __ecereNameSpace__ecere__com__eMember_AddDataMember(member, string, inst->_class->__anon1.__anon1.name, 0, 0, def->memberAccess);
1373 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in member %s\n", (((void *)0))), string, member->name);
1377 dataMember = __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, string, inst->_class->__anon1.__anon1.name, 0, 0, def->memberAccess);
1379 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in class %s\n", (((void *)0))), string, regClass->name);
1382 dataMember->dataType = dataType;
1389 else if(def->type == 3 && def->__anon1.propertyDef)
1391 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
1392 struct __ecereNameSpace__ecere__com__Property * prop;
1393 char * dataTypeString = StringFromSpecDecl(propertyDef->specifiers, propertyDef->declarator);
1395 prop = __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, propertyDef->__anon1.conversion ? (((void *)0)) : propertyDef->id->string, dataTypeString, inCompiler ? propertyDef->setStmt : (((void *)0)), inCompiler ? propertyDef->getStmt : (((void *)0)), def->memberAccess);
1396 (__ecereNameSpace__ecere__com__eSystem_Delete(dataTypeString), dataTypeString = 0);
1400 prop->IsSet = (void *)propertyDef->issetStmt;
1402 prop->symbol = __extension__ ({
1403 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1405 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(propertyDef->symbol->string), __ecereInstance1->type = propertyDef->symbol->type, __ecereInstance1;
1407 ((struct Symbol *)prop->symbol)->propCategory = propertyDef->category;
1408 propertyDef->category = (((void *)0));
1409 if(propertyDef->__anon1.isWatchable)
1410 __ecereNameSpace__ecere__com__eProperty_Watchable(prop);
1412 propertyDef->symbol->__anon1._property = prop;
1413 if(propertyDef->symbol->type)
1414 propertyDef->symbol->type->refCount++;
1416 else if(def->type == 10 && def->__anon1.propertyDef)
1418 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
1419 char * dataTypeString = StringFromSpecDecl(propertyDef->specifiers, propertyDef->declarator);
1421 __ecereNameSpace__ecere__com__eClass_AddClassProperty(regClass, propertyDef->id->string, dataTypeString, inCompiler ? propertyDef->setStmt : (((void *)0)), inCompiler ? propertyDef->getStmt : (((void *)0)));
1422 (__ecereNameSpace__ecere__com__eSystem_Delete(dataTypeString), dataTypeString = 0);
1428 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, int declMode)
1430 struct __ecereNameSpace__ecere__com__Class * regClass;
1431 struct ClassDef * def;
1432 unsigned int redefinition = 0;
1434 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1435 if(regClass && !regClass->internalDecl)
1437 if(symbol->parent || (struct Symbol *)globalContext->classes.root == symbol)
1439 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->classes, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
1440 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), symbol);
1446 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of class %s\n", (((void *)0))), symbol->string);
1452 char baseName[1024] = "";
1453 unsigned int unitType = 0;
1454 unsigned int wouldBeEnum = 0;
1455 int inheritanceAccess = 1;
1457 if(baseSpecs != (((void *)0)))
1459 struct Type * baseType = ProcessType(baseSpecs, (((void *)0)));
1461 PrintType(baseType, baseName, 0, 1);
1462 if(baseType->kind == 8)
1464 if(baseType->__anon1._class->__anon1.registered && classType == 0)
1466 if(baseType->__anon1._class->__anon1.registered->type == 3)
1468 else if(baseType->__anon1._class->__anon1.registered->type == 2)
1470 else if(baseType->__anon1._class->__anon1.registered->type == 5)
1472 else if(baseType->__anon1._class->__anon1.registered->type == 4)
1478 else if(baseType->kind == 9 || baseType->kind == 10)
1486 if(((struct Specifier *)baseSpecs->first)->type == 0 && ((struct Specifier *)baseSpecs->first)->__anon1.specifier == PRIVATE)
1487 inheritanceAccess = 2;
1493 if(definitions != (((void *)0)))
1495 for(def = definitions->first; def; def = def->next)
1499 struct Declaration * decl = def->__anon1.decl;
1508 if(decl->__anon1.__anon1.declarators)
1510 struct Declarator * d;
1512 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1516 if(d->__anon1.structDecl.exp)
1530 if(classType == 0 && wouldBeEnum)
1532 regClass = symbol->__anon1.registered = __ecereNameSpace__ecere__com__eSystem_RegisterClass((classType == 6) ? 1 : classType, symbol->string, baseName[0] ? baseName : (((void *)0)), 0, 0, (((void *)0)), (((void *)0)), privateModule, buildingECERECOMModule ? 4 : declMode, inheritanceAccess);
1534 regClass->symbol = symbol;
1540 struct __ecereNameSpace__ecere__com__DataMember * unionMember = __ecereNameSpace__ecere__com__eMember_New(1, 1);
1542 AddDefinitions(regClass, unionMember, definitions);
1543 __ecereNameSpace__ecere__com__eClass_AddMember(regClass, unionMember);
1546 AddDefinitions(regClass, (((void *)0)), definitions);
1548 if(definitions != (((void *)0)))
1550 for(def = definitions->first; def; def = def->next)
1552 if(def->type == 0 && (def->__anon1.function->isConstructor || def->__anon1.function->isDestructor))
1554 struct Specifier * spec = def->__anon1.function->specifiers ? (*def->__anon1.function->specifiers).last : (((void *)0));
1556 if(!spec || spec->type != 1 || !spec->__anon1.__anon1.name || (strcmp(spec->__anon1.__anon1.name, regClass->name) && (!spec->__anon1.__anon1.symbol || !spec->__anon1.__anon1.symbol->__anon1.registered || strcmp(spec->__anon1.__anon1.symbol->__anon1.registered->name, regClass->name))))
1558 yylloc = def->__anon1.function->loc;
1559 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "wrong class name specified for %s\n", (((void *)0))), def->__anon1.function->isConstructor ? __ecereNameSpace__ecere__GetTranslatedString("ec", "constructor", (((void *)0))) : __ecereNameSpace__ecere__GetTranslatedString("ec", "destructor", (((void *)0))));
1561 FreeList(def->__anon1.function->specifiers, (void *)(FreeSpecifier));
1562 def->__anon1.function->specifiers = (((void *)0));
1564 if(def->type == 0 && def->__anon1.function->declarator)
1566 struct ClassFunction * func = def->__anon1.function;
1568 func->_class = regClass;
1569 if(!redefinition && !func->dontMangle)
1571 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
1572 struct Identifier * id = GetDeclId(funcDecl);
1573 struct __ecereNameSpace__ecere__com__Method * method;
1577 char * typeString = StringFromSpecDecl(func->specifiers, func->declarator);
1579 method = __ecereNameSpace__ecere__com__eClass_AddVirtualMethod(regClass, id->string, typeString, inCompiler ? func->declarator->symbol : (((void *)0)), def->memberAccess);
1580 (__ecereNameSpace__ecere__com__eSystem_Delete(typeString), typeString = 0);
1584 char * typeString = StringFromSpecDecl(func->specifiers, func->declarator);
1586 method = __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, id->string, typeString, inCompiler ? func->declarator->symbol : (((void *)0)), def->memberAccess);
1588 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Redefinition of method %s in class %s\n", (((void *)0))), id->string, regClass->name);
1589 (__ecereNameSpace__ecere__com__eSystem_Delete(typeString), typeString = 0);
1591 if(method && (method->type != 1 || method->_class == regClass))
1593 method->symbol = __extension__ ({
1594 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1596 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(func->declarator->symbol->string), __ecereInstance1->type = func->declarator->symbol->type, __ecereInstance1->__anon1.method = method, __ecereInstance1;
1598 if(func->declarator->symbol->type)
1599 func->declarator->symbol->type->refCount++;
1600 func->declarator->symbol->__anon1.method = method;
1604 func->declarator->symbol->__anon1.method = method;
1610 if(regClass && symbol->templateParams)
1612 struct TemplateParameter * param;
1614 for(param = (*symbol->templateParams).first; param; param = param->next)
1616 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg =
1627 if(param->defaultArgument)
1632 defaultArg.__anon1.__anon1.dataTypeString = StringFromSpecDecl(param->defaultArgument->__anon1.templateDatatype->specifiers, param->defaultArgument->__anon1.templateDatatype->decl);
1636 char memberString[1024];
1638 memberString[0] = '\0';
1639 if(param->defaultArgument->__anon1.identifier->_class)
1641 if(param->defaultArgument->__anon1.identifier->_class->type == 8)
1643 if(param->defaultArgument->__anon1.identifier->_class->__anon1.templateParameter)
1644 strcpy(memberString, param->defaultArgument->__anon1.identifier->_class->__anon1.templateParameter->identifier->string);
1648 if(param->defaultArgument->__anon1.identifier->_class->__anon1.__anon1.name)
1649 strcpy(memberString, param->defaultArgument->__anon1.identifier->_class->__anon1.__anon1.name);
1654 strcat(memberString, "::");
1656 strcat(memberString, param->defaultArgument->__anon1.identifier->string);
1657 defaultArg.__anon1.__anon2.memberString = __ecereNameSpace__ecere__sys__CopyString(memberString);
1664 param->defaultArgument->__anon1.expression->destType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1665 ProcessExpressionType(param->defaultArgument->__anon1.expression);
1666 ComputeExpression(param->defaultArgument->__anon1.expression);
1667 op = GetOperand(param->defaultArgument->__anon1.expression);
1668 defaultArg.__anon1.expression.__anon1.ui64 = op.__anon1.ui64;
1673 if(param->type == 1)
1675 __ecereNameSpace__ecere__com__eClass_AddTemplateParameter(regClass, param->identifier->string, 1, (void *)(uintptr_t)param->__anon1.memberType, &defaultArg);
1679 char * typeString = param->__anon1.dataType ? StringFromSpecDecl(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl) : (((void *)0));
1681 __ecereNameSpace__ecere__com__eClass_AddTemplateParameter(regClass, param->identifier->string, param->type, typeString, &defaultArg);
1682 (__ecereNameSpace__ecere__com__eSystem_Delete(typeString), typeString = 0);
1684 if(param->type == 0 || param->type == 1)
1685 (__ecereNameSpace__ecere__com__eSystem_Delete((void *)defaultArg.__anon1.__anon1.dataTypeString), defaultArg.__anon1.__anon1.dataTypeString = 0);
1687 __ecereNameSpace__ecere__com__eClass_DoneAddingTemplateParameters(regClass);
1691 void PrePreProcessClassDefinitions()
1693 struct External * external, * next;
1695 curExternal = (((void *)0));
1698 for(external = (*ast).first; external; external = next)
1700 next = external->next;
1701 curExternal = external;
1702 if(external->type == 2)
1704 struct ClassDefinition * _class = external->__anon1._class;
1706 if((!_class->symbol->__anon1.registered || !inCompiler))
1708 if(_class->definitions)
1709 _class->symbol->mustRegister = 1;
1710 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), _class->declMode);
1711 _class->symbol->isStatic = _class->declMode == 3;
1714 else if(external->type == 1)
1716 struct Declaration * declaration = external->__anon1.declaration;
1718 if(declaration->type == 1)
1720 if(declaration->__anon1.__anon1.specifiers)
1722 struct Specifier * specifier;
1724 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
1726 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)))
1728 struct Symbol * type = FindType(globalContext, specifier->__anon1.__anon2.id->string);
1729 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
1733 declaration->declMode = 0;
1736 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->classes, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
1737 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), symbol);
1740 else if(symbol && !symbol->__anon1.registered)
1744 if(specifier->type == 2)
1746 else if(specifier->type == 4)
1750 if(specifier->__anon1.__anon2.definitions || specifier->type == 2 || specifier->__anon1.__anon2.baseSpecs)
1751 symbol->mustRegister = 1;
1752 ProcessClass(classType, specifier->__anon1.__anon2.definitions, symbol, specifier->__anon1.__anon2.baseSpecs, specifier->__anon1.__anon2.list, &specifier->loc, ast, external->prev, declaration->__anon1.__anon1.declarators, declaration->declMode);
1753 symbol->isStatic = declaration->declMode == 3;
1760 else if(external->type == 3)
1765 for(external = (*ast).first; external; external = external->next)
1767 if(external->type == 2)
1769 struct ClassDefinition * _class = external->__anon1._class;
1773 struct __ecereNameSpace__ecere__sys__OldLink * link;
1775 for(link = _class->symbol->templatedClasses.first; link; link = link->next)
1777 struct Symbol * symbol = link->data;
1779 symbol->__anon1.registered = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1783 else if(external->type == 1)
1785 struct Declaration * declaration = external->__anon1.declaration;
1787 if(declaration->type == 1)
1789 if(declaration->__anon1.__anon1.specifiers)
1791 struct Specifier * specifier;
1793 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
1795 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)))
1797 struct Symbol * type = FindType(globalContext, specifier->__anon1.__anon2.id->string);
1798 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
1805 struct __ecereNameSpace__ecere__sys__OldLink * link;
1807 for(link = symbol->templatedClasses.first; link; link = link->next)
1809 struct Symbol * tplSymbol = link->data;
1811 tplSymbol->__anon1.registered = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, tplSymbol->string);
1812 tplSymbol->module = symbol->module ? symbol->module : mainModule;
1825 void __ecereRegisterModule_firstPass(struct __ecereNameSpace__ecere__com__Instance * module)
1827 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
1829 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrePreProcessClassDefinitions", "void PrePreProcessClassDefinitions(void)", PrePreProcessClassDefinitions, module, 1);