Converting regular expressions to DFA. First attempt