Compiler 2013: Mid-term specification
外观
Testing Process
- Boot an up-to-date Ubuntu Server 12.04 system in VirtualBox
svn checkout
everyone's repository- For each repository (e.g.
xjia/compiler2013/
)- Kill all irrelevant processes
- Setup a new bash process
- Reset environment variables
cd xjia/compiler2013/
make
# compile your codesource midtermvars.sh
# setup environment variables for mid-term testing- For each test case (e.g.
input.c
)$CCHK input.c
- Check
$?
(the exit status); 0 for OK, 1 for error
Limits
For each test case, your compiler is required to exit within 5 seconds, consuming less than 64MB memory. Write operations to the file system are prohibited. But you are allowed to write to the standard output (stdout or System.out) and the standard error (stderr or System.err) stream.
Notes
You can setup environment variables like this:
export CCHK=java -cp .:classes/ cc.midterm.Main
or
export CCHK=java -jar midterm.jar
or
export CCHK=./c_compiler
In Java, use System.exit(...)
to specify the exit status. In C, use exit(...)
to specify the exit status.
You need a Makefile for this mid-term testing. If you don't know how to write a Makefile, read http://mrbook.org/tutorials/make/
Note that you also need a Makefile even if you want to compile Java using ant or maven.
Standard-library Functions
scanf printf malloc