8 # Get the machine name.
9 machine=`sed -n 's/^[\t ]*machine[\t ]*\([a-zA-Z_0-9]*\)[\t ]*;[\t ]*$/\1/p' \
10 $file | tr '[A-Z]' '[a-z]'`
12 # Make a temporary version of the test case using the Ruby language translations.
13 sed -n '/\/\*/,/\*\//d;p' $file | txl -q stdin langtrans_ruby.txl > $file.pr
15 # Begin writing out the test case.
22 grep '@ALLOW_GENFLAGS:' $file | sed 's/^ *\*/#/' | sed 's/-G.//g'
23 grep '@ALLOW_MINFLAGS:' $file | sed 's/^ *\*/#/'
30 # Write out the machine specification.
31 sed -n '/^%%{$/,/^}%%/{s/^/\t/;p}' $file.pr
33 # Write out the init and execute routines.
38 def run_machine( data )
45 # Write the data declarations
46 sed -n '/^%%$/q;{s/^/\t/;p}' $file.pr
48 # Write the data initializations
49 sed -n '0,/^%%$/d; /^%%{$/q; {s/^/\t\t/;p}' $file.pr
55 if cs >= ${machine}_first_final
64 # Write out the test data.
65 sed -n '0,/\/\* _____INPUT_____/d; /_____INPUT_____ \*\//q; p;' $file | awk '
75 print " inplen = " NR ";"
79 # Write out the main routine.
83 run_machine(str.unpack("c*"))
88 # Write out the expected output.
89 echo "=begin _____OUTPUT_____"
91 sed -n '/\/\* _____OUTPUT_____/,/_____OUTPUT_____ \*\//{/_____OUTPUT_____/d;p;};' $file
93 echo "=end _____OUTPUT_____"
95 # Don't need this language-specific file anymore.