update(add) packaging directory and spec file from OBSTF:Private, OBS
[external/ragel.git] / test / checkeofact.txl
1 include "testcase.txl"
2
3 define program
4                 [lang_indep]
5         |       'yes
6         |       'no
7 end define
8
9 rule findEof1
10         match [machine_expr_item]
11                 '>/
12 end rule
13
14 rule findEof2
15         match [machine_expr_item]
16                 '</
17 end rule
18
19 rule findEof3
20         match [machine_expr_item]
21                 '$/
22 end rule
23
24 rule findEof4
25         match [machine_expr_item]
26                 '%/
27 end rule
28
29 rule findEof5
30         match [machine_expr_item]
31                 '@/
32 end rule
33
34 rule findEof6
35         match [machine_expr_item]
36                 '<>/
37 end rule
38
39 rule findEof7
40         match [repeat machine_expr_item]
41                 '> 'eof _ [repeat machine_expr_item]
42 end rule
43
44 rule findEof8
45         match [repeat machine_expr_item]
46                 '< 'eof _ [repeat machine_expr_item]
47 end rule
48
49 rule findEof9
50         match [repeat machine_expr_item]
51                 '$ 'eof _ [repeat machine_expr_item]
52 end rule
53
54 rule findEof10
55         match [repeat machine_expr_item]
56                 '% 'eof _ [repeat machine_expr_item]
57 end rule
58
59 rule findEof11
60         match [repeat machine_expr_item]
61                 '@ 'eof _ [repeat machine_expr_item]
62 end rule
63
64 rule findEof12
65         match [repeat machine_expr_item]
66                 '<> 'eof _ [repeat machine_expr_item]
67 end rule
68
69 rule findScanner
70         match [machine_expr_item]
71                 '|* _ [repeat scanner_item] '*|
72 end rule
73
74 function findEof P [program]
75         replace [program]
76                 _ [program]
77         where
78                 P 
79                         [findEof1] [findEof2] [findEof3]
80                         [findEof4] [findEof5] [findEof6]
81                         [findEof7] [findEof8] [findEof9]
82                         [findEof10] [findEof11] [findEof12]
83                         [findScanner]
84         by
85                 'yes
86 end function
87                 
88 function main
89         replace [program]
90                 P [program]
91         construct NewP [program]
92                 'no
93         by
94                 NewP [findEof P]
95 end function