예제 #1
0
 internal static string GenerateCSharpStatements(CodeBase codeBase)
 {
     var generator = new CSharpGenerator(codeBase.TemporarySize.SaveByteCount);
     try
     {
         codeBase.Visit(generator);
     }
     catch(UnexpectedContextReference e)
     {
         Tracer.AssertionFailed("", () => e.Message);
     }
     return generator.Data;
 }
예제 #2
0
 CodeBase GetNewBody(CodeBase body)
     => _references.Any() ? (body.Visit(this) ?? body) : body;
예제 #3
0
 void IVisitor.ThenElse(Size condSize, CodeBase thenCode, CodeBase elseCode)
 {
     AddCode("if({0})\n{{", PullBool(condSize.ByteCount));
     Indent();
     thenCode.Visit(this);
     Unindent();
     AddCode("}}\nelse\n{{");
     Indent();
     elseCode.Visit(this);
     Unindent();
     AddCode("}}");
 }
예제 #4
0
 public Counter(CodeBase body) { body.Visit(this); }