genCoder.sh revision 441
0N/A#! /bin/sh
0N/A
0N/A#
0N/A# Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation. Sun designates this
0N/A# particular file as subject to the "Classpath" exception as provided
0N/A# by Sun in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
0N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A# CA 95054 USA or visit www.sun.com if you need additional information or
0N/A# have any questions.
0N/A#
0N/A
0N/A# Generate charset coder and decoder classes
0N/A
0N/A# Environment variables required from make: SED SPP
0N/A
0N/Awhat=$1
0N/ASRC=$2
0N/ADST=$3
0N/A
0N/Aif [ x$what = xdecoder ]; then
0N/A
0N/A echo ' '$SRC '--('$what')-->' $DST
0N/A $SPP <$SRC >$DST \
0N/A -K$what \
0N/A -DA='A' \
0N/A -Da='a' \
0N/A -DCode='Decode' \
0N/A -Dcode='decode' \
0N/A -DitypesPhrase='bytes in a specific charset' \
0N/A -DotypesPhrase='sixteen-bit Unicode characters' \
0N/A -Ditype='byte' \
0N/A -Dotype='character' \
0N/A -DItype='Byte' \
0N/A -DOtype='Char' \
0N/A -Dcoder='decoder' \
0N/A -DCoder='Decoder' \
0N/A -Dcoding='decoding' \
0N/A -DOtherCoder='Encoder' \
0N/A -DreplTypeName='string' \
441N/A -DdefaultRepl='"\\uFFFD"' \
441N/A -DdefaultReplName='<tt>"\&#92;uFFFD"<\/tt>' \
0N/A -DreplType='String' \
0N/A -DreplFQType='java.lang.String' \
0N/A -DreplLength='length()' \
0N/A -DItypesPerOtype='CharsPerByte' \
0N/A -DnotLegal='not legal for this charset' \
0N/A -Dotypes-per-itype='chars-per-byte' \
0N/A -DoutSequence='Unicode character'
0N/A
0N/Aelif [ x$what = xencoder ]; then
0N/A
0N/A echo ' '$SRC '--('$what')-->' $DST
0N/A $SPP <$SRC >$DST \
0N/A -K$what \
0N/A -DA='An' \
0N/A -Da='an' \
0N/A -DCode='Encode' \
0N/A -Dcode='encode' \
0N/A -DitypesPhrase='sixteen-bit Unicode characters' \
0N/A -DotypesPhrase='bytes in a specific charset' \
0N/A -Ditype='character' \
0N/A -Dotype='byte' \
0N/A -DItype='Char' \
0N/A -DOtype='Byte' \
0N/A -Dcoder='encoder' \
0N/A -DCoder='Encoder' \
0N/A -Dcoding='encoding' \
0N/A -DOtherCoder='Decoder' \
0N/A -DreplTypeName='byte array' \
0N/A -DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \
441N/A -DdefaultReplName='<tt>{<\/tt>\&nbsp;<tt>(byte)'"'"\\?"'"'<\/tt>\&nbsp;<tt>}<\/tt>' \
0N/A -DreplType='byte[]' \
0N/A -DreplFQType='byte[]' \
0N/A -DreplLength='length' \
0N/A -DItypesPerOtype='BytesPerChar' \
0N/A -DnotLegal='not a legal sixteen-bit Unicode sequence' \
0N/A -Dotypes-per-itype='bytes-per-char' \
0N/A -DoutSequence='byte sequence in the given charset'
0N/A
0N/Aelse
0N/A echo Illegal coder type: $what
0N/A exit 1
0N/Afi