Functional lexer.