CISC 672 Advanced Compiler Construction
Frequently Asked Questions

(Spring 2004)
General questions

Q1. What is the purpose of this page?

A1. This page is a list of the most frequently asked questions (hence the name FAQ) received by the instructor/TA for the assignments. Before sending us e-mail with a question regarding specification or implementation details of the assignment, you should check this FAQ page to see if the question has already been answered. If the question is not on the page, or if the explanation on the page is unclear, feel free to e-mail me with the question.

Turning in assignments (tar and gzip): A command to gzip all at once on stimpy would be: tar cvfj mytar.tar.gz files (on Linux the j needs to be z, but I don't think anyone will need that since all the COOL stuff is through your account).

Questions on Assignment PA1

Submission Procedure: Due to the individual nature of PA1, I will be holding demos to grade your assignments. Organizing demos can be difficult, so we will be using the help of a demo scheduler: https://atlas.cis.udel.edu:8443/scheduler. By Wed. afternoon you will receive an e-mail with a password, please login to the system, select the PA1 assignment and sign up for a demo slot. If you are unable to sign up for a time, please e-mail me. The demos will be held in the Smith 40 computer lab unless I e-mail you otherwise. In addition to the demo, you must still e-mail me your assignment submission (if you haven't submitted yet, please gzip the tar file first). Secondly, future assignments will be submitted via a Course Management System: http://dreadnought.cis.udel.edu/courseweb/. Please access the site and create an account by 10 AM Wed morning 2/16. Before viewing course materials you must enter the Enrollment Key for 672, which Dr. Pollock will give out during class. (But you can register as a user before you have the key, so please register as soon as you get this e-mail!)

Question: Are we allowed to use any of the classes given in your cool examples in our own programs for Project1. In particular, I'm wondering about using atoi and itoa incidentaly in my own algorithms. I could re-write the class, but it would be hard to think of a way to do it substantially different than that example.

Answer: You may use some classes of existing Cool programs, as long as at least 80% of the code you submit is your own.

Questions on Assignment PA2

If you are having trouble with the Java version, then make sure that your classpath is set up to find JLex and JCup.

Here is what I have for my classpath in my .cshrc file.

setenv JAVADIR /usr/local/java
setenv CLASSPATH .:/usa/pollock:$JAVADIR/lib/classes.zip:/usr/local/cis672:/usr/local/cis672/J Cup:

Note that the cool02 does not work with g++ 3.4.3. So, do the following:
gmake CC=g++2 with the rest of the line.

Question: For our scanner project, in the cool manual it says that strings canno t contain a newline, and that the true/false keywords must have a lowe rcase first letter. However, the lexer-test scanner allows escaped ne wlines (a slash followed by the actual ascii newline), and treats True or False as type ids. Is that correct?

Answer: You should follow the manual specification for Cool. The lexer-test, I see, does not match what the coolc compiler does in this case. The True will not make it through the coolc scanner, which follows the language spec. So, stay with the language specification when there are discrepancies between spec and our implementations. Thanks for letting us know also. We are still finding these things!

Questions on Assignment PA3

After looking over PA2, I have decided to give you a few more submission guidelines. THESE GUIDELINES APPLY FOR ALL ASSIGNMENTS. First, the assignments should be tarred and zipped and submitted on the web: http://dreadnought.cis.udel.edu/courseweb/login/index.php. Secondly, you should place the files you are submitting in a directory named with your last name (lowercase), and you should then tar the directory. The tar file name should include both your last name and the assignment. For example, if I were turning in PA3, I would type the following tar command:

> tar cvfj gibson_pa3.tar.gz gibson/*

The command would place all my project files from my gibson directory into the tar, and when the command 'tar xvfj gibson_pa3.tar.gz' is executed, a directory with my last name will be created, containing all my files. (Test this to make sure yours works properly.) It is limiting to have only two example test case files (good.cl and bad.cl). Therefore I would like everyone to create a subdirectory called 'tests' that contains all your test case files. You only have to submit good.cl and bad.cl, but please put them in a directory called 'tests' all lowercase. I'm trying to minimize the overhead I have to do to actually grade the assignments, so I can get them back to you faster!

Also, Groups only have to submit under one name.

Question: On pg 15 of the specification, there is the line

expr ::= .... | ID(expr,*) Is this intended? Should we design our parser this way or do:

expr ::= ID(expr ,expr*) | ID()

Answer: The rule in the manual should be:
expr :== ID() | ID(exprlist)
exprlist :== expr | expr, exprlist

Questions on Parsing Homework

Questions on PA4

Hope everyone's making progress with their semantic analyzers! When you're ready to submit, please follow these directions: For PA4, please tar & gzip all of your files. When I extract your directory I should be able to type: > tar xvfz person.tar.gz > cd person > gmake semant > ./mysemant program.cl And successfully run your semantic analyzer. Please put test cases in a subdirectory named 'tests'. You may have as many test cases as you want, just be sure to indicate whether the test case should be successfully analyzed or has errors (either in the name or in the README). As soon as I finish grading PA3, your grades will be posted on CourseWeb. Please let me know if you have any other questions, Emily
Questions on PA5