The Wikipedia article is accurate. If you have access, definitely read Wirth's original article on EBNF.
The other thing to know is that EBNF was designed to make it easy to hand-write recursive-descent parsers for languages in which each syntactic construct has identifying keywords at the beginning. Curly braces translate to while
loops; square brackets (optional stuff) translates to if
, and alternatives translate to if-then-else
or case
statements. If you have the luxury of designing your language this way you can knock out a parser quickly and give good error messages.
The only place this gets a bit tedious is when you have a language in which there are infix operators with many different levels of precedence. For that you want Dave Hanson's paper Compact Recursive-Descent Parsing of Expressions. Maybe the Princeton tech report series has a free version, and you can always look at the code in Hanson's C front end.