#! /bin/csh -f
#
#/*****************************************************************************
#                Copyright Carnegie Mellon University 1992
#
#                      All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of CMU not be
# used in advertising or publicity pertaining to distribution of the
# software without specific, written prior permission.
#
# CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
# CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
#*****************************************************************************/
#
#
# Written by Allan Heydon for the Miro project at Carnegie Mellon
#
# SYNTAX
#   iff2arrows [file]
#
# SYNOPSIS
#   Reads an IFF file from 'file' (default standard input), and writes
#   information regarding it's arrows to stdout. The arrows are written with
#   the real names of the "to" and "from" boxes, and the parity of the arrow
#   is represented "graphically". The sysname of the arrow is not printed.
#
# BUGS
#   Multiple boxes having the same name cannot be distinguished on the output.
#
#   The input IFF files must have all BOX and ARROW entries on one line each.
#   Also, strings and identifiers cannot contain ';' or '=' characters.
#
# FILES
#   /usr/miro/libi/awk/iff2arrows.awk	bawk script that does all the work
#
# SEE ALSO
#   fs2iff(1), searchfs(1), iff2ciff(1)

set awkfile = "/usr/miro/libi/awk/iff2arrows.awk"

if ( $#argv > 1 ) then
  echo "SYNTAX: iff2arrows <IFF-file>"
else 
  if ( $#argv < 1 ) then
    set infile = "-"
  else
    set infile = $1
  endif
  bawk -f $awkfile $infile
endif
