Removed arg passing from frontend to backend functions.
[ragel.git] / test / checkeofact.txl
blob81890133558a8551358dc7c77a62d3b0058b2db1
1 include "testcase.txl"
3 define program
4                 [lang_indep]
5         |       'yes
6         |       'no
7 end define
9 rule findEof1
10         match [machine_expr_item]
11                 '>/
12 end rule
14 rule findEof2
15         match [machine_expr_item]
16                 '</
17 end rule
19 rule findEof3
20         match [machine_expr_item]
21                 '$/
22 end rule
24 rule findEof4
25         match [machine_expr_item]
26                 '%/
27 end rule
29 rule findEof5
30         match [machine_expr_item]
31                 '@/
32 end rule
34 rule findEof6
35         match [machine_expr_item]
36                 '<>/
37 end rule
39 rule findEof7
40         match [repeat machine_expr_item]
41                 '> 'eof _ [repeat machine_expr_item]
42 end rule
44 rule findEof8
45         match [repeat machine_expr_item]
46                 '< 'eof _ [repeat machine_expr_item]
47 end rule
49 rule findEof9
50         match [repeat machine_expr_item]
51                 '$ 'eof _ [repeat machine_expr_item]
52 end rule
54 rule findEof10
55         match [repeat machine_expr_item]
56                 '% 'eof _ [repeat machine_expr_item]
57 end rule
59 rule findEof11
60         match [repeat machine_expr_item]
61                 '@ 'eof _ [repeat machine_expr_item]
62 end rule
64 rule findEof12
65         match [repeat machine_expr_item]
66                 '<> 'eof _ [repeat machine_expr_item]
67 end rule
69 rule findScanner
70         match [machine_expr_item]
71                 '|* _ [repeat scanner_item] '*|
72 end rule
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