Build a lex using RE, NFA and DFA