예제 #1
0
        public void WriteItems(ExpressionWriter writer, string op)
        {
            if (this.Expressions.Count < 1)
            {
                return;
            }

            if (this.Expressions.Count > 1)
            {
                // Only write surrounding ( if needed
                writer.Append("(");
            }

            for (int i = 0; i < this.Expressions.Count; i++)
            {
                if (i > 0)
                {
                    writer.Append(op);
                }

                writer.Append(this.Expressions[i]);
            }

            if (this.Expressions.Count > 1)
            {
                // Only write surrounding ) if needed
                writer.Append(")");
            }
        }
예제 #2
0
        public string ToExpressionString()
        {
            var writer = new ExpressionWriter();

            writer.Append(this);
            string s = writer.ToString();

            return(s);
        }
예제 #3
0
 public override void Write(ExpressionWriter writer)
 {
     writer.Append(name);
     writer.Append("(");
     for (int i = 0; i < this.items.Count; i++)
     {
         if (i > 0)
         {
             writer.Append(", ");
         }
         writer.Append(this.items[i]);
     }
     writer.Append(")");
 }
예제 #4
0
 public abstract void Write(ExpressionWriter writer);