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 usedInComparison;
913 unsigned int ambiguousUnits;
914 unsigned int parentOpDestType;
915 unsigned int needTemplateCast;
920 struct DBTableEntry * prev;
921 struct DBTableEntry * next;
923 struct Identifier * id;
928 struct TypeName * dataType;
930 } ecere_gcc_struct __anon1;
931 struct __ecereNameSpace__ecere__sys__OldList * items;
932 } ecere_gcc_struct __anon1;
937 struct TypeName * prev;
938 struct TypeName * next;
940 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
941 struct Declarator * declarator;
943 struct Expression * bitCount;
946 struct PropertyWatch;
950 struct PropertyWatch * prev;
951 struct PropertyWatch * next;
953 struct Statement * compound;
954 struct __ecereNameSpace__ecere__sys__OldList * properties;
955 unsigned int deleteWatch;
962 struct MemberInit * prev;
963 struct MemberInit * next;
965 struct Location realLoc;
966 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
967 struct Initializer * initializer;
969 unsigned int variable;
970 unsigned int takeOutExp;
973 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
975 extern struct MemberInit * MkMemberInitExp(struct Expression * idExp, struct Initializer * initializer);
977 struct InitDeclarator;
979 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
981 struct InitDeclarator
983 struct InitDeclarator * prev;
984 struct InitDeclarator * next;
986 struct Declarator * declarator;
987 struct Initializer * initializer;
990 static void ProcessExpression(struct Expression * exp);
992 static void ProcessInitializer(struct Initializer * initializer)
994 switch(initializer->type)
998 struct Initializer * init;
1000 for(init = (*initializer->__anon1.list).first; init; init = init->next)
1002 ProcessInitializer(init);
1007 ProcessExpression(initializer->__anon1.exp);
1012 static void ProcessInitDeclarator(struct InitDeclarator * decl)
1014 if(decl->initializer)
1015 ProcessInitializer(decl->initializer);
1018 static void ProcessMemberInit(struct MemberInit * init)
1020 if(init->initializer)
1022 ProcessInitializer(init->initializer);
1026 static void ProcessStatement(struct Statement * stmt);
1028 static void ProcessProperty(struct PropertyDef * def)
1032 ProcessStatement(def->getStmt);
1036 ProcessStatement(def->setStmt);
1040 struct ClassFunction;
1044 struct ClassDef * prev;
1045 struct ClassDef * next;
1046 struct Location loc;
1050 struct Declaration * decl;
1051 struct ClassFunction * function;
1052 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1053 struct PropertyDef * propertyDef;
1054 struct PropertyWatch * propertyWatch;
1056 struct Identifier * defaultProperty;
1059 struct Identifier * id;
1060 struct Initializer * initializer;
1061 } ecere_gcc_struct __anon1;
1062 } ecere_gcc_struct __anon1;
1069 struct MembersInit * prev;
1070 struct MembersInit * next;
1071 struct Location loc;
1075 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1076 struct ClassFunction * function;
1077 } ecere_gcc_struct __anon1;
1080 struct ClassFunction
1082 struct ClassFunction * prev;
1083 struct ClassFunction * next;
1084 struct Location loc;
1085 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1086 struct Declarator * declarator;
1087 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1088 struct Statement * body;
1089 struct __ecereNameSpace__ecere__com__Class * _class;
1090 struct __ecereNameSpace__ecere__sys__OldList attached;
1093 struct Symbol * propSet;
1094 unsigned int isVirtual;
1095 unsigned int isConstructor;
1096 unsigned int isDestructor;
1097 unsigned int dontMangle;
1102 static void ProcessClassFunction(struct ClassFunction * func)
1106 ProcessStatement(func->body);
1110 static void ProcessInstance(struct Instantiation * inst)
1114 struct MembersInit * init;
1115 struct MemberInit * memberInit;
1117 for(init = (*inst->members).first; init; init = init->next)
1119 if(init->type == 0 && init->__anon1.dataMembers)
1121 for(memberInit = (*init->__anon1.dataMembers).first; memberInit; memberInit = memberInit->next)
1123 ProcessMemberInit(memberInit);
1128 ProcessClassFunction(init->__anon1.function);
1134 struct __ecereNameSpace__ecere__com__NameSpace;
1136 struct __ecereNameSpace__ecere__com__NameSpace
1139 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1140 struct __ecereNameSpace__ecere__com__NameSpace * left;
1141 struct __ecereNameSpace__ecere__com__NameSpace * right;
1143 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1144 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1145 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1146 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1147 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1150 struct __ecereNameSpace__ecere__com__Application
1153 const char * * argv;
1155 unsigned int isGUIApp;
1156 struct __ecereNameSpace__ecere__sys__OldList allModules;
1157 char * parsedCommand;
1158 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1161 struct __ecereNameSpace__ecere__com__Module
1163 struct __ecereNameSpace__ecere__com__Instance * application;
1164 struct __ecereNameSpace__ecere__sys__OldList classes;
1165 struct __ecereNameSpace__ecere__sys__OldList defines;
1166 struct __ecereNameSpace__ecere__sys__OldList functions;
1167 struct __ecereNameSpace__ecere__sys__OldList modules;
1168 struct __ecereNameSpace__ecere__com__Instance * prev;
1169 struct __ecereNameSpace__ecere__com__Instance * next;
1175 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1176 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1179 void __ecereUnregisterModule_dbpass(struct __ecereNameSpace__ecere__com__Instance * module)
1184 struct FunctionDefinition;
1186 typedef union YYSTYPE
1191 struct Identifier * id;
1192 struct Expression * exp;
1193 struct Specifier * specifier;
1194 struct __ecereNameSpace__ecere__sys__OldList * list;
1195 struct Enumerator * enumerator;
1196 struct Declarator * declarator;
1197 struct Pointer * pointer;
1198 struct Initializer * initializer;
1199 struct InitDeclarator * initDeclarator;
1200 struct TypeName * typeName;
1201 struct Declaration * declaration;
1202 struct Statement * stmt;
1203 struct FunctionDefinition * function;
1204 struct External * external;
1205 struct Context * context;
1206 struct AsmField * asmField;
1207 struct Attrib * attrib;
1208 struct ExtDecl * extDecl;
1209 struct Attribute * attribute;
1210 struct Instantiation * instance;
1211 struct MembersInit * membersInit;
1212 struct MemberInit * memberInit;
1213 struct ClassFunction * classFunction;
1214 struct ClassDefinition * _class;
1215 struct ClassDef * classDef;
1216 struct PropertyDef * prop;
1218 struct Symbol * symbol;
1219 struct PropertyWatch * propertyWatch;
1220 struct TemplateParameter * templateParameter;
1221 struct TemplateArgument * templateArgument;
1222 struct TemplateDatatype * templateDatatype;
1223 struct DBTableEntry * dbtableEntry;
1224 struct DBIndexItem * dbindexItem;
1225 struct DBTableDef * dbtableDef;
1226 } ecere_gcc_struct YYSTYPE;
1228 extern YYSTYPE yylval;
1230 struct FunctionDefinition
1232 struct FunctionDefinition * prev;
1233 struct FunctionDefinition * next;
1234 struct Location loc;
1235 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1236 struct Declarator * declarator;
1237 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1238 struct Statement * body;
1239 struct __ecereNameSpace__ecere__com__Class * _class;
1240 struct __ecereNameSpace__ecere__sys__OldList attached;
1243 struct Symbol * propSet;
1245 unsigned int propertyNoThis;
1250 struct External * prev;
1251 struct External * next;
1252 struct Location loc;
1254 struct Symbol * symbol;
1257 struct FunctionDefinition * function;
1258 struct ClassDefinition * _class;
1259 struct Declaration * declaration;
1260 char * importString;
1261 struct Identifier * id;
1262 struct DBTableDef * table;
1263 } ecere_gcc_struct __anon1;
1265 struct External * fwdDecl;
1266 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1267 struct __ecereNameSpace__ecere__com__Instance * incoming;
1268 int nonBreakableIncoming;
1271 static void ProcessFunction(struct FunctionDefinition * func)
1275 ProcessStatement(func->body);
1279 struct __ecereNameSpace__ecere__com__DataMember;
1281 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1287 const char * dataTypeString;
1288 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1289 } ecere_gcc_struct __anon1;
1290 struct __ecereNameSpace__ecere__com__DataValue expression;
1293 const char * memberString;
1296 struct __ecereNameSpace__ecere__com__DataMember * member;
1297 struct __ecereNameSpace__ecere__com__Property * prop;
1298 struct __ecereNameSpace__ecere__com__Method * method;
1299 } ecere_gcc_struct __anon1;
1300 } ecere_gcc_struct __anon2;
1301 } ecere_gcc_struct __anon1;
1304 struct __ecereNameSpace__ecere__com__DataMember
1306 struct __ecereNameSpace__ecere__com__DataMember * prev;
1307 struct __ecereNameSpace__ecere__com__DataMember * next;
1309 unsigned int isProperty;
1312 struct __ecereNameSpace__ecere__com__Class * _class;
1313 const char * dataTypeString;
1314 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1315 struct Type * dataType;
1319 struct __ecereNameSpace__ecere__sys__OldList members;
1320 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
1322 short structAlignment;
1323 short pointerAlignment;
1326 struct __ecereNameSpace__ecere__com__Class
1328 struct __ecereNameSpace__ecere__com__Class * prev;
1329 struct __ecereNameSpace__ecere__com__Class * next;
1335 unsigned int (* Constructor)(void * );
1336 void (* Destructor)(void * );
1339 struct __ecereNameSpace__ecere__com__Class * base;
1340 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1341 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1342 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1343 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1344 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1345 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1349 struct __ecereNameSpace__ecere__com__Instance * module;
1350 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1351 const char * dataTypeString;
1352 struct Type * dataType;
1354 int defaultAlignment;
1355 void (* Initialize)();
1357 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1358 const char * designerClass;
1359 unsigned int noExpansion;
1360 const char * defaultProperty;
1361 unsigned int comRedefinition;
1364 unsigned int internalDecl;
1366 unsigned int computeSize;
1367 short structAlignment;
1368 short pointerAlignment;
1369 int destructionWatchOffset;
1371 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1372 int inheritanceAccess;
1373 const char * fullName;
1375 struct __ecereNameSpace__ecere__sys__OldList conversions;
1376 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1377 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1378 struct __ecereNameSpace__ecere__com__Class * templateClass;
1379 struct __ecereNameSpace__ecere__sys__OldList templatized;
1381 unsigned int isInstanceClass;
1382 unsigned int byValueSystemClass;
1385 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
1387 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
1389 static void ProcessExpression(struct Expression * exp)
1394 ProcessExpression(exp->__anon1._new.size);
1397 ProcessExpression(exp->__anon1._renew.exp);
1398 ProcessExpression(exp->__anon1._renew.size);
1403 ProcessIdentifier(exp->__anon1.__anon1.identifier);
1406 ProcessInstance(exp->__anon1.instance);
1411 if(exp->__anon1.op.exp1)
1413 ProcessExpression(exp->__anon1.op.exp1);
1415 if(exp->__anon1.op.exp2)
1417 ProcessExpression(exp->__anon1.op.exp2);
1422 struct Expression * expression;
1424 for(expression = (*exp->__anon1.list).first; expression; expression = expression->next)
1426 ProcessExpression(expression);
1432 struct Expression * expression;
1434 ProcessExpression(exp->__anon1.index.exp);
1435 for(expression = (*exp->__anon1.index.index).first; expression; expression = expression->next)
1437 ProcessExpression(expression);
1443 ProcessExpression(exp->__anon1.call.exp);
1444 if(exp->__anon1.call.arguments)
1446 struct Expression * expression;
1448 for(expression = (*exp->__anon1.call.arguments).first; expression; expression = expression->next)
1450 ProcessExpression(expression);
1456 ProcessExpression(exp->__anon1.member.exp);
1459 ProcessExpression(exp->__anon1.member.exp);
1464 ProcessExpression(exp->__anon1.cast.exp);
1467 ProcessExpression(exp->__anon1.cond.cond);
1469 struct Expression * expression;
1471 for(expression = (*exp->__anon1.cond.exp).first; expression; expression = expression->next)
1473 ProcessExpression(expression);
1476 ProcessExpression(exp->__anon1.cond.elseExp);
1482 char tableName[1024];
1484 int len = strlen(exp->__anon1.db.table);
1486 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1487 tableName[len - 2] = 0;
1488 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1489 sprintf(name, "__ecereDBField_%s_%s", tableName, exp->__anon1.db.id->string);
1490 FreeExpContents(exp);
1492 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1497 char tableName[1024];
1499 int len = strlen(exp->__anon1.db.table);
1501 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1502 tableName[len - 2] = 0;
1503 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1504 sprintf(name, "__ecereDBTable_%s", tableName);
1505 FreeExpContents(exp);
1507 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1512 char tableName[1024];
1514 int len = strlen(exp->__anon1.db.table);
1516 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1517 tableName[len - 2] = 0;
1518 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1519 sprintf(name, "__ecereDBIndex_%s_%s", tableName, exp->__anon1.db.id->string);
1520 FreeExpContents(exp);
1522 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1529 struct Statement * databaseOpenStmt = MkCompoundStmt(MkList(), MkList());
1530 struct Statement * compound;
1531 struct Statement * ifDBStmt;
1532 struct __ecereNameSpace__ecere__sys__OldList * args;
1533 char numIndexesString[16];
1535 databaseOpenStmt->__anon1.compound.context = __extension__ ({
1536 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1538 __ecereInstance1->parent = curContext, __ecereInstance1;
1540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.declarations), MkDeclaration(MkListOne(MkSpecifierName("Database")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("db")), (((void *)0))))));
1542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkSpecifier(STATIC));
1543 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkSpecifierName("bool"));
1544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.declarations), MkDeclaration(args, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("initialized")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("false")))))));
1545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("initialized"))), MkReturnStmt(MkListOne(MkExpConstant("0"))), (((void *)0))));
1546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("initialized")), '=', MkExpIdentifier(MkIdentifier("true"))))));
1548 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), CopyExpression(exp->__anon1.dbopen.name));
1549 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("no")));
1550 __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)))));
1551 __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))));
1552 compound->__anon1.compound.context = __extension__ ({
1553 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1555 __ecereInstance1->parent = databaseOpenStmt->__anon1.compound.context, __ecereInstance1;
1558 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), exp->__anon1.dbopen.name);
1559 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("create")));
1560 __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)))));
1561 exp->__anon1.dbopen.name = (((void *)0));
1562 exp->__anon1.dbopen.ds = (((void *)0));
1563 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("db"))), ifDBStmt = MkCompoundStmt(MkList(), MkList()), (((void *)0))));
1564 ifDBStmt->__anon1.compound.context = __extension__ ({
1565 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1567 __ecereInstance1->parent = databaseOpenStmt->__anon1.compound.context, __ecereInstance1;
1569 sprintf(numIndexesString, "%d", numIndexes);
1570 __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")))))))))));
1571 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Begin")), MkList()))));
1572 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), compound = MkCompoundStmt((((void *)0)), tableStatements));
1573 compound->__anon1.compound.context = __extension__ ({
1574 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1576 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1578 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), (compound = MkCompoundStmt((((void *)0)), addFieldStatements), compound->__anon1.compound.context = __extension__ ({
1579 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1581 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1583 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), compound = MkCompoundStmt((((void *)0)), indexStatements));
1584 compound->__anon1.compound.context = __extension__ ({
1585 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1587 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1589 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Commit")), MkList()))));
1591 exp->__anon1.compound = databaseOpenStmt;
1592 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("db")))));
1593 tableStatements = (((void *)0));
1597 FreeExpContents(exp);
1598 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No database table defined in this module or database_open already used.\n", (((void *)0))));
1606 static void ProcessDBTable(struct DBTableDef * table)
1608 struct __ecereNameSpace__ecere__sys__OldList * rowClassDefs = MkList(), * idClassDefs = (((void *)0));
1609 char tableName[1024];
1610 char rowClassName[1024];
1611 int len = strlen(table->name);
1612 unsigned int indexed = 0;
1614 char nameField[1024];
1615 struct __ecereNameSpace__ecere__sys__OldList * args;
1616 struct __ecereNameSpace__ecere__sys__OldList * members;
1619 idClassDefs = MkList();
1621 memcpy(tableName, table->name + 1, len - 2);
1622 tableName[len - 2] = 0;
1623 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1624 sprintf(tableID, "__ecereDBTable_%s", tableName);
1625 sprintf(rowClassName, "Row%s", tableName);
1626 __ecereNameSpace__ecere__sys__ChangeCh(rowClassName, ' ', '_');
1627 if(!tableStatements)
1629 tableStatements = MkList();
1630 indexStatements = MkList();
1631 addFieldStatements = MkList();
1634 struct External * external;
1636 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Table")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(tableID)), (((void *)0))))));
1637 external->__anon1.declaration->declMode = table->declMode;
1638 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1640 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*tableStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(tableID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")), args)))));
1641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(table->name));
1643 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpInstance(MkInstantiation((((void *)0)), (((void *)0)), MkListOne(MkMembersInitList(members)))));
1644 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("tableRows")))));
1645 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("create")))));
1648 struct ClassDefinition * _class;
1649 struct ClassDef * def;
1650 struct External * external;
1651 struct __ecereNameSpace__ecere__sys__OldList * inheritanceSpecs = MkList();
1653 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inheritanceSpecs), MkSpecifier(PRIVATE));
1654 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inheritanceSpecs), MkSpecifierName("Row"));
1656 _class = MkClass(DeclClass((((void *)0)), rowClassName), inheritanceSpecs, rowClassDefs);
1657 PopContext(curContext);
1658 def = MkClassDefDefaultProperty(MkListOne(MkMemberInitExp(MkExpIdentifier(MkIdentifier("tbl")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier(tableID))))));
1659 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1660 _class->declMode = table->declMode;
1661 external = MkExternalClass(_class);
1662 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1663 addAfter = external;
1665 if(table->definitions)
1667 struct DBTableEntry * entry;
1669 for(entry = (*table->definitions).first; entry; entry = entry->next)
1675 unsigned int isIndex = 0;
1677 struct __ecereNameSpace__ecere__sys__OldList * args;
1678 struct Specifier * spec = entry->__anon1.__anon1.dataType->qualifiers ? (struct Specifier *)(*entry->__anon1.__anon1.dataType->qualifiers).first : (((void *)0));
1680 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, entry->id->string);
1683 if(!nameField[0] && spec->type == 1 && (!strcmp(spec->__anon1.__anon1.name, "String") || !strcmp(spec->__anon1.__anon1.name, "eda::CIString")))
1685 strcpy(nameField, entry->id->string);
1687 if(!indexed && spec->type == 1 && !strcmp(spec->__anon1.__anon1.name, table->symbol->string))
1689 struct Statement * rowSet = MkCompoundStmt(MkList(), MkList());
1691 struct ClassDef * def;
1693 numIndexes = ((numIndexes > 1) ? numIndexes : 1);
1696 sprintf(name, "_%s", entry->id->string);
1697 curContext = rowSet->__anon1.compound.context = __extension__ ({
1698 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1700 __ecereInstance1->parent = globalContext, __ecereInstance1;
1702 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("Find")), args = MkList()))));
1703 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1704 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("middle")));
1705 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("nil")));
1706 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1707 curContext = globalContext;
1708 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator), MkIdentifier(name), rowSet, (((void *)0))));
1709 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1710 def->memberAccess = 1;
1711 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1716 struct Statement * rowSet = MkCompoundStmt(MkList(), MkList()), * rowGet = MkCompoundStmt(MkList(), MkList());
1717 struct ClassDef * def;
1719 curContext = rowGet->__anon1.compound.context = __extension__ ({
1720 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1722 __ecereInstance1->parent = globalContext, __ecereInstance1;
1724 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1726 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(spec->__anon1.__anon1.name), MkExpIdentifier(MkIdentifier("d")), (((void *)0)))));
1730 struct Expression * exp;
1732 __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"))))));
1733 exp->destType = __extension__ ({
1734 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
1736 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
1739 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("GetData")), args = MkList()))));
1740 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1741 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("d")));
1742 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1744 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', MkExpIdentifier(MkIdentifier("d"))))));
1747 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("d")))));
1748 curContext = rowSet->__anon1.compound.context = __extension__ ({
1749 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1751 __ecereInstance1->parent = globalContext, __ecereInstance1;
1753 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("SetData")), args = MkList()))));
1754 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1755 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1756 curContext = globalContext;
1757 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), entry->__anon1.__anon1.dataType->declarator, CopyIdentifier(entry->id), rowSet, rowGet));
1758 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1759 def->memberAccess = 1;
1760 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1763 struct External * external;
1765 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Field")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(fieldID)), (((void *)0))))));
1766 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
1767 external->__anon1.declaration->declMode = table->declMode;
1769 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*addFieldStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(fieldID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("FindField")), args)))));
1770 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(entry->__anon1.__anon1.name));
1772 __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))));
1773 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(entry->__anon1.__anon1.name));
1774 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpClass(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator)));
1775 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant("0"));
1779 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant("0"))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
1780 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant("0"))), MkIdentifier("order")), '=', MkExpIdentifier(MkIdentifier("ascending"))))));
1782 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("Index")), args))));
1783 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant("1"));
1784 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("indexes")));
1793 struct ClassDefinition * _class;
1794 struct External * external;
1795 struct ClassDef * def;
1796 struct Expression * exp;
1799 _class = MkClass(table->symbol, MkListOne(MkSpecifierName("Id")), idClassDefs);
1800 PopContext(curContext);
1801 _class->declMode = table->declMode;
1802 external = MkExternalClass(_class);
1803 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1804 addAfter = external;
1805 def = MkClassDefClassPropertyValue(MkIdentifier("table"), MkInitializerAssignment(exp = MkExpOp((((void *)0)), '&', MkExpDBTable(__ecereNameSpace__ecere__sys__CopyString(table->name)))));
1806 ProcessExpression(exp);
1807 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1810 def = MkClassDefClassPropertyValue(MkIdentifier("nameField"), MkInitializerAssignment(exp = MkExpOp((((void *)0)), '&', MkExpDBField(__ecereNameSpace__ecere__sys__CopyString(table->name), MkIdentifier(nameField)))));
1811 ProcessExpression(exp);
1812 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1815 if(table->definitions)
1817 struct DBTableEntry * entry;
1819 for(entry = (*table->definitions).first; entry; entry = entry->next)
1826 struct __ecereNameSpace__ecere__sys__OldList * args;
1827 struct Specifier * spec = entry->__anon1.__anon1.dataType->qualifiers ? (struct Specifier *)(*entry->__anon1.__anon1.dataType->qualifiers).first : (((void *)0));
1829 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, entry->id->string);
1830 if(idClassDefs && spec)
1832 struct Statement * idSet = MkCompoundStmt(MkList(), MkList()), * idGet = MkCompoundStmt(MkList(), MkList());
1833 struct ClassDef * def;
1835 curContext = idGet->__anon1.compound.context = __extension__ ({
1836 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1838 __ecereInstance1->parent = globalContext, __ecereInstance1;
1840 __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"))))))))));
1841 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1843 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(spec->__anon1.__anon1.name), MkExpIdentifier(MkIdentifier("d")), (((void *)0)))));
1847 struct Expression * exp;
1849 __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"))))));
1850 exp->destType = __extension__ ({
1851 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
1853 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
1856 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("GetData")), args = MkList()))));
1857 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1858 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("d")));
1859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), DELETE, MkExpIdentifier(MkIdentifier("r"))))));
1860 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1862 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', MkExpIdentifier(MkIdentifier("d"))))));
1865 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("d")))));
1866 curContext = idSet->__anon1.compound.context = __extension__ ({
1867 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1869 __ecereInstance1->parent = globalContext, __ecereInstance1;
1871 __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"))))))))));
1872 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("SetData")), args = MkList()))));
1873 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1874 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1875 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), DELETE, MkExpIdentifier(MkIdentifier("r"))))));
1876 curContext = globalContext;
1877 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator), CopyIdentifier(entry->id), idSet, idGet));
1878 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1879 def->memberAccess = 1;
1880 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1886 if(entry->__anon1.items && (*entry->__anon1.items).count)
1889 struct DBIndexItem * item;
1891 unsigned int needTable = 0;
1894 if(entry->id || indexed)
1896 if(entry->id || (*entry->__anon1.items).count == 1)
1898 struct External * external;
1899 struct Identifier * id = entry->id ? entry->id : ((struct DBIndexItem *)(*entry->__anon1.items).first)->id;
1901 sprintf(indexID, "__ecereDBIndex_%s_%s", tableName, id->string);
1902 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Table")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(indexID)), (((void *)0))))));
1903 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
1904 external->__anon1.declaration->declMode = table->declMode;
1908 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Multiple field index requires a name\n", (((void *)0))));
1913 strcpy(indexID, tableID);
1915 for(c = 0, item = (*entry->__anon1.items).first; item; item = item->next, c++)
1919 sprintf(num, "%d", c);
1920 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, item->id->string);
1921 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant(num))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
1922 __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"))))));
1924 sprintf(num, "%d", c);
1925 numIndexes = ((numIndexes > c) ? numIndexes : c);
1929 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(indexID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")), args)))));
1930 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(table->name));
1932 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpInstance(MkInstantiation((((void *)0)), (((void *)0)), MkListOne(MkMembersInitList(members)))));
1933 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("tableRows")))));
1936 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(indexID)), MkIdentifier("Index")), args))));
1937 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant(num));
1938 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("indexes")));
1947 static void ProcessDeclaration(struct Declaration * decl);
1949 static void ProcessSpecifier(struct Specifier * spec)
1957 if(spec->__anon1.__anon2.definitions)
1959 struct ClassDef * def;
1961 for(def = (*spec->__anon1.__anon2.definitions).first; def; def = def->next)
1966 ProcessDeclaration(def->__anon1.decl);
1970 struct MemberInit * init;
1972 for(init = (*def->__anon1.defProperties).first; init; init = init->next)
1974 ProcessMemberInit(init);
1979 ProcessClassFunction(def->__anon1.function);
1982 if(def->__anon1.propertyDef)
1984 ProcessProperty(def->__anon1.propertyDef);
1988 if(def->__anon1.propertyWatch && def->__anon1.propertyWatch->compound)
1990 ProcessStatement(def->__anon1.propertyWatch->compound);
1994 if(def->__anon1.__anon1.initializer)
1995 ProcessInitializer(def->__anon1.__anon1.initializer);
2005 static void ProcessStatement(struct Statement * stmt)
2010 ProcessStatement(stmt->__anon1.labeled.stmt);
2013 if(stmt->__anon1.caseStmt.exp)
2015 ProcessExpression(stmt->__anon1.caseStmt.exp);
2017 if(stmt->__anon1.caseStmt.stmt)
2019 ProcessStatement(stmt->__anon1.caseStmt.stmt);
2024 ProcessDeclaration(stmt->__anon1.decl);
2029 struct Context * oldContext = curContext;
2031 curContext = stmt->__anon1.compound.context;
2032 if(stmt->__anon1.compound.declarations)
2034 struct Declaration * decl;
2036 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
2038 ProcessDeclaration(decl);
2041 if(stmt->__anon1.compound.statements)
2043 struct Statement * statement;
2045 for(statement = (*stmt->__anon1.compound.statements).first; statement; statement = statement->next)
2047 ProcessStatement(statement);
2050 curContext = oldContext;
2055 if(stmt->__anon1.expressions)
2057 struct Expression * exp;
2059 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
2061 ProcessExpression(exp);
2068 struct Expression * exp;
2070 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
2072 ProcessExpression(exp);
2074 if(stmt->__anon1.ifStmt.stmt)
2076 ProcessStatement(stmt->__anon1.ifStmt.stmt);
2078 if(stmt->__anon1.ifStmt.elseStmt)
2080 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
2086 struct Expression * exp;
2088 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
2090 ProcessExpression(exp);
2092 ProcessStatement(stmt->__anon1.switchStmt.stmt);
2097 struct Expression * exp;
2099 if(stmt->__anon1.whileStmt.exp)
2101 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
2103 ProcessExpression(exp);
2106 if(stmt->__anon1.whileStmt.stmt)
2107 ProcessStatement(stmt->__anon1.whileStmt.stmt);
2112 ProcessStatement(stmt->__anon1.doWhile.stmt);
2113 if(stmt->__anon1.doWhile.exp)
2115 struct Expression * exp;
2117 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
2119 ProcessExpression(exp);
2126 struct Expression * exp;
2128 if(stmt->__anon1.forStmt.init)
2130 ProcessStatement(stmt->__anon1.forStmt.init);
2132 if(stmt->__anon1.forStmt.check)
2134 ProcessStatement(stmt->__anon1.forStmt.check);
2136 if(stmt->__anon1.forStmt.increment)
2138 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
2140 ProcessExpression(exp);
2143 if(stmt->__anon1.forStmt.stmt)
2144 ProcessStatement(stmt->__anon1.forStmt.stmt);
2154 if(stmt->__anon1.expressions)
2156 struct Expression * exp;
2158 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
2160 ProcessExpression(exp);
2167 struct Identifier * _watch;
2169 if(stmt->__anon1._watch.watcher)
2171 ProcessExpression(stmt->__anon1._watch.watcher);
2173 if(stmt->__anon1._watch.object)
2175 ProcessExpression(stmt->__anon1._watch.object);
2177 if(stmt->__anon1._watch.watches)
2179 for(_watch = (*stmt->__anon1._watch.watches).first; _watch; _watch = _watch->next)
2181 ProcessIdentifier(_watch);
2188 struct PropertyWatch * _watch;
2190 if(stmt->__anon1._watch.watcher)
2192 ProcessExpression(stmt->__anon1._watch.watcher);
2194 if(stmt->__anon1._watch.object)
2196 ProcessExpression(stmt->__anon1._watch.object);
2198 if(stmt->__anon1._watch.watches)
2200 for(_watch = (*stmt->__anon1._watch.watches).first; _watch; _watch = _watch->next)
2202 if(_watch->compound)
2204 ProcessStatement(_watch->compound);
2213 static void ProcessClassDef(struct ClassDef * def)
2218 ProcessDeclaration(def->__anon1.decl);
2222 struct MemberInit * init;
2224 for(init = (*def->__anon1.defProperties).first; init; init = init->next)
2226 ProcessMemberInit(init);
2231 if(def->__anon1.__anon1.initializer)
2232 ProcessInitializer(def->__anon1.__anon1.initializer);
2235 ProcessClassFunction(def->__anon1.function);
2238 if(def->__anon1.propertyDef)
2240 ProcessProperty(def->__anon1.propertyDef);
2244 if(def->__anon1.propertyWatch && def->__anon1.propertyWatch->compound)
2246 ProcessStatement(def->__anon1.propertyWatch->compound);
2252 static void ProcessDeclaration(struct Declaration * decl)
2258 struct Specifier * spec;
2260 if(decl->__anon1.__anon1.specifiers)
2262 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
2264 ProcessSpecifier(spec);
2271 if(decl->__anon1.__anon1.specifiers)
2273 struct Specifier * s;
2275 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
2277 ProcessSpecifier(s);
2280 if(decl->__anon1.__anon1.declarators && (*decl->__anon1.__anon1.declarators).first)
2282 struct InitDeclarator * d;
2284 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
2286 ProcessInitDeclarator(d);
2292 ProcessInstance(decl->__anon1.inst);
2297 static void ProcessClass(struct ClassDefinition * _class)
2299 if(_class->definitions)
2301 struct ClassDef * def;
2303 for(def = (*_class->definitions).first; def; def = def->next)
2305 ProcessClassDef(def);
2310 void ProcessDBTableDefinitions()
2312 struct External * external;
2314 addAfter = (((void *)0));
2315 curContext = globalContext;
2317 PrePreProcessClassDefinitions();
2318 DeclClass((((void *)0)), "Field");
2319 DeclClass((((void *)0)), "Table");
2320 DeclClass((((void *)0)), "Row");
2321 DeclClass((((void *)0)), "Id");
2323 if(ast != (((void *)0)))
2325 for(external = (*ast).first; external; external = external->next)
2327 curExternal = external;
2328 addAfter = external->prev;
2329 switch(external->type)
2332 ProcessDBTable(external->__anon1.table);
2336 for(external = (*ast).first; external; external = external->next)
2338 curExternal = external;
2339 addAfter = external->prev;
2340 switch(external->type)
2343 ProcessFunction(external->__anon1.function);
2346 ProcessDeclaration(external->__anon1.declaration);
2349 ProcessClass(external->__anon1._class);
2354 curContext = globalContext;
2357 void __ecereRegisterModule_dbpass(struct __ecereNameSpace__ecere__com__Instance * module)
2359 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessDBTableDefinitions", "void ProcessDBTableDefinitions(void)", ProcessDBTableDefinitions, module, 1);