retagged by
305 views

1 Answer

0 votes
0 votes

The grammars that have the property that no production right side is ε or has two adjacent nonterminals.

E->ECB | -A

A->id.

it is not Operator precedence parser.because on Right hand side two nonterminals are adjacent to each other.

To make it as OPG substitute C by any teminal like +,-,*.

E->E+B |E-B|E*B|-A

A->id.

Here Precedence relations are defined only for pair of terminals.

ii)It is hard to handle tokens like minus sign, which has two different precedence. (depending on whether it is unary or binary).

if string like a-b+c.(here '-' is for b(unary) but not operator.) (here string nothing but a handle)

it cannot differentiate operator like unary.

Hence option B is correct.

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
3
ukn asked Jan 19, 2017
387 views