chiark / gitweb /
wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 28 Feb 2019 02:22:58 +0000 (02:22 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 28 Feb 2019 02:22:58 +0000 (02:22 +0000)
generate-board [new file with mode: 0755]

diff --git a/generate-board b/generate-board
new file mode 100755 (executable)
index 0000000..8f40dfb
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Carp;
+
+BEGIN { unshift @INC, qw(.); }
+
+use Parse;
+
+our ($plagf) = @ARGV or die;
+
+parse_input_graph();
+
+our %prs2region;
+our %v2pos;
+
+foreach my $rn (keys %region) {
+  my $prs = plag_prs($rn);
+  die if $prs2region{$prs};
+  $prs2region{$prs} = $rn;
+}
+
+my $sre = qr{(\")(.*)\1$}; # 2 captures, $2 is the name
+
+open P, "<", $plagf or die $!;
+while (<P>) {
+  if (m/^$sre#/) {
+    my $invertex= $2;
+  } elsif (m/^ \@(.*),(.*)$/) {
+    die unless $invertex;
+    $v2pos{$invertex} = [ $1,$2 ];
+  } elsif (m/^ \^lface $sre$/) {
+    die unless $invertex;
+    
+
+# Local variables:
+# cperl-indent-level: 2
+# End.