1 /* Code generated from eC source file: pass0.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 # if defined(__GNUC__) || defined(__TINYC__)
40 # define stdcall __attribute__((__stdcall__))
42 # define stdcall __stdcall
48 #include <sys/types.h>
51 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372, WIDE_STRING_LITERAL = 373
54 extern unsigned int inCompiler;
58 extern int structDeclMode;
60 extern const char * sourceFile;
62 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
64 struct __ecereNameSpace__ecere__sys__OldList
71 } __attribute__ ((gcc_struct));
73 struct __ecereNameSpace__ecere__sys__BTNode;
75 struct __ecereNameSpace__ecere__com__DataValue
90 } __attribute__ ((gcc_struct)) __anon1;
91 } __attribute__ ((gcc_struct));
93 struct __ecereNameSpace__ecere__com__SerialBuffer
95 unsigned char * _buffer;
99 } __attribute__ ((gcc_struct));
101 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
103 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
105 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
107 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
109 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
115 struct InitDeclarator;
125 struct PropertyWatch;
127 struct TemplateParameter;
129 struct TemplateArgument;
131 struct TemplateDatatype;
145 } __attribute__ ((gcc_struct));
147 extern char * strcat(char * , const char * );
149 extern size_t strlen(const char * );
151 extern int strncmp(const char * , const char * , size_t n);
157 extern void Compiler_Error(const char * format, ...);
159 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
161 struct __ecereNameSpace__ecere__com__LinkList
166 } __attribute__ ((gcc_struct));
168 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
170 extern char * strcpy(char * , const char * );
172 struct __ecereNameSpace__ecere__com__LinkElement
176 } __attribute__ ((gcc_struct));
178 extern char * strstr(const char * , const char * );
180 extern void Compiler_Warning(const char * format, ...);
182 extern int sprintf(char * , const char * , ...);
184 struct __ecereNameSpace__ecere__com__GlobalFunction;
186 struct __ecereNameSpace__ecere__com__IteratorPointer;
188 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
190 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
192 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
194 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
196 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
198 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
200 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
202 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
204 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
206 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
208 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
210 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
212 extern void FreeInitDeclarator(struct InitDeclarator * decl);
214 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList * attribs);
216 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
220 struct CodePosition start;
221 struct CodePosition end;
222 } __attribute__ ((gcc_struct));
224 void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams)
230 for(c = 0; (ch = className[c]) && ch != '<'; c++)
234 strcat(output, "__ecereNameSpace__");
238 len = strlen(output);
240 if(!strncmp(className, "const ", 6))
242 for(; (ch = className[c]); c++)
266 if(!includeTemplateParams)
268 if(!strncmp(className + c + 1, "const ", 6))
282 if(!strncmp(className + c + 1, "const ", 6))
289 output[len++] = (char)0;
292 extern struct Location yylloc;
296 extern struct External * curExternal;
300 struct __ecereNameSpace__ecere__com__LinkElement in;
301 struct __ecereNameSpace__ecere__com__LinkElement out;
302 struct External * from;
303 struct External * to;
304 unsigned int breakable;
305 } __attribute__ ((gcc_struct));
307 extern void FreeExternal(struct External * external);
309 extern struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference);
313 extern struct Context * PushContext(void);
315 extern void PopContext(struct Context * ctx);
317 extern struct Context * curContext;
319 struct __ecereNameSpace__ecere__com__Class;
321 struct __ecereNameSpace__ecere__com__Instance
324 struct __ecereNameSpace__ecere__com__Class * _class;
326 } __attribute__ ((gcc_struct));
328 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
330 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
332 extern int AddMembers(struct External * neededBy, struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int * addedPadding);
334 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
336 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
338 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
340 int __ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext;
342 struct __ecereNameSpace__ecere__com__Property;
344 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
346 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
348 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
350 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
352 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_AddProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * dataType, void * setStmt, void * getStmt, int declMode);
356 extern void FreeDeclarator(struct Declarator * decl);
358 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
360 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
362 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
364 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
366 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
368 struct __ecereNameSpace__ecere__com__BTNamedLink;
370 struct __ecereNameSpace__ecere__com__BTNamedLink
373 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
374 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
375 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
378 } __attribute__ ((gcc_struct));
382 extern struct Symbol * FindClass(const char * name);
386 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
388 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
392 extern struct Specifier * MkSpecifierName(const char * name);
394 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
396 extern void FreeSpecifier(struct Specifier * spec);
398 extern struct Specifier * MkSpecifier(int specifier);
400 extern struct Specifier * CopySpecifier(struct Specifier * spec);
402 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
406 extern struct Identifier * GetDeclId(struct Declarator * decl);
410 struct Identifier * prev;
411 struct Identifier * next;
413 struct Symbol * classSym;
414 struct Specifier * _class;
416 struct Identifier * badID;
417 } __attribute__ ((gcc_struct));
419 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
421 extern struct Identifier * MkIdentifier(const char * string);
423 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
429 struct Specifier * prev;
430 struct Specifier * next;
438 struct ExtDecl * extDecl;
440 struct Symbol * symbol;
441 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
442 struct Specifier * nsSpec;
443 } __attribute__ ((gcc_struct)) __anon1;
446 struct Identifier * id;
447 struct __ecereNameSpace__ecere__sys__OldList * list;
448 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
449 struct __ecereNameSpace__ecere__sys__OldList * definitions;
450 unsigned int addNameSpace;
451 struct Context * ctx;
452 struct ExtDecl * extDeclStruct;
453 } __attribute__ ((gcc_struct)) __anon2;
454 struct Expression * expression;
455 struct Specifier * _class;
456 struct TemplateParameter * templateParameter;
457 } __attribute__ ((gcc_struct)) __anon1;
458 } __attribute__ ((gcc_struct));
462 struct Declarator * prev;
463 struct Declarator * next;
466 struct Symbol * symbol;
467 struct Declarator * declarator;
470 struct Identifier * identifier;
473 struct Expression * exp;
474 struct Expression * posExp;
475 struct Attrib * attrib;
476 } __attribute__ ((gcc_struct)) structDecl;
479 struct Expression * exp;
480 struct Specifier * enumClass;
481 } __attribute__ ((gcc_struct)) array;
484 struct __ecereNameSpace__ecere__sys__OldList * parameters;
485 } __attribute__ ((gcc_struct)) function;
488 struct Pointer * pointer;
489 } __attribute__ ((gcc_struct)) pointer;
492 struct ExtDecl * extended;
493 } __attribute__ ((gcc_struct)) extended;
494 } __attribute__ ((gcc_struct)) __anon1;
495 } __attribute__ ((gcc_struct));
497 extern struct Expression * QMkExpId(const char * id);
499 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
501 extern struct Expression * CopyExpression(struct Expression * exp);
503 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
505 extern struct Expression * MkExpIdentifier(struct Identifier * id);
507 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
509 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
513 struct __ecereNameSpace__ecere__com__Property
515 struct __ecereNameSpace__ecere__com__Property * prev;
516 struct __ecereNameSpace__ecere__com__Property * next;
518 unsigned int isProperty;
521 struct __ecereNameSpace__ecere__com__Class * _class;
522 const char * dataTypeString;
523 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
524 struct Type * dataType;
525 void (* Set)(void * , int);
526 int (* Get)(void * );
527 unsigned int (* IsSet)(void * );
531 unsigned int conversion;
532 unsigned int watcherOffset;
533 const char * category;
534 unsigned int compiled;
535 unsigned int selfWatchable;
536 unsigned int isWatchable;
537 } __attribute__ ((gcc_struct));
539 extern struct Type * MkClassType(const char * name);
541 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
543 extern void FreeType(struct Type * type);
545 struct ClassFunction;
547 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
553 struct Initializer * prev;
554 struct Initializer * next;
559 struct Expression * exp;
560 struct __ecereNameSpace__ecere__sys__OldList * list;
561 } __attribute__ ((gcc_struct)) __anon1;
562 unsigned int isConstant;
563 struct Identifier * id;
564 } __attribute__ ((gcc_struct));
566 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
568 extern void FreeInitializer(struct Initializer * initializer);
570 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
572 struct __ecereNameSpace__ecere__com__Method;
574 struct __ecereNameSpace__ecere__com__Method
577 struct __ecereNameSpace__ecere__com__Method * parent;
578 struct __ecereNameSpace__ecere__com__Method * left;
579 struct __ecereNameSpace__ecere__com__Method * right;
584 struct __ecereNameSpace__ecere__com__Class * _class;
586 const char * dataTypeString;
587 struct Type * dataType;
589 } __attribute__ ((gcc_struct));
594 struct Symbol * parent;
595 struct Symbol * left;
596 struct Symbol * right;
601 struct __ecereNameSpace__ecere__com__Method * method;
602 struct __ecereNameSpace__ecere__com__Property * _property;
603 struct __ecereNameSpace__ecere__com__Class * registered;
604 } __attribute__ ((gcc_struct)) __anon1;
605 unsigned int notYetDeclared;
610 struct External * pointerExternal;
611 struct External * structExternal;
612 } __attribute__ ((gcc_struct)) __anon1;
615 struct External * externalGet;
616 struct External * externalSet;
617 struct External * externalPtr;
618 struct External * externalIsSet;
619 } __attribute__ ((gcc_struct)) __anon2;
622 struct External * methodExternal;
623 struct External * methodCodeExternal;
624 } __attribute__ ((gcc_struct)) __anon3;
625 } __attribute__ ((gcc_struct)) __anon2;
626 unsigned int imported;
627 unsigned int declaredStructSym;
628 struct __ecereNameSpace__ecere__com__Class * _class;
629 unsigned int declaredStruct;
630 unsigned int needConstructor;
631 unsigned int needDestructor;
632 char * constructorName;
635 char * destructorName;
636 struct ModuleImport * module;
637 struct ClassImport * _import;
638 struct Location nameLoc;
639 unsigned int isParam;
640 unsigned int isRemote;
641 unsigned int isStruct;
642 unsigned int fireWatchersDone;
644 unsigned int classData;
645 unsigned int isStatic;
647 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
648 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
649 struct Context * ctx;
651 struct Expression * propCategory;
652 unsigned int mustRegister;
653 } __attribute__ ((gcc_struct));
662 struct Symbol * _class;
665 struct __ecereNameSpace__ecere__sys__OldList members;
667 } __attribute__ ((gcc_struct)) __anon1;
670 struct Type * returnType;
671 struct __ecereNameSpace__ecere__sys__OldList params;
672 struct Symbol * thisClass;
673 unsigned int staticMethod;
674 struct TemplateParameter * thisClassTemplate;
675 } __attribute__ ((gcc_struct)) __anon2;
678 struct __ecereNameSpace__ecere__com__Method * method;
679 struct __ecereNameSpace__ecere__com__Class * methodClass;
680 struct __ecereNameSpace__ecere__com__Class * usedClass;
681 } __attribute__ ((gcc_struct)) __anon3;
684 struct Type * arrayType;
686 struct Expression * arraySizeExp;
687 unsigned int freeExp;
688 struct Symbol * enumClass;
689 } __attribute__ ((gcc_struct)) __anon4;
691 struct TemplateParameter * templateParameter;
692 } __attribute__ ((gcc_struct)) __anon1;
697 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
703 unsigned int isSigned : 1;
704 unsigned int constant : 1;
705 unsigned int truth : 1;
706 unsigned int byReference : 1;
707 unsigned int extraParam : 1;
708 unsigned int directClassAccess : 1;
709 unsigned int computing : 1;
710 unsigned int keepCast : 1;
711 unsigned int passAsTemplate : 1;
712 unsigned int dllExport : 1;
713 unsigned int attrStdcall : 1;
714 unsigned int declaredWithStruct : 1;
715 unsigned int typedByReference : 1;
716 unsigned int casted : 1;
717 unsigned int pointerAlignment : 1;
718 unsigned int isLong : 1;
719 } __attribute__ ((gcc_struct));
721 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, void * function, int declMode);
723 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
725 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
731 struct ClassFunction * prev;
732 struct ClassFunction * next;
734 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
735 struct Declarator * declarator;
736 struct __ecereNameSpace__ecere__sys__OldList * declarations;
737 struct Statement * body;
738 struct __ecereNameSpace__ecere__com__Class * _class;
739 struct __ecereNameSpace__ecere__sys__OldList attached;
742 struct Symbol * propSet;
743 unsigned int isVirtual;
744 unsigned int isConstructor;
745 unsigned int isDestructor;
746 unsigned int dontMangle;
749 } __attribute__ ((gcc_struct));
753 struct Statement * prev;
754 struct Statement * next;
759 struct __ecereNameSpace__ecere__sys__OldList * expressions;
762 struct Identifier * id;
763 struct Statement * stmt;
764 } __attribute__ ((gcc_struct)) labeled;
767 struct Expression * exp;
768 struct Statement * stmt;
769 } __attribute__ ((gcc_struct)) caseStmt;
772 struct __ecereNameSpace__ecere__sys__OldList * declarations;
773 struct __ecereNameSpace__ecere__sys__OldList * statements;
774 struct Context * context;
775 unsigned int isSwitch;
776 } __attribute__ ((gcc_struct)) compound;
779 struct __ecereNameSpace__ecere__sys__OldList * exp;
780 struct Statement * stmt;
781 struct Statement * elseStmt;
782 } __attribute__ ((gcc_struct)) ifStmt;
785 struct __ecereNameSpace__ecere__sys__OldList * exp;
786 struct Statement * stmt;
787 } __attribute__ ((gcc_struct)) switchStmt;
790 struct __ecereNameSpace__ecere__sys__OldList * exp;
791 struct Statement * stmt;
792 } __attribute__ ((gcc_struct)) whileStmt;
795 struct __ecereNameSpace__ecere__sys__OldList * exp;
796 struct Statement * stmt;
797 } __attribute__ ((gcc_struct)) doWhile;
800 struct Statement * init;
801 struct Statement * check;
802 struct __ecereNameSpace__ecere__sys__OldList * increment;
803 struct Statement * stmt;
804 } __attribute__ ((gcc_struct)) forStmt;
807 struct Identifier * id;
808 } __attribute__ ((gcc_struct)) gotoStmt;
811 struct Specifier * spec;
813 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
814 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
815 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
816 } __attribute__ ((gcc_struct)) asmStmt;
819 struct Expression * watcher;
820 struct Expression * object;
821 struct __ecereNameSpace__ecere__sys__OldList * watches;
822 } __attribute__ ((gcc_struct)) _watch;
825 struct Identifier * id;
826 struct __ecereNameSpace__ecere__sys__OldList * exp;
827 struct __ecereNameSpace__ecere__sys__OldList * filter;
828 struct Statement * stmt;
829 } __attribute__ ((gcc_struct)) forEachStmt;
830 struct Declaration * decl;
831 } __attribute__ ((gcc_struct)) __anon1;
832 } __attribute__ ((gcc_struct));
834 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
836 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
838 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
840 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
842 struct __ecereNameSpace__ecere__sys__BinaryTree;
844 struct __ecereNameSpace__ecere__sys__BinaryTree
846 struct __ecereNameSpace__ecere__sys__BTNode * root;
848 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
849 void (* FreeKey)(void * key);
850 } __attribute__ ((gcc_struct));
852 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
854 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
856 struct __ecereNameSpace__ecere__com__DataMember;
858 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
864 const char * dataTypeString;
865 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
866 } __attribute__ ((gcc_struct)) __anon1;
867 struct __ecereNameSpace__ecere__com__DataValue expression;
870 const char * memberString;
873 struct __ecereNameSpace__ecere__com__DataMember * member;
874 struct __ecereNameSpace__ecere__com__Property * prop;
875 struct __ecereNameSpace__ecere__com__Method * method;
876 } __attribute__ ((gcc_struct)) __anon1;
877 } __attribute__ ((gcc_struct)) __anon2;
878 } __attribute__ ((gcc_struct)) __anon1;
879 } __attribute__ ((gcc_struct));
881 struct __ecereNameSpace__ecere__com__DataMember
883 struct __ecereNameSpace__ecere__com__DataMember * prev;
884 struct __ecereNameSpace__ecere__com__DataMember * next;
886 unsigned int isProperty;
889 struct __ecereNameSpace__ecere__com__Class * _class;
890 const char * dataTypeString;
891 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
892 struct Type * dataType;
896 struct __ecereNameSpace__ecere__sys__OldList members;
897 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
899 short structAlignment;
900 short pointerAlignment;
901 } __attribute__ ((gcc_struct));
903 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, unsigned int size, unsigned int alignment, int declMode);
905 struct __ecereNameSpace__ecere__com__Module;
907 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
909 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
911 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
915 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
917 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
919 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char * name, const char * type, void * func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
925 struct TypeName * prev;
926 struct TypeName * next;
928 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
929 struct Declarator * declarator;
931 struct Expression * bitCount;
932 } __attribute__ ((gcc_struct));
934 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
936 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
940 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
942 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
944 struct ClassDefinition;
948 struct Context * parent;
949 struct __ecereNameSpace__ecere__sys__BinaryTree types;
950 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
951 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
952 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
955 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
956 struct ClassDefinition * classDef;
957 unsigned int templateTypesOnly;
958 unsigned int hasNameSpace;
959 } __attribute__ ((gcc_struct));
961 struct ClassDefinition
963 struct ClassDefinition * prev;
964 struct ClassDefinition * next;
966 struct Specifier * _class;
967 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
968 struct __ecereNameSpace__ecere__sys__OldList * definitions;
969 struct Symbol * symbol;
970 struct Location blockStart;
971 struct Location nameLoc;
973 unsigned int deleteWatchable;
974 } __attribute__ ((gcc_struct));
976 struct Instantiation;
980 struct Expression * prev;
981 struct Expression * next;
989 struct Identifier * identifier;
990 } __attribute__ ((gcc_struct)) __anon1;
991 struct Statement * compound;
992 struct Instantiation * instance;
996 unsigned int intlString;
997 unsigned int wideString;
998 } __attribute__ ((gcc_struct)) __anon2;
999 struct __ecereNameSpace__ecere__sys__OldList * list;
1002 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1003 struct Declarator * decl;
1004 } __attribute__ ((gcc_struct)) _classExp;
1007 struct Identifier * id;
1008 } __attribute__ ((gcc_struct)) classData;
1011 struct Expression * exp;
1012 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1013 struct Location argLoc;
1014 } __attribute__ ((gcc_struct)) call;
1017 struct Expression * exp;
1018 struct __ecereNameSpace__ecere__sys__OldList * index;
1019 } __attribute__ ((gcc_struct)) index;
1022 struct Expression * exp;
1023 struct Identifier * member;
1025 unsigned int thisPtr;
1026 } __attribute__ ((gcc_struct)) member;
1030 struct Expression * exp1;
1031 struct Expression * exp2;
1032 } __attribute__ ((gcc_struct)) op;
1033 struct TypeName * typeName;
1034 struct Specifier * _class;
1037 struct TypeName * typeName;
1038 struct Expression * exp;
1039 } __attribute__ ((gcc_struct)) cast;
1042 struct Expression * cond;
1043 struct __ecereNameSpace__ecere__sys__OldList * exp;
1044 struct Expression * elseExp;
1045 } __attribute__ ((gcc_struct)) cond;
1048 struct TypeName * typeName;
1049 struct Expression * size;
1050 } __attribute__ ((gcc_struct)) _new;
1053 struct TypeName * typeName;
1054 struct Expression * size;
1055 struct Expression * exp;
1056 } __attribute__ ((gcc_struct)) _renew;
1060 struct Identifier * id;
1061 } __attribute__ ((gcc_struct)) db;
1064 struct Expression * ds;
1065 struct Expression * name;
1066 } __attribute__ ((gcc_struct)) dbopen;
1069 struct TypeName * typeName;
1070 struct Initializer * initializer;
1071 } __attribute__ ((gcc_struct)) initializer;
1074 struct Expression * exp;
1075 struct TypeName * typeName;
1076 } __attribute__ ((gcc_struct)) vaArg;
1077 } __attribute__ ((gcc_struct)) __anon1;
1078 unsigned int debugValue;
1079 struct __ecereNameSpace__ecere__com__DataValue val;
1081 unsigned int hasAddress;
1082 struct Type * expType;
1083 struct Type * destType;
1086 unsigned int byReference;
1087 unsigned int isConstant;
1088 unsigned int addedThis;
1089 unsigned int needCast;
1090 unsigned int thisPtr;
1091 unsigned int opDestType;
1092 unsigned int needTemplateCast;
1093 } __attribute__ ((gcc_struct));
1095 struct Instantiation
1097 struct Instantiation * prev;
1098 struct Instantiation * next;
1099 struct Location loc;
1100 struct Specifier * _class;
1101 struct Expression * exp;
1102 struct __ecereNameSpace__ecere__sys__OldList * members;
1103 struct Symbol * symbol;
1104 unsigned int fullSet;
1105 unsigned int isConstant;
1106 unsigned char * data;
1107 struct Location nameLoc;
1108 struct Location insideLoc;
1110 } __attribute__ ((gcc_struct));
1114 struct Declaration * prev;
1115 struct Declaration * next;
1116 struct Location loc;
1122 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1123 struct __ecereNameSpace__ecere__sys__OldList * declarators;
1124 } __attribute__ ((gcc_struct)) __anon1;
1125 struct Instantiation * inst;
1128 struct Identifier * id;
1129 struct Expression * exp;
1130 } __attribute__ ((gcc_struct)) __anon2;
1131 } __attribute__ ((gcc_struct)) __anon1;
1132 struct Specifier * extStorage;
1133 struct Symbol * symbol;
1135 } __attribute__ ((gcc_struct));
1137 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1143 struct MembersInit * prev;
1144 struct MembersInit * next;
1145 struct Location loc;
1149 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1150 struct ClassFunction * function;
1151 } __attribute__ ((gcc_struct)) __anon1;
1152 } __attribute__ ((gcc_struct));
1158 struct MemberInit * prev;
1159 struct MemberInit * next;
1160 struct Location loc;
1161 struct Location realLoc;
1162 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1163 struct Initializer * initializer;
1165 unsigned int variable;
1166 unsigned int takeOutExp;
1167 } __attribute__ ((gcc_struct));
1169 static void CheckPublicExpression(struct Expression * exp, int access);
1171 static void CheckPublicInitializer(struct Initializer * init, int access)
1176 CheckPublicExpression(init->__anon1.exp, access);
1180 struct Initializer * i;
1182 for(i = (*init->__anon1.list).first; i; i = i->next)
1183 CheckPublicInitializer(i, access);
1189 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word);
1191 static void CheckPublicTypeName(struct TypeName * type, int access)
1193 if(type->qualifiers)
1195 struct Specifier * spec;
1197 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1201 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1203 CheckPublicClass(classSym, access, "define");
1209 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1217 CheckPublicClass(type->__anon1._class, access, word);
1227 struct Type * param;
1229 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1230 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1231 CheckPublicDataType(param, access, word);
1232 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1236 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1237 if(type->__anon1.__anon4.enumClass)
1238 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1242 CheckPublicDataType(type->__anon1.type, access, word);
1251 CheckPublicClass(type->__anon1._class, access, word);
1258 static void CheckPublicExpression(struct Expression * exp, int access)
1271 if(exp->__anon1.op.exp1)
1272 CheckPublicExpression(exp->__anon1.op.exp1, access);
1273 if(exp->__anon1.op.exp2)
1274 CheckPublicExpression(exp->__anon1.op.exp2, access);
1278 struct Expression * e;
1280 for(e = (*exp->__anon1.list).first; e; e = e->next)
1281 CheckPublicExpression(e, access);
1286 struct Expression * e;
1288 CheckPublicExpression(exp->__anon1.index.exp, access);
1289 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1290 CheckPublicExpression(e, access);
1295 struct Expression * e;
1297 CheckPublicExpression(exp->__anon1.call.exp, access);
1298 if(exp->__anon1.call.arguments)
1300 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1301 CheckPublicExpression(e, access);
1307 CheckPublicExpression(exp->__anon1.member.exp, access);
1312 CheckPublicExpression(exp->__anon1.member.exp, access);
1316 CheckPublicTypeName(exp->__anon1.typeName, access);
1320 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1321 if(exp->__anon1.cast.exp)
1322 CheckPublicExpression(exp->__anon1.cast.exp, access);
1327 struct Expression * e;
1329 CheckPublicExpression(exp->__anon1.cond.cond, access);
1330 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1331 CheckPublicExpression(e, access);
1332 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1337 CheckPublicExpression(exp->__anon1._new.size, access);
1341 CheckPublicExpression(exp->__anon1._renew.size, access);
1342 CheckPublicExpression(exp->__anon1._renew.exp, access);
1346 struct MembersInit * members;
1348 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1349 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1351 if(members->type == 0)
1353 struct MemberInit * member;
1355 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1357 CheckPublicInitializer(member->initializer, access);
1371 struct ClassDef * prev;
1372 struct ClassDef * next;
1373 struct Location loc;
1377 struct Declaration * decl;
1378 struct ClassFunction * function;
1379 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1380 struct PropertyDef * propertyDef;
1381 struct PropertyWatch * propertyWatch;
1383 struct Identifier * defaultProperty;
1386 struct Identifier * id;
1387 struct Initializer * initializer;
1388 } __attribute__ ((gcc_struct)) __anon1;
1389 } __attribute__ ((gcc_struct)) __anon1;
1392 } __attribute__ ((gcc_struct));
1396 struct PropertyDef * prev;
1397 struct PropertyDef * next;
1398 struct Location loc;
1399 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1400 struct Declarator * declarator;
1401 struct Identifier * id;
1402 struct Statement * getStmt;
1403 struct Statement * setStmt;
1404 struct Statement * issetStmt;
1405 struct Symbol * symbol;
1406 struct Expression * category;
1409 unsigned int conversion : 1;
1410 unsigned int isWatchable : 1;
1411 unsigned int isDBProp : 1;
1412 } __attribute__ ((gcc_struct)) __anon1;
1413 } __attribute__ ((gcc_struct));
1415 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1417 if(definitions != (((void *)0)))
1419 struct ClassDef * def;
1421 for(def = definitions->first; def; def = def->next)
1425 struct Declaration * decl = def->__anon1.decl;
1426 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1431 struct Declarator * d;
1433 if(decl->__anon1.__anon1.declarators)
1435 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1437 struct Identifier * declId = GetDeclId(d);
1443 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1445 dataMember = link ? link->data : (((void *)0));
1448 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1450 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1454 else if(decl->__anon1.__anon1.specifiers)
1456 struct Specifier * spec;
1458 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1460 if(spec->type == 3 || spec->type == 4)
1462 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1464 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1466 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1470 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1472 dataMember = link ? link->data : (((void *)0));
1475 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1477 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1483 else if(decl->type == 2)
1485 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1492 struct FunctionDefinition;
1494 typedef union YYSTYPE
1499 struct Identifier * id;
1500 struct Expression * exp;
1501 struct Specifier * specifier;
1502 struct __ecereNameSpace__ecere__sys__OldList * list;
1503 struct Enumerator * enumerator;
1504 struct Declarator * declarator;
1505 struct Pointer * pointer;
1506 struct Initializer * initializer;
1507 struct InitDeclarator * initDeclarator;
1508 struct TypeName * typeName;
1509 struct Declaration * declaration;
1510 struct Statement * stmt;
1511 struct FunctionDefinition * function;
1512 struct External * external;
1513 struct Context * context;
1514 struct AsmField * asmField;
1515 struct Attrib * attrib;
1516 struct ExtDecl * extDecl;
1517 struct Attribute * attribute;
1518 struct Instantiation * instance;
1519 struct MembersInit * membersInit;
1520 struct MemberInit * memberInit;
1521 struct ClassFunction * classFunction;
1522 struct ClassDefinition * _class;
1523 struct ClassDef * classDef;
1524 struct PropertyDef * prop;
1526 struct Symbol * symbol;
1527 struct PropertyWatch * propertyWatch;
1528 struct TemplateParameter * templateParameter;
1529 struct TemplateArgument * templateArgument;
1530 struct TemplateDatatype * templateDatatype;
1531 struct DBTableEntry * dbtableEntry;
1532 struct DBIndexItem * dbindexItem;
1533 struct DBTableDef * dbtableDef;
1534 } __attribute__ ((gcc_struct)) YYSTYPE;
1536 extern YYSTYPE yylval;
1540 struct External * prev;
1541 struct External * next;
1542 struct Location loc;
1544 struct Symbol * symbol;
1547 struct FunctionDefinition * function;
1548 struct ClassDefinition * _class;
1549 struct Declaration * declaration;
1550 char * importString;
1551 struct Identifier * id;
1552 struct DBTableDef * table;
1553 } __attribute__ ((gcc_struct)) __anon1;
1555 struct External * fwdDecl;
1556 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1557 struct __ecereNameSpace__ecere__com__Instance * incoming;
1558 int nonBreakableIncoming;
1559 } __attribute__ ((gcc_struct));
1561 struct FunctionDefinition
1563 struct FunctionDefinition * prev;
1564 struct FunctionDefinition * next;
1565 struct Location loc;
1566 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1567 struct Declarator * declarator;
1568 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1569 struct Statement * body;
1570 struct __ecereNameSpace__ecere__com__Class * _class;
1571 struct __ecereNameSpace__ecere__sys__OldList attached;
1574 struct Symbol * propSet;
1576 unsigned int propertyNoThis;
1577 } __attribute__ ((gcc_struct));
1579 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
1581 struct __ecereNameSpace__ecere__com__NameSpace;
1583 struct __ecereNameSpace__ecere__com__NameSpace
1586 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1587 struct __ecereNameSpace__ecere__com__NameSpace * left;
1588 struct __ecereNameSpace__ecere__com__NameSpace * right;
1590 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1591 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1592 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1593 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1594 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1595 } __attribute__ ((gcc_struct));
1597 struct __ecereNameSpace__ecere__com__Class
1599 struct __ecereNameSpace__ecere__com__Class * prev;
1600 struct __ecereNameSpace__ecere__com__Class * next;
1606 unsigned int (* Constructor)(void * );
1607 void (* Destructor)(void * );
1610 struct __ecereNameSpace__ecere__com__Class * base;
1611 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1612 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1613 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1614 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1615 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1616 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1620 struct __ecereNameSpace__ecere__com__Instance * module;
1621 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1622 const char * dataTypeString;
1623 struct Type * dataType;
1625 int defaultAlignment;
1626 void (* Initialize)();
1628 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1629 const char * designerClass;
1630 unsigned int noExpansion;
1631 const char * defaultProperty;
1632 unsigned int comRedefinition;
1635 unsigned int internalDecl;
1637 unsigned int computeSize;
1638 short structAlignment;
1639 short pointerAlignment;
1640 int destructionWatchOffset;
1642 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1643 int inheritanceAccess;
1644 const char * fullName;
1646 struct __ecereNameSpace__ecere__sys__OldList conversions;
1647 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1648 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1649 struct __ecereNameSpace__ecere__com__Class * templateClass;
1650 struct __ecereNameSpace__ecere__sys__OldList templatized;
1652 unsigned int isInstanceClass;
1653 unsigned int byValueSystemClass;
1654 } __attribute__ ((gcc_struct));
1656 struct __ecereNameSpace__ecere__com__Application
1659 const char * * argv;
1661 unsigned int isGUIApp;
1662 struct __ecereNameSpace__ecere__sys__OldList allModules;
1663 char * parsedCommand;
1664 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1665 } __attribute__ ((gcc_struct));
1667 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1671 else if((*ns).parent)
1672 return NameSpaceContained((*ns).parent, parent);
1677 static void AddSimpleBaseMembers(struct External * external, struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1679 if(_class->type != 1000)
1680 AddMembers(external, list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1683 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
1685 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
1687 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1689 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1691 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
1693 struct __ecereNameSpace__ecere__com__Module
1695 struct __ecereNameSpace__ecere__com__Instance * application;
1696 struct __ecereNameSpace__ecere__sys__OldList classes;
1697 struct __ecereNameSpace__ecere__sys__OldList defines;
1698 struct __ecereNameSpace__ecere__sys__OldList functions;
1699 struct __ecereNameSpace__ecere__sys__OldList modules;
1700 struct __ecereNameSpace__ecere__com__Instance * prev;
1701 struct __ecereNameSpace__ecere__com__Instance * next;
1707 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1708 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1709 } __attribute__ ((gcc_struct));
1711 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
1716 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1718 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1722 if(regClass->templateClass)
1723 regClass = regClass->templateClass;
1724 if(classSym->isStatic && access != 3)
1726 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1728 else if(access == 1)
1730 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application + sizeof(struct __ecereNameSpace__ecere__com__Module) + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->systemNameSpace))
1732 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1733 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1739 static void ProcessClass(int classType, struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol, struct __ecereNameSpace__ecere__sys__OldList * baseSpecs, struct __ecereNameSpace__ecere__sys__OldList * enumValues, struct Location * loc, struct __ecereNameSpace__ecere__sys__OldList * defs, void * after, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators, struct ExtDecl * extDecl)
1741 char structName[1024];
1742 char className[1024];
1743 char constructorName[1024];
1744 char destructorName[1024];
1745 struct __ecereNameSpace__ecere__com__Class * regClass;
1746 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1747 unsigned int isUnion = classType == 6;
1748 struct External * external = (((void *)0));
1749 struct ClassDef * def;
1750 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1751 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1756 classDataList = MkList();
1758 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1761 classType = regClass->type;
1765 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && regClass->inheritanceAccess == 1)
1767 if(!regClass->base->symbol)
1768 regClass->base->symbol = FindClass(regClass->base->fullName);
1769 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1771 else if(!symbol->isStatic && regClass->base)
1773 if(!regClass->base->symbol)
1774 regClass->base->symbol = FindClass(regClass->base->fullName);
1775 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1778 if(definitions != (((void *)0)))
1780 for(def = definitions->first; def; def = def->next)
1784 struct __ecereNameSpace__ecere__com__DataMember * member;
1785 struct __ecereNameSpace__ecere__com__Property * prop;
1786 struct __ecereNameSpace__ecere__com__Method * method;
1788 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1790 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1792 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1794 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1796 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1798 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1803 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1810 external = MkExternalDeclaration((((void *)0)));
1811 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1812 curExternal = external;
1813 curExternal->symbol = symbol;
1815 if((classType == 1 || classType == 5) && inCompiler)
1817 AddSimpleBaseMembers(external, list, regClass->base, regClass);
1819 if(definitions != (((void *)0)))
1823 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
1824 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1825 else if(!symbol->isStatic)
1826 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1828 for(def = definitions->first; def; def = def->next)
1833 struct Declaration * decl = def->__anon1.decl;
1838 if(inCompiler && classType != 2)
1840 ListAdd(list, MkClassDefDeclaration(decl));
1841 def->__anon1.decl = (((void *)0));
1844 else if(decl->type == 2)
1846 struct Instantiation * inst = decl->__anon1.inst;
1847 struct Expression * exp = inst->exp;
1848 struct Symbol * classSym;
1852 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1853 struct Declarator * d;
1855 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1856 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1859 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1861 ListAdd(declarators, d);
1862 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1863 ListAdd(list, MkClassDefDeclaration(decl));
1865 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1866 exp->__anon1.member.exp = QMkExpId("this");
1867 exp->__anon1.member.memberType = 3;
1868 exp->__anon1.member.thisPtr = 1;
1873 FreeList(specifiers, (void *)(FreeSpecifier));
1876 classSym = inst->_class->__anon1.__anon1.symbol;
1877 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1879 if(inst->members && (*inst->members).count)
1880 symbol->needConstructor = 1;
1884 symbol->needConstructor = 1;
1885 symbol->needDestructor = 1;
1889 else if(def->type == 9)
1891 struct Declaration * decl = def->__anon1.decl;
1895 if(inCompiler && classType != 2)
1897 ListAdd(classDataList, MkClassDefDeclaration(decl));
1898 def->__anon1.decl = (((void *)0));
1902 else if(def->type == 1)
1903 symbol->needConstructor = 1;
1904 else if(def->type == 4)
1905 symbol->needConstructor = 1;
1906 else if(def->type == 0)
1908 struct ClassFunction * func = def->__anon1.function;
1910 if(func->isDestructor)
1915 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1919 symbol->needDestructor = 1;
1921 if(!inCompiler && func->body)
1923 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1925 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1929 if(func->isConstructor)
1934 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1938 symbol->needConstructor = 1;
1940 if(!inCompiler && func->body)
1942 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1944 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1953 external->symbol = (((void *)0));
1956 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1958 initDeclarators = (((void *)0));
1959 strcpy(structName, symbol->string);
1960 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1962 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1964 spec->__anon1.__anon2.extDeclStruct = extDecl;
1965 ListAdd(specs, spec);
1967 external->symbol = symbol;
1968 if(symbol->__anon2.__anon1.structExternal)
1971 struct TopoEdge * e;
1972 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->incoming;
1974 for(e = ((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first; e; e = (struct TopoEdge *)((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
1975 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1977 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1978 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1979 __ecereMethod_External_CreateUniqueEdge(external, e->from, e->breakable);
1982 struct TopoEdge * e;
1983 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->outgoing;
1985 for(e = ((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first; e; e = (struct TopoEdge *)((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
1986 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1988 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1989 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1990 __ecereMethod_External_CreateUniqueEdge(e->to, external, e->breakable);
1992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), symbol->__anon2.__anon1.structExternal);
1993 FreeExternal(symbol->__anon2.__anon1.structExternal);
1995 symbol->__anon2.__anon1.structExternal = external;
1996 external->__anon1.declaration = MkDeclaration(specs, declarators);
1998 symbol->declaredStruct = 1;
2002 curExternal = external->prev;
2003 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
2004 FreeExternal(external);
2005 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
2007 if((*classDataList).count)
2009 char classDataStructName[1024];
2010 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2011 struct External * external;
2013 strcpy(classDataStructName, "__ecereClassData_");
2014 FullClassNameCat(classDataStructName, symbol->string, 0);
2015 declMode = structDeclMode = 0;
2016 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
2017 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
2018 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
2020 symbol->classData = 1;
2023 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
2028 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2030 strcpy(className, "__ecereClass_");
2031 FullClassNameCat(className, symbol->string, 1);
2032 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2033 if(!strstr(sourceFile, ".main.ec"))
2034 ListAdd(specs, MkSpecifier(STATIC));
2035 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2036 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2037 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2038 DeclareStruct(symbol->__anon2.__anon1.pointerExternal, "ecere::com::Class", 0, 1);
2039 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon1.pointerExternal);
2040 after = symbol->__anon2.__anon3.methodExternal;
2042 if(symbol->needDestructor)
2044 struct ClassFunction * function;
2045 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2046 struct Declarator * decl;
2047 struct Statement * body;
2048 struct Context * context;
2049 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2051 strcpy(destructorName, "__ecereDestructor_");
2052 FullClassNameCat(destructorName, symbol->string, 0);
2053 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2054 ListAdd(specs, MkSpecifier(VOID));
2055 context = PushContext();
2056 statements = MkList();
2057 if(definitions != (((void *)0)))
2059 for(def = definitions->first; def; def = def->next)
2061 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2063 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2064 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2066 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2068 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2070 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2072 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2074 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2076 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2081 if(destructor && destructor->body)
2083 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2084 destructor->body->__anon1.compound.context->parent = context;
2085 destructor->body = (((void *)0));
2087 body = MkCompoundStmt(declarations, statements);
2088 PopContext(context);
2089 body->__anon1.compound.context = context;
2090 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2091 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2092 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2093 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2094 ProcessClassFunctionBody(function, body);
2095 function->dontMangle = 1;
2096 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2098 if(symbol->needConstructor && inCompiler)
2100 struct ClassFunction * function;
2101 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2102 struct Declarator * decl;
2103 struct Statement * body;
2104 struct Context * context;
2105 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2107 strcpy(constructorName, "__ecereConstructor_");
2108 FullClassNameCat(constructorName, symbol->string, 0);
2109 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2110 ListAdd(specs, MkSpecifierName("bool"));
2111 context = PushContext();
2112 statements = MkList();
2113 if(definitions != (((void *)0)))
2115 for(def = definitions->first; def; def = def->next)
2117 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2119 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2120 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2122 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2124 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2127 newInst->members = (((void *)0));
2128 newInst->exp = CopyExpression(inst->exp);
2129 newInst->_class = CopySpecifier(inst->_class);
2130 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2133 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2135 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2139 for(def = definitions->first; def; def = def->next)
2141 if(def->type == 1 && def->__anon1.defProperties)
2143 struct MemberInit * propertyDef;
2145 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2147 struct Expression * memberExp;
2148 struct Identifier * id = (*propertyDef->identifiers).first;
2152 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2153 for(id = id->next; id; id = id->next)
2154 memberExp = MkExpMember(memberExp, id);
2155 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2157 if(propertyDef->initializer)
2159 if(propertyDef->initializer->type == 0)
2160 propertyDef->initializer->__anon1.exp = (((void *)0));
2161 FreeInitializer(propertyDef->initializer);
2163 propertyDef->initializer = (((void *)0));
2164 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2168 for(def = definitions->first; def; def = def->next)
2170 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2172 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2173 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2175 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2177 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2179 def->__anon1.decl->__anon1.inst = (((void *)0));
2180 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2186 if(constructor && constructor->body)
2188 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2189 constructor->body->__anon1.compound.context->parent = context;
2190 constructor->body = (((void *)0));
2192 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2193 body = MkCompoundStmt(declarations, statements);
2194 PopContext(context);
2195 body->__anon1.compound.context = context;
2196 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2197 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2198 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2199 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2200 ProcessClassFunctionBody(function, body);
2201 function->dontMangle = 1;
2202 if(definitions != (((void *)0)))
2203 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2206 if(definitions != (((void *)0)))
2208 for(def = definitions->first; def; def = def->next)
2210 if(def->type == 3 && def->__anon1.propertyDef)
2212 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2213 struct ClassDef * after = def;
2214 struct ClassDef * newDef;
2218 yylloc = propertyDef->loc;
2219 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && def->memberAccess == 1)
2220 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2221 else if(!symbol->isStatic)
2222 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2226 struct ClassFunction * func;
2227 struct Declarator * decl;
2229 struct __ecereNameSpace__ecere__sys__OldList * params;
2231 if(propertyDef->getStmt && propertyDef->id)
2233 strcpy(name, "__ecereProp_");
2234 FullClassNameCat(name, symbol->string, 0);
2235 strcat(name, "_Get_");
2236 FullClassNameCat(name, propertyDef->id->string, 1);
2238 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->__anon1._class && propertyDef->symbol->type->__anon1._class->__anon1.registered && propertyDef->symbol->type->__anon1._class->__anon1.registered->type == 1)
2240 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2241 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2242 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2246 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2247 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2249 ProcessClassFunctionBody(func, propertyDef->getStmt);
2250 func->declarator->symbol = propertyDef->symbol;
2251 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2252 func->dontMangle = 1;
2253 newDef = MkClassDefFunction(func);
2254 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2257 propertyDef->getStmt = (((void *)0));
2259 func->body = (((void *)0));
2261 if(propertyDef->setStmt && propertyDef->id)
2263 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2265 strcpy(name, "__ecereProp_");
2266 FullClassNameCat(name, symbol->string, 0);
2267 strcat(name, "_Set_");
2268 FullClassNameCat(name, propertyDef->id->string, 1);
2270 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2271 if(propertyDef->__anon1.isDBProp)
2273 struct Specifier * spec;
2274 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2276 for(spec = (*specs).first; spec; spec = spec->next)
2277 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2280 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2282 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2284 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2285 unsigned int useVoid = 0;
2287 switch(regClass->type)
2295 useVoid = !isConversion;
2298 useVoid = !isConversion;
2299 if(useVoid && !propertyDef->__anon1.isDBProp)
2300 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2302 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2304 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2305 ProcessClassFunctionBody(func, propertyDef->setStmt);
2306 func->dontMangle = 1;
2307 func->declarator->symbol = propertyDef->symbol;
2308 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2309 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2310 func->propSet = propertyDef->symbol;
2311 newDef = MkClassDefFunction(func);
2312 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2315 propertyDef->setStmt = (((void *)0));
2317 func->body = (((void *)0));
2319 if(propertyDef->issetStmt && propertyDef->id)
2321 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2323 strcpy(name, "__ecereProp_");
2324 FullClassNameCat(name, symbol->string, 0);
2325 strcat(name, "_IsSet_");
2326 FullClassNameCat(name, propertyDef->id->string, 1);
2328 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2329 ListAdd(specifiers, MkSpecifierName("bool"));
2330 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2331 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2332 func->dontMangle = 1;
2333 func->declarator->symbol = propertyDef->symbol;
2334 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2335 newDef = MkClassDefFunction(func);
2336 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2339 propertyDef->issetStmt = (((void *)0));
2341 func->body = (((void *)0));
2343 if(propertyDef->id && inCompiler)
2345 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2346 struct Declaration * decl;
2347 struct External * external;
2348 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2350 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2351 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2352 ListAdd(specifiers, MkSpecifierName("Property"));
2353 strcpy(name, "__ecereProp_");
2354 FullClassNameCat(name, symbol->string, 0);
2356 FullClassNameCat(name, propertyDef->id->string, 1);
2358 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2360 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2361 strcpy(name, "__ecerePropM_");
2362 FullClassNameCat(name, symbol->string, 0);
2364 FullClassNameCat(name, propertyDef->id->string, 1);
2365 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2366 decl = MkDeclaration(specifiers, list);
2368 external = MkExternalDeclaration(decl);
2369 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2370 external->symbol = propertyDef->symbol;
2371 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2372 if(inCompiler && prop && prop->symbol)
2373 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2378 else if(def->type == 10 && def->__anon1.propertyDef)
2380 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2381 struct ClassDef * after = def;
2382 struct ClassDef * newDef;
2387 yylloc = propertyDef->loc;
2388 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
2389 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2390 else if(!symbol->isStatic)
2391 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2394 struct ClassFunction * func;
2395 struct Declarator * decl;
2397 struct __ecereNameSpace__ecere__sys__OldList * params;
2399 if(propertyDef->getStmt && propertyDef->id)
2401 struct Declarator * declId;
2403 sprintf(name, "class::__ecereClassProp_");
2404 FullClassNameCat(name, symbol->string, 0);
2405 strcat(name, "_Get_");
2406 strcat(name, propertyDef->id->string);
2408 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2410 decl = MkDeclaratorFunction(declId, params);
2411 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2413 ProcessClassFunctionBody(func, propertyDef->getStmt);
2414 func->declarator->symbol = propertyDef->symbol;
2415 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2416 func->dontMangle = 1;
2417 newDef = MkClassDefFunction(func);
2418 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2420 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2421 func->type = ProcessType(propertyDef->specifiers, decl);
2422 FreeDeclarator(decl);
2423 if(func->type->__anon1.__anon2.returnType->kind == 8 && func->type->__anon1.__anon2.returnType->__anon1._class && func->type->__anon1.__anon2.returnType->__anon1._class->__anon1.registered && func->type->__anon1.__anon2.returnType->__anon1._class->__anon1.registered->type == 1)
2424 func->type->__anon1.__anon2.returnType->byReference = 1;
2425 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2427 propertyDef->getStmt = (((void *)0));
2429 func->body = (((void *)0));
2431 if(propertyDef->setStmt && propertyDef->id)
2433 struct Context * prevCurContext;
2434 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2435 struct Statement * body = propertyDef->setStmt;
2436 struct Declarator * ptrDecl;
2437 struct Expression * e;
2439 strcpy(name, "class::__ecereClassProp_");
2440 FullClassNameCat(name, symbol->string, 0);
2441 strcat(name, "_Set_");
2442 strcat(name, propertyDef->id->string);
2444 prevCurContext = curContext;
2445 curContext = body->__anon1.compound.context;
2446 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2447 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2448 if(!body->__anon1.compound.declarations)
2449 body->__anon1.compound.declarations = MkList();
2450 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->__anon1._class && propertyDef->symbol->type->__anon1._class->__anon1.registered && propertyDef->symbol->type->__anon1._class->__anon1.registered->type == 1)
2451 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2453 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2454 e = MkExpIdentifier(MkIdentifier("_value"));
2455 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2456 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2457 ListAdd(body->__anon1.compound.declarations, MkDeclaration(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(ptrDecl, MkInitializerAssignment(MkExpCast(MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), CopyDeclarator(propertyDef->declarator)), e))))));
2458 curContext = prevCurContext;
2460 struct Symbol * sym = ptrDecl->symbol;
2463 FreeType(sym->type);
2464 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2466 ListAdd(specifiers, MkSpecifier(VOID));
2467 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2468 ProcessClassFunctionBody(func, propertyDef->setStmt);
2469 func->dontMangle = 1;
2470 func->declarator->symbol = propertyDef->symbol;
2471 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2472 newDef = MkClassDefFunction(func);
2473 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2476 propertyDef->setStmt = (((void *)0));
2478 func->body = (((void *)0));
2483 else if(def->type == 0 && def->__anon1.function->declarator)
2485 struct ClassFunction * func = def->__anon1.function;
2487 func->_class = regClass;
2488 if(!func->dontMangle)
2490 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2491 struct Identifier * id = GetDeclId(funcDecl);
2492 struct __ecereNameSpace__ecere__com__Method * method;
2494 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2496 if(!funcDecl->__anon1.function.parameters)
2497 funcDecl->__anon1.function.parameters = MkList();
2498 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2500 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2501 FreeSpecifier(id->_class);
2502 id->_class = (((void *)0));
2503 if(inCompiler && method)
2505 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2508 ProcessMethodType(method);
2510 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && method->memberAccess == 1)
2511 CheckPublicDataType(method->dataType, 1, "class method");
2512 strcpy(newId, "__ecereMethod_");
2513 FullClassNameCat(newId, symbol->string, 0);
2515 strcat(newId, id->string);
2516 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2518 if(method->type != 1)
2522 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2523 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2531 if(initDeclarators != (((void *)0)))
2532 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2535 void PreProcessClassDefinitions()
2537 struct External * external, * next;
2539 curExternal = (((void *)0));
2542 for(external = (*ast).first; external; external = next)
2544 next = external->next;
2545 curExternal = external;
2546 if(external->type == 2)
2548 struct ClassDefinition * _class = external->__anon1._class;
2550 if(_class->definitions)
2552 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2555 else if(external->type == 1)
2557 struct Declaration * declaration = external->__anon1.declaration;
2559 if(declaration && declaration->type == 1)
2561 if(declaration->__anon1.__anon1.specifiers)
2563 struct Specifier * specifier;
2565 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2567 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->__anon1.__anon2.id && specifier->__anon1.__anon2.id->string && (declaration->declMode || specifier->__anon1.__anon2.baseSpecs || (specifier->type == 2 && specifier->__anon1.__anon2.definitions)))
2569 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2573 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2574 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2576 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2579 initDeclarators = declaration->__anon1.__anon1.declarators;
2580 declaration->__anon1.__anon1.declarators = (((void *)0));
2582 ProcessClass((specifier->type == 4) ? 6 : 0, specifier->__anon1.__anon2.definitions, symbol, specifier->__anon1.__anon2.baseSpecs, specifier->__anon1.__anon2.list, &specifier->loc, ast, external->prev, initDeclarators, extDecl);
2588 else if(declaration && inCompiler && declaration->type == 3)
2590 yylloc = declaration->loc;
2591 if(declaration->declMode == 1)
2592 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2593 else if(declaration->declMode != 3)
2594 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2597 else if(external->type == 3)
2600 else if(inCompiler && external->type == 0)
2602 yylloc = external->__anon1.function->loc;
2603 if(!external->__anon1.function->type)
2604 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2605 if(external->__anon1.function->declMode == 1)
2606 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2607 else if(external->__anon1.function->declMode != 3)
2608 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2614 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2616 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2618 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2619 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);