61d9ac98b9a2d8c1f060655b2b0d4cdb585af132
[external/ragel.git] / test / java2.rl
1 /*
2  * @LANG: java
3  * @ALLOW_GENFLAGS: -T0
4  */
5
6 class java2
7 {
8         %%{
9                 machine java1;
10                 alphtype int;
11
12                 main := 1 2 3 4 (
13                         5 6 7 8 | 
14                         9 10 11 12
15                         ) 1073741824;
16                 
17         }%%
18
19         %% write data;
20
21         static void test( int data[] )
22         {
23                 int cs, p = 0, pe = data.length;
24                 int top;
25
26                 %% write init;
27                 %% write exec;
28
29                 if ( cs >= java1_first_final )
30                         System.out.println( "ACCEPT" );
31                 else
32                         System.out.println( "FAIL" );
33         }
34
35         static final int t1[] = { 1, 2, 3, 4, 5, 6, 7, 8, 1073741824 };
36         static final int t2[] = { 1, 2, 3, 4, 9, 10, 11, 12, 1073741824 };
37         static final int t3[] = { 1, 2, 3, 4, 1073741824 };
38
39         public static void main( String args[] )
40         {
41                 test( t1 );
42                 test( t2 );
43                 test( t3 );
44         }
45 }
46
47 /* _____OUTPUT_____
48 ACCEPT
49 ACCEPT
50 FAIL
51 */