Пример #1
0
 public override void WriteTo(ITextOutput output, MemberMapping memberMapping)
 {
     output.Write(".try", TextTokenKind.Keyword);
     output.WriteSpace();
     TryBlock.WriteTo(output, memberMapping, ILRanges);
     foreach (CatchBlock block in CatchBlocks)
     {
         block.WriteTo(output, memberMapping);
     }
     if (FaultBlock != null)
     {
         output.Write("fault", TextTokenKind.Keyword);
         output.WriteSpace();
         FaultBlock.WriteTo(output, memberMapping);
     }
     if (FinallyBlock != null)
     {
         output.Write("finally", TextTokenKind.Keyword);
         output.WriteSpace();
         FinallyBlock.WriteTo(output, memberMapping);
     }
     if (FilterBlock != null)
     {
         output.Write("filter", TextTokenKind.Keyword);
         output.WriteSpace();
         FilterBlock.WriteTo(output, memberMapping);
     }
 }
Пример #2
0
 public override void WriteTo(ITextOutput output)
 {
     output.WriteLine(".try {");
     output.Indent();
     TryBlock.WriteTo(output);
     output.Unindent();
     output.WriteLine("}");
     foreach (CatchBlock block in CatchBlocks)
     {
         block.WriteTo(output);
     }
     if (FaultBlock != null)
     {
         output.WriteLine("fault {");
         output.Indent();
         FaultBlock.WriteTo(output);
         output.Unindent();
         output.WriteLine("}");
     }
     if (FinallyBlock != null)
     {
         output.WriteLine("finally {");
         output.Indent();
         FinallyBlock.WriteTo(output);
         output.Unindent();
         output.WriteLine("}");
     }
 }
Пример #3
0
 public override void WriteTo(ITextOutput output)
 {
     output.WriteLine("");
     output.Write("loop (");
     if (Condition != null)
     {
         Condition.WriteTo(output);
     }
     output.WriteLine(") {");
     output.Indent();
     BodyBlock.WriteTo(output);
     output.Unindent();
     output.WriteLine("}");
 }
Пример #4
0
 public override void WriteTo(ITextOutput output)
 {
     output.Write("fixed (");
     for (int i = 0; i < Initializers.Count; i++)
     {
         if (i > 0)
         {
             output.Write(", ");
         }
         Initializers[i].WriteTo(output);
     }
     output.WriteLine(") {");
     output.Indent();
     BodyBlock.WriteTo(output);
     output.Unindent();
     output.WriteLine("}");
 }
Пример #5
0
 public override void WriteTo(ITextOutput output)
 {
     output.Write("if (");
     Condition.WriteTo(output);
     output.WriteLine(") {");
     output.Indent();
     TrueBlock.WriteTo(output);
     output.Unindent();
     output.Write("}");
     if (FalseBlock != null)
     {
         output.WriteLine(" else {");
         output.Indent();
         FalseBlock.WriteTo(output);
         output.Unindent();
         output.WriteLine("}");
     }
 }
Пример #6
0
        public override void WriteTo(ITextOutput output, MemberMapping memberMapping)
        {
            var startLoc = output.Location;

            output.Write("if", TextTokenKind.Keyword);
            output.WriteSpace();
            output.Write("(", TextTokenKind.Operator);
            Condition.WriteTo(output, null);
            output.Write(")", TextTokenKind.Operator);
            var ilRanges = new List <ILRange>(ILRanges);

            ilRanges.AddRange(Condition.GetSelfAndChildrenRecursiveILRanges());
            UpdateMemberMapping(memberMapping, startLoc, output.Location, ilRanges);
            output.WriteSpace();
            TrueBlock.WriteTo(output, memberMapping);
            if (FalseBlock != null)
            {
                output.Write("else", TextTokenKind.Keyword);
                output.WriteSpace();
                FalseBlock.WriteTo(output, memberMapping);
            }
        }