Commit | Line | Data |
---|---|---|
3dc81fba | 1 | #!/usr/bin/awk -f |
eff08ab6 GB |
2 | # Written by Greg J. Badros, <gjb@cs.washington.edu> |
3 | # 12-Dec-1999 | |
4 | ||
3dc81fba GB |
5 | BEGIN { FS="|"; |
6 | filename = ARGV[1]; ARGV[1] = ""; | |
7 | dot_x_file = filename; dot_doc_file = filename; | |
8 | sub(/\..*$/,".x",dot_x_file); | |
9 | sub(/\..*$/,".doc",dot_doc_file); | |
eff08ab6 GB |
10 | # be sure to put something in the files to help make out |
11 | printf "" > dot_x_file; | |
12 | printf "" > dot_doc_file; | |
3dc81fba GB |
13 | } |
14 | ||
eff08ab6 GB |
15 | /^[ \t]*%%%/ { copy = $0; |
16 | gsub(/[ \t]*%%%/, "", copy); | |
17 | gsub(/\$\$\$.*$/, "", copy); | |
18 | print copy > dot_x_file } | |
3dc81fba GB |
19 | |
20 | /\$\$\$/,/@@@/ { copy = $0; | |
eff08ab6 GB |
21 | if (match(copy,/\$\$\$R/)) { registering = 1; } |
22 | else {registering = 0; } | |
3dc81fba GB |
23 | gsub(/.*\$\$\$./,"", copy); |
24 | gsub(/@@@.*/,"",copy); | |
25 | gsub(/[ \t]+/," ", copy); | |
26 | sub(/^[ \t]*/,"(", copy); | |
3dc81fba GB |
27 | gsub(/\"/,"",copy); |
28 | sub(/ \(/," ",copy); | |
29 | numargs = gsub(/SCM /,"", copy); | |
30 | numcommas = gsub(/,/,"", copy); | |
31 | numactuals = $2 + $3 + $4; | |
32 | location = $5; | |
33 | gsub(/\"/,"",location); | |
eff08ab6 GB |
34 | sub(/^[ \t]*/,"",location); |
35 | sub(/[ \t]*$/,"",location); | |
36 | sub(/: /,":",location); | |
3dc81fba | 37 | gsub(/[ \t]*\|.*$/,"",copy); |
4079f87e | 38 | sub(/ )/,")",copy); |
eff08ab6 GB |
39 | if (numargs != numactuals && !registering) |
40 | { print location ":*** `" copy "' is improperly registered as having " numactuals " arguments"; } | |
41 | print "\f\n" copy (registering?")":"") > dot_doc_file ; } | |
3dc81fba | 42 | |
eff08ab6 | 43 | /@@@/,/@!!!.*$/ { copy = $0; |
3dc81fba | 44 | gsub(/.*@@@/,"",copy); |
eff08ab6 GB |
45 | gsub(/^[ \t]*"?/,"", copy); |
46 | gsub(/\"?[ \t]*@!!!.*$/,"", copy); | |
3dc81fba | 47 | gsub(/\\\"/,"\"",copy); |
eff08ab6 GB |
48 | gsub(/[ \t]*$/,"", copy); |
49 | if (copy != "") { print copy > dot_doc_file } } | |
50 | /@!!![ \t]/ { print "\ 1[" location "]" >> dot_doc_file; } | |
3dc81fba | 51 |