private static INfa Character(RegexCharacter character) { var start = new NfaState(); var end = new NfaState(); var terminal = new CharacterTerminal(character.Value); var transition = new TerminalNfaTransition( terminal: terminal, target: end); start.AddTransistion(transition); return new Nfa(start, end); }
private static INfa Character(RegexCharacterClassCharacter character, bool negate) { var start = new NfaState(); var end = new NfaState(); ITerminal terminal = new CharacterTerminal(character.Value); if (negate) terminal = new NegationTerminal(terminal); var transition = new TerminalNfaTransition( terminal: terminal, target: end); start.AddTransistion(transition); return new Nfa(start, end); }