1#!/sw/bin/gawk -f
2
3# Usage: generate_heuristic.awk <file>
4#
5#   Given a protokoll file name, generate an entry for the
6#   heuristics-string from it.
7#
8# Copyright 1999 Stephan Schulz, schulz@informatik.tu-muenchen.de
9
10
11/\-H/{
12   pos = index($0, "-H'(");
13   part = substr($0, pos+3);
14   pos = index(part, "'");
15   part = substr(part, 1, pos-1);
16   gsub(" ,", ",", part);
17   gsub(", ", ",", part);
18   gsub("),", "),\\n\"\n\"            ", part);
19   pos = index(FILENAME, "_");
20   name = substr(FILENAME, pos+1);
21   print "\"" gensub(/-/, "_", "g", name) " = " part "\\n\"";
22}
23