@abaplint/core
Version:
abaplint - Core API
25 lines • 3.43 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SQLFrom = void 0;
const combi_1 = require("../combi");
const tokens_1 = require("../../1_lexer/tokens");
const _1 = require(".");
class SQLFrom extends combi_1.Expression {
// todo: rewrite/refactor this method
getRunnable() {
const joins = (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), _1.SQLJoin));
// No opening parens
const from0 = (0, combi_1.seq)("FROM", _1.SQLFromSource, joins);
// 1 to 6 opening parens, with up to that many closing parens at the end
const from1 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
const from2 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
const from3 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
const from4 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
const from5 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
const from6 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
const source = (0, combi_1.altPrio)(from6, from5, from4, from3, from2, from1, from0);
return source;
}
}
exports.SQLFrom = SQLFrom;
//# sourceMappingURL=sql_from.js.map