diff options
Diffstat (limited to 'test/trans.d/case/next2.rl')
-rw-r--r-- | test/trans.d/case/next2.rl | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/test/trans.d/case/next2.rl b/test/trans.d/case/next2.rl new file mode 100644 index 00000000..9f8ffe2a --- /dev/null +++ b/test/trans.d/case/next2.rl @@ -0,0 +1,64 @@ +/* + * @LANG: indep + */ + +int target; +int last; + +%%{ + machine next2; + + unused := 'unused'; + + one := 'one' @{ + print_str "one\n"; + target = fentry(main); + fnext *target; + }; + + two := 'two' @{ + print_str "two\n"; + target = fentry(main); + fnext *target; + }; + + three := 'three' @{ + print_str "three\n"; + target = fentry(main); + fnext *target; + }; + + main := ( + '1' @{ + target = fentry(one); + fnext *target; + last = 1; + } | + + '2' @{ + target = fentry(two); + fnext *target; + last = 2; + } | + + # This one is conditional based on the last. + '3' @{ + if ( last == 2 ) { + target = fentry(three); + fnext *target; + } + + last = 3; + } 'x' | + + '\n' + )*; +}%% + +##### INPUT ##### +"1one3x2two3three\n" +##### OUTPUT ##### +one +two +three +ACCEPT |