doc-src/IsarImplementation/checkglossary
changeset 18537 2681f9e34390
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/doc-src/IsarImplementation/checkglossary	Mon Jan 02 20:16:52 2006 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +#!/usr/bin/env perl
     1.5 +# $Id$
     1.6 +
     1.7 +use strict;
     1.8 +
     1.9 +my %defs = ();
    1.10 +my %refs = ();
    1.11 +
    1.12 +while (<ARGV>) {
    1.13 +    if (m,\\glossaryentry\{\w*\\bf *((\w|\s)+)@,) {
    1.14 +	$defs{lc $1} = 1;
    1.15 +    }
    1.16 +    while (m,\\seeglossary *\{((\w|\s)+)\},g) {
    1.17 +	$refs{lc $1} = 1;
    1.18 +    }
    1.19 +}
    1.20 +
    1.21 +print "Glossary definitions:\n";
    1.22 +foreach (sort(keys(%defs))) {
    1.23 +    print "  \"$_\"\n";
    1.24 +}
    1.25 +
    1.26 +foreach (keys(%refs)) {
    1.27 +    s,s$,,;
    1.28 +    if (!defined($defs{$_})) {
    1.29 +	print "### Undefined glossary reference: \"$_\"\n";
    1.30 +    }
    1.31 +}