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.
19 # @ALLOW_GENFLAGS: -T0
25 # Write out the machine specification.
26 sed -n '/^%%{$/,/^}%%/{s/^/\t/;p}' $file.pr
28 # Write out the init and execute routines.
33 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
50 if cs >= ${machine}_first_final
59 # Write out the test data.
60 sed -n '0,/\/\* _____INPUT_____/d; /_____INPUT_____ \*\//q; p;' $file | awk '
70 print " inplen = " NR ";"
74 # Write out the main routine.
83 # Write out the expected output.
84 echo "=begin _____OUTPUT_____"
86 sed -n '/\/\* _____OUTPUT_____/,/_____OUTPUT_____ \*\//{/_____OUTPUT_____/d;p;};' $file
88 echo "=end _____OUTPUT_____"
90 # Don't need this language-specific file anymore.