Ejemplo n.º 1
0
        public override void ToPrecedenceFreeEPL(
            TextWriter writer,
            EPStatementFormatter formatter)
        {
            if (Single != null)
            {
                writer.Write("[");
                Single.ToEPL(writer, ExpressionPrecedenceEnum.MINIMUM);
                writer.Write("]");
            }
            else
            {
                if (Low != null || High != null)
                {
                    writer.Write("[");
                    if ((Low != null) && (High != null))
                    {
                        Low.ToEPL(writer, ExpressionPrecedenceEnum.MINIMUM);
                        writer.Write(":");
                        High.ToEPL(writer, ExpressionPrecedenceEnum.MINIMUM);
                    }
                    else if (Low != null)
                    {
                        Low.ToEPL(writer, ExpressionPrecedenceEnum.MINIMUM);
                        writer.Write(":");
                    }
                    else
                    {
                        writer.Write(":");
                        High.ToEPL(writer, ExpressionPrecedenceEnum.MINIMUM);
                    }

                    writer.Write("] ");
                }
            }

            PatternExprPrecedenceEnum precedence = Precedence;

            if (Children[0] is PatternMatchUntilExpr)
            {
                precedence = PatternExprPrecedenceEnum.MAXIMIM;
            }

            Children[0].ToEPL(writer, precedence, formatter);

            if (Children.Count > 1)
            {
                writer.Write(" until ");
                Children[1].ToEPL(writer, Precedence, formatter);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// RenderAny as epl.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public void WriteEPL(TextWriter writer)
        {
            writer.Write("{");
            if (Single != null)
            {
                Single.ToEPL(writer, ExpressionPrecedenceEnum.MINIMUM);
            }
            else
            {
                Low?.ToEPL(writer, ExpressionPrecedenceEnum.MINIMUM);

                writer.Write(",");
                High?.ToEPL(writer, ExpressionPrecedenceEnum.MINIMUM);
            }

            writer.Write("}");
        }