/**
 * AST + CST→AST visitor — Task H.1.3 (chevrotain v11 visitor).
 *
 * Lowers the CST from parser.ts (H.1.2) into a 6-kind discriminated union
 * (literal | name | path | call | unary | binary). Switches over
 * `ASTNode['kind']` MUST end with `assertNever(node)` so a new kind breaks
 * typecheck at every callsite. Nodes carry `offset: number` from the
 * originating token's `startOffset`; binary nodes inherit the LHS offset so
 * left-folded chains point at the leftmost operand. orExpr/andExpr fold
 * left-to-right (`((a&&b)&&c)`). Strings strip outer quotes then process
 * `\"` `\\` `\n` `\t` `\r` (unknown escapes pass through). `validateVisitor()`
 * is REQUIRED — without it, visitor-method typos silently return undefined.
 */
import type { CstNode } from 'chevrotain';
export type BinaryOp = '==' | '!=' | '<' | '<=' | '>' | '>=' | '&&' | '||';
export type PathSegment = {
    kind: 'prop';
    name: string;
} | {
    kind: 'index';
    value: number | string;
};
export type ASTNode = {
    kind: 'literal';
    value: string | number | boolean | null;
    offset: number;
} | {
    kind: 'name';
    id: string;
    offset: number;
} | {
    kind: 'path';
    target: ASTNode;
    segments: PathSegment[];
    offset: number;
} | {
    kind: 'call';
    name: string;
    args: ASTNode[];
    offset: number;
} | {
    kind: 'unary';
    op: '!';
    operand: ASTNode;
    offset: number;
} | {
    kind: 'binary';
    op: BinaryOp;
    lhs: ASTNode;
    rhs: ASTNode;
    offset: number;
};
/** Throw on unhandled discriminator — call from any switch over `ASTNode['kind']`. */
export declare function assertNever(x: never): never;
/** Lower a parser CST into an AST. Throws if the CST shape is malformed. */
export declare function cstToAst(cst: CstNode): ASTNode;
//# sourceMappingURL=ast.d.ts.map