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; }
CodeBase GetNewBody(CodeBase body) => _references.Any() ? (body.Visit(this) ?? body) : body;
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("}}"); }
public Counter(CodeBase body) { body.Visit(this); }