| Style | Name and link | Rule | Items | Concat (default space) | Choice | Optional | Repetition | Grouping | Other | Comment | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Terminal | Non Terminal | 0 or more | 1 or more | n | n to m | Other | |||||||||
| BNF | BNF (Algol 60) | <name>::=... | ... | <...> | | | note1 | note2 | note3 | note5 | ||||||
| Intermediate | ANSI C | name: ... | bold | italics | indented line one of | ...opt | note2 | note3 | note5 | ||||||
| BNF-like description of URLs | name ... | ... | ... | | | [...] | note2 | note3 | note5 | |||||||
| Wirth | Wirth | name=... . | "..." | ... | | | [...] | {...} | note4 | (...) | ||||||
| SAIF and Bungisoft | <name>::=... | "..." | <...> | | | [...] | {...} | note4 | (...) | note5 | ||||||
| EBNF from Compiler Basics by J.A.Farrell | name:==... | '...' | ... | | or [...,...] | [...] | {...}* | {...} | note5 | |||||||
| Pascal EBNF Definition | name ... | "..." bold | <...> | | | [...] | {...} | note4 | (...) | note5 | ||||||
| ISO Extended Pascal | name=... . name>... . | `...' | ... | | | [...] | {...} | note4 | (...) | (*...*) | ||||||
| ISO EBNF | name=...; | '...' "..." | ... | , | | | [...] | {...} | {...}- | n*... | (...) | ...-... ?...? | (*...*) | |||
| ABNF | EBNF from RFC822 (superceded by ABNF) | name=... | integer "..." | ... <...> | / | [...] *1... | *... | 1*... | n*n... | n*m... | n#m... | (...) | ;... | ||
| ABNF (RFC2234) | name=... | integer "..." | ... <...> | / | [...] *1... | *... | 1*... | n*n... | n*m... | (...) | ;... | ||||
| XBNF | XBNF | name::=... . | "..." | ... | | | O(...) | #(...) | N(...) | L(...,...) | (...) | ...&... ...~... | any text not in a rule | |||
| Regular expression | ISO Minimal BASIC | name=... | ITALICS | italics | / | ...? | ...* | note4 | note5 | ||||||
| EBNF for XML | name::=... | "..." '...' | ... | | | ...? | ...* | ...+ | (...) | ...-... [wfc:...] [vc:...] | /*...*/ | |||||
optionalb ::= a b c d | a c d
list ::= | listitem list
list ::= listitem | listitem list
list : listitem { listitem }
Here are some more versions of EBNF to be added to the table above.
(badly converted from pdf, needs checking!)
concatenation: block := declarations statements;
alternation: declaration := function | procedure;
constant lexical items: plusop := '+' | '-';
optionality: int := 'integer' identifier { 'in' range };
"Kleene plus": statements := statement + ;
lists with separators: funcall := identifier '(' expr ^ ', ')';
precedence: expr := < ('+' | '-'), ('*' | '/'), '^' > primitive;
nesting: 'declare' ('integer' | 'real') variable;
variable lexical items: LEXEME <| alphanumeric;
This page is maintained by and copyright © Pete Jinks [last modified 12/Mar/2004] suggestions, corrections etc. welcome You are welcome to make educational, not-for-profit use (else what would be the point!) but please give due credit.