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.

Related Questions

You are the administrator of eight SQL Server 2000 computers. You configure alerts on each server so that various problem conditions will be reported if they occur.You create 20 operators on one of the servers. You configure these operators by using the e-mail and pager contact information for the employees in your department. You configure the alerts on the server to send e-mail messages and pager messages to the appropriate operators.You need to configure the same 20 operators on the other seven servers. You want to do this with a minimum amount of administrative time.What should you do?
Consider a grammar G with the following production rules: S → SS, S → λ, S → aSb, S → bSa Which one of the following languages is generated using the above rules?