2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
16 typedef long long int64;
17 typedef unsigned long long uint64;
19 typedef __int64 int64;
20 typedef unsigned __int64 uint64;
23 #define __ENDIAN_PAD(x) (8 - (x))
25 #define __ENDIAN_PAD(x) 0
29 typedef unsigned long long int uintptr_t;
30 typedef long long int intptr_t;
32 typedef unsigned int uintptr_t;
38 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
40 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
42 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
44 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
46 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
48 struct __ecereNameSpace__ecere__sys__BTNode;
50 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
52 struct __ecereNameSpace__ecere__sys__BinaryTree
54 struct __ecereNameSpace__ecere__sys__BTNode * root;
56 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
57 void (* FreeKey)(void * key);
58 } __attribute__ ((gcc_struct));
60 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
62 struct __ecereNameSpace__ecere__sys__OldList
69 } __attribute__ ((gcc_struct));
71 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
73 struct __ecereNameSpace__ecere__com__Method
76 struct __ecereNameSpace__ecere__com__Method * parent;
77 struct __ecereNameSpace__ecere__com__Method * left;
78 struct __ecereNameSpace__ecere__com__Method * right;
83 struct __ecereNameSpace__ecere__com__Class * _class;
85 char * dataTypeString;
86 struct Type * dataType;
88 } __attribute__ ((gcc_struct));
90 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
92 struct __ecereNameSpace__ecere__com__Property
94 struct __ecereNameSpace__ecere__com__Property * prev;
95 struct __ecereNameSpace__ecere__com__Property * next;
97 unsigned int isProperty;
100 struct __ecereNameSpace__ecere__com__Class * _class;
101 char * dataTypeString;
102 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
103 struct Type * dataType;
106 unsigned int (* IsSet)();
110 unsigned int conversion;
111 unsigned int watcherOffset;
113 unsigned int compiled;
114 unsigned int selfWatchable;
115 unsigned int isWatchable;
116 } __attribute__ ((gcc_struct));
118 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
125 unsigned int included;
126 } __attribute__ ((gcc_struct));
128 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
132 struct CodePosition start;
133 struct CodePosition end;
134 } __attribute__ ((gcc_struct));
136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
140 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
144 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
146 struct ClassDefinition
148 struct ClassDefinition * prev;
149 struct ClassDefinition * next;
151 struct Specifier * _class;
152 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
153 struct __ecereNameSpace__ecere__sys__OldList * definitions;
154 struct Symbol * symbol;
155 struct Location blockStart;
156 struct Location nameLoc;
159 unsigned int deleteWatchable;
160 } __attribute__ ((gcc_struct));
162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
166 struct Context * parent;
167 struct __ecereNameSpace__ecere__sys__BinaryTree types;
168 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
169 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
170 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
173 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
174 struct ClassDefinition * classDef;
175 unsigned int templateTypesOnly;
176 unsigned int hasNameSpace;
177 } __attribute__ ((gcc_struct));
179 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
183 struct Instantiation * prev;
184 struct Instantiation * next;
186 struct Specifier * _class;
187 struct Expression * exp;
188 struct __ecereNameSpace__ecere__sys__OldList * members;
189 struct Symbol * symbol;
190 unsigned int fullSet;
191 unsigned int isConstant;
192 unsigned char * data;
193 struct Location nameLoc;
194 struct Location insideLoc;
196 } __attribute__ ((gcc_struct));
198 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
202 struct Declaration * prev;
203 struct Declaration * next;
210 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
211 struct __ecereNameSpace__ecere__sys__OldList * declarators;
212 } __attribute__ ((gcc_struct));
213 struct Instantiation * inst;
216 struct Identifier * id;
217 struct Expression * exp;
218 } __attribute__ ((gcc_struct));
219 } __attribute__ ((gcc_struct));
220 struct Specifier * extStorage;
221 struct Symbol * symbol;
223 } __attribute__ ((gcc_struct));
225 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
229 struct Statement * prev;
230 struct Statement * next;
235 struct __ecereNameSpace__ecere__sys__OldList * expressions;
238 struct Identifier * id;
239 struct Statement * stmt;
240 } __attribute__ ((gcc_struct)) labeled;
243 struct Expression * exp;
244 struct Statement * stmt;
245 } __attribute__ ((gcc_struct)) caseStmt;
248 struct __ecereNameSpace__ecere__sys__OldList * declarations;
249 struct __ecereNameSpace__ecere__sys__OldList * statements;
250 struct Context * context;
251 unsigned int isSwitch;
252 } __attribute__ ((gcc_struct)) compound;
255 struct __ecereNameSpace__ecere__sys__OldList * exp;
256 struct Statement * stmt;
257 struct Statement * elseStmt;
258 } __attribute__ ((gcc_struct)) ifStmt;
261 struct __ecereNameSpace__ecere__sys__OldList * exp;
262 struct Statement * stmt;
263 } __attribute__ ((gcc_struct)) switchStmt;
266 struct __ecereNameSpace__ecere__sys__OldList * exp;
267 struct Statement * stmt;
268 } __attribute__ ((gcc_struct)) whileStmt;
271 struct __ecereNameSpace__ecere__sys__OldList * exp;
272 struct Statement * stmt;
273 } __attribute__ ((gcc_struct)) doWhile;
276 struct Statement * init;
277 struct Statement * check;
278 struct __ecereNameSpace__ecere__sys__OldList * increment;
279 struct Statement * stmt;
280 } __attribute__ ((gcc_struct)) forStmt;
283 struct Identifier * id;
284 } __attribute__ ((gcc_struct)) gotoStmt;
287 struct Specifier * spec;
289 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
290 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
291 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
292 } __attribute__ ((gcc_struct)) asmStmt;
295 struct Expression * watcher;
296 struct Expression * object;
297 struct __ecereNameSpace__ecere__sys__OldList * watches;
298 } __attribute__ ((gcc_struct)) _watch;
301 struct Identifier * id;
302 struct __ecereNameSpace__ecere__sys__OldList * exp;
303 struct __ecereNameSpace__ecere__sys__OldList * filter;
304 struct Statement * stmt;
305 } __attribute__ ((gcc_struct)) forEachStmt;
306 struct Declaration * decl;
307 } __attribute__ ((gcc_struct));
308 } __attribute__ ((gcc_struct));
310 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
314 struct TypeName * prev;
315 struct TypeName * next;
317 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
318 struct Declarator * declarator;
320 struct Expression * bitCount;
321 } __attribute__ ((gcc_struct));
323 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
327 struct Initializer * prev;
328 struct Initializer * next;
333 struct Expression * exp;
334 struct __ecereNameSpace__ecere__sys__OldList * list;
335 } __attribute__ ((gcc_struct));
336 unsigned int isConstant;
337 } __attribute__ ((gcc_struct));
339 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
341 struct __ecereNameSpace__ecere__com__DataValue
356 } __attribute__ ((gcc_struct));
357 } __attribute__ ((gcc_struct));
359 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
363 struct Expression * prev;
364 struct Expression * next;
372 struct Identifier * identifier;
373 } __attribute__ ((gcc_struct));
374 struct Statement * compound;
375 struct Instantiation * instance;
377 struct __ecereNameSpace__ecere__sys__OldList * list;
380 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
381 struct Declarator * decl;
382 } __attribute__ ((gcc_struct)) _classExp;
385 struct Identifier * id;
386 } __attribute__ ((gcc_struct)) classData;
389 struct Expression * exp;
390 struct __ecereNameSpace__ecere__sys__OldList * arguments;
391 struct Location argLoc;
392 } __attribute__ ((gcc_struct)) call;
395 struct Expression * exp;
396 struct __ecereNameSpace__ecere__sys__OldList * index;
397 } __attribute__ ((gcc_struct)) index;
400 struct Expression * exp;
401 struct Identifier * member;
403 unsigned int thisPtr;
404 } __attribute__ ((gcc_struct)) member;
408 struct Expression * exp1;
409 struct Expression * exp2;
410 } __attribute__ ((gcc_struct)) op;
411 struct TypeName * typeName;
412 struct Specifier * _class;
415 struct TypeName * typeName;
416 struct Expression * exp;
417 } __attribute__ ((gcc_struct)) cast;
420 struct Expression * cond;
421 struct __ecereNameSpace__ecere__sys__OldList * exp;
422 struct Expression * elseExp;
423 } __attribute__ ((gcc_struct)) cond;
426 struct TypeName * typeName;
427 struct Expression * size;
428 } __attribute__ ((gcc_struct)) _new;
431 struct TypeName * typeName;
432 struct Expression * size;
433 struct Expression * exp;
434 } __attribute__ ((gcc_struct)) _renew;
438 struct Identifier * id;
439 } __attribute__ ((gcc_struct)) db;
442 struct Expression * ds;
443 struct Expression * name;
444 } __attribute__ ((gcc_struct)) dbopen;
447 struct TypeName * typeName;
448 struct Initializer * initializer;
449 } __attribute__ ((gcc_struct)) initializer;
452 struct Expression * exp;
453 struct TypeName * typeName;
454 } __attribute__ ((gcc_struct)) vaArg;
455 } __attribute__ ((gcc_struct));
456 unsigned int debugValue;
457 struct __ecereNameSpace__ecere__com__DataValue val;
458 unsigned int address;
459 unsigned int hasAddress;
460 struct Type * expType;
461 struct Type * destType;
464 unsigned int byReference;
465 unsigned int isConstant;
466 unsigned int addedThis;
467 unsigned int needCast;
468 unsigned int thisPtr;
469 } __attribute__ ((gcc_struct));
471 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
473 struct TemplateDatatype;
475 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
477 struct TemplateArgument;
479 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
481 struct TemplateParameter;
483 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
487 struct Specifier * prev;
488 struct Specifier * next;
496 struct ExtDecl * extDecl;
498 struct Symbol * symbol;
499 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
500 } __attribute__ ((gcc_struct));
503 struct Identifier * id;
504 struct __ecereNameSpace__ecere__sys__OldList * list;
505 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
506 struct __ecereNameSpace__ecere__sys__OldList * definitions;
507 unsigned int addNameSpace;
508 struct Context * ctx;
509 struct ExtDecl * extDeclStruct;
510 } __attribute__ ((gcc_struct));
511 struct Expression * expression;
512 struct Specifier * _class;
513 struct TemplateParameter * templateParameter;
514 } __attribute__ ((gcc_struct));
515 } __attribute__ ((gcc_struct));
517 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
521 struct Identifier * prev;
522 struct Identifier * next;
524 struct Symbol * classSym;
525 struct Specifier * _class;
527 struct Identifier * badID;
528 } __attribute__ ((gcc_struct));
530 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
534 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
538 struct Declarator * prev;
539 struct Declarator * next;
542 struct Symbol * symbol;
543 struct Declarator * declarator;
546 struct Identifier * identifier;
549 struct Expression * exp;
550 struct Expression * posExp;
551 struct Attrib * attrib;
552 } __attribute__ ((gcc_struct)) structDecl;
555 struct Expression * exp;
556 struct Specifier * enumClass;
557 } __attribute__ ((gcc_struct)) array;
560 struct __ecereNameSpace__ecere__sys__OldList * parameters;
561 } __attribute__ ((gcc_struct)) function;
564 struct Pointer * pointer;
565 } __attribute__ ((gcc_struct)) pointer;
568 struct ExtDecl * extended;
569 } __attribute__ ((gcc_struct)) extended;
570 } __attribute__ ((gcc_struct));
571 } __attribute__ ((gcc_struct));
573 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
575 struct FunctionDefinition
577 struct FunctionDefinition * prev;
578 struct FunctionDefinition * next;
580 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
581 struct Declarator * declarator;
582 struct __ecereNameSpace__ecere__sys__OldList * declarations;
583 struct Statement * body;
584 struct __ecereNameSpace__ecere__com__Class * _class;
585 struct __ecereNameSpace__ecere__sys__OldList attached;
588 struct Symbol * propSet;
590 unsigned int propertyNoThis;
591 } __attribute__ ((gcc_struct));
593 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
597 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
601 struct External * prev;
602 struct External * next;
605 struct Symbol * symbol;
608 struct FunctionDefinition * function;
609 struct ClassDefinition * _class;
610 struct Declaration * declaration;
612 struct Identifier * id;
613 struct DBTableDef * table;
614 } __attribute__ ((gcc_struct));
616 } __attribute__ ((gcc_struct));
618 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
622 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
626 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
631 struct Symbol * parent;
632 struct Symbol * left;
633 struct Symbol * right;
638 struct __ecereNameSpace__ecere__com__Method * method;
639 struct __ecereNameSpace__ecere__com__Property * _property;
640 struct __ecereNameSpace__ecere__com__Class * registered;
641 } __attribute__ ((gcc_struct));
648 struct External * pointerExternal;
649 struct External * structExternal;
650 } __attribute__ ((gcc_struct));
653 struct External * externalGet;
654 struct External * externalSet;
655 struct External * externalPtr;
656 struct External * externalIsSet;
657 } __attribute__ ((gcc_struct));
660 struct External * methodExternal;
661 struct External * methodCodeExternal;
662 } __attribute__ ((gcc_struct));
663 } __attribute__ ((gcc_struct));
664 unsigned int imported;
665 unsigned int declaredStructSym;
666 struct __ecereNameSpace__ecere__com__Class * _class;
667 unsigned int declaredStruct;
668 unsigned int needConstructor;
669 unsigned int needDestructor;
670 char * constructorName;
673 char * destructorName;
674 struct ModuleImport * module;
675 struct ClassImport * _import;
676 struct Location nameLoc;
677 unsigned int isParam;
678 unsigned int isRemote;
679 unsigned int isStruct;
680 unsigned int fireWatchersDone;
682 unsigned int classData;
683 unsigned int isStatic;
685 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
686 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
687 struct Context * ctx;
689 struct Expression * propCategory;
690 } __attribute__ ((gcc_struct));
692 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
701 struct Symbol * _class;
704 struct __ecereNameSpace__ecere__sys__OldList members;
706 } __attribute__ ((gcc_struct));
709 struct Type * returnType;
710 struct __ecereNameSpace__ecere__sys__OldList params;
711 struct Symbol * thisClass;
712 unsigned int staticMethod;
713 struct TemplateParameter * thisClassTemplate;
714 } __attribute__ ((gcc_struct));
717 struct __ecereNameSpace__ecere__com__Method * method;
718 struct __ecereNameSpace__ecere__com__Class * methodClass;
719 struct __ecereNameSpace__ecere__com__Class * usedClass;
720 } __attribute__ ((gcc_struct));
723 struct Type * arrayType;
725 struct Expression * arraySizeExp;
726 unsigned int freeExp;
727 struct Symbol * enumClass;
728 } __attribute__ ((gcc_struct));
730 struct TemplateParameter * templateParameter;
731 } __attribute__ ((gcc_struct));
732 unsigned int isSigned;
734 unsigned int constant;
741 unsigned int byReference;
742 unsigned int extraParam;
744 unsigned int directClassAccess;
745 unsigned int computing;
746 unsigned int dllExport;
748 unsigned int keepCast;
749 unsigned int passAsTemplate;
751 } __attribute__ ((gcc_struct));
753 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
755 struct __ecereNameSpace__ecere__com__Class
757 struct __ecereNameSpace__ecere__com__Class * prev;
758 struct __ecereNameSpace__ecere__com__Class * next;
764 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
765 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
768 struct __ecereNameSpace__ecere__com__Class * base;
769 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
770 struct __ecereNameSpace__ecere__sys__BinaryTree members;
771 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
772 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
773 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
774 struct __ecereNameSpace__ecere__sys__OldList derivatives;
778 struct __ecereNameSpace__ecere__com__Instance * module;
779 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
780 char * dataTypeString;
781 struct Type * dataType;
783 int defaultAlignment;
784 void (* Initialize)();
786 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
787 char * designerClass;
788 unsigned int noExpansion;
789 char * defaultProperty;
790 unsigned int comRedefinition;
792 unsigned int isRemote;
793 unsigned int internalDecl;
795 unsigned int computeSize;
797 int destructionWatchOffset;
799 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
800 int inheritanceAccess;
803 struct __ecereNameSpace__ecere__sys__OldList conversions;
804 struct __ecereNameSpace__ecere__sys__OldList templateParams;
805 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
806 struct __ecereNameSpace__ecere__com__Class * templateClass;
807 struct __ecereNameSpace__ecere__sys__OldList templatized;
809 } __attribute__ ((gcc_struct));
811 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
813 struct __ecereNameSpace__ecere__com__Instance
816 struct __ecereNameSpace__ecere__com__Class * _class;
818 } __attribute__ ((gcc_struct));
820 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
822 struct __ecereNameSpace__ecere__com__DataMember
824 struct __ecereNameSpace__ecere__com__DataMember * prev;
825 struct __ecereNameSpace__ecere__com__DataMember * next;
827 unsigned int isProperty;
830 struct __ecereNameSpace__ecere__com__Class * _class;
831 char * dataTypeString;
832 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
833 struct Type * dataType;
837 struct __ecereNameSpace__ecere__sys__OldList members;
838 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
841 } __attribute__ ((gcc_struct));
843 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
845 struct __ecereNameSpace__ecere__com__SerialBuffer
847 unsigned char * _buffer;
851 } __attribute__ ((gcc_struct));
853 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
855 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
861 char * dataTypeString;
862 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
863 } __attribute__ ((gcc_struct));
864 struct __ecereNameSpace__ecere__com__DataValue expression;
870 struct __ecereNameSpace__ecere__com__DataMember * member;
871 struct __ecereNameSpace__ecere__com__Property * prop;
872 struct __ecereNameSpace__ecere__com__Method * method;
873 } __attribute__ ((gcc_struct));
874 } __attribute__ ((gcc_struct));
875 } __attribute__ ((gcc_struct));
876 } __attribute__ ((gcc_struct));
880 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
883 typedef union YYSTYPE
888 struct Identifier * id;
889 struct Expression * exp;
890 struct Specifier * specifier;
891 struct __ecereNameSpace__ecere__sys__OldList * list;
892 struct Enumerator * enumerator;
893 struct Declarator * declarator;
894 struct Pointer * pointer;
895 struct Initializer * initializer;
896 struct InitDeclarator * initDeclarator;
897 struct TypeName * typeName;
898 struct Declaration * declaration;
899 struct Statement * stmt;
900 struct FunctionDefinition * function;
901 struct External * external;
902 struct Context * context;
903 struct AsmField * asmField;
904 struct Attrib * attrib;
905 struct ExtDecl * extDecl;
906 struct Attribute * attribute;
907 struct Instantiation * instance;
908 struct MembersInit * membersInit;
909 struct MemberInit * memberInit;
910 struct ClassFunction * classFunction;
911 struct ClassDefinition * _class;
912 struct ClassDef * classDef;
913 struct PropertyDef * prop;
915 struct Symbol * symbol;
916 struct PropertyWatch * propertyWatch;
917 struct TemplateParameter * templateParameter;
918 struct TemplateArgument * templateArgument;
919 struct TemplateDatatype * templateDatatype;
920 struct DBTableEntry * dbtableEntry;
921 struct DBIndexItem * dbindexItem;
922 struct DBTableDef * dbtableDef;
923 } __attribute__ ((gcc_struct)) YYSTYPE;
925 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
929 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
931 struct InitDeclarator;
933 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
937 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
941 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
945 struct ClassFunction * prev;
946 struct ClassFunction * next;
948 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
949 struct Declarator * declarator;
950 struct __ecereNameSpace__ecere__sys__OldList * declarations;
951 struct Statement * body;
952 struct __ecereNameSpace__ecere__com__Class * _class;
953 struct __ecereNameSpace__ecere__sys__OldList attached;
956 struct Symbol * propSet;
957 unsigned int isVirtual;
958 unsigned int isConstructor;
959 unsigned int isDestructor;
960 unsigned int dontMangle;
963 } __attribute__ ((gcc_struct));
965 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
969 struct MembersInit * prev;
970 struct MembersInit * next;
975 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
976 struct ClassFunction * function;
977 } __attribute__ ((gcc_struct));
978 } __attribute__ ((gcc_struct));
980 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
984 struct MemberInit * prev;
985 struct MemberInit * next;
987 struct Location realLoc;
988 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
989 struct Initializer * initializer;
991 unsigned int variable;
992 unsigned int takeOutExp;
993 } __attribute__ ((gcc_struct));
995 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
999 struct PropertyDef * prev;
1000 struct PropertyDef * next;
1001 struct Location loc;
1002 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1003 struct Declarator * declarator;
1004 struct Identifier * id;
1005 struct Statement * getStmt;
1006 struct Statement * setStmt;
1007 struct Statement * issetStmt;
1008 struct Symbol * symbol;
1009 unsigned int conversion;
1010 unsigned int isWatchable;
1011 struct Expression * category;
1012 } __attribute__ ((gcc_struct));
1014 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1016 struct PropertyWatch;
1018 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1022 struct ClassDef * prev;
1023 struct ClassDef * next;
1024 struct Location loc;
1028 struct Declaration * decl;
1029 struct ClassFunction * function;
1030 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1031 struct PropertyDef * propertyDef;
1032 struct PropertyWatch * propertyWatch;
1034 struct Identifier * defaultProperty;
1037 struct Identifier * id;
1038 struct Initializer * initializer;
1039 } __attribute__ ((gcc_struct));
1040 } __attribute__ ((gcc_struct));
1043 } __attribute__ ((gcc_struct));
1045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1047 struct DBTableEntry;
1049 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1053 extern YYSTYPE yylval;
1055 extern struct Location yylloc;
1057 extern struct External * curExternal;
1059 void MangleClassName(char * className)
1065 for(c = 0; (ch = className[c]); c++)
1104 output[d] = (char)0;
1107 extern char * strcat(char * , const char * );
1109 extern int strlen(const char * );
1111 void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams)
1117 for(c = 0; (ch = className[c]) && ch != '<'; c++)
1121 strcat(output, "__ecereNameSpace__");
1125 len = strlen(output);
1126 for(c = 0; (ch = className[c]); c++)
1129 output[len++] = '_';
1131 output[len++] = '_';
1134 output[len++] = '_';
1135 output[len++] = 'P';
1136 output[len++] = 'T';
1137 output[len++] = 'R';
1138 output[len++] = '_';
1142 output[len++] = '_';
1143 output[len++] = 'E';
1144 output[len++] = 'Q';
1145 output[len++] = 'U';
1146 output[len++] = '_';
1150 if(!includeTemplateParams)
1152 output[len++] = '_';
1153 output[len++] = 'T';
1154 output[len++] = 'P';
1155 output[len++] = 'L';
1156 output[len++] = '_';
1160 output[len++] = '_';
1164 output[len++] = '__';
1169 output[len++] = (char)0;
1172 extern int AddMembers(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass);
1174 static void AddSimpleBaseMembers(struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1176 if(_class->type != 1000)
1177 AddMembers(list, _class, 0x0, (((void *)0)), topClass);
1180 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
1182 struct __ecereNameSpace__ecere__com__NameSpace
1185 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1186 struct __ecereNameSpace__ecere__com__NameSpace * left;
1187 struct __ecereNameSpace__ecere__com__NameSpace * right;
1189 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1190 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1191 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1192 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1193 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1194 } __attribute__ ((gcc_struct));
1196 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1200 else if((*ns).parent)
1201 return NameSpaceContained((*ns).parent, parent);
1206 extern void Compiler_Error(char * format, ...);
1208 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
1210 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
1212 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1214 struct __ecereNameSpace__ecere__com__Module
1216 struct __ecereNameSpace__ecere__com__Instance * application;
1217 struct __ecereNameSpace__ecere__sys__OldList classes;
1218 struct __ecereNameSpace__ecere__sys__OldList defines;
1219 struct __ecereNameSpace__ecere__sys__OldList functions;
1220 struct __ecereNameSpace__ecere__sys__OldList modules;
1221 struct __ecereNameSpace__ecere__com__Instance * prev;
1222 struct __ecereNameSpace__ecere__com__Instance * next;
1228 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1229 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1230 } __attribute__ ((gcc_struct));
1232 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1234 struct __ecereNameSpace__ecere__com__Application
1239 unsigned int isGUIApp;
1240 struct __ecereNameSpace__ecere__sys__OldList allModules;
1241 char * parsedCommand;
1242 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1243 } __attribute__ ((gcc_struct));
1245 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
1247 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1249 static void CheckPublicClass(struct Symbol * classSym, int access, char * word)
1251 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->registered : (((void *)0));
1255 if(regClass->templateClass)
1256 regClass = regClass->templateClass;
1257 if(classSym->isStatic && access != 3)
1259 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Non-static %s making use of a static class\n", (((void *)0))), word);
1261 else if(access == 1)
1263 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + 12)))->application + 300)))->systemNameSpace))
1265 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + 12)))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1266 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Public %s making use of a private class\n", (((void *)0))), word);
1272 static void CheckPublicTypeName(struct TypeName * type, int access)
1274 if(type->qualifiers)
1276 struct Specifier * spec;
1278 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1282 struct Symbol * classSym = spec->symbol;
1284 CheckPublicClass(classSym, access, "define");
1290 static void CheckPublicExpression(struct Expression * exp, int access);
1292 static void CheckPublicInitializer(struct Initializer * init, int access)
1297 CheckPublicExpression(init->exp, access);
1301 struct Initializer * i;
1303 for(i = (*init->list).first; i; i = i->next)
1304 CheckPublicInitializer(i, access);
1310 static void CheckPublicExpression(struct Expression * exp, int access)
1324 CheckPublicExpression(exp->op.exp1, access);
1326 CheckPublicExpression(exp->op.exp2, access);
1330 struct Expression * e;
1332 for(e = (*exp->list).first; e; e = e->next)
1333 CheckPublicExpression(e, access);
1338 struct Expression * e;
1340 CheckPublicExpression(exp->index.exp, access);
1341 for(e = (*exp->index.index).first; e; e = e->next)
1342 CheckPublicExpression(e, access);
1347 struct Expression * e;
1349 CheckPublicExpression(exp->call.exp, access);
1350 if(exp->call.arguments)
1352 for(e = (*exp->call.arguments).first; e; e = e->next)
1353 CheckPublicExpression(e, access);
1359 CheckPublicExpression(exp->member.exp, access);
1364 CheckPublicExpression(exp->member.exp, access);
1368 CheckPublicTypeName(exp->typeName, access);
1372 struct Type * type = exp->expType;
1374 CheckPublicTypeName(exp->cast.typeName, access);
1376 CheckPublicExpression(exp->cast.exp, access);
1381 struct Expression * e;
1383 CheckPublicExpression(exp->cond.cond, access);
1384 for(e = (*exp->cond.exp).first; e; e = e->next)
1385 CheckPublicExpression(e, access);
1386 CheckPublicExpression(exp->cond.elseExp, access);
1391 CheckPublicExpression(exp->_new.size, access);
1395 CheckPublicExpression(exp->_renew.size, access);
1396 CheckPublicExpression(exp->_renew.exp, access);
1400 struct MembersInit * members;
1402 CheckPublicClass(exp->instance->_class->symbol, access, "define");
1403 for(members = (*exp->instance->members).first; members; members = members->next)
1405 if(members->type == 0)
1407 struct MemberInit * member;
1409 for(member = (*members->dataMembers).first; member; member = member->next)
1411 CheckPublicInitializer(member->initializer, access);
1421 static void CheckPublicDataType(struct Type * type, int access, char * word)
1429 CheckPublicClass(type->_class, access, word);
1439 struct Type * param;
1441 CheckPublicDataType(type->returnType, access, word);
1442 for(param = type->params.first; param; param = param->next)
1443 CheckPublicDataType(param, access, word);
1444 CheckPublicClass(type->thisClass, access, word);
1448 CheckPublicDataType(type->arrayType, access, word);
1450 CheckPublicClass(type->enumClass, access, word);
1454 CheckPublicDataType(type->type, access, word);
1463 CheckPublicClass(type->_class, access, word);
1470 extern struct Identifier * GetDeclId(struct Declarator * decl);
1472 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
1474 struct __ecereNameSpace__ecere__com__BTNamedLink
1477 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1478 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1479 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1482 } __attribute__ ((gcc_struct));
1484 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
1486 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1488 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1490 if(definitions != (((void *)0)))
1492 struct ClassDef * def;
1494 for(def = definitions->first; def; def = def->next)
1498 struct Declaration * decl = def->decl;
1499 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1504 struct Declarator * d;
1506 if(decl->declarators)
1508 for(d = (*decl->declarators).first; d; d = d->next)
1510 struct Identifier * declId = GetDeclId(d);
1516 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1518 dataMember = link ? link->data : (((void *)0));
1521 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1523 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString(__thisModule, "class data member", (((void *)0))));
1527 else if(decl->specifiers)
1529 struct Specifier * spec;
1531 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
1533 if(spec->type == 3 || spec->type == 4)
1535 if(spec->definitions && !spec->id)
1537 CheckMembersDefinitions(regClass, member, spec->definitions, (def->memberAccess == 2) ? 2 : access);
1539 else if(spec->definitions && spec->id)
1543 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->id->string);
1545 dataMember = link ? link->data : (((void *)0));
1548 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->id->string, privateModule, (((void *)0)), (((void *)0)));
1550 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString(__thisModule, "class data member", (((void *)0))));
1556 else if(decl->type == 2)
1558 CheckPublicClass(decl->inst->_class->symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString(__thisModule, "class member instance", (((void *)0))));
1565 extern unsigned int inCompiler;
1567 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1569 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
1571 extern struct Symbol * FindClass(char * name);
1573 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1575 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_AddProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, char * dataType, void * setStmt, void * getStmt, int declMode);
1577 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char * name, char * type, unsigned int size, unsigned int alignment, int declMode);
1579 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1581 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, char * name, char * type, void * function, int declMode);
1583 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
1585 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
1587 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
1589 extern struct Specifier * MkSpecifierName(char * name);
1591 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1593 extern struct Identifier * MkIdentifier(char * string);
1595 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
1597 extern struct Expression * QMkExpId(char * id);
1599 extern void FreeDeclarator(struct Declarator * decl);
1601 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
1603 extern void FreeSpecifier(struct Specifier * spec);
1605 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1607 extern struct Type * MkClassType(char * name);
1609 extern char * strcpy(char * , const char * );
1611 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
1613 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1615 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
1617 extern void FreeExternal(struct External * external);
1619 extern int declMode;
1621 extern char * strstr(char * , const char * );
1623 extern char * sourceFile;
1625 extern struct Specifier * MkSpecifier(int specifier);
1627 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1629 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1631 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1633 extern struct Context * PushContext(void);
1635 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1637 extern struct Expression * CopyExpression(struct Expression * exp);
1639 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
1641 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
1643 extern void PopContext(struct Context * ctx);
1645 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1647 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
1649 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1651 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1653 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
1655 extern struct Specifier * CopySpecifier(struct Specifier * spec);
1657 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1659 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
1661 extern struct Expression * MkExpIdentifier(struct Identifier * id);
1663 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
1665 extern void FreeInitializer(struct Initializer * initializer);
1667 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
1669 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1671 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
1673 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1675 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1677 extern int sprintf(char * , char * , ...);
1679 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1681 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
1683 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1685 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1687 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
1689 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
1691 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1693 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1695 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
1697 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)
1699 void * __ecereTemp1;
1700 char structName[1024];
1701 char className[1024];
1702 char constructorName[1024];
1703 char destructorName[1024];
1704 struct __ecereNameSpace__ecere__com__Class * regClass;
1705 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1706 unsigned int redefinition = 0x0;
1707 unsigned int isUnion = classType == 6;
1708 struct External * external = (((void *)0));
1709 struct ClassDef * def;
1710 struct __ecereNameSpace__ecere__sys__OldList * list;
1711 struct __ecereNameSpace__ecere__sys__OldList * classDataList;
1716 classDataList = MkList();
1718 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1721 classType = regClass->type;
1725 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + 12)))->privateNameSpace) && regClass->inheritanceAccess == 1)
1727 if(!regClass->base->symbol)
1728 regClass->base->symbol = FindClass(regClass->base->fullName);
1729 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString(__thisModule, "class", (((void *)0))));
1731 else if(!symbol->isStatic && regClass->base)
1733 if(!regClass->base->symbol)
1734 regClass->base->symbol = FindClass(regClass->base->fullName);
1735 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString(__thisModule, "class", (((void *)0))));
1738 if(definitions != (((void *)0)))
1740 for(def = definitions->first; def; def = def->next)
1744 struct __ecereNameSpace__ecere__com__DataMember * member;
1745 struct __ecereNameSpace__ecere__com__Property * prop;
1746 struct __ecereNameSpace__ecere__com__Method * method;
1748 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->id->string, privateModule)))
1750 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1752 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->id->string, privateModule, (((void *)0)), (((void *)0)))))
1754 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->id->string, (((void *)0)), 0, 0, def->memberAccess);
1756 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->id->string, privateModule)))
1758 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1763 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't find member %s to override\n", (((void *)0))), def->id->string);
1770 external = MkExternalDeclaration((((void *)0)));
1771 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1772 curExternal = external;
1773 curExternal->symbol = symbol;
1775 if((classType == 1 || classType == 5) && inCompiler)
1777 AddSimpleBaseMembers(list, regClass->base, regClass);
1779 if(definitions != (((void *)0)))
1783 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + 12)))->privateNameSpace))
1784 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1785 else if(!symbol->isStatic)
1786 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1788 for(def = definitions->first; def; def = def->next)
1792 struct Declaration * decl = def->decl;
1796 if(inCompiler && classType != 2)
1798 ListAdd(list, MkClassDefDeclaration(decl));
1799 def->decl = (((void *)0));
1802 else if(decl->type == 2)
1804 struct Instantiation * inst = decl->inst;
1805 struct Expression * exp = inst->exp;
1806 struct Symbol * classSym;
1810 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1811 struct Declarator * d;
1813 ListAdd(specifiers, MkSpecifierName(inst->_class->name));
1814 d = MkDeclaratorIdentifier(MkIdentifier(exp->identifier->string));
1817 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1819 ListAdd(declarators, d);
1820 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1821 ListAdd(list, MkClassDefDeclaration(decl));
1823 exp->member.member = exp->identifier;
1824 exp->member.exp = QMkExpId("this");
1825 exp->member.memberType = 3;
1826 exp->member.thisPtr = 0x1;
1831 FreeList(specifiers, FreeSpecifier);
1834 classSym = inst->_class->symbol;
1835 if(classSym && classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 2 || classSym->registered->type == 3))
1837 if(inst->members && (*inst->members).count)
1838 symbol->needConstructor = 0x1;
1842 symbol->needConstructor = 0x1;
1843 symbol->needDestructor = 0x1;
1847 else if(def->type == 9)
1849 struct Declaration * decl = def->decl;
1853 if(inCompiler && classType != 2)
1855 ListAdd(classDataList, MkClassDefDeclaration(decl));
1856 def->decl = (((void *)0));
1860 else if(def->type == 1)
1861 symbol->needConstructor = 0x1;
1862 else if(def->type == 4)
1863 symbol->needConstructor = 0x1;
1864 else if(def->type == 0)
1866 struct ClassFunction * func = def->function;
1868 if(func->isDestructor)
1873 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1877 symbol->needDestructor = 0x1;
1879 if(!inCompiler && func->body)
1881 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1883 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1887 if(func->isConstructor)
1892 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1896 symbol->needConstructor = 0x1;
1898 if(!inCompiler && func->body)
1900 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1902 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1911 external->symbol = (((void *)0));
1914 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1916 initDeclarators = (((void *)0));
1917 strcpy(structName, symbol->string);
1918 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1920 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1922 spec->extDeclStruct = extDecl;
1923 ListAdd(specs, spec);
1925 external->symbol = symbol;
1926 symbol->structExternal = external;
1927 external->declaration = MkDeclaration(specs, declarators);
1929 symbol->declaredStruct = 0x1;
1933 curExternal = external->prev;
1934 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1935 FreeExternal(external);
1936 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1938 if((*classDataList).count)
1940 char classDataStructName[1024];
1941 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1942 struct External * external;
1944 strcpy(classDataStructName, "__ecereClassData_");
1945 FullClassNameCat(classDataStructName, symbol->string, 0x0);
1947 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
1948 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
1949 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1951 symbol->classData = 0x1;
1954 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
1959 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
1961 strcpy(className, "__ecereClass_");
1962 FullClassNameCat(className, symbol->string, 0x1);
1963 MangleClassName(className);
1964 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
1965 if(!strstr(sourceFile, ".main.ec"))
1966 ListAdd(specs, MkSpecifier(STATIC));
1967 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
1968 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
1969 symbol->methodExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
1970 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->methodExternal);
1971 after = symbol->methodExternal;
1973 if(symbol->needDestructor)
1975 struct ClassFunction * function;
1976 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1977 struct Declarator * decl;
1978 struct Statement * body;
1979 struct Context * context;
1980 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
1982 strcpy(destructorName, "__ecereDestructor_");
1983 FullClassNameCat(destructorName, symbol->string, 0x0);
1984 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
1985 ListAdd(specs, MkSpecifier(VOID));
1986 context = PushContext();
1987 statements = MkList();
1988 if(definitions != (((void *)0)))
1990 for(def = definitions->first; def; def = def->next)
1992 if(def->type == 2 && def->decl && def->decl->type == 2)
1994 struct Instantiation * inst = def->decl->inst;
1995 struct Symbol * classSym = inst->_class->symbol;
1997 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0))
1999 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2001 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2003 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 5))
2005 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2007 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2012 if(destructor && destructor->body)
2014 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2015 destructor->body->compound.context->parent = context;
2016 destructor->body = (((void *)0));
2018 body = MkCompoundStmt(declarations, statements);
2019 PopContext(context);
2020 body->compound.context = context;
2021 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2022 decl->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = symbol->id, ((struct Symbol *)__ecereTemp1)->idCode = symbol->idCode, ((struct Symbol *)__ecereTemp1));
2023 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2024 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2025 ProcessClassFunctionBody(function, body);
2026 function->id = symbol->id;
2027 function->idCode = symbol->idCode;
2028 function->dontMangle = 0x1;
2029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2031 if(symbol->needConstructor && inCompiler)
2033 struct ClassFunction * function;
2034 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2035 struct Declarator * decl;
2036 struct Statement * body;
2037 struct Context * context;
2038 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2040 strcpy(constructorName, "__ecereConstructor_");
2041 FullClassNameCat(constructorName, symbol->string, 0x0);
2042 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2043 ListAdd(specs, MkSpecifierName("bool"));
2044 context = PushContext();
2045 statements = MkList();
2046 if(definitions != (((void *)0)))
2048 for(def = definitions->first; def; def = def->next)
2050 if(def->type == 2 && def->decl && def->decl->type == 2)
2052 struct Instantiation * inst = def->decl->inst;
2053 struct Symbol * classSym = inst->_class->symbol;
2055 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5))
2057 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2060 newInst->members = (((void *)0));
2061 newInst->exp = CopyExpression(inst->exp);
2062 newInst->_class = CopySpecifier(inst->_class);
2063 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2066 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0))
2068 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2072 for(def = definitions->first; def; def = def->next)
2074 if(def->type == 1 && def->defProperties)
2076 struct MemberInit * propertyDef;
2078 for(propertyDef = (*def->defProperties).first; propertyDef; propertyDef = propertyDef->next)
2080 struct Expression * memberExp;
2081 struct Identifier * id = (*propertyDef->identifiers).first;
2085 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2086 for(id = id->next; id; id = id->next)
2087 memberExp = MkExpMember(memberExp, id);
2088 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->exp : (((void *)0)))))));
2090 if(propertyDef->initializer)
2092 if(propertyDef->initializer->type == 0)
2093 propertyDef->initializer->exp = (((void *)0));
2094 FreeInitializer(propertyDef->initializer);
2096 propertyDef->initializer = (((void *)0));
2097 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2101 for(def = definitions->first; def; def = def->next)
2103 if(def->type == 2 && def->decl && def->decl->type == 2)
2105 struct Instantiation * inst = def->decl->inst;
2106 struct Symbol * classSym = inst->_class->symbol;
2108 if(inst->exp || (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5))
2110 if(!(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5)) || (inst->members && (*inst->members).count))
2112 def->decl->inst = (((void *)0));
2113 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2119 if(constructor && constructor->body)
2121 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2122 constructor->body->compound.context->parent = context;
2123 constructor->body = (((void *)0));
2125 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2126 body = MkCompoundStmt(declarations, statements);
2127 PopContext(context);
2128 body->compound.context = context;
2129 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2130 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2131 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2132 decl->symbol->id = symbol->id;
2133 decl->symbol->idCode = symbol->idCode;
2134 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2135 ProcessClassFunctionBody(function, body);
2136 function->id = symbol->id;
2137 function->idCode = symbol->idCode;
2138 function->dontMangle = 0x1;
2139 if(definitions != (((void *)0)))
2140 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2143 if(definitions != (((void *)0)))
2145 for(def = definitions->first; def; def = def->next)
2147 if(def->type == 3 && def->propertyDef)
2149 struct PropertyDef * propertyDef = def->propertyDef;
2150 struct ClassDef * after = def;
2151 struct ClassDef * newDef;
2155 yylloc = propertyDef->loc;
2156 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + 12)))->privateNameSpace) && def->memberAccess == 1)
2157 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2158 else if(!symbol->isStatic)
2159 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2163 struct ClassFunction * func;
2164 struct Declarator * decl;
2166 struct __ecereNameSpace__ecere__sys__OldList * params;
2168 if(propertyDef->getStmt && propertyDef->id)
2170 strcpy(name, "__ecereProp_");
2171 FullClassNameCat(name, symbol->string, 0x0);
2172 strcat(name, "_Get_");
2173 FullClassNameCat(name, propertyDef->id->string, 0x1);
2174 MangleClassName(name);
2176 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->_class && propertyDef->symbol->type->_class->registered && propertyDef->symbol->type->_class->registered->type == 1)
2178 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), MkDeclaratorIdentifier(MkIdentifier("value"))));
2179 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2180 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2184 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2185 func = MkClassFunction(CopyList(propertyDef->specifiers, CopySpecifier), (((void *)0)), decl, (((void *)0)));
2187 ProcessClassFunctionBody(func, propertyDef->getStmt);
2188 func->declarator->symbol = propertyDef->symbol;
2189 propertyDef->symbol->externalGet = (struct External *)func;
2190 func->dontMangle = 0x1;
2191 newDef = MkClassDefFunction(func);
2192 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2195 propertyDef->getStmt = (((void *)0));
2197 func->body = (((void *)0));
2199 if(propertyDef->setStmt && propertyDef->id)
2201 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2203 strcpy(name, "__ecereProp_");
2204 FullClassNameCat(name, symbol->string, 0x0);
2205 strcat(name, "_Set_");
2206 FullClassNameCat(name, propertyDef->id->string, 0x1);
2207 MangleClassName(name);
2209 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2210 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2211 if(!propertyDef->symbol->_property || !propertyDef->symbol->_property->conversion)
2212 ListAdd(specifiers, MkSpecifier(VOID));
2215 if(regClass->type == 1)
2216 ListAdd(specifiers, MkSpecifier(VOID));
2218 ListAdd(specifiers, MkSpecifierName(regClass->fullName));
2220 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2221 ProcessClassFunctionBody(func, propertyDef->setStmt);
2222 func->dontMangle = 0x1;
2223 func->declarator->symbol = propertyDef->symbol;
2224 propertyDef->symbol->externalSet = (struct External *)func;
2225 if(!propertyDef->conversion && regClass->type == 0)
2226 func->propSet = propertyDef->symbol;
2227 newDef = MkClassDefFunction(func);
2228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2231 propertyDef->setStmt = (((void *)0));
2233 func->body = (((void *)0));
2235 if(propertyDef->issetStmt && propertyDef->id)
2237 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2239 strcpy(name, "__ecereProp_");
2240 FullClassNameCat(name, symbol->string, 0x0);
2241 strcat(name, "_IsSet_");
2242 FullClassNameCat(name, propertyDef->id->string, 0x1);
2243 MangleClassName(name);
2245 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2246 ListAdd(specifiers, MkSpecifierName("bool"));
2247 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2248 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2249 func->dontMangle = 0x1;
2250 func->declarator->symbol = propertyDef->symbol;
2251 propertyDef->symbol->externalIsSet = (struct External *)func;
2252 newDef = MkClassDefFunction(func);
2253 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2256 propertyDef->issetStmt = (((void *)0));
2258 func->body = (((void *)0));
2260 if(propertyDef->id && inCompiler)
2262 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->registered, propertyDef->id->string, privateModule);
2263 struct Declaration * decl;
2264 struct External * external;
2265 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2267 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2268 ListAdd(specifiers, MkSpecifierName("Property"));
2269 strcpy(name, "__ecereProp_");
2270 FullClassNameCat(name, symbol->string, 0x0);
2272 FullClassNameCat(name, propertyDef->id->string, 0x1);
2273 MangleClassName(name);
2275 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2277 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2278 strcpy(name, "__ecerePropM_");
2279 FullClassNameCat(name, symbol->string, 0x0);
2281 FullClassNameCat(name, propertyDef->id->string, 0x1);
2282 MangleClassName(name);
2283 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2284 decl = MkDeclaration(specifiers, list);
2286 external = MkExternalDeclaration(decl);
2287 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2288 external->symbol = propertyDef->symbol;
2289 propertyDef->symbol->externalPtr = external;
2290 if(inCompiler && prop && prop->symbol)
2291 ((struct Symbol *)prop->symbol)->externalPtr = external;
2296 else if(def->type == 10 && def->propertyDef)
2298 struct PropertyDef * propertyDef = def->propertyDef;
2299 struct ClassDef * after = def;
2300 struct ClassDef * newDef;
2305 yylloc = propertyDef->loc;
2306 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + 12)))->privateNameSpace))
2307 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2308 else if(!symbol->isStatic)
2309 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2312 struct ClassFunction * func;
2313 struct Declarator * decl;
2315 struct __ecereNameSpace__ecere__sys__OldList * params;
2317 if(propertyDef->getStmt && propertyDef->id)
2319 struct Declarator * declId;
2321 sprintf(name, "class::__ecereClassProp_");
2322 FullClassNameCat(name, symbol->string, 0x0);
2323 strcat(name, "_Get_");
2324 strcat(name, propertyDef->id->string);
2325 MangleClassName(name);
2327 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2328 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->_class && propertyDef->symbol->type->_class->registered && propertyDef->symbol->type->_class->registered->type == 1)
2330 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), MkDeclaratorIdentifier(MkIdentifier("value"))));
2331 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(declId, params));
2332 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2336 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(declId, params));
2337 func = MkClassFunction(CopyList(propertyDef->specifiers, CopySpecifier), (((void *)0)), decl, (((void *)0)));
2339 ProcessClassFunctionBody(func, propertyDef->getStmt);
2340 func->declarator->symbol = propertyDef->symbol;
2341 propertyDef->symbol->externalGet = (struct External *)func;
2342 func->dontMangle = 0x1;
2343 newDef = MkClassDefFunction(func);
2344 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2347 propertyDef->getStmt = (((void *)0));
2349 func->body = (((void *)0));
2351 if(propertyDef->setStmt && propertyDef->id)
2353 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2355 strcpy(name, "class::__ecereClassProp_");
2356 FullClassNameCat(name, symbol->string, 0x0);
2357 strcat(name, "_Set_");
2358 strcat(name, propertyDef->id->string);
2359 MangleClassName(name);
2361 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2362 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2363 ListAdd(specifiers, MkSpecifier(VOID));
2364 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2365 ProcessClassFunctionBody(func, propertyDef->setStmt);
2366 func->dontMangle = 0x1;
2367 func->declarator->symbol = propertyDef->symbol;
2368 propertyDef->symbol->externalSet = (struct External *)func;
2369 newDef = MkClassDefFunction(func);
2370 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2373 propertyDef->setStmt = (((void *)0));
2375 func->body = (((void *)0));
2380 else if(def->type == 0 && def->function->declarator)
2382 struct ClassFunction * func = def->function;
2384 func->_class = regClass;
2385 if(!func->dontMangle)
2387 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2388 struct Identifier * id = GetDeclId(funcDecl);
2389 struct __ecereNameSpace__ecere__com__Method * method;
2391 if(!funcDecl->function.parameters || !(*funcDecl->function.parameters).first)
2393 if(!funcDecl->function.parameters)
2394 funcDecl->function.parameters = MkList();
2395 ListAdd(funcDecl->function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2397 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2398 FreeSpecifier(id->_class);
2399 id->_class = (((void *)0));
2400 if(inCompiler && method)
2402 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2405 ProcessMethodType(method);
2407 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + 12)))->privateNameSpace) && method->memberAccess == 1)
2408 CheckPublicDataType(method->dataType, 1, "class method");
2409 strcpy(newId, "__ecereMethod_");
2410 FullClassNameCat(newId, symbol->string, 0x0);
2412 strcat(newId, id->string);
2413 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2415 if(method->type != 1)
2419 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2420 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2428 if(initDeclarators != (((void *)0)))
2429 FreeList(initDeclarators, FreeInitDeclarator);
2432 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
2434 void PreProcessClassDefinitions()
2436 struct External * external, * next;
2438 curExternal = (((void *)0));
2441 for(external = (*ast).first; external; external = next)
2443 next = external->next;
2444 curExternal = external;
2445 if(external->type == 2)
2447 struct ClassDefinition * _class = external->_class;
2449 if(_class->definitions)
2451 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2454 else if(external->type == 1)
2456 struct Declaration * declaration = external->declaration;
2458 if(declaration->type == 1)
2460 if(declaration->specifiers)
2462 struct Specifier * specifier;
2464 for(specifier = (*declaration->specifiers).first; specifier; specifier = specifier->next)
2466 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->id && specifier->id->string && (declaration->declMode || specifier->baseSpecs || (specifier->type == 2 && specifier->definitions)))
2468 struct Symbol * symbol = FindClass(specifier->id->string);
2472 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2473 struct ExtDecl * extDecl = specifier->extDeclStruct;
2475 specifier->extDeclStruct = (((void *)0));
2478 initDeclarators = declaration->declarators;
2479 declaration->declarators = (((void *)0));
2481 ProcessClass((specifier->type == 4) ? 6 : 0, specifier->definitions, symbol, specifier->baseSpecs, specifier->list, &specifier->loc, ast, external->prev, initDeclarators, extDecl);
2487 else if(inCompiler && declaration->type == 3)
2489 yylloc = declaration->loc;
2490 if(declaration->declMode == 1)
2491 CheckPublicExpression(declaration->exp, 1);
2492 else if(declaration->declMode != 3)
2493 CheckPublicExpression(declaration->exp, 2);
2496 else if(external->type == 3)
2499 else if(inCompiler && external->type == 0)
2501 yylloc = external->function->loc;
2502 if(!external->function->type)
2503 external->function->type = ProcessType(external->function->specifiers, external->function->declarator);
2504 if(external->function->declMode == 1)
2505 CheckPublicDataType(external->function->type, 1, "function");
2506 else if(external->function->declMode != 3)
2507 CheckPublicDataType(external->function->type, 2, "function");
2513 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
2515 struct __ecereNameSpace__ecere__com__GlobalFunction;
2517 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(char * name, char * type, void * func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
2519 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2521 struct __ecereNameSpace__ecere__com__Class * class;
2523 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MangleClassName", "void MangleClassName(char * className)", MangleClassName, module, 1);
2524 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2525 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);
2528 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)