import * as TSU from "@panyam/tsutils"; import * as TLEX from "tlex"; import { Sym, Grammar, Rule } from "./grammar"; import { PTNode, SimpleParser as ParserBase } from "./parser"; type StringMap = TSU.StringMap; type Nullable = TSU.Nullable; export declare class ParseTable { readonly grammar: Grammar; protected entries: Map>; constructor(grammar: Grammar); refresh(): this; get count(): number; ensureEntry(nt: Sym, term: Sym): Rule[]; add(nt: Sym, term: Sym, entry: Rule): boolean; get(nt: Sym, term: Sym): Rule[]; forEachEntry(visitor: (nonterm: Sym, term: Sym, items: Rule[]) => boolean | void): void; get debugValue(): StringMap>; processRule(rule: Rule, index: number): void; } export declare class ParseStack { readonly parseTable: ParseTable; readonly stack: [Sym, PTNode][]; readonly docNode: PTNode; readonly rootNode: PTNode; protected idCounter: number; constructor(parseTable: ParseTable); get debugString(): string; push(sym: Sym, node?: Nullable): PTNode; top(): [Sym, PTNode]; pop(): [Sym, PTNode]; get isEmpty(): boolean; } export declare class Parser extends ParserBase { readonly parseTable: ParseTable; stack: ParseStack; constructor(parseTable: ParseTable); get grammar(): Grammar; protected parseInput(input: TLEX.Tape, delegate?: any): Nullable; popSymAndPushRule(parentNode: PTNode, rule: Rule): void; consumeTokenAndPop(tape: TLEX.Tape, nextSym: Sym, nextToken: TLEX.Token): void; processInvalidToken(nextSym: Sym, nextValue: any): boolean; processInvalidReductions(topNode: PTNode, currSym: Sym, nextSym: Sym, nextValue: any, entries: Rule[]): boolean; } export {};