44 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 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?

edited | 44 views
0

@srestha

Help..

0

how can we operate even two  terminal symbols when placed side by side?

means, which operation??

0

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?

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

but  here $A\rightarrow a$

$B\rightarrow b$ are useless production
0
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.
+1

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

0
Okay..Thank u.. 🙂