import { type ParserRuleContext } from "antlr4ng"; export type StatementCategory = "query" | "dml" | "ddl" | "dcl" | "tcl" | "utility" | "compound" | "other"; export type StatementKind = "query" | "dml" | "ddl" | "other"; /** Coarse rollup of a StatementCategory. ddl stays object DDL; dcl/tcl/utility/compound → other. */ export declare function coarseKind(category: StatementCategory): StatementKind; /** * Statements swallowed by error recovery at a batch root. When a statement inside a `;`-separated * batch fails to parse, ANTLR's recovery cannot resync at the separator: the remainder of the input * — including healthy statements after the break — attaches to the batch root as flat error-node * tokens instead of parsed elements. The CST element count then under-reports the batch, so a * CST-derived statement kind called a broken batch "query" and statementCategories under-counted * (anvil bug report, 2026-07-05). This derives the missing count from the swallowed TOKENS, which * are always intact (lexing is total). * * A swallowed statement = a non-empty `;`-separated group of error-node tokens among the root's * DIRECT children that starts at a statement boundary — beginning of input, after a `;`, or after * a parsed sibling whose last token is `;`. The boundary condition keeps a single broken * statement's trailing garbage (`select a from t t2 t3` — no separator anywhere) from counting as * a phantom second statement; strings can never split a group (a string is one token). */ export declare function swallowedStatements(root: ParserRuleContext): number; /** The `statementCategories` entries for the swallowed statements — one honest "other" per unit * (their text never parsed, so no finer classification is derivable without a keyword guess). */ export declare function swallowedCategories(root: ParserRuleContext): StatementCategory[]; /** * Map a single leading statement keyword to a category. This is the fallback only for grammar * alternatives that carry no distinguishing rule — object DDL, DCL and utility commands all begin * with their verb, so the keyword is the authoritative signal there. It is used only AFTER the * structural query / dml / compound cases have already been decided by the dialect. */ export declare function keywordCategory(keyword: string): StatementCategory;