String Parsing: Finite State Machine

This example parses a string and checks whether it is a valid identifier. The algorithm uses states, transitions, a start state, and accepting states as described in the slides.

Sample Input

Rule: an identifier must start with a letter or underscore. Later characters may be letters, digits, or underscores.

Current State

Step Explanation

Input Scan