a jva code for converting a regular expression to an nfa