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