repo.or.cz
/
ragel.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Use the new import feature of Ragel for bringing in defines from the parser
[ragel.git]
/
test
/
eofact.rl
blob
890b73c9715f2651cd199446e2990d73b7f57982
1
/*
2
* @LANG: indep
3
* @ALLOW_GENFLAGS: -T0 -T1 -F0 -F1 -G0 -G1 -G2 -P
4
*/
5
%%
6
%%{
7
machine eofact;
8
9
action a1 { prints "a1\n"; }
10
action a2 { prints "a2\n"; }
11
action a3 { prints "a3\n"; }
12
action a4 { prints "a4\n"; }
13
14
15
main := (
16
'hello' @eof a1 %eof a2 '\n'? |
17
'there' @eof a3 %eof a4
18
);
19
20
}%%
21
/* _____INPUT_____
22
""
23
"h"
24
"hell"
25
"hello"
26
"hello\n"
27
"t"
28
"ther"
29
"there"
30
"friend"
31
_____INPUT_____ */
32
/* _____OUTPUT_____
33
a1
34
a3
35
FAIL
36
a1
37
FAIL
38
a1
39
FAIL
40
a2
41
ACCEPT
42
ACCEPT
43
a3
44
FAIL
45
a3
46
FAIL
47
a4
48
ACCEPT
49
FAIL
50
_____OUTPUT_____ */