import { createToken, Lexer } from "chevrotain";
export const Whitespace = createToken({
    name: "Whitespace",
    pattern: /[\s\t\n\r]+/,
    group: Lexer.SKIPPED,
});
export const LineComment = createToken({
    name: "LineComment",
    pattern: /--[^\n\r]*/,
    group: Lexer.SKIPPED,
});
export const Select = createToken({
    name: "Select",
    pattern: /select\b/i,
});
export const Insert = createToken({
    name: "Insert",
    pattern: /insert\b/i,
});
export const Update = createToken({
    name: "Update",
    pattern: /update\b/i,
});
export const Delete = createToken({
    name: "Delete",
    pattern: /delete\b/i,
});
export const From = createToken({
    name: "From",
    pattern: /from\b/i,
});
export const Into = createToken({
    name: "Into",
    pattern: /into\b/i,
});
export const DefaultKeyword = createToken({
    name: "DefaultKeyword",
    pattern: /default\b/i,
});
export const Where = createToken({
    name: "Where",
    pattern: /where\b/i,
});
export const And = createToken({
    name: "And",
    pattern: /and\b/i,
});
export const Or = createToken({
    name: "Or",
    pattern: /or\b/i,
});
export const Not = createToken({
    name: "Not",
    pattern: /not\b/i,
});
export const Limit = createToken({
    name: "Limit",
    pattern: /limit\b/i,
});
export const Offset = createToken({
    name: "Offset",
    pattern: /offset\b/i,
});
export const Order = createToken({
    name: "Order",
    pattern: /order\b/i,
});
export const By = createToken({
    name: "By",
    pattern: /by\b/i,
});
export const Distinct = createToken({
    name: "Distinct",
    pattern: /distinct\b/i,
});
export const Asc = createToken({
    name: "Asc",
    pattern: /asc\b/i,
});
export const Desc = createToken({
    name: "Desc",
    pattern: /desc\b/i,
});
export const Group = createToken({
    name: "Group",
    pattern: /group\b/i,
});
export const Union = createToken({
    name: "Union",
    pattern: /union\b/i,
});
export const All = createToken({
    name: "All",
    pattern: /all\b/i,
});
export const Intersect = createToken({
    name: "Intersect",
    pattern: /intersect\b/i,
});
export const Except = createToken({
    name: "Except",
    pattern: /except\b/i,
});
export const With = createToken({
    name: "With",
    pattern: /with\b/i,
});
export const Recursive = createToken({
    name: "Recursive",
    pattern: /recursive\b/i,
});
export const Inner = createToken({
    name: "Inner",
    pattern: /inner\b/i,
});
export const Left = createToken({
    name: "Left",
    pattern: /left\b/i,
});
export const Right = createToken({
    name: "Right",
    pattern: /right\b/i,
});
export const Full = createToken({
    name: "Full",
    pattern: /full\b/i,
});
export const Join = createToken({
    name: "Join",
    pattern: /join\b/i,
});
export const On = createToken({
    name: "On",
    pattern: /on\b/i,
});
export const Conflict = createToken({
    name: "Conflict",
    pattern: /conflict\b/i,
});
export const Over = createToken({
    name: "Over",
    pattern: /over\b/i,
});
export const Partition = createToken({
    name: "Partition",
    pattern: /partition\b/i,
});
export const RowsKeyword = createToken({
    name: "RowsKeyword",
    pattern: /rows\b/i,
});
export const RangeKeyword = createToken({
    name: "RangeKeyword",
    pattern: /range\b/i,
});
export const GroupsKeyword = createToken({
    name: "GroupsKeyword",
    pattern: /groups\b/i,
});
export const UnboundedKeyword = createToken({
    name: "UnboundedKeyword",
    pattern: /unbounded\b/i,
});
export const PrecedingKeyword = createToken({
    name: "PrecedingKeyword",
    pattern: /preceding\b/i,
});
export const FollowingKeyword = createToken({
    name: "FollowingKeyword",
    pattern: /following\b/i,
});
export const CurrentKeyword = createToken({
    name: "CurrentKeyword",
    pattern: /current\b/i,
});
export const RowKeyword = createToken({
    name: "RowKeyword",
    pattern: /row\b/i,
});
export const WindowKeyword = createToken({
    name: "WindowKeyword",
    pattern: /window\b/i,
});
export const DoKeyword = createToken({
    name: "DoKeyword",
    pattern: /do\b/i,
});
export const NothingKeyword = createToken({
    name: "NothingKeyword",
    pattern: /nothing\b/i,
});
export const SetKeyword = createToken({
    name: "SetKeyword",
    pattern: /set\b/i,
});
export const Is = createToken({
    name: "Is",
    pattern: /is\b/i,
});
export const InKeyword = createToken({
    name: "InKeyword",
    pattern: /in\b/i,
});
export const NullKeyword = createToken({
    name: "NullKeyword",
    pattern: /null\b/i,
});
export const Exists = createToken({
    name: "Exists",
    pattern: /exists\b/i,
});
export const Between = createToken({
    name: "Between",
    pattern: /between\b/i,
});
export const Like = createToken({
    name: "Like",
    pattern: /like\b/i,
});
export const Match = createToken({
    name: "Match",
    pattern: /match\b/i,
});
export const Glob = createToken({
    name: "Glob",
    pattern: /glob\b/i,
});
export const Regexp = createToken({
    name: "Regexp",
    pattern: /regexp\b/i,
});
export const CaseKeyword = createToken({
    name: "CaseKeyword",
    pattern: /case\b/i,
});
export const WhenKeyword = createToken({
    name: "WhenKeyword",
    pattern: /when\b/i,
});
export const ThenKeyword = createToken({
    name: "ThenKeyword",
    pattern: /then\b/i,
});
export const ElseKeyword = createToken({
    name: "ElseKeyword",
    pattern: /else\b/i,
});
export const EndKeyword = createToken({
    name: "EndKeyword",
    pattern: /end\b/i,
});
export const As = createToken({
    name: "As",
    pattern: /as\b/i,
});
export const Values = createToken({
    name: "Values",
    pattern: /values\b/i,
});
export const Identifier = createToken({
    name: "Identifier",
    pattern: /[A-Za-z_][A-Za-z0-9_]*/,
    longer_alt: [
        Select,
        Insert,
        Update,
        Delete,
        From,
        Into,
        DefaultKeyword,
        Where,
        And,
        Order,
        Limit,
        Offset,
        Or,
        Not,
        By,
        Distinct,
        Asc,
        Desc,
        Group,
        Inner,
        Left,
        Right,
        Full,
        Join,
        On,
        Conflict,
        Over,
        Partition,
        RowsKeyword,
        RangeKeyword,
        GroupsKeyword,
        UnboundedKeyword,
        PrecedingKeyword,
        FollowingKeyword,
        CurrentKeyword,
        RowKeyword,
        WindowKeyword,
        DoKeyword,
        NothingKeyword,
        With,
        Recursive,
        Is,
        InKeyword,
        NullKeyword,
        Exists,
        Between,
        Like,
        Match,
        Glob,
        Regexp,
        CaseKeyword,
        WhenKeyword,
        ThenKeyword,
        ElseKeyword,
        EndKeyword,
        SetKeyword,
        DefaultKeyword,
        Values,
        As,
    ],
});
export const QuotedIdentifier = createToken({
    name: "QuotedIdentifier",
    pattern: /"(?:[^"]|"")*"/,
});
export const StringLiteral = createToken({
    name: "StringLiteral",
    pattern: /'(?:''|[^'])*'/,
});
export const NumberLiteral = createToken({
    name: "NumberLiteral",
    pattern: /[0-9]+(?:\.[0-9]+)?/,
});
export const Star = createToken({
    name: "Star",
    pattern: /\*/,
});
export const Comma = createToken({
    name: "Comma",
    pattern: /,/,
});
export const LeftParen = createToken({
    name: "LeftParen",
    pattern: /\(/,
});
export const RightParen = createToken({
    name: "RightParen",
    pattern: /\)/,
});
export const Dot = createToken({
    name: "Dot",
    pattern: /\./,
});
export const Parameter = createToken({
    name: "Parameter",
    pattern: /\?[0-9]*/,
});
export const Semicolon = createToken({
    name: "Semicolon",
    pattern: /;/,
});
export const Equals = createToken({
    name: "Equals",
    pattern: /=/,
});
export const JsonExtractText = createToken({
    name: "JsonExtractText",
    pattern: /->>/,
});
export const JsonExtract = createToken({
    name: "JsonExtract",
    pattern: /->/,
    longer_alt: [JsonExtractText],
});
export const NotEquals = createToken({
    name: "NotEquals",
    pattern: /!=/,
});
export const NotEqualsAlt = createToken({
    name: "NotEqualsAlt",
    pattern: /<>/,
});
export const GreaterThanOrEqual = createToken({
    name: "GreaterThanOrEqual",
    pattern: />=/,
});
export const LessThanOrEqual = createToken({
    name: "LessThanOrEqual",
    pattern: /<=/,
});
export const GreaterThan = createToken({
    name: "GreaterThan",
    pattern: />/,
});
export const LessThan = createToken({
    name: "LessThan",
    pattern: /</,
});
export const Plus = createToken({
    name: "Plus",
    pattern: /\+/,
});
export const Minus = createToken({
    name: "Minus",
    pattern: /-/,
});
export const Slash = createToken({
    name: "Slash",
    pattern: /\//,
});
export const Percent = createToken({
    name: "Percent",
    pattern: /%/,
});
export const Concat = createToken({
    name: "Concat",
    pattern: /\|\|/,
});
const tokens = [
    LineComment,
    Whitespace,
    Select,
    Insert,
    Update,
    Delete,
    From,
    Into,
    DefaultKeyword,
    Where,
    And,
    Order,
    Limit,
    Offset,
    Or,
    Not,
    By,
    Distinct,
    Asc,
    Desc,
    Group,
    Inner,
    Left,
    Right,
    Full,
    Join,
    On,
    Conflict,
    Over,
    Partition,
    RowsKeyword,
    RangeKeyword,
    GroupsKeyword,
    UnboundedKeyword,
    PrecedingKeyword,
    FollowingKeyword,
    CurrentKeyword,
    RowKeyword,
    WindowKeyword,
    DoKeyword,
    NothingKeyword,
    Union,
    All,
    Intersect,
    Except,
    With,
    Recursive,
    Is,
    InKeyword,
    NullKeyword,
    Exists,
    Between,
    Like,
    Match,
    Glob,
    Regexp,
    CaseKeyword,
    WhenKeyword,
    ThenKeyword,
    ElseKeyword,
    EndKeyword,
    SetKeyword,
    Values,
    As,
    Star,
    Comma,
    LeftParen,
    RightParen,
    Dot,
    Parameter,
    Semicolon,
    NotEquals,
    NotEqualsAlt,
    GreaterThanOrEqual,
    LessThanOrEqual,
    GreaterThan,
    LessThan,
    Equals,
    Concat,
    JsonExtractText,
    JsonExtract,
    Plus,
    Minus,
    Slash,
    Percent,
    StringLiteral,
    NumberLiteral,
    QuotedIdentifier,
    Identifier,
];
export const sqlTokens = tokens;
export const sqlLexer = new Lexer(tokens, {
    positionTracking: "onlyOffset",
});
//# sourceMappingURL=lexer.js.map