0 votes 0 votes $G$ is a natural-looking grammar for a fragment of a programming language, but $G$ is ambiguous$.$ Show that $G$ is ambiguous$.$ Give a new unambiguous grammar for the same language$.$ Theory of Computation michael-sipser theory-of-computation context-free-grammar ambiguous-grammar + – admin asked May 4, 2019 admin 1.5k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes 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 aditi19 answered Aug 18, 2019 • edited Aug 25, 2019 by aditi19 aditi19 comment Share Follow See all 0 reply Please log in or register to add a comment.