I'm trying below YACC grammar part but it gives me, what is the wrong with this? and how can I solve it? are there some rules to define grammar in Bison/ YACC ?
C:\Users\Dilan\Documents\LexProgram\miniProject>bison -dy videostore.y
conflicts: 1 shift/reduce
and my YACC code is :
%start VideoStore
%token title
%token type
%token name
%token days
%%
VideoStore : MOVIES CUSTOMERS
| CUSTOMERS MOVIES
| MOVIES
| CUSTOMERS
;
MOVIES : MOVIES MOVIE
| MOVIE
;
MOVIE : title type RENTALS2
;
RENTALS2 : RENTALS2 RENTAL2
| RENTAL2
;
RENTAL2 : CUSTOMER1
;
CUSTOMER1 : name days
;
CUSTOMERS : CUSTOMERS CUSTOMER
| CUSTOMER
;
CUSTOMER : name days RENTALS
;
RENTALS : RENTALS RENTAL
| RENTAL
;
RENTAL : MOVIE1
;
MOVIE1 : title type
;
%%
int trace=0;
My problem is VideoStore.y: conflicts: 2 shift/reduce and how can wrote LEX for this ?