UNPKG

@scinorandex/sparse

Version:

Yet another parser generator

29 lines (28 loc) 822 B
import { Production } from "./grammarParser"; import { TableState } from "./parser"; import { Result } from "./utils/Result"; type Item = Production & { dot: number; lookahead: string[]; }; type State = { itemSet: Item[]; kernel: Item; count: number; }; export declare const generateStates: (productions: Production[]) => Result<GeneratorResult>; export declare class GeneratorResult { readonly states: State[]; readonly ActionTable: Map<string, { action: "shift" | "reduce"; value: number; }>[]; readonly GotoTable: Map<string, number>[]; constructor(states: State[], ActionTable: Map<string, { action: "shift" | "reduce"; value: number; }>[], GotoTable: Map<string, number>[]); toTable(): string; toStates(): TableState[]; } export {};