Browsable EBNF Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: §wip/metasyntax/ebnf-bgf/extracted
Source used for this grammar: Vadim Zaytsev, ebnf-bgf.bgf, 11 July 2010 – 11 February 2011

Summary

Syntax

grammar ::=
	production+
production ::=
	label? string defining-metasymbol right-hand-side terminator-metasymbol
label ::=
	"[" string "]"
defining-metasymbol ::=
	":"
right-hand-side ::=
	(definition-separator-metasymbol definition)+
terminator-metasymbol ::=
	"\n"
definition-separator-metasymbol ::=
	"\n" " "
definition ::=
	expression (" " expression)*
expression ::=
	empty
	epsilon
	any
	value
	selectable-expression
	marked-expression
	repetition-expression
	optional-expression
	terminal
	nonterminal
	group-expression
empty ::=
	"EMPTY"
epsilon ::=
	"EPSILON"
any ::=
	"ANY"
value ::=
	"INT"
	"STR"
selectable-expression ::=
	[selector]::string "::" expression
marked-expression ::=
	"<" expression ">"
repetition-expression ::=
	expression repetition-metasymbol
repetition-metasymbol ::=
	"+"
	"*"
optional-expression ::=
	expression optionality-metasymbol
optionality-metasymbol ::=
	"?"
terminal ::=
	start-terminal-metasymbol string end-terminal-metasymbol
start-terminal-metasymbol ::=
	"""
end-terminal-metasymbol ::=
	"""
nonterminal ::=
	start-nonterminal-metasymbol string end-nonterminal-metasymbol
start-nonterminal-metasymbol ::=
	ε
end-nonterminal-metasymbol ::=
	ε
group-expression ::=
	start-group-metasymbol expression end-group-metasymbol
start-group-metasymbol ::=
	"("
end-group-metasymbol ::=
	")"

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