Exemple #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);
 }
        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));
        }
        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));
        }
        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));
        }