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
grammar
, production
, label
, defining-metasymbol
, right-hand-side
, terminator-metasymbol
, definition-separator-metasymbol
, definition
, expression
, empty
, epsilon
, any
, value
, selectable-expression
, marked-expression
, repetition-expression
, repetition-metasymbol
, optional-expression
, optionality-metasymbol
, terminal
, start-terminal-metasymbol
, end-terminal-metasymbol
, nonterminal
, start-nonterminal-metasymbol
, end-nonterminal-metasymbol
, group-expression
, start-group-metasymbol
, end-group-metasymbol
), 1 root (grammar
), 0 top (—), 0 bottom (—).[selector]
.grammar ::=
production
production ::=
label
string defining-metasymbol right-hand-side terminator-metasymbollabel ::= "[" 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 ::=
")"