ebnf-diagram

0.1.0 • Public • Published

EBNF Diagram

Usage

ebnfDiagram = require 'ebnf-diagram'

If your ebnf is in a file:

ebnfDiagram.fromFile('./gherkin.ebnf', './gherkin.png',2000,6000)

If you already have the text:

ebnfDiagram.fromText('''"EBNF defined in itself" {

	syntax     = [ title ] "{" { production } "}" [ comment ].
	production = identifier "=" expression ( "." | ";" ) .
	expression = term { "|" term } .
	term       = factor { factor } .
	factor     = identifier
	| literal
	| "[" expression "]"
	| "(" expression ")"
	| "{" expression "}" .
	identifier = character { character } .
	title      = literal .
	comment    = literal .
	literal    = "'" character { character } "'"
	| '"' character { character } '"' .


} "EBNF is a cool syntax for describing syntaxes."
''', './ebnf.png',1000,1000)

Generates:

EBNF in EBNF

Readme

Keywords

none

Package Sidebar

Install

npm i ebnf-diagram

Weekly Downloads

6

Version

0.1.0

License

none

Last publish

Collaborators

  • adiel