UNPKG

pegisland

Version:

General PEG-based parser supporting island grammars with lake symbols

26 lines 1.03 kB
import { IParseTree } from './ParseTree'; import { IParsingExpression } from './ParsingExpression'; import { BaseParsingEnv } from './IParsingEnv'; import { Rule } from './Rule'; import { Position } from './Position'; import { Stats } from './Stats'; export declare class ParsingError extends Error { env: PackratParsingEnv; constructor(env: PackratParsingEnv); } export declare class PackratParser { readonly rules: Map<string, Rule>; constructor(rules: Map<string, Rule>); parse(s: string, startSymbol?: string, stats?: Stats): IParseTree | ParsingError | Error; private getStartRule; } export declare class PackratParsingEnv extends BaseParsingEnv<Rule> { private stats; deepestStack: IParsingExpression[]; maxIndex: number; private currentStack; constructor(s: string, stats?: Stats); parseRule(rule: Rule, pos: Position): [IParseTree, Position] | null; parse(pe: IParsingExpression, pos: Position): [IParseTree, Position] | null; } //# sourceMappingURL=PackratParser.d.ts.map