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 stdcall __attribute__((__stdcall__))
42 # define stdcall __stdcall
48 #include <sys/types.h>
51 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
54 static int numIndexes;
56 extern unsigned int inCompiler;
58 struct __ecereNameSpace__ecere__sys__OldList
65 } __attribute__ ((gcc_struct));
67 struct __ecereNameSpace__ecere__sys__BTNode;
69 struct __ecereNameSpace__ecere__com__DataValue
84 } __attribute__ ((gcc_struct)) __anon1;
85 } __attribute__ ((gcc_struct));
87 struct __ecereNameSpace__ecere__com__SerialBuffer
89 unsigned char * _buffer;
93 } __attribute__ ((gcc_struct));
95 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
97 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
99 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
101 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
103 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
119 struct TemplateParameter;
121 struct TemplateArgument;
123 struct TemplateDatatype;
131 } __attribute__ ((gcc_struct));
133 extern size_t strlen(const char * );
135 extern void * memcpy(void * , const void * , size_t size);
137 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
139 extern int sprintf(char * , const char * , ...);
141 extern void Compiler_Error(const char * format, ...);
143 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
145 struct __ecereNameSpace__ecere__com__LinkList
150 } __attribute__ ((gcc_struct));
152 extern int strcmp(const char * , const char * );
154 extern char * strcpy(char * , const char * );
160 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
162 extern void PrePreProcessClassDefinitions(void);
164 struct __ecereNameSpace__ecere__com__GlobalFunction;
166 static struct __ecereNameSpace__ecere__sys__OldList * tableStatements, * indexStatements, * addFieldStatements;
168 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
170 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
172 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
174 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
176 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
178 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
180 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
184 struct CodePosition start;
185 struct CodePosition end;
186 } __attribute__ ((gcc_struct));
188 extern struct Location yylloc;
192 static struct External * addAfter;
194 extern struct External * curExternal;
198 static void ProcessIdentifier(struct Identifier * id)
202 extern struct Identifier * MkIdentifier(const char * string);
204 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
206 extern struct Identifier * CopyIdentifier(struct Identifier * id);
210 extern struct Context * curContext;
212 extern struct Context * PushContext(void);
214 extern void PopContext(struct Context * ctx);
216 extern struct Context * globalContext;
218 struct __ecereNameSpace__ecere__com__Class;
220 struct __ecereNameSpace__ecere__com__Instance
223 struct __ecereNameSpace__ecere__com__Class * _class;
225 } __attribute__ ((gcc_struct));
227 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
229 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
231 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
233 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
235 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
237 struct __ecereNameSpace__ecere__com__Property;
239 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
241 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);
243 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
245 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
249 extern void FreeExpContents(struct Expression * exp);
251 extern struct Expression * MkExpIdentifier(struct Identifier * id);
253 extern struct Expression * MkExpConstant(const char * string);
255 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
257 extern struct Expression * CopyExpression(struct Expression * exp);
259 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
261 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
263 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
265 extern struct Expression * MkExpString(const char * string);
267 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
269 extern struct Expression * MkExpIndex(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * index);
271 extern struct Expression * MkExpDBTable(char * table);
273 extern struct Expression * MkExpDBField(char * table, struct Identifier * id);
277 extern struct Specifier * MkSpecifierName(const char * name);
279 extern struct Specifier * MkSpecifier(int specifier);
281 extern struct Specifier * CopySpecifier(struct Specifier * spec);
285 struct Instantiation;
287 extern struct Expression * MkExpInstance(struct Instantiation * inst);
289 extern struct Instantiation * MkInstantiation(struct Specifier * _class, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
293 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
295 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
297 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
299 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
301 extern struct PropertyDef * MkProperty(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl, struct Identifier * id, struct Statement * setStmt, struct Statement * getStmt);
307 struct Statement * prev;
308 struct Statement * next;
313 struct __ecereNameSpace__ecere__sys__OldList * expressions;
316 struct Identifier * id;
317 struct Statement * stmt;
318 } __attribute__ ((gcc_struct)) labeled;
321 struct Expression * exp;
322 struct Statement * stmt;
323 } __attribute__ ((gcc_struct)) caseStmt;
326 struct __ecereNameSpace__ecere__sys__OldList * declarations;
327 struct __ecereNameSpace__ecere__sys__OldList * statements;
328 struct Context * context;
329 unsigned int isSwitch;
330 } __attribute__ ((gcc_struct)) compound;
333 struct __ecereNameSpace__ecere__sys__OldList * exp;
334 struct Statement * stmt;
335 struct Statement * elseStmt;
336 } __attribute__ ((gcc_struct)) ifStmt;
339 struct __ecereNameSpace__ecere__sys__OldList * exp;
340 struct Statement * stmt;
341 } __attribute__ ((gcc_struct)) switchStmt;
344 struct __ecereNameSpace__ecere__sys__OldList * exp;
345 struct Statement * stmt;
346 } __attribute__ ((gcc_struct)) whileStmt;
349 struct __ecereNameSpace__ecere__sys__OldList * exp;
350 struct Statement * stmt;
351 } __attribute__ ((gcc_struct)) doWhile;
354 struct Statement * init;
355 struct Statement * check;
356 struct __ecereNameSpace__ecere__sys__OldList * increment;
357 struct Statement * stmt;
358 } __attribute__ ((gcc_struct)) forStmt;
361 struct Identifier * id;
362 } __attribute__ ((gcc_struct)) gotoStmt;
365 struct Specifier * spec;
367 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
368 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
369 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
370 } __attribute__ ((gcc_struct)) asmStmt;
373 struct Expression * watcher;
374 struct Expression * object;
375 struct __ecereNameSpace__ecere__sys__OldList * watches;
376 } __attribute__ ((gcc_struct)) _watch;
379 struct Identifier * id;
380 struct __ecereNameSpace__ecere__sys__OldList * exp;
381 struct __ecereNameSpace__ecere__sys__OldList * filter;
382 struct Statement * stmt;
383 } __attribute__ ((gcc_struct)) forEachStmt;
384 struct Declaration * decl;
385 } __attribute__ ((gcc_struct)) __anon1;
386 } __attribute__ ((gcc_struct));
388 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
390 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
392 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
396 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
398 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
402 struct Initializer * prev;
403 struct Initializer * next;
408 struct Expression * exp;
409 struct __ecereNameSpace__ecere__sys__OldList * list;
410 } __attribute__ ((gcc_struct)) __anon1;
411 unsigned int isConstant;
412 struct Identifier * id;
413 } __attribute__ ((gcc_struct));
419 struct Specifier * prev;
420 struct Specifier * next;
428 struct ExtDecl * extDecl;
430 struct Symbol * symbol;
431 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
432 struct Specifier * nsSpec;
433 } __attribute__ ((gcc_struct)) __anon1;
436 struct Identifier * id;
437 struct __ecereNameSpace__ecere__sys__OldList * list;
438 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
439 struct __ecereNameSpace__ecere__sys__OldList * definitions;
440 unsigned int addNameSpace;
441 struct Context * ctx;
442 struct ExtDecl * extDeclStruct;
443 } __attribute__ ((gcc_struct)) __anon2;
444 struct Expression * expression;
445 struct Specifier * _class;
446 struct TemplateParameter * templateParameter;
447 } __attribute__ ((gcc_struct)) __anon1;
448 } __attribute__ ((gcc_struct));
452 struct Identifier * prev;
453 struct Identifier * next;
455 struct Symbol * classSym;
456 struct Specifier * _class;
458 struct Identifier * badID;
459 } __attribute__ ((gcc_struct));
463 struct Declaration * prev;
464 struct Declaration * next;
471 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
472 struct __ecereNameSpace__ecere__sys__OldList * declarators;
473 } __attribute__ ((gcc_struct)) __anon1;
474 struct Instantiation * inst;
477 struct Identifier * id;
478 struct Expression * exp;
479 } __attribute__ ((gcc_struct)) __anon2;
480 } __attribute__ ((gcc_struct)) __anon1;
481 struct Specifier * extStorage;
482 struct Symbol * symbol;
484 } __attribute__ ((gcc_struct));
488 struct Instantiation * prev;
489 struct Instantiation * next;
491 struct Specifier * _class;
492 struct Expression * exp;
493 struct __ecereNameSpace__ecere__sys__OldList * members;
494 struct Symbol * symbol;
495 unsigned int fullSet;
496 unsigned int isConstant;
497 unsigned char * data;
498 struct Location nameLoc;
499 struct Location insideLoc;
501 } __attribute__ ((gcc_struct));
505 struct PropertyDef * prev;
506 struct PropertyDef * next;
508 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
509 struct Declarator * declarator;
510 struct Identifier * id;
511 struct Statement * getStmt;
512 struct Statement * setStmt;
513 struct Statement * issetStmt;
514 struct Symbol * symbol;
515 struct Expression * category;
518 unsigned int conversion : 1;
519 unsigned int isWatchable : 1;
520 unsigned int isDBProp : 1;
521 } __attribute__ ((gcc_struct)) __anon1;
522 } __attribute__ ((gcc_struct));
527 struct Symbol * symbol;
528 struct __ecereNameSpace__ecere__sys__OldList * definitions;
530 } __attribute__ ((gcc_struct));
532 extern struct Symbol * DeclClass(struct Specifier * _class, const char * name);
536 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
540 extern struct ClassDef * MkClassDefDefaultProperty(struct __ecereNameSpace__ecere__sys__OldList * defProperties);
542 extern struct ClassDef * MkClassDefProperty(struct PropertyDef * propertyDef);
544 extern struct ClassDef * MkClassDefClassPropertyValue(struct Identifier * id, struct Initializer * initializer);
546 struct __ecereNameSpace__ecere__sys__BinaryTree;
548 struct __ecereNameSpace__ecere__sys__BinaryTree
550 struct __ecereNameSpace__ecere__sys__BTNode * root;
552 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
553 void (* FreeKey)(void * key);
554 } __attribute__ ((gcc_struct));
556 struct ClassDefinition;
558 struct ClassDefinition
560 struct ClassDefinition * prev;
561 struct ClassDefinition * next;
563 struct Specifier * _class;
564 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
565 struct __ecereNameSpace__ecere__sys__OldList * definitions;
566 struct Symbol * symbol;
567 struct Location blockStart;
568 struct Location nameLoc;
570 unsigned int deleteWatchable;
571 } __attribute__ ((gcc_struct));
573 extern struct ClassDefinition * MkClass(struct Symbol * symbol, struct __ecereNameSpace__ecere__sys__OldList * baseSpecs, struct __ecereNameSpace__ecere__sys__OldList * definitions);
575 extern struct External * MkExternalClass(struct ClassDefinition * _class);
579 struct Context * parent;
580 struct __ecereNameSpace__ecere__sys__BinaryTree types;
581 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
582 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
583 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
586 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
587 struct ClassDefinition * classDef;
588 unsigned int templateTypesOnly;
589 unsigned int hasNameSpace;
590 } __attribute__ ((gcc_struct));
598 struct DBIndexItem * prev;
599 struct DBIndexItem * next;
600 struct Identifier * id;
602 } __attribute__ ((gcc_struct));
604 struct __ecereNameSpace__ecere__com__Method;
606 struct __ecereNameSpace__ecere__com__Module;
608 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);
612 struct __ecereNameSpace__ecere__com__Property
614 struct __ecereNameSpace__ecere__com__Property * prev;
615 struct __ecereNameSpace__ecere__com__Property * next;
617 unsigned int isProperty;
620 struct __ecereNameSpace__ecere__com__Class * _class;
621 const char * dataTypeString;
622 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
623 struct Type * dataType;
624 void (* Set)(void * , int);
625 int (* Get)(void * );
626 unsigned int (* IsSet)(void * );
630 unsigned int conversion;
631 unsigned int watcherOffset;
632 const char * category;
633 unsigned int compiled;
634 unsigned int selfWatchable;
635 unsigned int isWatchable;
636 } __attribute__ ((gcc_struct));
638 struct __ecereNameSpace__ecere__com__Method
641 struct __ecereNameSpace__ecere__com__Method * parent;
642 struct __ecereNameSpace__ecere__com__Method * left;
643 struct __ecereNameSpace__ecere__com__Method * right;
648 struct __ecereNameSpace__ecere__com__Class * _class;
650 const char * dataTypeString;
651 struct Type * dataType;
653 } __attribute__ ((gcc_struct));
658 struct Symbol * parent;
659 struct Symbol * left;
660 struct Symbol * right;
665 struct __ecereNameSpace__ecere__com__Method * method;
666 struct __ecereNameSpace__ecere__com__Property * _property;
667 struct __ecereNameSpace__ecere__com__Class * registered;
668 } __attribute__ ((gcc_struct)) __anon1;
669 unsigned int notYetDeclared;
674 struct External * pointerExternal;
675 struct External * structExternal;
676 } __attribute__ ((gcc_struct)) __anon1;
679 struct External * externalGet;
680 struct External * externalSet;
681 struct External * externalPtr;
682 struct External * externalIsSet;
683 } __attribute__ ((gcc_struct)) __anon2;
686 struct External * methodExternal;
687 struct External * methodCodeExternal;
688 } __attribute__ ((gcc_struct)) __anon3;
689 } __attribute__ ((gcc_struct)) __anon2;
690 unsigned int imported;
691 unsigned int declaredStructSym;
692 struct __ecereNameSpace__ecere__com__Class * _class;
693 unsigned int declaredStruct;
694 unsigned int needConstructor;
695 unsigned int needDestructor;
696 char * constructorName;
699 char * destructorName;
700 struct ModuleImport * module;
701 struct ClassImport * _import;
702 struct Location nameLoc;
703 unsigned int isParam;
704 unsigned int isRemote;
705 unsigned int isStruct;
706 unsigned int fireWatchersDone;
708 unsigned int classData;
709 unsigned int isStatic;
711 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
712 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
713 struct Context * ctx;
715 struct Expression * propCategory;
716 unsigned int mustRegister;
717 } __attribute__ ((gcc_struct));
726 struct Symbol * _class;
729 struct __ecereNameSpace__ecere__sys__OldList members;
731 } __attribute__ ((gcc_struct)) __anon1;
734 struct Type * returnType;
735 struct __ecereNameSpace__ecere__sys__OldList params;
736 struct Symbol * thisClass;
737 unsigned int staticMethod;
738 struct TemplateParameter * thisClassTemplate;
739 } __attribute__ ((gcc_struct)) __anon2;
742 struct __ecereNameSpace__ecere__com__Method * method;
743 struct __ecereNameSpace__ecere__com__Class * methodClass;
744 struct __ecereNameSpace__ecere__com__Class * usedClass;
745 } __attribute__ ((gcc_struct)) __anon3;
748 struct Type * arrayType;
750 struct Expression * arraySizeExp;
751 unsigned int freeExp;
752 struct Symbol * enumClass;
753 } __attribute__ ((gcc_struct)) __anon4;
755 struct TemplateParameter * templateParameter;
756 } __attribute__ ((gcc_struct)) __anon1;
761 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
767 unsigned int isSigned : 1;
768 unsigned int constant : 1;
769 unsigned int truth : 1;
770 unsigned int byReference : 1;
771 unsigned int extraParam : 1;
772 unsigned int directClassAccess : 1;
773 unsigned int computing : 1;
774 unsigned int keepCast : 1;
775 unsigned int passAsTemplate : 1;
776 unsigned int dllExport : 1;
777 unsigned int attrStdcall : 1;
778 unsigned int declaredWithStruct : 1;
779 unsigned int typedByReference : 1;
780 unsigned int casted : 1;
781 unsigned int pointerAlignment : 1;
782 unsigned int isLong : 1;
783 } __attribute__ ((gcc_struct));
789 struct Expression * prev;
790 struct Expression * next;
798 struct Identifier * identifier;
799 } __attribute__ ((gcc_struct)) __anon1;
800 struct Statement * compound;
801 struct Instantiation * instance;
805 unsigned int intlString;
806 unsigned int wideString;
807 } __attribute__ ((gcc_struct)) __anon2;
808 struct __ecereNameSpace__ecere__sys__OldList * list;
811 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
812 struct Declarator * decl;
813 } __attribute__ ((gcc_struct)) _classExp;
816 struct Identifier * id;
817 } __attribute__ ((gcc_struct)) classData;
820 struct Expression * exp;
821 struct __ecereNameSpace__ecere__sys__OldList * arguments;
822 struct Location argLoc;
823 } __attribute__ ((gcc_struct)) call;
826 struct Expression * exp;
827 struct __ecereNameSpace__ecere__sys__OldList * index;
828 } __attribute__ ((gcc_struct)) index;
831 struct Expression * exp;
832 struct Identifier * member;
834 unsigned int thisPtr;
835 } __attribute__ ((gcc_struct)) member;
839 struct Expression * exp1;
840 struct Expression * exp2;
841 } __attribute__ ((gcc_struct)) op;
842 struct TypeName * typeName;
843 struct Specifier * _class;
846 struct TypeName * typeName;
847 struct Expression * exp;
848 } __attribute__ ((gcc_struct)) cast;
851 struct Expression * cond;
852 struct __ecereNameSpace__ecere__sys__OldList * exp;
853 struct Expression * elseExp;
854 } __attribute__ ((gcc_struct)) cond;
857 struct TypeName * typeName;
858 struct Expression * size;
859 } __attribute__ ((gcc_struct)) _new;
862 struct TypeName * typeName;
863 struct Expression * size;
864 struct Expression * exp;
865 } __attribute__ ((gcc_struct)) _renew;
869 struct Identifier * id;
870 } __attribute__ ((gcc_struct)) db;
873 struct Expression * ds;
874 struct Expression * name;
875 } __attribute__ ((gcc_struct)) dbopen;
878 struct TypeName * typeName;
879 struct Initializer * initializer;
880 } __attribute__ ((gcc_struct)) initializer;
883 struct Expression * exp;
884 struct TypeName * typeName;
885 } __attribute__ ((gcc_struct)) vaArg;
886 } __attribute__ ((gcc_struct)) __anon1;
887 unsigned int debugValue;
888 struct __ecereNameSpace__ecere__com__DataValue val;
890 unsigned int hasAddress;
891 struct Type * expType;
892 struct Type * destType;
895 unsigned int byReference;
896 unsigned int isConstant;
897 unsigned int addedThis;
898 unsigned int needCast;
899 unsigned int thisPtr;
900 unsigned int opDestType;
901 unsigned int needTemplateCast;
902 } __attribute__ ((gcc_struct));
906 struct DBTableEntry * prev;
907 struct DBTableEntry * next;
909 struct Identifier * id;
914 struct TypeName * dataType;
916 } __attribute__ ((gcc_struct)) __anon1;
917 struct __ecereNameSpace__ecere__sys__OldList * items;
918 } __attribute__ ((gcc_struct)) __anon1;
919 } __attribute__ ((gcc_struct));
923 struct TypeName * prev;
924 struct TypeName * next;
926 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
927 struct Declarator * declarator;
929 struct Expression * bitCount;
930 } __attribute__ ((gcc_struct));
932 struct PropertyWatch;
936 struct PropertyWatch * prev;
937 struct PropertyWatch * next;
939 struct Statement * compound;
940 struct __ecereNameSpace__ecere__sys__OldList * properties;
941 unsigned int deleteWatch;
942 } __attribute__ ((gcc_struct));
948 struct MemberInit * prev;
949 struct MemberInit * next;
951 struct Location realLoc;
952 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
953 struct Initializer * initializer;
955 unsigned int variable;
956 unsigned int takeOutExp;
957 } __attribute__ ((gcc_struct));
959 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
961 extern struct MemberInit * MkMemberInitExp(struct Expression * idExp, struct Initializer * initializer);
963 struct InitDeclarator;
965 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
967 struct InitDeclarator
969 struct InitDeclarator * prev;
970 struct InitDeclarator * next;
972 struct Declarator * declarator;
973 struct Initializer * initializer;
974 } __attribute__ ((gcc_struct));
976 static void ProcessExpression(struct Expression * exp);
978 static void ProcessInitializer(struct Initializer * initializer)
980 switch(initializer->type)
984 struct Initializer * init;
986 for(init = (*initializer->__anon1.list).first; init; init = init->next)
988 ProcessInitializer(init);
993 ProcessExpression(initializer->__anon1.exp);
998 static void ProcessInitDeclarator(struct InitDeclarator * decl)
1000 if(decl->initializer)
1001 ProcessInitializer(decl->initializer);
1004 static void ProcessMemberInit(struct MemberInit * init)
1006 if(init->initializer)
1008 ProcessInitializer(init->initializer);
1012 static void ProcessStatement(struct Statement * stmt);
1014 static void ProcessProperty(struct PropertyDef * def)
1018 ProcessStatement(def->getStmt);
1022 ProcessStatement(def->setStmt);
1026 struct ClassFunction;
1030 struct ClassDef * prev;
1031 struct ClassDef * next;
1032 struct Location loc;
1036 struct Declaration * decl;
1037 struct ClassFunction * function;
1038 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1039 struct PropertyDef * propertyDef;
1040 struct PropertyWatch * propertyWatch;
1042 struct Identifier * defaultProperty;
1045 struct Identifier * id;
1046 struct Initializer * initializer;
1047 } __attribute__ ((gcc_struct)) __anon1;
1048 } __attribute__ ((gcc_struct)) __anon1;
1051 } __attribute__ ((gcc_struct));
1055 struct MembersInit * prev;
1056 struct MembersInit * next;
1057 struct Location loc;
1061 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1062 struct ClassFunction * function;
1063 } __attribute__ ((gcc_struct)) __anon1;
1064 } __attribute__ ((gcc_struct));
1066 struct ClassFunction
1068 struct ClassFunction * prev;
1069 struct ClassFunction * next;
1070 struct Location loc;
1071 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1072 struct Declarator * declarator;
1073 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1074 struct Statement * body;
1075 struct __ecereNameSpace__ecere__com__Class * _class;
1076 struct __ecereNameSpace__ecere__sys__OldList attached;
1079 struct Symbol * propSet;
1080 unsigned int isVirtual;
1081 unsigned int isConstructor;
1082 unsigned int isDestructor;
1083 unsigned int dontMangle;
1086 } __attribute__ ((gcc_struct));
1088 static void ProcessClassFunction(struct ClassFunction * func)
1092 ProcessStatement(func->body);
1096 static void ProcessInstance(struct Instantiation * inst)
1100 struct MembersInit * init;
1101 struct MemberInit * memberInit;
1103 for(init = (*inst->members).first; init; init = init->next)
1105 if(init->type == 0 && init->__anon1.dataMembers)
1107 for(memberInit = (*init->__anon1.dataMembers).first; memberInit; memberInit = memberInit->next)
1109 ProcessMemberInit(memberInit);
1114 ProcessClassFunction(init->__anon1.function);
1120 struct __ecereNameSpace__ecere__com__NameSpace;
1122 struct __ecereNameSpace__ecere__com__NameSpace
1125 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1126 struct __ecereNameSpace__ecere__com__NameSpace * left;
1127 struct __ecereNameSpace__ecere__com__NameSpace * right;
1129 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1130 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1131 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1132 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1133 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1134 } __attribute__ ((gcc_struct));
1136 struct __ecereNameSpace__ecere__com__Application
1139 const char * * argv;
1141 unsigned int isGUIApp;
1142 struct __ecereNameSpace__ecere__sys__OldList allModules;
1143 char * parsedCommand;
1144 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1145 } __attribute__ ((gcc_struct));
1147 struct __ecereNameSpace__ecere__com__Module
1149 struct __ecereNameSpace__ecere__com__Instance * application;
1150 struct __ecereNameSpace__ecere__sys__OldList classes;
1151 struct __ecereNameSpace__ecere__sys__OldList defines;
1152 struct __ecereNameSpace__ecere__sys__OldList functions;
1153 struct __ecereNameSpace__ecere__sys__OldList modules;
1154 struct __ecereNameSpace__ecere__com__Instance * prev;
1155 struct __ecereNameSpace__ecere__com__Instance * next;
1161 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1162 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1163 } __attribute__ ((gcc_struct));
1165 void __ecereUnregisterModule_dbpass(struct __ecereNameSpace__ecere__com__Instance * module)
1170 struct FunctionDefinition;
1172 typedef union YYSTYPE
1177 struct Identifier * id;
1178 struct Expression * exp;
1179 struct Specifier * specifier;
1180 struct __ecereNameSpace__ecere__sys__OldList * list;
1181 struct Enumerator * enumerator;
1182 struct Declarator * declarator;
1183 struct Pointer * pointer;
1184 struct Initializer * initializer;
1185 struct InitDeclarator * initDeclarator;
1186 struct TypeName * typeName;
1187 struct Declaration * declaration;
1188 struct Statement * stmt;
1189 struct FunctionDefinition * function;
1190 struct External * external;
1191 struct Context * context;
1192 struct AsmField * asmField;
1193 struct Attrib * attrib;
1194 struct ExtDecl * extDecl;
1195 struct Attribute * attribute;
1196 struct Instantiation * instance;
1197 struct MembersInit * membersInit;
1198 struct MemberInit * memberInit;
1199 struct ClassFunction * classFunction;
1200 struct ClassDefinition * _class;
1201 struct ClassDef * classDef;
1202 struct PropertyDef * prop;
1204 struct Symbol * symbol;
1205 struct PropertyWatch * propertyWatch;
1206 struct TemplateParameter * templateParameter;
1207 struct TemplateArgument * templateArgument;
1208 struct TemplateDatatype * templateDatatype;
1209 struct DBTableEntry * dbtableEntry;
1210 struct DBIndexItem * dbindexItem;
1211 struct DBTableDef * dbtableDef;
1212 } __attribute__ ((gcc_struct)) YYSTYPE;
1214 extern YYSTYPE yylval;
1216 struct FunctionDefinition
1218 struct FunctionDefinition * prev;
1219 struct FunctionDefinition * next;
1220 struct Location loc;
1221 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1222 struct Declarator * declarator;
1223 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1224 struct Statement * body;
1225 struct __ecereNameSpace__ecere__com__Class * _class;
1226 struct __ecereNameSpace__ecere__sys__OldList attached;
1229 struct Symbol * propSet;
1231 unsigned int propertyNoThis;
1232 } __attribute__ ((gcc_struct));
1236 struct External * prev;
1237 struct External * next;
1238 struct Location loc;
1240 struct Symbol * symbol;
1243 struct FunctionDefinition * function;
1244 struct ClassDefinition * _class;
1245 struct Declaration * declaration;
1246 char * importString;
1247 struct Identifier * id;
1248 struct DBTableDef * table;
1249 } __attribute__ ((gcc_struct)) __anon1;
1251 struct External * fwdDecl;
1252 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1253 struct __ecereNameSpace__ecere__com__Instance * incoming;
1254 int nonBreakableIncoming;
1255 } __attribute__ ((gcc_struct));
1257 static void ProcessFunction(struct FunctionDefinition * func)
1261 ProcessStatement(func->body);
1265 struct __ecereNameSpace__ecere__com__DataMember;
1267 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1273 const char * dataTypeString;
1274 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1275 } __attribute__ ((gcc_struct)) __anon1;
1276 struct __ecereNameSpace__ecere__com__DataValue expression;
1279 const char * memberString;
1282 struct __ecereNameSpace__ecere__com__DataMember * member;
1283 struct __ecereNameSpace__ecere__com__Property * prop;
1284 struct __ecereNameSpace__ecere__com__Method * method;
1285 } __attribute__ ((gcc_struct)) __anon1;
1286 } __attribute__ ((gcc_struct)) __anon2;
1287 } __attribute__ ((gcc_struct)) __anon1;
1288 } __attribute__ ((gcc_struct));
1290 struct __ecereNameSpace__ecere__com__DataMember
1292 struct __ecereNameSpace__ecere__com__DataMember * prev;
1293 struct __ecereNameSpace__ecere__com__DataMember * next;
1295 unsigned int isProperty;
1298 struct __ecereNameSpace__ecere__com__Class * _class;
1299 const char * dataTypeString;
1300 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1301 struct Type * dataType;
1305 struct __ecereNameSpace__ecere__sys__OldList members;
1306 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
1308 short structAlignment;
1309 short pointerAlignment;
1310 } __attribute__ ((gcc_struct));
1312 struct __ecereNameSpace__ecere__com__Class
1314 struct __ecereNameSpace__ecere__com__Class * prev;
1315 struct __ecereNameSpace__ecere__com__Class * next;
1321 unsigned int (* Constructor)(void * );
1322 void (* Destructor)(void * );
1325 struct __ecereNameSpace__ecere__com__Class * base;
1326 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1327 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1328 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1329 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1330 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1331 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1335 struct __ecereNameSpace__ecere__com__Instance * module;
1336 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
1337 const char * dataTypeString;
1338 struct Type * dataType;
1340 int defaultAlignment;
1341 void (* Initialize)();
1343 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1344 const char * designerClass;
1345 unsigned int noExpansion;
1346 const char * defaultProperty;
1347 unsigned int comRedefinition;
1350 unsigned int internalDecl;
1352 unsigned int computeSize;
1353 short structAlignment;
1354 short pointerAlignment;
1355 int destructionWatchOffset;
1357 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1358 int inheritanceAccess;
1359 const char * fullName;
1361 struct __ecereNameSpace__ecere__sys__OldList conversions;
1362 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1363 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
1364 struct __ecereNameSpace__ecere__com__Class * templateClass;
1365 struct __ecereNameSpace__ecere__sys__OldList templatized;
1367 unsigned int isInstanceClass;
1368 unsigned int byValueSystemClass;
1369 } __attribute__ ((gcc_struct));
1371 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
1373 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
1375 static void ProcessExpression(struct Expression * exp)
1380 ProcessExpression(exp->__anon1._new.size);
1383 ProcessExpression(exp->__anon1._renew.exp);
1384 ProcessExpression(exp->__anon1._renew.size);
1389 ProcessIdentifier(exp->__anon1.__anon1.identifier);
1392 ProcessInstance(exp->__anon1.instance);
1397 if(exp->__anon1.op.exp1)
1399 ProcessExpression(exp->__anon1.op.exp1);
1401 if(exp->__anon1.op.exp2)
1403 ProcessExpression(exp->__anon1.op.exp2);
1408 struct Expression * expression;
1410 for(expression = (*exp->__anon1.list).first; expression; expression = expression->next)
1412 ProcessExpression(expression);
1418 struct Expression * expression;
1420 ProcessExpression(exp->__anon1.index.exp);
1421 for(expression = (*exp->__anon1.index.index).first; expression; expression = expression->next)
1423 ProcessExpression(expression);
1429 ProcessExpression(exp->__anon1.call.exp);
1430 if(exp->__anon1.call.arguments)
1432 struct Expression * expression;
1434 for(expression = (*exp->__anon1.call.arguments).first; expression; expression = expression->next)
1436 ProcessExpression(expression);
1442 ProcessExpression(exp->__anon1.member.exp);
1445 ProcessExpression(exp->__anon1.member.exp);
1450 ProcessExpression(exp->__anon1.cast.exp);
1453 ProcessExpression(exp->__anon1.cond.cond);
1455 struct Expression * expression;
1457 for(expression = (*exp->__anon1.cond.exp).first; expression; expression = expression->next)
1459 ProcessExpression(expression);
1462 ProcessExpression(exp->__anon1.cond.elseExp);
1468 char tableName[1024];
1470 int len = strlen(exp->__anon1.db.table);
1472 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1473 tableName[len - 2] = (char)0;
1474 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1475 sprintf(name, "__ecereDBField_%s_%s", tableName, exp->__anon1.db.id->string);
1476 FreeExpContents(exp);
1478 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1483 char tableName[1024];
1485 int len = strlen(exp->__anon1.db.table);
1487 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1488 tableName[len - 2] = (char)0;
1489 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1490 sprintf(name, "__ecereDBTable_%s", tableName);
1491 FreeExpContents(exp);
1493 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1498 char tableName[1024];
1500 int len = strlen(exp->__anon1.db.table);
1502 memcpy(tableName, exp->__anon1.db.table + 1, len - 2);
1503 tableName[len - 2] = (char)0;
1504 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1505 sprintf(name, "__ecereDBIndex_%s_%s", tableName, exp->__anon1.db.id->string);
1506 FreeExpContents(exp);
1508 exp->__anon1.__anon1.identifier = MkIdentifier(name);
1515 struct Statement * databaseOpenStmt = MkCompoundStmt(MkList(), MkList());
1516 struct Statement * compound;
1517 struct Statement * ifDBStmt;
1518 struct __ecereNameSpace__ecere__sys__OldList * args;
1519 char numIndexesString[16];
1521 databaseOpenStmt->__anon1.compound.context = __extension__ ({
1522 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1524 __ecereInstance1->parent = curContext, __ecereInstance1;
1526 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.declarations), MkDeclaration(MkListOne(MkSpecifierName("Database")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("db")), (((void *)0))))));
1528 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkSpecifier(STATIC));
1529 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkSpecifierName("bool"));
1530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.declarations), MkDeclaration(args, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("initialized")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("false")))))));
1531 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("initialized"))), MkReturnStmt(MkListOne(MkExpConstant("0"))), (((void *)0))));
1532 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("initialized")), '=', MkExpIdentifier(MkIdentifier("true"))))));
1534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), CopyExpression(exp->__anon1.dbopen.name));
1535 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("no")));
1536 __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)))));
1537 __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))));
1538 compound->__anon1.compound.context = __extension__ ({
1539 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1541 __ecereInstance1->parent = databaseOpenStmt->__anon1.compound.context, __ecereInstance1;
1544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), exp->__anon1.dbopen.name);
1545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("create")));
1546 __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)))));
1547 exp->__anon1.dbopen.name = (((void *)0));
1548 exp->__anon1.dbopen.ds = (((void *)0));
1549 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("db"))), ifDBStmt = MkCompoundStmt(MkList(), MkList()), (((void *)0))));
1550 ifDBStmt->__anon1.compound.context = __extension__ ({
1551 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1553 __ecereInstance1->parent = databaseOpenStmt->__anon1.compound.context, __ecereInstance1;
1555 sprintf(numIndexesString, "%d", numIndexes);
1556 __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")))))))))));
1557 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Begin")), MkList()))));
1558 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), compound = MkCompoundStmt((((void *)0)), tableStatements));
1559 compound->__anon1.compound.context = __extension__ ({
1560 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1562 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1564 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), (compound = MkCompoundStmt((((void *)0)), addFieldStatements), compound->__anon1.compound.context = __extension__ ({
1565 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1567 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1569 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), compound = MkCompoundStmt((((void *)0)), indexStatements));
1570 compound->__anon1.compound.context = __extension__ ({
1571 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1573 __ecereInstance1->parent = ifDBStmt->__anon1.compound.context, __ecereInstance1;
1575 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Commit")), MkList()))));
1577 exp->__anon1.compound = databaseOpenStmt;
1578 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("db")))));
1579 tableStatements = (((void *)0));
1583 FreeExpContents(exp);
1584 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No database table defined in this module or database_open already used.\n", (((void *)0))));
1592 static void ProcessDBTable(struct DBTableDef * table)
1594 struct __ecereNameSpace__ecere__sys__OldList * rowClassDefs = MkList(), * idClassDefs = (((void *)0));
1595 char tableName[1024];
1596 char rowClassName[1024];
1597 int len = strlen(table->name);
1598 unsigned int indexed = 0;
1600 char nameField[1024];
1601 struct __ecereNameSpace__ecere__sys__OldList * args;
1602 struct __ecereNameSpace__ecere__sys__OldList * members;
1605 idClassDefs = MkList();
1606 nameField[0] = (char)0;
1607 memcpy(tableName, table->name + 1, len - 2);
1608 tableName[len - 2] = (char)0;
1609 __ecereNameSpace__ecere__sys__ChangeCh(tableName, ' ', '_');
1610 sprintf(tableID, "__ecereDBTable_%s", tableName);
1611 sprintf(rowClassName, "Row%s", tableName);
1612 __ecereNameSpace__ecere__sys__ChangeCh(rowClassName, ' ', '_');
1613 if(!tableStatements)
1615 tableStatements = MkList();
1616 indexStatements = MkList();
1617 addFieldStatements = MkList();
1620 struct External * external;
1622 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Table")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(tableID)), (((void *)0))))));
1623 external->__anon1.declaration->declMode = table->declMode;
1624 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1626 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*tableStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(tableID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")), args)))));
1627 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(table->name));
1629 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpInstance(MkInstantiation((((void *)0)), (((void *)0)), MkListOne(MkMembersInitList(members)))));
1630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("tableRows")))));
1631 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("create")))));
1634 struct ClassDefinition * _class;
1635 struct ClassDef * def;
1636 struct External * external;
1637 struct __ecereNameSpace__ecere__sys__OldList * inheritanceSpecs = MkList();
1639 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inheritanceSpecs), MkSpecifier(PRIVATE));
1640 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inheritanceSpecs), MkSpecifierName("Row"));
1642 _class = MkClass(DeclClass((((void *)0)), rowClassName), inheritanceSpecs, rowClassDefs);
1643 PopContext(curContext);
1644 def = MkClassDefDefaultProperty(MkListOne(MkMemberInitExp(MkExpIdentifier(MkIdentifier("tbl")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier(tableID))))));
1645 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1646 _class->declMode = table->declMode;
1647 external = MkExternalClass(_class);
1648 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1649 addAfter = external;
1651 if(table->definitions)
1653 struct DBTableEntry * entry;
1655 for(entry = (*table->definitions).first; entry; entry = entry->next)
1661 unsigned int isIndex = 0;
1663 struct __ecereNameSpace__ecere__sys__OldList * args;
1664 struct Specifier * spec = entry->__anon1.__anon1.dataType->qualifiers ? (struct Specifier *)(*entry->__anon1.__anon1.dataType->qualifiers).first : (((void *)0));
1666 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, entry->id->string);
1669 if(!nameField[0] && spec->type == 1 && (!strcmp(spec->__anon1.__anon1.name, "String") || !strcmp(spec->__anon1.__anon1.name, "eda::CIString")))
1671 strcpy(nameField, entry->id->string);
1673 if(!indexed && spec->type == 1 && !strcmp(spec->__anon1.__anon1.name, table->symbol->string))
1675 struct Statement * rowSet = MkCompoundStmt(MkList(), MkList());
1677 struct ClassDef * def;
1679 numIndexes = ((numIndexes > 1) ? numIndexes : 1);
1682 sprintf(name, "_%s", entry->id->string);
1683 curContext = rowSet->__anon1.compound.context = __extension__ ({
1684 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1686 __ecereInstance1->parent = globalContext, __ecereInstance1;
1688 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("Find")), args = MkList()))));
1689 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1690 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("middle")));
1691 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("nil")));
1692 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1693 curContext = globalContext;
1694 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator), MkIdentifier(name), rowSet, (((void *)0))));
1695 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1696 def->memberAccess = 1;
1697 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1702 struct Statement * rowSet = MkCompoundStmt(MkList(), MkList()), * rowGet = MkCompoundStmt(MkList(), MkList());
1703 struct ClassDef * def;
1705 curContext = rowGet->__anon1.compound.context = __extension__ ({
1706 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1708 __ecereInstance1->parent = globalContext, __ecereInstance1;
1710 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1712 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(spec->__anon1.__anon1.name), MkExpIdentifier(MkIdentifier("d")), (((void *)0)))));
1716 struct Expression * exp;
1718 __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"))))));
1719 exp->destType = __extension__ ({
1720 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
1722 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
1725 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("GetData")), args = MkList()))));
1726 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1727 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("d")));
1728 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1730 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', MkExpIdentifier(MkIdentifier("d"))))));
1733 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowGet->__anon1.compound.statements), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("d")))));
1734 curContext = rowSet->__anon1.compound.context = __extension__ ({
1735 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1737 __ecereInstance1->parent = globalContext, __ecereInstance1;
1739 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("SetData")), args = MkList()))));
1740 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1741 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1742 curContext = globalContext;
1743 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), entry->__anon1.__anon1.dataType->declarator, CopyIdentifier(entry->id), rowSet, rowGet));
1744 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1745 def->memberAccess = 1;
1746 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*rowClassDefs), def);
1749 struct External * external;
1751 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Field")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(fieldID)), (((void *)0))))));
1752 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
1753 external->__anon1.declaration->declMode = table->declMode;
1755 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*addFieldStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(fieldID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("FindField")), args)))));
1756 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(entry->__anon1.__anon1.name));
1758 __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))));
1759 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(entry->__anon1.__anon1.name));
1760 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpClass(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator)));
1761 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant("0"));
1765 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant("0"))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
1766 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant("0"))), MkIdentifier("order")), '=', MkExpIdentifier(MkIdentifier("ascending"))))));
1768 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("Index")), args))));
1769 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant("1"));
1770 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("indexes")));
1779 struct ClassDefinition * _class;
1780 struct External * external;
1781 struct ClassDef * def;
1782 struct Expression * exp;
1785 _class = MkClass(table->symbol, MkListOne(MkSpecifierName("Id")), idClassDefs);
1786 PopContext(curContext);
1787 _class->declMode = table->declMode;
1788 external = MkExternalClass(_class);
1789 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), addAfter, external);
1790 addAfter = external;
1791 def = MkClassDefClassPropertyValue(MkIdentifier("table"), MkInitializerAssignment(exp = MkExpOp((((void *)0)), '&', MkExpDBTable(__ecereNameSpace__ecere__sys__CopyString(table->name)))));
1792 ProcessExpression(exp);
1793 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1796 def = MkClassDefClassPropertyValue(MkIdentifier("nameField"), MkInitializerAssignment(exp = MkExpOp((((void *)0)), '&', MkExpDBField(__ecereNameSpace__ecere__sys__CopyString(table->name), MkIdentifier(nameField)))));
1797 ProcessExpression(exp);
1798 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1801 if(table->definitions)
1803 struct DBTableEntry * entry;
1805 for(entry = (*table->definitions).first; entry; entry = entry->next)
1812 struct __ecereNameSpace__ecere__sys__OldList * args;
1813 struct Specifier * spec = entry->__anon1.__anon1.dataType->qualifiers ? (struct Specifier *)(*entry->__anon1.__anon1.dataType->qualifiers).first : (((void *)0));
1815 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, entry->id->string);
1816 if(idClassDefs && spec)
1818 struct Statement * idSet = MkCompoundStmt(MkList(), MkList()), * idGet = MkCompoundStmt(MkList(), MkList());
1819 struct ClassDef * def;
1821 curContext = idGet->__anon1.compound.context = __extension__ ({
1822 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1824 __ecereInstance1->parent = globalContext, __ecereInstance1;
1826 __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"))))))))));
1827 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1829 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.declarations), MkDeclarationInst(MkInstantiation(MkSpecifierName(spec->__anon1.__anon1.name), MkExpIdentifier(MkIdentifier("d")), (((void *)0)))));
1833 struct Expression * exp;
1835 __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"))))));
1836 exp->destType = __extension__ ({
1837 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
1839 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
1842 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("GetData")), args = MkList()))));
1843 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1844 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("d")));
1845 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), DELETE, MkExpIdentifier(MkIdentifier("r"))))));
1846 if(spec->type == 1 && spec->__anon1.__anon1.symbol && spec->__anon1.__anon1.symbol->__anon1.registered && spec->__anon1.__anon1.symbol->__anon1.registered->type == 1)
1848 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', MkExpIdentifier(MkIdentifier("d"))))));
1851 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idGet->__anon1.compound.statements), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("d")))));
1852 curContext = idSet->__anon1.compound.context = __extension__ ({
1853 struct Context * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1855 __ecereInstance1->parent = globalContext, __ecereInstance1;
1857 __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"))))))))));
1858 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("SetData")), args = MkList()))));
1859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier(fieldID)));
1860 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("value")));
1861 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idSet->__anon1.compound.statements), MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), DELETE, MkExpIdentifier(MkIdentifier("r"))))));
1862 curContext = globalContext;
1863 def = MkClassDefProperty(MkProperty(CopyList(entry->__anon1.__anon1.dataType->qualifiers, (void *)(CopySpecifier)), CopyDeclarator(entry->__anon1.__anon1.dataType->declarator), CopyIdentifier(entry->id), idSet, idGet));
1864 def->__anon1.propertyDef->__anon1.isDBProp = 1;
1865 def->memberAccess = 1;
1866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*idClassDefs), def);
1872 if(entry->__anon1.items && (*entry->__anon1.items).count)
1875 struct DBIndexItem * item;
1877 unsigned int needTable = 0;
1880 if(entry->id || indexed)
1882 if(entry->id || (*entry->__anon1.items).count == 1)
1884 struct External * external;
1885 struct Identifier * id = entry->id ? entry->id : ((struct DBIndexItem *)(*entry->__anon1.items).first)->id;
1887 sprintf(indexID, "__ecereDBIndex_%s_%s", tableName, id->string);
1888 external = MkExternalDeclaration(MkDeclaration(MkListOne(MkSpecifierName("Table")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(indexID)), (((void *)0))))));
1889 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
1890 external->__anon1.declaration->declMode = table->declMode;
1894 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Multiple field index requires a name\n", (((void *)0))));
1899 strcpy(indexID, tableID);
1901 for(c = 0, item = (*entry->__anon1.items).first; item; item = item->next, c++)
1905 sprintf(num, "%d", c);
1906 sprintf(fieldID, "__ecereDBField_%s_%s", tableName, item->id->string);
1907 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), MkListOne(MkExpConstant(num))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
1908 __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"))))));
1910 sprintf(num, "%d", c);
1911 numIndexes = ((numIndexes > c) ? numIndexes : c);
1915 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(indexID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")), args)))));
1916 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpString(table->name));
1918 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpInstance(MkInstantiation((((void *)0)), (((void *)0)), MkListOne(MkMembersInitList(members)))));
1919 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*members), MkMemberInit((((void *)0)), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("tableRows")))));
1922 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*indexStatements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(indexID)), MkIdentifier("Index")), args))));
1923 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpConstant(num));
1924 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*args), MkExpIdentifier(MkIdentifier("indexes")));
1933 static void ProcessDeclaration(struct Declaration * decl);
1935 static void ProcessSpecifier(struct Specifier * spec)
1943 if(spec->__anon1.__anon2.definitions)
1945 struct ClassDef * def;
1947 for(def = (*spec->__anon1.__anon2.definitions).first; def; def = def->next)
1952 ProcessDeclaration(def->__anon1.decl);
1956 struct MemberInit * init;
1958 for(init = (*def->__anon1.defProperties).first; init; init = init->next)
1960 ProcessMemberInit(init);
1965 ProcessClassFunction(def->__anon1.function);
1968 if(def->__anon1.propertyDef)
1970 ProcessProperty(def->__anon1.propertyDef);
1974 if(def->__anon1.propertyWatch && def->__anon1.propertyWatch->compound)
1976 ProcessStatement(def->__anon1.propertyWatch->compound);
1980 if(def->__anon1.__anon1.initializer)
1981 ProcessInitializer(def->__anon1.__anon1.initializer);
1991 static void ProcessStatement(struct Statement * stmt)
1996 ProcessStatement(stmt->__anon1.labeled.stmt);
1999 if(stmt->__anon1.caseStmt.exp)
2001 ProcessExpression(stmt->__anon1.caseStmt.exp);
2003 if(stmt->__anon1.caseStmt.stmt)
2005 ProcessStatement(stmt->__anon1.caseStmt.stmt);
2010 ProcessDeclaration(stmt->__anon1.decl);
2015 struct Context * oldContext = curContext;
2017 curContext = stmt->__anon1.compound.context;
2018 if(stmt->__anon1.compound.declarations)
2020 struct Declaration * decl;
2022 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
2024 ProcessDeclaration(decl);
2027 if(stmt->__anon1.compound.statements)
2029 struct Statement * statement;
2031 for(statement = (*stmt->__anon1.compound.statements).first; statement; statement = statement->next)
2033 ProcessStatement(statement);
2036 curContext = oldContext;
2041 if(stmt->__anon1.expressions)
2043 struct Expression * exp;
2045 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
2047 ProcessExpression(exp);
2054 struct Expression * exp;
2056 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
2058 ProcessExpression(exp);
2060 if(stmt->__anon1.ifStmt.stmt)
2062 ProcessStatement(stmt->__anon1.ifStmt.stmt);
2064 if(stmt->__anon1.ifStmt.elseStmt)
2066 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
2072 struct Expression * exp;
2074 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
2076 ProcessExpression(exp);
2078 ProcessStatement(stmt->__anon1.switchStmt.stmt);
2083 struct Expression * exp;
2085 if(stmt->__anon1.whileStmt.exp)
2087 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
2089 ProcessExpression(exp);
2092 if(stmt->__anon1.whileStmt.stmt)
2093 ProcessStatement(stmt->__anon1.whileStmt.stmt);
2098 ProcessStatement(stmt->__anon1.doWhile.stmt);
2099 if(stmt->__anon1.doWhile.exp)
2101 struct Expression * exp;
2103 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
2105 ProcessExpression(exp);
2112 struct Expression * exp;
2114 if(stmt->__anon1.forStmt.init)
2116 ProcessStatement(stmt->__anon1.forStmt.init);
2118 if(stmt->__anon1.forStmt.check)
2120 ProcessStatement(stmt->__anon1.forStmt.check);
2122 if(stmt->__anon1.forStmt.increment)
2124 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
2126 ProcessExpression(exp);
2129 if(stmt->__anon1.forStmt.stmt)
2130 ProcessStatement(stmt->__anon1.forStmt.stmt);
2140 if(stmt->__anon1.expressions)
2142 struct Expression * exp;
2144 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
2146 ProcessExpression(exp);
2153 struct Identifier * _watch;
2155 if(stmt->__anon1._watch.watcher)
2157 ProcessExpression(stmt->__anon1._watch.watcher);
2159 if(stmt->__anon1._watch.object)
2161 ProcessExpression(stmt->__anon1._watch.object);
2163 if(stmt->__anon1._watch.watches)
2165 for(_watch = (*stmt->__anon1._watch.watches).first; _watch; _watch = _watch->next)
2167 ProcessIdentifier(_watch);
2174 struct PropertyWatch * _watch;
2176 if(stmt->__anon1._watch.watcher)
2178 ProcessExpression(stmt->__anon1._watch.watcher);
2180 if(stmt->__anon1._watch.object)
2182 ProcessExpression(stmt->__anon1._watch.object);
2184 if(stmt->__anon1._watch.watches)
2186 for(_watch = (*stmt->__anon1._watch.watches).first; _watch; _watch = _watch->next)
2188 if(_watch->compound)
2190 ProcessStatement(_watch->compound);
2199 static void ProcessClassDef(struct ClassDef * def)
2204 ProcessDeclaration(def->__anon1.decl);
2208 struct MemberInit * init;
2210 for(init = (*def->__anon1.defProperties).first; init; init = init->next)
2212 ProcessMemberInit(init);
2217 if(def->__anon1.__anon1.initializer)
2218 ProcessInitializer(def->__anon1.__anon1.initializer);
2221 ProcessClassFunction(def->__anon1.function);
2224 if(def->__anon1.propertyDef)
2226 ProcessProperty(def->__anon1.propertyDef);
2230 if(def->__anon1.propertyWatch && def->__anon1.propertyWatch->compound)
2232 ProcessStatement(def->__anon1.propertyWatch->compound);
2238 static void ProcessDeclaration(struct Declaration * decl)
2244 struct Specifier * spec;
2246 if(decl->__anon1.__anon1.specifiers)
2248 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
2250 ProcessSpecifier(spec);
2257 if(decl->__anon1.__anon1.specifiers)
2259 struct Specifier * s;
2261 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
2263 ProcessSpecifier(s);
2266 if(decl->__anon1.__anon1.declarators && (*decl->__anon1.__anon1.declarators).first)
2268 struct InitDeclarator * d;
2270 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
2272 ProcessInitDeclarator(d);
2278 ProcessInstance(decl->__anon1.inst);
2283 static void ProcessClass(struct ClassDefinition * _class)
2285 if(_class->definitions)
2287 struct ClassDef * def;
2289 for(def = (*_class->definitions).first; def; def = def->next)
2291 ProcessClassDef(def);
2296 void ProcessDBTableDefinitions()
2298 struct External * external;
2300 addAfter = (((void *)0));
2301 curContext = globalContext;
2303 PrePreProcessClassDefinitions();
2304 DeclClass((((void *)0)), "Field");
2305 DeclClass((((void *)0)), "Table");
2306 DeclClass((((void *)0)), "Row");
2307 DeclClass((((void *)0)), "Id");
2309 if(ast != (((void *)0)))
2311 for(external = (*ast).first; external; external = external->next)
2313 curExternal = external;
2314 addAfter = external->prev;
2315 switch(external->type)
2318 ProcessDBTable(external->__anon1.table);
2322 for(external = (*ast).first; external; external = external->next)
2324 curExternal = external;
2325 addAfter = external->prev;
2326 switch(external->type)
2329 ProcessFunction(external->__anon1.function);
2332 ProcessDeclaration(external->__anon1.declaration);
2335 ProcessClass(external->__anon1._class);
2340 curContext = globalContext;
2343 void __ecereRegisterModule_dbpass(struct __ecereNameSpace__ecere__com__Instance * module)
2345 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2347 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessDBTableDefinitions", "void ProcessDBTableDefinitions(void)", ProcessDBTableDefinitions, module, 1);