The grammar whose productions are → if id then → if id then else → id := id is ambiguous becausea) the sentence if a then if b then c:= d has two parse trees b) the left most and right most derivations of the sentence if a then if b then c:= d give rise to different parse trees c) the sentence if a then if b then c:= d else c:= f has more than two parse treesd) the sentence if a then if b then c:= d else c:= f has two parse trees

🎲 Try a Random Question  |  Total Questions in Quiz: 95  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Theory of Computation and Compiler Design Practice Test — practice the complete quiz, review flashcards, or try a random question.

Automata theory (also known as Theory Of Computation) is a theoretical branch of Computer Science and Mathematics, which mainly deals with the logic of computation with respect to simple machines, referred to as automata. Automata* enables scientists to understand how machines compute the functions and solve problems.
Theory of Computation is very important in compiler design as it helps in writing efficient algorithms, which help make efficient compiler construcion.


The grammar whose productions are<br><stmt> → if id then <stmt><br><stmt> → if id then <stmt> else <stmt><br><stmt> → id := id is ambiguous because<br>a) the sentence if a then if b then c:= d has two parse trees<br> b) the left most and right most derivations of the sentence if a then if b then c:= d give rise to different parse trees<br> c) the sentence if a then if b then c:= d else c:= f has more than two parse trees<br>d) the sentence if a then if b then c:= d else c:= f has two parse trees