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.
20 grep '@ALLOW_GENFLAGS:' $file
21 grep '@ALLOW_MINFLAGS:' $file
30 # Write the data declarations
31 sed -n '/^%%$/q;{s/^/\t/;p}' $file.
pr
33 # Write out the machine specification.
34 sed -n '/^%%{$/,/^}%%/{s/^/\t/;p}' $file.
pr
36 # Write out the init and execute routines.
46 sed -n '0,/^%%$/d; /^%%{$/q; {s/^/\t\t/;p}' $file.
pr
52 void exec( char data[], int len )
63 if ( cs >= ${class}_first_final )
64 System.out.println( "ACCEPT" );
66 System.out.println( "FAIL" );
71 # Write out the test data.
72 sed -n '0,/\/\* _____INPUT_____/d; /_____INPUT_____ \*\//q; p;' $file |
awk '
74 print " static final String inp[] = {"
82 print " static final int inplen = " NR ";"
86 # Write out the main routine.
89 public static void main (String[] args)
91 $class machine = new $class();
92 for ( int i = 0; i < inplen; i++ ) {
94 machine.exec( inp[i].toCharArray(), inp[i].length() );
102 # Write out the expected output.
103 sed -n '/\/\* _____OUTPUT_____/,/_____OUTPUT_____ \*\//p;' $file
105 # Don't need this language-specific file anymore.