Search in sources :

Example 1 with EdgeAttributes

use of com.dat3m.dartagnan.witness.EdgeAttributes in project Dat3M by hernanponcedeleon.

the class WitnessGraph method write.

public void write() {
    try (FileWriter fw = new FileWriter(String.format("%s/output/%s.graphml", System.getenv("DAT3M_HOME"), Files.getNameWithoutExtension(getProgram())))) {
        fw.write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
        fw.write("<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n");
        for (GraphAttributes attr : GraphAttributes.values()) {
            fw.write("<key attr.name=\"" + attr.toString() + "\" attr.type=\"string\" for=\"graph\" id=\"" + attr + "\"/>\n");
        }
        for (NodeAttributes attr : NodeAttributes.values()) {
            fw.write("<key attr.name=\"" + attr.toString() + "\" attr.type=\"boolean\" for=\"node\" id=\"" + attr + "\"/>\n");
        }
        for (EdgeAttributes attr : EdgeAttributes.values()) {
            fw.write("<key attr.name=\"" + attr.toString() + "\" attr.type=\"string\" for=\"edge\" id=\"" + attr + "\"/>\n");
        }
        fw.write(toXML());
        fw.write("</graphml>\n");
    } catch (IOException e1) {
        e1.printStackTrace();
    }
}
Also used : FileWriter(java.io.FileWriter) IOException(java.io.IOException) EdgeAttributes(com.dat3m.dartagnan.witness.EdgeAttributes)

Aggregations

EdgeAttributes (com.dat3m.dartagnan.witness.EdgeAttributes)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1