0
$\begingroup$

This Grammar:

A-->Bbab|aa

B-->b

I think we can't because basically there is no relation between terminals? like no relation between a and b! or am i missing something? and the language of this grammar has only 2 members !

can we using Operator precedence parsing with this grammar?

$\endgroup$
1
$\begingroup$

It's an operator grammar since no right-hand side has two consecutive non-terminals. So we then attempt to construct the precedence relations:

$$b \gtrdot b \\ b \doteq a \\ a \doteq b \\ a \doteq a $$

There is no multiple entry, so an operator precedence parser is possible.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.