Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
        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");
        }