
12.3 Programming Grammars by Example for More Accessibility 231
l i eber@medi a.mi t. edu
and
nardi@appl e. com.
This pattern is expressed in BNF as a set of context-flee rules, each of which
tells the computer how to recognize a certain grammatical
category, or
nonterminal, as a sequence of specific strings, lexical categories such as
"Word" or "Number," or other nonterminals.
Below,
E - M a i 1 - A d d r e s s
is expressed in terms of
P e r s o n
and
H o s t.
We assume W o r d is a primitive token recognized by the parser.
<E-Mail-Address> := <Person> @ <Host>
<Person> := <Word>
<Host> := <Word> I <Word> ...