import { Token } from './lexer'; export declare type AST = { type: 'error'; message: string; } | { type: 'literal'; value: string; } | { type: 'terminal'; value: Token['type']; } | { type: 'identifier'; value: string; } | { type: 'structure'; startToken: string; endToken: string; expr: AST; } | { type: 'maybe'; expr: AST; } | { type: 'repeat0'; expr: AST; } | { type: 'repeat1'; expr: AST; } | { type: 'sepBy0'; expr: AST; separator: AST; } | { type: 'sepBy1'; expr: AST; separator: AST; } | { type: 'seq'; exprs: AST[]; fn: SeqFn | null; } | { type: 'alt'; exprs: AST[]; } | { type: 'ruleset'; rules: Array<{ name: string; expr: AST; }>; }; export declare function print(node: AST, indent?: number, prec?: number): string; export declare function checkLit(x: string): AST; declare type SeqFn = (...xs: any[]) => unknown; export declare const builders: { error: (message: string) => AST; ident: (value: string) => AST; lit: (value: string) => AST; terminal: (value: Token['type']) => AST; alt: (...exprs: AST[]) => AST; seq: (fn: SeqFn | null, ...exprs: AST[]) => AST; repeat0: (expr: AST) => AST; repeat1: (expr: AST) => AST; maybe: (expr: AST) => AST; sepBy0: (expr: AST, separator: AST) => AST; sepBy1: (expr: AST, separator: AST) => AST; structure: (startToken: string, expr: AST, endToken: string) => AST; rule: (name: string, expr: AST) => { name: string; expr: AST; }; ruleset: (...rules: Array<{ name: string; expr: AST; }>) => AST; }; export declare const coreAST: AST; export {};