Entity XML inheritance graph generator. (Basically just Graphviz.)

This was SVN commit r2091.
This commit is contained in:
Ykkrosh 2005-03-30 18:03:47 +00:00
parent bb7a22f32a
commit 31fb8c37c4
7 changed files with 38 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,38 @@
use strict;
use warnings;
use File::Find;
use Graph;
use Graph::Writer::Dot;
my $dir = '../../../binaries/data/mods/official/entities';
my @xml;
find({wanted=>sub{
push @xml, $_ if /\.xml$/;
}, no_chdir=>1}, $dir);
s~\Q$dir/~~ for @xml;
my $graph = new Graph;
for my $f (@xml) {
my $parent;
open I, "$dir/$f" or die "error opening $dir/$f: $!";
while (<I>) {
$parent = $1 if /Parent="(.*?)"/;
}
close I;
$f =~ m~(?:.*/|^)(.*)\.xml~ or die "invalid filename $f";
my $name = $1;
if (defined $parent) {
$graph->add_edge($parent, $name);
} else {
$graph->add_vertex($name);
}
}
Graph::Writer::Dot->new()->write_graph($graph, "entities.dot");
system("dot.exe", "-Tpng", "entities.dot", "-o", "entities.png");

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
source/tools/entgraph/z.dll Normal file

Binary file not shown.