64 An Introduction to Compiler Construction in a Java World
(3.9)
E ::= E + T
E ::= T
T ::= T * F
T ::= F
F ::= (E)
F ::= id
We may surmise that the symbols (here E, T , and F ) that are defined by at least one
production rule are non-terminals. Conventionally, the first defined non-terminal (that is,
E here) is our start symbol. Those symbols that are not defined (here +, *, (, ), and id)
are terminals.
The start symbol is important to us because it is from this symbol, using the production
rules, that can generate strings in a language. For example, because we designate E to be
the start symbol in the grammar above, we can record a sequence of applications of the
production rules, starting from E to the sentence id + id * id as follows:
E ⇒ E + T
⇒ T + T
⇒