search
Log In
0 votes
878 views
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.
in Compiler Design 878 views
0
is it option b?

2 Answers

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;
}
0
But for terminal {$, $} , there is no associativity defined as the ORT(operator relational table ) contains blank entry at [$,$].
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

Related questions

1 vote
2 answers
1
356 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 not S--> AB, A->a and B->b, though they are giving us the same output. Why so?
asked Jun 14, 2019 in Compiler Design Hirak 356 views
2 votes
0 answers
2
461 views
Can anyone explain why operator precedence parsing cannot handle unary minus,and what are the approach to handle it.
asked Nov 16, 2017 in Compiler Design junaid ahmad 461 views
0 votes
3 answers
3
0 votes
0 answers
4
152 views
Say I have a grammar, S→ AB A→ a B→ b This grammar is not operator grammar as 2 non terminals are lying side by side, but can be converted to an operator grammar. S→ ab , A→ a , B→ b here i have a doubt, operator grammar as the name suggests should have a ... right? how can we operate even two terminal symbols when placed side by side? Isn't it same as placing 2 non-terminal symbol side by side?
asked Jun 6, 2019 in Compiler Design Hirak 152 views
...