import CypherLexer from './generated-parser/CypherCmdLexer';
export var CypherTokenType;
(function (CypherTokenType) {
    CypherTokenType["comment"] = "comment";
    CypherTokenType["keyword"] = "keyword";
    CypherTokenType["label"] = "label";
    CypherTokenType["predicateFunction"] = "predicateFunction";
    CypherTokenType["function"] = "function";
    CypherTokenType["procedure"] = "procedure";
    CypherTokenType["variable"] = "variable";
    CypherTokenType["paramDollar"] = "paramDollar";
    CypherTokenType["paramValue"] = "paramValue";
    CypherTokenType["symbolicName"] = "symbolicName";
    CypherTokenType["operator"] = "operator";
    CypherTokenType["stringLiteral"] = "stringLiteral";
    CypherTokenType["numberLiteral"] = "numberLiteral";
    CypherTokenType["booleanLiteral"] = "booleanLiteral";
    CypherTokenType["keywordLiteral"] = "keywordLiteral";
    CypherTokenType["property"] = "property";
    CypherTokenType["namespace"] = "namespace";
    CypherTokenType["bracket"] = "bracket";
    CypherTokenType["separator"] = "separator";
    CypherTokenType["punctuation"] = "punctuation";
    CypherTokenType["none"] = "none";
    CypherTokenType["consoleCommand"] = "consoleCommand";
    CypherTokenType["settingValue"] = "settingValue";
    CypherTokenType["setting"] = "setting";
})(CypherTokenType || (CypherTokenType = {}));
export const lexerOperators = [
    CypherLexer.AMPERSAND,
    CypherLexer.BAR,
    CypherLexer.COLON,
    CypherLexer.COLONCOLON,
    CypherLexer.DIVIDE,
    CypherLexer.DOLLAR,
    CypherLexer.DOT,
    CypherLexer.DOTDOT,
    CypherLexer.DOUBLEBAR,
    CypherLexer.EQ,
    CypherLexer.EXCLAMATION_MARK,
    CypherLexer.GE,
    CypherLexer.GT,
    CypherLexer.LE,
    CypherLexer.LT,
    CypherLexer.MINUS,
    CypherLexer.NEQ,
    CypherLexer.INVALID_NEQ,
    CypherLexer.PERCENT,
    CypherLexer.PLUS,
    CypherLexer.PLUSEQUAL,
    CypherLexer.POW,
    CypherLexer.QUESTION,
    CypherLexer.REGEQ,
    CypherLexer.TIMES,
];
export const lexerBrackets = [
    CypherLexer.LBRACKET,
    CypherLexer.LCURLY,
    CypherLexer.LPAREN,
    CypherLexer.RBRACKET,
    CypherLexer.RCURLY,
    CypherLexer.RPAREN,
];
export const lexerPunctuation = [CypherLexer.SEMICOLON];
export const lexerSeparators = [
    CypherLexer.COMMA,
    CypherLexer.ARROW_LINE,
    CypherLexer.ARROW_LEFT_HEAD,
    CypherLexer.ARROW_RIGHT_HEAD,
];
export const lexerNumberLiterals = [
    CypherLexer.DECIMAL_DOUBLE,
    CypherLexer.UNSIGNED_DECIMAL_INTEGER,
    CypherLexer.UNSIGNED_HEX_INTEGER,
    CypherLexer.UNSIGNED_OCTAL_INTEGER,
];
export const lexerStringLiteral = [
    CypherLexer.STRING_LITERAL1,
    CypherLexer.STRING_LITERAL2,
];
export const lexerGarbage = [
    CypherLexer.ErrorChar,
    CypherLexer.EOF,
    CypherLexer.SPACE,
];
export const identifier = [
    CypherLexer.IDENTIFIER,
    CypherLexer.ESCAPED_SYMBOLIC_NAME,
    CypherLexer.EXTENDED_IDENTIFIER,
];
export const lexerComment = [
    CypherLexer.MULTI_LINE_COMMENT,
    CypherLexer.SINGLE_LINE_COMMENT,
];
export const lexerKeywords = [
    CypherLexer.ACCESS,
    CypherLexer.ACTIVE,
    CypherLexer.ADD,
    CypherLexer.ADMIN,
    CypherLexer.ADMINISTRATOR,
    CypherLexer.ALIAS,
    CypherLexer.ALIASES,
    CypherLexer.ALL,
    CypherLexer.ALLREDUCE,
    CypherLexer.ALL_SHORTEST_PATHS,
    CypherLexer.ALTER,
    CypherLexer.AND,
    CypherLexer.ANY,
    CypherLexer.ARRAY,
    CypherLexer.AS,
    CypherLexer.ASC,
    CypherLexer.ASCENDING,
    CypherLexer.ASSIGN,
    CypherLexer.AT,
    CypherLexer.AUTH,
    CypherLexer.BINDINGS,
    CypherLexer.BOOL,
    CypherLexer.BOOLEAN,
    CypherLexer.BOOSTED,
    CypherLexer.BOTH,
    CypherLexer.BREAK,
    CypherLexer.BUILT,
    CypherLexer.BY,
    CypherLexer.CALL,
    CypherLexer.CASCADE,
    CypherLexer.CASE,
    CypherLexer.CIDR,
    CypherLexer.CHANGE,
    CypherLexer.COLLECT,
    CypherLexer.COMMAND,
    CypherLexer.COMMANDS,
    CypherLexer.COMPOSITE,
    CypherLexer.CONSTRAINT,
    CypherLexer.CONSTRAINTS,
    CypherLexer.CONTAINS,
    CypherLexer.CONTINUE,
    CypherLexer.COPY,
    CypherLexer.COUNT,
    CypherLexer.CREATE,
    CypherLexer.CSV,
    CypherLexer.CONCURRENT,
    CypherLexer.CURRENT,
    CypherLexer.DATA,
    CypherLexer.DATABASE,
    CypherLexer.DATABASES,
    CypherLexer.DATE,
    CypherLexer.DATETIME,
    CypherLexer.DBMS,
    CypherLexer.DEALLOCATE,
    CypherLexer.DEFAULT,
    CypherLexer.DEFINED,
    CypherLexer.DELETE,
    CypherLexer.DENY,
    CypherLexer.DESC,
    CypherLexer.DESCENDING,
    CypherLexer.DESTROY,
    CypherLexer.DETACH,
    CypherLexer.DIFFERENT,
    CypherLexer.DISTINCT,
    CypherLexer.DRIVER,
    CypherLexer.DROP,
    CypherLexer.DRYRUN,
    CypherLexer.DUMP,
    CypherLexer.DURATION,
    CypherLexer.EACH,
    CypherLexer.EDGE,
    CypherLexer.ELEMENT,
    CypherLexer.ELEMENTS,
    CypherLexer.ELSE,
    CypherLexer.ENABLE,
    CypherLexer.ENCRYPTED,
    CypherLexer.END,
    CypherLexer.ENDS,
    CypherLexer.ERROR,
    CypherLexer.EXECUTABLE,
    CypherLexer.EXECUTE,
    CypherLexer.EXIST,
    CypherLexer.EXISTENCE,
    CypherLexer.EXISTS,
    CypherLexer.EXTENDED_IDENTIFIER,
    CypherLexer.FAIL,
    CypherLexer.FALSE,
    CypherLexer.FIELDTERMINATOR,
    CypherLexer.FILTER,
    CypherLexer.FINISH,
    CypherLexer.FLOAT,
    CypherLexer.FLOAT32,
    CypherLexer.FLOAT64,
    CypherLexer.FOR,
    CypherLexer.FOREACH,
    CypherLexer.FROM,
    CypherLexer.FULLTEXT,
    CypherLexer.FUNCTION,
    CypherLexer.FUNCTIONS,
    CypherLexer.GRANT,
    CypherLexer.GRAPH,
    CypherLexer.GRAPHS,
    CypherLexer.GROUP,
    CypherLexer.GROUPS,
    CypherLexer.HEADERS,
    CypherLexer.HOME,
    CypherLexer.ID,
    CypherLexer.IF,
    CypherLexer.IMMUTABLE,
    CypherLexer.IMPERSONATE,
    CypherLexer.IMPLIES,
    CypherLexer.IN,
    CypherLexer.INDEX,
    CypherLexer.INDEXES,
    CypherLexer.INF,
    CypherLexer.INFINITY,
    CypherLexer.INSERT,
    CypherLexer.INT,
    CypherLexer.INT8,
    CypherLexer.INT16,
    CypherLexer.INT32,
    CypherLexer.INT64,
    CypherLexer.INTEGER,
    CypherLexer.INTEGER8,
    CypherLexer.INTEGER16,
    CypherLexer.INTEGER32,
    CypherLexer.INTEGER64,
    CypherLexer.IS,
    CypherLexer.JOIN,
    CypherLexer.KEY,
    CypherLexer.LABEL,
    CypherLexer.LABELS,
    CypherLexer.LANGUAGE,
    CypherLexer.LEADING,
    CypherLexer.LET,
    CypherLexer.LIMITROWS,
    CypherLexer.LIST,
    CypherLexer.LOAD,
    CypherLexer.LOCAL,
    CypherLexer.LOOKUP,
    CypherLexer.MANAGEMENT,
    CypherLexer.MAP,
    CypherLexer.MATCH,
    CypherLexer.MERGE,
    CypherLexer.NAME,
    CypherLexer.NAMES,
    CypherLexer.NAN,
    CypherLexer.NEW,
    CypherLexer.NEXT,
    CypherLexer.NFC,
    CypherLexer.NFD,
    CypherLexer.NFKC,
    CypherLexer.NFKD,
    CypherLexer.NODE,
    CypherLexer.NODETACH,
    CypherLexer.NODES,
    CypherLexer.NONE,
    CypherLexer.NORMALIZE,
    CypherLexer.NORMALIZED,
    CypherLexer.NOT,
    CypherLexer.NOTHING,
    CypherLexer.NOWAIT,
    CypherLexer.NULL,
    CypherLexer.OF,
    CypherLexer.OFFSET,
    CypherLexer.ON,
    CypherLexer.ONLY,
    CypherLexer.OPTION,
    CypherLexer.OPTIONAL,
    CypherLexer.OPTIONS,
    CypherLexer.OR,
    CypherLexer.ORDER,
    CypherLexer.PASSWORD,
    CypherLexer.PASSWORDS,
    CypherLexer.PATH,
    CypherLexer.PATHS,
    CypherLexer.PLAINTEXT,
    CypherLexer.POINT,
    CypherLexer.POPULATED,
    CypherLexer.PRIMARY,
    CypherLexer.PRIMARIES,
    CypherLexer.PRIVILEGE,
    CypherLexer.PRIVILEGES,
    CypherLexer.PROCEDURE,
    CypherLexer.PROCEDURES,
    CypherLexer.PROPERTIES,
    CypherLexer.PROPERTY,
    CypherLexer.PROVIDER,
    CypherLexer.PROVIDERS,
    CypherLexer.RANGE,
    CypherLexer.READ,
    CypherLexer.REALLOCATE,
    CypherLexer.REDUCE,
    CypherLexer.REL,
    CypherLexer.RELATIONSHIP,
    CypherLexer.RELATIONSHIPS,
    CypherLexer.REMOVE,
    CypherLexer.RENAME,
    CypherLexer.REPEATABLE,
    CypherLexer.REPLACE,
    CypherLexer.REPLICA,
    CypherLexer.REPLICAS,
    CypherLexer.REPORT,
    CypherLexer.REQUIRE,
    CypherLexer.REQUIRED,
    CypherLexer.RESTRICT,
    CypherLexer.RETRY,
    CypherLexer.RETURN,
    CypherLexer.REVOKE,
    CypherLexer.ROLE,
    CypherLexer.ROLES,
    CypherLexer.ROW,
    CypherLexer.ROWS,
    CypherLexer.SCAN,
    CypherLexer.SECONDARY,
    CypherLexer.SECONDARIES,
    CypherLexer.SEC,
    CypherLexer.SECOND,
    CypherLexer.SECONDS,
    CypherLexer.SEEK,
    CypherLexer.SERVER,
    CypherLexer.SERVERS,
    CypherLexer.SET,
    CypherLexer.SETTING,
    CypherLexer.SETTINGS,
    CypherLexer.SHARD,
    CypherLexer.SHARDS,
    CypherLexer.SHORTEST,
    CypherLexer.SHORTEST_PATH,
    CypherLexer.SHOW,
    CypherLexer.SIGNED,
    CypherLexer.SINGLE,
    CypherLexer.SKIPROWS,
    CypherLexer.START,
    CypherLexer.STARTS,
    CypherLexer.STATUS,
    CypherLexer.STOP,
    CypherLexer.VARCHAR,
    CypherLexer.STRING,
    CypherLexer.SUPPORTED,
    CypherLexer.SUSPENDED,
    CypherLexer.TARGET,
    CypherLexer.TERMINATE,
    CypherLexer.TEXT,
    CypherLexer.THEN,
    CypherLexer.TIME,
    CypherLexer.TIMESTAMP,
    CypherLexer.TIMEZONE,
    CypherLexer.TO,
    CypherLexer.TOPOLOGY,
    CypherLexer.TRAILING,
    CypherLexer.TRANSACTION,
    CypherLexer.TRANSACTIONS,
    CypherLexer.TRAVERSE,
    CypherLexer.TRIM,
    CypherLexer.TRUE,
    CypherLexer.TYPE,
    CypherLexer.TYPED,
    CypherLexer.TYPES,
    CypherLexer.UNION,
    CypherLexer.UNIQUE,
    CypherLexer.UNIQUENESS,
    CypherLexer.UNWIND,
    CypherLexer.URL,
    CypherLexer.USE,
    CypherLexer.USER,
    CypherLexer.USERS,
    CypherLexer.USING,
    CypherLexer.VALUE,
    CypherLexer.VECTOR,
    CypherLexer.VERTEX,
    CypherLexer.WAIT,
    CypherLexer.WHEN,
    CypherLexer.WHERE,
    CypherLexer.WITH,
    CypherLexer.WITHOUT,
    CypherLexer.WRITE,
    CypherLexer.XOR,
    CypherLexer.YIELD,
    CypherLexer.ZONE,
    CypherLexer.ZONED,
    // Preparser tokens
    CypherLexer.EXPLAIN,
    CypherLexer.PROFILE,
    CypherLexer.CYPHER,
];
export const lexerConsoleCmds = [
    CypherLexer.HISTORY,
    CypherLexer.PARAM,
    CypherLexer.CLEAR,
    CypherLexer.CONNECT,
    CypherLexer.DISCONNECT,
    CypherLexer.WELCOME,
    CypherLexer.SYSINFO,
    CypherLexer.STYLE,
    CypherLexer.RESET,
    CypherLexer.PLAY,
    CypherLexer.ACCESSMODE,
];
function toTokentypeObject(arr, tokenType) {
    return arr.reduce((acc, curr) => ({ ...acc, [curr]: tokenType }), {});
}
export const lexerSymbols = {
    ...toTokentypeObject(lexerOperators, CypherTokenType.operator),
    ...toTokentypeObject(lexerKeywords, CypherTokenType.keyword),
    ...toTokentypeObject(lexerBrackets, CypherTokenType.bracket),
    ...toTokentypeObject(lexerComment, CypherTokenType.comment),
    ...toTokentypeObject(lexerGarbage, CypherTokenType.none),
    ...toTokentypeObject(lexerNumberLiterals, CypherTokenType.numberLiteral),
    ...toTokentypeObject(lexerPunctuation, CypherTokenType.punctuation),
    ...toTokentypeObject(lexerSeparators, CypherTokenType.separator),
    ...toTokentypeObject(lexerStringLiteral, CypherTokenType.stringLiteral),
    ...toTokentypeObject(identifier, CypherTokenType.variable),
    ...toTokentypeObject(lexerConsoleCmds, CypherTokenType.consoleCommand),
};
export const hasIncorrectSymbolicName = {
    [CypherLexer.ALL_SHORTEST_PATHS]: 'allShortestPaths',
    [CypherLexer.SHORTEST_PATH]: 'shortestPath',
    [CypherLexer.LIMITROWS]: 'LIMIT',
    [CypherLexer.SKIPROWS]: 'SKIP',
    [CypherLexer.ACCESSMODE]: 'access-mode',
};
const { literalNames, symbolicNames } = CypherLexer;
const length = Math.max(literalNames.length, symbolicNames.length);
export const tokenNames = Array.from({ length }).map((_, i) => hasIncorrectSymbolicName[i] ??
    literalNames[i] ??
    symbolicNames[i] ??
    '<INVALID');
export const keywordNames = new Set(lexerKeywords.map((i) => tokenNames[i]));
export const operatorSymbols = new Set(lexerOperators.map((i) => literalNames[i].replaceAll("'", '')));
//# sourceMappingURL=lexerSymbols.js.map