blob: e5878b7c2c1c480ab4cadfc40d3085482f8a4f0b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/*
* @LANG: indep
*
* Test in and out state actions.
*/
%%{
machine state_act;
action a1 { print_str "a1\n"; }
action a2 { print_str "a2\n"; }
action b1 { print_str "b1\n"; }
action b2 { print_str "b2\n"; }
action c1 { print_str "c1\n"; }
action c2 { print_str "c2\n"; }
action next_again {fnext again;}
hi = 'hi';
line = again:
hi
>to b1
>from b2
'\n'
>to c1
>from c2
@next_again;
main := line*
>to a1
>from a2;
}%%
##### INPUT #####
"hi\nhi\n"
##### OUTPUT #####
a2
b2
c1
c2
b1
b2
c1
c2
b1
FAIL
|