Below the grammar i make.
- S' -> sqf
- sqf -> declarations
- declarations -> declaration
- declarations -> declaration declarations
- declaration -> relation
- declaration -> norelation
- relation -> head body
- norelation -> relatts
- norelation -> reldata
- norelation -> relatts reldata
- head -> relname attributes
- body -> reldata
- body -> empty
- relname -> RELKW IDENTIFIER
- attributes -> relatts
- attributes -> empty
- relatts -> attname
- relatts -> attname relatts
- reldata -> DATAKW tuples
- reldata -> DATAKW
- tuples -> tuple
- tuples -> tuple tuples
- attname -> ATTKW IDENTIFIER
- tuple -> VALUE
- empty ->
The problem is that the grammar is ambiguous because for some rules there are shift/reduce conflicts. Particularly
at the rules below for DATAKW we have shift/reduce conflict
- relation -> head body
- body -> reldata
- body -> empty
- reldata -> DATAKW tuples
- reldata -> DATAKW
- *empty -> *
at the rules below for DATAKW we have shift/reduce conflict
- norelation -> relatts
- norelation -> relatts reldata
- reldata -> DATAKW tuples
- reldata -> DATAKW
at the rules below for ATTKW we have shift/reduce conflict
- head -> relname attributes
- attributes -> relatts
- attributes -> empty
- relatts -> attname
- relatts -> attname relatts
- *empty -> *
- attname -> ATTKW IDENTIFIER
at the rules below for ATTKW we have shift/reduce conflict
- relatts -> attname
- relatts -> attname relatts
- relatts -> attname
- relatts -> attname relatts
- attname -> ATTKW IDENTIFIER
Can anyone help me to solve that conflicts, please.