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
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;
892 } ecere_gcc_struct __anon1;
893 unsigned int debugValue;
894 struct __ecereNameSpace__ecere__com__DataValue val;
896 unsigned int hasAddress;
897 struct Type * expType;
898 struct Type * destType;
901 unsigned int byReference;
902 unsigned int isConstant;
903 unsigned int addedThis;
904 unsigned int needCast;
905 unsigned int thisPtr;
906 unsigned int opDestType;
907 unsigned int needTemplateCast;
912 struct DBTableEntry * prev;
913 struct DBTableEntry * next;
915 struct Identifier * id;
920 struct TypeName * dataType;
922 } ecere_gcc_struct __anon1;
923 struct __ecereNameSpace__ecere__sys__OldList * items;
924 } ecere_gcc_struct __anon1;
929 struct TypeName * prev;
930 struct TypeName * next;
932 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
933 struct Declarator * declarator;
935 struct Expression * bitCount;
938 struct PropertyWatch;
942 struct PropertyWatch * prev;
943 struct PropertyWatch * next;
945 struct Statement * compound;
946 struct __ecereNameSpace__ecere__sys__OldList * properties;
947 unsigned int deleteWatch;
954 struct MemberInit * prev;
955 struct MemberInit * next;
957 struct Location realLoc;
958 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
959 struct Initializer * initializer;
961 unsigned int variable;
962 unsigned int takeOutExp;
965 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
967 extern struct MemberInit * MkMemberInitExp(struct Expression * idExp, struct Initializer * initializer);
969 struct InitDeclarator;
971 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
973 struct InitDeclarator
975 struct InitDeclarator * prev;
976 struct InitDeclarator * next;
978 struct Declarator * declarator;
979 struct Initializer * initializer;
982 static void ProcessExpression(struct Expression * exp);
984 static void ProcessInitializer(struct Initializer * initializer)
986 switch(initializer->type)
990 struct Initializer * init;
992 for(init = (*initializer->__anon1.list).first; init; init = init->next)
994 ProcessInitializer(init);
999 ProcessExpression(initializer->__anon1.exp);
1004 static void ProcessInitDeclarator(struct InitDeclarator * decl)
1006 if(decl->initializer)
1007 ProcessInitializer(decl->initializer);
1010 static void ProcessMemberInit(struct MemberInit * init)
1012 if(init->initializer)
1014 ProcessInitializer(init->initializer);
1018 static void ProcessStatement(struct Statement * stmt);
1020 static void ProcessProperty(struct PropertyDef * def)
1024 ProcessStatement(def->getStmt);
1028 ProcessStatement(def->setStmt);
1032 struct ClassFunction;
1036 struct ClassDef * prev;
1037 struct ClassDef * next;
1038 struct Location loc;
1042 struct Declaration * decl;
1043 struct ClassFunction * function;
1044 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1045 struct PropertyDef * propertyDef;
1046 struct PropertyWatch * propertyWatch;
1048 struct Identifier * defaultProperty;
1051 struct Identifier * id;
1052 struct Initializer * initializer;
1053 } ecere_gcc_struct __anon1;
1054 } ecere_gcc_struct __anon1;
1061 struct MembersInit * prev;
1062 struct MembersInit * next;
1063 struct Location loc;
1067 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1068 struct ClassFunction * function;
1069 } ecere_gcc_struct __anon1;
1072 struct ClassFunction
1074 struct ClassFunction * prev;
1075 struct ClassFunction * next;
1076 struct Location loc;
1077 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1078 struct Declarator * declarator;
1079 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1080 struct Statement * body;
1081 struct __ecereNameSpace__ecere__com__Class * _class;
1082 struct __ecereNameSpace__ecere__sys__OldList attached;
1085 struct Symbol * propSet;
1086 unsigned int isVirtual;
1087 unsigned int isConstructor;
1088 unsigned int isDestructor;
1089 unsigned int dontMangle;
1094 static void ProcessClassFunction(struct ClassFunction * func)
1098 ProcessStatement(func->body);
1102 static void ProcessInstance(struct Instantiation * inst)
1106 struct MembersInit * init;
1107 struct MemberInit * memberInit;
1109 for(init = (*inst->members).first; init; init = init->next)
1111 if(init->type == 0 && init->__anon1.dataMembers)
1113 for(memberInit = (*init->__anon1.dataMembers).first; memberInit; memberInit = memberInit->next)
1115 ProcessMemberInit(memberInit);
1120 ProcessClassFunction(init->__anon1.function);
1126 struct __ecereNameSpace__ecere__com__NameSpace;
1128 struct __ecereNameSpace__ecere__com__NameSpace
1131 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1132 struct __ecereNameSpace__ecere__com__NameSpace * left;
1133 struct __ecereNameSpace__ecere__com__NameSpace * right;
1135 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1136 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1137 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1138 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1139 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1142 struct __ecereNameSpace__ecere__com__Application
1145 const char * * argv;
1147 unsigned int isGUIApp;
1148 struct __ecereNameSpace__ecere__sys__OldList allModules;
1149 char * parsedCommand;
1150 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1153 struct __ecereNameSpace__ecere__com__Module
1155 struct __ecereNameSpace__ecere__com__Instance * application;
1156 struct __ecereNameSpace__ecere__sys__OldList classes;
1157 struct __ecereNameSpace__ecere__sys__OldList defines;
1158 struct __ecereNameSpace__ecere__sys__OldList functions;
1159 struct __ecereNameSpace__ecere__sys__OldList modules;
1160 struct __ecereNameSpace__ecere__com__Instance * prev;
1161 struct __ecereNameSpace__ecere__com__Instance * next;
1167 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1168 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1171 void __ecereUnregisterModule_dbpass(struct __ecereNameSpace__ecere__com__Instance * module)
1176 struct FunctionDefinition;
1178 typedef union YYSTYPE
1183 struct Identifier * id;
1184 struct Expression * exp;
1185 struct Specifier * specifier;
1186 struct __ecereNameSpace__ecere__sys__OldList * list;
1187 struct Enumerator * enumerator;
1188 struct Declarator * declarator;
1189 struct Pointer * pointer;
1190 struct Initializer * initializer;
1191 struct InitDeclarator * initDeclarator;
1192 struct TypeName * typeName;
1193 struct Declaration * declaration;
1194 struct Statement * stmt;
1195 struct FunctionDefinition * function;
1196 struct External * external;
1197 struct Context * context;
1198 struct AsmField * asmField;
1199 struct Attrib * attrib;
1200 struct ExtDecl * extDecl;
1201 struct Attribute * attribute;
1202 struct Instantiation * instance;
1203 struct MembersInit * membersInit;
1204 struct MemberInit * memberInit;
1205 struct ClassFunction * classFunction;
1206 struct ClassDefinition * _class;
1207 struct ClassDef * classDef;
1208 struct PropertyDef * prop;
1210 struct Symbol * symbol;
1211 struct PropertyWatch * propertyWatch;
1212 struct TemplateParameter * templateParameter;
1213 struct TemplateArgument * templateArgument;
1214 struct TemplateDatatype * templateDatatype;
1215 struct DBTableEntry * dbtableEntry;
1216 struct DBIndexItem * dbindexItem;
1217 struct DBTableDef * dbtableDef;
1218 } ecere_gcc_struct YYSTYPE;
1220 extern YYSTYPE yylval;
1222 struct FunctionDefinition
1224 struct FunctionDefinition * prev;
1225 struct FunctionDefinition * next;
1226 struct Location loc;
1227 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1228 struct Declarator * declarator;
1229 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1230 struct Statement * body;
1231 struct __ecereNameSpace__ecere__com__Class * _class;
1232 struct __ecereNameSpace__ecere__sys__OldList attached;
1235 struct Symbol * propSet;
1237 unsigned int propertyNoThis;
1242 struct External * prev;
1243 struct External * next;
1244 struct Location loc;
1246 struct Symbol * symbol;
1249 struct FunctionDefinition * function;
1250 struct ClassDefinition * _class;
1251 struct Declaration * declaration;
1252 char * importString;
1253 struct Identifier * id;
1254 struct DBTableDef * table;
1255 } ecere_gcc_struct __anon1;
1257 struct External * fwdDecl;
1258 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1259 struct __ecereNameSpace__ecere__com__Instance * incoming;
1260 int nonBreakableIncoming;
1263 static void ProcessFunction(struct FunctionDefinition * func)
1267 ProcessStatement(func->body);
1271 struct __ecereNameSpace__ecere__com__DataMember;
1273 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1279 const char * dataTypeString;
1280 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1281 } ecere_gcc_struct __anon1;
1282 struct __ecereNameSpace__ecere__com__DataValue expression;
1285 const char * memberString;
1288 struct __ecereNameSpace__ecere__com__DataMember * member;
1289 struct __ecereNameSpace__ecere__com__Property * prop;
1290 struct __ecereNameSpace__ecere__com__Method * method;
1291 } ecere_gcc_struct __anon1;
1292 } ecere_gcc_struct __anon2;
1293 } ecere_gcc_struct __anon1;
1296 struct __ecereNameSpace__ecere__com__DataMember
1298 struct __ecereNameSpace__ecere__com__DataMember * prev;
1299 struct __ecereNameSpace__ecere__com__DataMember * next;
1301 unsigned int isProperty;
1304 struct __ecereNameSpace__ecere__com__Class * _class;
1305 const char * dataTypeString;
1306 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1307 struct Type * dataType;
1311 struct __ecereNameSpace__ecere__sys__OldList members;
1312 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
1314 short structAlignment;
1315 short pointerAlignment;
1318 struct __ecereNameSpace__ecere__com__Class
1320 struct __ecereNameSpace__ecere__com__Class * prev;
1321 struct __ecereNameSpace__ecere__com__Class * next;
1327 unsigned int (* Constructor)(void * );
1328 void (* Destructor)(void * );
1331 struct __ecereNameSpace__ecere__com__Class * base;
1332 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1333 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1334 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1335 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1336 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1337 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1341 struct __ecereNameSpace__ecere__com__Instance * module;
1342 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1343 const char * dataTypeString;
1344 struct Type * dataType;
1346 int defaultAlignment;
1347 void (* Initialize)();
1349 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1350 const char * designerClass;
1351 unsigned int noExpansion;
1352 const char * defaultProperty;
1353 unsigned int comRedefinition;
1356 unsigned int internalDecl;
1358 unsigned int computeSize;
1359 short structAlignment;
1360 short pointerAlignment;
1361 int destructionWatchOffset;
1363 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1364 int inheritanceAccess;
1365 const char * fullName;
1367 struct __ecereNameSpace__ecere__sys__OldList conversions;
1368 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1369 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1370 struct __ecereNameSpace__ecere__com__Class * templateClass;
1371 struct __ecereNameSpace__ecere__sys__OldList templatized;
1373 unsigned int isInstanceClass;
1374 unsigned int byValueSystemClass;
1377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
1379 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
1381 static void ProcessExpression(struct Expression * exp)
1386 ProcessExpression(exp->__anon1._new.size);
1389 ProcessExpression(exp->__anon1._renew.exp);
1390 ProcessExpression(exp->__anon1._renew.size);
1395 ProcessIdentifier(exp->__anon1.__anon1.identifier);
1398 ProcessInstance(exp->__anon1.instance);
1403 if(exp->__anon1.op.exp1)
1405 ProcessExpression(exp->__anon1.op.exp1);
1407 if(exp->__anon1.op.exp2)
1409 ProcessExpression(exp->__anon1.op.exp2);
1414 struct Expression * expression;
1416 for(expression = (*exp->__anon1.list).first; expression; expression = expression->next)
1418 ProcessExpression(expression);
1424 struct Expression * expression;
1426 ProcessExpression(exp->__anon1.index.exp);
1427 for(expression = (*exp->__anon1.index.index).first; expression; expression = expression->next)
1429 ProcessExpression(expression);
1435 ProcessExpression(exp->__anon1.call.exp);
1436 if(exp->__anon1.call.arguments)
1438 struct Expression * expression;
1440 for(expression = (*exp->__anon1.call.arguments).first; expression; expression = expression->next)
1442 ProcessExpression(expression);
1448 ProcessExpression(exp->__anon1.member.exp);
1451 ProcessExpression(exp->__anon1.member.exp);
1456 ProcessExpression(exp->__anon1.cast.exp);
1459 ProcessExpression(exp->__anon1.cond.cond);
1461 struct Expression * expression;
1463 for(expression = (*exp->__anon1.cond.exp).first; expression; expression = expression->next)
1465 ProcessExpression(expression);
1468 ProcessExpression(exp->__anon1.cond.elseExp);
1474 char tableName[1024];
1476 int len = strlen(exp->__anon1.db.table);
1478 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1479 tableName[len - 2] = 0;
1480 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1481 sprintf(name, "__ecereDBField_%s_%s", tableName, exp->__anon1.db.id->string);
1482 FreeExpContents(exp);
1484 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1489 char tableName[1024];
1491 int len = strlen(exp->__anon1.db.table);
1493 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1494 tableName[len - 2] = 0;
1495 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1496 sprintf(name, "__ecereDBTable_%s", tableName);
1497 FreeExpContents(exp);
1499 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1504 char tableName[1024];
1506 int len = strlen(exp->__anon1.db.table);
1508 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1509 tableName[len - 2] = 0;
1510 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1511 sprintf(name, "__ecereDBIndex_%s_%s", tableName, exp->__anon1.db.id->string);
1512 FreeExpContents(exp);
1514 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1521 struct Statement * databaseOpenStmt = MkCompoundStmt(MkList(), MkList());
1522 struct Statement * compound;
1523 struct Statement * ifDBStmt;
1524 struct __ecereNameSpace__ecere__sys__OldList * args;
1525 char numIndexesString[16];
1527 databaseOpenStmt->__anon1.compound.context = __extension__ ({
1528 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1530 __ecereInstance1->parent = curContext, __ecereInstance1;
1532 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.declarations), MkDeclaration(MkListOne(MkSpecifierName("Database")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("db")), (((void *)0))))));
1534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkSpecifier(STATIC));
1535 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkSpecifierName("bool"));
1536 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.declarations), MkDeclaration(args, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("initialized")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("false")))))));
1537 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("initialized"))), MkReturnStmt(MkListOne(MkExpConstant("0"))), (((void *)0))));
1538 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("initialized")), '=', MkExpIdentifier(MkIdentifier("true"))))));
1540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), CopyExpression(exp->__anon1.dbopen.name));
1541 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("no")));
1542 __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)))));
1543 __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))));
1544 compound->__anon1.compound.context = __extension__ ({
1545 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1547 __ecereInstance1->parent = databaseOpenStmt->__anon1.compound.context, __ecereInstance1;
1550 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), exp->__anon1.dbopen.name);
1551 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("create")));
1552 __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)))));
1553 exp->__anon1.dbopen.name = (((void *)0));
1554 exp->__anon1.dbopen.ds = (((void *)0));
1555 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("db"))), ifDBStmt = MkCompoundStmt(MkList(), MkList()), (((void *)0))));
1556 ifDBStmt->__anon1.compound.context = __extension__ ({
1557 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1559 __ecereInstance1->parent = databaseOpenStmt->__anon1.compound.context, __ecereInstance1;
1561 sprintf(numIndexesString, "%d", numIndexes);
1562 __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")))))))))));
1563 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Begin")), MkList()))));
1564 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), compound = MkCompoundStmt((((void *)0)), tableStatements));
1565 compound->__anon1.compound.context = __extension__ ({
1566 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1568 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1570 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), (compound = MkCompoundStmt((((void *)0)), addFieldStatements), 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)), indexStatements));
1576 compound->__anon1.compound.context = __extension__ ({
1577 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1579 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1581 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Commit")), MkList()))));
1583 exp->__anon1.compound = databaseOpenStmt;
1584 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("db")))));
1585 tableStatements = (((void *)0));
1589 FreeExpContents(exp);
1590 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No database table defined in this module or database_open already used.\n", (((void *)0))));
1598 static void ProcessDBTable(struct DBTableDef * table)
1600 struct __ecereNameSpace__ecere__sys__OldList * rowClassDefs = MkList(), * idClassDefs = (((void *)0));
1601 char tableName[1024];
1602 char rowClassName[1024];
1603 int len = strlen(table->name);
1604 unsigned int indexed = 0;
1606 char nameField[1024];
1607 struct __ecereNameSpace__ecere__sys__OldList * args;
1608 struct __ecereNameSpace__ecere__sys__OldList * members;
1611 idClassDefs = MkList();
1613 memcpy(tableName, table->name + 1, len - 2);
1614 tableName[len - 2] = 0;
1615 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1616 sprintf(tableID, "__ecereDBTable_%s", tableName);
1617 sprintf(rowClassName, "Row%s", tableName);
1618 __ecereNameSpace__ecere__sys__ChangeCh(rowClassName, ' ', '_');
1619 if(!tableStatements)
1621 tableStatements = MkList();
1622 indexStatements = MkList();
1623 addFieldStatements = MkList();
1626 struct External * external;
1628 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Table")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(tableID)), (((void *)0))))));
1629 external->__anon1.declaration->declMode = table->declMode;
1630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1632 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*tableStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(tableID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")), args)))));
1633 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(table->name));
1635 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpInstance(MkInstantiation((((void *)0)), (((void *)0)), MkListOne(MkMembersInitList(members)))));
1636 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("tableRows")))));
1637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("create")))));
1640 struct ClassDefinition * _class;
1641 struct ClassDef * def;
1642 struct External * external;
1643 struct __ecereNameSpace__ecere__sys__OldList * inheritanceSpecs = MkList();
1645 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inheritanceSpecs), MkSpecifier(PRIVATE));
1646 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inheritanceSpecs), MkSpecifierName("Row"));
1648 _class = MkClass(DeclClass((((void *)0)), rowClassName), inheritanceSpecs, rowClassDefs);
1649 PopContext(curContext);
1650 def = MkClassDefDefaultProperty(MkListOne(MkMemberInitExp(MkExpIdentifier(MkIdentifier("tbl")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier(tableID))))));
1651 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1652 _class->declMode = table->declMode;
1653 external = MkExternalClass(_class);
1654 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1655 addAfter = external;
1657 if(table->definitions)
1659 struct DBTableEntry * entry;
1661 for(entry = (*table->definitions).first; entry; entry = entry->next)
1667 unsigned int isIndex = 0;
1669 struct __ecereNameSpace__ecere__sys__OldList * args;
1670 struct Specifier * spec = entry->__anon1.__anon1.dataType->qualifiers ? (struct Specifier *)(*entry->__anon1.__anon1.dataType->qualifiers).first : (((void *)0));
1672 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, entry->id->string);
1675 if(!nameField[0] && spec->type == 1 && (!strcmp(spec->__anon1.__anon1.name, "String") || !strcmp(spec->__anon1.__anon1.name, "eda::CIString")))
1677 strcpy(nameField, entry->id->string);
1679 if(!indexed && spec->type == 1 && !strcmp(spec->__anon1.__anon1.name, table->symbol->string))
1681 struct Statement * rowSet = MkCompoundStmt(MkList(), MkList());
1683 struct ClassDef * def;
1685 numIndexes = ((numIndexes > 1) ? numIndexes : 1);
1688 sprintf(name, "_%s", entry->id->string);
1689 curContext = rowSet->__anon1.compound.context = __extension__ ({
1690 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1692 __ecereInstance1->parent = globalContext, __ecereInstance1;
1694 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("Find")), args = MkList()))));
1695 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1696 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("middle")));
1697 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("nil")));
1698 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1699 curContext = globalContext;
1700 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator), MkIdentifier(name), rowSet, (((void *)0))));
1701 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1702 def->memberAccess = 1;
1703 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1708 struct Statement * rowSet = MkCompoundStmt(MkList(), MkList()), * rowGet = MkCompoundStmt(MkList(), MkList());
1709 struct ClassDef * def;
1711 curContext = rowGet->__anon1.compound.context = __extension__ ({
1712 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1714 __ecereInstance1->parent = globalContext, __ecereInstance1;
1716 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1718 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(spec->__anon1.__anon1.name), MkExpIdentifier(MkIdentifier("d")), (((void *)0)))));
1722 struct Expression * exp;
1724 __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"))))));
1725 exp->destType = __extension__ ({
1726 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
1728 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
1731 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("GetData")), args = MkList()))));
1732 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1733 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("d")));
1734 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1736 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', MkExpIdentifier(MkIdentifier("d"))))));
1739 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("d")))));
1740 curContext = rowSet->__anon1.compound.context = __extension__ ({
1741 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1743 __ecereInstance1->parent = globalContext, __ecereInstance1;
1745 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("SetData")), args = MkList()))));
1746 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1747 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1748 curContext = globalContext;
1749 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), entry->__anon1.__anon1.dataType->declarator, CopyIdentifier(entry->id), rowSet, rowGet));
1750 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1751 def->memberAccess = 1;
1752 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1755 struct External * external;
1757 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Field")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(fieldID)), (((void *)0))))));
1758 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
1759 external->__anon1.declaration->declMode = table->declMode;
1761 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*addFieldStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(fieldID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("FindField")), args)))));
1762 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(entry->__anon1.__anon1.name));
1764 __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))));
1765 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(entry->__anon1.__anon1.name));
1766 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpClass(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator)));
1767 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant("0"));
1771 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant("0"))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
1772 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant("0"))), MkIdentifier("order")), '=', MkExpIdentifier(MkIdentifier("ascending"))))));
1774 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("Index")), args))));
1775 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant("1"));
1776 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("indexes")));
1785 struct ClassDefinition * _class;
1786 struct External * external;
1787 struct ClassDef * def;
1788 struct Expression * exp;
1791 _class = MkClass(table->symbol, MkListOne(MkSpecifierName("Id")), idClassDefs);
1792 PopContext(curContext);
1793 _class->declMode = table->declMode;
1794 external = MkExternalClass(_class);
1795 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1796 addAfter = external;
1797 def = MkClassDefClassPropertyValue(MkIdentifier("table"), MkInitializerAssignment(exp = MkExpOp((((void *)0)), '&', MkExpDBTable(__ecereNameSpace__ecere__sys__CopyString(table->name)))));
1798 ProcessExpression(exp);
1799 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1802 def = MkClassDefClassPropertyValue(MkIdentifier("nameField"), MkInitializerAssignment(exp = MkExpOp((((void *)0)), '&', MkExpDBField(__ecereNameSpace__ecere__sys__CopyString(table->name), MkIdentifier(nameField)))));
1803 ProcessExpression(exp);
1804 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1807 if(table->definitions)
1809 struct DBTableEntry * entry;
1811 for(entry = (*table->definitions).first; entry; entry = entry->next)
1818 struct __ecereNameSpace__ecere__sys__OldList * args;
1819 struct Specifier * spec = entry->__anon1.__anon1.dataType->qualifiers ? (struct Specifier *)(*entry->__anon1.__anon1.dataType->qualifiers).first : (((void *)0));
1821 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, entry->id->string);
1822 if(idClassDefs && spec)
1824 struct Statement * idSet = MkCompoundStmt(MkList(), MkList()), * idGet = MkCompoundStmt(MkList(), MkList());
1825 struct ClassDef * def;
1827 curContext = idGet->__anon1.compound.context = __extension__ ({
1828 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1830 __ecereInstance1->parent = globalContext, __ecereInstance1;
1832 __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"))))))))));
1833 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1835 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(spec->__anon1.__anon1.name), MkExpIdentifier(MkIdentifier("d")), (((void *)0)))));
1839 struct Expression * exp;
1841 __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"))))));
1842 exp->destType = __extension__ ({
1843 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
1845 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
1848 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("GetData")), args = MkList()))));
1849 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1850 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("d")));
1851 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), DELETE, MkExpIdentifier(MkIdentifier("r"))))));
1852 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1854 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', MkExpIdentifier(MkIdentifier("d"))))));
1857 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("d")))));
1858 curContext = idSet->__anon1.compound.context = __extension__ ({
1859 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1861 __ecereInstance1->parent = globalContext, __ecereInstance1;
1863 __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"))))))))));
1864 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("SetData")), args = MkList()))));
1865 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1867 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), DELETE, MkExpIdentifier(MkIdentifier("r"))))));
1868 curContext = globalContext;
1869 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator), CopyIdentifier(entry->id), idSet, idGet));
1870 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1871 def->memberAccess = 1;
1872 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1878 if(entry->__anon1.items && (*entry->__anon1.items).count)
1881 struct DBIndexItem * item;
1883 unsigned int needTable = 0;
1886 if(entry->id || indexed)
1888 if(entry->id || (*entry->__anon1.items).count == 1)
1890 struct External * external;
1891 struct Identifier * id = entry->id ? entry->id : ((struct DBIndexItem *)(*entry->__anon1.items).first)->id;
1893 sprintf(indexID, "__ecereDBIndex_%s_%s", tableName, id->string);
1894 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Table")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(indexID)), (((void *)0))))));
1895 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
1896 external->__anon1.declaration->declMode = table->declMode;
1900 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Multiple field index requires a name\n", (((void *)0))));
1905 strcpy(indexID, tableID);
1907 for(c = 0, item = (*entry->__anon1.items).first; item; item = item->next, c++)
1911 sprintf(num, "%d", c);
1912 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, item->id->string);
1913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant(num))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
1914 __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"))))));
1916 sprintf(num, "%d", c);
1917 numIndexes = ((numIndexes > c) ? numIndexes : c);
1921 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(indexID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")), args)))));
1922 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(table->name));
1924 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpInstance(MkInstantiation((((void *)0)), (((void *)0)), MkListOne(MkMembersInitList(members)))));
1925 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("tableRows")))));
1928 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(indexID)), MkIdentifier("Index")), args))));
1929 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant(num));
1930 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("indexes")));
1939 static void ProcessDeclaration(struct Declaration * decl);
1941 static void ProcessSpecifier(struct Specifier * spec)
1949 if(spec->__anon1.__anon2.definitions)
1951 struct ClassDef * def;
1953 for(def = (*spec->__anon1.__anon2.definitions).first; def; def = def->next)
1958 ProcessDeclaration(def->__anon1.decl);
1962 struct MemberInit * init;
1964 for(init = (*def->__anon1.defProperties).first; init; init = init->next)
1966 ProcessMemberInit(init);
1971 ProcessClassFunction(def->__anon1.function);
1974 if(def->__anon1.propertyDef)
1976 ProcessProperty(def->__anon1.propertyDef);
1980 if(def->__anon1.propertyWatch && def->__anon1.propertyWatch->compound)
1982 ProcessStatement(def->__anon1.propertyWatch->compound);
1986 if(def->__anon1.__anon1.initializer)
1987 ProcessInitializer(def->__anon1.__anon1.initializer);
1997 static void ProcessStatement(struct Statement * stmt)
2002 ProcessStatement(stmt->__anon1.labeled.stmt);
2005 if(stmt->__anon1.caseStmt.exp)
2007 ProcessExpression(stmt->__anon1.caseStmt.exp);
2009 if(stmt->__anon1.caseStmt.stmt)
2011 ProcessStatement(stmt->__anon1.caseStmt.stmt);
2016 ProcessDeclaration(stmt->__anon1.decl);
2021 struct Context * oldContext = curContext;
2023 curContext = stmt->__anon1.compound.context;
2024 if(stmt->__anon1.compound.declarations)
2026 struct Declaration * decl;
2028 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
2030 ProcessDeclaration(decl);
2033 if(stmt->__anon1.compound.statements)
2035 struct Statement * statement;
2037 for(statement = (*stmt->__anon1.compound.statements).first; statement; statement = statement->next)
2039 ProcessStatement(statement);
2042 curContext = oldContext;
2047 if(stmt->__anon1.expressions)
2049 struct Expression * exp;
2051 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
2053 ProcessExpression(exp);
2060 struct Expression * exp;
2062 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
2064 ProcessExpression(exp);
2066 if(stmt->__anon1.ifStmt.stmt)
2068 ProcessStatement(stmt->__anon1.ifStmt.stmt);
2070 if(stmt->__anon1.ifStmt.elseStmt)
2072 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
2078 struct Expression * exp;
2080 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
2082 ProcessExpression(exp);
2084 ProcessStatement(stmt->__anon1.switchStmt.stmt);
2089 struct Expression * exp;
2091 if(stmt->__anon1.whileStmt.exp)
2093 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
2095 ProcessExpression(exp);
2098 if(stmt->__anon1.whileStmt.stmt)
2099 ProcessStatement(stmt->__anon1.whileStmt.stmt);
2104 ProcessStatement(stmt->__anon1.doWhile.stmt);
2105 if(stmt->__anon1.doWhile.exp)
2107 struct Expression * exp;
2109 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
2111 ProcessExpression(exp);
2118 struct Expression * exp;
2120 if(stmt->__anon1.forStmt.init)
2122 ProcessStatement(stmt->__anon1.forStmt.init);
2124 if(stmt->__anon1.forStmt.check)
2126 ProcessStatement(stmt->__anon1.forStmt.check);
2128 if(stmt->__anon1.forStmt.increment)
2130 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
2132 ProcessExpression(exp);
2135 if(stmt->__anon1.forStmt.stmt)
2136 ProcessStatement(stmt->__anon1.forStmt.stmt);
2146 if(stmt->__anon1.expressions)
2148 struct Expression * exp;
2150 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
2152 ProcessExpression(exp);
2159 struct Identifier * _watch;
2161 if(stmt->__anon1._watch.watcher)
2163 ProcessExpression(stmt->__anon1._watch.watcher);
2165 if(stmt->__anon1._watch.object)
2167 ProcessExpression(stmt->__anon1._watch.object);
2169 if(stmt->__anon1._watch.watches)
2171 for(_watch = (*stmt->__anon1._watch.watches).first; _watch; _watch = _watch->next)
2173 ProcessIdentifier(_watch);
2180 struct PropertyWatch * _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 if(_watch->compound)
2196 ProcessStatement(_watch->compound);
2205 static void ProcessClassDef(struct ClassDef * def)
2210 ProcessDeclaration(def->__anon1.decl);
2214 struct MemberInit * init;
2216 for(init = (*def->__anon1.defProperties).first; init; init = init->next)
2218 ProcessMemberInit(init);
2223 if(def->__anon1.__anon1.initializer)
2224 ProcessInitializer(def->__anon1.__anon1.initializer);
2227 ProcessClassFunction(def->__anon1.function);
2230 if(def->__anon1.propertyDef)
2232 ProcessProperty(def->__anon1.propertyDef);
2236 if(def->__anon1.propertyWatch && def->__anon1.propertyWatch->compound)
2238 ProcessStatement(def->__anon1.propertyWatch->compound);
2244 static void ProcessDeclaration(struct Declaration * decl)
2250 struct Specifier * spec;
2252 if(decl->__anon1.__anon1.specifiers)
2254 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
2256 ProcessSpecifier(spec);
2263 if(decl->__anon1.__anon1.specifiers)
2265 struct Specifier * s;
2267 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
2269 ProcessSpecifier(s);
2272 if(decl->__anon1.__anon1.declarators && (*decl->__anon1.__anon1.declarators).first)
2274 struct InitDeclarator * d;
2276 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
2278 ProcessInitDeclarator(d);
2284 ProcessInstance(decl->__anon1.inst);
2289 static void ProcessClass(struct ClassDefinition * _class)
2291 if(_class->definitions)
2293 struct ClassDef * def;
2295 for(def = (*_class->definitions).first; def; def = def->next)
2297 ProcessClassDef(def);
2302 void ProcessDBTableDefinitions()
2304 struct External * external;
2306 addAfter = (((void *)0));
2307 curContext = globalContext;
2309 PrePreProcessClassDefinitions();
2310 DeclClass((((void *)0)), "Field");
2311 DeclClass((((void *)0)), "Table");
2312 DeclClass((((void *)0)), "Row");
2313 DeclClass((((void *)0)), "Id");
2315 if(ast != (((void *)0)))
2317 for(external = (*ast).first; external; external = external->next)
2319 curExternal = external;
2320 addAfter = external->prev;
2321 switch(external->type)
2324 ProcessDBTable(external->__anon1.table);
2328 for(external = (*ast).first; external; external = external->next)
2330 curExternal = external;
2331 addAfter = external->prev;
2332 switch(external->type)
2335 ProcessFunction(external->__anon1.function);
2338 ProcessDeclaration(external->__anon1.declaration);
2341 ProcessClass(external->__anon1._class);
2346 curContext = globalContext;
2349 void __ecereRegisterModule_dbpass(struct __ecereNameSpace__ecere__com__Instance * module)
2351 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessDBTableDefinitions", "void ProcessDBTableDefinitions(void)", ProcessDBTableDefinitions, module, 1);