Assignment 5 (4%)
Note: Your solution should be written in C!
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 firstname.lastname@example.org (if you
somehow end up with a very large archive, send only a short note and
send the main file to email@example.com.
- 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
- 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
Schulz,firstname.lastname@example.org, Thu Aug 22 13:35:31 EDT 2002