Initialize Tizen 2.3
[external/ragel.git] / test / export2.rl
1 /*
2  * @LANG: java
3  */
4
5 class export2
6 {
7         %%{
8                 machine test;
9
10                 export c1 = 'c';
11                 export c2 = 'z';
12                 export c3 = 't';
13
14                 commands := (
15                         c1 . digit* '\n' @{ System.out.println( "c1" );} |
16                         c2 . alpha* '\n' @{ System.out.println( "c2" );}|
17                         c3 . '.'* '\n' @{ System.out.println( "c3" );}
18                 )*;
19                         
20                 other := any*;
21         }%%
22
23         %% write exports;
24         %% write data;
25
26         static void test( char data[] )
27         {
28                 int cs = test_en_commands, p = 0, pe = data.length;
29                 int top;
30
31                 %% write init nocs;
32                 %% write exec;
33
34                 if ( cs >= test_first_final )
35                         System.out.println( "ACCEPT" );
36                 else
37                         System.out.println( "FAIL" );
38         }
39
40         public static void main( String args[] )
41         {
42                 char data[] = { 
43                         test_ex_c1, '1', '2', '\n', 
44                         test_ex_c2, 'a', 'b', '\n', 
45                         test_ex_c3, '.', '.', '\n',
46                 };
47                 test( data );
48         }
49 }
50
51
52 /* _____OUTPUT_____
53 c1
54 c2
55 c3
56 ACCEPT
57 */