CSC 330 Assignment 2

Assignment 2: Some Further Clarifications



  1. Define true and false as keywords; i.e., don't recognize them as identifiers.

  2. Define just one INTEGER token type for all three kinds of integer literal, i.e., decimal, hex, and octal. This one token type also covers regular integers and longs.

  3. For the values of INTEGER literals, you do not need to distinguish between Integer and Long values; for convenience, you can represent the value of all INTEGER literals as Long.

  4. Define just one FLOATING_POINT literal token type for floats and doubles.

  5. For the values of FLOATING_POINT literals, you do not need to distinguish between Float and Double values; for convenience, you can represent the value of all FLOATING_POINT literals as Double.

  6. If you cannot get numeric conversion to work for INTEGER and FLOATING_POINT tokens, you can return the values as strings for partial credit.

  7. For STRING literals, you do not have to do unicode preprocessing, i.e., processing of "\uxxxx" escape sequences. However, you do need to convert the other forms of escape sequences to their single character values. E.g., the string literal value of the input token "\t\n" is a two-character string containing a tab and a newline character; it is not a four-character string containing a backslash, the letter "t", another backslash, and the letter "n".

  8. If you cannot get escape sequences to work, you will only loose 6 points out of 100.

  9. The following have been recently posted at the 330 Assignment 2 directory on falcon/hornet:

    1. a detailed point breakdown for the assignment

    2. the Java test program that will be used to run your submitted programs

    3. a sample EJay input file, containing a collection of raw EJay tokens that your lexer must recognize

    4. the output result of running the Assignment 2 solution on the sample input file