ebnf-railroad-visualizer
Version:
A web-based EBNF railroad diagram visualizer
23 lines (22 loc) • 732 B
TypeScript
import { Syntax } from "./wsn/Syntax.js";
import { Production } from "./wsn/Production.js";
/**
* Represents the parsed grammar.
*/
export declare class Grammar {
readonly syntax: Syntax;
private constructor();
/**
* Creates a new {@link Grammar} instance from a given string containing a grammar.
* @param grammar The grammar to parse. The individual productions must be separated by a newline.
* @returns
*/
static fromString(grammar: string): Grammar;
toString(): string;
/**
* Returns the potential start identifiers of the grammar.
* @returns The names of the start symbols.
*/
getStartSymbols(): string[];
getProductionFromName(name: string): Production;
}