Scanner Generator. Regular Expressions to NFA, DFA, and Lexical Analyzer


Token Specification Instructions

Specify one token definition per line, with each in the form of TokenName:regex. TokenName is the name of the thing you're recognizing. regex is a regular expression that recognizes it.

Token Specification Example

identifier:L(L|D|_)*
int:D+
float:D*.D+|D+.D*
string:"([^"]|\\")*"
comment://[^\\n]*\n
comment:/\*(\*[^/]|[^*])*\*/
whitespace:\ |\n|\t

Token Specification Input