예제 #1
0
 static System.Text.StringBuilder toString(System.Text.StringBuilder buf, char[] chars)
 {
     buf.Append('[');
     if (chars.Length > 0)
     {
         buf.Append(CharEncoder.Encode(chars[0]));
         for (int i = 1; i < chars.Length; i++)
         {
             buf.Append(',').Append(CharEncoder.Encode(chars[i]));
         }
     }
     buf.Append(']');
     return(buf);
 }
예제 #2
0
 /// <summary> succeed and consume the current character if it is not equal to ch.</summary>
 /// <param name="ch">the expected character.
 /// </param>
 /// <returns> the scanner.
 /// </returns>
 public static Scanner NotChar(char ch)
 {
     return(NotChar(ch, "^" + CharEncoder.Encode(ch)));
 }
예제 #3
0
 /// <summary> succeed and consume the current character if it is equal to ch.</summary>
 /// <param name="ch">the expected character.
 /// </param>
 /// <returns> the scanner.
 /// </returns>
 public static Scanner IsChar(char ch)
 {
     return(IsChar(ch, CharEncoder.Encode(ch)));
 }