epsilonClosure method

  1. @override
Set<NonDeterministicState> epsilonClosure(
  1. NonDeterministicState state
)
override

Implementation

@override
Set<NonDeterministicState> epsilonClosure(NonDeterministicState state) {
  final possibleNextStates = state.executeTransition(epsilon);
  if (possibleNextStates.isEmpty) return {state};
  return {
    state,
    ...possibleNextStates.map(epsilonClosure).reduce((a, b) => {...a, ...b}),
  };
}