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, BUILTIN_OFFSETOF = 374
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;
1085 struct TypeName * typeName;
1086 struct Identifier * id;
1087 } ecere_gcc_struct offset;
1088 } ecere_gcc_struct __anon1;
1089 unsigned int debugValue;
1090 struct __ecereNameSpace__ecere__com__DataValue val;
1092 unsigned int hasAddress;
1093 struct Type * expType;
1094 struct Type * destType;
1097 unsigned int byReference;
1098 unsigned int isConstant;
1099 unsigned int addedThis;
1100 unsigned int needCast;
1101 unsigned int thisPtr;
1102 unsigned int opDestType;
1103 unsigned int usedInComparison;
1104 unsigned int ambiguousUnits;
1105 unsigned int parentOpDestType;
1106 unsigned int needTemplateCast;
1109 struct Instantiation
1111 struct Instantiation * prev;
1112 struct Instantiation * next;
1113 struct Location loc;
1114 struct Specifier * _class;
1115 struct Expression * exp;
1116 struct __ecereNameSpace__ecere__sys__OldList * members;
1117 struct Symbol * symbol;
1118 unsigned int fullSet;
1119 unsigned int isConstant;
1120 unsigned char * data;
1121 struct Location nameLoc;
1122 struct Location insideLoc;
1128 struct Declaration * prev;
1129 struct Declaration * next;
1130 struct Location loc;
1136 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1137 struct __ecereNameSpace__ecere__sys__OldList * declarators;
1138 } ecere_gcc_struct __anon1;
1139 struct Instantiation * inst;
1142 struct Identifier * id;
1143 struct Expression * exp;
1144 } ecere_gcc_struct __anon2;
1145 } ecere_gcc_struct __anon1;
1146 struct Specifier * extStorage;
1147 struct Symbol * symbol;
1151 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1157 struct MembersInit * prev;
1158 struct MembersInit * next;
1159 struct Location loc;
1163 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1164 struct ClassFunction * function;
1165 } ecere_gcc_struct __anon1;
1172 struct MemberInit * prev;
1173 struct MemberInit * next;
1174 struct Location loc;
1175 struct Location realLoc;
1176 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1177 struct Initializer * initializer;
1179 unsigned int variable;
1180 unsigned int takeOutExp;
1183 static void CheckPublicExpression(struct Expression * exp, int access);
1185 static void CheckPublicInitializer(struct Initializer * init, int access)
1190 CheckPublicExpression(init->__anon1.exp, access);
1194 struct Initializer * i;
1196 for(i = (*init->__anon1.list).first; i; i = i->next)
1197 CheckPublicInitializer(i, access);
1203 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word);
1205 static void CheckPublicTypeName(struct TypeName * type, int access)
1207 if(type->qualifiers)
1209 struct Specifier * spec;
1211 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1215 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1217 CheckPublicClass(classSym, access, "define");
1223 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1231 CheckPublicClass(type->__anon1._class, access, word);
1241 struct Type * param;
1243 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1244 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1245 CheckPublicDataType(param, access, word);
1246 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1250 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1251 if(type->__anon1.__anon4.enumClass)
1252 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1256 CheckPublicDataType(type->__anon1.type, access, word);
1265 CheckPublicClass(type->__anon1._class, access, word);
1272 static void CheckPublicExpression(struct Expression * exp, int access)
1285 if(exp->__anon1.op.exp1)
1286 CheckPublicExpression(exp->__anon1.op.exp1, access);
1287 if(exp->__anon1.op.exp2)
1288 CheckPublicExpression(exp->__anon1.op.exp2, access);
1292 struct Expression * e;
1294 for(e = (*exp->__anon1.list).first; e; e = e->next)
1295 CheckPublicExpression(e, access);
1300 struct Expression * e;
1302 CheckPublicExpression(exp->__anon1.index.exp, access);
1303 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1304 CheckPublicExpression(e, access);
1309 struct Expression * e;
1311 CheckPublicExpression(exp->__anon1.call.exp, access);
1312 if(exp->__anon1.call.arguments)
1314 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1315 CheckPublicExpression(e, access);
1321 CheckPublicExpression(exp->__anon1.member.exp, access);
1326 CheckPublicExpression(exp->__anon1.member.exp, access);
1330 CheckPublicTypeName(exp->__anon1.typeName, access);
1334 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1335 if(exp->__anon1.cast.exp)
1336 CheckPublicExpression(exp->__anon1.cast.exp, access);
1341 struct Expression * e;
1343 CheckPublicExpression(exp->__anon1.cond.cond, access);
1344 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1345 CheckPublicExpression(e, access);
1346 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1351 CheckPublicExpression(exp->__anon1._new.size, access);
1355 CheckPublicExpression(exp->__anon1._renew.size, access);
1356 CheckPublicExpression(exp->__anon1._renew.exp, access);
1360 struct MembersInit * members;
1362 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1363 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1365 if(members->type == 0)
1367 struct MemberInit * member;
1369 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1371 CheckPublicInitializer(member->initializer, access);
1385 struct ClassDef * prev;
1386 struct ClassDef * next;
1387 struct Location loc;
1391 struct Declaration * decl;
1392 struct ClassFunction * function;
1393 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1394 struct PropertyDef * propertyDef;
1395 struct PropertyWatch * propertyWatch;
1397 struct Identifier * defaultProperty;
1400 struct Identifier * id;
1401 struct Initializer * initializer;
1402 } ecere_gcc_struct __anon1;
1403 } ecere_gcc_struct __anon1;
1410 struct PropertyDef * prev;
1411 struct PropertyDef * next;
1412 struct Location loc;
1413 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1414 struct Declarator * declarator;
1415 struct Identifier * id;
1416 struct Statement * getStmt;
1417 struct Statement * setStmt;
1418 struct Statement * issetStmt;
1419 struct Symbol * symbol;
1420 struct Expression * category;
1423 unsigned int conversion : 1;
1424 unsigned int isWatchable : 1;
1425 unsigned int isDBProp : 1;
1426 } ecere_gcc_struct __anon1;
1429 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1431 if(definitions != (((void *)0)))
1433 struct ClassDef * def;
1435 for(def = definitions->first; def; def = def->next)
1439 struct Declaration * decl = def->__anon1.decl;
1440 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1445 struct Declarator * d;
1447 if(decl->__anon1.__anon1.declarators)
1449 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1451 struct Identifier * declId = GetDeclId(d);
1457 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1459 dataMember = link ? link->data : (((void *)0));
1462 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1464 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1468 else if(decl->__anon1.__anon1.specifiers)
1470 struct Specifier * spec;
1472 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1474 if(spec->type == 3 || spec->type == 4)
1476 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1478 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1480 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1484 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1486 dataMember = link ? link->data : (((void *)0));
1489 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1491 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1497 else if(decl->type == 2)
1499 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1506 struct FunctionDefinition;
1508 typedef union YYSTYPE
1513 struct Identifier * id;
1514 struct Expression * exp;
1515 struct Specifier * specifier;
1516 struct __ecereNameSpace__ecere__sys__OldList * list;
1517 struct Enumerator * enumerator;
1518 struct Declarator * declarator;
1519 struct Pointer * pointer;
1520 struct Initializer * initializer;
1521 struct InitDeclarator * initDeclarator;
1522 struct TypeName * typeName;
1523 struct Declaration * declaration;
1524 struct Statement * stmt;
1525 struct FunctionDefinition * function;
1526 struct External * external;
1527 struct Context * context;
1528 struct AsmField * asmField;
1529 struct Attrib * attrib;
1530 struct ExtDecl * extDecl;
1531 struct Attribute * attribute;
1532 struct Instantiation * instance;
1533 struct MembersInit * membersInit;
1534 struct MemberInit * memberInit;
1535 struct ClassFunction * classFunction;
1536 struct ClassDefinition * _class;
1537 struct ClassDef * classDef;
1538 struct PropertyDef * prop;
1540 struct Symbol * symbol;
1541 struct PropertyWatch * propertyWatch;
1542 struct TemplateParameter * templateParameter;
1543 struct TemplateArgument * templateArgument;
1544 struct TemplateDatatype * templateDatatype;
1545 struct DBTableEntry * dbtableEntry;
1546 struct DBIndexItem * dbindexItem;
1547 struct DBTableDef * dbtableDef;
1548 } ecere_gcc_struct YYSTYPE;
1550 extern YYSTYPE yylval;
1554 struct External * prev;
1555 struct External * next;
1556 struct Location loc;
1558 struct Symbol * symbol;
1561 struct FunctionDefinition * function;
1562 struct ClassDefinition * _class;
1563 struct Declaration * declaration;
1564 char * importString;
1565 struct Identifier * id;
1566 struct DBTableDef * table;
1567 } ecere_gcc_struct __anon1;
1569 struct External * fwdDecl;
1570 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1571 struct __ecereNameSpace__ecere__com__Instance * incoming;
1572 int nonBreakableIncoming;
1575 struct FunctionDefinition
1577 struct FunctionDefinition * prev;
1578 struct FunctionDefinition * next;
1579 struct Location loc;
1580 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1581 struct Declarator * declarator;
1582 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1583 struct Statement * body;
1584 struct __ecereNameSpace__ecere__com__Class * _class;
1585 struct __ecereNameSpace__ecere__sys__OldList attached;
1588 struct Symbol * propSet;
1590 unsigned int propertyNoThis;
1593 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
1595 struct __ecereNameSpace__ecere__com__NameSpace;
1597 struct __ecereNameSpace__ecere__com__NameSpace
1600 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1601 struct __ecereNameSpace__ecere__com__NameSpace * left;
1602 struct __ecereNameSpace__ecere__com__NameSpace * right;
1604 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1605 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1606 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1607 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1608 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1611 struct __ecereNameSpace__ecere__com__Class
1613 struct __ecereNameSpace__ecere__com__Class * prev;
1614 struct __ecereNameSpace__ecere__com__Class * next;
1620 unsigned int (* Constructor)(void * );
1621 void (* Destructor)(void * );
1624 struct __ecereNameSpace__ecere__com__Class * base;
1625 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1626 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1627 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1628 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1629 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1630 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1634 struct __ecereNameSpace__ecere__com__Instance * module;
1635 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1636 const char * dataTypeString;
1637 struct Type * dataType;
1639 int defaultAlignment;
1640 void (* Initialize)();
1642 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1643 const char * designerClass;
1644 unsigned int noExpansion;
1645 const char * defaultProperty;
1646 unsigned int comRedefinition;
1649 unsigned int internalDecl;
1651 unsigned int computeSize;
1652 short structAlignment;
1653 short pointerAlignment;
1654 int destructionWatchOffset;
1656 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1657 int inheritanceAccess;
1658 const char * fullName;
1660 struct __ecereNameSpace__ecere__sys__OldList conversions;
1661 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1662 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1663 struct __ecereNameSpace__ecere__com__Class * templateClass;
1664 struct __ecereNameSpace__ecere__sys__OldList templatized;
1666 unsigned int isInstanceClass;
1667 unsigned int byValueSystemClass;
1670 struct __ecereNameSpace__ecere__com__Application
1673 const char * * argv;
1675 unsigned int isGUIApp;
1676 struct __ecereNameSpace__ecere__sys__OldList allModules;
1677 char * parsedCommand;
1678 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1681 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1685 else if((*ns).parent)
1686 return NameSpaceContained((*ns).parent, parent);
1691 static void AddSimpleBaseMembers(struct External * external, struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1693 if(_class->type != 1000)
1694 AddMembers(external, list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1697 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
1699 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
1701 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1703 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1705 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
1707 struct __ecereNameSpace__ecere__com__Module
1709 struct __ecereNameSpace__ecere__com__Instance * application;
1710 struct __ecereNameSpace__ecere__sys__OldList classes;
1711 struct __ecereNameSpace__ecere__sys__OldList defines;
1712 struct __ecereNameSpace__ecere__sys__OldList functions;
1713 struct __ecereNameSpace__ecere__sys__OldList modules;
1714 struct __ecereNameSpace__ecere__com__Instance * prev;
1715 struct __ecereNameSpace__ecere__com__Instance * next;
1721 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1722 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1725 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
1730 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1732 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1736 if(regClass->templateClass)
1737 regClass = regClass->templateClass;
1738 if(classSym->isStatic && access != 3)
1740 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1742 else if(access == 1)
1744 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))
1746 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1747 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1753 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)
1755 char structName[1024];
1756 char className[1024];
1757 char constructorName[1024];
1758 char destructorName[1024];
1759 struct __ecereNameSpace__ecere__com__Class * regClass;
1760 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1761 unsigned int isUnion = classType == 6;
1762 struct External * external = (((void *)0));
1763 struct ClassDef * def;
1764 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1765 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1770 classDataList = MkList();
1772 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1775 classType = regClass->type;
1776 if(inCompiler && regClass->base)
1779 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && regClass->inheritanceAccess == 1)
1781 if(!regClass->base->symbol)
1782 regClass->base->symbol = FindClass(regClass->base->fullName);
1783 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1785 else if(!symbol->isStatic && regClass->base)
1787 if(!regClass->base->symbol)
1788 regClass->base->symbol = FindClass(regClass->base->fullName);
1789 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1792 if(definitions != (((void *)0)))
1794 for(def = definitions->first; def; def = def->next)
1798 struct __ecereNameSpace__ecere__com__DataMember * member;
1799 struct __ecereNameSpace__ecere__com__Property * prop;
1800 struct __ecereNameSpace__ecere__com__Method * method;
1802 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1804 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1806 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1808 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1810 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1812 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1817 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1824 external = MkExternalDeclaration((((void *)0)));
1825 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1826 curExternal = external;
1827 curExternal->symbol = symbol;
1829 if((classType == 1 || classType == 5) && inCompiler)
1831 AddSimpleBaseMembers(external, list, regClass->base, regClass);
1833 if(definitions != (((void *)0)))
1837 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
1838 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1839 else if(!symbol->isStatic)
1840 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1842 for(def = definitions->first; def; def = def->next)
1847 struct Declaration * decl = def->__anon1.decl;
1852 if(inCompiler && classType != 2)
1854 ListAdd(list, MkClassDefDeclaration(decl));
1855 def->__anon1.decl = (((void *)0));
1858 else if(decl->type == 2)
1860 struct Instantiation * inst = decl->__anon1.inst;
1861 struct Expression * exp = inst->exp;
1862 struct Symbol * classSym;
1866 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1867 struct Declarator * d;
1869 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1870 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1873 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1875 ListAdd(declarators, d);
1876 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1877 ListAdd(list, MkClassDefDeclaration(decl));
1879 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1880 exp->__anon1.member.exp = QMkExpId("this");
1881 exp->__anon1.member.memberType = 3;
1882 exp->__anon1.member.thisPtr = 1;
1887 FreeList(specifiers, (void *)(FreeSpecifier));
1890 classSym = inst->_class->__anon1.__anon1.symbol;
1891 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1893 if(inst->members && (*inst->members).count)
1894 symbol->needConstructor = 1;
1898 symbol->needConstructor = 1;
1899 symbol->needDestructor = 1;
1903 else if(def->type == 9)
1905 struct Declaration * decl = def->__anon1.decl;
1909 if(inCompiler && classType != 2)
1911 ListAdd(classDataList, MkClassDefDeclaration(decl));
1912 def->__anon1.decl = (((void *)0));
1916 else if(def->type == 1)
1917 symbol->needConstructor = 1;
1918 else if(def->type == 4)
1919 symbol->needConstructor = 1;
1920 else if(def->type == 0)
1922 struct ClassFunction * func = def->__anon1.function;
1924 if(func->isDestructor)
1929 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1933 symbol->needDestructor = 1;
1935 if(!inCompiler && func->body)
1937 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1939 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1943 if(func->isConstructor)
1948 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1952 symbol->needConstructor = 1;
1954 if(!inCompiler && func->body)
1956 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1958 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1967 external->symbol = (((void *)0));
1970 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1972 initDeclarators = (((void *)0));
1973 strcpy(structName, symbol->string);
1974 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1976 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1978 spec->__anon1.__anon2.extDeclStruct = extDecl;
1979 ListAdd(specs, spec);
1981 external->symbol = symbol;
1982 if(symbol->__anon2.__anon1.structExternal)
1985 struct TopoEdge * e;
1986 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->incoming;
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(external, e->from, e->breakable);
1996 struct TopoEdge * e;
1997 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->outgoing;
1999 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__ ({
2000 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
2002 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
2003 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
2004 __ecereMethod_External_CreateUniqueEdge(e->to, external, e->breakable);
2006 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), symbol->__anon2.__anon1.structExternal);
2007 FreeExternal(symbol->__anon2.__anon1.structExternal);
2009 symbol->__anon2.__anon1.structExternal = external;
2010 external->__anon1.declaration = MkDeclaration(specs, declarators);
2012 symbol->declaredStruct = 1;
2016 curExternal = external->prev;
2017 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
2018 FreeExternal(external);
2019 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
2021 if((*classDataList).count)
2023 char classDataStructName[1024];
2024 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2025 struct External * external;
2027 strcpy(classDataStructName, "__ecereClassData_");
2028 FullClassNameCat(classDataStructName, symbol->string, 0);
2029 declMode = structDeclMode = 0;
2030 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
2031 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
2032 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
2034 symbol->classData = 1;
2037 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
2042 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2044 strcpy(className, "__ecereClass_");
2045 FullClassNameCat(className, symbol->string, 1);
2046 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2047 if(!strstr(sourceFile, ".main.ec"))
2048 ListAdd(specs, MkSpecifier(STATIC));
2049 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2050 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2051 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2052 DeclareStruct(symbol->__anon2.__anon1.pointerExternal, "ecere::com::Class", 0, 1);
2053 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon1.pointerExternal);
2054 after = symbol->__anon2.__anon3.methodExternal;
2056 if(symbol->needDestructor)
2058 struct ClassFunction * function;
2059 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2060 struct Declarator * decl;
2061 struct Statement * body;
2062 struct Context * context;
2063 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2065 strcpy(destructorName, "__ecereDestructor_");
2066 FullClassNameCat(destructorName, symbol->string, 0);
2067 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2068 ListAdd(specs, MkSpecifier(VOID));
2069 context = PushContext();
2070 statements = MkList();
2071 if(definitions != (((void *)0)))
2073 for(def = definitions->first; def; def = def->next)
2075 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2077 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2078 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2080 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2082 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2084 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2086 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2088 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2090 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2095 if(destructor && destructor->body)
2097 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2098 destructor->body->__anon1.compound.context->parent = context;
2099 destructor->body = (((void *)0));
2101 body = MkCompoundStmt(declarations, statements);
2102 PopContext(context);
2103 body->__anon1.compound.context = context;
2104 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2105 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2106 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2107 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2108 ProcessClassFunctionBody(function, body);
2109 function->dontMangle = 1;
2110 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2112 if(symbol->needConstructor && inCompiler)
2114 struct ClassFunction * function;
2115 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2116 struct Declarator * decl;
2117 struct Statement * body;
2118 struct Context * context;
2119 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2121 strcpy(constructorName, "__ecereConstructor_");
2122 FullClassNameCat(constructorName, symbol->string, 0);
2123 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2124 ListAdd(specs, MkSpecifierName("bool"));
2125 context = PushContext();
2126 statements = MkList();
2127 if(definitions != (((void *)0)))
2129 for(def = definitions->first; def; def = def->next)
2131 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2133 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2134 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2136 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2138 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2141 newInst->members = (((void *)0));
2142 newInst->exp = CopyExpression(inst->exp);
2143 newInst->_class = CopySpecifier(inst->_class);
2144 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2147 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2149 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2153 for(def = definitions->first; def; def = def->next)
2155 if(def->type == 1 && def->__anon1.defProperties)
2157 struct MemberInit * propertyDef;
2159 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2161 struct Expression * memberExp;
2162 struct Identifier * id = (*propertyDef->identifiers).first;
2166 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2167 for(id = id->next; id; id = id->next)
2168 memberExp = MkExpMember(memberExp, id);
2169 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2171 if(propertyDef->initializer)
2173 if(propertyDef->initializer->type == 0)
2174 propertyDef->initializer->__anon1.exp = (((void *)0));
2175 FreeInitializer(propertyDef->initializer);
2177 propertyDef->initializer = (((void *)0));
2178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2182 for(def = definitions->first; def; def = def->next)
2184 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2186 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2187 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2189 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2191 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2193 def->__anon1.decl->__anon1.inst = (((void *)0));
2194 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2200 if(constructor && constructor->body)
2202 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2203 constructor->body->__anon1.compound.context->parent = context;
2204 constructor->body = (((void *)0));
2206 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2207 body = MkCompoundStmt(declarations, statements);
2208 PopContext(context);
2209 body->__anon1.compound.context = context;
2210 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2211 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2212 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2213 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2214 ProcessClassFunctionBody(function, body);
2215 function->dontMangle = 1;
2216 if(definitions != (((void *)0)))
2217 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2220 if(definitions != (((void *)0)))
2222 for(def = definitions->first; def; def = def->next)
2224 if(def->type == 3 && def->__anon1.propertyDef)
2226 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2227 struct ClassDef * after = def;
2228 struct ClassDef * newDef;
2232 yylloc = propertyDef->loc;
2233 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && def->memberAccess == 1)
2234 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2235 else if(!symbol->isStatic)
2236 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2240 struct ClassFunction * func;
2241 struct Declarator * decl;
2243 struct __ecereNameSpace__ecere__sys__OldList * params;
2245 if(propertyDef->getStmt && propertyDef->id)
2247 strcpy(name, "__ecereProp_");
2248 FullClassNameCat(name, symbol->string, 0);
2249 strcat(name, "_Get_");
2250 FullClassNameCat(name, propertyDef->id->string, 1);
2252 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)
2254 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2255 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2256 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2260 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2261 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2263 ProcessClassFunctionBody(func, propertyDef->getStmt);
2264 func->declarator->symbol = propertyDef->symbol;
2265 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2266 func->dontMangle = 1;
2267 newDef = MkClassDefFunction(func);
2268 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2271 propertyDef->getStmt = (((void *)0));
2273 func->body = (((void *)0));
2275 if(propertyDef->setStmt && propertyDef->id)
2277 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2279 strcpy(name, "__ecereProp_");
2280 FullClassNameCat(name, symbol->string, 0);
2281 strcat(name, "_Set_");
2282 FullClassNameCat(name, propertyDef->id->string, 1);
2284 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2285 if(propertyDef->__anon1.isDBProp)
2287 struct Specifier * spec;
2288 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2290 for(spec = (*specs).first; spec; spec = spec->next)
2291 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2294 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2296 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2298 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2299 unsigned int useVoid = 0;
2301 switch(regClass->type)
2309 useVoid = !isConversion;
2312 useVoid = !isConversion;
2313 if(useVoid && !propertyDef->__anon1.isDBProp)
2314 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2316 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2318 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2319 ProcessClassFunctionBody(func, propertyDef->setStmt);
2320 func->dontMangle = 1;
2321 func->declarator->symbol = propertyDef->symbol;
2322 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2323 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2324 func->propSet = propertyDef->symbol;
2325 newDef = MkClassDefFunction(func);
2326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2329 propertyDef->setStmt = (((void *)0));
2331 func->body = (((void *)0));
2333 if(propertyDef->issetStmt && propertyDef->id)
2335 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2337 strcpy(name, "__ecereProp_");
2338 FullClassNameCat(name, symbol->string, 0);
2339 strcat(name, "_IsSet_");
2340 FullClassNameCat(name, propertyDef->id->string, 1);
2342 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2343 ListAdd(specifiers, MkSpecifierName("bool"));
2344 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2345 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2346 func->dontMangle = 1;
2347 func->declarator->symbol = propertyDef->symbol;
2348 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2349 newDef = MkClassDefFunction(func);
2350 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2353 propertyDef->issetStmt = (((void *)0));
2355 func->body = (((void *)0));
2357 if(propertyDef->id && inCompiler)
2359 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2360 struct Declaration * decl;
2361 struct External * external;
2362 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2364 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2365 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2366 ListAdd(specifiers, MkSpecifierName("Property"));
2367 strcpy(name, "__ecereProp_");
2368 FullClassNameCat(name, symbol->string, 0);
2370 FullClassNameCat(name, propertyDef->id->string, 1);
2372 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2374 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2375 strcpy(name, "__ecerePropM_");
2376 FullClassNameCat(name, symbol->string, 0);
2378 FullClassNameCat(name, propertyDef->id->string, 1);
2379 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2380 decl = MkDeclaration(specifiers, list);
2382 external = MkExternalDeclaration(decl);
2383 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2384 external->symbol = propertyDef->symbol;
2385 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2386 if(inCompiler && prop && prop->symbol)
2387 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2392 else if(def->type == 10 && def->__anon1.propertyDef)
2394 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2395 struct ClassDef * after = def;
2396 struct ClassDef * newDef;
2401 yylloc = propertyDef->loc;
2402 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
2403 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2404 else if(!symbol->isStatic)
2405 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2408 struct ClassFunction * func;
2409 struct Declarator * decl;
2411 struct __ecereNameSpace__ecere__sys__OldList * params;
2413 if(propertyDef->getStmt && propertyDef->id)
2415 struct Declarator * declId;
2417 sprintf(name, "class::__ecereClassProp_");
2418 FullClassNameCat(name, symbol->string, 0);
2419 strcat(name, "_Get_");
2420 strcat(name, propertyDef->id->string);
2422 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2424 decl = MkDeclaratorFunction(declId, params);
2425 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2427 ProcessClassFunctionBody(func, propertyDef->getStmt);
2428 func->declarator->symbol = propertyDef->symbol;
2429 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2430 func->dontMangle = 1;
2431 newDef = MkClassDefFunction(func);
2432 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2434 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2435 func->type = ProcessType(propertyDef->specifiers, decl);
2436 FreeDeclarator(decl);
2437 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)
2438 func->type->__anon1.__anon2.returnType->byReference = 1;
2439 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2441 propertyDef->getStmt = (((void *)0));
2443 func->body = (((void *)0));
2445 if(propertyDef->setStmt && propertyDef->id)
2447 struct Context * prevCurContext;
2448 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2449 struct Statement * body = propertyDef->setStmt;
2450 struct Declarator * ptrDecl;
2451 struct Expression * e;
2453 strcpy(name, "class::__ecereClassProp_");
2454 FullClassNameCat(name, symbol->string, 0);
2455 strcat(name, "_Set_");
2456 strcat(name, propertyDef->id->string);
2458 prevCurContext = curContext;
2459 curContext = body->__anon1.compound.context;
2460 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2461 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2462 if(!body->__anon1.compound.declarations)
2463 body->__anon1.compound.declarations = MkList();
2464 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)
2465 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2467 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2468 e = MkExpIdentifier(MkIdentifier("_value"));
2469 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2470 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2471 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))))));
2472 curContext = prevCurContext;
2474 struct Symbol * sym = ptrDecl->symbol;
2477 FreeType(sym->type);
2478 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2480 ListAdd(specifiers, MkSpecifier(VOID));
2481 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2482 ProcessClassFunctionBody(func, propertyDef->setStmt);
2483 func->dontMangle = 1;
2484 func->declarator->symbol = propertyDef->symbol;
2485 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2486 newDef = MkClassDefFunction(func);
2487 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2490 propertyDef->setStmt = (((void *)0));
2492 func->body = (((void *)0));
2497 else if(def->type == 0 && def->__anon1.function->declarator)
2499 struct ClassFunction * func = def->__anon1.function;
2501 func->_class = regClass;
2502 if(!func->dontMangle)
2504 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2505 struct Identifier * id = GetDeclId(funcDecl);
2506 struct __ecereNameSpace__ecere__com__Method * method;
2508 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2510 if(!funcDecl->__anon1.function.parameters)
2511 funcDecl->__anon1.function.parameters = MkList();
2512 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2514 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2515 FreeSpecifier(id->_class);
2516 id->_class = (((void *)0));
2517 if(inCompiler && method)
2519 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2522 ProcessMethodType(method);
2524 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && method->memberAccess == 1)
2525 CheckPublicDataType(method->dataType, 1, "class method");
2526 strcpy(newId, "__ecereMethod_");
2527 FullClassNameCat(newId, symbol->string, 0);
2529 strcat(newId, id->string);
2530 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2532 if(method->type != 1)
2536 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2537 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2545 if(initDeclarators != (((void *)0)))
2546 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2549 void PreProcessClassDefinitions()
2551 struct External * external, * next;
2553 curExternal = (((void *)0));
2556 for(external = (*ast).first; external; external = next)
2558 next = external->next;
2559 curExternal = external;
2560 if(external->type == 2)
2562 struct ClassDefinition * _class = external->__anon1._class;
2564 if(_class->definitions)
2566 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2569 else if(external->type == 1)
2571 struct Declaration * declaration = external->__anon1.declaration;
2573 if(declaration && declaration->type == 1)
2575 if(declaration->__anon1.__anon1.specifiers)
2577 struct Specifier * specifier;
2579 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2581 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)))
2583 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2587 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2588 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2590 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2593 initDeclarators = declaration->__anon1.__anon1.declarators;
2594 declaration->__anon1.__anon1.declarators = (((void *)0));
2596 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);
2602 else if(declaration && inCompiler && declaration->type == 3)
2604 yylloc = declaration->loc;
2605 if(declaration->declMode == 1)
2606 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2607 else if(declaration->declMode != 3)
2608 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2611 else if(external->type == 3)
2614 else if(inCompiler && external->type == 0)
2616 yylloc = external->__anon1.function->loc;
2617 if(!external->__anon1.function->type)
2618 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2619 if(external->__anon1.function->declMode == 1)
2620 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2621 else if(external->__anon1.function->declMode != 3)
2622 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2628 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2630 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2632 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2633 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);