July 2017
Beginner to intermediate
486 pages
13h 49m
English
Grammar transformation is a technique used to make grammar more restrictive, which makes the parsing process more efficient. We will use Chomsky Normal Form (CNF) to transform grammar rules. Let's explore CNF before looking at an example.
Let's see CNF first. It states that all rules should follow the following rules:
X-> Y Z or X-> w where X, Y, Z ε N and w ε T
The meaning of the rule is very simple. You should not have more than two non-terminals on the right-hand side of any grammar rule; you can include the rules where the right-hand side of the rule has a single terminal. To transform the existing grammar into CNF, there is a basic procedure that you can follow:
Read now
Unlock full access