I know that DCFL are unambiguous languages and DCFL languages have one-to-one correspondence with LR grammars.
But I wanted to know if there can be an instance that deterministic context free grammar is ambiguous.
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.Sign up to join this community
No, there is no deterministic context-free grammar that is ambiguous since any deterministic context free grammar (DCFG) must be unambiguous.
Here is definition 2.47 of the book introduction to the theory of computation, third edition, by Michael Sipser.
A deterministic context-free grammar is a context-free grammar such that every valid string has a forced handle.
Furthermore, here is definition 2.62.
An LR($k$) grammar is a context-free grammar such that the handle of every valid string is forced by lookahead $k$.
A DCFG is the same as an LR(0) grammar. All LR($k$) grammars are unambiguous, by definition.