UNPKG

langium-railroad

Version:

Use Langium as source for railroad syntax diagrams

34 lines 1.44 kB
/****************************************************************************** * Copyright 2023 TypeFox GmbH * This program and the accompanying materials are made available under the * terms of the MIT License, which is available in the project root. ******************************************************************************/ import { GrammarAST } from 'langium'; export declare const defaultCss: string; export interface GrammarDiagramOptions { css?: string; javascript?: string; } /** * Creates a whole HTML file that contains all railroad diagrams. * * @param grammar * @param options * Use to add additional styling to all diagrams and additional behavior for the created HTML. * * @returns A complete HTML document containing all diagrams. */ export declare function createGrammarDiagramHtml(rules: GrammarAST.ParserRule[], options?: GrammarDiagramOptions): string; /** * Creates a standalone SVG diagram for each non-terminal of grammar. * * @param grammar * @param options * Use to add additional styling to all diagrams. * * @returns diagrams * For the rule named 'NonTerminal', diagrams.get('NonTerminal') has its SVG content. */ export declare function createGrammarDiagramSvg(rules: GrammarAST.ParserRule[], options?: GrammarDiagramOptions): Map<string, string>; export declare function createGrammarDiagram(rules: GrammarAST.ParserRule[]): string; //# sourceMappingURL=grammar-railroad.d.ts.map