Theory-of-Computation
December 6, 2023Theory-of-Computation
December 6, 2023Theory-of-Computation
Question 33 |
The grammar whose productions are
→ if id then → if id then else → id := id
is ambiguous because
the sentence if a then if b then c:=d | |
the left most and right most derivations of the sentence if a then if b then c:=d give rise top different parse trees | |
the sentence if a then if b then c:=d else c:=f has more than two parse trees | |
the sentence if a then if then c:=d else c:=f has two parse trees |
Question 33 Explanation:
We have to generate
“if a then if b then c:=d else c:=f”.
Parse tree 1:
Parse tree 2:
“if a then if b then c:=d else c:=f”.
Parse tree 1:
Parse tree 2:
Correct Answer: D
Question 33 Explanation:
We have to generate
“if a then if b then c:=d else c:=f”.
Parse tree 1:
Parse tree 2:
“if a then if b then c:=d else c:=f”.
Parse tree 1:
Parse tree 2:
Subscribe
Login
0 Comments