Operating-Systems
October 25, 2023ISRO-2007
October 25, 2023UGC NET CS 2014 June-paper-2
Question 6 |
A grammar G is LL(1) if and only if the following conditions hold for two distinct productions
A → α | β
- First (α) ∩ First (β) ≠ {a} where a is some terminal symbol of the grammar.
- First (α) ∩ First (β) ≠ λ
III. First (α) ∩ Follow (A) = φ if λ ∈ First (β)
I and II | |
I and III | |
II and III | |
I, II and III |
Question 6 Explanation:
A grammar G is LL(1) if and only if the following conditions hold for two distinct productions:
A → α | β
1. First (α) and First (β) must be disjoint if none of α and β contains NULL move.
2. At most one of the strings α or β can drive NULL move i.e. α → NULL(since First (α) and First (β) are disjoint). In this case, First (β) and Follow(A) must be disjoint.
Hence the answer is option(D).
A → α | β
1. First (α) and First (β) must be disjoint if none of α and β contains NULL move.
2. At most one of the strings α or β can drive NULL move i.e. α → NULL(since First (α) and First (β) are disjoint). In this case, First (β) and Follow(A) must be disjoint.
Hence the answer is option(D).
Correct Answer: D
Question 6 Explanation:
A grammar G is LL(1) if and only if the following conditions hold for two distinct productions:
A → α | β
1. First (α) and First (β) must be disjoint if none of α and β contains NULL move.
2. At most one of the strings α or β can drive NULL move i.e. α → NULL(since First (α) and First (β) are disjoint). In this case, First (β) and Follow(A) must be disjoint.
Hence the answer is option(D).
A → α | β
1. First (α) and First (β) must be disjoint if none of α and β contains NULL move.
2. At most one of the strings α or β can drive NULL move i.e. α → NULL(since First (α) and First (β) are disjoint). In this case, First (β) and Follow(A) must be disjoint.
Hence the answer is option(D).
Subscribe
Login
0 Comments