| OCR Text |
Show APPENDIXB COMPILING EXTENDED WAM CODE TO C This appendix itemizes some of the changes made to the PLM compiler to generate C code which can be compiled. B.l PLM Changes for C Code Production In general, C code is produced by the EPLM compiler by transforming the original PLM code. Four kinds of transformation are made. The first type of transformation implements the mechanical part of producing C syntax from the W AM syntax originally produced by the compiler. Transformations include the addition of ';' to the ends of all instructions and parenthesizing operand lists to produce ar-gument lists. A second kind of transformation tailors instructions to the type of their operands so that execution of these instructions will be specific to their operands. These transformations perform two functions. If the operand of an instruction is a Y register, e.g., Yl, this operand is always a reference to a value cell offset from the current environment by its number. Thus, Yl indicates the first value cell of the current environment. The first transformation specializes the instruction to one which is particular toY registers. For example, the WAM (and PLM) inStruction unify_value Yl becomes unify_y_value Yl The "y" part of the Yl is now superfluous, and the second transformation changes this instruction to unify_y_value 1 or, after transformation to C, unify_y_value(l) |