The Gateway to Computer Science Excellence
0 votes
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 operator in between 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?
in Compiler Design by Active (3.5k points)
edited by | 43 views





means, which operation?? 


like S--> ab is a valid production in operator grammar, but there is no operation between ab, so how can it be a part of operator grammar?

why $S\rightarrow ab$ , why it will not a operator grammar??

but  here $A\rightarrow a$

$B\rightarrow b$ are useless production
I am not denying S--> ab is not an operator grammar..

but i am unable to understand what is  the logic behind not taking two non terminals side by side, where as taking two terminals adjacent to each other is absolutely fine..! Why is this rule?  I haven't found any proper explanation.

if there are any terminals, that means production atleast terminates.

Operator-precedence parsers can be constructed for a large class of context-free grammars.

and in CFG we have no need of two non-terminal side by side 

Okay..Thank u.. 🙂

Please log in or register to answer this question.

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,647 questions
56,479 answers
100,553 users