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.
24 # Write out the machine specification.
25 sed -n '/^%%{$/,/^}%%/{s/^/\t/;p}' $file.pr
27 # Write out the init and execute routines.
32 def run_machine( data )
39 # Write the data declarations
40 sed -n '/^%%$/q;{s/^/\t/;p}' $file.pr
42 # Write the data initializations
43 sed -n '0,/^%%$/d; /^%%{$/q; {s/^/\t\t/;p}' $file.pr
49 if cs >= ${machine}_first_final
58 # Write out the test data.
59 sed -n '0,/\/\* _____INPUT_____/d; /_____INPUT_____ \*\//q; p;' $file | awk '
69 print " inplen = " NR ";"
73 # Write out the main routine.
82 # Write out the expected output.
83 echo "=begin _____OUTPUT_____"
85 sed -n '/\/\* _____OUTPUT_____/,/_____OUTPUT_____ \*\//{/_____OUTPUT_____/d;p;};' $file
87 echo "=end _____OUTPUT_____"
89 # Don't need this language-specific file anymore.