Consider the grammar defined by the following production rules, with two operators ∗ and + S → T * P T → U|T * U P → Q + P|Q Q → Id U → Id Which one of the following is TRUE?
Consider the grammar defined by the following production rules, with two operators ∗ and + S → T * P T → U|T * U P → Q + P|Q Q → Id U → Id Which one of the following is TRUE? Correct Answer + is right associative, while ∗ is left associative
In second production T → T * U here T is generating T*U left recursively so * is left associative.
In third production P → Q + P, Here P is generating Q + P right recursively so + is right associative.
Hence option 2 is the correct answer.
মোঃ আরিফুল ইসলাম
Feb 20, 2025