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, 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
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;
345 struct __ecereNameSpace__ecere__com__Property;
347 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
349 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);
351 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
353 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
355 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);
359 extern void FreeDeclarator(struct Declarator * decl);
361 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
363 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
365 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
367 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
369 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
371 struct __ecereNameSpace__ecere__com__BTNamedLink;
373 struct __ecereNameSpace__ecere__com__BTNamedLink
376 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
377 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
378 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
385 extern struct Symbol * FindClass(const char * name);
389 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
391 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
395 extern struct Specifier * MkSpecifierName(const char * name);
397 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
399 extern void FreeSpecifier(struct Specifier * spec);
401 extern struct Specifier * MkSpecifier(int specifier);
403 extern struct Specifier * CopySpecifier(struct Specifier * spec);
405 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
409 extern struct Identifier * GetDeclId(struct Declarator * decl);
413 struct Identifier * prev;
414 struct Identifier * next;
416 struct Symbol * classSym;
417 struct Specifier * _class;
419 struct Identifier * badID;
422 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
424 extern struct Identifier * MkIdentifier(const char * string);
426 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
432 struct Specifier * prev;
433 struct Specifier * next;
441 struct ExtDecl * extDecl;
443 struct Symbol * symbol;
444 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
445 struct Specifier * nsSpec;
446 } ecere_gcc_struct __anon1;
449 struct Identifier * id;
450 struct __ecereNameSpace__ecere__sys__OldList * list;
451 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
452 struct __ecereNameSpace__ecere__sys__OldList * definitions;
453 unsigned int addNameSpace;
454 struct Context * ctx;
455 struct ExtDecl * extDeclStruct;
456 } ecere_gcc_struct __anon2;
457 struct Expression * expression;
458 struct Specifier * _class;
459 struct TemplateParameter * templateParameter;
460 } ecere_gcc_struct __anon1;
465 struct Declarator * prev;
466 struct Declarator * next;
469 struct Symbol * symbol;
470 struct Declarator * declarator;
473 struct Identifier * identifier;
476 struct Expression * exp;
477 struct Expression * posExp;
478 struct Attrib * attrib;
479 } ecere_gcc_struct structDecl;
482 struct Expression * exp;
483 struct Specifier * enumClass;
484 } ecere_gcc_struct array;
487 struct __ecereNameSpace__ecere__sys__OldList * parameters;
488 } ecere_gcc_struct function;
491 struct Pointer * pointer;
492 } ecere_gcc_struct pointer;
495 struct ExtDecl * extended;
496 } ecere_gcc_struct extended;
497 } ecere_gcc_struct __anon1;
500 extern struct Expression * QMkExpId(const char * id);
502 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
504 extern struct Expression * CopyExpression(struct Expression * exp);
506 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
508 extern struct Expression * MkExpIdentifier(struct Identifier * id);
510 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
512 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
516 struct __ecereNameSpace__ecere__com__Property
518 struct __ecereNameSpace__ecere__com__Property * prev;
519 struct __ecereNameSpace__ecere__com__Property * next;
521 unsigned int isProperty;
524 struct __ecereNameSpace__ecere__com__Class * _class;
525 const char * dataTypeString;
526 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
527 struct Type * dataType;
528 void (* Set)(void * , int);
529 int (* Get)(void * );
530 unsigned int (* IsSet)(void * );
534 unsigned int conversion;
535 unsigned int watcherOffset;
536 const char * category;
537 unsigned int compiled;
538 unsigned int selfWatchable;
539 unsigned int isWatchable;
542 extern struct Type * MkClassType(const char * name);
544 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
546 extern void FreeType(struct Type * type);
548 struct ClassFunction;
550 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
556 struct Initializer * prev;
557 struct Initializer * next;
562 struct Expression * exp;
563 struct __ecereNameSpace__ecere__sys__OldList * list;
564 } ecere_gcc_struct __anon1;
565 unsigned int isConstant;
566 struct Identifier * id;
569 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
571 extern void FreeInitializer(struct Initializer * initializer);
573 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
575 struct __ecereNameSpace__ecere__com__Method;
577 struct __ecereNameSpace__ecere__com__Method
580 struct __ecereNameSpace__ecere__com__Method * parent;
581 struct __ecereNameSpace__ecere__com__Method * left;
582 struct __ecereNameSpace__ecere__com__Method * right;
587 struct __ecereNameSpace__ecere__com__Class * _class;
589 const char * dataTypeString;
590 struct Type * dataType;
597 struct Symbol * parent;
598 struct Symbol * left;
599 struct Symbol * right;
604 struct __ecereNameSpace__ecere__com__Method * method;
605 struct __ecereNameSpace__ecere__com__Property * _property;
606 struct __ecereNameSpace__ecere__com__Class * registered;
607 } ecere_gcc_struct __anon1;
608 unsigned int notYetDeclared;
613 struct External * pointerExternal;
614 struct External * structExternal;
615 } ecere_gcc_struct __anon1;
618 struct External * externalGet;
619 struct External * externalSet;
620 struct External * externalPtr;
621 struct External * externalIsSet;
622 } ecere_gcc_struct __anon2;
625 struct External * methodExternal;
626 struct External * methodCodeExternal;
627 } ecere_gcc_struct __anon3;
628 } ecere_gcc_struct __anon2;
629 unsigned int imported;
630 unsigned int declaredStructSym;
631 struct __ecereNameSpace__ecere__com__Class * _class;
632 unsigned int declaredStruct;
633 unsigned int needConstructor;
634 unsigned int needDestructor;
635 char * constructorName;
638 char * destructorName;
639 struct ModuleImport * module;
640 struct ClassImport * _import;
641 struct Location nameLoc;
642 unsigned int isParam;
643 unsigned int isRemote;
644 unsigned int isStruct;
645 unsigned int fireWatchersDone;
647 unsigned int classData;
648 unsigned int isStatic;
650 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
651 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
652 struct Context * ctx;
654 struct Expression * propCategory;
655 unsigned int mustRegister;
665 struct Symbol * _class;
668 struct __ecereNameSpace__ecere__sys__OldList members;
670 } ecere_gcc_struct __anon1;
673 struct Type * returnType;
674 struct __ecereNameSpace__ecere__sys__OldList params;
675 struct Symbol * thisClass;
676 unsigned int staticMethod;
677 struct TemplateParameter * thisClassTemplate;
678 } ecere_gcc_struct __anon2;
681 struct __ecereNameSpace__ecere__com__Method * method;
682 struct __ecereNameSpace__ecere__com__Class * methodClass;
683 struct __ecereNameSpace__ecere__com__Class * usedClass;
684 } ecere_gcc_struct __anon3;
687 struct Type * arrayType;
689 struct Expression * arraySizeExp;
690 unsigned int freeExp;
691 struct Symbol * enumClass;
692 } ecere_gcc_struct __anon4;
694 struct TemplateParameter * templateParameter;
695 } ecere_gcc_struct __anon1;
700 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
708 unsigned int isSigned : 1;
709 unsigned int constant : 1;
710 unsigned int truth : 1;
711 unsigned int byReference : 1;
712 unsigned int extraParam : 1;
713 unsigned int directClassAccess : 1;
714 unsigned int computing : 1;
715 unsigned int keepCast : 1;
716 unsigned int passAsTemplate : 1;
717 unsigned int dllExport : 1;
718 unsigned int attrStdcall : 1;
719 unsigned int declaredWithStruct : 1;
720 unsigned int typedByReference : 1;
721 unsigned int casted : 1;
722 unsigned int pointerAlignment : 1;
723 unsigned int isLong : 1;
724 unsigned int signedBeforePromotion : 1;
727 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);
729 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
731 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
737 struct ClassFunction * prev;
738 struct ClassFunction * next;
740 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
741 struct Declarator * declarator;
742 struct __ecereNameSpace__ecere__sys__OldList * declarations;
743 struct Statement * body;
744 struct __ecereNameSpace__ecere__com__Class * _class;
745 struct __ecereNameSpace__ecere__sys__OldList attached;
748 struct Symbol * propSet;
749 unsigned int isVirtual;
750 unsigned int isConstructor;
751 unsigned int isDestructor;
752 unsigned int dontMangle;
759 struct Statement * prev;
760 struct Statement * next;
765 struct __ecereNameSpace__ecere__sys__OldList * expressions;
768 struct Identifier * id;
769 struct Statement * stmt;
770 } ecere_gcc_struct labeled;
773 struct Expression * exp;
774 struct Statement * stmt;
775 } ecere_gcc_struct caseStmt;
778 struct __ecereNameSpace__ecere__sys__OldList * declarations;
779 struct __ecereNameSpace__ecere__sys__OldList * statements;
780 struct Context * context;
781 unsigned int isSwitch;
782 } ecere_gcc_struct compound;
785 struct __ecereNameSpace__ecere__sys__OldList * exp;
786 struct Statement * stmt;
787 struct Statement * elseStmt;
788 } ecere_gcc_struct ifStmt;
791 struct __ecereNameSpace__ecere__sys__OldList * exp;
792 struct Statement * stmt;
793 } ecere_gcc_struct switchStmt;
796 struct __ecereNameSpace__ecere__sys__OldList * exp;
797 struct Statement * stmt;
798 } ecere_gcc_struct whileStmt;
801 struct __ecereNameSpace__ecere__sys__OldList * exp;
802 struct Statement * stmt;
803 } ecere_gcc_struct doWhile;
806 struct Statement * init;
807 struct Statement * check;
808 struct __ecereNameSpace__ecere__sys__OldList * increment;
809 struct Statement * stmt;
810 } ecere_gcc_struct forStmt;
813 struct Identifier * id;
814 } ecere_gcc_struct gotoStmt;
817 struct Specifier * spec;
819 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
820 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
821 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
822 } ecere_gcc_struct asmStmt;
825 struct Expression * watcher;
826 struct Expression * object;
827 struct __ecereNameSpace__ecere__sys__OldList * watches;
828 } ecere_gcc_struct _watch;
831 struct Identifier * id;
832 struct __ecereNameSpace__ecere__sys__OldList * exp;
833 struct __ecereNameSpace__ecere__sys__OldList * filter;
834 struct Statement * stmt;
835 } ecere_gcc_struct forEachStmt;
836 struct Declaration * decl;
837 } ecere_gcc_struct __anon1;
840 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
842 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
844 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
846 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
848 struct __ecereNameSpace__ecere__sys__BinaryTree;
850 struct __ecereNameSpace__ecere__sys__BinaryTree
852 struct __ecereNameSpace__ecere__sys__BTNode * root;
854 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
855 void (* FreeKey)(void * key);
858 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
860 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
862 struct __ecereNameSpace__ecere__com__DataMember;
864 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
870 const char * dataTypeString;
871 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
872 } ecere_gcc_struct __anon1;
873 struct __ecereNameSpace__ecere__com__DataValue expression;
876 const char * memberString;
879 struct __ecereNameSpace__ecere__com__DataMember * member;
880 struct __ecereNameSpace__ecere__com__Property * prop;
881 struct __ecereNameSpace__ecere__com__Method * method;
882 } ecere_gcc_struct __anon1;
883 } ecere_gcc_struct __anon2;
884 } ecere_gcc_struct __anon1;
887 struct __ecereNameSpace__ecere__com__DataMember
889 struct __ecereNameSpace__ecere__com__DataMember * prev;
890 struct __ecereNameSpace__ecere__com__DataMember * next;
892 unsigned int isProperty;
895 struct __ecereNameSpace__ecere__com__Class * _class;
896 const char * dataTypeString;
897 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
898 struct Type * dataType;
902 struct __ecereNameSpace__ecere__sys__OldList members;
903 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
905 short structAlignment;
906 short pointerAlignment;
909 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);
911 struct __ecereNameSpace__ecere__com__Module;
913 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
915 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
917 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);
919 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
921 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);
923 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);
925 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);
931 struct TypeName * prev;
932 struct TypeName * next;
934 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
935 struct Declarator * declarator;
937 struct Expression * bitCount;
940 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
942 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
946 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
948 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
950 struct ClassDefinition;
954 struct Context * parent;
955 struct __ecereNameSpace__ecere__sys__BinaryTree types;
956 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
957 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
958 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
961 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
962 struct ClassDefinition * classDef;
963 unsigned int templateTypesOnly;
964 unsigned int hasNameSpace;
967 struct ClassDefinition
969 struct ClassDefinition * prev;
970 struct ClassDefinition * next;
972 struct Specifier * _class;
973 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
974 struct __ecereNameSpace__ecere__sys__OldList * definitions;
975 struct Symbol * symbol;
976 struct Location blockStart;
977 struct Location nameLoc;
979 unsigned int deleteWatchable;
982 struct Instantiation;
986 struct Expression * prev;
987 struct Expression * next;
995 struct Identifier * identifier;
996 } ecere_gcc_struct __anon1;
997 struct Statement * compound;
998 struct Instantiation * instance;
1002 unsigned int intlString;
1003 unsigned int wideString;
1004 } ecere_gcc_struct __anon2;
1005 struct __ecereNameSpace__ecere__sys__OldList * list;
1008 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1009 struct Declarator * decl;
1010 } ecere_gcc_struct _classExp;
1013 struct Identifier * id;
1014 } ecere_gcc_struct classData;
1017 struct Expression * exp;
1018 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1019 struct Location argLoc;
1020 } ecere_gcc_struct call;
1023 struct Expression * exp;
1024 struct __ecereNameSpace__ecere__sys__OldList * index;
1025 } ecere_gcc_struct index;
1028 struct Expression * exp;
1029 struct Identifier * member;
1031 unsigned int thisPtr;
1032 } ecere_gcc_struct member;
1036 struct Expression * exp1;
1037 struct Expression * exp2;
1038 } ecere_gcc_struct op;
1039 struct TypeName * typeName;
1040 struct Specifier * _class;
1043 struct TypeName * typeName;
1044 struct Expression * exp;
1045 } ecere_gcc_struct cast;
1048 struct Expression * cond;
1049 struct __ecereNameSpace__ecere__sys__OldList * exp;
1050 struct Expression * elseExp;
1051 } ecere_gcc_struct cond;
1054 struct TypeName * typeName;
1055 struct Expression * size;
1056 } ecere_gcc_struct _new;
1059 struct TypeName * typeName;
1060 struct Expression * size;
1061 struct Expression * exp;
1062 } ecere_gcc_struct _renew;
1066 struct Identifier * id;
1067 } ecere_gcc_struct db;
1070 struct Expression * ds;
1071 struct Expression * name;
1072 } ecere_gcc_struct dbopen;
1075 struct TypeName * typeName;
1076 struct Initializer * initializer;
1077 } ecere_gcc_struct initializer;
1080 struct Expression * exp;
1081 struct TypeName * typeName;
1082 } ecere_gcc_struct vaArg;
1083 } ecere_gcc_struct __anon1;
1084 unsigned int debugValue;
1085 struct __ecereNameSpace__ecere__com__DataValue val;
1087 unsigned int hasAddress;
1088 struct Type * expType;
1089 struct Type * destType;
1092 unsigned int byReference;
1093 unsigned int isConstant;
1094 unsigned int addedThis;
1095 unsigned int needCast;
1096 unsigned int thisPtr;
1097 unsigned int opDestType;
1098 unsigned int needTemplateCast;
1101 struct Instantiation
1103 struct Instantiation * prev;
1104 struct Instantiation * next;
1105 struct Location loc;
1106 struct Specifier * _class;
1107 struct Expression * exp;
1108 struct __ecereNameSpace__ecere__sys__OldList * members;
1109 struct Symbol * symbol;
1110 unsigned int fullSet;
1111 unsigned int isConstant;
1112 unsigned char * data;
1113 struct Location nameLoc;
1114 struct Location insideLoc;
1120 struct Declaration * prev;
1121 struct Declaration * next;
1122 struct Location loc;
1128 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1129 struct __ecereNameSpace__ecere__sys__OldList * declarators;
1130 } ecere_gcc_struct __anon1;
1131 struct Instantiation * inst;
1134 struct Identifier * id;
1135 struct Expression * exp;
1136 } ecere_gcc_struct __anon2;
1137 } ecere_gcc_struct __anon1;
1138 struct Specifier * extStorage;
1139 struct Symbol * symbol;
1143 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1149 struct MembersInit * prev;
1150 struct MembersInit * next;
1151 struct Location loc;
1155 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1156 struct ClassFunction * function;
1157 } ecere_gcc_struct __anon1;
1164 struct MemberInit * prev;
1165 struct MemberInit * next;
1166 struct Location loc;
1167 struct Location realLoc;
1168 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1169 struct Initializer * initializer;
1171 unsigned int variable;
1172 unsigned int takeOutExp;
1175 static void CheckPublicExpression(struct Expression * exp, int access);
1177 static void CheckPublicInitializer(struct Initializer * init, int access)
1182 CheckPublicExpression(init->__anon1.exp, access);
1186 struct Initializer * i;
1188 for(i = (*init->__anon1.list).first; i; i = i->next)
1189 CheckPublicInitializer(i, access);
1195 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word);
1197 static void CheckPublicTypeName(struct TypeName * type, int access)
1199 if(type->qualifiers)
1201 struct Specifier * spec;
1203 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1207 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1209 CheckPublicClass(classSym, access, "define");
1215 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1223 CheckPublicClass(type->__anon1._class, access, word);
1233 struct Type * param;
1235 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1236 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1237 CheckPublicDataType(param, access, word);
1238 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1242 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1243 if(type->__anon1.__anon4.enumClass)
1244 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1248 CheckPublicDataType(type->__anon1.type, access, word);
1257 CheckPublicClass(type->__anon1._class, access, word);
1264 static void CheckPublicExpression(struct Expression * exp, int access)
1277 if(exp->__anon1.op.exp1)
1278 CheckPublicExpression(exp->__anon1.op.exp1, access);
1279 if(exp->__anon1.op.exp2)
1280 CheckPublicExpression(exp->__anon1.op.exp2, access);
1284 struct Expression * e;
1286 for(e = (*exp->__anon1.list).first; e; e = e->next)
1287 CheckPublicExpression(e, access);
1292 struct Expression * e;
1294 CheckPublicExpression(exp->__anon1.index.exp, access);
1295 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1296 CheckPublicExpression(e, access);
1301 struct Expression * e;
1303 CheckPublicExpression(exp->__anon1.call.exp, access);
1304 if(exp->__anon1.call.arguments)
1306 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1307 CheckPublicExpression(e, access);
1313 CheckPublicExpression(exp->__anon1.member.exp, access);
1318 CheckPublicExpression(exp->__anon1.member.exp, access);
1322 CheckPublicTypeName(exp->__anon1.typeName, access);
1326 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1327 if(exp->__anon1.cast.exp)
1328 CheckPublicExpression(exp->__anon1.cast.exp, access);
1333 struct Expression * e;
1335 CheckPublicExpression(exp->__anon1.cond.cond, access);
1336 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1337 CheckPublicExpression(e, access);
1338 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1343 CheckPublicExpression(exp->__anon1._new.size, access);
1347 CheckPublicExpression(exp->__anon1._renew.size, access);
1348 CheckPublicExpression(exp->__anon1._renew.exp, access);
1352 struct MembersInit * members;
1354 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1355 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1357 if(members->type == 0)
1359 struct MemberInit * member;
1361 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1363 CheckPublicInitializer(member->initializer, access);
1377 struct ClassDef * prev;
1378 struct ClassDef * next;
1379 struct Location loc;
1383 struct Declaration * decl;
1384 struct ClassFunction * function;
1385 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1386 struct PropertyDef * propertyDef;
1387 struct PropertyWatch * propertyWatch;
1389 struct Identifier * defaultProperty;
1392 struct Identifier * id;
1393 struct Initializer * initializer;
1394 } ecere_gcc_struct __anon1;
1395 } ecere_gcc_struct __anon1;
1402 struct PropertyDef * prev;
1403 struct PropertyDef * next;
1404 struct Location loc;
1405 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1406 struct Declarator * declarator;
1407 struct Identifier * id;
1408 struct Statement * getStmt;
1409 struct Statement * setStmt;
1410 struct Statement * issetStmt;
1411 struct Symbol * symbol;
1412 struct Expression * category;
1415 unsigned int conversion : 1;
1416 unsigned int isWatchable : 1;
1417 unsigned int isDBProp : 1;
1418 } ecere_gcc_struct __anon1;
1421 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1423 if(definitions != (((void *)0)))
1425 struct ClassDef * def;
1427 for(def = definitions->first; def; def = def->next)
1431 struct Declaration * decl = def->__anon1.decl;
1432 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1437 struct Declarator * d;
1439 if(decl->__anon1.__anon1.declarators)
1441 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1443 struct Identifier * declId = GetDeclId(d);
1449 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1451 dataMember = link ? link->data : (((void *)0));
1454 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1456 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1460 else if(decl->__anon1.__anon1.specifiers)
1462 struct Specifier * spec;
1464 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1466 if(spec->type == 3 || spec->type == 4)
1468 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1470 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1472 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1476 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1478 dataMember = link ? link->data : (((void *)0));
1481 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1483 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1489 else if(decl->type == 2)
1491 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1498 struct FunctionDefinition;
1500 typedef union YYSTYPE
1505 struct Identifier * id;
1506 struct Expression * exp;
1507 struct Specifier * specifier;
1508 struct __ecereNameSpace__ecere__sys__OldList * list;
1509 struct Enumerator * enumerator;
1510 struct Declarator * declarator;
1511 struct Pointer * pointer;
1512 struct Initializer * initializer;
1513 struct InitDeclarator * initDeclarator;
1514 struct TypeName * typeName;
1515 struct Declaration * declaration;
1516 struct Statement * stmt;
1517 struct FunctionDefinition * function;
1518 struct External * external;
1519 struct Context * context;
1520 struct AsmField * asmField;
1521 struct Attrib * attrib;
1522 struct ExtDecl * extDecl;
1523 struct Attribute * attribute;
1524 struct Instantiation * instance;
1525 struct MembersInit * membersInit;
1526 struct MemberInit * memberInit;
1527 struct ClassFunction * classFunction;
1528 struct ClassDefinition * _class;
1529 struct ClassDef * classDef;
1530 struct PropertyDef * prop;
1532 struct Symbol * symbol;
1533 struct PropertyWatch * propertyWatch;
1534 struct TemplateParameter * templateParameter;
1535 struct TemplateArgument * templateArgument;
1536 struct TemplateDatatype * templateDatatype;
1537 struct DBTableEntry * dbtableEntry;
1538 struct DBIndexItem * dbindexItem;
1539 struct DBTableDef * dbtableDef;
1540 } ecere_gcc_struct YYSTYPE;
1542 extern YYSTYPE yylval;
1546 struct External * prev;
1547 struct External * next;
1548 struct Location loc;
1550 struct Symbol * symbol;
1553 struct FunctionDefinition * function;
1554 struct ClassDefinition * _class;
1555 struct Declaration * declaration;
1556 char * importString;
1557 struct Identifier * id;
1558 struct DBTableDef * table;
1559 } ecere_gcc_struct __anon1;
1561 struct External * fwdDecl;
1562 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1563 struct __ecereNameSpace__ecere__com__Instance * incoming;
1564 int nonBreakableIncoming;
1567 struct FunctionDefinition
1569 struct FunctionDefinition * prev;
1570 struct FunctionDefinition * next;
1571 struct Location loc;
1572 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1573 struct Declarator * declarator;
1574 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1575 struct Statement * body;
1576 struct __ecereNameSpace__ecere__com__Class * _class;
1577 struct __ecereNameSpace__ecere__sys__OldList attached;
1580 struct Symbol * propSet;
1582 unsigned int propertyNoThis;
1585 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
1587 struct __ecereNameSpace__ecere__com__NameSpace;
1589 struct __ecereNameSpace__ecere__com__NameSpace
1592 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1593 struct __ecereNameSpace__ecere__com__NameSpace * left;
1594 struct __ecereNameSpace__ecere__com__NameSpace * right;
1596 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1597 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1598 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1599 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1600 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1603 struct __ecereNameSpace__ecere__com__Class
1605 struct __ecereNameSpace__ecere__com__Class * prev;
1606 struct __ecereNameSpace__ecere__com__Class * next;
1612 unsigned int (* Constructor)(void * );
1613 void (* Destructor)(void * );
1616 struct __ecereNameSpace__ecere__com__Class * base;
1617 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1618 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1619 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1620 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1621 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1622 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1626 struct __ecereNameSpace__ecere__com__Instance * module;
1627 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1628 const char * dataTypeString;
1629 struct Type * dataType;
1631 int defaultAlignment;
1632 void (* Initialize)();
1634 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1635 const char * designerClass;
1636 unsigned int noExpansion;
1637 const char * defaultProperty;
1638 unsigned int comRedefinition;
1641 unsigned int internalDecl;
1643 unsigned int computeSize;
1644 short structAlignment;
1645 short pointerAlignment;
1646 int destructionWatchOffset;
1648 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1649 int inheritanceAccess;
1650 const char * fullName;
1652 struct __ecereNameSpace__ecere__sys__OldList conversions;
1653 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1654 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1655 struct __ecereNameSpace__ecere__com__Class * templateClass;
1656 struct __ecereNameSpace__ecere__sys__OldList templatized;
1658 unsigned int isInstanceClass;
1659 unsigned int byValueSystemClass;
1662 struct __ecereNameSpace__ecere__com__Application
1665 const char * * argv;
1667 unsigned int isGUIApp;
1668 struct __ecereNameSpace__ecere__sys__OldList allModules;
1669 char * parsedCommand;
1670 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1673 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1677 else if((*ns).parent)
1678 return NameSpaceContained((*ns).parent, parent);
1683 static void AddSimpleBaseMembers(struct External * external, struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1685 if(_class->type != 1000)
1686 AddMembers(external, list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1689 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
1691 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
1693 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1695 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1697 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
1699 struct __ecereNameSpace__ecere__com__Module
1701 struct __ecereNameSpace__ecere__com__Instance * application;
1702 struct __ecereNameSpace__ecere__sys__OldList classes;
1703 struct __ecereNameSpace__ecere__sys__OldList defines;
1704 struct __ecereNameSpace__ecere__sys__OldList functions;
1705 struct __ecereNameSpace__ecere__sys__OldList modules;
1706 struct __ecereNameSpace__ecere__com__Instance * prev;
1707 struct __ecereNameSpace__ecere__com__Instance * next;
1713 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1714 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1717 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
1722 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1724 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1728 if(regClass->templateClass)
1729 regClass = regClass->templateClass;
1730 if(classSym->isStatic && access != 3)
1732 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1734 else if(access == 1)
1736 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))
1738 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1739 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1745 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)
1747 char structName[1024];
1748 char className[1024];
1749 char constructorName[1024];
1750 char destructorName[1024];
1751 struct __ecereNameSpace__ecere__com__Class * regClass;
1752 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1753 unsigned int isUnion = classType == 6;
1754 struct External * external = (((void *)0));
1755 struct ClassDef * def;
1756 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1757 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1762 classDataList = MkList();
1764 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1767 classType = regClass->type;
1771 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && regClass->inheritanceAccess == 1)
1773 if(!regClass->base->symbol)
1774 regClass->base->symbol = FindClass(regClass->base->fullName);
1775 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1777 else if(!symbol->isStatic && regClass->base)
1779 if(!regClass->base->symbol)
1780 regClass->base->symbol = FindClass(regClass->base->fullName);
1781 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1784 if(definitions != (((void *)0)))
1786 for(def = definitions->first; def; def = def->next)
1790 struct __ecereNameSpace__ecere__com__DataMember * member;
1791 struct __ecereNameSpace__ecere__com__Property * prop;
1792 struct __ecereNameSpace__ecere__com__Method * method;
1794 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1796 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1798 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1800 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1802 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1804 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1809 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1816 external = MkExternalDeclaration((((void *)0)));
1817 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1818 curExternal = external;
1819 curExternal->symbol = symbol;
1821 if((classType == 1 || classType == 5) && inCompiler)
1823 AddSimpleBaseMembers(external, list, regClass->base, regClass);
1825 if(definitions != (((void *)0)))
1829 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
1830 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1831 else if(!symbol->isStatic)
1832 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1834 for(def = definitions->first; def; def = def->next)
1839 struct Declaration * decl = def->__anon1.decl;
1844 if(inCompiler && classType != 2)
1846 ListAdd(list, MkClassDefDeclaration(decl));
1847 def->__anon1.decl = (((void *)0));
1850 else if(decl->type == 2)
1852 struct Instantiation * inst = decl->__anon1.inst;
1853 struct Expression * exp = inst->exp;
1854 struct Symbol * classSym;
1858 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1859 struct Declarator * d;
1861 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1862 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1865 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1867 ListAdd(declarators, d);
1868 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1869 ListAdd(list, MkClassDefDeclaration(decl));
1871 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1872 exp->__anon1.member.exp = QMkExpId("this");
1873 exp->__anon1.member.memberType = 3;
1874 exp->__anon1.member.thisPtr = 1;
1879 FreeList(specifiers, (void *)(FreeSpecifier));
1882 classSym = inst->_class->__anon1.__anon1.symbol;
1883 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1885 if(inst->members && (*inst->members).count)
1886 symbol->needConstructor = 1;
1890 symbol->needConstructor = 1;
1891 symbol->needDestructor = 1;
1895 else if(def->type == 9)
1897 struct Declaration * decl = def->__anon1.decl;
1901 if(inCompiler && classType != 2)
1903 ListAdd(classDataList, MkClassDefDeclaration(decl));
1904 def->__anon1.decl = (((void *)0));
1908 else if(def->type == 1)
1909 symbol->needConstructor = 1;
1910 else if(def->type == 4)
1911 symbol->needConstructor = 1;
1912 else if(def->type == 0)
1914 struct ClassFunction * func = def->__anon1.function;
1916 if(func->isDestructor)
1921 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1925 symbol->needDestructor = 1;
1927 if(!inCompiler && func->body)
1929 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1931 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1935 if(func->isConstructor)
1940 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1944 symbol->needConstructor = 1;
1946 if(!inCompiler && func->body)
1948 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1950 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1959 external->symbol = (((void *)0));
1962 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1964 initDeclarators = (((void *)0));
1965 strcpy(structName, symbol->string);
1966 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1968 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1970 spec->__anon1.__anon2.extDeclStruct = extDecl;
1971 ListAdd(specs, spec);
1973 external->symbol = symbol;
1974 if(symbol->__anon2.__anon1.structExternal)
1977 struct TopoEdge * e;
1978 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->incoming;
1980 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__ ({
1981 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1983 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1984 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1985 __ecereMethod_External_CreateUniqueEdge(external, e->from, e->breakable);
1988 struct TopoEdge * e;
1989 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->outgoing;
1991 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__ ({
1992 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1994 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1995 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1996 __ecereMethod_External_CreateUniqueEdge(e->to, external, e->breakable);
1998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), symbol->__anon2.__anon1.structExternal);
1999 FreeExternal(symbol->__anon2.__anon1.structExternal);
2001 symbol->__anon2.__anon1.structExternal = external;
2002 external->__anon1.declaration = MkDeclaration(specs, declarators);
2004 symbol->declaredStruct = 1;
2008 curExternal = external->prev;
2009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
2010 FreeExternal(external);
2011 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
2013 if((*classDataList).count)
2015 char classDataStructName[1024];
2016 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2017 struct External * external;
2019 strcpy(classDataStructName, "__ecereClassData_");
2020 FullClassNameCat(classDataStructName, symbol->string, 0);
2021 declMode = structDeclMode = 0;
2022 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
2023 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
2024 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
2026 symbol->classData = 1;
2029 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
2034 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2036 strcpy(className, "__ecereClass_");
2037 FullClassNameCat(className, symbol->string, 1);
2038 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2039 if(!strstr(sourceFile, ".main.ec"))
2040 ListAdd(specs, MkSpecifier(STATIC));
2041 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2042 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2043 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2044 DeclareStruct(symbol->__anon2.__anon1.pointerExternal, "ecere::com::Class", 0, 1);
2045 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon1.pointerExternal);
2046 after = symbol->__anon2.__anon3.methodExternal;
2048 if(symbol->needDestructor)
2050 struct ClassFunction * function;
2051 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2052 struct Declarator * decl;
2053 struct Statement * body;
2054 struct Context * context;
2055 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2057 strcpy(destructorName, "__ecereDestructor_");
2058 FullClassNameCat(destructorName, symbol->string, 0);
2059 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2060 ListAdd(specs, MkSpecifier(VOID));
2061 context = PushContext();
2062 statements = MkList();
2063 if(definitions != (((void *)0)))
2065 for(def = definitions->first; def; def = def->next)
2067 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2069 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2070 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2072 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2074 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2076 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2078 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2080 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2082 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2087 if(destructor && destructor->body)
2089 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2090 destructor->body->__anon1.compound.context->parent = context;
2091 destructor->body = (((void *)0));
2093 body = MkCompoundStmt(declarations, statements);
2094 PopContext(context);
2095 body->__anon1.compound.context = context;
2096 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2097 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2098 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2099 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2100 ProcessClassFunctionBody(function, body);
2101 function->dontMangle = 1;
2102 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2104 if(symbol->needConstructor && inCompiler)
2106 struct ClassFunction * function;
2107 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2108 struct Declarator * decl;
2109 struct Statement * body;
2110 struct Context * context;
2111 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2113 strcpy(constructorName, "__ecereConstructor_");
2114 FullClassNameCat(constructorName, symbol->string, 0);
2115 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2116 ListAdd(specs, MkSpecifierName("bool"));
2117 context = PushContext();
2118 statements = MkList();
2119 if(definitions != (((void *)0)))
2121 for(def = definitions->first; def; def = def->next)
2123 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2125 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2126 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2128 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2130 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2133 newInst->members = (((void *)0));
2134 newInst->exp = CopyExpression(inst->exp);
2135 newInst->_class = CopySpecifier(inst->_class);
2136 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2139 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2141 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2145 for(def = definitions->first; def; def = def->next)
2147 if(def->type == 1 && def->__anon1.defProperties)
2149 struct MemberInit * propertyDef;
2151 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2153 struct Expression * memberExp;
2154 struct Identifier * id = (*propertyDef->identifiers).first;
2158 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2159 for(id = id->next; id; id = id->next)
2160 memberExp = MkExpMember(memberExp, id);
2161 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2163 if(propertyDef->initializer)
2165 if(propertyDef->initializer->type == 0)
2166 propertyDef->initializer->__anon1.exp = (((void *)0));
2167 FreeInitializer(propertyDef->initializer);
2169 propertyDef->initializer = (((void *)0));
2170 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2174 for(def = definitions->first; def; def = def->next)
2176 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2178 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2179 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2181 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2183 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2185 def->__anon1.decl->__anon1.inst = (((void *)0));
2186 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2192 if(constructor && constructor->body)
2194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2195 constructor->body->__anon1.compound.context->parent = context;
2196 constructor->body = (((void *)0));
2198 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2199 body = MkCompoundStmt(declarations, statements);
2200 PopContext(context);
2201 body->__anon1.compound.context = context;
2202 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2203 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2204 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2205 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2206 ProcessClassFunctionBody(function, body);
2207 function->dontMangle = 1;
2208 if(definitions != (((void *)0)))
2209 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2212 if(definitions != (((void *)0)))
2214 for(def = definitions->first; def; def = def->next)
2216 if(def->type == 3 && def->__anon1.propertyDef)
2218 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2219 struct ClassDef * after = def;
2220 struct ClassDef * newDef;
2224 yylloc = propertyDef->loc;
2225 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && def->memberAccess == 1)
2226 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2227 else if(!symbol->isStatic)
2228 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2232 struct ClassFunction * func;
2233 struct Declarator * decl;
2235 struct __ecereNameSpace__ecere__sys__OldList * params;
2237 if(propertyDef->getStmt && propertyDef->id)
2239 strcpy(name, "__ecereProp_");
2240 FullClassNameCat(name, symbol->string, 0);
2241 strcat(name, "_Get_");
2242 FullClassNameCat(name, propertyDef->id->string, 1);
2244 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)
2246 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2247 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2248 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2252 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2253 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2255 ProcessClassFunctionBody(func, propertyDef->getStmt);
2256 func->declarator->symbol = propertyDef->symbol;
2257 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2258 func->dontMangle = 1;
2259 newDef = MkClassDefFunction(func);
2260 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2263 propertyDef->getStmt = (((void *)0));
2265 func->body = (((void *)0));
2267 if(propertyDef->setStmt && propertyDef->id)
2269 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2271 strcpy(name, "__ecereProp_");
2272 FullClassNameCat(name, symbol->string, 0);
2273 strcat(name, "_Set_");
2274 FullClassNameCat(name, propertyDef->id->string, 1);
2276 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2277 if(propertyDef->__anon1.isDBProp)
2279 struct Specifier * spec;
2280 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2282 for(spec = (*specs).first; spec; spec = spec->next)
2283 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2288 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2290 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2291 unsigned int useVoid = 0;
2293 switch(regClass->type)
2301 useVoid = !isConversion;
2304 useVoid = !isConversion;
2305 if(useVoid && !propertyDef->__anon1.isDBProp)
2306 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2308 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2310 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2311 ProcessClassFunctionBody(func, propertyDef->setStmt);
2312 func->dontMangle = 1;
2313 func->declarator->symbol = propertyDef->symbol;
2314 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2315 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2316 func->propSet = propertyDef->symbol;
2317 newDef = MkClassDefFunction(func);
2318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2321 propertyDef->setStmt = (((void *)0));
2323 func->body = (((void *)0));
2325 if(propertyDef->issetStmt && propertyDef->id)
2327 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2329 strcpy(name, "__ecereProp_");
2330 FullClassNameCat(name, symbol->string, 0);
2331 strcat(name, "_IsSet_");
2332 FullClassNameCat(name, propertyDef->id->string, 1);
2334 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2335 ListAdd(specifiers, MkSpecifierName("bool"));
2336 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2337 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2338 func->dontMangle = 1;
2339 func->declarator->symbol = propertyDef->symbol;
2340 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2341 newDef = MkClassDefFunction(func);
2342 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2345 propertyDef->issetStmt = (((void *)0));
2347 func->body = (((void *)0));
2349 if(propertyDef->id && inCompiler)
2351 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2352 struct Declaration * decl;
2353 struct External * external;
2354 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2356 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2357 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2358 ListAdd(specifiers, MkSpecifierName("Property"));
2359 strcpy(name, "__ecereProp_");
2360 FullClassNameCat(name, symbol->string, 0);
2362 FullClassNameCat(name, propertyDef->id->string, 1);
2364 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2366 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2367 strcpy(name, "__ecerePropM_");
2368 FullClassNameCat(name, symbol->string, 0);
2370 FullClassNameCat(name, propertyDef->id->string, 1);
2371 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2372 decl = MkDeclaration(specifiers, list);
2374 external = MkExternalDeclaration(decl);
2375 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2376 external->symbol = propertyDef->symbol;
2377 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2378 if(inCompiler && prop && prop->symbol)
2379 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2384 else if(def->type == 10 && def->__anon1.propertyDef)
2386 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2387 struct ClassDef * after = def;
2388 struct ClassDef * newDef;
2393 yylloc = propertyDef->loc;
2394 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
2395 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2396 else if(!symbol->isStatic)
2397 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2400 struct ClassFunction * func;
2401 struct Declarator * decl;
2403 struct __ecereNameSpace__ecere__sys__OldList * params;
2405 if(propertyDef->getStmt && propertyDef->id)
2407 struct Declarator * declId;
2409 sprintf(name, "class::__ecereClassProp_");
2410 FullClassNameCat(name, symbol->string, 0);
2411 strcat(name, "_Get_");
2412 strcat(name, propertyDef->id->string);
2414 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2416 decl = MkDeclaratorFunction(declId, params);
2417 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2419 ProcessClassFunctionBody(func, propertyDef->getStmt);
2420 func->declarator->symbol = propertyDef->symbol;
2421 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2422 func->dontMangle = 1;
2423 newDef = MkClassDefFunction(func);
2424 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2426 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2427 func->type = ProcessType(propertyDef->specifiers, decl);
2428 FreeDeclarator(decl);
2429 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)
2430 func->type->__anon1.__anon2.returnType->byReference = 1;
2431 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2433 propertyDef->getStmt = (((void *)0));
2435 func->body = (((void *)0));
2437 if(propertyDef->setStmt && propertyDef->id)
2439 struct Context * prevCurContext;
2440 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2441 struct Statement * body = propertyDef->setStmt;
2442 struct Declarator * ptrDecl;
2443 struct Expression * e;
2445 strcpy(name, "class::__ecereClassProp_");
2446 FullClassNameCat(name, symbol->string, 0);
2447 strcat(name, "_Set_");
2448 strcat(name, propertyDef->id->string);
2450 prevCurContext = curContext;
2451 curContext = body->__anon1.compound.context;
2452 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2453 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2454 if(!body->__anon1.compound.declarations)
2455 body->__anon1.compound.declarations = MkList();
2456 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)
2457 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2459 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2460 e = MkExpIdentifier(MkIdentifier("_value"));
2461 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2462 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2463 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))))));
2464 curContext = prevCurContext;
2466 struct Symbol * sym = ptrDecl->symbol;
2469 FreeType(sym->type);
2470 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2472 ListAdd(specifiers, MkSpecifier(VOID));
2473 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2474 ProcessClassFunctionBody(func, propertyDef->setStmt);
2475 func->dontMangle = 1;
2476 func->declarator->symbol = propertyDef->symbol;
2477 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2478 newDef = MkClassDefFunction(func);
2479 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2482 propertyDef->setStmt = (((void *)0));
2484 func->body = (((void *)0));
2489 else if(def->type == 0 && def->__anon1.function->declarator)
2491 struct ClassFunction * func = def->__anon1.function;
2493 func->_class = regClass;
2494 if(!func->dontMangle)
2496 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2497 struct Identifier * id = GetDeclId(funcDecl);
2498 struct __ecereNameSpace__ecere__com__Method * method;
2500 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2502 if(!funcDecl->__anon1.function.parameters)
2503 funcDecl->__anon1.function.parameters = MkList();
2504 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2506 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2507 FreeSpecifier(id->_class);
2508 id->_class = (((void *)0));
2509 if(inCompiler && method)
2511 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2514 ProcessMethodType(method);
2516 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && method->memberAccess == 1)
2517 CheckPublicDataType(method->dataType, 1, "class method");
2518 strcpy(newId, "__ecereMethod_");
2519 FullClassNameCat(newId, symbol->string, 0);
2521 strcat(newId, id->string);
2522 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2524 if(method->type != 1)
2528 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2529 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2537 if(initDeclarators != (((void *)0)))
2538 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2541 void PreProcessClassDefinitions()
2543 struct External * external, * next;
2545 curExternal = (((void *)0));
2548 for(external = (*ast).first; external; external = next)
2550 next = external->next;
2551 curExternal = external;
2552 if(external->type == 2)
2554 struct ClassDefinition * _class = external->__anon1._class;
2556 if(_class->definitions)
2558 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2561 else if(external->type == 1)
2563 struct Declaration * declaration = external->__anon1.declaration;
2565 if(declaration && declaration->type == 1)
2567 if(declaration->__anon1.__anon1.specifiers)
2569 struct Specifier * specifier;
2571 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2573 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)))
2575 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2579 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2580 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2582 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2585 initDeclarators = declaration->__anon1.__anon1.declarators;
2586 declaration->__anon1.__anon1.declarators = (((void *)0));
2588 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);
2594 else if(declaration && inCompiler && declaration->type == 3)
2596 yylloc = declaration->loc;
2597 if(declaration->declMode == 1)
2598 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2599 else if(declaration->declMode != 3)
2600 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2603 else if(external->type == 3)
2606 else if(inCompiler && external->type == 0)
2608 yylloc = external->__anon1.function->loc;
2609 if(!external->__anon1.function->type)
2610 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2611 if(external->__anon1.function->declMode == 1)
2612 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2613 else if(external->__anon1.function->declMode != 3)
2614 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2620 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2622 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2624 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2625 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);