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