$G$ is a natural-looking grammar for a fragment of a programming language, but $G$ is ambiguous$.$
for the string
"if condition then if condition then a:=1 else a:=1" has two different parse trees
so the grammar is ambiguous
This is also called dangling else problem
64.3k questions
77.9k answers
244k comments
80.0k users