Content deleted Content added
m →References: HTTP to HTTPS for Wayback Machine, replaced: http://web.archive.org/ → https://web.archive.org/ |
→Example: fix both BNF and EBNF to look like railroad diagram cf talk page |
||
Line 11:
We use arithmetic expressions as an example. First we provide a simplified BNF grammar:
<source lang="bnf">
<expression> ::= <term> | <
<term> ::= <factor> | <
<factor> ::= <constant> | <variable> | "(" <expression> ")"
<variable> ::= "x" | "y" | "z"
Line 22:
This grammar can also be expressed in [[EBNF]]:
<source lang="ebnf">
expression = term
term = factor
factor = constant | variable | "(" , expression , ")";
variable = "x" | "y" | "z";
constant = digit , { digit };
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|