Search in sources :

Example 1 with InstructionLabelProvider

use of org.candle.decompiler.instruction.graph.vertex.InstructionLabelProvider in project candle-decompiler by bradsdavis.

the class ClassIntermediateVisitor method writeGraph.

private void writeGraph(String name, InstructionGraphContext igc) {
    LOG.debug("Instruction Graph ======");
    File a = new File("/Users/bradsdavis/Projects/workspace/clzTest/" + name);
    Writer x;
    try {
        x = new FileWriter(a);
        DOTExporter<InstructionHandle, IntermediateEdge> f = new DOTExporter<InstructionHandle, IntermediateEdge>(new IntegerNameProvider<InstructionHandle>(), new InstructionLabelProvider(), new IntermediateEdgeProvider(), null, new InstructionEdgeAttributeProvider());
        f.export(x, igc.getGraph());
    } catch (IOException e) {
        e.printStackTrace();
    }
    LOG.debug("End Instruction Graph ======");
}
Also used : DOTExporter(org.jgrapht.ext.DOTExporter) InstructionLabelProvider(org.candle.decompiler.instruction.graph.vertex.InstructionLabelProvider) IntermediateEdgeProvider(org.candle.decompiler.intermediate.graph.edge.IntermediateEdgeProvider) FileWriter(java.io.FileWriter) InstructionEdgeAttributeProvider(org.candle.decompiler.instruction.graph.edge.InstructionEdgeAttributeProvider) IOException(java.io.IOException) File(java.io.File) IntermediateEdge(org.candle.decompiler.intermediate.graph.edge.IntermediateEdge) InstructionGraphWriter(org.candle.decompiler.instruction.graph.enhancer.InstructionGraphWriter) Writer(java.io.Writer) IntermediateGraphWriter(org.candle.decompiler.intermediate.graph.enhancer.IntermediateGraphWriter) FileWriter(java.io.FileWriter) InstructionHandle(org.apache.bcel.generic.InstructionHandle)

Example 2 with InstructionLabelProvider

use of org.candle.decompiler.instruction.graph.vertex.InstructionLabelProvider in project candle-decompiler by bradsdavis.

the class InstructionGraphWriter method process.

@Override
public void process() {
    if (directory == null) {
        return;
    }
    File a = new File(directory.getAbsolutePath() + File.separator + name);
    LOG.debug("Instruction Graph: " + a.getAbsolutePath());
    Writer x;
    try {
        x = new FileWriter(a);
        DOTExporter<InstructionHandle, IntermediateEdge> f = new DOTExporter<InstructionHandle, IntermediateEdge>(new IntegerNameProvider<InstructionHandle>(), new InstructionLabelProvider(), new IntermediateEdgeProvider(), null, new InstructionEdgeAttributeProvider());
        f.export(x, igc.getGraph());
    } catch (IOException e) {
        e.printStackTrace();
    }
    LOG.debug("End Instruction Graph ======");
}
Also used : DOTExporter(org.jgrapht.ext.DOTExporter) InstructionLabelProvider(org.candle.decompiler.instruction.graph.vertex.InstructionLabelProvider) IntermediateEdgeProvider(org.candle.decompiler.intermediate.graph.edge.IntermediateEdgeProvider) FileWriter(java.io.FileWriter) InstructionEdgeAttributeProvider(org.candle.decompiler.instruction.graph.edge.InstructionEdgeAttributeProvider) IOException(java.io.IOException) File(java.io.File) IntermediateEdge(org.candle.decompiler.intermediate.graph.edge.IntermediateEdge) FileWriter(java.io.FileWriter) Writer(java.io.Writer) InstructionHandle(org.apache.bcel.generic.InstructionHandle)

Aggregations

File (java.io.File)2 FileWriter (java.io.FileWriter)2 IOException (java.io.IOException)2 Writer (java.io.Writer)2 InstructionHandle (org.apache.bcel.generic.InstructionHandle)2 InstructionEdgeAttributeProvider (org.candle.decompiler.instruction.graph.edge.InstructionEdgeAttributeProvider)2 InstructionLabelProvider (org.candle.decompiler.instruction.graph.vertex.InstructionLabelProvider)2 IntermediateEdge (org.candle.decompiler.intermediate.graph.edge.IntermediateEdge)2 IntermediateEdgeProvider (org.candle.decompiler.intermediate.graph.edge.IntermediateEdgeProvider)2 DOTExporter (org.jgrapht.ext.DOTExporter)2 InstructionGraphWriter (org.candle.decompiler.instruction.graph.enhancer.InstructionGraphWriter)1 IntermediateGraphWriter (org.candle.decompiler.intermediate.graph.enhancer.IntermediateGraphWriter)1