import "ecdefs"
#define YYLTYPE Location
-#include "grammar.eh"
+#include "grammar.h"
static OldList * tableStatements, * indexStatements, * addFieldStatements/*, * findFieldStatements*/;
static int numIndexes;
MemberInit init;
for(init = def.defProperties->first; init; init = init.next)
{
- Class oldThisClass = thisClass;
+ //Class oldThisClass = thisClass;
ProcessMemberInit(init);
}
break;
ProcessStatement(def.propertyWatch.compound);
}
break;
+ case classPropertyValueClassDef:
+ if(def.initializer)
+ ProcessInitializer(def.initializer);
+ break;
}
}
}
{
Expression expression;
ProcessExpression(exp.index.exp);
-
+
for(expression = exp.index.index->first; expression; expression = expression.next)
{
ProcessExpression(expression);
case callExp:
{
ProcessExpression(exp.call.exp);
-
+
if(exp.call.arguments)
{
Expression expression;
sprintf(name, "__ecereDBField_%s_%s", tableName, exp.db.id.string);
FreeExpContents(exp);
exp.type = identifierExp;
- exp.identifier = MkIdentifier(name);
+ exp.identifier = MkIdentifier(name);
break;
}
case dbtableExp:
sprintf(name, "__ecereDBTable_%s", tableName);
FreeExpContents(exp);
exp.type = identifierExp;
- exp.identifier = MkIdentifier(name);
+ exp.identifier = MkIdentifier(name);
break;
}
case dbindexExp:
sprintf(name, "__ecereDBIndex_%s_%s", tableName, exp.db.id.string);
FreeExpContents(exp);
exp.type = identifierExp;
- exp.identifier = MkIdentifier(name);
+ exp.identifier = MkIdentifier(name);
break;
}
case dbopenExp:
if(tableStatements)
{
Statement databaseOpenStmt = MkCompoundStmt(MkList(), MkList());
- Statement compound, compound2;
+ Statement compound/*, compound2*/;
Statement ifDBStmt;
OldList * args;
char numIndexesString[16];
databaseOpenStmt.compound.context = Context { parent = curContext };
- databaseOpenStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("Database")),
+ databaseOpenStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("Database")),
MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("db")), null))));
// bool createNow = false;
- databaseOpenStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("bool")),
- MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("createNow")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("false")))))));
+ /*databaseOpenStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("bool")),
+ MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("createNow")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("false")))))));*/
// static bool initialized = false;
args = MkList();
args->Add(MkSpecifier(STATIC));
args->Add(MkSpecifierName("bool"));
- databaseOpenStmt.compound.declarations->Add(MkDeclaration(args,
+ databaseOpenStmt.compound.declarations->Add(MkDeclaration(args,
MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("initialized")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("false")))))));
- // if(initialized) return;
- databaseOpenStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("initialized"))), MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("null")))), null));
+ // Assuming we're in a function where we can return 0 (Typically a DataBase InitSchema() or an Application constructor)
+ // if(initialized) return 0;
+ databaseOpenStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("initialized"))), MkReturnStmt(MkListOne(MkExpConstant("0"))), null));
// initialized = true;
databaseOpenStmt.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("initialized")), '=', MkExpIdentifier(MkIdentifier("true"))))));
args = MkList();
args->Add(CopyExpression(exp.dbopen.name));
args->Add(MkExpIdentifier(MkIdentifier("no")));
- databaseOpenStmt.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("db")), '=',
+ databaseOpenStmt.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("db")), '=',
MkExpCall(MkExpMember(CopyExpression(exp.dbopen.ds), MkIdentifier("OpenDatabase")), args)))));
-
+
/*if(!db)
{
db = ds.OpenDatabase("med", create);
createNow = true;
}
*/
- databaseOpenStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpOp(null, '!', MkExpIdentifier(MkIdentifier("db")))),
+ databaseOpenStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpOp(null, '!', MkExpIdentifier(MkIdentifier("db")))),
compound = MkCompoundStmt(null, MkList()), null));
compound.compound.context = Context { parent = databaseOpenStmt.compound.context };
-
+
args = MkList();
args->Add(exp.dbopen.name);
args->Add(MkExpIdentifier(MkIdentifier("create")));
- compound.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("db")), '=',
+ compound.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("db")), '=',
MkExpCall(MkExpMember(exp.dbopen.ds, MkIdentifier("OpenDatabase")), args)))));
- compound.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("createNow")), '=',
- MkExpIdentifier(MkIdentifier("true"))))));
+ /*compound.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("createNow")), '=',
+ MkExpIdentifier(MkIdentifier("true")))));*/
exp.dbopen.name = null;
exp.dbopen.ds = null;
// if(db)
- databaseOpenStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("db"))),
+ databaseOpenStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("db"))),
ifDBStmt = MkCompoundStmt(MkList(), MkList()), null));
ifDBStmt.compound.context = Context { parent = databaseOpenStmt.compound.context };
// FieldIndex indexes[numIndexes] = { null };
sprintf(numIndexesString, "%d", numIndexes);
- ifDBStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("FieldIndex")), MkListOne(MkInitDeclarator(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("indexes")),
+ ifDBStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("FieldIndex")), MkListOne(MkInitDeclarator(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("indexes")),
MkExpConstant(numIndexesString)), MkInitializerList(MkListOne(MkInitializerList(MkListOne(MkInitializerAssignment(MkExpIdentifier(MkIdentifier("null")))))))))));
-
+
+ // db.Begin();
+ ifDBStmt.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Begin")), MkList()))));
+
ifDBStmt.compound.statements->Add(compound = MkCompoundStmt(null, tableStatements));
compound.compound.context = Context { parent = ifDBStmt.compound.context };
/*
- ifDBStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("createNow"))),
- (compound = MkCompoundStmt(null, addFieldStatements), compound.compound.context = Context { parent = ifDBStmt.compound.context }, compound),
+ ifDBStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("createNow"))),
+ (compound = MkCompoundStmt(null, addFieldStatements), compound.compound.context = Context { parent = ifDBStmt.compound.context }, compound),
(compound2 = MkCompoundStmt(null, findFieldStatements), compound2.compound.context = Context { parent = ifDBStmt.compound.context }, compound2)));
*/
ifDBStmt.compound.statements->Add(
ifDBStmt.compound.statements->Add(compound = MkCompoundStmt(null, indexStatements));
compound.compound.context = Context { parent = ifDBStmt.compound.context };
+ // db.Commit();
+ ifDBStmt.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Commit")), MkList()))));
+
// TODO: Don't make use of extension
exp.type = extensionCompoundExp;
exp.compound = databaseOpenStmt;
else
{
FreeExpContents(exp);
- Compiler_Error("No database table defined in this module or database_open already used.\n");
+ Compiler_Error($"No database table defined in this module or database_open already used.\n");
exp.type = dummyExp;
}
break;
{
ProcessStatement(stmt.forStmt.init);
}
-
+
if(stmt.forStmt.check)
{
ProcessStatement(stmt.forStmt.check);
}
-
+
if(stmt.forStmt.increment)
{
for(exp = stmt.forStmt.increment->first; exp; exp = exp.next)
if(stmt.expressions)
{
Expression exp;
-
+
for(exp = stmt.expressions->first; exp; exp = exp.next)
{
ProcessExpression(exp);
case listInitializer:
{
Initializer init;
-
+
for(init = initializer.list->first; init; init = init.next)
{
ProcessInitializer(init);
for(d = decl.declarators->first; d; d = d.next)
{
ProcessInitDeclarator(d);
- }
+ }
}
break;
}
MembersInit init;
MemberInit memberInit;
for(init = inst.members->first; init; init = init.next)
- {
+ {
if(init.type == dataMembersInit && init.dataMembers)
{
for(memberInit = init.dataMembers->first; memberInit; memberInit = memberInit.next)
}
break;
}
+ case classPropertyValueClassDef:
+ if(def.initializer)
+ ProcessInitializer(def.initializer);
+ break;
case functionClassDef:
ProcessClassFunction(def.function);
break;
char nameField[1024];
OldList * args;
OldList * members;
- int symbolID = 0; //MAXINT; //globalContext.nextID++;
if(table.symbol)
idClassDefs = MkList();
sprintf(rowClassName, "Row%s", tableName);
ChangeCh(rowClassName, ' ', '_');
-
+
if(!tableStatements)
{
tableStatements = MkList();
MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(tableID)), null))));
external.declaration.declMode = table.declMode;
ast->Insert(addAfter, external);
-
+
// tClasses = db.OpenTable("Classes", { tableRows, create });
args = MkList();
tableStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(tableID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")),
inheritanceSpecs->Add(MkSpecifier(PRIVATE));
inheritanceSpecs->Add(MkSpecifierName("Row"));
PushContext();
- _class = MkClass(DeclClass(globalContext.nextID++, rowClassName), inheritanceSpecs, rowClassDefs);
+ _class = MkClass(DeclClass(rowClassName), inheritanceSpecs, rowClassDefs);
PopContext(curContext);
def = MkClassDefDefaultProperty(MkListOne(MkMemberInitExp(MkExpIdentifier(MkIdentifier("tbl")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier(tableID))))));
rowClassDefs->Add(def);
- _class.symbol.idCode = symbolID;
_class.declMode = table.declMode;
external = MkExternalClass(_class);
ast->Insert(addAfter, external);
curContext = rowSet.compound.context = Context { parent = globalContext };
// Find(fieldSECid, middle, nil, value);
- rowSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("Find")),
+ rowSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("Find")),
args = MkList()))));
args->Add(MkExpIdentifier(MkIdentifier(fieldID)));
args->Add(MkExpIdentifier(MkIdentifier("middle")));
curContext = globalContext;
def = MkClassDefProperty(MkProperty(
- CopyList(entry.dataType.qualifiers, CopySpecifier), CopyDeclarator(entry.dataType.declarator),
+ CopyList(entry.dataType.qualifiers, CopySpecifier), CopyDeclarator(entry.dataType.declarator),
MkIdentifier(name), rowSet, null));
- def.propertyDef.symbol.id = def.propertyDef.symbol.idCode = symbolID;
+ def.propertyDef.isDBProp = true;
def.memberAccess = publicAccess;
rowClassDefs->Add(def);
}
{
Statement rowSet = MkCompoundStmt(MkList(), MkList()), rowGet = MkCompoundStmt(MkList(), MkList());
ClassDef def;
-
+
curContext = rowGet.compound.context = Context { parent = globalContext };
// *** GET ***
else
{
Expression exp;
- rowGet.compound.declarations->Add(MkDeclaration(CopyList(entry.dataType.qualifiers, CopySpecifier),
+ rowGet.compound.declarations->Add(MkDeclaration(CopyList(entry.dataType.qualifiers, CopySpecifier),
MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("d")), MkInitializerAssignment(exp = MkExpConstant("0"))))));
exp.destType = Type { kind = intType, refCount = 1 };
}
// GetData(fieldCNTid, d);
- rowGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("GetData")),
+ rowGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("GetData")),
args = MkList()))));
args->Add(MkExpIdentifier(MkIdentifier(fieldID)));
/*if(spec.type == nameSpecifier && spec.symbol && spec.symbol.registered && spec.symbol.registered.type == structClass)
// return d;
if(spec.type == nameSpecifier && spec.symbol && spec.symbol.registered && spec.symbol.registered.type == structClass)
{
- rowGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=',
+ rowGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=',
MkExpIdentifier(MkIdentifier("d"))))));
}
else
// *** SET ***
curContext = rowSet.compound.context = Context { parent = globalContext };
-
+
// SetData(fieldCNTid, value);
- rowSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("SetData")),
+ rowSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("SetData")),
args = MkList()))));
args->Add(MkExpIdentifier(MkIdentifier(fieldID)));
args->Add(MkExpIdentifier(MkIdentifier("value")));
curContext = globalContext;
def = MkClassDefProperty(MkProperty(CopyList(entry.dataType.qualifiers, CopySpecifier), entry.dataType.declarator, CopyIdentifier(entry.id), rowSet, rowGet));
- def.propertyDef.symbol.id = def.propertyDef.symbol.idCode = symbolID;
+ def.propertyDef.isDBProp = true;
def.memberAccess = publicAccess;
rowClassDefs->Add(def);
}
MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(fieldID)), null))));
ast->Add(external);
external.declaration.declMode = table.declMode;
-
+
// fieldCLSname = tClasses.AddField("name", class(String), 0 );
args = MkList();
addFieldStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(fieldID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("FindField")),
args = MkList();
addFieldStatements->Add(
- MkIfStmt(MkListOne(MkExpOp(null, '!', MkExpIdentifier(MkIdentifier(fieldID)))),
+ MkIfStmt(MkListOne(MkExpOp(null, '!', MkExpIdentifier(MkIdentifier(fieldID)))),
MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(fieldID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("AddField")),
args)))), null));
args->Add(MkExpString(entry.name));
if(isIndex)
{
// indexes[0].field = fieldCLSid;
- indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
+ indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
MkListOne(MkExpConstant("0"))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
// indexes[0].order = ascending;
- indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
+ indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
MkListOne(MkExpConstant("0"))), MkIdentifier("order")), '=', MkExpIdentifier(MkIdentifier("ascending"))))));
// tClasses.Index(1, indexes);
ClassDef def;
Expression exp;
- // table.symbol.id = table.symbol.idCode = globalContext.nextID++;
PushContext();
_class = MkClass(table.symbol, MkListOne(MkSpecifierName("Id")), idClassDefs);
PopContext(curContext);
def = MkClassDefClassPropertyValue(MkIdentifier("nameField"), MkInitializerAssignment(exp = MkExpOp(null, '&', MkExpDBField(CopyString(table.name), MkIdentifier(nameField)))));
ProcessExpression(exp);
idClassDefs->Add(def);
- }
+ }
// indexed = true;
}
// *** GET ***
// RowContacts r { this };
- idGet.compound.declarations->Add(MkDeclarationInst(MkInstantiation(MkSpecifierName(rowClassName), MkExpIdentifier(MkIdentifier("r")),
+ idGet.compound.declarations->Add(MkDeclarationInst(MkInstantiation(MkSpecifierName(rowClassName), MkExpIdentifier(MkIdentifier("r")),
MkListOne(MkMembersInitList(MkListOne(MkMemberInit(null, MkInitializerAssignment(MkExpIdentifier(MkIdentifier("this"))))))))));
-
+
// Contact d = null;
if(spec.type == nameSpecifier && spec.symbol && spec.symbol.registered && spec.symbol.registered.type == structClass)
{
else
{
Expression exp;
- idGet.compound.declarations->Add(MkDeclaration(CopyList(entry.dataType.qualifiers, CopySpecifier),
+ idGet.compound.declarations->Add(MkDeclaration(CopyList(entry.dataType.qualifiers, CopySpecifier),
MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("d")), MkInitializerAssignment(exp = MkExpConstant("0"))))));
exp.destType = Type { kind = intType, refCount = 1 };
}
// r.GetData(fieldCNTid, d);
- idGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("GetData")),
+ idGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("GetData")),
args = MkList()))));
args->Add(MkExpIdentifier(MkIdentifier(fieldID)));
/*if(spec.type == nameSpecifier && spec.symbol && spec.symbol.registered && spec.symbol.registered.type == structClass)
// return d;
if(spec.type == nameSpecifier && spec.symbol && spec.symbol.registered && spec.symbol.registered.type == structClass)
{
- idGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=',
+ idGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=',
MkExpIdentifier(MkIdentifier("d"))))));
}
else
// *** SET ***
curContext = idSet.compound.context = Context { parent = globalContext };
-
+
// RowContacts r { this };
- idSet.compound.declarations->Add(MkDeclarationInst(MkInstantiation(MkSpecifierName(rowClassName), MkExpIdentifier(MkIdentifier("r")),
+ idSet.compound.declarations->Add(MkDeclarationInst(MkInstantiation(MkSpecifierName(rowClassName), MkExpIdentifier(MkIdentifier("r")),
MkListOne(MkMembersInitList(MkListOne(MkMemberInit(null, MkInitializerAssignment(MkExpIdentifier(MkIdentifier("this"))))))))));
// r.SetData(fieldCNTid, value);
- idSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("SetData")),
+ idSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("SetData")),
args = MkList()))));
args->Add(MkExpIdentifier(MkIdentifier(fieldID)));
args->Add(MkExpIdentifier(MkIdentifier("value")));
idSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(null, DELETE, MkExpIdentifier(MkIdentifier("r"))))));
curContext = globalContext;
-
+
def = MkClassDefProperty(MkProperty(
- CopyList(entry.dataType.qualifiers, CopySpecifier), CopyDeclarator(entry.dataType.declarator),
+ CopyList(entry.dataType.qualifiers, CopySpecifier), CopyDeclarator(entry.dataType.declarator),
CopyIdentifier(entry.id), idSet, idGet));
- def.propertyDef.symbol.id = def.propertyDef.symbol.idCode = symbolID;
+ def.propertyDef.isDBProp = true;
def.memberAccess = publicAccess;
idClassDefs->Add(def);
}
needTable = true;
}
else
- Compiler_Error("Multiple field index requires a name\n");
+ Compiler_Error($"Multiple field index requires a name\n");
}
else
{
sprintf(num, "%d", c);
sprintf(fieldID, "__ecereDBField_%s_%s", tableName, item.id.string);
- indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
+ indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
MkListOne(MkExpConstant(num))), MkIdentifier("field")), '=', MkExpIdentifier(MkIdentifier(fieldID))))));
- indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
+ indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
MkListOne(MkExpConstant(num))), MkIdentifier("order")), '=', MkExpIdentifier(MkIdentifier((item.order == ascending) ? "ascending" : "descending"))))));
}
sprintf(num, "%d", c);
if(inCompiler)
PrePreProcessClassDefinitions();
- DeclClass(0, "Field");
- DeclClass(0, "Table");
- DeclClass(0, "Row");
- DeclClass(0, "Id");
+ DeclClass("Field");
+ DeclClass("Table");
+ DeclClass("Row");
+ DeclClass("Id");
numIndexes = 0;
if(ast != null)
{
for(external = ast->first; external; external = external.next)
{
curExternal = external;
+
+ addAfter = external.prev;
switch(external.type)
{
case dbtableExternal:
for(external = ast->first; external; external = external.next)
{
curExternal = external;
+
+ addAfter = external.prev;
+
switch(external.type)
{
- case functionExternal:
+ case functionExternal:
ProcessFunction(external.function);
break;
- case declarationExternal:
+ case declarationExternal:
ProcessDeclaration(external.declaration);
break;
- case classExternal:
+ case classExternal:
ProcessClass(external._class);
break;
}