aboutsummaryrefslogtreecommitdiff
path: root/bfd/doc/scanph
blob: 4f36d684f776d9498abccb9ba38d4830f9b87738 (plain)
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
#!/bin/sh
# Script to coordinate parsing of S. Chamberlain source-embedded 
# header-file markup language. 

# '-i' option means use *proto-internal* segments, else just *proto*
SFX=p
if [ $1 = "-i" ]; then
	SFX=ip
	shift
fi

base=`echo $1 | cut -d '.' -f 1`
out=`echo $2 | cut -d '.' -f 1`

#  passes:
#	1) awk discards lines not intended for header, and marks blocks of
#	   text with comments identifying source file;
#	2) first sed pass interprets Chamberlain markup;
#	3) further sed passes clean up---merging adjacent comments etc.

awk -f awkscan-$SFX $1 |\
sed -f sedscript-p |\
sed -f mergecom-p |\
sed -f startcom-p  |\
sed -f blins-p |\
sed -f movecom-p  >$out.$SFX