/**
 * Expression parser — Task H.1.2 (chevrotain v11 CstParser).
 *
 * Builds a CST from lexer.ts (H.1.1) tokens; CST→AST visitor lives in H.1.3.
 *
 * Grammar (9 rules — precedence via nesting depth, low→high `||<&&<!<cmp`):
 *   expression  := orExpr
 *   orExpr      := andExpr ( '||' andExpr )*
 *   andExpr     := notExpr ( '&&' notExpr )*
 *   notExpr     := '!'? compareExpr
 *   compareExpr := primary ( (==|!=|<|<=|>|>=) primary )?
 *   primary     := '(' expression ')' | literal | callOrPath
 *   callOrPath  := Identifier ( '(' args ')' | pathSegment* )?
 *   pathSegment := '.' Identifier | '[' (NumberLit | StringLit) ']'
 *   literal     := StringLit | NumberLit | True | False | Null
 *
 * Left-associativity via `MANY`: chevrotain LL(k) rejects left-recursion at
 * `performSelfAnalysis()`. The idiomatic shape `lhs ( OP rhs )*` lets the
 * visitor left-fold the children. No chained comparison: single `OPTION` on
 * compareExpr; `a < b < c` surfaces as a parse error under recoveryEnabled:false.
 *
 * Singleton per chevrotain perf guide — one instance reused (state reset via
 * `parser.input = tokens`). Fresh instance per call would re-run
 * performSelfAnalysis() (~5ms). Audit-grep `new ExpressionParser` = 1 match.
 *
 * LL(1) disjointness audit — all OR/OPTION sites have disjoint first-tokens:
 * primary {LParen|literal|Identifier}; callOrPath OPTION {LParen|Dot/LBracket};
 * pathSegment {Dot|LBracket}; literal {5 distinct kinds}; compareExpr {6 ops}.
 *
 * CST navigation hints for H.1.3 visitor:
 *   - LABEL'd sub-rules live under `children.lhs`/`children.rhs`;
 *     un-labeled sub-rules use the sub-rule name as the key.
 *   - `MANY` collects same-LABEL children into an array (e.g.
 *     `orExpr.children.rhs` is `CstNode[]` length 0..N).
 *   - `callOrPath.children` has `Identifier` (always) plus either
 *     `LParen`+`arg[]`+`RParen` (call) or `pathSegment[]` (path). Distinguish
 *     by presence of `LParen`. Args use `LABEL:'arg'` →
 *     `children.arg` is `CstNode[]` of expressions.
 *
 * Pinned to chevrotain ^11.0.0 — same engine constraint as lexer.ts.
 */
import { CstParser, type CstNode, type IToken } from 'chevrotain';
declare class ExpressionParser extends CstParser {
    constructor();
    expression: import("chevrotain").ParserMethod<[], CstNode>;
    private orExpr;
    private andExpr;
    private notExpr;
    private compareExpr;
    private primary;
    private callOrPath;
    private pathSegment;
    private literal;
}
declare const parserInstance: ExpressionParser;
/** Parse error — `offset` is start-offset of the offending token (-1 if none). */
export interface ParseError {
    message: string;
    offset: number;
}
/** Result of a parse attempt — cst always present (may be partial on error). */
export interface ParseResult {
    cst: CstNode;
    errors: ParseError[];
}
/**
 * Parse a token stream into a CST. Caller invokes the lexer first and passes
 * the `{ tokens }` result (matches `ILexingResult` shape so callers can pass
 * `lexer.tokenize(input)` directly). recoveryEnabled:false means we stop at
 * the first error and surface it via the snapshot below.
 */
export declare function parseToCst(tokens: {
    tokens: IToken[];
}): ParseResult;
export { parserInstance };
//# sourceMappingURL=parser.d.ts.map