File: eleminate_protocolls.awk

package info (click to toggle)
eprover 2.6%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 21,288 kB
  • sloc: ansic: 331,111; csh: 12,026; python: 10,178; awk: 5,825; makefile: 461; sh: 389
file content (38 lines) | stat: -rwxr-xr-x 668 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/opt/local/bin/gawk -f

# Usage: eliminate_protocolls.awk <input_file>
#
# Copyright 1999 Stephan Schulz, schulz@informatik.tu-muenchen.de
#
#   Read the output of find_optimal.awk and eliminate all protocol
#   lines not matching one of the hard-coded patterns.
#

BEGIN{
   wanted["3b"] = 1;
   wanted["Ba"] = 1;
   wanted["2c"] = 1;
   wanted["7c"] = 1;
   wanted["7a"] = 1;
   wanted["Cb"] = 1;
   wanted["Eb"] = 1;
#   wanted["X"] = 1;
}

/^  protokoll/{
   praekey = substr($0, 18);
   start = match(praekey, /[0-9A-Z].*:/);
   if(start)
   {
      key = substr(praekey, RSTART, RLENGTH-1);
	 if(wanted[key])
	 {
	    print;
	 }
   }
   next;
}

{
   print;
}