bel_parser 1.0.0.alpha.38-java → 1.0.0.alpha.39-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/bel_parser/ast_filter.rb +6 -2
- data/lib/bel_parser/parsers/ast/node.rb +113 -58
- data/lib/bel_parser/parsers/bel_script/define_annotation.rb +4175 -3097
- data/lib/bel_parser/parsers/bel_script/define_annotation.rl +142 -49
- data/lib/bel_parser/parsers/bel_script/define_namespace.rb +980 -461
- data/lib/bel_parser/parsers/bel_script/define_namespace.rl +79 -39
- data/lib/bel_parser/parsers/bel_script/set.rb +4878 -2743
- data/lib/bel_parser/parsers/bel_script/set.rl +114 -32
- data/lib/bel_parser/parsers/bel_script/set_document.rb +5839 -5292
- data/lib/bel_parser/parsers/bel_script/set_document.rl +130 -27
- data/lib/bel_parser/parsers/bel_script/unset.rb +321 -234
- data/lib/bel_parser/parsers/bel_script/unset.rl +49 -21
- data/lib/bel_parser/parsers/common/blank_line.rb +12 -11
- data/lib/bel_parser/parsers/common/blank_line.rl +12 -12
- data/lib/bel_parser/parsers/common/comment_line.rb +65 -40
- data/lib/bel_parser/parsers/common/comment_line.rl +26 -26
- data/lib/bel_parser/parsers/common/common.rl +60 -0
- data/lib/bel_parser/parsers/common/function.rb +319 -0
- data/lib/bel_parser/parsers/common/function.rl +149 -0
- data/lib/bel_parser/parsers/common/identifier.rb +72 -68
- data/lib/bel_parser/parsers/common/identifier.rl +73 -29
- data/lib/bel_parser/parsers/common/list.rb +1617 -1243
- data/lib/bel_parser/parsers/common/list.rl +120 -60
- data/lib/bel_parser/parsers/common/string.rb +114 -41
- data/lib/bel_parser/parsers/common/string.rl +91 -28
- data/lib/bel_parser/parsers/common.rb +1 -0
- data/lib/bel_parser/parsers/expression/comment.rb +70 -38
- data/lib/bel_parser/parsers/expression/comment.rl +37 -20
- data/lib/bel_parser/parsers/expression/nested_statement.rb +63116 -13958
- data/lib/bel_parser/parsers/expression/nested_statement.rl +53 -23
- data/lib/bel_parser/parsers/expression/observed_term.rb +32497 -5188
- data/lib/bel_parser/parsers/expression/observed_term.rl +25 -20
- data/lib/bel_parser/parsers/expression/parameter.rb +2861 -847
- data/lib/bel_parser/parsers/expression/parameter.rl +178 -21
- data/lib/bel_parser/parsers/expression/relationship.rb +73 -55
- data/lib/bel_parser/parsers/expression/relationship.rl +41 -23
- data/lib/bel_parser/parsers/expression/simple_statement.rb +42895 -7846
- data/lib/bel_parser/parsers/expression/simple_statement.rl +41 -24
- data/lib/bel_parser/parsers/expression/term.rb +16498 -2602
- data/lib/bel_parser/parsers/expression/term.rl +52 -35
- data/lib/bel_parser/parsers/line_parser.rb +1 -0
- data/lib/bel_parser/parsers/mixin/buffer.rb +4 -0
- data/lib/bel_parser/parsers/tracer.rb +19 -0
- data/lib/bel_parser/script/state/namespace_definition.rb +1 -0
- metadata +10 -7
@@ -9,9 +9,9 @@ end
|
|
9
9
|
self._bel_trans_keys = [
|
10
10
|
0, 0, 85, 117, 78, 110,
|
11
11
|
83, 115, 69, 101, 84,
|
12
|
-
116,
|
13
|
-
|
14
|
-
0
|
12
|
+
116, 48, 122, 9, 122,
|
13
|
+
48, 122, 10, 122, 0, 0,
|
14
|
+
0
|
15
15
|
]
|
16
16
|
|
17
17
|
class << self
|
@@ -19,8 +19,8 @@ class << self
|
|
19
19
|
private :_bel_key_spans, :_bel_key_spans=
|
20
20
|
end
|
21
21
|
self._bel_key_spans = [
|
22
|
-
0, 33, 33, 33, 33, 33,
|
23
|
-
|
22
|
+
0, 33, 33, 33, 33, 33, 75, 114,
|
23
|
+
75, 113, 0
|
24
24
|
]
|
25
25
|
|
26
26
|
class << self
|
@@ -28,8 +28,8 @@ class << self
|
|
28
28
|
private :_bel_index_offsets, :_bel_index_offsets=
|
29
29
|
end
|
30
30
|
self._bel_index_offsets = [
|
31
|
-
0, 0, 34, 68, 102, 136, 170,
|
32
|
-
|
31
|
+
0, 0, 34, 68, 102, 136, 170, 246,
|
32
|
+
361, 437, 551
|
33
33
|
]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, 9, 7, 7, 7, 7, 7,
|
69
87
|
7, 7, 9, 9, 9, 9, 9, 9,
|
70
|
-
9, 9, 9, 9, 7, 7, 7, 7,
|
71
|
-
7, 7, 7, 9, 9, 9, 9, 9,
|
72
88
|
9, 9, 9, 9, 9, 9, 9, 9,
|
73
89
|
9, 9, 9, 9, 9, 9, 9, 9,
|
74
|
-
9, 9, 9, 9,
|
75
|
-
|
90
|
+
9, 9, 9, 9, 7, 7, 7, 7,
|
91
|
+
9, 7, 9, 9, 9, 9, 9, 9,
|
76
92
|
9, 9, 9, 9, 9, 9, 9, 9,
|
77
93
|
9, 9, 9, 9, 9, 9, 9, 9,
|
78
|
-
9, 9, 9, 9,
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
11, 11, 11, 11, 11, 11, 11, 11,
|
87
|
-
11, 11, 11, 11, 11, 11, 11, 11,
|
88
|
-
11, 11, 11, 11, 11, 11, 11, 7,
|
89
|
-
7, 7, 7, 11, 7, 11, 11, 11,
|
90
|
-
11, 11, 11, 11, 11, 11, 11, 11,
|
91
|
-
11, 11, 11, 11, 11, 11, 11, 11,
|
92
|
-
11, 11, 11, 11, 11, 11, 11, 7,
|
93
|
-
13, 13, 13, 13, 13, 13, 13, 13,
|
94
|
-
13, 13, 12, 12, 12, 12, 12, 12,
|
95
|
-
12, 13, 13, 13, 13, 13, 13, 13,
|
96
|
-
13, 13, 13, 13, 13, 13, 13, 13,
|
97
|
-
13, 13, 13, 13, 13, 13, 13, 13,
|
98
|
-
13, 13, 13, 12, 12, 12, 12, 13,
|
99
|
-
12, 13, 13, 13, 13, 13, 13, 13,
|
100
|
-
13, 13, 13, 13, 13, 13, 13, 13,
|
101
|
-
13, 13, 13, 13, 13, 13, 13, 13,
|
102
|
-
13, 13, 13, 12, 14, 12, 12, 12,
|
94
|
+
9, 9, 9, 9, 7, 11, 10, 10,
|
95
|
+
10, 10, 10, 10, 10, 10, 10, 10,
|
96
|
+
10, 10, 10, 10, 10, 10, 10, 10,
|
97
|
+
10, 10, 10, 10, 10, 10, 10, 10,
|
98
|
+
10, 10, 10, 10, 10, 10, 10, 10,
|
99
|
+
10, 10, 10, 12, 12, 12, 12, 12,
|
100
|
+
12, 12, 12, 12, 12, 10, 10, 10,
|
101
|
+
10, 10, 10, 10, 12, 12, 12, 12,
|
103
102
|
12, 12, 12, 12, 12, 12, 12, 12,
|
104
103
|
12, 12, 12, 12, 12, 12, 12, 12,
|
104
|
+
12, 12, 12, 12, 12, 12, 10, 10,
|
105
|
+
10, 10, 12, 10, 12, 12, 12, 12,
|
105
106
|
12, 12, 12, 12, 12, 12, 12, 12,
|
106
107
|
12, 12, 12, 12, 12, 12, 12, 12,
|
107
|
-
12, 12,
|
108
|
-
15, 15, 15, 15, 12, 12, 12, 12,
|
109
|
-
12, 12, 12, 15, 15, 15, 15, 15,
|
110
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
111
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
112
|
-
15, 15, 15, 15, 15, 12, 12, 12,
|
113
|
-
12, 15, 12, 15, 15, 15, 15, 15,
|
114
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
115
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
116
|
-
15, 15, 15, 15, 15, 12, 1, 1,
|
108
|
+
12, 12, 12, 12, 12, 12, 10, 10,
|
117
109
|
0
|
118
110
|
]
|
119
111
|
|
@@ -122,8 +114,8 @@ class << self
|
|
122
114
|
private :_bel_trans_targs, :_bel_trans_targs=
|
123
115
|
end
|
124
116
|
self._bel_trans_targs = [
|
125
|
-
2, 0, 3, 4, 5,
|
126
|
-
|
117
|
+
2, 0, 3, 4, 5, 7, 9, 0,
|
118
|
+
8, 8, 0, 10, 9
|
127
119
|
]
|
128
120
|
|
129
121
|
class << self
|
@@ -131,8 +123,8 @@ class << self
|
|
131
123
|
private :_bel_trans_actions, :_bel_trans_actions=
|
132
124
|
end
|
133
125
|
self._bel_trans_actions = [
|
134
|
-
0, 0, 0, 0, 0, 0, 1,
|
135
|
-
|
126
|
+
0, 0, 0, 0, 0, 0, 1, 3,
|
127
|
+
1, 0, 6, 7, 0
|
136
128
|
]
|
137
129
|
|
138
130
|
class << self
|
@@ -141,7 +133,7 @@ class << self
|
|
141
133
|
end
|
142
134
|
self._bel_eof_actions = [
|
143
135
|
0, 0, 0, 0, 0, 0, 0, 2,
|
144
|
-
|
136
|
+
4, 5, 8
|
145
137
|
]
|
146
138
|
|
147
139
|
class << self
|
@@ -151,20 +143,20 @@ self.bel_start = 1;
|
|
151
143
|
class << self
|
152
144
|
attr_accessor :bel_first_final
|
153
145
|
end
|
154
|
-
self.bel_first_final =
|
146
|
+
self.bel_first_final = 7;
|
155
147
|
class << self
|
156
148
|
attr_accessor :bel_error
|
157
149
|
end
|
158
150
|
self.bel_error = 0;
|
159
151
|
|
160
152
|
class << self
|
161
|
-
attr_accessor :
|
153
|
+
attr_accessor :bel_en_ident_node
|
162
154
|
end
|
163
|
-
self.
|
155
|
+
self.bel_en_ident_node = 6;
|
164
156
|
class << self
|
165
|
-
attr_accessor :
|
157
|
+
attr_accessor :bel_en_unset_ast_node
|
166
158
|
end
|
167
|
-
self.
|
159
|
+
self.bel_en_unset_ast_node = 1;
|
168
160
|
|
169
161
|
|
170
162
|
begin
|
@@ -209,105 +201,155 @@ begin
|
|
209
201
|
cs = _bel_trans_targs[_trans]
|
210
202
|
if _bel_trans_actions[_trans] != 0
|
211
203
|
case _bel_trans_actions[_trans]
|
212
|
-
when
|
204
|
+
when 1 then
|
213
205
|
begin
|
214
206
|
|
215
|
-
(
|
207
|
+
trace('IDENTIFIER start_identifier')
|
208
|
+
@identifier_started = true
|
209
|
+
id_start = p;
|
216
210
|
end
|
217
|
-
when
|
211
|
+
when 7 then
|
218
212
|
begin
|
219
213
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
214
|
+
trace('IDENTIFIER end_identifier')
|
215
|
+
id_end = p
|
216
|
+
chars = data[id_start...id_end]
|
217
|
+
completed = !chars.empty?
|
218
|
+
ast_node = identifier(utf8_string(chars), complete: completed)
|
219
|
+
@buffers[:ident] = ast_node
|
224
220
|
end
|
225
|
-
when
|
221
|
+
when 3 then
|
226
222
|
begin
|
227
223
|
|
228
|
-
|
224
|
+
trace('IDENTIFIER an_ident_err')
|
225
|
+
id_end = p
|
226
|
+
chars = data[id_start...id_end]
|
227
|
+
ast_node = identifier(utf8_string(chars), complete: false)
|
228
|
+
@buffers[:ident] = ast_node
|
229
229
|
end
|
230
|
-
when
|
230
|
+
when 6 then
|
231
231
|
begin
|
232
232
|
|
233
|
-
|
233
|
+
trace('IDENTIFIER ident_node_err')
|
234
|
+
id_end = p
|
235
|
+
chars = data[id_start...id_end]
|
236
|
+
ast_node = identifier(utf8_string(chars), complete: false)
|
237
|
+
yield ast_node
|
234
238
|
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
if _goto_level <= _again
|
243
|
+
if cs == 0
|
244
|
+
_goto_level = _out
|
245
|
+
next
|
246
|
+
end
|
247
|
+
p += 1
|
248
|
+
if p != pe
|
249
|
+
_goto_level = _resume
|
250
|
+
next
|
251
|
+
end
|
252
|
+
end
|
253
|
+
if _goto_level <= _test_eof
|
254
|
+
if p == eof
|
255
|
+
case _bel_eof_actions[cs]
|
256
|
+
when 8 then
|
235
257
|
begin
|
236
258
|
|
237
|
-
(
|
259
|
+
trace('IDENTIFIER yield_identifier')
|
260
|
+
yield @buffers[:ident]
|
238
261
|
end
|
239
|
-
when
|
262
|
+
when 5 then
|
240
263
|
begin
|
241
264
|
|
242
|
-
|
265
|
+
trace('IDENTIFIER end_identifier')
|
266
|
+
id_end = p
|
267
|
+
chars = data[id_start...id_end]
|
268
|
+
completed = !chars.empty?
|
269
|
+
ast_node = identifier(utf8_string(chars), complete: completed)
|
270
|
+
@buffers[:ident] = ast_node
|
243
271
|
end
|
244
272
|
begin
|
245
273
|
|
274
|
+
trace('IDENTIFIER yield_identifier')
|
246
275
|
yield @buffers[:ident]
|
247
276
|
end
|
248
|
-
when
|
277
|
+
when 2 then
|
249
278
|
begin
|
250
279
|
|
251
|
-
|
252
|
-
|
253
|
-
|
280
|
+
trace('IDENTIFIER an_ident_eof')
|
281
|
+
if @identifier_started
|
282
|
+
id_end = p
|
283
|
+
chars = data[id_start...id_end]
|
284
|
+
completed = !chars.empty?
|
285
|
+
ast_node = identifier(utf8_string(chars), complete: completed)
|
286
|
+
@buffers[:ident] = ast_node
|
254
287
|
end
|
255
288
|
end
|
256
289
|
begin
|
257
290
|
|
258
|
-
|
259
|
-
|
291
|
+
trace('UNSET add_name')
|
292
|
+
key = @buffers.delete(:ident)
|
293
|
+
@buffers[:unset_name] = key
|
260
294
|
end
|
261
|
-
when 4 then
|
262
295
|
begin
|
263
296
|
|
264
|
-
|
297
|
+
trace('UNSET unset_end')
|
298
|
+
name = @buffers.delete(:unset_name)
|
299
|
+
unless name.nil?
|
300
|
+
unset_node = unset(name, complete: name.complete)
|
301
|
+
else
|
302
|
+
unset_node = unset(complete: false)
|
303
|
+
end
|
304
|
+
@buffers[:unset] = unset_node
|
265
305
|
end
|
266
306
|
begin
|
267
307
|
|
268
|
-
|
308
|
+
trace('UNSET yield_unset')
|
309
|
+
yield @buffers[:unset]
|
269
310
|
end
|
311
|
+
when 4 then
|
270
312
|
begin
|
271
313
|
|
272
|
-
|
314
|
+
trace('IDENTIFIER end_identifier')
|
315
|
+
id_end = p
|
316
|
+
chars = data[id_start...id_end]
|
317
|
+
completed = !chars.empty?
|
318
|
+
ast_node = identifier(utf8_string(chars), complete: completed)
|
319
|
+
@buffers[:ident] = ast_node
|
273
320
|
end
|
274
|
-
end
|
275
|
-
end
|
276
|
-
end
|
277
|
-
if _goto_level <= _again
|
278
|
-
if cs == 0
|
279
|
-
_goto_level = _out
|
280
|
-
next
|
281
|
-
end
|
282
|
-
p += 1
|
283
|
-
if p != pe
|
284
|
-
_goto_level = _resume
|
285
|
-
next
|
286
|
-
end
|
287
|
-
end
|
288
|
-
if _goto_level <= _test_eof
|
289
|
-
if p == eof
|
290
|
-
case _bel_eof_actions[cs]
|
291
|
-
when 2 then
|
292
321
|
begin
|
293
322
|
|
294
|
-
|
295
|
-
|
296
|
-
|
323
|
+
trace('IDENTIFIER an_ident_eof')
|
324
|
+
if @identifier_started
|
325
|
+
id_end = p
|
326
|
+
chars = data[id_start...id_end]
|
327
|
+
completed = !chars.empty?
|
328
|
+
ast_node = identifier(utf8_string(chars), complete: completed)
|
329
|
+
@buffers[:ident] = ast_node
|
297
330
|
end
|
298
331
|
end
|
299
|
-
when 6 then
|
300
332
|
begin
|
301
333
|
|
302
|
-
|
303
|
-
|
304
|
-
|
334
|
+
trace('UNSET add_name')
|
335
|
+
key = @buffers.delete(:ident)
|
336
|
+
@buffers[:unset_name] = key
|
337
|
+
end
|
338
|
+
begin
|
339
|
+
|
340
|
+
trace('UNSET unset_end')
|
341
|
+
name = @buffers.delete(:unset_name)
|
342
|
+
unless name.nil?
|
343
|
+
unset_node = unset(name, complete: name.complete)
|
344
|
+
else
|
345
|
+
unset_node = unset(complete: false)
|
305
346
|
end
|
347
|
+
@buffers[:unset] = unset_node
|
306
348
|
end
|
307
349
|
begin
|
308
350
|
|
309
|
-
|
310
|
-
yield @buffers[:
|
351
|
+
trace('UNSET yield_unset')
|
352
|
+
yield @buffers[:unset]
|
311
353
|
end
|
312
354
|
end
|
313
355
|
end
|
@@ -326,6 +368,7 @@ end
|
|
326
368
|
require_relative '../ast/node'
|
327
369
|
require_relative '../mixin/buffer'
|
328
370
|
require_relative '../nonblocking_io_wrapper'
|
371
|
+
require_relative '../tracer'
|
329
372
|
|
330
373
|
module BELParser
|
331
374
|
module Parsers
|
@@ -351,10 +394,11 @@ module BELParser
|
|
351
394
|
include Enumerable
|
352
395
|
include BELParser::Parsers::Buffer
|
353
396
|
include BELParser::Parsers::AST::Sexp
|
397
|
+
include BELParser::Parsers::Tracer
|
354
398
|
|
355
399
|
def initialize(content)
|
356
400
|
@content = content
|
357
|
-
# begin: ragel
|
401
|
+
# begin: ragel
|
358
402
|
|
359
403
|
class << self
|
360
404
|
attr_accessor :_bel_trans_keys
|
@@ -363,9 +407,9 @@ end
|
|
363
407
|
self._bel_trans_keys = [
|
364
408
|
0, 0, 85, 117, 78, 110,
|
365
409
|
83, 115, 69, 101, 84,
|
366
|
-
116,
|
367
|
-
|
368
|
-
0
|
410
|
+
116, 48, 122, 9, 122,
|
411
|
+
48, 122, 10, 122, 0, 0,
|
412
|
+
0
|
369
413
|
]
|
370
414
|
|
371
415
|
class << self
|
@@ -373,8 +417,8 @@ class << self
|
|
373
417
|
private :_bel_key_spans, :_bel_key_spans=
|
374
418
|
end
|
375
419
|
self._bel_key_spans = [
|
376
|
-
0, 33, 33, 33, 33, 33,
|
377
|
-
|
420
|
+
0, 33, 33, 33, 33, 33, 75, 114,
|
421
|
+
75, 113, 0
|
378
422
|
]
|
379
423
|
|
380
424
|
class << self
|
@@ -382,8 +426,8 @@ class << self
|
|
382
426
|
private :_bel_index_offsets, :_bel_index_offsets=
|
383
427
|
end
|
384
428
|
self._bel_index_offsets = [
|
385
|
-
0, 0, 34, 68, 102, 136, 170,
|
386
|
-
|
429
|
+
0, 0, 34, 68, 102, 136, 170, 246,
|
430
|
+
361, 437, 551
|
387
431
|
]
|
388
432
|
|
389
433
|
class << self
|
@@ -412,62 +456,54 @@ self._bel_indicies = [
|
|
412
456
|
1, 1, 1, 1, 1, 1, 1, 1,
|
413
457
|
1, 1, 1, 1, 1, 1, 1, 1,
|
414
458
|
1, 1, 1, 1, 1, 1, 1, 1,
|
415
|
-
5, 1, 6,
|
416
|
-
|
417
|
-
1, 1, 1,
|
418
|
-
|
459
|
+
5, 1, 6, 6, 6, 6, 6, 6,
|
460
|
+
6, 6, 6, 6, 1, 1, 1, 1,
|
461
|
+
1, 1, 1, 6, 6, 6, 6, 6,
|
462
|
+
6, 6, 6, 6, 6, 6, 6, 6,
|
463
|
+
6, 6, 6, 6, 6, 6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9, 9,
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
11, 11, 11, 11, 11, 11, 11, 11,
|
441
|
-
11, 11, 11, 11, 11, 11, 11, 11,
|
442
|
-
11, 11, 11, 11, 11, 11, 11, 7,
|
443
|
-
7, 7, 7, 11, 7, 11, 11, 11,
|
444
|
-
11, 11, 11, 11, 11, 11, 11, 11,
|
445
|
-
11, 11, 11, 11, 11, 11, 11, 11,
|
446
|
-
11, 11, 11, 11, 11, 11, 11, 7,
|
447
|
-
13, 13, 13, 13, 13, 13, 13, 13,
|
448
|
-
13, 13, 12, 12, 12, 12, 12, 12,
|
449
|
-
12, 13, 13, 13, 13, 13, 13, 13,
|
450
|
-
13, 13, 13, 13, 13, 13, 13, 13,
|
451
|
-
13, 13, 13, 13, 13, 13, 13, 13,
|
452
|
-
13, 13, 13, 12, 12, 12, 12, 13,
|
453
|
-
12, 13, 13, 13, 13, 13, 13, 13,
|
454
|
-
13, 13, 13, 13, 13, 13, 13, 13,
|
455
|
-
13, 13, 13, 13, 13, 13, 13, 13,
|
456
|
-
13, 13, 13, 12, 14, 12, 12, 12,
|
492
|
+
9, 9, 9, 9, 7, 11, 10, 10,
|
493
|
+
10, 10, 10, 10, 10, 10, 10, 10,
|
494
|
+
10, 10, 10, 10, 10, 10, 10, 10,
|
495
|
+
10, 10, 10, 10, 10, 10, 10, 10,
|
496
|
+
10, 10, 10, 10, 10, 10, 10, 10,
|
497
|
+
10, 10, 10, 12, 12, 12, 12, 12,
|
498
|
+
12, 12, 12, 12, 12, 10, 10, 10,
|
499
|
+
10, 10, 10, 10, 12, 12, 12, 12,
|
457
500
|
12, 12, 12, 12, 12, 12, 12, 12,
|
458
501
|
12, 12, 12, 12, 12, 12, 12, 12,
|
502
|
+
12, 12, 12, 12, 12, 12, 10, 10,
|
503
|
+
10, 10, 12, 10, 12, 12, 12, 12,
|
459
504
|
12, 12, 12, 12, 12, 12, 12, 12,
|
460
505
|
12, 12, 12, 12, 12, 12, 12, 12,
|
461
|
-
12, 12,
|
462
|
-
15, 15, 15, 15, 12, 12, 12, 12,
|
463
|
-
12, 12, 12, 15, 15, 15, 15, 15,
|
464
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
465
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
466
|
-
15, 15, 15, 15, 15, 12, 12, 12,
|
467
|
-
12, 15, 12, 15, 15, 15, 15, 15,
|
468
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
469
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
470
|
-
15, 15, 15, 15, 15, 12, 1, 1,
|
506
|
+
12, 12, 12, 12, 12, 12, 10, 10,
|
471
507
|
0
|
472
508
|
]
|
473
509
|
|
@@ -476,8 +512,8 @@ class << self
|
|
476
512
|
private :_bel_trans_targs, :_bel_trans_targs=
|
477
513
|
end
|
478
514
|
self._bel_trans_targs = [
|
479
|
-
2, 0, 3, 4, 5,
|
480
|
-
|
515
|
+
2, 0, 3, 4, 5, 7, 9, 0,
|
516
|
+
8, 8, 0, 10, 9
|
481
517
|
]
|
482
518
|
|
483
519
|
class << self
|
@@ -485,8 +521,8 @@ class << self
|
|
485
521
|
private :_bel_trans_actions, :_bel_trans_actions=
|
486
522
|
end
|
487
523
|
self._bel_trans_actions = [
|
488
|
-
0, 0, 0, 0, 0, 0, 1,
|
489
|
-
|
524
|
+
0, 0, 0, 0, 0, 0, 1, 3,
|
525
|
+
1, 0, 6, 7, 0
|
490
526
|
]
|
491
527
|
|
492
528
|
class << self
|
@@ -495,7 +531,7 @@ class << self
|
|
495
531
|
end
|
496
532
|
self._bel_eof_actions = [
|
497
533
|
0, 0, 0, 0, 0, 0, 0, 2,
|
498
|
-
|
534
|
+
4, 5, 8
|
499
535
|
]
|
500
536
|
|
501
537
|
class << self
|
@@ -505,33 +541,34 @@ self.bel_start = 1;
|
|
505
541
|
class << self
|
506
542
|
attr_accessor :bel_first_final
|
507
543
|
end
|
508
|
-
self.bel_first_final =
|
544
|
+
self.bel_first_final = 7;
|
509
545
|
class << self
|
510
546
|
attr_accessor :bel_error
|
511
547
|
end
|
512
548
|
self.bel_error = 0;
|
513
549
|
|
514
550
|
class << self
|
515
|
-
attr_accessor :
|
551
|
+
attr_accessor :bel_en_ident_node
|
516
552
|
end
|
517
|
-
self.
|
553
|
+
self.bel_en_ident_node = 6;
|
518
554
|
class << self
|
519
|
-
attr_accessor :
|
555
|
+
attr_accessor :bel_en_unset_ast_node
|
520
556
|
end
|
521
|
-
self.
|
557
|
+
self.bel_en_unset_ast_node = 1;
|
522
558
|
|
523
559
|
|
524
|
-
# end: ragel
|
560
|
+
# end: ragel
|
525
561
|
end
|
526
562
|
|
527
563
|
def each
|
528
|
-
@buffers
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
564
|
+
@buffers = {}
|
565
|
+
@incomplete = {}
|
566
|
+
data = @content.unpack('C*')
|
567
|
+
p = 0
|
568
|
+
pe = data.length
|
569
|
+
eof = data.length
|
570
|
+
|
571
|
+
# begin: ragel
|
535
572
|
|
536
573
|
begin
|
537
574
|
p ||= 0
|
@@ -576,105 +613,155 @@ begin
|
|
576
613
|
cs = _bel_trans_targs[_trans]
|
577
614
|
if _bel_trans_actions[_trans] != 0
|
578
615
|
case _bel_trans_actions[_trans]
|
579
|
-
when
|
616
|
+
when 1 then
|
580
617
|
begin
|
581
618
|
|
582
|
-
(
|
619
|
+
trace('IDENTIFIER start_identifier')
|
620
|
+
@identifier_started = true
|
621
|
+
id_start = p;
|
583
622
|
end
|
584
|
-
when
|
623
|
+
when 7 then
|
585
624
|
begin
|
586
625
|
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
626
|
+
trace('IDENTIFIER end_identifier')
|
627
|
+
id_end = p
|
628
|
+
chars = data[id_start...id_end]
|
629
|
+
completed = !chars.empty?
|
630
|
+
ast_node = identifier(utf8_string(chars), complete: completed)
|
631
|
+
@buffers[:ident] = ast_node
|
591
632
|
end
|
592
|
-
when
|
633
|
+
when 3 then
|
593
634
|
begin
|
594
635
|
|
595
|
-
|
636
|
+
trace('IDENTIFIER an_ident_err')
|
637
|
+
id_end = p
|
638
|
+
chars = data[id_start...id_end]
|
639
|
+
ast_node = identifier(utf8_string(chars), complete: false)
|
640
|
+
@buffers[:ident] = ast_node
|
596
641
|
end
|
597
|
-
when
|
642
|
+
when 6 then
|
598
643
|
begin
|
599
644
|
|
600
|
-
|
645
|
+
trace('IDENTIFIER ident_node_err')
|
646
|
+
id_end = p
|
647
|
+
chars = data[id_start...id_end]
|
648
|
+
ast_node = identifier(utf8_string(chars), complete: false)
|
649
|
+
yield ast_node
|
601
650
|
end
|
651
|
+
end
|
652
|
+
end
|
653
|
+
end
|
654
|
+
if _goto_level <= _again
|
655
|
+
if cs == 0
|
656
|
+
_goto_level = _out
|
657
|
+
next
|
658
|
+
end
|
659
|
+
p += 1
|
660
|
+
if p != pe
|
661
|
+
_goto_level = _resume
|
662
|
+
next
|
663
|
+
end
|
664
|
+
end
|
665
|
+
if _goto_level <= _test_eof
|
666
|
+
if p == eof
|
667
|
+
case _bel_eof_actions[cs]
|
668
|
+
when 8 then
|
602
669
|
begin
|
603
670
|
|
604
|
-
(
|
671
|
+
trace('IDENTIFIER yield_identifier')
|
672
|
+
yield @buffers[:ident]
|
605
673
|
end
|
606
|
-
when
|
674
|
+
when 5 then
|
607
675
|
begin
|
608
676
|
|
609
|
-
|
677
|
+
trace('IDENTIFIER end_identifier')
|
678
|
+
id_end = p
|
679
|
+
chars = data[id_start...id_end]
|
680
|
+
completed = !chars.empty?
|
681
|
+
ast_node = identifier(utf8_string(chars), complete: completed)
|
682
|
+
@buffers[:ident] = ast_node
|
610
683
|
end
|
611
684
|
begin
|
612
685
|
|
686
|
+
trace('IDENTIFIER yield_identifier')
|
613
687
|
yield @buffers[:ident]
|
614
688
|
end
|
615
|
-
when
|
689
|
+
when 2 then
|
616
690
|
begin
|
617
691
|
|
618
|
-
|
619
|
-
|
620
|
-
|
692
|
+
trace('IDENTIFIER an_ident_eof')
|
693
|
+
if @identifier_started
|
694
|
+
id_end = p
|
695
|
+
chars = data[id_start...id_end]
|
696
|
+
completed = !chars.empty?
|
697
|
+
ast_node = identifier(utf8_string(chars), complete: completed)
|
698
|
+
@buffers[:ident] = ast_node
|
621
699
|
end
|
622
700
|
end
|
623
701
|
begin
|
624
702
|
|
625
|
-
|
626
|
-
|
703
|
+
trace('UNSET add_name')
|
704
|
+
key = @buffers.delete(:ident)
|
705
|
+
@buffers[:unset_name] = key
|
627
706
|
end
|
628
|
-
when 4 then
|
629
707
|
begin
|
630
708
|
|
631
|
-
|
709
|
+
trace('UNSET unset_end')
|
710
|
+
name = @buffers.delete(:unset_name)
|
711
|
+
unless name.nil?
|
712
|
+
unset_node = unset(name, complete: name.complete)
|
713
|
+
else
|
714
|
+
unset_node = unset(complete: false)
|
715
|
+
end
|
716
|
+
@buffers[:unset] = unset_node
|
632
717
|
end
|
633
718
|
begin
|
634
719
|
|
635
|
-
|
720
|
+
trace('UNSET yield_unset')
|
721
|
+
yield @buffers[:unset]
|
636
722
|
end
|
723
|
+
when 4 then
|
637
724
|
begin
|
638
725
|
|
639
|
-
|
726
|
+
trace('IDENTIFIER end_identifier')
|
727
|
+
id_end = p
|
728
|
+
chars = data[id_start...id_end]
|
729
|
+
completed = !chars.empty?
|
730
|
+
ast_node = identifier(utf8_string(chars), complete: completed)
|
731
|
+
@buffers[:ident] = ast_node
|
640
732
|
end
|
641
|
-
end
|
642
|
-
end
|
643
|
-
end
|
644
|
-
if _goto_level <= _again
|
645
|
-
if cs == 0
|
646
|
-
_goto_level = _out
|
647
|
-
next
|
648
|
-
end
|
649
|
-
p += 1
|
650
|
-
if p != pe
|
651
|
-
_goto_level = _resume
|
652
|
-
next
|
653
|
-
end
|
654
|
-
end
|
655
|
-
if _goto_level <= _test_eof
|
656
|
-
if p == eof
|
657
|
-
case _bel_eof_actions[cs]
|
658
|
-
when 2 then
|
659
733
|
begin
|
660
734
|
|
661
|
-
|
662
|
-
|
663
|
-
|
735
|
+
trace('IDENTIFIER an_ident_eof')
|
736
|
+
if @identifier_started
|
737
|
+
id_end = p
|
738
|
+
chars = data[id_start...id_end]
|
739
|
+
completed = !chars.empty?
|
740
|
+
ast_node = identifier(utf8_string(chars), complete: completed)
|
741
|
+
@buffers[:ident] = ast_node
|
664
742
|
end
|
665
743
|
end
|
666
|
-
when 6 then
|
667
744
|
begin
|
668
745
|
|
669
|
-
|
670
|
-
|
671
|
-
|
746
|
+
trace('UNSET add_name')
|
747
|
+
key = @buffers.delete(:ident)
|
748
|
+
@buffers[:unset_name] = key
|
749
|
+
end
|
750
|
+
begin
|
751
|
+
|
752
|
+
trace('UNSET unset_end')
|
753
|
+
name = @buffers.delete(:unset_name)
|
754
|
+
unless name.nil?
|
755
|
+
unset_node = unset(name, complete: name.complete)
|
756
|
+
else
|
757
|
+
unset_node = unset(complete: false)
|
672
758
|
end
|
759
|
+
@buffers[:unset] = unset_node
|
673
760
|
end
|
674
761
|
begin
|
675
762
|
|
676
|
-
|
677
|
-
yield @buffers[:
|
763
|
+
trace('UNSET yield_unset')
|
764
|
+
yield @buffers[:unset]
|
678
765
|
end
|
679
766
|
end
|
680
767
|
end
|
@@ -686,7 +773,7 @@ begin
|
|
686
773
|
end
|
687
774
|
end
|
688
775
|
|
689
|
-
# end: ragel
|
776
|
+
# end: ragel
|
690
777
|
end
|
691
778
|
end
|
692
779
|
end
|