rubysl-yaml 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2725 +0,0 @@
1
- /* Generated by re2c 0.9.10 on Tue Sep 20 17:46:17 2005 */
2
- #line 1 "token.re"
3
- /*
4
- * token.re
5
- *
6
- * $Author: shyouhei $
7
- * $Date: 2007-02-12 15:01:19 -0800 (Mon, 12 Feb 2007) $
8
- *
9
- * Copyright (C) 2003 why the lucky stiff
10
- */
11
- #include "ruby.h"
12
- #include "syck.h"
13
- #include "gram.h"
14
-
15
- /*
16
- * Allocate quoted strings in chunks
17
- */
18
- #define QUOTELEN 1024
19
-
20
- /*
21
- * They do my bidding...
22
- */
23
- #define YYCTYPE char
24
- #define YYCURSOR parser->cursor
25
- #define YYMARKER parser->marker
26
- #define YYLIMIT parser->limit
27
- #define YYTOKEN parser->token
28
- #define YYTOKTMP parser->toktmp
29
- #define YYLINEPTR parser->lineptr
30
- #define YYLINECTPTR parser->linectptr
31
- #define YYLINE parser->linect
32
- #define YYFILL(n) syck_parser_read(parser)
33
-
34
- /*
35
- * Repositions the cursor at `n' offset from the token start.
36
- * Only works in `Header' and `Document' sections.
37
- */
38
- #define YYPOS(n) YYCURSOR = YYTOKEN + n
39
-
40
- /*
41
- * Track line numbers
42
- */
43
- #define NEWLINE(ptr) YYLINEPTR = ptr + newline_len(ptr); if ( YYLINEPTR > YYLINECTPTR ) { YYLINE++; YYLINECTPTR = YYLINEPTR; }
44
-
45
- /*
46
- * I like seeing the level operations as macros...
47
- */
48
- #define ADD_LEVEL(len, status) syck_parser_add_level( parser, len, status )
49
- #define POP_LEVEL() syck_parser_pop_level( parser )
50
- #define CURRENT_LEVEL() syck_parser_current_level( parser )
51
-
52
- /*
53
- * Force a token next time around sycklex()
54
- */
55
- #define FORCE_NEXT_TOKEN(tok) parser->force_token = tok;
56
-
57
- /*
58
- * Nice little macro to ensure we're YAML_IOPENed to the current level.
59
- * * Only use this macro in the "Document" section *
60
- */
61
- #define ENSURE_YAML_IOPEN(last_lvl, to_len, reset) \
62
- if ( last_lvl->spaces < to_len ) \
63
- { \
64
- if ( last_lvl->status == syck_lvl_iseq || last_lvl->status == syck_lvl_imap ) \
65
- { \
66
- goto Document; \
67
- } \
68
- else \
69
- { \
70
- ADD_LEVEL( to_len, syck_lvl_doc ); \
71
- if ( reset == 1 ) YYPOS(0); \
72
- return YAML_IOPEN; \
73
- } \
74
- }
75
-
76
- /*
77
- * Nice little macro to ensure closure of levels.
78
- * * Only use this macro in the "Document" section *
79
- */
80
- #define ENSURE_YAML_IEND(last_lvl, to_len) \
81
- if ( last_lvl->spaces > to_len ) \
82
- { \
83
- syck_parser_pop_level( parser ); \
84
- YYPOS(0); \
85
- return YAML_IEND; \
86
- }
87
-
88
- /*
89
- * Concatenates quoted string items and manages allocation
90
- * to the quoted string
91
- */
92
- #define QUOTECAT(s, c, i, l) \
93
- { \
94
- if ( i + 1 >= c ) \
95
- { \
96
- c += QUOTELEN; \
97
- S_REALLOC_N( s, char, c ); \
98
- } \
99
- s[i++] = l; \
100
- s[i] = '\0'; \
101
- }
102
-
103
- #define QUOTECATS(s, c, i, cs, cl) \
104
- { \
105
- while ( i + cl >= c ) \
106
- { \
107
- c += QUOTELEN; \
108
- S_REALLOC_N( s, char, c ); \
109
- } \
110
- S_MEMCPY( s + i, cs, char, cl ); \
111
- i += cl; \
112
- s[i] = '\0'; \
113
- }
114
-
115
- /*
116
- * Tags a plain scalar with a transfer method
117
- * * Use only in "Plain" section *
118
- */
119
- #define RETURN_IMPLICIT() \
120
- { \
121
- SyckNode *n = syck_alloc_str(); \
122
- YYCURSOR = YYTOKEN; \
123
- n->data.str->ptr = qstr; \
124
- n->data.str->len = qidx; \
125
- n->data.str->style = scalar_plain; \
126
- sycklval->nodeData = n; \
127
- if ( parser->implicit_typing == 1 ) \
128
- { \
129
- try_tag_implicit( sycklval->nodeData, parser->taguri_expansion ); \
130
- } \
131
- return YAML_PLAIN; \
132
- }
133
-
134
- /* concat the inline characters to the plain scalar */
135
- #define PLAIN_NOT_INL() \
136
- if ( *(YYCURSOR - 1) == ' ' || is_newline( YYCURSOR - 1 ) ) \
137
- { \
138
- YYCURSOR--; \
139
- } \
140
- QUOTECATS(qstr, qcapa, qidx, YYTOKEN, YYCURSOR - YYTOKEN); \
141
- goto Plain2;
142
-
143
- /* trim spaces off the end in case of indent */
144
- #define PLAIN_IS_INL() \
145
- char *walker = qstr + qidx - 1; \
146
- while ( walker > qstr && ( *walker == '\n' || *walker == ' ' || *walker == '\t' ) ) \
147
- { \
148
- qidx--; \
149
- walker[0] = '\0'; \
150
- walker--; \
151
- }
152
-
153
- /*
154
- * Keep or chomp block?
155
- * * Use only in "ScalarBlock" section *
156
- */
157
- #define RETURN_YAML_BLOCK() \
158
- { \
159
- SyckNode *n = syck_alloc_str(); \
160
- if ( ((SyckParser *)parser)->taguri_expansion == 1 ) \
161
- { \
162
- n->type_id = syck_taguri( YAML_DOMAIN, "str", 3 ); \
163
- } \
164
- else \
165
- { \
166
- n->type_id = syck_strndup( "str", 3 ); \
167
- } \
168
- n->data.str->ptr = qstr; \
169
- n->data.str->len = qidx; \
170
- if ( blockType == BLOCK_LIT ) { \
171
- n->data.str->style = scalar_literal; \
172
- } else { \
173
- n->data.str->style = scalar_fold; \
174
- } \
175
- if ( qidx > 0 ) \
176
- { \
177
- if ( nlDoWhat != NL_KEEP ) \
178
- { \
179
- char *fc = n->data.str->ptr + n->data.str->len - 1; \
180
- while ( is_newline( fc ) ) fc--; \
181
- if ( nlDoWhat != NL_CHOMP && fc < n->data.str->ptr + n->data.str->len - 1 ) \
182
- fc += 1; \
183
- n->data.str->len = fc - n->data.str->ptr + 1; \
184
- } \
185
- } \
186
- sycklval->nodeData = n; \
187
- return YAML_BLOCK; \
188
- }
189
-
190
- /*
191
- * Handles newlines, calculates indent
192
- */
193
- #define GOBBLE_UP_YAML_INDENT( ict, start ) \
194
- char *indent = start; \
195
- NEWLINE(indent); \
196
- while ( indent < YYCURSOR ) \
197
- { \
198
- if ( is_newline( ++indent ) ) \
199
- { \
200
- NEWLINE(indent); \
201
- } \
202
- } \
203
- ict = 0; \
204
- if ( *YYCURSOR == '\0' ) \
205
- { \
206
- ict = -1; \
207
- start = YYCURSOR - 1; \
208
- } \
209
- else if ( *YYLINEPTR == ' ' ) \
210
- { \
211
- ict = YYCURSOR - YYLINEPTR; \
212
- }
213
-
214
- /*
215
- * If an indent exists at the current level, back up.
216
- */
217
- #define GET_TRUE_YAML_INDENT(indt_len) \
218
- { \
219
- SyckLevel *lvl_deep = CURRENT_LEVEL(); \
220
- indt_len = lvl_deep->spaces; \
221
- if ( lvl_deep->status == syck_lvl_seq || ( indt_len == YYCURSOR - YYLINEPTR && lvl_deep->status != syck_lvl_map ) ) \
222
- { \
223
- SyckLevel *lvl_over; \
224
- parser->lvl_idx--; \
225
- lvl_over = CURRENT_LEVEL(); \
226
- indt_len = lvl_over->spaces; \
227
- parser->lvl_idx++; \
228
- } \
229
- }
230
-
231
- /*
232
- * Argjh! I hate globals! Here for syckerror() only!
233
- */
234
- SyckParser *syck_parser_ptr = NULL;
235
-
236
- /*
237
- * Accessory funcs later in this file.
238
- */
239
- void eat_comments( SyckParser * );
240
- char escape_seq( char );
241
- int is_newline( char *ptr );
242
- int newline_len( char *ptr );
243
- int sycklex_yaml_utf8( YYSTYPE *, SyckParser * );
244
- int sycklex_bytecode_utf8( YYSTYPE *, SyckParser * );
245
- int syckwrap();
246
-
247
- /*
248
- * My own re-entrant sycklex() using re2c.
249
- * You really get used to the limited regexp.
250
- * It's really nice to not rely on backtracking and such.
251
- */
252
- int
253
- sycklex( YYSTYPE *sycklval, SyckParser *parser )
254
- {
255
- switch ( parser->input_type )
256
- {
257
- case syck_yaml_utf8:
258
- return sycklex_yaml_utf8( sycklval, parser );
259
-
260
- case syck_yaml_utf16:
261
- syckerror( "UTF-16 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
262
- break;
263
-
264
- case syck_yaml_utf32:
265
- syckerror( "UTF-32 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
266
- break;
267
-
268
- case syck_bytecode_utf8:
269
- return sycklex_bytecode_utf8( sycklval, parser );
270
- }
271
- return YAML_DOCSEP;
272
- }
273
-
274
- /*
275
- * Parser for standard YAML [UTF-8]
276
- */
277
- int
278
- sycklex_yaml_utf8( YYSTYPE *sycklval, SyckParser *parser )
279
- {
280
- int doc_level = 0;
281
- syck_parser_ptr = parser;
282
- if ( YYCURSOR == NULL )
283
- {
284
- syck_parser_read( parser );
285
- }
286
-
287
- if ( parser->force_token != 0 )
288
- {
289
- int t = parser->force_token;
290
- parser->force_token = 0;
291
- return t;
292
- }
293
-
294
- #line 315 "token.re"
295
-
296
-
297
- if ( YYLINEPTR != YYCURSOR )
298
- {
299
- goto Document;
300
- }
301
-
302
- Header:
303
-
304
- YYTOKEN = YYCURSOR;
305
-
306
-
307
- #line 307 "<stdout>"
308
- {
309
- YYCTYPE yych;
310
- unsigned int yyaccept;
311
- goto yy0;
312
- ++YYCURSOR;
313
- yy0:
314
- if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
315
- yych = *YYCURSOR;
316
- switch(yych){
317
- case 0x00: goto yy7;
318
- case 0x09: case ' ': goto yy12;
319
- case 0x0A: goto yy9;
320
- case 0x0D: goto yy11;
321
- case '#': goto yy5;
322
- case '-': goto yy2;
323
- case '.': goto yy4;
324
- default: goto yy14;
325
- }
326
- yy2: yyaccept = 0;
327
- yych = *(YYMARKER = ++YYCURSOR);
328
- switch(yych){
329
- case '-': goto yy28;
330
- default: goto yy3;
331
- }
332
- yy3:
333
- #line 374 "token.re"
334
- { YYPOS(0);
335
- goto Document;
336
- }
337
- #line 337 "<stdout>"
338
- yy4: yyaccept = 0;
339
- yych = *(YYMARKER = ++YYCURSOR);
340
- switch(yych){
341
- case '.': goto yy21;
342
- default: goto yy3;
343
- }
344
- yy5: ++YYCURSOR;
345
- goto yy6;
346
- yy6:
347
- #line 356 "token.re"
348
- { eat_comments( parser );
349
- goto Header;
350
- }
351
- #line 351 "<stdout>"
352
- yy7: ++YYCURSOR;
353
- goto yy8;
354
- yy8:
355
- #line 360 "token.re"
356
- { SyckLevel *lvl = CURRENT_LEVEL();
357
- ENSURE_YAML_IEND(lvl, -1);
358
- YYPOS(0);
359
- return 0;
360
- }
361
- #line 361 "<stdout>"
362
- yy9: yyaccept = 1;
363
- yych = *(YYMARKER = ++YYCURSOR);
364
- goto yy18;
365
- yy10:
366
- #line 366 "token.re"
367
- { GOBBLE_UP_YAML_INDENT( doc_level, YYTOKEN );
368
- goto Header;
369
- }
370
- #line 370 "<stdout>"
371
- yy11: yych = *++YYCURSOR;
372
- switch(yych){
373
- case 0x0A: goto yy17;
374
- default: goto yy3;
375
- }
376
- yy12: ++YYCURSOR;
377
- yych = *YYCURSOR;
378
- goto yy16;
379
- yy13:
380
- #line 370 "token.re"
381
- { doc_level = YYCURSOR - YYLINEPTR;
382
- goto Header;
383
- }
384
- #line 384 "<stdout>"
385
- yy14: yych = *++YYCURSOR;
386
- goto yy3;
387
- yy15: ++YYCURSOR;
388
- if(YYLIMIT == YYCURSOR) YYFILL(1);
389
- yych = *YYCURSOR;
390
- goto yy16;
391
- yy16: switch(yych){
392
- case 0x09: case ' ': goto yy15;
393
- default: goto yy13;
394
- }
395
- yy17: yyaccept = 1;
396
- YYMARKER = ++YYCURSOR;
397
- if(YYLIMIT == YYCURSOR) YYFILL(1);
398
- yych = *YYCURSOR;
399
- goto yy18;
400
- yy18: switch(yych){
401
- case 0x0A: case ' ': goto yy17;
402
- case 0x0D: goto yy19;
403
- default: goto yy10;
404
- }
405
- yy19: ++YYCURSOR;
406
- if(YYLIMIT == YYCURSOR) YYFILL(1);
407
- yych = *YYCURSOR;
408
- switch(yych){
409
- case 0x0A: goto yy17;
410
- default: goto yy20;
411
- }
412
- yy20: YYCURSOR = YYMARKER;
413
- switch(yyaccept){
414
- case 1: goto yy10;
415
- case 0: goto yy3;
416
- }
417
- yy21: yych = *++YYCURSOR;
418
- switch(yych){
419
- case '.': goto yy22;
420
- default: goto yy20;
421
- }
422
- yy22: yych = *++YYCURSOR;
423
- switch(yych){
424
- case 0x0A: goto yy23;
425
- case 0x0D: goto yy27;
426
- case ' ': goto yy25;
427
- default: goto yy20;
428
- }
429
- yy23: ++YYCURSOR;
430
- goto yy24;
431
- yy24:
432
- #line 342 "token.re"
433
- { SyckLevel *lvl = CURRENT_LEVEL();
434
- if ( lvl->status == syck_lvl_header )
435
- {
436
- goto Header;
437
- }
438
- else
439
- {
440
- ENSURE_YAML_IEND(lvl, -1);
441
- YYPOS(0);
442
- return 0;
443
- }
444
- return 0;
445
- }
446
- #line 446 "<stdout>"
447
- yy25: ++YYCURSOR;
448
- if(YYLIMIT == YYCURSOR) YYFILL(1);
449
- yych = *YYCURSOR;
450
- goto yy26;
451
- yy26: switch(yych){
452
- case ' ': goto yy25;
453
- default: goto yy24;
454
- }
455
- yy27: yych = *++YYCURSOR;
456
- switch(yych){
457
- case 0x0A: goto yy23;
458
- default: goto yy20;
459
- }
460
- yy28: yych = *++YYCURSOR;
461
- switch(yych){
462
- case '-': goto yy29;
463
- default: goto yy20;
464
- }
465
- yy29: yych = *++YYCURSOR;
466
- switch(yych){
467
- case 0x0A: goto yy30;
468
- case 0x0D: goto yy34;
469
- case ' ': goto yy32;
470
- default: goto yy20;
471
- }
472
- yy30: ++YYCURSOR;
473
- goto yy31;
474
- yy31:
475
- #line 328 "token.re"
476
- { SyckLevel *lvl = CURRENT_LEVEL();
477
- if ( lvl->status == syck_lvl_header )
478
- {
479
- YYPOS(3);
480
- goto Directive;
481
- }
482
- else
483
- {
484
- ENSURE_YAML_IEND(lvl, -1);
485
- YYPOS(0);
486
- return 0;
487
- }
488
- }
489
- #line 489 "<stdout>"
490
- yy32: ++YYCURSOR;
491
- if(YYLIMIT == YYCURSOR) YYFILL(1);
492
- yych = *YYCURSOR;
493
- goto yy33;
494
- yy33: switch(yych){
495
- case ' ': goto yy32;
496
- default: goto yy31;
497
- }
498
- yy34: ++YYCURSOR;
499
- switch((yych = *YYCURSOR)) {
500
- case 0x0A: goto yy30;
501
- default: goto yy20;
502
- }
503
- }
504
- #line 378 "token.re"
505
-
506
-
507
- Document:
508
- {
509
- SyckLevel *lvl = CURRENT_LEVEL();
510
- if ( lvl->status == syck_lvl_header )
511
- {
512
- lvl->status = syck_lvl_doc;
513
- }
514
-
515
- YYTOKEN = YYCURSOR;
516
-
517
-
518
- #line 518 "<stdout>"
519
- {
520
- YYCTYPE yych;
521
- unsigned int yyaccept;
522
- goto yy35;
523
- ++YYCURSOR;
524
- yy35:
525
- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
526
- yych = *YYCURSOR;
527
- switch(yych){
528
- case 0x00: goto yy62;
529
- case 0x09: case ' ': goto yy60;
530
- case 0x0A: goto yy37;
531
- case 0x0D: goto yy39;
532
- case '!': goto yy51;
533
- case '"': goto yy55;
534
- case '#': goto yy58;
535
- case '&': goto yy49;
536
- case '\'': goto yy53;
537
- case '*': goto yy50;
538
- case ',': case ':': goto yy47;
539
- case '-': case '?': goto yy48;
540
- case '>': case '|': goto yy57;
541
- case '[': goto yy41;
542
- case ']': case '}': goto yy45;
543
- case '{': goto yy43;
544
- default: goto yy64;
545
- }
546
- yy37: yyaccept = 0;
547
- yych = *(YYMARKER = ++YYCURSOR);
548
- goto yy92;
549
- yy38:
550
- #line 392 "token.re"
551
- { /* Isolate spaces */
552
- int indt_len;
553
- GOBBLE_UP_YAML_INDENT( indt_len, YYTOKEN );
554
- lvl = CURRENT_LEVEL();
555
- doc_level = 0;
556
-
557
- /* XXX: Comment lookahead */
558
- if ( *YYCURSOR == '#' )
559
- {
560
- goto Document;
561
- }
562
-
563
- /* Ignore indentation inside inlines */
564
- if ( lvl->status == syck_lvl_iseq || lvl->status == syck_lvl_imap )
565
- {
566
- goto Document;
567
- }
568
-
569
- /* Check for open indent */
570
- ENSURE_YAML_IEND(lvl, indt_len);
571
- ENSURE_YAML_IOPEN(lvl, indt_len, 0);
572
- if ( indt_len == -1 )
573
- {
574
- return 0;
575
- }
576
- return YAML_INDENT;
577
- }
578
- #line 578 "<stdout>"
579
- yy39: ++YYCURSOR;
580
- switch((yych = *YYCURSOR)) {
581
- case 0x0A: goto yy91;
582
- default: goto yy40;
583
- }
584
- yy40:
585
- #line 497 "token.re"
586
- { ENSURE_YAML_IOPEN(lvl, doc_level, 1);
587
- goto Plain;
588
- }
589
- #line 589 "<stdout>"
590
- yy41: ++YYCURSOR;
591
- goto yy42;
592
- yy42:
593
- #line 420 "token.re"
594
- { ENSURE_YAML_IOPEN(lvl, doc_level, 1);
595
- lvl = CURRENT_LEVEL();
596
- ADD_LEVEL(lvl->spaces + 1, syck_lvl_iseq);
597
- return YYTOKEN[0];
598
- }
599
- #line 599 "<stdout>"
600
- yy43: ++YYCURSOR;
601
- goto yy44;
602
- yy44:
603
- #line 426 "token.re"
604
- { ENSURE_YAML_IOPEN(lvl, doc_level, 1);
605
- lvl = CURRENT_LEVEL();
606
- ADD_LEVEL(lvl->spaces + 1, syck_lvl_imap);
607
- return YYTOKEN[0];
608
- }
609
- #line 609 "<stdout>"
610
- yy45: ++YYCURSOR;
611
- goto yy46;
612
- yy46:
613
- #line 432 "token.re"
614
- { POP_LEVEL();
615
- return YYTOKEN[0];
616
- }
617
- #line 617 "<stdout>"
618
- yy47: yyaccept = 1;
619
- yych = *(YYMARKER = ++YYCURSOR);
620
- switch(yych){
621
- case 0x0A: goto yy86;
622
- case 0x0D: goto yy90;
623
- case ' ': goto yy88;
624
- default: goto yy40;
625
- }
626
- yy48: yyaccept = 1;
627
- yych = *(YYMARKER = ++YYCURSOR);
628
- switch(yych){
629
- case 0x0A: goto yy81;
630
- case 0x0D: goto yy85;
631
- case ' ': goto yy83;
632
- default: goto yy40;
633
- }
634
- yy49: yych = *++YYCURSOR;
635
- switch(yych){
636
- case '-': case '0':
637
- case '1':
638
- case '2':
639
- case '3':
640
- case '4':
641
- case '5':
642
- case '6':
643
- case '7':
644
- case '8':
645
- case '9': case 'A':
646
- case 'B':
647
- case 'C':
648
- case 'D':
649
- case 'E':
650
- case 'F':
651
- case 'G':
652
- case 'H':
653
- case 'I':
654
- case 'J':
655
- case 'K':
656
- case 'L':
657
- case 'M':
658
- case 'N':
659
- case 'O':
660
- case 'P':
661
- case 'Q':
662
- case 'R':
663
- case 'S':
664
- case 'T':
665
- case 'U':
666
- case 'V':
667
- case 'W':
668
- case 'X':
669
- case 'Y':
670
- case 'Z': case '_': case 'a':
671
- case 'b':
672
- case 'c':
673
- case 'd':
674
- case 'e':
675
- case 'f':
676
- case 'g':
677
- case 'h':
678
- case 'i':
679
- case 'j':
680
- case 'k':
681
- case 'l':
682
- case 'm':
683
- case 'n':
684
- case 'o':
685
- case 'p':
686
- case 'q':
687
- case 'r':
688
- case 's':
689
- case 't':
690
- case 'u':
691
- case 'v':
692
- case 'w':
693
- case 'x':
694
- case 'y':
695
- case 'z': goto yy78;
696
- default: goto yy40;
697
- }
698
- yy50: yych = *++YYCURSOR;
699
- switch(yych){
700
- case '-': case '0':
701
- case '1':
702
- case '2':
703
- case '3':
704
- case '4':
705
- case '5':
706
- case '6':
707
- case '7':
708
- case '8':
709
- case '9': case 'A':
710
- case 'B':
711
- case 'C':
712
- case 'D':
713
- case 'E':
714
- case 'F':
715
- case 'G':
716
- case 'H':
717
- case 'I':
718
- case 'J':
719
- case 'K':
720
- case 'L':
721
- case 'M':
722
- case 'N':
723
- case 'O':
724
- case 'P':
725
- case 'Q':
726
- case 'R':
727
- case 'S':
728
- case 'T':
729
- case 'U':
730
- case 'V':
731
- case 'W':
732
- case 'X':
733
- case 'Y':
734
- case 'Z': case '_': case 'a':
735
- case 'b':
736
- case 'c':
737
- case 'd':
738
- case 'e':
739
- case 'f':
740
- case 'g':
741
- case 'h':
742
- case 'i':
743
- case 'j':
744
- case 'k':
745
- case 'l':
746
- case 'm':
747
- case 'n':
748
- case 'o':
749
- case 'p':
750
- case 'q':
751
- case 'r':
752
- case 's':
753
- case 't':
754
- case 'u':
755
- case 'v':
756
- case 'w':
757
- case 'x':
758
- case 'y':
759
- case 'z': goto yy75;
760
- default: goto yy40;
761
- }
762
- yy51: ++YYCURSOR;
763
- goto yy52;
764
- yy52:
765
- #line 471 "token.re"
766
- { goto TransferMethod; }
767
- #line 767 "<stdout>"
768
- yy53: ++YYCURSOR;
769
- goto yy54;
770
- yy54:
771
- #line 473 "token.re"
772
- { ENSURE_YAML_IOPEN(lvl, doc_level, 1);
773
- goto SingleQuote; }
774
- #line 774 "<stdout>"
775
- yy55: ++YYCURSOR;
776
- goto yy56;
777
- yy56:
778
- #line 476 "token.re"
779
- { ENSURE_YAML_IOPEN(lvl, doc_level, 1);
780
- goto DoubleQuote; }
781
- #line 781 "<stdout>"
782
- yy57: yyaccept = 1;
783
- yych = *(YYMARKER = ++YYCURSOR);
784
- switch(yych){
785
- case 0x0A: goto yy70;
786
- case 0x0D: goto yy74;
787
- case ' ': goto yy72;
788
- case '+': case '-': case '0':
789
- case '1':
790
- case '2':
791
- case '3':
792
- case '4':
793
- case '5':
794
- case '6':
795
- case '7':
796
- case '8':
797
- case '9': goto yy67;
798
- default: goto yy40;
799
- }
800
- yy58: ++YYCURSOR;
801
- goto yy59;
802
- yy59:
803
- #line 486 "token.re"
804
- { eat_comments( parser );
805
- goto Document;
806
- }
807
- #line 807 "<stdout>"
808
- yy60: ++YYCURSOR;
809
- yych = *YYCURSOR;
810
- goto yy66;
811
- yy61:
812
- #line 490 "token.re"
813
- { goto Document; }
814
- #line 814 "<stdout>"
815
- yy62: ++YYCURSOR;
816
- goto yy63;
817
- yy63:
818
- #line 492 "token.re"
819
- { ENSURE_YAML_IEND(lvl, -1);
820
- YYPOS(0);
821
- return 0;
822
- }
823
- #line 823 "<stdout>"
824
- yy64: yych = *++YYCURSOR;
825
- goto yy40;
826
- yy65: ++YYCURSOR;
827
- if(YYLIMIT == YYCURSOR) YYFILL(1);
828
- yych = *YYCURSOR;
829
- goto yy66;
830
- yy66: switch(yych){
831
- case 0x09: case ' ': goto yy65;
832
- default: goto yy61;
833
- }
834
- yy67: ++YYCURSOR;
835
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
836
- yych = *YYCURSOR;
837
- goto yy68;
838
- yy68: switch(yych){
839
- case 0x0A: goto yy70;
840
- case 0x0D: goto yy74;
841
- case ' ': goto yy72;
842
- case '+': case '-': case '0':
843
- case '1':
844
- case '2':
845
- case '3':
846
- case '4':
847
- case '5':
848
- case '6':
849
- case '7':
850
- case '8':
851
- case '9': goto yy67;
852
- default: goto yy69;
853
- }
854
- yy69: YYCURSOR = YYMARKER;
855
- switch(yyaccept){
856
- case 0: goto yy38;
857
- case 1: goto yy40;
858
- }
859
- yy70: ++YYCURSOR;
860
- goto yy71;
861
- yy71:
862
- #line 479 "token.re"
863
- { if ( is_newline( YYCURSOR - 1 ) )
864
- {
865
- YYCURSOR--;
866
- }
867
- goto ScalarBlock;
868
- }
869
- #line 869 "<stdout>"
870
- yy72: ++YYCURSOR;
871
- if(YYLIMIT == YYCURSOR) YYFILL(1);
872
- yych = *YYCURSOR;
873
- goto yy73;
874
- yy73: switch(yych){
875
- case ' ': goto yy72;
876
- default: goto yy71;
877
- }
878
- yy74: yych = *++YYCURSOR;
879
- switch(yych){
880
- case 0x0A: goto yy70;
881
- default: goto yy69;
882
- }
883
- yy75: ++YYCURSOR;
884
- if(YYLIMIT == YYCURSOR) YYFILL(1);
885
- yych = *YYCURSOR;
886
- goto yy76;
887
- yy76: switch(yych){
888
- case '-': case '0':
889
- case '1':
890
- case '2':
891
- case '3':
892
- case '4':
893
- case '5':
894
- case '6':
895
- case '7':
896
- case '8':
897
- case '9': case 'A':
898
- case 'B':
899
- case 'C':
900
- case 'D':
901
- case 'E':
902
- case 'F':
903
- case 'G':
904
- case 'H':
905
- case 'I':
906
- case 'J':
907
- case 'K':
908
- case 'L':
909
- case 'M':
910
- case 'N':
911
- case 'O':
912
- case 'P':
913
- case 'Q':
914
- case 'R':
915
- case 'S':
916
- case 'T':
917
- case 'U':
918
- case 'V':
919
- case 'W':
920
- case 'X':
921
- case 'Y':
922
- case 'Z': case '_': case 'a':
923
- case 'b':
924
- case 'c':
925
- case 'd':
926
- case 'e':
927
- case 'f':
928
- case 'g':
929
- case 'h':
930
- case 'i':
931
- case 'j':
932
- case 'k':
933
- case 'l':
934
- case 'm':
935
- case 'n':
936
- case 'o':
937
- case 'p':
938
- case 'q':
939
- case 'r':
940
- case 's':
941
- case 't':
942
- case 'u':
943
- case 'v':
944
- case 'w':
945
- case 'x':
946
- case 'y':
947
- case 'z': goto yy75;
948
- default: goto yy77;
949
- }
950
- yy77:
951
- #line 466 "token.re"
952
- { ENSURE_YAML_IOPEN(lvl, doc_level, 1);
953
- sycklval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
954
- return YAML_ALIAS;
955
- }
956
- #line 956 "<stdout>"
957
- yy78: ++YYCURSOR;
958
- if(YYLIMIT == YYCURSOR) YYFILL(1);
959
- yych = *YYCURSOR;
960
- goto yy79;
961
- yy79: switch(yych){
962
- case '-': case '0':
963
- case '1':
964
- case '2':
965
- case '3':
966
- case '4':
967
- case '5':
968
- case '6':
969
- case '7':
970
- case '8':
971
- case '9': case 'A':
972
- case 'B':
973
- case 'C':
974
- case 'D':
975
- case 'E':
976
- case 'F':
977
- case 'G':
978
- case 'H':
979
- case 'I':
980
- case 'J':
981
- case 'K':
982
- case 'L':
983
- case 'M':
984
- case 'N':
985
- case 'O':
986
- case 'P':
987
- case 'Q':
988
- case 'R':
989
- case 'S':
990
- case 'T':
991
- case 'U':
992
- case 'V':
993
- case 'W':
994
- case 'X':
995
- case 'Y':
996
- case 'Z': case '_': case 'a':
997
- case 'b':
998
- case 'c':
999
- case 'd':
1000
- case 'e':
1001
- case 'f':
1002
- case 'g':
1003
- case 'h':
1004
- case 'i':
1005
- case 'j':
1006
- case 'k':
1007
- case 'l':
1008
- case 'm':
1009
- case 'n':
1010
- case 'o':
1011
- case 'p':
1012
- case 'q':
1013
- case 'r':
1014
- case 's':
1015
- case 't':
1016
- case 'u':
1017
- case 'v':
1018
- case 'w':
1019
- case 'x':
1020
- case 'y':
1021
- case 'z': goto yy78;
1022
- default: goto yy80;
1023
- }
1024
- yy80:
1025
- #line 455 "token.re"
1026
- { sycklval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
1027
-
1028
- /*
1029
- * Remove previous anchors of the same name. Since the parser will likely
1030
- * construct deeper nodes first, we want those nodes to be placed in the
1031
- * queue for matching at a higher level of indentation.
1032
- */
1033
- syck_hdlr_remove_anchor(parser, sycklval->name);
1034
- return YAML_ANCHOR;
1035
- }
1036
- #line 1036 "<stdout>"
1037
- yy81: ++YYCURSOR;
1038
- goto yy82;
1039
- yy82:
1040
- #line 441 "token.re"
1041
- { ENSURE_YAML_IOPEN(lvl, YYTOKEN - YYLINEPTR, 1);
1042
- FORCE_NEXT_TOKEN(YAML_IOPEN);
1043
- if ( *YYCURSOR == '#' || is_newline( YYCURSOR ) || is_newline( YYCURSOR - 1 ) )
1044
- {
1045
- YYCURSOR--;
1046
- ADD_LEVEL((YYTOKEN + 1) - YYLINEPTR, syck_lvl_seq);
1047
- }
1048
- else /* spaces followed by content uses the space as indentation */
1049
- {
1050
- ADD_LEVEL(YYCURSOR - YYLINEPTR, syck_lvl_seq);
1051
- }
1052
- return YYTOKEN[0];
1053
- }
1054
- #line 1054 "<stdout>"
1055
- yy83: ++YYCURSOR;
1056
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1057
- yych = *YYCURSOR;
1058
- goto yy84;
1059
- yy84: switch(yych){
1060
- case ' ': goto yy83;
1061
- default: goto yy82;
1062
- }
1063
- yy85: yych = *++YYCURSOR;
1064
- switch(yych){
1065
- case 0x0A: goto yy81;
1066
- default: goto yy69;
1067
- }
1068
- yy86: ++YYCURSOR;
1069
- goto yy87;
1070
- yy87:
1071
- #line 436 "token.re"
1072
- { if ( *YYTOKEN == ':' && lvl->status != syck_lvl_imap ) lvl->status = syck_lvl_map;
1073
- YYPOS(1);
1074
- return YYTOKEN[0];
1075
- }
1076
- #line 1076 "<stdout>"
1077
- yy88: ++YYCURSOR;
1078
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1079
- yych = *YYCURSOR;
1080
- goto yy89;
1081
- yy89: switch(yych){
1082
- case ' ': goto yy88;
1083
- default: goto yy87;
1084
- }
1085
- yy90: yych = *++YYCURSOR;
1086
- switch(yych){
1087
- case 0x0A: goto yy86;
1088
- default: goto yy69;
1089
- }
1090
- yy91: yyaccept = 0;
1091
- YYMARKER = ++YYCURSOR;
1092
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1093
- yych = *YYCURSOR;
1094
- goto yy92;
1095
- yy92: switch(yych){
1096
- case 0x0A: case ' ': goto yy91;
1097
- case 0x0D: goto yy93;
1098
- default: goto yy38;
1099
- }
1100
- yy93: ++YYCURSOR;
1101
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1102
- yych = *YYCURSOR;
1103
- switch(yych){
1104
- case 0x0A: goto yy91;
1105
- default: goto yy69;
1106
- }
1107
- }
1108
- #line 501 "token.re"
1109
-
1110
- }
1111
-
1112
- Directive:
1113
- {
1114
- YYTOKTMP = YYCURSOR;
1115
-
1116
-
1117
- #line 1117 "<stdout>"
1118
- {
1119
- YYCTYPE yych;
1120
- unsigned int yyaccept;
1121
- goto yy94;
1122
- ++YYCURSOR;
1123
- yy94:
1124
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
1125
- yych = *YYCURSOR;
1126
- switch(yych){
1127
- case 0x00: goto yy96;
1128
- case 0x09: case ' ': goto yy99;
1129
- case '%': goto yy97;
1130
- default: goto yy101;
1131
- }
1132
- yy96: YYCURSOR = YYMARKER;
1133
- switch(yyaccept){
1134
- case 0: goto yy98;
1135
- }
1136
- yy97: yyaccept = 0;
1137
- yych = *(YYMARKER = ++YYCURSOR);
1138
- switch(yych){
1139
- case '.':
1140
- case '/':
1141
- case '0':
1142
- case '1':
1143
- case '2':
1144
- case '3':
1145
- case '4':
1146
- case '5':
1147
- case '6':
1148
- case '7':
1149
- case '8':
1150
- case '9':
1151
- case ':':
1152
- case ';':
1153
- case '<':
1154
- case '=':
1155
- case '>':
1156
- case '?':
1157
- case '@':
1158
- case 'A':
1159
- case 'B':
1160
- case 'C':
1161
- case 'D':
1162
- case 'E':
1163
- case 'F':
1164
- case 'G':
1165
- case 'H':
1166
- case 'I':
1167
- case 'J':
1168
- case 'K':
1169
- case 'L':
1170
- case 'M':
1171
- case 'N':
1172
- case 'O':
1173
- case 'P':
1174
- case 'Q':
1175
- case 'R':
1176
- case 'S':
1177
- case 'T':
1178
- case 'U':
1179
- case 'V':
1180
- case 'W':
1181
- case 'X':
1182
- case 'Y':
1183
- case 'Z':
1184
- case '[':
1185
- case '\\':
1186
- case ']':
1187
- case '^':
1188
- case '_': case 'a':
1189
- case 'b':
1190
- case 'c':
1191
- case 'd':
1192
- case 'e':
1193
- case 'f':
1194
- case 'g':
1195
- case 'h':
1196
- case 'i':
1197
- case 'j':
1198
- case 'k':
1199
- case 'l':
1200
- case 'm':
1201
- case 'n':
1202
- case 'o':
1203
- case 'p':
1204
- case 'q':
1205
- case 'r':
1206
- case 's':
1207
- case 't':
1208
- case 'u':
1209
- case 'v':
1210
- case 'w':
1211
- case 'x':
1212
- case 'y':
1213
- case 'z': goto yy104;
1214
- default: goto yy98;
1215
- }
1216
- yy98:
1217
- #line 514 "token.re"
1218
- { YYCURSOR = YYTOKTMP;
1219
- return YAML_DOCSEP;
1220
- }
1221
- #line 1221 "<stdout>"
1222
- yy99: ++YYCURSOR;
1223
- yych = *YYCURSOR;
1224
- goto yy103;
1225
- yy100:
1226
- #line 512 "token.re"
1227
- { goto Directive; }
1228
- #line 1228 "<stdout>"
1229
- yy101: yych = *++YYCURSOR;
1230
- goto yy98;
1231
- yy102: ++YYCURSOR;
1232
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1233
- yych = *YYCURSOR;
1234
- goto yy103;
1235
- yy103: switch(yych){
1236
- case 0x09: case ' ': goto yy102;
1237
- default: goto yy100;
1238
- }
1239
- yy104: ++YYCURSOR;
1240
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
1241
- yych = *YYCURSOR;
1242
- goto yy105;
1243
- yy105: switch(yych){
1244
- case '.':
1245
- case '/':
1246
- case '0':
1247
- case '1':
1248
- case '2':
1249
- case '3':
1250
- case '4':
1251
- case '5':
1252
- case '6':
1253
- case '7':
1254
- case '8':
1255
- case '9': case ';':
1256
- case '<':
1257
- case '=':
1258
- case '>':
1259
- case '?':
1260
- case '@':
1261
- case 'A':
1262
- case 'B':
1263
- case 'C':
1264
- case 'D':
1265
- case 'E':
1266
- case 'F':
1267
- case 'G':
1268
- case 'H':
1269
- case 'I':
1270
- case 'J':
1271
- case 'K':
1272
- case 'L':
1273
- case 'M':
1274
- case 'N':
1275
- case 'O':
1276
- case 'P':
1277
- case 'Q':
1278
- case 'R':
1279
- case 'S':
1280
- case 'T':
1281
- case 'U':
1282
- case 'V':
1283
- case 'W':
1284
- case 'X':
1285
- case 'Y':
1286
- case 'Z':
1287
- case '[':
1288
- case '\\':
1289
- case ']':
1290
- case '^':
1291
- case '_': case 'a':
1292
- case 'b':
1293
- case 'c':
1294
- case 'd':
1295
- case 'e':
1296
- case 'f':
1297
- case 'g':
1298
- case 'h':
1299
- case 'i':
1300
- case 'j':
1301
- case 'k':
1302
- case 'l':
1303
- case 'm':
1304
- case 'n':
1305
- case 'o':
1306
- case 'p':
1307
- case 'q':
1308
- case 'r':
1309
- case 's':
1310
- case 't':
1311
- case 'u':
1312
- case 'v':
1313
- case 'w':
1314
- case 'x':
1315
- case 'y':
1316
- case 'z': goto yy104;
1317
- case ':': goto yy106;
1318
- default: goto yy96;
1319
- }
1320
- yy106: yych = *++YYCURSOR;
1321
- switch(yych){
1322
- case '.':
1323
- case '/':
1324
- case '0':
1325
- case '1':
1326
- case '2':
1327
- case '3':
1328
- case '4':
1329
- case '5':
1330
- case '6':
1331
- case '7':
1332
- case '8':
1333
- case '9':
1334
- case ':':
1335
- case ';':
1336
- case '<':
1337
- case '=':
1338
- case '>':
1339
- case '?':
1340
- case '@':
1341
- case 'A':
1342
- case 'B':
1343
- case 'C':
1344
- case 'D':
1345
- case 'E':
1346
- case 'F':
1347
- case 'G':
1348
- case 'H':
1349
- case 'I':
1350
- case 'J':
1351
- case 'K':
1352
- case 'L':
1353
- case 'M':
1354
- case 'N':
1355
- case 'O':
1356
- case 'P':
1357
- case 'Q':
1358
- case 'R':
1359
- case 'S':
1360
- case 'T':
1361
- case 'U':
1362
- case 'V':
1363
- case 'W':
1364
- case 'X':
1365
- case 'Y':
1366
- case 'Z':
1367
- case '[':
1368
- case '\\':
1369
- case ']':
1370
- case '^':
1371
- case '_': case 'a':
1372
- case 'b':
1373
- case 'c':
1374
- case 'd':
1375
- case 'e':
1376
- case 'f':
1377
- case 'g':
1378
- case 'h':
1379
- case 'i':
1380
- case 'j':
1381
- case 'k':
1382
- case 'l':
1383
- case 'm':
1384
- case 'n':
1385
- case 'o':
1386
- case 'p':
1387
- case 'q':
1388
- case 'r':
1389
- case 's':
1390
- case 't':
1391
- case 'u':
1392
- case 'v':
1393
- case 'w':
1394
- case 'x':
1395
- case 'y':
1396
- case 'z': goto yy107;
1397
- default: goto yy96;
1398
- }
1399
- yy107: ++YYCURSOR;
1400
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1401
- yych = *YYCURSOR;
1402
- goto yy108;
1403
- yy108: switch(yych){
1404
- case '.':
1405
- case '/':
1406
- case '0':
1407
- case '1':
1408
- case '2':
1409
- case '3':
1410
- case '4':
1411
- case '5':
1412
- case '6':
1413
- case '7':
1414
- case '8':
1415
- case '9':
1416
- case ':':
1417
- case ';':
1418
- case '<':
1419
- case '=':
1420
- case '>':
1421
- case '?':
1422
- case '@':
1423
- case 'A':
1424
- case 'B':
1425
- case 'C':
1426
- case 'D':
1427
- case 'E':
1428
- case 'F':
1429
- case 'G':
1430
- case 'H':
1431
- case 'I':
1432
- case 'J':
1433
- case 'K':
1434
- case 'L':
1435
- case 'M':
1436
- case 'N':
1437
- case 'O':
1438
- case 'P':
1439
- case 'Q':
1440
- case 'R':
1441
- case 'S':
1442
- case 'T':
1443
- case 'U':
1444
- case 'V':
1445
- case 'W':
1446
- case 'X':
1447
- case 'Y':
1448
- case 'Z':
1449
- case '[':
1450
- case '\\':
1451
- case ']':
1452
- case '^':
1453
- case '_': case 'a':
1454
- case 'b':
1455
- case 'c':
1456
- case 'd':
1457
- case 'e':
1458
- case 'f':
1459
- case 'g':
1460
- case 'h':
1461
- case 'i':
1462
- case 'j':
1463
- case 'k':
1464
- case 'l':
1465
- case 'm':
1466
- case 'n':
1467
- case 'o':
1468
- case 'p':
1469
- case 'q':
1470
- case 'r':
1471
- case 's':
1472
- case 't':
1473
- case 'u':
1474
- case 'v':
1475
- case 'w':
1476
- case 'x':
1477
- case 'y':
1478
- case 'z': goto yy107;
1479
- default: goto yy109;
1480
- }
1481
- yy109:
1482
- #line 510 "token.re"
1483
- { goto Directive; }
1484
- #line 1484 "<stdout>"
1485
- }
1486
- #line 517 "token.re"
1487
-
1488
-
1489
- }
1490
-
1491
- Plain:
1492
- {
1493
- int qidx = 0;
1494
- int qcapa = 100;
1495
- char *qstr = S_ALLOC_N( char, qcapa );
1496
- SyckLevel *plvl;
1497
- int parentIndent;
1498
-
1499
- YYCURSOR = YYTOKEN;
1500
- plvl = CURRENT_LEVEL();
1501
- GET_TRUE_YAML_INDENT(parentIndent);
1502
-
1503
- Plain2:
1504
- YYTOKEN = YYCURSOR;
1505
-
1506
- Plain3:
1507
-
1508
-
1509
- #line 1509 "<stdout>"
1510
- {
1511
- YYCTYPE yych;
1512
- unsigned int yyaccept;
1513
- goto yy110;
1514
- ++YYCURSOR;
1515
- yy110:
1516
- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
1517
- yych = *YYCURSOR;
1518
- switch(yych){
1519
- case 0x00: goto yy124;
1520
- case 0x09: goto yy126;
1521
- case 0x0A: goto yy112;
1522
- case 0x0D: goto yy114;
1523
- case ' ': goto yy122;
1524
- case ',': goto yy117;
1525
- case ':': goto yy116;
1526
- case ']': goto yy120;
1527
- case '}': goto yy118;
1528
- default: goto yy127;
1529
- }
1530
- yy112: yyaccept = 0;
1531
- yych = *(YYMARKER = ++YYCURSOR);
1532
- goto yy142;
1533
- yy113:
1534
- #line 540 "token.re"
1535
- { int indt_len, nl_count = 0;
1536
- SyckLevel *lvl;
1537
- char *tok = YYTOKEN;
1538
- GOBBLE_UP_YAML_INDENT( indt_len, tok );
1539
- lvl = CURRENT_LEVEL();
1540
-
1541
- if ( indt_len <= parentIndent )
1542
- {
1543
- RETURN_IMPLICIT();
1544
- }
1545
-
1546
- while ( YYTOKEN < YYCURSOR )
1547
- {
1548
- int nl_len = newline_len( YYTOKEN++ );
1549
- if ( nl_len )
1550
- {
1551
- nl_count++;
1552
- YYTOKEN += nl_len - 1;
1553
- }
1554
- }
1555
- if ( nl_count <= 1 )
1556
- {
1557
- QUOTECAT(qstr, qcapa, qidx, ' ');
1558
- }
1559
- else
1560
- {
1561
- int i;
1562
- for ( i = 0; i < nl_count - 1; i++ )
1563
- {
1564
- QUOTECAT(qstr, qcapa, qidx, '\n');
1565
- }
1566
- }
1567
-
1568
- goto Plain2;
1569
- }
1570
- #line 1570 "<stdout>"
1571
- yy114: ++YYCURSOR;
1572
- switch((yych = *YYCURSOR)) {
1573
- case 0x0A: goto yy141;
1574
- default: goto yy115;
1575
- }
1576
- yy115:
1577
- #line 627 "token.re"
1578
- { QUOTECATS(qstr, qcapa, qidx, YYTOKEN, YYCURSOR - YYTOKEN);
1579
- goto Plain2;
1580
- }
1581
- #line 1581 "<stdout>"
1582
- yy116: yyaccept = 1;
1583
- yych = *(YYMARKER = ++YYCURSOR);
1584
- switch(yych){
1585
- case 0x0A: goto yy136;
1586
- case 0x0D: goto yy140;
1587
- case ' ': goto yy138;
1588
- default: goto yy115;
1589
- }
1590
- yy117: yyaccept = 1;
1591
- yych = *(YYMARKER = ++YYCURSOR);
1592
- switch(yych){
1593
- case 0x0A: goto yy130;
1594
- case 0x0D: goto yy134;
1595
- case ' ': goto yy132;
1596
- default: goto yy115;
1597
- }
1598
- yy118: ++YYCURSOR;
1599
- goto yy119;
1600
- yy119:
1601
- #line 589 "token.re"
1602
- { if ( plvl->status != syck_lvl_imap )
1603
- {
1604
- PLAIN_NOT_INL();
1605
- }
1606
- else
1607
- {
1608
- PLAIN_IS_INL();
1609
- }
1610
- RETURN_IMPLICIT();
1611
- }
1612
- #line 1612 "<stdout>"
1613
- yy120: ++YYCURSOR;
1614
- goto yy121;
1615
- yy121:
1616
- #line 600 "token.re"
1617
- { if ( plvl->status != syck_lvl_iseq )
1618
- {
1619
- PLAIN_NOT_INL();
1620
- }
1621
- else
1622
- {
1623
- PLAIN_IS_INL();
1624
- }
1625
- RETURN_IMPLICIT();
1626
- }
1627
- #line 1627 "<stdout>"
1628
- yy122: ++YYCURSOR;
1629
- switch((yych = *YYCURSOR)) {
1630
- case '#': goto yy128;
1631
- default: goto yy123;
1632
- }
1633
- yy123:
1634
- #line 617 "token.re"
1635
- { if ( qidx == 0 )
1636
- {
1637
- goto Plain2;
1638
- }
1639
- else
1640
- {
1641
- goto Plain3;
1642
- }
1643
- }
1644
- #line 1644 "<stdout>"
1645
- yy124: ++YYCURSOR;
1646
- goto yy125;
1647
- yy125:
1648
- #line 615 "token.re"
1649
- { RETURN_IMPLICIT(); }
1650
- #line 1650 "<stdout>"
1651
- yy126: yych = *++YYCURSOR;
1652
- goto yy123;
1653
- yy127: yych = *++YYCURSOR;
1654
- goto yy115;
1655
- yy128: ++YYCURSOR;
1656
- goto yy129;
1657
- yy129:
1658
- #line 611 "token.re"
1659
- { eat_comments( parser );
1660
- RETURN_IMPLICIT();
1661
- }
1662
- #line 1662 "<stdout>"
1663
- yy130: ++YYCURSOR;
1664
- goto yy131;
1665
- yy131:
1666
- #line 578 "token.re"
1667
- { if ( plvl->status != syck_lvl_iseq && plvl->status != syck_lvl_imap )
1668
- {
1669
- PLAIN_NOT_INL();
1670
- }
1671
- else
1672
- {
1673
- PLAIN_IS_INL();
1674
- }
1675
- RETURN_IMPLICIT();
1676
- }
1677
- #line 1677 "<stdout>"
1678
- yy132: ++YYCURSOR;
1679
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1680
- yych = *YYCURSOR;
1681
- goto yy133;
1682
- yy133: switch(yych){
1683
- case ' ': goto yy132;
1684
- default: goto yy131;
1685
- }
1686
- yy134: yych = *++YYCURSOR;
1687
- switch(yych){
1688
- case 0x0A: goto yy130;
1689
- default: goto yy135;
1690
- }
1691
- yy135: YYCURSOR = YYMARKER;
1692
- switch(yyaccept){
1693
- case 0: goto yy113;
1694
- case 1: goto yy115;
1695
- }
1696
- yy136: ++YYCURSOR;
1697
- goto yy137;
1698
- yy137:
1699
- #line 576 "token.re"
1700
- { RETURN_IMPLICIT(); }
1701
- #line 1701 "<stdout>"
1702
- yy138: ++YYCURSOR;
1703
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1704
- yych = *YYCURSOR;
1705
- goto yy139;
1706
- yy139: switch(yych){
1707
- case ' ': goto yy138;
1708
- default: goto yy137;
1709
- }
1710
- yy140: yych = *++YYCURSOR;
1711
- switch(yych){
1712
- case 0x0A: goto yy136;
1713
- default: goto yy135;
1714
- }
1715
- yy141: yyaccept = 0;
1716
- YYMARKER = ++YYCURSOR;
1717
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1718
- yych = *YYCURSOR;
1719
- goto yy142;
1720
- yy142: switch(yych){
1721
- case 0x0A: case ' ': goto yy141;
1722
- case 0x0D: goto yy143;
1723
- default: goto yy113;
1724
- }
1725
- yy143: ++YYCURSOR;
1726
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1727
- yych = *YYCURSOR;
1728
- switch(yych){
1729
- case 0x0A: goto yy141;
1730
- default: goto yy135;
1731
- }
1732
- }
1733
- #line 631 "token.re"
1734
-
1735
- }
1736
-
1737
- SingleQuote:
1738
- {
1739
- int qidx = 0;
1740
- int qcapa = 100;
1741
- char *qstr = S_ALLOC_N( char, qcapa );
1742
-
1743
- SingleQuote2:
1744
- YYTOKEN = YYCURSOR;
1745
-
1746
-
1747
- #line 1747 "<stdout>"
1748
- {
1749
- YYCTYPE yych;
1750
- unsigned int yyaccept;
1751
- goto yy144;
1752
- ++YYCURSOR;
1753
- yy144:
1754
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
1755
- yych = *YYCURSOR;
1756
- switch(yych){
1757
- case 0x00: goto yy152;
1758
- case 0x0A: goto yy146;
1759
- case 0x0D: goto yy148;
1760
- case '\'': goto yy150;
1761
- default: goto yy153;
1762
- }
1763
- yy146: yyaccept = 0;
1764
- yych = *(YYMARKER = ++YYCURSOR);
1765
- goto yy157;
1766
- yy147:
1767
- #line 645 "token.re"
1768
- { int indt_len;
1769
- int nl_count = 0;
1770
- SyckLevel *lvl;
1771
- GOBBLE_UP_YAML_INDENT( indt_len, YYTOKEN );
1772
- lvl = CURRENT_LEVEL();
1773
-
1774
- if ( lvl->status != syck_lvl_str )
1775
- {
1776
- ADD_LEVEL( indt_len, syck_lvl_str );
1777
- }
1778
- else if ( indt_len < lvl->spaces )
1779
- {
1780
- /* Error! */
1781
- }
1782
-
1783
- while ( YYTOKEN < YYCURSOR )
1784
- {
1785
- int nl_len = newline_len( YYTOKEN++ );
1786
- if ( nl_len )
1787
- {
1788
- nl_count++;
1789
- YYTOKEN += nl_len - 1;
1790
- }
1791
- }
1792
- if ( nl_count <= 1 )
1793
- {
1794
- QUOTECAT(qstr, qcapa, qidx, ' ');
1795
- }
1796
- else
1797
- {
1798
- int i;
1799
- for ( i = 0; i < nl_count - 1; i++ )
1800
- {
1801
- QUOTECAT(qstr, qcapa, qidx, '\n');
1802
- }
1803
- }
1804
-
1805
- goto SingleQuote2;
1806
- }
1807
- #line 1807 "<stdout>"
1808
- yy148: ++YYCURSOR;
1809
- switch((yych = *YYCURSOR)) {
1810
- case 0x0A: goto yy156;
1811
- default: goto yy149;
1812
- }
1813
- yy149:
1814
- #line 712 "token.re"
1815
- { QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
1816
- goto SingleQuote2;
1817
- }
1818
- #line 1818 "<stdout>"
1819
- yy150: ++YYCURSOR;
1820
- switch((yych = *YYCURSOR)) {
1821
- case '\'': goto yy154;
1822
- default: goto yy151;
1823
- }
1824
- yy151:
1825
- #line 689 "token.re"
1826
- { SyckLevel *lvl;
1827
- SyckNode *n = syck_alloc_str();
1828
- lvl = CURRENT_LEVEL();
1829
-
1830
- if ( lvl->status == syck_lvl_str )
1831
- {
1832
- POP_LEVEL();
1833
- }
1834
- if ( ((SyckParser *)parser)->taguri_expansion == 1 )
1835
- {
1836
- n->type_id = syck_taguri( YAML_DOMAIN, "str", 3 );
1837
- }
1838
- else
1839
- {
1840
- n->type_id = syck_strndup( "str", 3 );
1841
- }
1842
- n->data.str->ptr = qstr;
1843
- n->data.str->len = qidx;
1844
- n->data.str->style = scalar_1quote;
1845
- sycklval->nodeData = n;
1846
- return YAML_PLAIN;
1847
- }
1848
- #line 1848 "<stdout>"
1849
- yy152: yych = *++YYCURSOR;
1850
- goto yy151;
1851
- yy153: yych = *++YYCURSOR;
1852
- goto yy149;
1853
- yy154: ++YYCURSOR;
1854
- goto yy155;
1855
- yy155:
1856
- #line 685 "token.re"
1857
- { QUOTECAT(qstr, qcapa, qidx, '\'');
1858
- goto SingleQuote2;
1859
- }
1860
- #line 1860 "<stdout>"
1861
- yy156: yyaccept = 0;
1862
- YYMARKER = ++YYCURSOR;
1863
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1864
- yych = *YYCURSOR;
1865
- goto yy157;
1866
- yy157: switch(yych){
1867
- case 0x0A: case ' ': goto yy156;
1868
- case 0x0D: goto yy158;
1869
- default: goto yy147;
1870
- }
1871
- yy158: ++YYCURSOR;
1872
- if(YYLIMIT == YYCURSOR) YYFILL(1);
1873
- yych = *YYCURSOR;
1874
- switch(yych){
1875
- case 0x0A: goto yy156;
1876
- default: goto yy159;
1877
- }
1878
- yy159: YYCURSOR = YYMARKER;
1879
- switch(yyaccept){
1880
- case 0: goto yy147;
1881
- }
1882
- }
1883
- #line 716 "token.re"
1884
-
1885
-
1886
- }
1887
-
1888
-
1889
- DoubleQuote:
1890
- {
1891
- int keep_nl = 1;
1892
- int qidx = 0;
1893
- int qcapa = 100;
1894
- char *qstr = S_ALLOC_N( char, qcapa );
1895
-
1896
- DoubleQuote2:
1897
- YYTOKEN = YYCURSOR;
1898
-
1899
-
1900
-
1901
- #line 1901 "<stdout>"
1902
- {
1903
- YYCTYPE yych;
1904
- unsigned int yyaccept;
1905
- goto yy160;
1906
- ++YYCURSOR;
1907
- yy160:
1908
- if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
1909
- yych = *YYCURSOR;
1910
- switch(yych){
1911
- case 0x00: goto yy167;
1912
- case 0x0A: goto yy162;
1913
- case 0x0D: goto yy164;
1914
- case '"': goto yy169;
1915
- case '\\': goto yy166;
1916
- default: goto yy170;
1917
- }
1918
- yy162: yyaccept = 0;
1919
- yych = *(YYMARKER = ++YYCURSOR);
1920
- goto yy184;
1921
- yy163:
1922
- #line 734 "token.re"
1923
- { int indt_len;
1924
- int nl_count = 0;
1925
- SyckLevel *lvl;
1926
- GOBBLE_UP_YAML_INDENT( indt_len, YYTOKEN );
1927
- lvl = CURRENT_LEVEL();
1928
-
1929
- if ( lvl->status != syck_lvl_str )
1930
- {
1931
- ADD_LEVEL( indt_len, syck_lvl_str );
1932
- }
1933
- else if ( indt_len < lvl->spaces )
1934
- {
1935
- /* FIXME */
1936
- }
1937
-
1938
- if ( keep_nl == 1 )
1939
- {
1940
- while ( YYTOKEN < YYCURSOR )
1941
- {
1942
- int nl_len = newline_len( YYTOKEN++ );
1943
- if ( nl_len )
1944
- {
1945
- nl_count++;
1946
- YYTOKEN += nl_len - 1;
1947
- }
1948
- }
1949
- if ( nl_count <= 1 )
1950
- {
1951
- QUOTECAT(qstr, qcapa, qidx, ' ');
1952
- }
1953
- else
1954
- {
1955
- int i;
1956
- for ( i = 0; i < nl_count - 1; i++ )
1957
- {
1958
- QUOTECAT(qstr, qcapa, qidx, '\n');
1959
- }
1960
- }
1961
- }
1962
-
1963
- keep_nl = 1;
1964
- goto DoubleQuote2;
1965
- }
1966
- #line 1966 "<stdout>"
1967
- yy164: ++YYCURSOR;
1968
- switch((yych = *YYCURSOR)) {
1969
- case 0x0A: goto yy183;
1970
- default: goto yy165;
1971
- }
1972
- yy165:
1973
- #line 820 "token.re"
1974
- { QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
1975
- goto DoubleQuote2;
1976
- }
1977
- #line 1977 "<stdout>"
1978
- yy166: yyaccept = 1;
1979
- yych = *(YYMARKER = ++YYCURSOR);
1980
- switch(yych){
1981
- case 0x0A: goto yy174;
1982
- case 0x0D: goto yy176;
1983
- case ' ': goto yy171;
1984
- case '"': case '0': case '\\': case 'a':
1985
- case 'b': case 'e':
1986
- case 'f': case 'n': case 'r': case 't': case 'v': goto yy178;
1987
- case 'x': goto yy177;
1988
- default: goto yy165;
1989
- }
1990
- yy167: ++YYCURSOR;
1991
- goto yy168;
1992
- yy168:
1993
- #line 797 "token.re"
1994
- { SyckLevel *lvl;
1995
- SyckNode *n = syck_alloc_str();
1996
- lvl = CURRENT_LEVEL();
1997
-
1998
- if ( lvl->status == syck_lvl_str )
1999
- {
2000
- POP_LEVEL();
2001
- }
2002
- if ( ((SyckParser *)parser)->taguri_expansion == 1 )
2003
- {
2004
- n->type_id = syck_taguri( YAML_DOMAIN, "str", 3 );
2005
- }
2006
- else
2007
- {
2008
- n->type_id = syck_strndup( "str", 3 );
2009
- }
2010
- n->data.str->ptr = qstr;
2011
- n->data.str->len = qidx;
2012
- n->data.str->style = scalar_2quote;
2013
- sycklval->nodeData = n;
2014
- return YAML_PLAIN;
2015
- }
2016
- #line 2016 "<stdout>"
2017
- yy169: yych = *++YYCURSOR;
2018
- goto yy168;
2019
- yy170: yych = *++YYCURSOR;
2020
- goto yy165;
2021
- yy171: ++YYCURSOR;
2022
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
2023
- yych = *YYCURSOR;
2024
- goto yy172;
2025
- yy172: switch(yych){
2026
- case 0x0A: goto yy174;
2027
- case 0x0D: goto yy176;
2028
- case ' ': goto yy171;
2029
- default: goto yy173;
2030
- }
2031
- yy173: YYCURSOR = YYMARKER;
2032
- switch(yyaccept){
2033
- case 0: goto yy163;
2034
- case 1: goto yy165;
2035
- }
2036
- yy174: ++YYCURSOR;
2037
- goto yy175;
2038
- yy175:
2039
- #line 792 "token.re"
2040
- { keep_nl = 0;
2041
- YYCURSOR--;
2042
- goto DoubleQuote2;
2043
- }
2044
- #line 2044 "<stdout>"
2045
- yy176: yych = *++YYCURSOR;
2046
- switch(yych){
2047
- case 0x0A: goto yy174;
2048
- default: goto yy173;
2049
- }
2050
- yy177: yych = *++YYCURSOR;
2051
- switch(yych){
2052
- case '0':
2053
- case '1':
2054
- case '2':
2055
- case '3':
2056
- case '4':
2057
- case '5':
2058
- case '6':
2059
- case '7':
2060
- case '8':
2061
- case '9': case 'A':
2062
- case 'B':
2063
- case 'C':
2064
- case 'D':
2065
- case 'E':
2066
- case 'F': case 'a':
2067
- case 'b':
2068
- case 'c':
2069
- case 'd':
2070
- case 'e':
2071
- case 'f': goto yy180;
2072
- default: goto yy173;
2073
- }
2074
- yy178: ++YYCURSOR;
2075
- goto yy179;
2076
- yy179:
2077
- #line 778 "token.re"
2078
- { char ch = *( YYCURSOR - 1 );
2079
- QUOTECAT(qstr, qcapa, qidx, escape_seq( ch ));
2080
- goto DoubleQuote2;
2081
- }
2082
- #line 2082 "<stdout>"
2083
- yy180: yych = *++YYCURSOR;
2084
- switch(yych){
2085
- case '0':
2086
- case '1':
2087
- case '2':
2088
- case '3':
2089
- case '4':
2090
- case '5':
2091
- case '6':
2092
- case '7':
2093
- case '8':
2094
- case '9': case 'A':
2095
- case 'B':
2096
- case 'C':
2097
- case 'D':
2098
- case 'E':
2099
- case 'F': case 'a':
2100
- case 'b':
2101
- case 'c':
2102
- case 'd':
2103
- case 'e':
2104
- case 'f': goto yy181;
2105
- default: goto yy173;
2106
- }
2107
- yy181: ++YYCURSOR;
2108
- goto yy182;
2109
- yy182:
2110
- #line 783 "token.re"
2111
- { long ch;
2112
- char *chr_text = syck_strndup( YYTOKEN, 4 );
2113
- chr_text[0] = '0';
2114
- ch = strtol( chr_text, NULL, 16 );
2115
- free( chr_text );
2116
- QUOTECAT(qstr, qcapa, qidx, ch);
2117
- goto DoubleQuote2;
2118
- }
2119
- #line 2119 "<stdout>"
2120
- yy183: yyaccept = 0;
2121
- YYMARKER = ++YYCURSOR;
2122
- if(YYLIMIT == YYCURSOR) YYFILL(1);
2123
- yych = *YYCURSOR;
2124
- goto yy184;
2125
- yy184: switch(yych){
2126
- case 0x0A: case ' ': goto yy183;
2127
- case 0x0D: goto yy185;
2128
- default: goto yy163;
2129
- }
2130
- yy185: ++YYCURSOR;
2131
- if(YYLIMIT == YYCURSOR) YYFILL(1);
2132
- yych = *YYCURSOR;
2133
- switch(yych){
2134
- case 0x0A: goto yy183;
2135
- default: goto yy173;
2136
- }
2137
- }
2138
- #line 824 "token.re"
2139
-
2140
- }
2141
-
2142
- TransferMethod:
2143
- {
2144
- int qidx = 0;
2145
- int qcapa = 100;
2146
- char *qstr = S_ALLOC_N( char, qcapa );
2147
-
2148
- TransferMethod2:
2149
- YYTOKTMP = YYCURSOR;
2150
-
2151
-
2152
- #line 2152 "<stdout>"
2153
- {
2154
- YYCTYPE yych;
2155
- unsigned int yyaccept;
2156
- goto yy186;
2157
- ++YYCURSOR;
2158
- yy186:
2159
- if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
2160
- yych = *YYCURSOR;
2161
- switch(yych){
2162
- case 0x00: goto yy188;
2163
- case 0x0A: goto yy190;
2164
- case 0x0D: goto yy192;
2165
- case ' ': goto yy191;
2166
- case '\\': goto yy194;
2167
- default: goto yy195;
2168
- }
2169
- yy188: ++YYCURSOR;
2170
- goto yy189;
2171
- yy189:
2172
- #line 838 "token.re"
2173
- { SyckLevel *lvl;
2174
- YYCURSOR = YYTOKTMP;
2175
- if ( YYCURSOR == YYTOKEN + 1 )
2176
- {
2177
- free( qstr );
2178
- return YAML_ITRANSFER;
2179
- }
2180
-
2181
- lvl = CURRENT_LEVEL();
2182
-
2183
- /*
2184
- * URL Prefixing
2185
- */
2186
- if ( *qstr == '^' )
2187
- {
2188
- sycklval->name = S_ALLOC_N( char, qidx + strlen( lvl->domain ) );
2189
- sycklval->name[0] = '\0';
2190
- strcat( sycklval->name, lvl->domain );
2191
- strncat( sycklval->name, qstr + 1, qidx - 1 );
2192
- free( qstr );
2193
- }
2194
- else
2195
- {
2196
- char *carat = qstr;
2197
- char *qend = qstr + qidx;
2198
- while ( (++carat) < qend )
2199
- {
2200
- if ( *carat == '^' )
2201
- break;
2202
- }
2203
-
2204
- if ( carat < qend )
2205
- {
2206
- free( lvl->domain );
2207
- lvl->domain = syck_strndup( qstr, carat - qstr );
2208
- sycklval->name = S_ALLOC_N( char, ( qend - carat ) + strlen( lvl->domain ) );
2209
- sycklval->name[0] = '\0';
2210
- strcat( sycklval->name, lvl->domain );
2211
- strncat( sycklval->name, carat + 1, ( qend - carat ) - 1 );
2212
- free( qstr );
2213
- }
2214
- else
2215
- {
2216
- sycklval->name = qstr;
2217
- }
2218
- }
2219
-
2220
- return YAML_TRANSFER;
2221
- }
2222
- #line 2222 "<stdout>"
2223
- yy190: yych = *++YYCURSOR;
2224
- goto yy189;
2225
- yy191: yych = *++YYCURSOR;
2226
- goto yy204;
2227
- yy192: ++YYCURSOR;
2228
- switch((yych = *YYCURSOR)) {
2229
- case 0x0A: goto yy188;
2230
- default: goto yy193;
2231
- }
2232
- yy193:
2233
- #line 905 "token.re"
2234
- { QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
2235
- goto TransferMethod2;
2236
- }
2237
- #line 2237 "<stdout>"
2238
- yy194: yyaccept = 0;
2239
- yych = *(YYMARKER = ++YYCURSOR);
2240
- switch(yych){
2241
- case '"': case '0': case '\\': case 'a':
2242
- case 'b': case 'e':
2243
- case 'f': case 'n': case 'r': case 't': case 'v': goto yy198;
2244
- case 'x': goto yy196;
2245
- default: goto yy193;
2246
- }
2247
- yy195: yych = *++YYCURSOR;
2248
- goto yy193;
2249
- yy196: yych = *++YYCURSOR;
2250
- switch(yych){
2251
- case '0':
2252
- case '1':
2253
- case '2':
2254
- case '3':
2255
- case '4':
2256
- case '5':
2257
- case '6':
2258
- case '7':
2259
- case '8':
2260
- case '9': case 'A':
2261
- case 'B':
2262
- case 'C':
2263
- case 'D':
2264
- case 'E':
2265
- case 'F': case 'a':
2266
- case 'b':
2267
- case 'c':
2268
- case 'd':
2269
- case 'e':
2270
- case 'f': goto yy200;
2271
- default: goto yy197;
2272
- }
2273
- yy197: YYCURSOR = YYMARKER;
2274
- switch(yyaccept){
2275
- case 0: goto yy193;
2276
- }
2277
- yy198: ++YYCURSOR;
2278
- goto yy199;
2279
- yy199:
2280
- #line 891 "token.re"
2281
- { char ch = *( YYCURSOR - 1 );
2282
- QUOTECAT(qstr, qcapa, qidx, escape_seq( ch ));
2283
- goto TransferMethod2;
2284
- }
2285
- #line 2285 "<stdout>"
2286
- yy200: yych = *++YYCURSOR;
2287
- switch(yych){
2288
- case '0':
2289
- case '1':
2290
- case '2':
2291
- case '3':
2292
- case '4':
2293
- case '5':
2294
- case '6':
2295
- case '7':
2296
- case '8':
2297
- case '9': case 'A':
2298
- case 'B':
2299
- case 'C':
2300
- case 'D':
2301
- case 'E':
2302
- case 'F': case 'a':
2303
- case 'b':
2304
- case 'c':
2305
- case 'd':
2306
- case 'e':
2307
- case 'f': goto yy201;
2308
- default: goto yy197;
2309
- }
2310
- yy201: ++YYCURSOR;
2311
- goto yy202;
2312
- yy202:
2313
- #line 896 "token.re"
2314
- { long ch;
2315
- char *chr_text = syck_strndup( YYTOKTMP, 4 );
2316
- chr_text[0] = '0';
2317
- ch = strtol( chr_text, NULL, 16 );
2318
- free( chr_text );
2319
- QUOTECAT(qstr, qcapa, qidx, ch);
2320
- goto TransferMethod2;
2321
- }
2322
- #line 2322 "<stdout>"
2323
- yy203: ++YYCURSOR;
2324
- if(YYLIMIT == YYCURSOR) YYFILL(1);
2325
- yych = *YYCURSOR;
2326
- goto yy204;
2327
- yy204: switch(yych){
2328
- case ' ': goto yy203;
2329
- default: goto yy189;
2330
- }
2331
- }
2332
- #line 910 "token.re"
2333
-
2334
- }
2335
-
2336
- ScalarBlock:
2337
- {
2338
- int qidx = 0;
2339
- int qcapa = 100;
2340
- char *qstr = S_ALLOC_N( char, qcapa );
2341
- int blockType = 0;
2342
- int nlDoWhat = 0;
2343
- int lastIndent = 0;
2344
- int forceIndent = -1;
2345
- char *yyt = YYTOKEN;
2346
- SyckLevel *lvl = CURRENT_LEVEL();
2347
- int parentIndent = -1;
2348
-
2349
- switch ( *yyt )
2350
- {
2351
- case '|': blockType = BLOCK_LIT; break;
2352
- case '>': blockType = BLOCK_FOLD; break;
2353
- }
2354
-
2355
- while ( ++yyt <= YYCURSOR )
2356
- {
2357
- if ( *yyt == '-' )
2358
- {
2359
- nlDoWhat = NL_CHOMP;
2360
- }
2361
- else if ( *yyt == '+' )
2362
- {
2363
- nlDoWhat = NL_KEEP;
2364
- }
2365
- else if ( isdigit( *yyt ) )
2366
- {
2367
- forceIndent = strtol( yyt, NULL, 10 );
2368
- }
2369
- }
2370
-
2371
- qstr[0] = '\0';
2372
- YYTOKEN = YYCURSOR;
2373
-
2374
- ScalarBlock2:
2375
- YYTOKEN = YYCURSOR;
2376
-
2377
-
2378
- #line 2378 "<stdout>"
2379
- {
2380
- YYCTYPE yych;
2381
- unsigned int yyaccept;
2382
- goto yy205;
2383
- ++YYCURSOR;
2384
- yy205:
2385
- if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
2386
- yych = *YYCURSOR;
2387
- switch(yych){
2388
- case 0x00: goto yy213;
2389
- case 0x0A: goto yy207;
2390
- case 0x0D: goto yy209;
2391
- case '#': goto yy211;
2392
- case '-': goto yy215;
2393
- default: goto yy216;
2394
- }
2395
- yy207: yyaccept = 0;
2396
- yych = *(YYMARKER = ++YYCURSOR);
2397
- goto yy226;
2398
- yy208:
2399
- #line 956 "token.re"
2400
- { char *pacer;
2401
- char *tok = YYTOKEN;
2402
- int indt_len = 0, nl_count = 0, fold_nl = 0, nl_begin = 0;
2403
- GOBBLE_UP_YAML_INDENT( indt_len, tok );
2404
- lvl = CURRENT_LEVEL();
2405
-
2406
- if ( lvl->status != syck_lvl_block )
2407
- {
2408
- GET_TRUE_YAML_INDENT(parentIndent);
2409
- if ( forceIndent > 0 ) forceIndent += parentIndent;
2410
- if ( indt_len > parentIndent )
2411
- {
2412
- int new_spaces = forceIndent > 0 ? forceIndent : indt_len;
2413
- ADD_LEVEL( new_spaces, syck_lvl_block );
2414
- lastIndent = indt_len - new_spaces;
2415
- nl_begin = 1;
2416
- lvl = CURRENT_LEVEL();
2417
- }
2418
- else
2419
- {
2420
- YYCURSOR = YYTOKEN;
2421
- RETURN_YAML_BLOCK();
2422
- }
2423
- }
2424
-
2425
- /*
2426
- * Fold only in the event of two lines being on the leftmost
2427
- * indentation.
2428
- */
2429
- if ( blockType == BLOCK_FOLD && lastIndent == 0 && ( indt_len - lvl->spaces ) == 0 )
2430
- {
2431
- fold_nl = 1;
2432
- }
2433
-
2434
- pacer = YYTOKEN;
2435
- while ( pacer < YYCURSOR )
2436
- {
2437
- int nl_len = newline_len( pacer++ );
2438
- if ( nl_len )
2439
- {
2440
- nl_count++;
2441
- pacer += nl_len - 1;
2442
- }
2443
- }
2444
-
2445
- if ( fold_nl == 1 || nl_begin == 1 )
2446
- {
2447
- nl_count--;
2448
- }
2449
-
2450
- if ( nl_count < 1 && nl_begin == 0 )
2451
- {
2452
- QUOTECAT(qstr, qcapa, qidx, ' ');
2453
- }
2454
- else
2455
- {
2456
- int i;
2457
- for ( i = 0; i < nl_count; i++ )
2458
- {
2459
- QUOTECAT(qstr, qcapa, qidx, '\n');
2460
- }
2461
- }
2462
-
2463
- lastIndent = indt_len - lvl->spaces;
2464
- YYCURSOR -= lastIndent;
2465
-
2466
- if ( indt_len < lvl->spaces )
2467
- {
2468
- POP_LEVEL();
2469
- YYCURSOR = YYTOKEN;
2470
- RETURN_YAML_BLOCK();
2471
- }
2472
- goto ScalarBlock2;
2473
- }
2474
- #line 2474 "<stdout>"
2475
- yy209: ++YYCURSOR;
2476
- switch((yych = *YYCURSOR)) {
2477
- case 0x0A: goto yy225;
2478
- default: goto yy210;
2479
- }
2480
- yy210:
2481
- #line 1070 "token.re"
2482
- { QUOTECAT(qstr, qcapa, qidx, *YYTOKEN);
2483
- goto ScalarBlock2;
2484
- }
2485
- #line 2485 "<stdout>"
2486
- yy211: ++YYCURSOR;
2487
- goto yy212;
2488
- yy212:
2489
- #line 1032 "token.re"
2490
- { lvl = CURRENT_LEVEL();
2491
- if ( lvl->status != syck_lvl_block )
2492
- {
2493
- eat_comments( parser );
2494
- YYTOKEN = YYCURSOR;
2495
- }
2496
- else
2497
- {
2498
- QUOTECAT(qstr, qcapa, qidx, *YYTOKEN);
2499
- }
2500
- goto ScalarBlock2;
2501
- }
2502
- #line 2502 "<stdout>"
2503
- yy213: ++YYCURSOR;
2504
- goto yy214;
2505
- yy214:
2506
- #line 1046 "token.re"
2507
- { YYCURSOR--;
2508
- POP_LEVEL();
2509
- RETURN_YAML_BLOCK();
2510
- }
2511
- #line 2511 "<stdout>"
2512
- yy215: yyaccept = 1;
2513
- yych = *(YYMARKER = ++YYCURSOR);
2514
- switch(yych){
2515
- case '-': goto yy217;
2516
- default: goto yy210;
2517
- }
2518
- yy216: yych = *++YYCURSOR;
2519
- goto yy210;
2520
- yy217: yych = *++YYCURSOR;
2521
- switch(yych){
2522
- case '-': goto yy219;
2523
- default: goto yy218;
2524
- }
2525
- yy218: YYCURSOR = YYMARKER;
2526
- switch(yyaccept){
2527
- case 0: goto yy208;
2528
- case 1: goto yy210;
2529
- }
2530
- yy219: yych = *++YYCURSOR;
2531
- switch(yych){
2532
- case 0x0A: goto yy220;
2533
- case 0x0D: goto yy224;
2534
- case ' ': goto yy222;
2535
- default: goto yy218;
2536
- }
2537
- yy220: ++YYCURSOR;
2538
- goto yy221;
2539
- yy221:
2540
- #line 1051 "token.re"
2541
- { if ( YYTOKEN == YYLINEPTR )
2542
- {
2543
- if ( blockType == BLOCK_FOLD && qidx > 0 )
2544
- {
2545
- qidx -= 1;
2546
- }
2547
- QUOTECAT(qstr, qcapa, qidx, '\n');
2548
- POP_LEVEL();
2549
- YYCURSOR = YYTOKEN;
2550
- RETURN_YAML_BLOCK();
2551
- }
2552
- else
2553
- {
2554
- QUOTECAT(qstr, qcapa, qidx, *YYTOKEN);
2555
- YYCURSOR = YYTOKEN + 1;
2556
- goto ScalarBlock2;
2557
- }
2558
- }
2559
- #line 2559 "<stdout>"
2560
- yy222: ++YYCURSOR;
2561
- if(YYLIMIT == YYCURSOR) YYFILL(1);
2562
- yych = *YYCURSOR;
2563
- goto yy223;
2564
- yy223: switch(yych){
2565
- case ' ': goto yy222;
2566
- default: goto yy221;
2567
- }
2568
- yy224: yych = *++YYCURSOR;
2569
- switch(yych){
2570
- case 0x0A: goto yy220;
2571
- default: goto yy218;
2572
- }
2573
- yy225: yyaccept = 0;
2574
- YYMARKER = ++YYCURSOR;
2575
- if(YYLIMIT == YYCURSOR) YYFILL(1);
2576
- yych = *YYCURSOR;
2577
- goto yy226;
2578
- yy226: switch(yych){
2579
- case 0x0A: case ' ': goto yy225;
2580
- case 0x0D: goto yy227;
2581
- default: goto yy208;
2582
- }
2583
- yy227: ++YYCURSOR;
2584
- if(YYLIMIT == YYCURSOR) YYFILL(1);
2585
- yych = *YYCURSOR;
2586
- switch(yych){
2587
- case 0x0A: goto yy225;
2588
- default: goto yy218;
2589
- }
2590
- }
2591
- #line 1075 "token.re"
2592
-
2593
- }
2594
-
2595
- return 0;
2596
-
2597
- }
2598
-
2599
- void
2600
- eat_comments( SyckParser *parser )
2601
- {
2602
- Comment:
2603
- {
2604
- YYTOKEN = YYCURSOR;
2605
-
2606
-
2607
- #line 2607 "<stdout>"
2608
- {
2609
- YYCTYPE yych;
2610
- unsigned int yyaccept;
2611
- goto yy228;
2612
- ++YYCURSOR;
2613
- yy228:
2614
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
2615
- yych = *YYCURSOR;
2616
- switch(yych){
2617
- case 0x00: goto yy230;
2618
- case 0x0A: goto yy232;
2619
- case 0x0D: goto yy233;
2620
- default: goto yy235;
2621
- }
2622
- yy230: ++YYCURSOR;
2623
- goto yy231;
2624
- yy231:
2625
- #line 1091 "token.re"
2626
- { YYCURSOR = YYTOKEN;
2627
- return;
2628
- }
2629
- #line 2629 "<stdout>"
2630
- yy232: yyaccept = 0;
2631
- yych = *(YYMARKER = ++YYCURSOR);
2632
- goto yy237;
2633
- yy233: ++YYCURSOR;
2634
- switch((yych = *YYCURSOR)) {
2635
- case 0x0A: goto yy236;
2636
- default: goto yy234;
2637
- }
2638
- yy234:
2639
- #line 1095 "token.re"
2640
- { goto Comment;
2641
- }
2642
- #line 2642 "<stdout>"
2643
- yy235: yych = *++YYCURSOR;
2644
- goto yy234;
2645
- yy236: yyaccept = 0;
2646
- YYMARKER = ++YYCURSOR;
2647
- if(YYLIMIT == YYCURSOR) YYFILL(1);
2648
- yych = *YYCURSOR;
2649
- goto yy237;
2650
- yy237: switch(yych){
2651
- case 0x0A: goto yy236;
2652
- case 0x0D: goto yy238;
2653
- default: goto yy231;
2654
- }
2655
- yy238: ++YYCURSOR;
2656
- if(YYLIMIT == YYCURSOR) YYFILL(1);
2657
- yych = *YYCURSOR;
2658
- switch(yych){
2659
- case 0x0A: goto yy236;
2660
- default: goto yy239;
2661
- }
2662
- yy239: YYCURSOR = YYMARKER;
2663
- switch(yyaccept){
2664
- case 0: goto yy231;
2665
- }
2666
- }
2667
- #line 1098 "token.re"
2668
-
2669
-
2670
- }
2671
-
2672
- }
2673
-
2674
- char
2675
- escape_seq( char ch )
2676
- {
2677
- switch ( ch )
2678
- {
2679
- case '0': return '\0';
2680
- case 'a': return 7;
2681
- case 'b': return '\010';
2682
- case 'e': return '\033';
2683
- case 'f': return '\014';
2684
- case 'n': return '\n';
2685
- case 'r': return '\015';
2686
- case 't': return '\t';
2687
- case 'v': return '\013';
2688
- default: return ch;
2689
- }
2690
- }
2691
-
2692
- int
2693
- is_newline( char *ptr )
2694
- {
2695
- return newline_len( ptr );
2696
- }
2697
-
2698
- int
2699
- newline_len( char *ptr )
2700
- {
2701
- if ( *ptr == '\n' )
2702
- return 1;
2703
-
2704
- if ( *ptr == '\r' && *( ptr + 1 ) == '\n' )
2705
- return 2;
2706
-
2707
- return 0;
2708
- }
2709
-
2710
- int
2711
- syckwrap()
2712
- {
2713
- return 1;
2714
- }
2715
-
2716
- void
2717
- syckerror( char *msg )
2718
- {
2719
- if ( syck_parser_ptr->error_handler == NULL )
2720
- syck_parser_ptr->error_handler = syck_default_error_handler;
2721
-
2722
- syck_parser_ptr->root = syck_parser_ptr->root_on_error;
2723
- (syck_parser_ptr->error_handler)(syck_parser_ptr, msg);
2724
- }
2725
-