UNPKG

pegisland

Version:

General PEG-based parser supporting island grammars with lake symbols

31 lines 1.2 kB
import { IParseTree } from './ParseTree'; import { Position } from './Position'; import { Recognizer } from './Recognizer'; import { Rule } from './Rule'; import { IParsingExpression } from './ParsingExpression'; export interface IParsingEnv { s: string; parse(pe: IParsingExpression, pos: Position): [IParseTree, Position] | null; parseRule(rule: Rule, pos: Position): [IParseTree, Position] | null; push(): void; pop(): void; has(name: string): boolean; lookup(name: string): string; register(name: string, value: string): void; } export declare abstract class BaseParsingEnv<K extends object> implements IParsingEnv { #private; s: string; readonly recognizer: Recognizer; protected readonly memo: WeakMap<K, [IParseTree, Position] | null>[]; private symbolStack; constructor(s: string); push(): void; pop(): void; has(name: string): boolean; lookup(name: string): string; register(name: string, value: string): void; parseRule(rule: Rule, pos: Position): [IParseTree, Position] | null; abstract parse(pe: IParsingExpression, pos: Position): [IParseTree, Position] | null; } //# sourceMappingURL=IParsingEnv.d.ts.map