Skip to content

Commit

Permalink
Merge pull request #3 from Tony0380/fix
Browse files Browse the repository at this point in the history
chore: Fix null start state check in DFA class
  • Loading branch information
Tony0380 committed Jun 10, 2024
2 parents 41cd353 + ec65223 commit bb1f1da
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public void setStartState(State startState) {
*/
public boolean accepts(String input) {
if (startState == null || Transictions.isEmpty() || States.isEmpty()) {
if (startState == null) {
System.out.println("Start state is not set");
}
return false;
}
State currentState = startState;
Expand Down

0 comments on commit bb1f1da

Please sign in to comment.