I have an impression but I am not entirely sure it is right. If a grammar is not ambiguous, can it have First/Follow conflicts? I am fairly sure it can't, but I would like to have some confirmation.
Thank you.
I have an impression but I am not entirely sure it is right. If a grammar is not ambiguous, can it have First/Follow conflicts? I am fairly sure it can't, but I would like to have some confirmation.
Thank you.
Copyright © 2021 Jogjafile Inc.
Unambiguous grammars can have first/follow conflicts. Here's an example:
This grammar can produce two strings,
bc
andbbc
, and it's unambiguous. However, there's a FIRST/FOLLOW conflict on production A → b | ε, becauseb
∈ FIRST(A) andb
∈ FOLLOW(A) as well.Hope this helps!