Site navigation

Given the following expressions of a grammar E → E * F / F + E / F F → F − F / idWhich of the following…

Interpreting slash as the production-alternative separator, subtraction occurs inside F while multiplication uses F operands at the E level. Thus subtraction binds more…

Choose your answer

Given the following expressions of a grammar

E → E * F / F + E / F
F → F − F / id

Which of the following is true ?

Select one answer
Answer and explanation

Correct answer B

Interpreting slash as the production-alternative separator, subtraction occurs inside F while multiplication uses F operands at the E level. Thus subtraction binds more tightly than multiplication. The E productions do not establish the claimed opposite precedence relations.

Practice for these exams

  • UGC NET Computer Science and Applications

Related question papers

Related exam syllabi

Related questions in this topic