CS 440/540

D. Nordstrom
Summer 2008

Course Material

The course syllabus can be found here.

The midterm exam will be Thursday, June 5.
The final exam will be Thursday, June 19, 1:30 - 4:15.
Please note the unusual date and time and remember to bring a bluebook.

Project material:

The Paxi Definition is here.
The Paxi Grammar in BNF (ASCII file) is here.

Program 1 is here.
Sample data for Program 1 is here.
Program 2 is here.
C skeleton code (as of Program 2) is here.
For your terminal session for Program 2:
0Write your program to compile an input file whose name is taken from the command line. Your program will then parse (yyparse()) the input file and, *if* the parse terminates without an error, print out the entire symbol table. Run your program for each of the files:
SampleA.pax. This file has no errors.
SampleB.pax. This file has a syntax error.
SampleC.pax. This file has a lexical error.
Program 3 is here.
Sample input for Program 3 is here. Compile this program with your compiler then complile the output with a C compiler:
gcc -o sample3 sample3.c        for Unix, etc.
gcc -o sample3.exe sample3.c    for Windows
(here the "- o" switch means the following string is to be the name of the output file.) and run the resulting executable for you sample terminal session. Read the comment at the beginning of the sample Paxi file before running your sample terminal session.

The "lunch" example from class is available here: the jflex file, the byaccj file a driver file, and a text file with some notes on using jflex and byaccj together.
And for the C++ versions: the flex file, the bison file, and a driver file.

Some notes (read only after reading the above notes) on using yylval to communicate between jflex- and byaccj-generated files are here. A (trivial) example has a jflex file and a byaccj file.

Resources

Lots of wonderful stuff is available from the Free Software Foundation: http://www.fsf.org.

For Java Users

JFlex is a version of lex which generates Java code (and is written in Java). JFlex and complete documentation can be found at http://jflex.de.

byacc/j is an extension of byacc (Berkeley yacc) which will, as an option, generate Java code. It can be found, along with documentation, at http://byaccj.sourceforge.net.

MS Windows Resources

If you are working on a PC using Microsoft Windows the following may be useful.

DOS ports of flex and bison can be downloaded here: http://www.delorie.com/pub/djgpp/current/v2gnu/flx254b.zip and http://www.delorie.com/pub/djgpp/current/v2gnu/bsn23b.zip.

djgpp, a DOS port of gcc/g++, can be accessed by following links from http://www.delorie.com/djgpp . Documentation is available there as well.

A large number of Unix programming tools have been ported using this compiler and can be found in http://www.delorie.com/pub/djgpp/current/v2gnu/

Cygwin provides gcc/g++ along with a Unix-like environment. Read about it and how to download it at http://www.cygwin.com/ (but be prepared for a huge download).

Editors for Windows/DOS

A Windows port of emacs is ntemacs ( http://www.gnu.org/software/emacs/windows/ntemacs.html)

If you really must use vi, vim ("vi improved") is available for a variety of systems including Windows at http://www.vim.org

jEdit, a powerful editor with commands much like a standard word processor, is available for all systems at http://jedit.org.