Example #1
0
 public virtual void ToEPL(TextWriter writer, RowRegexExprNodePrecedenceEnum parentPrecedence)
 {
     if (Precedence.GetLevel() < parentPrecedence.GetLevel())
     {
         writer.Write("(");
         ToPrecedenceFreeEPL(writer);
         writer.Write(")");
     }
     else
     {
         ToPrecedenceFreeEPL(writer);
     }
 }
Example #2
0
        /// <summary>
        /// Level.
        /// </summary>
        /// <returns>level</returns>
        public static int GetLevel(this RowRegexExprNodePrecedenceEnum value)
        {
            switch (value)
            {
            case RowRegexExprNodePrecedenceEnum.UNARY:
                return(4);

            case RowRegexExprNodePrecedenceEnum.GROUPING:
                return(3);

            case RowRegexExprNodePrecedenceEnum.CONCATENATION:
                return(2);

            case RowRegexExprNodePrecedenceEnum.ALTERNATION:
                return(1);

            case RowRegexExprNodePrecedenceEnum.MINIMUM:
                return(int.MinValue);
            }

            throw new ArgumentException();
        }