public INfa Kleene() { var newStart = new NfaState(); var newEnd = new NfaState(); newStart.AddTransistion(new NullNfaTransition(Start)); newStart.AddTransistion(new NullNfaTransition(newEnd)); newEnd.AddTransistion(new NullNfaTransition(Start)); End.AddTransistion(new NullNfaTransition(newEnd)); return(new Nfa(newStart, newEnd)); }
public INfa Union(INfa nfa) { var newStart = new NfaState(); var newEnd = new NfaState(); newStart.AddTransistion(new NullNfaTransition(Start)); newStart.AddTransistion(new NullNfaTransition(nfa.Start)); End.AddTransistion(new NullNfaTransition(newEnd)); nfa.End.AddTransistion(new NullNfaTransition(newEnd)); return(new Nfa(newStart, newEnd)); }
public INfa Concatenation(INfa nfa) { End.AddTransistion( new NullNfaTransition(nfa.Start)); return(this); }