File: filtertree

package info (click to toggle)
vrwave 0.9-4
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 5,032 kB
  • ctags: 7,153
  • sloc: java: 15,050; ansic: 8,219; sh: 458; makefile: 181
file content (47 lines) | stat: -rwxr-xr-x 910 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
46
47
#!/bin/sh

# filtertree - filter out java.-classes/interfaces
# from which no class is derived
#
# created: mpichler, 19970131
# changed: mpichler, 19970925
#
# $Id: filtertree,v 1.3 1997/09/25 18:27:49 mpichler Exp $

if [ ! -f tree_orig.html ]
then
  echo "tree_orig.html not found"
  exit 1
fi

# filtering for both iicm and vrml did not work
# no idea why (even for vrml alone did not work)
# missing vrml.exception classes this way

awk '
BEGIN { pr=1; level=0 }
/<li>/ { if (!level) { pr=1; buf="" } }
/java\./ { pr=0 }
{
  if (pr)
    print
  else if ($0 ~ /iicm\./)
  { print buf $0
    level=0; pr=1; buf=""
  }
#  else if ($0 ~ /vrml\./)
#  { print buf $0
#    level=0; pr=1; buf=""
#  }
  else
    buf = buf $0 "\n"
}
/<ul>/ { if (!pr) level++ }
/<\/ul>/ {
  if (!pr)
    if (!--level) { pr=1; buf="" }
    else if (level < 0)
    { print; level=0; pr=1; buf=""
    }
}
' tree_orig.html > tree.html