Files
PolyORB/support/gentexifile
Thomas Quinot d4d3b63591 Minor reformatting.
Subversion-branch: /trunk/polyorb
Subversion-revision: 116855
2007-10-15 09:15:29 +00:00

50 lines
935 B
Bash
Executable File

#!/bin/sh
if [ $# = 0 ]; then
echo "Usage: $0 <file to translate>"
exit 0
fi
SOURCE=$1
case ${SOURCE} in
*.idl)
SEDFILE=idl.sed;;
*.ad[bs])
SEDFILE=ada.sed;;
*.cfg)
SEDFILE=cfg.sed;;
*)
echo "Cannot translate file";
exit 1;;
esac
TARGET=${SOURCE}.texi
TMPTAR=${TARGET}.tmp
${AWK:-awk} 'BEGIN{out=1}$1=="end"&&substr($0,1,1)=="e"{out=1}out==1{print}$1=="private"&&out==1{out=0; print " -- implementation removed"}' ${SOURCE} > genout
echo "@smallexample" >${TMPTAR}
if [ $# = 1 ]; then
echo "@cartouche" >>${TMPTAR}
echo "@group" >>${TMPTAR}
fi
echo "" >>${TMPTAR}
${SED:-sed} -f ${SEDFILE} genout >>${TMPTAR}
echo "" >>${TMPTAR}
if [ $# = 1 ]; then
echo "@end group" >>${TMPTAR}
echo "@end cartouche" >>${TMPTAR}
fi
echo "@end smallexample" >>${TMPTAR}
cat ${TMPTAR} | tr -d '\r' > ${TARGET}
rm -f ${TMPTAR} genout