/** * Creates a dfa state from all nfa states that can be reached from this state * with epsilon move. * @param scope * @return */ public Set<NFAState<T>> epsilonClosure(Scope<DFAState<T>> scope) { Set<NFAState<T>> set = new HashSet<>(); set.add(this); return epsilonClosure(scope, set); } /**
Set<NFAState<T>> startSet = epsilonClosure(dfaScope); DFAState<T> startDfa = new DFAState<>(dfaScope, startSet); all.put(startSet, startDfa); if (!moveSet.isEmpty()) Set<NFAState<T>> newSet = epsilonClosure(dfaScope, moveSet); DFAState<T> ndfa = all.get(newSet); if (ndfa == null)