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))
292 output[len++] = (char)0;
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;
706 unsigned int isSigned : 1;
707 unsigned int constant : 1;
708 unsigned int truth : 1;
709 unsigned int byReference : 1;
710 unsigned int extraParam : 1;
711 unsigned int directClassAccess : 1;
712 unsigned int computing : 1;
713 unsigned int keepCast : 1;
714 unsigned int passAsTemplate : 1;
715 unsigned int dllExport : 1;
716 unsigned int attrStdcall : 1;
717 unsigned int declaredWithStruct : 1;
718 unsigned int typedByReference : 1;
719 unsigned int casted : 1;
720 unsigned int pointerAlignment : 1;
721 unsigned int isLong : 1;
724 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);
726 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
728 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
734 struct ClassFunction * prev;
735 struct ClassFunction * next;
737 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
738 struct Declarator * declarator;
739 struct __ecereNameSpace__ecere__sys__OldList * declarations;
740 struct Statement * body;
741 struct __ecereNameSpace__ecere__com__Class * _class;
742 struct __ecereNameSpace__ecere__sys__OldList attached;
745 struct Symbol * propSet;
746 unsigned int isVirtual;
747 unsigned int isConstructor;
748 unsigned int isDestructor;
749 unsigned int dontMangle;
756 struct Statement * prev;
757 struct Statement * next;
762 struct __ecereNameSpace__ecere__sys__OldList * expressions;
765 struct Identifier * id;
766 struct Statement * stmt;
767 } ecere_gcc_struct labeled;
770 struct Expression * exp;
771 struct Statement * stmt;
772 } ecere_gcc_struct caseStmt;
775 struct __ecereNameSpace__ecere__sys__OldList * declarations;
776 struct __ecereNameSpace__ecere__sys__OldList * statements;
777 struct Context * context;
778 unsigned int isSwitch;
779 } ecere_gcc_struct compound;
782 struct __ecereNameSpace__ecere__sys__OldList * exp;
783 struct Statement * stmt;
784 struct Statement * elseStmt;
785 } ecere_gcc_struct ifStmt;
788 struct __ecereNameSpace__ecere__sys__OldList * exp;
789 struct Statement * stmt;
790 } ecere_gcc_struct switchStmt;
793 struct __ecereNameSpace__ecere__sys__OldList * exp;
794 struct Statement * stmt;
795 } ecere_gcc_struct whileStmt;
798 struct __ecereNameSpace__ecere__sys__OldList * exp;
799 struct Statement * stmt;
800 } ecere_gcc_struct doWhile;
803 struct Statement * init;
804 struct Statement * check;
805 struct __ecereNameSpace__ecere__sys__OldList * increment;
806 struct Statement * stmt;
807 } ecere_gcc_struct forStmt;
810 struct Identifier * id;
811 } ecere_gcc_struct gotoStmt;
814 struct Specifier * spec;
816 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
817 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
818 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
819 } ecere_gcc_struct asmStmt;
822 struct Expression * watcher;
823 struct Expression * object;
824 struct __ecereNameSpace__ecere__sys__OldList * watches;
825 } ecere_gcc_struct _watch;
828 struct Identifier * id;
829 struct __ecereNameSpace__ecere__sys__OldList * exp;
830 struct __ecereNameSpace__ecere__sys__OldList * filter;
831 struct Statement * stmt;
832 } ecere_gcc_struct forEachStmt;
833 struct Declaration * decl;
834 } ecere_gcc_struct __anon1;
837 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
839 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
841 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
843 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
845 struct __ecereNameSpace__ecere__sys__BinaryTree;
847 struct __ecereNameSpace__ecere__sys__BinaryTree
849 struct __ecereNameSpace__ecere__sys__BTNode * root;
851 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
852 void (* FreeKey)(void * key);
855 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
857 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
859 struct __ecereNameSpace__ecere__com__DataMember;
861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
867 const char * dataTypeString;
868 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
869 } ecere_gcc_struct __anon1;
870 struct __ecereNameSpace__ecere__com__DataValue expression;
873 const char * memberString;
876 struct __ecereNameSpace__ecere__com__DataMember * member;
877 struct __ecereNameSpace__ecere__com__Property * prop;
878 struct __ecereNameSpace__ecere__com__Method * method;
879 } ecere_gcc_struct __anon1;
880 } ecere_gcc_struct __anon2;
881 } ecere_gcc_struct __anon1;
884 struct __ecereNameSpace__ecere__com__DataMember
886 struct __ecereNameSpace__ecere__com__DataMember * prev;
887 struct __ecereNameSpace__ecere__com__DataMember * next;
889 unsigned int isProperty;
892 struct __ecereNameSpace__ecere__com__Class * _class;
893 const char * dataTypeString;
894 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
895 struct Type * dataType;
899 struct __ecereNameSpace__ecere__sys__OldList members;
900 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
902 short structAlignment;
903 short pointerAlignment;
906 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);
908 struct __ecereNameSpace__ecere__com__Module;
910 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
912 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
914 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);
916 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
918 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);
920 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);
922 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);
928 struct TypeName * prev;
929 struct TypeName * next;
931 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
932 struct Declarator * declarator;
934 struct Expression * bitCount;
937 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
939 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
943 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
945 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
947 struct ClassDefinition;
951 struct Context * parent;
952 struct __ecereNameSpace__ecere__sys__BinaryTree types;
953 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
954 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
955 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
958 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
959 struct ClassDefinition * classDef;
960 unsigned int templateTypesOnly;
961 unsigned int hasNameSpace;
964 struct ClassDefinition
966 struct ClassDefinition * prev;
967 struct ClassDefinition * next;
969 struct Specifier * _class;
970 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
971 struct __ecereNameSpace__ecere__sys__OldList * definitions;
972 struct Symbol * symbol;
973 struct Location blockStart;
974 struct Location nameLoc;
976 unsigned int deleteWatchable;
979 struct Instantiation;
983 struct Expression * prev;
984 struct Expression * next;
992 struct Identifier * identifier;
993 } ecere_gcc_struct __anon1;
994 struct Statement * compound;
995 struct Instantiation * instance;
999 unsigned int intlString;
1000 unsigned int wideString;
1001 } ecere_gcc_struct __anon2;
1002 struct __ecereNameSpace__ecere__sys__OldList * list;
1005 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1006 struct Declarator * decl;
1007 } ecere_gcc_struct _classExp;
1010 struct Identifier * id;
1011 } ecere_gcc_struct classData;
1014 struct Expression * exp;
1015 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1016 struct Location argLoc;
1017 } ecere_gcc_struct call;
1020 struct Expression * exp;
1021 struct __ecereNameSpace__ecere__sys__OldList * index;
1022 } ecere_gcc_struct index;
1025 struct Expression * exp;
1026 struct Identifier * member;
1028 unsigned int thisPtr;
1029 } ecere_gcc_struct member;
1033 struct Expression * exp1;
1034 struct Expression * exp2;
1035 } ecere_gcc_struct op;
1036 struct TypeName * typeName;
1037 struct Specifier * _class;
1040 struct TypeName * typeName;
1041 struct Expression * exp;
1042 } ecere_gcc_struct cast;
1045 struct Expression * cond;
1046 struct __ecereNameSpace__ecere__sys__OldList * exp;
1047 struct Expression * elseExp;
1048 } ecere_gcc_struct cond;
1051 struct TypeName * typeName;
1052 struct Expression * size;
1053 } ecere_gcc_struct _new;
1056 struct TypeName * typeName;
1057 struct Expression * size;
1058 struct Expression * exp;
1059 } ecere_gcc_struct _renew;
1063 struct Identifier * id;
1064 } ecere_gcc_struct db;
1067 struct Expression * ds;
1068 struct Expression * name;
1069 } ecere_gcc_struct dbopen;
1072 struct TypeName * typeName;
1073 struct Initializer * initializer;
1074 } ecere_gcc_struct initializer;
1077 struct Expression * exp;
1078 struct TypeName * typeName;
1079 } ecere_gcc_struct vaArg;
1080 } ecere_gcc_struct __anon1;
1081 unsigned int debugValue;
1082 struct __ecereNameSpace__ecere__com__DataValue val;
1084 unsigned int hasAddress;
1085 struct Type * expType;
1086 struct Type * destType;
1089 unsigned int byReference;
1090 unsigned int isConstant;
1091 unsigned int addedThis;
1092 unsigned int needCast;
1093 unsigned int thisPtr;
1094 unsigned int opDestType;
1095 unsigned int needTemplateCast;
1098 struct Instantiation
1100 struct Instantiation * prev;
1101 struct Instantiation * next;
1102 struct Location loc;
1103 struct Specifier * _class;
1104 struct Expression * exp;
1105 struct __ecereNameSpace__ecere__sys__OldList * members;
1106 struct Symbol * symbol;
1107 unsigned int fullSet;
1108 unsigned int isConstant;
1109 unsigned char * data;
1110 struct Location nameLoc;
1111 struct Location insideLoc;
1117 struct Declaration * prev;
1118 struct Declaration * next;
1119 struct Location loc;
1125 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1126 struct __ecereNameSpace__ecere__sys__OldList * declarators;
1127 } ecere_gcc_struct __anon1;
1128 struct Instantiation * inst;
1131 struct Identifier * id;
1132 struct Expression * exp;
1133 } ecere_gcc_struct __anon2;
1134 } ecere_gcc_struct __anon1;
1135 struct Specifier * extStorage;
1136 struct Symbol * symbol;
1140 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1146 struct MembersInit * prev;
1147 struct MembersInit * next;
1148 struct Location loc;
1152 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1153 struct ClassFunction * function;
1154 } ecere_gcc_struct __anon1;
1161 struct MemberInit * prev;
1162 struct MemberInit * next;
1163 struct Location loc;
1164 struct Location realLoc;
1165 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1166 struct Initializer * initializer;
1168 unsigned int variable;
1169 unsigned int takeOutExp;
1172 static void CheckPublicExpression(struct Expression * exp, int access);
1174 static void CheckPublicInitializer(struct Initializer * init, int access)
1179 CheckPublicExpression(init->__anon1.exp, access);
1183 struct Initializer * i;
1185 for(i = (*init->__anon1.list).first; i; i = i->next)
1186 CheckPublicInitializer(i, access);
1192 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word);
1194 static void CheckPublicTypeName(struct TypeName * type, int access)
1196 if(type->qualifiers)
1198 struct Specifier * spec;
1200 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1204 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1206 CheckPublicClass(classSym, access, "define");
1212 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1220 CheckPublicClass(type->__anon1._class, access, word);
1230 struct Type * param;
1232 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1233 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1234 CheckPublicDataType(param, access, word);
1235 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1239 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1240 if(type->__anon1.__anon4.enumClass)
1241 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1245 CheckPublicDataType(type->__anon1.type, access, word);
1254 CheckPublicClass(type->__anon1._class, access, word);
1261 static void CheckPublicExpression(struct Expression * exp, int access)
1274 if(exp->__anon1.op.exp1)
1275 CheckPublicExpression(exp->__anon1.op.exp1, access);
1276 if(exp->__anon1.op.exp2)
1277 CheckPublicExpression(exp->__anon1.op.exp2, access);
1281 struct Expression * e;
1283 for(e = (*exp->__anon1.list).first; e; e = e->next)
1284 CheckPublicExpression(e, access);
1289 struct Expression * e;
1291 CheckPublicExpression(exp->__anon1.index.exp, access);
1292 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1293 CheckPublicExpression(e, access);
1298 struct Expression * e;
1300 CheckPublicExpression(exp->__anon1.call.exp, access);
1301 if(exp->__anon1.call.arguments)
1303 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1304 CheckPublicExpression(e, access);
1310 CheckPublicExpression(exp->__anon1.member.exp, access);
1315 CheckPublicExpression(exp->__anon1.member.exp, access);
1319 CheckPublicTypeName(exp->__anon1.typeName, access);
1323 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1324 if(exp->__anon1.cast.exp)
1325 CheckPublicExpression(exp->__anon1.cast.exp, access);
1330 struct Expression * e;
1332 CheckPublicExpression(exp->__anon1.cond.cond, access);
1333 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1334 CheckPublicExpression(e, access);
1335 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1340 CheckPublicExpression(exp->__anon1._new.size, access);
1344 CheckPublicExpression(exp->__anon1._renew.size, access);
1345 CheckPublicExpression(exp->__anon1._renew.exp, access);
1349 struct MembersInit * members;
1351 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1352 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1354 if(members->type == 0)
1356 struct MemberInit * member;
1358 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1360 CheckPublicInitializer(member->initializer, access);
1374 struct ClassDef * prev;
1375 struct ClassDef * next;
1376 struct Location loc;
1380 struct Declaration * decl;
1381 struct ClassFunction * function;
1382 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1383 struct PropertyDef * propertyDef;
1384 struct PropertyWatch * propertyWatch;
1386 struct Identifier * defaultProperty;
1389 struct Identifier * id;
1390 struct Initializer * initializer;
1391 } ecere_gcc_struct __anon1;
1392 } ecere_gcc_struct __anon1;
1399 struct PropertyDef * prev;
1400 struct PropertyDef * next;
1401 struct Location loc;
1402 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1403 struct Declarator * declarator;
1404 struct Identifier * id;
1405 struct Statement * getStmt;
1406 struct Statement * setStmt;
1407 struct Statement * issetStmt;
1408 struct Symbol * symbol;
1409 struct Expression * category;
1412 unsigned int conversion : 1;
1413 unsigned int isWatchable : 1;
1414 unsigned int isDBProp : 1;
1415 } ecere_gcc_struct __anon1;
1418 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1420 if(definitions != (((void *)0)))
1422 struct ClassDef * def;
1424 for(def = definitions->first; def; def = def->next)
1428 struct Declaration * decl = def->__anon1.decl;
1429 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1434 struct Declarator * d;
1436 if(decl->__anon1.__anon1.declarators)
1438 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1440 struct Identifier * declId = GetDeclId(d);
1446 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1448 dataMember = link ? link->data : (((void *)0));
1451 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1453 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1457 else if(decl->__anon1.__anon1.specifiers)
1459 struct Specifier * spec;
1461 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1463 if(spec->type == 3 || spec->type == 4)
1465 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1467 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1469 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1473 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1475 dataMember = link ? link->data : (((void *)0));
1478 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1480 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1486 else if(decl->type == 2)
1488 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1495 struct FunctionDefinition;
1497 typedef union YYSTYPE
1502 struct Identifier * id;
1503 struct Expression * exp;
1504 struct Specifier * specifier;
1505 struct __ecereNameSpace__ecere__sys__OldList * list;
1506 struct Enumerator * enumerator;
1507 struct Declarator * declarator;
1508 struct Pointer * pointer;
1509 struct Initializer * initializer;
1510 struct InitDeclarator * initDeclarator;
1511 struct TypeName * typeName;
1512 struct Declaration * declaration;
1513 struct Statement * stmt;
1514 struct FunctionDefinition * function;
1515 struct External * external;
1516 struct Context * context;
1517 struct AsmField * asmField;
1518 struct Attrib * attrib;
1519 struct ExtDecl * extDecl;
1520 struct Attribute * attribute;
1521 struct Instantiation * instance;
1522 struct MembersInit * membersInit;
1523 struct MemberInit * memberInit;
1524 struct ClassFunction * classFunction;
1525 struct ClassDefinition * _class;
1526 struct ClassDef * classDef;
1527 struct PropertyDef * prop;
1529 struct Symbol * symbol;
1530 struct PropertyWatch * propertyWatch;
1531 struct TemplateParameter * templateParameter;
1532 struct TemplateArgument * templateArgument;
1533 struct TemplateDatatype * templateDatatype;
1534 struct DBTableEntry * dbtableEntry;
1535 struct DBIndexItem * dbindexItem;
1536 struct DBTableDef * dbtableDef;
1537 } ecere_gcc_struct YYSTYPE;
1539 extern YYSTYPE yylval;
1543 struct External * prev;
1544 struct External * next;
1545 struct Location loc;
1547 struct Symbol * symbol;
1550 struct FunctionDefinition * function;
1551 struct ClassDefinition * _class;
1552 struct Declaration * declaration;
1553 char * importString;
1554 struct Identifier * id;
1555 struct DBTableDef * table;
1556 } ecere_gcc_struct __anon1;
1558 struct External * fwdDecl;
1559 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1560 struct __ecereNameSpace__ecere__com__Instance * incoming;
1561 int nonBreakableIncoming;
1564 struct FunctionDefinition
1566 struct FunctionDefinition * prev;
1567 struct FunctionDefinition * next;
1568 struct Location loc;
1569 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1570 struct Declarator * declarator;
1571 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1572 struct Statement * body;
1573 struct __ecereNameSpace__ecere__com__Class * _class;
1574 struct __ecereNameSpace__ecere__sys__OldList attached;
1577 struct Symbol * propSet;
1579 unsigned int propertyNoThis;
1582 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
1584 struct __ecereNameSpace__ecere__com__NameSpace;
1586 struct __ecereNameSpace__ecere__com__NameSpace
1589 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1590 struct __ecereNameSpace__ecere__com__NameSpace * left;
1591 struct __ecereNameSpace__ecere__com__NameSpace * right;
1593 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1594 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1595 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1596 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1597 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1600 struct __ecereNameSpace__ecere__com__Class
1602 struct __ecereNameSpace__ecere__com__Class * prev;
1603 struct __ecereNameSpace__ecere__com__Class * next;
1609 unsigned int (* Constructor)(void * );
1610 void (* Destructor)(void * );
1613 struct __ecereNameSpace__ecere__com__Class * base;
1614 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1615 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1616 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1617 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1618 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1619 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1623 struct __ecereNameSpace__ecere__com__Instance * module;
1624 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1625 const char * dataTypeString;
1626 struct Type * dataType;
1628 int defaultAlignment;
1629 void (* Initialize)();
1631 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1632 const char * designerClass;
1633 unsigned int noExpansion;
1634 const char * defaultProperty;
1635 unsigned int comRedefinition;
1638 unsigned int internalDecl;
1640 unsigned int computeSize;
1641 short structAlignment;
1642 short pointerAlignment;
1643 int destructionWatchOffset;
1645 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1646 int inheritanceAccess;
1647 const char * fullName;
1649 struct __ecereNameSpace__ecere__sys__OldList conversions;
1650 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1651 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1652 struct __ecereNameSpace__ecere__com__Class * templateClass;
1653 struct __ecereNameSpace__ecere__sys__OldList templatized;
1655 unsigned int isInstanceClass;
1656 unsigned int byValueSystemClass;
1659 struct __ecereNameSpace__ecere__com__Application
1662 const char * * argv;
1664 unsigned int isGUIApp;
1665 struct __ecereNameSpace__ecere__sys__OldList allModules;
1666 char * parsedCommand;
1667 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1670 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1674 else if((*ns).parent)
1675 return NameSpaceContained((*ns).parent, parent);
1680 static void AddSimpleBaseMembers(struct External * external, struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1682 if(_class->type != 1000)
1683 AddMembers(external, list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1686 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
1688 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
1690 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1692 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1694 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
1696 struct __ecereNameSpace__ecere__com__Module
1698 struct __ecereNameSpace__ecere__com__Instance * application;
1699 struct __ecereNameSpace__ecere__sys__OldList classes;
1700 struct __ecereNameSpace__ecere__sys__OldList defines;
1701 struct __ecereNameSpace__ecere__sys__OldList functions;
1702 struct __ecereNameSpace__ecere__sys__OldList modules;
1703 struct __ecereNameSpace__ecere__com__Instance * prev;
1704 struct __ecereNameSpace__ecere__com__Instance * next;
1710 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1711 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1714 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
1719 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1721 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1725 if(regClass->templateClass)
1726 regClass = regClass->templateClass;
1727 if(classSym->isStatic && access != 3)
1729 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1731 else if(access == 1)
1733 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))
1735 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1736 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1742 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)
1744 char structName[1024];
1745 char className[1024];
1746 char constructorName[1024];
1747 char destructorName[1024];
1748 struct __ecereNameSpace__ecere__com__Class * regClass;
1749 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1750 unsigned int isUnion = classType == 6;
1751 struct External * external = (((void *)0));
1752 struct ClassDef * def;
1753 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1754 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1759 classDataList = MkList();
1761 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1764 classType = regClass->type;
1768 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && regClass->inheritanceAccess == 1)
1770 if(!regClass->base->symbol)
1771 regClass->base->symbol = FindClass(regClass->base->fullName);
1772 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1774 else if(!symbol->isStatic && regClass->base)
1776 if(!regClass->base->symbol)
1777 regClass->base->symbol = FindClass(regClass->base->fullName);
1778 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1781 if(definitions != (((void *)0)))
1783 for(def = definitions->first; def; def = def->next)
1787 struct __ecereNameSpace__ecere__com__DataMember * member;
1788 struct __ecereNameSpace__ecere__com__Property * prop;
1789 struct __ecereNameSpace__ecere__com__Method * method;
1791 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1793 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1795 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1797 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1799 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1801 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1806 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1813 external = MkExternalDeclaration((((void *)0)));
1814 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1815 curExternal = external;
1816 curExternal->symbol = symbol;
1818 if((classType == 1 || classType == 5) && inCompiler)
1820 AddSimpleBaseMembers(external, list, regClass->base, regClass);
1822 if(definitions != (((void *)0)))
1826 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
1827 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1828 else if(!symbol->isStatic)
1829 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1831 for(def = definitions->first; def; def = def->next)
1836 struct Declaration * decl = def->__anon1.decl;
1841 if(inCompiler && classType != 2)
1843 ListAdd(list, MkClassDefDeclaration(decl));
1844 def->__anon1.decl = (((void *)0));
1847 else if(decl->type == 2)
1849 struct Instantiation * inst = decl->__anon1.inst;
1850 struct Expression * exp = inst->exp;
1851 struct Symbol * classSym;
1855 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1856 struct Declarator * d;
1858 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1859 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1862 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1864 ListAdd(declarators, d);
1865 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1866 ListAdd(list, MkClassDefDeclaration(decl));
1868 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1869 exp->__anon1.member.exp = QMkExpId("this");
1870 exp->__anon1.member.memberType = 3;
1871 exp->__anon1.member.thisPtr = 1;
1876 FreeList(specifiers, (void *)(FreeSpecifier));
1879 classSym = inst->_class->__anon1.__anon1.symbol;
1880 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1882 if(inst->members && (*inst->members).count)
1883 symbol->needConstructor = 1;
1887 symbol->needConstructor = 1;
1888 symbol->needDestructor = 1;
1892 else if(def->type == 9)
1894 struct Declaration * decl = def->__anon1.decl;
1898 if(inCompiler && classType != 2)
1900 ListAdd(classDataList, MkClassDefDeclaration(decl));
1901 def->__anon1.decl = (((void *)0));
1905 else if(def->type == 1)
1906 symbol->needConstructor = 1;
1907 else if(def->type == 4)
1908 symbol->needConstructor = 1;
1909 else if(def->type == 0)
1911 struct ClassFunction * func = def->__anon1.function;
1913 if(func->isDestructor)
1918 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1922 symbol->needDestructor = 1;
1924 if(!inCompiler && func->body)
1926 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1928 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1932 if(func->isConstructor)
1937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1941 symbol->needConstructor = 1;
1943 if(!inCompiler && func->body)
1945 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1947 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1956 external->symbol = (((void *)0));
1959 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1961 initDeclarators = (((void *)0));
1962 strcpy(structName, symbol->string);
1963 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1965 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1967 spec->__anon1.__anon2.extDeclStruct = extDecl;
1968 ListAdd(specs, spec);
1970 external->symbol = symbol;
1971 if(symbol->__anon2.__anon1.structExternal)
1974 struct TopoEdge * e;
1975 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->incoming;
1977 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__ ({
1978 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1980 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1981 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1982 __ecereMethod_External_CreateUniqueEdge(external, e->from, e->breakable);
1985 struct TopoEdge * e;
1986 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->outgoing;
1988 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__ ({
1989 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1991 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1992 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1993 __ecereMethod_External_CreateUniqueEdge(e->to, external, e->breakable);
1995 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), symbol->__anon2.__anon1.structExternal);
1996 FreeExternal(symbol->__anon2.__anon1.structExternal);
1998 symbol->__anon2.__anon1.structExternal = external;
1999 external->__anon1.declaration = MkDeclaration(specs, declarators);
2001 symbol->declaredStruct = 1;
2005 curExternal = external->prev;
2006 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
2007 FreeExternal(external);
2008 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
2010 if((*classDataList).count)
2012 char classDataStructName[1024];
2013 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2014 struct External * external;
2016 strcpy(classDataStructName, "__ecereClassData_");
2017 FullClassNameCat(classDataStructName, symbol->string, 0);
2018 declMode = structDeclMode = 0;
2019 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
2020 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
2021 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
2023 symbol->classData = 1;
2026 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
2031 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2033 strcpy(className, "__ecereClass_");
2034 FullClassNameCat(className, symbol->string, 1);
2035 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2036 if(!strstr(sourceFile, ".main.ec"))
2037 ListAdd(specs, MkSpecifier(STATIC));
2038 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2039 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2040 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2041 DeclareStruct(symbol->__anon2.__anon1.pointerExternal, "ecere::com::Class", 0, 1);
2042 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon1.pointerExternal);
2043 after = symbol->__anon2.__anon3.methodExternal;
2045 if(symbol->needDestructor)
2047 struct ClassFunction * function;
2048 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2049 struct Declarator * decl;
2050 struct Statement * body;
2051 struct Context * context;
2052 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2054 strcpy(destructorName, "__ecereDestructor_");
2055 FullClassNameCat(destructorName, symbol->string, 0);
2056 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2057 ListAdd(specs, MkSpecifier(VOID));
2058 context = PushContext();
2059 statements = MkList();
2060 if(definitions != (((void *)0)))
2062 for(def = definitions->first; def; def = def->next)
2064 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2066 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2067 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2069 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2071 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2073 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2075 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2077 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2079 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2084 if(destructor && destructor->body)
2086 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2087 destructor->body->__anon1.compound.context->parent = context;
2088 destructor->body = (((void *)0));
2090 body = MkCompoundStmt(declarations, statements);
2091 PopContext(context);
2092 body->__anon1.compound.context = context;
2093 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2094 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2095 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2096 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2097 ProcessClassFunctionBody(function, body);
2098 function->dontMangle = 1;
2099 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2101 if(symbol->needConstructor && inCompiler)
2103 struct ClassFunction * function;
2104 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2105 struct Declarator * decl;
2106 struct Statement * body;
2107 struct Context * context;
2108 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2110 strcpy(constructorName, "__ecereConstructor_");
2111 FullClassNameCat(constructorName, symbol->string, 0);
2112 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2113 ListAdd(specs, MkSpecifierName("bool"));
2114 context = PushContext();
2115 statements = MkList();
2116 if(definitions != (((void *)0)))
2118 for(def = definitions->first; def; def = def->next)
2120 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2122 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2123 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2125 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2127 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2130 newInst->members = (((void *)0));
2131 newInst->exp = CopyExpression(inst->exp);
2132 newInst->_class = CopySpecifier(inst->_class);
2133 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2136 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2138 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2142 for(def = definitions->first; def; def = def->next)
2144 if(def->type == 1 && def->__anon1.defProperties)
2146 struct MemberInit * propertyDef;
2148 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2150 struct Expression * memberExp;
2151 struct Identifier * id = (*propertyDef->identifiers).first;
2155 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2156 for(id = id->next; id; id = id->next)
2157 memberExp = MkExpMember(memberExp, id);
2158 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2160 if(propertyDef->initializer)
2162 if(propertyDef->initializer->type == 0)
2163 propertyDef->initializer->__anon1.exp = (((void *)0));
2164 FreeInitializer(propertyDef->initializer);
2166 propertyDef->initializer = (((void *)0));
2167 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2171 for(def = definitions->first; def; def = def->next)
2173 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2175 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2176 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2178 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2180 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2182 def->__anon1.decl->__anon1.inst = (((void *)0));
2183 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2189 if(constructor && constructor->body)
2191 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2192 constructor->body->__anon1.compound.context->parent = context;
2193 constructor->body = (((void *)0));
2195 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2196 body = MkCompoundStmt(declarations, statements);
2197 PopContext(context);
2198 body->__anon1.compound.context = context;
2199 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2200 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2201 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2202 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2203 ProcessClassFunctionBody(function, body);
2204 function->dontMangle = 1;
2205 if(definitions != (((void *)0)))
2206 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2209 if(definitions != (((void *)0)))
2211 for(def = definitions->first; def; def = def->next)
2213 if(def->type == 3 && def->__anon1.propertyDef)
2215 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2216 struct ClassDef * after = def;
2217 struct ClassDef * newDef;
2221 yylloc = propertyDef->loc;
2222 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && def->memberAccess == 1)
2223 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2224 else if(!symbol->isStatic)
2225 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2229 struct ClassFunction * func;
2230 struct Declarator * decl;
2232 struct __ecereNameSpace__ecere__sys__OldList * params;
2234 if(propertyDef->getStmt && propertyDef->id)
2236 strcpy(name, "__ecereProp_");
2237 FullClassNameCat(name, symbol->string, 0);
2238 strcat(name, "_Get_");
2239 FullClassNameCat(name, propertyDef->id->string, 1);
2241 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)
2243 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2244 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2245 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2249 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2250 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2252 ProcessClassFunctionBody(func, propertyDef->getStmt);
2253 func->declarator->symbol = propertyDef->symbol;
2254 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2255 func->dontMangle = 1;
2256 newDef = MkClassDefFunction(func);
2257 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2260 propertyDef->getStmt = (((void *)0));
2262 func->body = (((void *)0));
2264 if(propertyDef->setStmt && propertyDef->id)
2266 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2268 strcpy(name, "__ecereProp_");
2269 FullClassNameCat(name, symbol->string, 0);
2270 strcat(name, "_Set_");
2271 FullClassNameCat(name, propertyDef->id->string, 1);
2273 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2274 if(propertyDef->__anon1.isDBProp)
2276 struct Specifier * spec;
2277 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2279 for(spec = (*specs).first; spec; spec = spec->next)
2280 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2283 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2285 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2287 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2288 unsigned int useVoid = 0;
2290 switch(regClass->type)
2298 useVoid = !isConversion;
2301 useVoid = !isConversion;
2302 if(useVoid && !propertyDef->__anon1.isDBProp)
2303 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2305 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2307 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2308 ProcessClassFunctionBody(func, propertyDef->setStmt);
2309 func->dontMangle = 1;
2310 func->declarator->symbol = propertyDef->symbol;
2311 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2312 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2313 func->propSet = propertyDef->symbol;
2314 newDef = MkClassDefFunction(func);
2315 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2318 propertyDef->setStmt = (((void *)0));
2320 func->body = (((void *)0));
2322 if(propertyDef->issetStmt && propertyDef->id)
2324 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2326 strcpy(name, "__ecereProp_");
2327 FullClassNameCat(name, symbol->string, 0);
2328 strcat(name, "_IsSet_");
2329 FullClassNameCat(name, propertyDef->id->string, 1);
2331 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2332 ListAdd(specifiers, MkSpecifierName("bool"));
2333 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2334 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2335 func->dontMangle = 1;
2336 func->declarator->symbol = propertyDef->symbol;
2337 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2338 newDef = MkClassDefFunction(func);
2339 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2342 propertyDef->issetStmt = (((void *)0));
2344 func->body = (((void *)0));
2346 if(propertyDef->id && inCompiler)
2348 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2349 struct Declaration * decl;
2350 struct External * external;
2351 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2353 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2354 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2355 ListAdd(specifiers, MkSpecifierName("Property"));
2356 strcpy(name, "__ecereProp_");
2357 FullClassNameCat(name, symbol->string, 0);
2359 FullClassNameCat(name, propertyDef->id->string, 1);
2361 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2363 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2364 strcpy(name, "__ecerePropM_");
2365 FullClassNameCat(name, symbol->string, 0);
2367 FullClassNameCat(name, propertyDef->id->string, 1);
2368 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2369 decl = MkDeclaration(specifiers, list);
2371 external = MkExternalDeclaration(decl);
2372 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2373 external->symbol = propertyDef->symbol;
2374 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2375 if(inCompiler && prop && prop->symbol)
2376 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2381 else if(def->type == 10 && def->__anon1.propertyDef)
2383 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2384 struct ClassDef * after = def;
2385 struct ClassDef * newDef;
2390 yylloc = propertyDef->loc;
2391 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
2392 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2393 else if(!symbol->isStatic)
2394 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2397 struct ClassFunction * func;
2398 struct Declarator * decl;
2400 struct __ecereNameSpace__ecere__sys__OldList * params;
2402 if(propertyDef->getStmt && propertyDef->id)
2404 struct Declarator * declId;
2406 sprintf(name, "class::__ecereClassProp_");
2407 FullClassNameCat(name, symbol->string, 0);
2408 strcat(name, "_Get_");
2409 strcat(name, propertyDef->id->string);
2411 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2413 decl = MkDeclaratorFunction(declId, params);
2414 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2416 ProcessClassFunctionBody(func, propertyDef->getStmt);
2417 func->declarator->symbol = propertyDef->symbol;
2418 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2419 func->dontMangle = 1;
2420 newDef = MkClassDefFunction(func);
2421 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2423 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2424 func->type = ProcessType(propertyDef->specifiers, decl);
2425 FreeDeclarator(decl);
2426 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)
2427 func->type->__anon1.__anon2.returnType->byReference = 1;
2428 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2430 propertyDef->getStmt = (((void *)0));
2432 func->body = (((void *)0));
2434 if(propertyDef->setStmt && propertyDef->id)
2436 struct Context * prevCurContext;
2437 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2438 struct Statement * body = propertyDef->setStmt;
2439 struct Declarator * ptrDecl;
2440 struct Expression * e;
2442 strcpy(name, "class::__ecereClassProp_");
2443 FullClassNameCat(name, symbol->string, 0);
2444 strcat(name, "_Set_");
2445 strcat(name, propertyDef->id->string);
2447 prevCurContext = curContext;
2448 curContext = body->__anon1.compound.context;
2449 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2450 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2451 if(!body->__anon1.compound.declarations)
2452 body->__anon1.compound.declarations = MkList();
2453 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)
2454 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2456 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2457 e = MkExpIdentifier(MkIdentifier("_value"));
2458 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2459 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2460 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))))));
2461 curContext = prevCurContext;
2463 struct Symbol * sym = ptrDecl->symbol;
2466 FreeType(sym->type);
2467 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2469 ListAdd(specifiers, MkSpecifier(VOID));
2470 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2471 ProcessClassFunctionBody(func, propertyDef->setStmt);
2472 func->dontMangle = 1;
2473 func->declarator->symbol = propertyDef->symbol;
2474 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2475 newDef = MkClassDefFunction(func);
2476 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2479 propertyDef->setStmt = (((void *)0));
2481 func->body = (((void *)0));
2486 else if(def->type == 0 && def->__anon1.function->declarator)
2488 struct ClassFunction * func = def->__anon1.function;
2490 func->_class = regClass;
2491 if(!func->dontMangle)
2493 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2494 struct Identifier * id = GetDeclId(funcDecl);
2495 struct __ecereNameSpace__ecere__com__Method * method;
2497 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2499 if(!funcDecl->__anon1.function.parameters)
2500 funcDecl->__anon1.function.parameters = MkList();
2501 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2503 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2504 FreeSpecifier(id->_class);
2505 id->_class = (((void *)0));
2506 if(inCompiler && method)
2508 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2511 ProcessMethodType(method);
2513 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && method->memberAccess == 1)
2514 CheckPublicDataType(method->dataType, 1, "class method");
2515 strcpy(newId, "__ecereMethod_");
2516 FullClassNameCat(newId, symbol->string, 0);
2518 strcat(newId, id->string);
2519 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2521 if(method->type != 1)
2525 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2526 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2534 if(initDeclarators != (((void *)0)))
2535 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2538 void PreProcessClassDefinitions()
2540 struct External * external, * next;
2542 curExternal = (((void *)0));
2545 for(external = (*ast).first; external; external = next)
2547 next = external->next;
2548 curExternal = external;
2549 if(external->type == 2)
2551 struct ClassDefinition * _class = external->__anon1._class;
2553 if(_class->definitions)
2555 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2558 else if(external->type == 1)
2560 struct Declaration * declaration = external->__anon1.declaration;
2562 if(declaration && declaration->type == 1)
2564 if(declaration->__anon1.__anon1.specifiers)
2566 struct Specifier * specifier;
2568 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2570 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)))
2572 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2576 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2577 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2579 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2582 initDeclarators = declaration->__anon1.__anon1.declarators;
2583 declaration->__anon1.__anon1.declarators = (((void *)0));
2585 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);
2591 else if(declaration && inCompiler && declaration->type == 3)
2593 yylloc = declaration->loc;
2594 if(declaration->declMode == 1)
2595 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2596 else if(declaration->declMode != 3)
2597 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2600 else if(external->type == 3)
2603 else if(inCompiler && external->type == 0)
2605 yylloc = external->__anon1.function->loc;
2606 if(!external->__anon1.function->type)
2607 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2608 if(external->__anon1.function->declMode == 1)
2609 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2610 else if(external->__anon1.function->declMode != 3)
2611 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2617 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2619 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2621 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2622 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);