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

Author:Peter Ajtai (profile at wordpress.org)
WordPress version required:2.5
WordPress version tested:3.2.1
Plugin version:0.4
Added to WordPress repository:29-08-2011
Last updated:02-09-2011
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:http://netlumination.com/blog/ebnfer
Total downloads:616
plugin download
Click to start download

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 } ] ']'.

Stay tuned for

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