FSA
Class DFA_Reader

java.lang.Object
  |
  +--Reader
        |
        +--FSA.DFA_Reader

public class DFA_Reader
extends Reader

This class provides a method for reading DFA files.

See Also:
Serialized Form

Constructor Summary
DFA_Reader(java.lang.String fname)
          Constructs a DFA reader for a file.
 
Method Summary
 FSA.DFA read()
          Reads a DFA from a file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DFA_Reader

public DFA_Reader(java.lang.String fname)
           throws java.io.FileNotFoundException
Constructs a DFA reader for a file. File format is essentially the transition table, with one transition (state symbol new-state) per line. Symbol should be a single character, state a non-negative integer. First state read is treated as start state. Accepting states should be marked with asterisk.

Parameters:
fname - name of file specifying DFA
Throws:
java.io.FileNotFoundException - on failure to open file
Method Detail

read

public FSA.DFA read()
             throws java.lang.Exception
Reads a DFA from a file.

Returns:
DFA object
Throws:
java.lang.Exception - on failure to read file, too few items in a line of the file, or excessively long symbol.