diff options
author | Steve Chamberlain <steve@cygnus> | 1991-08-22 19:56:14 +0000 |
---|---|---|
committer | Steve Chamberlain <steve@cygnus> | 1991-08-22 19:56:14 +0000 |
commit | 80d29884b8b36ca12dcae2bd744d74ba7c749e42 (patch) | |
tree | 50d1eb2b5b6d0cd0fb7e2861dc8c00d255801733 /bfd/doc/sedscript-p | |
parent | d51d16c8e6bc078ac493ea6853093724163f169f (diff) | |
download | gdb-80d29884b8b36ca12dcae2bd744d74ba7c749e42.zip gdb-80d29884b8b36ca12dcae2bd744d74ba7c749e42.tar.gz gdb-80d29884b8b36ca12dcae2bd744d74ba7c749e42.tar.bz2 |
Initial revision
Diffstat (limited to 'bfd/doc/sedscript-p')
-rwxr-xr-x | bfd/doc/sedscript-p | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/bfd/doc/sedscript-p b/bfd/doc/sedscript-p new file mode 100755 index 0000000..1f24900 --- /dev/null +++ b/bfd/doc/sedscript-p @@ -0,0 +1,63 @@ +# SED script for preprocessing embedded headers from source +# (S. Chamberlain markup) +# middle pass; most of the work is done here. +# +# First, get rid of /*proto* markers; they've done their job in the first pass. +# (They remain comment-introducers) +/^\/\*proto\*/s/^\/\*proto\*/\/*/ +/^\/\*proto-internal\*/s/^\/\*proto-internal\*/\/*/ +# +# *-*/ is an alternative (older) comment-block end. Remap for uniformity: +s/^\*-\*\//\*\// +# +# {* and *} are standins for comment markers (originally embedded in .c +# comments)---turn into real comment markers: +s/{\*/\/\*/ +s/\*}/\*\// +# +# '*+++' and '*---' span a block of text that includes both header lines +# (marked by leading '$') and explanatory text (to be comments). +# No need to start comment at "*+++", or end it at "*---", since we're +# already in a *proto* comment block. Just delete. +/\*\+\+\+/d +/\*---/d +# +# Any line beginning with '$' is made a line of code in the header; +# stuff in between is comments, so *precede* each '$' line with +# END-comment, *follow* each '$' line with START-comment; third pass later +# eliminates empty comment blocks. +/^\$/i\ +*/ +/^\$/a\ +/* +# +# Now delete the '$' markers themselves: +/^\$/s/\$// +# +# *+ and *- delimit larger blocks of code, treated the same as '$' lines +/^\*\+$/c\ +*/ +/^\*-$/c\ +/* +# +# '*;' introduces code which may have a single line or multiple lines; +# it extends until the next semicolon (which is also printed). +# +# One-line case: (do this first; else second line address for multi-line case +# will include random text til we happen to end a line in a proto comment with +# a semicolon) +/^\*;.*;$/{ +s/^\*;/*\/\ +/ +s/;$/;\ +\/*\ +/ +} +# Multi-line case: +/^\*;/,/.*;$/{ +s/^\*;/*\/\ +/ +s/;$/;\ +\/*\ +/ +} |