COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Simplify the given grammar:S
|
S
|
|
S
|
|
S
|
|
None of the mentioned
|
Explanation:
Detailed explanation-1: -Step 1: Find all nullable non-terminal variables which derive first. Step 2: For all the productions of X → a, construct all production X → a, where a is obtained from x by removing non-terminals from the first step. Step 3: Combine the result of the second step with the original production.
Detailed explanation-2: -Simplification of grammar means reduction of grammar by removing useless symbols. The properties of reduced grammar are given below: Each variable (i.e. non-terminal) and each terminal of G appears in the derivation of some word in L. There should not be any production as X → Y where X and Y are non-terminal.
There is 1 question to complete.