Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: §wip/metasyntax/ebnf-iso-2/extracted
Source used for this grammar: ISO/IEC 14977:1996(E), Information Technology—Syntactic Metalanguage—Extended BNF, 1996, §8.2 “Extended BNF used to define itself informally”, page 10 [PDF]
syntax
, syntax_rule
, definitions_list
, single_definition
, term
, exception
, factor
, primary
, empty
, optional_sequence
, repeated_sequence
, grouped_sequence
, terminal_string
, meta_identifier
, integer
, special_sequence
, comment
, comment_symbol
), 0 root (—), 1 top (syntax
), 3 bottom (decimal_digit
2, letter
2, character
4).syntax ::=
syntax_rule
syntax_rule ::= meta_identifier "=" definitions_list ";"
definitions_list ::= single_definition "|" single_definition
single_definition ::= term "," term
term ::= factor "-" exception
exception ::= factor
factor ::= "*" primaryinteger
primary ::= optional_sequence repeated_sequence special_sequence grouped_sequence meta_identifier terminal_string empty
empty ::= ε
optional_sequence ::= "[" definitions_list "]"
repeated_sequence ::= "{" definitions_list "}"
grouped_sequence ::= "(" definitions_list ")"
terminal_string ::= "’" character "’" """ character """
meta_identifier ::= letterletter decimal_digit
integer ::=
decimal_digit
special_sequence ::= "?" character "?"
comment ::= "(*" comment_symbol "*)"
comment_symbol ::= comment terminal_string special_sequence character