10 # Make a temporary version of the test case using the Java language translations.
11 sed -n '/\/\*/,/\*\//d;p' $file | txl -q stdin langtrans_java.txl - $class > $file.pr
13 # Begin writing out the test case.
24 # Write the data declarations
25 sed -n '/^%%$/q;{s/^/\t/;p}' $file.pr
27 # Write out the machine specification.
28 sed -n '/^%%{$/,/^}%%/{s/^/\t/;p}' $file.pr
30 # Write out the init and execute routines.
40 sed -n '0,/^%%$/d; /^%%{$/q; {s/^/\t\t/;p}' $file.pr
46 void exec( char data[], int len )
57 if ( cs >= ${class}_first_final )
58 System.out.println( "ACCEPT" );
60 System.out.println( "FAIL" );
65 # Write out the test data.
66 sed -n '0,/\/\* _____INPUT_____/d; /_____INPUT_____ \*\//q; p;' $file | awk '
68 print " static final String inp[] = {"
76 print " static final int inplen = " NR ";"
80 # Write out the main routine.
83 public static void main (String[] args)
85 $class machine = new $class();
86 for ( int i = 0; i < inplen; i++ ) {
88 machine.exec( inp[i].toCharArray(), inp[i].length() );
96 # Write out the expected output.
97 sed -n '/\/\* _____OUTPUT_____/,/_____OUTPUT_____ \*\//p;' $file
99 # Don't need this language-specific file anymore.