src/main/java/de/dfki/lt/loot/fsa/algo/Determinization.java
private static <EdgeInfo> void expandWithEpsilonClosure(
    AbstractAutomaton<EdgeInfo> graph,
    TIntHashSet nfaStateSet) {

    // store all states to process in a stack
    final TIntStack toCheck = new TIntArrayStack();
    nfaStateSet.forEach(new TIntProcedure() {
      @Override
      public boolean execute(int value) {
        toCheck.push(value);
        return true;
      }
    });

    // loop until the stack is empty
    while (!(toCheck.size() == 0)) {
      // get top element from stack
      int currentState = toCheck.pop();
      // get all states that can be reached via epsilon transition, to
      // expand state set and update toCheck
      for (Edge<EdgeInfo> oneEdge : graph.getOutEdges(currentState)) {
        if (graph.isEpsilon(oneEdge.getInfo())) {
          int targetState =
            oneEdge.getTarget();
          if (!nfaStateSet.contains(targetState)) {
            nfaStateSet.add(targetState);
            toCheck.push(targetState);
          }
        }
      }
    }
  }
/**
   * This expands the given set of states of the non-deterministic automaton
   * with all states that can be reached via epsilon transitions.
   *
   * @param nfaStateSet
   * a <code>Set<Vertex<Integer, Character>></code>
   * with states of the non-deterministic automaton
   */
This expands the given set of states of the non-deterministic automaton
with all states that can be reached via epsilon transitions.

@param nfaStateSet
a Set>
with states of the non-deterministic automaton
This expands the given set of states of the non - deterministic automaton with all states that can be reached via epsilon transitions . @param nfaStateSet a Set > with states of the non - deterministic automaton
private static <EdgeInfo> void expandWithEpsilonClosure(
    AbstractAutomaton<EdgeInfo> graph,
    TIntHashSet nfaStateSet) {
    final TIntStack toCheck = new TIntArrayStack();
    nfaStateSet.forEach(new TIntProcedure() {
      @Override
      public boolean execute(int value) {
        toCheck.push(value);
        return true;
      }
    });
    while (!(toCheck.size() == 0)) {
      int currentState = toCheck.pop();
      for (Edge<EdgeInfo> oneEdge : graph.getOutEdges(currentState)) {
        if (graph.isEpsilon(oneEdge.getInfo())) {
          int targetState =
            oneEdge.getTarget();
          if (!nfaStateSet.contains(targetState)) {
            nfaStateSet.add(targetState);
            toCheck.push(targetState);
          }
        }
      }
    }
  }
private static < EdgeInfo > void expandWithEpsilonClosure ( AbstractAutomaton < EdgeInfo > graph , TIntHashSet nfaStateSet ) { final TIntStack toCheck = new TIntArrayStack ( ) ; nfaStateSet . forEach ( new TIntProcedure ( ) { @ Override public boolean execute ( int value ) { toCheck . push ( value ) ; return true ; } } ) ; while ( ! ( toCheck . size ( ) == 0 ) ) { int currentState = toCheck . pop ( ) ; for ( Edge < EdgeInfo > oneEdge : graph . getOutEdges ( currentState ) ) { if ( graph . isEpsilon ( oneEdge . getInfo ( ) ) ) { int targetState = oneEdge . getTarget ( ) ; if ( ! nfaStateSet . contains ( targetState ) ) { nfaStateSet . add ( targetState ) ; toCheck . push ( targetState ) ; } } } } }
This expands the given set of states of the non-deterministic automaton
 with all states that can be reached via epsilon transitions.
This expands the given set of states of the non - deterministic automaton with all states that can be reached via epsilon transitions .
// store all states to process in a stack // loop until the stack is empty // get top element from stack // get all states that can be reached via epsilon transition, to // expand state set and update toCheck