in Theory of Computation
216 views
1 vote
1 vote

What does it mean for grammar or a language if it has a shift-reduce conflict or reduce-reduce conflict?

Is the language/grammar ambiguous? (always/maybe)? I want to know the nature of the language.

in Theory of Computation
216 views

1 Answer

0 votes
0 votes
Best answer
SR Conflict  means compiler is confused wheather to shift the current input symbol on to stack or make a reduce move at that stage
e.g  some state has these things        
A  -> d.c
C  -> d.
this means Top of Stack has 'd' symbol in which BottomUpParsing is going on
Now if ip string has 'c' as the next symbol you have two options Either Shift 'c' on stack or Reduce the TOS 'd' to C
In RR Conflict the compiler is confused between two Reduce moves
e.g   A  -> d.
C  -> d.
selected by
by

Related questions