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 struct Specifier * nsSpec;
434 } __attribute__ ((gcc_struct)) __anon1;
437 struct Identifier * id;
438 struct __ecereNameSpace__ecere__sys__OldList * list;
439 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
440 struct __ecereNameSpace__ecere__sys__OldList * definitions;
441 unsigned int addNameSpace;
442 struct Context * ctx;
443 struct ExtDecl * extDeclStruct;
444 } __attribute__ ((gcc_struct)) __anon2;
445 struct Expression * expression;
446 struct Specifier * _class;
447 struct TemplateParameter * templateParameter;
448 } __attribute__ ((gcc_struct)) __anon1;
449 } __attribute__ ((gcc_struct));
453 struct Declarator * prev;
454 struct Declarator * next;
457 struct Symbol * symbol;
458 struct Declarator * declarator;
461 struct Identifier * identifier;
464 struct Expression * exp;
465 struct Expression * posExp;
466 struct Attrib * attrib;
467 } __attribute__ ((gcc_struct)) structDecl;
470 struct Expression * exp;
471 struct Specifier * enumClass;
472 } __attribute__ ((gcc_struct)) array;
475 struct __ecereNameSpace__ecere__sys__OldList * parameters;
476 } __attribute__ ((gcc_struct)) function;
479 struct Pointer * pointer;
480 } __attribute__ ((gcc_struct)) pointer;
483 struct ExtDecl * extended;
484 } __attribute__ ((gcc_struct)) extended;
485 } __attribute__ ((gcc_struct)) __anon1;
486 } __attribute__ ((gcc_struct));
488 extern struct Expression * QMkExpId(const char * id);
490 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
492 extern struct Expression * CopyExpression(struct Expression * exp);
494 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
496 extern struct Expression * MkExpIdentifier(struct Identifier * id);
498 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
500 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
504 struct __ecereNameSpace__ecere__com__Property
506 struct __ecereNameSpace__ecere__com__Property * prev;
507 struct __ecereNameSpace__ecere__com__Property * next;
509 unsigned int isProperty;
512 struct __ecereNameSpace__ecere__com__Class * _class;
513 const char * dataTypeString;
514 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
515 struct Type * dataType;
516 void (* Set)(void * , int);
517 int (* Get)(void * );
518 unsigned int (* IsSet)(void * );
522 unsigned int conversion;
523 unsigned int watcherOffset;
524 const char * category;
525 unsigned int compiled;
526 unsigned int selfWatchable;
527 unsigned int isWatchable;
528 } __attribute__ ((gcc_struct));
530 extern struct Type * MkClassType(const char * name);
532 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
534 extern void FreeType(struct Type * type);
536 struct ClassFunction;
538 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
544 struct Initializer * prev;
545 struct Initializer * next;
550 struct Expression * exp;
551 struct __ecereNameSpace__ecere__sys__OldList * list;
552 } __attribute__ ((gcc_struct)) __anon1;
553 unsigned int isConstant;
554 struct Identifier * id;
555 } __attribute__ ((gcc_struct));
557 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
559 extern void FreeInitializer(struct Initializer * initializer);
561 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
563 struct __ecereNameSpace__ecere__com__Method;
565 struct __ecereNameSpace__ecere__com__Method
568 struct __ecereNameSpace__ecere__com__Method * parent;
569 struct __ecereNameSpace__ecere__com__Method * left;
570 struct __ecereNameSpace__ecere__com__Method * right;
575 struct __ecereNameSpace__ecere__com__Class * _class;
577 const char * dataTypeString;
578 struct Type * dataType;
580 } __attribute__ ((gcc_struct));
585 struct Symbol * parent;
586 struct Symbol * left;
587 struct Symbol * right;
592 struct __ecereNameSpace__ecere__com__Method * method;
593 struct __ecereNameSpace__ecere__com__Property * _property;
594 struct __ecereNameSpace__ecere__com__Class * registered;
595 } __attribute__ ((gcc_struct)) __anon1;
596 unsigned int notYetDeclared;
601 struct External * pointerExternal;
602 struct External * structExternal;
603 } __attribute__ ((gcc_struct)) __anon1;
606 struct External * externalGet;
607 struct External * externalSet;
608 struct External * externalPtr;
609 struct External * externalIsSet;
610 } __attribute__ ((gcc_struct)) __anon2;
613 struct External * methodExternal;
614 struct External * methodCodeExternal;
615 } __attribute__ ((gcc_struct)) __anon3;
616 } __attribute__ ((gcc_struct)) __anon2;
617 unsigned int imported;
618 unsigned int declaredStructSym;
619 struct __ecereNameSpace__ecere__com__Class * _class;
620 unsigned int declaredStruct;
621 unsigned int needConstructor;
622 unsigned int needDestructor;
623 char * constructorName;
626 char * destructorName;
627 struct ModuleImport * module;
628 struct ClassImport * _import;
629 struct Location nameLoc;
630 unsigned int isParam;
631 unsigned int isRemote;
632 unsigned int isStruct;
633 unsigned int fireWatchersDone;
635 unsigned int classData;
636 unsigned int isStatic;
638 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
639 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
640 struct Context * ctx;
642 struct Expression * propCategory;
643 unsigned int mustRegister;
644 } __attribute__ ((gcc_struct));
653 struct Symbol * _class;
656 struct __ecereNameSpace__ecere__sys__OldList members;
658 } __attribute__ ((gcc_struct)) __anon1;
661 struct Type * returnType;
662 struct __ecereNameSpace__ecere__sys__OldList params;
663 struct Symbol * thisClass;
664 unsigned int staticMethod;
665 struct TemplateParameter * thisClassTemplate;
666 } __attribute__ ((gcc_struct)) __anon2;
669 struct __ecereNameSpace__ecere__com__Method * method;
670 struct __ecereNameSpace__ecere__com__Class * methodClass;
671 struct __ecereNameSpace__ecere__com__Class * usedClass;
672 } __attribute__ ((gcc_struct)) __anon3;
675 struct Type * arrayType;
677 struct Expression * arraySizeExp;
678 unsigned int freeExp;
679 struct Symbol * enumClass;
680 } __attribute__ ((gcc_struct)) __anon4;
682 struct TemplateParameter * templateParameter;
683 } __attribute__ ((gcc_struct)) __anon1;
688 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
694 unsigned int isSigned : 1;
695 unsigned int constant : 1;
696 unsigned int truth : 1;
697 unsigned int byReference : 1;
698 unsigned int extraParam : 1;
699 unsigned int directClassAccess : 1;
700 unsigned int computing : 1;
701 unsigned int keepCast : 1;
702 unsigned int passAsTemplate : 1;
703 unsigned int dllExport : 1;
704 unsigned int attrStdcall : 1;
705 unsigned int declaredWithStruct : 1;
706 unsigned int typedByReference : 1;
707 unsigned int casted : 1;
708 unsigned int pointerAlignment : 1;
709 unsigned int isLong : 1;
710 } __attribute__ ((gcc_struct));
712 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);
714 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
716 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
722 struct ClassFunction * prev;
723 struct ClassFunction * next;
725 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
726 struct Declarator * declarator;
727 struct __ecereNameSpace__ecere__sys__OldList * declarations;
728 struct Statement * body;
729 struct __ecereNameSpace__ecere__com__Class * _class;
730 struct __ecereNameSpace__ecere__sys__OldList attached;
733 struct Symbol * propSet;
734 unsigned int isVirtual;
735 unsigned int isConstructor;
736 unsigned int isDestructor;
737 unsigned int dontMangle;
740 } __attribute__ ((gcc_struct));
744 struct Statement * prev;
745 struct Statement * next;
750 struct __ecereNameSpace__ecere__sys__OldList * expressions;
753 struct Identifier * id;
754 struct Statement * stmt;
755 } __attribute__ ((gcc_struct)) labeled;
758 struct Expression * exp;
759 struct Statement * stmt;
760 } __attribute__ ((gcc_struct)) caseStmt;
763 struct __ecereNameSpace__ecere__sys__OldList * declarations;
764 struct __ecereNameSpace__ecere__sys__OldList * statements;
765 struct Context * context;
766 unsigned int isSwitch;
767 } __attribute__ ((gcc_struct)) compound;
770 struct __ecereNameSpace__ecere__sys__OldList * exp;
771 struct Statement * stmt;
772 struct Statement * elseStmt;
773 } __attribute__ ((gcc_struct)) ifStmt;
776 struct __ecereNameSpace__ecere__sys__OldList * exp;
777 struct Statement * stmt;
778 } __attribute__ ((gcc_struct)) switchStmt;
781 struct __ecereNameSpace__ecere__sys__OldList * exp;
782 struct Statement * stmt;
783 } __attribute__ ((gcc_struct)) whileStmt;
786 struct __ecereNameSpace__ecere__sys__OldList * exp;
787 struct Statement * stmt;
788 } __attribute__ ((gcc_struct)) doWhile;
791 struct Statement * init;
792 struct Statement * check;
793 struct __ecereNameSpace__ecere__sys__OldList * increment;
794 struct Statement * stmt;
795 } __attribute__ ((gcc_struct)) forStmt;
798 struct Identifier * id;
799 } __attribute__ ((gcc_struct)) gotoStmt;
802 struct Specifier * spec;
804 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
805 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
806 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
807 } __attribute__ ((gcc_struct)) asmStmt;
810 struct Expression * watcher;
811 struct Expression * object;
812 struct __ecereNameSpace__ecere__sys__OldList * watches;
813 } __attribute__ ((gcc_struct)) _watch;
816 struct Identifier * id;
817 struct __ecereNameSpace__ecere__sys__OldList * exp;
818 struct __ecereNameSpace__ecere__sys__OldList * filter;
819 struct Statement * stmt;
820 } __attribute__ ((gcc_struct)) forEachStmt;
821 struct Declaration * decl;
822 } __attribute__ ((gcc_struct)) __anon1;
823 } __attribute__ ((gcc_struct));
825 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
827 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
829 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
831 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
833 struct __ecereNameSpace__ecere__sys__BinaryTree;
835 struct __ecereNameSpace__ecere__sys__BinaryTree
837 struct __ecereNameSpace__ecere__sys__BTNode * root;
839 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
840 void (* FreeKey)(void * key);
841 } __attribute__ ((gcc_struct));
843 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
845 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
847 struct __ecereNameSpace__ecere__com__DataMember;
849 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
855 const char * dataTypeString;
856 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
857 } __attribute__ ((gcc_struct)) __anon1;
858 struct __ecereNameSpace__ecere__com__DataValue expression;
861 const char * memberString;
864 struct __ecereNameSpace__ecere__com__DataMember * member;
865 struct __ecereNameSpace__ecere__com__Property * prop;
866 struct __ecereNameSpace__ecere__com__Method * method;
867 } __attribute__ ((gcc_struct)) __anon1;
868 } __attribute__ ((gcc_struct)) __anon2;
869 } __attribute__ ((gcc_struct)) __anon1;
870 } __attribute__ ((gcc_struct));
872 struct __ecereNameSpace__ecere__com__DataMember
874 struct __ecereNameSpace__ecere__com__DataMember * prev;
875 struct __ecereNameSpace__ecere__com__DataMember * next;
877 unsigned int isProperty;
880 struct __ecereNameSpace__ecere__com__Class * _class;
881 const char * dataTypeString;
882 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
883 struct Type * dataType;
887 struct __ecereNameSpace__ecere__sys__OldList members;
888 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
890 short structAlignment;
891 short pointerAlignment;
892 } __attribute__ ((gcc_struct));
894 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);
896 struct __ecereNameSpace__ecere__com__Module;
898 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
900 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
902 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);
904 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
906 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);
908 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);
910 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);
916 struct TypeName * prev;
917 struct TypeName * next;
919 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
920 struct Declarator * declarator;
922 struct Expression * bitCount;
923 } __attribute__ ((gcc_struct));
925 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
927 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
931 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
933 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
935 struct ClassDefinition;
939 struct Context * parent;
940 struct __ecereNameSpace__ecere__sys__BinaryTree types;
941 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
942 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
943 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
946 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
947 struct ClassDefinition * classDef;
948 unsigned int templateTypesOnly;
949 unsigned int hasNameSpace;
950 } __attribute__ ((gcc_struct));
952 struct ClassDefinition
954 struct ClassDefinition * prev;
955 struct ClassDefinition * next;
957 struct Specifier * _class;
958 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
959 struct __ecereNameSpace__ecere__sys__OldList * definitions;
960 struct Symbol * symbol;
961 struct Location blockStart;
962 struct Location nameLoc;
964 unsigned int deleteWatchable;
965 } __attribute__ ((gcc_struct));
967 struct Instantiation;
971 struct Expression * prev;
972 struct Expression * next;
980 struct Identifier * identifier;
981 } __attribute__ ((gcc_struct)) __anon1;
982 struct Statement * compound;
983 struct Instantiation * instance;
987 unsigned int intlString;
988 unsigned int wideString;
989 } __attribute__ ((gcc_struct)) __anon2;
990 struct __ecereNameSpace__ecere__sys__OldList * list;
993 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
994 struct Declarator * decl;
995 } __attribute__ ((gcc_struct)) _classExp;
998 struct Identifier * id;
999 } __attribute__ ((gcc_struct)) classData;
1002 struct Expression * exp;
1003 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1004 struct Location argLoc;
1005 } __attribute__ ((gcc_struct)) call;
1008 struct Expression * exp;
1009 struct __ecereNameSpace__ecere__sys__OldList * index;
1010 } __attribute__ ((gcc_struct)) index;
1013 struct Expression * exp;
1014 struct Identifier * member;
1016 unsigned int thisPtr;
1017 } __attribute__ ((gcc_struct)) member;
1021 struct Expression * exp1;
1022 struct Expression * exp2;
1023 } __attribute__ ((gcc_struct)) op;
1024 struct TypeName * typeName;
1025 struct Specifier * _class;
1028 struct TypeName * typeName;
1029 struct Expression * exp;
1030 } __attribute__ ((gcc_struct)) cast;
1033 struct Expression * cond;
1034 struct __ecereNameSpace__ecere__sys__OldList * exp;
1035 struct Expression * elseExp;
1036 } __attribute__ ((gcc_struct)) cond;
1039 struct TypeName * typeName;
1040 struct Expression * size;
1041 } __attribute__ ((gcc_struct)) _new;
1044 struct TypeName * typeName;
1045 struct Expression * size;
1046 struct Expression * exp;
1047 } __attribute__ ((gcc_struct)) _renew;
1051 struct Identifier * id;
1052 } __attribute__ ((gcc_struct)) db;
1055 struct Expression * ds;
1056 struct Expression * name;
1057 } __attribute__ ((gcc_struct)) dbopen;
1060 struct TypeName * typeName;
1061 struct Initializer * initializer;
1062 } __attribute__ ((gcc_struct)) initializer;
1065 struct Expression * exp;
1066 struct TypeName * typeName;
1067 } __attribute__ ((gcc_struct)) vaArg;
1068 } __attribute__ ((gcc_struct)) __anon1;
1069 unsigned int debugValue;
1070 struct __ecereNameSpace__ecere__com__DataValue val;
1072 unsigned int hasAddress;
1073 struct Type * expType;
1074 struct Type * destType;
1077 unsigned int byReference;
1078 unsigned int isConstant;
1079 unsigned int addedThis;
1080 unsigned int needCast;
1081 unsigned int thisPtr;
1082 unsigned int opDestType;
1083 unsigned int needTemplateCast;
1084 } __attribute__ ((gcc_struct));
1086 struct Instantiation
1088 struct Instantiation * prev;
1089 struct Instantiation * next;
1090 struct Location loc;
1091 struct Specifier * _class;
1092 struct Expression * exp;
1093 struct __ecereNameSpace__ecere__sys__OldList * members;
1094 struct Symbol * symbol;
1095 unsigned int fullSet;
1096 unsigned int isConstant;
1097 unsigned char * data;
1098 struct Location nameLoc;
1099 struct Location insideLoc;
1101 } __attribute__ ((gcc_struct));
1105 struct Declaration * prev;
1106 struct Declaration * next;
1107 struct Location loc;
1113 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1114 struct __ecereNameSpace__ecere__sys__OldList * declarators;
1115 } __attribute__ ((gcc_struct)) __anon1;
1116 struct Instantiation * inst;
1119 struct Identifier * id;
1120 struct Expression * exp;
1121 } __attribute__ ((gcc_struct)) __anon2;
1122 } __attribute__ ((gcc_struct)) __anon1;
1123 struct Specifier * extStorage;
1124 struct Symbol * symbol;
1126 } __attribute__ ((gcc_struct));
1128 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1134 struct MembersInit * prev;
1135 struct MembersInit * next;
1136 struct Location loc;
1140 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1141 struct ClassFunction * function;
1142 } __attribute__ ((gcc_struct)) __anon1;
1143 } __attribute__ ((gcc_struct));
1149 struct MemberInit * prev;
1150 struct MemberInit * next;
1151 struct Location loc;
1152 struct Location realLoc;
1153 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1154 struct Initializer * initializer;
1156 unsigned int variable;
1157 unsigned int takeOutExp;
1158 } __attribute__ ((gcc_struct));
1160 static void CheckPublicExpression(struct Expression * exp, int access);
1162 static void CheckPublicInitializer(struct Initializer * init, int access)
1167 CheckPublicExpression(init->__anon1.exp, access);
1171 struct Initializer * i;
1173 for(i = (*init->__anon1.list).first; i; i = i->next)
1174 CheckPublicInitializer(i, access);
1180 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word);
1182 static void CheckPublicTypeName(struct TypeName * type, int access)
1184 if(type->qualifiers)
1186 struct Specifier * spec;
1188 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1192 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1194 CheckPublicClass(classSym, access, "define");
1200 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1208 CheckPublicClass(type->__anon1._class, access, word);
1218 struct Type * param;
1220 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1221 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1222 CheckPublicDataType(param, access, word);
1223 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1227 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1228 if(type->__anon1.__anon4.enumClass)
1229 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1233 CheckPublicDataType(type->__anon1.type, access, word);
1242 CheckPublicClass(type->__anon1._class, access, word);
1249 static void CheckPublicExpression(struct Expression * exp, int access)
1262 if(exp->__anon1.op.exp1)
1263 CheckPublicExpression(exp->__anon1.op.exp1, access);
1264 if(exp->__anon1.op.exp2)
1265 CheckPublicExpression(exp->__anon1.op.exp2, access);
1269 struct Expression * e;
1271 for(e = (*exp->__anon1.list).first; e; e = e->next)
1272 CheckPublicExpression(e, access);
1277 struct Expression * e;
1279 CheckPublicExpression(exp->__anon1.index.exp, access);
1280 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1281 CheckPublicExpression(e, access);
1286 struct Expression * e;
1288 CheckPublicExpression(exp->__anon1.call.exp, access);
1289 if(exp->__anon1.call.arguments)
1291 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1292 CheckPublicExpression(e, access);
1298 CheckPublicExpression(exp->__anon1.member.exp, access);
1303 CheckPublicExpression(exp->__anon1.member.exp, access);
1307 CheckPublicTypeName(exp->__anon1.typeName, access);
1311 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1312 if(exp->__anon1.cast.exp)
1313 CheckPublicExpression(exp->__anon1.cast.exp, access);
1318 struct Expression * e;
1320 CheckPublicExpression(exp->__anon1.cond.cond, access);
1321 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1322 CheckPublicExpression(e, access);
1323 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1328 CheckPublicExpression(exp->__anon1._new.size, access);
1332 CheckPublicExpression(exp->__anon1._renew.size, access);
1333 CheckPublicExpression(exp->__anon1._renew.exp, access);
1337 struct MembersInit * members;
1339 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1340 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1342 if(members->type == 0)
1344 struct MemberInit * member;
1346 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1348 CheckPublicInitializer(member->initializer, access);
1362 struct ClassDef * prev;
1363 struct ClassDef * next;
1364 struct Location loc;
1368 struct Declaration * decl;
1369 struct ClassFunction * function;
1370 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1371 struct PropertyDef * propertyDef;
1372 struct PropertyWatch * propertyWatch;
1374 struct Identifier * defaultProperty;
1377 struct Identifier * id;
1378 struct Initializer * initializer;
1379 } __attribute__ ((gcc_struct)) __anon1;
1380 } __attribute__ ((gcc_struct)) __anon1;
1383 } __attribute__ ((gcc_struct));
1387 struct PropertyDef * prev;
1388 struct PropertyDef * next;
1389 struct Location loc;
1390 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1391 struct Declarator * declarator;
1392 struct Identifier * id;
1393 struct Statement * getStmt;
1394 struct Statement * setStmt;
1395 struct Statement * issetStmt;
1396 struct Symbol * symbol;
1397 struct Expression * category;
1400 unsigned int conversion : 1;
1401 unsigned int isWatchable : 1;
1402 unsigned int isDBProp : 1;
1403 } __attribute__ ((gcc_struct)) __anon1;
1404 } __attribute__ ((gcc_struct));
1406 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1408 if(definitions != (((void *)0)))
1410 struct ClassDef * def;
1412 for(def = definitions->first; def; def = def->next)
1416 struct Declaration * decl = def->__anon1.decl;
1417 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1422 struct Declarator * d;
1424 if(decl->__anon1.__anon1.declarators)
1426 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1428 struct Identifier * declId = GetDeclId(d);
1434 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1436 dataMember = link ? link->data : (((void *)0));
1439 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1441 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1445 else if(decl->__anon1.__anon1.specifiers)
1447 struct Specifier * spec;
1449 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1451 if(spec->type == 3 || spec->type == 4)
1453 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1455 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1457 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1461 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1463 dataMember = link ? link->data : (((void *)0));
1466 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1468 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1474 else if(decl->type == 2)
1476 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1483 struct FunctionDefinition;
1485 typedef union YYSTYPE
1490 struct Identifier * id;
1491 struct Expression * exp;
1492 struct Specifier * specifier;
1493 struct __ecereNameSpace__ecere__sys__OldList * list;
1494 struct Enumerator * enumerator;
1495 struct Declarator * declarator;
1496 struct Pointer * pointer;
1497 struct Initializer * initializer;
1498 struct InitDeclarator * initDeclarator;
1499 struct TypeName * typeName;
1500 struct Declaration * declaration;
1501 struct Statement * stmt;
1502 struct FunctionDefinition * function;
1503 struct External * external;
1504 struct Context * context;
1505 struct AsmField * asmField;
1506 struct Attrib * attrib;
1507 struct ExtDecl * extDecl;
1508 struct Attribute * attribute;
1509 struct Instantiation * instance;
1510 struct MembersInit * membersInit;
1511 struct MemberInit * memberInit;
1512 struct ClassFunction * classFunction;
1513 struct ClassDefinition * _class;
1514 struct ClassDef * classDef;
1515 struct PropertyDef * prop;
1517 struct Symbol * symbol;
1518 struct PropertyWatch * propertyWatch;
1519 struct TemplateParameter * templateParameter;
1520 struct TemplateArgument * templateArgument;
1521 struct TemplateDatatype * templateDatatype;
1522 struct DBTableEntry * dbtableEntry;
1523 struct DBIndexItem * dbindexItem;
1524 struct DBTableDef * dbtableDef;
1525 } __attribute__ ((gcc_struct)) YYSTYPE;
1527 extern YYSTYPE yylval;
1531 struct External * prev;
1532 struct External * next;
1533 struct Location loc;
1535 struct Symbol * symbol;
1538 struct FunctionDefinition * function;
1539 struct ClassDefinition * _class;
1540 struct Declaration * declaration;
1541 char * importString;
1542 struct Identifier * id;
1543 struct DBTableDef * table;
1544 } __attribute__ ((gcc_struct)) __anon1;
1546 struct External * fwdDecl;
1547 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1548 struct __ecereNameSpace__ecere__com__Instance * incoming;
1549 int nonBreakableIncoming;
1550 } __attribute__ ((gcc_struct));
1552 struct FunctionDefinition
1554 struct FunctionDefinition * prev;
1555 struct FunctionDefinition * next;
1556 struct Location loc;
1557 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1558 struct Declarator * declarator;
1559 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1560 struct Statement * body;
1561 struct __ecereNameSpace__ecere__com__Class * _class;
1562 struct __ecereNameSpace__ecere__sys__OldList attached;
1565 struct Symbol * propSet;
1567 unsigned int propertyNoThis;
1568 } __attribute__ ((gcc_struct));
1570 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
1572 struct __ecereNameSpace__ecere__com__NameSpace;
1574 struct __ecereNameSpace__ecere__com__NameSpace
1577 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1578 struct __ecereNameSpace__ecere__com__NameSpace * left;
1579 struct __ecereNameSpace__ecere__com__NameSpace * right;
1581 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1582 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1583 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1584 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1585 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1586 } __attribute__ ((gcc_struct));
1588 struct __ecereNameSpace__ecere__com__Class
1590 struct __ecereNameSpace__ecere__com__Class * prev;
1591 struct __ecereNameSpace__ecere__com__Class * next;
1597 unsigned int (* Constructor)(void * );
1598 void (* Destructor)(void * );
1601 struct __ecereNameSpace__ecere__com__Class * base;
1602 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1603 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1604 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1605 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1606 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1607 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1611 struct __ecereNameSpace__ecere__com__Instance * module;
1612 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1613 const char * dataTypeString;
1614 struct Type * dataType;
1616 int defaultAlignment;
1617 void (* Initialize)();
1619 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1620 const char * designerClass;
1621 unsigned int noExpansion;
1622 const char * defaultProperty;
1623 unsigned int comRedefinition;
1626 unsigned int internalDecl;
1628 unsigned int computeSize;
1629 short structAlignment;
1630 short pointerAlignment;
1631 int destructionWatchOffset;
1633 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1634 int inheritanceAccess;
1635 const char * fullName;
1637 struct __ecereNameSpace__ecere__sys__OldList conversions;
1638 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1639 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1640 struct __ecereNameSpace__ecere__com__Class * templateClass;
1641 struct __ecereNameSpace__ecere__sys__OldList templatized;
1643 unsigned int isInstanceClass;
1644 unsigned int byValueSystemClass;
1645 } __attribute__ ((gcc_struct));
1647 struct __ecereNameSpace__ecere__com__Application
1650 const char * * argv;
1652 unsigned int isGUIApp;
1653 struct __ecereNameSpace__ecere__sys__OldList allModules;
1654 char * parsedCommand;
1655 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1656 } __attribute__ ((gcc_struct));
1658 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1662 else if((*ns).parent)
1663 return NameSpaceContained((*ns).parent, parent);
1668 static void AddSimpleBaseMembers(struct External * external, struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1670 if(_class->type != 1000)
1671 AddMembers(external, list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
1676 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
1678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1680 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1682 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
1684 struct __ecereNameSpace__ecere__com__Module
1686 struct __ecereNameSpace__ecere__com__Instance * application;
1687 struct __ecereNameSpace__ecere__sys__OldList classes;
1688 struct __ecereNameSpace__ecere__sys__OldList defines;
1689 struct __ecereNameSpace__ecere__sys__OldList functions;
1690 struct __ecereNameSpace__ecere__sys__OldList modules;
1691 struct __ecereNameSpace__ecere__com__Instance * prev;
1692 struct __ecereNameSpace__ecere__com__Instance * next;
1698 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1699 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1700 } __attribute__ ((gcc_struct));
1702 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
1707 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1709 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1713 if(regClass->templateClass)
1714 regClass = regClass->templateClass;
1715 if(classSym->isStatic && access != 3)
1717 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1719 else if(access == 1)
1721 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))
1723 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1724 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1730 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)
1732 char structName[1024];
1733 char className[1024];
1734 char constructorName[1024];
1735 char destructorName[1024];
1736 struct __ecereNameSpace__ecere__com__Class * regClass;
1737 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1738 unsigned int isUnion = classType == 6;
1739 struct External * external = (((void *)0));
1740 struct ClassDef * def;
1741 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1742 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1747 classDataList = MkList();
1749 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1752 classType = regClass->type;
1756 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && regClass->inheritanceAccess == 1)
1758 if(!regClass->base->symbol)
1759 regClass->base->symbol = FindClass(regClass->base->fullName);
1760 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1762 else if(!symbol->isStatic && regClass->base)
1764 if(!regClass->base->symbol)
1765 regClass->base->symbol = FindClass(regClass->base->fullName);
1766 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1769 if(definitions != (((void *)0)))
1771 for(def = definitions->first; def; def = def->next)
1775 struct __ecereNameSpace__ecere__com__DataMember * member;
1776 struct __ecereNameSpace__ecere__com__Property * prop;
1777 struct __ecereNameSpace__ecere__com__Method * method;
1779 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1781 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1783 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1785 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1787 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1789 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1794 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1801 external = MkExternalDeclaration((((void *)0)));
1802 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1803 curExternal = external;
1804 curExternal->symbol = symbol;
1806 if((classType == 1 || classType == 5) && inCompiler)
1808 AddSimpleBaseMembers(external, list, regClass->base, regClass);
1810 if(definitions != (((void *)0)))
1814 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
1815 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1816 else if(!symbol->isStatic)
1817 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1819 for(def = definitions->first; def; def = def->next)
1824 struct Declaration * decl = def->__anon1.decl;
1829 if(inCompiler && classType != 2)
1831 ListAdd(list, MkClassDefDeclaration(decl));
1832 def->__anon1.decl = (((void *)0));
1835 else if(decl->type == 2)
1837 struct Instantiation * inst = decl->__anon1.inst;
1838 struct Expression * exp = inst->exp;
1839 struct Symbol * classSym;
1843 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1844 struct Declarator * d;
1846 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1847 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1850 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1852 ListAdd(declarators, d);
1853 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1854 ListAdd(list, MkClassDefDeclaration(decl));
1856 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1857 exp->__anon1.member.exp = QMkExpId("this");
1858 exp->__anon1.member.memberType = 3;
1859 exp->__anon1.member.thisPtr = 1;
1864 FreeList(specifiers, (void *)(FreeSpecifier));
1867 classSym = inst->_class->__anon1.__anon1.symbol;
1868 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1870 if(inst->members && (*inst->members).count)
1871 symbol->needConstructor = 1;
1875 symbol->needConstructor = 1;
1876 symbol->needDestructor = 1;
1880 else if(def->type == 9)
1882 struct Declaration * decl = def->__anon1.decl;
1886 if(inCompiler && classType != 2)
1888 ListAdd(classDataList, MkClassDefDeclaration(decl));
1889 def->__anon1.decl = (((void *)0));
1893 else if(def->type == 1)
1894 symbol->needConstructor = 1;
1895 else if(def->type == 4)
1896 symbol->needConstructor = 1;
1897 else if(def->type == 0)
1899 struct ClassFunction * func = def->__anon1.function;
1901 if(func->isDestructor)
1906 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1910 symbol->needDestructor = 1;
1912 if(!inCompiler && func->body)
1914 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1916 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1920 if(func->isConstructor)
1925 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1929 symbol->needConstructor = 1;
1931 if(!inCompiler && func->body)
1933 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1935 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1944 external->symbol = (((void *)0));
1947 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1949 initDeclarators = (((void *)0));
1950 strcpy(structName, symbol->string);
1951 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1953 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1955 spec->__anon1.__anon2.extDeclStruct = extDecl;
1956 ListAdd(specs, spec);
1958 external->symbol = symbol;
1959 if(symbol->__anon2.__anon1.structExternal)
1962 struct TopoEdge * e;
1963 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->incoming;
1965 for(e = ((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first; e; e = (struct TopoEdge *)((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
1966 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1968 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1969 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1970 __ecereMethod_External_CreateUniqueEdge(external, e->from, e->breakable);
1973 struct TopoEdge * e;
1974 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->outgoing;
1976 for(e = ((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first; e; e = (struct TopoEdge *)((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
1977 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1979 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1980 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1981 __ecereMethod_External_CreateUniqueEdge(e->to, external, e->breakable);
1983 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), symbol->__anon2.__anon1.structExternal);
1984 FreeExternal(symbol->__anon2.__anon1.structExternal);
1986 symbol->__anon2.__anon1.structExternal = external;
1987 external->__anon1.declaration = MkDeclaration(specs, declarators);
1989 symbol->declaredStruct = 1;
1993 curExternal = external->prev;
1994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1995 FreeExternal(external);
1996 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1998 if((*classDataList).count)
2000 char classDataStructName[1024];
2001 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2002 struct External * external;
2004 strcpy(classDataStructName, "__ecereClassData_");
2005 FullClassNameCat(classDataStructName, symbol->string, 0);
2006 declMode = structDeclMode = 0;
2007 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
2008 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
2009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
2011 symbol->classData = 1;
2014 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
2019 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2021 strcpy(className, "__ecereClass_");
2022 FullClassNameCat(className, symbol->string, 1);
2023 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2024 if(!strstr(sourceFile, ".main.ec"))
2025 ListAdd(specs, MkSpecifier(STATIC));
2026 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2027 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2028 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2029 DeclareStruct(symbol->__anon2.__anon1.pointerExternal, "ecere::com::Class", 0, 1);
2030 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon1.pointerExternal);
2031 after = symbol->__anon2.__anon3.methodExternal;
2033 if(symbol->needDestructor)
2035 struct ClassFunction * function;
2036 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2037 struct Declarator * decl;
2038 struct Statement * body;
2039 struct Context * context;
2040 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2042 strcpy(destructorName, "__ecereDestructor_");
2043 FullClassNameCat(destructorName, symbol->string, 0);
2044 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2045 ListAdd(specs, MkSpecifier(VOID));
2046 context = PushContext();
2047 statements = MkList();
2048 if(definitions != (((void *)0)))
2050 for(def = definitions->first; def; def = def->next)
2052 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2054 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2055 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2057 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2059 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2061 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2063 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2065 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2067 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2072 if(destructor && destructor->body)
2074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2075 destructor->body->__anon1.compound.context->parent = context;
2076 destructor->body = (((void *)0));
2078 body = MkCompoundStmt(declarations, statements);
2079 PopContext(context);
2080 body->__anon1.compound.context = context;
2081 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2082 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2083 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2084 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2085 ProcessClassFunctionBody(function, body);
2086 function->dontMangle = 1;
2087 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2089 if(symbol->needConstructor && inCompiler)
2091 struct ClassFunction * function;
2092 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2093 struct Declarator * decl;
2094 struct Statement * body;
2095 struct Context * context;
2096 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2098 strcpy(constructorName, "__ecereConstructor_");
2099 FullClassNameCat(constructorName, symbol->string, 0);
2100 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2101 ListAdd(specs, MkSpecifierName("bool"));
2102 context = PushContext();
2103 statements = MkList();
2104 if(definitions != (((void *)0)))
2106 for(def = definitions->first; def; def = def->next)
2108 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2110 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2111 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2113 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2115 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2118 newInst->members = (((void *)0));
2119 newInst->exp = CopyExpression(inst->exp);
2120 newInst->_class = CopySpecifier(inst->_class);
2121 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2124 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2126 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2130 for(def = definitions->first; def; def = def->next)
2132 if(def->type == 1 && def->__anon1.defProperties)
2134 struct MemberInit * propertyDef;
2136 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2138 struct Expression * memberExp;
2139 struct Identifier * id = (*propertyDef->identifiers).first;
2143 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2144 for(id = id->next; id; id = id->next)
2145 memberExp = MkExpMember(memberExp, id);
2146 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2148 if(propertyDef->initializer)
2150 if(propertyDef->initializer->type == 0)
2151 propertyDef->initializer->__anon1.exp = (((void *)0));
2152 FreeInitializer(propertyDef->initializer);
2154 propertyDef->initializer = (((void *)0));
2155 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2159 for(def = definitions->first; def; def = def->next)
2161 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2163 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2164 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2166 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2168 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2170 def->__anon1.decl->__anon1.inst = (((void *)0));
2171 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2177 if(constructor && constructor->body)
2179 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2180 constructor->body->__anon1.compound.context->parent = context;
2181 constructor->body = (((void *)0));
2183 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2184 body = MkCompoundStmt(declarations, statements);
2185 PopContext(context);
2186 body->__anon1.compound.context = context;
2187 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2188 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2189 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2190 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2191 ProcessClassFunctionBody(function, body);
2192 function->dontMangle = 1;
2193 if(definitions != (((void *)0)))
2194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2197 if(definitions != (((void *)0)))
2199 for(def = definitions->first; def; def = def->next)
2201 if(def->type == 3 && def->__anon1.propertyDef)
2203 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2204 struct ClassDef * after = def;
2205 struct ClassDef * newDef;
2209 yylloc = propertyDef->loc;
2210 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && def->memberAccess == 1)
2211 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2212 else if(!symbol->isStatic)
2213 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2217 struct ClassFunction * func;
2218 struct Declarator * decl;
2220 struct __ecereNameSpace__ecere__sys__OldList * params;
2222 if(propertyDef->getStmt && propertyDef->id)
2224 strcpy(name, "__ecereProp_");
2225 FullClassNameCat(name, symbol->string, 0);
2226 strcat(name, "_Get_");
2227 FullClassNameCat(name, propertyDef->id->string, 1);
2229 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)
2231 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2232 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2233 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2237 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2238 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2240 ProcessClassFunctionBody(func, propertyDef->getStmt);
2241 func->declarator->symbol = propertyDef->symbol;
2242 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2243 func->dontMangle = 1;
2244 newDef = MkClassDefFunction(func);
2245 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2248 propertyDef->getStmt = (((void *)0));
2250 func->body = (((void *)0));
2252 if(propertyDef->setStmt && propertyDef->id)
2254 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2256 strcpy(name, "__ecereProp_");
2257 FullClassNameCat(name, symbol->string, 0);
2258 strcat(name, "_Set_");
2259 FullClassNameCat(name, propertyDef->id->string, 1);
2261 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2262 if(propertyDef->__anon1.isDBProp)
2264 struct Specifier * spec;
2265 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2267 for(spec = (*specs).first; spec; spec = spec->next)
2268 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2271 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2273 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2275 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2276 unsigned int useVoid = 0;
2278 switch(regClass->type)
2286 useVoid = !isConversion;
2289 useVoid = !isConversion;
2290 if(useVoid && !propertyDef->__anon1.isDBProp)
2291 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2293 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2295 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2296 ProcessClassFunctionBody(func, propertyDef->setStmt);
2297 func->dontMangle = 1;
2298 func->declarator->symbol = propertyDef->symbol;
2299 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2300 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2301 func->propSet = propertyDef->symbol;
2302 newDef = MkClassDefFunction(func);
2303 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2306 propertyDef->setStmt = (((void *)0));
2308 func->body = (((void *)0));
2310 if(propertyDef->issetStmt && propertyDef->id)
2312 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2314 strcpy(name, "__ecereProp_");
2315 FullClassNameCat(name, symbol->string, 0);
2316 strcat(name, "_IsSet_");
2317 FullClassNameCat(name, propertyDef->id->string, 1);
2319 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2320 ListAdd(specifiers, MkSpecifierName("bool"));
2321 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2322 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2323 func->dontMangle = 1;
2324 func->declarator->symbol = propertyDef->symbol;
2325 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2326 newDef = MkClassDefFunction(func);
2327 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2330 propertyDef->issetStmt = (((void *)0));
2332 func->body = (((void *)0));
2334 if(propertyDef->id && inCompiler)
2336 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2337 struct Declaration * decl;
2338 struct External * external;
2339 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2341 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2342 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2343 ListAdd(specifiers, MkSpecifierName("Property"));
2344 strcpy(name, "__ecereProp_");
2345 FullClassNameCat(name, symbol->string, 0);
2347 FullClassNameCat(name, propertyDef->id->string, 1);
2349 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2351 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2352 strcpy(name, "__ecerePropM_");
2353 FullClassNameCat(name, symbol->string, 0);
2355 FullClassNameCat(name, propertyDef->id->string, 1);
2356 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2357 decl = MkDeclaration(specifiers, list);
2359 external = MkExternalDeclaration(decl);
2360 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2361 external->symbol = propertyDef->symbol;
2362 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2363 if(inCompiler && prop && prop->symbol)
2364 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2369 else if(def->type == 10 && def->__anon1.propertyDef)
2371 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2372 struct ClassDef * after = def;
2373 struct ClassDef * newDef;
2378 yylloc = propertyDef->loc;
2379 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
2380 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2381 else if(!symbol->isStatic)
2382 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2385 struct ClassFunction * func;
2386 struct Declarator * decl;
2388 struct __ecereNameSpace__ecere__sys__OldList * params;
2390 if(propertyDef->getStmt && propertyDef->id)
2392 struct Declarator * declId;
2394 sprintf(name, "class::__ecereClassProp_");
2395 FullClassNameCat(name, symbol->string, 0);
2396 strcat(name, "_Get_");
2397 strcat(name, propertyDef->id->string);
2399 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2401 decl = MkDeclaratorFunction(declId, params);
2402 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2404 ProcessClassFunctionBody(func, propertyDef->getStmt);
2405 func->declarator->symbol = propertyDef->symbol;
2406 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2407 func->dontMangle = 1;
2408 newDef = MkClassDefFunction(func);
2409 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2411 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2412 func->type = ProcessType(propertyDef->specifiers, decl);
2413 FreeDeclarator(decl);
2414 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)
2415 func->type->__anon1.__anon2.returnType->byReference = 1;
2416 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2418 propertyDef->getStmt = (((void *)0));
2420 func->body = (((void *)0));
2422 if(propertyDef->setStmt && propertyDef->id)
2424 struct Context * prevCurContext;
2425 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2426 struct Statement * body = propertyDef->setStmt;
2427 struct Declarator * ptrDecl;
2428 struct Expression * e;
2430 strcpy(name, "class::__ecereClassProp_");
2431 FullClassNameCat(name, symbol->string, 0);
2432 strcat(name, "_Set_");
2433 strcat(name, propertyDef->id->string);
2435 prevCurContext = curContext;
2436 curContext = body->__anon1.compound.context;
2437 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2438 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2439 if(!body->__anon1.compound.declarations)
2440 body->__anon1.compound.declarations = MkList();
2441 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)
2442 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2444 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2445 e = MkExpIdentifier(MkIdentifier("_value"));
2446 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2447 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2448 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))))));
2449 curContext = prevCurContext;
2451 struct Symbol * sym = ptrDecl->symbol;
2454 FreeType(sym->type);
2455 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2457 ListAdd(specifiers, MkSpecifier(VOID));
2458 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2459 ProcessClassFunctionBody(func, propertyDef->setStmt);
2460 func->dontMangle = 1;
2461 func->declarator->symbol = propertyDef->symbol;
2462 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2463 newDef = MkClassDefFunction(func);
2464 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2467 propertyDef->setStmt = (((void *)0));
2469 func->body = (((void *)0));
2474 else if(def->type == 0 && def->__anon1.function->declarator)
2476 struct ClassFunction * func = def->__anon1.function;
2478 func->_class = regClass;
2479 if(!func->dontMangle)
2481 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2482 struct Identifier * id = GetDeclId(funcDecl);
2483 struct __ecereNameSpace__ecere__com__Method * method;
2485 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2487 if(!funcDecl->__anon1.function.parameters)
2488 funcDecl->__anon1.function.parameters = MkList();
2489 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2491 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2492 FreeSpecifier(id->_class);
2493 id->_class = (((void *)0));
2494 if(inCompiler && method)
2496 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2499 ProcessMethodType(method);
2501 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && method->memberAccess == 1)
2502 CheckPublicDataType(method->dataType, 1, "class method");
2503 strcpy(newId, "__ecereMethod_");
2504 FullClassNameCat(newId, symbol->string, 0);
2506 strcat(newId, id->string);
2507 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2509 if(method->type != 1)
2513 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2514 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2522 if(initDeclarators != (((void *)0)))
2523 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2526 void PreProcessClassDefinitions()
2528 struct External * external, * next;
2530 curExternal = (((void *)0));
2533 for(external = (*ast).first; external; external = next)
2535 next = external->next;
2536 curExternal = external;
2537 if(external->type == 2)
2539 struct ClassDefinition * _class = external->__anon1._class;
2541 if(_class->definitions)
2543 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2546 else if(external->type == 1)
2548 struct Declaration * declaration = external->__anon1.declaration;
2550 if(declaration && declaration->type == 1)
2552 if(declaration->__anon1.__anon1.specifiers)
2554 struct Specifier * specifier;
2556 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2558 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)))
2560 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2564 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2565 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2567 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2570 initDeclarators = declaration->__anon1.__anon1.declarators;
2571 declaration->__anon1.__anon1.declarators = (((void *)0));
2573 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);
2579 else if(declaration && inCompiler && declaration->type == 3)
2581 yylloc = declaration->loc;
2582 if(declaration->declMode == 1)
2583 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2584 else if(declaration->declMode != 3)
2585 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2588 else if(external->type == 3)
2591 else if(inCompiler && external->type == 0)
2593 yylloc = external->__anon1.function->loc;
2594 if(!external->__anon1.function->type)
2595 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2596 if(external->__anon1.function->declMode == 1)
2597 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2598 else if(external->__anon1.function->declMode != 3)
2599 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2605 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2607 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2609 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2610 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);