parjs
Version:
A parser-combinator library for JavaScript.
33 lines (32 loc) • 964 B
TypeScript
/**
* @module parjs/internal
*/
/** */
import { ParjsResult } from "./result";
import { ParsingState } from "./state";
import { Parjser } from "./parjser";
/**
* A marker class used for storing the parser's user state.
*/
export declare class ParserUserState {
}
/**
* The base Parjs parser class, which supports only basic parsing operations. Should not be used in user code.
*/
export declare abstract class ParjserBase implements Parjser<any> {
abstract type: string;
abstract expecting: string | object;
/**
* Apply the parser to the given state.
* @param ps The parsing state.
*/
apply(ps: ParsingState): void;
/**
* The internal operation performed by the PARSER. This will be overriden by derived classes.
* @param ps
* @private
*/
abstract _apply(ps: ParsingState): void | void;
parse(input: string, initialState?: any): ParjsResult<any>;
pipe(...funcs: ((x: any) => any)[]): any;
}