Backus-Naur Form (BNF) grammars are used as a tool for describing language and command syntax, for example:
select-statement
: SELECT
select-list
FROM
table-name
[ restriction
] [ ordering
]
restriction
: WHERE
search-condition
ordering
: ORDER BY
sort-order
A BNF definition states that the named item given before the colon is written
as described after the colon. For example, an ordering is written as ORDER
BY
followed by a sort-order (which may be defined elsewhere).
BNF expression |
What it means |
|
Declares that a named-construction is written as expression. |
|
Declares that a named-construction is written as either expression1 or expression2. |
|
The word |
|
exp1 followed by exp2. |
|
exp is optional. |
|
Either exp1 or exp2 or nothing. |
|
exp is an entity or name that you specify. |
|
expression, repeated one or more times. |
|
expression, repeated zero, one or more times. |