code: private CompactDFA<I> parseDFA(Reader reader)
              throws FSMParseException, IOException {
  
          parse(reader);
  
          final Alphabet<I> alphabet;
  
          if (targetInputs != null) {
              alphabet = Alphabets.fromCollection(targetInputs);
          } else {
              alphabet = Alphabets.fromCollection(getInputs());
          }
  
          final CompactDFA<I> dfa = new CompactDFA<>(alphabet);
  
          // add all the states
          states.forEach((key, value) -> dfa.addState(value));
  
          // set the initial state (substract one because the StreamTokenizer starts counting at 1
          dfa.setInitialState(states.firstKey() - 1);
  
          // add all the transitions
          transitions.entrySet()
                     .stream()
                     .filter(e -> alphabet.containsSymbol(e.getKey().getSecond()))
                     .forEach(e -> dfa.addTransition(e.getKey().getFirst() - 1,
                                                     e.getKey().getSecond(),
                                                     e.getValue() - 1));
  
          // clear our state for next parse call
          states.clear();
          transitions.clear();
  
          return dfa;
      }
docs: Constructs the actual {@link net.automatalib.automata.fsa.DFA}.
  
  @return the DFA represented by the FSM file.
  
  @throws FSMParseException
  see {@link #parse(Reader)}.
  @throws IOException
  see {@link #parse(Reader)}.