Skip to main content

No project description provided

Project description


pip install gkdbnf.

Maybe the most simplest way to write pretty BNF in LaTex.

Use this package with gkdtex:


<a> ::= a b | c
| d <a>


Valid BNF Syntax:

       | TERMINAL
       | TERMINAL2
       | '|'

rule        ::= '%%%' TERMINAL2
description ::=  TERMINAL | TERMINAL2

prod  ::= description? NONTERMINAL '::' type  '=' atom+ rule? 
      | '|' atom+ rule?

start ::= start NEWLINE
      |   start prod
      |   NEWLINE
      |   prod

Lexer rule by regex:

NEWLINE     = [\r\n]+
TERMINAL2   = !.*?!

Whitespace tokens are ignored.

Nice Error Report

1:  \gkd@usepackage{gkdbnf}
2:  \gkd@bnf{
3:  <a> ::= a + 1
5:  <c> ::= a a
6:  Expressions e ::= e
7: }

You get error

SyntaxError: filename runtest/a.tex:
line 6, column 13, NonTerm not match

Then you know you should change Expression e to Expression <e>.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gkdbnf, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size gkdbnf-0.3-py3-none-any.whl (10.8 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page