import { ParserRuleContext } from "antlr4ng"; import type { Dialect } from "../dialect.js"; /** The three verdicts `deriveConsumedAs` ever stamps (matches `Token.consumedAs`'s type). */ export type ConsumedAs = "keyword" | "identifier" | "type"; export interface ConsumedAsRules { /** Rule indices that realize "this token is a name": non-reserved-word wrappers and every * rule strictly between one and the keyword terminal for a real grammar path. */ identifierRules: ReadonlySet; /** Rule indices that realize "this token is a type name": data-type productions and every * rule strictly between one and the keyword terminal. Undefined when the dialect's type * grammar does not cleanly separate from generic identifier/keyword use (documented per * dialect below); those dialects only ever produce "identifier" | "keyword". */ typeRules?: ReadonlySet; } /** * Walk `tree` once and return every ordinary (non-error-recovery) consumed terminal's antlr * `tokenIndex` mapped to its verdict. A tokenIndex absent from the map was never consumed as * a genuine part of the parse (error-recovery skip, or the caller passed a hidden-channel * token that could never reach the tree); callers read that absence as "no verdict", not * "keyword" (see token.ts's `consumedAs` doc). Every entry is one of the three verdicts; * whether the caller SHOWS "keyword" (vs. leaving the field off) is the caller's call, gated * on the token's role. This function has no notion of token role at all. */ export declare function deriveConsumedAs(tree: ParserRuleContext, rules: ConsumedAsRules): Map; /** Per-dialect rule config for `deriveConsumedAs`. `typeRules` is absent for sqlite (see its note * above); every other dialect's type grammar was clean enough to enumerate. */ export declare const CONSUMED_AS_RULES: Record;