CS 423 HW#7
Due: Thursday May 7 5:00pm
Generate final code for k0. Please turnin via Canvas an electronic copy
of your whole project in a hw7.zip.
Take your compiler, and add target code generation. Individuals may
target TAC-C code; groups or more ambitious
individuals may target x86_64 assembler code.
Finals demos: if you have substantial new functionality to show, you are
invited to demonstrate your compiler to your professor (individually or in
a group as appropriate) in its final state prior to our final exam
(May 9, 12, or 13). This allows you to show what
works and ensures that you get credit for as much as you are able to
accomplish. Minor corrections and resubmission will be allowed in reponse
to a finals week demo.
Notes
- your executable should still be named "k0"
- take in files with .kt extensions and write out corresponding
final code in files with an appropriate extension.
If generating TAC-C, take in a file foo.kt and
write out a file foo.c; if generating x86_64, write out foo.s.
- write out the name of the file to standard out when you open it
- do NOT write out the tree, or other debugging information, by default;
you may add command line options to print that info if you want.
- error messages should be written to standard error not stdout
- If no errors and -s was given, x86_64 compilers should generate
assembler (as)
- If no errors and -c was given, call the assembler (as) or compiler (cc)
to produce an object code file in your target language.
- If no errors and no -c was given, call the assembler or compiler to
produce a .o file, and if that was successful, go ahead and call a
linker and produce an executable
- if ANY file has a lexical error,
your process exit status should return 1,
for a syntax error 2, for a semantic error 3, and for no errors,
return 0.