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, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372, WIDE_STRING_LITERAL = 373, BUILTIN_OFFSETOF = 374
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;
795 struct Expression * prev;
796 struct Expression * next;
804 struct Identifier * identifier;
805 } ecere_gcc_struct __anon1;
806 struct Statement * compound;
807 struct Instantiation * instance;
811 unsigned int intlString;
812 unsigned int wideString;
813 } ecere_gcc_struct __anon2;
814 struct __ecereNameSpace__ecere__sys__OldList * list;
817 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
818 struct Declarator * decl;
819 } ecere_gcc_struct _classExp;
822 struct Identifier * id;
823 } ecere_gcc_struct classData;
826 struct Expression * exp;
827 struct __ecereNameSpace__ecere__sys__OldList * arguments;
828 struct Location argLoc;
829 } ecere_gcc_struct call;
832 struct Expression * exp;
833 struct __ecereNameSpace__ecere__sys__OldList * index;
834 } ecere_gcc_struct index;
837 struct Expression * exp;
838 struct Identifier * member;
840 unsigned int thisPtr;
841 } ecere_gcc_struct member;
845 struct Expression * exp1;
846 struct Expression * exp2;
847 } ecere_gcc_struct op;
848 struct TypeName * typeName;
849 struct Specifier * _class;
852 struct TypeName * typeName;
853 struct Expression * exp;
854 } ecere_gcc_struct cast;
857 struct Expression * cond;
858 struct __ecereNameSpace__ecere__sys__OldList * exp;
859 struct Expression * elseExp;
860 } ecere_gcc_struct cond;
863 struct TypeName * typeName;
864 struct Expression * size;
865 } ecere_gcc_struct _new;
868 struct TypeName * typeName;
869 struct Expression * size;
870 struct Expression * exp;
871 } ecere_gcc_struct _renew;
875 struct Identifier * id;
876 } ecere_gcc_struct db;
879 struct Expression * ds;
880 struct Expression * name;
881 } ecere_gcc_struct dbopen;
884 struct TypeName * typeName;
885 struct Initializer * initializer;
886 } ecere_gcc_struct initializer;
889 struct Expression * exp;
890 struct TypeName * typeName;
891 } ecere_gcc_struct vaArg;
894 struct TypeName * typeName;
895 struct Identifier * id;
896 } ecere_gcc_struct offset;
897 } ecere_gcc_struct __anon1;
898 unsigned int debugValue;
899 struct __ecereNameSpace__ecere__com__DataValue val;
901 unsigned int hasAddress;
902 struct Type * expType;
903 struct Type * destType;
906 unsigned int byReference;
907 unsigned int isConstant;
908 unsigned int addedThis;
909 unsigned int needCast;
910 unsigned int thisPtr;
911 unsigned int opDestType;
912 unsigned int needTemplateCast;
917 struct DBTableEntry * prev;
918 struct DBTableEntry * next;
920 struct Identifier * id;
925 struct TypeName * dataType;
927 } ecere_gcc_struct __anon1;
928 struct __ecereNameSpace__ecere__sys__OldList * items;
929 } ecere_gcc_struct __anon1;
934 struct TypeName * prev;
935 struct TypeName * next;
937 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
938 struct Declarator * declarator;
940 struct Expression * bitCount;
943 struct PropertyWatch;
947 struct PropertyWatch * prev;
948 struct PropertyWatch * next;
950 struct Statement * compound;
951 struct __ecereNameSpace__ecere__sys__OldList * properties;
952 unsigned int deleteWatch;
959 struct MemberInit * prev;
960 struct MemberInit * next;
962 struct Location realLoc;
963 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
964 struct Initializer * initializer;
966 unsigned int variable;
967 unsigned int takeOutExp;
970 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
972 extern struct MemberInit * MkMemberInitExp(struct Expression * idExp, struct Initializer * initializer);
974 struct InitDeclarator;
976 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
978 struct InitDeclarator
980 struct InitDeclarator * prev;
981 struct InitDeclarator * next;
983 struct Declarator * declarator;
984 struct Initializer * initializer;
987 static void ProcessExpression(struct Expression * exp);
989 static void ProcessInitializer(struct Initializer * initializer)
991 switch(initializer->type)
995 struct Initializer * init;
997 for(init = (*initializer->__anon1.list).first; init; init = init->next)
999 ProcessInitializer(init);
1004 ProcessExpression(initializer->__anon1.exp);
1009 static void ProcessInitDeclarator(struct InitDeclarator * decl)
1011 if(decl->initializer)
1012 ProcessInitializer(decl->initializer);
1015 static void ProcessMemberInit(struct MemberInit * init)
1017 if(init->initializer)
1019 ProcessInitializer(init->initializer);
1023 static void ProcessStatement(struct Statement * stmt);
1025 static void ProcessProperty(struct PropertyDef * def)
1029 ProcessStatement(def->getStmt);
1033 ProcessStatement(def->setStmt);
1037 struct ClassFunction;
1041 struct ClassDef * prev;
1042 struct ClassDef * next;
1043 struct Location loc;
1047 struct Declaration * decl;
1048 struct ClassFunction * function;
1049 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1050 struct PropertyDef * propertyDef;
1051 struct PropertyWatch * propertyWatch;
1053 struct Identifier * defaultProperty;
1056 struct Identifier * id;
1057 struct Initializer * initializer;
1058 } ecere_gcc_struct __anon1;
1059 } ecere_gcc_struct __anon1;
1066 struct MembersInit * prev;
1067 struct MembersInit * next;
1068 struct Location loc;
1072 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1073 struct ClassFunction * function;
1074 } ecere_gcc_struct __anon1;
1077 struct ClassFunction
1079 struct ClassFunction * prev;
1080 struct ClassFunction * next;
1081 struct Location loc;
1082 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1083 struct Declarator * declarator;
1084 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1085 struct Statement * body;
1086 struct __ecereNameSpace__ecere__com__Class * _class;
1087 struct __ecereNameSpace__ecere__sys__OldList attached;
1090 struct Symbol * propSet;
1091 unsigned int isVirtual;
1092 unsigned int isConstructor;
1093 unsigned int isDestructor;
1094 unsigned int dontMangle;
1099 static void ProcessClassFunction(struct ClassFunction * func)
1103 ProcessStatement(func->body);
1107 static void ProcessInstance(struct Instantiation * inst)
1111 struct MembersInit * init;
1112 struct MemberInit * memberInit;
1114 for(init = (*inst->members).first; init; init = init->next)
1116 if(init->type == 0 && init->__anon1.dataMembers)
1118 for(memberInit = (*init->__anon1.dataMembers).first; memberInit; memberInit = memberInit->next)
1120 ProcessMemberInit(memberInit);
1125 ProcessClassFunction(init->__anon1.function);
1131 struct __ecereNameSpace__ecere__com__NameSpace;
1133 struct __ecereNameSpace__ecere__com__NameSpace
1136 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1137 struct __ecereNameSpace__ecere__com__NameSpace * left;
1138 struct __ecereNameSpace__ecere__com__NameSpace * right;
1140 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1141 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1142 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1143 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1144 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1147 struct __ecereNameSpace__ecere__com__Application
1150 const char * * argv;
1152 unsigned int isGUIApp;
1153 struct __ecereNameSpace__ecere__sys__OldList allModules;
1154 char * parsedCommand;
1155 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1158 struct __ecereNameSpace__ecere__com__Module
1160 struct __ecereNameSpace__ecere__com__Instance * application;
1161 struct __ecereNameSpace__ecere__sys__OldList classes;
1162 struct __ecereNameSpace__ecere__sys__OldList defines;
1163 struct __ecereNameSpace__ecere__sys__OldList functions;
1164 struct __ecereNameSpace__ecere__sys__OldList modules;
1165 struct __ecereNameSpace__ecere__com__Instance * prev;
1166 struct __ecereNameSpace__ecere__com__Instance * next;
1172 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1173 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1176 void __ecereUnregisterModule_dbpass(struct __ecereNameSpace__ecere__com__Instance * module)
1181 struct FunctionDefinition;
1183 typedef union YYSTYPE
1188 struct Identifier * id;
1189 struct Expression * exp;
1190 struct Specifier * specifier;
1191 struct __ecereNameSpace__ecere__sys__OldList * list;
1192 struct Enumerator * enumerator;
1193 struct Declarator * declarator;
1194 struct Pointer * pointer;
1195 struct Initializer * initializer;
1196 struct InitDeclarator * initDeclarator;
1197 struct TypeName * typeName;
1198 struct Declaration * declaration;
1199 struct Statement * stmt;
1200 struct FunctionDefinition * function;
1201 struct External * external;
1202 struct Context * context;
1203 struct AsmField * asmField;
1204 struct Attrib * attrib;
1205 struct ExtDecl * extDecl;
1206 struct Attribute * attribute;
1207 struct Instantiation * instance;
1208 struct MembersInit * membersInit;
1209 struct MemberInit * memberInit;
1210 struct ClassFunction * classFunction;
1211 struct ClassDefinition * _class;
1212 struct ClassDef * classDef;
1213 struct PropertyDef * prop;
1215 struct Symbol * symbol;
1216 struct PropertyWatch * propertyWatch;
1217 struct TemplateParameter * templateParameter;
1218 struct TemplateArgument * templateArgument;
1219 struct TemplateDatatype * templateDatatype;
1220 struct DBTableEntry * dbtableEntry;
1221 struct DBIndexItem * dbindexItem;
1222 struct DBTableDef * dbtableDef;
1223 } ecere_gcc_struct YYSTYPE;
1225 extern YYSTYPE yylval;
1227 struct FunctionDefinition
1229 struct FunctionDefinition * prev;
1230 struct FunctionDefinition * next;
1231 struct Location loc;
1232 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1233 struct Declarator * declarator;
1234 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1235 struct Statement * body;
1236 struct __ecereNameSpace__ecere__com__Class * _class;
1237 struct __ecereNameSpace__ecere__sys__OldList attached;
1240 struct Symbol * propSet;
1242 unsigned int propertyNoThis;
1247 struct External * prev;
1248 struct External * next;
1249 struct Location loc;
1251 struct Symbol * symbol;
1254 struct FunctionDefinition * function;
1255 struct ClassDefinition * _class;
1256 struct Declaration * declaration;
1257 char * importString;
1258 struct Identifier * id;
1259 struct DBTableDef * table;
1260 } ecere_gcc_struct __anon1;
1262 struct External * fwdDecl;
1263 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1264 struct __ecereNameSpace__ecere__com__Instance * incoming;
1265 int nonBreakableIncoming;
1268 static void ProcessFunction(struct FunctionDefinition * func)
1272 ProcessStatement(func->body);
1276 struct __ecereNameSpace__ecere__com__DataMember;
1278 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1284 const char * dataTypeString;
1285 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1286 } ecere_gcc_struct __anon1;
1287 struct __ecereNameSpace__ecere__com__DataValue expression;
1290 const char * memberString;
1293 struct __ecereNameSpace__ecere__com__DataMember * member;
1294 struct __ecereNameSpace__ecere__com__Property * prop;
1295 struct __ecereNameSpace__ecere__com__Method * method;
1296 } ecere_gcc_struct __anon1;
1297 } ecere_gcc_struct __anon2;
1298 } ecere_gcc_struct __anon1;
1301 struct __ecereNameSpace__ecere__com__DataMember
1303 struct __ecereNameSpace__ecere__com__DataMember * prev;
1304 struct __ecereNameSpace__ecere__com__DataMember * next;
1306 unsigned int isProperty;
1309 struct __ecereNameSpace__ecere__com__Class * _class;
1310 const char * dataTypeString;
1311 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1312 struct Type * dataType;
1316 struct __ecereNameSpace__ecere__sys__OldList members;
1317 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
1319 short structAlignment;
1320 short pointerAlignment;
1323 struct __ecereNameSpace__ecere__com__Class
1325 struct __ecereNameSpace__ecere__com__Class * prev;
1326 struct __ecereNameSpace__ecere__com__Class * next;
1332 unsigned int (* Constructor)(void * );
1333 void (* Destructor)(void * );
1336 struct __ecereNameSpace__ecere__com__Class * base;
1337 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1338 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1339 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1340 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1341 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1342 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1346 struct __ecereNameSpace__ecere__com__Instance * module;
1347 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1348 const char * dataTypeString;
1349 struct Type * dataType;
1351 int defaultAlignment;
1352 void (* Initialize)();
1354 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1355 const char * designerClass;
1356 unsigned int noExpansion;
1357 const char * defaultProperty;
1358 unsigned int comRedefinition;
1361 unsigned int internalDecl;
1363 unsigned int computeSize;
1364 short structAlignment;
1365 short pointerAlignment;
1366 int destructionWatchOffset;
1368 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1369 int inheritanceAccess;
1370 const char * fullName;
1372 struct __ecereNameSpace__ecere__sys__OldList conversions;
1373 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1374 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1375 struct __ecereNameSpace__ecere__com__Class * templateClass;
1376 struct __ecereNameSpace__ecere__sys__OldList templatized;
1378 unsigned int isInstanceClass;
1379 unsigned int byValueSystemClass;
1382 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
1384 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
1386 static void ProcessExpression(struct Expression * exp)
1391 ProcessExpression(exp->__anon1._new.size);
1394 ProcessExpression(exp->__anon1._renew.exp);
1395 ProcessExpression(exp->__anon1._renew.size);
1400 ProcessIdentifier(exp->__anon1.__anon1.identifier);
1403 ProcessInstance(exp->__anon1.instance);
1408 if(exp->__anon1.op.exp1)
1410 ProcessExpression(exp->__anon1.op.exp1);
1412 if(exp->__anon1.op.exp2)
1414 ProcessExpression(exp->__anon1.op.exp2);
1419 struct Expression * expression;
1421 for(expression = (*exp->__anon1.list).first; expression; expression = expression->next)
1423 ProcessExpression(expression);
1429 struct Expression * expression;
1431 ProcessExpression(exp->__anon1.index.exp);
1432 for(expression = (*exp->__anon1.index.index).first; expression; expression = expression->next)
1434 ProcessExpression(expression);
1440 ProcessExpression(exp->__anon1.call.exp);
1441 if(exp->__anon1.call.arguments)
1443 struct Expression * expression;
1445 for(expression = (*exp->__anon1.call.arguments).first; expression; expression = expression->next)
1447 ProcessExpression(expression);
1453 ProcessExpression(exp->__anon1.member.exp);
1456 ProcessExpression(exp->__anon1.member.exp);
1461 ProcessExpression(exp->__anon1.cast.exp);
1464 ProcessExpression(exp->__anon1.cond.cond);
1466 struct Expression * expression;
1468 for(expression = (*exp->__anon1.cond.exp).first; expression; expression = expression->next)
1470 ProcessExpression(expression);
1473 ProcessExpression(exp->__anon1.cond.elseExp);
1479 char tableName[1024];
1481 int len = strlen(exp->__anon1.db.table);
1483 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1484 tableName[len - 2] = 0;
1485 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1486 sprintf(name, "__ecereDBField_%s_%s", tableName, exp->__anon1.db.id->string);
1487 FreeExpContents(exp);
1489 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1494 char tableName[1024];
1496 int len = strlen(exp->__anon1.db.table);
1498 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1499 tableName[len - 2] = 0;
1500 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1501 sprintf(name, "__ecereDBTable_%s", tableName);
1502 FreeExpContents(exp);
1504 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1509 char tableName[1024];
1511 int len = strlen(exp->__anon1.db.table);
1513 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1514 tableName[len - 2] = 0;
1515 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1516 sprintf(name, "__ecereDBIndex_%s_%s", tableName, exp->__anon1.db.id->string);
1517 FreeExpContents(exp);
1519 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1526 struct Statement * databaseOpenStmt = MkCompoundStmt(MkList(), MkList());
1527 struct Statement * compound;
1528 struct Statement * ifDBStmt;
1529 struct __ecereNameSpace__ecere__sys__OldList * args;
1530 char numIndexesString[16];
1532 databaseOpenStmt->__anon1.compound.context = __extension__ ({
1533 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1535 __ecereInstance1->parent = curContext, __ecereInstance1;
1537 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.declarations), MkDeclaration(MkListOne(MkSpecifierName("Database")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("db")), (((void *)0))))));
1539 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkSpecifier(STATIC));
1540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkSpecifierName("bool"));
1541 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.declarations), MkDeclaration(args, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("initialized")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("false")))))));
1542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("initialized"))), MkReturnStmt(MkListOne(MkExpConstant("0"))), (((void *)0))));
1543 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("initialized")), '=', MkExpIdentifier(MkIdentifier("true"))))));
1545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), CopyExpression(exp->__anon1.dbopen.name));
1546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("no")));
1547 __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)))));
1548 __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))));
1549 compound->__anon1.compound.context = __extension__ ({
1550 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1552 __ecereInstance1->parent = databaseOpenStmt->__anon1.compound.context, __ecereInstance1;
1555 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), exp->__anon1.dbopen.name);
1556 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("create")));
1557 __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)))));
1558 exp->__anon1.dbopen.name = (((void *)0));
1559 exp->__anon1.dbopen.ds = (((void *)0));
1560 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("db"))), ifDBStmt = MkCompoundStmt(MkList(), MkList()), (((void *)0))));
1561 ifDBStmt->__anon1.compound.context = __extension__ ({
1562 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1564 __ecereInstance1->parent = databaseOpenStmt->__anon1.compound.context, __ecereInstance1;
1566 sprintf(numIndexesString, "%d", numIndexes);
1567 __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")))))))))));
1568 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Begin")), MkList()))));
1569 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), compound = MkCompoundStmt((((void *)0)), tableStatements));
1570 compound->__anon1.compound.context = __extension__ ({
1571 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1573 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1575 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), (compound = MkCompoundStmt((((void *)0)), addFieldStatements), compound->__anon1.compound.context = __extension__ ({
1576 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1578 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1580 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), compound = MkCompoundStmt((((void *)0)), indexStatements));
1581 compound->__anon1.compound.context = __extension__ ({
1582 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1584 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1586 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Commit")), MkList()))));
1588 exp->__anon1.compound = databaseOpenStmt;
1589 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("db")))));
1590 tableStatements = (((void *)0));
1594 FreeExpContents(exp);
1595 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No database table defined in this module or database_open already used.\n", (((void *)0))));
1603 static void ProcessDBTable(struct DBTableDef * table)
1605 struct __ecereNameSpace__ecere__sys__OldList * rowClassDefs = MkList(), * idClassDefs = (((void *)0));
1606 char tableName[1024];
1607 char rowClassName[1024];
1608 int len = strlen(table->name);
1609 unsigned int indexed = 0;
1611 char nameField[1024];
1612 struct __ecereNameSpace__ecere__sys__OldList * args;
1613 struct __ecereNameSpace__ecere__sys__OldList * members;
1616 idClassDefs = MkList();
1618 memcpy(tableName, table->name + 1, len - 2);
1619 tableName[len - 2] = 0;
1620 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1621 sprintf(tableID, "__ecereDBTable_%s", tableName);
1622 sprintf(rowClassName, "Row%s", tableName);
1623 __ecereNameSpace__ecere__sys__ChangeCh(rowClassName, ' ', '_');
1624 if(!tableStatements)
1626 tableStatements = MkList();
1627 indexStatements = MkList();
1628 addFieldStatements = MkList();
1631 struct External * external;
1633 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Table")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(tableID)), (((void *)0))))));
1634 external->__anon1.declaration->declMode = table->declMode;
1635 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*tableStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(tableID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")), args)))));
1638 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(table->name));
1640 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpInstance(MkInstantiation((((void *)0)), (((void *)0)), MkListOne(MkMembersInitList(members)))));
1641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("tableRows")))));
1642 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("create")))));
1645 struct ClassDefinition * _class;
1646 struct ClassDef * def;
1647 struct External * external;
1648 struct __ecereNameSpace__ecere__sys__OldList * inheritanceSpecs = MkList();
1650 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inheritanceSpecs), MkSpecifier(PRIVATE));
1651 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inheritanceSpecs), MkSpecifierName("Row"));
1653 _class = MkClass(DeclClass((((void *)0)), rowClassName), inheritanceSpecs, rowClassDefs);
1654 PopContext(curContext);
1655 def = MkClassDefDefaultProperty(MkListOne(MkMemberInitExp(MkExpIdentifier(MkIdentifier("tbl")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier(tableID))))));
1656 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1657 _class->declMode = table->declMode;
1658 external = MkExternalClass(_class);
1659 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1660 addAfter = external;
1662 if(table->definitions)
1664 struct DBTableEntry * entry;
1666 for(entry = (*table->definitions).first; entry; entry = entry->next)
1672 unsigned int isIndex = 0;
1674 struct __ecereNameSpace__ecere__sys__OldList * args;
1675 struct Specifier * spec = entry->__anon1.__anon1.dataType->qualifiers ? (struct Specifier *)(*entry->__anon1.__anon1.dataType->qualifiers).first : (((void *)0));
1677 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, entry->id->string);
1680 if(!nameField[0] && spec->type == 1 && (!strcmp(spec->__anon1.__anon1.name, "String") || !strcmp(spec->__anon1.__anon1.name, "eda::CIString")))
1682 strcpy(nameField, entry->id->string);
1684 if(!indexed && spec->type == 1 && !strcmp(spec->__anon1.__anon1.name, table->symbol->string))
1686 struct Statement * rowSet = MkCompoundStmt(MkList(), MkList());
1688 struct ClassDef * def;
1690 numIndexes = ((numIndexes > 1) ? numIndexes : 1);
1693 sprintf(name, "_%s", entry->id->string);
1694 curContext = rowSet->__anon1.compound.context = __extension__ ({
1695 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1697 __ecereInstance1->parent = globalContext, __ecereInstance1;
1699 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("Find")), args = MkList()))));
1700 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1701 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("middle")));
1702 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("nil")));
1703 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1704 curContext = globalContext;
1705 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator), MkIdentifier(name), rowSet, (((void *)0))));
1706 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1707 def->memberAccess = 1;
1708 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1713 struct Statement * rowSet = MkCompoundStmt(MkList(), MkList()), * rowGet = MkCompoundStmt(MkList(), MkList());
1714 struct ClassDef * def;
1716 curContext = rowGet->__anon1.compound.context = __extension__ ({
1717 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1719 __ecereInstance1->parent = globalContext, __ecereInstance1;
1721 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1723 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(spec->__anon1.__anon1.name), MkExpIdentifier(MkIdentifier("d")), (((void *)0)))));
1727 struct Expression * exp;
1729 __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"))))));
1730 exp->destType = __extension__ ({
1731 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
1733 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
1736 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("GetData")), args = MkList()))));
1737 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1738 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("d")));
1739 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1741 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', MkExpIdentifier(MkIdentifier("d"))))));
1744 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("d")))));
1745 curContext = rowSet->__anon1.compound.context = __extension__ ({
1746 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1748 __ecereInstance1->parent = globalContext, __ecereInstance1;
1750 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("SetData")), args = MkList()))));
1751 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1752 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1753 curContext = globalContext;
1754 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), entry->__anon1.__anon1.dataType->declarator, CopyIdentifier(entry->id), rowSet, rowGet));
1755 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1756 def->memberAccess = 1;
1757 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1760 struct External * external;
1762 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Field")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(fieldID)), (((void *)0))))));
1763 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
1764 external->__anon1.declaration->declMode = table->declMode;
1766 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*addFieldStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(fieldID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("FindField")), args)))));
1767 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(entry->__anon1.__anon1.name));
1769 __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))));
1770 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(entry->__anon1.__anon1.name));
1771 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpClass(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator)));
1772 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant("0"));
1776 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant("0"))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
1777 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant("0"))), MkIdentifier("order")), '=', MkExpIdentifier(MkIdentifier("ascending"))))));
1779 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("Index")), args))));
1780 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant("1"));
1781 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("indexes")));
1790 struct ClassDefinition * _class;
1791 struct External * external;
1792 struct ClassDef * def;
1793 struct Expression * exp;
1796 _class = MkClass(table->symbol, MkListOne(MkSpecifierName("Id")), idClassDefs);
1797 PopContext(curContext);
1798 _class->declMode = table->declMode;
1799 external = MkExternalClass(_class);
1800 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1801 addAfter = external;
1802 def = MkClassDefClassPropertyValue(MkIdentifier("table"), MkInitializerAssignment(exp = MkExpOp((((void *)0)), '&', MkExpDBTable(__ecereNameSpace__ecere__sys__CopyString(table->name)))));
1803 ProcessExpression(exp);
1804 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1807 def = MkClassDefClassPropertyValue(MkIdentifier("nameField"), MkInitializerAssignment(exp = MkExpOp((((void *)0)), '&', MkExpDBField(__ecereNameSpace__ecere__sys__CopyString(table->name), MkIdentifier(nameField)))));
1808 ProcessExpression(exp);
1809 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1812 if(table->definitions)
1814 struct DBTableEntry * entry;
1816 for(entry = (*table->definitions).first; entry; entry = entry->next)
1823 struct __ecereNameSpace__ecere__sys__OldList * args;
1824 struct Specifier * spec = entry->__anon1.__anon1.dataType->qualifiers ? (struct Specifier *)(*entry->__anon1.__anon1.dataType->qualifiers).first : (((void *)0));
1826 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, entry->id->string);
1827 if(idClassDefs && spec)
1829 struct Statement * idSet = MkCompoundStmt(MkList(), MkList()), * idGet = MkCompoundStmt(MkList(), MkList());
1830 struct ClassDef * def;
1832 curContext = idGet->__anon1.compound.context = __extension__ ({
1833 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1835 __ecereInstance1->parent = globalContext, __ecereInstance1;
1837 __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"))))))))));
1838 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1840 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(spec->__anon1.__anon1.name), MkExpIdentifier(MkIdentifier("d")), (((void *)0)))));
1844 struct Expression * exp;
1846 __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"))))));
1847 exp->destType = __extension__ ({
1848 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
1850 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
1853 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("GetData")), args = MkList()))));
1854 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1855 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("d")));
1856 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), DELETE, MkExpIdentifier(MkIdentifier("r"))))));
1857 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', MkExpIdentifier(MkIdentifier("d"))))));
1862 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("d")))));
1863 curContext = idSet->__anon1.compound.context = __extension__ ({
1864 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1866 __ecereInstance1->parent = globalContext, __ecereInstance1;
1868 __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"))))))))));
1869 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("SetData")), args = MkList()))));
1870 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1871 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1872 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), DELETE, MkExpIdentifier(MkIdentifier("r"))))));
1873 curContext = globalContext;
1874 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator), CopyIdentifier(entry->id), idSet, idGet));
1875 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1876 def->memberAccess = 1;
1877 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1883 if(entry->__anon1.items && (*entry->__anon1.items).count)
1886 struct DBIndexItem * item;
1888 unsigned int needTable = 0;
1891 if(entry->id || indexed)
1893 if(entry->id || (*entry->__anon1.items).count == 1)
1895 struct External * external;
1896 struct Identifier * id = entry->id ? entry->id : ((struct DBIndexItem *)(*entry->__anon1.items).first)->id;
1898 sprintf(indexID, "__ecereDBIndex_%s_%s", tableName, id->string);
1899 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Table")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(indexID)), (((void *)0))))));
1900 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
1901 external->__anon1.declaration->declMode = table->declMode;
1905 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Multiple field index requires a name\n", (((void *)0))));
1910 strcpy(indexID, tableID);
1912 for(c = 0, item = (*entry->__anon1.items).first; item; item = item->next, c++)
1916 sprintf(num, "%d", c);
1917 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, item->id->string);
1918 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant(num))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
1919 __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"))))));
1921 sprintf(num, "%d", c);
1922 numIndexes = ((numIndexes > c) ? numIndexes : c);
1926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(indexID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")), args)))));
1927 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(table->name));
1929 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpInstance(MkInstantiation((((void *)0)), (((void *)0)), MkListOne(MkMembersInitList(members)))));
1930 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("tableRows")))));
1933 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(indexID)), MkIdentifier("Index")), args))));
1934 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant(num));
1935 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("indexes")));
1944 static void ProcessDeclaration(struct Declaration * decl);
1946 static void ProcessSpecifier(struct Specifier * spec)
1954 if(spec->__anon1.__anon2.definitions)
1956 struct ClassDef * def;
1958 for(def = (*spec->__anon1.__anon2.definitions).first; def; def = def->next)
1963 ProcessDeclaration(def->__anon1.decl);
1967 struct MemberInit * init;
1969 for(init = (*def->__anon1.defProperties).first; init; init = init->next)
1971 ProcessMemberInit(init);
1976 ProcessClassFunction(def->__anon1.function);
1979 if(def->__anon1.propertyDef)
1981 ProcessProperty(def->__anon1.propertyDef);
1985 if(def->__anon1.propertyWatch && def->__anon1.propertyWatch->compound)
1987 ProcessStatement(def->__anon1.propertyWatch->compound);
1991 if(def->__anon1.__anon1.initializer)
1992 ProcessInitializer(def->__anon1.__anon1.initializer);
2002 static void ProcessStatement(struct Statement * stmt)
2007 ProcessStatement(stmt->__anon1.labeled.stmt);
2010 if(stmt->__anon1.caseStmt.exp)
2012 ProcessExpression(stmt->__anon1.caseStmt.exp);
2014 if(stmt->__anon1.caseStmt.stmt)
2016 ProcessStatement(stmt->__anon1.caseStmt.stmt);
2021 ProcessDeclaration(stmt->__anon1.decl);
2026 struct Context * oldContext = curContext;
2028 curContext = stmt->__anon1.compound.context;
2029 if(stmt->__anon1.compound.declarations)
2031 struct Declaration * decl;
2033 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
2035 ProcessDeclaration(decl);
2038 if(stmt->__anon1.compound.statements)
2040 struct Statement * statement;
2042 for(statement = (*stmt->__anon1.compound.statements).first; statement; statement = statement->next)
2044 ProcessStatement(statement);
2047 curContext = oldContext;
2052 if(stmt->__anon1.expressions)
2054 struct Expression * exp;
2056 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
2058 ProcessExpression(exp);
2065 struct Expression * exp;
2067 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
2069 ProcessExpression(exp);
2071 if(stmt->__anon1.ifStmt.stmt)
2073 ProcessStatement(stmt->__anon1.ifStmt.stmt);
2075 if(stmt->__anon1.ifStmt.elseStmt)
2077 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
2083 struct Expression * exp;
2085 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
2087 ProcessExpression(exp);
2089 ProcessStatement(stmt->__anon1.switchStmt.stmt);
2094 struct Expression * exp;
2096 if(stmt->__anon1.whileStmt.exp)
2098 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
2100 ProcessExpression(exp);
2103 if(stmt->__anon1.whileStmt.stmt)
2104 ProcessStatement(stmt->__anon1.whileStmt.stmt);
2109 ProcessStatement(stmt->__anon1.doWhile.stmt);
2110 if(stmt->__anon1.doWhile.exp)
2112 struct Expression * exp;
2114 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
2116 ProcessExpression(exp);
2123 struct Expression * exp;
2125 if(stmt->__anon1.forStmt.init)
2127 ProcessStatement(stmt->__anon1.forStmt.init);
2129 if(stmt->__anon1.forStmt.check)
2131 ProcessStatement(stmt->__anon1.forStmt.check);
2133 if(stmt->__anon1.forStmt.increment)
2135 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
2137 ProcessExpression(exp);
2140 if(stmt->__anon1.forStmt.stmt)
2141 ProcessStatement(stmt->__anon1.forStmt.stmt);
2151 if(stmt->__anon1.expressions)
2153 struct Expression * exp;
2155 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
2157 ProcessExpression(exp);
2164 struct Identifier * _watch;
2166 if(stmt->__anon1._watch.watcher)
2168 ProcessExpression(stmt->__anon1._watch.watcher);
2170 if(stmt->__anon1._watch.object)
2172 ProcessExpression(stmt->__anon1._watch.object);
2174 if(stmt->__anon1._watch.watches)
2176 for(_watch = (*stmt->__anon1._watch.watches).first; _watch; _watch = _watch->next)
2178 ProcessIdentifier(_watch);
2185 struct PropertyWatch * _watch;
2187 if(stmt->__anon1._watch.watcher)
2189 ProcessExpression(stmt->__anon1._watch.watcher);
2191 if(stmt->__anon1._watch.object)
2193 ProcessExpression(stmt->__anon1._watch.object);
2195 if(stmt->__anon1._watch.watches)
2197 for(_watch = (*stmt->__anon1._watch.watches).first; _watch; _watch = _watch->next)
2199 if(_watch->compound)
2201 ProcessStatement(_watch->compound);
2210 static void ProcessClassDef(struct ClassDef * def)
2215 ProcessDeclaration(def->__anon1.decl);
2219 struct MemberInit * init;
2221 for(init = (*def->__anon1.defProperties).first; init; init = init->next)
2223 ProcessMemberInit(init);
2228 if(def->__anon1.__anon1.initializer)
2229 ProcessInitializer(def->__anon1.__anon1.initializer);
2232 ProcessClassFunction(def->__anon1.function);
2235 if(def->__anon1.propertyDef)
2237 ProcessProperty(def->__anon1.propertyDef);
2241 if(def->__anon1.propertyWatch && def->__anon1.propertyWatch->compound)
2243 ProcessStatement(def->__anon1.propertyWatch->compound);
2249 static void ProcessDeclaration(struct Declaration * decl)
2255 struct Specifier * spec;
2257 if(decl->__anon1.__anon1.specifiers)
2259 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
2261 ProcessSpecifier(spec);
2268 if(decl->__anon1.__anon1.specifiers)
2270 struct Specifier * s;
2272 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
2274 ProcessSpecifier(s);
2277 if(decl->__anon1.__anon1.declarators && (*decl->__anon1.__anon1.declarators).first)
2279 struct InitDeclarator * d;
2281 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
2283 ProcessInitDeclarator(d);
2289 ProcessInstance(decl->__anon1.inst);
2294 static void ProcessClass(struct ClassDefinition * _class)
2296 if(_class->definitions)
2298 struct ClassDef * def;
2300 for(def = (*_class->definitions).first; def; def = def->next)
2302 ProcessClassDef(def);
2307 void ProcessDBTableDefinitions()
2309 struct External * external;
2311 addAfter = (((void *)0));
2312 curContext = globalContext;
2314 PrePreProcessClassDefinitions();
2315 DeclClass((((void *)0)), "Field");
2316 DeclClass((((void *)0)), "Table");
2317 DeclClass((((void *)0)), "Row");
2318 DeclClass((((void *)0)), "Id");
2320 if(ast != (((void *)0)))
2322 for(external = (*ast).first; external; external = external->next)
2324 curExternal = external;
2325 addAfter = external->prev;
2326 switch(external->type)
2329 ProcessDBTable(external->__anon1.table);
2333 for(external = (*ast).first; external; external = external->next)
2335 curExternal = external;
2336 addAfter = external->prev;
2337 switch(external->type)
2340 ProcessFunction(external->__anon1.function);
2343 ProcessDeclaration(external->__anon1.declaration);
2346 ProcessClass(external->__anon1._class);
2351 curContext = globalContext;
2354 void __ecereRegisterModule_dbpass(struct __ecereNameSpace__ecere__com__Instance * module)
2356 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessDBTableDefinitions", "void ProcessDBTableDefinitions(void)", ProcessDBTableDefinitions, module, 1);