uri_scanner 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,44 @@
1
+ #
2
+ # @LANG: ruby
3
+ # Parsing URI
4
+ #
5
+
6
+ =begin
7
+ %%{
8
+ machine m_uri;
9
+ include actions "../machines/ruby_actions.rl";
10
+ include ip_addr "../machines/ip_addr.rl";
11
+ include uri "../machines/uri.rl";
12
+ include sip_uri "../machines/sip_uri.rl";
13
+
14
+ main := URI_REF | SIP_URI;
15
+ }%%
16
+ =end
17
+ class URIParserError < Exception; end
18
+
19
+ class MachineURI
20
+ attr_accessor :scheme, :host, :userinfo, :port, :query,
21
+ :fragment, :username, :password, :path, :param, :header
22
+ def initialize(data)
23
+ @is_valid = false
24
+ @param = {}
25
+ @header = {}
26
+ eof = data.length
27
+ mark = 0
28
+ %% write data;
29
+ %% write init;
30
+ %% write exec;
31
+ #%
32
+ if cs >= m_uri_first_final
33
+ @is_valid = true
34
+ else
35
+ raise URIParserError, "Invalid URI: #{data}"
36
+ end
37
+ end
38
+
39
+ def is_valid?
40
+ @is_valid
41
+ end
42
+
43
+ end
44
+
@@ -0,0 +1,1007 @@
1
+
2
+ # line 1 "lib/uri_scanner/uri_scanner.rl"
3
+ #
4
+ # @LANG: ruby
5
+ # Scan text and extracts URI(s)
6
+ #
7
+
8
+ =begin
9
+
10
+ # line 18 "lib/uri_scanner/uri_scanner.rl"
11
+
12
+ =end
13
+
14
+ class MachineURIScanner
15
+ attr_accessor :collection
16
+
17
+ def initialize(data)
18
+ @collection = []
19
+ eof = data.length
20
+
21
+ # line 22 "lib/uri_scanner/uri_scanner.rb"
22
+ class << self
23
+ attr_accessor :_uri_scanner_actions
24
+ private :_uri_scanner_actions, :_uri_scanner_actions=
25
+ end
26
+ self._uri_scanner_actions = [
27
+ 0, 1, 0, 1, 1, 1, 2, 1,
28
+ 8, 1, 9, 1, 10, 1, 13, 1,
29
+ 14, 1, 15, 1, 16, 1, 17, 1,
30
+ 18, 2, 0, 2, 2, 5, 14, 2,
31
+ 6, 14, 2, 7, 14, 2, 10, 0,
32
+ 2, 10, 2, 2, 10, 3, 2, 10,
33
+ 5, 2, 10, 6, 2, 10, 11, 2,
34
+ 10, 12, 3, 0, 6, 14, 3, 0,
35
+ 7, 14, 3, 10, 0, 2, 3, 10,
36
+ 0, 3, 3, 10, 0, 4, 3, 10,
37
+ 0, 6, 3, 10, 0, 11, 3, 10,
38
+ 2, 0, 3, 10, 4, 0, 4, 0,
39
+ 2, 5, 14, 4, 0, 4, 5, 14,
40
+ 4, 2, 0, 5, 14, 4, 4, 0,
41
+ 5, 14, 4, 10, 0, 2, 5, 4,
42
+ 10, 0, 4, 5, 4, 10, 2, 0,
43
+ 5, 4, 10, 4, 0, 5
44
+ ]
45
+
46
+ class << self
47
+ attr_accessor :_uri_scanner_key_offsets
48
+ private :_uri_scanner_key_offsets, :_uri_scanner_key_offsets=
49
+ end
50
+ self._uri_scanner_key_offsets = [
51
+ 0, 10, 23, 29, 35, 41, 47, 53,
52
+ 59, 65, 71, 77, 83, 97, 103, 109,
53
+ 115, 121, 129, 136, 143, 150, 151, 158,
54
+ 165, 172, 179, 180, 187, 194, 201, 208,
55
+ 209, 216, 223, 230, 237, 238, 245, 252,
56
+ 259, 266, 267, 274, 281, 288, 295, 296,
57
+ 306, 314, 319, 322, 327, 330, 335, 338,
58
+ 341, 342, 348, 351, 354, 355, 361, 364,
59
+ 367, 368, 374, 377, 385, 393, 394, 401,
60
+ 408, 415, 422, 429, 436, 447, 457, 465,
61
+ 473, 480, 487, 497, 506, 515, 524, 526,
62
+ 532, 540, 548, 560, 571, 580, 589, 597,
63
+ 607, 616, 625, 634, 636, 645, 653, 661,
64
+ 673, 684, 693, 702, 710, 720, 729, 738,
65
+ 747, 749, 758, 766, 774, 786, 797, 806,
66
+ 815, 823, 833, 842, 851, 860, 862, 871,
67
+ 879, 887, 899, 910, 919, 928, 936, 946,
68
+ 955, 964, 973, 975, 984, 992, 1000, 1012,
69
+ 1023, 1032, 1041, 1049, 1050, 1056, 1064, 1072,
70
+ 1080, 1082, 1088, 1095, 1102, 1109, 1110, 1116,
71
+ 1123, 1130, 1137, 1138, 1144, 1151, 1158, 1165,
72
+ 1166, 1172, 1179, 1186, 1193, 1194, 1203, 1211,
73
+ 1219, 1227, 1228, 1235, 1242, 1253, 1263, 1271,
74
+ 1279, 1286, 1292, 1299, 1312, 1326, 1330, 1340,
75
+ 1342, 1353, 1364, 1376, 1388, 1401, 1415, 1428,
76
+ 1445, 1461, 1480, 1496, 1511, 1516, 1521, 1525
77
+ ]
78
+
79
+ class << self
80
+ attr_accessor :_uri_scanner_trans_keys
81
+ private :_uri_scanner_trans_keys, :_uri_scanner_trans_keys=
82
+ end
83
+ self._uri_scanner_trans_keys = [
84
+ 43, 58, 45, 46, 48, 57, 65, 90,
85
+ 97, 122, 0, 33, 37, 47, 61, 95,
86
+ 126, 36, 59, 64, 90, 97, 122, 48,
87
+ 57, 65, 70, 97, 102, 48, 57, 65,
88
+ 70, 97, 102, 48, 57, 65, 70, 97,
89
+ 102, 48, 57, 65, 70, 97, 102, 48,
90
+ 57, 65, 70, 97, 102, 48, 57, 65,
91
+ 70, 97, 102, 48, 57, 65, 70, 97,
92
+ 102, 48, 57, 65, 70, 97, 102, 48,
93
+ 57, 65, 70, 97, 102, 48, 57, 65,
94
+ 70, 97, 102, 33, 37, 61, 64, 95,
95
+ 126, 36, 46, 48, 59, 65, 90, 97,
96
+ 122, 48, 57, 65, 70, 97, 102, 48,
97
+ 57, 65, 70, 97, 102, 48, 57, 65,
98
+ 70, 97, 102, 48, 57, 65, 70, 97,
99
+ 102, 58, 118, 48, 57, 65, 70, 97,
100
+ 102, 58, 48, 57, 65, 70, 97, 102,
101
+ 58, 48, 57, 65, 70, 97, 102, 58,
102
+ 48, 57, 65, 70, 97, 102, 58, 58,
103
+ 48, 57, 65, 70, 97, 102, 58, 48,
104
+ 57, 65, 70, 97, 102, 58, 48, 57,
105
+ 65, 70, 97, 102, 58, 48, 57, 65,
106
+ 70, 97, 102, 58, 58, 48, 57, 65,
107
+ 70, 97, 102, 58, 48, 57, 65, 70,
108
+ 97, 102, 58, 48, 57, 65, 70, 97,
109
+ 102, 58, 48, 57, 65, 70, 97, 102,
110
+ 58, 58, 48, 57, 65, 70, 97, 102,
111
+ 58, 48, 57, 65, 70, 97, 102, 58,
112
+ 48, 57, 65, 70, 97, 102, 58, 48,
113
+ 57, 65, 70, 97, 102, 58, 58, 48,
114
+ 57, 65, 70, 97, 102, 58, 48, 57,
115
+ 65, 70, 97, 102, 58, 48, 57, 65,
116
+ 70, 97, 102, 58, 48, 57, 65, 70,
117
+ 97, 102, 58, 58, 48, 57, 65, 70,
118
+ 97, 102, 58, 48, 57, 65, 70, 97,
119
+ 102, 58, 48, 57, 65, 70, 97, 102,
120
+ 58, 48, 57, 65, 70, 97, 102, 58,
121
+ 50, 58, 48, 49, 51, 57, 65, 70,
122
+ 97, 102, 46, 58, 48, 57, 65, 70,
123
+ 97, 102, 50, 48, 49, 51, 57, 46,
124
+ 48, 57, 50, 48, 49, 51, 57, 46,
125
+ 48, 57, 50, 48, 49, 51, 57, 93,
126
+ 48, 57, 93, 48, 57, 93, 53, 93,
127
+ 48, 52, 54, 57, 93, 48, 53, 46,
128
+ 48, 57, 46, 46, 53, 48, 52, 54,
129
+ 57, 46, 48, 53, 46, 48, 57, 46,
130
+ 46, 53, 48, 52, 54, 57, 46, 48,
131
+ 53, 46, 58, 48, 57, 65, 70, 97,
132
+ 102, 46, 58, 48, 57, 65, 70, 97,
133
+ 102, 58, 58, 48, 57, 65, 70, 97,
134
+ 102, 93, 48, 57, 65, 70, 97, 102,
135
+ 93, 48, 57, 65, 70, 97, 102, 93,
136
+ 48, 57, 65, 70, 97, 102, 58, 48,
137
+ 57, 65, 70, 97, 102, 58, 48, 57,
138
+ 65, 70, 97, 102, 46, 53, 58, 48,
139
+ 52, 54, 57, 65, 70, 97, 102, 46,
140
+ 58, 48, 53, 54, 57, 65, 70, 97,
141
+ 102, 46, 58, 48, 57, 65, 70, 97,
142
+ 102, 46, 58, 48, 57, 65, 70, 97,
143
+ 102, 93, 48, 57, 65, 70, 97, 102,
144
+ 58, 48, 57, 65, 70, 97, 102, 50,
145
+ 93, 48, 49, 51, 57, 65, 70, 97,
146
+ 102, 46, 58, 93, 48, 57, 65, 70,
147
+ 97, 102, 46, 58, 93, 48, 57, 65,
148
+ 70, 97, 102, 46, 58, 93, 48, 57,
149
+ 65, 70, 97, 102, 58, 93, 48, 57,
150
+ 65, 70, 97, 102, 58, 93, 48, 57,
151
+ 65, 70, 97, 102, 58, 93, 48, 57,
152
+ 65, 70, 97, 102, 46, 53, 58, 93,
153
+ 48, 52, 54, 57, 65, 70, 97, 102,
154
+ 46, 58, 93, 48, 53, 54, 57, 65,
155
+ 70, 97, 102, 46, 58, 93, 48, 57,
156
+ 65, 70, 97, 102, 46, 58, 93, 48,
157
+ 57, 65, 70, 97, 102, 58, 93, 48,
158
+ 57, 65, 70, 97, 102, 50, 93, 48,
159
+ 49, 51, 57, 65, 70, 97, 102, 46,
160
+ 58, 93, 48, 57, 65, 70, 97, 102,
161
+ 46, 58, 93, 48, 57, 65, 70, 97,
162
+ 102, 46, 58, 93, 48, 57, 65, 70,
163
+ 97, 102, 58, 93, 50, 48, 49, 51,
164
+ 57, 65, 70, 97, 102, 58, 93, 48,
165
+ 57, 65, 70, 97, 102, 58, 93, 48,
166
+ 57, 65, 70, 97, 102, 46, 53, 58,
167
+ 93, 48, 52, 54, 57, 65, 70, 97,
168
+ 102, 46, 58, 93, 48, 53, 54, 57,
169
+ 65, 70, 97, 102, 46, 58, 93, 48,
170
+ 57, 65, 70, 97, 102, 46, 58, 93,
171
+ 48, 57, 65, 70, 97, 102, 58, 93,
172
+ 48, 57, 65, 70, 97, 102, 50, 93,
173
+ 48, 49, 51, 57, 65, 70, 97, 102,
174
+ 46, 58, 93, 48, 57, 65, 70, 97,
175
+ 102, 46, 58, 93, 48, 57, 65, 70,
176
+ 97, 102, 46, 58, 93, 48, 57, 65,
177
+ 70, 97, 102, 58, 93, 50, 48, 49,
178
+ 51, 57, 65, 70, 97, 102, 58, 93,
179
+ 48, 57, 65, 70, 97, 102, 58, 93,
180
+ 48, 57, 65, 70, 97, 102, 46, 53,
181
+ 58, 93, 48, 52, 54, 57, 65, 70,
182
+ 97, 102, 46, 58, 93, 48, 53, 54,
183
+ 57, 65, 70, 97, 102, 46, 58, 93,
184
+ 48, 57, 65, 70, 97, 102, 46, 58,
185
+ 93, 48, 57, 65, 70, 97, 102, 58,
186
+ 93, 48, 57, 65, 70, 97, 102, 50,
187
+ 93, 48, 49, 51, 57, 65, 70, 97,
188
+ 102, 46, 58, 93, 48, 57, 65, 70,
189
+ 97, 102, 46, 58, 93, 48, 57, 65,
190
+ 70, 97, 102, 46, 58, 93, 48, 57,
191
+ 65, 70, 97, 102, 58, 93, 50, 48,
192
+ 49, 51, 57, 65, 70, 97, 102, 58,
193
+ 93, 48, 57, 65, 70, 97, 102, 58,
194
+ 93, 48, 57, 65, 70, 97, 102, 46,
195
+ 53, 58, 93, 48, 52, 54, 57, 65,
196
+ 70, 97, 102, 46, 58, 93, 48, 53,
197
+ 54, 57, 65, 70, 97, 102, 46, 58,
198
+ 93, 48, 57, 65, 70, 97, 102, 46,
199
+ 58, 93, 48, 57, 65, 70, 97, 102,
200
+ 58, 93, 48, 57, 65, 70, 97, 102,
201
+ 50, 93, 48, 49, 51, 57, 65, 70,
202
+ 97, 102, 46, 58, 93, 48, 57, 65,
203
+ 70, 97, 102, 46, 58, 93, 48, 57,
204
+ 65, 70, 97, 102, 46, 58, 93, 48,
205
+ 57, 65, 70, 97, 102, 58, 93, 50,
206
+ 48, 49, 51, 57, 65, 70, 97, 102,
207
+ 58, 93, 48, 57, 65, 70, 97, 102,
208
+ 58, 93, 48, 57, 65, 70, 97, 102,
209
+ 46, 53, 58, 93, 48, 52, 54, 57,
210
+ 65, 70, 97, 102, 46, 58, 93, 48,
211
+ 53, 54, 57, 65, 70, 97, 102, 46,
212
+ 58, 93, 48, 57, 65, 70, 97, 102,
213
+ 46, 58, 93, 48, 57, 65, 70, 97,
214
+ 102, 58, 93, 48, 57, 65, 70, 97,
215
+ 102, 58, 48, 57, 65, 70, 97, 102,
216
+ 58, 93, 48, 57, 65, 70, 97, 102,
217
+ 58, 93, 48, 57, 65, 70, 97, 102,
218
+ 58, 93, 48, 57, 65, 70, 97, 102,
219
+ 58, 93, 48, 57, 65, 70, 97, 102,
220
+ 58, 48, 57, 65, 70, 97, 102, 58,
221
+ 48, 57, 65, 70, 97, 102, 58, 48,
222
+ 57, 65, 70, 97, 102, 58, 48, 57,
223
+ 65, 70, 97, 102, 58, 48, 57, 65,
224
+ 70, 97, 102, 58, 48, 57, 65, 70,
225
+ 97, 102, 58, 48, 57, 65, 70, 97,
226
+ 102, 58, 48, 57, 65, 70, 97, 102,
227
+ 58, 48, 57, 65, 70, 97, 102, 58,
228
+ 48, 57, 65, 70, 97, 102, 58, 48,
229
+ 57, 65, 70, 97, 102, 58, 48, 57,
230
+ 65, 70, 97, 102, 58, 48, 57, 65,
231
+ 70, 97, 102, 58, 48, 57, 65, 70,
232
+ 97, 102, 58, 48, 57, 65, 70, 97,
233
+ 102, 58, 50, 48, 49, 51, 57, 65,
234
+ 70, 97, 102, 46, 58, 48, 57, 65,
235
+ 70, 97, 102, 46, 58, 48, 57, 65,
236
+ 70, 97, 102, 46, 58, 48, 57, 65,
237
+ 70, 97, 102, 58, 58, 48, 57, 65,
238
+ 70, 97, 102, 58, 48, 57, 65, 70,
239
+ 97, 102, 46, 53, 58, 48, 52, 54,
240
+ 57, 65, 70, 97, 102, 46, 58, 48,
241
+ 53, 54, 57, 65, 70, 97, 102, 46,
242
+ 58, 48, 57, 65, 70, 97, 102, 46,
243
+ 58, 48, 57, 65, 70, 97, 102, 58,
244
+ 48, 57, 65, 70, 97, 102, 48, 57,
245
+ 65, 70, 97, 102, 46, 48, 57, 65,
246
+ 70, 97, 102, 33, 36, 61, 95, 126,
247
+ 38, 46, 48, 59, 65, 90, 97, 122,
248
+ 33, 36, 61, 93, 95, 126, 38, 46,
249
+ 48, 59, 65, 90, 97, 122, 65, 90,
250
+ 97, 122, 43, 58, 45, 46, 48, 57,
251
+ 65, 90, 97, 122, 35, 63, 33, 37,
252
+ 61, 95, 126, 36, 59, 63, 90, 97,
253
+ 122, 33, 37, 61, 95, 126, 36, 59,
254
+ 63, 90, 97, 122, 33, 35, 37, 61,
255
+ 95, 126, 36, 59, 63, 90, 97, 122,
256
+ 33, 35, 37, 61, 95, 126, 36, 59,
257
+ 63, 90, 97, 122, 33, 35, 37, 61,
258
+ 63, 95, 126, 36, 59, 64, 90, 97,
259
+ 122, 33, 35, 37, 47, 61, 63, 95,
260
+ 126, 36, 59, 64, 90, 97, 122, 33,
261
+ 35, 37, 61, 63, 95, 126, 36, 59,
262
+ 64, 90, 97, 122, 33, 35, 37, 47,
263
+ 58, 61, 63, 64, 91, 95, 126, 36,
264
+ 59, 65, 90, 97, 122, 33, 35, 37,
265
+ 47, 58, 61, 63, 64, 95, 126, 36,
266
+ 59, 65, 90, 97, 122, 33, 35, 37,
267
+ 47, 61, 63, 64, 95, 126, 36, 46,
268
+ 48, 57, 58, 59, 65, 90, 97, 122,
269
+ 33, 35, 37, 47, 58, 61, 63, 91,
270
+ 95, 126, 36, 59, 65, 90, 97, 122,
271
+ 33, 35, 37, 47, 58, 61, 63, 95,
272
+ 126, 36, 59, 65, 90, 97, 122, 35,
273
+ 47, 63, 48, 57, 35, 47, 63, 48,
274
+ 57, 35, 47, 58, 63, 33, 35, 37,
275
+ 47, 61, 63, 64, 95, 126, 36, 46,
276
+ 48, 57, 58, 59, 65, 90, 97, 122,
277
+ 0
278
+ ]
279
+
280
+ class << self
281
+ attr_accessor :_uri_scanner_single_lengths
282
+ private :_uri_scanner_single_lengths, :_uri_scanner_single_lengths=
283
+ end
284
+ self._uri_scanner_single_lengths = [
285
+ 2, 7, 0, 0, 0, 0, 0, 0,
286
+ 0, 0, 0, 0, 6, 0, 0, 0,
287
+ 0, 2, 1, 1, 1, 1, 1, 1,
288
+ 1, 1, 1, 1, 1, 1, 1, 1,
289
+ 1, 1, 1, 1, 1, 1, 1, 1,
290
+ 1, 1, 1, 1, 1, 1, 1, 2,
291
+ 2, 1, 1, 1, 1, 1, 1, 1,
292
+ 1, 2, 1, 1, 1, 2, 1, 1,
293
+ 1, 2, 1, 2, 2, 1, 1, 1,
294
+ 1, 1, 1, 1, 3, 2, 2, 2,
295
+ 1, 1, 2, 3, 3, 3, 2, 0,
296
+ 2, 2, 4, 3, 3, 3, 2, 2,
297
+ 3, 3, 3, 2, 1, 2, 2, 4,
298
+ 3, 3, 3, 2, 2, 3, 3, 3,
299
+ 2, 1, 2, 2, 4, 3, 3, 3,
300
+ 2, 2, 3, 3, 3, 2, 1, 2,
301
+ 2, 4, 3, 3, 3, 2, 2, 3,
302
+ 3, 3, 2, 1, 2, 2, 4, 3,
303
+ 3, 3, 2, 1, 0, 2, 2, 2,
304
+ 2, 0, 1, 1, 1, 1, 0, 1,
305
+ 1, 1, 1, 0, 1, 1, 1, 1,
306
+ 0, 1, 1, 1, 1, 1, 2, 2,
307
+ 2, 1, 1, 1, 3, 2, 2, 2,
308
+ 1, 0, 1, 5, 6, 0, 2, 2,
309
+ 5, 5, 6, 6, 7, 8, 7, 11,
310
+ 10, 9, 10, 9, 3, 3, 4, 9
311
+ ]
312
+
313
+ class << self
314
+ attr_accessor :_uri_scanner_range_lengths
315
+ private :_uri_scanner_range_lengths, :_uri_scanner_range_lengths=
316
+ end
317
+ self._uri_scanner_range_lengths = [
318
+ 4, 3, 3, 3, 3, 3, 3, 3,
319
+ 3, 3, 3, 3, 4, 3, 3, 3,
320
+ 3, 3, 3, 3, 3, 0, 3, 3,
321
+ 3, 3, 0, 3, 3, 3, 3, 0,
322
+ 3, 3, 3, 3, 0, 3, 3, 3,
323
+ 3, 0, 3, 3, 3, 3, 0, 4,
324
+ 3, 2, 1, 2, 1, 2, 1, 1,
325
+ 0, 2, 1, 1, 0, 2, 1, 1,
326
+ 0, 2, 1, 3, 3, 0, 3, 3,
327
+ 3, 3, 3, 3, 4, 4, 3, 3,
328
+ 3, 3, 4, 3, 3, 3, 0, 3,
329
+ 3, 3, 4, 4, 3, 3, 3, 4,
330
+ 3, 3, 3, 0, 4, 3, 3, 4,
331
+ 4, 3, 3, 3, 4, 3, 3, 3,
332
+ 0, 4, 3, 3, 4, 4, 3, 3,
333
+ 3, 4, 3, 3, 3, 0, 4, 3,
334
+ 3, 4, 4, 3, 3, 3, 4, 3,
335
+ 3, 3, 0, 4, 3, 3, 4, 4,
336
+ 3, 3, 3, 0, 3, 3, 3, 3,
337
+ 0, 3, 3, 3, 3, 0, 3, 3,
338
+ 3, 3, 0, 3, 3, 3, 3, 0,
339
+ 3, 3, 3, 3, 0, 4, 3, 3,
340
+ 3, 0, 3, 3, 4, 4, 3, 3,
341
+ 3, 3, 3, 4, 4, 2, 4, 0,
342
+ 3, 3, 3, 3, 3, 3, 3, 3,
343
+ 3, 5, 3, 3, 1, 1, 0, 5
344
+ ]
345
+
346
+ class << self
347
+ attr_accessor :_uri_scanner_index_offsets
348
+ private :_uri_scanner_index_offsets, :_uri_scanner_index_offsets=
349
+ end
350
+ self._uri_scanner_index_offsets = [
351
+ 0, 7, 18, 22, 26, 30, 34, 38,
352
+ 42, 46, 50, 54, 58, 69, 73, 77,
353
+ 81, 85, 91, 96, 101, 106, 108, 113,
354
+ 118, 123, 128, 130, 135, 140, 145, 150,
355
+ 152, 157, 162, 167, 172, 174, 179, 184,
356
+ 189, 194, 196, 201, 206, 211, 216, 218,
357
+ 225, 231, 235, 238, 242, 245, 249, 252,
358
+ 255, 257, 262, 265, 268, 270, 275, 278,
359
+ 281, 283, 288, 291, 297, 303, 305, 310,
360
+ 315, 320, 325, 330, 335, 343, 350, 356,
361
+ 362, 367, 372, 379, 386, 393, 400, 403,
362
+ 407, 413, 419, 428, 436, 443, 450, 456,
363
+ 463, 470, 477, 484, 487, 493, 499, 505,
364
+ 514, 522, 529, 536, 542, 549, 556, 563,
365
+ 570, 573, 579, 585, 591, 600, 608, 615,
366
+ 622, 628, 635, 642, 649, 656, 659, 665,
367
+ 671, 677, 686, 694, 701, 708, 714, 721,
368
+ 728, 735, 742, 745, 751, 757, 763, 772,
369
+ 780, 787, 794, 800, 802, 806, 812, 818,
370
+ 824, 827, 831, 836, 841, 846, 848, 852,
371
+ 857, 862, 867, 869, 873, 878, 883, 888,
372
+ 890, 894, 899, 904, 909, 911, 917, 923,
373
+ 929, 935, 937, 942, 947, 955, 962, 968,
374
+ 974, 979, 983, 988, 998, 1009, 1012, 1019,
375
+ 1022, 1031, 1040, 1050, 1060, 1071, 1083, 1094,
376
+ 1109, 1123, 1138, 1152, 1165, 1170, 1175, 1180
377
+ ]
378
+
379
+ class << self
380
+ attr_accessor :_uri_scanner_indicies
381
+ private :_uri_scanner_indicies, :_uri_scanner_indicies=
382
+ end
383
+ self._uri_scanner_indicies = [
384
+ 1, 2, 1, 1, 1, 1, 0, 3,
385
+ 4, 5, 6, 4, 4, 4, 4, 4,
386
+ 4, 0, 8, 8, 8, 7, 9, 9,
387
+ 9, 7, 10, 10, 10, 7, 11, 11,
388
+ 11, 7, 13, 13, 13, 12, 14, 14,
389
+ 14, 12, 15, 15, 15, 7, 16, 16,
390
+ 16, 7, 17, 17, 17, 7, 18, 18,
391
+ 18, 7, 19, 20, 19, 21, 19, 19,
392
+ 19, 19, 19, 19, 7, 22, 22, 22,
393
+ 7, 19, 19, 19, 7, 23, 23, 23,
394
+ 7, 24, 24, 24, 7, 26, 27, 25,
395
+ 25, 25, 7, 29, 28, 28, 28, 7,
396
+ 29, 30, 30, 30, 7, 29, 31, 31,
397
+ 31, 7, 29, 7, 33, 32, 32, 32,
398
+ 7, 35, 34, 34, 34, 7, 35, 36,
399
+ 36, 36, 7, 35, 37, 37, 37, 7,
400
+ 35, 7, 39, 38, 38, 38, 7, 41,
401
+ 40, 40, 40, 7, 41, 42, 42, 42,
402
+ 7, 41, 43, 43, 43, 7, 41, 7,
403
+ 45, 44, 44, 44, 7, 47, 46, 46,
404
+ 46, 7, 47, 48, 48, 48, 7, 47,
405
+ 49, 49, 49, 7, 47, 7, 51, 50,
406
+ 50, 50, 7, 53, 52, 52, 52, 7,
407
+ 53, 54, 54, 54, 7, 53, 55, 55,
408
+ 55, 7, 53, 7, 57, 56, 56, 56,
409
+ 7, 59, 58, 58, 58, 7, 59, 60,
410
+ 60, 60, 7, 59, 61, 61, 61, 7,
411
+ 59, 7, 63, 65, 62, 64, 66, 66,
412
+ 7, 67, 69, 68, 70, 70, 7, 72,
413
+ 71, 73, 7, 74, 73, 7, 76, 75,
414
+ 77, 7, 78, 77, 7, 80, 79, 81,
415
+ 7, 82, 81, 7, 82, 83, 7, 82,
416
+ 7, 84, 82, 81, 83, 7, 82, 83,
417
+ 7, 78, 85, 7, 78, 7, 78, 86,
418
+ 77, 85, 7, 78, 85, 7, 74, 87,
419
+ 7, 74, 7, 74, 88, 73, 87, 7,
420
+ 74, 87, 7, 67, 69, 89, 90, 90,
421
+ 7, 67, 69, 91, 91, 91, 7, 69,
422
+ 7, 83, 92, 92, 92, 7, 82, 93,
423
+ 93, 93, 7, 82, 94, 94, 94, 7,
424
+ 82, 83, 83, 83, 7, 69, 91, 91,
425
+ 91, 7, 69, 90, 90, 90, 7, 67,
426
+ 95, 69, 68, 96, 70, 70, 7, 67,
427
+ 69, 89, 90, 90, 90, 7, 67, 69,
428
+ 90, 90, 90, 7, 67, 69, 96, 70,
429
+ 70, 7, 82, 92, 92, 92, 7, 69,
430
+ 70, 70, 70, 7, 98, 82, 97, 99,
431
+ 100, 100, 7, 67, 102, 82, 101, 103,
432
+ 103, 7, 67, 102, 82, 104, 105, 105,
433
+ 7, 67, 102, 82, 106, 106, 106, 7,
434
+ 102, 82, 7, 92, 92, 92, 7, 102,
435
+ 82, 106, 106, 106, 7, 102, 82, 105,
436
+ 105, 105, 7, 67, 107, 102, 82, 101,
437
+ 108, 103, 103, 7, 67, 102, 82, 104,
438
+ 105, 105, 105, 7, 67, 102, 82, 105,
439
+ 105, 105, 7, 67, 102, 82, 108, 103,
440
+ 103, 7, 102, 82, 103, 103, 103, 7,
441
+ 110, 82, 109, 111, 112, 112, 7, 67,
442
+ 114, 82, 113, 115, 115, 7, 67, 114,
443
+ 82, 116, 117, 117, 7, 67, 114, 82,
444
+ 118, 118, 118, 7, 114, 82, 7, 98,
445
+ 97, 99, 100, 100, 7, 114, 82, 118,
446
+ 118, 118, 7, 114, 82, 117, 117, 117,
447
+ 7, 67, 119, 114, 82, 113, 120, 115,
448
+ 115, 7, 67, 114, 82, 116, 117, 117,
449
+ 117, 7, 67, 114, 82, 117, 117, 117,
450
+ 7, 67, 114, 82, 120, 115, 115, 7,
451
+ 114, 82, 115, 115, 115, 7, 122, 82,
452
+ 121, 123, 124, 124, 7, 67, 126, 82,
453
+ 125, 127, 127, 7, 67, 126, 82, 128,
454
+ 129, 129, 7, 67, 126, 82, 130, 130,
455
+ 130, 7, 126, 82, 7, 110, 109, 111,
456
+ 112, 112, 7, 126, 82, 130, 130, 130,
457
+ 7, 126, 82, 129, 129, 129, 7, 67,
458
+ 131, 126, 82, 125, 132, 127, 127, 7,
459
+ 67, 126, 82, 128, 129, 129, 129, 7,
460
+ 67, 126, 82, 129, 129, 129, 7, 67,
461
+ 126, 82, 132, 127, 127, 7, 126, 82,
462
+ 127, 127, 127, 7, 134, 82, 133, 135,
463
+ 136, 136, 7, 67, 138, 82, 137, 139,
464
+ 139, 7, 67, 138, 82, 140, 141, 141,
465
+ 7, 67, 138, 82, 142, 142, 142, 7,
466
+ 138, 82, 7, 122, 121, 123, 124, 124,
467
+ 7, 138, 82, 142, 142, 142, 7, 138,
468
+ 82, 141, 141, 141, 7, 67, 143, 138,
469
+ 82, 137, 144, 139, 139, 7, 67, 138,
470
+ 82, 140, 141, 141, 141, 7, 67, 138,
471
+ 82, 141, 141, 141, 7, 67, 138, 82,
472
+ 144, 139, 139, 7, 138, 82, 139, 139,
473
+ 139, 7, 146, 82, 145, 147, 148, 148,
474
+ 7, 67, 150, 82, 149, 151, 151, 7,
475
+ 67, 150, 82, 152, 153, 153, 7, 67,
476
+ 150, 82, 154, 154, 154, 7, 150, 82,
477
+ 7, 134, 133, 135, 136, 136, 7, 150,
478
+ 82, 154, 154, 154, 7, 150, 82, 153,
479
+ 153, 153, 7, 67, 155, 150, 82, 149,
480
+ 156, 151, 151, 7, 67, 150, 82, 152,
481
+ 153, 153, 153, 7, 67, 150, 82, 153,
482
+ 153, 153, 7, 67, 150, 82, 156, 151,
483
+ 151, 7, 150, 82, 151, 151, 151, 7,
484
+ 157, 7, 158, 158, 158, 7, 160, 82,
485
+ 159, 159, 159, 7, 160, 82, 161, 161,
486
+ 161, 7, 160, 82, 162, 162, 162, 7,
487
+ 160, 82, 7, 163, 163, 163, 7, 165,
488
+ 164, 164, 164, 7, 165, 166, 166, 166,
489
+ 7, 165, 167, 167, 167, 7, 165, 7,
490
+ 168, 168, 168, 7, 170, 169, 169, 169,
491
+ 7, 170, 171, 171, 171, 7, 170, 172,
492
+ 172, 172, 7, 170, 7, 173, 173, 173,
493
+ 7, 175, 174, 174, 174, 7, 175, 176,
494
+ 176, 176, 7, 175, 177, 177, 177, 7,
495
+ 175, 7, 178, 178, 178, 7, 180, 179,
496
+ 179, 179, 7, 180, 181, 181, 181, 7,
497
+ 180, 182, 182, 182, 7, 180, 7, 184,
498
+ 183, 185, 186, 186, 7, 67, 102, 187,
499
+ 188, 188, 7, 67, 102, 189, 190, 190,
500
+ 7, 67, 102, 191, 191, 191, 7, 102,
501
+ 7, 102, 191, 191, 191, 7, 102, 190,
502
+ 190, 190, 7, 67, 192, 102, 187, 193,
503
+ 188, 188, 7, 67, 102, 189, 190, 190,
504
+ 190, 7, 67, 102, 190, 190, 190, 7,
505
+ 67, 102, 193, 188, 188, 7, 102, 188,
506
+ 188, 188, 7, 194, 194, 194, 7, 195,
507
+ 194, 194, 194, 7, 196, 196, 196, 196,
508
+ 196, 196, 196, 196, 196, 7, 196, 196,
509
+ 196, 82, 196, 196, 196, 196, 196, 196,
510
+ 7, 198, 198, 197, 1, 2, 1, 1,
511
+ 1, 1, 199, 201, 202, 200, 204, 205,
512
+ 204, 204, 204, 204, 204, 204, 203, 9,
513
+ 207, 9, 9, 9, 9, 9, 9, 206,
514
+ 209, 210, 211, 209, 209, 209, 209, 209,
515
+ 209, 208, 11, 213, 214, 11, 11, 11,
516
+ 11, 11, 11, 212, 14, 216, 217, 14,
517
+ 218, 14, 14, 14, 14, 14, 215, 16,
518
+ 216, 219, 220, 16, 218, 16, 16, 16,
519
+ 16, 16, 215, 16, 216, 219, 16, 218,
520
+ 16, 16, 16, 16, 16, 215, 222, 223,
521
+ 224, 225, 226, 222, 227, 228, 229, 222,
522
+ 222, 222, 222, 222, 221, 18, 231, 232,
523
+ 233, 234, 18, 235, 21, 18, 18, 18,
524
+ 18, 18, 230, 19, 237, 20, 238, 19,
525
+ 240, 21, 19, 19, 19, 239, 19, 19,
526
+ 19, 236, 241, 223, 242, 225, 243, 241,
527
+ 227, 229, 241, 241, 241, 241, 241, 221,
528
+ 24, 231, 244, 233, 245, 24, 235, 24,
529
+ 24, 24, 24, 24, 230, 237, 238, 240,
530
+ 246, 236, 248, 249, 251, 250, 247, 231,
531
+ 233, 245, 235, 230, 19, 248, 20, 249,
532
+ 19, 251, 21, 19, 19, 19, 252, 19,
533
+ 19, 19, 247, 0
534
+ ]
535
+
536
+ class << self
537
+ attr_accessor :_uri_scanner_trans_targs
538
+ private :_uri_scanner_trans_targs, :_uri_scanner_trans_targs=
539
+ end
540
+ self._uri_scanner_trans_targs = [
541
+ 189, 0, 1, 191, 196, 6, 197, 189,
542
+ 3, 193, 5, 195, 189, 7, 196, 9,
543
+ 198, 11, 200, 12, 13, 202, 14, 16,
544
+ 203, 18, 147, 185, 19, 22, 20, 21,
545
+ 23, 134, 24, 27, 25, 26, 28, 121,
546
+ 29, 32, 30, 31, 33, 108, 34, 37,
547
+ 35, 36, 38, 95, 39, 42, 40, 41,
548
+ 43, 82, 44, 47, 45, 46, 48, 76,
549
+ 79, 80, 81, 49, 67, 70, 75, 50,
550
+ 65, 63, 51, 52, 61, 59, 53, 54,
551
+ 57, 55, 206, 56, 58, 60, 62, 64,
552
+ 66, 68, 74, 69, 71, 72, 73, 77,
553
+ 78, 83, 90, 93, 94, 84, 87, 89,
554
+ 85, 88, 86, 91, 92, 96, 103, 106,
555
+ 107, 97, 100, 102, 98, 101, 99, 104,
556
+ 105, 109, 116, 119, 120, 110, 113, 115,
557
+ 111, 114, 112, 117, 118, 122, 129, 132,
558
+ 133, 123, 126, 128, 124, 127, 125, 130,
559
+ 131, 135, 142, 145, 146, 136, 139, 141,
560
+ 137, 140, 138, 143, 144, 148, 149, 150,
561
+ 153, 151, 152, 154, 155, 158, 156, 157,
562
+ 159, 160, 163, 161, 162, 164, 165, 168,
563
+ 166, 167, 169, 170, 173, 171, 172, 174,
564
+ 180, 183, 184, 175, 179, 176, 178, 177,
565
+ 181, 182, 186, 187, 188, 189, 190, 189,
566
+ 189, 192, 194, 189, 193, 2, 189, 2,
567
+ 189, 195, 192, 4, 189, 192, 4, 189,
568
+ 192, 6, 194, 8, 199, 189, 200, 192,
569
+ 10, 198, 201, 194, 202, 17, 189, 192,
570
+ 10, 198, 201, 194, 189, 192, 198, 207,
571
+ 194, 203, 15, 204, 15, 204, 205, 189,
572
+ 192, 198, 205, 194, 207
573
+ ]
574
+
575
+ class << self
576
+ attr_accessor :_uri_scanner_trans_actions
577
+ private :_uri_scanner_trans_actions, :_uri_scanner_trans_actions=
578
+ end
579
+ self._uri_scanner_trans_actions = [
580
+ 21, 0, 3, 0, 82, 1, 37, 19,
581
+ 0, 11, 0, 11, 23, 0, 52, 0,
582
+ 11, 0, 11, 0, 0, 43, 0, 0,
583
+ 11, 0, 0, 0, 0, 0, 0, 0,
584
+ 0, 0, 0, 0, 0, 0, 0, 0,
585
+ 0, 0, 0, 0, 0, 0, 0, 0,
586
+ 0, 0, 0, 0, 0, 0, 0, 0,
587
+ 0, 0, 0, 0, 0, 0, 0, 0,
588
+ 0, 0, 0, 0, 0, 0, 0, 0,
589
+ 0, 0, 0, 0, 0, 0, 0, 0,
590
+ 0, 0, 0, 0, 0, 0, 0, 0,
591
+ 0, 0, 0, 0, 0, 0, 0, 0,
592
+ 0, 0, 0, 0, 0, 0, 0, 0,
593
+ 0, 0, 0, 0, 0, 0, 0, 0,
594
+ 0, 0, 0, 0, 0, 0, 0, 0,
595
+ 0, 0, 0, 0, 0, 0, 0, 0,
596
+ 0, 0, 0, 0, 0, 0, 0, 0,
597
+ 0, 0, 0, 0, 0, 0, 0, 0,
598
+ 0, 0, 0, 0, 0, 0, 0, 0,
599
+ 0, 0, 0, 0, 0, 0, 0, 0,
600
+ 0, 0, 0, 0, 0, 0, 0, 0,
601
+ 0, 0, 0, 0, 0, 0, 0, 0,
602
+ 0, 0, 0, 0, 0, 0, 0, 0,
603
+ 0, 0, 0, 0, 0, 0, 0, 0,
604
+ 0, 0, 0, 0, 0, 13, 55, 17,
605
+ 15, 11, 11, 62, 37, 1, 34, 0,
606
+ 58, 37, 78, 1, 31, 49, 0, 28,
607
+ 46, 0, 46, 0, 11, 94, 37, 114,
608
+ 1, 66, 66, 114, 70, 1, 104, 124,
609
+ 0, 86, 40, 124, 99, 119, 74, 37,
610
+ 119, 37, 1, 25, 0, 5, 1, 109,
611
+ 129, 90, 0, 129, 11
612
+ ]
613
+
614
+ class << self
615
+ attr_accessor :_uri_scanner_to_state_actions
616
+ private :_uri_scanner_to_state_actions, :_uri_scanner_to_state_actions=
617
+ end
618
+ self._uri_scanner_to_state_actions = [
619
+ 0, 0, 0, 0, 0, 0, 0, 0,
620
+ 0, 0, 0, 0, 0, 0, 0, 0,
621
+ 0, 0, 0, 0, 0, 0, 0, 0,
622
+ 0, 0, 0, 0, 0, 0, 0, 0,
623
+ 0, 0, 0, 0, 0, 0, 0, 0,
624
+ 0, 0, 0, 0, 0, 0, 0, 0,
625
+ 0, 0, 0, 0, 0, 0, 0, 0,
626
+ 0, 0, 0, 0, 0, 0, 0, 0,
627
+ 0, 0, 0, 0, 0, 0, 0, 0,
628
+ 0, 0, 0, 0, 0, 0, 0, 0,
629
+ 0, 0, 0, 0, 0, 0, 0, 0,
630
+ 0, 0, 0, 0, 0, 0, 0, 0,
631
+ 0, 0, 0, 0, 0, 0, 0, 0,
632
+ 0, 0, 0, 0, 0, 0, 0, 0,
633
+ 0, 0, 0, 0, 0, 0, 0, 0,
634
+ 0, 0, 0, 0, 0, 0, 0, 0,
635
+ 0, 0, 0, 0, 0, 0, 0, 0,
636
+ 0, 0, 0, 0, 0, 0, 0, 0,
637
+ 0, 0, 0, 0, 0, 0, 0, 0,
638
+ 0, 0, 0, 0, 0, 0, 0, 0,
639
+ 0, 0, 0, 0, 0, 0, 0, 0,
640
+ 0, 0, 0, 0, 0, 0, 0, 0,
641
+ 0, 0, 0, 0, 0, 0, 0, 0,
642
+ 0, 0, 0, 0, 0, 7, 0, 0,
643
+ 0, 0, 0, 0, 0, 0, 0, 0,
644
+ 0, 0, 0, 0, 0, 0, 0, 0
645
+ ]
646
+
647
+ class << self
648
+ attr_accessor :_uri_scanner_from_state_actions
649
+ private :_uri_scanner_from_state_actions, :_uri_scanner_from_state_actions=
650
+ end
651
+ self._uri_scanner_from_state_actions = [
652
+ 0, 0, 0, 0, 0, 0, 0, 0,
653
+ 0, 0, 0, 0, 0, 0, 0, 0,
654
+ 0, 0, 0, 0, 0, 0, 0, 0,
655
+ 0, 0, 0, 0, 0, 0, 0, 0,
656
+ 0, 0, 0, 0, 0, 0, 0, 0,
657
+ 0, 0, 0, 0, 0, 0, 0, 0,
658
+ 0, 0, 0, 0, 0, 0, 0, 0,
659
+ 0, 0, 0, 0, 0, 0, 0, 0,
660
+ 0, 0, 0, 0, 0, 0, 0, 0,
661
+ 0, 0, 0, 0, 0, 0, 0, 0,
662
+ 0, 0, 0, 0, 0, 0, 0, 0,
663
+ 0, 0, 0, 0, 0, 0, 0, 0,
664
+ 0, 0, 0, 0, 0, 0, 0, 0,
665
+ 0, 0, 0, 0, 0, 0, 0, 0,
666
+ 0, 0, 0, 0, 0, 0, 0, 0,
667
+ 0, 0, 0, 0, 0, 0, 0, 0,
668
+ 0, 0, 0, 0, 0, 0, 0, 0,
669
+ 0, 0, 0, 0, 0, 0, 0, 0,
670
+ 0, 0, 0, 0, 0, 0, 0, 0,
671
+ 0, 0, 0, 0, 0, 0, 0, 0,
672
+ 0, 0, 0, 0, 0, 0, 0, 0,
673
+ 0, 0, 0, 0, 0, 0, 0, 0,
674
+ 0, 0, 0, 0, 0, 0, 0, 0,
675
+ 0, 0, 0, 0, 0, 9, 0, 0,
676
+ 0, 0, 0, 0, 0, 0, 0, 0,
677
+ 0, 0, 0, 0, 0, 0, 0, 0
678
+ ]
679
+
680
+ class << self
681
+ attr_accessor :_uri_scanner_eof_trans
682
+ private :_uri_scanner_eof_trans, :_uri_scanner_eof_trans=
683
+ end
684
+ self._uri_scanner_eof_trans = [
685
+ 1, 1, 8, 8, 8, 8, 13, 13,
686
+ 8, 8, 8, 8, 8, 8, 8, 8,
687
+ 8, 8, 8, 8, 8, 8, 8, 8,
688
+ 8, 8, 8, 8, 8, 8, 8, 8,
689
+ 8, 8, 8, 8, 8, 8, 8, 8,
690
+ 8, 8, 8, 8, 8, 8, 8, 8,
691
+ 8, 8, 8, 8, 8, 8, 8, 8,
692
+ 8, 8, 8, 8, 8, 8, 8, 8,
693
+ 8, 8, 8, 8, 8, 8, 8, 8,
694
+ 8, 8, 8, 8, 8, 8, 8, 8,
695
+ 8, 8, 8, 8, 8, 8, 8, 8,
696
+ 8, 8, 8, 8, 8, 8, 8, 8,
697
+ 8, 8, 8, 8, 8, 8, 8, 8,
698
+ 8, 8, 8, 8, 8, 8, 8, 8,
699
+ 8, 8, 8, 8, 8, 8, 8, 8,
700
+ 8, 8, 8, 8, 8, 8, 8, 8,
701
+ 8, 8, 8, 8, 8, 8, 8, 8,
702
+ 8, 8, 8, 8, 8, 8, 8, 8,
703
+ 8, 8, 8, 8, 8, 8, 8, 8,
704
+ 8, 8, 8, 8, 8, 8, 8, 8,
705
+ 8, 8, 8, 8, 8, 8, 8, 8,
706
+ 8, 8, 8, 8, 8, 8, 8, 8,
707
+ 8, 8, 8, 8, 8, 8, 8, 8,
708
+ 8, 8, 8, 8, 8, 0, 200, 201,
709
+ 204, 207, 209, 213, 216, 216, 216, 222,
710
+ 231, 237, 222, 231, 237, 248, 231, 248
711
+ ]
712
+
713
+ class << self
714
+ attr_accessor :uri_scanner_start
715
+ end
716
+ self.uri_scanner_start = 189;
717
+ class << self
718
+ attr_accessor :uri_scanner_first_final
719
+ end
720
+ self.uri_scanner_first_final = 189;
721
+ class << self
722
+ attr_accessor :uri_scanner_error
723
+ end
724
+ self.uri_scanner_error = -1;
725
+
726
+ class << self
727
+ attr_accessor :uri_scanner_en_main
728
+ end
729
+ self.uri_scanner_en_main = 189;
730
+
731
+
732
+ # line 28 "lib/uri_scanner/uri_scanner.rl"
733
+
734
+ # line 735 "lib/uri_scanner/uri_scanner.rb"
735
+ begin
736
+ p ||= 0
737
+ pe ||= data.length
738
+ cs = uri_scanner_start
739
+ ts = nil
740
+ te = nil
741
+ act = 0
742
+ end
743
+
744
+ # line 29 "lib/uri_scanner/uri_scanner.rl"
745
+
746
+ # line 747 "lib/uri_scanner/uri_scanner.rb"
747
+ begin
748
+ _klen, _trans, _keys, _acts, _nacts = nil
749
+ _goto_level = 0
750
+ _resume = 10
751
+ _eof_trans = 15
752
+ _again = 20
753
+ _test_eof = 30
754
+ _out = 40
755
+ while true
756
+ _trigger_goto = false
757
+ if _goto_level <= 0
758
+ if p == pe
759
+ _goto_level = _test_eof
760
+ next
761
+ end
762
+ end
763
+ if _goto_level <= _resume
764
+ _acts = _uri_scanner_from_state_actions[cs]
765
+ _nacts = _uri_scanner_actions[_acts]
766
+ _acts += 1
767
+ while _nacts > 0
768
+ _nacts -= 1
769
+ _acts += 1
770
+ case _uri_scanner_actions[_acts - 1]
771
+ when 9 then
772
+ # line 1 "NONE"
773
+ begin
774
+ ts = p
775
+ end
776
+ # line 777 "lib/uri_scanner/uri_scanner.rb"
777
+ end # from state action switch
778
+ end
779
+ if _trigger_goto
780
+ next
781
+ end
782
+ _keys = _uri_scanner_key_offsets[cs]
783
+ _trans = _uri_scanner_index_offsets[cs]
784
+ _klen = _uri_scanner_single_lengths[cs]
785
+ _break_match = false
786
+
787
+ begin
788
+ if _klen > 0
789
+ _lower = _keys
790
+ _upper = _keys + _klen - 1
791
+
792
+ loop do
793
+ break if _upper < _lower
794
+ _mid = _lower + ( (_upper - _lower) >> 1 )
795
+
796
+ if data[p].ord < _uri_scanner_trans_keys[_mid]
797
+ _upper = _mid - 1
798
+ elsif data[p].ord > _uri_scanner_trans_keys[_mid]
799
+ _lower = _mid + 1
800
+ else
801
+ _trans += (_mid - _keys)
802
+ _break_match = true
803
+ break
804
+ end
805
+ end # loop
806
+ break if _break_match
807
+ _keys += _klen
808
+ _trans += _klen
809
+ end
810
+ _klen = _uri_scanner_range_lengths[cs]
811
+ if _klen > 0
812
+ _lower = _keys
813
+ _upper = _keys + (_klen << 1) - 2
814
+ loop do
815
+ break if _upper < _lower
816
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1)
817
+ if data[p].ord < _uri_scanner_trans_keys[_mid]
818
+ _upper = _mid - 2
819
+ elsif data[p].ord > _uri_scanner_trans_keys[_mid+1]
820
+ _lower = _mid + 2
821
+ else
822
+ _trans += ((_mid - _keys) >> 1)
823
+ _break_match = true
824
+ break
825
+ end
826
+ end # loop
827
+ break if _break_match
828
+ _trans += _klen
829
+ end
830
+ end while false
831
+ _trans = _uri_scanner_indicies[_trans]
832
+ end
833
+ if _goto_level <= _eof_trans
834
+ cs = _uri_scanner_trans_targs[_trans]
835
+ if _uri_scanner_trans_actions[_trans] != 0
836
+ _acts = _uri_scanner_trans_actions[_trans]
837
+ _nacts = _uri_scanner_actions[_acts]
838
+ _acts += 1
839
+ while _nacts > 0
840
+ _nacts -= 1
841
+ _acts += 1
842
+ case _uri_scanner_actions[_acts - 1]
843
+ when 0 then
844
+ # line 4 "lib/uri_scanner/../machines/ruby_actions.rl"
845
+ begin
846
+
847
+ mark = p
848
+ end
849
+ when 1 then
850
+ # line 8 "lib/uri_scanner/../machines/ruby_actions.rl"
851
+ begin
852
+
853
+ @scheme = data[0..p-1]
854
+ end
855
+ when 2 then
856
+ # line 12 "lib/uri_scanner/../machines/ruby_actions.rl"
857
+ begin
858
+
859
+ @host = data[mark..p-1]
860
+ end
861
+ when 3 then
862
+ # line 16 "lib/uri_scanner/../machines/ruby_actions.rl"
863
+ begin
864
+
865
+ @userinfo = data[mark..p-1]
866
+ @username, @password = @userinfo.split(":")
867
+ end
868
+ when 4 then
869
+ # line 21 "lib/uri_scanner/../machines/ruby_actions.rl"
870
+ begin
871
+
872
+ @port = data[mark..p-1].to_i
873
+ end
874
+ when 5 then
875
+ # line 25 "lib/uri_scanner/../machines/ruby_actions.rl"
876
+ begin
877
+
878
+ @path = data[mark..p-1]
879
+ end
880
+ when 6 then
881
+ # line 29 "lib/uri_scanner/../machines/ruby_actions.rl"
882
+ begin
883
+
884
+ @query = data[mark..p-1]
885
+ end
886
+ when 7 then
887
+ # line 33 "lib/uri_scanner/../machines/ruby_actions.rl"
888
+ begin
889
+
890
+ @fragment = data[mark..p-1]
891
+ end
892
+ when 10 then
893
+ # line 1 "NONE"
894
+ begin
895
+ te = p+1
896
+ end
897
+ when 11 then
898
+ # line 15 "lib/uri_scanner/uri_scanner.rl"
899
+ begin
900
+ act = 1; end
901
+ when 12 then
902
+ # line 16 "lib/uri_scanner/uri_scanner.rl"
903
+ begin
904
+ act = 2; end
905
+ when 13 then
906
+ # line 16 "lib/uri_scanner/uri_scanner.rl"
907
+ begin
908
+ te = p+1
909
+ end
910
+ when 14 then
911
+ # line 15 "lib/uri_scanner/uri_scanner.rl"
912
+ begin
913
+ te = p
914
+ p = p - 1; begin @collection << data[ts..te-1] end
915
+ end
916
+ when 15 then
917
+ # line 16 "lib/uri_scanner/uri_scanner.rl"
918
+ begin
919
+ te = p
920
+ p = p - 1; end
921
+ when 16 then
922
+ # line 15 "lib/uri_scanner/uri_scanner.rl"
923
+ begin
924
+ begin p = ((te))-1; end
925
+ begin @collection << data[ts..te-1] end
926
+ end
927
+ when 17 then
928
+ # line 16 "lib/uri_scanner/uri_scanner.rl"
929
+ begin
930
+ begin p = ((te))-1; end
931
+ end
932
+ when 18 then
933
+ # line 1 "NONE"
934
+ begin
935
+ case act
936
+ when 1 then
937
+ begin begin p = ((te))-1; end
938
+ @collection << data[ts..te-1]end
939
+ else
940
+ begin begin p = ((te))-1; end
941
+ end
942
+ end
943
+ end
944
+ # line 945 "lib/uri_scanner/uri_scanner.rb"
945
+ end # action switch
946
+ end
947
+ end
948
+ if _trigger_goto
949
+ next
950
+ end
951
+ end
952
+ if _goto_level <= _again
953
+ _acts = _uri_scanner_to_state_actions[cs]
954
+ _nacts = _uri_scanner_actions[_acts]
955
+ _acts += 1
956
+ while _nacts > 0
957
+ _nacts -= 1
958
+ _acts += 1
959
+ case _uri_scanner_actions[_acts - 1]
960
+ when 8 then
961
+ # line 1 "NONE"
962
+ begin
963
+ ts = nil; end
964
+ # line 965 "lib/uri_scanner/uri_scanner.rb"
965
+ end # to state action switch
966
+ end
967
+ if _trigger_goto
968
+ next
969
+ end
970
+ p += 1
971
+ if p != pe
972
+ _goto_level = _resume
973
+ next
974
+ end
975
+ end
976
+ if _goto_level <= _test_eof
977
+ if p == eof
978
+ if _uri_scanner_eof_trans[cs] > 0
979
+ _trans = _uri_scanner_eof_trans[cs] - 1;
980
+ _goto_level = _eof_trans
981
+ next;
982
+ end
983
+ end
984
+ end
985
+ if _goto_level <= _out
986
+ break
987
+ end
988
+ end
989
+ end
990
+
991
+ # line 30 "lib/uri_scanner/uri_scanner.rl"
992
+ #%
993
+ end
994
+
995
+ class << self
996
+ def scan(data, to_objects=false)
997
+ if to_objects
998
+ self.new(data).collection.map do |url|
999
+ MachineURI.new(url)
1000
+ end
1001
+ else
1002
+ self.new(data).collection
1003
+ end
1004
+ end
1005
+ end
1006
+ end
1007
+