Shift-reduce and reduce-reduce conflicts with LR

59 views Asked by At

This is the grammar:

expr-> expr OPER expr
expr->PREFIX expr
expr->expr POSTFIX
expr->expr ‘?’ expr ‘:’ expr
expr->expr‘[’ expr ‘]’
expr->expr‘(’ expr ‘)’
expr->ID
expr->CONSTANT
expr->‘(’ expr‘)

I cannot find the shift-reduce and reduce-reduce conflicts with LR, can someone help me?

1

There are 1 answers

1
Computer Eng On

The priority of the operators: 1)[] () . –> POSTFIX ++ –– (LEFT Customerism) 2)PREFIX ++ –– - 3)?: (RIGHT CUSTOMERISM)