The Gateway to Computer Science Excellence
0 votes

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?

in Compiler Design by Active (3.6k points) | 117 views
because operator precedence parser can work on only operator grammar. And that rule is one of the conditions for being an operator grammar.
Okay, Thank u.. :)

1 Answer

+2 votes

Rule of Operator precedence Parser is Any two variable should not adjacent to each other.If they are adjacent to each other then convert it!

eg- In C compiler,no two variables are adjacent 

            ab!=a*b this is not allowed in our c compiler

by Active (1.7k points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,379 answers
105,317 users