public static string GetText(this MatchRecogizePatternElementType value)
        {
            switch (value)
            {
                case MatchRecogizePatternElementType.SINGLE:
                    return "";

                case MatchRecogizePatternElementType.ZERO_TO_MANY:
                    return "*";

                case MatchRecogizePatternElementType.ONE_TO_MANY:
                    return "+";

                case MatchRecogizePatternElementType.ONE_OPTIONAL:
                    return "?";

                case MatchRecogizePatternElementType.ZERO_TO_MANY_RELUCTANT:
                    return "*?";

                case MatchRecogizePatternElementType.ONE_TO_MANY_RELUCTANT:
                    return "+?";

                case MatchRecogizePatternElementType.ONE_OPTIONAL_RELUCTANT:
                    return "??";
            }

            throw new ArgumentException("invalid value", nameof(value));
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="type">multiplicity</param>
 /// <param name="optionalRepeat">repetition</param>
 public MatchRecognizeRegExNested(
     MatchRecogizePatternElementType type,
     MatchRecognizeRegExRepeat optionalRepeat)
 {
     this.type = type;
     this.optionalRepeat = optionalRepeat;
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="name">of variable</param>
 /// <param name="type">multiplicity</param>
 public MatchRecognizeRegExAtom(
     string name,
     MatchRecogizePatternElementType type)
 {
     this.name = name;
     this.type = type;
 }
Ejemplo n.º 4
0
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="name">of variable</param>
 /// <param name="type">multiplicity</param>
 /// <param name="optionalRepeat">repetition</param>
 public MatchRecognizeRegExAtom(
     string name,
     MatchRecogizePatternElementType type,
     MatchRecognizeRegExRepeat optionalRepeat)
 {
     this.name = name;
     this.type = type;
     this.optionalRepeat = optionalRepeat;
 }
Ejemplo n.º 5
0
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="type">multiplicity</param>
 public MatchRecognizeRegExNested(MatchRecogizePatternElementType type)
 {
     this.type = type;
 }