import type { Dialect } from "./dialect.js"; /** Per-dialect membership sets — canonical UPPERCASE names. See module header for sources * and heuristic limits per set. */ export interface DialectSymbols { functions: ReadonlySet; keywords: ReadonlySet; types: ReadonlySet; } /** Per-position identifier-admission record for one keyword in one dialect, probe-derived (see * tools/gen-reserved.ts). `reserved` is true iff the grammar admits the keyword as neither a bare * column reference nor a bare table name; `alias` (the AS-labeled projection-alias slot) is * recorded but deliberately excluded from `reserved` — verified genuinely maximally permissive by * grammar design in several of these dialects (Postgres's own keyword-appendix docs: any keyword * is a valid column label after AS), so folding it in would score classic reserved words like * FROM as soft purely on that slot's leniency. */ export interface KeywordReservation { /** True iff admitted in NEITHER the column NOR the table position. */ reserved: boolean; /** Parses clean as a SELECT-list alias: `SELECT 1 AS `. */ alias: boolean; /** Parses clean as a bare column reference: `SELECT FROM t`. */ column: boolean; /** Parses clean as a bare table name: `SELECT a FROM `. */ table: boolean; } /** One vocabulary keyword's symbolic lexer name plus its reserved/soft split. */ export interface KeywordEntry extends KeywordReservation { /** Symbolic lexer rule name (e.g. "SELECT", bigquery's "SELECT_SYMBOL"). */ symbol: string; } /** A dialect's token catalog: literal spelling → the lexer rule's symbolic name (+ reserved split * for keywords). */ export interface DialectVocabulary { /** Keyword literal text (canonical UPPERCASE) → symbol name + reserved/soft split. */ keywords: ReadonlyMap; /** Operator/punctuation literal text (exact spelling) → symbolic token name (e.g. "::" → its rule name). */ operators: ReadonlyMap; } /** * The dialect's token catalog (keywords + operators, spelling → symbolic name), derived from * the generated lexer, computed once and cached. See the module block comment for the * derivation, stability guarantees, and what is deliberately absent (pattern tokens, * parser-level compounds). */ export declare function dialectVocabulary(dialect: Dialect): DialectVocabulary; /** * The dialect's hard-reserved keyword spellings (canonical UPPERCASE) — every keyword whose * `KeywordEntry.reserved` is true, i.e. the grammar admits it as neither a bare column reference * nor a bare table name (the AS-alias slot is excluded from this determination; see * `KeywordReservation`'s doc comment). A convenience over `dialectVocabulary(dialect).keywords` * for the common "is this identifier a reserved word?" membership check. Computed once per * dialect and cached. */ export declare function reservedKeywords(dialect: Dialect): ReadonlySet; /** * The known function / keyword / type-name membership sets for a dialect — canonical UPPERCASE * strings, computed once and cached (repeat calls for the same dialect return the identical Set * instances). See the module header for exact sources and the heuristic's known limits. */ export declare function dialectSymbols(dialect: Dialect): DialectSymbols;