CS 5500 Assignment #3. Assigned: Wednesday, 11 September 2013 Due: Wednesday, 25 September 2013 This is an individual assignment. Collaboration between students is forbidden on this assignment. You are responsible for keeping your code hidden from all other students. For this assignment, you will write a simple syntax checker that implements the specification given below. You must write all of your program's source code by yourself. You are not allowed to use source code written by other students, you are not allowed to use source code obtained from the World-Wide Web or other sources, and you are not allowed to use software packages unless they are already installed on the standard CCIS Linux machines. Your software must include a README file (which *must* be in UTF-8 plain text, and must be named README) that 1. gives your name (as you want the instructor to spell it), 2. gives your preferred email address(es) for contacting you, 3. tells the grader(s) how your software can be compiled and run on any CCIS Linux machine in the main lab. All of the files necessary to construct and to run your software must be combined into a gzip'ed tar file whose name ends in tar.gz. Submit that gzip'ed tar file before 6pm on the date it is due using the submit script that's described at the course assignments page: http://www.ccs.neu.edu/course/cs5500f13/assignments.html Your software will be graded on these criteria: 1. the quality of the instructions and documentation in your README file, 2. the ease of constructing and running your software on CCIS Linux machines, 3. your software's correctness with respect to not attempting to read any files not attempting to create any files not producing extraneous output having no side effects apart from writing to standard output producing the specified error message for incorrect inputs returning an exit status of zero for correct command lines returning a nonzero exit status for incorrect command lines 4. and the readability of your source code. Your software's build process must result in software that can be invoked by cd'ing to the directory containing your software's executable and executing a command of the following form ./check5500 where is a sequence of tokens generated by ::= -f | --file | -d | --dir and is a sequence of ASCII characters generated by ::= | ::= | | | | | | ::= / ::= . ::= ~ ::= - ::= _ ::= a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Note that as specified here is not quite the same as a Linux path name, so you will have to write your own code to check the syntax of a . Most programming languages provide a built-in way to split the command line into tokens, and you may rely on that built-in tokenizer when parsing the command line and each . If your software discovers that its command line was correct according to the specification above, then your software should produce no output at all and should terminate with an exit status of 0. If your software discovers that its command line was incorrect according to the specification above, then your software should write "ERROR" to standard output, followed by a newline (also sent to standard output), and should terminate with an exit status other than 0. ---------------------------------------------------------------- Examples. The following test cases should produce no output and terminate with an exit status of 0: ./check5500 -f here -d there ./check5500 --dir /~~/./..////.../_~-..// -d - ./check5500 --file a -f b The following test cases should write "ERROR" to standard output and should terminate with an exit status other than 0: ./check5500 ./check5500 -f ./check5500 -f here ./check5500 -f here -d ./check5500 -f here -d there --dir everywhere ./check5500 -file here -d there ./check5500 -f here -dir there ./check5500 -f x$50 -d yz ----------------------------------------------------------------