Plugin Directory

EBNFer

EBNFer is a railroad diagram generator for WordPress. It lets you use WordPress shortcodes to parse and render Extended Backus–Naur Form diagrams.

The EBNF parser and renderer is built off of the one created by Vincent Tscherter ( http://karmin.ch/ebnf/index ).

The diagrams are stored / cached as PNG images.

Enclose your grammar defintions within [ebnf] shortcodes using the form: [ebnf] GRAMMAR [/ebnf]

You can use any of three optional addtributes

  • title - Define the generated image title
  • alt - Define the generated image alt tag
  • link - Set to, "no" if you don't want the image tag to link to the image file
  • arrows - Set to a truthy value to turn arrows on. Leave out or set falsey to turn off. (e.g. arrows="1" to turn on)

For the grammar group things with parentheses (). Use | for "or", use [...] for one or more times, and {...} for zero or more times.

Enclose the entire grammar in {...} and included and optional title with "..."

For example here is how you would create railroad diagrams for JSON with EBNFer:

[ebnf title="JSON RR Diagram"]
"JSON" {
object = "{" [ ( string ':' value ) { ',' string ':' value }  ] "}".
array = '['  [ value { ',' value } ] ']'.
}
[/ebnf]

Stay tuned for

  • Smarter image caching
  • Smarter renderer
  • Switch out bracket styled grammar definitions with Regex styled grammar definitions

Requires: 2.5 or higher
Compatible up to: 3.2.1
Last Updated: 2011-9-2
Downloads: 90

Average Rating

5 stars
(1 ratings)

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1