Example #1
0
        static IDictionary <string, IList <CharRange> > _GetCharacterClasses()
        {
            var result = new Dictionary <string, IList <CharRange> >();

            result.Add("letter", new List <CharRange>(CharRange.GetRanges(CharUtility.Letter)));
            result.Add("digit", new List <CharRange>(CharRange.GetRanges(CharUtility.Digit)));
            return(result);
        }
Example #2
0
 /// <summary>
 /// Returns a <see cref="IDictionary{FA,IList{KeyValuePair{Char,Char}}}"/>, keyed by state, that contains all of the outgoing local input transitions, expressed as a series of ranges
 /// </summary>
 /// <param name="result">The <see cref="IDictionary{FA,IList{CharRange}}"/> to fill, or null to create one.</param>
 /// <returns>A <see cref="IDictionary{FA,IList{CharRange}}"/> containing the result of the query</returns>
 public IDictionary <FA <char, TAccept>, IList <CharRange> > FillInputTransitionRangesGroupedByState(IDictionary <FA <char, TAccept>, IList <CharRange> > result = null)
 {
     if (null == result)
     {
         result = new Dictionary <FA <char, TAccept>, IList <CharRange> >();
     }
     // using the optimized dictionary we have little to do here.
     foreach (var trns in (IDictionary <FA <char, TAccept>, ICollection <char> >)Transitions)
     {
         result.Add(trns.Key, new List <CharRange>(CharRange.GetRanges(trns.Value)));
     }
     return(result);
 }