2003-10-14 19:15:19 -04:00
|
|
|
/* Generated by re2c 0.5 on Mon Oct 13 18:40:21 2003 */
|
2003-05-09 17:25:50 -04:00
|
|
|
#line 1 "token.re"
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* token.re
|
|
|
|
*
|
|
|
|
* $Author$
|
|
|
|
* $Date$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2003 why the lucky stiff
|
|
|
|
*/
|
2003-05-09 17:25:50 -04:00
|
|
|
#include "syck.h"
|
2003-07-28 15:27:42 -04:00
|
|
|
#include "ruby.h"
|
2003-05-09 17:25:50 -04:00
|
|
|
#include "gram.h"
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* Allocate quoted strings in chunks
|
|
|
|
*/
|
2003-05-09 17:25:50 -04:00
|
|
|
#define QUOTELEN 1024
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* They do my bidding...
|
|
|
|
*/
|
2003-05-09 17:25:50 -04:00
|
|
|
#define YYCTYPE char
|
|
|
|
#define YYCURSOR parser->cursor
|
|
|
|
#define YYMARKER parser->marker
|
|
|
|
#define YYLIMIT parser->limit
|
|
|
|
#define YYTOKEN parser->token
|
|
|
|
#define YYTOKTMP parser->toktmp
|
|
|
|
#define YYLINEPTR parser->lineptr
|
2003-05-19 12:37:20 -04:00
|
|
|
#define YYLINECTPTR parser->linectptr
|
2003-05-09 17:25:50 -04:00
|
|
|
#define YYLINE parser->linect
|
|
|
|
#define YYFILL(n) syck_parser_read(parser)
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* Repositions the cursor at `n' offset from the token start.
|
|
|
|
* Only works in `Header' and `Document' sections.
|
|
|
|
*/
|
2003-05-09 17:25:50 -04:00
|
|
|
#define YYPOS(n) YYCURSOR = YYTOKEN + n
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* Track line numbers
|
|
|
|
*/
|
2003-05-19 12:37:20 -04:00
|
|
|
#define NEWLINE(ptr) YYLINEPTR = ptr + 1; if ( YYLINEPTR > YYLINECTPTR ) { YYLINE++; YYLINECTPTR = YYLINEPTR; }
|
2003-05-09 17:25:50 -04:00
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* I like seeing the level operations as macros...
|
|
|
|
*/
|
2003-05-09 17:25:50 -04:00
|
|
|
#define ADD_LEVEL(len, status) syck_parser_add_level( parser, len, status )
|
|
|
|
#define POP_LEVEL() syck_parser_pop_level( parser )
|
|
|
|
#define CURRENT_LEVEL() syck_parser_current_level( parser )
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
2003-07-28 15:27:42 -04:00
|
|
|
* Force a token next time around sycklex()
|
2003-05-13 02:34:18 -04:00
|
|
|
*/
|
2003-05-09 17:25:50 -04:00
|
|
|
#define FORCE_NEXT_TOKEN(tok) parser->force_token = tok;
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
2003-07-28 23:27:01 -04:00
|
|
|
* Nice little macro to ensure we're YAML_IOPENed to the current level.
|
2003-05-13 02:34:18 -04:00
|
|
|
* * Only use this macro in the "Document" section *
|
|
|
|
*/
|
2003-07-28 23:27:01 -04:00
|
|
|
#define ENSURE_YAML_IOPEN(last_lvl, to_len, reset) \
|
2003-05-09 17:25:50 -04:00
|
|
|
if ( last_lvl->spaces < to_len ) \
|
|
|
|
{ \
|
|
|
|
if ( last_lvl->status == syck_lvl_inline ) \
|
|
|
|
{ \
|
|
|
|
goto Document; \
|
|
|
|
} \
|
|
|
|
else \
|
|
|
|
{ \
|
|
|
|
ADD_LEVEL( to_len, syck_lvl_doc ); \
|
|
|
|
if ( reset == 1 ) YYPOS(0); \
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_IOPEN; \
|
2003-05-09 17:25:50 -04:00
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* Nice little macro to ensure closure of levels.
|
|
|
|
* * Only use this macro in the "Document" section *
|
|
|
|
*/
|
2003-07-28 23:27:01 -04:00
|
|
|
#define ENSURE_YAML_IEND(last_lvl, to_len) \
|
2003-05-09 17:25:50 -04:00
|
|
|
if ( last_lvl->spaces > to_len ) \
|
|
|
|
{ \
|
|
|
|
syck_parser_pop_level( parser ); \
|
|
|
|
YYPOS(0); \
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_IEND; \
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* Concatenates quoted string items and manages allocation
|
|
|
|
* to the quoted string
|
|
|
|
*/
|
2003-05-09 17:25:50 -04:00
|
|
|
#define QUOTECAT(s, c, i, l) \
|
|
|
|
{ \
|
|
|
|
if ( i + 1 >= c ) \
|
|
|
|
{ \
|
|
|
|
c += QUOTELEN; \
|
|
|
|
S_REALLOC_N( s, char, c ); \
|
|
|
|
} \
|
|
|
|
s[i++] = l; \
|
|
|
|
s[i] = '\0'; \
|
|
|
|
}
|
|
|
|
|
2003-05-29 19:33:10 -04:00
|
|
|
#define QUOTECATS(s, c, i, cs, cl) \
|
|
|
|
{ \
|
|
|
|
while ( i + cl >= c ) \
|
|
|
|
{ \
|
|
|
|
c += QUOTELEN; \
|
|
|
|
S_REALLOC_N( s, char, c ); \
|
|
|
|
} \
|
|
|
|
S_MEMCPY( s + i, cs, char, cl ); \
|
|
|
|
i += cl; \
|
|
|
|
s[i] = '\0'; \
|
|
|
|
}
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* Tags a plain scalar with a transfer method
|
|
|
|
* * Use only in "Plain" section *
|
|
|
|
*/
|
2003-05-29 19:33:10 -04:00
|
|
|
#define RETURN_IMPLICIT() \
|
2003-05-09 17:25:50 -04:00
|
|
|
{ \
|
2003-05-29 19:33:10 -04:00
|
|
|
SyckNode *n = syck_alloc_str(); \
|
2003-05-09 17:25:50 -04:00
|
|
|
YYCURSOR = YYTOKTMP; \
|
2003-05-29 19:33:10 -04:00
|
|
|
n->data.str->ptr = qstr; \
|
|
|
|
n->data.str->len = qidx; \
|
2003-07-28 15:27:42 -04:00
|
|
|
sycklval->nodeData = n; \
|
2003-05-09 17:25:50 -04:00
|
|
|
if ( parser->implicit_typing == 1 ) \
|
|
|
|
{ \
|
2003-07-28 15:27:42 -04:00
|
|
|
try_tag_implicit( sycklval->nodeData, parser->taguri_expansion ); \
|
2003-05-09 17:25:50 -04:00
|
|
|
} \
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_PLAIN; \
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
|
2003-05-29 19:33:10 -04:00
|
|
|
/*
|
|
|
|
* Keep or chomp block?
|
|
|
|
* * Use only in "ScalarBlock" section *
|
|
|
|
*/
|
2003-07-28 23:27:01 -04:00
|
|
|
#define RETURN_YAML_BLOCK() \
|
2003-05-29 19:33:10 -04:00
|
|
|
{ \
|
|
|
|
SyckNode *n = syck_alloc_str(); \
|
2003-08-21 17:16:58 -04:00
|
|
|
n->type_id = syck_strndup( "str", 3 ); \
|
2003-05-29 19:33:10 -04:00
|
|
|
n->data.str->ptr = qstr; \
|
|
|
|
n->data.str->len = qidx; \
|
|
|
|
if ( qidx > 0 ) \
|
|
|
|
{ \
|
|
|
|
if ( nlDoWhat != NL_KEEP ) \
|
|
|
|
{ \
|
|
|
|
char *fc = n->data.str->ptr + n->data.str->len - 1; \
|
2003-06-10 10:15:27 -04:00
|
|
|
while ( is_newline( fc ) ) fc--; \
|
2003-05-29 19:33:10 -04:00
|
|
|
if ( nlDoWhat != NL_CHOMP ) \
|
|
|
|
fc += 1; \
|
|
|
|
n->data.str->len = fc - n->data.str->ptr + 1; \
|
|
|
|
} \
|
|
|
|
} \
|
2003-07-28 15:27:42 -04:00
|
|
|
sycklval->nodeData = n; \
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_BLOCK; \
|
2003-05-29 19:33:10 -04:00
|
|
|
}
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* Handles newlines, calculates indent
|
|
|
|
*/
|
2003-07-28 23:27:01 -04:00
|
|
|
#define GOBBLE_UP_YAML_INDENT( ict, start ) \
|
2003-05-09 17:25:50 -04:00
|
|
|
char *indent = start; \
|
|
|
|
NEWLINE(indent); \
|
|
|
|
while ( indent < YYCURSOR ) \
|
|
|
|
{ \
|
2003-06-10 10:15:27 -04:00
|
|
|
if ( is_newline( ++indent ) ) \
|
2003-05-09 17:25:50 -04:00
|
|
|
{ \
|
|
|
|
NEWLINE(indent); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
ict = 0; \
|
|
|
|
if ( *YYCURSOR == '\0' ) \
|
|
|
|
{ \
|
|
|
|
ict = -1; \
|
2003-05-15 17:46:47 -04:00
|
|
|
start = YYCURSOR - 1; \
|
2003-05-09 17:25:50 -04:00
|
|
|
} \
|
|
|
|
else if ( *YYLINEPTR == ' ' ) \
|
|
|
|
{ \
|
|
|
|
ict = YYCURSOR - YYLINEPTR; \
|
|
|
|
}
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* If an indent exists at the current level, back up.
|
|
|
|
*/
|
2003-07-28 23:27:01 -04:00
|
|
|
#define GET_TRUE_YAML_INDENT(indt_len) \
|
2003-05-09 17:25:50 -04:00
|
|
|
{ \
|
|
|
|
SyckLevel *lvl_deep = CURRENT_LEVEL(); \
|
|
|
|
indt_len = lvl_deep->spaces; \
|
|
|
|
if ( indt_len == YYTOKEN - YYLINEPTR ) \
|
|
|
|
{ \
|
|
|
|
SyckLevel *lvl_over; \
|
|
|
|
parser->lvl_idx--; \
|
|
|
|
lvl_over = CURRENT_LEVEL(); \
|
|
|
|
indt_len = lvl_over->spaces; \
|
|
|
|
parser->lvl_idx++; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
2003-07-28 15:27:42 -04:00
|
|
|
* Argjh! I hate globals! Here for syckerror() only!
|
2003-05-13 02:34:18 -04:00
|
|
|
*/
|
2003-05-09 17:25:50 -04:00
|
|
|
SyckParser *syck_parser_ptr = NULL;
|
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
|
|
|
* Accessory funcs later in this file.
|
|
|
|
*/
|
2003-05-09 17:25:50 -04:00
|
|
|
void eat_comments( SyckParser * );
|
2003-07-28 15:27:42 -04:00
|
|
|
int is_newline( char *ptr );
|
2003-10-14 19:15:19 -04:00
|
|
|
int sycklex_yaml_utf8( YYSTYPE *, SyckParser * );
|
|
|
|
int sycklex_bytecode_utf8( YYSTYPE *, SyckParser * );
|
|
|
|
int syckwrap();
|
2003-05-09 17:25:50 -04:00
|
|
|
|
2003-05-13 02:34:18 -04:00
|
|
|
/*
|
2003-07-28 15:27:42 -04:00
|
|
|
* My own re-entrant sycklex() using re2c.
|
2003-05-13 02:34:18 -04:00
|
|
|
* You really get used to the limited regexp.
|
|
|
|
* It's really nice to not rely on backtracking and such.
|
|
|
|
*/
|
2003-05-09 17:25:50 -04:00
|
|
|
int
|
2003-07-28 15:27:42 -04:00
|
|
|
sycklex( YYSTYPE *sycklval, SyckParser *parser )
|
2003-10-14 19:15:19 -04:00
|
|
|
{
|
|
|
|
switch ( parser->input_type )
|
|
|
|
{
|
|
|
|
case syck_yaml_utf8:
|
|
|
|
return sycklex_yaml_utf8( sycklval, parser );
|
|
|
|
|
|
|
|
case syck_yaml_utf16:
|
|
|
|
syckerror( "UTF-16 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case syck_yaml_utf32:
|
|
|
|
syckerror( "UTF-32 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case syck_bytecode_utf8:
|
|
|
|
return sycklex_bytecode_utf8( sycklval, parser );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Parser for standard YAML [UTF-8]
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
sycklex_yaml_utf8( YYSTYPE *sycklval, SyckParser *parser )
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
2003-09-03 14:58:27 -04:00
|
|
|
int doc_level = 0;
|
2003-05-09 17:25:50 -04:00
|
|
|
syck_parser_ptr = parser;
|
|
|
|
if ( YYCURSOR == NULL )
|
|
|
|
{
|
|
|
|
syck_parser_read( parser );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( parser->force_token != 0 )
|
|
|
|
{
|
|
|
|
int t = parser->force_token;
|
|
|
|
parser->force_token = 0;
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 274
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
if ( YYLINEPTR != YYCURSOR )
|
|
|
|
{
|
|
|
|
goto Document;
|
|
|
|
}
|
|
|
|
|
|
|
|
Header:
|
|
|
|
|
|
|
|
YYTOKEN = YYCURSOR;
|
|
|
|
|
|
|
|
{
|
|
|
|
YYCTYPE yych;
|
|
|
|
unsigned int yyaccept;
|
|
|
|
goto yy0;
|
|
|
|
yy1: ++YYCURSOR;
|
|
|
|
yy0:
|
2003-06-10 10:15:27 -04:00
|
|
|
if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
|
2003-05-09 17:25:50 -04:00
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\037'){
|
|
|
|
if(yych <= '\n'){
|
|
|
|
if(yych <= '\000') goto yy7;
|
|
|
|
if(yych <= '\t') goto yy14;
|
|
|
|
goto yy9;
|
|
|
|
} else {
|
|
|
|
if(yych == '\r') goto yy11;
|
|
|
|
goto yy14;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= '#'){
|
|
|
|
if(yych <= ' ') goto yy12;
|
|
|
|
if(yych <= '"') goto yy14;
|
|
|
|
goto yy5;
|
|
|
|
} else {
|
|
|
|
if(yych <= ',') goto yy14;
|
|
|
|
if(yych <= '-') goto yy2;
|
|
|
|
if(yych <= '.') goto yy4;
|
|
|
|
goto yy14;
|
|
|
|
}
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
yy2: yyaccept = 0;
|
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '-') goto yy28;
|
2003-05-09 17:25:50 -04:00
|
|
|
yy3:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 333
|
2003-05-09 17:25:50 -04:00
|
|
|
{ YYPOS(0);
|
|
|
|
goto Document;
|
|
|
|
}
|
2003-06-17 12:55:54 -04:00
|
|
|
yy4: yyaccept = 0;
|
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '.') goto yy21;
|
|
|
|
goto yy3;
|
2003-06-17 12:55:54 -04:00
|
|
|
yy5: yych = *++YYCURSOR;
|
|
|
|
yy6:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 315
|
2003-05-09 17:25:50 -04:00
|
|
|
{ eat_comments( parser );
|
|
|
|
goto Header;
|
|
|
|
}
|
2003-06-17 12:55:54 -04:00
|
|
|
yy7: yych = *++YYCURSOR;
|
|
|
|
yy8:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 319
|
2003-05-09 17:25:50 -04:00
|
|
|
{ SyckLevel *lvl = CURRENT_LEVEL();
|
2003-07-28 23:27:01 -04:00
|
|
|
ENSURE_YAML_IEND(lvl, -1);
|
2003-06-05 13:42:06 -04:00
|
|
|
YYPOS(0);
|
2003-05-09 17:25:50 -04:00
|
|
|
return 0;
|
|
|
|
}
|
2003-06-17 12:55:54 -04:00
|
|
|
yy9: yyaccept = 1;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy18;
|
2003-06-17 12:55:54 -04:00
|
|
|
yy10:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 325
|
2003-09-03 14:58:27 -04:00
|
|
|
{ GOBBLE_UP_YAML_INDENT( doc_level, YYTOKEN );
|
2003-05-09 17:25:50 -04:00
|
|
|
goto Header;
|
|
|
|
}
|
2003-06-17 12:55:54 -04:00
|
|
|
yy11: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy17;
|
|
|
|
goto yy3;
|
2003-06-17 12:55:54 -04:00
|
|
|
yy12: yych = *++YYCURSOR;
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy16;
|
|
|
|
yy13:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 329
|
2003-09-03 14:58:27 -04:00
|
|
|
{ doc_level = YYCURSOR - YYLINEPTR;
|
|
|
|
goto Header;
|
|
|
|
}
|
|
|
|
yy14: yych = *++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
goto yy3;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy15: ++YYCURSOR;
|
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy16: if(yych == ' ') goto yy15;
|
|
|
|
goto yy13;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy17: yyaccept = 1;
|
2003-06-10 10:15:27 -04:00
|
|
|
YYMARKER = ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy18: if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy17;
|
|
|
|
goto yy10;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy19;
|
|
|
|
if(yych == ' ') goto yy17;
|
|
|
|
goto yy10;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy19: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy17;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy20: YYCURSOR = YYMARKER;
|
2003-05-09 17:25:50 -04:00
|
|
|
switch(yyaccept){
|
2003-06-17 12:55:54 -04:00
|
|
|
case 1: goto yy10;
|
2003-05-09 17:25:50 -04:00
|
|
|
case 0: goto yy3;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy21: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych != '.') goto yy20;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy22: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych != '\n') goto yy20;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy27;
|
|
|
|
if(yych == ' ') goto yy25;
|
|
|
|
goto yy20;
|
2003-09-03 14:58:27 -04:00
|
|
|
}
|
|
|
|
yy23: yych = *++YYCURSOR;
|
|
|
|
yy24:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 301
|
2003-06-17 12:55:54 -04:00
|
|
|
{ SyckLevel *lvl = CURRENT_LEVEL();
|
|
|
|
if ( lvl->status == syck_lvl_header )
|
|
|
|
{
|
|
|
|
goto Header;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-07-28 23:27:01 -04:00
|
|
|
ENSURE_YAML_IEND(lvl, -1);
|
2003-06-17 12:55:54 -04:00
|
|
|
YYPOS(0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy25: ++YYCURSOR;
|
2003-06-17 12:55:54 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy26: if(yych == ' ') goto yy25;
|
|
|
|
goto yy24;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy27: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy23;
|
|
|
|
goto yy20;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy28: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych != '-') goto yy20;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy29: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych != '\n') goto yy20;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy34;
|
|
|
|
if(yych == ' ') goto yy32;
|
|
|
|
goto yy20;
|
2003-09-03 14:58:27 -04:00
|
|
|
}
|
|
|
|
yy30: yych = *++YYCURSOR;
|
|
|
|
yy31:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 287
|
2003-05-09 17:25:50 -04:00
|
|
|
{ SyckLevel *lvl = CURRENT_LEVEL();
|
|
|
|
if ( lvl->status == syck_lvl_header )
|
|
|
|
{
|
|
|
|
YYPOS(3);
|
|
|
|
goto Directive;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-07-28 23:27:01 -04:00
|
|
|
ENSURE_YAML_IEND(lvl, -1);
|
2003-05-09 17:25:50 -04:00
|
|
|
YYPOS(0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy32: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy33: if(yych == ' ') goto yy32;
|
|
|
|
goto yy31;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy34: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy30;
|
|
|
|
goto yy20;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 337
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
Document:
|
|
|
|
{
|
|
|
|
SyckLevel *lvl = CURRENT_LEVEL();
|
|
|
|
if ( lvl->status == syck_lvl_header )
|
|
|
|
{
|
|
|
|
lvl->status = syck_lvl_doc;
|
|
|
|
}
|
|
|
|
|
|
|
|
YYTOKEN = YYCURSOR;
|
|
|
|
|
|
|
|
{
|
|
|
|
YYCTYPE yych;
|
|
|
|
unsigned int yyaccept;
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy35;
|
|
|
|
yy36: ++YYCURSOR;
|
|
|
|
yy35:
|
2003-06-10 10:15:27 -04:00
|
|
|
if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
|
2003-05-09 17:25:50 -04:00
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '+'){
|
|
|
|
if(yych <= '!'){
|
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych <= '\000') goto yy60;
|
|
|
|
if(yych != '\n') goto yy62;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy39;
|
|
|
|
if(yych <= '\037') goto yy62;
|
|
|
|
if(yych <= ' ') goto yy58;
|
|
|
|
goto yy49;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= '&'){
|
|
|
|
if(yych <= '"') goto yy53;
|
|
|
|
if(yych <= '#') goto yy56;
|
|
|
|
if(yych <= '%') goto yy62;
|
|
|
|
goto yy47;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\'') goto yy51;
|
|
|
|
if(yych == '*') goto yy48;
|
|
|
|
goto yy62;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= 'Z'){
|
|
|
|
if(yych <= ':'){
|
|
|
|
if(yych <= ',') goto yy45;
|
|
|
|
if(yych <= '-') goto yy46;
|
|
|
|
if(yych <= '9') goto yy62;
|
|
|
|
goto yy45;
|
|
|
|
} else {
|
|
|
|
if(yych <= '=') goto yy62;
|
|
|
|
if(yych <= '>') goto yy55;
|
|
|
|
if(yych <= '?') goto yy46;
|
|
|
|
goto yy62;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= 'z'){
|
|
|
|
if(yych <= '[') goto yy41;
|
|
|
|
if(yych == ']') goto yy43;
|
|
|
|
goto yy62;
|
|
|
|
} else {
|
|
|
|
if(yych <= '{') goto yy41;
|
|
|
|
if(yych <= '|') goto yy55;
|
|
|
|
if(yych <= '}') goto yy43;
|
|
|
|
goto yy62;
|
|
|
|
}
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
}
|
|
|
|
yy37: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy90;
|
|
|
|
yy38:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 351
|
2003-07-04 08:51:42 -04:00
|
|
|
{ /* Isolate spaces */
|
2003-05-09 17:25:50 -04:00
|
|
|
int indt_len;
|
2003-07-28 23:27:01 -04:00
|
|
|
GOBBLE_UP_YAML_INDENT( indt_len, YYTOKEN );
|
2003-05-09 17:25:50 -04:00
|
|
|
lvl = CURRENT_LEVEL();
|
2003-09-03 14:58:27 -04:00
|
|
|
doc_level = 0;
|
2003-05-09 17:25:50 -04:00
|
|
|
|
2003-10-14 19:15:19 -04:00
|
|
|
/* XXX: Comment lookahead */
|
|
|
|
if ( *YYCURSOR == '#' )
|
|
|
|
{
|
|
|
|
goto Document;
|
|
|
|
}
|
|
|
|
|
2003-07-04 08:51:42 -04:00
|
|
|
/* Check for open indent */
|
2003-07-28 23:27:01 -04:00
|
|
|
ENSURE_YAML_IEND(lvl, indt_len);
|
|
|
|
ENSURE_YAML_IOPEN(lvl, indt_len, 0);
|
2003-05-11 02:32:13 -04:00
|
|
|
if ( indt_len == -1 )
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_INDENT;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy39: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy89;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy40:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 445
|
2003-09-03 14:58:27 -04:00
|
|
|
{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
|
2003-06-10 10:15:27 -04:00
|
|
|
goto Plain;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy41: yych = *++YYCURSOR;
|
|
|
|
yy42:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 373
|
2003-09-03 14:58:27 -04:00
|
|
|
{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
|
2003-05-09 17:25:50 -04:00
|
|
|
lvl = CURRENT_LEVEL();
|
|
|
|
ADD_LEVEL(lvl->spaces + 1, syck_lvl_inline);
|
|
|
|
return YYTOKEN[0];
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy43: yych = *++YYCURSOR;
|
|
|
|
yy44:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 379
|
2003-05-09 17:25:50 -04:00
|
|
|
{ POP_LEVEL();
|
|
|
|
return YYTOKEN[0];
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy45: yyaccept = 1;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy84;
|
|
|
|
goto yy40;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy88;
|
|
|
|
if(yych == ' ') goto yy86;
|
|
|
|
goto yy40;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy46: yyaccept = 1;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy79;
|
|
|
|
goto yy40;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy83;
|
|
|
|
if(yych == ' ') goto yy81;
|
|
|
|
goto yy40;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy47: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '@'){
|
|
|
|
if(yych <= '-'){
|
|
|
|
if(yych <= ',') goto yy40;
|
|
|
|
goto yy76;
|
|
|
|
} else {
|
|
|
|
if(yych <= '/') goto yy40;
|
|
|
|
if(yych <= '9') goto yy76;
|
|
|
|
goto yy40;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= '_'){
|
|
|
|
if(yych <= 'Z') goto yy76;
|
|
|
|
if(yych <= '^') goto yy40;
|
|
|
|
goto yy76;
|
|
|
|
} else {
|
|
|
|
if(yych <= '`') goto yy40;
|
|
|
|
if(yych <= 'z') goto yy76;
|
|
|
|
goto yy40;
|
|
|
|
}
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy48: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '@'){
|
|
|
|
if(yych <= '-'){
|
|
|
|
if(yych <= ',') goto yy40;
|
|
|
|
goto yy73;
|
|
|
|
} else {
|
|
|
|
if(yych <= '/') goto yy40;
|
|
|
|
if(yych <= '9') goto yy73;
|
|
|
|
goto yy40;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= '_'){
|
|
|
|
if(yych <= 'Z') goto yy73;
|
|
|
|
if(yych <= '^') goto yy40;
|
|
|
|
goto yy73;
|
|
|
|
} else {
|
|
|
|
if(yych <= '`') goto yy40;
|
|
|
|
if(yych <= 'z') goto yy73;
|
|
|
|
goto yy40;
|
|
|
|
}
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-06-17 12:55:54 -04:00
|
|
|
yy49: yych = *++YYCURSOR;
|
|
|
|
yy50:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 418
|
2003-09-03 14:58:27 -04:00
|
|
|
{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
|
|
|
|
goto TransferMethod; }
|
|
|
|
yy51: yych = *++YYCURSOR;
|
|
|
|
yy52:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 421
|
2003-09-03 14:58:27 -04:00
|
|
|
{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
|
|
|
|
goto SingleQuote; }
|
|
|
|
yy53: yych = *++YYCURSOR;
|
|
|
|
yy54:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 424
|
2003-09-03 14:58:27 -04:00
|
|
|
{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
|
2003-05-22 13:56:30 -04:00
|
|
|
goto DoubleQuote; }
|
2003-09-03 14:58:27 -04:00
|
|
|
yy55: yyaccept = 1;
|
2003-05-09 17:25:50 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= ' '){
|
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy68;
|
|
|
|
goto yy40;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy72;
|
|
|
|
if(yych <= '\037') goto yy40;
|
|
|
|
goto yy70;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= ','){
|
|
|
|
if(yych == '+') goto yy65;
|
|
|
|
goto yy40;
|
|
|
|
} else {
|
|
|
|
if(yych <= '-') goto yy65;
|
|
|
|
if(yych <= '/') goto yy40;
|
|
|
|
if(yych <= '9') goto yy65;
|
|
|
|
goto yy40;
|
|
|
|
}
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy56: yych = *++YYCURSOR;
|
|
|
|
yy57:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 434
|
2003-05-09 17:25:50 -04:00
|
|
|
{ eat_comments( parser );
|
|
|
|
goto Document;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy58: yych = *++YYCURSOR;
|
|
|
|
goto yy64;
|
|
|
|
yy59:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 438
|
2003-05-09 17:25:50 -04:00
|
|
|
{ goto Document; }
|
2003-09-03 14:58:27 -04:00
|
|
|
yy60: yych = *++YYCURSOR;
|
|
|
|
yy61:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 440
|
2003-07-28 23:27:01 -04:00
|
|
|
{ ENSURE_YAML_IEND(lvl, -1);
|
2003-06-05 13:42:06 -04:00
|
|
|
YYPOS(0);
|
2003-05-09 17:25:50 -04:00
|
|
|
return 0;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy62: yych = *++YYCURSOR;
|
|
|
|
goto yy40;
|
|
|
|
yy63: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy64: if(yych == ' ') goto yy63;
|
|
|
|
goto yy59;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy65: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy66: if(yych <= ' '){
|
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy68;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy72;
|
|
|
|
if(yych >= ' ') goto yy70;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= ','){
|
|
|
|
if(yych == '+') goto yy65;
|
|
|
|
} else {
|
|
|
|
if(yych <= '-') goto yy65;
|
|
|
|
if(yych <= '/') goto yy67;
|
|
|
|
if(yych <= '9') goto yy65;
|
|
|
|
}
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy67: YYCURSOR = YYMARKER;
|
2003-05-09 17:25:50 -04:00
|
|
|
switch(yyaccept){
|
2003-09-03 14:58:27 -04:00
|
|
|
case 0: goto yy38;
|
|
|
|
case 1: goto yy40;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy68: yych = *++YYCURSOR;
|
|
|
|
yy69:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 427
|
2003-06-10 10:15:27 -04:00
|
|
|
{ if ( is_newline( YYCURSOR - 1 ) )
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
|
|
|
YYCURSOR--;
|
|
|
|
}
|
|
|
|
goto ScalarBlock;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy70: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy71: if(yych == ' ') goto yy70;
|
|
|
|
goto yy69;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy72: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy68;
|
|
|
|
goto yy67;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy73: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy74: if(yych <= '@'){
|
|
|
|
if(yych <= '-'){
|
|
|
|
if(yych >= '-') goto yy73;
|
|
|
|
} else {
|
|
|
|
if(yych <= '/') goto yy75;
|
|
|
|
if(yych <= '9') goto yy73;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= '_'){
|
|
|
|
if(yych <= 'Z') goto yy73;
|
|
|
|
if(yych >= '_') goto yy73;
|
|
|
|
} else {
|
|
|
|
if(yych <= '`') goto yy75;
|
|
|
|
if(yych <= 'z') goto yy73;
|
|
|
|
}
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy75:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 413
|
2003-09-03 14:58:27 -04:00
|
|
|
{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
|
2003-07-28 15:27:42 -04:00
|
|
|
sycklval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_ALIAS;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy76: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy77: if(yych <= '@'){
|
|
|
|
if(yych <= '-'){
|
|
|
|
if(yych >= '-') goto yy76;
|
|
|
|
} else {
|
|
|
|
if(yych <= '/') goto yy78;
|
|
|
|
if(yych <= '9') goto yy76;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= '_'){
|
|
|
|
if(yych <= 'Z') goto yy76;
|
|
|
|
if(yych >= '_') goto yy76;
|
|
|
|
} else {
|
|
|
|
if(yych <= '`') goto yy78;
|
|
|
|
if(yych <= 'z') goto yy76;
|
|
|
|
}
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy78:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 401
|
2003-09-03 14:58:27 -04:00
|
|
|
{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
|
2003-07-28 15:27:42 -04:00
|
|
|
sycklval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
|
2003-06-17 12:55:54 -04:00
|
|
|
|
2003-07-04 08:51:42 -04:00
|
|
|
/*
|
|
|
|
* Remove previous anchors of the same name. Since the parser will likely
|
|
|
|
* construct deeper nodes first, we want those nodes to be placed in the
|
|
|
|
* queue for matching at a higher level of indentation.
|
|
|
|
*/
|
2003-07-28 15:27:42 -04:00
|
|
|
syck_hdlr_remove_anchor(parser, sycklval->name);
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_ANCHOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy79: yych = *++YYCURSOR;
|
|
|
|
yy80:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 387
|
2003-07-28 23:27:01 -04:00
|
|
|
{ ENSURE_YAML_IOPEN(lvl, YYTOKEN - YYLINEPTR, 1);
|
|
|
|
FORCE_NEXT_TOKEN(YAML_IOPEN);
|
2003-06-10 10:15:27 -04:00
|
|
|
if ( is_newline( YYCURSOR ) || is_newline( YYCURSOR - 1 ) )
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
|
|
|
YYCURSOR--;
|
2003-05-29 19:33:10 -04:00
|
|
|
ADD_LEVEL((YYTOKEN + 1) - YYLINEPTR, syck_lvl_doc);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ADD_LEVEL(YYCURSOR - YYLINEPTR, syck_lvl_doc);
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
return YYTOKEN[0];
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy81: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy82: if(yych == ' ') goto yy81;
|
|
|
|
goto yy80;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy83: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy79;
|
|
|
|
goto yy67;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy84: yych = *++YYCURSOR;
|
|
|
|
yy85:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 383
|
2003-05-09 17:25:50 -04:00
|
|
|
{ YYPOS(1);
|
|
|
|
return YYTOKEN[0];
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy86: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy87: if(yych == ' ') goto yy86;
|
|
|
|
goto yy85;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy88: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy84;
|
|
|
|
goto yy67;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy89: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
YYMARKER = ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy90: if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy89;
|
|
|
|
goto yy38;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy91;
|
|
|
|
if(yych == ' ') goto yy89;
|
|
|
|
goto yy38;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy91: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy89;
|
|
|
|
goto yy67;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 449
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Directive:
|
|
|
|
{
|
|
|
|
YYTOKTMP = YYCURSOR;
|
|
|
|
|
|
|
|
{
|
|
|
|
YYCTYPE yych;
|
|
|
|
unsigned int yyaccept;
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy92;
|
|
|
|
yy93: ++YYCURSOR;
|
|
|
|
yy92:
|
2003-05-09 17:25:50 -04:00
|
|
|
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= ' '){
|
|
|
|
if(yych <= '\000') goto yy94;
|
|
|
|
if(yych <= '\037') goto yy99;
|
|
|
|
goto yy97;
|
|
|
|
} else {
|
|
|
|
if(yych == '%') goto yy95;
|
|
|
|
goto yy99;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy94: YYCURSOR = YYMARKER;
|
2003-05-09 17:25:50 -04:00
|
|
|
switch(yyaccept){
|
2003-09-03 14:58:27 -04:00
|
|
|
case 0: goto yy96;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy95: yyaccept = 0;
|
2003-05-09 17:25:50 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '-') goto yy96;
|
|
|
|
if(yych == '`') goto yy96;
|
|
|
|
if(yych <= 'z') goto yy102;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy96:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 462
|
2003-05-09 17:25:50 -04:00
|
|
|
{ YYCURSOR = YYTOKTMP;
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_DOCSEP;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy97: yych = *++YYCURSOR;
|
|
|
|
goto yy101;
|
|
|
|
yy98:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 460
|
2003-05-09 17:25:50 -04:00
|
|
|
{ goto Directive; }
|
2003-09-03 14:58:27 -04:00
|
|
|
yy99: yych = *++YYCURSOR;
|
|
|
|
goto yy96;
|
|
|
|
yy100: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy101: if(yych == ' ') goto yy100;
|
|
|
|
goto yy98;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy102: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy103: if(yych <= ':'){
|
|
|
|
if(yych <= '-') goto yy94;
|
|
|
|
if(yych <= '9') goto yy102;
|
|
|
|
} else {
|
|
|
|
if(yych == '`') goto yy94;
|
|
|
|
if(yych <= 'z') goto yy102;
|
|
|
|
goto yy94;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy104: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '-') goto yy94;
|
|
|
|
if(yych == '`') goto yy94;
|
|
|
|
if(yych >= '{') goto yy94;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy105: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy106: if(yych <= '-') goto yy107;
|
|
|
|
if(yych == '`') goto yy107;
|
|
|
|
if(yych <= 'z') goto yy105;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy107:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 458
|
2003-05-09 17:25:50 -04:00
|
|
|
{ goto Directive; }
|
|
|
|
}
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 465
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Plain:
|
|
|
|
{
|
2003-05-29 19:33:10 -04:00
|
|
|
int qidx = 0;
|
|
|
|
int qcapa = 100;
|
|
|
|
char *qstr = S_ALLOC_N( char, qcapa );
|
2003-05-09 17:25:50 -04:00
|
|
|
SyckLevel *plvl;
|
|
|
|
int parentIndent;
|
2003-05-29 19:33:10 -04:00
|
|
|
|
2003-05-09 17:25:50 -04:00
|
|
|
YYCURSOR = YYTOKEN;
|
|
|
|
plvl = CURRENT_LEVEL();
|
2003-07-28 23:27:01 -04:00
|
|
|
GET_TRUE_YAML_INDENT(parentIndent);
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
Plain2:
|
|
|
|
YYTOKTMP = YYCURSOR;
|
|
|
|
|
|
|
|
Plain3:
|
|
|
|
|
|
|
|
{
|
|
|
|
YYCTYPE yych;
|
|
|
|
unsigned int yyaccept;
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy108;
|
|
|
|
yy109: ++YYCURSOR;
|
|
|
|
yy108:
|
2003-06-10 10:15:27 -04:00
|
|
|
if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
|
2003-05-09 17:25:50 -04:00
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '+'){
|
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych <= '\000') goto yy120;
|
|
|
|
if(yych != '\n') goto yy122;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy112;
|
|
|
|
if(yych == ' ') goto yy118;
|
|
|
|
goto yy122;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= '\\'){
|
|
|
|
if(yych <= ',') goto yy117;
|
|
|
|
if(yych == ':') goto yy114;
|
|
|
|
goto yy122;
|
|
|
|
} else {
|
|
|
|
if(yych <= ']') goto yy115;
|
|
|
|
if(yych == '}') goto yy115;
|
|
|
|
goto yy122;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
}
|
|
|
|
yy110: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy136;
|
|
|
|
yy111:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 488
|
2003-05-29 19:33:10 -04:00
|
|
|
{ int indt_len, nl_count = 0;
|
2003-05-09 17:25:50 -04:00
|
|
|
SyckLevel *lvl;
|
|
|
|
char *tok = YYTOKTMP;
|
2003-07-28 23:27:01 -04:00
|
|
|
GOBBLE_UP_YAML_INDENT( indt_len, tok );
|
2003-05-09 17:25:50 -04:00
|
|
|
lvl = CURRENT_LEVEL();
|
|
|
|
|
|
|
|
if ( indt_len <= parentIndent )
|
|
|
|
{
|
2003-05-29 19:33:10 -04:00
|
|
|
RETURN_IMPLICIT();
|
|
|
|
}
|
|
|
|
|
|
|
|
while ( YYTOKTMP < YYCURSOR )
|
|
|
|
{
|
2003-06-10 10:15:27 -04:00
|
|
|
if ( is_newline( YYTOKTMP++ ) )
|
2003-05-29 19:33:10 -04:00
|
|
|
nl_count++;
|
|
|
|
}
|
|
|
|
if ( nl_count <= 1 )
|
|
|
|
{
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, ' ');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for ( i = 0; i < nl_count - 1; i++ )
|
|
|
|
{
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, '\n');
|
|
|
|
}
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
goto Plain2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy112: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy135;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy113:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 542
|
2003-05-29 19:33:10 -04:00
|
|
|
{ QUOTECATS(qstr, qcapa, qidx, YYTOKTMP, YYCURSOR - YYTOKTMP);
|
|
|
|
goto Plain2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy114: yyaccept = 1;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy130;
|
|
|
|
goto yy113;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy134;
|
|
|
|
if(yych == ' ') goto yy132;
|
|
|
|
goto yy113;
|
2003-09-03 14:58:27 -04:00
|
|
|
}
|
|
|
|
yy115: yych = *++YYCURSOR;
|
|
|
|
yy116:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 522
|
2003-05-29 19:33:10 -04:00
|
|
|
{ if ( plvl->status != syck_lvl_inline )
|
|
|
|
{
|
2003-06-10 10:15:27 -04:00
|
|
|
if ( *(YYCURSOR - 1) == ' ' || is_newline( YYCURSOR - 1 ) )
|
2003-06-05 13:42:06 -04:00
|
|
|
{
|
|
|
|
YYCURSOR--;
|
|
|
|
}
|
2003-05-29 19:33:10 -04:00
|
|
|
QUOTECATS(qstr, qcapa, qidx, YYTOKTMP, YYCURSOR - YYTOKTMP);
|
|
|
|
goto Plain2;
|
|
|
|
}
|
|
|
|
RETURN_IMPLICIT();
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy117: yyaccept = 1;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy125;
|
|
|
|
goto yy113;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy128;
|
|
|
|
if(yych == ' ') goto yy126;
|
|
|
|
goto yy113;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy118: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '#') goto yy123;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy119:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 540
|
2003-05-09 17:25:50 -04:00
|
|
|
{ goto Plain3; }
|
2003-09-03 14:58:27 -04:00
|
|
|
yy120: yych = *++YYCURSOR;
|
|
|
|
yy121:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 538
|
2003-05-29 19:33:10 -04:00
|
|
|
{ RETURN_IMPLICIT(); }
|
2003-09-03 14:58:27 -04:00
|
|
|
yy122: yych = *++YYCURSOR;
|
|
|
|
goto yy113;
|
|
|
|
yy123: yych = *++YYCURSOR;
|
|
|
|
yy124:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 534
|
2003-05-09 17:25:50 -04:00
|
|
|
{ eat_comments( parser );
|
2003-05-29 19:33:10 -04:00
|
|
|
RETURN_IMPLICIT();
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy125: yych = *++YYCURSOR;
|
|
|
|
goto yy116;
|
|
|
|
yy126: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy127: if(yych == ' ') goto yy126;
|
|
|
|
goto yy116;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy128: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy125;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy129: YYCURSOR = YYMARKER;
|
2003-06-10 10:15:27 -04:00
|
|
|
switch(yyaccept){
|
2003-09-03 14:58:27 -04:00
|
|
|
case 0: goto yy111;
|
|
|
|
case 1: goto yy113;
|
2003-06-10 10:15:27 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy130: yych = *++YYCURSOR;
|
|
|
|
yy131:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 520
|
2003-05-29 19:33:10 -04:00
|
|
|
{ RETURN_IMPLICIT(); }
|
2003-09-03 14:58:27 -04:00
|
|
|
yy132: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy133: if(yych == ' ') goto yy132;
|
|
|
|
goto yy131;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy134: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy130;
|
|
|
|
goto yy129;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy135: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
YYMARKER = ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy136: if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy135;
|
|
|
|
goto yy111;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy137;
|
|
|
|
if(yych == ' ') goto yy135;
|
|
|
|
goto yy111;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy137: ++YYCURSOR;
|
2003-06-10 10:15:27 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy135;
|
|
|
|
goto yy129;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 546
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SingleQuote:
|
|
|
|
{
|
|
|
|
int qidx = 0;
|
|
|
|
int qcapa = 100;
|
|
|
|
char *qstr = S_ALLOC_N( char, qcapa );
|
|
|
|
|
|
|
|
SingleQuote2:
|
|
|
|
YYTOKTMP = YYCURSOR;
|
|
|
|
|
|
|
|
{
|
|
|
|
YYCTYPE yych;
|
|
|
|
unsigned int yyaccept;
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy138;
|
|
|
|
yy139: ++YYCURSOR;
|
|
|
|
yy138:
|
2003-05-09 17:25:50 -04:00
|
|
|
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych <= '\000') goto yy146;
|
|
|
|
if(yych != '\n') goto yy147;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy142;
|
|
|
|
if(yych == '\'') goto yy144;
|
|
|
|
goto yy147;
|
2003-06-10 10:15:27 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy140: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy151;
|
|
|
|
yy141:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 560
|
2003-05-09 17:25:50 -04:00
|
|
|
{ int indt_len;
|
|
|
|
int nl_count = 0;
|
|
|
|
SyckLevel *lvl;
|
2003-07-28 23:27:01 -04:00
|
|
|
GOBBLE_UP_YAML_INDENT( indt_len, YYTOKTMP );
|
2003-05-09 17:25:50 -04:00
|
|
|
lvl = CURRENT_LEVEL();
|
|
|
|
|
|
|
|
if ( lvl->status != syck_lvl_str )
|
|
|
|
{
|
|
|
|
ADD_LEVEL( indt_len, syck_lvl_str );
|
|
|
|
}
|
|
|
|
else if ( indt_len < lvl->spaces )
|
|
|
|
{
|
2003-07-04 08:51:42 -04:00
|
|
|
/* Error! */
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
while ( YYTOKTMP < YYCURSOR )
|
|
|
|
{
|
2003-06-10 10:15:27 -04:00
|
|
|
if ( is_newline( YYTOKTMP++ ) )
|
2003-05-09 17:25:50 -04:00
|
|
|
nl_count++;
|
|
|
|
}
|
|
|
|
if ( nl_count <= 1 )
|
|
|
|
{
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, ' ');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for ( i = 0; i < nl_count - 1; i++ )
|
|
|
|
{
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, '\n');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
goto SingleQuote2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy142: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy150;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy143:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 615
|
2003-06-10 10:15:27 -04:00
|
|
|
{ QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
|
|
|
|
goto SingleQuote2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy144: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\'') goto yy148;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy145:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 600
|
2003-05-09 17:25:50 -04:00
|
|
|
{ SyckLevel *lvl;
|
|
|
|
SyckNode *n = syck_alloc_str();
|
|
|
|
lvl = CURRENT_LEVEL();
|
|
|
|
|
|
|
|
if ( lvl->status == syck_lvl_str )
|
|
|
|
{
|
|
|
|
POP_LEVEL();
|
|
|
|
}
|
2003-08-21 17:16:58 -04:00
|
|
|
n->type_id = syck_strndup( "str", 3 );
|
2003-05-09 17:25:50 -04:00
|
|
|
n->data.str->ptr = qstr;
|
|
|
|
n->data.str->len = qidx;
|
2003-07-28 15:27:42 -04:00
|
|
|
sycklval->nodeData = n;
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_PLAIN;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy146: yych = *++YYCURSOR;
|
|
|
|
goto yy145;
|
|
|
|
yy147: yych = *++YYCURSOR;
|
|
|
|
goto yy143;
|
|
|
|
yy148: yych = *++YYCURSOR;
|
|
|
|
yy149:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 596
|
2003-05-09 17:25:50 -04:00
|
|
|
{ QUOTECAT(qstr, qcapa, qidx, '\'');
|
|
|
|
goto SingleQuote2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy150: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
YYMARKER = ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy151: if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy150;
|
|
|
|
goto yy141;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy152;
|
|
|
|
if(yych == ' ') goto yy150;
|
|
|
|
goto yy141;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy152: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy150;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy153: YYCURSOR = YYMARKER;
|
2003-06-10 10:15:27 -04:00
|
|
|
switch(yyaccept){
|
2003-09-03 14:58:27 -04:00
|
|
|
case 0: goto yy141;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 619
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DoubleQuote:
|
|
|
|
{
|
|
|
|
int keep_nl = 1;
|
|
|
|
int qidx = 0;
|
|
|
|
int qcapa = 100;
|
|
|
|
char *qstr = S_ALLOC_N( char, qcapa );
|
|
|
|
|
|
|
|
DoubleQuote2:
|
|
|
|
YYTOKTMP = YYCURSOR;
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
YYCTYPE yych;
|
|
|
|
unsigned int yyaccept;
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy154;
|
|
|
|
yy155: ++YYCURSOR;
|
|
|
|
yy154:
|
2003-05-30 19:09:54 -04:00
|
|
|
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
|
2003-05-09 17:25:50 -04:00
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\r'){
|
|
|
|
if(yych <= '\t'){
|
|
|
|
if(yych <= '\000') goto yy161;
|
|
|
|
goto yy164;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\n') goto yy156;
|
|
|
|
if(yych <= '\f') goto yy164;
|
|
|
|
goto yy158;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= '"'){
|
|
|
|
if(yych <= '!') goto yy164;
|
|
|
|
goto yy163;
|
|
|
|
} else {
|
|
|
|
if(yych == '\\') goto yy160;
|
|
|
|
goto yy164;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
}
|
|
|
|
yy156: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy178;
|
|
|
|
yy157:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 637
|
2003-05-09 17:25:50 -04:00
|
|
|
{ int indt_len;
|
|
|
|
int nl_count = 0;
|
|
|
|
SyckLevel *lvl;
|
2003-07-28 23:27:01 -04:00
|
|
|
GOBBLE_UP_YAML_INDENT( indt_len, YYTOKTMP );
|
2003-05-09 17:25:50 -04:00
|
|
|
lvl = CURRENT_LEVEL();
|
|
|
|
|
|
|
|
if ( lvl->status != syck_lvl_str )
|
|
|
|
{
|
|
|
|
ADD_LEVEL( indt_len, syck_lvl_str );
|
|
|
|
}
|
|
|
|
else if ( indt_len < lvl->spaces )
|
|
|
|
{
|
2003-07-24 12:30:43 -04:00
|
|
|
/* FIXME */
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( keep_nl == 1 )
|
|
|
|
{
|
|
|
|
while ( YYTOKTMP < YYCURSOR )
|
|
|
|
{
|
2003-06-10 10:15:27 -04:00
|
|
|
if ( is_newline( YYTOKTMP++ ) )
|
2003-05-09 17:25:50 -04:00
|
|
|
nl_count++;
|
|
|
|
}
|
|
|
|
if ( nl_count <= 1 )
|
|
|
|
{
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, ' ');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for ( i = 0; i < nl_count - 1; i++ )
|
|
|
|
{
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, '\n');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
keep_nl = 1;
|
|
|
|
goto DoubleQuote2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy158: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy177;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy159:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 722
|
2003-05-09 17:25:50 -04:00
|
|
|
{ QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
|
|
|
|
goto DoubleQuote2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy160: yyaccept = 1;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= 'b'){
|
|
|
|
if(yych <= ' '){
|
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy168;
|
|
|
|
goto yy159;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy170;
|
|
|
|
if(yych <= '\037') goto yy159;
|
|
|
|
goto yy165;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= '['){
|
|
|
|
if(yych == '"') goto yy172;
|
|
|
|
goto yy159;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\\') goto yy172;
|
|
|
|
if(yych <= '`') goto yy159;
|
|
|
|
goto yy172;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= 'r'){
|
|
|
|
if(yych <= 'm'){
|
|
|
|
if(yych <= 'd') goto yy159;
|
|
|
|
if(yych <= 'f') goto yy172;
|
|
|
|
goto yy159;
|
|
|
|
} else {
|
|
|
|
if(yych <= 'n') goto yy172;
|
|
|
|
if(yych <= 'q') goto yy159;
|
|
|
|
goto yy172;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= 'u'){
|
|
|
|
if(yych == 't') goto yy172;
|
|
|
|
goto yy159;
|
|
|
|
} else {
|
|
|
|
if(yych <= 'v') goto yy172;
|
|
|
|
if(yych == 'x') goto yy171;
|
|
|
|
goto yy159;
|
|
|
|
}
|
|
|
|
}
|
2003-06-10 10:15:27 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy161: yych = *++YYCURSOR;
|
|
|
|
yy162:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 707
|
2003-05-09 17:25:50 -04:00
|
|
|
{ SyckLevel *lvl;
|
|
|
|
SyckNode *n = syck_alloc_str();
|
|
|
|
lvl = CURRENT_LEVEL();
|
|
|
|
|
|
|
|
if ( lvl->status == syck_lvl_str )
|
|
|
|
{
|
|
|
|
POP_LEVEL();
|
|
|
|
}
|
2003-08-21 17:16:58 -04:00
|
|
|
n->type_id = syck_strndup( "str", 3 );
|
2003-05-09 17:25:50 -04:00
|
|
|
n->data.str->ptr = qstr;
|
|
|
|
n->data.str->len = qidx;
|
2003-07-28 15:27:42 -04:00
|
|
|
sycklval->nodeData = n;
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_PLAIN;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy163: yych = *++YYCURSOR;
|
|
|
|
goto yy162;
|
|
|
|
yy164: yych = *++YYCURSOR;
|
|
|
|
goto yy159;
|
|
|
|
yy165: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy166: if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy168;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy170;
|
|
|
|
if(yych == ' ') goto yy165;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy167: YYCURSOR = YYMARKER;
|
2003-05-09 17:25:50 -04:00
|
|
|
switch(yyaccept){
|
2003-09-03 14:58:27 -04:00
|
|
|
case 0: goto yy157;
|
|
|
|
case 1: goto yy159;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy168: yych = *++YYCURSOR;
|
|
|
|
yy169:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 702
|
2003-05-09 17:25:50 -04:00
|
|
|
{ keep_nl = 0;
|
|
|
|
YYCURSOR--;
|
|
|
|
goto DoubleQuote2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy170: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy168;
|
|
|
|
goto yy167;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy171: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '@'){
|
|
|
|
if(yych <= '/') goto yy167;
|
|
|
|
if(yych <= '9') goto yy174;
|
|
|
|
goto yy167;
|
|
|
|
} else {
|
|
|
|
if(yych <= 'F') goto yy174;
|
|
|
|
if(yych <= '`') goto yy167;
|
|
|
|
if(yych <= 'f') goto yy174;
|
|
|
|
goto yy167;
|
2003-05-30 19:09:54 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy172: yych = *++YYCURSOR;
|
|
|
|
yy173:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 677
|
2003-05-29 19:33:10 -04:00
|
|
|
{ char ch = *( YYCURSOR - 1 );
|
2003-05-09 17:25:50 -04:00
|
|
|
switch ( ch )
|
|
|
|
{
|
2003-05-13 18:29:52 -04:00
|
|
|
case 'a': ch = 7; break;
|
|
|
|
case 'b': ch = '\010'; break;
|
|
|
|
case 'e': ch = '\033'; break;
|
|
|
|
case 'f': ch = '\014'; break;
|
2003-05-09 17:25:50 -04:00
|
|
|
case 'n': ch = '\n'; break;
|
2003-05-13 18:29:52 -04:00
|
|
|
case 'r': ch = '\015'; break;
|
2003-05-09 17:25:50 -04:00
|
|
|
case 't': ch = '\t'; break;
|
2003-05-13 18:29:52 -04:00
|
|
|
case 'v': ch = '\013'; break;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, ch);
|
|
|
|
goto DoubleQuote2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy174: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '@'){
|
|
|
|
if(yych <= '/') goto yy167;
|
|
|
|
if(yych >= ':') goto yy167;
|
|
|
|
} else {
|
|
|
|
if(yych <= 'F') goto yy175;
|
|
|
|
if(yych <= '`') goto yy167;
|
|
|
|
if(yych >= 'g') goto yy167;
|
2003-05-30 19:09:54 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy175: yych = *++YYCURSOR;
|
|
|
|
yy176:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 693
|
2003-05-30 19:09:54 -04:00
|
|
|
{ long ch;
|
|
|
|
char *chr_text = syck_strndup( YYTOKTMP, 4 );
|
|
|
|
chr_text[0] = '0';
|
|
|
|
ch = strtol( chr_text, NULL, 16 );
|
|
|
|
free( chr_text );
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, ch);
|
|
|
|
goto DoubleQuote2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy177: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
YYMARKER = ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy178: if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy177;
|
|
|
|
goto yy157;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy179;
|
|
|
|
if(yych == ' ') goto yy177;
|
|
|
|
goto yy157;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy179: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy177;
|
|
|
|
goto yy167;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 726
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
TransferMethod:
|
|
|
|
{
|
2003-07-24 12:30:43 -04:00
|
|
|
int qidx = 0;
|
|
|
|
int qcapa = 100;
|
|
|
|
char *qstr = S_ALLOC_N( char, qcapa );
|
|
|
|
|
|
|
|
TransferMethod2:
|
2003-05-09 17:25:50 -04:00
|
|
|
YYTOKTMP = YYCURSOR;
|
|
|
|
|
|
|
|
{
|
|
|
|
YYCTYPE yych;
|
|
|
|
unsigned int yyaccept;
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy180;
|
|
|
|
yy181: ++YYCURSOR;
|
|
|
|
yy180:
|
2003-07-24 12:30:43 -04:00
|
|
|
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
|
2003-05-09 17:25:50 -04:00
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\r'){
|
|
|
|
if(yych <= '\t'){
|
|
|
|
if(yych >= '\001') goto yy189;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\n') goto yy183;
|
|
|
|
if(yych <= '\f') goto yy189;
|
|
|
|
goto yy186;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(yych <= ' '){
|
|
|
|
if(yych <= '\037') goto yy189;
|
|
|
|
goto yy185;
|
|
|
|
} else {
|
|
|
|
if(yych == '\\') goto yy188;
|
|
|
|
goto yy189;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
}
|
|
|
|
yy182: YYCURSOR = YYMARKER;
|
2003-07-24 12:30:43 -04:00
|
|
|
switch(yyaccept){
|
2003-09-03 14:58:27 -04:00
|
|
|
case 0: goto yy187;
|
2003-06-10 10:15:27 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy183: yych = *++YYCURSOR;
|
|
|
|
yy184:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 740
|
2003-05-09 17:25:50 -04:00
|
|
|
{ SyckLevel *lvl;
|
|
|
|
YYCURSOR = YYTOKTMP;
|
|
|
|
if ( YYCURSOR == YYTOKEN + 1 )
|
|
|
|
{
|
2003-07-24 12:30:43 -04:00
|
|
|
free( qstr );
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_ITRANSFER;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
lvl = CURRENT_LEVEL();
|
|
|
|
|
2003-07-04 08:51:42 -04:00
|
|
|
/*
|
|
|
|
* URL Prefixing
|
|
|
|
*/
|
2003-07-24 12:30:43 -04:00
|
|
|
if ( *qstr == '^' )
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
2003-07-28 15:27:42 -04:00
|
|
|
sycklval->name = S_ALLOC_N( char, qidx + strlen( lvl->domain ) );
|
|
|
|
sycklval->name[0] = '\0';
|
|
|
|
strcat( sycklval->name, lvl->domain );
|
|
|
|
strncat( sycklval->name, qstr + 1, qidx - 1 );
|
2003-07-24 12:30:43 -04:00
|
|
|
free( qstr );
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-07-24 12:30:43 -04:00
|
|
|
char *carat = qstr;
|
|
|
|
char *qend = qstr + qidx;
|
|
|
|
while ( (++carat) < qend )
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
|
|
|
if ( *carat == '^' )
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-07-24 12:30:43 -04:00
|
|
|
if ( carat < qend )
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
2003-05-13 02:34:18 -04:00
|
|
|
free( lvl->domain );
|
2003-07-24 12:30:43 -04:00
|
|
|
lvl->domain = syck_strndup( qstr, carat - qstr );
|
2003-07-28 15:27:42 -04:00
|
|
|
sycklval->name = S_ALLOC_N( char, ( qend - carat ) + strlen( lvl->domain ) );
|
|
|
|
sycklval->name[0] = '\0';
|
|
|
|
strcat( sycklval->name, lvl->domain );
|
|
|
|
strncat( sycklval->name, carat + 1, ( qend - carat ) - 1 );
|
2003-07-24 12:30:43 -04:00
|
|
|
free( qstr );
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-07-28 15:27:42 -04:00
|
|
|
sycklval->name = qstr;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
}
|
2003-05-11 02:32:13 -04:00
|
|
|
|
2003-07-28 23:27:01 -04:00
|
|
|
return YAML_TRANSFER;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy185: yych = *++YYCURSOR;
|
|
|
|
goto yy196;
|
|
|
|
yy186: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy194;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy187:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 802
|
2003-07-24 12:30:43 -04:00
|
|
|
{ QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
|
|
|
|
goto TransferMethod2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy188: yyaccept = 0;
|
2003-07-24 12:30:43 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == 'x') goto yy190;
|
|
|
|
goto yy187;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy189: yych = *++YYCURSOR;
|
|
|
|
goto yy187;
|
|
|
|
yy190: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '@'){
|
|
|
|
if(yych <= '/') goto yy182;
|
|
|
|
if(yych >= ':') goto yy182;
|
|
|
|
} else {
|
|
|
|
if(yych <= 'F') goto yy191;
|
|
|
|
if(yych <= '`') goto yy182;
|
|
|
|
if(yych >= 'g') goto yy182;
|
2003-07-24 12:30:43 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy191: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '@'){
|
|
|
|
if(yych <= '/') goto yy182;
|
|
|
|
if(yych >= ':') goto yy182;
|
|
|
|
} else {
|
|
|
|
if(yych <= 'F') goto yy192;
|
|
|
|
if(yych <= '`') goto yy182;
|
|
|
|
if(yych >= 'g') goto yy182;
|
2003-07-24 12:30:43 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy192: yych = *++YYCURSOR;
|
|
|
|
yy193:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 793
|
2003-07-24 12:30:43 -04:00
|
|
|
{ long ch;
|
|
|
|
char *chr_text = syck_strndup( YYTOKTMP, 4 );
|
|
|
|
chr_text[0] = '0';
|
|
|
|
ch = strtol( chr_text, NULL, 16 );
|
|
|
|
free( chr_text );
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, ch);
|
|
|
|
goto TransferMethod2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy194: yych = *++YYCURSOR;
|
|
|
|
goto yy184;
|
|
|
|
yy195: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy196: if(yych == ' ') goto yy195;
|
|
|
|
goto yy184;
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 807
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ScalarBlock:
|
|
|
|
{
|
2003-05-29 19:33:10 -04:00
|
|
|
int qidx = 0;
|
|
|
|
int qcapa = 100;
|
|
|
|
char *qstr = S_ALLOC_N( char, qcapa );
|
2003-05-09 17:25:50 -04:00
|
|
|
int blockType = 0;
|
|
|
|
int nlDoWhat = 0;
|
2003-05-29 19:33:10 -04:00
|
|
|
int lastIndent = 0;
|
2003-05-09 17:25:50 -04:00
|
|
|
int forceIndent = -1;
|
|
|
|
char *yyt = YYTOKEN;
|
|
|
|
SyckLevel *lvl = CURRENT_LEVEL();
|
|
|
|
int parentIndent;
|
2003-07-28 23:27:01 -04:00
|
|
|
GET_TRUE_YAML_INDENT(parentIndent);
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
switch ( *yyt )
|
|
|
|
{
|
|
|
|
case '|': blockType = BLOCK_LIT; break;
|
|
|
|
case '>': blockType = BLOCK_FOLD; break;
|
|
|
|
}
|
|
|
|
|
|
|
|
while ( ++yyt <= YYCURSOR )
|
|
|
|
{
|
|
|
|
if ( *yyt == '-' )
|
|
|
|
{
|
|
|
|
nlDoWhat = NL_CHOMP;
|
|
|
|
}
|
|
|
|
else if ( *yyt == '+' )
|
|
|
|
{
|
|
|
|
nlDoWhat = NL_KEEP;
|
|
|
|
}
|
|
|
|
else if ( isdigit( *yyt ) )
|
|
|
|
{
|
|
|
|
forceIndent = strtol( yyt, NULL, 10 ) + parentIndent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-05-29 19:33:10 -04:00
|
|
|
qstr[0] = '\0';
|
2003-05-09 17:25:50 -04:00
|
|
|
YYTOKEN = YYCURSOR;
|
|
|
|
|
|
|
|
ScalarBlock2:
|
|
|
|
YYTOKTMP = YYCURSOR;
|
|
|
|
|
|
|
|
{
|
|
|
|
YYCTYPE yych;
|
|
|
|
unsigned int yyaccept;
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy197;
|
|
|
|
yy198: ++YYCURSOR;
|
|
|
|
yy197:
|
2003-05-09 17:25:50 -04:00
|
|
|
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\f'){
|
|
|
|
if(yych <= '\000') goto yy205;
|
|
|
|
if(yych != '\n') goto yy207;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy201;
|
|
|
|
if(yych == '#') goto yy203;
|
|
|
|
goto yy207;
|
2003-05-30 19:09:54 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy199: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy209;
|
|
|
|
yy200:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 854
|
2003-05-29 19:33:10 -04:00
|
|
|
{ char *pacer;
|
|
|
|
char *tok = YYTOKTMP;
|
2003-06-10 10:15:27 -04:00
|
|
|
int indt_len = 0, nl_count = 0, fold_nl = 0, nl_begin = 0;
|
2003-07-28 23:27:01 -04:00
|
|
|
GOBBLE_UP_YAML_INDENT( indt_len, tok );
|
2003-05-09 17:25:50 -04:00
|
|
|
lvl = CURRENT_LEVEL();
|
|
|
|
|
|
|
|
if ( indt_len > parentIndent && lvl->status != syck_lvl_block )
|
|
|
|
{
|
2003-05-29 19:51:16 -04:00
|
|
|
int new_spaces = forceIndent > 0 ? forceIndent : indt_len;
|
|
|
|
ADD_LEVEL( new_spaces, syck_lvl_block );
|
|
|
|
lastIndent = indt_len - new_spaces;
|
2003-06-10 10:15:27 -04:00
|
|
|
nl_begin = 1;
|
|
|
|
lvl = CURRENT_LEVEL();
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-06-10 10:15:27 -04:00
|
|
|
else if ( lvl->status != syck_lvl_block )
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
|
|
|
YYCURSOR = YYTOKTMP;
|
2003-07-28 23:27:01 -04:00
|
|
|
RETURN_YAML_BLOCK();
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-05-29 19:33:10 -04:00
|
|
|
|
2003-07-04 08:51:42 -04:00
|
|
|
/*
|
|
|
|
* Fold only in the event of two lines being on the leftmost
|
|
|
|
* indentation.
|
|
|
|
*/
|
2003-05-29 19:33:10 -04:00
|
|
|
if ( blockType == BLOCK_FOLD && lastIndent == 0 && ( indt_len - lvl->spaces ) == 0 )
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
2003-05-29 19:33:10 -04:00
|
|
|
fold_nl = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
pacer = YYTOKTMP;
|
|
|
|
while ( pacer < YYCURSOR )
|
|
|
|
{
|
2003-06-10 10:15:27 -04:00
|
|
|
if ( is_newline( pacer++ ) )
|
2003-05-29 19:33:10 -04:00
|
|
|
nl_count++;
|
|
|
|
}
|
|
|
|
|
2003-06-10 10:15:27 -04:00
|
|
|
if ( fold_nl == 1 || nl_begin == 1 )
|
2003-05-29 19:33:10 -04:00
|
|
|
{
|
|
|
|
nl_count--;
|
|
|
|
}
|
|
|
|
|
2003-06-10 10:15:27 -04:00
|
|
|
if ( nl_count < 1 && nl_begin == 0 )
|
2003-05-29 19:33:10 -04:00
|
|
|
{
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, ' ');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for ( i = 0; i < nl_count; i++ )
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
2003-05-29 19:33:10 -04:00
|
|
|
QUOTECAT(qstr, qcapa, qidx, '\n');
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-05-29 19:33:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
lastIndent = indt_len - lvl->spaces;
|
|
|
|
YYCURSOR -= lastIndent;
|
|
|
|
|
|
|
|
if ( indt_len < lvl->spaces )
|
|
|
|
{
|
|
|
|
POP_LEVEL();
|
2003-05-09 17:25:50 -04:00
|
|
|
YYCURSOR = YYTOKTMP;
|
2003-07-28 23:27:01 -04:00
|
|
|
RETURN_YAML_BLOCK();
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
goto ScalarBlock2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy201: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy208;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy202:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 940
|
2003-06-10 10:15:27 -04:00
|
|
|
{ QUOTECAT(qstr, qcapa, qidx, *YYTOKTMP);
|
|
|
|
goto ScalarBlock2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy203: yych = *++YYCURSOR;
|
|
|
|
yy204:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 921
|
2003-05-30 19:09:54 -04:00
|
|
|
{ lvl = CURRENT_LEVEL();
|
|
|
|
if ( lvl->status != syck_lvl_block )
|
|
|
|
{
|
|
|
|
eat_comments( parser );
|
|
|
|
YYTOKTMP = YYCURSOR;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
QUOTECAT(qstr, qcapa, qidx, *YYTOKTMP);
|
|
|
|
}
|
|
|
|
goto ScalarBlock2;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy205: yych = *++YYCURSOR;
|
|
|
|
yy206:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 935
|
2003-05-29 19:33:10 -04:00
|
|
|
{ YYCURSOR--;
|
2003-05-09 17:25:50 -04:00
|
|
|
POP_LEVEL();
|
2003-07-28 23:27:01 -04:00
|
|
|
RETURN_YAML_BLOCK();
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy207: yych = *++YYCURSOR;
|
|
|
|
goto yy202;
|
|
|
|
yy208: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
YYMARKER = ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy209: if(yych <= '\f'){
|
|
|
|
if(yych == '\n') goto yy208;
|
|
|
|
goto yy200;
|
|
|
|
} else {
|
|
|
|
if(yych <= '\r') goto yy210;
|
|
|
|
if(yych == ' ') goto yy208;
|
|
|
|
goto yy200;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy210: ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy208;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy211: YYCURSOR = YYMARKER;
|
2003-06-10 10:15:27 -04:00
|
|
|
switch(yyaccept){
|
2003-09-03 14:58:27 -04:00
|
|
|
case 0: goto yy200;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 945
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2003-07-28 15:27:42 -04:00
|
|
|
return 0;
|
|
|
|
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
eat_comments( SyckParser *parser )
|
|
|
|
{
|
|
|
|
char *tok;
|
|
|
|
|
|
|
|
Comment:
|
|
|
|
{
|
|
|
|
tok = YYCURSOR;
|
|
|
|
|
|
|
|
{
|
|
|
|
YYCTYPE yych;
|
|
|
|
unsigned int yyaccept;
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy212;
|
|
|
|
yy213: ++YYCURSOR;
|
|
|
|
yy212:
|
2003-05-09 17:25:50 -04:00
|
|
|
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych <= '\n'){
|
|
|
|
if(yych <= '\000') goto yy214;
|
|
|
|
if(yych <= '\t') goto yy219;
|
|
|
|
goto yy216;
|
|
|
|
} else {
|
|
|
|
if(yych == '\r') goto yy217;
|
|
|
|
goto yy219;
|
2003-07-24 12:30:43 -04:00
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy214: yych = *++YYCURSOR;
|
|
|
|
yy215:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 963
|
2003-07-28 15:27:42 -04:00
|
|
|
{ YYCURSOR = tok;
|
2003-05-09 17:25:50 -04:00
|
|
|
return;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy216: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
2003-09-03 14:58:27 -04:00
|
|
|
goto yy221;
|
|
|
|
yy217: yych = *++YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy220;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy218:
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 967
|
2003-05-09 17:25:50 -04:00
|
|
|
{ goto Comment;
|
|
|
|
}
|
2003-09-03 14:58:27 -04:00
|
|
|
yy219: yych = *++YYCURSOR;
|
|
|
|
goto yy218;
|
|
|
|
yy220: yyaccept = 0;
|
2003-06-10 10:15:27 -04:00
|
|
|
YYMARKER = ++YYCURSOR;
|
2003-05-09 17:25:50 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
yy221: if(yych == '\n') goto yy220;
|
|
|
|
if(yych != '\r') goto yy215;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy222: ++YYCURSOR;
|
2003-06-10 10:15:27 -04:00
|
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
|
|
yych = *YYCURSOR;
|
2003-10-14 19:15:19 -04:00
|
|
|
if(yych == '\n') goto yy220;
|
2003-09-03 14:58:27 -04:00
|
|
|
yy223: YYCURSOR = YYMARKER;
|
2003-06-10 10:15:27 -04:00
|
|
|
switch(yyaccept){
|
2003-09-03 14:58:27 -04:00
|
|
|
case 0: goto yy215;
|
2003-05-19 14:46:57 -04:00
|
|
|
}
|
2003-05-09 17:25:50 -04:00
|
|
|
}
|
2003-10-14 19:15:19 -04:00
|
|
|
#line 970
|
2003-05-09 17:25:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2003-06-10 10:15:27 -04:00
|
|
|
int
|
|
|
|
is_newline( char *ptr )
|
|
|
|
{
|
|
|
|
if ( *ptr == '\n' )
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
if ( *ptr == '\r' && *( ptr + 1 ) == '\n' )
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-05-09 17:25:50 -04:00
|
|
|
int
|
2003-07-28 15:27:42 -04:00
|
|
|
syckwrap()
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2003-07-28 15:27:42 -04:00
|
|
|
syckerror( char *msg )
|
2003-05-09 17:25:50 -04:00
|
|
|
{
|
|
|
|
if ( syck_parser_ptr->error_handler == NULL )
|
|
|
|
syck_parser_ptr->error_handler = syck_default_error_handler;
|
|
|
|
|
2003-05-15 17:46:47 -04:00
|
|
|
syck_parser_ptr->root = syck_parser_ptr->root_on_error;
|
2003-05-09 17:25:50 -04:00
|
|
|
(syck_parser_ptr->error_handler)(syck_parser_ptr, msg);
|
|
|
|
}
|
|
|
|
|