doc-src/IsarImplementation/checkglossary
author wenzelm
Wed, 11 Oct 2006 00:27:38 +0200
changeset 20963 a7fd8f05a2be
parent 18537 2681f9e34390
permissions -rwxr-xr-x
added type global_theory -- theory or local_theory; added begin/exit_local_theory; removed theory_context; renamed body_context_node to presentation_context; removed copy (checkpoint twice instead -- avoids unrelated theories);

#!/usr/bin/env perl
# $Id$

use strict;

my %defs = ();
my %refs = ();

while (<ARGV>) {
    if (m,\\glossaryentry\{\w*\\bf *((\w|\s)+)@,) {
	$defs{lc $1} = 1;
    }
    while (m,\\seeglossary *\{((\w|\s)+)\},g) {
	$refs{lc $1} = 1;
    }
}

print "Glossary definitions:\n";
foreach (sort(keys(%defs))) {
    print "  \"$_\"\n";
}

foreach (keys(%refs)) {
    s,s$,,;
    if (!defined($defs{$_})) {
	print "### Undefined glossary reference: \"$_\"\n";
    }
}