Esempio n. 1
0
 public RepeatMatcher(Matcher <T> matcher)
 {
     this.matcher = matcher;
 }
Esempio n. 2
0
 public ChoiceMatcher(Matcher <T> matcher1, Matcher <T> matcher2)
 {
     _matcher1 = matcher1;
     _matcher2 = matcher2;
 }
Esempio n. 3
0
 /// <summary>
 /// Matcher equivalent to (m_1 ... m_n)
 /// </summary>
 public static Matcher <T> Sequence <T>(params Matcher <T>[] matchers)
 {
     return(Matcher <T> .Sequence(matchers));
 }
Esempio n. 4
0
 /// <summary>
 /// Matcher that matches an element if the provide predicate returns true.
 /// </summary>
 public static Matcher <T> Single <T>(Func <T, bool> predicate, string description)
 {
     return(Matcher <T> .Single(predicate, description));
 }
Esempio n. 5
0
 /// <summary>
 /// Matcher equivalent to (m+)
 /// </summary>
 public static Matcher <T> OneOrMore <T>(Matcher <T> matcher)
 {
     return(Matcher <T> .OneOrMore(matcher));
 }
Esempio n. 6
0
 /// <summary>
 /// Matcher equivalent to (m_1|m_2|...|m_n)
 /// </summary>
 public static Matcher <T> Choice <T>(params Matcher <T>[] matchers)
 {
     return(Matcher <T> .Choice(matchers));
 }
Esempio n. 7
0
 public RepeatMatcher(Matcher <T> matcher)
 {
     _matcher = matcher;
 }
Esempio n. 8
0
 /// <summary>
 /// Matcher equivalent to (m*)
 /// </summary>
 public static Matcher <T> Repeat <T>(Matcher <T> matcher)
 {
     return(Matcher <T> .Repeat(matcher));
 }
Esempio n. 9
0
 internal static Matcher <T> Choice(Matcher <T> matcher1, Matcher <T> matcher2)
 {
     return(new ChoiceMatcher(matcher1, matcher2));
 }
Esempio n. 10
0
 internal static Matcher <T> OneOrMore(Matcher <T> matcher)
 {
     // m+ is the same as (m m*)
     return(Sequence(matcher, Repeat(matcher)));
 }
Esempio n. 11
0
 internal static Matcher <T> Repeat(Matcher <T> matcher)
 {
     return(new RepeatMatcher(matcher));
 }
Esempio n. 12
0
 public ChoiceMatcher(Matcher <T> matcher1, Matcher <T> matcher2)
 {
     this.matcher1 = matcher1;
     this.matcher2 = matcher2;
 }
Esempio n. 13
0
 internal static Matcher <T> Repeat(Matcher <T> matcher)
 => new RepeatMatcher(matcher);