edn_turbo 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -6
- data/Rakefile +6 -3
- data/ext/edn_turbo/edn_parser.cc +1140 -414
- data/ext/edn_turbo/edn_parser.h +24 -17
- data/ext/edn_turbo/edn_parser.rl +208 -85
- data/ext/edn_turbo/edn_parser_def.cc +61 -14
- data/ext/edn_turbo/main.cc +4 -0
- data/lib/edn_turbo/version.rb +2 -2
- data/lib/edn_turbo.rb +14 -0
- data/test/test_output_diff.rb +8 -8
- metadata +2 -2
data/ext/edn_turbo/edn_parser.cc
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
//
|
20
20
|
|
21
21
|
|
22
|
-
#line
|
22
|
+
#line 61 "edn_parser.rl"
|
23
23
|
|
24
24
|
|
25
25
|
// ============================================================
|
@@ -29,19 +29,19 @@
|
|
29
29
|
|
30
30
|
#line 31 "edn_parser.cc"
|
31
31
|
static const int EDN_value_start = 1;
|
32
|
-
static const int EDN_value_first_final =
|
32
|
+
static const int EDN_value_first_final = 2;
|
33
33
|
static const int EDN_value_error = 0;
|
34
34
|
|
35
35
|
static const int EDN_value_en_main = 1;
|
36
36
|
|
37
37
|
|
38
|
-
#line
|
38
|
+
#line 160 "edn_parser.rl"
|
39
39
|
|
40
40
|
|
41
41
|
|
42
42
|
const char *edn::Parser::parse_value(const char *p, const char *pe, Rice::Object& o)
|
43
43
|
{
|
44
|
-
//
|
44
|
+
//std::cerr << __FUNCTION__ << " - p: '" << p << "'" << std::endl;
|
45
45
|
int cs;
|
46
46
|
|
47
47
|
|
@@ -50,7 +50,7 @@ const char *edn::Parser::parse_value(const char *p, const char *pe, Rice::Object
|
|
50
50
|
cs = EDN_value_start;
|
51
51
|
}
|
52
52
|
|
53
|
-
#line
|
53
|
+
#line 169 "edn_parser.rl"
|
54
54
|
|
55
55
|
#line 56 "edn_parser.cc"
|
56
56
|
{
|
@@ -63,19 +63,20 @@ case 1:
|
|
63
63
|
case 34: goto tr2;
|
64
64
|
case 35: goto tr3;
|
65
65
|
case 40: goto tr4;
|
66
|
-
case 42: goto tr0;
|
67
|
-
case 45: goto tr5;
|
68
66
|
case 58: goto tr6;
|
69
|
-
case 91: goto
|
70
|
-
case 92: goto
|
67
|
+
case 91: goto tr8;
|
68
|
+
case 92: goto tr9;
|
71
69
|
case 95: goto tr0;
|
72
|
-
case 123: goto
|
70
|
+
case 123: goto tr10;
|
73
71
|
}
|
74
72
|
if ( (*p) < 48 ) {
|
75
|
-
if ( (*p)
|
76
|
-
if (
|
73
|
+
if ( (*p) < 42 ) {
|
74
|
+
if ( 33 <= (*p) && (*p) <= 38 )
|
77
75
|
goto tr0;
|
78
|
-
} else if ( (*p)
|
76
|
+
} else if ( (*p) > 43 ) {
|
77
|
+
if ( 45 <= (*p) && (*p) <= 47 )
|
78
|
+
goto tr0;
|
79
|
+
} else
|
79
80
|
goto tr0;
|
80
81
|
} else if ( (*p) > 57 ) {
|
81
82
|
if ( (*p) < 65 ) {
|
@@ -83,9 +84,9 @@ case 1:
|
|
83
84
|
goto tr0;
|
84
85
|
} else if ( (*p) > 90 ) {
|
85
86
|
if ( 97 <= (*p) && (*p) <= 122 )
|
86
|
-
goto
|
87
|
+
goto tr7;
|
87
88
|
} else
|
88
|
-
goto
|
89
|
+
goto tr7;
|
89
90
|
} else
|
90
91
|
goto tr5;
|
91
92
|
goto st0;
|
@@ -93,42 +94,33 @@ st0:
|
|
93
94
|
cs = 0;
|
94
95
|
goto _out;
|
95
96
|
tr0:
|
96
|
-
#line
|
97
|
+
#line 93 "edn_parser.rl"
|
97
98
|
{
|
98
|
-
|
99
|
-
|
100
|
-
if (np == NULL) { p--; {p++; cs = 3; goto _out;} } else {
|
101
|
-
if (sym == "true") { o = Qtrue; }
|
102
|
-
else if (sym == "false") { o = Qfalse; }
|
103
|
-
else if (sym == "nil") { o = Qnil; }
|
104
|
-
else {
|
105
|
-
o = Parser::make_edn_symbol(sym);
|
106
|
-
}
|
107
|
-
{p = (( np))-1;}
|
108
|
-
}
|
99
|
+
const char *np = parse_operator(p, pe, o);
|
100
|
+
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
109
101
|
}
|
110
|
-
goto
|
102
|
+
goto st2;
|
111
103
|
tr2:
|
112
|
-
#line
|
104
|
+
#line 83 "edn_parser.rl"
|
113
105
|
{
|
114
106
|
const char *np = parse_string(p, pe, o);
|
115
|
-
if (np == NULL) { p--; {p++; cs =
|
107
|
+
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
116
108
|
}
|
117
|
-
goto
|
109
|
+
goto st2;
|
118
110
|
tr3:
|
119
|
-
#line
|
111
|
+
#line 73 "edn_parser.rl"
|
120
112
|
{
|
121
113
|
const char *np = parse_dispatch(p + 1, pe, o);
|
122
|
-
if (np == NULL) { p--; {p++; cs =
|
114
|
+
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
123
115
|
}
|
124
|
-
goto
|
116
|
+
goto st2;
|
125
117
|
tr4:
|
126
118
|
#line 136 "edn_parser.rl"
|
127
119
|
{
|
128
120
|
const char *np = parse_list(p, pe, o);
|
129
|
-
if (np == NULL) { p--; {p++; cs =
|
121
|
+
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
130
122
|
}
|
131
|
-
goto
|
123
|
+
goto st2;
|
132
124
|
tr5:
|
133
125
|
#line 112 "edn_parser.rl"
|
134
126
|
{
|
@@ -142,71 +134,74 @@ tr5:
|
|
142
134
|
if (np) {
|
143
135
|
{p = (( np))-1;}
|
144
136
|
p--;
|
145
|
-
{p++; cs =
|
137
|
+
{p++; cs = 2; goto _out;}
|
146
138
|
}
|
147
139
|
else {
|
148
140
|
error(__FUNCTION__, *p);
|
149
141
|
{p = (( pe))-1;}
|
150
142
|
}
|
151
143
|
}
|
152
|
-
goto
|
144
|
+
goto st2;
|
153
145
|
tr6:
|
154
|
-
#line
|
146
|
+
#line 88 "edn_parser.rl"
|
155
147
|
{
|
156
148
|
const char *np = parse_keyword(p, pe, o);
|
157
|
-
if (np == NULL) { p--; {p++; cs =
|
149
|
+
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
158
150
|
}
|
159
|
-
goto
|
151
|
+
goto st2;
|
160
152
|
tr7:
|
153
|
+
#line 98 "edn_parser.rl"
|
154
|
+
{
|
155
|
+
std::string sym;
|
156
|
+
const char *np = parse_symbol(p, pe, sym);
|
157
|
+
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {
|
158
|
+
if (sym == "true") { o = Qtrue; }
|
159
|
+
else if (sym == "false") { o = Qfalse; }
|
160
|
+
else if (sym == "nil") { o = Qnil; }
|
161
|
+
else {
|
162
|
+
o = Parser::make_edn_symbol(sym);
|
163
|
+
}
|
164
|
+
{p = (( np))-1;}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
goto st2;
|
168
|
+
tr8:
|
161
169
|
#line 131 "edn_parser.rl"
|
162
170
|
{
|
163
171
|
const char *np = parse_vector(p, pe, o);
|
164
|
-
if (np == NULL) { p--; {p++; cs =
|
172
|
+
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
165
173
|
}
|
166
|
-
goto
|
174
|
+
goto st2;
|
167
175
|
tr9:
|
168
|
-
#line
|
176
|
+
#line 78 "edn_parser.rl"
|
169
177
|
{
|
170
|
-
const char *np =
|
171
|
-
if (np == NULL) { p--; {p++; cs =
|
178
|
+
const char *np = parse_esc_char(p, pe, o);
|
179
|
+
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
172
180
|
}
|
173
|
-
goto
|
181
|
+
goto st2;
|
174
182
|
tr10:
|
175
|
-
#line
|
183
|
+
#line 141 "edn_parser.rl"
|
176
184
|
{
|
177
|
-
|
178
|
-
|
179
|
-
if (!parse_escaped_char(*p, s)) {
|
180
|
-
p--; {p++; cs = 3; goto _out;}
|
181
|
-
} else {
|
182
|
-
o = s;
|
183
|
-
}
|
185
|
+
const char *np = parse_map(p, pe, o);
|
186
|
+
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
184
187
|
}
|
185
|
-
goto
|
186
|
-
st3:
|
187
|
-
if ( ++p == pe )
|
188
|
-
goto _test_eof3;
|
189
|
-
case 3:
|
190
|
-
#line 151 "edn_parser.rl"
|
191
|
-
{ p--; {p++; cs = 3; goto _out;} }
|
192
|
-
#line 193 "edn_parser.cc"
|
193
|
-
goto st0;
|
188
|
+
goto st2;
|
194
189
|
st2:
|
195
190
|
if ( ++p == pe )
|
196
191
|
goto _test_eof2;
|
197
192
|
case 2:
|
198
|
-
|
199
|
-
|
193
|
+
#line 146 "edn_parser.rl"
|
194
|
+
{ p--; {p++; cs = 2; goto _out;} }
|
195
|
+
#line 196 "edn_parser.cc"
|
200
196
|
goto st0;
|
201
197
|
}
|
202
|
-
_test_eof3: cs = 3; goto _test_eof;
|
203
198
|
_test_eof2: cs = 2; goto _test_eof;
|
204
199
|
|
205
200
|
_test_eof: {}
|
206
201
|
_out: {}
|
207
202
|
}
|
208
203
|
|
209
|
-
#line
|
204
|
+
#line 170 "edn_parser.rl"
|
210
205
|
|
211
206
|
if (cs >= EDN_value_first_final) {
|
212
207
|
return p;
|
@@ -222,36 +217,37 @@ case 2:
|
|
222
217
|
|
223
218
|
|
224
219
|
// ============================================================
|
225
|
-
//
|
220
|
+
// operator parsing
|
226
221
|
//
|
227
222
|
|
228
|
-
#line
|
229
|
-
static const int
|
230
|
-
static const int
|
231
|
-
static const int
|
223
|
+
#line 224 "edn_parser.cc"
|
224
|
+
static const int EDN_operator_start = 1;
|
225
|
+
static const int EDN_operator_first_final = 3;
|
226
|
+
static const int EDN_operator_error = 0;
|
232
227
|
|
233
|
-
static const int
|
228
|
+
static const int EDN_operator_en_main = 1;
|
234
229
|
|
235
230
|
|
236
|
-
#line
|
231
|
+
#line 237 "edn_parser.rl"
|
237
232
|
|
238
233
|
|
239
234
|
|
240
|
-
const char* edn::Parser::
|
235
|
+
const char* edn::Parser::parse_operator(const char *p, const char *pe, Rice::Object& o)
|
241
236
|
{
|
242
|
-
//std::cerr << __FUNCTION__ << " - p: '" << p << "'" << std::endl;
|
237
|
+
// std::cerr << __FUNCTION__ << " - p: '" << p << "'" << std::endl;
|
243
238
|
int cs;
|
239
|
+
std::string op;
|
244
240
|
|
245
241
|
|
246
|
-
#line
|
242
|
+
#line 243 "edn_parser.cc"
|
247
243
|
{
|
248
|
-
cs =
|
244
|
+
cs = EDN_operator_start;
|
249
245
|
}
|
250
246
|
|
251
|
-
#line
|
247
|
+
#line 247 "edn_parser.rl"
|
252
248
|
p_save = p;
|
253
249
|
|
254
|
-
#line
|
250
|
+
#line 251 "edn_parser.cc"
|
255
251
|
{
|
256
252
|
if ( p == pe )
|
257
253
|
goto _test_eof;
|
@@ -260,24 +256,17 @@ const char* edn::Parser::parse_symbol(const char *p, const char *pe, std::string
|
|
260
256
|
case 1:
|
261
257
|
switch( (*p) ) {
|
262
258
|
case 33: goto st3;
|
259
|
+
case 42: goto st3;
|
260
|
+
case 43: goto st7;
|
261
|
+
case 45: goto st7;
|
262
|
+
case 46: goto st9;
|
263
|
+
case 47: goto st3;
|
263
264
|
case 95: goto st3;
|
264
265
|
}
|
265
|
-
if ( (*p)
|
266
|
-
if ( (*p)
|
267
|
-
if ( 42 <= (*p) && (*p) <= 43 )
|
268
|
-
goto st3;
|
269
|
-
} else if ( (*p) >= 36 )
|
270
|
-
goto st3;
|
271
|
-
} else if ( (*p) > 47 ) {
|
272
|
-
if ( (*p) < 65 ) {
|
273
|
-
if ( 60 <= (*p) && (*p) <= 63 )
|
274
|
-
goto st3;
|
275
|
-
} else if ( (*p) > 90 ) {
|
276
|
-
if ( 97 <= (*p) && (*p) <= 122 )
|
277
|
-
goto st3;
|
278
|
-
} else
|
266
|
+
if ( (*p) > 38 ) {
|
267
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
279
268
|
goto st3;
|
280
|
-
} else
|
269
|
+
} else if ( (*p) >= 36 )
|
281
270
|
goto st3;
|
282
271
|
goto st0;
|
283
272
|
st0:
|
@@ -288,111 +277,745 @@ st3:
|
|
288
277
|
goto _test_eof3;
|
289
278
|
case 3:
|
290
279
|
switch( (*p) ) {
|
291
|
-
case 10: goto
|
292
|
-
case 32: goto
|
293
|
-
case 33: goto
|
294
|
-
case 44: goto
|
295
|
-
case 59: goto
|
296
|
-
case 95: goto
|
280
|
+
case 10: goto tr8;
|
281
|
+
case 32: goto tr7;
|
282
|
+
case 33: goto st0;
|
283
|
+
case 44: goto tr7;
|
284
|
+
case 59: goto tr9;
|
285
|
+
case 95: goto st0;
|
297
286
|
}
|
298
287
|
if ( (*p) < 42 ) {
|
299
288
|
if ( (*p) > 13 ) {
|
300
|
-
if (
|
301
|
-
goto
|
289
|
+
if ( 36 <= (*p) && (*p) <= 38 )
|
290
|
+
goto st0;
|
302
291
|
} else if ( (*p) >= 9 )
|
303
|
-
goto
|
304
|
-
} else if ( (*p) >
|
305
|
-
if ( (*p)
|
292
|
+
goto tr7;
|
293
|
+
} else if ( (*p) > 57 ) {
|
294
|
+
if ( (*p) < 65 ) {
|
295
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
296
|
+
goto st0;
|
297
|
+
} else if ( (*p) > 90 ) {
|
306
298
|
if ( 97 <= (*p) && (*p) <= 122 )
|
307
|
-
goto
|
308
|
-
} else
|
309
|
-
goto
|
299
|
+
goto st0;
|
300
|
+
} else
|
301
|
+
goto st0;
|
310
302
|
} else
|
311
|
-
goto
|
312
|
-
goto
|
313
|
-
|
314
|
-
#line
|
303
|
+
goto st0;
|
304
|
+
goto tr6;
|
305
|
+
tr6:
|
306
|
+
#line 223 "edn_parser.rl"
|
307
|
+
{
|
308
|
+
// std::cerr << "PARSE OP::OP '" << *(fpc-1) << "', pe: '" << *pe << "'" << std::endl;
|
309
|
+
std::string sym;
|
310
|
+
sym += *(p - 1);
|
311
|
+
o = Parser::make_edn_symbol(sym);
|
312
|
+
}
|
313
|
+
#line 230 "edn_parser.rl"
|
314
|
+
{ p--; {p++; cs = 4; goto _out;} }
|
315
|
+
goto st4;
|
316
|
+
tr10:
|
317
|
+
#line 230 "edn_parser.rl"
|
315
318
|
{ p--; {p++; cs = 4; goto _out;} }
|
316
319
|
goto st4;
|
317
320
|
st4:
|
318
321
|
if ( ++p == pe )
|
319
322
|
goto _test_eof4;
|
320
323
|
case 4:
|
321
|
-
#line
|
324
|
+
#line 325 "edn_parser.cc"
|
322
325
|
goto st0;
|
323
|
-
|
326
|
+
tr5:
|
324
327
|
#line 23 "edn_parser.rl"
|
325
328
|
{ line_number++; }
|
326
329
|
goto st5;
|
327
|
-
|
328
|
-
#line
|
330
|
+
tr7:
|
331
|
+
#line 223 "edn_parser.rl"
|
332
|
+
{
|
333
|
+
// std::cerr << "PARSE OP::OP '" << *(fpc-1) << "', pe: '" << *pe << "'" << std::endl;
|
334
|
+
std::string sym;
|
335
|
+
sym += *(p - 1);
|
336
|
+
o = Parser::make_edn_symbol(sym);
|
337
|
+
}
|
338
|
+
#line 230 "edn_parser.rl"
|
329
339
|
{ p--; {p++; cs = 5; goto _out;} }
|
330
340
|
goto st5;
|
331
|
-
|
341
|
+
tr8:
|
342
|
+
#line 223 "edn_parser.rl"
|
343
|
+
{
|
344
|
+
// std::cerr << "PARSE OP::OP '" << *(fpc-1) << "', pe: '" << *pe << "'" << std::endl;
|
345
|
+
std::string sym;
|
346
|
+
sym += *(p - 1);
|
347
|
+
o = Parser::make_edn_symbol(sym);
|
348
|
+
}
|
349
|
+
#line 23 "edn_parser.rl"
|
350
|
+
{ line_number++; }
|
351
|
+
#line 230 "edn_parser.rl"
|
352
|
+
{ p--; {p++; cs = 5; goto _out;} }
|
353
|
+
goto st5;
|
354
|
+
tr11:
|
355
|
+
#line 230 "edn_parser.rl"
|
356
|
+
{ p--; {p++; cs = 5; goto _out;} }
|
357
|
+
goto st5;
|
358
|
+
tr12:
|
332
359
|
#line 23 "edn_parser.rl"
|
333
360
|
{ line_number++; }
|
334
|
-
#line
|
361
|
+
#line 230 "edn_parser.rl"
|
335
362
|
{ p--; {p++; cs = 5; goto _out;} }
|
336
363
|
goto st5;
|
337
364
|
st5:
|
338
365
|
if ( ++p == pe )
|
339
366
|
goto _test_eof5;
|
340
367
|
case 5:
|
341
|
-
#line
|
368
|
+
#line 369 "edn_parser.cc"
|
342
369
|
switch( (*p) ) {
|
343
|
-
case 10: goto
|
344
|
-
case 32: goto
|
370
|
+
case 10: goto tr12;
|
371
|
+
case 32: goto tr11;
|
345
372
|
case 33: goto st0;
|
346
|
-
case 44: goto
|
347
|
-
case 59: goto
|
373
|
+
case 44: goto tr11;
|
374
|
+
case 59: goto tr13;
|
348
375
|
case 95: goto st0;
|
349
376
|
}
|
350
377
|
if ( (*p) < 42 ) {
|
351
378
|
if ( (*p) > 13 ) {
|
352
|
-
if (
|
379
|
+
if ( 36 <= (*p) && (*p) <= 38 )
|
353
380
|
goto st0;
|
354
381
|
} else if ( (*p) >= 9 )
|
355
|
-
goto
|
356
|
-
} else if ( (*p) >
|
357
|
-
if ( (*p)
|
382
|
+
goto tr11;
|
383
|
+
} else if ( (*p) > 57 ) {
|
384
|
+
if ( (*p) < 65 ) {
|
385
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
386
|
+
goto st0;
|
387
|
+
} else if ( (*p) > 90 ) {
|
388
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
389
|
+
goto st0;
|
390
|
+
} else
|
391
|
+
goto st0;
|
392
|
+
} else
|
393
|
+
goto st0;
|
394
|
+
goto tr10;
|
395
|
+
tr9:
|
396
|
+
#line 223 "edn_parser.rl"
|
397
|
+
{
|
398
|
+
// std::cerr << "PARSE OP::OP '" << *(fpc-1) << "', pe: '" << *pe << "'" << std::endl;
|
399
|
+
std::string sym;
|
400
|
+
sym += *(p - 1);
|
401
|
+
o = Parser::make_edn_symbol(sym);
|
402
|
+
}
|
403
|
+
#line 230 "edn_parser.rl"
|
404
|
+
{ p--; {p++; cs = 6; goto _out;} }
|
405
|
+
goto st6;
|
406
|
+
tr13:
|
407
|
+
#line 230 "edn_parser.rl"
|
408
|
+
{ p--; {p++; cs = 6; goto _out;} }
|
409
|
+
goto st6;
|
410
|
+
st6:
|
411
|
+
if ( ++p == pe )
|
412
|
+
goto _test_eof6;
|
413
|
+
case 6:
|
414
|
+
#line 415 "edn_parser.cc"
|
415
|
+
if ( (*p) == 10 )
|
416
|
+
goto tr5;
|
417
|
+
goto st2;
|
418
|
+
st2:
|
419
|
+
if ( ++p == pe )
|
420
|
+
goto _test_eof2;
|
421
|
+
case 2:
|
422
|
+
if ( (*p) == 10 )
|
423
|
+
goto tr5;
|
424
|
+
goto st2;
|
425
|
+
st7:
|
426
|
+
if ( ++p == pe )
|
427
|
+
goto _test_eof7;
|
428
|
+
case 7:
|
429
|
+
switch( (*p) ) {
|
430
|
+
case 10: goto tr8;
|
431
|
+
case 32: goto tr7;
|
432
|
+
case 33: goto st0;
|
433
|
+
case 44: goto tr7;
|
434
|
+
case 59: goto tr9;
|
435
|
+
case 95: goto st0;
|
436
|
+
}
|
437
|
+
if ( (*p) < 48 ) {
|
438
|
+
if ( (*p) < 36 ) {
|
439
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
440
|
+
goto tr7;
|
441
|
+
} else if ( (*p) > 38 ) {
|
442
|
+
if ( 42 <= (*p) && (*p) <= 47 )
|
443
|
+
goto st0;
|
444
|
+
} else
|
445
|
+
goto st0;
|
446
|
+
} else if ( (*p) > 57 ) {
|
447
|
+
if ( (*p) < 65 ) {
|
448
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
449
|
+
goto st0;
|
450
|
+
} else if ( (*p) > 90 ) {
|
451
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
452
|
+
goto tr15;
|
453
|
+
} else
|
454
|
+
goto tr15;
|
455
|
+
} else
|
456
|
+
goto tr14;
|
457
|
+
goto tr6;
|
458
|
+
tr14:
|
459
|
+
#line 203 "edn_parser.rl"
|
460
|
+
{
|
461
|
+
//std::cerr << "PARSE OP::NUM '" << (fpc - 1) << "'" << std::endl;
|
462
|
+
// try to parse a decimal first
|
463
|
+
const char *np = parse_decimal(p_save, pe, o);
|
464
|
+
if (np == NULL) {
|
465
|
+
// if we can't, try to parse it as an int
|
466
|
+
np = parse_integer(p_save, pe, o);
|
467
|
+
}
|
468
|
+
|
469
|
+
if (np) {
|
470
|
+
{p = (( np))-1;}
|
471
|
+
p--;
|
472
|
+
{p++; cs = 8; goto _out;}
|
473
|
+
}
|
474
|
+
else {
|
475
|
+
error(__FUNCTION__, *p);
|
476
|
+
{p = (( pe))-1;}
|
477
|
+
}
|
478
|
+
}
|
479
|
+
goto st8;
|
480
|
+
tr15:
|
481
|
+
#line 193 "edn_parser.rl"
|
482
|
+
{
|
483
|
+
// std::cerr << "PARSE OP::SYM '" << (fpc - 1) << "'" << std::endl;
|
484
|
+
std::string sym;
|
485
|
+
const char *np = parse_symbol(p_save, pe, sym);
|
486
|
+
if (np == NULL) { p--; {p++; cs = 8; goto _out;} } else {
|
487
|
+
o = Parser::make_edn_symbol(sym);
|
488
|
+
{p = (( np))-1;}
|
489
|
+
}
|
490
|
+
}
|
491
|
+
goto st8;
|
492
|
+
st8:
|
493
|
+
if ( ++p == pe )
|
494
|
+
goto _test_eof8;
|
495
|
+
case 8:
|
496
|
+
#line 497 "edn_parser.cc"
|
497
|
+
switch( (*p) ) {
|
498
|
+
case 33: goto st0;
|
499
|
+
case 95: goto st0;
|
500
|
+
}
|
501
|
+
if ( (*p) < 45 ) {
|
502
|
+
if ( (*p) > 38 ) {
|
503
|
+
if ( 42 <= (*p) && (*p) <= 43 )
|
504
|
+
goto st0;
|
505
|
+
} else if ( (*p) >= 36 )
|
506
|
+
goto st0;
|
507
|
+
} else if ( (*p) > 57 ) {
|
508
|
+
if ( (*p) < 65 ) {
|
509
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
510
|
+
goto st0;
|
511
|
+
} else if ( (*p) > 90 ) {
|
512
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
513
|
+
goto st0;
|
514
|
+
} else
|
515
|
+
goto st0;
|
516
|
+
} else
|
517
|
+
goto st0;
|
518
|
+
goto tr10;
|
519
|
+
st9:
|
520
|
+
if ( ++p == pe )
|
521
|
+
goto _test_eof9;
|
522
|
+
case 9:
|
523
|
+
switch( (*p) ) {
|
524
|
+
case 10: goto tr8;
|
525
|
+
case 32: goto tr7;
|
526
|
+
case 33: goto st0;
|
527
|
+
case 44: goto tr7;
|
528
|
+
case 59: goto tr9;
|
529
|
+
case 95: goto st0;
|
530
|
+
}
|
531
|
+
if ( (*p) < 42 ) {
|
532
|
+
if ( (*p) > 13 ) {
|
533
|
+
if ( 36 <= (*p) && (*p) <= 38 )
|
534
|
+
goto st0;
|
535
|
+
} else if ( (*p) >= 9 )
|
536
|
+
goto tr7;
|
537
|
+
} else if ( (*p) > 57 ) {
|
538
|
+
if ( (*p) < 65 ) {
|
539
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
540
|
+
goto st0;
|
541
|
+
} else if ( (*p) > 90 ) {
|
542
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
543
|
+
goto tr15;
|
544
|
+
} else
|
545
|
+
goto tr15;
|
546
|
+
} else
|
547
|
+
goto st0;
|
548
|
+
goto tr6;
|
549
|
+
}
|
550
|
+
_test_eof3: cs = 3; goto _test_eof;
|
551
|
+
_test_eof4: cs = 4; goto _test_eof;
|
552
|
+
_test_eof5: cs = 5; goto _test_eof;
|
553
|
+
_test_eof6: cs = 6; goto _test_eof;
|
554
|
+
_test_eof2: cs = 2; goto _test_eof;
|
555
|
+
_test_eof7: cs = 7; goto _test_eof;
|
556
|
+
_test_eof8: cs = 8; goto _test_eof;
|
557
|
+
_test_eof9: cs = 9; goto _test_eof;
|
558
|
+
|
559
|
+
_test_eof: {}
|
560
|
+
if ( p == eof )
|
561
|
+
{
|
562
|
+
switch ( cs ) {
|
563
|
+
case 3:
|
564
|
+
case 7:
|
565
|
+
case 9:
|
566
|
+
#line 223 "edn_parser.rl"
|
567
|
+
{
|
568
|
+
// std::cerr << "PARSE OP::OP '" << *(fpc-1) << "', pe: '" << *pe << "'" << std::endl;
|
569
|
+
std::string sym;
|
570
|
+
sym += *(p - 1);
|
571
|
+
o = Parser::make_edn_symbol(sym);
|
572
|
+
}
|
573
|
+
break;
|
574
|
+
#line 575 "edn_parser.cc"
|
575
|
+
}
|
576
|
+
}
|
577
|
+
|
578
|
+
_out: {}
|
579
|
+
}
|
580
|
+
|
581
|
+
#line 249 "edn_parser.rl"
|
582
|
+
|
583
|
+
if (cs >= EDN_operator_first_final) {
|
584
|
+
return p;
|
585
|
+
}
|
586
|
+
else if (cs == EDN_operator_error) {
|
587
|
+
error(__FUNCTION__, *p);
|
588
|
+
return pe;
|
589
|
+
}
|
590
|
+
else if (cs == EDN_operator_en_main) {} // silence ragel warning
|
591
|
+
return NULL;
|
592
|
+
}
|
593
|
+
|
594
|
+
|
595
|
+
|
596
|
+
// ============================================================
|
597
|
+
// escaped char parsing
|
598
|
+
//
|
599
|
+
|
600
|
+
#line 601 "edn_parser.cc"
|
601
|
+
static const int EDN_escaped_char_start = 1;
|
602
|
+
static const int EDN_escaped_char_first_final = 4;
|
603
|
+
static const int EDN_escaped_char_error = 0;
|
604
|
+
|
605
|
+
static const int EDN_escaped_char_en_main = 1;
|
606
|
+
|
607
|
+
|
608
|
+
#line 279 "edn_parser.rl"
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
const char* edn::Parser::parse_esc_char(const char *p, const char *pe, Rice::Object& o)
|
613
|
+
{
|
614
|
+
//std::cerr << __FUNCTION__ << " - p: '" << p << "'" << std::endl;
|
615
|
+
int cs;
|
616
|
+
|
617
|
+
|
618
|
+
#line 619 "edn_parser.cc"
|
619
|
+
{
|
620
|
+
cs = EDN_escaped_char_start;
|
621
|
+
}
|
622
|
+
|
623
|
+
#line 288 "edn_parser.rl"
|
624
|
+
p_save = p;
|
625
|
+
|
626
|
+
#line 627 "edn_parser.cc"
|
627
|
+
{
|
628
|
+
if ( p == pe )
|
629
|
+
goto _test_eof;
|
630
|
+
switch ( cs )
|
631
|
+
{
|
632
|
+
case 1:
|
633
|
+
if ( (*p) == 92 )
|
634
|
+
goto st2;
|
635
|
+
goto st0;
|
636
|
+
st0:
|
637
|
+
cs = 0;
|
638
|
+
goto _out;
|
639
|
+
st2:
|
640
|
+
if ( ++p == pe )
|
641
|
+
goto _test_eof2;
|
642
|
+
case 2:
|
643
|
+
if ( (*p) > 90 ) {
|
644
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
645
|
+
goto st4;
|
646
|
+
} else if ( (*p) >= 65 )
|
647
|
+
goto st4;
|
648
|
+
goto st0;
|
649
|
+
st4:
|
650
|
+
if ( ++p == pe )
|
651
|
+
goto _test_eof4;
|
652
|
+
case 4:
|
653
|
+
switch( (*p) ) {
|
654
|
+
case 10: goto tr7;
|
655
|
+
case 32: goto tr6;
|
656
|
+
case 44: goto tr6;
|
657
|
+
case 59: goto tr8;
|
658
|
+
case 92: goto st0;
|
659
|
+
}
|
660
|
+
if ( (*p) < 65 ) {
|
661
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
662
|
+
goto tr6;
|
663
|
+
} else if ( (*p) > 90 ) {
|
664
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
665
|
+
goto st4;
|
666
|
+
} else
|
667
|
+
goto st4;
|
668
|
+
goto tr5;
|
669
|
+
tr5:
|
670
|
+
#line 274 "edn_parser.rl"
|
671
|
+
{ p--; {p++; cs = 5; goto _out;} }
|
672
|
+
goto st5;
|
673
|
+
st5:
|
674
|
+
if ( ++p == pe )
|
675
|
+
goto _test_eof5;
|
676
|
+
case 5:
|
677
|
+
#line 678 "edn_parser.cc"
|
678
|
+
goto st0;
|
679
|
+
tr4:
|
680
|
+
#line 23 "edn_parser.rl"
|
681
|
+
{ line_number++; }
|
682
|
+
goto st6;
|
683
|
+
tr6:
|
684
|
+
#line 274 "edn_parser.rl"
|
685
|
+
{ p--; {p++; cs = 6; goto _out;} }
|
686
|
+
goto st6;
|
687
|
+
tr7:
|
688
|
+
#line 23 "edn_parser.rl"
|
689
|
+
{ line_number++; }
|
690
|
+
#line 274 "edn_parser.rl"
|
691
|
+
{ p--; {p++; cs = 6; goto _out;} }
|
692
|
+
goto st6;
|
693
|
+
st6:
|
694
|
+
if ( ++p == pe )
|
695
|
+
goto _test_eof6;
|
696
|
+
case 6:
|
697
|
+
#line 698 "edn_parser.cc"
|
698
|
+
switch( (*p) ) {
|
699
|
+
case 10: goto tr7;
|
700
|
+
case 32: goto tr6;
|
701
|
+
case 44: goto tr6;
|
702
|
+
case 59: goto tr8;
|
703
|
+
case 92: goto st0;
|
704
|
+
}
|
705
|
+
if ( (*p) < 65 ) {
|
706
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
707
|
+
goto tr6;
|
708
|
+
} else if ( (*p) > 90 ) {
|
709
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
710
|
+
goto st0;
|
711
|
+
} else
|
712
|
+
goto st0;
|
713
|
+
goto tr5;
|
714
|
+
tr8:
|
715
|
+
#line 274 "edn_parser.rl"
|
716
|
+
{ p--; {p++; cs = 7; goto _out;} }
|
717
|
+
goto st7;
|
718
|
+
st7:
|
719
|
+
if ( ++p == pe )
|
720
|
+
goto _test_eof7;
|
721
|
+
case 7:
|
722
|
+
#line 723 "edn_parser.cc"
|
723
|
+
if ( (*p) == 10 )
|
724
|
+
goto tr4;
|
725
|
+
goto st3;
|
726
|
+
st3:
|
727
|
+
if ( ++p == pe )
|
728
|
+
goto _test_eof3;
|
729
|
+
case 3:
|
730
|
+
if ( (*p) == 10 )
|
731
|
+
goto tr4;
|
732
|
+
goto st3;
|
733
|
+
}
|
734
|
+
_test_eof2: cs = 2; goto _test_eof;
|
735
|
+
_test_eof4: cs = 4; goto _test_eof;
|
736
|
+
_test_eof5: cs = 5; goto _test_eof;
|
737
|
+
_test_eof6: cs = 6; goto _test_eof;
|
738
|
+
_test_eof7: cs = 7; goto _test_eof;
|
739
|
+
_test_eof3: cs = 3; goto _test_eof;
|
740
|
+
|
741
|
+
_test_eof: {}
|
742
|
+
_out: {}
|
743
|
+
}
|
744
|
+
|
745
|
+
#line 290 "edn_parser.rl"
|
746
|
+
|
747
|
+
if (cs >= EDN_escaped_char_first_final) {
|
748
|
+
if (!Parser::parse_escaped_char(p_save + 1, p, o)) {
|
749
|
+
return pe;
|
750
|
+
}
|
751
|
+
return p;
|
752
|
+
}
|
753
|
+
else if (cs == EDN_escaped_char_error) {
|
754
|
+
error(__FUNCTION__, *p);
|
755
|
+
return pe;
|
756
|
+
}
|
757
|
+
else if (cs == EDN_escaped_char_en_main) {} // silence ragel warning
|
758
|
+
return NULL;
|
759
|
+
}
|
760
|
+
|
761
|
+
|
762
|
+
|
763
|
+
|
764
|
+
// ============================================================
|
765
|
+
// symbol parsing
|
766
|
+
//
|
767
|
+
|
768
|
+
#line 769 "edn_parser.cc"
|
769
|
+
static const int EDN_symbol_start = 1;
|
770
|
+
static const int EDN_symbol_first_final = 4;
|
771
|
+
static const int EDN_symbol_error = 0;
|
772
|
+
|
773
|
+
static const int EDN_symbol_en_main = 1;
|
774
|
+
|
775
|
+
|
776
|
+
#line 323 "edn_parser.rl"
|
777
|
+
|
778
|
+
|
779
|
+
|
780
|
+
const char* edn::Parser::parse_symbol(const char *p, const char *pe, std::string& s)
|
781
|
+
{
|
782
|
+
// std::cerr << __FUNCTION__ << " - p: '" << p << "'" << std::endl;
|
783
|
+
int cs;
|
784
|
+
|
785
|
+
|
786
|
+
#line 787 "edn_parser.cc"
|
787
|
+
{
|
788
|
+
cs = EDN_symbol_start;
|
789
|
+
}
|
790
|
+
|
791
|
+
#line 332 "edn_parser.rl"
|
792
|
+
p_save = p;
|
793
|
+
|
794
|
+
#line 795 "edn_parser.cc"
|
795
|
+
{
|
796
|
+
if ( p == pe )
|
797
|
+
goto _test_eof;
|
798
|
+
switch ( cs )
|
799
|
+
{
|
800
|
+
case 1:
|
801
|
+
switch( (*p) ) {
|
802
|
+
case 33: goto st4;
|
803
|
+
case 95: goto st4;
|
804
|
+
}
|
805
|
+
if ( (*p) < 45 ) {
|
806
|
+
if ( (*p) > 38 ) {
|
807
|
+
if ( 42 <= (*p) && (*p) <= 43 )
|
808
|
+
goto st4;
|
809
|
+
} else if ( (*p) >= 36 )
|
810
|
+
goto st4;
|
811
|
+
} else if ( (*p) > 47 ) {
|
812
|
+
if ( (*p) < 65 ) {
|
813
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
814
|
+
goto st4;
|
815
|
+
} else if ( (*p) > 90 ) {
|
816
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
817
|
+
goto st8;
|
818
|
+
} else
|
819
|
+
goto st8;
|
820
|
+
} else
|
821
|
+
goto st4;
|
822
|
+
goto st0;
|
823
|
+
st0:
|
824
|
+
cs = 0;
|
825
|
+
goto _out;
|
826
|
+
st4:
|
827
|
+
if ( ++p == pe )
|
828
|
+
goto _test_eof4;
|
829
|
+
case 4:
|
830
|
+
switch( (*p) ) {
|
831
|
+
case 10: goto tr8;
|
832
|
+
case 32: goto tr7;
|
833
|
+
case 33: goto st0;
|
834
|
+
case 44: goto tr7;
|
835
|
+
case 59: goto tr9;
|
836
|
+
case 95: goto st0;
|
837
|
+
}
|
838
|
+
if ( (*p) < 42 ) {
|
839
|
+
if ( (*p) > 13 ) {
|
840
|
+
if ( 35 <= (*p) && (*p) <= 38 )
|
841
|
+
goto st0;
|
842
|
+
} else if ( (*p) >= 9 )
|
843
|
+
goto tr7;
|
844
|
+
} else if ( (*p) > 63 ) {
|
845
|
+
if ( (*p) > 90 ) {
|
846
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
847
|
+
goto st8;
|
848
|
+
} else if ( (*p) >= 65 )
|
849
|
+
goto st8;
|
850
|
+
} else
|
851
|
+
goto st0;
|
852
|
+
goto tr6;
|
853
|
+
tr6:
|
854
|
+
#line 317 "edn_parser.rl"
|
855
|
+
{ p--; {p++; cs = 5; goto _out;} }
|
856
|
+
goto st5;
|
857
|
+
st5:
|
858
|
+
if ( ++p == pe )
|
859
|
+
goto _test_eof5;
|
860
|
+
case 5:
|
861
|
+
#line 862 "edn_parser.cc"
|
862
|
+
goto st0;
|
863
|
+
tr4:
|
864
|
+
#line 23 "edn_parser.rl"
|
865
|
+
{ line_number++; }
|
866
|
+
goto st6;
|
867
|
+
tr7:
|
868
|
+
#line 317 "edn_parser.rl"
|
869
|
+
{ p--; {p++; cs = 6; goto _out;} }
|
870
|
+
goto st6;
|
871
|
+
tr8:
|
872
|
+
#line 23 "edn_parser.rl"
|
873
|
+
{ line_number++; }
|
874
|
+
#line 317 "edn_parser.rl"
|
875
|
+
{ p--; {p++; cs = 6; goto _out;} }
|
876
|
+
goto st6;
|
877
|
+
st6:
|
878
|
+
if ( ++p == pe )
|
879
|
+
goto _test_eof6;
|
880
|
+
case 6:
|
881
|
+
#line 882 "edn_parser.cc"
|
882
|
+
switch( (*p) ) {
|
883
|
+
case 10: goto tr8;
|
884
|
+
case 32: goto tr7;
|
885
|
+
case 33: goto st0;
|
886
|
+
case 44: goto tr7;
|
887
|
+
case 59: goto tr9;
|
888
|
+
case 95: goto st0;
|
889
|
+
}
|
890
|
+
if ( (*p) < 42 ) {
|
891
|
+
if ( (*p) > 13 ) {
|
892
|
+
if ( 35 <= (*p) && (*p) <= 38 )
|
893
|
+
goto st0;
|
894
|
+
} else if ( (*p) >= 9 )
|
895
|
+
goto tr7;
|
896
|
+
} else if ( (*p) > 63 ) {
|
897
|
+
if ( (*p) > 90 ) {
|
898
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
899
|
+
goto st0;
|
900
|
+
} else if ( (*p) >= 65 )
|
901
|
+
goto st0;
|
902
|
+
} else
|
903
|
+
goto st0;
|
904
|
+
goto tr6;
|
905
|
+
tr9:
|
906
|
+
#line 317 "edn_parser.rl"
|
907
|
+
{ p--; {p++; cs = 7; goto _out;} }
|
908
|
+
goto st7;
|
909
|
+
st7:
|
910
|
+
if ( ++p == pe )
|
911
|
+
goto _test_eof7;
|
912
|
+
case 7:
|
913
|
+
#line 914 "edn_parser.cc"
|
914
|
+
if ( (*p) == 10 )
|
915
|
+
goto tr4;
|
916
|
+
goto st2;
|
917
|
+
st2:
|
918
|
+
if ( ++p == pe )
|
919
|
+
goto _test_eof2;
|
920
|
+
case 2:
|
921
|
+
if ( (*p) == 10 )
|
922
|
+
goto tr4;
|
923
|
+
goto st2;
|
924
|
+
st8:
|
925
|
+
if ( ++p == pe )
|
926
|
+
goto _test_eof8;
|
927
|
+
case 8:
|
928
|
+
switch( (*p) ) {
|
929
|
+
case 10: goto tr8;
|
930
|
+
case 32: goto tr7;
|
931
|
+
case 33: goto st0;
|
932
|
+
case 35: goto st8;
|
933
|
+
case 44: goto tr7;
|
934
|
+
case 47: goto st3;
|
935
|
+
case 59: goto tr9;
|
936
|
+
case 95: goto st8;
|
937
|
+
}
|
938
|
+
if ( (*p) < 45 ) {
|
939
|
+
if ( (*p) < 36 ) {
|
940
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
941
|
+
goto tr7;
|
942
|
+
} else if ( (*p) > 38 ) {
|
943
|
+
if ( 42 <= (*p) && (*p) <= 43 )
|
944
|
+
goto st0;
|
945
|
+
} else
|
946
|
+
goto st0;
|
947
|
+
} else if ( (*p) > 58 ) {
|
948
|
+
if ( (*p) < 65 ) {
|
949
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
950
|
+
goto st0;
|
951
|
+
} else if ( (*p) > 90 ) {
|
952
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
953
|
+
goto st8;
|
954
|
+
} else
|
955
|
+
goto st8;
|
956
|
+
} else
|
957
|
+
goto st8;
|
958
|
+
goto tr6;
|
959
|
+
st3:
|
960
|
+
if ( ++p == pe )
|
961
|
+
goto _test_eof3;
|
962
|
+
case 3:
|
963
|
+
if ( (*p) > 90 ) {
|
964
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
965
|
+
goto st9;
|
966
|
+
} else if ( (*p) >= 65 )
|
967
|
+
goto st9;
|
968
|
+
goto st0;
|
969
|
+
st9:
|
970
|
+
if ( ++p == pe )
|
971
|
+
goto _test_eof9;
|
972
|
+
case 9:
|
973
|
+
switch( (*p) ) {
|
974
|
+
case 10: goto tr8;
|
975
|
+
case 32: goto tr7;
|
976
|
+
case 33: goto st0;
|
977
|
+
case 35: goto st9;
|
978
|
+
case 44: goto tr7;
|
979
|
+
case 47: goto st0;
|
980
|
+
case 59: goto tr9;
|
981
|
+
case 95: goto st9;
|
982
|
+
}
|
983
|
+
if ( (*p) < 45 ) {
|
984
|
+
if ( (*p) < 36 ) {
|
985
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
986
|
+
goto tr7;
|
987
|
+
} else if ( (*p) > 38 ) {
|
988
|
+
if ( 42 <= (*p) && (*p) <= 43 )
|
989
|
+
goto st0;
|
990
|
+
} else
|
991
|
+
goto st0;
|
992
|
+
} else if ( (*p) > 58 ) {
|
993
|
+
if ( (*p) < 65 ) {
|
994
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
995
|
+
goto st0;
|
996
|
+
} else if ( (*p) > 90 ) {
|
358
997
|
if ( 97 <= (*p) && (*p) <= 122 )
|
359
|
-
goto
|
360
|
-
} else
|
361
|
-
goto
|
998
|
+
goto st9;
|
999
|
+
} else
|
1000
|
+
goto st9;
|
362
1001
|
} else
|
363
|
-
goto
|
364
|
-
goto
|
365
|
-
tr7:
|
366
|
-
#line 197 "edn_parser.rl"
|
367
|
-
{ p--; {p++; cs = 6; goto _out;} }
|
368
|
-
goto st6;
|
369
|
-
st6:
|
370
|
-
if ( ++p == pe )
|
371
|
-
goto _test_eof6;
|
372
|
-
case 6:
|
373
|
-
#line 374 "edn_parser.cc"
|
374
|
-
if ( (*p) == 10 )
|
375
|
-
goto tr3;
|
376
|
-
goto st2;
|
377
|
-
st2:
|
378
|
-
if ( ++p == pe )
|
379
|
-
goto _test_eof2;
|
380
|
-
case 2:
|
381
|
-
if ( (*p) == 10 )
|
382
|
-
goto tr3;
|
383
|
-
goto st2;
|
1002
|
+
goto st9;
|
1003
|
+
goto tr6;
|
384
1004
|
}
|
385
|
-
_test_eof3: cs = 3; goto _test_eof;
|
386
1005
|
_test_eof4: cs = 4; goto _test_eof;
|
387
1006
|
_test_eof5: cs = 5; goto _test_eof;
|
388
1007
|
_test_eof6: cs = 6; goto _test_eof;
|
1008
|
+
_test_eof7: cs = 7; goto _test_eof;
|
389
1009
|
_test_eof2: cs = 2; goto _test_eof;
|
1010
|
+
_test_eof8: cs = 8; goto _test_eof;
|
1011
|
+
_test_eof3: cs = 3; goto _test_eof;
|
1012
|
+
_test_eof9: cs = 9; goto _test_eof;
|
390
1013
|
|
391
1014
|
_test_eof: {}
|
392
1015
|
_out: {}
|
393
1016
|
}
|
394
1017
|
|
395
|
-
#line
|
1018
|
+
#line 334 "edn_parser.rl"
|
396
1019
|
|
397
1020
|
if (cs >= EDN_symbol_first_final) {
|
398
1021
|
uint32_t len = p - p_save;
|
@@ -417,7 +1040,7 @@ case 2:
|
|
417
1040
|
// keyword parsing
|
418
1041
|
//
|
419
1042
|
|
420
|
-
#line
|
1043
|
+
#line 1044 "edn_parser.cc"
|
421
1044
|
static const int EDN_keyword_start = 1;
|
422
1045
|
static const int EDN_keyword_first_final = 3;
|
423
1046
|
static const int EDN_keyword_error = 0;
|
@@ -425,24 +1048,25 @@ static const int EDN_keyword_error = 0;
|
|
425
1048
|
static const int EDN_keyword_en_main = 1;
|
426
1049
|
|
427
1050
|
|
428
|
-
#line
|
1051
|
+
#line 371 "edn_parser.rl"
|
429
1052
|
|
430
1053
|
|
431
1054
|
|
432
1055
|
const char* edn::Parser::parse_keyword(const char *p, const char *pe, Rice::Object& o)
|
433
1056
|
{
|
434
1057
|
int cs;
|
1058
|
+
// std::cerr << __FUNCTION__ << " - p: '" << p << "'" << std::endl;
|
435
1059
|
|
436
1060
|
|
437
|
-
#line
|
1061
|
+
#line 1062 "edn_parser.cc"
|
438
1062
|
{
|
439
1063
|
cs = EDN_keyword_start;
|
440
1064
|
}
|
441
1065
|
|
442
|
-
#line
|
1066
|
+
#line 380 "edn_parser.rl"
|
443
1067
|
p_save = p;
|
444
1068
|
|
445
|
-
#line
|
1069
|
+
#line 1070 "edn_parser.cc"
|
446
1070
|
{
|
447
1071
|
if ( p == pe )
|
448
1072
|
goto _test_eof;
|
@@ -459,24 +1083,13 @@ st2:
|
|
459
1083
|
if ( ++p == pe )
|
460
1084
|
goto _test_eof2;
|
461
1085
|
case 2:
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
if ( (*p) < 45 ) {
|
467
|
-
if ( (*p) > 38 ) {
|
468
|
-
if ( 42 <= (*p) && (*p) <= 43 )
|
469
|
-
goto st3;
|
470
|
-
} else if ( (*p) >= 35 )
|
1086
|
+
if ( (*p) == 35 )
|
1087
|
+
goto st3;
|
1088
|
+
if ( (*p) < 65 ) {
|
1089
|
+
if ( 46 <= (*p) && (*p) <= 47 )
|
471
1090
|
goto st3;
|
472
|
-
} else if ( (*p) >
|
473
|
-
if ( (*p)
|
474
|
-
if ( 60 <= (*p) && (*p) <= 63 )
|
475
|
-
goto st3;
|
476
|
-
} else if ( (*p) > 90 ) {
|
477
|
-
if ( 97 <= (*p) && (*p) <= 122 )
|
478
|
-
goto st3;
|
479
|
-
} else
|
1091
|
+
} else if ( (*p) > 90 ) {
|
1092
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
480
1093
|
goto st3;
|
481
1094
|
} else
|
482
1095
|
goto st3;
|
@@ -508,14 +1121,14 @@ case 3:
|
|
508
1121
|
goto st3;
|
509
1122
|
goto tr3;
|
510
1123
|
tr3:
|
511
|
-
#line
|
1124
|
+
#line 368 "edn_parser.rl"
|
512
1125
|
{ p--; {p++; cs = 4; goto _out;} }
|
513
1126
|
goto st4;
|
514
1127
|
st4:
|
515
1128
|
if ( ++p == pe )
|
516
1129
|
goto _test_eof4;
|
517
1130
|
case 4:
|
518
|
-
#line
|
1131
|
+
#line 1132 "edn_parser.cc"
|
519
1132
|
goto st0;
|
520
1133
|
}
|
521
1134
|
_test_eof2: cs = 2; goto _test_eof;
|
@@ -526,7 +1139,7 @@ case 4:
|
|
526
1139
|
_out: {}
|
527
1140
|
}
|
528
1141
|
|
529
|
-
#line
|
1142
|
+
#line 382 "edn_parser.rl"
|
530
1143
|
|
531
1144
|
if (cs >= EDN_keyword_first_final) {
|
532
1145
|
uint32_t len = p - p_save - 1; // don't include leading ':' because Rice::Symbol will handle it
|
@@ -549,7 +1162,7 @@ case 4:
|
|
549
1162
|
// string parsing
|
550
1163
|
//
|
551
1164
|
|
552
|
-
#line
|
1165
|
+
#line 1166 "edn_parser.cc"
|
553
1166
|
static const int EDN_string_start = 1;
|
554
1167
|
static const int EDN_string_first_final = 8;
|
555
1168
|
static const int EDN_string_error = 0;
|
@@ -557,7 +1170,7 @@ static const int EDN_string_error = 0;
|
|
557
1170
|
static const int EDN_string_en_main = 1;
|
558
1171
|
|
559
1172
|
|
560
|
-
#line
|
1173
|
+
#line 426 "edn_parser.rl"
|
561
1174
|
|
562
1175
|
|
563
1176
|
|
@@ -570,15 +1183,15 @@ const char* edn::Parser::parse_string(const char *p, const char *pe, Rice::Objec
|
|
570
1183
|
|
571
1184
|
Rice::String s;
|
572
1185
|
|
573
|
-
#line
|
1186
|
+
#line 1187 "edn_parser.cc"
|
574
1187
|
{
|
575
1188
|
cs = EDN_string_start;
|
576
1189
|
}
|
577
1190
|
|
578
|
-
#line
|
1191
|
+
#line 438 "edn_parser.rl"
|
579
1192
|
p_save = p;
|
580
1193
|
|
581
|
-
#line
|
1194
|
+
#line 1195 "edn_parser.cc"
|
582
1195
|
{
|
583
1196
|
if ( p == pe )
|
584
1197
|
goto _test_eof;
|
@@ -589,15 +1202,15 @@ case 1:
|
|
589
1202
|
goto st2;
|
590
1203
|
goto st0;
|
591
1204
|
tr2:
|
592
|
-
#line
|
1205
|
+
#line 55 "edn_parser.rl"
|
593
1206
|
{
|
594
1207
|
std::stringstream s;
|
595
1208
|
s << "unterminated " << EDN_TYPE;
|
596
1209
|
error(__FUNCTION__, s.str());
|
597
|
-
|
1210
|
+
p--; {p++; cs = 0; goto _out;}
|
598
1211
|
}
|
599
1212
|
goto st0;
|
600
|
-
#line
|
1213
|
+
#line 1214 "edn_parser.cc"
|
601
1214
|
st0:
|
602
1215
|
cs = 0;
|
603
1216
|
goto _out;
|
@@ -613,23 +1226,23 @@ case 2:
|
|
613
1226
|
goto tr2;
|
614
1227
|
goto st2;
|
615
1228
|
tr3:
|
616
|
-
#line
|
1229
|
+
#line 409 "edn_parser.rl"
|
617
1230
|
{
|
618
|
-
if (!parse_byte_stream(p_save + 1, p, s)) {
|
1231
|
+
if (!Parser::parse_byte_stream(p_save + 1, p, s)) {
|
619
1232
|
p--;
|
620
1233
|
{p++; cs = 8; goto _out;}
|
621
1234
|
} else {
|
622
1235
|
{p = (( p + 1))-1;}
|
623
1236
|
}
|
624
1237
|
}
|
625
|
-
#line
|
1238
|
+
#line 418 "edn_parser.rl"
|
626
1239
|
{ p--; {p++; cs = 8; goto _out;} }
|
627
1240
|
goto st8;
|
628
1241
|
st8:
|
629
1242
|
if ( ++p == pe )
|
630
1243
|
goto _test_eof8;
|
631
1244
|
case 8:
|
632
|
-
#line
|
1245
|
+
#line 1246 "edn_parser.cc"
|
633
1246
|
goto st0;
|
634
1247
|
st3:
|
635
1248
|
if ( ++p == pe )
|
@@ -706,22 +1319,22 @@ case 7:
|
|
706
1319
|
{
|
707
1320
|
switch ( cs ) {
|
708
1321
|
case 2:
|
709
|
-
#line
|
1322
|
+
#line 55 "edn_parser.rl"
|
710
1323
|
{
|
711
1324
|
std::stringstream s;
|
712
1325
|
s << "unterminated " << EDN_TYPE;
|
713
1326
|
error(__FUNCTION__, s.str());
|
714
|
-
|
1327
|
+
p--; {p++; cs = 0; goto _out;}
|
715
1328
|
}
|
716
1329
|
break;
|
717
|
-
#line
|
1330
|
+
#line 1331 "edn_parser.cc"
|
718
1331
|
}
|
719
1332
|
}
|
720
1333
|
|
721
1334
|
_out: {}
|
722
1335
|
}
|
723
1336
|
|
724
|
-
#line
|
1337
|
+
#line 440 "edn_parser.rl"
|
725
1338
|
|
726
1339
|
if (cs >= EDN_string_first_final) {
|
727
1340
|
o = s;
|
@@ -738,14 +1351,14 @@ case 7:
|
|
738
1351
|
// decimal parsing grammar
|
739
1352
|
//
|
740
1353
|
|
741
|
-
#line
|
1354
|
+
#line 1355 "edn_parser.cc"
|
742
1355
|
static const int EDN_decimal_start = 1;
|
743
1356
|
static const int EDN_decimal_first_final = 9;
|
744
1357
|
|
745
1358
|
static const int EDN_decimal_en_main = 1;
|
746
1359
|
|
747
1360
|
|
748
|
-
#line
|
1361
|
+
#line 467 "edn_parser.rl"
|
749
1362
|
|
750
1363
|
|
751
1364
|
|
@@ -754,15 +1367,15 @@ const char* edn::Parser::parse_decimal(const char *p, const char *pe, Rice::Obje
|
|
754
1367
|
int cs;
|
755
1368
|
|
756
1369
|
|
757
|
-
#line
|
1370
|
+
#line 1371 "edn_parser.cc"
|
758
1371
|
{
|
759
1372
|
cs = EDN_decimal_start;
|
760
1373
|
}
|
761
1374
|
|
762
|
-
#line
|
1375
|
+
#line 475 "edn_parser.rl"
|
763
1376
|
p_save = p;
|
764
1377
|
|
765
|
-
#line
|
1378
|
+
#line 1379 "edn_parser.cc"
|
766
1379
|
{
|
767
1380
|
if ( p == pe )
|
768
1381
|
goto _test_eof;
|
@@ -770,6 +1383,7 @@ const char* edn::Parser::parse_decimal(const char *p, const char *pe, Rice::Obje
|
|
770
1383
|
{
|
771
1384
|
case 1:
|
772
1385
|
switch( (*p) ) {
|
1386
|
+
case 43: goto st2;
|
773
1387
|
case 45: goto st2;
|
774
1388
|
case 48: goto st3;
|
775
1389
|
}
|
@@ -815,14 +1429,14 @@ case 9:
|
|
815
1429
|
goto st0;
|
816
1430
|
goto tr10;
|
817
1431
|
tr10:
|
818
|
-
#line
|
1432
|
+
#line 461 "edn_parser.rl"
|
819
1433
|
{ p--; {p++; cs = 10; goto _out;} }
|
820
1434
|
goto st10;
|
821
1435
|
st10:
|
822
1436
|
if ( ++p == pe )
|
823
1437
|
goto _test_eof10;
|
824
1438
|
case 10:
|
825
|
-
#line
|
1439
|
+
#line 1440 "edn_parser.cc"
|
826
1440
|
goto st0;
|
827
1441
|
st4:
|
828
1442
|
if ( ++p == pe )
|
@@ -938,11 +1552,10 @@ case 8:
|
|
938
1552
|
_out: {}
|
939
1553
|
}
|
940
1554
|
|
941
|
-
#line
|
1555
|
+
#line 477 "edn_parser.rl"
|
942
1556
|
|
943
1557
|
if (cs >= EDN_decimal_first_final) {
|
944
|
-
|
945
|
-
o = Parser::buftotype<double>(p_save, p - p_save, value);
|
1558
|
+
o = Parser::float_to_ruby(p_save, p - p_save);
|
946
1559
|
return p + 1;
|
947
1560
|
}
|
948
1561
|
else if (cs == EDN_decimal_en_main) {} // silence ragel warning
|
@@ -954,14 +1567,14 @@ case 8:
|
|
954
1567
|
// integer parsing grammar
|
955
1568
|
//
|
956
1569
|
|
957
|
-
#line
|
1570
|
+
#line 1571 "edn_parser.cc"
|
958
1571
|
static const int EDN_integer_start = 1;
|
959
1572
|
static const int EDN_integer_first_final = 3;
|
960
1573
|
|
961
1574
|
static const int EDN_integer_en_main = 1;
|
962
1575
|
|
963
1576
|
|
964
|
-
#line
|
1577
|
+
#line 501 "edn_parser.rl"
|
965
1578
|
|
966
1579
|
|
967
1580
|
const char* edn::Parser::parse_integer(const char *p, const char *pe, Rice::Object& o)
|
@@ -969,15 +1582,15 @@ const char* edn::Parser::parse_integer(const char *p, const char *pe, Rice::Obje
|
|
969
1582
|
int cs;
|
970
1583
|
|
971
1584
|
|
972
|
-
#line
|
1585
|
+
#line 1586 "edn_parser.cc"
|
973
1586
|
{
|
974
1587
|
cs = EDN_integer_start;
|
975
1588
|
}
|
976
1589
|
|
977
|
-
#line
|
1590
|
+
#line 508 "edn_parser.rl"
|
978
1591
|
p_save = p;
|
979
1592
|
|
980
|
-
#line
|
1593
|
+
#line 1594 "edn_parser.cc"
|
981
1594
|
{
|
982
1595
|
if ( p == pe )
|
983
1596
|
goto _test_eof;
|
@@ -985,6 +1598,7 @@ const char* edn::Parser::parse_integer(const char *p, const char *pe, Rice::Obje
|
|
985
1598
|
{
|
986
1599
|
case 1:
|
987
1600
|
switch( (*p) ) {
|
1601
|
+
case 43: goto st2;
|
988
1602
|
case 45: goto st2;
|
989
1603
|
case 48: goto st3;
|
990
1604
|
}
|
@@ -1007,8 +1621,10 @@ st3:
|
|
1007
1621
|
if ( ++p == pe )
|
1008
1622
|
goto _test_eof3;
|
1009
1623
|
case 3:
|
1010
|
-
|
1011
|
-
goto
|
1624
|
+
switch( (*p) ) {
|
1625
|
+
case 43: goto st0;
|
1626
|
+
case 45: goto st0;
|
1627
|
+
}
|
1012
1628
|
if ( (*p) > 57 ) {
|
1013
1629
|
if ( 77 <= (*p) && (*p) <= 78 )
|
1014
1630
|
goto st5;
|
@@ -1016,24 +1632,23 @@ case 3:
|
|
1016
1632
|
goto st0;
|
1017
1633
|
goto tr4;
|
1018
1634
|
tr4:
|
1019
|
-
#line
|
1635
|
+
#line 496 "edn_parser.rl"
|
1020
1636
|
{ p--; {p++; cs = 4; goto _out;} }
|
1021
1637
|
goto st4;
|
1022
1638
|
st4:
|
1023
1639
|
if ( ++p == pe )
|
1024
1640
|
goto _test_eof4;
|
1025
1641
|
case 4:
|
1026
|
-
#line
|
1642
|
+
#line 1643 "edn_parser.cc"
|
1027
1643
|
goto st0;
|
1028
|
-
tr6:
|
1029
|
-
#line 377 "edn_parser.rl"
|
1030
|
-
{ p--; {p++; cs = 5; goto _out;} }
|
1031
|
-
goto st5;
|
1032
1644
|
st5:
|
1033
1645
|
if ( ++p == pe )
|
1034
1646
|
goto _test_eof5;
|
1035
1647
|
case 5:
|
1036
|
-
|
1648
|
+
switch( (*p) ) {
|
1649
|
+
case 43: goto st0;
|
1650
|
+
case 45: goto st0;
|
1651
|
+
}
|
1037
1652
|
if ( (*p) > 57 ) {
|
1038
1653
|
if ( 77 <= (*p) && (*p) <= 78 )
|
1039
1654
|
goto st0;
|
@@ -1044,8 +1659,10 @@ st6:
|
|
1044
1659
|
if ( ++p == pe )
|
1045
1660
|
goto _test_eof6;
|
1046
1661
|
case 6:
|
1047
|
-
|
1048
|
-
goto
|
1662
|
+
switch( (*p) ) {
|
1663
|
+
case 43: goto st0;
|
1664
|
+
case 45: goto st0;
|
1665
|
+
}
|
1049
1666
|
if ( (*p) > 57 ) {
|
1050
1667
|
if ( 77 <= (*p) && (*p) <= 78 )
|
1051
1668
|
goto st5;
|
@@ -1063,11 +1680,10 @@ case 6:
|
|
1063
1680
|
_out: {}
|
1064
1681
|
}
|
1065
1682
|
|
1066
|
-
#line
|
1683
|
+
#line 510 "edn_parser.rl"
|
1067
1684
|
|
1068
1685
|
if (cs >= EDN_integer_first_final) {
|
1069
|
-
|
1070
|
-
o = Parser::buftotype<int>(p_save, p - p_save, value);
|
1686
|
+
o = Parser::integer_to_ruby(p_save, p - p_save);
|
1071
1687
|
return p + 1;
|
1072
1688
|
}
|
1073
1689
|
else if (cs == EDN_integer_en_main) {} // silence ragel warning
|
@@ -1082,13 +1698,13 @@ case 6:
|
|
1082
1698
|
// sets the same array is used)
|
1083
1699
|
//
|
1084
1700
|
|
1085
|
-
#line
|
1701
|
+
#line 554 "edn_parser.rl"
|
1086
1702
|
|
1087
1703
|
|
1088
1704
|
//
|
1089
1705
|
// vector-specific machine
|
1090
1706
|
|
1091
|
-
#line
|
1707
|
+
#line 1708 "edn_parser.cc"
|
1092
1708
|
static const int EDN_vector_start = 1;
|
1093
1709
|
static const int EDN_vector_first_final = 4;
|
1094
1710
|
static const int EDN_vector_error = 0;
|
@@ -1096,7 +1712,7 @@ static const int EDN_vector_error = 0;
|
|
1096
1712
|
static const int EDN_vector_en_main = 1;
|
1097
1713
|
|
1098
1714
|
|
1099
|
-
#line
|
1715
|
+
#line 570 "edn_parser.rl"
|
1100
1716
|
|
1101
1717
|
|
1102
1718
|
|
@@ -1112,14 +1728,14 @@ const char* edn::Parser::parse_vector(const char *p, const char *pe, Rice::Objec
|
|
1112
1728
|
Rice::Array arr;
|
1113
1729
|
|
1114
1730
|
|
1115
|
-
#line
|
1731
|
+
#line 1732 "edn_parser.cc"
|
1116
1732
|
{
|
1117
1733
|
cs = EDN_vector_start;
|
1118
1734
|
}
|
1119
1735
|
|
1120
|
-
#line
|
1736
|
+
#line 585 "edn_parser.rl"
|
1121
1737
|
|
1122
|
-
#line
|
1738
|
+
#line 1739 "edn_parser.cc"
|
1123
1739
|
{
|
1124
1740
|
if ( p == pe )
|
1125
1741
|
goto _test_eof;
|
@@ -1130,15 +1746,15 @@ case 1:
|
|
1130
1746
|
goto st2;
|
1131
1747
|
goto st0;
|
1132
1748
|
tr2:
|
1133
|
-
#line
|
1749
|
+
#line 55 "edn_parser.rl"
|
1134
1750
|
{
|
1135
1751
|
std::stringstream s;
|
1136
1752
|
s << "unterminated " << EDN_TYPE;
|
1137
1753
|
error(__FUNCTION__, s.str());
|
1138
|
-
|
1754
|
+
p--; {p++; cs = 0; goto _out;}
|
1139
1755
|
}
|
1140
1756
|
goto st0;
|
1141
|
-
#line
|
1757
|
+
#line 1758 "edn_parser.cc"
|
1142
1758
|
st0:
|
1143
1759
|
cs = 0;
|
1144
1760
|
goto _out;
|
@@ -1147,7 +1763,7 @@ tr3:
|
|
1147
1763
|
{ line_number++; }
|
1148
1764
|
goto st2;
|
1149
1765
|
tr4:
|
1150
|
-
#line
|
1766
|
+
#line 530 "edn_parser.rl"
|
1151
1767
|
{
|
1152
1768
|
Rice::Object v;
|
1153
1769
|
const char *np = parse_value(p, pe, v);
|
@@ -1171,7 +1787,7 @@ st2:
|
|
1171
1787
|
if ( ++p == pe )
|
1172
1788
|
goto _test_eof2;
|
1173
1789
|
case 2:
|
1174
|
-
#line
|
1790
|
+
#line 1791 "edn_parser.cc"
|
1175
1791
|
switch( (*p) ) {
|
1176
1792
|
case 10: goto tr3;
|
1177
1793
|
case 32: goto st2;
|
@@ -1204,14 +1820,14 @@ case 3:
|
|
1204
1820
|
goto tr3;
|
1205
1821
|
goto st3;
|
1206
1822
|
tr6:
|
1207
|
-
#line
|
1823
|
+
#line 553 "edn_parser.rl"
|
1208
1824
|
{ p--; {p++; cs = 4; goto _out;} }
|
1209
1825
|
goto st4;
|
1210
1826
|
st4:
|
1211
1827
|
if ( ++p == pe )
|
1212
1828
|
goto _test_eof4;
|
1213
1829
|
case 4:
|
1214
|
-
#line
|
1830
|
+
#line 1831 "edn_parser.cc"
|
1215
1831
|
goto st0;
|
1216
1832
|
}
|
1217
1833
|
_test_eof2: cs = 2; goto _test_eof;
|
@@ -1223,22 +1839,23 @@ case 4:
|
|
1223
1839
|
{
|
1224
1840
|
switch ( cs ) {
|
1225
1841
|
case 2:
|
1226
|
-
|
1842
|
+
case 3:
|
1843
|
+
#line 55 "edn_parser.rl"
|
1227
1844
|
{
|
1228
1845
|
std::stringstream s;
|
1229
1846
|
s << "unterminated " << EDN_TYPE;
|
1230
1847
|
error(__FUNCTION__, s.str());
|
1231
|
-
|
1848
|
+
p--; {p++; cs = 0; goto _out;}
|
1232
1849
|
}
|
1233
1850
|
break;
|
1234
|
-
#line
|
1851
|
+
#line 1852 "edn_parser.cc"
|
1235
1852
|
}
|
1236
1853
|
}
|
1237
1854
|
|
1238
1855
|
_out: {}
|
1239
1856
|
}
|
1240
1857
|
|
1241
|
-
#line
|
1858
|
+
#line 586 "edn_parser.rl"
|
1242
1859
|
|
1243
1860
|
if (cs >= EDN_vector_first_final) {
|
1244
1861
|
o = arr;
|
@@ -1258,7 +1875,7 @@ case 4:
|
|
1258
1875
|
// list parsing machine
|
1259
1876
|
//
|
1260
1877
|
|
1261
|
-
#line
|
1878
|
+
#line 1879 "edn_parser.cc"
|
1262
1879
|
static const int EDN_list_start = 1;
|
1263
1880
|
static const int EDN_list_first_final = 4;
|
1264
1881
|
static const int EDN_list_error = 0;
|
@@ -1266,7 +1883,7 @@ static const int EDN_list_error = 0;
|
|
1266
1883
|
static const int EDN_list_en_main = 1;
|
1267
1884
|
|
1268
1885
|
|
1269
|
-
#line
|
1886
|
+
#line 615 "edn_parser.rl"
|
1270
1887
|
|
1271
1888
|
|
1272
1889
|
//
|
@@ -1280,14 +1897,14 @@ const char* edn::Parser::parse_list(const char *p, const char *pe, Rice::Object&
|
|
1280
1897
|
Rice::Array arr;
|
1281
1898
|
|
1282
1899
|
|
1283
|
-
#line
|
1900
|
+
#line 1901 "edn_parser.cc"
|
1284
1901
|
{
|
1285
1902
|
cs = EDN_list_start;
|
1286
1903
|
}
|
1287
1904
|
|
1288
|
-
#line
|
1905
|
+
#line 628 "edn_parser.rl"
|
1289
1906
|
|
1290
|
-
#line
|
1907
|
+
#line 1908 "edn_parser.cc"
|
1291
1908
|
{
|
1292
1909
|
if ( p == pe )
|
1293
1910
|
goto _test_eof;
|
@@ -1298,15 +1915,15 @@ case 1:
|
|
1298
1915
|
goto st2;
|
1299
1916
|
goto st0;
|
1300
1917
|
tr2:
|
1301
|
-
#line
|
1918
|
+
#line 55 "edn_parser.rl"
|
1302
1919
|
{
|
1303
1920
|
std::stringstream s;
|
1304
1921
|
s << "unterminated " << EDN_TYPE;
|
1305
1922
|
error(__FUNCTION__, s.str());
|
1306
|
-
|
1923
|
+
p--; {p++; cs = 0; goto _out;}
|
1307
1924
|
}
|
1308
1925
|
goto st0;
|
1309
|
-
#line
|
1926
|
+
#line 1927 "edn_parser.cc"
|
1310
1927
|
st0:
|
1311
1928
|
cs = 0;
|
1312
1929
|
goto _out;
|
@@ -1315,7 +1932,7 @@ tr3:
|
|
1315
1932
|
{ line_number++; }
|
1316
1933
|
goto st2;
|
1317
1934
|
tr4:
|
1318
|
-
#line
|
1935
|
+
#line 530 "edn_parser.rl"
|
1319
1936
|
{
|
1320
1937
|
Rice::Object v;
|
1321
1938
|
const char *np = parse_value(p, pe, v);
|
@@ -1339,7 +1956,7 @@ st2:
|
|
1339
1956
|
if ( ++p == pe )
|
1340
1957
|
goto _test_eof2;
|
1341
1958
|
case 2:
|
1342
|
-
#line
|
1959
|
+
#line 1960 "edn_parser.cc"
|
1343
1960
|
switch( (*p) ) {
|
1344
1961
|
case 10: goto tr3;
|
1345
1962
|
case 32: goto st2;
|
@@ -1364,14 +1981,14 @@ case 2:
|
|
1364
1981
|
goto tr4;
|
1365
1982
|
goto tr2;
|
1366
1983
|
tr5:
|
1367
|
-
#line
|
1984
|
+
#line 553 "edn_parser.rl"
|
1368
1985
|
{ p--; {p++; cs = 4; goto _out;} }
|
1369
1986
|
goto st4;
|
1370
1987
|
st4:
|
1371
1988
|
if ( ++p == pe )
|
1372
1989
|
goto _test_eof4;
|
1373
1990
|
case 4:
|
1374
|
-
#line
|
1991
|
+
#line 1992 "edn_parser.cc"
|
1375
1992
|
goto st0;
|
1376
1993
|
st3:
|
1377
1994
|
if ( ++p == pe )
|
@@ -1390,22 +2007,23 @@ case 3:
|
|
1390
2007
|
{
|
1391
2008
|
switch ( cs ) {
|
1392
2009
|
case 2:
|
1393
|
-
|
2010
|
+
case 3:
|
2011
|
+
#line 55 "edn_parser.rl"
|
1394
2012
|
{
|
1395
2013
|
std::stringstream s;
|
1396
2014
|
s << "unterminated " << EDN_TYPE;
|
1397
2015
|
error(__FUNCTION__, s.str());
|
1398
|
-
|
2016
|
+
p--; {p++; cs = 0; goto _out;}
|
1399
2017
|
}
|
1400
2018
|
break;
|
1401
|
-
#line
|
2019
|
+
#line 2020 "edn_parser.cc"
|
1402
2020
|
}
|
1403
2021
|
}
|
1404
2022
|
|
1405
2023
|
_out: {}
|
1406
2024
|
}
|
1407
2025
|
|
1408
|
-
#line
|
2026
|
+
#line 629 "edn_parser.rl"
|
1409
2027
|
|
1410
2028
|
if (cs >= EDN_list_first_final) {
|
1411
2029
|
o = arr;
|
@@ -1425,7 +2043,7 @@ case 3:
|
|
1425
2043
|
// set parsing machine
|
1426
2044
|
//
|
1427
2045
|
|
1428
|
-
#line
|
2046
|
+
#line 2047 "edn_parser.cc"
|
1429
2047
|
static const int EDN_set_start = 1;
|
1430
2048
|
static const int EDN_set_first_final = 4;
|
1431
2049
|
static const int EDN_set_error = 0;
|
@@ -1433,7 +2051,7 @@ static const int EDN_set_error = 0;
|
|
1433
2051
|
static const int EDN_set_en_main = 1;
|
1434
2052
|
|
1435
2053
|
|
1436
|
-
#line
|
2054
|
+
#line 659 "edn_parser.rl"
|
1437
2055
|
|
1438
2056
|
|
1439
2057
|
//
|
@@ -1448,14 +2066,14 @@ const char* edn::Parser::parse_set(const char *p, const char *pe, Rice::Object&
|
|
1448
2066
|
Rice::Array arr; // store as a vector; then convert to a set once done
|
1449
2067
|
|
1450
2068
|
|
1451
|
-
#line
|
2069
|
+
#line 2070 "edn_parser.cc"
|
1452
2070
|
{
|
1453
2071
|
cs = EDN_set_start;
|
1454
2072
|
}
|
1455
2073
|
|
1456
|
-
#line
|
2074
|
+
#line 673 "edn_parser.rl"
|
1457
2075
|
|
1458
|
-
#line
|
2076
|
+
#line 2077 "edn_parser.cc"
|
1459
2077
|
{
|
1460
2078
|
if ( p == pe )
|
1461
2079
|
goto _test_eof;
|
@@ -1466,15 +2084,15 @@ case 1:
|
|
1466
2084
|
goto st2;
|
1467
2085
|
goto st0;
|
1468
2086
|
tr2:
|
1469
|
-
#line
|
2087
|
+
#line 55 "edn_parser.rl"
|
1470
2088
|
{
|
1471
2089
|
std::stringstream s;
|
1472
2090
|
s << "unterminated " << EDN_TYPE;
|
1473
2091
|
error(__FUNCTION__, s.str());
|
1474
|
-
|
2092
|
+
p--; {p++; cs = 0; goto _out;}
|
1475
2093
|
}
|
1476
2094
|
goto st0;
|
1477
|
-
#line
|
2095
|
+
#line 2096 "edn_parser.cc"
|
1478
2096
|
st0:
|
1479
2097
|
cs = 0;
|
1480
2098
|
goto _out;
|
@@ -1483,7 +2101,7 @@ tr3:
|
|
1483
2101
|
{ line_number++; }
|
1484
2102
|
goto st2;
|
1485
2103
|
tr4:
|
1486
|
-
#line
|
2104
|
+
#line 530 "edn_parser.rl"
|
1487
2105
|
{
|
1488
2106
|
Rice::Object v;
|
1489
2107
|
const char *np = parse_value(p, pe, v);
|
@@ -1507,7 +2125,7 @@ st2:
|
|
1507
2125
|
if ( ++p == pe )
|
1508
2126
|
goto _test_eof2;
|
1509
2127
|
case 2:
|
1510
|
-
#line
|
2128
|
+
#line 2129 "edn_parser.cc"
|
1511
2129
|
switch( (*p) ) {
|
1512
2130
|
case 10: goto tr3;
|
1513
2131
|
case 32: goto st2;
|
@@ -1540,14 +2158,14 @@ case 3:
|
|
1540
2158
|
goto tr3;
|
1541
2159
|
goto st3;
|
1542
2160
|
tr6:
|
1543
|
-
#line
|
2161
|
+
#line 553 "edn_parser.rl"
|
1544
2162
|
{ p--; {p++; cs = 4; goto _out;} }
|
1545
2163
|
goto st4;
|
1546
2164
|
st4:
|
1547
2165
|
if ( ++p == pe )
|
1548
2166
|
goto _test_eof4;
|
1549
2167
|
case 4:
|
1550
|
-
#line
|
2168
|
+
#line 2169 "edn_parser.cc"
|
1551
2169
|
goto st0;
|
1552
2170
|
}
|
1553
2171
|
_test_eof2: cs = 2; goto _test_eof;
|
@@ -1559,25 +2177,26 @@ case 4:
|
|
1559
2177
|
{
|
1560
2178
|
switch ( cs ) {
|
1561
2179
|
case 2:
|
1562
|
-
|
2180
|
+
case 3:
|
2181
|
+
#line 55 "edn_parser.rl"
|
1563
2182
|
{
|
1564
2183
|
std::stringstream s;
|
1565
2184
|
s << "unterminated " << EDN_TYPE;
|
1566
2185
|
error(__FUNCTION__, s.str());
|
1567
|
-
|
2186
|
+
p--; {p++; cs = 0; goto _out;}
|
1568
2187
|
}
|
1569
2188
|
break;
|
1570
|
-
#line
|
2189
|
+
#line 2190 "edn_parser.cc"
|
1571
2190
|
}
|
1572
2191
|
}
|
1573
2192
|
|
1574
2193
|
_out: {}
|
1575
2194
|
}
|
1576
2195
|
|
1577
|
-
#line
|
2196
|
+
#line 674 "edn_parser.rl"
|
1578
2197
|
|
1579
2198
|
if (cs >= EDN_set_first_final) {
|
1580
|
-
o = make_ruby_set(arr);
|
2199
|
+
o = Parser::make_ruby_set(arr);
|
1581
2200
|
return p + 1;
|
1582
2201
|
}
|
1583
2202
|
else if (cs == EDN_set_error) {
|
@@ -1594,7 +2213,7 @@ case 4:
|
|
1594
2213
|
// hash parsing
|
1595
2214
|
//
|
1596
2215
|
|
1597
|
-
#line
|
2216
|
+
#line 2217 "edn_parser.cc"
|
1598
2217
|
static const int EDN_map_start = 1;
|
1599
2218
|
static const int EDN_map_first_final = 4;
|
1600
2219
|
static const int EDN_map_error = 0;
|
@@ -1602,7 +2221,7 @@ static const int EDN_map_error = 0;
|
|
1602
2221
|
static const int EDN_map_en_main = 1;
|
1603
2222
|
|
1604
2223
|
|
1605
|
-
#line
|
2224
|
+
#line 709 "edn_parser.rl"
|
1606
2225
|
|
1607
2226
|
|
1608
2227
|
|
@@ -1614,14 +2233,14 @@ const char* edn::Parser::parse_map(const char *p, const char *pe, Rice::Object&
|
|
1614
2233
|
int cs;
|
1615
2234
|
|
1616
2235
|
|
1617
|
-
#line
|
2236
|
+
#line 2237 "edn_parser.cc"
|
1618
2237
|
{
|
1619
2238
|
cs = EDN_map_start;
|
1620
2239
|
}
|
1621
2240
|
|
1622
|
-
#line
|
2241
|
+
#line 720 "edn_parser.rl"
|
1623
2242
|
|
1624
|
-
#line
|
2243
|
+
#line 2244 "edn_parser.cc"
|
1625
2244
|
{
|
1626
2245
|
if ( p == pe )
|
1627
2246
|
goto _test_eof;
|
@@ -1632,15 +2251,15 @@ case 1:
|
|
1632
2251
|
goto st2;
|
1633
2252
|
goto st0;
|
1634
2253
|
tr2:
|
1635
|
-
#line
|
2254
|
+
#line 55 "edn_parser.rl"
|
1636
2255
|
{
|
1637
2256
|
std::stringstream s;
|
1638
2257
|
s << "unterminated " << EDN_TYPE;
|
1639
2258
|
error(__FUNCTION__, s.str());
|
1640
|
-
|
2259
|
+
p--; {p++; cs = 0; goto _out;}
|
1641
2260
|
}
|
1642
2261
|
goto st0;
|
1643
|
-
#line
|
2262
|
+
#line 2263 "edn_parser.cc"
|
1644
2263
|
st0:
|
1645
2264
|
cs = 0;
|
1646
2265
|
goto _out;
|
@@ -1649,7 +2268,7 @@ tr3:
|
|
1649
2268
|
{ line_number++; }
|
1650
2269
|
goto st2;
|
1651
2270
|
tr4:
|
1652
|
-
#line
|
2271
|
+
#line 530 "edn_parser.rl"
|
1653
2272
|
{
|
1654
2273
|
Rice::Object v;
|
1655
2274
|
const char *np = parse_value(p, pe, v);
|
@@ -1673,7 +2292,7 @@ st2:
|
|
1673
2292
|
if ( ++p == pe )
|
1674
2293
|
goto _test_eof2;
|
1675
2294
|
case 2:
|
1676
|
-
#line
|
2295
|
+
#line 2296 "edn_parser.cc"
|
1677
2296
|
switch( (*p) ) {
|
1678
2297
|
case 10: goto tr3;
|
1679
2298
|
case 32: goto st2;
|
@@ -1706,14 +2325,14 @@ case 3:
|
|
1706
2325
|
goto tr3;
|
1707
2326
|
goto st3;
|
1708
2327
|
tr6:
|
1709
|
-
#line
|
2328
|
+
#line 553 "edn_parser.rl"
|
1710
2329
|
{ p--; {p++; cs = 4; goto _out;} }
|
1711
2330
|
goto st4;
|
1712
2331
|
st4:
|
1713
2332
|
if ( ++p == pe )
|
1714
2333
|
goto _test_eof4;
|
1715
2334
|
case 4:
|
1716
|
-
#line
|
2335
|
+
#line 2336 "edn_parser.cc"
|
1717
2336
|
goto st0;
|
1718
2337
|
}
|
1719
2338
|
_test_eof2: cs = 2; goto _test_eof;
|
@@ -1725,22 +2344,23 @@ case 4:
|
|
1725
2344
|
{
|
1726
2345
|
switch ( cs ) {
|
1727
2346
|
case 2:
|
1728
|
-
|
2347
|
+
case 3:
|
2348
|
+
#line 55 "edn_parser.rl"
|
1729
2349
|
{
|
1730
2350
|
std::stringstream s;
|
1731
2351
|
s << "unterminated " << EDN_TYPE;
|
1732
2352
|
error(__FUNCTION__, s.str());
|
1733
|
-
|
2353
|
+
p--; {p++; cs = 0; goto _out;}
|
1734
2354
|
}
|
1735
2355
|
break;
|
1736
|
-
#line
|
2356
|
+
#line 2357 "edn_parser.cc"
|
1737
2357
|
}
|
1738
2358
|
}
|
1739
2359
|
|
1740
2360
|
_out: {}
|
1741
2361
|
}
|
1742
2362
|
|
1743
|
-
#line
|
2363
|
+
#line 721 "edn_parser.rl"
|
1744
2364
|
|
1745
2365
|
if (cs >= EDN_map_first_final) {
|
1746
2366
|
|
@@ -1771,68 +2391,52 @@ case 4:
|
|
1771
2391
|
// tagged element parsing - #uuid, #inst, #{, #_
|
1772
2392
|
//
|
1773
2393
|
|
1774
|
-
#line
|
2394
|
+
#line 2395 "edn_parser.cc"
|
1775
2395
|
static const int EDN_tagged_start = 1;
|
1776
|
-
static const int EDN_tagged_first_final =
|
2396
|
+
static const int EDN_tagged_first_final = 6;
|
1777
2397
|
static const int EDN_tagged_error = 0;
|
1778
2398
|
|
1779
2399
|
static const int EDN_tagged_en_main = 1;
|
1780
2400
|
|
1781
2401
|
|
1782
|
-
#line
|
2402
|
+
#line 771 "edn_parser.rl"
|
1783
2403
|
|
1784
2404
|
|
1785
2405
|
|
1786
2406
|
const char* edn::Parser::parse_tagged(const char *p, const char *pe, Rice::Object& o)
|
1787
2407
|
{
|
1788
|
-
//
|
2408
|
+
// std::cerr << __FUNCTION__ << " p '" << p << "'" << std::endl;
|
1789
2409
|
std::string sym_name;
|
1790
2410
|
Rice::Object object;
|
1791
2411
|
|
1792
2412
|
int cs;
|
1793
2413
|
|
1794
2414
|
|
1795
|
-
#line
|
2415
|
+
#line 2416 "edn_parser.cc"
|
1796
2416
|
{
|
1797
2417
|
cs = EDN_tagged_start;
|
1798
2418
|
}
|
1799
2419
|
|
1800
|
-
#line
|
2420
|
+
#line 783 "edn_parser.rl"
|
1801
2421
|
|
1802
|
-
#line
|
2422
|
+
#line 2423 "edn_parser.cc"
|
1803
2423
|
{
|
1804
2424
|
if ( p == pe )
|
1805
2425
|
goto _test_eof;
|
1806
2426
|
switch ( cs )
|
1807
2427
|
{
|
1808
2428
|
case 1:
|
1809
|
-
|
1810
|
-
|
1811
|
-
case 95: goto tr0;
|
1812
|
-
}
|
1813
|
-
if ( (*p) < 45 ) {
|
1814
|
-
if ( (*p) > 38 ) {
|
1815
|
-
if ( 42 <= (*p) && (*p) <= 43 )
|
1816
|
-
goto tr0;
|
1817
|
-
} else if ( (*p) >= 36 )
|
1818
|
-
goto tr0;
|
1819
|
-
} else if ( (*p) > 47 ) {
|
1820
|
-
if ( (*p) < 65 ) {
|
1821
|
-
if ( 60 <= (*p) && (*p) <= 63 )
|
1822
|
-
goto tr0;
|
1823
|
-
} else if ( (*p) > 90 ) {
|
1824
|
-
if ( 97 <= (*p) && (*p) <= 122 )
|
1825
|
-
goto tr0;
|
1826
|
-
} else
|
2429
|
+
if ( (*p) > 90 ) {
|
2430
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1827
2431
|
goto tr0;
|
1828
|
-
} else
|
2432
|
+
} else if ( (*p) >= 65 )
|
1829
2433
|
goto tr0;
|
1830
2434
|
goto st0;
|
1831
2435
|
st0:
|
1832
2436
|
cs = 0;
|
1833
2437
|
goto _out;
|
1834
2438
|
tr0:
|
1835
|
-
#line
|
2439
|
+
#line 759 "edn_parser.rl"
|
1836
2440
|
{
|
1837
2441
|
const char *np = parse_symbol(p, pe, sym_name);
|
1838
2442
|
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else { {p = (( np))-1;} }
|
@@ -1842,34 +2446,41 @@ st2:
|
|
1842
2446
|
if ( ++p == pe )
|
1843
2447
|
goto _test_eof2;
|
1844
2448
|
case 2:
|
1845
|
-
#line
|
2449
|
+
#line 2450 "edn_parser.cc"
|
1846
2450
|
switch( (*p) ) {
|
1847
2451
|
case 10: goto tr3;
|
1848
2452
|
case 32: goto st3;
|
1849
|
-
case
|
1850
|
-
case 40: goto
|
2453
|
+
case 35: goto tr5;
|
2454
|
+
case 40: goto tr4;
|
1851
2455
|
case 44: goto st3;
|
2456
|
+
case 47: goto tr6;
|
1852
2457
|
case 59: goto st4;
|
1853
|
-
case 95: goto
|
1854
|
-
case 123: goto
|
2458
|
+
case 95: goto tr5;
|
2459
|
+
case 123: goto tr4;
|
1855
2460
|
}
|
1856
|
-
if ( (*p) <
|
1857
|
-
if ( (*p)
|
1858
|
-
if (
|
2461
|
+
if ( (*p) < 45 ) {
|
2462
|
+
if ( (*p) < 33 ) {
|
2463
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
2464
|
+
goto st3;
|
2465
|
+
} else if ( (*p) > 38 ) {
|
2466
|
+
if ( 42 <= (*p) && (*p) <= 43 )
|
1859
2467
|
goto tr4;
|
1860
|
-
} else
|
1861
|
-
goto
|
1862
|
-
} else if ( (*p) >
|
1863
|
-
if ( (*p) <
|
1864
|
-
if (
|
2468
|
+
} else
|
2469
|
+
goto tr4;
|
2470
|
+
} else if ( (*p) > 58 ) {
|
2471
|
+
if ( (*p) < 65 ) {
|
2472
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
1865
2473
|
goto tr4;
|
1866
|
-
} else if ( (*p) >
|
1867
|
-
if (
|
2474
|
+
} else if ( (*p) > 90 ) {
|
2475
|
+
if ( (*p) > 92 ) {
|
2476
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
2477
|
+
goto tr5;
|
2478
|
+
} else if ( (*p) >= 91 )
|
1868
2479
|
goto tr4;
|
1869
2480
|
} else
|
1870
2481
|
goto tr5;
|
1871
2482
|
} else
|
1872
|
-
goto
|
2483
|
+
goto tr5;
|
1873
2484
|
goto st0;
|
1874
2485
|
tr3:
|
1875
2486
|
#line 23 "edn_parser.rl"
|
@@ -1879,44 +2490,44 @@ st3:
|
|
1879
2490
|
if ( ++p == pe )
|
1880
2491
|
goto _test_eof3;
|
1881
2492
|
case 3:
|
1882
|
-
#line
|
2493
|
+
#line 2494 "edn_parser.cc"
|
1883
2494
|
switch( (*p) ) {
|
1884
2495
|
case 10: goto tr3;
|
1885
2496
|
case 32: goto st3;
|
1886
|
-
case 40: goto
|
2497
|
+
case 40: goto tr4;
|
1887
2498
|
case 44: goto st3;
|
1888
2499
|
case 59: goto st4;
|
1889
|
-
case 95: goto
|
2500
|
+
case 95: goto tr4;
|
1890
2501
|
}
|
1891
2502
|
if ( (*p) < 42 ) {
|
1892
2503
|
if ( (*p) > 13 ) {
|
1893
2504
|
if ( 33 <= (*p) && (*p) <= 38 )
|
1894
|
-
goto
|
2505
|
+
goto tr4;
|
1895
2506
|
} else if ( (*p) >= 9 )
|
1896
2507
|
goto st3;
|
1897
2508
|
} else if ( (*p) > 63 ) {
|
1898
2509
|
if ( (*p) > 92 ) {
|
1899
2510
|
if ( 97 <= (*p) && (*p) <= 123 )
|
1900
|
-
goto
|
2511
|
+
goto tr4;
|
1901
2512
|
} else if ( (*p) >= 65 )
|
1902
|
-
goto
|
2513
|
+
goto tr4;
|
1903
2514
|
} else
|
1904
|
-
goto
|
2515
|
+
goto tr4;
|
1905
2516
|
goto st0;
|
1906
|
-
|
1907
|
-
#line
|
2517
|
+
tr4:
|
2518
|
+
#line 763 "edn_parser.rl"
|
1908
2519
|
{
|
1909
2520
|
const char *np = parse_value(p, pe, object);
|
1910
|
-
if (np == NULL) { p--; {p++; cs =
|
2521
|
+
if (np == NULL) { p--; {p++; cs = 6; goto _out;} } else { {p = (( np))-1;} }
|
1911
2522
|
}
|
1912
|
-
#line
|
1913
|
-
{ p--; {p++; cs =
|
1914
|
-
goto
|
1915
|
-
|
2523
|
+
#line 768 "edn_parser.rl"
|
2524
|
+
{ p--; {p++; cs = 6; goto _out;} }
|
2525
|
+
goto st6;
|
2526
|
+
st6:
|
1916
2527
|
if ( ++p == pe )
|
1917
|
-
goto
|
1918
|
-
case
|
1919
|
-
#line
|
2528
|
+
goto _test_eof6;
|
2529
|
+
case 6:
|
2530
|
+
#line 2531 "edn_parser.cc"
|
1920
2531
|
goto st0;
|
1921
2532
|
st4:
|
1922
2533
|
if ( ++p == pe )
|
@@ -1925,63 +2536,181 @@ case 4:
|
|
1925
2536
|
if ( (*p) == 10 )
|
1926
2537
|
goto tr3;
|
1927
2538
|
goto st4;
|
1928
|
-
|
1929
|
-
#line
|
2539
|
+
tr5:
|
2540
|
+
#line 763 "edn_parser.rl"
|
1930
2541
|
{
|
1931
2542
|
const char *np = parse_value(p, pe, object);
|
1932
|
-
if (np == NULL) { p--; {p++; cs =
|
2543
|
+
if (np == NULL) { p--; {p++; cs = 7; goto _out;} } else { {p = (( np))-1;} }
|
1933
2544
|
}
|
1934
|
-
#line
|
1935
|
-
{ p--; {p++; cs =
|
1936
|
-
goto
|
1937
|
-
|
2545
|
+
#line 768 "edn_parser.rl"
|
2546
|
+
{ p--; {p++; cs = 7; goto _out;} }
|
2547
|
+
goto st7;
|
2548
|
+
st7:
|
1938
2549
|
if ( ++p == pe )
|
1939
|
-
goto
|
1940
|
-
case
|
1941
|
-
#line
|
2550
|
+
goto _test_eof7;
|
2551
|
+
case 7:
|
2552
|
+
#line 2553 "edn_parser.cc"
|
1942
2553
|
switch( (*p) ) {
|
1943
2554
|
case 10: goto tr3;
|
1944
2555
|
case 32: goto st3;
|
1945
|
-
case
|
1946
|
-
case 40: goto
|
2556
|
+
case 35: goto tr5;
|
2557
|
+
case 40: goto tr4;
|
1947
2558
|
case 44: goto st3;
|
2559
|
+
case 47: goto tr6;
|
1948
2560
|
case 59: goto st4;
|
1949
|
-
case 95: goto
|
1950
|
-
case 123: goto
|
2561
|
+
case 95: goto tr5;
|
2562
|
+
case 123: goto tr4;
|
1951
2563
|
}
|
1952
|
-
if ( (*p) <
|
1953
|
-
if ( (*p)
|
1954
|
-
if (
|
2564
|
+
if ( (*p) < 45 ) {
|
2565
|
+
if ( (*p) < 33 ) {
|
2566
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
2567
|
+
goto st3;
|
2568
|
+
} else if ( (*p) > 38 ) {
|
2569
|
+
if ( 42 <= (*p) && (*p) <= 43 )
|
1955
2570
|
goto tr4;
|
1956
|
-
} else
|
1957
|
-
goto
|
1958
|
-
} else if ( (*p) >
|
1959
|
-
if ( (*p) <
|
1960
|
-
if (
|
2571
|
+
} else
|
2572
|
+
goto tr4;
|
2573
|
+
} else if ( (*p) > 58 ) {
|
2574
|
+
if ( (*p) < 65 ) {
|
2575
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
1961
2576
|
goto tr4;
|
1962
|
-
} else if ( (*p) >
|
1963
|
-
if (
|
2577
|
+
} else if ( (*p) > 90 ) {
|
2578
|
+
if ( (*p) > 92 ) {
|
2579
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
2580
|
+
goto tr5;
|
2581
|
+
} else if ( (*p) >= 91 )
|
1964
2582
|
goto tr4;
|
1965
2583
|
} else
|
1966
2584
|
goto tr5;
|
1967
2585
|
} else
|
1968
|
-
goto
|
2586
|
+
goto tr5;
|
2587
|
+
goto st0;
|
2588
|
+
tr6:
|
2589
|
+
#line 763 "edn_parser.rl"
|
2590
|
+
{
|
2591
|
+
const char *np = parse_value(p, pe, object);
|
2592
|
+
if (np == NULL) { p--; {p++; cs = 8; goto _out;} } else { {p = (( np))-1;} }
|
2593
|
+
}
|
2594
|
+
#line 768 "edn_parser.rl"
|
2595
|
+
{ p--; {p++; cs = 8; goto _out;} }
|
2596
|
+
goto st8;
|
2597
|
+
st8:
|
2598
|
+
if ( ++p == pe )
|
2599
|
+
goto _test_eof8;
|
2600
|
+
case 8:
|
2601
|
+
#line 2602 "edn_parser.cc"
|
2602
|
+
if ( (*p) > 90 ) {
|
2603
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
2604
|
+
goto st5;
|
2605
|
+
} else if ( (*p) >= 65 )
|
2606
|
+
goto st5;
|
2607
|
+
goto st0;
|
2608
|
+
st5:
|
2609
|
+
if ( ++p == pe )
|
2610
|
+
goto _test_eof5;
|
2611
|
+
case 5:
|
2612
|
+
switch( (*p) ) {
|
2613
|
+
case 10: goto tr3;
|
2614
|
+
case 32: goto st3;
|
2615
|
+
case 35: goto tr8;
|
2616
|
+
case 40: goto tr4;
|
2617
|
+
case 44: goto st3;
|
2618
|
+
case 47: goto tr4;
|
2619
|
+
case 59: goto st4;
|
2620
|
+
case 95: goto tr8;
|
2621
|
+
case 123: goto tr4;
|
2622
|
+
}
|
2623
|
+
if ( (*p) < 45 ) {
|
2624
|
+
if ( (*p) < 33 ) {
|
2625
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
2626
|
+
goto st3;
|
2627
|
+
} else if ( (*p) > 38 ) {
|
2628
|
+
if ( 42 <= (*p) && (*p) <= 43 )
|
2629
|
+
goto tr4;
|
2630
|
+
} else
|
2631
|
+
goto tr4;
|
2632
|
+
} else if ( (*p) > 58 ) {
|
2633
|
+
if ( (*p) < 65 ) {
|
2634
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
2635
|
+
goto tr4;
|
2636
|
+
} else if ( (*p) > 90 ) {
|
2637
|
+
if ( (*p) > 92 ) {
|
2638
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
2639
|
+
goto tr8;
|
2640
|
+
} else if ( (*p) >= 91 )
|
2641
|
+
goto tr4;
|
2642
|
+
} else
|
2643
|
+
goto tr8;
|
2644
|
+
} else
|
2645
|
+
goto tr8;
|
2646
|
+
goto st0;
|
2647
|
+
tr8:
|
2648
|
+
#line 763 "edn_parser.rl"
|
2649
|
+
{
|
2650
|
+
const char *np = parse_value(p, pe, object);
|
2651
|
+
if (np == NULL) { p--; {p++; cs = 9; goto _out;} } else { {p = (( np))-1;} }
|
2652
|
+
}
|
2653
|
+
#line 768 "edn_parser.rl"
|
2654
|
+
{ p--; {p++; cs = 9; goto _out;} }
|
2655
|
+
goto st9;
|
2656
|
+
st9:
|
2657
|
+
if ( ++p == pe )
|
2658
|
+
goto _test_eof9;
|
2659
|
+
case 9:
|
2660
|
+
#line 2661 "edn_parser.cc"
|
2661
|
+
switch( (*p) ) {
|
2662
|
+
case 10: goto tr3;
|
2663
|
+
case 32: goto st3;
|
2664
|
+
case 35: goto tr8;
|
2665
|
+
case 40: goto tr4;
|
2666
|
+
case 44: goto st3;
|
2667
|
+
case 47: goto tr4;
|
2668
|
+
case 59: goto st4;
|
2669
|
+
case 95: goto tr8;
|
2670
|
+
case 123: goto tr4;
|
2671
|
+
}
|
2672
|
+
if ( (*p) < 45 ) {
|
2673
|
+
if ( (*p) < 33 ) {
|
2674
|
+
if ( 9 <= (*p) && (*p) <= 13 )
|
2675
|
+
goto st3;
|
2676
|
+
} else if ( (*p) > 38 ) {
|
2677
|
+
if ( 42 <= (*p) && (*p) <= 43 )
|
2678
|
+
goto tr4;
|
2679
|
+
} else
|
2680
|
+
goto tr4;
|
2681
|
+
} else if ( (*p) > 58 ) {
|
2682
|
+
if ( (*p) < 65 ) {
|
2683
|
+
if ( 60 <= (*p) && (*p) <= 63 )
|
2684
|
+
goto tr4;
|
2685
|
+
} else if ( (*p) > 90 ) {
|
2686
|
+
if ( (*p) > 92 ) {
|
2687
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
2688
|
+
goto tr8;
|
2689
|
+
} else if ( (*p) >= 91 )
|
2690
|
+
goto tr4;
|
2691
|
+
} else
|
2692
|
+
goto tr8;
|
2693
|
+
} else
|
2694
|
+
goto tr8;
|
1969
2695
|
goto st0;
|
1970
2696
|
}
|
1971
2697
|
_test_eof2: cs = 2; goto _test_eof;
|
1972
2698
|
_test_eof3: cs = 3; goto _test_eof;
|
1973
|
-
_test_eof5: cs = 5; goto _test_eof;
|
1974
|
-
_test_eof4: cs = 4; goto _test_eof;
|
1975
2699
|
_test_eof6: cs = 6; goto _test_eof;
|
2700
|
+
_test_eof4: cs = 4; goto _test_eof;
|
2701
|
+
_test_eof7: cs = 7; goto _test_eof;
|
2702
|
+
_test_eof8: cs = 8; goto _test_eof;
|
2703
|
+
_test_eof5: cs = 5; goto _test_eof;
|
2704
|
+
_test_eof9: cs = 9; goto _test_eof;
|
1976
2705
|
|
1977
2706
|
_test_eof: {}
|
1978
2707
|
_out: {}
|
1979
2708
|
}
|
1980
2709
|
|
1981
|
-
#line
|
2710
|
+
#line 784 "edn_parser.rl"
|
1982
2711
|
|
1983
2712
|
if (cs >= EDN_tagged_first_final) {
|
1984
|
-
//
|
2713
|
+
//std::cerr << __FUNCTION__ << " parse symbol name as '" << sym_name << "', value is: " << object << std::endl;
|
1985
2714
|
o = Parser::tagged_element(sym_name, object);
|
1986
2715
|
return p + 1;
|
1987
2716
|
}
|
@@ -1997,7 +2726,7 @@ case 6:
|
|
1997
2726
|
// discard
|
1998
2727
|
//
|
1999
2728
|
|
2000
|
-
#line
|
2729
|
+
#line 2730 "edn_parser.cc"
|
2001
2730
|
static const int EDN_discard_start = 1;
|
2002
2731
|
static const int EDN_discard_first_final = 4;
|
2003
2732
|
static const int EDN_discard_error = 0;
|
@@ -2005,7 +2734,7 @@ static const int EDN_discard_error = 0;
|
|
2005
2734
|
static const int EDN_discard_en_main = 1;
|
2006
2735
|
|
2007
2736
|
|
2008
|
-
#line
|
2737
|
+
#line 821 "edn_parser.rl"
|
2009
2738
|
|
2010
2739
|
|
2011
2740
|
|
@@ -2016,14 +2745,14 @@ const char* edn::Parser::parse_discard(const char *p, const char *pe)
|
|
2016
2745
|
Rice::Object o;
|
2017
2746
|
|
2018
2747
|
|
2019
|
-
#line
|
2748
|
+
#line 2749 "edn_parser.cc"
|
2020
2749
|
{
|
2021
2750
|
cs = EDN_discard_start;
|
2022
2751
|
}
|
2023
2752
|
|
2024
|
-
#line
|
2753
|
+
#line 831 "edn_parser.rl"
|
2025
2754
|
|
2026
|
-
#line
|
2755
|
+
#line 2756 "edn_parser.cc"
|
2027
2756
|
{
|
2028
2757
|
if ( p == pe )
|
2029
2758
|
goto _test_eof;
|
@@ -2044,7 +2773,7 @@ st2:
|
|
2044
2773
|
if ( ++p == pe )
|
2045
2774
|
goto _test_eof2;
|
2046
2775
|
case 2:
|
2047
|
-
#line
|
2776
|
+
#line 2777 "edn_parser.cc"
|
2048
2777
|
switch( (*p) ) {
|
2049
2778
|
case 10: goto tr2;
|
2050
2779
|
case 32: goto st2;
|
@@ -2069,12 +2798,12 @@ case 2:
|
|
2069
2798
|
goto tr3;
|
2070
2799
|
goto st0;
|
2071
2800
|
tr3:
|
2072
|
-
#line
|
2801
|
+
#line 809 "edn_parser.rl"
|
2073
2802
|
{
|
2074
2803
|
const char *np = parse_value(p, pe, o);
|
2075
2804
|
if (np == NULL) { p--; {p++; cs = 4; goto _out;} } else { discard.push(o); {p = (( np))-1;} }
|
2076
2805
|
}
|
2077
|
-
#line
|
2806
|
+
#line 814 "edn_parser.rl"
|
2078
2807
|
{
|
2079
2808
|
p--; {p++; cs = 4; goto _out;}
|
2080
2809
|
}
|
@@ -2083,7 +2812,7 @@ st4:
|
|
2083
2812
|
if ( ++p == pe )
|
2084
2813
|
goto _test_eof4;
|
2085
2814
|
case 4:
|
2086
|
-
#line
|
2815
|
+
#line 2816 "edn_parser.cc"
|
2087
2816
|
goto st0;
|
2088
2817
|
st3:
|
2089
2818
|
if ( ++p == pe )
|
@@ -2101,7 +2830,7 @@ case 3:
|
|
2101
2830
|
_out: {}
|
2102
2831
|
}
|
2103
2832
|
|
2104
|
-
#line
|
2833
|
+
#line 832 "edn_parser.rl"
|
2105
2834
|
|
2106
2835
|
if (cs >= EDN_discard_first_final) {
|
2107
2836
|
return p + 1;
|
@@ -2121,7 +2850,7 @@ case 3:
|
|
2121
2850
|
// dispatch
|
2122
2851
|
//
|
2123
2852
|
|
2124
|
-
#line
|
2853
|
+
#line 2854 "edn_parser.cc"
|
2125
2854
|
static const int EDN_dispatch_start = 1;
|
2126
2855
|
static const int EDN_dispatch_first_final = 2;
|
2127
2856
|
static const int EDN_dispatch_error = 0;
|
@@ -2129,7 +2858,7 @@ static const int EDN_dispatch_error = 0;
|
|
2129
2858
|
static const int EDN_dispatch_en_main = 1;
|
2130
2859
|
|
2131
2860
|
|
2132
|
-
#line
|
2861
|
+
#line 878 "edn_parser.rl"
|
2133
2862
|
|
2134
2863
|
|
2135
2864
|
|
@@ -2139,14 +2868,14 @@ const char* edn::Parser::parse_dispatch(const char *p, const char *pe, Rice::Obj
|
|
2139
2868
|
int cs;
|
2140
2869
|
|
2141
2870
|
|
2142
|
-
#line
|
2871
|
+
#line 2872 "edn_parser.cc"
|
2143
2872
|
{
|
2144
2873
|
cs = EDN_dispatch_start;
|
2145
2874
|
}
|
2146
2875
|
|
2147
|
-
#line
|
2876
|
+
#line 887 "edn_parser.rl"
|
2148
2877
|
|
2149
|
-
#line
|
2878
|
+
#line 2879 "edn_parser.cc"
|
2150
2879
|
{
|
2151
2880
|
if ( p == pe )
|
2152
2881
|
goto _test_eof;
|
@@ -2167,40 +2896,37 @@ st0:
|
|
2167
2896
|
cs = 0;
|
2168
2897
|
goto _out;
|
2169
2898
|
tr0:
|
2170
|
-
#line
|
2899
|
+
#line 866 "edn_parser.rl"
|
2171
2900
|
{
|
2172
|
-
// std::cerr << "--- DISPATCH TAGGED: fpc is '" << fpc << "'" << std::endl;
|
2173
2901
|
const char *np = parse_tagged(p, pe, o);
|
2174
2902
|
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
2175
2903
|
}
|
2176
|
-
#line
|
2904
|
+
#line 871 "edn_parser.rl"
|
2177
2905
|
{ p--; {p++; cs = 2; goto _out;} }
|
2178
2906
|
goto st2;
|
2179
2907
|
tr2:
|
2180
|
-
#line
|
2908
|
+
#line 856 "edn_parser.rl"
|
2181
2909
|
{
|
2182
|
-
// std::cerr << "--- DISPATCH DISCARD: fpc is '" << fpc << "'" << std::endl;
|
2183
2910
|
const char *np = parse_discard(p, pe);
|
2184
2911
|
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
2185
2912
|
}
|
2186
|
-
#line
|
2913
|
+
#line 871 "edn_parser.rl"
|
2187
2914
|
{ p--; {p++; cs = 2; goto _out;} }
|
2188
2915
|
goto st2;
|
2189
2916
|
tr3:
|
2190
|
-
#line
|
2917
|
+
#line 861 "edn_parser.rl"
|
2191
2918
|
{
|
2192
|
-
// std::cerr << "--- DISPATCH SET: fpc is '" << fpc << "'" << std::endl;
|
2193
2919
|
const char *np = parse_set(p, pe, o);
|
2194
2920
|
if (np == NULL) { p--; {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
2195
2921
|
}
|
2196
|
-
#line
|
2922
|
+
#line 871 "edn_parser.rl"
|
2197
2923
|
{ p--; {p++; cs = 2; goto _out;} }
|
2198
2924
|
goto st2;
|
2199
2925
|
st2:
|
2200
2926
|
if ( ++p == pe )
|
2201
2927
|
goto _test_eof2;
|
2202
2928
|
case 2:
|
2203
|
-
#line
|
2929
|
+
#line 2930 "edn_parser.cc"
|
2204
2930
|
goto st0;
|
2205
2931
|
}
|
2206
2932
|
_test_eof2: cs = 2; goto _test_eof;
|
@@ -2209,7 +2935,7 @@ case 2:
|
|
2209
2935
|
_out: {}
|
2210
2936
|
}
|
2211
2937
|
|
2212
|
-
#line
|
2938
|
+
#line 888 "edn_parser.rl"
|
2213
2939
|
|
2214
2940
|
if (cs >= EDN_dispatch_first_final) {
|
2215
2941
|
return p + 1;
|
@@ -2227,14 +2953,14 @@ case 2:
|
|
2227
2953
|
// main parsing machine
|
2228
2954
|
//
|
2229
2955
|
|
2230
|
-
#line
|
2956
|
+
#line 2957 "edn_parser.cc"
|
2231
2957
|
static const int EDN_start = 2;
|
2232
2958
|
static const int EDN_error = 0;
|
2233
2959
|
|
2234
2960
|
static const int EDN_en_main = 2;
|
2235
2961
|
|
2236
2962
|
|
2237
|
-
#line
|
2963
|
+
#line 921 "edn_parser.rl"
|
2238
2964
|
|
2239
2965
|
|
2240
2966
|
//
|
@@ -2254,17 +2980,17 @@ Rice::Object edn::Parser::parse(const char* buf, std::size_t len)
|
|
2254
2980
|
discard.pop();
|
2255
2981
|
|
2256
2982
|
|
2257
|
-
#line
|
2983
|
+
#line 2984 "edn_parser.cc"
|
2258
2984
|
{
|
2259
2985
|
cs = EDN_start;
|
2260
2986
|
}
|
2261
2987
|
|
2262
|
-
#line
|
2988
|
+
#line 940 "edn_parser.rl"
|
2263
2989
|
p = &buf[0];
|
2264
2990
|
pe = p + len;
|
2265
2991
|
eof = pe; // eof defined in Parser class
|
2266
2992
|
|
2267
|
-
#line
|
2993
|
+
#line 2994 "edn_parser.cc"
|
2268
2994
|
{
|
2269
2995
|
if ( p == pe )
|
2270
2996
|
goto _test_eof;
|
@@ -2275,7 +3001,7 @@ tr1:
|
|
2275
3001
|
{ line_number++; }
|
2276
3002
|
goto st2;
|
2277
3003
|
tr4:
|
2278
|
-
#line
|
3004
|
+
#line 910 "edn_parser.rl"
|
2279
3005
|
{
|
2280
3006
|
const char* np = parse_value(p, pe, result);
|
2281
3007
|
if (np == NULL) { {p = (( pe))-1;} {p++; cs = 2; goto _out;} } else {p = (( np))-1;}
|
@@ -2285,7 +3011,7 @@ st2:
|
|
2285
3011
|
if ( ++p == pe )
|
2286
3012
|
goto _test_eof2;
|
2287
3013
|
case 2:
|
2288
|
-
#line
|
3014
|
+
#line 3015 "edn_parser.cc"
|
2289
3015
|
switch( (*p) ) {
|
2290
3016
|
case 10: goto tr1;
|
2291
3017
|
case 32: goto st2;
|
@@ -2327,7 +3053,7 @@ case 1:
|
|
2327
3053
|
_out: {}
|
2328
3054
|
}
|
2329
3055
|
|
2330
|
-
#line
|
3056
|
+
#line 944 "edn_parser.rl"
|
2331
3057
|
|
2332
3058
|
if (cs == EDN_error) {
|
2333
3059
|
error(__FUNCTION__, *p);
|