COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The variable which produces ∈ is called ____
A
Empty variable
B
Nullable variable
C
Terminal
D
All of the above.
Explanation: 

Detailed explanation-1: -Explanation: We use the concept of dependency graph inorder to check, whether any of the variable is reachable from the starting variable or not. 2. The variable which produces an epsilon is called: a) empty variable.

Detailed explanation-2: -Null productions are of the form A-> . In this tutorial we will learn to remove the null productions from the grammar. We cannot remove all -productions from a grammar if the language contains as a word, but if it doesn’t we can remove all.

Detailed explanation-3: -Besides, there may be some null productions and unit productions. Elimination of these productions and symbols is called simplification of CFGs.

Detailed explanation-4: -The unit productions are the productions in which one non-terminal gives another non-terminal. Use the following steps to remove unit production: Step 1: To remove X → Y, add production X → a to the grammar rule whenever Y → a occurs in the grammar. Step 2: Now delete X → Y from the grammar.

Detailed explanation-5: -First find all null-able non terminals which derive. For each production A->a construct all productions A. where X is obtained from ‘a’ by removing 1 or more non-terminals from step 1. Now combine the result of step 2 with the original production and remove production. 16-Jun-2021

There is 1 question to complete.