/// <summary>Returns the multiplicity text. </summary>
        /// <returns>text</returns>
        public static string GetText(this MatchRecognizePatternElementType value)
        {
            switch (value)
            {
            case MatchRecognizePatternElementType.SINGLE:
                return("");

            case MatchRecognizePatternElementType.ZERO_TO_MANY:
                return("*");

            case MatchRecognizePatternElementType.ONE_TO_MANY:
                return("+");

            case MatchRecognizePatternElementType.ONE_OPTIONAL:
                return("?");

            case MatchRecognizePatternElementType.ZERO_TO_MANY_RELUCTANT:
                return("*?");

            case MatchRecognizePatternElementType.ONE_TO_MANY_RELUCTANT:
                return("+?");

            case MatchRecognizePatternElementType.ONE_OPTIONAL_RELUCTANT:
                return("??");
            }

            throw new ArgumentException("invalid value", "value");
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MatchRecognizeRegExNested"/> class.
 /// </summary>
 /// <param name="elementType">Type of the element.</param>
 /// <param name="optionalRepeat">The optional repeat.</param>
 public MatchRecognizeRegExNested(MatchRecognizePatternElementType elementType, MatchRecognizeRegExRepeat optionalRepeat)
 {
     ElementType    = elementType;
     OptionalRepeat = optionalRepeat;
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MatchRecognizeRegExAtom"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="type">The type.</param>
 /// <param name="optionalRepeat">The optional repeat.</param>
 public MatchRecognizeRegExAtom(String name, MatchRecognizePatternElementType type, MatchRecognizeRegExRepeat optionalRepeat)
 {
     Name           = name;
     ElementType    = type;
     OptionalRepeat = optionalRepeat;
 }
Esempio n. 4
0
 /// <summary>Ctor. </summary>
 /// <param name="type">multiplicity</param>
 public MatchRecognizeRegExNested(MatchRecognizePatternElementType type)
 {
     ElementType = type;
 }
Esempio n. 5
0
 /// <summary>Ctor. </summary>
 /// <param name="name">of variable</param>
 /// <param name="type">multiplicity</param>
 public MatchRecognizeRegExAtom(String name, MatchRecognizePatternElementType type)
 {
     Name        = name;
     ElementType = type;
 }