#! /bin/sh -f

if make UnicodeData.txt
then	true
else	echo Could not acquire Unicode data file UnicodeData.txt
	exit 1
fi


# scan UnicodeData.txt:
#	00BD;VULGAR FRACTION ONE HALF;No;0;ON;<fraction> 0031 2044 0032;;;1/2;N;FRACTION ONE HALF;;;;
#	00C0;LATIN CAPITAL LETTER A WITH GRAVE;Lu;0;L;0041 0300;;;;N;LATIN CAPITAL LETTER A GRAVE;;;00E0;
# generate lines:
#	{0x00BD, decomp_fraction, {0x0031, 0x2044, 0x0032}},
#	{0x00C0, decomp_none, {0x0041, 0x0300}},

sed	-e 's/^\([^;]*\);[^;]*;[^;]*;[^;]*;[^;]*;\([^;][^;]*\);.*/\1	\2/' \
	-e t -e d UnicodeData.txt |
sed	-e 's/	\([^<]\)/	0x\1/' -e 's/ / 0x/g' |
sed	-e 's/<\(.*\)> /decomp_\1,	/' \
	-e t \
	-e 's/	/	decomp_none,	/' |
sed	-e 's/ /, /g' \
	-e 's/,	/, {/' -e 's/$/}},/' \
	-e 's/	/, /' -e 's/^/	{0x/' > decompos.t

