Essentials of Compilation by Jeremy G. Siek

Essentials of Compilation by Jeremy G. Siek

Author:Jeremy G. Siek
Language: eng
Format: epub
Publisher: MIT Press


5.5 Remove Complex Operands

The new language forms, get!, set!, begin, and while are all complex expressions. The subexpressions of set!, begin, and while are allowed to be complex. Figure 5.6 defines the output language of this pass.

Figure 5.6

is ℒWhile in monadic normal form.

As usual, when a complex expression appears in a grammar position that needs to be atomic, such as the argument of a primitive operator, we must introduce a temporary variable and bind it to the complex expression. This approach applies, unchanged, to handle the new language forms. For example, in the following code there are two begin expressions appearing as arguments to the + operator. The output of rco_exp is then shown, in which the begin expressions have been bound to temporary variables. Recall that let expressions in are allowed to have arbitrary expressions in their right-hand side expression, so it is fine to place begin there.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.