Search in sources :

Example 1 with IntermediateEdgeProvider

use of org.candle.decompiler.intermediate.graph.edge.IntermediateEdgeProvider in project candle-decompiler by bradsdavis.

the class IntermediateGraphWriter 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<AbstractIntermediate, IntermediateEdge> dot = new DOTExporter<AbstractIntermediate, IntermediateEdge>(new IntegerNameProvider<AbstractIntermediate>(), new IntermediateLabelProvider(), new IntermediateEdgeProvider(), new IntermediateVertexAttributeProvider(), new InstructionEdgeAttributeProvider());
        dot.export(x, igc.getGraph());
    } catch (IOException e) {
        e.printStackTrace();
    }
    LOG.debug("End Instruction Graph ======");
}
Also used : AbstractIntermediate(org.candle.decompiler.intermediate.code.AbstractIntermediate) DOTExporter(org.jgrapht.ext.DOTExporter) IntermediateEdgeProvider(org.candle.decompiler.intermediate.graph.edge.IntermediateEdgeProvider) FileWriter(java.io.FileWriter) IOException(java.io.IOException) IntermediateEdge(org.candle.decompiler.intermediate.graph.edge.IntermediateEdge) IntermediateVertexAttributeProvider(org.candle.decompiler.intermediate.graph.IntermediateVertexAttributeProvider) IntermediateLabelProvider(org.candle.decompiler.intermediate.graph.IntermediateLabelProvider) InstructionEdgeAttributeProvider(org.candle.decompiler.instruction.graph.edge.InstructionEdgeAttributeProvider) File(java.io.File) FileWriter(java.io.FileWriter) Writer(java.io.Writer)

Example 2 with IntermediateEdgeProvider

use of org.candle.decompiler.intermediate.graph.edge.IntermediateEdgeProvider 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 3 with IntermediateEdgeProvider

use of org.candle.decompiler.intermediate.graph.edge.IntermediateEdgeProvider 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)3 FileWriter (java.io.FileWriter)3 IOException (java.io.IOException)3 Writer (java.io.Writer)3 InstructionEdgeAttributeProvider (org.candle.decompiler.instruction.graph.edge.InstructionEdgeAttributeProvider)3 IntermediateEdge (org.candle.decompiler.intermediate.graph.edge.IntermediateEdge)3 IntermediateEdgeProvider (org.candle.decompiler.intermediate.graph.edge.IntermediateEdgeProvider)3 DOTExporter (org.jgrapht.ext.DOTExporter)3 InstructionHandle (org.apache.bcel.generic.InstructionHandle)2 InstructionLabelProvider (org.candle.decompiler.instruction.graph.vertex.InstructionLabelProvider)2 InstructionGraphWriter (org.candle.decompiler.instruction.graph.enhancer.InstructionGraphWriter)1 AbstractIntermediate (org.candle.decompiler.intermediate.code.AbstractIntermediate)1 IntermediateLabelProvider (org.candle.decompiler.intermediate.graph.IntermediateLabelProvider)1 IntermediateVertexAttributeProvider (org.candle.decompiler.intermediate.graph.IntermediateVertexAttributeProvider)1 IntermediateGraphWriter (org.candle.decompiler.intermediate.graph.enhancer.IntermediateGraphWriter)1