Question: The questions in this section are based on the grammar given as the following: prog -> assign | expr assign -> id = expr expr

The questions in this section are based on the grammar given as the following: prog -> assign | expr assign -> id = expr expr -> expr + term | expr - term | term term -> factor | factor * term factor -> ( expr ) | id | num id -> A | B | C num -> 0 | 1 | 2 | 3 (2a) What is the associativity of the * operator? (5 points) (2b) What is the associativity of the + operator? (5 points) (2c) For the * and + operators, do they have the same precedence, does the * operator have greater precedence than +, or does + have greater precedence than * ? (5 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!