Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: §wip/metasyntax/ebnf-iso-3/extracted
Source used for this grammar: ISO/IEC 14977:1996(E), Information Technology—Syntactic Metalanguage—Extended BNF, 1996, §8.3 “Extended BNF defined informally”, page 10 [PDF]
SYNTAX
, SYNTAX_RULE
, DEFINITIONS_LIST
, SINGLE_DEFINITION
, TERM
, EXCEPTION
, FACTOR
, PRIMARY
, EMPTY
, OPTIONAL_SEQUENCE
, REPEATED_SEQUENCE
, GROUPED_SEQUENCE
, TERMINAL
, META_IDENTIFIER
, INTEGER
, SPECIAL_SEQUENCE
, COMMENT
, COMMENT_SYMBOL
), 0 root (—), 1 top (SYNTAX
), 3 bottom (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 EMPTY
EMPTY ::= ε
OPTIONAL_SEQUENCE ::= "(/" DEFINITIONS_LIST "/)"
REPEATED_SEQUENCE ::= "(:" DEFINITIONS_LIST ":)"
GROUPED_SEQUENCE ::= "(" DEFINITIONS_LIST ")"
TERMINAL ::= "’" CHARACTER "’" """ CHARACTER """
META_IDENTIFIER ::= LETTERLETTER DIGIT
INTEGER ::=
DIGIT
SPECIAL_SEQUENCE ::= "?" CHARACTER "?"
COMMENT ::= "(*" COMMENT_SYMBOL "*)"
COMMENT_SYMBOL ::= COMMENT TERMINAL SPECIAL_SEQUENCE CHARACTER