Redirected
2,083 views
0 votes
0 votes
In Operator precedence parsing, precedence relations are defined,

i. for all pair of non-terminals.

ii. for all pair of terminals.

iii. to delimit the handle.

iv. only for certain pair of terminals.

5 Answers

2 votes
2 votes
it is Option - (b)
Precedence Relation Table is constructed to decide the priority of the operators, we use a stack here

if(stack.top()<=current->symbol){
stack.push(current->symbol);
current=current->next;
}
else {
stack.pop();
current=current->next;
}
2 votes
2 votes
A:-

There are two important properties for operator precedence parsers is that

1)it doesn't appear on the right side of any production

2)no  production has two adjacent no terminals

So the answer would be (A) for all pair of non terminals
0 votes
0 votes
option A) is correct
0 votes
0 votes
If we go forward by assuming that question is asking only for parser table than answer is B. C is the consequence of using relation in parsing process. Question is asking only defined not why table is constructed.

Related questions

1 votes
1 votes
2 answers
1
Hirak asked Jun 14, 2019
1,288 views
In operator precedence parsing we have the rule that production cannot have two adjacent non-terminals or an epsilon production, so this production, S ab is allowed but ...
0 votes
0 votes
1 answer
2
saumya mishra asked Jun 15, 2018
2,130 views
What is the difference between operator grammar and operator precedence grammar?
2 votes
2 votes
0 answers
3
junaid ahmad asked Nov 16, 2017
872 views
Can anyone explain why operator precedence parsing cannot handle unary minus,and what are the approach to handle it.
0 votes
0 votes
1 answer
4
jatin khachane 1 asked Jun 7, 2017
478 views
E → E + E | E * E | ( E ) | idWhat will be operator precedence for above grammar.Is precedence differs due to ambiguity