Q:

Types of conflicts in Bison

%token<val>num 
%left '+' '-'

Example for shift/reduce conflict:
Expr:num {$$=$1};
     |Expr '+' Expr;{};
     |Expr '-' Expr;{};

I want to recognize the reduce/reduce conflict.
It occurs when two or more rules apply to same sequence of input (token)
For example:
Prod: proda|prodb
     proda :'x'
     prodb : 'x'

Could anyone to give some ideas how to recognise reduce/reduce conflict easily?

A:

Easiest way to do this is to create y.output file.
Use command yacc -v parser_name.y. This will create you output how yacc works. Find state where yacc says your conflict is, and then it is very important to understand what point sign . in file means. 
If your output file says something like this:

4  |Expr. '+' Expr;{};

Point sign after expression is saying to you: "I've read Expr and on input I have '+'.
Reduce-Reduce conflicts appear when you have situation like this:
NON_TERMINAL1: Expr.
NON_TERMINAL2: Expr.

In this situation, where you have Expr. at the end of the rule Yacc doesn't know which reduce to do and that is Reduce-Reduce conflict.

