Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 1x 1x | import {IStatement} from "./_statement";
import {alt, altPrio, opt, optPrio, per, plus, plusPrio, seq, ver} from "../combi";
import {AssociationName, EntityAssociation, NamespaceSimpleName, SimpleName, Source, Target} from "../expressions";
import {IStatementRunnable} from "../statement_runnable";
import {Version} from "../../../version";
export class ModifyEntities implements IStatement {
public getMatcher(): IStatementRunnable {
const withh = seq("WITH", Source);
const fieldsWith = seq("FIELDS (", plus(SimpleName), ")", withh);
const by = seq("BY", AssociationName);
const relating = seq("RELATING TO", NamespaceSimpleName, "BY", NamespaceSimpleName);
const execute = seq("EXECUTE", NamespaceSimpleName, "FROM", Source);
const create = seq("CREATE", opt(by), "FROM", Source, opt(relating));
const updateFrom = seq("UPDATE FROM", Source, opt(relating));
const deleteFrom = seq("DELETE FROM", Source);
const updateFields = seq("UPDATE", fieldsWith);
const updateSetFields = seq("UPDATE SET FIELDS WITH", Source);
const operation = alt(
updateSetFields,
seq("CREATE SET FIELDS WITH", Source),
updateFields,
deleteFrom,
updateFrom,
create,
execute,
seq("CREATE", opt(by), optPrio("AUTO FILL CID"), altPrio(withh, fieldsWith)));
const failed = seq("FAILED", Target);
const result = seq("RESULT", Target);
const mapped = seq("MAPPED", Target);
const reported = seq("REPORTED", Target);
const end = optPrio(per(failed,
result,
mapped,
reported));
const entities = seq(optPrio("AUGMENTING"), "ENTITIES OF", NamespaceSimpleName,
opt("IN LOCAL MODE"),
plusPrio(seq("ENTITY", NamespaceSimpleName, plus(operation))));
const create2 = seq("CREATE", fieldsWith, opt(seq("CREATE BY", AssociationName, fieldsWith)));
const create3 = seq("CREATE BY", AssociationName, fieldsWith);
const create4 = seq("CREATE FROM", Source, plus(seq("CREATE BY", AssociationName, "FROM", Source)));
const entity = seq("ENTITY",
opt("IN LOCAL MODE"),
alt(NamespaceSimpleName, EntityAssociation),
alt(execute, create, updateFields, deleteFrom, updateSetFields, updateFrom, create2, create3, create4));
return ver(Version.v754, seq("MODIFY", alt(entities, entity), end));
}
} |