CS 431 Home Page


The syllabus, lab exercises, and other information are posted here.  These are links to Word documents and other things which you should be able to download.

cs431springsyl2006


    Some interesting resources related to language definition (and compilation), but not directly related to class lectures or assignments:

Java Language Specification  The java language specification as supplied by Sun.

JVM Specification  The java virtual machine specification as supplied by Sun.


    The files given here are not assignments.  They consist of short answer questions on the chapters and sections in the book which are covered in this class.  These questions were taken from tests given in previous offerings of the class.  You may find it useful to read through them as part of studying for tests.  You are not supposed to hand in your answers and there are no homework points associated with these question sets.

cs431ch1rvw.doc

cs431ch2rvw.doc

cs431ch3rvw.doc

cs431ch4rvw.doc

cs431ch5rvw.doc

cs431chs8-9rvw.doc


Assignments A-F.  You should be able to start working on these assignments right away.  If you did one of the lettered assignments per week for the first 6 weeks of the semester, you would be making good progress, and any information needed from the book or from lectures which might be helpful in doing any of the parts should have been covered by the time you reach it if you follow this schedule.

AssignmentsA-F.doc  As of 2/27/2006 this assignment document is in final form.  I have been able to solve A-F to my satisfaction, and the document has been rewritten to reflect the specific problems solved, with some indication of how it was done.  Typos or other mistakes may still be found and corrected, but the overall plan of the assignments will not change.  If the assignment sheet is not clear or if you're having trouble getting your solutions to work, contact me.

LetterCountWithWriting.java  This program contains the logic for file I/O which might be useful as a starting point for assignment A.  It is included here in case you're rusty on that syntax.

MyTerminalIO.java  This is the simple class used for interactive keyboard and monitor I/O in the program above.

TrialFile.txt  This is a sample input file without formatting.  You can test your solution to assignment A on it.

TrialOut.txt  This is the output file generated for TrialFile.txt with a solution to assignment A that I wrote.  You may want to compare with it.  In my browser it comes up as if it's double spaced.  If you download it and open it in TextPad it will be single spaced.


Numbered Assignments

    If you have followed the plan of doing assignments A-F during the first 6 weeks of class, if you then start on the 4 numbered assignments, any information needed from the book or from lectures which might be helpful in doing these assignments should have been covered by the time you reach them.


cs431assignment1.doc  This is assignment 1.  It has to do with the implementation of a parser based on the background in chapter 2.

Predictor.java  This is incomplete, unrunnable code.  It is not intended to be immediately useful in doing an assignment.  It is posted for the purpose of making clearer the pseudo-code in Figure 2.17 on page 44 of the book.

NewInfixToPostfixCut.java  This is incomplete code which may be useful in doing assignment 1.

MyInputReader.java  This the I/O file used by NewInfixToPostfixCut.java.

infile1.txt  This is the simplest of the three examples mentioned in the assignment sheet.

infile2.txt  This is the second example mentioned in the assignment sheet.

infile3.txt  This is the third example mentioned in the assignment sheet.

infile4.txt  This one of the two files your code will be black box tested on.

infile5.txt  This is the other of the two files your code will be black box tested on.


cs431assignment2.doc  This is assignment 2.  It has to do with the implementation of a scanner based on the background in chapter 3.

ass2givenlang.doc  This is the language which you have to scan for assignment 2.

scantest.txt  This is the black box testing input file for assignment 2.

    What follows are the background files which might prove helpful for assignment 2.

simplescantransitions.doc  This document contains the transition diagrams, unified into one, implemented in SimpleScanV1.java.

SimpleScanV1.java  This program scans a "horizontal" input file containing the tokens specified in the previous document and produces output where every successfully identified token is printed on a separate line.

DoubleBufferV1.java  This is a very simple implementation of double buffering which is used in SimpleScanV1.java.  (Do not confuse it with the Java API class DoubleBuffer, which is a (single) buffer which holds elements of type double.)

simplescantest.txt  This is a sample input file for SimpleScanV1.java.  It contains some things that should scan as identifiers, some things that should scan as comparison operators, and some white space.

scantestinout.doc  This is how the sample input file would scan.


    Assignment 2 was based on the contents of chapter 3.  Sections 1 through 4 of chapter 4 are on the syllabus, but a fair amount of this material is review of chapter 2.  Not all of it will be lectured on.

cs431ch4outline.doc  This document is a supplement to the syllabus.  It spells out in detail which sub-sections of sections 4.1 through 4.4 will be lectured on and which you should read on your own.


cs431assignment3.doc  This is assignment 3.  Refer to the information below on MISC for the background needed for this assignment.

    What comes here is information on MISC.  This is a simple machine simulation that will serve as the basis for the numbered assignments which follow.

miscinfojavaV1.doc  This document contains the general background on MISC.

miscinfojavaV1overheads.doc  This is an abbreviated version of the previous document.

miscinfoassembly.doc  This document contains information specifically related to MISC assembly and machine language, and translating from one to the other.

    What follows are the java files for the simplest implementation of MISC.  Putting them all in one directory and compiling MachineOSProgramV1.java ought to result in a runnable version of the code.

MachineByteV1.java

MachineOSProgramV1.java

MachineV1.java

MachineWordV1.java

OsystemV1.java

MyTerminalIO.java  This is the class I use to do keyboard/monitor I/O with my non graphical programs.

    Here are some files giving information about the kind of input program that runs on the MISC simulation.

sumtenV1.txt  This is a valid machine language file which should be runnable on the MISC simulation.

sumtenV1lines.txt  This is not a valid machine language file.  It is the previous program with line feeds in it in order to show the line by line structure of the source.

sumtenV1asm.txt  This is the assembly language source file which corresponds to the machine language file above.


There will be no assignment 4.  This link is left for my convenience, but assignment 4 will not be accepted or graded.  Do not work on it.

cs431assignment4.doc  This is assignment 4.






 

 

THIS WEB PAGE IS UNDER REVISION FROM A PREVIOUS VERSION.  EVERYTHING ABOVE THIS RED BOUNDARY IS CURRENT.  EVERYTHING BELOW THIS BOUNDARY IS OLD AND YOU SHOULD PAY NO ATTENTION TO IT UNTIL IT HAS BEEN REVISED AND MOVED ABOVE.

    Materials directly related to class and class assignments:

pisc431info.doc  This is the complete documentation for pisc.  The first part gives the hardware specifications of the machine simulated by pisc431.cpp.  The second part gives the specifications for its assembler.  This is the background information needed for assignment 1.

pisc431.cpp  This is the .cpp file for pisc.  Note that this has been written so that it works with the Microsoft Visual C++ compiler.  It is standard C++ code, but as you know, it may not work correctly using a different compiler.

pisc431.h  This is the header file for pisc.  The same warning applies about the choice of compiler here.

cs431ass1.doc  This is assignment 1, writing a pisc machine language multiplication program.

cs431ass1sol.doc  This is a presentation of the overall solution to the multiplication problem, covering all 4 possible combinations of operand signs.

sumtenformatted.txt  This is the formatted version of the machine language program to sum the first ten integers which is given as an example in the pisc documentation.

sumten.txt  This is the unformatted version of the program which can be run on pisc with the rpf command.

multiplyformatted.txt  This is the formatted version of the machine language program that does all four cases of multiplication, a superset of the assignment problem.

multiply.txt  This is the unformatted version of the program which can be run on pisc with the rpf command.

cs431ass2.doc  This document explains assignment 2 which consists of writing missing pieces of code for the pisc assembler.  A large part of the document is a repetitition of the assembler documentation which was the second half of pisc431info.doc.

asmsamp.txt  This is the sample assembly language source file for testing the assembler.

asm431part.cpp  This is the partial assembler program file which you use to complete assignment 2.

asm431part.h  This is the partial assembler header file which you use to complete assignment 2.

parser1.cpp  This is the code given in chapter 2 for the initial complete parser program.  It is straight C code which won't work in Visual C++.

parser2.cpp  This is the code for the initial complete parser program of chapter 2 with the minimum changes needed in order to make it compilable and runnable in Visual C++.

  What follows are the book's C source files for the complete parser program at the end of chapter 2.  I have not compiled and debugged them, so it's possible that there are typographical errors in them.  They are provided for your convenience since it is possible to do the assignments in C code on UNIX if you prefer, rather than using Visual C++.

emitter.c    error.c    global.h    init.c    lexer.c    main.c    parser.c    symbol.c

ch2wholeparser.cpp  This is the complete code given at the end of chapter 2 for the parser program, modified so that it will compile and run as a monolithic program in Visual C++.  This code has been tested, so it should work.  Programming assignments are listed below.

cs431ass3.doc  This document gives assignment 3.

cs431ass4.doc  This document gives assignment 4.

cs431ass5.doc  This document gives assignment 5.

lextrimmed.cpp  The code for assignment 5.

testfile1.txt  The first test file for assignment 5.

outfile1.txt  The output of the first test file for assignment 5.

testfile2.txt  The second test file for assignment 5.

outfile2.txt  The output of the second test file for assignment 5.

t2qsummary.doc  This is a summary of the questions that will appear on test 2.

cs431ass6.doc  The explanatory notes for assignment 6.

parser3addressfinal.cpp  My code for assignment 6.

cs431ass7.doc  The explanatory notes for assignment 7.

NOTICE:  The time and day for the final as originally posted on the syllabus was wrong.  The correct information is:

Thursday, May 3rd, 1:00-3:45

The syllabus now shows this corrected information.

  Here is some final information about the class:

  NO HOMEWORK WILL BE ACCEPTED AFTER THE FINAL TEST PERIOD.

  Part 1 of the final test consists of 18 short answer questions at 5 points apiece.  This will still count for 100 points.  The coverage of material is as follows:  ch. 1; ch. 2.1-2.7

  Part 2 of the final test isn't written yet.  More information may be posted when it becomes available.  The coverage of the material is as follows:  ch. 2.8-2.9; ch. 3.1-3.4.

  Part 3 of the final test consists of 18 short answer questions at 5 points apiece.  This will still count for 100 points.  The coverage of material is as follows:  ch.8.1-8.3; ch. 9.1-9.2, 9.4-9.7.