#!/bin/gawk -f # # This is a gawk script for extracting a dot-format specification of a # poset from an output file produced by one of the atlas commands # kgborder, corder, or blockorder. # # Edit the first line above in case you have awk and not gawk, # or the path is wrong. # # For more information about dot, see # http://www.graphviz.org/pub/scm/graphviz2/pdf/dotguide.pdf # # Syntax: # exposet # # Example: # exposet myfile > poset.dot # dot -Tps poset.dot > poset.eps # BEGIN { printf "digraph \"%s\" {\n", ARGV[1] printf "node [color=black,fontcolor=black];\n" printf "edge [arrowhead=none,color=red];\n" } /[0-9]+:/ { n=split($0,L,":"); printf "%d [label=\"%d\"];",L[1],L[1] if ( match(L[2],"[0-9]") ) { n=split(L[2],entries,","); i=0 while ( i < n ) { i++; printf " %d -> %d;",L[1],entries[i] } } printf "\n" } END { printf "}\n" }