Пример #1
0
 public static Nfa MatchRange(Interval range)
 {
     State startState = new State();
     State endState = new State();
     startState.AddTransition(new MatchRangeTransition(endState, range));
     return new Nfa(startState, endState);
 }
Пример #2
0
        public static Nfa MatchRange(Interval range)
        {
            State startState = new State();
            State endState   = new State();

            startState.AddTransition(new MatchRangeTransition(endState, range));
            return(new Nfa(startState, endState));
        }
Пример #3
0
        public static Nfa Match(int symbol)
        {
            State startState = new State();
            State endState   = new State();

            startState.AddTransition(new MatchRangeTransition(endState, Interval.FromBounds(symbol, symbol)));
            return(new Nfa(startState, endState));
        }
Пример #4
0
        public static Nfa MatchAny(params int[] symbols)
        {
            State startState = new State();
            State endState   = new State();

            foreach (var symbol in symbols)
            {
                startState.AddTransition(new MatchRangeTransition(endState, Interval.FromBounds(symbol, symbol)));
            }
            return(new Nfa(startState, endState));
        }