...
Theory-of-Computation
December 6, 2023
Theory-of-Computation
December 6, 2023
Theory-of-Computation
December 6, 2023
Theory-of-Computation
December 6, 2023

Theory-of-Computation

Question 33

The grammar whose productions are

  → if id then 
  → if id then   else 
  → id := id 

is ambiguous because

A
the sentence
if a then if b then c:=d
B
the left most and right most derivations of the sentence
if a then if b then c:=d
give rise top different parse trees
C
the sentence
if a then if b then c:=d else c:=f
has more than two parse trees
D
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:
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:
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!