1,442 views

1 Answer

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

 

edited by

Related questions

1 votes
1 votes
1 answer
2
admin asked May 4, 2019
495 views
Show that if $G$ is a $CFG$ in Chomsky normal form$,$ then for any string $w\in L(G)$ of length $n\geq 1,$ exactly $2n − 1$ steps are required for any derivation of $w....