executeTransition method

DeterministicState executeTransition(
  1. String input
)

Implementation

DeterministicState executeTransition(String input) {
  if (transitions.isEmpty) throw InvalidTransitionException();

  final hasValidTransition =
      transitions.containsKey(input) || transitions.containsKey(epsilon);

  if (!hasValidTransition) throw InvalidInputException();

  return transitions[input] ?? transitions[epsilon]!;
}