@abaplint/core
Version:
abaplint - Core API
49 lines • 4.82 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectionScreen = void 0;
const combi_1 = require("../combi");
const tokens_1 = require("../../1_lexer/tokens");
const expressions_1 = require("../expressions");
const version_1 = require("../../../version");
class SelectionScreen {
getMatcher() {
const beginBlock = (0, combi_1.seq)("BEGIN OF BLOCK", expressions_1.BlockName, (0, combi_1.optPrio)("WITH FRAME"), (0, combi_1.optPrio)((0, combi_1.seq)("TITLE", (0, combi_1.alt)(expressions_1.InlineField, expressions_1.TextElement))), (0, combi_1.optPrio)("NO INTERVALS"));
const endBlock = (0, combi_1.seq)("END OF BLOCK", expressions_1.BlockName);
const nesting = (0, combi_1.seq)("NESTING LEVEL", expressions_1.Source);
const scrOptions = (0, combi_1.per)((0, combi_1.seq)("AS", (0, combi_1.alt)("WINDOW", "SUBSCREEN")), (0, combi_1.seq)("TITLE", (0, combi_1.alt)(expressions_1.InlineField, expressions_1.TextElement)), "NO INTERVALS", nesting);
const beginScreen = (0, combi_1.seq)("BEGIN OF SCREEN", expressions_1.Integer, (0, combi_1.opt)(scrOptions));
const endScreen = (0, combi_1.seq)("END OF SCREEN", expressions_1.Integer);
const beginLine = (0, combi_1.str)("BEGIN OF LINE");
const endLine = (0, combi_1.str)("END OF LINE");
const modif = (0, combi_1.seq)("MODIF ID", expressions_1.Modif);
const visible = (0, combi_1.seq)("VISIBLE LENGTH", (0, combi_1.regex)(/^\d+$/));
const ldbId = (0, combi_1.seq)("ID", (0, combi_1.regex)(/^\w+$/));
const ldb = (0, combi_1.seq)("FOR FIELD", expressions_1.FieldSub, (0, combi_1.optPrio)(ldbId));
const commentOpt = (0, combi_1.per)(ldb, modif, visible);
const position = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.regex)(/^\/?[\d\w]+$/)), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.WParenLeft)), expressions_1.Integer, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.ParenRight)));
const comment = (0, combi_1.seq)("COMMENT", position, (0, combi_1.opt)((0, combi_1.alt)(expressions_1.InlineField, expressions_1.TextElement)), (0, combi_1.opt)(commentOpt));
const command = (0, combi_1.seq)("USER-COMMAND", (0, combi_1.alt)(expressions_1.Field, expressions_1.Constant));
const push = (0, combi_1.seq)("PUSHBUTTON", position, (0, combi_1.alt)(expressions_1.InlineField, expressions_1.TextElement), command, (0, combi_1.opt)(modif), (0, combi_1.opt)(visible));
const prog = (0, combi_1.seq)("PROGRAM", expressions_1.Field);
const def = (0, combi_1.seq)("DEFAULT", (0, combi_1.opt)(prog), "SCREEN", expressions_1.Integer);
const tab = (0, combi_1.seq)("TAB", (0, combi_1.tok)(tokens_1.WParenLeft), expressions_1.Integer, (0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.alt)(expressions_1.InlineField, expressions_1.TextElement), command, (0, combi_1.opt)(def), (0, combi_1.opt)(modif));
const func = (0, combi_1.seq)("FUNCTION KEY", expressions_1.Integer);
const skip = (0, combi_1.seq)("SKIP", (0, combi_1.opt)(expressions_1.Integer));
const posSymbols = (0, combi_1.altPrio)("POS_LOW", "POS_HIGH");
// number between 1 and 83
const posIntegers = (0, combi_1.regex)(/^(0?[1-9]|[1234567][0-9]|8[0-3])$/);
const pos = (0, combi_1.seq)("POSITION", (0, combi_1.altPrio)(posIntegers, posSymbols), (0, combi_1.opt)((0, combi_1.seq)("FOR TABLE", expressions_1.Field)));
const incl = (0, combi_1.seq)("INCLUDE BLOCKS", expressions_1.BlockName);
const tabbed = (0, combi_1.seq)("BEGIN OF TABBED BLOCK", expressions_1.BlockName, "FOR", expressions_1.Integer, "LINES", (0, combi_1.optPrio)("NO INTERVALS"));
const uline = (0, combi_1.seq)("ULINE", (0, combi_1.opt)(position), (0, combi_1.opt)(modif));
const param = (0, combi_1.seq)("INCLUDE PARAMETERS", expressions_1.Field);
const iso = (0, combi_1.seq)("INCLUDE SELECT-OPTIONS", expressions_1.Field);
const exclude = (0, combi_1.seq)("EXCLUDE", (0, combi_1.alt)("IDS", "PARAMETERS"), (0, combi_1.regex)(/^\w+$/));
const beginVersion = (0, combi_1.seq)("BEGIN OF VERSION", (0, combi_1.regex)(/^\w+$/), expressions_1.TextElement);
const endVersion = (0, combi_1.seq)("END OF VERSION", (0, combi_1.regex)(/^\w+$/));
const ret = (0, combi_1.seq)("SELECTION-SCREEN", (0, combi_1.altPrio)(comment, func, skip, pos, incl, iso, push, tab, uline, beginBlock, tabbed, endBlock, beginLine, endLine, param, beginScreen, endScreen, exclude, beginVersion, endVersion, def));
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
}
}
exports.SelectionScreen = SelectionScreen;
//# sourceMappingURL=selectionscreen.js.map