Question: 7 . Consider the if/then/else rule in a simple language. The grammar rule is: --> if ( ) else | | | | | |

7. Consider the if/then/else rule in a simple language. The grammar rule is:

--> if ( ) else

| | | | | | |

1 2 3 4 5 6 7

a. Write the simple Recursive Descent routine for the nonterminal "ifelse". Use "match" if desired no need to write it. Assume routines for and are written elsewhere and are available for use with whatever parameters you want for them.

b. What tests need done? Describe any checks that the compiler must do in this statement.

c. What code needs generated? Describe it all ( only! other code will be generated by and , and where (in ifelse) it will be generated. [You can answer as MIPS or as "code to" or in any made-up three address code that you want to invent]

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!