
Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: §wip/metasyntax/ebnf-iso-1/extracted
Source used for this grammar: ISO/IEC 14977:1996(E), Information Technology—Syntactic Metalanguage—Extended BNF, 1996, §8.1 “The syntax of Extended BNF”, pages 8–10 [PDF]
letter, decimal_digit, concatenate_symbol, defining_symbol, definition_separator_symbol, end_comment_symbol, end_group_symbol, end_option_symbol, end_repeat_symbol, except_symbol, first_quote_symbol, repetition_symbol, second_quote_symbol, special_sequence_symbol, start_comment_symbol, start_group_symbol, start_option_symbol, start_repeat_symbol, terminator_symbol, other_character, space_character, horizontal_tabulation_character, new_line, vertical_tabulation_character, form_feed, terminal_character, gap_free_symbol, terminal_string, first_terminal_character, second_terminal_character, gap_separator, syntax, commentless_symbol, integer, meta_identifier, meta_identifier_character, special_sequence, special_sequence_character, comment_symbol, bracketed_textual_comment, syntax_rule, definitions_list, single_definition, syntactic_term, syntactic_exception, syntactic_factor, syntactic_primary, optional_sequence, repeated_sequence, grouped_sequence, empty_sequence), 0 root (—), 1 top (syntax), 1 bottom (syntactic-factor).letter ::= "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"
decimal_digit ::= "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"
concatenate_symbol ::=
","defining_symbol ::=
"="definition_separator_symbol ::= "|" "/" "!"
end_comment_symbol ::=
"*)"end_group_symbol ::=
")"end_option_symbol ::= "]" "/)"
end_repeat_symbol ::= "}" ":)"
except_symbol ::=
"-"first_quote_symbol ::=
"’"repetition_symbol ::=
"*"second_quote_symbol ::=
"""special_sequence_symbol ::=
"?"start_comment_symbol ::=
"(*"start_group_symbol ::=
"("start_option_symbol ::= "[" "(/"
start_repeat_symbol ::= "{" "(:"
terminator_symbol ::= ";" "."
other_character ::= " " ":" "+" "_" "%" "@" "&" "#" "$" "<" ">" "\" "^" "‘" "~"
space_character ::=
" "horizontal_tabulation_character ::=
"\t"new_line ::= "\r" "\n" "\r"
vertical_tabulation_character ::=
"\v"form_feed ::=
"\f"terminal_character ::= letter decimal_digit concatenate_symbol defining_symbol definition_separator_symbol end_comment_symbol end_group_symbol end_option_symbol end_repeat_symbol except_symbol first_quote_symbol repetition_symbol second_quote_symbol special_sequence_symbol start_comment_symbol start_group_symbol start_option_symbol start_repeat_symbol terminator_symbol other_character
gap_free_symbol ::= terminal_character terminal_string
terminal_string ::= first_quote_symbol first_terminal_character first_quote_symbol second_quote_symbol second_terminal_character second_quote_symbol
first_terminal_character ::= terminal_character
second_terminal_character ::= terminal_character
gap_separator ::= space_character horizontal_tabulation_character new_line vertical_tabulation_character form_feed
syntax ::= gap_separator gap_free_symbol gap_separator
syntax ::= bracketed_textual_comment commentless_symbol bracketed_textual_comment commentless_symbol bracketed_textual_comment
syntax ::=
syntax_rulecommentless_symbol ::= terminal_character meta_identifier integer terminal_string special_sequence
integer ::=
decimal_digitmeta_identifier ::=
letter meta_identifier_charactermeta_identifier_character ::= letter decimal_digit
special_sequence ::=
special_sequence_symbol special_sequence_character special_sequence_symbolspecial_sequence_character ::= terminal_character
comment_symbol ::= bracketed_textual_comment other_character commentless_symbol
bracketed_textual_comment ::=
start_comment_symbol comment_symbol end_comment_symbolsyntax_rule ::= meta_identifier defining_symbol definitions_list terminator_symbol
definitions_list ::= single_definition definition_separator_symbol single_definition
single_definition ::= syntactic_term concatenate_symbol syntactic_term
syntactic_term ::= syntactic_factor except_symbol syntactic_exception
syntactic_exception ::= syntactic-factor
syntactic_factor ::= integer repetition_symbol syntactic_primary
syntactic_primary ::= optional_sequence repeated_sequence grouped_sequence meta_identifier terminal_string special_sequence empty_sequence
optional_sequence ::= start_option_symbol definitions_list end_option_symbol
repeated_sequence ::= start_repeat_symbol definitions_list end_repeat_symbol
grouped_sequence ::= start_group_symbol definitions_list end_group_symbol
empty_sequence ::= ε