1.0.6 • Published 5 months ago

grammar-converter v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Grammar Converter

Use

Transform a grammar in ebnf format to bnf with this command: npx grammar-converter myGrammar.ebnf.

The input file has to be formatted with a space before and after every =, |, {, [, (, ), ], } and .. Furthermore the inputfile has to be encoded with LF lineendings. There should be an empty line at the end of the file as well.

This ebnf:

A = a | b .
B = ( c | d ) e .
C = [ A | B ] .
D = a { C | [ f | g ] } .

will get transformed to this:

A = a | b
BP1 =  c | d
B = BP1 e
CP1 =  A | B | eps
C = CP1
DP1P1P1 =  f | g | eps
DP1P1 =  C | DP1P1P1
DP1 = DP1 DP1P1 | eps
D = a DP1
1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago