export type Expr = Alt | Any | Apply | ApplyGeneralized | CaseInsensitive | Dispatch | End | Lex | LiftedTerminal | Lookahead | Opt | Not | Param | Plus | Range | Seq | Star | Terminal | UnicodeChar; export type FailableExpr = Any | Apply | CaseInsensitive | End | LiftedTerminal | Range | Terminal | UnicodeChar; export interface Alt { type: 'Alt'; children: Expr[]; outArity: number; } export declare const alt: (children: Expr[]) => Alt; export interface Any { type: 'Any'; } export declare const any: () => Any; type ApplyLike = Extract; export interface Apply { type: 'Apply'; ruleName: string; descriptionId?: number; children: ApplyLike[]; } export declare const apply: (ruleName: string, descriptionId?: number, children?: ApplyLike[]) => Apply; export interface ApplyGeneralized { type: 'ApplyGeneralized'; ruleName: string; caseIdx: number; } export declare const applyGeneralized: (ruleName: string, caseIdx: number) => ApplyGeneralized; export interface CaseInsensitive { type: 'CaseInsensitive'; value: string; } export declare const caseInsensitive: (value: string) => CaseInsensitive; export interface Dispatch { type: 'Dispatch'; child: Expr; patterns: Expr[][]; } export declare const dispatch: (child: Apply | Param, patterns: Expr[][]) => Dispatch; export interface End { type: 'End'; } export declare const end: () => End; export interface Lex { type: 'Lex'; child: Expr; outArity: number; } export declare const lex: (child: Expr) => Lex; export interface Lookahead { type: 'Lookahead'; child: Expr; outArity: number; } export declare const lookahead: (child: Expr) => Lookahead; export interface Opt { type: 'Opt'; child: Expr; } export declare const opt: (child: Expr) => Opt; export interface Not { type: 'Not'; child: Expr; } export declare const not: (child: Expr) => Not; export interface Param { type: 'Param'; index: number; } export declare const param: (index: number) => Param; export interface Plus { type: 'Plus'; child: Expr; } export declare const plus: (child: Expr) => Plus; export interface Range { type: 'Range'; lo: number; hi: number; } export declare const range: (lo: number, hi: number) => Range; export interface Seq { type: 'Seq'; children: Expr[]; outArity: number; } export declare const seq: (children: Expr[]) => Seq; export interface Star { type: 'Star'; child: Expr; } export declare const star: (child: Expr) => Star; export interface Terminal { type: 'Terminal'; value: string; } export declare const terminal: (value: string) => Terminal; export interface UnicodeChar { type: 'UnicodeChar'; categoryOrProp: string; } export declare const unicodeChar: (categoryOrProp: string) => UnicodeChar; export interface LiftedTerminal { type: 'LiftedTerminal'; terminalId: number; failureId: number; } export declare const liftedTerminal: (terminalId: number, failureId: number) => LiftedTerminal; export declare function collectParams(exp: Expr, seen?: Set): Param[]; export declare function substituteParams(exp: T, actuals: Exclude[]): Exclude; export declare function specializedName(app: Apply | LiftedTerminal): string; export type ExprType = Expr extends { type: infer U; } ? U : never; export type RewriteActions = { [K in ExprType]?: (exp: Extract) => Expr; }; export declare function rewrite(exp: Expr, actions: RewriteActions): Expr; export declare function toString(exp: Expr): string; export declare function outArity(exp: Expr): number; export {}; //# sourceMappingURL=ir.d.ts.map