|
|
Sentential Form and Sentence
Sentential Form
A sentential form is any string derivable from the start
symbol. Thus, in the derivation of a + a * a ,
E + T * F
and E + F * a and F + a * a are all sentential forms as are E and
a + a * a themselves.
Sentence
A sentence is a sentential form consisting only of terminals
such as a + a * a. A sentence can be derived using the following
algorithm:
Algorithm
Derive String
String := Start Symbol
REPEAT
Choose any nonterminal in String.
Find a production with this nonterminal on the left-hand side.
Replace the nonterminal with one of the options on the right-hand
side of the production.
UNTIL String contains only terminals.
|