package ch.usi.inf.sp.callgraph;

import ch.usi.inf.sp.callgraph.renderer.DotGraph;
import org.objectweb.asm.Opcodes;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;


/**
 * Dump out information about the given ClassHierarchy.
 * 
 * @author maggicl@usi.ch
 * @author Matthias.Hauswirth@usi.ch
 */
public final class CallGraphRenderer {

	public void dumpDot(final ClassHierarchy hierarchy, final String fileName) throws IOException {
		final DotGraph g = new DotGraph();
		g.build(hierarchy);

		final PrintWriter pw = new PrintWriter(new FileWriter(fileName));
		pw.print(g.toDot());
		pw.close();
	}

}
