diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-10-13 19:14:30 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-10-13 19:14:30 +0000 |
commit | eafd7a3974e8605fd02794269db6114a3446e016 (patch) | |
tree | 064737b35dbe10f2995753ead92f95bac30ba048 /test/erract8.rl | |
download | ragel-tarball-eafd7a3974e8605fd02794269db6114a3446e016.tar.gz |
ragel-6.9ragel-6.9
Diffstat (limited to 'test/erract8.rl')
-rw-r--r-- | test/erract8.rl | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/erract8.rl b/test/erract8.rl new file mode 100644 index 0000000..7926186 --- /dev/null +++ b/test/erract8.rl @@ -0,0 +1,44 @@ +/* + * @LANG: java + */ + +class erract8 +{ + %%{ + machine erract8; + + action on_char { System.out.println("char: " + data[p]); } + action on_err { System.out.println("err: " + data[p]); } + action to_state { System.out.println("to state: " + data[p]); } + + main := 'heXXX' $on_char $err(on_err) $to(to_state); + }%% + + %% write data; + + static void test( char data[] ) + { + int cs, p = 0, pe = data.length; + int eof = pe; + int top; + + %% write init; + %% write exec; + + System.out.println("rest: " + data[p] + data[p+1] + data[p+2]); + } + + public static void main( String args[] ) + { + test( "hello".toCharArray() ); + } +} + +/* _____OUTPUT_____ +char: h +to state: h +char: e +to state: e +err: l +rest: llo +*/ |