A sentential form of a formal grammar is any word derivable from the start symbol: . It may contain both terminal symbols and nonterminal symbols. A terminal-only sentential form is a word of the generated formal language.
For productions and , the derivation contains four sentential forms. The intermediate is not a sentence of the terminal language because remains. An arbitrary word over need not be a sentential form: it must actually be reachable by a grammar derivation.
Tracking sentential forms makes it possible to discuss intermediate parsing states and distinguish leftmost derivations from other orders of rewriting. The word need not be a complete output or a prefix of one in an arbitrary grammar.

Articles by others on the same topic (0)

There are currently no matching articles.