bel_parser 1.0.0.alpha.38 → 1.0.0.alpha.39

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.gemspec +1 -1
  3. data/VERSION +1 -1
  4. data/lib/bel_parser/ast_filter.rb +6 -2
  5. data/lib/bel_parser/parsers/ast/node.rb +113 -58
  6. data/lib/bel_parser/parsers/bel_script/define_annotation.rb +4175 -3097
  7. data/lib/bel_parser/parsers/bel_script/define_annotation.rl +142 -49
  8. data/lib/bel_parser/parsers/bel_script/define_namespace.rb +980 -461
  9. data/lib/bel_parser/parsers/bel_script/define_namespace.rl +79 -39
  10. data/lib/bel_parser/parsers/bel_script/set.rb +4878 -2743
  11. data/lib/bel_parser/parsers/bel_script/set.rl +114 -32
  12. data/lib/bel_parser/parsers/bel_script/set_document.rb +5839 -5292
  13. data/lib/bel_parser/parsers/bel_script/set_document.rl +130 -27
  14. data/lib/bel_parser/parsers/bel_script/unset.rb +321 -234
  15. data/lib/bel_parser/parsers/bel_script/unset.rl +49 -21
  16. data/lib/bel_parser/parsers/common.rb +1 -0
  17. data/lib/bel_parser/parsers/common/blank_line.rb +12 -11
  18. data/lib/bel_parser/parsers/common/blank_line.rl +12 -12
  19. data/lib/bel_parser/parsers/common/comment_line.rb +65 -40
  20. data/lib/bel_parser/parsers/common/comment_line.rl +26 -26
  21. data/lib/bel_parser/parsers/common/common.rl +60 -0
  22. data/lib/bel_parser/parsers/common/function.rb +319 -0
  23. data/lib/bel_parser/parsers/common/function.rl +149 -0
  24. data/lib/bel_parser/parsers/common/identifier.rb +72 -68
  25. data/lib/bel_parser/parsers/common/identifier.rl +73 -29
  26. data/lib/bel_parser/parsers/common/list.rb +1617 -1243
  27. data/lib/bel_parser/parsers/common/list.rl +120 -60
  28. data/lib/bel_parser/parsers/common/string.rb +114 -41
  29. data/lib/bel_parser/parsers/common/string.rl +91 -28
  30. data/lib/bel_parser/parsers/expression/comment.rb +70 -38
  31. data/lib/bel_parser/parsers/expression/comment.rl +37 -20
  32. data/lib/bel_parser/parsers/expression/nested_statement.rb +63116 -13958
  33. data/lib/bel_parser/parsers/expression/nested_statement.rl +53 -23
  34. data/lib/bel_parser/parsers/expression/observed_term.rb +32497 -5188
  35. data/lib/bel_parser/parsers/expression/observed_term.rl +25 -20
  36. data/lib/bel_parser/parsers/expression/parameter.rb +2861 -847
  37. data/lib/bel_parser/parsers/expression/parameter.rl +178 -21
  38. data/lib/bel_parser/parsers/expression/relationship.rb +73 -55
  39. data/lib/bel_parser/parsers/expression/relationship.rl +41 -23
  40. data/lib/bel_parser/parsers/expression/simple_statement.rb +42895 -7846
  41. data/lib/bel_parser/parsers/expression/simple_statement.rl +41 -24
  42. data/lib/bel_parser/parsers/expression/term.rb +16498 -2602
  43. data/lib/bel_parser/parsers/expression/term.rl +52 -35
  44. data/lib/bel_parser/parsers/line_parser.rb +1 -0
  45. data/lib/bel_parser/parsers/mixin/buffer.rb +4 -0
  46. data/lib/bel_parser/parsers/tracer.rb +19 -0
  47. data/lib/bel_parser/script/state/namespace_definition.rb +1 -0
  48. metadata +13 -9
@@ -8,69 +8,156 @@
8
8
  include 'string.rl';
9
9
  include 'list.rl';
10
10
 
11
- DEFINE_KW = [dD][eE][fF][iI][nN][eE];
12
- ANNOTATION_KW = [aA][nN][nN][oO][tT][aA][tT][iI][oO][nN];
13
- AS_KW = [aA][sS];
14
- LIST_KW = [lL][iI][sS][tT];
15
- PATTERN_KW = [pP][aA][tT][tT][eE][rR][nN];
16
- URL_KW = [uU][rR][lL];
17
-
18
- action annotation_keyword {
19
- @buffers[:annotation_definition] = annotation_definition()
11
+ action add_name {
12
+ trace('DEFINE_ANNOTATION add_name')
13
+ name = @buffers.delete(:ident)
14
+ @buffers[:annotation_definition_name] = name
20
15
  }
21
16
 
22
- action keyword {
23
- @buffers[:annotation_definition] = annotation_definition(
24
- keyword(@buffers[:ident]))
17
+ action add_string_value {
18
+ trace('DEFINE_ANNOTATION add_string_value')
19
+ string_node = @buffers.delete(:string)
20
+ if @url_domain
21
+ leaf = domain(url(string_node))
22
+ leaf.complete = string_node.complete
23
+ elsif @pattern_domain
24
+ leaf = domain(pattern(string_node))
25
+ leaf.complete = string_node.complete
26
+ else
27
+ leaf = domain(string_node)
28
+ # defined as list, given string
29
+ leaf.complete = false
30
+ end
31
+ @buffers[:annotation_definition_domain] = leaf
25
32
  }
26
33
 
27
- action list_keyword {
28
- @buffers[:annotation_definition] = @buffers[:annotation_definition] << domain()
34
+ action add_list_value {
35
+ trace('DEFINE_ANNOTATION add_list_value')
36
+ list_node = @buffers.delete(:list)
37
+ if @url_domain
38
+ leaf = domain(url(list_node))
39
+ # defined as url, given list
40
+ leaf.completed = false
41
+ elsif @pattern_domain
42
+ leaf = domain(pattern(list_node))
43
+ # defined as url, given pattern
44
+ leaf.complete = false
45
+ else
46
+ leaf = domain(list_node)
47
+ leaf.complete = list_node.complete
48
+ end
49
+ @buffers[:annotation_definition_domain] = leaf
29
50
  }
30
51
 
31
- action pattern_keyword {
32
- @buffers[:annotation_definition] = @buffers[:annotation_definition] << domain(pattern())
52
+ action add_list_domain {
53
+ trace('DEFINE_ANNOTATION add_list_domain')
54
+ @list_domain = true
33
55
  }
34
56
 
35
- action url_keyword {
36
- @buffers[:annotation_definition] = @buffers[:annotation_definition] << domain(url())
57
+ action add_url_domain {
58
+ trace('DEFINE_ANNOTATION add_url_domain')
59
+ @url_domain = true
37
60
  }
38
61
 
39
- action pattern {
40
- keyword, domain = @buffers[:annotation_definition].children
41
- domain = domain(
42
- domain.children[0] << @buffers[:string])
43
- @buffers[:annotation_definition] = annotation_definition(keyword, domain)
62
+ action add_pattern_domain {
63
+ trace('DEFINE_ANNOTATION add_pattern_domain')
64
+ @pattern_domain = true
44
65
  }
45
66
 
46
- action url {
47
- keyword, domain = @buffers[:annotation_definition].children
48
- domain = domain(
49
- domain.children[0] << @buffers[:string])
50
- @buffers[:annotation_definition] = annotation_definition(keyword, domain)
67
+ action define_annotation_end {
68
+ trace('DEFINE_ANNOTATION define_annotation_end')
69
+ annotation_definition_node = annotation_definition()
70
+ domain = @buffers.delete(:annotation_definition_domain)
71
+ unless domain.nil?
72
+ annotation_definition_node <<= domain
73
+ annotation_definition_node.complete = domain.complete
74
+ end
75
+ @buffers[:annotation_definition] = annotation_definition_node
51
76
  }
52
77
 
53
- action list {
54
- keyword, domain = @buffers[:annotation_definition].children
55
- domain = domain(
56
- @buffers[:list])
57
- @buffers[:annotation_definition] = annotation_definition(keyword, domain)
78
+ action yield_define_annotation {
79
+ trace('DEFINE_ANNOTATION yield_define_annotation')
80
+ yield @buffers[:annotation_definition]
58
81
  }
59
82
 
60
- action yield_annotation_definition {
61
- yield @buffers[:annotation_definition]
83
+ action define_annotation_node_eof {
84
+ trace('DEFINE_ANNOTATION define_annotation_node_eof')
85
+ annotation_definition_node = annotation_definition()
86
+ if @url_domain
87
+ domain_node = domain(url())
88
+ elsif @pattern_domain
89
+ domain_node = domain(pattern())
90
+ else
91
+ domain_node = domain()
92
+ end
93
+
94
+ domain_node.complete = false
95
+ list_node = @buffers.delete(:list)
96
+ unless list_node.nil?
97
+ domain_node <<= list_node
98
+ domain_node.complete = list_node.complete
99
+ end
100
+ string_node = @buffers.delete(:string)
101
+ unless string_node.nil?
102
+ domain_node <<= string_node
103
+ domain_node.complete = string_node.complete
104
+ end
105
+ annotation_definition_node <<= domain_node
106
+ annotation_definition_node.complete = domain_node.complete
107
+ yield annotation_definition_node
62
108
  }
63
109
 
64
- # Define FSM
65
- annotation_definition :=
66
- DEFINE_KW SP+ ANNOTATION_KW @annotation_keyword SP+
67
- IDENT %keyword SP+
68
- AS_KW SP+
69
- (
70
- (LIST_KW %list_keyword SP+ LIST %list SP* NL @yield_annotation_definition) |
71
- (PATTERN_KW %pattern_keyword SP+ STRING %pattern SP* NL @yield_annotation_definition) |
72
- (URL_KW %url_keyword SP+ STRING %url SP* NL @yield_annotation_definition)
73
- );
110
+ string_value =
111
+ a_string
112
+ %add_string_value
113
+ ;
114
+
115
+ list_value =
116
+ a_list
117
+ %add_list_value
118
+ ;
119
+
120
+ value =
121
+ string_value |
122
+ list_value
123
+ ;
124
+
125
+ list_domain =
126
+ KW_LIST
127
+ %add_list_domain
128
+ ;
129
+
130
+ url_domain =
131
+ KW_URL
132
+ %add_url_domain
133
+ ;
134
+
135
+ pattern_domain =
136
+ KW_PATTERN
137
+ %add_pattern_domain
138
+ ;
139
+
140
+ domain =
141
+ list_domain |
142
+ url_domain |
143
+ pattern_domain
144
+ ;
145
+
146
+ define_annotation_node :=
147
+ DEFINE_ANNOTATION
148
+ SP+
149
+ an_ident
150
+ %add_name
151
+ SP+
152
+ KW_AS
153
+ SP+
154
+ domain
155
+ SP+
156
+ value
157
+ @eof(define_annotation_node_eof)
158
+ %define_annotation_end
159
+ %yield_define_annotation
160
+ ;
74
161
  }%%
75
162
  =end
76
163
  # end: ragel
@@ -78,6 +165,7 @@
78
165
  require_relative '../ast/node'
79
166
  require_relative '../mixin/buffer'
80
167
  require_relative '../nonblocking_io_wrapper'
168
+ require_relative '../tracer'
81
169
 
82
170
  module BELParser
83
171
  module Parsers
@@ -103,25 +191,30 @@ module BELParser
103
191
  include Enumerable
104
192
  include BELParser::Parsers::Buffer
105
193
  include BELParser::Parsers::AST::Sexp
194
+ include BELParser::Parsers::Tracer
106
195
 
107
196
  def initialize(content)
108
197
  @content = content
109
- # begin: ragel
198
+ # begin: ragel
110
199
  %% write data;
111
- # end: ragel
200
+ # end: ragel
112
201
  end
113
202
 
114
203
  def each
115
204
  @buffers = {}
205
+ @incomplete = {}
206
+ @list_domain = false
207
+ @url_domain = false
208
+ @pattern_domain = false
116
209
  data = @content.unpack('C*')
117
210
  p = 0
118
211
  pe = data.length
119
212
  eof = data.length
120
213
 
121
- # begin: ragel
214
+ # begin: ragel
122
215
  %% write init;
123
216
  %% write exec;
124
- # end: ragel
217
+ # end: ragel
125
218
  end
126
219
  end
127
220
  end
@@ -17,11 +17,11 @@ self._bel_trans_keys = [
17
17
  9, 122, 9, 97, 83,
18
18
  115, 9, 32, 9, 117,
19
19
  82, 114, 76, 108, 9, 32,
20
- 9, 34, 34, 92, 9,
21
- 32, 9, 32, 92, 92,
22
- 48, 122, 10, 122, 34, 34,
23
- 34, 92, 10, 10, 92,
24
- 92, 0, 0, 0, 0,
20
+ 9, 34, 34, 92, 34,
21
+ 92, 10, 10, 0, 0,
22
+ 48, 122, 9, 34, 34, 92,
23
+ 34, 92, 0, 0, 0,
24
+ 0, 10, 122, 0, 0,
25
25
  0, 0, 0
26
26
  ]
27
27
 
@@ -33,8 +33,8 @@ self._bel_key_spans = [
33
33
  0, 33, 33, 33, 33, 33, 33, 24,
34
34
  102, 33, 33, 33, 33, 33, 33, 33,
35
35
  33, 24, 114, 114, 89, 33, 24, 109,
36
- 33, 33, 24, 26, 59, 24, 24, 1,
37
- 75, 113, 1, 59, 1, 1, 0, 0,
36
+ 33, 33, 24, 26, 59, 59, 1, 0,
37
+ 75, 26, 59, 59, 0, 0, 113, 0,
38
38
  0
39
39
  ]
40
40
 
@@ -46,9 +46,9 @@ self._bel_index_offsets = [
46
46
  0, 0, 34, 68, 102, 136, 170, 204,
47
47
  229, 332, 366, 400, 434, 468, 502, 536,
48
48
  570, 604, 629, 744, 859, 949, 983, 1008,
49
- 1118, 1152, 1186, 1211, 1238, 1298, 1323, 1348,
50
- 1350, 1426, 1540, 1542, 1602, 1604, 1606, 1607,
51
- 1608
49
+ 1118, 1152, 1186, 1211, 1238, 1298, 1358, 1360,
50
+ 1361, 1437, 1464, 1524, 1584, 1585, 1586, 1700,
51
+ 1701
52
52
  ]
53
53
 
54
54
  class << self
@@ -207,57 +207,68 @@ self._bel_indicies = [
207
207
  28, 1, 29, 1, 1, 1, 1, 1,
208
208
  1, 1, 1, 1, 1, 1, 1, 1,
209
209
  1, 1, 1, 1, 1, 1, 1, 1,
210
- 1, 29, 1, 29, 30, 30, 30, 30,
210
+ 1, 29, 1, 31, 31, 31, 31, 31,
211
211
  30, 30, 30, 30, 30, 30, 30, 30,
212
212
  30, 30, 30, 30, 30, 30, 30, 30,
213
- 30, 30, 29, 30, 31, 30, 33, 32,
214
- 32, 32, 32, 32, 32, 32, 32, 32,
215
- 32, 32, 32, 32, 32, 32, 32, 32,
216
- 32, 32, 32, 32, 32, 32, 32, 32,
217
- 32, 32, 32, 32, 32, 32, 32, 32,
218
- 32, 32, 32, 32, 32, 32, 32, 32,
219
- 32, 32, 32, 32, 32, 32, 32, 32,
220
- 32, 32, 32, 32, 32, 32, 32, 32,
221
- 34, 32, 35, 36, 30, 30, 30, 30,
222
- 30, 30, 30, 30, 30, 30, 30, 30,
223
- 30, 30, 30, 30, 30, 30, 30, 30,
224
- 30, 35, 30, 37, 38, 1, 1, 1,
225
- 1, 1, 1, 1, 1, 1, 1, 1,
226
- 1, 1, 1, 1, 1, 1, 1, 1,
227
- 1, 1, 37, 1, 34, 32, 40, 40,
228
- 40, 40, 40, 40, 40, 40, 40, 40,
229
- 39, 39, 39, 39, 39, 39, 39, 40,
213
+ 30, 30, 31, 30, 32, 30, 34, 33,
214
+ 33, 33, 33, 33, 33, 33, 33, 33,
215
+ 33, 33, 33, 33, 33, 33, 33, 33,
216
+ 33, 33, 33, 33, 33, 33, 33, 33,
217
+ 33, 33, 33, 33, 33, 33, 33, 33,
218
+ 33, 33, 33, 33, 33, 33, 33, 33,
219
+ 33, 33, 33, 33, 33, 33, 33, 33,
220
+ 33, 33, 33, 33, 33, 33, 33, 33,
221
+ 35, 33, 37, 36, 36, 36, 36, 36,
222
+ 36, 36, 36, 36, 36, 36, 36, 36,
223
+ 36, 36, 36, 36, 36, 36, 36, 36,
224
+ 36, 36, 36, 36, 36, 36, 36, 36,
225
+ 36, 36, 36, 36, 36, 36, 36, 36,
226
+ 36, 36, 36, 36, 36, 36, 36, 36,
227
+ 36, 36, 36, 36, 36, 36, 36, 36,
228
+ 36, 36, 36, 36, 38, 36, 39, 30,
229
+ 36, 40, 40, 40, 40, 40, 40, 40,
230
+ 40, 40, 40, 1, 1, 1, 1, 1,
231
+ 1, 1, 40, 40, 40, 40, 40, 40,
230
232
  40, 40, 40, 40, 40, 40, 40, 40,
231
233
  40, 40, 40, 40, 40, 40, 40, 40,
234
+ 40, 40, 40, 40, 1, 1, 1, 1,
235
+ 40, 1, 40, 40, 40, 40, 40, 40,
232
236
  40, 40, 40, 40, 40, 40, 40, 40,
233
- 40, 39, 39, 39, 39, 40, 39, 40,
234
237
  40, 40, 40, 40, 40, 40, 40, 40,
235
- 40, 40, 40, 40, 40, 40, 40, 40,
236
- 40, 40, 40, 40, 40, 40, 40, 40,
237
- 40, 39, 41, 39, 39, 39, 39, 39,
238
- 39, 39, 39, 39, 39, 39, 39, 39,
239
- 39, 39, 39, 39, 39, 39, 39, 39,
240
- 39, 39, 39, 39, 39, 39, 39, 39,
241
- 39, 39, 39, 39, 39, 39, 39, 39,
242
- 42, 42, 42, 42, 42, 42, 42, 42,
243
- 42, 42, 39, 39, 39, 39, 39, 39,
244
- 39, 42, 42, 42, 42, 42, 42, 42,
245
- 42, 42, 42, 42, 42, 42, 42, 42,
246
- 42, 42, 42, 42, 42, 42, 42, 42,
247
- 42, 42, 42, 39, 39, 39, 39, 42,
248
- 39, 42, 42, 42, 42, 42, 42, 42,
249
- 42, 42, 42, 42, 42, 42, 42, 42,
250
- 42, 42, 42, 42, 42, 42, 42, 42,
251
- 42, 42, 42, 39, 44, 43, 46, 45,
252
- 45, 45, 45, 45, 45, 45, 45, 45,
253
- 45, 45, 45, 45, 45, 45, 45, 45,
254
- 45, 45, 45, 45, 45, 45, 45, 45,
255
- 45, 45, 45, 45, 45, 45, 45, 45,
256
- 45, 45, 45, 45, 45, 45, 45, 45,
257
- 45, 45, 45, 45, 45, 45, 45, 45,
258
- 45, 45, 45, 45, 45, 45, 45, 45,
259
- 47, 45, 48, 43, 47, 45, 1, 1,
260
- 1, 0
238
+ 40, 40, 40, 40, 1, 42, 42, 42,
239
+ 42, 42, 41, 41, 41, 41, 41, 41,
240
+ 41, 41, 41, 41, 41, 41, 41, 41,
241
+ 41, 41, 41, 41, 42, 41, 43, 41,
242
+ 45, 44, 44, 44, 44, 44, 44, 44,
243
+ 44, 44, 44, 44, 44, 44, 44, 44,
244
+ 44, 44, 44, 44, 44, 44, 44, 44,
245
+ 44, 44, 44, 44, 44, 44, 44, 44,
246
+ 44, 44, 44, 44, 44, 44, 44, 44,
247
+ 44, 44, 44, 44, 44, 44, 44, 44,
248
+ 44, 44, 44, 44, 44, 44, 44, 44,
249
+ 44, 44, 46, 44, 48, 47, 47, 47,
250
+ 47, 47, 47, 47, 47, 47, 47, 47,
251
+ 47, 47, 47, 47, 47, 47, 47, 47,
252
+ 47, 47, 47, 47, 47, 47, 47, 47,
253
+ 47, 47, 47, 47, 47, 47, 47, 47,
254
+ 47, 47, 47, 47, 47, 47, 47, 47,
255
+ 47, 47, 47, 47, 47, 47, 47, 47,
256
+ 47, 47, 47, 47, 47, 47, 49, 47,
257
+ 47, 1, 51, 50, 50, 50, 50, 50,
258
+ 50, 50, 50, 50, 50, 50, 50, 50,
259
+ 50, 50, 50, 50, 50, 50, 50, 50,
260
+ 50, 50, 50, 50, 50, 50, 50, 50,
261
+ 50, 50, 50, 50, 50, 50, 50, 50,
262
+ 52, 52, 52, 52, 52, 52, 52, 52,
263
+ 52, 52, 50, 50, 50, 50, 50, 50,
264
+ 50, 52, 52, 52, 52, 52, 52, 52,
265
+ 52, 52, 52, 52, 52, 52, 52, 52,
266
+ 52, 52, 52, 52, 52, 52, 52, 52,
267
+ 52, 52, 52, 50, 50, 50, 50, 52,
268
+ 50, 52, 52, 52, 52, 52, 52, 52,
269
+ 52, 52, 52, 52, 52, 52, 52, 52,
270
+ 52, 52, 52, 52, 52, 52, 52, 52,
271
+ 52, 52, 52, 50, 50, 41, 0
261
272
  ]
262
273
 
263
274
  class << self
@@ -268,10 +279,10 @@ self._bel_trans_targs = [
268
279
  2, 0, 3, 4, 5, 6, 7, 8,
269
280
  9, 10, 11, 12, 13, 14, 15, 16,
270
281
  17, 18, 0, 19, 20, 19, 20, 21,
271
- 22, 23, 24, 25, 26, 27, 0, 28,
272
- 28, 29, 31, 30, 38, 30, 38, 0,
273
- 33, 39, 33, 0, 35, 35, 36, 37,
274
- 40
282
+ 22, 23, 24, 25, 26, 27, 0, 27,
283
+ 28, 29, 30, 31, 29, 30, 31, 37,
284
+ 38, 0, 33, 34, 35, 40, 36, 35,
285
+ 40, 36, 0, 39, 38
275
286
  ]
276
287
 
277
288
  class << self
@@ -281,11 +292,11 @@ end
281
292
  self._bel_trans_actions = [
282
293
  0, 0, 0, 0, 0, 0, 0, 0,
283
294
  0, 0, 0, 0, 0, 0, 0, 0,
284
- 1, 0, 2, 3, 4, 5, 0, 0,
285
- 0, 0, 0, 0, 6, 0, 7, 8,
286
- 9, 9, 9, 10, 11, 0, 12, 13,
287
- 3, 14, 5, 15, 8, 9, 9, 9,
288
- 16
295
+ 0, 0, 2, 3, 4, 0, 0, 0,
296
+ 0, 0, 0, 0, 0, 5, 7, 0,
297
+ 0, 9, 10, 9, 0, 11, 0, 12,
298
+ 3, 14, 0, 0, 9, 16, 9, 0,
299
+ 17, 0, 19, 20, 0
289
300
  ]
290
301
 
291
302
  class << self
@@ -295,9 +306,9 @@ end
295
306
  self._bel_eof_actions = [
296
307
  0, 0, 0, 0, 0, 0, 0, 0,
297
308
  0, 0, 0, 0, 0, 0, 0, 0,
298
- 0, 0, 2, 2, 0, 0, 0, 0,
299
- 0, 0, 0, 7, 7, 7, 0, 7,
300
- 13, 13, 15, 15, 15, 15, 0, 0,
309
+ 0, 0, 1, 1, 0, 0, 0, 0,
310
+ 0, 0, 0, 6, 8, 8, 7, 8,
311
+ 0, 13, 15, 15, 15, 0, 18, 21,
301
312
  0
302
313
  ]
303
314
 
@@ -308,24 +319,24 @@ self.bel_start = 1;
308
319
  class << self
309
320
  attr_accessor :bel_first_final
310
321
  end
311
- self.bel_first_final = 38;
322
+ self.bel_first_final = 37;
312
323
  class << self
313
324
  attr_accessor :bel_error
314
325
  end
315
326
  self.bel_error = 0;
316
327
 
317
328
  class << self
318
- attr_accessor :bel_en_ident
329
+ attr_accessor :bel_en_ident_node
319
330
  end
320
- self.bel_en_ident = 32;
331
+ self.bel_en_ident_node = 32;
321
332
  class << self
322
- attr_accessor :bel_en_string
333
+ attr_accessor :bel_en_string_node
323
334
  end
324
- self.bel_en_string = 34;
335
+ self.bel_en_string_node = 33;
325
336
  class << self
326
- attr_accessor :bel_en_define_namespace
337
+ attr_accessor :bel_en_define_namespace_node
327
338
  end
328
- self.bel_en_define_namespace = 1;
339
+ self.bel_en_define_namespace_node = 1;
329
340
 
330
341
 
331
342
  begin
@@ -370,141 +381,198 @@ begin
370
381
  cs = _bel_trans_targs[_trans]
371
382
  if _bel_trans_actions[_trans] != 0
372
383
  case _bel_trans_actions[_trans]
373
- when 5 then
384
+ when 3 then
374
385
  begin
375
386
 
376
- (@buffers[:ident] ||= []) << data[p].ord
387
+ trace('IDENTIFIER start_identifier')
388
+ @identifier_started = true
389
+ id_start = p;
377
390
  end
378
- when 2 then
391
+ when 20 then
379
392
  begin
380
393
 
381
- unless @buffers[:ident].is_a?(::AST::Node)
382
- @buffers[:ident] ||= []
383
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
384
- end
394
+ trace('IDENTIFIER end_identifier')
395
+ id_end = p
396
+ chars = data[id_start...id_end]
397
+ completed = !chars.empty?
398
+ ast_node = identifier(utf8_string(chars), complete: completed)
399
+ @buffers[:ident] = ast_node
385
400
  end
386
- when 9 then
401
+ when 2 then
387
402
  begin
388
403
 
389
- (@buffers[:string] ||= []) << data[p].ord
404
+ trace('IDENTIFIER an_ident_err')
405
+ id_end = p
406
+ chars = data[id_start...id_end]
407
+ ast_node = identifier(utf8_string(chars), complete: false)
408
+ @buffers[:ident] = ast_node
390
409
  end
391
- when 7 then
410
+ when 19 then
392
411
  begin
393
412
 
394
- @buffers[:string] ||= []
395
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
413
+ trace('IDENTIFIER ident_node_err')
414
+ id_end = p
415
+ chars = data[id_start...id_end]
416
+ ast_node = identifier(utf8_string(chars), complete: false)
417
+ yield ast_node
396
418
  end
397
- when 1 then
419
+ when 9 then
398
420
  begin
399
421
 
400
- @buffers[:namespace_definition] = namespace_definition()
422
+ trace('STRING start_string')
423
+ @string_opened = true
424
+ p_start = p
401
425
  end
402
- when 6 then
426
+ when 7 then
403
427
  begin
404
428
 
405
- @buffers[:namespace_definition] = @buffers[:namespace_definition] << domain(url())
429
+ trace('STRING a_string_err')
430
+ p_end = p
431
+ chars = data[p_start...p_end]
432
+ ast_node = string(utf8_string(chars), complete: false)
433
+ @buffers[:string] = ast_node
406
434
  end
407
- when 12 then
435
+ when 14 then
408
436
  begin
409
437
 
410
- yield @buffers[:namespace_definition]
438
+ trace('STRING string_node_err')
439
+ p_end = p
440
+ chars = data[p_start...p_end]
441
+ ast_node = string(utf8_string(chars), complete: false)
442
+ yield ast_node
411
443
  end
412
- when 3 then
444
+ when 5 then
413
445
  begin
414
446
 
415
- @buffers[:ident] = []
447
+ trace('DEFINE_NAMESPACE add_url_domain')
448
+ @url_domain = true
416
449
  end
450
+ when 4 then
417
451
  begin
418
452
 
419
- (@buffers[:ident] ||= []) << data[p].ord
453
+ trace('IDENTIFIER end_identifier')
454
+ id_end = p
455
+ chars = data[id_start...id_end]
456
+ completed = !chars.empty?
457
+ ast_node = identifier(utf8_string(chars), complete: completed)
458
+ @buffers[:ident] = ast_node
420
459
  end
421
- when 14 then
422
460
  begin
423
461
 
424
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]))
462
+ trace('DEFINE_NAMESPACE add_name')
463
+ name = @buffers.delete(:ident)
464
+ @buffers[:namespace_definition_name] = name
425
465
  end
466
+ when 11 then
426
467
  begin
427
468
 
428
- yield @buffers[:ident]
469
+ trace('STRING stop_string')
470
+ @string_closed = true
471
+ p_end = p
429
472
  end
430
- when 4 then
431
473
  begin
432
474
 
433
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]))
475
+ trace('STRING string_end')
476
+ completed = @string_opened && @string_closed
477
+ chars = data[p_start...p_end]
478
+ ast_node = string(utf8_string(chars), complete: true)
479
+ @buffers[:string] = ast_node
434
480
  end
481
+ when 10 then
435
482
  begin
436
483
 
437
- @buffers[:namespace_definition] = @buffers[:namespace_definition] << keyword(@buffers[:ident])
484
+ trace('STRING start_string')
485
+ @string_opened = true
486
+ p_start = p
438
487
  end
439
- when 13 then
440
488
  begin
441
489
 
442
- unless @buffers[:ident].is_a?(::AST::Node)
443
- @buffers[:ident] ||= []
444
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
445
- end
490
+ trace('STRING stop_string')
491
+ @string_closed = true
492
+ p_end = p
446
493
  end
447
494
  begin
448
495
 
449
- @buffers[:ident] ||= []
450
- yield @buffers[:ident]
496
+ trace('STRING string_end')
497
+ completed = @string_opened && @string_closed
498
+ chars = data[p_start...p_end]
499
+ ast_node = string(utf8_string(chars), complete: true)
500
+ @buffers[:string] = ast_node
451
501
  end
452
- when 8 then
502
+ when 17 then
453
503
  begin
454
504
 
455
- @buffers[:string] = []
505
+ trace('STRING stop_string')
506
+ @string_closed = true
507
+ p_end = p
456
508
  end
457
509
  begin
458
510
 
459
- (@buffers[:string] ||= []) << data[p].ord
460
- end
461
- when 16 then
462
- begin
463
-
464
- @buffers[:string] = string(utf8_string(@buffers[:string]))
511
+ trace('STRING string_end')
512
+ completed = @string_opened && @string_closed
513
+ chars = data[p_start...p_end]
514
+ ast_node = string(utf8_string(chars), complete: true)
515
+ @buffers[:string] = ast_node
465
516
  end
466
517
  begin
467
518
 
519
+ trace('STRING yield_string')
468
520
  yield @buffers[:string]
469
521
  end
470
- when 10 then
522
+ when 12 then
471
523
  begin
472
524
 
473
- @buffers[:string] = string(utf8_string(@buffers[:string]))
525
+ trace('DEFINE_NAMESPACE add_string_value')
526
+ string_node = @buffers.delete(:string)
527
+ leaf = domain(url(string_node))
528
+ leaf.complete = string_node.complete
529
+ @buffers[:namespace_definition_domain] = leaf
474
530
  end
475
531
  begin
476
532
 
477
- keyword, domain = @buffers[:namespace_definition].children
478
- domain = domain(
479
- domain.children[0] << @buffers[:string])
480
- @buffers[:namespace_definition] = namespace_definition(keyword, domain)
533
+ trace('DEFINE_NAMESPACE define_namespace_end')
534
+ namespace_definition_node = namespace_definition()
535
+
536
+ name = @buffers.delete(:namespace_definition_name)
537
+ namespace_definition_node <<= keyword(name)
538
+
539
+ domain = @buffers.delete(:namespace_definition_domain)
540
+ unless domain.nil?
541
+ namespace_definition_node <<= domain
542
+ namespace_definition_node.complete = domain.complete
543
+ end
544
+ @buffers[:namespace_definition] = namespace_definition_node
481
545
  end
482
- when 15 then
483
546
  begin
484
547
 
485
- @buffers[:string] ||= []
486
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
548
+ trace('DEFINE_NAMESPACE yield_define_namespace')
549
+ yield @buffers[:namespace_definition]
487
550
  end
551
+ when 16 then
488
552
  begin
489
553
 
490
- @buffers[:string] ||= []
491
- yield @buffers[:string]
554
+ trace('STRING start_string')
555
+ @string_opened = true
556
+ p_start = p
492
557
  end
493
- when 11 then
494
558
  begin
495
559
 
496
- @buffers[:string] = string(utf8_string(@buffers[:string]))
560
+ trace('STRING stop_string')
561
+ @string_closed = true
562
+ p_end = p
497
563
  end
498
564
  begin
499
565
 
500
- keyword, domain = @buffers[:namespace_definition].children
501
- domain = domain(
502
- domain.children[0] << @buffers[:string])
503
- @buffers[:namespace_definition] = namespace_definition(keyword, domain)
566
+ trace('STRING string_end')
567
+ completed = @string_opened && @string_closed
568
+ chars = data[p_start...p_end]
569
+ ast_node = string(utf8_string(chars), complete: true)
570
+ @buffers[:string] = ast_node
504
571
  end
505
572
  begin
506
573
 
507
- yield @buffers[:namespace_definition]
574
+ trace('STRING yield_string')
575
+ yield @buffers[:string]
508
576
  end
509
577
  end
510
578
  end
@@ -523,42 +591,146 @@ begin
523
591
  if _goto_level <= _test_eof
524
592
  if p == eof
525
593
  case _bel_eof_actions[cs]
526
- when 2 then
594
+ when 21 then
527
595
  begin
528
596
 
529
- unless @buffers[:ident].is_a?(::AST::Node)
530
- @buffers[:ident] ||= []
531
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
532
- end
597
+ trace('IDENTIFIER yield_identifier')
598
+ yield @buffers[:ident]
533
599
  end
534
600
  when 7 then
535
601
  begin
536
602
 
537
- @buffers[:string] ||= []
538
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
603
+ trace('STRING a_string_err')
604
+ p_end = p
605
+ chars = data[p_start...p_end]
606
+ ast_node = string(utf8_string(chars), complete: false)
607
+ @buffers[:string] = ast_node
539
608
  end
540
- when 13 then
609
+ when 18 then
541
610
  begin
542
611
 
543
- unless @buffers[:ident].is_a?(::AST::Node)
544
- @buffers[:ident] ||= []
545
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
546
- end
612
+ trace('IDENTIFIER end_identifier')
613
+ id_end = p
614
+ chars = data[id_start...id_end]
615
+ completed = !chars.empty?
616
+ ast_node = identifier(utf8_string(chars), complete: completed)
617
+ @buffers[:ident] = ast_node
547
618
  end
548
619
  begin
549
620
 
550
- @buffers[:ident] ||= []
621
+ trace('IDENTIFIER yield_identifier')
551
622
  yield @buffers[:ident]
552
623
  end
624
+ when 1 then
625
+ begin
626
+
627
+ trace('IDENTIFIER an_ident_eof')
628
+ if @identifier_started
629
+ id_end = p
630
+ chars = data[id_start...id_end]
631
+ completed = !chars.empty?
632
+ ast_node = identifier(utf8_string(chars), complete: completed)
633
+ @buffers[:ident] = ast_node
634
+ end
635
+ end
636
+ begin
637
+
638
+ trace('IDENTIFIER an_ident_err')
639
+ id_end = p
640
+ chars = data[id_start...id_end]
641
+ ast_node = identifier(utf8_string(chars), complete: false)
642
+ @buffers[:ident] = ast_node
643
+ end
644
+ when 6 then
645
+ begin
646
+
647
+ trace('STRING a_string_err')
648
+ p_end = p
649
+ chars = data[p_start...p_end]
650
+ ast_node = string(utf8_string(chars), complete: false)
651
+ @buffers[:string] = ast_node
652
+ end
653
+ begin
654
+
655
+ trace('DEFINE_NAMESPACE define_namespace_node_eof')
656
+ leaf = url()
657
+ string_node = @buffers.delete(:string)
658
+ unless string_node.nil?
659
+ leaf <<= string_node
660
+ leaf.complete = string_node.complete
661
+ end
662
+ domain_node = domain(leaf)
663
+ domain_node.complete = leaf.complete
664
+ namespace_definition_node = namespace_definition(domain_node)
665
+ namespace_definition_node.complete = domain_node.complete
666
+ yield namespace_definition_node
667
+ end
668
+ when 13 then
669
+ begin
670
+
671
+ trace('STRING string_node_err')
672
+ p_end = p
673
+ chars = data[p_start...p_end]
674
+ ast_node = string(utf8_string(chars), complete: false)
675
+ yield ast_node
676
+ end
677
+ begin
678
+
679
+ trace('STRING string_node_eof')
680
+ yield @buffers[:string]
681
+ end
682
+ when 8 then
683
+ begin
684
+
685
+ trace('STRING eof_string')
686
+ p_end = p
687
+ chars = data[p_start...p_end]
688
+ ast_node = string(utf8_string(chars), complete: false)
689
+ @buffers[:string] = ast_node
690
+ end
691
+ begin
692
+
693
+ trace('STRING a_string_err')
694
+ p_end = p
695
+ chars = data[p_start...p_end]
696
+ ast_node = string(utf8_string(chars), complete: false)
697
+ @buffers[:string] = ast_node
698
+ end
699
+ begin
700
+
701
+ trace('DEFINE_NAMESPACE define_namespace_node_eof')
702
+ leaf = url()
703
+ string_node = @buffers.delete(:string)
704
+ unless string_node.nil?
705
+ leaf <<= string_node
706
+ leaf.complete = string_node.complete
707
+ end
708
+ domain_node = domain(leaf)
709
+ domain_node.complete = leaf.complete
710
+ namespace_definition_node = namespace_definition(domain_node)
711
+ namespace_definition_node.complete = domain_node.complete
712
+ yield namespace_definition_node
713
+ end
553
714
  when 15 then
554
715
  begin
555
716
 
556
- @buffers[:string] ||= []
557
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
717
+ trace('STRING eof_string')
718
+ p_end = p
719
+ chars = data[p_start...p_end]
720
+ ast_node = string(utf8_string(chars), complete: false)
721
+ @buffers[:string] = ast_node
722
+ end
723
+ begin
724
+
725
+ trace('STRING string_node_err')
726
+ p_end = p
727
+ chars = data[p_start...p_end]
728
+ ast_node = string(utf8_string(chars), complete: false)
729
+ yield ast_node
558
730
  end
559
731
  begin
560
732
 
561
- @buffers[:string] ||= []
733
+ trace('STRING string_node_eof')
562
734
  yield @buffers[:string]
563
735
  end
564
736
  end
@@ -586,11 +758,11 @@ self._bel_trans_keys = [
586
758
  9, 122, 9, 97, 83,
587
759
  115, 9, 32, 9, 117,
588
760
  82, 114, 76, 108, 9, 32,
589
- 9, 34, 34, 92, 9,
590
- 32, 9, 32, 92, 92,
591
- 48, 122, 10, 122, 34, 34,
592
- 34, 92, 10, 10, 92,
593
- 92, 0, 0, 0, 0,
761
+ 9, 34, 34, 92, 34,
762
+ 92, 10, 10, 0, 0,
763
+ 48, 122, 9, 34, 34, 92,
764
+ 34, 92, 0, 0, 0,
765
+ 0, 10, 122, 0, 0,
594
766
  0, 0, 0
595
767
  ]
596
768
 
@@ -602,8 +774,8 @@ self._bel_key_spans = [
602
774
  0, 33, 33, 33, 33, 33, 33, 24,
603
775
  102, 33, 33, 33, 33, 33, 33, 33,
604
776
  33, 24, 114, 114, 89, 33, 24, 109,
605
- 33, 33, 24, 26, 59, 24, 24, 1,
606
- 75, 113, 1, 59, 1, 1, 0, 0,
777
+ 33, 33, 24, 26, 59, 59, 1, 0,
778
+ 75, 26, 59, 59, 0, 0, 113, 0,
607
779
  0
608
780
  ]
609
781
 
@@ -615,9 +787,9 @@ self._bel_index_offsets = [
615
787
  0, 0, 34, 68, 102, 136, 170, 204,
616
788
  229, 332, 366, 400, 434, 468, 502, 536,
617
789
  570, 604, 629, 744, 859, 949, 983, 1008,
618
- 1118, 1152, 1186, 1211, 1238, 1298, 1323, 1348,
619
- 1350, 1426, 1540, 1542, 1602, 1604, 1606, 1607,
620
- 1608
790
+ 1118, 1152, 1186, 1211, 1238, 1298, 1358, 1360,
791
+ 1361, 1437, 1464, 1524, 1584, 1585, 1586, 1700,
792
+ 1701
621
793
  ]
622
794
 
623
795
  class << self
@@ -776,57 +948,68 @@ self._bel_indicies = [
776
948
  28, 1, 29, 1, 1, 1, 1, 1,
777
949
  1, 1, 1, 1, 1, 1, 1, 1,
778
950
  1, 1, 1, 1, 1, 1, 1, 1,
779
- 1, 29, 1, 29, 30, 30, 30, 30,
951
+ 1, 29, 1, 31, 31, 31, 31, 31,
780
952
  30, 30, 30, 30, 30, 30, 30, 30,
781
953
  30, 30, 30, 30, 30, 30, 30, 30,
782
- 30, 30, 29, 30, 31, 30, 33, 32,
783
- 32, 32, 32, 32, 32, 32, 32, 32,
784
- 32, 32, 32, 32, 32, 32, 32, 32,
785
- 32, 32, 32, 32, 32, 32, 32, 32,
786
- 32, 32, 32, 32, 32, 32, 32, 32,
787
- 32, 32, 32, 32, 32, 32, 32, 32,
788
- 32, 32, 32, 32, 32, 32, 32, 32,
789
- 32, 32, 32, 32, 32, 32, 32, 32,
790
- 34, 32, 35, 36, 30, 30, 30, 30,
791
- 30, 30, 30, 30, 30, 30, 30, 30,
792
- 30, 30, 30, 30, 30, 30, 30, 30,
793
- 30, 35, 30, 37, 38, 1, 1, 1,
794
- 1, 1, 1, 1, 1, 1, 1, 1,
795
- 1, 1, 1, 1, 1, 1, 1, 1,
796
- 1, 1, 37, 1, 34, 32, 40, 40,
954
+ 30, 30, 31, 30, 32, 30, 34, 33,
955
+ 33, 33, 33, 33, 33, 33, 33, 33,
956
+ 33, 33, 33, 33, 33, 33, 33, 33,
957
+ 33, 33, 33, 33, 33, 33, 33, 33,
958
+ 33, 33, 33, 33, 33, 33, 33, 33,
959
+ 33, 33, 33, 33, 33, 33, 33, 33,
960
+ 33, 33, 33, 33, 33, 33, 33, 33,
961
+ 33, 33, 33, 33, 33, 33, 33, 33,
962
+ 35, 33, 37, 36, 36, 36, 36, 36,
963
+ 36, 36, 36, 36, 36, 36, 36, 36,
964
+ 36, 36, 36, 36, 36, 36, 36, 36,
965
+ 36, 36, 36, 36, 36, 36, 36, 36,
966
+ 36, 36, 36, 36, 36, 36, 36, 36,
967
+ 36, 36, 36, 36, 36, 36, 36, 36,
968
+ 36, 36, 36, 36, 36, 36, 36, 36,
969
+ 36, 36, 36, 36, 38, 36, 39, 30,
970
+ 36, 40, 40, 40, 40, 40, 40, 40,
971
+ 40, 40, 40, 1, 1, 1, 1, 1,
972
+ 1, 1, 40, 40, 40, 40, 40, 40,
797
973
  40, 40, 40, 40, 40, 40, 40, 40,
798
- 39, 39, 39, 39, 39, 39, 39, 40,
799
974
  40, 40, 40, 40, 40, 40, 40, 40,
975
+ 40, 40, 40, 40, 1, 1, 1, 1,
976
+ 40, 1, 40, 40, 40, 40, 40, 40,
800
977
  40, 40, 40, 40, 40, 40, 40, 40,
801
978
  40, 40, 40, 40, 40, 40, 40, 40,
802
- 40, 39, 39, 39, 39, 40, 39, 40,
803
- 40, 40, 40, 40, 40, 40, 40, 40,
804
- 40, 40, 40, 40, 40, 40, 40, 40,
805
- 40, 40, 40, 40, 40, 40, 40, 40,
806
- 40, 39, 41, 39, 39, 39, 39, 39,
807
- 39, 39, 39, 39, 39, 39, 39, 39,
808
- 39, 39, 39, 39, 39, 39, 39, 39,
809
- 39, 39, 39, 39, 39, 39, 39, 39,
810
- 39, 39, 39, 39, 39, 39, 39, 39,
811
- 42, 42, 42, 42, 42, 42, 42, 42,
812
- 42, 42, 39, 39, 39, 39, 39, 39,
813
- 39, 42, 42, 42, 42, 42, 42, 42,
814
- 42, 42, 42, 42, 42, 42, 42, 42,
815
- 42, 42, 42, 42, 42, 42, 42, 42,
816
- 42, 42, 42, 39, 39, 39, 39, 42,
817
- 39, 42, 42, 42, 42, 42, 42, 42,
818
- 42, 42, 42, 42, 42, 42, 42, 42,
819
- 42, 42, 42, 42, 42, 42, 42, 42,
820
- 42, 42, 42, 39, 44, 43, 46, 45,
821
- 45, 45, 45, 45, 45, 45, 45, 45,
822
- 45, 45, 45, 45, 45, 45, 45, 45,
823
- 45, 45, 45, 45, 45, 45, 45, 45,
824
- 45, 45, 45, 45, 45, 45, 45, 45,
825
- 45, 45, 45, 45, 45, 45, 45, 45,
826
- 45, 45, 45, 45, 45, 45, 45, 45,
827
- 45, 45, 45, 45, 45, 45, 45, 45,
828
- 47, 45, 48, 43, 47, 45, 1, 1,
829
- 1, 0
979
+ 40, 40, 40, 40, 1, 42, 42, 42,
980
+ 42, 42, 41, 41, 41, 41, 41, 41,
981
+ 41, 41, 41, 41, 41, 41, 41, 41,
982
+ 41, 41, 41, 41, 42, 41, 43, 41,
983
+ 45, 44, 44, 44, 44, 44, 44, 44,
984
+ 44, 44, 44, 44, 44, 44, 44, 44,
985
+ 44, 44, 44, 44, 44, 44, 44, 44,
986
+ 44, 44, 44, 44, 44, 44, 44, 44,
987
+ 44, 44, 44, 44, 44, 44, 44, 44,
988
+ 44, 44, 44, 44, 44, 44, 44, 44,
989
+ 44, 44, 44, 44, 44, 44, 44, 44,
990
+ 44, 44, 46, 44, 48, 47, 47, 47,
991
+ 47, 47, 47, 47, 47, 47, 47, 47,
992
+ 47, 47, 47, 47, 47, 47, 47, 47,
993
+ 47, 47, 47, 47, 47, 47, 47, 47,
994
+ 47, 47, 47, 47, 47, 47, 47, 47,
995
+ 47, 47, 47, 47, 47, 47, 47, 47,
996
+ 47, 47, 47, 47, 47, 47, 47, 47,
997
+ 47, 47, 47, 47, 47, 47, 49, 47,
998
+ 47, 1, 51, 50, 50, 50, 50, 50,
999
+ 50, 50, 50, 50, 50, 50, 50, 50,
1000
+ 50, 50, 50, 50, 50, 50, 50, 50,
1001
+ 50, 50, 50, 50, 50, 50, 50, 50,
1002
+ 50, 50, 50, 50, 50, 50, 50, 50,
1003
+ 52, 52, 52, 52, 52, 52, 52, 52,
1004
+ 52, 52, 50, 50, 50, 50, 50, 50,
1005
+ 50, 52, 52, 52, 52, 52, 52, 52,
1006
+ 52, 52, 52, 52, 52, 52, 52, 52,
1007
+ 52, 52, 52, 52, 52, 52, 52, 52,
1008
+ 52, 52, 52, 50, 50, 50, 50, 52,
1009
+ 50, 52, 52, 52, 52, 52, 52, 52,
1010
+ 52, 52, 52, 52, 52, 52, 52, 52,
1011
+ 52, 52, 52, 52, 52, 52, 52, 52,
1012
+ 52, 52, 52, 50, 50, 41, 0
830
1013
  ]
831
1014
 
832
1015
  class << self
@@ -837,10 +1020,10 @@ self._bel_trans_targs = [
837
1020
  2, 0, 3, 4, 5, 6, 7, 8,
838
1021
  9, 10, 11, 12, 13, 14, 15, 16,
839
1022
  17, 18, 0, 19, 20, 19, 20, 21,
840
- 22, 23, 24, 25, 26, 27, 0, 28,
841
- 28, 29, 31, 30, 38, 30, 38, 0,
842
- 33, 39, 33, 0, 35, 35, 36, 37,
843
- 40
1023
+ 22, 23, 24, 25, 26, 27, 0, 27,
1024
+ 28, 29, 30, 31, 29, 30, 31, 37,
1025
+ 38, 0, 33, 34, 35, 40, 36, 35,
1026
+ 40, 36, 0, 39, 38
844
1027
  ]
845
1028
 
846
1029
  class << self
@@ -850,11 +1033,11 @@ end
850
1033
  self._bel_trans_actions = [
851
1034
  0, 0, 0, 0, 0, 0, 0, 0,
852
1035
  0, 0, 0, 0, 0, 0, 0, 0,
853
- 1, 0, 2, 3, 4, 5, 0, 0,
854
- 0, 0, 0, 0, 6, 0, 7, 8,
855
- 9, 9, 9, 10, 11, 0, 12, 13,
856
- 3, 14, 5, 15, 8, 9, 9, 9,
857
- 16
1036
+ 0, 0, 2, 3, 4, 0, 0, 0,
1037
+ 0, 0, 0, 0, 0, 5, 7, 0,
1038
+ 0, 9, 10, 9, 0, 11, 0, 12,
1039
+ 3, 14, 0, 0, 9, 16, 9, 0,
1040
+ 17, 0, 19, 20, 0
858
1041
  ]
859
1042
 
860
1043
  class << self
@@ -864,9 +1047,9 @@ end
864
1047
  self._bel_eof_actions = [
865
1048
  0, 0, 0, 0, 0, 0, 0, 0,
866
1049
  0, 0, 0, 0, 0, 0, 0, 0,
867
- 0, 0, 2, 2, 0, 0, 0, 0,
868
- 0, 0, 0, 7, 7, 7, 0, 7,
869
- 13, 13, 15, 15, 15, 15, 0, 0,
1050
+ 0, 0, 1, 1, 0, 0, 0, 0,
1051
+ 0, 0, 0, 6, 8, 8, 7, 8,
1052
+ 0, 13, 15, 15, 15, 0, 18, 21,
870
1053
  0
871
1054
  ]
872
1055
 
@@ -877,24 +1060,24 @@ self.bel_start = 1;
877
1060
  class << self
878
1061
  attr_accessor :bel_first_final
879
1062
  end
880
- self.bel_first_final = 38;
1063
+ self.bel_first_final = 37;
881
1064
  class << self
882
1065
  attr_accessor :bel_error
883
1066
  end
884
1067
  self.bel_error = 0;
885
1068
 
886
1069
  class << self
887
- attr_accessor :bel_en_ident
1070
+ attr_accessor :bel_en_ident_node
888
1071
  end
889
- self.bel_en_ident = 32;
1072
+ self.bel_en_ident_node = 32;
890
1073
  class << self
891
- attr_accessor :bel_en_string
1074
+ attr_accessor :bel_en_string_node
892
1075
  end
893
- self.bel_en_string = 34;
1076
+ self.bel_en_string_node = 33;
894
1077
  class << self
895
- attr_accessor :bel_en_define_namespace
1078
+ attr_accessor :bel_en_define_namespace_node
896
1079
  end
897
- self.bel_en_define_namespace = 1;
1080
+ self.bel_en_define_namespace_node = 1;
898
1081
 
899
1082
 
900
1083
  begin
@@ -939,141 +1122,198 @@ begin
939
1122
  cs = _bel_trans_targs[_trans]
940
1123
  if _bel_trans_actions[_trans] != 0
941
1124
  case _bel_trans_actions[_trans]
942
- when 5 then
943
- begin
944
-
945
- (@buffers[:ident] ||= []) << data[p].ord
946
- end
947
- when 2 then
1125
+ when 3 then
948
1126
  begin
949
1127
 
950
- unless @buffers[:ident].is_a?(::AST::Node)
951
- @buffers[:ident] ||= []
952
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
953
- end
1128
+ trace('IDENTIFIER start_identifier')
1129
+ @identifier_started = true
1130
+ id_start = p;
954
1131
  end
955
- when 9 then
1132
+ when 20 then
956
1133
  begin
957
1134
 
958
- (@buffers[:string] ||= []) << data[p].ord
1135
+ trace('IDENTIFIER end_identifier')
1136
+ id_end = p
1137
+ chars = data[id_start...id_end]
1138
+ completed = !chars.empty?
1139
+ ast_node = identifier(utf8_string(chars), complete: completed)
1140
+ @buffers[:ident] = ast_node
959
1141
  end
960
- when 7 then
1142
+ when 2 then
961
1143
  begin
962
1144
 
963
- @buffers[:string] ||= []
964
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
1145
+ trace('IDENTIFIER an_ident_err')
1146
+ id_end = p
1147
+ chars = data[id_start...id_end]
1148
+ ast_node = identifier(utf8_string(chars), complete: false)
1149
+ @buffers[:ident] = ast_node
965
1150
  end
966
- when 1 then
1151
+ when 19 then
967
1152
  begin
968
1153
 
969
- @buffers[:namespace_definition] = namespace_definition()
1154
+ trace('IDENTIFIER ident_node_err')
1155
+ id_end = p
1156
+ chars = data[id_start...id_end]
1157
+ ast_node = identifier(utf8_string(chars), complete: false)
1158
+ yield ast_node
970
1159
  end
971
- when 6 then
1160
+ when 9 then
972
1161
  begin
973
1162
 
974
- @buffers[:namespace_definition] = @buffers[:namespace_definition] << domain(url())
1163
+ trace('STRING start_string')
1164
+ @string_opened = true
1165
+ p_start = p
975
1166
  end
976
- when 12 then
1167
+ when 7 then
977
1168
  begin
978
1169
 
979
- yield @buffers[:namespace_definition]
1170
+ trace('STRING a_string_err')
1171
+ p_end = p
1172
+ chars = data[p_start...p_end]
1173
+ ast_node = string(utf8_string(chars), complete: false)
1174
+ @buffers[:string] = ast_node
980
1175
  end
981
- when 3 then
1176
+ when 14 then
982
1177
  begin
983
1178
 
984
- @buffers[:ident] = []
1179
+ trace('STRING string_node_err')
1180
+ p_end = p
1181
+ chars = data[p_start...p_end]
1182
+ ast_node = string(utf8_string(chars), complete: false)
1183
+ yield ast_node
985
1184
  end
1185
+ when 5 then
986
1186
  begin
987
1187
 
988
- (@buffers[:ident] ||= []) << data[p].ord
1188
+ trace('DEFINE_NAMESPACE add_url_domain')
1189
+ @url_domain = true
989
1190
  end
990
- when 14 then
1191
+ when 4 then
991
1192
  begin
992
1193
 
993
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]))
1194
+ trace('IDENTIFIER end_identifier')
1195
+ id_end = p
1196
+ chars = data[id_start...id_end]
1197
+ completed = !chars.empty?
1198
+ ast_node = identifier(utf8_string(chars), complete: completed)
1199
+ @buffers[:ident] = ast_node
994
1200
  end
995
1201
  begin
996
1202
 
997
- yield @buffers[:ident]
1203
+ trace('DEFINE_NAMESPACE add_name')
1204
+ name = @buffers.delete(:ident)
1205
+ @buffers[:namespace_definition_name] = name
998
1206
  end
999
- when 4 then
1207
+ when 11 then
1000
1208
  begin
1001
1209
 
1002
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]))
1210
+ trace('STRING stop_string')
1211
+ @string_closed = true
1212
+ p_end = p
1003
1213
  end
1004
1214
  begin
1005
1215
 
1006
- @buffers[:namespace_definition] = @buffers[:namespace_definition] << keyword(@buffers[:ident])
1216
+ trace('STRING string_end')
1217
+ completed = @string_opened && @string_closed
1218
+ chars = data[p_start...p_end]
1219
+ ast_node = string(utf8_string(chars), complete: true)
1220
+ @buffers[:string] = ast_node
1007
1221
  end
1008
- when 13 then
1222
+ when 10 then
1009
1223
  begin
1010
1224
 
1011
- unless @buffers[:ident].is_a?(::AST::Node)
1012
- @buffers[:ident] ||= []
1013
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
1014
- end
1225
+ trace('STRING start_string')
1226
+ @string_opened = true
1227
+ p_start = p
1015
1228
  end
1016
1229
  begin
1017
1230
 
1018
- @buffers[:ident] ||= []
1019
- yield @buffers[:ident]
1231
+ trace('STRING stop_string')
1232
+ @string_closed = true
1233
+ p_end = p
1020
1234
  end
1021
- when 8 then
1022
1235
  begin
1023
1236
 
1024
- @buffers[:string] = []
1237
+ trace('STRING string_end')
1238
+ completed = @string_opened && @string_closed
1239
+ chars = data[p_start...p_end]
1240
+ ast_node = string(utf8_string(chars), complete: true)
1241
+ @buffers[:string] = ast_node
1025
1242
  end
1243
+ when 17 then
1026
1244
  begin
1027
1245
 
1028
- (@buffers[:string] ||= []) << data[p].ord
1246
+ trace('STRING stop_string')
1247
+ @string_closed = true
1248
+ p_end = p
1029
1249
  end
1030
- when 16 then
1031
1250
  begin
1032
1251
 
1033
- @buffers[:string] = string(utf8_string(@buffers[:string]))
1252
+ trace('STRING string_end')
1253
+ completed = @string_opened && @string_closed
1254
+ chars = data[p_start...p_end]
1255
+ ast_node = string(utf8_string(chars), complete: true)
1256
+ @buffers[:string] = ast_node
1034
1257
  end
1035
1258
  begin
1036
1259
 
1260
+ trace('STRING yield_string')
1037
1261
  yield @buffers[:string]
1038
1262
  end
1039
- when 10 then
1263
+ when 12 then
1040
1264
  begin
1041
1265
 
1042
- @buffers[:string] = string(utf8_string(@buffers[:string]))
1266
+ trace('DEFINE_NAMESPACE add_string_value')
1267
+ string_node = @buffers.delete(:string)
1268
+ leaf = domain(url(string_node))
1269
+ leaf.complete = string_node.complete
1270
+ @buffers[:namespace_definition_domain] = leaf
1043
1271
  end
1044
1272
  begin
1045
1273
 
1046
- keyword, domain = @buffers[:namespace_definition].children
1047
- domain = domain(
1048
- domain.children[0] << @buffers[:string])
1049
- @buffers[:namespace_definition] = namespace_definition(keyword, domain)
1274
+ trace('DEFINE_NAMESPACE define_namespace_end')
1275
+ namespace_definition_node = namespace_definition()
1276
+
1277
+ name = @buffers.delete(:namespace_definition_name)
1278
+ namespace_definition_node <<= keyword(name)
1279
+
1280
+ domain = @buffers.delete(:namespace_definition_domain)
1281
+ unless domain.nil?
1282
+ namespace_definition_node <<= domain
1283
+ namespace_definition_node.complete = domain.complete
1284
+ end
1285
+ @buffers[:namespace_definition] = namespace_definition_node
1050
1286
  end
1051
- when 15 then
1052
1287
  begin
1053
1288
 
1054
- @buffers[:string] ||= []
1055
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
1289
+ trace('DEFINE_NAMESPACE yield_define_namespace')
1290
+ yield @buffers[:namespace_definition]
1056
1291
  end
1292
+ when 16 then
1057
1293
  begin
1058
1294
 
1059
- @buffers[:string] ||= []
1060
- yield @buffers[:string]
1295
+ trace('STRING start_string')
1296
+ @string_opened = true
1297
+ p_start = p
1061
1298
  end
1062
- when 11 then
1063
1299
  begin
1064
1300
 
1065
- @buffers[:string] = string(utf8_string(@buffers[:string]))
1301
+ trace('STRING stop_string')
1302
+ @string_closed = true
1303
+ p_end = p
1066
1304
  end
1067
1305
  begin
1068
1306
 
1069
- keyword, domain = @buffers[:namespace_definition].children
1070
- domain = domain(
1071
- domain.children[0] << @buffers[:string])
1072
- @buffers[:namespace_definition] = namespace_definition(keyword, domain)
1307
+ trace('STRING string_end')
1308
+ completed = @string_opened && @string_closed
1309
+ chars = data[p_start...p_end]
1310
+ ast_node = string(utf8_string(chars), complete: true)
1311
+ @buffers[:string] = ast_node
1073
1312
  end
1074
1313
  begin
1075
1314
 
1076
- yield @buffers[:namespace_definition]
1315
+ trace('STRING yield_string')
1316
+ yield @buffers[:string]
1077
1317
  end
1078
1318
  end
1079
1319
  end
@@ -1092,42 +1332,146 @@ begin
1092
1332
  if _goto_level <= _test_eof
1093
1333
  if p == eof
1094
1334
  case _bel_eof_actions[cs]
1095
- when 2 then
1335
+ when 21 then
1096
1336
  begin
1097
1337
 
1098
- unless @buffers[:ident].is_a?(::AST::Node)
1099
- @buffers[:ident] ||= []
1100
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
1101
- end
1338
+ trace('IDENTIFIER yield_identifier')
1339
+ yield @buffers[:ident]
1102
1340
  end
1103
1341
  when 7 then
1104
1342
  begin
1105
1343
 
1106
- @buffers[:string] ||= []
1107
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
1344
+ trace('STRING a_string_err')
1345
+ p_end = p
1346
+ chars = data[p_start...p_end]
1347
+ ast_node = string(utf8_string(chars), complete: false)
1348
+ @buffers[:string] = ast_node
1108
1349
  end
1109
- when 13 then
1350
+ when 18 then
1110
1351
  begin
1111
1352
 
1112
- unless @buffers[:ident].is_a?(::AST::Node)
1113
- @buffers[:ident] ||= []
1114
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
1115
- end
1353
+ trace('IDENTIFIER end_identifier')
1354
+ id_end = p
1355
+ chars = data[id_start...id_end]
1356
+ completed = !chars.empty?
1357
+ ast_node = identifier(utf8_string(chars), complete: completed)
1358
+ @buffers[:ident] = ast_node
1116
1359
  end
1117
1360
  begin
1118
1361
 
1119
- @buffers[:ident] ||= []
1362
+ trace('IDENTIFIER yield_identifier')
1120
1363
  yield @buffers[:ident]
1121
1364
  end
1365
+ when 1 then
1366
+ begin
1367
+
1368
+ trace('IDENTIFIER an_ident_eof')
1369
+ if @identifier_started
1370
+ id_end = p
1371
+ chars = data[id_start...id_end]
1372
+ completed = !chars.empty?
1373
+ ast_node = identifier(utf8_string(chars), complete: completed)
1374
+ @buffers[:ident] = ast_node
1375
+ end
1376
+ end
1377
+ begin
1378
+
1379
+ trace('IDENTIFIER an_ident_err')
1380
+ id_end = p
1381
+ chars = data[id_start...id_end]
1382
+ ast_node = identifier(utf8_string(chars), complete: false)
1383
+ @buffers[:ident] = ast_node
1384
+ end
1385
+ when 6 then
1386
+ begin
1387
+
1388
+ trace('STRING a_string_err')
1389
+ p_end = p
1390
+ chars = data[p_start...p_end]
1391
+ ast_node = string(utf8_string(chars), complete: false)
1392
+ @buffers[:string] = ast_node
1393
+ end
1394
+ begin
1395
+
1396
+ trace('DEFINE_NAMESPACE define_namespace_node_eof')
1397
+ leaf = url()
1398
+ string_node = @buffers.delete(:string)
1399
+ unless string_node.nil?
1400
+ leaf <<= string_node
1401
+ leaf.complete = string_node.complete
1402
+ end
1403
+ domain_node = domain(leaf)
1404
+ domain_node.complete = leaf.complete
1405
+ namespace_definition_node = namespace_definition(domain_node)
1406
+ namespace_definition_node.complete = domain_node.complete
1407
+ yield namespace_definition_node
1408
+ end
1409
+ when 13 then
1410
+ begin
1411
+
1412
+ trace('STRING string_node_err')
1413
+ p_end = p
1414
+ chars = data[p_start...p_end]
1415
+ ast_node = string(utf8_string(chars), complete: false)
1416
+ yield ast_node
1417
+ end
1418
+ begin
1419
+
1420
+ trace('STRING string_node_eof')
1421
+ yield @buffers[:string]
1422
+ end
1423
+ when 8 then
1424
+ begin
1425
+
1426
+ trace('STRING eof_string')
1427
+ p_end = p
1428
+ chars = data[p_start...p_end]
1429
+ ast_node = string(utf8_string(chars), complete: false)
1430
+ @buffers[:string] = ast_node
1431
+ end
1432
+ begin
1433
+
1434
+ trace('STRING a_string_err')
1435
+ p_end = p
1436
+ chars = data[p_start...p_end]
1437
+ ast_node = string(utf8_string(chars), complete: false)
1438
+ @buffers[:string] = ast_node
1439
+ end
1440
+ begin
1441
+
1442
+ trace('DEFINE_NAMESPACE define_namespace_node_eof')
1443
+ leaf = url()
1444
+ string_node = @buffers.delete(:string)
1445
+ unless string_node.nil?
1446
+ leaf <<= string_node
1447
+ leaf.complete = string_node.complete
1448
+ end
1449
+ domain_node = domain(leaf)
1450
+ domain_node.complete = leaf.complete
1451
+ namespace_definition_node = namespace_definition(domain_node)
1452
+ namespace_definition_node.complete = domain_node.complete
1453
+ yield namespace_definition_node
1454
+ end
1122
1455
  when 15 then
1123
1456
  begin
1124
1457
 
1125
- @buffers[:string] ||= []
1126
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
1458
+ trace('STRING eof_string')
1459
+ p_end = p
1460
+ chars = data[p_start...p_end]
1461
+ ast_node = string(utf8_string(chars), complete: false)
1462
+ @buffers[:string] = ast_node
1127
1463
  end
1128
1464
  begin
1129
1465
 
1130
- @buffers[:string] ||= []
1466
+ trace('STRING string_node_err')
1467
+ p_end = p
1468
+ chars = data[p_start...p_end]
1469
+ ast_node = string(utf8_string(chars), complete: false)
1470
+ yield ast_node
1471
+ end
1472
+ begin
1473
+
1474
+ trace('STRING string_node_eof')
1131
1475
  yield @buffers[:string]
1132
1476
  end
1133
1477
  end
@@ -1147,6 +1491,7 @@ end
1147
1491
  require_relative '../ast/node'
1148
1492
  require_relative '../mixin/buffer'
1149
1493
  require_relative '../nonblocking_io_wrapper'
1494
+ require_relative '../tracer'
1150
1495
 
1151
1496
  module BELParser
1152
1497
  module Parsers
@@ -1172,10 +1517,11 @@ module BELParser
1172
1517
  include Enumerable
1173
1518
  include BELParser::Parsers::Buffer
1174
1519
  include BELParser::Parsers::AST::Sexp
1520
+ include BELParser::Parsers::Tracer
1175
1521
 
1176
1522
  def initialize(content)
1177
1523
  @content = content
1178
- # begin: ragel
1524
+ # begin: ragel
1179
1525
 
1180
1526
  class << self
1181
1527
  attr_accessor :_bel_trans_keys
@@ -1192,11 +1538,11 @@ self._bel_trans_keys = [
1192
1538
  9, 122, 9, 97, 83,
1193
1539
  115, 9, 32, 9, 117,
1194
1540
  82, 114, 76, 108, 9, 32,
1195
- 9, 34, 34, 92, 9,
1196
- 32, 9, 32, 92, 92,
1197
- 48, 122, 10, 122, 34, 34,
1198
- 34, 92, 10, 10, 92,
1199
- 92, 0, 0, 0, 0,
1541
+ 9, 34, 34, 92, 34,
1542
+ 92, 10, 10, 0, 0,
1543
+ 48, 122, 9, 34, 34, 92,
1544
+ 34, 92, 0, 0, 0,
1545
+ 0, 10, 122, 0, 0,
1200
1546
  0, 0, 0
1201
1547
  ]
1202
1548
 
@@ -1208,8 +1554,8 @@ self._bel_key_spans = [
1208
1554
  0, 33, 33, 33, 33, 33, 33, 24,
1209
1555
  102, 33, 33, 33, 33, 33, 33, 33,
1210
1556
  33, 24, 114, 114, 89, 33, 24, 109,
1211
- 33, 33, 24, 26, 59, 24, 24, 1,
1212
- 75, 113, 1, 59, 1, 1, 0, 0,
1557
+ 33, 33, 24, 26, 59, 59, 1, 0,
1558
+ 75, 26, 59, 59, 0, 0, 113, 0,
1213
1559
  0
1214
1560
  ]
1215
1561
 
@@ -1221,9 +1567,9 @@ self._bel_index_offsets = [
1221
1567
  0, 0, 34, 68, 102, 136, 170, 204,
1222
1568
  229, 332, 366, 400, 434, 468, 502, 536,
1223
1569
  570, 604, 629, 744, 859, 949, 983, 1008,
1224
- 1118, 1152, 1186, 1211, 1238, 1298, 1323, 1348,
1225
- 1350, 1426, 1540, 1542, 1602, 1604, 1606, 1607,
1226
- 1608
1570
+ 1118, 1152, 1186, 1211, 1238, 1298, 1358, 1360,
1571
+ 1361, 1437, 1464, 1524, 1584, 1585, 1586, 1700,
1572
+ 1701
1227
1573
  ]
1228
1574
 
1229
1575
  class << self
@@ -1382,57 +1728,68 @@ self._bel_indicies = [
1382
1728
  28, 1, 29, 1, 1, 1, 1, 1,
1383
1729
  1, 1, 1, 1, 1, 1, 1, 1,
1384
1730
  1, 1, 1, 1, 1, 1, 1, 1,
1385
- 1, 29, 1, 29, 30, 30, 30, 30,
1386
- 30, 30, 30, 30, 30, 30, 30, 30,
1387
- 30, 30, 30, 30, 30, 30, 30, 30,
1388
- 30, 30, 29, 30, 31, 30, 33, 32,
1389
- 32, 32, 32, 32, 32, 32, 32, 32,
1390
- 32, 32, 32, 32, 32, 32, 32, 32,
1391
- 32, 32, 32, 32, 32, 32, 32, 32,
1392
- 32, 32, 32, 32, 32, 32, 32, 32,
1393
- 32, 32, 32, 32, 32, 32, 32, 32,
1394
- 32, 32, 32, 32, 32, 32, 32, 32,
1395
- 32, 32, 32, 32, 32, 32, 32, 32,
1396
- 34, 32, 35, 36, 30, 30, 30, 30,
1731
+ 1, 29, 1, 31, 31, 31, 31, 31,
1397
1732
  30, 30, 30, 30, 30, 30, 30, 30,
1398
1733
  30, 30, 30, 30, 30, 30, 30, 30,
1399
- 30, 35, 30, 37, 38, 1, 1, 1,
1400
- 1, 1, 1, 1, 1, 1, 1, 1,
1401
- 1, 1, 1, 1, 1, 1, 1, 1,
1402
- 1, 1, 37, 1, 34, 32, 40, 40,
1403
- 40, 40, 40, 40, 40, 40, 40, 40,
1404
- 39, 39, 39, 39, 39, 39, 39, 40,
1405
- 40, 40, 40, 40, 40, 40, 40, 40,
1734
+ 30, 30, 31, 30, 32, 30, 34, 33,
1735
+ 33, 33, 33, 33, 33, 33, 33, 33,
1736
+ 33, 33, 33, 33, 33, 33, 33, 33,
1737
+ 33, 33, 33, 33, 33, 33, 33, 33,
1738
+ 33, 33, 33, 33, 33, 33, 33, 33,
1739
+ 33, 33, 33, 33, 33, 33, 33, 33,
1740
+ 33, 33, 33, 33, 33, 33, 33, 33,
1741
+ 33, 33, 33, 33, 33, 33, 33, 33,
1742
+ 35, 33, 37, 36, 36, 36, 36, 36,
1743
+ 36, 36, 36, 36, 36, 36, 36, 36,
1744
+ 36, 36, 36, 36, 36, 36, 36, 36,
1745
+ 36, 36, 36, 36, 36, 36, 36, 36,
1746
+ 36, 36, 36, 36, 36, 36, 36, 36,
1747
+ 36, 36, 36, 36, 36, 36, 36, 36,
1748
+ 36, 36, 36, 36, 36, 36, 36, 36,
1749
+ 36, 36, 36, 36, 38, 36, 39, 30,
1750
+ 36, 40, 40, 40, 40, 40, 40, 40,
1751
+ 40, 40, 40, 1, 1, 1, 1, 1,
1752
+ 1, 1, 40, 40, 40, 40, 40, 40,
1406
1753
  40, 40, 40, 40, 40, 40, 40, 40,
1407
1754
  40, 40, 40, 40, 40, 40, 40, 40,
1408
- 40, 39, 39, 39, 39, 40, 39, 40,
1755
+ 40, 40, 40, 40, 1, 1, 1, 1,
1756
+ 40, 1, 40, 40, 40, 40, 40, 40,
1409
1757
  40, 40, 40, 40, 40, 40, 40, 40,
1410
1758
  40, 40, 40, 40, 40, 40, 40, 40,
1411
- 40, 40, 40, 40, 40, 40, 40, 40,
1412
- 40, 39, 41, 39, 39, 39, 39, 39,
1413
- 39, 39, 39, 39, 39, 39, 39, 39,
1414
- 39, 39, 39, 39, 39, 39, 39, 39,
1415
- 39, 39, 39, 39, 39, 39, 39, 39,
1416
- 39, 39, 39, 39, 39, 39, 39, 39,
1417
- 42, 42, 42, 42, 42, 42, 42, 42,
1418
- 42, 42, 39, 39, 39, 39, 39, 39,
1419
- 39, 42, 42, 42, 42, 42, 42, 42,
1420
- 42, 42, 42, 42, 42, 42, 42, 42,
1421
- 42, 42, 42, 42, 42, 42, 42, 42,
1422
- 42, 42, 42, 39, 39, 39, 39, 42,
1423
- 39, 42, 42, 42, 42, 42, 42, 42,
1424
- 42, 42, 42, 42, 42, 42, 42, 42,
1425
- 42, 42, 42, 42, 42, 42, 42, 42,
1426
- 42, 42, 42, 39, 44, 43, 46, 45,
1427
- 45, 45, 45, 45, 45, 45, 45, 45,
1428
- 45, 45, 45, 45, 45, 45, 45, 45,
1429
- 45, 45, 45, 45, 45, 45, 45, 45,
1430
- 45, 45, 45, 45, 45, 45, 45, 45,
1431
- 45, 45, 45, 45, 45, 45, 45, 45,
1432
- 45, 45, 45, 45, 45, 45, 45, 45,
1433
- 45, 45, 45, 45, 45, 45, 45, 45,
1434
- 47, 45, 48, 43, 47, 45, 1, 1,
1435
- 1, 0
1759
+ 40, 40, 40, 40, 1, 42, 42, 42,
1760
+ 42, 42, 41, 41, 41, 41, 41, 41,
1761
+ 41, 41, 41, 41, 41, 41, 41, 41,
1762
+ 41, 41, 41, 41, 42, 41, 43, 41,
1763
+ 45, 44, 44, 44, 44, 44, 44, 44,
1764
+ 44, 44, 44, 44, 44, 44, 44, 44,
1765
+ 44, 44, 44, 44, 44, 44, 44, 44,
1766
+ 44, 44, 44, 44, 44, 44, 44, 44,
1767
+ 44, 44, 44, 44, 44, 44, 44, 44,
1768
+ 44, 44, 44, 44, 44, 44, 44, 44,
1769
+ 44, 44, 44, 44, 44, 44, 44, 44,
1770
+ 44, 44, 46, 44, 48, 47, 47, 47,
1771
+ 47, 47, 47, 47, 47, 47, 47, 47,
1772
+ 47, 47, 47, 47, 47, 47, 47, 47,
1773
+ 47, 47, 47, 47, 47, 47, 47, 47,
1774
+ 47, 47, 47, 47, 47, 47, 47, 47,
1775
+ 47, 47, 47, 47, 47, 47, 47, 47,
1776
+ 47, 47, 47, 47, 47, 47, 47, 47,
1777
+ 47, 47, 47, 47, 47, 47, 49, 47,
1778
+ 47, 1, 51, 50, 50, 50, 50, 50,
1779
+ 50, 50, 50, 50, 50, 50, 50, 50,
1780
+ 50, 50, 50, 50, 50, 50, 50, 50,
1781
+ 50, 50, 50, 50, 50, 50, 50, 50,
1782
+ 50, 50, 50, 50, 50, 50, 50, 50,
1783
+ 52, 52, 52, 52, 52, 52, 52, 52,
1784
+ 52, 52, 50, 50, 50, 50, 50, 50,
1785
+ 50, 52, 52, 52, 52, 52, 52, 52,
1786
+ 52, 52, 52, 52, 52, 52, 52, 52,
1787
+ 52, 52, 52, 52, 52, 52, 52, 52,
1788
+ 52, 52, 52, 50, 50, 50, 50, 52,
1789
+ 50, 52, 52, 52, 52, 52, 52, 52,
1790
+ 52, 52, 52, 52, 52, 52, 52, 52,
1791
+ 52, 52, 52, 52, 52, 52, 52, 52,
1792
+ 52, 52, 52, 50, 50, 41, 0
1436
1793
  ]
1437
1794
 
1438
1795
  class << self
@@ -1443,10 +1800,10 @@ self._bel_trans_targs = [
1443
1800
  2, 0, 3, 4, 5, 6, 7, 8,
1444
1801
  9, 10, 11, 12, 13, 14, 15, 16,
1445
1802
  17, 18, 0, 19, 20, 19, 20, 21,
1446
- 22, 23, 24, 25, 26, 27, 0, 28,
1447
- 28, 29, 31, 30, 38, 30, 38, 0,
1448
- 33, 39, 33, 0, 35, 35, 36, 37,
1449
- 40
1803
+ 22, 23, 24, 25, 26, 27, 0, 27,
1804
+ 28, 29, 30, 31, 29, 30, 31, 37,
1805
+ 38, 0, 33, 34, 35, 40, 36, 35,
1806
+ 40, 36, 0, 39, 38
1450
1807
  ]
1451
1808
 
1452
1809
  class << self
@@ -1456,11 +1813,11 @@ end
1456
1813
  self._bel_trans_actions = [
1457
1814
  0, 0, 0, 0, 0, 0, 0, 0,
1458
1815
  0, 0, 0, 0, 0, 0, 0, 0,
1459
- 1, 0, 2, 3, 4, 5, 0, 0,
1460
- 0, 0, 0, 0, 6, 0, 7, 8,
1461
- 9, 9, 9, 10, 11, 0, 12, 13,
1462
- 3, 14, 5, 15, 8, 9, 9, 9,
1463
- 16
1816
+ 0, 0, 2, 3, 4, 0, 0, 0,
1817
+ 0, 0, 0, 0, 0, 5, 7, 0,
1818
+ 0, 9, 10, 9, 0, 11, 0, 12,
1819
+ 3, 14, 0, 0, 9, 16, 9, 0,
1820
+ 17, 0, 19, 20, 0
1464
1821
  ]
1465
1822
 
1466
1823
  class << self
@@ -1470,9 +1827,9 @@ end
1470
1827
  self._bel_eof_actions = [
1471
1828
  0, 0, 0, 0, 0, 0, 0, 0,
1472
1829
  0, 0, 0, 0, 0, 0, 0, 0,
1473
- 0, 0, 2, 2, 0, 0, 0, 0,
1474
- 0, 0, 0, 7, 7, 7, 0, 7,
1475
- 13, 13, 15, 15, 15, 15, 0, 0,
1830
+ 0, 0, 1, 1, 0, 0, 0, 0,
1831
+ 0, 0, 0, 6, 8, 8, 7, 8,
1832
+ 0, 13, 15, 15, 15, 0, 18, 21,
1476
1833
  0
1477
1834
  ]
1478
1835
 
@@ -1483,38 +1840,39 @@ self.bel_start = 1;
1483
1840
  class << self
1484
1841
  attr_accessor :bel_first_final
1485
1842
  end
1486
- self.bel_first_final = 38;
1843
+ self.bel_first_final = 37;
1487
1844
  class << self
1488
1845
  attr_accessor :bel_error
1489
1846
  end
1490
1847
  self.bel_error = 0;
1491
1848
 
1492
1849
  class << self
1493
- attr_accessor :bel_en_ident
1850
+ attr_accessor :bel_en_ident_node
1494
1851
  end
1495
- self.bel_en_ident = 32;
1852
+ self.bel_en_ident_node = 32;
1496
1853
  class << self
1497
- attr_accessor :bel_en_string
1854
+ attr_accessor :bel_en_string_node
1498
1855
  end
1499
- self.bel_en_string = 34;
1856
+ self.bel_en_string_node = 33;
1500
1857
  class << self
1501
- attr_accessor :bel_en_define_namespace
1858
+ attr_accessor :bel_en_define_namespace_node
1502
1859
  end
1503
- self.bel_en_define_namespace = 1;
1860
+ self.bel_en_define_namespace_node = 1;
1504
1861
 
1505
1862
 
1506
- # end: ragel
1863
+ # end: ragel
1507
1864
  end
1508
1865
 
1509
1866
  def each
1510
- @buffers = {}
1511
- stack = []
1512
- data = @content.unpack('C*')
1513
- p = 0
1514
- pe = data.length
1515
- eof = data.length
1516
-
1517
- # begin: ragel
1867
+ @buffers = {}
1868
+ @incomplete = {}
1869
+ stack = []
1870
+ data = @content.unpack('C*')
1871
+ p = 0
1872
+ pe = data.length
1873
+ eof = data.length
1874
+
1875
+ # begin: ragel
1518
1876
 
1519
1877
  begin
1520
1878
  p ||= 0
@@ -1559,141 +1917,198 @@ begin
1559
1917
  cs = _bel_trans_targs[_trans]
1560
1918
  if _bel_trans_actions[_trans] != 0
1561
1919
  case _bel_trans_actions[_trans]
1562
- when 5 then
1563
- begin
1564
-
1565
- (@buffers[:ident] ||= []) << data[p].ord
1566
- end
1567
- when 2 then
1920
+ when 3 then
1568
1921
  begin
1569
1922
 
1570
- unless @buffers[:ident].is_a?(::AST::Node)
1571
- @buffers[:ident] ||= []
1572
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
1573
- end
1923
+ trace('IDENTIFIER start_identifier')
1924
+ @identifier_started = true
1925
+ id_start = p;
1574
1926
  end
1575
- when 9 then
1927
+ when 20 then
1576
1928
  begin
1577
1929
 
1578
- (@buffers[:string] ||= []) << data[p].ord
1930
+ trace('IDENTIFIER end_identifier')
1931
+ id_end = p
1932
+ chars = data[id_start...id_end]
1933
+ completed = !chars.empty?
1934
+ ast_node = identifier(utf8_string(chars), complete: completed)
1935
+ @buffers[:ident] = ast_node
1579
1936
  end
1580
- when 7 then
1937
+ when 2 then
1581
1938
  begin
1582
1939
 
1583
- @buffers[:string] ||= []
1584
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
1940
+ trace('IDENTIFIER an_ident_err')
1941
+ id_end = p
1942
+ chars = data[id_start...id_end]
1943
+ ast_node = identifier(utf8_string(chars), complete: false)
1944
+ @buffers[:ident] = ast_node
1585
1945
  end
1586
- when 1 then
1946
+ when 19 then
1587
1947
  begin
1588
1948
 
1589
- @buffers[:namespace_definition] = namespace_definition()
1949
+ trace('IDENTIFIER ident_node_err')
1950
+ id_end = p
1951
+ chars = data[id_start...id_end]
1952
+ ast_node = identifier(utf8_string(chars), complete: false)
1953
+ yield ast_node
1590
1954
  end
1591
- when 6 then
1955
+ when 9 then
1592
1956
  begin
1593
1957
 
1594
- @buffers[:namespace_definition] = @buffers[:namespace_definition] << domain(url())
1958
+ trace('STRING start_string')
1959
+ @string_opened = true
1960
+ p_start = p
1595
1961
  end
1596
- when 12 then
1962
+ when 7 then
1597
1963
  begin
1598
1964
 
1599
- yield @buffers[:namespace_definition]
1965
+ trace('STRING a_string_err')
1966
+ p_end = p
1967
+ chars = data[p_start...p_end]
1968
+ ast_node = string(utf8_string(chars), complete: false)
1969
+ @buffers[:string] = ast_node
1600
1970
  end
1601
- when 3 then
1971
+ when 14 then
1602
1972
  begin
1603
1973
 
1604
- @buffers[:ident] = []
1974
+ trace('STRING string_node_err')
1975
+ p_end = p
1976
+ chars = data[p_start...p_end]
1977
+ ast_node = string(utf8_string(chars), complete: false)
1978
+ yield ast_node
1605
1979
  end
1980
+ when 5 then
1606
1981
  begin
1607
1982
 
1608
- (@buffers[:ident] ||= []) << data[p].ord
1983
+ trace('DEFINE_NAMESPACE add_url_domain')
1984
+ @url_domain = true
1609
1985
  end
1610
- when 14 then
1986
+ when 4 then
1611
1987
  begin
1612
1988
 
1613
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]))
1989
+ trace('IDENTIFIER end_identifier')
1990
+ id_end = p
1991
+ chars = data[id_start...id_end]
1992
+ completed = !chars.empty?
1993
+ ast_node = identifier(utf8_string(chars), complete: completed)
1994
+ @buffers[:ident] = ast_node
1614
1995
  end
1615
1996
  begin
1616
1997
 
1617
- yield @buffers[:ident]
1998
+ trace('DEFINE_NAMESPACE add_name')
1999
+ name = @buffers.delete(:ident)
2000
+ @buffers[:namespace_definition_name] = name
1618
2001
  end
1619
- when 4 then
2002
+ when 11 then
1620
2003
  begin
1621
2004
 
1622
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]))
2005
+ trace('STRING stop_string')
2006
+ @string_closed = true
2007
+ p_end = p
1623
2008
  end
1624
2009
  begin
1625
2010
 
1626
- @buffers[:namespace_definition] = @buffers[:namespace_definition] << keyword(@buffers[:ident])
2011
+ trace('STRING string_end')
2012
+ completed = @string_opened && @string_closed
2013
+ chars = data[p_start...p_end]
2014
+ ast_node = string(utf8_string(chars), complete: true)
2015
+ @buffers[:string] = ast_node
1627
2016
  end
1628
- when 13 then
2017
+ when 10 then
1629
2018
  begin
1630
2019
 
1631
- unless @buffers[:ident].is_a?(::AST::Node)
1632
- @buffers[:ident] ||= []
1633
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
1634
- end
2020
+ trace('STRING start_string')
2021
+ @string_opened = true
2022
+ p_start = p
1635
2023
  end
1636
2024
  begin
1637
2025
 
1638
- @buffers[:ident] ||= []
1639
- yield @buffers[:ident]
2026
+ trace('STRING stop_string')
2027
+ @string_closed = true
2028
+ p_end = p
1640
2029
  end
1641
- when 8 then
1642
2030
  begin
1643
2031
 
1644
- @buffers[:string] = []
2032
+ trace('STRING string_end')
2033
+ completed = @string_opened && @string_closed
2034
+ chars = data[p_start...p_end]
2035
+ ast_node = string(utf8_string(chars), complete: true)
2036
+ @buffers[:string] = ast_node
1645
2037
  end
2038
+ when 17 then
1646
2039
  begin
1647
2040
 
1648
- (@buffers[:string] ||= []) << data[p].ord
2041
+ trace('STRING stop_string')
2042
+ @string_closed = true
2043
+ p_end = p
1649
2044
  end
1650
- when 16 then
1651
2045
  begin
1652
2046
 
1653
- @buffers[:string] = string(utf8_string(@buffers[:string]))
2047
+ trace('STRING string_end')
2048
+ completed = @string_opened && @string_closed
2049
+ chars = data[p_start...p_end]
2050
+ ast_node = string(utf8_string(chars), complete: true)
2051
+ @buffers[:string] = ast_node
1654
2052
  end
1655
2053
  begin
1656
2054
 
2055
+ trace('STRING yield_string')
1657
2056
  yield @buffers[:string]
1658
2057
  end
1659
- when 10 then
2058
+ when 12 then
1660
2059
  begin
1661
2060
 
1662
- @buffers[:string] = string(utf8_string(@buffers[:string]))
2061
+ trace('DEFINE_NAMESPACE add_string_value')
2062
+ string_node = @buffers.delete(:string)
2063
+ leaf = domain(url(string_node))
2064
+ leaf.complete = string_node.complete
2065
+ @buffers[:namespace_definition_domain] = leaf
1663
2066
  end
1664
2067
  begin
1665
2068
 
1666
- keyword, domain = @buffers[:namespace_definition].children
1667
- domain = domain(
1668
- domain.children[0] << @buffers[:string])
1669
- @buffers[:namespace_definition] = namespace_definition(keyword, domain)
2069
+ trace('DEFINE_NAMESPACE define_namespace_end')
2070
+ namespace_definition_node = namespace_definition()
2071
+
2072
+ name = @buffers.delete(:namespace_definition_name)
2073
+ namespace_definition_node <<= keyword(name)
2074
+
2075
+ domain = @buffers.delete(:namespace_definition_domain)
2076
+ unless domain.nil?
2077
+ namespace_definition_node <<= domain
2078
+ namespace_definition_node.complete = domain.complete
2079
+ end
2080
+ @buffers[:namespace_definition] = namespace_definition_node
1670
2081
  end
1671
- when 15 then
1672
2082
  begin
1673
2083
 
1674
- @buffers[:string] ||= []
1675
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
2084
+ trace('DEFINE_NAMESPACE yield_define_namespace')
2085
+ yield @buffers[:namespace_definition]
1676
2086
  end
2087
+ when 16 then
1677
2088
  begin
1678
2089
 
1679
- @buffers[:string] ||= []
1680
- yield @buffers[:string]
2090
+ trace('STRING start_string')
2091
+ @string_opened = true
2092
+ p_start = p
1681
2093
  end
1682
- when 11 then
1683
2094
  begin
1684
2095
 
1685
- @buffers[:string] = string(utf8_string(@buffers[:string]))
2096
+ trace('STRING stop_string')
2097
+ @string_closed = true
2098
+ p_end = p
1686
2099
  end
1687
2100
  begin
1688
2101
 
1689
- keyword, domain = @buffers[:namespace_definition].children
1690
- domain = domain(
1691
- domain.children[0] << @buffers[:string])
1692
- @buffers[:namespace_definition] = namespace_definition(keyword, domain)
2102
+ trace('STRING string_end')
2103
+ completed = @string_opened && @string_closed
2104
+ chars = data[p_start...p_end]
2105
+ ast_node = string(utf8_string(chars), complete: true)
2106
+ @buffers[:string] = ast_node
1693
2107
  end
1694
2108
  begin
1695
2109
 
1696
- yield @buffers[:namespace_definition]
2110
+ trace('STRING yield_string')
2111
+ yield @buffers[:string]
1697
2112
  end
1698
2113
  end
1699
2114
  end
@@ -1712,42 +2127,146 @@ begin
1712
2127
  if _goto_level <= _test_eof
1713
2128
  if p == eof
1714
2129
  case _bel_eof_actions[cs]
1715
- when 2 then
2130
+ when 21 then
1716
2131
  begin
1717
2132
 
1718
- unless @buffers[:ident].is_a?(::AST::Node)
1719
- @buffers[:ident] ||= []
1720
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
1721
- end
2133
+ trace('IDENTIFIER yield_identifier')
2134
+ yield @buffers[:ident]
1722
2135
  end
1723
2136
  when 7 then
1724
2137
  begin
1725
2138
 
1726
- @buffers[:string] ||= []
1727
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
2139
+ trace('STRING a_string_err')
2140
+ p_end = p
2141
+ chars = data[p_start...p_end]
2142
+ ast_node = string(utf8_string(chars), complete: false)
2143
+ @buffers[:string] = ast_node
1728
2144
  end
1729
- when 13 then
2145
+ when 18 then
1730
2146
  begin
1731
2147
 
1732
- unless @buffers[:ident].is_a?(::AST::Node)
1733
- @buffers[:ident] ||= []
1734
- @buffers[:ident] = identifier(utf8_string(@buffers[:ident]).sub(/\n$/, ''))
1735
- end
2148
+ trace('IDENTIFIER end_identifier')
2149
+ id_end = p
2150
+ chars = data[id_start...id_end]
2151
+ completed = !chars.empty?
2152
+ ast_node = identifier(utf8_string(chars), complete: completed)
2153
+ @buffers[:ident] = ast_node
1736
2154
  end
1737
2155
  begin
1738
2156
 
1739
- @buffers[:ident] ||= []
2157
+ trace('IDENTIFIER yield_identifier')
1740
2158
  yield @buffers[:ident]
1741
2159
  end
2160
+ when 1 then
2161
+ begin
2162
+
2163
+ trace('IDENTIFIER an_ident_eof')
2164
+ if @identifier_started
2165
+ id_end = p
2166
+ chars = data[id_start...id_end]
2167
+ completed = !chars.empty?
2168
+ ast_node = identifier(utf8_string(chars), complete: completed)
2169
+ @buffers[:ident] = ast_node
2170
+ end
2171
+ end
2172
+ begin
2173
+
2174
+ trace('IDENTIFIER an_ident_err')
2175
+ id_end = p
2176
+ chars = data[id_start...id_end]
2177
+ ast_node = identifier(utf8_string(chars), complete: false)
2178
+ @buffers[:ident] = ast_node
2179
+ end
2180
+ when 6 then
2181
+ begin
2182
+
2183
+ trace('STRING a_string_err')
2184
+ p_end = p
2185
+ chars = data[p_start...p_end]
2186
+ ast_node = string(utf8_string(chars), complete: false)
2187
+ @buffers[:string] = ast_node
2188
+ end
2189
+ begin
2190
+
2191
+ trace('DEFINE_NAMESPACE define_namespace_node_eof')
2192
+ leaf = url()
2193
+ string_node = @buffers.delete(:string)
2194
+ unless string_node.nil?
2195
+ leaf <<= string_node
2196
+ leaf.complete = string_node.complete
2197
+ end
2198
+ domain_node = domain(leaf)
2199
+ domain_node.complete = leaf.complete
2200
+ namespace_definition_node = namespace_definition(domain_node)
2201
+ namespace_definition_node.complete = domain_node.complete
2202
+ yield namespace_definition_node
2203
+ end
2204
+ when 13 then
2205
+ begin
2206
+
2207
+ trace('STRING string_node_err')
2208
+ p_end = p
2209
+ chars = data[p_start...p_end]
2210
+ ast_node = string(utf8_string(chars), complete: false)
2211
+ yield ast_node
2212
+ end
2213
+ begin
2214
+
2215
+ trace('STRING string_node_eof')
2216
+ yield @buffers[:string]
2217
+ end
2218
+ when 8 then
2219
+ begin
2220
+
2221
+ trace('STRING eof_string')
2222
+ p_end = p
2223
+ chars = data[p_start...p_end]
2224
+ ast_node = string(utf8_string(chars), complete: false)
2225
+ @buffers[:string] = ast_node
2226
+ end
2227
+ begin
2228
+
2229
+ trace('STRING a_string_err')
2230
+ p_end = p
2231
+ chars = data[p_start...p_end]
2232
+ ast_node = string(utf8_string(chars), complete: false)
2233
+ @buffers[:string] = ast_node
2234
+ end
2235
+ begin
2236
+
2237
+ trace('DEFINE_NAMESPACE define_namespace_node_eof')
2238
+ leaf = url()
2239
+ string_node = @buffers.delete(:string)
2240
+ unless string_node.nil?
2241
+ leaf <<= string_node
2242
+ leaf.complete = string_node.complete
2243
+ end
2244
+ domain_node = domain(leaf)
2245
+ domain_node.complete = leaf.complete
2246
+ namespace_definition_node = namespace_definition(domain_node)
2247
+ namespace_definition_node.complete = domain_node.complete
2248
+ yield namespace_definition_node
2249
+ end
1742
2250
  when 15 then
1743
2251
  begin
1744
2252
 
1745
- @buffers[:string] ||= []
1746
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
2253
+ trace('STRING eof_string')
2254
+ p_end = p
2255
+ chars = data[p_start...p_end]
2256
+ ast_node = string(utf8_string(chars), complete: false)
2257
+ @buffers[:string] = ast_node
2258
+ end
2259
+ begin
2260
+
2261
+ trace('STRING string_node_err')
2262
+ p_end = p
2263
+ chars = data[p_start...p_end]
2264
+ ast_node = string(utf8_string(chars), complete: false)
2265
+ yield ast_node
1747
2266
  end
1748
2267
  begin
1749
2268
 
1750
- @buffers[:string] ||= []
2269
+ trace('STRING string_node_eof')
1751
2270
  yield @buffers[:string]
1752
2271
  end
1753
2272
  end
@@ -1760,7 +2279,7 @@ begin
1760
2279
  end
1761
2280
  end
1762
2281
 
1763
- # end: ragel
2282
+ # end: ragel
1764
2283
  end
1765
2284
  end
1766
2285
  end