export declare class NodeVisitor {
    visitImport(stmt: Import): void;
    visitContextStmt(stmt: ContextStmt): void;
    visitNonTerminalStmt(stmt: NonTerminalStmt): void;
    visitKeyFunctionDeclaration(stmt: KeyFunctionDeclarationStmt): void;
    visitExpansionRule(stmt: Expansion): void;
    visitConstantsRule(stmt: Constants): void;
    visitConditionRule(stmt: Condition): void;
    visitNonTerminalRuleHead(node: RuleHeadPart): void;
}
export declare class Grammar {
    comment: string;
    statements: Statement[];
    constructor(comment: string, statements: Statement[]);
    visit(visitor: NodeVisitor): void;
    codegen(): string;
}
export declare abstract class Statement {
    static CodeBlock: typeof CodeBlock;
    static JSImportStmt: typeof JSImportStmt;
    static NonTerminal: typeof NonTerminalStmt;
    static Context: typeof ContextStmt;
    static FunctionDeclaration: typeof FunctionDeclarationStmt;
    static ForLoop: typeof ForLoop;
    static If: typeof IfStmt;
    static Import: typeof Import;
    static KeyFunctionDeclaration: typeof KeyFunctionDeclarationStmt;
    abstract codegen(prefix?: string): string;
    abstract visit(visitor: NodeVisitor): void;
}
export declare class CodeBlock extends Statement {
    code: string;
    constructor(code: string);
    codegen(): string;
    visit(visitor: NodeVisitor): void;
}
export declare class JSImportStmt extends Statement {
    code: string;
    constructor(code: string);
    codegen(): string;
    visit(visitor: NodeVisitor): void;
}
export declare class KeyFunctionDeclarationStmt extends Statement {
    decls: Array<[string, string]>;
    constructor(decls: Array<[string, string]>);
    codegen(): string;
    visit(visitor: NodeVisitor): void;
}
export declare class NonTerminalStmt extends Statement {
    name: string;
    type: string | undefined;
    rules: Rule[];
    keyfn: string;
    constructor(name: string, type: string | undefined, rules: Rule[]);
    visit(visitor: NodeVisitor): void;
    codegen(prefix?: string): string;
}
export declare class ContextStmt extends Statement {
    names: string[];
    type: string | undefined;
    constructor(names: string[], type: string | undefined);
    visit(visitor: NodeVisitor): void;
    codegen(prefix?: string): string;
}
export declare class FunctionDeclarationStmt extends Statement {
    name: string;
    args: string;
    code: string;
    type: string;
    constructor(name: string, args: string, code: string, type?: string);
    visit(visitor: NodeVisitor): void;
    codegen(prefix?: string): string;
}
export declare class ForLoop extends Statement {
    head: string;
    statements: Statement[];
    constructor(head: string, statements: Statement[]);
    visit(visitor: NodeVisitor): void;
    codegen(prefix?: string): string;
}
export declare class IfStmt extends Statement {
    cond: string;
    iftrue: Statement[];
    iffalse: Statement[];
    constructor(cond: string, iftrue: Statement[], iffalse: Statement[]);
    visit(visitor: NodeVisitor): void;
    codegen(prefix?: string): string;
}
export declare class Import extends Statement {
    what: string;
    constructor(what: string);
    visit(visitor: NodeVisitor): void;
    codegen(prefix?: string): string;
}
interface RuleAttribute {
    name: string;
    code: string;
}
export declare class RuleAttributes {
    attributes: RuleAttribute[];
    constructor(attributes?: RuleAttribute[]);
    codegen(): string;
}
export declare abstract class Rule {
    static Constants: typeof Constants;
    static Expansion: typeof Expansion;
    static Condition: typeof Condition;
    abstract codegen(nonTerminal: string, prefix: string, type: string, keyfn: string): string;
    abstract visit(visitor: NodeVisitor): void;
}
export declare class Constants extends Rule {
    token: string;
    typeCode: string;
    attrs: RuleAttributes;
    constructor(token: string, typeCode: string, attrs: RuleAttributes);
    visit(visitor: NodeVisitor): void;
    codegen(nonTerminal: string, prefix: string | undefined, type: string, keyfn: string): string;
}
export declare class Expansion extends Rule {
    head: RuleHeadPart[];
    bodyCode: string;
    attrs: RuleAttributes;
    constructor(head: RuleHeadPart[], bodyCode: string, attrs: RuleAttributes);
    visit(visitor: NodeVisitor): void;
    getTranslationKey(): [string, string, boolean];
    codegen(nonTerminal: string, prefix: string | undefined, type: string, keyfn: string): string;
}
export declare class Condition extends Rule {
    flag: string;
    rules: Rule[];
    constructor(flag: string, rules: Rule[]);
    visit(visitor: NodeVisitor): void;
    codegen(nonTerminal: string, prefix: string, type: string, keyfn: string): string;
}
export declare abstract class NonTerminalConstraint {
    static Constant: typeof ConstantNonTerminalConstraint;
    static Equality: typeof EqualityNonTerminalConstraint;
    abstract codegen(allParts: RuleHeadPart[], ourKeyFn: string, ourIndex: number): string;
}
export declare class EqualityNonTerminalConstraint extends NonTerminalConstraint {
    ourIndexName: string;
    nonTermRef: string;
    theirIndexName: string;
    constructor(ourIndexName: string, nonTermRef: string, theirIndexName: string);
    codegen(allParts: RuleHeadPart[], ourKeyFn: string, ourIndex: number): string;
}
export declare class ConstantNonTerminalConstraint extends NonTerminalConstraint {
    indexName: string;
    valueCode: string;
    constructor(indexName: string, valueCode: string);
    codegen(allParts: RuleHeadPart[], ourKeyFn: string): string;
}
export declare abstract class RuleHeadPart {
    static NonTerminal: typeof NonTerminalRuleHead;
    static StringLiteral: typeof StringLiteralRuleHead;
    static ComputedStringLiteral: typeof ComputedStringLiteralRuleHead;
    static Choice: typeof ChoiceRuleHead;
    abstract type: string;
    abstract codegen(allParts: RuleHeadPart[], index: number): string;
    abstract visit(visitor: NodeVisitor): void;
}
export declare class NonTerminalRuleHead extends RuleHeadPart {
    name: string | null;
    category: string;
    constraint: NonTerminalConstraint | null;
    type: string;
    keyfn: string;
    constructor(name: string | null, category: string, constraint: NonTerminalConstraint | null);
    toString(): string;
    visit(visitor: NodeVisitor): void;
    codegen(allParts: RuleHeadPart[], index: number): string;
}
export declare class StringLiteralRuleHead extends RuleHeadPart {
    value: string;
    type: string;
    constructor(value: string);
    visit(visitor: NodeVisitor): void;
    codegen(): string;
}
export declare class ComputedStringLiteralRuleHead extends RuleHeadPart {
    code: string;
    type: string;
    constructor(code: string);
    visit(visitor: NodeVisitor): void;
    codegen(): string;
}
export declare class ChoiceRuleHead extends RuleHeadPart {
    values: string[];
    type: string;
    constructor(values: string[]);
    visit(visitor: NodeVisitor): void;
    codegen(): string;
}
export {};
