private void button3_Click(object sender, EventArgs e)
 {
     this.PerformAction(() =>
     {
         this.automata = this.automata.ToDfa();
         this.DrawAutomata();
         AutomataFileWriter.WriteToFile(this.automata, "DFAConverted");
     });
 }
 private void parseRegExBtn_Click(object sender, EventArgs e)
 {
     this.PerformAction(() =>
     {
         var regex = this.regexTb.Text;
         if (string.IsNullOrEmpty(regex) || string.IsNullOrWhiteSpace(regex))
         {
             throw new Exception("Expresson cannot be empty");
         }
         this.automata = RegExParser.RegExParser.GenerateAutomataForRegex(regex);
         this.DrawAutomata();
         AutomataFileWriter.WriteToFile(this.automata, "RegExpGenerated");
     });
 }