private static void DecompileFunction(FunctionDefinition func, TextWriter output, string indent) { output.WriteLine(indent + func.ToString(false)); if (func.Instructions == null) { return; } output.WriteLine(indent + "{"); foreach (var local in func.Locals) { output.WriteLine(indent + " " + local); } if (func.Locals.Count > 0) { output.WriteLine(""); } var decompiler = new FunctionDecompiler(func); var statements = decompiler.DecompileStatements(); foreach (var statement in statements) { statement.Write(output, indent + " "); } output.WriteLine(indent + "}\n"); }
private static void DecompileFunction(FunctionDefinition func, TextWriter output, string indent) { output.WriteLine(indent + func.ToString(false)); if (func.Instructions == null) return; output.WriteLine(indent + "{"); foreach(var local in func.Locals) { output.WriteLine(indent + " " + local); } if (func.Locals.Count > 0) { output.WriteLine(""); } var decompiler = new FunctionDecompiler(func); var statements = decompiler.DecompileStatements(); foreach(var statement in statements) { statement.Write(output, indent + " "); } output.WriteLine(indent + "}\n"); }