CS 3723 -- Finite Automata Assignment


  1. Identifiers. Construct a DFA for legal identifiers in Java: a string of characters starting with a letter or an underscore followed by any number (including 0) of letters, digits or underscores. (You can just label a transition with "letter", etc. Actual Java can also start with a "currency symbol", and the letters can be in any foreign alphabet, but we will ignore this.)

  2. Floating Point Constants in Java. Construct a DFA that recognizes exactly the legal floating point constants in Java and C, as shown by the example program below. This should ignore the optional trailing "f" or "F" for "float" constants and the optional trailing "d" or "D" for "double" constants. (With no optional trailing letter the constant is double by default.) It shouild also ignore the limitation on the size of the exponent, so the last illegal constant in the program below would be accepted by the DFA. (This is fairly complicated and needs to be done with care.) Output: The two commented out constants produced error messages:
  3. (and 4.) NFAs into DFAs. I will give you two NFAs to convert into DFAs that accept the same strings of symbols.

Revision date: 2001-09-13. (Please use ISO 8601, the International Standard.)