CS 441G-001Professor Craig C. DouglasTuesday-Thursday 12:30-1:45 RMB 323
http://www.mgnet.org/~douglas/Classes/cs441g-f05 Please fill out the Survey if you have not done so already.
|
Homework 9/8/2005You will work with your group on this assignment. You will need your cvs account information that was passed out in class on 9/6/2005. Log into your CS Lab account. Use cvs to check out the project cs441. Assuming you use either the c-shell or tc-shell, define the CVS environment variables (see your account information sheet), then just type
After typing your password (see your cvs account information sheet), cvs will download a directory tree of files. Investigate them. You will be adding to this tree for the remainder of the semester. There are directories for executables (bin), simple documentation (doc), your project (lexer, parser, and codegen), and a directory for your first programming assignment. Find the latter and write a short lex program that recognizes names, integers, and white space. Use the lex-header.l file as the first part of your lex file. Names start with a letter, dollar sign, or underscore. If the name is longer than one character, then it can also have digits in addition to the start characters. Integers consist of digits and can have an optional minus sign at the start. White space consists of a blank, tab, or new line character. Have your lex program print the matching character string, its length, and what type (name, integer, or white space) it is. Just use the C language to do this assignment. You can optionally try another language (C++, Java, or Python). Add your file(s) to your cvs repository. Make sure you add and commit the file(s). Then, to be safe, email me your lex file(s) (click on the link since it has the subject line defined already). Even if cvs fails completely, you should be able to do this assignment using the lex-header.l file from the class notes web page, lex, and email to get your solution to me. You should add the cvs environment variables to the .cshrc or .bash_profile files in your home directory for the CS Lab machines. Good luck. |
|
Cheers, Last modified: |