Ejemplo n.º 1
0
		public void VisitDoWhile(AbsynDoWhile loop)
		{
			writer.Indent();
			writer.WriteKeyword("do");
			writer.Terminate();
			WriteIndentedStatements(loop.Body, true);
			
			if (loop.Body.Count <= 1)
                writer.Indent();
			writer.WriteKeyword("while");
            writer.Write(" (");
			WriteExpression(loop.Condition);
			writer.Terminate(");");
		}
Ejemplo n.º 2
0
 public void EmitDoWhile(List<AbsynStatement> body, Expression expr)
 {
     AbsynDoWhile doWhile = new AbsynDoWhile(body, expr);
     stms.Add(doWhile);
 }
Ejemplo n.º 3
0
 public void CfDoWhile_LargeBody()
 {
     var dw = new AbsynDoWhile(new List<AbsynStatement>
         {
             new AbsynAssignment(Id("foo"), m.Int32(3)),
             new AbsynAssignment(Id("foo"), m.Int32(4))
         },
         m.Lt(Id("bar"), 0));
     dw.Accept(cf);
     var sExp =
         "\tdo" + nl +
         "\t{" + nl +
             "\t\tfoo = 0x00000003;" + nl + 
             "\t\tfoo = 0x00000004;" + nl + 
         "\t} while (bar < 0x00000000);" + nl;
     Assert.AreEqual(sExp, sw.ToString());
 }
Ejemplo n.º 4
0
 public void VisitDoWhile(AbsynDoWhile loop)
 {
     stms.Add(loop);
 }