Overview
Thompson's construction recursively turns literals, concatenation, alternation, and repetition into NFA fragments with clear entry and exit states.
Compiles a regular expression into an epsilon-NFA using small pattern fragments.
Compact metadata for implementation and discovery.
Thompson's construction recursively turns literals, concatenation, alternation, and repetition into NFA fragments with clear entry and exit states.
Quick facts
Runtime and memory behavior at a glance.
Best
O(regex length)
Average
O(regex length)
Worst
O(regex length)
Space
O(regex length)
Show grammar items, parser states, and consumed input as parsing progresses.
Thompson's Construction should be used with the assumptions and tradeoffs of regex Compilation in mind.
What each reference supports for this entry.
Original reference for compiling regular expressions into automata fragments.
Open sourceAutomata textbook support for Thompson's Construction's state-machine construction, language recognition, and correctness model.
Good next jumps from the relationship graph, ranked for useful discovery.
Thompson construction produces an NFA that can then be determinized into a DFA.