#!/bin/sh

./modify 's!lexorder\((.*?)\)!Compare($1) <= 0!g' $1

./modify 's!to_ASCII\(!to_Enum\(!g' $1

./modify 's!from_ASCII\((.*?)\)\s*;!from_enum($1) || die;!g' $1

./modify 's!to_String\(!to_Hex\(!g' $1

./modify 's!from_string\(!from_hex\(!g' $1

./modify 's!(\$\w+)\s*=\s*Bit::Vector->new_from_String\((.*?)\)\s*;\
!$1 = Bit::Vector->new(length($2)*4); $1->from_hex($2) || die;!g' $1

