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 #include <sys/types.h>
42 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
45 extern unsigned int inCompiler;
49 extern int structDeclMode;
51 extern const char * sourceFile;
53 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
55 struct __ecereNameSpace__ecere__sys__OldList
62 } __attribute__ ((gcc_struct));
64 struct __ecereNameSpace__ecere__sys__BTNode;
66 struct __ecereNameSpace__ecere__com__DataValue
81 } __attribute__ ((gcc_struct)) __anon1;
82 } __attribute__ ((gcc_struct));
84 struct __ecereNameSpace__ecere__com__SerialBuffer
86 unsigned char * _buffer;
90 } __attribute__ ((gcc_struct));
92 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
94 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
96 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
98 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
100 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
106 struct InitDeclarator;
116 struct PropertyWatch;
118 struct TemplateParameter;
120 struct TemplateArgument;
122 struct TemplateDatatype;
136 } __attribute__ ((gcc_struct));
138 extern char * strcat(char * , const char * );
140 extern size_t strlen(const char * );
142 extern int strncmp(const char * , const char * , size_t n);
148 extern void Compiler_Error(const char * format, ...);
150 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
152 struct __ecereNameSpace__ecere__com__LinkList
157 } __attribute__ ((gcc_struct));
159 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
161 extern char * strcpy(char * , const char * );
163 struct __ecereNameSpace__ecere__com__LinkElement
167 } __attribute__ ((gcc_struct));
169 extern char * strstr(const char * , const char * );
171 extern void Compiler_Warning(const char * format, ...);
173 extern int sprintf(char * , const char * , ...);
175 struct __ecereNameSpace__ecere__com__GlobalFunction;
177 struct __ecereNameSpace__ecere__com__IteratorPointer;
179 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
181 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
183 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
185 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
187 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
189 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
191 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
193 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
195 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
197 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
199 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
201 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
203 extern void FreeInitDeclarator(struct InitDeclarator * decl);
205 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList * attribs);
207 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
211 struct CodePosition start;
212 struct CodePosition end;
213 } __attribute__ ((gcc_struct));
215 void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams)
221 for(c = 0; (ch = className[c]) && ch != '<'; c++)
225 strcat(output, "__ecereNameSpace__");
229 len = strlen(output);
231 if(!strncmp(className, "const ", 6))
233 for(; (ch = className[c]); c++)
257 if(!includeTemplateParams)
259 if(!strncmp(className + c + 1, "const ", 6))
273 if(!strncmp(className + c + 1, "const ", 6))
280 output[len++] = (char)0;
283 extern struct Location yylloc;
287 extern struct External * curExternal;
291 struct __ecereNameSpace__ecere__com__LinkElement in;
292 struct __ecereNameSpace__ecere__com__LinkElement out;
293 struct External * from;
294 struct External * to;
295 unsigned int breakable;
296 } __attribute__ ((gcc_struct));
298 extern void FreeExternal(struct External * external);
300 extern struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference);
304 extern struct Context * PushContext(void);
306 extern void PopContext(struct Context * ctx);
308 extern struct Context * curContext;
310 struct __ecereNameSpace__ecere__com__Class;
312 struct __ecereNameSpace__ecere__com__Instance
315 struct __ecereNameSpace__ecere__com__Class * _class;
317 } __attribute__ ((gcc_struct));
319 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
321 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
323 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);
325 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
327 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
329 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
331 int __ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext;
333 struct __ecereNameSpace__ecere__com__Property;
335 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
337 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);
339 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
341 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
343 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);
347 extern void FreeDeclarator(struct Declarator * decl);
349 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
351 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
353 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
355 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
357 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
359 struct __ecereNameSpace__ecere__com__BTNamedLink;
361 struct __ecereNameSpace__ecere__com__BTNamedLink
364 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
365 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
366 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
369 } __attribute__ ((gcc_struct));
373 extern struct Symbol * FindClass(const char * name);
377 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
379 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
383 extern struct Specifier * MkSpecifierName(const char * name);
385 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
387 extern void FreeSpecifier(struct Specifier * spec);
389 extern struct Specifier * MkSpecifier(int specifier);
391 extern struct Specifier * CopySpecifier(struct Specifier * spec);
393 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
397 extern struct Identifier * GetDeclId(struct Declarator * decl);
401 struct Identifier * prev;
402 struct Identifier * next;
404 struct Symbol * classSym;
405 struct Specifier * _class;
407 struct Identifier * badID;
408 } __attribute__ ((gcc_struct));
410 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
412 extern struct Identifier * MkIdentifier(const char * string);
414 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
420 struct Specifier * prev;
421 struct Specifier * next;
429 struct ExtDecl * extDecl;
431 struct Symbol * symbol;
432 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
433 } __attribute__ ((gcc_struct)) __anon1;
436 struct Identifier * id;
437 struct __ecereNameSpace__ecere__sys__OldList * list;
438 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
439 struct __ecereNameSpace__ecere__sys__OldList * definitions;
440 unsigned int addNameSpace;
441 struct Context * ctx;
442 struct ExtDecl * extDeclStruct;
443 } __attribute__ ((gcc_struct)) __anon2;
444 struct Expression * expression;
445 struct Specifier * _class;
446 struct TemplateParameter * templateParameter;
447 } __attribute__ ((gcc_struct)) __anon1;
448 } __attribute__ ((gcc_struct));
452 struct Declarator * prev;
453 struct Declarator * next;
456 struct Symbol * symbol;
457 struct Declarator * declarator;
460 struct Identifier * identifier;
463 struct Expression * exp;
464 struct Expression * posExp;
465 struct Attrib * attrib;
466 } __attribute__ ((gcc_struct)) structDecl;
469 struct Expression * exp;
470 struct Specifier * enumClass;
471 } __attribute__ ((gcc_struct)) array;
474 struct __ecereNameSpace__ecere__sys__OldList * parameters;
475 } __attribute__ ((gcc_struct)) function;
478 struct Pointer * pointer;
479 } __attribute__ ((gcc_struct)) pointer;
482 struct ExtDecl * extended;
483 } __attribute__ ((gcc_struct)) extended;
484 } __attribute__ ((gcc_struct)) __anon1;
485 } __attribute__ ((gcc_struct));
487 extern struct Expression * QMkExpId(const char * id);
489 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
491 extern struct Expression * CopyExpression(struct Expression * exp);
493 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
495 extern struct Expression * MkExpIdentifier(struct Identifier * id);
497 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
499 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
503 struct __ecereNameSpace__ecere__com__Property
505 struct __ecereNameSpace__ecere__com__Property * prev;
506 struct __ecereNameSpace__ecere__com__Property * next;
508 unsigned int isProperty;
511 struct __ecereNameSpace__ecere__com__Class * _class;
512 const char * dataTypeString;
513 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
514 struct Type * dataType;
515 void (* Set)(void * , int);
516 int (* Get)(void * );
517 unsigned int (* IsSet)(void * );
521 unsigned int conversion;
522 unsigned int watcherOffset;
523 const char * category;
524 unsigned int compiled;
525 unsigned int selfWatchable;
526 unsigned int isWatchable;
527 } __attribute__ ((gcc_struct));
529 extern struct Type * MkClassType(const char * name);
531 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
533 extern void FreeType(struct Type * type);
535 struct ClassFunction;
537 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
543 struct Initializer * prev;
544 struct Initializer * next;
549 struct Expression * exp;
550 struct __ecereNameSpace__ecere__sys__OldList * list;
551 } __attribute__ ((gcc_struct)) __anon1;
552 unsigned int isConstant;
553 struct Identifier * id;
554 } __attribute__ ((gcc_struct));
556 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
558 extern void FreeInitializer(struct Initializer * initializer);
560 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
562 struct __ecereNameSpace__ecere__com__Method;
564 struct __ecereNameSpace__ecere__com__Method
567 struct __ecereNameSpace__ecere__com__Method * parent;
568 struct __ecereNameSpace__ecere__com__Method * left;
569 struct __ecereNameSpace__ecere__com__Method * right;
574 struct __ecereNameSpace__ecere__com__Class * _class;
576 const char * dataTypeString;
577 struct Type * dataType;
579 } __attribute__ ((gcc_struct));
584 struct Symbol * parent;
585 struct Symbol * left;
586 struct Symbol * right;
591 struct __ecereNameSpace__ecere__com__Method * method;
592 struct __ecereNameSpace__ecere__com__Property * _property;
593 struct __ecereNameSpace__ecere__com__Class * registered;
594 } __attribute__ ((gcc_struct)) __anon1;
595 unsigned int notYetDeclared;
600 struct External * pointerExternal;
601 struct External * structExternal;
602 } __attribute__ ((gcc_struct)) __anon1;
605 struct External * externalGet;
606 struct External * externalSet;
607 struct External * externalPtr;
608 struct External * externalIsSet;
609 } __attribute__ ((gcc_struct)) __anon2;
612 struct External * methodExternal;
613 struct External * methodCodeExternal;
614 } __attribute__ ((gcc_struct)) __anon3;
615 } __attribute__ ((gcc_struct)) __anon2;
616 unsigned int imported;
617 unsigned int declaredStructSym;
618 struct __ecereNameSpace__ecere__com__Class * _class;
619 unsigned int declaredStruct;
620 unsigned int needConstructor;
621 unsigned int needDestructor;
622 char * constructorName;
625 char * destructorName;
626 struct ModuleImport * module;
627 struct ClassImport * _import;
628 struct Location nameLoc;
629 unsigned int isParam;
630 unsigned int isRemote;
631 unsigned int isStruct;
632 unsigned int fireWatchersDone;
634 unsigned int classData;
635 unsigned int isStatic;
637 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
638 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
639 struct Context * ctx;
641 struct Expression * propCategory;
642 } __attribute__ ((gcc_struct));
651 struct Symbol * _class;
654 struct __ecereNameSpace__ecere__sys__OldList members;
656 } __attribute__ ((gcc_struct)) __anon1;
659 struct Type * returnType;
660 struct __ecereNameSpace__ecere__sys__OldList params;
661 struct Symbol * thisClass;
662 unsigned int staticMethod;
663 struct TemplateParameter * thisClassTemplate;
664 } __attribute__ ((gcc_struct)) __anon2;
667 struct __ecereNameSpace__ecere__com__Method * method;
668 struct __ecereNameSpace__ecere__com__Class * methodClass;
669 struct __ecereNameSpace__ecere__com__Class * usedClass;
670 } __attribute__ ((gcc_struct)) __anon3;
673 struct Type * arrayType;
675 struct Expression * arraySizeExp;
676 unsigned int freeExp;
677 struct Symbol * enumClass;
678 } __attribute__ ((gcc_struct)) __anon4;
680 struct TemplateParameter * templateParameter;
681 } __attribute__ ((gcc_struct)) __anon1;
686 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
692 unsigned int isSigned : 1;
693 unsigned int constant : 1;
694 unsigned int truth : 1;
695 unsigned int byReference : 1;
696 unsigned int extraParam : 1;
697 unsigned int directClassAccess : 1;
698 unsigned int computing : 1;
699 unsigned int keepCast : 1;
700 unsigned int passAsTemplate : 1;
701 unsigned int dllExport : 1;
702 unsigned int attrStdcall : 1;
703 unsigned int declaredWithStruct : 1;
704 unsigned int typedByReference : 1;
705 unsigned int casted : 1;
706 unsigned int pointerAlignment : 1;
707 } __attribute__ ((gcc_struct));
709 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);
711 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
713 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
719 struct ClassFunction * prev;
720 struct ClassFunction * next;
722 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
723 struct Declarator * declarator;
724 struct __ecereNameSpace__ecere__sys__OldList * declarations;
725 struct Statement * body;
726 struct __ecereNameSpace__ecere__com__Class * _class;
727 struct __ecereNameSpace__ecere__sys__OldList attached;
730 struct Symbol * propSet;
731 unsigned int isVirtual;
732 unsigned int isConstructor;
733 unsigned int isDestructor;
734 unsigned int dontMangle;
737 } __attribute__ ((gcc_struct));
741 struct Statement * prev;
742 struct Statement * next;
747 struct __ecereNameSpace__ecere__sys__OldList * expressions;
750 struct Identifier * id;
751 struct Statement * stmt;
752 } __attribute__ ((gcc_struct)) labeled;
755 struct Expression * exp;
756 struct Statement * stmt;
757 } __attribute__ ((gcc_struct)) caseStmt;
760 struct __ecereNameSpace__ecere__sys__OldList * declarations;
761 struct __ecereNameSpace__ecere__sys__OldList * statements;
762 struct Context * context;
763 unsigned int isSwitch;
764 } __attribute__ ((gcc_struct)) compound;
767 struct __ecereNameSpace__ecere__sys__OldList * exp;
768 struct Statement * stmt;
769 struct Statement * elseStmt;
770 } __attribute__ ((gcc_struct)) ifStmt;
773 struct __ecereNameSpace__ecere__sys__OldList * exp;
774 struct Statement * stmt;
775 } __attribute__ ((gcc_struct)) switchStmt;
778 struct __ecereNameSpace__ecere__sys__OldList * exp;
779 struct Statement * stmt;
780 } __attribute__ ((gcc_struct)) whileStmt;
783 struct __ecereNameSpace__ecere__sys__OldList * exp;
784 struct Statement * stmt;
785 } __attribute__ ((gcc_struct)) doWhile;
788 struct Statement * init;
789 struct Statement * check;
790 struct __ecereNameSpace__ecere__sys__OldList * increment;
791 struct Statement * stmt;
792 } __attribute__ ((gcc_struct)) forStmt;
795 struct Identifier * id;
796 } __attribute__ ((gcc_struct)) gotoStmt;
799 struct Specifier * spec;
801 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
802 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
803 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
804 } __attribute__ ((gcc_struct)) asmStmt;
807 struct Expression * watcher;
808 struct Expression * object;
809 struct __ecereNameSpace__ecere__sys__OldList * watches;
810 } __attribute__ ((gcc_struct)) _watch;
813 struct Identifier * id;
814 struct __ecereNameSpace__ecere__sys__OldList * exp;
815 struct __ecereNameSpace__ecere__sys__OldList * filter;
816 struct Statement * stmt;
817 } __attribute__ ((gcc_struct)) forEachStmt;
818 struct Declaration * decl;
819 } __attribute__ ((gcc_struct)) __anon1;
820 } __attribute__ ((gcc_struct));
822 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
824 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
826 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
828 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
830 struct __ecereNameSpace__ecere__sys__BinaryTree;
832 struct __ecereNameSpace__ecere__sys__BinaryTree
834 struct __ecereNameSpace__ecere__sys__BTNode * root;
836 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
837 void (* FreeKey)(void * key);
838 } __attribute__ ((gcc_struct));
840 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
842 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
844 struct __ecereNameSpace__ecere__com__DataMember;
846 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
852 const char * dataTypeString;
853 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
854 } __attribute__ ((gcc_struct)) __anon1;
855 struct __ecereNameSpace__ecere__com__DataValue expression;
858 const char * memberString;
861 struct __ecereNameSpace__ecere__com__DataMember * member;
862 struct __ecereNameSpace__ecere__com__Property * prop;
863 struct __ecereNameSpace__ecere__com__Method * method;
864 } __attribute__ ((gcc_struct)) __anon1;
865 } __attribute__ ((gcc_struct)) __anon2;
866 } __attribute__ ((gcc_struct)) __anon1;
867 } __attribute__ ((gcc_struct));
869 struct __ecereNameSpace__ecere__com__DataMember
871 struct __ecereNameSpace__ecere__com__DataMember * prev;
872 struct __ecereNameSpace__ecere__com__DataMember * next;
874 unsigned int isProperty;
877 struct __ecereNameSpace__ecere__com__Class * _class;
878 const char * dataTypeString;
879 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
880 struct Type * dataType;
884 struct __ecereNameSpace__ecere__sys__OldList members;
885 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
887 short structAlignment;
888 short pointerAlignment;
889 } __attribute__ ((gcc_struct));
891 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);
893 struct __ecereNameSpace__ecere__com__Module;
895 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
897 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
899 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);
901 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
903 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);
905 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);
907 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);
913 struct TypeName * prev;
914 struct TypeName * next;
916 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
917 struct Declarator * declarator;
919 struct Expression * bitCount;
920 } __attribute__ ((gcc_struct));
922 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
924 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
928 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
930 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
932 struct ClassDefinition;
936 struct Context * parent;
937 struct __ecereNameSpace__ecere__sys__BinaryTree types;
938 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
939 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
940 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
943 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
944 struct ClassDefinition * classDef;
945 unsigned int templateTypesOnly;
946 unsigned int hasNameSpace;
947 } __attribute__ ((gcc_struct));
949 struct ClassDefinition
951 struct ClassDefinition * prev;
952 struct ClassDefinition * next;
954 struct Specifier * _class;
955 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
956 struct __ecereNameSpace__ecere__sys__OldList * definitions;
957 struct Symbol * symbol;
958 struct Location blockStart;
959 struct Location nameLoc;
961 unsigned int deleteWatchable;
962 } __attribute__ ((gcc_struct));
964 struct Instantiation;
968 struct Expression * prev;
969 struct Expression * next;
977 struct Identifier * identifier;
978 } __attribute__ ((gcc_struct)) __anon1;
979 struct Statement * compound;
980 struct Instantiation * instance;
984 unsigned int intlString;
985 unsigned int wideString;
986 } __attribute__ ((gcc_struct)) __anon2;
987 struct __ecereNameSpace__ecere__sys__OldList * list;
990 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
991 struct Declarator * decl;
992 } __attribute__ ((gcc_struct)) _classExp;
995 struct Identifier * id;
996 } __attribute__ ((gcc_struct)) classData;
999 struct Expression * exp;
1000 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1001 struct Location argLoc;
1002 } __attribute__ ((gcc_struct)) call;
1005 struct Expression * exp;
1006 struct __ecereNameSpace__ecere__sys__OldList * index;
1007 } __attribute__ ((gcc_struct)) index;
1010 struct Expression * exp;
1011 struct Identifier * member;
1013 unsigned int thisPtr;
1014 } __attribute__ ((gcc_struct)) member;
1018 struct Expression * exp1;
1019 struct Expression * exp2;
1020 } __attribute__ ((gcc_struct)) op;
1021 struct TypeName * typeName;
1022 struct Specifier * _class;
1025 struct TypeName * typeName;
1026 struct Expression * exp;
1027 } __attribute__ ((gcc_struct)) cast;
1030 struct Expression * cond;
1031 struct __ecereNameSpace__ecere__sys__OldList * exp;
1032 struct Expression * elseExp;
1033 } __attribute__ ((gcc_struct)) cond;
1036 struct TypeName * typeName;
1037 struct Expression * size;
1038 } __attribute__ ((gcc_struct)) _new;
1041 struct TypeName * typeName;
1042 struct Expression * size;
1043 struct Expression * exp;
1044 } __attribute__ ((gcc_struct)) _renew;
1048 struct Identifier * id;
1049 } __attribute__ ((gcc_struct)) db;
1052 struct Expression * ds;
1053 struct Expression * name;
1054 } __attribute__ ((gcc_struct)) dbopen;
1057 struct TypeName * typeName;
1058 struct Initializer * initializer;
1059 } __attribute__ ((gcc_struct)) initializer;
1062 struct Expression * exp;
1063 struct TypeName * typeName;
1064 } __attribute__ ((gcc_struct)) vaArg;
1065 } __attribute__ ((gcc_struct)) __anon1;
1066 unsigned int debugValue;
1067 struct __ecereNameSpace__ecere__com__DataValue val;
1069 unsigned int hasAddress;
1070 struct Type * expType;
1071 struct Type * destType;
1074 unsigned int byReference;
1075 unsigned int isConstant;
1076 unsigned int addedThis;
1077 unsigned int needCast;
1078 unsigned int thisPtr;
1079 unsigned int opDestType;
1080 unsigned int needTemplateCast;
1081 } __attribute__ ((gcc_struct));
1083 struct Instantiation
1085 struct Instantiation * prev;
1086 struct Instantiation * next;
1087 struct Location loc;
1088 struct Specifier * _class;
1089 struct Expression * exp;
1090 struct __ecereNameSpace__ecere__sys__OldList * members;
1091 struct Symbol * symbol;
1092 unsigned int fullSet;
1093 unsigned int isConstant;
1094 unsigned char * data;
1095 struct Location nameLoc;
1096 struct Location insideLoc;
1098 } __attribute__ ((gcc_struct));
1102 struct Declaration * prev;
1103 struct Declaration * next;
1104 struct Location loc;
1110 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1111 struct __ecereNameSpace__ecere__sys__OldList * declarators;
1112 } __attribute__ ((gcc_struct)) __anon1;
1113 struct Instantiation * inst;
1116 struct Identifier * id;
1117 struct Expression * exp;
1118 } __attribute__ ((gcc_struct)) __anon2;
1119 } __attribute__ ((gcc_struct)) __anon1;
1120 struct Specifier * extStorage;
1121 struct Symbol * symbol;
1123 } __attribute__ ((gcc_struct));
1125 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1131 struct MembersInit * prev;
1132 struct MembersInit * next;
1133 struct Location loc;
1137 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1138 struct ClassFunction * function;
1139 } __attribute__ ((gcc_struct)) __anon1;
1140 } __attribute__ ((gcc_struct));
1146 struct MemberInit * prev;
1147 struct MemberInit * next;
1148 struct Location loc;
1149 struct Location realLoc;
1150 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1151 struct Initializer * initializer;
1153 unsigned int variable;
1154 unsigned int takeOutExp;
1155 } __attribute__ ((gcc_struct));
1157 static void CheckPublicExpression(struct Expression * exp, int access);
1159 static void CheckPublicInitializer(struct Initializer * init, int access)
1164 CheckPublicExpression(init->__anon1.exp, access);
1168 struct Initializer * i;
1170 for(i = (*init->__anon1.list).first; i; i = i->next)
1171 CheckPublicInitializer(i, access);
1177 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word);
1179 static void CheckPublicTypeName(struct TypeName * type, int access)
1181 if(type->qualifiers)
1183 struct Specifier * spec;
1185 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1189 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1191 CheckPublicClass(classSym, access, "define");
1197 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1205 CheckPublicClass(type->__anon1._class, access, word);
1215 struct Type * param;
1217 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1218 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1219 CheckPublicDataType(param, access, word);
1220 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1224 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1225 if(type->__anon1.__anon4.enumClass)
1226 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1230 CheckPublicDataType(type->__anon1.type, access, word);
1239 CheckPublicClass(type->__anon1._class, access, word);
1246 static void CheckPublicExpression(struct Expression * exp, int access)
1259 if(exp->__anon1.op.exp1)
1260 CheckPublicExpression(exp->__anon1.op.exp1, access);
1261 if(exp->__anon1.op.exp2)
1262 CheckPublicExpression(exp->__anon1.op.exp2, access);
1266 struct Expression * e;
1268 for(e = (*exp->__anon1.list).first; e; e = e->next)
1269 CheckPublicExpression(e, access);
1274 struct Expression * e;
1276 CheckPublicExpression(exp->__anon1.index.exp, access);
1277 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1278 CheckPublicExpression(e, access);
1283 struct Expression * e;
1285 CheckPublicExpression(exp->__anon1.call.exp, access);
1286 if(exp->__anon1.call.arguments)
1288 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1289 CheckPublicExpression(e, access);
1295 CheckPublicExpression(exp->__anon1.member.exp, access);
1300 CheckPublicExpression(exp->__anon1.member.exp, access);
1304 CheckPublicTypeName(exp->__anon1.typeName, access);
1308 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1309 if(exp->__anon1.cast.exp)
1310 CheckPublicExpression(exp->__anon1.cast.exp, access);
1315 struct Expression * e;
1317 CheckPublicExpression(exp->__anon1.cond.cond, access);
1318 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1319 CheckPublicExpression(e, access);
1320 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1325 CheckPublicExpression(exp->__anon1._new.size, access);
1329 CheckPublicExpression(exp->__anon1._renew.size, access);
1330 CheckPublicExpression(exp->__anon1._renew.exp, access);
1334 struct MembersInit * members;
1336 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1337 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1339 if(members->type == 0)
1341 struct MemberInit * member;
1343 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1345 CheckPublicInitializer(member->initializer, access);
1359 struct ClassDef * prev;
1360 struct ClassDef * next;
1361 struct Location loc;
1365 struct Declaration * decl;
1366 struct ClassFunction * function;
1367 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1368 struct PropertyDef * propertyDef;
1369 struct PropertyWatch * propertyWatch;
1371 struct Identifier * defaultProperty;
1374 struct Identifier * id;
1375 struct Initializer * initializer;
1376 } __attribute__ ((gcc_struct)) __anon1;
1377 } __attribute__ ((gcc_struct)) __anon1;
1380 } __attribute__ ((gcc_struct));
1384 struct PropertyDef * prev;
1385 struct PropertyDef * next;
1386 struct Location loc;
1387 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1388 struct Declarator * declarator;
1389 struct Identifier * id;
1390 struct Statement * getStmt;
1391 struct Statement * setStmt;
1392 struct Statement * issetStmt;
1393 struct Symbol * symbol;
1394 struct Expression * category;
1397 unsigned int conversion : 1;
1398 unsigned int isWatchable : 1;
1399 unsigned int isDBProp : 1;
1400 } __attribute__ ((gcc_struct)) __anon1;
1401 } __attribute__ ((gcc_struct));
1403 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1405 if(definitions != (((void *)0)))
1407 struct ClassDef * def;
1409 for(def = definitions->first; def; def = def->next)
1413 struct Declaration * decl = def->__anon1.decl;
1414 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1419 struct Declarator * d;
1421 if(decl->__anon1.__anon1.declarators)
1423 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1425 struct Identifier * declId = GetDeclId(d);
1431 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1433 dataMember = link ? link->data : (((void *)0));
1436 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1438 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1442 else if(decl->__anon1.__anon1.specifiers)
1444 struct Specifier * spec;
1446 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1448 if(spec->type == 3 || spec->type == 4)
1450 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1452 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1454 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1458 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1460 dataMember = link ? link->data : (((void *)0));
1463 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1465 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1471 else if(decl->type == 2)
1473 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1480 struct FunctionDefinition;
1482 typedef union YYSTYPE
1487 struct Identifier * id;
1488 struct Expression * exp;
1489 struct Specifier * specifier;
1490 struct __ecereNameSpace__ecere__sys__OldList * list;
1491 struct Enumerator * enumerator;
1492 struct Declarator * declarator;
1493 struct Pointer * pointer;
1494 struct Initializer * initializer;
1495 struct InitDeclarator * initDeclarator;
1496 struct TypeName * typeName;
1497 struct Declaration * declaration;
1498 struct Statement * stmt;
1499 struct FunctionDefinition * function;
1500 struct External * external;
1501 struct Context * context;
1502 struct AsmField * asmField;
1503 struct Attrib * attrib;
1504 struct ExtDecl * extDecl;
1505 struct Attribute * attribute;
1506 struct Instantiation * instance;
1507 struct MembersInit * membersInit;
1508 struct MemberInit * memberInit;
1509 struct ClassFunction * classFunction;
1510 struct ClassDefinition * _class;
1511 struct ClassDef * classDef;
1512 struct PropertyDef * prop;
1514 struct Symbol * symbol;
1515 struct PropertyWatch * propertyWatch;
1516 struct TemplateParameter * templateParameter;
1517 struct TemplateArgument * templateArgument;
1518 struct TemplateDatatype * templateDatatype;
1519 struct DBTableEntry * dbtableEntry;
1520 struct DBIndexItem * dbindexItem;
1521 struct DBTableDef * dbtableDef;
1522 } __attribute__ ((gcc_struct)) YYSTYPE;
1524 extern YYSTYPE yylval;
1528 struct External * prev;
1529 struct External * next;
1530 struct Location loc;
1532 struct Symbol * symbol;
1535 struct FunctionDefinition * function;
1536 struct ClassDefinition * _class;
1537 struct Declaration * declaration;
1538 char * importString;
1539 struct Identifier * id;
1540 struct DBTableDef * table;
1541 } __attribute__ ((gcc_struct)) __anon1;
1543 struct External * fwdDecl;
1544 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1545 struct __ecereNameSpace__ecere__com__Instance * incoming;
1546 int nonBreakableIncoming;
1547 } __attribute__ ((gcc_struct));
1549 struct FunctionDefinition
1551 struct FunctionDefinition * prev;
1552 struct FunctionDefinition * next;
1553 struct Location loc;
1554 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1555 struct Declarator * declarator;
1556 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1557 struct Statement * body;
1558 struct __ecereNameSpace__ecere__com__Class * _class;
1559 struct __ecereNameSpace__ecere__sys__OldList attached;
1562 struct Symbol * propSet;
1564 unsigned int propertyNoThis;
1565 } __attribute__ ((gcc_struct));
1567 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
1569 struct __ecereNameSpace__ecere__com__NameSpace;
1571 struct __ecereNameSpace__ecere__com__NameSpace
1574 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1575 struct __ecereNameSpace__ecere__com__NameSpace * left;
1576 struct __ecereNameSpace__ecere__com__NameSpace * right;
1578 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1579 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1580 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1581 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1582 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1583 } __attribute__ ((gcc_struct));
1585 struct __ecereNameSpace__ecere__com__Class
1587 struct __ecereNameSpace__ecere__com__Class * prev;
1588 struct __ecereNameSpace__ecere__com__Class * next;
1594 unsigned int (* Constructor)(void * );
1595 void (* Destructor)(void * );
1598 struct __ecereNameSpace__ecere__com__Class * base;
1599 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1600 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1601 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1602 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1603 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1604 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1608 struct __ecereNameSpace__ecere__com__Instance * module;
1609 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1610 const char * dataTypeString;
1611 struct Type * dataType;
1613 int defaultAlignment;
1614 void (* Initialize)();
1616 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1617 const char * designerClass;
1618 unsigned int noExpansion;
1619 const char * defaultProperty;
1620 unsigned int comRedefinition;
1623 unsigned int internalDecl;
1625 unsigned int computeSize;
1626 short structAlignment;
1627 short pointerAlignment;
1628 int destructionWatchOffset;
1630 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1631 int inheritanceAccess;
1632 const char * fullName;
1634 struct __ecereNameSpace__ecere__sys__OldList conversions;
1635 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1636 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1637 struct __ecereNameSpace__ecere__com__Class * templateClass;
1638 struct __ecereNameSpace__ecere__sys__OldList templatized;
1640 unsigned int isInstanceClass;
1641 unsigned int byValueSystemClass;
1642 } __attribute__ ((gcc_struct));
1644 struct __ecereNameSpace__ecere__com__Application
1647 const char * * argv;
1649 unsigned int isGUIApp;
1650 struct __ecereNameSpace__ecere__sys__OldList allModules;
1651 char * parsedCommand;
1652 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1653 } __attribute__ ((gcc_struct));
1655 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1659 else if((*ns).parent)
1660 return NameSpaceContained((*ns).parent, parent);
1665 static void AddSimpleBaseMembers(struct External * external, struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1667 if(_class->type != 1000)
1668 AddMembers(external, list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1671 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
1673 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
1675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1677 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1679 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
1681 struct __ecereNameSpace__ecere__com__Module
1683 struct __ecereNameSpace__ecere__com__Instance * application;
1684 struct __ecereNameSpace__ecere__sys__OldList classes;
1685 struct __ecereNameSpace__ecere__sys__OldList defines;
1686 struct __ecereNameSpace__ecere__sys__OldList functions;
1687 struct __ecereNameSpace__ecere__sys__OldList modules;
1688 struct __ecereNameSpace__ecere__com__Instance * prev;
1689 struct __ecereNameSpace__ecere__com__Instance * next;
1695 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1696 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1697 } __attribute__ ((gcc_struct));
1699 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
1704 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1706 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1710 if(regClass->templateClass)
1711 regClass = regClass->templateClass;
1712 if(classSym->isStatic && access != 3)
1714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1716 else if(access == 1)
1718 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))
1720 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1721 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1727 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)
1729 char structName[1024];
1730 char className[1024];
1731 char constructorName[1024];
1732 char destructorName[1024];
1733 struct __ecereNameSpace__ecere__com__Class * regClass;
1734 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1735 unsigned int isUnion = classType == 6;
1736 struct External * external = (((void *)0));
1737 struct ClassDef * def;
1738 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1739 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1744 classDataList = MkList();
1746 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1749 classType = regClass->type;
1753 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && regClass->inheritanceAccess == 1)
1755 if(!regClass->base->symbol)
1756 regClass->base->symbol = FindClass(regClass->base->fullName);
1757 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1759 else if(!symbol->isStatic && regClass->base)
1761 if(!regClass->base->symbol)
1762 regClass->base->symbol = FindClass(regClass->base->fullName);
1763 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1766 if(definitions != (((void *)0)))
1768 for(def = definitions->first; def; def = def->next)
1772 struct __ecereNameSpace__ecere__com__DataMember * member;
1773 struct __ecereNameSpace__ecere__com__Property * prop;
1774 struct __ecereNameSpace__ecere__com__Method * method;
1776 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1778 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1780 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1782 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1784 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1786 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1791 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1798 external = MkExternalDeclaration((((void *)0)));
1799 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1800 curExternal = external;
1801 curExternal->symbol = symbol;
1803 if((classType == 1 || classType == 5) && inCompiler)
1805 AddSimpleBaseMembers(external, list, regClass->base, regClass);
1807 if(definitions != (((void *)0)))
1811 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
1812 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1813 else if(!symbol->isStatic)
1814 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1816 for(def = definitions->first; def; def = def->next)
1821 struct Declaration * decl = def->__anon1.decl;
1826 if(inCompiler && classType != 2)
1828 ListAdd(list, MkClassDefDeclaration(decl));
1829 def->__anon1.decl = (((void *)0));
1832 else if(decl->type == 2)
1834 struct Instantiation * inst = decl->__anon1.inst;
1835 struct Expression * exp = inst->exp;
1836 struct Symbol * classSym;
1840 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1841 struct Declarator * d;
1843 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1844 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1847 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1849 ListAdd(declarators, d);
1850 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1851 ListAdd(list, MkClassDefDeclaration(decl));
1853 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1854 exp->__anon1.member.exp = QMkExpId("this");
1855 exp->__anon1.member.memberType = 3;
1856 exp->__anon1.member.thisPtr = 1;
1861 FreeList(specifiers, (void *)(FreeSpecifier));
1864 classSym = inst->_class->__anon1.__anon1.symbol;
1865 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1867 if(inst->members && (*inst->members).count)
1868 symbol->needConstructor = 1;
1872 symbol->needConstructor = 1;
1873 symbol->needDestructor = 1;
1877 else if(def->type == 9)
1879 struct Declaration * decl = def->__anon1.decl;
1883 if(inCompiler && classType != 2)
1885 ListAdd(classDataList, MkClassDefDeclaration(decl));
1886 def->__anon1.decl = (((void *)0));
1890 else if(def->type == 1)
1891 symbol->needConstructor = 1;
1892 else if(def->type == 4)
1893 symbol->needConstructor = 1;
1894 else if(def->type == 0)
1896 struct ClassFunction * func = def->__anon1.function;
1898 if(func->isDestructor)
1903 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1907 symbol->needDestructor = 1;
1909 if(!inCompiler && func->body)
1911 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1913 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1917 if(func->isConstructor)
1922 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1926 symbol->needConstructor = 1;
1928 if(!inCompiler && func->body)
1930 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1932 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1941 external->symbol = (((void *)0));
1944 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1946 initDeclarators = (((void *)0));
1947 strcpy(structName, symbol->string);
1948 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1950 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1952 spec->__anon1.__anon2.extDeclStruct = extDecl;
1953 ListAdd(specs, spec);
1955 external->symbol = symbol;
1956 if(symbol->__anon2.__anon1.structExternal)
1959 struct TopoEdge * e;
1960 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->incoming;
1962 for(e = ((struct TopoEdge *)(uintptr_t)((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__ ({
1963 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1965 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1966 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1967 __ecereMethod_External_CreateUniqueEdge(external, e->from, e->breakable);
1970 struct TopoEdge * e;
1971 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->outgoing;
1973 for(e = ((struct TopoEdge *)(uintptr_t)((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__ ({
1974 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1976 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1977 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1978 __ecereMethod_External_CreateUniqueEdge(e->to, external, e->breakable);
1980 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), symbol->__anon2.__anon1.structExternal);
1981 FreeExternal(symbol->__anon2.__anon1.structExternal);
1983 symbol->__anon2.__anon1.structExternal = external;
1984 external->__anon1.declaration = MkDeclaration(specs, declarators);
1986 symbol->declaredStruct = 1;
1990 curExternal = external->prev;
1991 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1992 FreeExternal(external);
1993 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1995 if((*classDataList).count)
1997 char classDataStructName[1024];
1998 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1999 struct External * external;
2001 strcpy(classDataStructName, "__ecereClassData_");
2002 FullClassNameCat(classDataStructName, symbol->string, 0);
2003 declMode = structDeclMode = 0;
2004 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
2005 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
2006 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
2008 symbol->classData = 1;
2011 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
2016 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2018 strcpy(className, "__ecereClass_");
2019 FullClassNameCat(className, symbol->string, 1);
2020 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2021 if(!strstr(sourceFile, ".main.ec"))
2022 ListAdd(specs, MkSpecifier(STATIC));
2023 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2024 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2025 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2026 DeclareStruct(symbol->__anon2.__anon1.pointerExternal, "ecere::com::Class", 0, 1);
2027 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon1.pointerExternal);
2028 after = symbol->__anon2.__anon3.methodExternal;
2030 if(symbol->needDestructor)
2032 struct ClassFunction * function;
2033 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2034 struct Declarator * decl;
2035 struct Statement * body;
2036 struct Context * context;
2037 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2039 strcpy(destructorName, "__ecereDestructor_");
2040 FullClassNameCat(destructorName, symbol->string, 0);
2041 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2042 ListAdd(specs, MkSpecifier(VOID));
2043 context = PushContext();
2044 statements = MkList();
2045 if(definitions != (((void *)0)))
2047 for(def = definitions->first; def; def = def->next)
2049 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2051 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2052 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2054 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2056 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2058 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2060 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2062 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2064 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2069 if(destructor && destructor->body)
2071 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2072 destructor->body->__anon1.compound.context->parent = context;
2073 destructor->body = (((void *)0));
2075 body = MkCompoundStmt(declarations, statements);
2076 PopContext(context);
2077 body->__anon1.compound.context = context;
2078 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2079 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2080 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2081 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2082 ProcessClassFunctionBody(function, body);
2083 function->dontMangle = 1;
2084 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2086 if(symbol->needConstructor && inCompiler)
2088 struct ClassFunction * function;
2089 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2090 struct Declarator * decl;
2091 struct Statement * body;
2092 struct Context * context;
2093 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2095 strcpy(constructorName, "__ecereConstructor_");
2096 FullClassNameCat(constructorName, symbol->string, 0);
2097 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2098 ListAdd(specs, MkSpecifierName("bool"));
2099 context = PushContext();
2100 statements = MkList();
2101 if(definitions != (((void *)0)))
2103 for(def = definitions->first; def; def = def->next)
2105 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2107 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2108 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2110 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2112 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2115 newInst->members = (((void *)0));
2116 newInst->exp = CopyExpression(inst->exp);
2117 newInst->_class = CopySpecifier(inst->_class);
2118 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2121 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2123 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2127 for(def = definitions->first; def; def = def->next)
2129 if(def->type == 1 && def->__anon1.defProperties)
2131 struct MemberInit * propertyDef;
2133 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2135 struct Expression * memberExp;
2136 struct Identifier * id = (*propertyDef->identifiers).first;
2140 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2141 for(id = id->next; id; id = id->next)
2142 memberExp = MkExpMember(memberExp, id);
2143 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2145 if(propertyDef->initializer)
2147 if(propertyDef->initializer->type == 0)
2148 propertyDef->initializer->__anon1.exp = (((void *)0));
2149 FreeInitializer(propertyDef->initializer);
2151 propertyDef->initializer = (((void *)0));
2152 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2156 for(def = definitions->first; def; def = def->next)
2158 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2160 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2161 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2163 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2165 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2167 def->__anon1.decl->__anon1.inst = (((void *)0));
2168 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2174 if(constructor && constructor->body)
2176 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2177 constructor->body->__anon1.compound.context->parent = context;
2178 constructor->body = (((void *)0));
2180 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2181 body = MkCompoundStmt(declarations, statements);
2182 PopContext(context);
2183 body->__anon1.compound.context = context;
2184 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2185 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2186 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2187 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2188 ProcessClassFunctionBody(function, body);
2189 function->dontMangle = 1;
2190 if(definitions != (((void *)0)))
2191 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2194 if(definitions != (((void *)0)))
2196 for(def = definitions->first; def; def = def->next)
2198 if(def->type == 3 && def->__anon1.propertyDef)
2200 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2201 struct ClassDef * after = def;
2202 struct ClassDef * newDef;
2206 yylloc = propertyDef->loc;
2207 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && def->memberAccess == 1)
2208 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2209 else if(!symbol->isStatic)
2210 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2214 struct ClassFunction * func;
2215 struct Declarator * decl;
2217 struct __ecereNameSpace__ecere__sys__OldList * params;
2219 if(propertyDef->getStmt && propertyDef->id)
2221 strcpy(name, "__ecereProp_");
2222 FullClassNameCat(name, symbol->string, 0);
2223 strcat(name, "_Get_");
2224 FullClassNameCat(name, propertyDef->id->string, 1);
2226 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)
2228 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2229 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2230 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2234 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2235 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2237 ProcessClassFunctionBody(func, propertyDef->getStmt);
2238 func->declarator->symbol = propertyDef->symbol;
2239 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2240 func->dontMangle = 1;
2241 newDef = MkClassDefFunction(func);
2242 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2245 propertyDef->getStmt = (((void *)0));
2247 func->body = (((void *)0));
2249 if(propertyDef->setStmt && propertyDef->id)
2251 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2253 strcpy(name, "__ecereProp_");
2254 FullClassNameCat(name, symbol->string, 0);
2255 strcat(name, "_Set_");
2256 FullClassNameCat(name, propertyDef->id->string, 1);
2258 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2259 if(propertyDef->__anon1.isDBProp)
2261 struct Specifier * spec;
2262 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2264 for(spec = (*specs).first; spec; spec = spec->next)
2265 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2268 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2270 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2272 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2273 unsigned int useVoid = 0;
2275 switch(regClass->type)
2283 useVoid = !isConversion;
2286 useVoid = !isConversion;
2287 if(useVoid && !propertyDef->__anon1.isDBProp)
2288 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2290 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2292 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2293 ProcessClassFunctionBody(func, propertyDef->setStmt);
2294 func->dontMangle = 1;
2295 func->declarator->symbol = propertyDef->symbol;
2296 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2297 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2298 func->propSet = propertyDef->symbol;
2299 newDef = MkClassDefFunction(func);
2300 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2303 propertyDef->setStmt = (((void *)0));
2305 func->body = (((void *)0));
2307 if(propertyDef->issetStmt && propertyDef->id)
2309 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2311 strcpy(name, "__ecereProp_");
2312 FullClassNameCat(name, symbol->string, 0);
2313 strcat(name, "_IsSet_");
2314 FullClassNameCat(name, propertyDef->id->string, 1);
2316 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2317 ListAdd(specifiers, MkSpecifierName("bool"));
2318 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2319 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2320 func->dontMangle = 1;
2321 func->declarator->symbol = propertyDef->symbol;
2322 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2323 newDef = MkClassDefFunction(func);
2324 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2327 propertyDef->issetStmt = (((void *)0));
2329 func->body = (((void *)0));
2331 if(propertyDef->id && inCompiler)
2333 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2334 struct Declaration * decl;
2335 struct External * external;
2336 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2338 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2339 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2340 ListAdd(specifiers, MkSpecifierName("Property"));
2341 strcpy(name, "__ecereProp_");
2342 FullClassNameCat(name, symbol->string, 0);
2344 FullClassNameCat(name, propertyDef->id->string, 1);
2346 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2348 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2349 strcpy(name, "__ecerePropM_");
2350 FullClassNameCat(name, symbol->string, 0);
2352 FullClassNameCat(name, propertyDef->id->string, 1);
2353 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2354 decl = MkDeclaration(specifiers, list);
2356 external = MkExternalDeclaration(decl);
2357 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2358 external->symbol = propertyDef->symbol;
2359 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2360 if(inCompiler && prop && prop->symbol)
2361 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2366 else if(def->type == 10 && def->__anon1.propertyDef)
2368 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2369 struct ClassDef * after = def;
2370 struct ClassDef * newDef;
2375 yylloc = propertyDef->loc;
2376 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
2377 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2378 else if(!symbol->isStatic)
2379 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2382 struct ClassFunction * func;
2383 struct Declarator * decl;
2385 struct __ecereNameSpace__ecere__sys__OldList * params;
2387 if(propertyDef->getStmt && propertyDef->id)
2389 struct Declarator * declId;
2391 sprintf(name, "class::__ecereClassProp_");
2392 FullClassNameCat(name, symbol->string, 0);
2393 strcat(name, "_Get_");
2394 strcat(name, propertyDef->id->string);
2396 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2398 decl = MkDeclaratorFunction(declId, params);
2399 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2401 ProcessClassFunctionBody(func, propertyDef->getStmt);
2402 func->declarator->symbol = propertyDef->symbol;
2403 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2404 func->dontMangle = 1;
2405 newDef = MkClassDefFunction(func);
2406 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2408 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2409 func->type = ProcessType(propertyDef->specifiers, decl);
2410 FreeDeclarator(decl);
2411 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)
2412 func->type->__anon1.__anon2.returnType->byReference = 1;
2413 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2415 propertyDef->getStmt = (((void *)0));
2417 func->body = (((void *)0));
2419 if(propertyDef->setStmt && propertyDef->id)
2421 struct Context * prevCurContext;
2422 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2423 struct Statement * body = propertyDef->setStmt;
2424 struct Declarator * ptrDecl;
2425 struct Expression * e;
2427 strcpy(name, "class::__ecereClassProp_");
2428 FullClassNameCat(name, symbol->string, 0);
2429 strcat(name, "_Set_");
2430 strcat(name, propertyDef->id->string);
2432 prevCurContext = curContext;
2433 curContext = body->__anon1.compound.context;
2434 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2435 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2436 if(!body->__anon1.compound.declarations)
2437 body->__anon1.compound.declarations = MkList();
2438 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)
2439 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2441 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2442 e = MkExpIdentifier(MkIdentifier("_value"));
2443 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2444 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2445 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))))));
2446 curContext = prevCurContext;
2448 struct Symbol * sym = ptrDecl->symbol;
2451 FreeType(sym->type);
2452 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2454 ListAdd(specifiers, MkSpecifier(VOID));
2455 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2456 ProcessClassFunctionBody(func, propertyDef->setStmt);
2457 func->dontMangle = 1;
2458 func->declarator->symbol = propertyDef->symbol;
2459 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2460 newDef = MkClassDefFunction(func);
2461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2464 propertyDef->setStmt = (((void *)0));
2466 func->body = (((void *)0));
2471 else if(def->type == 0 && def->__anon1.function->declarator)
2473 struct ClassFunction * func = def->__anon1.function;
2475 func->_class = regClass;
2476 if(!func->dontMangle)
2478 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2479 struct Identifier * id = GetDeclId(funcDecl);
2480 struct __ecereNameSpace__ecere__com__Method * method;
2482 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2484 if(!funcDecl->__anon1.function.parameters)
2485 funcDecl->__anon1.function.parameters = MkList();
2486 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2488 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2489 FreeSpecifier(id->_class);
2490 id->_class = (((void *)0));
2491 if(inCompiler && method)
2493 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2496 ProcessMethodType(method);
2498 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && method->memberAccess == 1)
2499 CheckPublicDataType(method->dataType, 1, "class method");
2500 strcpy(newId, "__ecereMethod_");
2501 FullClassNameCat(newId, symbol->string, 0);
2503 strcat(newId, id->string);
2504 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2506 if(method->type != 1)
2510 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2511 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2519 if(initDeclarators != (((void *)0)))
2520 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2523 void PreProcessClassDefinitions()
2525 struct External * external, * next;
2527 curExternal = (((void *)0));
2530 for(external = (*ast).first; external; external = next)
2532 next = external->next;
2533 curExternal = external;
2534 if(external->type == 2)
2536 struct ClassDefinition * _class = external->__anon1._class;
2538 if(_class->definitions)
2540 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2543 else if(external->type == 1)
2545 struct Declaration * declaration = external->__anon1.declaration;
2547 if(declaration && declaration->type == 1)
2549 if(declaration->__anon1.__anon1.specifiers)
2551 struct Specifier * specifier;
2553 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2555 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)))
2557 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2561 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2562 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2564 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2567 initDeclarators = declaration->__anon1.__anon1.declarators;
2568 declaration->__anon1.__anon1.declarators = (((void *)0));
2570 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);
2576 else if(declaration && inCompiler && declaration->type == 3)
2578 yylloc = declaration->loc;
2579 if(declaration->declMode == 1)
2580 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2581 else if(declaration->declMode != 3)
2582 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2585 else if(external->type == 3)
2588 else if(inCompiler && external->type == 0)
2590 yylloc = external->__anon1.function->loc;
2591 if(!external->__anon1.function->type)
2592 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2593 if(external->__anon1.function->declMode == 1)
2594 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2595 else if(external->__anon1.function->declMode != 3)
2596 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2602 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2604 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2606 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2607 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);