CS541 is an course covering many aspects of compiling programming languages. It covers both the theory and practice of compiler-writing tools, such as lexical analyzers and parser generators, as well as symbol tables, runtime organization for simple and structured variables, and code generation. As a prerequisite, you should be adept in programming in a modern programming language (you will complete all assignments in Java) and have knowledge of machine organization (you will compile for the Java Virtual Machine, which we will describe in class).
You will complete a five-stage project that creates a comprehensive compiler (symbol table, lexical analyzer, parser, semantic checker, and code generator).
The first half of the class is devoted to lectures on the theory of scanning and parsing. The second half deals with practical matters of building a compiler. Each class session will present an oddity of Java.
By the end of the course, you will be able to:
Due to the Coronavirus situation, we will conduct all classes via Zoom.
|Class||TR 11:00am ‒ 12:15pm; Zoom 933 2254 5699|
|(Password provided separately)|
|Office||Hardymon 230 (7-3885); Zoom 581609732|
|Office hours||M 12n-1:30p, Th 3p-4:30p|
There are five programming assignments corresponding to five stages of a compiler. All are based on CSX_go (Computer Science eXperimental - Go syntax). Professor Charles Fischer, the author of our textbook, designed the original CSX language and the assignments.
I encourage you to use the machines in the
on the second floor of the Engineering Annex
The tools you need are available there.
You automatically get a class account at the MultiLab.
You need to use a secure shell to contact these computers from elsewhere;
you can use ssh from Unix, putty
from Win32 machines, or MindTerm
https://www.appgate.com/mindterm) from any browser.
If you use a secure shell to access the MultiLab, it is best to
You may need to use the University VPN (virtual private network) to connect
You may construct your programs on any computer you wish, but they must run
properly on Linux in the MultiLab.
You must complete your assignments in Java.
The following is approximate.
|1‒12||Chapter in the textbook|
|a-e||Assignment due (noon Friday)|
|g||Absolute deadline (noon Friday)|
|M||Discuss midterm exam|
|n||No class - University holiday|
|f||Final: Thursday Dec. 3 10:30 am - 12:30 pm|
The text for the course is Charles N. Fischer, Ron K. Cytron, and Richard J. LeBlanc, Jr, Crafting a Compiler Addison-Wesley ISBN 978-0-13-606705-4, 2010.
There are many other good books on compiler construction, including:
You will be graded 50% on programs and 50% on the tests. The final will only cover material in the course presented after the midterm. You are not graded on class attendance, but you really need to attend class.
Our accreditation association and the policy of the Graduate School require that there be different assignments and grading criteria for undergraduate students and graduate students in 400G and 500-level courses. Undergraduate students must contact me in the first week for details on the special criteria I will apply to you.
For programs, correctness is an important criterion, but is by no means the whole story. Grades on programs are based on
http://www.cs.uky.edu/~raphael/writing.htmlfor guidance. Run all code and documentation through a spelling checker such as ispell.
http://www.cs.uky.edu/~raphael/checklist.htmlfor suggestions on programming standards, and
http://www.cs.uky.edu/~raphael/programming.htmlfor techniques specific to a few languages.
Extra credit is available on all programs. Don't attempt extra work until you have the basic assignment ready to hand in. Extra credit is only be used after initial final grades are assigned to raise grades that are close to borderlines.
Late programs are penalized 3% for each day late, starting at noon time on the due date (always Friday), but not including weekends or holidays. (Allowances for computer failure are announced in class and by the class mailing list.) The maximum penalty is 7 days late; after that, you may hand in the program and still get 79% until the absolute deadline: Friday noon of the last week of classes. No extra credit is available on late programs. If you turn in a program early, you gain early credits (which also ignore weekends and holidays), which are only used to offset late penalties on other assignments but have no other value.
Submit all work electronically. Collect all the files in your assignment (including program, documentation, test data, and output, into a single file (you may use shar, rar, zip, gzip, bzip2, or tar) and submit it via Canvas.
You are expected to use the computing facilities on campus in accordance
with standards of honesty and personal
conduct. Those standards, outlined in the University of Kentucky
Policy governing access to and use of University of Kentucky computing resources ,
call for all members of the community to act in a responsible,
ethical, and professional way. This note offers guidelines in applying those
standards to use of these facilities.
The operating systems used by our facilities encourage sharing of information. Security mechanisms for protecting information from unintended access, from within the system or from the outside, are minimal. These mechanisms, by themselves, are not sufficient for a large community in which protection of individual privacy is as important as sharing. Users must supplement the system's security mechanisms by using the system in a manner that preserves the privacy of others.
For example, users should not attempt to gain access to the files or directories of another user without clear authorization from the other user (typically that authorization is expressed by setting file access permissions to allow public or group reading). Nor should users attempt to intercept any network communications, such as electronic mail or user-to-user dialog. A shared program should not secretly collect information about its users. Personal information about individuals, which a user would not normally disseminate, should not be stored or communicated on the system. Examples of such personal information are grades or letters of recommendation.
Actions taken by users intentionally to interfere with or to alter the integrity of the system are out of bounds. Such actions include unauthorized use of accounts, impersonation of other individuals in communications, attempts to capture or crack passwords or encryption, and destruction or alteration of data or programs belonging to other users. Equally unacceptable are intentional efforts to restrict or deny access by legitimate users to the system.
The assignments for this class are similar to ones assigned in previous semesters. You may not refer to any work submitted or published (on github, for example) by previous students. All academic work, written or otherwise, that you submit is expected to be the result of your own thought, research, or self-expression. You may certainly discuss the programs with each other, but you must not show each other your code; everyone must develop the code completely independently. It is a serious offense to allow other students to copy your work or to copy the work of other students (even if it is in a public computer file or the Internet). If you borrow ideas, algorithms, wording, or code from other sources, you must acknowledge that fact or you have committed plagiarism. If you directly take more than about 4 words in a row from any source, you must indicate that you have done so, typically with a footnote or an in-line citation, using indentation or quote marks to set off the quoted text. (I took some of this text years ago from an online plagiarism guide.) I punish offenses against this policy quite strictly.
All the sections marked BOILERPLATE LANGUAGE in
https://www.uky.edu/universitysenate/sites/www.uky.edu.universitysenate/files/Files/Forms/Syllabus%20Template_DL_20200801.docx are included here by