1 /* Code generated from eC source file: dbpass.ec */
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
7 #define __runtimePlatform 2
10 typedef long long int64;
11 typedef unsigned long long uint64;
15 #elif defined(__TINYC__)
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
27 typedef long long int64;
28 typedef unsigned long long uint64;
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
34 #define __ENDIAN_PAD(x) (8 - (x))
36 #define __ENDIAN_PAD(x) 0
39 # if defined(__GNUC__) || defined(__TINYC__)
40 # define ecere_stdcall __attribute__((__stdcall__))
41 # define ecere_gcc_struct __attribute__((gcc_struct))
43 # define ecere_stdcall __stdcall
44 # define ecere_gcc_struct
47 # define ecere_stdcall
48 # define ecere_gcc_struct
51 #include <sys/types.h>
54 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, INT128 = 294, LONG = 295, SIGNED = 296, UNSIGNED = 297, FLOAT = 298, DOUBLE = 299, CONST = 300, VOLATILE = 301, VOID = 302, VALIST = 303, STRUCT = 304, UNION = 305, ENUM = 306, ELLIPSIS = 307, CASE = 308, DEFAULT = 309, IF = 310, SWITCH = 311, WHILE = 312, DO = 313, FOR = 314, GOTO = 315, CONTINUE = 316, BREAK = 317, RETURN = 318, IFX = 319, ELSE = 320, CLASS = 321, THISCLASS = 322, CLASS_NAME = 323, PROPERTY = 324, SETPROP = 325, GETPROP = 326, NEWOP = 327, RENEW = 328, DELETE = 329, EXT_DECL = 330, EXT_STORAGE = 331, IMPORT = 332, DEFINE = 333, VIRTUAL = 334, ATTRIB = 335, PUBLIC = 336, PRIVATE = 337, TYPED_OBJECT = 338, ANY_OBJECT = 339, _INCREF = 340, EXTENSION = 341, ASM = 342, TYPEOF = 343, WATCH = 344, STOPWATCHING = 345, FIREWATCHERS = 346, WATCHABLE = 347, CLASS_DESIGNER = 348, CLASS_NO_EXPANSION = 349, CLASS_FIXED = 350, ISPROPSET = 351, CLASS_DEFAULT_PROPERTY = 352, PROPERTY_CATEGORY = 353, CLASS_DATA = 354, CLASS_PROPERTY = 355, SUBCLASS = 356, NAMESPACE = 357, NEW0OP = 358, RENEW0 = 359, VAARG = 360, DBTABLE = 361, DBFIELD = 362, DBINDEX = 363, DATABASE_OPEN = 364, ALIGNOF = 365, ATTRIB_DEP = 366, __ATTRIB = 367, BOOL = 368, _BOOL = 369, _COMPLEX = 370, _IMAGINARY = 371, RESTRICT = 372, THREAD = 373, WIDE_STRING_LITERAL = 374, BUILTIN_OFFSETOF = 375
57 static int numIndexes;
59 extern unsigned int inCompiler;
61 struct __ecereNameSpace__ecere__sys__OldList
70 struct __ecereNameSpace__ecere__sys__BTNode;
72 struct __ecereNameSpace__ecere__com__DataValue
87 } ecere_gcc_struct __anon1;
90 struct __ecereNameSpace__ecere__com__SerialBuffer
92 unsigned char * _buffer;
98 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
100 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
102 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
104 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
106 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
122 struct TemplateParameter;
124 struct TemplateArgument;
126 struct TemplateDatatype;
136 extern size_t strlen(const char * );
138 extern void * memcpy(void * , const void * , size_t size);
140 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
142 extern int sprintf(char * , const char * , ...);
144 extern void Compiler_Error(const char * format, ...);
146 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
148 struct __ecereNameSpace__ecere__com__LinkList
155 extern int strcmp(const char * , const char * );
157 extern char * strcpy(char * , const char * );
163 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
165 extern void PrePreProcessClassDefinitions(void);
167 struct __ecereNameSpace__ecere__com__GlobalFunction;
169 static struct __ecereNameSpace__ecere__sys__OldList * tableStatements, * indexStatements, * addFieldStatements;
171 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
173 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
175 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
177 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
179 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
181 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
183 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
187 struct CodePosition start;
188 struct CodePosition end;
191 extern struct Location yylloc;
195 static struct External * addAfter;
197 extern struct External * curExternal;
201 static void ProcessIdentifier(struct Identifier * id)
205 extern struct Identifier * MkIdentifier(const char * string);
207 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
209 extern struct Identifier * CopyIdentifier(struct Identifier * id);
213 extern struct Context * curContext;
215 extern struct Context * PushContext(void);
217 extern void PopContext(struct Context * ctx);
219 extern struct Context * globalContext;
221 struct __ecereNameSpace__ecere__com__Class;
223 struct __ecereNameSpace__ecere__com__Instance
226 struct __ecereNameSpace__ecere__com__Class * _class;
230 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
232 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
234 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
236 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
238 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
240 struct __ecereNameSpace__ecere__com__Property;
242 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
244 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);
246 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
248 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
252 extern void FreeExpContents(struct Expression * exp);
254 extern struct Expression * MkExpIdentifier(struct Identifier * id);
256 extern struct Expression * MkExpConstant(const char * string);
258 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
260 extern struct Expression * CopyExpression(struct Expression * exp);
262 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
264 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
266 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
268 extern struct Expression * MkExpString(const char * string);
270 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
272 extern struct Expression * MkExpIndex(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * index);
274 extern struct Expression * MkExpDBTable(char * table);
276 extern struct Expression * MkExpDBField(char * table, struct Identifier * id);
280 extern struct Specifier * MkSpecifierName(const char * name);
282 extern struct Specifier * MkSpecifier(int specifier);
284 extern struct Specifier * CopySpecifier(struct Specifier * spec);
288 struct Instantiation;
290 extern struct Expression * MkExpInstance(struct Instantiation * inst);
292 extern struct Instantiation * MkInstantiation(struct Specifier * _class, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
296 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
298 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
300 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
302 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
304 extern struct PropertyDef * MkProperty(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl, struct Identifier * id, struct Statement * setStmt, struct Statement * getStmt);
310 struct Statement * prev;
311 struct Statement * next;
316 struct __ecereNameSpace__ecere__sys__OldList * expressions;
319 struct Identifier * id;
320 struct Statement * stmt;
321 } ecere_gcc_struct labeled;
324 struct Expression * exp;
325 struct Statement * stmt;
326 } ecere_gcc_struct caseStmt;
329 struct __ecereNameSpace__ecere__sys__OldList * declarations;
330 struct __ecereNameSpace__ecere__sys__OldList * statements;
331 struct Context * context;
332 unsigned int isSwitch;
333 } ecere_gcc_struct compound;
336 struct __ecereNameSpace__ecere__sys__OldList * exp;
337 struct Statement * stmt;
338 struct Statement * elseStmt;
339 } ecere_gcc_struct ifStmt;
342 struct __ecereNameSpace__ecere__sys__OldList * exp;
343 struct Statement * stmt;
344 } ecere_gcc_struct switchStmt;
347 struct __ecereNameSpace__ecere__sys__OldList * exp;
348 struct Statement * stmt;
349 } ecere_gcc_struct whileStmt;
352 struct __ecereNameSpace__ecere__sys__OldList * exp;
353 struct Statement * stmt;
354 } ecere_gcc_struct doWhile;
357 struct Statement * init;
358 struct Statement * check;
359 struct __ecereNameSpace__ecere__sys__OldList * increment;
360 struct Statement * stmt;
361 } ecere_gcc_struct forStmt;
364 struct Identifier * id;
365 } ecere_gcc_struct gotoStmt;
368 struct Specifier * spec;
370 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
371 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
372 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
373 } ecere_gcc_struct asmStmt;
376 struct Expression * watcher;
377 struct Expression * object;
378 struct __ecereNameSpace__ecere__sys__OldList * watches;
379 } ecere_gcc_struct _watch;
382 struct Identifier * id;
383 struct __ecereNameSpace__ecere__sys__OldList * exp;
384 struct __ecereNameSpace__ecere__sys__OldList * filter;
385 struct Statement * stmt;
386 } ecere_gcc_struct forEachStmt;
387 struct Declaration * decl;
388 } ecere_gcc_struct __anon1;
391 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
393 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
395 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
399 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
401 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
405 struct Initializer * prev;
406 struct Initializer * next;
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * list;
413 } ecere_gcc_struct __anon1;
414 unsigned int isConstant;
415 struct Identifier * id;
422 struct Specifier * prev;
423 struct Specifier * next;
431 struct ExtDecl * extDecl;
433 struct Symbol * symbol;
434 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
435 struct Specifier * nsSpec;
436 } ecere_gcc_struct __anon1;
439 struct Identifier * id;
440 struct __ecereNameSpace__ecere__sys__OldList * list;
441 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
442 struct __ecereNameSpace__ecere__sys__OldList * definitions;
443 unsigned int addNameSpace;
444 struct Context * ctx;
445 struct ExtDecl * extDeclStruct;
446 } ecere_gcc_struct __anon2;
447 struct Expression * expression;
448 struct Specifier * _class;
449 struct TemplateParameter * templateParameter;
450 } ecere_gcc_struct __anon1;
455 struct Identifier * prev;
456 struct Identifier * next;
458 struct Symbol * classSym;
459 struct Specifier * _class;
461 struct Identifier * badID;
466 struct Declaration * prev;
467 struct Declaration * next;
474 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
475 struct __ecereNameSpace__ecere__sys__OldList * declarators;
476 } ecere_gcc_struct __anon1;
477 struct Instantiation * inst;
480 struct Identifier * id;
481 struct Expression * exp;
482 } ecere_gcc_struct __anon2;
483 } ecere_gcc_struct __anon1;
484 struct Specifier * extStorage;
485 struct Symbol * symbol;
491 struct Instantiation * prev;
492 struct Instantiation * next;
494 struct Specifier * _class;
495 struct Expression * exp;
496 struct __ecereNameSpace__ecere__sys__OldList * members;
497 struct Symbol * symbol;
498 unsigned int fullSet;
499 unsigned int isConstant;
500 unsigned char * data;
501 struct Location nameLoc;
502 struct Location insideLoc;
508 struct PropertyDef * prev;
509 struct PropertyDef * next;
511 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
512 struct Declarator * declarator;
513 struct Identifier * id;
514 struct Statement * getStmt;
515 struct Statement * setStmt;
516 struct Statement * issetStmt;
517 struct Symbol * symbol;
518 struct Expression * category;
521 unsigned int conversion : 1;
522 unsigned int isWatchable : 1;
523 unsigned int isDBProp : 1;
524 } ecere_gcc_struct __anon1;
530 struct Symbol * symbol;
531 struct __ecereNameSpace__ecere__sys__OldList * definitions;
535 extern struct Symbol * DeclClass(struct Specifier * _class, const char * name);
539 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
543 extern struct ClassDef * MkClassDefDefaultProperty(struct __ecereNameSpace__ecere__sys__OldList * defProperties);
545 extern struct ClassDef * MkClassDefProperty(struct PropertyDef * propertyDef);
547 extern struct ClassDef * MkClassDefClassPropertyValue(struct Identifier * id, struct Initializer * initializer);
549 struct __ecereNameSpace__ecere__sys__BinaryTree;
551 struct __ecereNameSpace__ecere__sys__BinaryTree
553 struct __ecereNameSpace__ecere__sys__BTNode * root;
555 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
556 void (* FreeKey)(void * key);
559 struct ClassDefinition;
561 struct ClassDefinition
563 struct ClassDefinition * prev;
564 struct ClassDefinition * next;
566 struct Specifier * _class;
567 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
568 struct __ecereNameSpace__ecere__sys__OldList * definitions;
569 struct Symbol * symbol;
570 struct Location blockStart;
571 struct Location nameLoc;
573 unsigned int deleteWatchable;
576 extern struct ClassDefinition * MkClass(struct Symbol * symbol, struct __ecereNameSpace__ecere__sys__OldList * baseSpecs, struct __ecereNameSpace__ecere__sys__OldList * definitions);
578 extern struct External * MkExternalClass(struct ClassDefinition * _class);
582 struct Context * parent;
583 struct __ecereNameSpace__ecere__sys__BinaryTree types;
584 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
585 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
586 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
589 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
590 struct ClassDefinition * classDef;
591 unsigned int templateTypesOnly;
592 unsigned int hasNameSpace;
601 struct DBIndexItem * prev;
602 struct DBIndexItem * next;
603 struct Identifier * id;
607 struct __ecereNameSpace__ecere__com__Method;
609 struct __ecereNameSpace__ecere__com__Module;
611 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);
615 struct __ecereNameSpace__ecere__com__Property
617 struct __ecereNameSpace__ecere__com__Property * prev;
618 struct __ecereNameSpace__ecere__com__Property * next;
620 unsigned int isProperty;
623 struct __ecereNameSpace__ecere__com__Class * _class;
624 const char * dataTypeString;
625 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
626 struct Type * dataType;
627 void (* Set)(void * , int);
628 int (* Get)(void * );
629 unsigned int (* IsSet)(void * );
633 unsigned int conversion;
634 unsigned int watcherOffset;
635 const char * category;
636 unsigned int compiled;
637 unsigned int selfWatchable;
638 unsigned int isWatchable;
641 struct __ecereNameSpace__ecere__com__Method
644 struct __ecereNameSpace__ecere__com__Method * parent;
645 struct __ecereNameSpace__ecere__com__Method * left;
646 struct __ecereNameSpace__ecere__com__Method * right;
651 struct __ecereNameSpace__ecere__com__Class * _class;
653 const char * dataTypeString;
654 struct Type * dataType;
661 struct Symbol * parent;
662 struct Symbol * left;
663 struct Symbol * right;
668 struct __ecereNameSpace__ecere__com__Method * method;
669 struct __ecereNameSpace__ecere__com__Property * _property;
670 struct __ecereNameSpace__ecere__com__Class * registered;
671 } ecere_gcc_struct __anon1;
672 unsigned int notYetDeclared;
677 struct External * pointerExternal;
678 struct External * structExternal;
679 } ecere_gcc_struct __anon1;
682 struct External * externalGet;
683 struct External * externalSet;
684 struct External * externalPtr;
685 struct External * externalIsSet;
686 } ecere_gcc_struct __anon2;
689 struct External * methodExternal;
690 struct External * methodCodeExternal;
691 } ecere_gcc_struct __anon3;
692 } ecere_gcc_struct __anon2;
693 unsigned int imported;
694 unsigned int declaredStructSym;
695 struct __ecereNameSpace__ecere__com__Class * _class;
696 unsigned int declaredStruct;
697 unsigned int needConstructor;
698 unsigned int needDestructor;
699 char * constructorName;
702 char * destructorName;
703 struct ModuleImport * module;
704 struct ClassImport * _import;
705 struct Location nameLoc;
706 unsigned int isParam;
707 unsigned int isRemote;
708 unsigned int isStruct;
709 unsigned int fireWatchersDone;
711 unsigned int classData;
712 unsigned int isStatic;
714 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
715 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
716 struct Context * ctx;
718 struct Expression * propCategory;
719 unsigned int mustRegister;
729 struct Symbol * _class;
732 struct __ecereNameSpace__ecere__sys__OldList members;
734 } ecere_gcc_struct __anon1;
737 struct Type * returnType;
738 struct __ecereNameSpace__ecere__sys__OldList params;
739 struct Symbol * thisClass;
740 unsigned int staticMethod;
741 struct TemplateParameter * thisClassTemplate;
742 } ecere_gcc_struct __anon2;
745 struct __ecereNameSpace__ecere__com__Method * method;
746 struct __ecereNameSpace__ecere__com__Class * methodClass;
747 struct __ecereNameSpace__ecere__com__Class * usedClass;
748 } ecere_gcc_struct __anon3;
751 struct Type * arrayType;
753 struct Expression * arraySizeExp;
754 unsigned int freeExp;
755 struct Symbol * enumClass;
756 } ecere_gcc_struct __anon4;
758 struct TemplateParameter * templateParameter;
759 } ecere_gcc_struct __anon1;
764 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
772 unsigned int isSigned : 1;
773 unsigned int constant : 1;
774 unsigned int truth : 1;
775 unsigned int byReference : 1;
776 unsigned int extraParam : 1;
777 unsigned int directClassAccess : 1;
778 unsigned int computing : 1;
779 unsigned int keepCast : 1;
780 unsigned int passAsTemplate : 1;
781 unsigned int dllExport : 1;
782 unsigned int attrStdcall : 1;
783 unsigned int declaredWithStruct : 1;
784 unsigned int typedByReference : 1;
785 unsigned int casted : 1;
786 unsigned int pointerAlignment : 1;
787 unsigned int isLong : 1;
788 unsigned int signedBeforePromotion : 1;
789 unsigned int isVector : 1;
796 struct Expression * prev;
797 struct Expression * next;
805 struct Identifier * identifier;
806 } ecere_gcc_struct __anon1;
807 struct Statement * compound;
808 struct Instantiation * instance;
812 unsigned int intlString;
813 unsigned int wideString;
814 } ecere_gcc_struct __anon2;
815 struct __ecereNameSpace__ecere__sys__OldList * list;
818 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
819 struct Declarator * decl;
820 } ecere_gcc_struct _classExp;
823 struct Identifier * id;
824 } ecere_gcc_struct classData;
827 struct Expression * exp;
828 struct __ecereNameSpace__ecere__sys__OldList * arguments;
829 struct Location argLoc;
830 } ecere_gcc_struct call;
833 struct Expression * exp;
834 struct __ecereNameSpace__ecere__sys__OldList * index;
835 } ecere_gcc_struct index;
838 struct Expression * exp;
839 struct Identifier * member;
841 unsigned int thisPtr;
842 } ecere_gcc_struct member;
846 struct Expression * exp1;
847 struct Expression * exp2;
848 } ecere_gcc_struct op;
849 struct TypeName * typeName;
850 struct Specifier * _class;
853 struct TypeName * typeName;
854 struct Expression * exp;
855 } ecere_gcc_struct cast;
858 struct Expression * cond;
859 struct __ecereNameSpace__ecere__sys__OldList * exp;
860 struct Expression * elseExp;
861 } ecere_gcc_struct cond;
864 struct TypeName * typeName;
865 struct Expression * size;
866 } ecere_gcc_struct _new;
869 struct TypeName * typeName;
870 struct Expression * size;
871 struct Expression * exp;
872 } ecere_gcc_struct _renew;
876 struct Identifier * id;
877 } ecere_gcc_struct db;
880 struct Expression * ds;
881 struct Expression * name;
882 } ecere_gcc_struct dbopen;
885 struct TypeName * typeName;
886 struct Initializer * initializer;
887 } ecere_gcc_struct initializer;
890 struct Expression * exp;
891 struct TypeName * typeName;
892 } ecere_gcc_struct vaArg;
895 struct TypeName * typeName;
896 struct Identifier * id;
897 } ecere_gcc_struct offset;
898 } ecere_gcc_struct __anon1;
899 unsigned int debugValue;
900 struct __ecereNameSpace__ecere__com__DataValue val;
902 unsigned int hasAddress;
903 struct Type * expType;
904 struct Type * destType;
907 unsigned int byReference;
908 unsigned int isConstant;
909 unsigned int addedThis;
910 unsigned int needCast;
911 unsigned int thisPtr;
912 unsigned int opDestType;
913 unsigned int usedInComparison;
914 unsigned int ambiguousUnits;
915 unsigned int parentOpDestType;
916 unsigned int needTemplateCast;
921 struct DBTableEntry * prev;
922 struct DBTableEntry * next;
924 struct Identifier * id;
929 struct TypeName * dataType;
931 } ecere_gcc_struct __anon1;
932 struct __ecereNameSpace__ecere__sys__OldList * items;
933 } ecere_gcc_struct __anon1;
938 struct TypeName * prev;
939 struct TypeName * next;
941 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
942 struct Declarator * declarator;
944 struct Expression * bitCount;
947 struct PropertyWatch;
951 struct PropertyWatch * prev;
952 struct PropertyWatch * next;
954 struct Statement * compound;
955 struct __ecereNameSpace__ecere__sys__OldList * properties;
956 unsigned int deleteWatch;
963 struct MemberInit * prev;
964 struct MemberInit * next;
966 struct Location realLoc;
967 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
968 struct Initializer * initializer;
970 unsigned int variable;
971 unsigned int takeOutExp;
974 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
976 extern struct MemberInit * MkMemberInitExp(struct Expression * idExp, struct Initializer * initializer);
978 struct InitDeclarator;
980 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
982 struct InitDeclarator
984 struct InitDeclarator * prev;
985 struct InitDeclarator * next;
987 struct Declarator * declarator;
988 struct Initializer * initializer;
991 static void ProcessExpression(struct Expression * exp);
993 static void ProcessInitializer(struct Initializer * initializer)
995 switch(initializer->type)
999 struct Initializer * init;
1001 for(init = (*initializer->__anon1.list).first; init; init = init->next)
1003 ProcessInitializer(init);
1008 ProcessExpression(initializer->__anon1.exp);
1013 static void ProcessInitDeclarator(struct InitDeclarator * decl)
1015 if(decl->initializer)
1016 ProcessInitializer(decl->initializer);
1019 static void ProcessMemberInit(struct MemberInit * init)
1021 if(init->initializer)
1023 ProcessInitializer(init->initializer);
1027 static void ProcessStatement(struct Statement * stmt);
1029 static void ProcessProperty(struct PropertyDef * def)
1033 ProcessStatement(def->getStmt);
1037 ProcessStatement(def->setStmt);
1041 struct ClassFunction;
1045 struct ClassDef * prev;
1046 struct ClassDef * next;
1047 struct Location loc;
1051 struct Declaration * decl;
1052 struct ClassFunction * function;
1053 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1054 struct PropertyDef * propertyDef;
1055 struct PropertyWatch * propertyWatch;
1057 struct Identifier * defaultProperty;
1060 struct Identifier * id;
1061 struct Initializer * initializer;
1062 } ecere_gcc_struct __anon1;
1063 } ecere_gcc_struct __anon1;
1070 struct MembersInit * prev;
1071 struct MembersInit * next;
1072 struct Location loc;
1076 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1077 struct ClassFunction * function;
1078 } ecere_gcc_struct __anon1;
1081 struct ClassFunction
1083 struct ClassFunction * prev;
1084 struct ClassFunction * next;
1085 struct Location loc;
1086 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1087 struct Declarator * declarator;
1088 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1089 struct Statement * body;
1090 struct __ecereNameSpace__ecere__com__Class * _class;
1091 struct __ecereNameSpace__ecere__sys__OldList attached;
1094 struct Symbol * propSet;
1095 unsigned int isVirtual;
1096 unsigned int isConstructor;
1097 unsigned int isDestructor;
1098 unsigned int dontMangle;
1103 static void ProcessClassFunction(struct ClassFunction * func)
1107 ProcessStatement(func->body);
1111 static void ProcessInstance(struct Instantiation * inst)
1115 struct MembersInit * init;
1116 struct MemberInit * memberInit;
1118 for(init = (*inst->members).first; init; init = init->next)
1120 if(init->type == 0 && init->__anon1.dataMembers)
1122 for(memberInit = (*init->__anon1.dataMembers).first; memberInit; memberInit = memberInit->next)
1124 ProcessMemberInit(memberInit);
1129 ProcessClassFunction(init->__anon1.function);
1135 struct __ecereNameSpace__ecere__com__NameSpace;
1137 struct __ecereNameSpace__ecere__com__NameSpace
1140 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1141 struct __ecereNameSpace__ecere__com__NameSpace * left;
1142 struct __ecereNameSpace__ecere__com__NameSpace * right;
1144 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1145 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1146 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1147 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1148 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1151 struct __ecereNameSpace__ecere__com__Application
1154 const char * * argv;
1156 unsigned int isGUIApp;
1157 struct __ecereNameSpace__ecere__sys__OldList allModules;
1158 char * parsedCommand;
1159 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1162 struct __ecereNameSpace__ecere__com__Module
1164 struct __ecereNameSpace__ecere__com__Instance * application;
1165 struct __ecereNameSpace__ecere__sys__OldList classes;
1166 struct __ecereNameSpace__ecere__sys__OldList defines;
1167 struct __ecereNameSpace__ecere__sys__OldList functions;
1168 struct __ecereNameSpace__ecere__sys__OldList modules;
1169 struct __ecereNameSpace__ecere__com__Instance * prev;
1170 struct __ecereNameSpace__ecere__com__Instance * next;
1176 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1177 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1180 void __ecereUnregisterModule_dbpass(struct __ecereNameSpace__ecere__com__Instance * module)
1185 struct FunctionDefinition;
1187 typedef union YYSTYPE
1192 struct Identifier * id;
1193 struct Expression * exp;
1194 struct Specifier * specifier;
1195 struct __ecereNameSpace__ecere__sys__OldList * list;
1196 struct Enumerator * enumerator;
1197 struct Declarator * declarator;
1198 struct Pointer * pointer;
1199 struct Initializer * initializer;
1200 struct InitDeclarator * initDeclarator;
1201 struct TypeName * typeName;
1202 struct Declaration * declaration;
1203 struct Statement * stmt;
1204 struct FunctionDefinition * function;
1205 struct External * external;
1206 struct Context * context;
1207 struct AsmField * asmField;
1208 struct Attrib * attrib;
1209 struct ExtDecl * extDecl;
1210 struct Attribute * attribute;
1211 struct Instantiation * instance;
1212 struct MembersInit * membersInit;
1213 struct MemberInit * memberInit;
1214 struct ClassFunction * classFunction;
1215 struct ClassDefinition * _class;
1216 struct ClassDef * classDef;
1217 struct PropertyDef * prop;
1219 struct Symbol * symbol;
1220 struct PropertyWatch * propertyWatch;
1221 struct TemplateParameter * templateParameter;
1222 struct TemplateArgument * templateArgument;
1223 struct TemplateDatatype * templateDatatype;
1224 struct DBTableEntry * dbtableEntry;
1225 struct DBIndexItem * dbindexItem;
1226 struct DBTableDef * dbtableDef;
1227 } ecere_gcc_struct YYSTYPE;
1229 extern YYSTYPE yylval;
1231 struct FunctionDefinition
1233 struct FunctionDefinition * prev;
1234 struct FunctionDefinition * next;
1235 struct Location loc;
1236 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1237 struct Declarator * declarator;
1238 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1239 struct Statement * body;
1240 struct __ecereNameSpace__ecere__com__Class * _class;
1241 struct __ecereNameSpace__ecere__sys__OldList attached;
1244 struct Symbol * propSet;
1246 unsigned int propertyNoThis;
1251 struct External * prev;
1252 struct External * next;
1253 struct Location loc;
1255 struct Symbol * symbol;
1258 struct FunctionDefinition * function;
1259 struct ClassDefinition * _class;
1260 struct Declaration * declaration;
1261 char * importString;
1262 struct Identifier * id;
1263 struct DBTableDef * table;
1264 } ecere_gcc_struct __anon1;
1266 struct External * fwdDecl;
1267 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1268 struct __ecereNameSpace__ecere__com__Instance * incoming;
1269 int nonBreakableIncoming;
1272 static void ProcessFunction(struct FunctionDefinition * func)
1276 ProcessStatement(func->body);
1280 struct __ecereNameSpace__ecere__com__DataMember;
1282 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1288 const char * dataTypeString;
1289 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1290 } ecere_gcc_struct __anon1;
1291 struct __ecereNameSpace__ecere__com__DataValue expression;
1294 const char * memberString;
1297 struct __ecereNameSpace__ecere__com__DataMember * member;
1298 struct __ecereNameSpace__ecere__com__Property * prop;
1299 struct __ecereNameSpace__ecere__com__Method * method;
1300 } ecere_gcc_struct __anon1;
1301 } ecere_gcc_struct __anon2;
1302 } ecere_gcc_struct __anon1;
1305 struct __ecereNameSpace__ecere__com__DataMember
1307 struct __ecereNameSpace__ecere__com__DataMember * prev;
1308 struct __ecereNameSpace__ecere__com__DataMember * next;
1310 unsigned int isProperty;
1313 struct __ecereNameSpace__ecere__com__Class * _class;
1314 const char * dataTypeString;
1315 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1316 struct Type * dataType;
1320 struct __ecereNameSpace__ecere__sys__OldList members;
1321 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
1323 short structAlignment;
1324 short pointerAlignment;
1327 struct __ecereNameSpace__ecere__com__Class
1329 struct __ecereNameSpace__ecere__com__Class * prev;
1330 struct __ecereNameSpace__ecere__com__Class * next;
1336 unsigned int (* Constructor)(void * );
1337 void (* Destructor)(void * );
1340 struct __ecereNameSpace__ecere__com__Class * base;
1341 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1342 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1343 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1344 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1345 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1346 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1350 struct __ecereNameSpace__ecere__com__Instance * module;
1351 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1352 const char * dataTypeString;
1353 struct Type * dataType;
1355 int defaultAlignment;
1356 void (* Initialize)();
1358 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1359 const char * designerClass;
1360 unsigned int noExpansion;
1361 const char * defaultProperty;
1362 unsigned int comRedefinition;
1365 unsigned int internalDecl;
1367 unsigned int computeSize;
1368 short structAlignment;
1369 short pointerAlignment;
1370 int destructionWatchOffset;
1372 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1373 int inheritanceAccess;
1374 const char * fullName;
1376 struct __ecereNameSpace__ecere__sys__OldList conversions;
1377 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1378 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1379 struct __ecereNameSpace__ecere__com__Class * templateClass;
1380 struct __ecereNameSpace__ecere__sys__OldList templatized;
1382 unsigned int isInstanceClass;
1383 unsigned int byValueSystemClass;
1386 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
1388 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
1390 static void ProcessExpression(struct Expression * exp)
1395 ProcessExpression(exp->__anon1._new.size);
1398 ProcessExpression(exp->__anon1._renew.exp);
1399 ProcessExpression(exp->__anon1._renew.size);
1404 ProcessIdentifier(exp->__anon1.__anon1.identifier);
1407 ProcessInstance(exp->__anon1.instance);
1412 if(exp->__anon1.op.exp1)
1414 ProcessExpression(exp->__anon1.op.exp1);
1416 if(exp->__anon1.op.exp2)
1418 ProcessExpression(exp->__anon1.op.exp2);
1423 struct Expression * expression;
1425 for(expression = (*exp->__anon1.list).first; expression; expression = expression->next)
1427 ProcessExpression(expression);
1433 struct Expression * expression;
1435 ProcessExpression(exp->__anon1.index.exp);
1436 for(expression = (*exp->__anon1.index.index).first; expression; expression = expression->next)
1438 ProcessExpression(expression);
1444 ProcessExpression(exp->__anon1.call.exp);
1445 if(exp->__anon1.call.arguments)
1447 struct Expression * expression;
1449 for(expression = (*exp->__anon1.call.arguments).first; expression; expression = expression->next)
1451 ProcessExpression(expression);
1457 ProcessExpression(exp->__anon1.member.exp);
1460 ProcessExpression(exp->__anon1.member.exp);
1465 ProcessExpression(exp->__anon1.cast.exp);
1468 ProcessExpression(exp->__anon1.cond.cond);
1470 struct Expression * expression;
1472 for(expression = (*exp->__anon1.cond.exp).first; expression; expression = expression->next)
1474 ProcessExpression(expression);
1477 ProcessExpression(exp->__anon1.cond.elseExp);
1483 char tableName[1024];
1485 int len = strlen(exp->__anon1.db.table);
1487 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1488 tableName[len - 2] = 0;
1489 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1490 sprintf(name, "__ecereDBField_%s_%s", tableName, exp->__anon1.db.id->string);
1491 FreeExpContents(exp);
1493 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1498 char tableName[1024];
1500 int len = strlen(exp->__anon1.db.table);
1502 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1503 tableName[len - 2] = 0;
1504 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1505 sprintf(name, "__ecereDBTable_%s", tableName);
1506 FreeExpContents(exp);
1508 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1513 char tableName[1024];
1515 int len = strlen(exp->__anon1.db.table);
1517 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1518 tableName[len - 2] = 0;
1519 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1520 sprintf(name, "__ecereDBIndex_%s_%s", tableName, exp->__anon1.db.id->string);
1521 FreeExpContents(exp);
1523 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1530 struct Statement * databaseOpenStmt = MkCompoundStmt(MkList(), MkList());
1531 struct Statement * compound;
1532 struct Statement * ifDBStmt;
1533 struct __ecereNameSpace__ecere__sys__OldList * args;
1534 char numIndexesString[16];
1536 databaseOpenStmt->__anon1.compound.context = __extension__ ({
1537 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1539 __ecereInstance1->parent = curContext, __ecereInstance1;
1541 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.declarations), MkDeclaration(MkListOne(MkSpecifierName("Database")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("db")), (((void *)0))))));
1543 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkSpecifier(STATIC));
1544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkSpecifierName("bool"));
1545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.declarations), MkDeclaration(args, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("initialized")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("false")))))));
1546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("initialized"))), MkReturnStmt(MkListOne(MkExpConstant("0"))), (((void *)0))));
1547 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("initialized")), '=', MkExpIdentifier(MkIdentifier("true"))))));
1549 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), CopyExpression(exp->__anon1.dbopen.name));
1550 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("no")));
1551 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("db")), '=', MkExpCall(MkExpMember(CopyExpression(exp->__anon1.dbopen.ds), MkIdentifier("OpenDatabase")), args)))));
1552 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpOp((((void *)0)), '!', MkExpIdentifier(MkIdentifier("db")))), compound = MkCompoundStmt((((void *)0)), MkList()), (((void *)0))));
1553 compound->__anon1.compound.context = __extension__ ({
1554 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1556 __ecereInstance1->parent = databaseOpenStmt->__anon1.compound.context, __ecereInstance1;
1559 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), exp->__anon1.dbopen.name);
1560 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("create")));
1561 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*compound->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("db")), '=', MkExpCall(MkExpMember(exp->__anon1.dbopen.ds, MkIdentifier("OpenDatabase")), args)))));
1562 exp->__anon1.dbopen.name = (((void *)0));
1563 exp->__anon1.dbopen.ds = (((void *)0));
1564 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("db"))), ifDBStmt = MkCompoundStmt(MkList(), MkList()), (((void *)0))));
1565 ifDBStmt->__anon1.compound.context = __extension__ ({
1566 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1568 __ecereInstance1->parent = databaseOpenStmt->__anon1.compound.context, __ecereInstance1;
1570 sprintf(numIndexesString, "%d", numIndexes);
1571 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.declarations), MkDeclaration(MkListOne(MkSpecifierName("FieldIndex")), MkListOne(MkInitDeclarator(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("indexes")), MkExpConstant(numIndexesString)), MkInitializerList(MkListOne(MkInitializerList(MkListOne(MkInitializerAssignment(MkExpIdentifier(MkIdentifier("null")))))))))));
1572 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Begin")), MkList()))));
1573 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), compound = MkCompoundStmt((((void *)0)), tableStatements));
1574 compound->__anon1.compound.context = __extension__ ({
1575 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1577 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1579 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), (compound = MkCompoundStmt((((void *)0)), addFieldStatements), compound->__anon1.compound.context = __extension__ ({
1580 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1582 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1584 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), compound = MkCompoundStmt((((void *)0)), indexStatements));
1585 compound->__anon1.compound.context = __extension__ ({
1586 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1588 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1590 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Commit")), MkList()))));
1592 exp->__anon1.compound = databaseOpenStmt;
1593 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("db")))));
1594 tableStatements = (((void *)0));
1598 FreeExpContents(exp);
1599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No database table defined in this module or database_open already used.\n", (((void *)0))));
1607 static void ProcessDBTable(struct DBTableDef * table)
1609 struct __ecereNameSpace__ecere__sys__OldList * rowClassDefs = MkList(), * idClassDefs = (((void *)0));
1610 char tableName[1024];
1611 char rowClassName[1024];
1612 int len = strlen(table->name);
1613 unsigned int indexed = 0;
1615 char nameField[1024];
1616 struct __ecereNameSpace__ecere__sys__OldList * args;
1617 struct __ecereNameSpace__ecere__sys__OldList * members;
1620 idClassDefs = MkList();
1622 memcpy(tableName, table->name + 1, len - 2);
1623 tableName[len - 2] = 0;
1624 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1625 sprintf(tableID, "__ecereDBTable_%s", tableName);
1626 sprintf(rowClassName, "Row%s", tableName);
1627 __ecereNameSpace__ecere__sys__ChangeCh(rowClassName, ' ', '_');
1628 if(!tableStatements)
1630 tableStatements = MkList();
1631 indexStatements = MkList();
1632 addFieldStatements = MkList();
1635 struct External * external;
1637 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Table")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(tableID)), (((void *)0))))));
1638 external->__anon1.declaration->declMode = table->declMode;
1639 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*tableStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(tableID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")), args)))));
1642 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(table->name));
1644 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpInstance(MkInstantiation((((void *)0)), (((void *)0)), MkListOne(MkMembersInitList(members)))));
1645 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("tableRows")))));
1646 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("create")))));
1649 struct ClassDefinition * _class;
1650 struct ClassDef * def;
1651 struct External * external;
1652 struct __ecereNameSpace__ecere__sys__OldList * inheritanceSpecs = MkList();
1654 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inheritanceSpecs), MkSpecifier(PRIVATE));
1655 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inheritanceSpecs), MkSpecifierName("Row"));
1657 _class = MkClass(DeclClass((((void *)0)), rowClassName), inheritanceSpecs, rowClassDefs);
1658 PopContext(curContext);
1659 def = MkClassDefDefaultProperty(MkListOne(MkMemberInitExp(MkExpIdentifier(MkIdentifier("tbl")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier(tableID))))));
1660 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1661 _class->declMode = table->declMode;
1662 external = MkExternalClass(_class);
1663 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1664 addAfter = external;
1666 if(table->definitions)
1668 struct DBTableEntry * entry;
1670 for(entry = (*table->definitions).first; entry; entry = entry->next)
1676 unsigned int isIndex = 0;
1678 struct __ecereNameSpace__ecere__sys__OldList * args;
1679 struct Specifier * spec = entry->__anon1.__anon1.dataType->qualifiers ? (struct Specifier *)(*entry->__anon1.__anon1.dataType->qualifiers).first : (((void *)0));
1681 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, entry->id->string);
1684 if(!nameField[0] && spec->type == 1 && (!strcmp(spec->__anon1.__anon1.name, "String") || !strcmp(spec->__anon1.__anon1.name, "eda::CIString")))
1686 strcpy(nameField, entry->id->string);
1688 if(!indexed && spec->type == 1 && !strcmp(spec->__anon1.__anon1.name, table->symbol->string))
1690 struct Statement * rowSet = MkCompoundStmt(MkList(), MkList());
1692 struct ClassDef * def;
1694 numIndexes = ((numIndexes > 1) ? numIndexes : 1);
1697 sprintf(name, "_%s", entry->id->string);
1698 curContext = rowSet->__anon1.compound.context = __extension__ ({
1699 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1701 __ecereInstance1->parent = globalContext, __ecereInstance1;
1703 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("Find")), args = MkList()))));
1704 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1705 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("middle")));
1706 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("nil")));
1707 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1708 curContext = globalContext;
1709 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator), MkIdentifier(name), rowSet, (((void *)0))));
1710 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1711 def->memberAccess = 1;
1712 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1717 struct Statement * rowSet = MkCompoundStmt(MkList(), MkList()), * rowGet = MkCompoundStmt(MkList(), MkList());
1718 struct ClassDef * def;
1720 curContext = rowGet->__anon1.compound.context = __extension__ ({
1721 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1723 __ecereInstance1->parent = globalContext, __ecereInstance1;
1725 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1727 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(spec->__anon1.__anon1.name), MkExpIdentifier(MkIdentifier("d")), (((void *)0)))));
1731 struct Expression * exp;
1733 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.declarations), MkDeclaration(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("d")), MkInitializerAssignment(exp = MkExpConstant("0"))))));
1734 exp->destType = __extension__ ({
1735 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
1737 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
1740 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("GetData")), args = MkList()))));
1741 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1742 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("d")));
1743 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1745 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', MkExpIdentifier(MkIdentifier("d"))))));
1748 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("d")))));
1749 curContext = rowSet->__anon1.compound.context = __extension__ ({
1750 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1752 __ecereInstance1->parent = globalContext, __ecereInstance1;
1754 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("SetData")), args = MkList()))));
1755 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1756 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1757 curContext = globalContext;
1758 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), entry->__anon1.__anon1.dataType->declarator, CopyIdentifier(entry->id), rowSet, rowGet));
1759 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1760 def->memberAccess = 1;
1761 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1764 struct External * external;
1766 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Field")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(fieldID)), (((void *)0))))));
1767 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
1768 external->__anon1.declaration->declMode = table->declMode;
1770 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*addFieldStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(fieldID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("FindField")), args)))));
1771 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(entry->__anon1.__anon1.name));
1773 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*addFieldStatements), MkIfStmt(MkListOne(MkExpOp((((void *)0)), '!', MkExpIdentifier(MkIdentifier(fieldID)))), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(fieldID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("AddField")), args)))), (((void *)0))));
1774 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(entry->__anon1.__anon1.name));
1775 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpClass(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator)));
1776 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant("0"));
1780 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant("0"))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
1781 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant("0"))), MkIdentifier("order")), '=', MkExpIdentifier(MkIdentifier("ascending"))))));
1783 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("Index")), args))));
1784 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant("1"));
1785 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("indexes")));
1794 struct ClassDefinition * _class;
1795 struct External * external;
1796 struct ClassDef * def;
1797 struct Expression * exp;
1800 _class = MkClass(table->symbol, MkListOne(MkSpecifierName("Id")), idClassDefs);
1801 PopContext(curContext);
1802 _class->declMode = table->declMode;
1803 external = MkExternalClass(_class);
1804 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1805 addAfter = external;
1806 def = MkClassDefClassPropertyValue(MkIdentifier("table"), MkInitializerAssignment(exp = MkExpOp((((void *)0)), '&', MkExpDBTable(__ecereNameSpace__ecere__sys__CopyString(table->name)))));
1807 ProcessExpression(exp);
1808 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1811 def = MkClassDefClassPropertyValue(MkIdentifier("nameField"), MkInitializerAssignment(exp = MkExpOp((((void *)0)), '&', MkExpDBField(__ecereNameSpace__ecere__sys__CopyString(table->name), MkIdentifier(nameField)))));
1812 ProcessExpression(exp);
1813 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1816 if(table->definitions)
1818 struct DBTableEntry * entry;
1820 for(entry = (*table->definitions).first; entry; entry = entry->next)
1827 struct __ecereNameSpace__ecere__sys__OldList * args;
1828 struct Specifier * spec = entry->__anon1.__anon1.dataType->qualifiers ? (struct Specifier *)(*entry->__anon1.__anon1.dataType->qualifiers).first : (((void *)0));
1830 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, entry->id->string);
1831 if(idClassDefs && spec)
1833 struct Statement * idSet = MkCompoundStmt(MkList(), MkList()), * idGet = MkCompoundStmt(MkList(), MkList());
1834 struct ClassDef * def;
1836 curContext = idGet->__anon1.compound.context = __extension__ ({
1837 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1839 __ecereInstance1->parent = globalContext, __ecereInstance1;
1841 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(rowClassName), MkExpIdentifier(MkIdentifier("r")), MkListOne(MkMembersInitList(MkListOne(MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("this"))))))))));
1842 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1844 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(spec->__anon1.__anon1.name), MkExpIdentifier(MkIdentifier("d")), (((void *)0)))));
1848 struct Expression * exp;
1850 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.declarations), MkDeclaration(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("d")), MkInitializerAssignment(exp = MkExpConstant("0"))))));
1851 exp->destType = __extension__ ({
1852 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
1854 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
1857 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("GetData")), args = MkList()))));
1858 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("d")));
1860 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), DELETE, MkExpIdentifier(MkIdentifier("r"))))));
1861 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1863 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', MkExpIdentifier(MkIdentifier("d"))))));
1866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("d")))));
1867 curContext = idSet->__anon1.compound.context = __extension__ ({
1868 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1870 __ecereInstance1->parent = globalContext, __ecereInstance1;
1872 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(rowClassName), MkExpIdentifier(MkIdentifier("r")), MkListOne(MkMembersInitList(MkListOne(MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("this"))))))))));
1873 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("SetData")), args = MkList()))));
1874 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1875 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1876 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), DELETE, MkExpIdentifier(MkIdentifier("r"))))));
1877 curContext = globalContext;
1878 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator), CopyIdentifier(entry->id), idSet, idGet));
1879 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1880 def->memberAccess = 1;
1881 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1887 if(entry->__anon1.items && (*entry->__anon1.items).count)
1890 struct DBIndexItem * item;
1892 unsigned int needTable = 0;
1895 if(entry->id || indexed)
1897 if(entry->id || (*entry->__anon1.items).count == 1)
1899 struct External * external;
1900 struct Identifier * id = entry->id ? entry->id : ((struct DBIndexItem *)(*entry->__anon1.items).first)->id;
1902 sprintf(indexID, "__ecereDBIndex_%s_%s", tableName, id->string);
1903 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Table")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(indexID)), (((void *)0))))));
1904 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
1905 external->__anon1.declaration->declMode = table->declMode;
1909 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Multiple field index requires a name\n", (((void *)0))));
1914 strcpy(indexID, tableID);
1916 for(c = 0, item = (*entry->__anon1.items).first; item; item = item->next, c++)
1920 sprintf(num, "%d", c);
1921 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, item->id->string);
1922 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant(num))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
1923 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant(num))), MkIdentifier("order")), '=', MkExpIdentifier(MkIdentifier((item->order == 0) ? "ascending" : "descending"))))));
1925 sprintf(num, "%d", c);
1926 numIndexes = ((numIndexes > c) ? numIndexes : c);
1930 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(indexID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")), args)))));
1931 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(table->name));
1933 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpInstance(MkInstantiation((((void *)0)), (((void *)0)), MkListOne(MkMembersInitList(members)))));
1934 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("tableRows")))));
1937 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(indexID)), MkIdentifier("Index")), args))));
1938 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant(num));
1939 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("indexes")));
1948 static void ProcessDeclaration(struct Declaration * decl);
1950 static void ProcessSpecifier(struct Specifier * spec)
1958 if(spec->__anon1.__anon2.definitions)
1960 struct ClassDef * def;
1962 for(def = (*spec->__anon1.__anon2.definitions).first; def; def = def->next)
1967 ProcessDeclaration(def->__anon1.decl);
1971 struct MemberInit * init;
1973 for(init = (*def->__anon1.defProperties).first; init; init = init->next)
1975 ProcessMemberInit(init);
1980 ProcessClassFunction(def->__anon1.function);
1983 if(def->__anon1.propertyDef)
1985 ProcessProperty(def->__anon1.propertyDef);
1989 if(def->__anon1.propertyWatch && def->__anon1.propertyWatch->compound)
1991 ProcessStatement(def->__anon1.propertyWatch->compound);
1995 if(def->__anon1.__anon1.initializer)
1996 ProcessInitializer(def->__anon1.__anon1.initializer);
2006 static void ProcessStatement(struct Statement * stmt)
2011 ProcessStatement(stmt->__anon1.labeled.stmt);
2014 if(stmt->__anon1.caseStmt.exp)
2016 ProcessExpression(stmt->__anon1.caseStmt.exp);
2018 if(stmt->__anon1.caseStmt.stmt)
2020 ProcessStatement(stmt->__anon1.caseStmt.stmt);
2025 ProcessDeclaration(stmt->__anon1.decl);
2030 struct Context * oldContext = curContext;
2032 curContext = stmt->__anon1.compound.context;
2033 if(stmt->__anon1.compound.declarations)
2035 struct Declaration * decl;
2037 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
2039 ProcessDeclaration(decl);
2042 if(stmt->__anon1.compound.statements)
2044 struct Statement * statement;
2046 for(statement = (*stmt->__anon1.compound.statements).first; statement; statement = statement->next)
2048 ProcessStatement(statement);
2051 curContext = oldContext;
2056 if(stmt->__anon1.expressions)
2058 struct Expression * exp;
2060 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
2062 ProcessExpression(exp);
2069 struct Expression * exp;
2071 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
2073 ProcessExpression(exp);
2075 if(stmt->__anon1.ifStmt.stmt)
2077 ProcessStatement(stmt->__anon1.ifStmt.stmt);
2079 if(stmt->__anon1.ifStmt.elseStmt)
2081 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
2087 struct Expression * exp;
2089 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
2091 ProcessExpression(exp);
2093 ProcessStatement(stmt->__anon1.switchStmt.stmt);
2098 struct Expression * exp;
2100 if(stmt->__anon1.whileStmt.exp)
2102 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
2104 ProcessExpression(exp);
2107 if(stmt->__anon1.whileStmt.stmt)
2108 ProcessStatement(stmt->__anon1.whileStmt.stmt);
2113 ProcessStatement(stmt->__anon1.doWhile.stmt);
2114 if(stmt->__anon1.doWhile.exp)
2116 struct Expression * exp;
2118 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
2120 ProcessExpression(exp);
2127 struct Expression * exp;
2129 if(stmt->__anon1.forStmt.init)
2131 ProcessStatement(stmt->__anon1.forStmt.init);
2133 if(stmt->__anon1.forStmt.check)
2135 ProcessStatement(stmt->__anon1.forStmt.check);
2137 if(stmt->__anon1.forStmt.increment)
2139 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
2141 ProcessExpression(exp);
2144 if(stmt->__anon1.forStmt.stmt)
2145 ProcessStatement(stmt->__anon1.forStmt.stmt);
2150 struct Expression * exp;
2152 for(exp = stmt->__anon1.forEachStmt.exp ? (*stmt->__anon1.forEachStmt.exp).first : (((void *)0)); exp; exp = exp->next)
2153 ProcessExpression(exp);
2154 for(exp = stmt->__anon1.forEachStmt.filter ? (*stmt->__anon1.forEachStmt.filter).first : (((void *)0)); exp; exp = exp->next)
2155 ProcessExpression(exp);
2156 if(stmt->__anon1.forEachStmt.stmt)
2157 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
2167 if(stmt->__anon1.expressions)
2169 struct Expression * exp;
2171 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
2173 ProcessExpression(exp);
2180 struct Identifier * _watch;
2182 if(stmt->__anon1._watch.watcher)
2184 ProcessExpression(stmt->__anon1._watch.watcher);
2186 if(stmt->__anon1._watch.object)
2188 ProcessExpression(stmt->__anon1._watch.object);
2190 if(stmt->__anon1._watch.watches)
2192 for(_watch = (*stmt->__anon1._watch.watches).first; _watch; _watch = _watch->next)
2194 ProcessIdentifier(_watch);
2201 struct PropertyWatch * _watch;
2203 if(stmt->__anon1._watch.watcher)
2205 ProcessExpression(stmt->__anon1._watch.watcher);
2207 if(stmt->__anon1._watch.object)
2209 ProcessExpression(stmt->__anon1._watch.object);
2211 if(stmt->__anon1._watch.watches)
2213 for(_watch = (*stmt->__anon1._watch.watches).first; _watch; _watch = _watch->next)
2215 if(_watch->compound)
2217 ProcessStatement(_watch->compound);
2226 static void ProcessClassDef(struct ClassDef * def)
2231 ProcessDeclaration(def->__anon1.decl);
2235 struct MemberInit * init;
2237 for(init = (*def->__anon1.defProperties).first; init; init = init->next)
2239 ProcessMemberInit(init);
2244 if(def->__anon1.__anon1.initializer)
2245 ProcessInitializer(def->__anon1.__anon1.initializer);
2248 ProcessClassFunction(def->__anon1.function);
2251 if(def->__anon1.propertyDef)
2253 ProcessProperty(def->__anon1.propertyDef);
2257 if(def->__anon1.propertyWatch && def->__anon1.propertyWatch->compound)
2259 ProcessStatement(def->__anon1.propertyWatch->compound);
2265 static void ProcessDeclaration(struct Declaration * decl)
2271 struct Specifier * spec;
2273 if(decl->__anon1.__anon1.specifiers)
2275 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
2277 ProcessSpecifier(spec);
2284 if(decl->__anon1.__anon1.specifiers)
2286 struct Specifier * s;
2288 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
2290 ProcessSpecifier(s);
2293 if(decl->__anon1.__anon1.declarators && (*decl->__anon1.__anon1.declarators).first)
2295 struct InitDeclarator * d;
2297 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
2299 ProcessInitDeclarator(d);
2305 ProcessInstance(decl->__anon1.inst);
2310 static void ProcessClass(struct ClassDefinition * _class)
2312 if(_class->definitions)
2314 struct ClassDef * def;
2316 for(def = (*_class->definitions).first; def; def = def->next)
2318 ProcessClassDef(def);
2323 void ProcessDBTableDefinitions()
2325 struct External * external;
2327 addAfter = (((void *)0));
2328 curContext = globalContext;
2330 PrePreProcessClassDefinitions();
2331 DeclClass((((void *)0)), "Field");
2332 DeclClass((((void *)0)), "Table");
2333 DeclClass((((void *)0)), "Row");
2334 DeclClass((((void *)0)), "Id");
2336 if(ast != (((void *)0)))
2338 for(external = (*ast).first; external; external = external->next)
2340 curExternal = external;
2341 addAfter = external->prev;
2342 switch(external->type)
2345 ProcessDBTable(external->__anon1.table);
2349 for(external = (*ast).first; external; external = external->next)
2351 curExternal = external;
2352 addAfter = external->prev;
2353 switch(external->type)
2356 ProcessFunction(external->__anon1.function);
2359 ProcessDeclaration(external->__anon1.declaration);
2362 ProcessClass(external->__anon1._class);
2367 curContext = globalContext;
2370 void __ecereRegisterModule_dbpass(struct __ecereNameSpace__ecere__com__Instance * module)
2372 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessDBTableDefinitions", "void ProcessDBTableDefinitions(void)", ProcessDBTableDefinitions, module, 1);