• edited by
701 views
–1 –1 vote

In the following grammar
\[
\begin{array}{l}
\mathrm{P} \rightarrow \mathrm{P} \uparrow \mathrm{Q} \mid \mathrm{Q} \\
\mathrm{Q} \rightarrow \mathrm{R} \& \mathrm{~S} \mid \mathrm{S} \\
\mathrm{~S} \rightarrow \mathrm{id}
\end{array}
\]

Which of the following is true?

  1. $\uparrow$ is left associative while $\&$ is right associative
  2. $\uparrow$ is right associative while $\&$ is left associative
  3. both $\uparrow \& \&$ are left associative
  4. none of the above

2 Answers

1 1 vote

A---> A∗B i.e. * is Left associative
A--->B*A  i.e. * is Right associative

P is Left associative . Associativity of Q is Not Defined.

Position:
Show:

Related questions

2 2 votes
1 answers 1 answer
2.3k
2.3k views
arch asked Nov 7, 2017
2,325 views
someone please explain how to draw operator precedence table to solve this question.\[\begin{array}{l}\mathrm{S} \rightarrow \mathrm{aSb} / \mathrm{Ac} \\\mathrm{~A} \rig...
1 1 vote
3 3 answers
4.1k
4.1k views
Jhunjhunuwala asked Jan 28, 2016
4,140 views
Q). Consider the following operator grammar $S \rightarrow BbA\mid bA \mid bBA$ $B \rightarrow b \mid c$ $A \rightarrow a $Which of the following precedenc...
1 1 vote
3 3 answers
2.2k
2.2k views
Crackca asked Sep 19, 2021
2,222 views
Which of the following statements are true. Please give a detailed explanation.1) If the given grammar is not operator grammar then we can’t design an operator precedenc...
0 0 votes
1 answers 1 answer
943
943 views