An algorithm for converting a regular expression into an NFA-. Aka. McNaughton-Yamada-Thompson algorithm.
Steps
- Break the regular expression into subexpressions
- Construct basic automata
- Combine them using inductive rules
Basis Automata
For , connect from the starting state to the accepting state for the input.

For , no diagrams.
Rules
Suppose and are NFA- for and respectively.
Union
For strings either or .

Concatenation
For strings .

Kleene Star
For strings .

Properties of Thompson Automata
- Exactly one start state
- Exactly one accept state
- No incoming edges to start state
- No outgoing edges from accept state
- Number of states ≤ 2 × (operators + operands)