Files
mercury/scripts/sicstus_conv.sh
Fergus Henderson 5df40b0d26 Add copyright notices.
scripts/*:
	Add copyright notices.
1995-03-28 15:35:15 +00:00

34 lines
912 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
#---------------------------------------------------------------------------#
# Copyright (C) 1995 University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#---------------------------------------------------------------------------#
#
# This sed script is used to convert from Mercury to Sicstus Prolog
# It does three things: delete the `:- module' line,
# expand backslash escapes, and replace the use
# of `^' for xor in calls to is/2 with `#'.
for file in "$@"; do
case $file in
*.m) base=`basename $file .m` ;;
*.nl) base=`basename $file .nl` ;;
*) base=`basename $file` ;;
esac
sed -e '
/ is /s/\^/#/g
/^:- *module/d
/^[ ]*%/s/.*//
/\\\\/s//\\/g
/\\a/s///g
/\\b/s///g
/\\r/s//
/g
/\\f/s// /g
/\\t/s// /g
/\\n/s//\
/g
/\\v/s// /g
' $file > $base.pl
done