$\textbf{stmt} \to$ $ \textbf{if} $expr$ \textbf{then}$ stmt $\mid $ $\textbf{if}$ expr $ \textbf{then}$ stmt$ \textbf{else}$ stmt $\mid \textbf{other} $
This grammar is called as Dangling Else Problem . However the ambiguity is resolved by parser as described as follows
In all programming languages with conditional statements of this form, the first parse tree is preferred. The general rule is, "Match each else with the closest unmatched then"
It is rarely built into productions
$\textbf{stmt} \to$ $ \textbf{matched_stmt}$ $\mid $ $\textbf{open_stmt}$
$\textbf{matched_stmt} \to$ $ \textbf{if} $expr$ \textbf{then}$ matched_stmt $ \textbf{else}$ matched_stmt $\mid $ $\textbf{other}$
$\textbf{open_stmt} \to$ $ \textbf{if} $expr$ \textbf{then}$ stmt $\mid $ $\textbf{if}$ expr $ \textbf{then}$ matched_stmt$ \textbf{else}$ open_stmt
However this grammar is also ambiguous . Moreover no grammar is there that could eliminate ambiguity problem of Dangling else problem . Hence we can say that dangling else problem in also inherently ambiguous
Source : Compilers: Principles, Techniques, & Tools -Aho & Ullman
My question is How to prove that Ambiguity is still present in this resolved Production of Dangling Else Problem ? What I know is that if two different parse trees are possible then the grammar in ambiguous . Does any such parse trees possible for the resolved grammar ? If so could u please give an example parse tree for the same