import { Grammar } from "./cfg.js"; import { GrammarSymbols, Sym } from "./grammar_symbols.js"; export declare const enum ExprKind { SEQ = 0, OR = 1, OPT = 2, STAR = 3, PLUS = 4 } export type Expr = Sym | { kind: ExprKind; params: Expr[]; }; export type ExprGrammar = { start: Sym; rules: { lhs: Sym; rhs: Expr; }[]; distinct?: Sym[][]; empty?: [Sym, Sym][]; final?: Sym[]; }; export declare function cloneExpr(expr: Expr): Expr; export declare function cloneExprGrammar(grammar: ExprGrammar): ExprGrammar; export declare function rule(lhs: Sym, ...rhs: Expr[]): { lhs: Sym; rhs: Expr; }; export declare function seq(...exprs: Expr[]): Expr; export declare function or(...exprs: Expr[]): Expr; export declare function opt(...exprs: Expr[]): Expr; export declare function star(...exprs: Expr[]): Expr; export declare function plus(...exprs: Expr[]): Expr; export declare function printExpr(expr: Expr): string; export declare function convertExprGrammar(exprGrammar: ExprGrammar, prefix_nonterminals?: string): { symbols: GrammarSymbols; grammar: Grammar; };