Presentation is loading. Please wait.

Presentation is loading. Please wait.

Optimizations for the CSE Machine

Similar presentations


Presentation on theme: "Optimizations for the CSE Machine"— Presentation transcript:

1 Optimizations for the CSE Machine
Programming Language Principles Lecture 13 Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida

2 Five CSE Rules (Minimally) Sufficient
Let's take some shortcuts. CSE Rules 6 and 7: Unary and Binary Operators.

3 Five CSE Rules (Minimally) Sufficient (cont’d)
In the control structures, abbreviate:   + to +   - to - . . . (other binary operators)  neg to neg  not to not In other words, DO NOT standardize unops and binops.

4

5 CSE Rule 8: Conditional Do not standardize → node. Instead, for B → E1 | E 2, generate then else  B, where then = control structure for E1 else = control structure for E2 B evaluated first, then  pops the stack, keeps one  and discards the other.

6

7

8 CSE Rules 9 and 10: Tuples Do not standardize "tau“. Instead, for a tuple of the form (E1, E2, ..., En), generate the control structure taun E1 ... En. taun will: Pop the top n values from the stack, Create a new n-tuple, Push the tuple on the stack. Note: tuple elements are evaluated right-to-left.

9

10 CSE Rule 11: n-ary Functions
Do not standardize the "," node. Instead, For (x,y).E, simply allow multiple bindings in one environment.

11

12 Optimizations for the CSE Machine
Programming Language Principles Lecture 13 Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida


Download ppt "Optimizations for the CSE Machine"

Similar presentations


Ads by Google