Consider the grammar defined by the following production rules, with two…

GATE · 2014 · CS · Set 2 · Computer Science & IT

Consider the grammar defined by the following production rules, with two operators ∗ and 

S → T∗PT → U∣T∗UP → Q+P∣QQ →IdU →IdS\:\to\:T∗P \\ T\:\to\:U\mid T∗U \\ P\:\to\:Q+P\mid Q \\ Q\:\to Id \\ U\:\to Id

Which one of the following is TRUE?

  1. A.

    + is left associative, while ∗ is right associative

  2. B.

    + is right associative, while ∗ is left associative

  3. C.

    Both + and ∗ are right associative

  4. D.

    Both + and ∗ are left associative

Attempted by 257 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…