Start state
Accepting state
Current position
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.
Every compiler front end starts the same way: a lexer turns raw source text into tokens using regular expressions compiled down to a single deterministic finite automaton. This simulator makes that compilation visible. Pick a regular expression (or type your own using literals, |, *, +, ? and grouping), and watch it become a nondeterministic automaton via Thompson's construction, then get determinized into a DFA via subset construction — rendered as a live 3D state graph. Type a test string and step or run it through the DFA to see exactly which state the scanner is in after each character, and whether the string is accepted, exactly the mechanism inside every lex/flex-generated tokenizer.