10 # Make a temporary version of the test case using the Java language translations.
11 sed -n '/\/\*/,/\*\//d;p' $file | txl
-q stdin langtrans_csharp.txl
- $class > $file.
pr
13 # Begin writing out the test case.
20 grep '@ALLOW_GENFLAGS:' $file |
sed 's/-G2//g'
21 grep '@ALLOW_MINFLAGS:' $file
26 // Disables lots of warnings that appear in the test suite
27 #pragma warning disable 0168, 0169, 0219, 0162, 0414
33 # Write the data declarations
34 sed -n '/^%%$/q;{s/^/\t/;p}' $file.
pr
36 # Write out the machine specification.
37 sed -n '/^%%{$/,/^}%%/{s/^/\t/;p}' $file.
pr
39 # Write out the init and execute routines.
49 sed -n '0,/^%%$/d; /^%%{$/q; {s/^/\t\t/;p}' $file.
pr
55 void exec( char[] data, int len )
66 if ( cs >= ${class}_first_final )
67 Console.WriteLine( "ACCEPT" );
69 Console.WriteLine( "FAIL" );
74 # Write out the test data.
75 sed -n '0,/\/\* _____INPUT_____/d; /_____INPUT_____ \*\//q; p;' $file |
awk '
77 print " static readonly string[] inp = {"
85 print " static readonly int inplen = " NR ";"
89 # Write out the main routine.
92 public static void Main (string[] args)
94 $class machine = new $class();
95 for ( int i = 0; i < inplen; i++ ) {
97 machine.exec( inp[i].ToCharArray(), inp[i].Length );
105 # Write out the expected output.
106 sed -n '/\/\* _____OUTPUT_____/,/_____OUTPUT_____ \*\//p;' $file
108 # Don't need this language-specific file anymore.