Esempio n. 1
0
        public void Append(CSTWriter w)
        {
            w.Append('[');
            Type.Append(w);
            w.Append('(');
            var first = true;

            foreach (var o in PositionalProperties)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    w.Append(',');
                }
                w.AppendQuotedObject(o);
            }
            foreach (var kv in NamedProperties)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    w.Append(',');
                }
                w.Append(kv.Key);
                w.Append('=');
                w.AppendQuotedObject(kv.Value);
            }
            w.Append(")]");
        }
Esempio n. 2
0
 public override void Append(CSTWriter w)
 {
     w.Append("CATCH ");
     w.Append("(* ");
     Type.Append(w);
     w.Append(" *) B");
     w.Append(Body.Id);
 }
Esempio n. 3
0
 public override void Append(CSTWriter w)
 {
     w.Append("box(");
     Box.Append(w, 0);
     w.Append(':');
     ValueType.Append(w);
     w.Append(')');
 }
Esempio n. 4
0
 public void Append(CSTWriter w)
 {
     Type.Append(w);
     if (UpperBound != null)
     {
         w.Append("<:");
         UpperBound.Append(w);
     }
 }
Esempio n. 5
0
 public override void AppendDefinition(CSTWriter w)
 {
     base.AppendDefinition(w);
     w.Append(':');
     FieldType.Append(w);
     if (Init != null)
     {
         w.Append('=');
         Init.Append(w);
     }
 }
Esempio n. 6
0
        public override void Append(CSTWriter w, IImSeq <TypeRef> methodTypeArguments)
        {
            if (methodTypeArguments != null)
            {
                throw new InvalidOperationException("signature does not accept type arguments");
            }

            w.Append("field ");
            w.AppendName(Name);
            w.Append(':');
            FieldType.Append(w);
        }
Esempio n. 7
0
 public override void Append(CSTWriter w, IImSeq <TypeRef> methodTypeArguments)
 {
     w.Append("method ");
     w.Append(IsStatic ? "static " : "instance ");
     w.AppendName(Name);
     if (methodTypeArguments != null)
     {
         if (methodTypeArguments.Count > 0)
         {
             w.Append('<');
             for (var i = 0; i < methodTypeArguments.Count; i++)
             {
                 if (i > 0)
                 {
                     w.Append(',');
                 }
                 methodTypeArguments[i].Append(w);
             }
             w.Append('>');
         }
     }
     else
     {
         if (TypeArity > 0)
         {
             w.Append("<[");
             w.Append(TypeArity);
             w.Append("]>");
         }
     }
     w.Append('(');
     for (var i = 0; i < Parameters.Count; i++)
     {
         if (i > 0)
         {
             w.Append(',');
         }
         Parameters[i].Append(w);
     }
     w.Append(')');
     if (Result != null)
     {
         w.Append(':');
         Result.Append(w);
     }
 }
Esempio n. 8
0
 public override void AppendDefinition(CSTWriter w)
 {
     base.AppendDefinition(w);
     w.Append(':');
     FieldType.Append(w);
     w.Append(" {");
     if (Get != null)
     {
         w.Append(" get { ");
         Get.Append(w);
         w.Append(" }");
     }
     if (Set != null)
     {
         w.Append(" set { ");
         Set.Append(w);
         w.Append(" }");
     }
     w.Append(" }");
 }
Esempio n. 9
0
 public override void AppendDefinition(CSTWriter w)
 {
     base.AppendDefinition(w);
     w.Append(':');
     HandlerType.Append(w);
     w.Append(" {");
     if (Add != null)
     {
         w.Append(" add { ");
         Add.Append(w);
         w.Append(" }");
     }
     if (Remove != null)
     {
         w.Append(" remove {");
         Remove.Append(w);
         w.Append(" }");
     }
     w.Append(" }");
 }
Esempio n. 10
0
        public override void Append(CSTWriter w, IImSeq <TypeRef> methodTypeArguments)
        {
            if (methodTypeArguments != null)
            {
                throw new InvalidOperationException("signature does not accept type arguments");
            }

            w.Append("property ");
            w.Append(IsStatic ? "static " : "instance ");
            w.AppendName(Name);
            w.Append('(');
            for (var i = 0; i < Parameters.Count; i++)
            {
                if (i > 0)
                {
                    w.Append(',');
                }
                Parameters[i].Append(w);
            }
            w.Append(')');
            w.Append(':');
            Result.Append(w);
        }
Esempio n. 11
0
        //
        // Pretty printing
        //

        public virtual void Append(CSTWriter w)
        {
            DefiningType.Append(w);
            w.Append("::");
            Signature.Append(w);
        }
Esempio n. 12
0
 public void Append(CSTWriter w)
 {
     Type.Append(w);
 }
Esempio n. 13
0
        public void Append(CSTWriter w)
        {
            switch (Op)
            {
            case TestOp.True:
                w.Append("true");
                break;

            case TestOp.False:
                w.Append("false");
                break;

            case TestOp.LessThanOrEqual:
                w.Append("le");
                break;

            case TestOp.LessThan:
                w.Append("lt");
                break;

            case TestOp.GreaterThanOrEqual:
                w.Append("ge");
                break;

            case TestOp.GreaterThan:
                w.Append("gt");
                break;

            case TestOp.Equal:
                w.Append("eq");
                break;

            case TestOp.NotEqual:
                w.Append("ne");
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            switch (Op)
            {
            case TestOp.True:
            case TestOp.False:
            case TestOp.Equal:
            case TestOp.NotEqual:
                if (IsUnsigned)
                {
                    throw new InvalidOperationException("no such condition test");
                }
                break;

            case TestOp.LessThanOrEqual:
            case TestOp.LessThan:
            case TestOp.GreaterThanOrEqual:
            case TestOp.GreaterThan:
                if (IsUnsigned)
                {
                    w.Append(".un");
                }
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            w.Append(" (* ");
            Type.Append(w);
            w.Append(" *)");
        }
Esempio n. 14
0
 public void Append(CSTWriter w)
 {
     w.AppendName(Id.Value);
     w.Append(':');
     Type.Append(w);
 }