#!/bin/bash --

# $Id: emucolor,v 1.1 2000/11/09 20:06:04 bsittler Exp $
#
# This sed program applies ANSI color escape sequences to the output
# of the SMOKE-16 emulator. Use it as a pipeline stage.
#

sed -e '
s/\(0x[0-9a-f]\+\)\(\( \?\)\(<\)\([^+>]*\)\(+\?\)\([^>]*\)\(>\)\)\?/[0;34;1m\1[m\3[1m\4[31m\5[m\6[32m\7[m[1m\8[m/g
s/\(%[a-z0-9]\+\)\(\((\)\([^)]*\)\()\)\)/[1m\1[0;1m\3[m\4[1m\5[m/g
s/%[a-z0-9]\+/[33m&[m/g
s/\(:	\)\([a-zA-Z0-9]\+\)/\1[35;1m\2[m	/g
s/_ _//g
s/_  _/ͻ/g
s/_\( \|$\)/ͻ/g
s/ __//g
s/_|_//g
s/|_//g
s/_|/ͼ/g
// {
   s/_//g
   s/[-a-zA-Z ]\+/[7m&[m/g
}
/|.*|/ s/|//g
' -- "$@"
