Browsable ISO EBNF Grammar

CC-BY

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]

Summary

Syntax

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 ::=
	(integer "*")? primary
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 ::=
	letter (letter | decimal_digit)*
integer ::=
	decimal_digit+
special_sequence ::=
	"?" character* "?"
comment ::=
	"(*" comment_symbol* "*)"
comment_symbol ::=
	comment
	terminal_string
	special_sequence
	character

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []