extendedTransition method
Implementation
@override
Set<NonDeterministicState> extendedTransition(
NonDeterministicState state,
String input,
) {
if (input.isEmpty) return {state};
final possibleNextStates = state.executeTransition(input[0]);
if (possibleNextStates.isEmpty) return {};
return possibleNextStates
.map(
(nextState) => epsilonClosure(nextState)
.map(
(closureState) => extendedTransition(
closureState,
input.substring(1),
),
)
.reduce((a, b) => {...a, ...b}),
)
.reduce((a, b) => {...a, ...b});
}