1 /* Code generated from eC source file: pass0.ec */
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
7 #define __runtimePlatform 2
10 typedef long long int64;
11 typedef unsigned long long uint64;
15 #elif defined(__TINYC__)
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
27 typedef long long int64;
28 typedef unsigned long long uint64;
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
34 #define __ENDIAN_PAD(x) (8 - (x))
36 #define __ENDIAN_PAD(x) 0
39 # if defined(__GNUC__) || defined(__TINYC__)
40 # define ecere_stdcall __attribute__((__stdcall__))
41 # define ecere_gcc_struct __attribute__((gcc_struct))
43 # define ecere_stdcall __stdcall
44 # define ecere_gcc_struct
47 # define ecere_stdcall
48 # define ecere_gcc_struct
51 #include <sys/types.h>
54 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, INT128 = 294, LONG = 295, SIGNED = 296, UNSIGNED = 297, FLOAT = 298, DOUBLE = 299, CONST = 300, VOLATILE = 301, VOID = 302, VALIST = 303, STRUCT = 304, UNION = 305, ENUM = 306, ELLIPSIS = 307, CASE = 308, DEFAULT = 309, IF = 310, SWITCH = 311, WHILE = 312, DO = 313, FOR = 314, GOTO = 315, CONTINUE = 316, BREAK = 317, RETURN = 318, IFX = 319, ELSE = 320, CLASS = 321, THISCLASS = 322, CLASS_NAME = 323, PROPERTY = 324, SETPROP = 325, GETPROP = 326, NEWOP = 327, RENEW = 328, DELETE = 329, EXT_DECL = 330, EXT_STORAGE = 331, IMPORT = 332, DEFINE = 333, VIRTUAL = 334, ATTRIB = 335, PUBLIC = 336, PRIVATE = 337, TYPED_OBJECT = 338, ANY_OBJECT = 339, _INCREF = 340, EXTENSION = 341, ASM = 342, TYPEOF = 343, WATCH = 344, STOPWATCHING = 345, FIREWATCHERS = 346, WATCHABLE = 347, CLASS_DESIGNER = 348, CLASS_NO_EXPANSION = 349, CLASS_FIXED = 350, ISPROPSET = 351, CLASS_DEFAULT_PROPERTY = 352, PROPERTY_CATEGORY = 353, CLASS_DATA = 354, CLASS_PROPERTY = 355, SUBCLASS = 356, NAMESPACE = 357, NEW0OP = 358, RENEW0 = 359, VAARG = 360, DBTABLE = 361, DBFIELD = 362, DBINDEX = 363, DATABASE_OPEN = 364, ALIGNOF = 365, ATTRIB_DEP = 366, __ATTRIB = 367, BOOL = 368, _BOOL = 369, _COMPLEX = 370, _IMAGINARY = 371, RESTRICT = 372, THREAD = 373, WIDE_STRING_LITERAL = 374, BUILTIN_OFFSETOF = 375
57 extern unsigned int inCompiler;
61 extern int structDeclMode;
63 extern const char * sourceFile;
65 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
67 struct __ecereNameSpace__ecere__sys__OldList
76 struct __ecereNameSpace__ecere__sys__BTNode;
78 struct __ecereNameSpace__ecere__com__DataValue
93 } ecere_gcc_struct __anon1;
96 struct __ecereNameSpace__ecere__com__SerialBuffer
98 unsigned char * _buffer;
104 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
106 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
108 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
110 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
112 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
118 struct InitDeclarator;
128 struct PropertyWatch;
130 struct TemplateParameter;
132 struct TemplateArgument;
134 struct TemplateDatatype;
150 extern char * strcat(char * , const char * );
152 extern size_t strlen(const char * );
154 extern int strncmp(const char * , const char * , size_t n);
160 extern void Compiler_Error(const char * format, ...);
162 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
164 struct __ecereNameSpace__ecere__com__LinkList
171 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
173 extern char * strcpy(char * , const char * );
175 struct __ecereNameSpace__ecere__com__LinkElement
181 extern char * strstr(const char * , const char * );
183 extern void Compiler_Warning(const char * format, ...);
185 extern int sprintf(char * , const char * , ...);
187 struct __ecereNameSpace__ecere__com__GlobalFunction;
189 struct __ecereNameSpace__ecere__com__IteratorPointer;
191 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
193 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
195 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
197 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
199 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
201 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
203 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
205 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
207 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
209 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
211 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
213 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
215 extern void FreeInitDeclarator(struct InitDeclarator * decl);
217 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList * attribs);
219 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
223 struct CodePosition start;
224 struct CodePosition end;
227 void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams)
233 for(c = 0; (ch = className[c]) && ch != '<'; c++)
237 strcat(output, "__ecereNameSpace__");
241 len = strlen(output);
243 if(!strncmp(className, "const ", 6))
245 for(; (ch = className[c]); c++)
269 if(!includeTemplateParams)
271 if(!strncmp(className + c + 1, "const ", 6))
285 if(!strncmp(className + c + 1, "const ", 6))
295 extern struct Location yylloc;
299 extern struct External * curExternal;
303 struct __ecereNameSpace__ecere__com__LinkElement in;
304 struct __ecereNameSpace__ecere__com__LinkElement out;
305 struct External * from;
306 struct External * to;
307 unsigned int breakable;
310 extern void FreeExternal(struct External * external);
312 extern struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference);
316 extern struct Context * PushContext(void);
318 extern void PopContext(struct Context * ctx);
320 extern struct Context * curContext;
322 struct __ecereNameSpace__ecere__com__Class;
324 struct __ecereNameSpace__ecere__com__Instance
327 struct __ecereNameSpace__ecere__com__Class * _class;
331 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
333 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
335 extern int AddMembers(struct External * neededBy, struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int * addedPadding);
337 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
339 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
341 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
343 int __ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext;
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;
725 unsigned int isVector : 1;
728 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);
730 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
732 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
738 struct ClassFunction * prev;
739 struct ClassFunction * next;
741 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
742 struct Declarator * declarator;
743 struct __ecereNameSpace__ecere__sys__OldList * declarations;
744 struct Statement * body;
745 struct __ecereNameSpace__ecere__com__Class * _class;
746 struct __ecereNameSpace__ecere__sys__OldList attached;
749 struct Symbol * propSet;
750 unsigned int isVirtual;
751 unsigned int isConstructor;
752 unsigned int isDestructor;
753 unsigned int dontMangle;
760 struct Statement * prev;
761 struct Statement * next;
766 struct __ecereNameSpace__ecere__sys__OldList * expressions;
769 struct Identifier * id;
770 struct Statement * stmt;
771 } ecere_gcc_struct labeled;
774 struct Expression * exp;
775 struct Statement * stmt;
776 } ecere_gcc_struct caseStmt;
779 struct __ecereNameSpace__ecere__sys__OldList * declarations;
780 struct __ecereNameSpace__ecere__sys__OldList * statements;
781 struct Context * context;
782 unsigned int isSwitch;
783 } ecere_gcc_struct compound;
786 struct __ecereNameSpace__ecere__sys__OldList * exp;
787 struct Statement * stmt;
788 struct Statement * elseStmt;
789 } ecere_gcc_struct ifStmt;
792 struct __ecereNameSpace__ecere__sys__OldList * exp;
793 struct Statement * stmt;
794 } ecere_gcc_struct switchStmt;
797 struct __ecereNameSpace__ecere__sys__OldList * exp;
798 struct Statement * stmt;
799 } ecere_gcc_struct whileStmt;
802 struct __ecereNameSpace__ecere__sys__OldList * exp;
803 struct Statement * stmt;
804 } ecere_gcc_struct doWhile;
807 struct Statement * init;
808 struct Statement * check;
809 struct __ecereNameSpace__ecere__sys__OldList * increment;
810 struct Statement * stmt;
811 } ecere_gcc_struct forStmt;
814 struct Identifier * id;
815 } ecere_gcc_struct gotoStmt;
818 struct Specifier * spec;
820 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
821 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
822 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
823 } ecere_gcc_struct asmStmt;
826 struct Expression * watcher;
827 struct Expression * object;
828 struct __ecereNameSpace__ecere__sys__OldList * watches;
829 } ecere_gcc_struct _watch;
832 struct Identifier * id;
833 struct __ecereNameSpace__ecere__sys__OldList * exp;
834 struct __ecereNameSpace__ecere__sys__OldList * filter;
835 struct Statement * stmt;
836 } ecere_gcc_struct forEachStmt;
837 struct Declaration * decl;
838 } ecere_gcc_struct __anon1;
841 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
843 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
845 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
847 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
849 struct __ecereNameSpace__ecere__sys__BinaryTree;
851 struct __ecereNameSpace__ecere__sys__BinaryTree
853 struct __ecereNameSpace__ecere__sys__BTNode * root;
855 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
856 void (* FreeKey)(void * key);
859 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
861 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
863 struct __ecereNameSpace__ecere__com__DataMember;
865 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
871 const char * dataTypeString;
872 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
873 } ecere_gcc_struct __anon1;
874 struct __ecereNameSpace__ecere__com__DataValue expression;
877 const char * memberString;
880 struct __ecereNameSpace__ecere__com__DataMember * member;
881 struct __ecereNameSpace__ecere__com__Property * prop;
882 struct __ecereNameSpace__ecere__com__Method * method;
883 } ecere_gcc_struct __anon1;
884 } ecere_gcc_struct __anon2;
885 } ecere_gcc_struct __anon1;
888 struct __ecereNameSpace__ecere__com__DataMember
890 struct __ecereNameSpace__ecere__com__DataMember * prev;
891 struct __ecereNameSpace__ecere__com__DataMember * next;
893 unsigned int isProperty;
896 struct __ecereNameSpace__ecere__com__Class * _class;
897 const char * dataTypeString;
898 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
899 struct Type * dataType;
903 struct __ecereNameSpace__ecere__sys__OldList members;
904 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
906 short structAlignment;
907 short pointerAlignment;
910 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, unsigned int size, unsigned int alignment, int declMode);
912 struct __ecereNameSpace__ecere__com__Module;
914 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
916 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
918 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
920 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
922 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
924 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
926 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char * name, const char * type, void * func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
932 struct TypeName * prev;
933 struct TypeName * next;
935 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
936 struct Declarator * declarator;
938 struct Expression * bitCount;
941 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
943 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
947 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
949 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
951 struct ClassDefinition;
955 struct Context * parent;
956 struct __ecereNameSpace__ecere__sys__BinaryTree types;
957 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
958 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
959 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
962 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
963 struct ClassDefinition * classDef;
964 unsigned int templateTypesOnly;
965 unsigned int hasNameSpace;
968 struct ClassDefinition
970 struct ClassDefinition * prev;
971 struct ClassDefinition * next;
973 struct Specifier * _class;
974 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
975 struct __ecereNameSpace__ecere__sys__OldList * definitions;
976 struct Symbol * symbol;
977 struct Location blockStart;
978 struct Location nameLoc;
980 unsigned int deleteWatchable;
983 struct Instantiation;
987 struct Expression * prev;
988 struct Expression * next;
996 struct Identifier * identifier;
997 } ecere_gcc_struct __anon1;
998 struct Statement * compound;
999 struct Instantiation * instance;
1003 unsigned int intlString;
1004 unsigned int wideString;
1005 } ecere_gcc_struct __anon2;
1006 struct __ecereNameSpace__ecere__sys__OldList * list;
1009 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1010 struct Declarator * decl;
1011 } ecere_gcc_struct _classExp;
1014 struct Identifier * id;
1015 } ecere_gcc_struct classData;
1018 struct Expression * exp;
1019 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1020 struct Location argLoc;
1021 } ecere_gcc_struct call;
1024 struct Expression * exp;
1025 struct __ecereNameSpace__ecere__sys__OldList * index;
1026 } ecere_gcc_struct index;
1029 struct Expression * exp;
1030 struct Identifier * member;
1032 unsigned int thisPtr;
1033 } ecere_gcc_struct member;
1037 struct Expression * exp1;
1038 struct Expression * exp2;
1039 } ecere_gcc_struct op;
1040 struct TypeName * typeName;
1041 struct Specifier * _class;
1044 struct TypeName * typeName;
1045 struct Expression * exp;
1046 } ecere_gcc_struct cast;
1049 struct Expression * cond;
1050 struct __ecereNameSpace__ecere__sys__OldList * exp;
1051 struct Expression * elseExp;
1052 } ecere_gcc_struct cond;
1055 struct TypeName * typeName;
1056 struct Expression * size;
1057 } ecere_gcc_struct _new;
1060 struct TypeName * typeName;
1061 struct Expression * size;
1062 struct Expression * exp;
1063 } ecere_gcc_struct _renew;
1067 struct Identifier * id;
1068 } ecere_gcc_struct db;
1071 struct Expression * ds;
1072 struct Expression * name;
1073 } ecere_gcc_struct dbopen;
1076 struct TypeName * typeName;
1077 struct Initializer * initializer;
1078 } ecere_gcc_struct initializer;
1081 struct Expression * exp;
1082 struct TypeName * typeName;
1083 } ecere_gcc_struct vaArg;
1086 struct TypeName * typeName;
1087 struct Identifier * id;
1088 } ecere_gcc_struct offset;
1089 } ecere_gcc_struct __anon1;
1090 unsigned int debugValue;
1091 struct __ecereNameSpace__ecere__com__DataValue val;
1093 unsigned int hasAddress;
1094 struct Type * expType;
1095 struct Type * destType;
1098 unsigned int byReference;
1099 unsigned int isConstant;
1100 unsigned int addedThis;
1101 unsigned int needCast;
1102 unsigned int thisPtr;
1103 unsigned int opDestType;
1104 unsigned int usedInComparison;
1105 unsigned int ambiguousUnits;
1106 unsigned int parentOpDestType;
1107 unsigned int needTemplateCast;
1110 struct Instantiation
1112 struct Instantiation * prev;
1113 struct Instantiation * next;
1114 struct Location loc;
1115 struct Specifier * _class;
1116 struct Expression * exp;
1117 struct __ecereNameSpace__ecere__sys__OldList * members;
1118 struct Symbol * symbol;
1119 unsigned int fullSet;
1120 unsigned int isConstant;
1121 unsigned char * data;
1122 struct Location nameLoc;
1123 struct Location insideLoc;
1129 struct Declaration * prev;
1130 struct Declaration * next;
1131 struct Location loc;
1137 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1138 struct __ecereNameSpace__ecere__sys__OldList * declarators;
1139 } ecere_gcc_struct __anon1;
1140 struct Instantiation * inst;
1143 struct Identifier * id;
1144 struct Expression * exp;
1145 } ecere_gcc_struct __anon2;
1146 } ecere_gcc_struct __anon1;
1147 struct Specifier * extStorage;
1148 struct Symbol * symbol;
1152 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1158 struct MembersInit * prev;
1159 struct MembersInit * next;
1160 struct Location loc;
1164 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1165 struct ClassFunction * function;
1166 } ecere_gcc_struct __anon1;
1173 struct MemberInit * prev;
1174 struct MemberInit * next;
1175 struct Location loc;
1176 struct Location realLoc;
1177 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1178 struct Initializer * initializer;
1180 unsigned int variable;
1181 unsigned int takeOutExp;
1184 static void CheckPublicExpression(struct Expression * exp, int access);
1186 static void CheckPublicInitializer(struct Initializer * init, int access)
1191 CheckPublicExpression(init->__anon1.exp, access);
1195 struct Initializer * i;
1197 for(i = (*init->__anon1.list).first; i; i = i->next)
1198 CheckPublicInitializer(i, access);
1204 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word);
1206 static void CheckPublicTypeName(struct TypeName * type, int access)
1208 if(type->qualifiers)
1210 struct Specifier * spec;
1212 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1216 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1218 CheckPublicClass(classSym, access, "define");
1224 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1232 CheckPublicClass(type->__anon1._class, access, word);
1242 struct Type * param;
1244 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1245 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1246 CheckPublicDataType(param, access, word);
1247 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1251 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1252 if(type->__anon1.__anon4.enumClass)
1253 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1257 CheckPublicDataType(type->__anon1.type, access, word);
1266 CheckPublicClass(type->__anon1._class, access, word);
1273 static void CheckPublicExpression(struct Expression * exp, int access)
1286 if(exp->__anon1.op.exp1)
1287 CheckPublicExpression(exp->__anon1.op.exp1, access);
1288 if(exp->__anon1.op.exp2)
1289 CheckPublicExpression(exp->__anon1.op.exp2, access);
1293 struct Expression * e;
1295 for(e = (*exp->__anon1.list).first; e; e = e->next)
1296 CheckPublicExpression(e, access);
1301 struct Expression * e;
1303 CheckPublicExpression(exp->__anon1.index.exp, access);
1304 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1305 CheckPublicExpression(e, access);
1310 struct Expression * e;
1312 CheckPublicExpression(exp->__anon1.call.exp, access);
1313 if(exp->__anon1.call.arguments)
1315 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1316 CheckPublicExpression(e, access);
1322 CheckPublicExpression(exp->__anon1.member.exp, access);
1327 CheckPublicExpression(exp->__anon1.member.exp, access);
1331 CheckPublicTypeName(exp->__anon1.typeName, access);
1335 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1336 if(exp->__anon1.cast.exp)
1337 CheckPublicExpression(exp->__anon1.cast.exp, access);
1342 struct Expression * e;
1344 CheckPublicExpression(exp->__anon1.cond.cond, access);
1345 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1346 CheckPublicExpression(e, access);
1347 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1352 CheckPublicExpression(exp->__anon1._new.size, access);
1356 CheckPublicExpression(exp->__anon1._renew.size, access);
1357 CheckPublicExpression(exp->__anon1._renew.exp, access);
1361 struct MembersInit * members;
1363 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1364 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1366 if(members->type == 0)
1368 struct MemberInit * member;
1370 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1372 CheckPublicInitializer(member->initializer, access);
1386 struct ClassDef * prev;
1387 struct ClassDef * next;
1388 struct Location loc;
1392 struct Declaration * decl;
1393 struct ClassFunction * function;
1394 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1395 struct PropertyDef * propertyDef;
1396 struct PropertyWatch * propertyWatch;
1398 struct Identifier * defaultProperty;
1401 struct Identifier * id;
1402 struct Initializer * initializer;
1403 } ecere_gcc_struct __anon1;
1404 } ecere_gcc_struct __anon1;
1411 struct PropertyDef * prev;
1412 struct PropertyDef * next;
1413 struct Location loc;
1414 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1415 struct Declarator * declarator;
1416 struct Identifier * id;
1417 struct Statement * getStmt;
1418 struct Statement * setStmt;
1419 struct Statement * issetStmt;
1420 struct Symbol * symbol;
1421 struct Expression * category;
1424 unsigned int conversion : 1;
1425 unsigned int isWatchable : 1;
1426 unsigned int isDBProp : 1;
1427 } ecere_gcc_struct __anon1;
1430 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1432 if(definitions != (((void *)0)))
1434 struct ClassDef * def;
1436 for(def = definitions->first; def; def = def->next)
1440 struct Declaration * decl = def->__anon1.decl;
1441 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1446 struct Declarator * d;
1448 if(decl->__anon1.__anon1.declarators)
1450 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1452 struct Identifier * declId = GetDeclId(d);
1458 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1460 dataMember = link ? link->data : (((void *)0));
1463 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1465 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1469 else if(decl->__anon1.__anon1.specifiers)
1471 struct Specifier * spec;
1473 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1475 if(spec->type == 3 || spec->type == 4)
1477 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1479 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1481 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1485 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1487 dataMember = link ? link->data : (((void *)0));
1490 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1492 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1498 else if(decl->type == 2)
1500 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1507 struct FunctionDefinition;
1509 typedef union YYSTYPE
1514 struct Identifier * id;
1515 struct Expression * exp;
1516 struct Specifier * specifier;
1517 struct __ecereNameSpace__ecere__sys__OldList * list;
1518 struct Enumerator * enumerator;
1519 struct Declarator * declarator;
1520 struct Pointer * pointer;
1521 struct Initializer * initializer;
1522 struct InitDeclarator * initDeclarator;
1523 struct TypeName * typeName;
1524 struct Declaration * declaration;
1525 struct Statement * stmt;
1526 struct FunctionDefinition * function;
1527 struct External * external;
1528 struct Context * context;
1529 struct AsmField * asmField;
1530 struct Attrib * attrib;
1531 struct ExtDecl * extDecl;
1532 struct Attribute * attribute;
1533 struct Instantiation * instance;
1534 struct MembersInit * membersInit;
1535 struct MemberInit * memberInit;
1536 struct ClassFunction * classFunction;
1537 struct ClassDefinition * _class;
1538 struct ClassDef * classDef;
1539 struct PropertyDef * prop;
1541 struct Symbol * symbol;
1542 struct PropertyWatch * propertyWatch;
1543 struct TemplateParameter * templateParameter;
1544 struct TemplateArgument * templateArgument;
1545 struct TemplateDatatype * templateDatatype;
1546 struct DBTableEntry * dbtableEntry;
1547 struct DBIndexItem * dbindexItem;
1548 struct DBTableDef * dbtableDef;
1549 } ecere_gcc_struct YYSTYPE;
1551 extern YYSTYPE yylval;
1555 struct External * prev;
1556 struct External * next;
1557 struct Location loc;
1559 struct Symbol * symbol;
1562 struct FunctionDefinition * function;
1563 struct ClassDefinition * _class;
1564 struct Declaration * declaration;
1565 char * importString;
1566 struct Identifier * id;
1567 struct DBTableDef * table;
1568 } ecere_gcc_struct __anon1;
1570 struct External * fwdDecl;
1571 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1572 struct __ecereNameSpace__ecere__com__Instance * incoming;
1573 int nonBreakableIncoming;
1576 struct FunctionDefinition
1578 struct FunctionDefinition * prev;
1579 struct FunctionDefinition * next;
1580 struct Location loc;
1581 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1582 struct Declarator * declarator;
1583 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1584 struct Statement * body;
1585 struct __ecereNameSpace__ecere__com__Class * _class;
1586 struct __ecereNameSpace__ecere__sys__OldList attached;
1589 struct Symbol * propSet;
1591 unsigned int propertyNoThis;
1594 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
1596 struct __ecereNameSpace__ecere__com__NameSpace;
1598 struct __ecereNameSpace__ecere__com__NameSpace
1601 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1602 struct __ecereNameSpace__ecere__com__NameSpace * left;
1603 struct __ecereNameSpace__ecere__com__NameSpace * right;
1605 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1606 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1607 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1608 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1609 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1612 struct __ecereNameSpace__ecere__com__Class
1614 struct __ecereNameSpace__ecere__com__Class * prev;
1615 struct __ecereNameSpace__ecere__com__Class * next;
1621 unsigned int (* Constructor)(void * );
1622 void (* Destructor)(void * );
1625 struct __ecereNameSpace__ecere__com__Class * base;
1626 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1627 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1628 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1629 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1630 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1631 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1635 struct __ecereNameSpace__ecere__com__Instance * module;
1636 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1637 const char * dataTypeString;
1638 struct Type * dataType;
1640 int defaultAlignment;
1641 void (* Initialize)();
1643 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1644 const char * designerClass;
1645 unsigned int noExpansion;
1646 const char * defaultProperty;
1647 unsigned int comRedefinition;
1650 unsigned int internalDecl;
1652 unsigned int computeSize;
1653 short structAlignment;
1654 short pointerAlignment;
1655 int destructionWatchOffset;
1657 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1658 int inheritanceAccess;
1659 const char * fullName;
1661 struct __ecereNameSpace__ecere__sys__OldList conversions;
1662 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1663 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1664 struct __ecereNameSpace__ecere__com__Class * templateClass;
1665 struct __ecereNameSpace__ecere__sys__OldList templatized;
1667 unsigned int isInstanceClass;
1668 unsigned int byValueSystemClass;
1671 struct __ecereNameSpace__ecere__com__Application
1674 const char * * argv;
1676 unsigned int isGUIApp;
1677 struct __ecereNameSpace__ecere__sys__OldList allModules;
1678 char * parsedCommand;
1679 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1682 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1686 else if((*ns).parent)
1687 return NameSpaceContained((*ns).parent, parent);
1692 static void AddSimpleBaseMembers(struct External * external, struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1694 if(_class->type != 1000)
1695 AddMembers(external, list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1698 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
1700 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
1702 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1704 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1706 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
1708 struct __ecereNameSpace__ecere__com__Module
1710 struct __ecereNameSpace__ecere__com__Instance * application;
1711 struct __ecereNameSpace__ecere__sys__OldList classes;
1712 struct __ecereNameSpace__ecere__sys__OldList defines;
1713 struct __ecereNameSpace__ecere__sys__OldList functions;
1714 struct __ecereNameSpace__ecere__sys__OldList modules;
1715 struct __ecereNameSpace__ecere__com__Instance * prev;
1716 struct __ecereNameSpace__ecere__com__Instance * next;
1722 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1723 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1726 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
1731 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1733 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1737 if(regClass->templateClass)
1738 regClass = regClass->templateClass;
1739 if(classSym->isStatic && access != 3)
1741 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1743 else if(access == 1)
1745 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))
1747 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1748 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1754 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)
1756 char structName[1024];
1757 char className[1024];
1758 char constructorName[1024];
1759 char destructorName[1024];
1760 struct __ecereNameSpace__ecere__com__Class * regClass;
1761 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1762 unsigned int isUnion = classType == 6;
1763 struct External * external = (((void *)0));
1764 struct ClassDef * def;
1765 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1766 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1771 classDataList = MkList();
1773 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1776 classType = regClass->type;
1777 if(inCompiler && regClass->base)
1780 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && regClass->inheritanceAccess == 1)
1782 if(!regClass->base->symbol)
1783 regClass->base->symbol = FindClass(regClass->base->fullName);
1784 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1786 else if(!symbol->isStatic && regClass->base)
1788 if(!regClass->base->symbol)
1789 regClass->base->symbol = FindClass(regClass->base->fullName);
1790 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1793 if(definitions != (((void *)0)))
1795 for(def = definitions->first; def; def = def->next)
1799 struct __ecereNameSpace__ecere__com__DataMember * member;
1800 struct __ecereNameSpace__ecere__com__Property * prop;
1801 struct __ecereNameSpace__ecere__com__Method * method;
1803 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1805 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1807 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1809 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1811 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1813 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1818 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1825 external = MkExternalDeclaration((((void *)0)));
1826 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1827 curExternal = external;
1828 curExternal->symbol = symbol;
1830 if((classType == 1 || classType == 5) && inCompiler)
1832 AddSimpleBaseMembers(external, list, regClass->base, regClass);
1834 if(definitions != (((void *)0)))
1838 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
1839 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1840 else if(!symbol->isStatic)
1841 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1843 for(def = definitions->first; def; def = def->next)
1848 struct Declaration * decl = def->__anon1.decl;
1853 if(inCompiler && classType != 2)
1855 ListAdd(list, MkClassDefDeclaration(decl));
1856 def->__anon1.decl = (((void *)0));
1859 else if(decl->type == 2)
1861 struct Instantiation * inst = decl->__anon1.inst;
1862 struct Expression * exp = inst->exp;
1863 struct Symbol * classSym;
1867 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1868 struct Declarator * d;
1870 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1871 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1874 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1876 ListAdd(declarators, d);
1877 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1878 ListAdd(list, MkClassDefDeclaration(decl));
1880 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1881 exp->__anon1.member.exp = QMkExpId("this");
1882 exp->__anon1.member.memberType = 3;
1883 exp->__anon1.member.thisPtr = 1;
1888 FreeList(specifiers, (void *)(FreeSpecifier));
1891 classSym = inst->_class->__anon1.__anon1.symbol;
1892 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1894 if(inst->members && (*inst->members).count)
1895 symbol->needConstructor = 1;
1899 symbol->needConstructor = 1;
1900 symbol->needDestructor = 1;
1904 else if(def->type == 9)
1906 struct Declaration * decl = def->__anon1.decl;
1910 if(inCompiler && classType != 2)
1912 ListAdd(classDataList, MkClassDefDeclaration(decl));
1913 def->__anon1.decl = (((void *)0));
1917 else if(def->type == 1)
1918 symbol->needConstructor = 1;
1919 else if(def->type == 4)
1920 symbol->needConstructor = 1;
1921 else if(def->type == 0)
1923 struct ClassFunction * func = def->__anon1.function;
1925 if(func->isDestructor)
1930 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1934 symbol->needDestructor = 1;
1936 if(!inCompiler && func->body)
1938 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1940 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1944 if(func->isConstructor)
1949 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1953 symbol->needConstructor = 1;
1955 if(!inCompiler && func->body)
1957 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1959 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1968 external->symbol = (((void *)0));
1971 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1973 initDeclarators = (((void *)0));
1974 strcpy(structName, symbol->string);
1975 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1977 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1979 spec->__anon1.__anon2.extDeclStruct = extDecl;
1980 ListAdd(specs, spec);
1982 external->symbol = symbol;
1983 if(symbol->__anon2.__anon1.structExternal)
1986 struct TopoEdge * e;
1987 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->incoming;
1989 for(e = ((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first; e; e = (struct TopoEdge *)(__extension__ ({
1990 struct __ecereNameSpace__ecere__com__IteratorPointer * (* __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer);
1992 __internal_VirtualMethod = ((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
1993 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1995 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1996 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext]);
1997 __internal_VirtualMethod ? __internal_VirtualMethod(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e) : (struct __ecereNameSpace__ecere__com__IteratorPointer *)1;
1999 __ecereMethod_External_CreateUniqueEdge(external, e->from, e->breakable);
2002 struct TopoEdge * e;
2003 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->outgoing;
2005 for(e = ((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first; e; e = (struct TopoEdge *)(__extension__ ({
2006 struct __ecereNameSpace__ecere__com__IteratorPointer * (* __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer);
2008 __internal_VirtualMethod = ((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
2009 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
2011 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
2012 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext]);
2013 __internal_VirtualMethod ? __internal_VirtualMethod(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e) : (struct __ecereNameSpace__ecere__com__IteratorPointer *)1;
2015 __ecereMethod_External_CreateUniqueEdge(e->to, external, e->breakable);
2017 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), symbol->__anon2.__anon1.structExternal);
2018 FreeExternal(symbol->__anon2.__anon1.structExternal);
2020 symbol->__anon2.__anon1.structExternal = external;
2021 external->__anon1.declaration = MkDeclaration(specs, declarators);
2023 symbol->declaredStruct = 1;
2027 curExternal = external->prev;
2028 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
2029 FreeExternal(external);
2030 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
2032 if((*classDataList).count)
2034 char classDataStructName[1024];
2035 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2036 struct External * external;
2038 strcpy(classDataStructName, "__ecereClassData_");
2039 FullClassNameCat(classDataStructName, symbol->string, 0);
2040 declMode = structDeclMode = 0;
2041 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
2042 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
2043 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
2045 symbol->classData = 1;
2048 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
2053 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2055 strcpy(className, "__ecereClass_");
2056 FullClassNameCat(className, symbol->string, 1);
2057 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2058 if(!strstr(sourceFile, ".main.ec"))
2059 ListAdd(specs, MkSpecifier(STATIC));
2060 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2061 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2062 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2063 DeclareStruct(symbol->__anon2.__anon1.pointerExternal, "ecere::com::Class", 0, 1);
2064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon1.pointerExternal);
2065 after = symbol->__anon2.__anon3.methodExternal;
2067 if(symbol->needDestructor)
2069 struct ClassFunction * function;
2070 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2071 struct Declarator * decl;
2072 struct Statement * body;
2073 struct Context * context;
2074 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2076 strcpy(destructorName, "__ecereDestructor_");
2077 FullClassNameCat(destructorName, symbol->string, 0);
2078 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2079 ListAdd(specs, MkSpecifier(VOID));
2080 context = PushContext();
2081 statements = MkList();
2082 if(definitions != (((void *)0)))
2084 for(def = definitions->first; def; def = def->next)
2086 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2088 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2089 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2091 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2093 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2095 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2097 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2099 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2101 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2106 if(destructor && destructor->body)
2108 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2109 destructor->body->__anon1.compound.context->parent = context;
2110 destructor->body = (((void *)0));
2112 body = MkCompoundStmt(declarations, statements);
2113 PopContext(context);
2114 body->__anon1.compound.context = context;
2115 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2116 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2117 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2118 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2119 ProcessClassFunctionBody(function, body);
2120 function->dontMangle = 1;
2121 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2123 if(symbol->needConstructor && inCompiler)
2125 struct ClassFunction * function;
2126 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2127 struct Declarator * decl;
2128 struct Statement * body;
2129 struct Context * context;
2130 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2132 strcpy(constructorName, "__ecereConstructor_");
2133 FullClassNameCat(constructorName, symbol->string, 0);
2134 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2135 ListAdd(specs, MkSpecifierName("bool"));
2136 context = PushContext();
2137 statements = MkList();
2138 if(definitions != (((void *)0)))
2140 for(def = definitions->first; def; def = def->next)
2142 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2144 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2145 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2147 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2149 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2152 newInst->members = (((void *)0));
2153 newInst->exp = CopyExpression(inst->exp);
2154 newInst->_class = CopySpecifier(inst->_class);
2155 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2158 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2160 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2164 for(def = definitions->first; def; def = def->next)
2166 if(def->type == 1 && def->__anon1.defProperties)
2168 struct MemberInit * propertyDef;
2170 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2172 struct Expression * memberExp;
2173 struct Identifier * id = (*propertyDef->identifiers).first;
2177 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2178 for(id = id->next; id; id = id->next)
2179 memberExp = MkExpMember(memberExp, id);
2180 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2182 if(propertyDef->initializer)
2184 if(propertyDef->initializer->type == 0)
2185 propertyDef->initializer->__anon1.exp = (((void *)0));
2186 FreeInitializer(propertyDef->initializer);
2188 propertyDef->initializer = (((void *)0));
2189 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2193 for(def = definitions->first; def; def = def->next)
2195 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2197 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2198 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2200 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2202 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2204 def->__anon1.decl->__anon1.inst = (((void *)0));
2205 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2211 if(constructor && constructor->body)
2213 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2214 constructor->body->__anon1.compound.context->parent = context;
2215 constructor->body = (((void *)0));
2217 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2218 body = MkCompoundStmt(declarations, statements);
2219 PopContext(context);
2220 body->__anon1.compound.context = context;
2221 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2222 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2223 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2224 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2225 ProcessClassFunctionBody(function, body);
2226 function->dontMangle = 1;
2227 if(definitions != (((void *)0)))
2228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2231 if(definitions != (((void *)0)))
2233 for(def = definitions->first; def; def = def->next)
2235 if(def->type == 3 && def->__anon1.propertyDef)
2237 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2238 struct ClassDef * after = def;
2239 struct ClassDef * newDef;
2243 yylloc = propertyDef->loc;
2244 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && def->memberAccess == 1)
2245 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2246 else if(!symbol->isStatic)
2247 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2251 struct ClassFunction * func;
2252 struct Declarator * decl;
2254 struct __ecereNameSpace__ecere__sys__OldList * params;
2256 if(propertyDef->getStmt && propertyDef->id)
2258 strcpy(name, "__ecereProp_");
2259 FullClassNameCat(name, symbol->string, 0);
2260 strcat(name, "_Get_");
2261 FullClassNameCat(name, propertyDef->id->string, 1);
2263 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)
2265 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2266 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2267 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2271 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2272 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2274 ProcessClassFunctionBody(func, propertyDef->getStmt);
2275 func->declarator->symbol = propertyDef->symbol;
2276 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2277 func->dontMangle = 1;
2278 newDef = MkClassDefFunction(func);
2279 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2282 propertyDef->getStmt = (((void *)0));
2284 func->body = (((void *)0));
2286 if(propertyDef->setStmt && propertyDef->id)
2288 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2290 strcpy(name, "__ecereProp_");
2291 FullClassNameCat(name, symbol->string, 0);
2292 strcat(name, "_Set_");
2293 FullClassNameCat(name, propertyDef->id->string, 1);
2295 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2296 if(propertyDef->__anon1.isDBProp)
2298 struct Specifier * spec;
2299 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2301 for(spec = (*specs).first; spec; spec = spec->next)
2302 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2307 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2309 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2310 unsigned int useVoid = 0;
2312 switch(regClass->type)
2320 useVoid = !isConversion;
2323 useVoid = !isConversion;
2324 if(useVoid && !propertyDef->__anon1.isDBProp)
2325 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2327 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2329 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2330 ProcessClassFunctionBody(func, propertyDef->setStmt);
2331 func->dontMangle = 1;
2332 func->declarator->symbol = propertyDef->symbol;
2333 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2334 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2335 func->propSet = propertyDef->symbol;
2336 newDef = MkClassDefFunction(func);
2337 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2340 propertyDef->setStmt = (((void *)0));
2342 func->body = (((void *)0));
2344 if(propertyDef->issetStmt && propertyDef->id)
2346 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2348 strcpy(name, "__ecereProp_");
2349 FullClassNameCat(name, symbol->string, 0);
2350 strcat(name, "_IsSet_");
2351 FullClassNameCat(name, propertyDef->id->string, 1);
2353 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2354 ListAdd(specifiers, MkSpecifierName("bool"));
2355 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2356 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2357 func->dontMangle = 1;
2358 func->declarator->symbol = propertyDef->symbol;
2359 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2360 newDef = MkClassDefFunction(func);
2361 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2364 propertyDef->issetStmt = (((void *)0));
2366 func->body = (((void *)0));
2368 if(propertyDef->id && inCompiler)
2370 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2371 struct Declaration * decl;
2372 struct External * external;
2373 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2375 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2376 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2377 ListAdd(specifiers, MkSpecifierName("Property"));
2378 strcpy(name, "__ecereProp_");
2379 FullClassNameCat(name, symbol->string, 0);
2381 FullClassNameCat(name, propertyDef->id->string, 1);
2383 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2385 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2386 strcpy(name, "__ecerePropM_");
2387 FullClassNameCat(name, symbol->string, 0);
2389 FullClassNameCat(name, propertyDef->id->string, 1);
2390 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2391 decl = MkDeclaration(specifiers, list);
2393 external = MkExternalDeclaration(decl);
2394 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2395 external->symbol = propertyDef->symbol;
2396 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2397 if(inCompiler && prop && prop->symbol)
2398 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2403 else if(def->type == 10 && def->__anon1.propertyDef)
2405 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2406 struct ClassDef * after = def;
2407 struct ClassDef * newDef;
2412 yylloc = propertyDef->loc;
2413 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
2414 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2415 else if(!symbol->isStatic)
2416 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2419 struct ClassFunction * func;
2420 struct Declarator * decl;
2422 struct __ecereNameSpace__ecere__sys__OldList * params;
2424 if(propertyDef->getStmt && propertyDef->id)
2426 struct Declarator * declId;
2428 sprintf(name, "class::__ecereClassProp_");
2429 FullClassNameCat(name, symbol->string, 0);
2430 strcat(name, "_Get_");
2431 strcat(name, propertyDef->id->string);
2433 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2435 decl = MkDeclaratorFunction(declId, params);
2436 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2438 ProcessClassFunctionBody(func, propertyDef->getStmt);
2439 func->declarator->symbol = propertyDef->symbol;
2440 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2441 func->dontMangle = 1;
2442 newDef = MkClassDefFunction(func);
2443 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2445 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2446 func->type = ProcessType(propertyDef->specifiers, decl);
2447 FreeDeclarator(decl);
2448 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)
2449 func->type->__anon1.__anon2.returnType->byReference = 1;
2450 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2452 propertyDef->getStmt = (((void *)0));
2454 func->body = (((void *)0));
2456 if(propertyDef->setStmt && propertyDef->id)
2458 struct Context * prevCurContext;
2459 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2460 struct Statement * body = propertyDef->setStmt;
2461 struct Declarator * ptrDecl;
2462 struct Expression * e;
2464 strcpy(name, "class::__ecereClassProp_");
2465 FullClassNameCat(name, symbol->string, 0);
2466 strcat(name, "_Set_");
2467 strcat(name, propertyDef->id->string);
2469 prevCurContext = curContext;
2470 curContext = body->__anon1.compound.context;
2471 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2472 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2473 if(!body->__anon1.compound.declarations)
2474 body->__anon1.compound.declarations = MkList();
2475 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)
2476 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2478 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2479 e = MkExpIdentifier(MkIdentifier("_value"));
2480 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2481 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2482 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))))));
2483 curContext = prevCurContext;
2485 struct Symbol * sym = ptrDecl->symbol;
2488 FreeType(sym->type);
2489 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2491 ListAdd(specifiers, MkSpecifier(VOID));
2492 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2493 ProcessClassFunctionBody(func, propertyDef->setStmt);
2494 func->dontMangle = 1;
2495 func->declarator->symbol = propertyDef->symbol;
2496 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2497 newDef = MkClassDefFunction(func);
2498 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2501 propertyDef->setStmt = (((void *)0));
2503 func->body = (((void *)0));
2508 else if(def->type == 0 && def->__anon1.function->declarator)
2510 struct ClassFunction * func = def->__anon1.function;
2512 func->_class = regClass;
2513 if(!func->dontMangle)
2515 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2516 struct Identifier * id = GetDeclId(funcDecl);
2517 struct __ecereNameSpace__ecere__com__Method * method;
2519 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2521 if(!funcDecl->__anon1.function.parameters)
2522 funcDecl->__anon1.function.parameters = MkList();
2523 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2525 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2526 FreeSpecifier(id->_class);
2527 id->_class = (((void *)0));
2528 if(inCompiler && method)
2530 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2533 ProcessMethodType(method);
2535 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && method->memberAccess == 1)
2536 CheckPublicDataType(method->dataType, 1, "class method");
2537 strcpy(newId, "__ecereMethod_");
2538 FullClassNameCat(newId, symbol->string, 0);
2540 strcat(newId, id->string);
2541 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2543 if(method->type != 1)
2547 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2548 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2556 if(initDeclarators != (((void *)0)))
2557 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2560 void PreProcessClassDefinitions()
2562 struct External * external, * next;
2564 curExternal = (((void *)0));
2567 for(external = (*ast).first; external; external = next)
2569 next = external->next;
2570 curExternal = external;
2571 if(external->type == 2)
2573 struct ClassDefinition * _class = external->__anon1._class;
2575 if(_class->definitions)
2577 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2580 else if(external->type == 1)
2582 struct Declaration * declaration = external->__anon1.declaration;
2584 if(declaration && declaration->type == 1)
2586 if(declaration->__anon1.__anon1.specifiers)
2588 struct Specifier * specifier;
2590 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2592 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)))
2594 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2598 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2599 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2601 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2604 initDeclarators = declaration->__anon1.__anon1.declarators;
2605 declaration->__anon1.__anon1.declarators = (((void *)0));
2607 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);
2613 else if(declaration && inCompiler && declaration->type == 3)
2615 yylloc = declaration->loc;
2616 if(declaration->declMode == 1)
2617 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2618 else if(declaration->declMode != 3)
2619 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2622 else if(external->type == 3)
2625 else if(inCompiler && external->type == 0)
2627 yylloc = external->__anon1.function->loc;
2628 if(!external->__anon1.function->type)
2629 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2630 if(external->__anon1.function->declMode == 1)
2631 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2632 else if(external->__anon1.function->declMode != 3)
2633 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2639 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2641 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2643 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2644 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);