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 ecere_stdcall __attribute__((__stdcall__))
41 # define ecere_gcc_struct __attribute__((gcc_struct))
43 # define ecere_stdcall __stdcall
44 # define ecere_gcc_struct
47 # define ecere_stdcall
48 # define ecere_gcc_struct
51 #include <sys/types.h>
54 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, INT128 = 294, LONG = 295, SIGNED = 296, UNSIGNED = 297, FLOAT = 298, DOUBLE = 299, CONST = 300, VOLATILE = 301, VOID = 302, VALIST = 303, STRUCT = 304, UNION = 305, ENUM = 306, ELLIPSIS = 307, CASE = 308, DEFAULT = 309, IF = 310, SWITCH = 311, WHILE = 312, DO = 313, FOR = 314, GOTO = 315, CONTINUE = 316, BREAK = 317, RETURN = 318, IFX = 319, ELSE = 320, CLASS = 321, THISCLASS = 322, CLASS_NAME = 323, PROPERTY = 324, SETPROP = 325, GETPROP = 326, NEWOP = 327, RENEW = 328, DELETE = 329, EXT_DECL = 330, EXT_STORAGE = 331, IMPORT = 332, DEFINE = 333, VIRTUAL = 334, ATTRIB = 335, PUBLIC = 336, PRIVATE = 337, TYPED_OBJECT = 338, ANY_OBJECT = 339, _INCREF = 340, EXTENSION = 341, ASM = 342, TYPEOF = 343, WATCH = 344, STOPWATCHING = 345, FIREWATCHERS = 346, WATCHABLE = 347, CLASS_DESIGNER = 348, CLASS_NO_EXPANSION = 349, CLASS_FIXED = 350, ISPROPSET = 351, CLASS_DEFAULT_PROPERTY = 352, PROPERTY_CATEGORY = 353, CLASS_DATA = 354, CLASS_PROPERTY = 355, SUBCLASS = 356, NAMESPACE = 357, NEW0OP = 358, RENEW0 = 359, VAARG = 360, DBTABLE = 361, DBFIELD = 362, DBINDEX = 363, DATABASE_OPEN = 364, ALIGNOF = 365, ATTRIB_DEP = 366, __ATTRIB = 367, BOOL = 368, _BOOL = 369, _COMPLEX = 370, _IMAGINARY = 371, RESTRICT = 372, THREAD = 373, WIDE_STRING_LITERAL = 374, BUILTIN_OFFSETOF = 375
57 extern unsigned int inCompiler;
61 extern int structDeclMode;
63 extern const char * sourceFile;
65 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
67 struct __ecereNameSpace__ecere__sys__OldList
76 struct __ecereNameSpace__ecere__sys__BTNode;
78 struct __ecereNameSpace__ecere__com__DataValue
93 } ecere_gcc_struct __anon1;
96 struct __ecereNameSpace__ecere__com__SerialBuffer
98 unsigned char * _buffer;
104 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
106 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
108 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
110 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
112 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
118 struct InitDeclarator;
128 struct PropertyWatch;
130 struct TemplateParameter;
132 struct TemplateArgument;
134 struct TemplateDatatype;
150 extern char * strcat(char * , const char * );
152 extern size_t strlen(const char * );
154 extern int strncmp(const char * , const char * , size_t n);
160 extern void Compiler_Error(const char * format, ...);
162 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
164 struct __ecereNameSpace__ecere__com__LinkList
171 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
173 extern char * strcpy(char * , const char * );
175 struct __ecereNameSpace__ecere__com__LinkElement
181 extern char * strstr(const char * , const char * );
183 extern void Compiler_Warning(const char * format, ...);
185 extern int sprintf(char * , const char * , ...);
187 struct __ecereNameSpace__ecere__com__GlobalFunction;
189 struct __ecereNameSpace__ecere__com__IteratorPointer;
191 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
193 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
195 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
197 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
199 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
201 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
203 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
205 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
207 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
209 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
211 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
213 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
215 extern void FreeInitDeclarator(struct InitDeclarator * decl);
217 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList * attribs);
219 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
223 struct CodePosition start;
224 struct CodePosition end;
227 void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams)
233 for(c = 0; (ch = className[c]) && ch != '<'; c++)
237 strcat(output, "__ecereNameSpace__");
241 len = strlen(output);
243 if(!strncmp(className, "const ", 6))
245 for(; (ch = className[c]); c++)
269 if(!includeTemplateParams)
271 if(!strncmp(className + c + 1, "const ", 6))
285 if(!strncmp(className + c + 1, "const ", 6))
295 extern struct Location yylloc;
299 extern struct External * curExternal;
303 struct __ecereNameSpace__ecere__com__LinkElement in;
304 struct __ecereNameSpace__ecere__com__LinkElement out;
305 struct External * from;
306 struct External * to;
307 unsigned int breakable;
310 extern void FreeExternal(struct External * external);
312 extern struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference);
316 extern struct Context * PushContext(void);
318 extern void PopContext(struct Context * ctx);
320 extern struct Context * curContext;
322 struct __ecereNameSpace__ecere__com__Class;
324 struct __ecereNameSpace__ecere__com__Instance
327 struct __ecereNameSpace__ecere__com__Class * _class;
331 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
333 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
335 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);
337 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
339 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
341 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
343 int __ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext;
347 extern void FreeDeclarator(struct Declarator * decl);
349 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
351 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
353 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
355 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
357 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
359 struct __ecereNameSpace__ecere__com__BTNamedLink;
361 struct __ecereNameSpace__ecere__com__BTNamedLink
364 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
365 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
366 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
373 extern struct Symbol * FindClass(const char * name);
377 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
379 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
383 extern struct Specifier * MkSpecifierName(const char * name);
385 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
387 extern void FreeSpecifier(struct Specifier * spec);
389 extern struct Specifier * MkSpecifier(int specifier);
391 extern struct Specifier * CopySpecifier(struct Specifier * spec);
393 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
397 extern struct Identifier * GetDeclId(struct Declarator * decl);
401 struct Identifier * prev;
402 struct Identifier * next;
404 struct Symbol * classSym;
405 struct Specifier * _class;
407 struct Identifier * badID;
410 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
412 extern struct Identifier * MkIdentifier(const char * string);
414 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
420 struct Specifier * prev;
421 struct Specifier * next;
429 struct ExtDecl * extDecl;
431 struct Symbol * symbol;
432 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
433 struct Specifier * nsSpec;
434 } ecere_gcc_struct __anon1;
437 struct Identifier * id;
438 struct __ecereNameSpace__ecere__sys__OldList * list;
439 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
440 struct __ecereNameSpace__ecere__sys__OldList * definitions;
441 unsigned int addNameSpace;
442 struct Context * ctx;
443 struct ExtDecl * extDeclStruct;
444 } ecere_gcc_struct __anon2;
445 struct Expression * expression;
446 struct Specifier * _class;
447 struct TemplateParameter * templateParameter;
448 } ecere_gcc_struct __anon1;
453 struct Declarator * prev;
454 struct Declarator * next;
457 struct Symbol * symbol;
458 struct Declarator * declarator;
461 struct Identifier * identifier;
464 struct Expression * exp;
465 struct Expression * posExp;
466 struct Attrib * attrib;
467 } ecere_gcc_struct structDecl;
470 struct Expression * exp;
471 struct Specifier * enumClass;
472 } ecere_gcc_struct array;
475 struct __ecereNameSpace__ecere__sys__OldList * parameters;
476 } ecere_gcc_struct function;
479 struct Pointer * pointer;
480 } ecere_gcc_struct pointer;
483 struct ExtDecl * extended;
484 } ecere_gcc_struct extended;
485 } ecere_gcc_struct __anon1;
488 extern struct Expression * QMkExpId(const char * id);
490 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
492 extern struct Expression * CopyExpression(struct Expression * exp);
494 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
496 extern struct Expression * MkExpIdentifier(struct Identifier * id);
498 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
500 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
504 extern struct Type * MkClassType(const char * name);
506 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
508 extern void FreeType(struct Type * type);
510 struct ClassFunction;
512 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
518 struct Initializer * prev;
519 struct Initializer * next;
524 struct Expression * exp;
525 struct __ecereNameSpace__ecere__sys__OldList * list;
526 } ecere_gcc_struct __anon1;
527 unsigned int isConstant;
528 struct Identifier * id;
531 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
533 extern void FreeInitializer(struct Initializer * initializer);
535 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
537 struct __ecereNameSpace__ecere__com__Method;
539 struct __ecereNameSpace__ecere__com__Method
542 struct __ecereNameSpace__ecere__com__Method * parent;
543 struct __ecereNameSpace__ecere__com__Method * left;
544 struct __ecereNameSpace__ecere__com__Method * right;
549 struct __ecereNameSpace__ecere__com__Class * _class;
551 const char * dataTypeString;
552 struct Type * dataType;
563 struct Symbol * _class;
566 struct __ecereNameSpace__ecere__sys__OldList members;
568 } ecere_gcc_struct __anon1;
571 struct Type * returnType;
572 struct __ecereNameSpace__ecere__sys__OldList params;
573 struct Symbol * thisClass;
574 unsigned int staticMethod;
575 struct TemplateParameter * thisClassTemplate;
576 } ecere_gcc_struct __anon2;
579 struct __ecereNameSpace__ecere__com__Method * method;
580 struct __ecereNameSpace__ecere__com__Class * methodClass;
581 struct __ecereNameSpace__ecere__com__Class * usedClass;
582 } ecere_gcc_struct __anon3;
585 struct Type * arrayType;
587 struct Expression * arraySizeExp;
588 unsigned int freeExp;
589 struct Symbol * enumClass;
590 } ecere_gcc_struct __anon4;
592 struct TemplateParameter * templateParameter;
593 } ecere_gcc_struct __anon1;
598 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
606 unsigned int isSigned : 1;
607 unsigned int constant : 1;
608 unsigned int truth : 1;
609 unsigned int byReference : 1;
610 unsigned int extraParam : 1;
611 unsigned int directClassAccess : 1;
612 unsigned int computing : 1;
613 unsigned int keepCast : 1;
614 unsigned int passAsTemplate : 1;
615 unsigned int dllExport : 1;
616 unsigned int attrStdcall : 1;
617 unsigned int declaredWithStruct : 1;
618 unsigned int typedByReference : 1;
619 unsigned int casted : 1;
620 unsigned int pointerAlignment : 1;
621 unsigned int isLong : 1;
622 unsigned int signedBeforePromotion : 1;
623 unsigned int isVector : 1;
626 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);
628 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
630 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
636 struct ClassFunction * prev;
637 struct ClassFunction * next;
639 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
640 struct Declarator * declarator;
641 struct __ecereNameSpace__ecere__sys__OldList * declarations;
642 struct Statement * body;
643 struct __ecereNameSpace__ecere__com__Class * _class;
644 struct __ecereNameSpace__ecere__sys__OldList attached;
647 struct Symbol * propSet;
648 unsigned int isVirtual;
649 unsigned int isConstructor;
650 unsigned int isDestructor;
651 unsigned int dontMangle;
658 struct Statement * prev;
659 struct Statement * next;
664 struct __ecereNameSpace__ecere__sys__OldList * expressions;
667 struct Identifier * id;
668 struct Statement * stmt;
669 } ecere_gcc_struct labeled;
672 struct Expression * exp;
673 struct Statement * stmt;
674 } ecere_gcc_struct caseStmt;
677 struct __ecereNameSpace__ecere__sys__OldList * declarations;
678 struct __ecereNameSpace__ecere__sys__OldList * statements;
679 struct Context * context;
680 unsigned int isSwitch;
681 } ecere_gcc_struct compound;
684 struct __ecereNameSpace__ecere__sys__OldList * exp;
685 struct Statement * stmt;
686 struct Statement * elseStmt;
687 } ecere_gcc_struct ifStmt;
690 struct __ecereNameSpace__ecere__sys__OldList * exp;
691 struct Statement * stmt;
692 } ecere_gcc_struct switchStmt;
695 struct __ecereNameSpace__ecere__sys__OldList * exp;
696 struct Statement * stmt;
697 } ecere_gcc_struct whileStmt;
700 struct __ecereNameSpace__ecere__sys__OldList * exp;
701 struct Statement * stmt;
702 } ecere_gcc_struct doWhile;
705 struct Statement * init;
706 struct Statement * check;
707 struct __ecereNameSpace__ecere__sys__OldList * increment;
708 struct Statement * stmt;
709 } ecere_gcc_struct forStmt;
712 struct Identifier * id;
713 } ecere_gcc_struct gotoStmt;
716 struct Specifier * spec;
718 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
719 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
720 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
721 } ecere_gcc_struct asmStmt;
724 struct Expression * watcher;
725 struct Expression * object;
726 struct __ecereNameSpace__ecere__sys__OldList * watches;
727 } ecere_gcc_struct _watch;
730 struct Identifier * id;
731 struct __ecereNameSpace__ecere__sys__OldList * exp;
732 struct __ecereNameSpace__ecere__sys__OldList * filter;
733 struct Statement * stmt;
734 } ecere_gcc_struct forEachStmt;
735 struct Declaration * decl;
736 } ecere_gcc_struct __anon1;
739 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
741 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
743 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
745 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
747 struct __ecereNameSpace__ecere__sys__BinaryTree;
749 struct __ecereNameSpace__ecere__sys__BinaryTree
751 struct __ecereNameSpace__ecere__sys__BTNode * root;
753 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
754 void (* FreeKey)(void * key);
757 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
759 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
761 struct __ecereNameSpace__ecere__com__Property;
763 struct __ecereNameSpace__ecere__com__Property
765 struct __ecereNameSpace__ecere__com__Property * prev;
766 struct __ecereNameSpace__ecere__com__Property * next;
768 unsigned int isProperty;
771 struct __ecereNameSpace__ecere__com__Class * _class;
772 const char * dataTypeString;
773 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
774 struct Type * dataType;
775 void (* Set)(void * , int);
776 int (* Get)(void * );
777 unsigned int (* IsSet)(void * );
781 unsigned int conversion;
782 unsigned int watcherOffset;
783 const char * category;
784 unsigned int compiled;
785 unsigned int selfWatchable;
786 unsigned int isWatchable;
789 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
791 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);
793 extern void __ecereNameSpace__ecere__com__eInstance_Watch(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
795 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
800 struct Symbol * parent;
801 struct Symbol * left;
802 struct Symbol * right;
807 struct __ecereNameSpace__ecere__com__Method * method;
808 struct __ecereNameSpace__ecere__com__Property * _property;
809 struct __ecereNameSpace__ecere__com__Class * registered;
810 } ecere_gcc_struct __anon1;
811 unsigned int notYetDeclared;
816 struct External * pointerExternal;
817 struct External * structExternal;
818 } ecere_gcc_struct __anon1;
821 struct External * externalGet;
822 struct External * externalSet;
823 struct External * externalPtr;
824 struct External * externalIsSet;
825 } ecere_gcc_struct __anon2;
828 struct External * methodExternal;
829 struct External * methodCodeExternal;
830 } ecere_gcc_struct __anon3;
831 } ecere_gcc_struct __anon2;
832 unsigned int imported;
833 unsigned int declaredStructSym;
834 struct __ecereNameSpace__ecere__com__Class * _class;
835 unsigned int declaredStruct;
836 unsigned int needConstructor;
837 unsigned int needDestructor;
838 char * constructorName;
841 char * destructorName;
842 struct ModuleImport * module;
843 struct ClassImport * _import;
844 struct Location nameLoc;
845 unsigned int isParam;
846 unsigned int isRemote;
847 unsigned int isStruct;
848 unsigned int fireWatchersDone;
850 unsigned int classData;
851 unsigned int isStatic;
853 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
854 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
855 struct Context * ctx;
857 struct Expression * propCategory;
858 unsigned int mustRegister;
861 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);
863 struct __ecereNameSpace__ecere__com__DataMember;
865 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
871 const char * dataTypeString;
872 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
873 } ecere_gcc_struct __anon1;
874 struct __ecereNameSpace__ecere__com__DataValue expression;
877 const char * memberString;
880 struct __ecereNameSpace__ecere__com__DataMember * member;
881 struct __ecereNameSpace__ecere__com__Property * prop;
882 struct __ecereNameSpace__ecere__com__Method * method;
883 } ecere_gcc_struct __anon1;
884 } ecere_gcc_struct __anon2;
885 } ecere_gcc_struct __anon1;
888 struct __ecereNameSpace__ecere__com__DataMember
890 struct __ecereNameSpace__ecere__com__DataMember * prev;
891 struct __ecereNameSpace__ecere__com__DataMember * next;
893 unsigned int isProperty;
896 struct __ecereNameSpace__ecere__com__Class * _class;
897 const char * dataTypeString;
898 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
899 struct Type * dataType;
903 struct __ecereNameSpace__ecere__sys__OldList members;
904 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
906 short structAlignment;
907 short pointerAlignment;
910 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);
912 struct __ecereNameSpace__ecere__com__Module;
914 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
916 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
918 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);
920 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
922 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);
924 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);
926 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);
932 struct TypeName * prev;
933 struct TypeName * next;
935 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
936 struct Declarator * declarator;
938 struct Expression * bitCount;
941 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
943 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
947 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
949 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
951 struct ClassDefinition;
955 struct Context * parent;
956 struct __ecereNameSpace__ecere__sys__BinaryTree types;
957 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
958 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
959 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
962 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
963 struct ClassDefinition * classDef;
964 unsigned int templateTypesOnly;
965 unsigned int hasNameSpace;
968 struct ClassDefinition
970 struct ClassDefinition * prev;
971 struct ClassDefinition * next;
973 struct Specifier * _class;
974 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
975 struct __ecereNameSpace__ecere__sys__OldList * definitions;
976 struct Symbol * symbol;
977 struct Location blockStart;
978 struct Location nameLoc;
980 unsigned int deleteWatchable;
983 struct Instantiation;
987 struct Expression * prev;
988 struct Expression * next;
996 struct Identifier * identifier;
997 } ecere_gcc_struct __anon1;
998 struct Statement * compound;
999 struct Instantiation * instance;
1003 unsigned int intlString;
1004 unsigned int wideString;
1005 } ecere_gcc_struct __anon2;
1006 struct __ecereNameSpace__ecere__sys__OldList * list;
1009 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1010 struct Declarator * decl;
1011 } ecere_gcc_struct _classExp;
1014 struct Identifier * id;
1015 } ecere_gcc_struct classData;
1018 struct Expression * exp;
1019 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1020 struct Location argLoc;
1021 } ecere_gcc_struct call;
1024 struct Expression * exp;
1025 struct __ecereNameSpace__ecere__sys__OldList * index;
1026 } ecere_gcc_struct index;
1029 struct Expression * exp;
1030 struct Identifier * member;
1032 unsigned int thisPtr;
1033 } ecere_gcc_struct member;
1037 struct Expression * exp1;
1038 struct Expression * exp2;
1039 } ecere_gcc_struct op;
1040 struct TypeName * typeName;
1041 struct Specifier * _class;
1044 struct TypeName * typeName;
1045 struct Expression * exp;
1046 } ecere_gcc_struct cast;
1049 struct Expression * cond;
1050 struct __ecereNameSpace__ecere__sys__OldList * exp;
1051 struct Expression * elseExp;
1052 } ecere_gcc_struct cond;
1055 struct TypeName * typeName;
1056 struct Expression * size;
1057 } ecere_gcc_struct _new;
1060 struct TypeName * typeName;
1061 struct Expression * size;
1062 struct Expression * exp;
1063 } ecere_gcc_struct _renew;
1067 struct Identifier * id;
1068 } ecere_gcc_struct db;
1071 struct Expression * ds;
1072 struct Expression * name;
1073 } ecere_gcc_struct dbopen;
1076 struct TypeName * typeName;
1077 struct Initializer * initializer;
1078 } ecere_gcc_struct initializer;
1081 struct Expression * exp;
1082 struct TypeName * typeName;
1083 } ecere_gcc_struct vaArg;
1086 struct TypeName * typeName;
1087 struct Identifier * id;
1088 } ecere_gcc_struct offset;
1089 } ecere_gcc_struct __anon1;
1090 unsigned int debugValue;
1091 struct __ecereNameSpace__ecere__com__DataValue val;
1093 unsigned int hasAddress;
1094 struct Type * expType;
1095 struct Type * destType;
1098 unsigned int byReference;
1099 unsigned int isConstant;
1100 unsigned int addedThis;
1101 unsigned int needCast;
1102 unsigned int thisPtr;
1103 unsigned int opDestType;
1104 unsigned int usedInComparison;
1105 unsigned int ambiguousUnits;
1106 unsigned int parentOpDestType;
1107 unsigned int needTemplateCast;
1110 struct Instantiation
1112 struct Instantiation * prev;
1113 struct Instantiation * next;
1114 struct Location loc;
1115 struct Specifier * _class;
1116 struct Expression * exp;
1117 struct __ecereNameSpace__ecere__sys__OldList * members;
1118 struct Symbol * symbol;
1119 unsigned int fullSet;
1120 unsigned int isConstant;
1121 unsigned char * data;
1122 struct Location nameLoc;
1123 struct Location insideLoc;
1129 struct Declaration * prev;
1130 struct Declaration * next;
1131 struct Location loc;
1137 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1138 struct __ecereNameSpace__ecere__sys__OldList * declarators;
1139 } ecere_gcc_struct __anon1;
1140 struct Instantiation * inst;
1143 struct Identifier * id;
1144 struct Expression * exp;
1145 } ecere_gcc_struct __anon2;
1146 } ecere_gcc_struct __anon1;
1147 struct Specifier * extStorage;
1148 struct Symbol * symbol;
1152 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1158 struct MembersInit * prev;
1159 struct MembersInit * next;
1160 struct Location loc;
1164 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1165 struct ClassFunction * function;
1166 } ecere_gcc_struct __anon1;
1173 struct MemberInit * prev;
1174 struct MemberInit * next;
1175 struct Location loc;
1176 struct Location realLoc;
1177 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1178 struct Initializer * initializer;
1180 unsigned int variable;
1181 unsigned int takeOutExp;
1184 static void CheckPublicExpression(struct Expression * exp, int access);
1186 static void CheckPublicInitializer(struct Initializer * init, int access)
1191 CheckPublicExpression(init->__anon1.exp, access);
1195 struct Initializer * i;
1197 for(i = (*init->__anon1.list).first; i; i = i->next)
1198 CheckPublicInitializer(i, access);
1204 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word);
1206 static void CheckPublicTypeName(struct TypeName * type, int access)
1208 if(type->qualifiers)
1210 struct Specifier * spec;
1212 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1216 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1218 CheckPublicClass(classSym, access, "define");
1224 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1232 CheckPublicClass(type->__anon1._class, access, word);
1242 struct Type * param;
1244 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1245 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1246 CheckPublicDataType(param, access, word);
1247 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1251 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1252 if(type->__anon1.__anon4.enumClass)
1253 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1257 CheckPublicDataType(type->__anon1.type, access, word);
1266 CheckPublicClass(type->__anon1._class, access, word);
1273 static void CheckPublicExpression(struct Expression * exp, int access)
1286 if(exp->__anon1.op.exp1)
1287 CheckPublicExpression(exp->__anon1.op.exp1, access);
1288 if(exp->__anon1.op.exp2)
1289 CheckPublicExpression(exp->__anon1.op.exp2, access);
1293 struct Expression * e;
1295 for(e = (*exp->__anon1.list).first; e; e = e->next)
1296 CheckPublicExpression(e, access);
1301 struct Expression * e;
1303 CheckPublicExpression(exp->__anon1.index.exp, access);
1304 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1305 CheckPublicExpression(e, access);
1310 struct Expression * e;
1312 CheckPublicExpression(exp->__anon1.call.exp, access);
1313 if(exp->__anon1.call.arguments)
1315 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1316 CheckPublicExpression(e, access);
1322 CheckPublicExpression(exp->__anon1.member.exp, access);
1327 CheckPublicExpression(exp->__anon1.member.exp, access);
1331 CheckPublicTypeName(exp->__anon1.typeName, access);
1335 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1336 if(exp->__anon1.cast.exp)
1337 CheckPublicExpression(exp->__anon1.cast.exp, access);
1342 struct Expression * e;
1344 CheckPublicExpression(exp->__anon1.cond.cond, access);
1345 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1346 CheckPublicExpression(e, access);
1347 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1352 CheckPublicExpression(exp->__anon1._new.size, access);
1356 CheckPublicExpression(exp->__anon1._renew.size, access);
1357 CheckPublicExpression(exp->__anon1._renew.exp, access);
1361 struct MembersInit * members;
1363 if(exp->__anon1.instance->_class)
1364 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1365 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1367 if(members->type == 0)
1369 struct MemberInit * member;
1371 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1373 CheckPublicInitializer(member->initializer, access);
1387 struct ClassDef * prev;
1388 struct ClassDef * next;
1389 struct Location loc;
1393 struct Declaration * decl;
1394 struct ClassFunction * function;
1395 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1396 struct PropertyDef * propertyDef;
1397 struct PropertyWatch * propertyWatch;
1399 struct Identifier * defaultProperty;
1402 struct Identifier * id;
1403 struct Initializer * initializer;
1404 } ecere_gcc_struct __anon1;
1405 } ecere_gcc_struct __anon1;
1412 struct PropertyDef * prev;
1413 struct PropertyDef * next;
1414 struct Location loc;
1415 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1416 struct Declarator * declarator;
1417 struct Identifier * id;
1418 struct Statement * getStmt;
1419 struct Statement * setStmt;
1420 struct Statement * issetStmt;
1421 struct Symbol * symbol;
1422 struct Expression * category;
1425 unsigned int conversion : 1;
1426 unsigned int isWatchable : 1;
1427 unsigned int isDBProp : 1;
1428 } ecere_gcc_struct __anon1;
1431 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1433 if(definitions != (((void *)0)))
1435 struct ClassDef * def;
1437 for(def = definitions->first; def; def = def->next)
1441 struct Declaration * decl = def->__anon1.decl;
1442 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1447 struct Declarator * d;
1449 if(decl->__anon1.__anon1.declarators)
1451 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1453 struct Identifier * declId = GetDeclId(d);
1459 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1461 dataMember = link ? link->data : (((void *)0));
1464 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1466 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1470 else if(decl->__anon1.__anon1.specifiers)
1472 struct Specifier * spec;
1474 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1476 if(spec->type == 3 || spec->type == 4)
1478 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1480 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1482 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1486 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1488 dataMember = link ? link->data : (((void *)0));
1491 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1493 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1499 else if(decl->type == 2)
1501 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1508 struct FunctionDefinition;
1510 typedef union YYSTYPE
1515 struct Identifier * id;
1516 struct Expression * exp;
1517 struct Specifier * specifier;
1518 struct __ecereNameSpace__ecere__sys__OldList * list;
1519 struct Enumerator * enumerator;
1520 struct Declarator * declarator;
1521 struct Pointer * pointer;
1522 struct Initializer * initializer;
1523 struct InitDeclarator * initDeclarator;
1524 struct TypeName * typeName;
1525 struct Declaration * declaration;
1526 struct Statement * stmt;
1527 struct FunctionDefinition * function;
1528 struct External * external;
1529 struct Context * context;
1530 struct AsmField * asmField;
1531 struct Attrib * attrib;
1532 struct ExtDecl * extDecl;
1533 struct Attribute * attribute;
1534 struct Instantiation * instance;
1535 struct MembersInit * membersInit;
1536 struct MemberInit * memberInit;
1537 struct ClassFunction * classFunction;
1538 struct ClassDefinition * _class;
1539 struct ClassDef * classDef;
1540 struct PropertyDef * prop;
1542 struct Symbol * symbol;
1543 struct PropertyWatch * propertyWatch;
1544 struct TemplateParameter * templateParameter;
1545 struct TemplateArgument * templateArgument;
1546 struct TemplateDatatype * templateDatatype;
1547 struct DBTableEntry * dbtableEntry;
1548 struct DBIndexItem * dbindexItem;
1549 struct DBTableDef * dbtableDef;
1550 } ecere_gcc_struct YYSTYPE;
1552 extern YYSTYPE yylval;
1556 struct External * prev;
1557 struct External * next;
1558 struct Location loc;
1560 struct Symbol * symbol;
1563 struct FunctionDefinition * function;
1564 struct ClassDefinition * _class;
1565 struct Declaration * declaration;
1566 char * importString;
1567 struct Identifier * id;
1568 struct DBTableDef * table;
1569 } ecere_gcc_struct __anon1;
1571 struct External * fwdDecl;
1572 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1573 struct __ecereNameSpace__ecere__com__Instance * incoming;
1574 int nonBreakableIncoming;
1577 struct FunctionDefinition
1579 struct FunctionDefinition * prev;
1580 struct FunctionDefinition * next;
1581 struct Location loc;
1582 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1583 struct Declarator * declarator;
1584 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1585 struct Statement * body;
1586 struct __ecereNameSpace__ecere__com__Class * _class;
1587 struct __ecereNameSpace__ecere__sys__OldList attached;
1590 struct Symbol * propSet;
1592 unsigned int propertyNoThis;
1595 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
1597 struct __ecereNameSpace__ecere__com__NameSpace;
1599 struct __ecereNameSpace__ecere__com__NameSpace
1602 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1603 struct __ecereNameSpace__ecere__com__NameSpace * left;
1604 struct __ecereNameSpace__ecere__com__NameSpace * right;
1606 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1607 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1608 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1609 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1610 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1613 struct __ecereNameSpace__ecere__com__Class
1615 struct __ecereNameSpace__ecere__com__Class * prev;
1616 struct __ecereNameSpace__ecere__com__Class * next;
1622 unsigned int (* Constructor)(void * );
1623 void (* Destructor)(void * );
1626 struct __ecereNameSpace__ecere__com__Class * base;
1627 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1628 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1629 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1630 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1631 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1632 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1636 struct __ecereNameSpace__ecere__com__Instance * module;
1637 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1638 const char * dataTypeString;
1639 struct Type * dataType;
1641 int defaultAlignment;
1642 void (* Initialize)();
1644 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1645 const char * designerClass;
1646 unsigned int noExpansion;
1647 const char * defaultProperty;
1648 unsigned int comRedefinition;
1651 unsigned int internalDecl;
1653 unsigned int computeSize;
1654 short structAlignment;
1655 short pointerAlignment;
1656 int destructionWatchOffset;
1658 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1659 int inheritanceAccess;
1660 const char * fullName;
1662 struct __ecereNameSpace__ecere__sys__OldList conversions;
1663 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1664 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1665 struct __ecereNameSpace__ecere__com__Class * templateClass;
1666 struct __ecereNameSpace__ecere__sys__OldList templatized;
1668 unsigned int isInstanceClass;
1669 unsigned int byValueSystemClass;
1670 void * bindingsClass;
1673 struct __ecereNameSpace__ecere__com__Application
1676 const char * * argv;
1678 unsigned int isGUIApp;
1679 struct __ecereNameSpace__ecere__sys__OldList allModules;
1680 char * parsedCommand;
1681 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1684 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1688 else if((*ns).parent)
1689 return NameSpaceContained((*ns).parent, parent);
1694 static void AddSimpleBaseMembers(struct External * external, struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1696 if(_class->type != 1000)
1697 AddMembers(external, list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1700 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
1702 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
1704 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1706 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1708 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
1710 struct __ecereNameSpace__ecere__com__Module
1712 struct __ecereNameSpace__ecere__com__Instance * application;
1713 struct __ecereNameSpace__ecere__sys__OldList classes;
1714 struct __ecereNameSpace__ecere__sys__OldList defines;
1715 struct __ecereNameSpace__ecere__sys__OldList functions;
1716 struct __ecereNameSpace__ecere__sys__OldList modules;
1717 struct __ecereNameSpace__ecere__com__Instance * prev;
1718 struct __ecereNameSpace__ecere__com__Instance * next;
1724 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1725 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1728 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
1733 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1735 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1739 if(regClass->templateClass)
1740 regClass = regClass->templateClass;
1741 if(classSym->isStatic && access != 3)
1743 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1745 else if(access == 1)
1747 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))
1749 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1750 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1756 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)
1758 char structName[1024];
1759 char className[1024];
1760 char constructorName[1024];
1761 char destructorName[1024];
1762 struct __ecereNameSpace__ecere__com__Class * regClass;
1763 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1764 unsigned int isUnion = classType == 6;
1765 struct External * external = (((void *)0));
1766 struct ClassDef * def;
1767 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1768 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1773 classDataList = MkList();
1775 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1778 classType = regClass->type;
1779 if(inCompiler && regClass->base)
1782 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && regClass->inheritanceAccess == 1)
1784 if(!regClass->base->symbol)
1785 regClass->base->symbol = FindClass(regClass->base->fullName);
1786 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1788 else if(!symbol->isStatic && regClass->base)
1790 if(!regClass->base->symbol)
1791 regClass->base->symbol = FindClass(regClass->base->fullName);
1792 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1795 if(definitions != (((void *)0)))
1797 for(def = definitions->first; def; def = def->next)
1801 struct __ecereNameSpace__ecere__com__DataMember * member;
1802 struct __ecereNameSpace__ecere__com__Property * prop;
1803 struct __ecereNameSpace__ecere__com__Method * method;
1805 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1807 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1809 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1811 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1813 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1815 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1820 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1827 external = MkExternalDeclaration((((void *)0)));
1828 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1829 curExternal = external;
1830 curExternal->symbol = symbol;
1832 if((classType == 1 || classType == 5) && inCompiler)
1834 AddSimpleBaseMembers(external, list, regClass->base, regClass);
1836 if(definitions != (((void *)0)))
1840 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
1841 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1842 else if(!symbol->isStatic)
1843 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1845 for(def = definitions->first; def; def = def->next)
1850 struct Declaration * decl = def->__anon1.decl;
1855 if(inCompiler && classType != 2)
1857 ListAdd(list, MkClassDefDeclaration(decl));
1858 def->__anon1.decl = (((void *)0));
1861 else if(decl->type == 2)
1863 struct Instantiation * inst = decl->__anon1.inst;
1864 struct Expression * exp = inst->exp;
1865 struct Symbol * classSym;
1869 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1870 struct Declarator * d;
1872 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1873 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1876 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1878 ListAdd(declarators, d);
1879 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1880 ListAdd(list, MkClassDefDeclaration(decl));
1882 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1883 exp->__anon1.member.exp = QMkExpId("this");
1884 exp->__anon1.member.memberType = 3;
1885 exp->__anon1.member.thisPtr = 1;
1890 FreeList(specifiers, (void *)(FreeSpecifier));
1893 classSym = inst->_class->__anon1.__anon1.symbol;
1894 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1896 if(inst->members && (*inst->members).count)
1897 symbol->needConstructor = 1;
1901 symbol->needConstructor = 1;
1902 symbol->needDestructor = 1;
1906 else if(def->type == 9)
1908 struct Declaration * decl = def->__anon1.decl;
1912 if(inCompiler && classType != 2)
1914 ListAdd(classDataList, MkClassDefDeclaration(decl));
1915 def->__anon1.decl = (((void *)0));
1919 else if(def->type == 1)
1920 symbol->needConstructor = 1;
1921 else if(def->type == 4)
1922 symbol->needConstructor = 1;
1923 else if(def->type == 0)
1925 struct ClassFunction * func = def->__anon1.function;
1927 if(func->isDestructor)
1932 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1936 symbol->needDestructor = 1;
1938 if(!inCompiler && func->body)
1940 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1942 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1946 if(func->isConstructor)
1951 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1955 symbol->needConstructor = 1;
1957 if(!inCompiler && func->body)
1959 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1961 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1970 external->symbol = (((void *)0));
1973 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1975 initDeclarators = (((void *)0));
1976 strcpy(structName, symbol->string);
1977 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1979 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1981 spec->__anon1.__anon2.extDeclStruct = extDecl;
1982 ListAdd(specs, spec);
1984 external->symbol = symbol;
1985 if(symbol->__anon2.__anon1.structExternal)
1988 struct TopoEdge * e;
1989 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->incoming;
1991 for(e = ((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first; e; e = (struct TopoEdge *)(__extension__ ({
1992 struct __ecereNameSpace__ecere__com__IteratorPointer * (* __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer);
1994 __internal_VirtualMethod = ((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
1995 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1997 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1998 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext]);
1999 __internal_VirtualMethod ? __internal_VirtualMethod(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e) : (struct __ecereNameSpace__ecere__com__IteratorPointer *)1;
2001 __ecereMethod_External_CreateUniqueEdge(external, e->from, e->breakable);
2004 struct TopoEdge * e;
2005 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->outgoing;
2007 for(e = ((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first; e; e = (struct TopoEdge *)(__extension__ ({
2008 struct __ecereNameSpace__ecere__com__IteratorPointer * (* __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer);
2010 __internal_VirtualMethod = ((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
2011 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
2013 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
2014 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext]);
2015 __internal_VirtualMethod ? __internal_VirtualMethod(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e) : (struct __ecereNameSpace__ecere__com__IteratorPointer *)1;
2017 __ecereMethod_External_CreateUniqueEdge(e->to, external, e->breakable);
2019 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), symbol->__anon2.__anon1.structExternal);
2020 FreeExternal(symbol->__anon2.__anon1.structExternal);
2022 symbol->__anon2.__anon1.structExternal = external;
2023 external->__anon1.declaration = MkDeclaration(specs, declarators);
2025 symbol->declaredStruct = 1;
2029 curExternal = external->prev;
2030 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
2031 FreeExternal(external);
2032 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
2034 if((*classDataList).count)
2036 char classDataStructName[1024];
2037 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2038 struct External * external;
2040 strcpy(classDataStructName, "__ecereClassData_");
2041 FullClassNameCat(classDataStructName, symbol->string, 0);
2042 declMode = structDeclMode = 0;
2043 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
2044 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
2045 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
2047 symbol->classData = 1;
2050 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
2055 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2057 strcpy(className, "__ecereClass_");
2058 FullClassNameCat(className, symbol->string, 1);
2059 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2060 if(!strstr(sourceFile, ".main.ec"))
2061 ListAdd(specs, MkSpecifier(STATIC));
2062 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2063 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2064 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2065 DeclareStruct(symbol->__anon2.__anon1.pointerExternal, "ecere::com::Class", 0, 1);
2066 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon1.pointerExternal);
2067 after = symbol->__anon2.__anon3.methodExternal;
2069 if(symbol->needDestructor)
2071 struct ClassFunction * function;
2072 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2073 struct Declarator * decl;
2074 struct Statement * body;
2075 struct Context * context;
2076 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2078 strcpy(destructorName, "__ecereDestructor_");
2079 FullClassNameCat(destructorName, symbol->string, 0);
2080 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2081 ListAdd(specs, MkSpecifier(VOID));
2082 context = PushContext();
2083 statements = MkList();
2084 if(definitions != (((void *)0)))
2086 for(def = definitions->first; def; def = def->next)
2088 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2090 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2091 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2093 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2095 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2097 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2099 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2101 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2103 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2108 if(destructor && destructor->body)
2110 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2111 destructor->body->__anon1.compound.context->parent = context;
2112 destructor->body = (((void *)0));
2114 body = MkCompoundStmt(declarations, statements);
2115 PopContext(context);
2116 body->__anon1.compound.context = context;
2117 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2118 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2119 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2120 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2121 ProcessClassFunctionBody(function, body);
2122 function->dontMangle = 1;
2123 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2125 if(symbol->needConstructor && inCompiler)
2127 struct ClassFunction * function;
2128 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2129 struct Declarator * decl;
2130 struct Statement * body;
2131 struct Context * context;
2132 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2134 strcpy(constructorName, "__ecereConstructor_");
2135 FullClassNameCat(constructorName, symbol->string, 0);
2136 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2137 ListAdd(specs, MkSpecifierName("bool"));
2138 context = PushContext();
2139 statements = MkList();
2140 if(definitions != (((void *)0)))
2142 for(def = definitions->first; def; def = def->next)
2144 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2146 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2147 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2149 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2151 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2154 newInst->members = (((void *)0));
2155 newInst->exp = CopyExpression(inst->exp);
2156 newInst->_class = CopySpecifier(inst->_class);
2157 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2160 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2162 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2166 for(def = definitions->first; def; def = def->next)
2168 if(def->type == 1 && def->__anon1.defProperties)
2170 struct MemberInit * propertyDef;
2172 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2174 struct Expression * memberExp;
2175 struct Identifier * id = (*propertyDef->identifiers).first;
2179 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2180 for(id = id->next; id; id = id->next)
2181 memberExp = MkExpMember(memberExp, id);
2182 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2184 if(propertyDef->initializer)
2186 if(propertyDef->initializer->type == 0)
2187 propertyDef->initializer->__anon1.exp = (((void *)0));
2188 FreeInitializer(propertyDef->initializer);
2190 propertyDef->initializer = (((void *)0));
2191 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2195 for(def = definitions->first; def; def = def->next)
2197 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2199 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2200 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2202 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2204 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2206 def->__anon1.decl->__anon1.inst = (((void *)0));
2207 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2213 if(constructor && constructor->body)
2215 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2216 constructor->body->__anon1.compound.context->parent = context;
2217 constructor->body = (((void *)0));
2219 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2220 body = MkCompoundStmt(declarations, statements);
2221 PopContext(context);
2222 body->__anon1.compound.context = context;
2223 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2224 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2225 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2226 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2227 ProcessClassFunctionBody(function, body);
2228 function->dontMangle = 1;
2229 if(definitions != (((void *)0)))
2230 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2233 if(definitions != (((void *)0)))
2235 for(def = definitions->first; def; def = def->next)
2237 if(def->type == 3 && def->__anon1.propertyDef)
2239 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2240 struct ClassDef * after = def;
2241 struct ClassDef * newDef;
2245 yylloc = propertyDef->loc;
2246 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && def->memberAccess == 1)
2247 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2248 else if(!symbol->isStatic)
2249 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2253 struct ClassFunction * func;
2254 struct Declarator * decl;
2256 struct __ecereNameSpace__ecere__sys__OldList * params;
2258 if(propertyDef->getStmt && propertyDef->id)
2260 strcpy(name, "__ecereProp_");
2261 FullClassNameCat(name, symbol->string, 0);
2262 strcat(name, "_Get_");
2263 FullClassNameCat(name, propertyDef->id->string, 1);
2265 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)
2267 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2268 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2269 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2273 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2274 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2276 ProcessClassFunctionBody(func, propertyDef->getStmt);
2277 func->declarator->symbol = propertyDef->symbol;
2278 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2279 func->dontMangle = 1;
2280 newDef = MkClassDefFunction(func);
2281 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2284 propertyDef->getStmt = (((void *)0));
2286 func->body = (((void *)0));
2288 if(propertyDef->setStmt && propertyDef->id)
2290 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2292 strcpy(name, "__ecereProp_");
2293 FullClassNameCat(name, symbol->string, 0);
2294 strcat(name, "_Set_");
2295 FullClassNameCat(name, propertyDef->id->string, 1);
2297 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2298 if(propertyDef->__anon1.isDBProp)
2300 struct Specifier * spec;
2301 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2303 for(spec = (*specs).first; spec; spec = spec->next)
2304 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2307 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2309 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2311 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2312 unsigned int useVoid = 0;
2314 switch(regClass->type)
2322 useVoid = !isConversion;
2325 useVoid = !isConversion;
2326 if(useVoid && !propertyDef->__anon1.isDBProp)
2327 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2329 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2331 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2332 ProcessClassFunctionBody(func, propertyDef->setStmt);
2333 func->dontMangle = 1;
2334 func->declarator->symbol = propertyDef->symbol;
2335 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2336 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2337 func->propSet = propertyDef->symbol;
2338 newDef = MkClassDefFunction(func);
2339 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2342 propertyDef->setStmt = (((void *)0));
2344 func->body = (((void *)0));
2346 if(propertyDef->issetStmt && propertyDef->id)
2348 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2350 strcpy(name, "__ecereProp_");
2351 FullClassNameCat(name, symbol->string, 0);
2352 strcat(name, "_IsSet_");
2353 FullClassNameCat(name, propertyDef->id->string, 1);
2355 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2356 ListAdd(specifiers, MkSpecifierName("bool"));
2357 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2358 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2359 func->dontMangle = 1;
2360 func->declarator->symbol = propertyDef->symbol;
2361 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2362 newDef = MkClassDefFunction(func);
2363 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2366 propertyDef->issetStmt = (((void *)0));
2368 func->body = (((void *)0));
2370 if(propertyDef->id && inCompiler)
2372 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2373 struct Declaration * decl;
2374 struct External * external;
2375 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2377 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2378 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2379 ListAdd(specifiers, MkSpecifierName("Property"));
2380 strcpy(name, "__ecereProp_");
2381 FullClassNameCat(name, symbol->string, 0);
2383 FullClassNameCat(name, propertyDef->id->string, 1);
2385 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2387 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2388 strcpy(name, "__ecerePropM_");
2389 FullClassNameCat(name, symbol->string, 0);
2391 FullClassNameCat(name, propertyDef->id->string, 1);
2392 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2393 decl = MkDeclaration(specifiers, list);
2395 external = MkExternalDeclaration(decl);
2396 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2397 external->symbol = propertyDef->symbol;
2398 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2399 if(inCompiler && prop && prop->symbol)
2400 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2405 else if(def->type == 10 && def->__anon1.propertyDef)
2407 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2408 struct ClassDef * after = def;
2409 struct ClassDef * newDef;
2414 yylloc = propertyDef->loc;
2415 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
2416 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2417 else if(!symbol->isStatic)
2418 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2421 struct ClassFunction * func;
2422 struct Declarator * decl;
2424 struct __ecereNameSpace__ecere__sys__OldList * params;
2426 if(propertyDef->getStmt && propertyDef->id)
2428 struct Declarator * declId;
2430 sprintf(name, "class::__ecereClassProp_");
2431 FullClassNameCat(name, symbol->string, 0);
2432 strcat(name, "_Get_");
2433 strcat(name, propertyDef->id->string);
2435 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2437 decl = MkDeclaratorFunction(declId, params);
2438 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2440 ProcessClassFunctionBody(func, propertyDef->getStmt);
2441 func->declarator->symbol = propertyDef->symbol;
2442 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2443 func->dontMangle = 1;
2444 newDef = MkClassDefFunction(func);
2445 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2447 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2448 func->type = ProcessType(propertyDef->specifiers, decl);
2449 FreeDeclarator(decl);
2450 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)
2451 func->type->__anon1.__anon2.returnType->byReference = 1;
2452 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2454 propertyDef->getStmt = (((void *)0));
2456 func->body = (((void *)0));
2458 if(propertyDef->setStmt && propertyDef->id)
2460 struct Context * prevCurContext;
2461 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2462 struct Statement * body = propertyDef->setStmt;
2463 struct Declarator * ptrDecl;
2464 struct Expression * e;
2466 strcpy(name, "class::__ecereClassProp_");
2467 FullClassNameCat(name, symbol->string, 0);
2468 strcat(name, "_Set_");
2469 strcat(name, propertyDef->id->string);
2471 prevCurContext = curContext;
2472 curContext = body->__anon1.compound.context;
2473 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2474 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2475 if(!body->__anon1.compound.declarations)
2476 body->__anon1.compound.declarations = MkList();
2477 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)
2478 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2480 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2481 e = MkExpIdentifier(MkIdentifier("_value"));
2482 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2483 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2484 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))))));
2485 curContext = prevCurContext;
2487 struct Symbol * sym = ptrDecl->symbol;
2490 FreeType(sym->type);
2491 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2493 ListAdd(specifiers, MkSpecifier(VOID));
2494 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2495 ProcessClassFunctionBody(func, propertyDef->setStmt);
2496 func->dontMangle = 1;
2497 func->declarator->symbol = propertyDef->symbol;
2498 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2499 newDef = MkClassDefFunction(func);
2500 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2503 propertyDef->setStmt = (((void *)0));
2505 func->body = (((void *)0));
2510 else if(def->type == 0 && def->__anon1.function->declarator)
2512 struct ClassFunction * func = def->__anon1.function;
2514 func->_class = regClass;
2515 if(!func->dontMangle)
2517 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2518 struct Identifier * id = GetDeclId(funcDecl);
2519 struct __ecereNameSpace__ecere__com__Method * method;
2521 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2523 if(!funcDecl->__anon1.function.parameters)
2524 funcDecl->__anon1.function.parameters = MkList();
2525 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2527 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2528 FreeSpecifier(id->_class);
2529 id->_class = (((void *)0));
2530 if(inCompiler && method)
2532 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2535 ProcessMethodType(method);
2537 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && method->memberAccess == 1)
2538 CheckPublicDataType(method->dataType, 1, "class method");
2539 strcpy(newId, "__ecereMethod_");
2540 FullClassNameCat(newId, symbol->string, 0);
2542 strcat(newId, id->string);
2543 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2545 if(method->type != 1)
2549 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2550 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2558 if(initDeclarators != (((void *)0)))
2559 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2562 void PreProcessClassDefinitions()
2564 struct External * external, * next;
2566 curExternal = (((void *)0));
2569 for(external = (*ast).first; external; external = next)
2571 next = external->next;
2572 curExternal = external;
2573 if(external->type == 2)
2575 struct ClassDefinition * _class = external->__anon1._class;
2577 if(_class->definitions)
2579 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2582 else if(external->type == 1)
2584 struct Declaration * declaration = external->__anon1.declaration;
2586 if(declaration && declaration->type == 1)
2588 if(declaration->__anon1.__anon1.specifiers)
2590 struct Specifier * specifier;
2592 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2594 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)))
2596 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2600 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2601 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2603 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2606 initDeclarators = declaration->__anon1.__anon1.declarators;
2607 declaration->__anon1.__anon1.declarators = (((void *)0));
2609 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);
2615 else if(declaration && inCompiler && declaration->type == 3)
2617 yylloc = declaration->loc;
2618 if(declaration->declMode == 1)
2619 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2620 else if(declaration->declMode != 3)
2621 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2624 else if(external->type == 3)
2627 else if(inCompiler && external->type == 0)
2629 yylloc = external->__anon1.function->loc;
2630 if(!external->__anon1.function->type)
2631 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2632 if(external->__anon1.function->declMode == 1)
2633 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2634 else if(external->__anon1.function->declMode != 3)
2635 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2641 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2643 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2645 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2646 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);