Assignment 5 (4%)
Note: Your solution should be written in C!
- Write a code generator for PL, generating valid C code
- Write runtime support code for PL
- Put things together to write a PL to C compiler that generates a
compilable C program and test it
- Hints:
- You'll need to traverse the parsed program to get a list of
all variables before proper code generation!
- Parameter passing: If you call compiled_pl 1 7 3 42,
then the input variables should be initialized as follows (and
regardless of the order of their appearance in the PL program):
- You can use the function atol() from
<stdlib.h> to convert any numbers in strings to
long values
Please pack your source code (not including any binaries or object
files!) using gtar czvf ASSIGNMENT5.tgz [files or
directories] and send the resulting archive as an attachment
to yi_82@yahoo.com (if you
somehow end up with a very large archive, send only a short note and
send the main file to yigao@mail.cs.miami.edu.
Stephan
Schulz,schulz@cs.miami.edu, Thu Aug 22 13:35:31 EDT 2002