From 71a8bebf5a130735b6455426b25a817fb31463c8 Mon Sep 17 00:00:00 2001 From: why Date: Fri, 17 Oct 2003 20:53:39 +0000 Subject: [PATCH] * ext/syck/rubyext.c: YAML::Syck::compile method. * ext/syck/syck.c: Buffer edge bug. * ext/syck/yaml2byte.c: YAML to bytecode converter. * ext/syck/bytecode.c: Bytecode parser fixes to empty collections and empty strings. * ext/syck/token.c: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 13 + ext/syck/MANIFEST | 1 + ext/syck/bytecode.c | 708 +++++++--- ext/syck/implicit.c | 3165 ++++++++++++++++++++++++++++++------------ ext/syck/rubyext.c | 47 + ext/syck/syck.c | 4 +- ext/syck/syck.h | 3 + ext/syck/token.c | 1477 +++++++++++++------- ext/syck/yaml2byte.c | 251 ++++ 9 files changed, 4111 insertions(+), 1558 deletions(-) create mode 100644 ext/syck/yaml2byte.c diff --git a/ChangeLog b/ChangeLog index 83f9681aad..ef508e7a8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Sat Oct 18 05:48:59 2003 why the lucky stiff + + * ext/syck/rubyext.c: YAML::Syck::compile method. + + * ext/syck/syck.c: Buffer edge bug. + + * ext/syck/yaml2byte.c: YAML to bytecode converter. + + * ext/syck/bytecode.c: Bytecode parser fixes to empty collections + and empty strings. + + * ext/syck/token.c: Ditto. + Fri Oct 17 23:07:38 2003 Akinori MUSHA * ext/enumerator/enumerator.c, ext/enumerator/enumerator.txt: diff --git a/ext/syck/MANIFEST b/ext/syck/MANIFEST index c7079e5fb0..5f5fcaf968 100644 --- a/ext/syck/MANIFEST +++ b/ext/syck/MANIFEST @@ -11,3 +11,4 @@ rubyext.c syck.c syck.h token.c +yaml2byte.c diff --git a/ext/syck/bytecode.c b/ext/syck/bytecode.c index efc9890c4d..848f69f918 100644 --- a/ext/syck/bytecode.c +++ b/ext/syck/bytecode.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.5 on Tue Oct 14 15:44:30 2003 */ +/* Generated by re2c 0.5 on Fri Oct 17 12:13:58 2003 */ #line 1 "bytecode.re" /* * bytecode.re @@ -62,6 +62,11 @@ char *get_inline( SyckParser *parser ); ADD_LEVEL(len, syck_lvl_open); \ YYPOS(0); \ return '-'; \ + \ + case syck_lvl_map: \ + lvl->ncount++; \ + ADD_LEVEL(len, s); \ + break; \ \ case syck_lvl_open: \ lvl->status = s; \ @@ -139,7 +144,7 @@ sycklex_bytecode_utf8( YYSTYPE *sycklval, SyckParser *parser ) return t; } -#line 163 +#line 168 lvl = CURRENT_LEVEL(); @@ -160,19 +165,24 @@ yy1: ++YYCURSOR; yy0: if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; - if(yych <= '\000') goto yy2; - if(yych == 'D') goto yy3; - goto yy5; + switch(yych){ + case '\000': goto yy2; + case 'D': goto yy3; + default: goto yy5; + } yy2: YYCURSOR = YYMARKER; switch(yyaccept){ case 0: goto yy4; } yy3: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == '\n') goto yy6; - if(yych == '\r') goto yy8; + switch(yych){ + case '\n': goto yy6; + case '\r': goto yy8; + default: goto yy4; + } yy4: -#line 189 +#line 194 { YYPOS(0); goto Document; } @@ -180,7 +190,7 @@ yy5: yych = *++YYCURSOR; goto yy4; yy6: yych = *++YYCURSOR; yy7: -#line 177 +#line 182 { if ( lvl->status == syck_lvl_header ) { goto Directive; @@ -193,10 +203,12 @@ yy7: } } yy8: yych = *++YYCURSOR; - if(yych == '\n') goto yy6; - goto yy2; + switch(yych){ + case '\n': goto yy6; + default: goto yy2; + } } -#line 193 +#line 198 lvl->status = syck_lvl_doc; @@ -219,71 +231,61 @@ yy10: ++YYCURSOR; yy9: if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; - if(yych <= 'E'){ - if(yych <= '\r'){ - if(yych <= '\t'){ - if(yych <= '\000') goto yy30; - } else { - if(yych <= '\n') goto yy27; - if(yych >= '\r') goto yy29; - } - } else { - if(yych <= 'A'){ - if(yych >= 'A') goto yy19; - } else { - if(yych <= 'C') goto yy11; - if(yych <= 'D') goto yy12; - goto yy16; - } - } - } else { - if(yych <= 'Q'){ - if(yych <= 'M'){ - if(yych >= 'M') goto yy14; - } else { - if(yych <= 'O') goto yy11; - if(yych <= 'P') goto yy13; - goto yy15; - } - } else { - if(yych <= 'T'){ - if(yych <= 'R') goto yy21; - if(yych <= 'S') goto yy17; - goto yy23; - } else { - if(yych == 'c') goto yy25; - } - } + switch(yych){ + case '\000': goto yy30; + case '\n': goto yy27; + case '\r': goto yy29; + case 'A': goto yy19; + case 'D': goto yy12; + case 'E': goto yy16; + case 'M': goto yy14; + case 'P': goto yy13; + case 'Q': goto yy15; + case 'R': goto yy21; + case 'S': goto yy17; + case 'T': goto yy23; + case 'c': goto yy25; + default: goto yy11; } yy11:yy12: yych = *++YYCURSOR; - if(yych == '\n') goto yy41; - if(yych == '\r') goto yy44; - goto yy11; + switch(yych){ + case '\n': goto yy41; + case '\r': goto yy44; + default: goto yy11; + } yy13: yych = *++YYCURSOR; - if(yych == '\n') goto yy41; - if(yych == '\r') goto yy43; - goto yy11; + switch(yych){ + case '\n': goto yy41; + case '\r': goto yy43; + default: goto yy11; + } yy14: yych = *++YYCURSOR; - if(yych == '\n') goto yy38; - if(yych == '\r') goto yy40; - goto yy11; + switch(yych){ + case '\n': goto yy38; + case '\r': goto yy40; + default: goto yy11; + } yy15: yych = *++YYCURSOR; - if(yych == '\n') goto yy35; - if(yych == '\r') goto yy37; - goto yy11; + switch(yych){ + case '\n': goto yy35; + case '\r': goto yy37; + default: goto yy11; + } yy16: yych = *++YYCURSOR; - if(yych == '\n') goto yy32; - if(yych == '\r') goto yy34; - goto yy11; + switch(yych){ + case '\n': goto yy32; + case '\r': goto yy34; + default: goto yy11; + } yy17: yych = *++YYCURSOR; yy18: -#line 243 +#line 282 { ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str); goto Scalar; } yy19: yych = *++YYCURSOR; yy20: -#line 247 +#line 286 { ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open); sycklval->name = get_inline( parser ); syck_hdlr_remove_anchor( parser, sycklval->name ); @@ -291,7 +293,7 @@ yy20: } yy21: yych = *++YYCURSOR; yy22: -#line 253 +#line 292 { ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str); sycklval->name = get_inline( parser ); POP_LEVEL(); @@ -300,8 +302,10 @@ yy22: } yy23: yych = *++YYCURSOR; yy24: -#line 260 - { char *qstr = get_inline( parser ); +#line 299 + { char *qstr; + ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open); + qstr = get_inline( parser ); if ( qstr[0] == '!' ) { int qidx = strlen( qstr ); @@ -347,6 +351,7 @@ yy24: else { sycklval->name = S_ALLOC_N( char, strlen( qstr ) ); + sycklval->name[0] = '\0'; S_MEMCPY( sycklval->name, qstr + 1, char, strlen( qstr ) ); free( qstr ); } @@ -358,37 +363,53 @@ yy24: } yy25: yych = *++YYCURSOR; yy26: -#line 316 +#line 358 { goto Comment; } yy27: yych = *++YYCURSOR; yy28: -#line 318 +#line 360 { if ( lvl->status == syck_lvl_seq ) { return YAML_INDENT; } else if ( lvl->status == syck_lvl_map ) { - lvl->ncount++; if ( lvl->ncount % 2 == 1 ) return ':'; else return YAML_INDENT; } goto Document; } yy29: yych = *++YYCURSOR; - if(yych == '\n') goto yy27; - goto yy11; + switch(yych){ + case '\n': goto yy27; + default: goto yy11; + } yy30: yych = *++YYCURSOR; yy31: -#line 331 +#line 372 { ENSURE_YAML_IEND(lvl, -1); YYPOS(0); return 0; } yy32: yych = *++YYCURSOR; yy33: -#line 222 - { POP_LEVEL(); +#line 247 + { if ( lvl->status == syck_lvl_seq && lvl->ncount == 0 ) + { + lvl->ncount++; + YYPOS(0); + FORCE_NEXT_TOKEN( ']' ); + return '['; + } + else if ( lvl->status == syck_lvl_map && lvl->ncount == 0 ) + { + lvl->ncount++; + YYPOS(0); + FORCE_NEXT_TOKEN( '}' ); + return '{'; + } + + POP_LEVEL(); lvl = CURRENT_LEVEL(); if ( lvl->status == syck_lvl_seq ) { @@ -396,7 +417,6 @@ yy33: } else if ( lvl->status == syck_lvl_map ) { - lvl->ncount++; if ( lvl->ncount % 2 == 1 ) { FORCE_NEXT_TOKEN(':'); @@ -409,41 +429,71 @@ yy33: return YAML_IEND; } yy34: yych = *++YYCURSOR; - if(yych == '\n') goto yy32; - goto yy11; + switch(yych){ + case '\n': goto yy32; + default: goto yy11; + } yy35: yych = *++YYCURSOR; yy36: -#line 218 - { ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_seq); +#line 233 + { int complex = 0; + if ( lvl->ncount % 2 == 0 && ( lvl->status == syck_lvl_map || lvl->status == syck_lvl_seq ) ) + { + complex = 1; + } + ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_seq); + if ( complex ) + { + FORCE_NEXT_TOKEN( YAML_IOPEN ); + return '?'; + } return YAML_IOPEN; } yy37: yych = *++YYCURSOR; - if(yych == '\n') goto yy35; - goto yy11; + switch(yych){ + case '\n': goto yy35; + default: goto yy11; + } yy38: yych = *++YYCURSOR; yy39: -#line 214 - { ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_map); +#line 219 + { int complex = 0; + if ( lvl->ncount % 2 == 0 && ( lvl->status == syck_lvl_map || lvl->status == syck_lvl_seq ) ) + { + complex = 1; + } + ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_map); + if ( complex ) + { + FORCE_NEXT_TOKEN( YAML_IOPEN ); + return '?'; + } return YAML_IOPEN; } yy40: yych = *++YYCURSOR; - if(yych == '\n') goto yy38; - goto yy11; + switch(yych){ + case '\n': goto yy38; + default: goto yy11; + } yy41: yych = *++YYCURSOR; yy42: -#line 209 +#line 214 { ENSURE_YAML_IEND(lvl, -1); YYPOS(0); return 0; } yy43: yych = *++YYCURSOR; - if(yych == '\n') goto yy41; - goto yy11; + switch(yych){ + case '\n': goto yy41; + default: goto yy11; + } yy44: yych = *++YYCURSOR; - if(yych == '\n') goto yy41; - goto yy11; + switch(yych){ + case '\n': goto yy41; + default: goto yy11; + } } -#line 336 +#line 377 } @@ -460,20 +510,97 @@ yy46: ++YYCURSOR; yy45: if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if(yych <= '\000') goto yy47; - if(yych == 'V') goto yy48; - goto yy50; + switch(yych){ + case '\000': goto yy47; + case 'V': goto yy48; + default: goto yy50; + } yy47: YYCURSOR = YYMARKER; switch(yyaccept){ case 0: goto yy49; } yy48: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '-') goto yy49; - if(yych == '`') goto yy49; - if(yych <= 'z') goto yy51; + switch(yych){ + case '.': + case '/': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case ':': + case ';': + case '<': + case '=': + case '>': + case '?': + case '@': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '[': + case '\\': + case ']': + case '^': + case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy51; + default: goto yy49; + } yy49: -#line 348 +#line 389 { YYCURSOR = YYTOKTMP; return YAML_DOCSEP; } @@ -482,44 +609,256 @@ yy50: yych = *++YYCURSOR; yy51: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy52: if(yych <= ':'){ - if(yych <= '-') goto yy47; - if(yych <= '9') goto yy51; - } else { - if(yych == '`') goto yy47; - if(yych <= 'z') goto yy51; - goto yy47; +yy52: switch(yych){ + case '.': + case '/': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case ';': + case '<': + case '=': + case '>': + case '?': + case '@': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '[': + case '\\': + case ']': + case '^': + case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy51; + case ':': goto yy53; + default: goto yy47; } yy53: yych = *++YYCURSOR; - if(yych <= '-') goto yy47; - if(yych == '`') goto yy47; - if(yych >= '{') goto yy47; + switch(yych){ + case '.': + case '/': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case ':': + case ';': + case '<': + case '=': + case '>': + case '?': + case '@': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '[': + case '\\': + case ']': + case '^': + case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy54; + default: goto yy47; + } yy54: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy55: if(yych <= '\r'){ - if(yych == '\n') goto yy56; - if(yych <= '\f') goto yy47; - goto yy58; - } else { - if(yych <= '_'){ - if(yych <= '-') goto yy47; - goto yy54; - } else { - if(yych <= '`') goto yy47; - if(yych <= 'z') goto yy54; - goto yy47; - } +yy55: switch(yych){ + case '\n': goto yy56; + case '\r': goto yy58; + case '.': + case '/': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case ':': + case ';': + case '<': + case '=': + case '>': + case '?': + case '@': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '[': + case '\\': + case ']': + case '^': + case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy54; + default: goto yy47; } yy56: yych = *++YYCURSOR; yy57: -#line 346 +#line 387 { goto Directive; } yy58: yych = *++YYCURSOR; - if(yych == '\n') goto yy56; - goto yy47; + switch(yych){ + case '\n': goto yy56; + default: goto yy47; + } } -#line 351 +#line 392 } @@ -536,29 +875,30 @@ yy60: ++YYCURSOR; yy59: if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if(yych <= '\n'){ - if(yych <= '\000') goto yy61; - if(yych <= '\t') goto yy66; - goto yy62; - } else { - if(yych == '\r') goto yy64; - goto yy66; + switch(yych){ + case '\000': goto yy61; + case '\n': goto yy62; + case '\r': goto yy64; + default: goto yy66; } yy61:yy62: yych = *++YYCURSOR; yy63: -#line 361 +#line 402 { goto Document; } yy64: yych = *++YYCURSOR; - if(yych == '\n') goto yy67; + switch(yych){ + case '\n': goto yy67; + default: goto yy65; + } yy65: -#line 363 +#line 404 { goto Comment; } yy66: yych = *++YYCURSOR; goto yy65; yy67: yych = *++YYCURSOR; goto yy63; } -#line 365 +#line 406 } @@ -570,6 +910,8 @@ Scalar: char *str = S_ALLOC_N( char, cap ); char *tok; + str[0] = '\0'; + Scalar2: tok = YYCURSOR; @@ -581,59 +923,71 @@ yy69: ++YYCURSOR; yy68: if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; - if(yych <= '\n'){ - if(yych <= '\000') goto yy74; - if(yych <= '\t') goto yy76; - } else { - if(yych == '\r') goto yy72; - goto yy76; + switch(yych){ + case '\000': goto yy74; + case '\n': goto yy70; + case '\r': goto yy72; + default: goto yy76; } yy70: yych = *++YYCURSOR; - if(yych <= 'M'){ - if(yych == 'C') goto yy78; - } else { - if(yych <= 'N') goto yy80; - if(yych == 'Z') goto yy83; + switch(yych){ + case 'C': goto yy78; + case 'N': goto yy80; + case 'Z': goto yy83; + default: goto yy71; } yy71: -#line 404 +#line 447 { YYCURSOR = tok; goto ScalarEnd; } yy72: yych = *++YYCURSOR; - if(yych == '\n') goto yy77; + switch(yych){ + case '\n': goto yy77; + default: goto yy73; + } yy73: -#line 412 +#line 455 { CAT(str, cap, idx, tok[0]); goto Scalar2; } yy74: yych = *++YYCURSOR; yy75: -#line 408 +#line 451 { YYCURSOR = tok; goto ScalarEnd; } yy76: yych = *++YYCURSOR; goto yy73; yy77: yych = *++YYCURSOR; - if(yych <= 'M'){ - if(yych != 'C') goto yy71; - } else { - if(yych <= 'N') goto yy80; - if(yych == 'Z') goto yy83; - goto yy71; + switch(yych){ + case 'C': goto yy78; + case 'N': goto yy80; + case 'Z': goto yy83; + default: goto yy71; } yy78: yych = *++YYCURSOR; yy79: -#line 381 +#line 424 { goto Scalar2; } yy80: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy81: if(yych <= '/') goto yy82; - if(yych <= '9') goto yy80; +yy81: switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy80; + default: goto yy82; + } yy82: -#line 383 +#line 426 { if ( tok + 2 < YYCURSOR ) { char *count = tok + 2; @@ -652,12 +1006,12 @@ yy82: } yy83: yych = *++YYCURSOR; yy84: -#line 400 +#line 443 { CAT(str, cap, idx, '\0'); goto Scalar2; } } -#line 416 +#line 459 ScalarEnd: @@ -685,6 +1039,8 @@ get_inline( SyckParser *parser ) char *str = S_ALLOC_N( char, cap ); char *tok; + str[0] = '\0'; + Inline: { tok = YYCURSOR; @@ -697,27 +1053,29 @@ yy86: ++YYCURSOR; yy85: if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if(yych <= '\n'){ - if(yych <= '\000') goto yy91; - if(yych <= '\t') goto yy93; - } else { - if(yych == '\r') goto yy89; - goto yy93; + switch(yych){ + case '\000': goto yy91; + case '\n': goto yy87; + case '\r': goto yy89; + default: goto yy93; } yy87: yych = *++YYCURSOR; yy88: -#line 449 +#line 494 { return str; } yy89: yych = *++YYCURSOR; - if(yych == '\n') goto yy94; + switch(yych){ + case '\n': goto yy94; + default: goto yy90; + } yy90: -#line 455 +#line 500 { CAT(str, cap, idx, tok[0]); goto Inline; } yy91: yych = *++YYCURSOR; yy92: -#line 451 +#line 496 { YYCURSOR = tok; return str; } @@ -726,7 +1084,7 @@ yy93: yych = *++YYCURSOR; yy94: yych = *++YYCURSOR; goto yy88; } -#line 459 +#line 504 } diff --git a/ext/syck/implicit.c b/ext/syck/implicit.c index a34e5d30f2..1dfeac3953 100644 --- a/ext/syck/implicit.c +++ b/ext/syck/implicit.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.5 on Thu Oct 9 09:11:08 2003 */ +/* Generated by re2c 0.5 on Thu Oct 16 14:12:57 2003 */ #line 1 "implicit.re" /* * implicit.re @@ -58,56 +58,35 @@ yy1: ++YYCURSOR; yy0: if((YYLIMIT - YYCURSOR) < 26) YYFILL(26); yych = *YYCURSOR; - if(yych <= 'N'){ - if(yych <= '0'){ - if(yych <= ','){ - if(yych <= '\000') goto yy6; - if(yych == '+') goto yy16; - goto yy23; - } else { - if(yych <= '-') goto yy17; - if(yych <= '.') goto yy20; - if(yych <= '/') goto yy23; - goto yy18; - } - } else { - if(yych <= '='){ - if(yych <= '9') goto yy19; - if(yych <= ';') goto yy23; - if(yych <= '<') goto yy22; - goto yy21; - } else { - if(yych == 'F') goto yy15; - if(yych <= 'M') goto yy23; - goto yy5; - } - } - } else { - if(yych <= 'm'){ - if(yych <= 'X'){ - if(yych <= 'O') goto yy13; - if(yych == 'T') goto yy9; - goto yy23; - } else { - if(yych <= 'Y') goto yy11; - if(yych == 'f') goto yy14; - goto yy23; - } - } else { - if(yych <= 't'){ - if(yych <= 'n') goto yy4; - if(yych <= 'o') goto yy12; - if(yych <= 's') goto yy23; - goto yy8; - } else { - if(yych <= 'y'){ - if(yych <= 'x') goto yy23; - goto yy10; - } else { - if(yych != '~') goto yy23; - } - } - } + switch(yych){ + case '\000': goto yy6; + case '+': goto yy16; + case '-': goto yy17; + case '.': goto yy20; + case '0': goto yy18; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + case '<': goto yy22; + case '=': goto yy21; + case 'F': goto yy15; + case 'N': goto yy5; + case 'O': goto yy13; + case 'T': goto yy9; + case 'Y': goto yy11; + case 'f': goto yy14; + case 'n': goto yy4; + case 'o': goto yy12; + case 't': goto yy8; + case 'y': goto yy10; + case '~': goto yy2; + default: goto yy23; } yy2: yych = *++YYCURSOR; if(yych <= '\000') goto yy6; @@ -116,23 +95,18 @@ yy3: { return "str"; } yy4: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'o') goto yy163; - if(yych == 'u') goto yy191; - goto yy3; + switch(yych){ + case 'o': goto yy163; + case 'u': goto yy191; + default: goto yy3; + } yy5: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'U'){ - if(yych == 'O') goto yy163; - if(yych <= 'T') goto yy3; - goto yy186; - } else { - if(yych <= 'o'){ - if(yych <= 'n') goto yy3; - goto yy163; - } else { - if(yych == 'u') goto yy187; - goto yy3; - } + switch(yych){ + case 'O': case 'o': goto yy163; + case 'U': goto yy186; + case 'u': goto yy187; + default: goto yy3; } yy6: yych = *++YYCURSOR; yy7: @@ -140,126 +114,145 @@ yy7: { return "null"; } yy8: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'r') goto yy184; - goto yy3; + switch(yych){ + case 'r': goto yy184; + default: goto yy3; + } yy9: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'R') goto yy180; - if(yych == 'r') goto yy181; - goto yy3; + switch(yych){ + case 'R': goto yy180; + case 'r': goto yy181; + default: goto yy3; + } yy10: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'e') goto yy179; - goto yy3; + switch(yych){ + case 'e': goto yy179; + default: goto yy3; + } yy11: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'E') goto yy177; - if(yych == 'e') goto yy178; - goto yy3; + switch(yych){ + case 'E': goto yy177; + case 'e': goto yy178; + default: goto yy3; + } yy12: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'f') goto yy176; - if(yych == 'n') goto yy173; - goto yy3; + switch(yych){ + case 'f': goto yy176; + case 'n': goto yy173; + default: goto yy3; + } yy13: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'N'){ - if(yych == 'F') goto yy171; - if(yych <= 'M') goto yy3; - goto yy173; - } else { - if(yych <= 'f'){ - if(yych <= 'e') goto yy3; - goto yy172; - } else { - if(yych == 'n') goto yy173; - goto yy3; - } + switch(yych){ + case 'F': goto yy171; + case 'N': case 'n': goto yy173; + case 'f': goto yy172; + default: goto yy3; } yy14: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'a') goto yy168; - goto yy3; + switch(yych){ + case 'a': goto yy168; + default: goto yy3; + } yy15: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'A') goto yy159; - if(yych == 'a') goto yy160; - goto yy3; + switch(yych){ + case 'A': goto yy159; + case 'a': goto yy160; + default: goto yy3; + } yy16: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy158; - goto yy3; - } else { - if(yych <= '0') goto yy149; - if(yych <= '9') goto yy47; - goto yy3; + switch(yych){ + case '.': goto yy158; + case '0': goto yy149; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy47; + default: goto yy3; } yy17: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy148; - goto yy3; - } else { - if(yych <= '0') goto yy149; - if(yych <= '9') goto yy47; - goto yy3; + switch(yych){ + case '.': goto yy148; + case '0': goto yy149; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy47; + default: goto yy3; } yy18: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '.'){ - if(yych <= '+'){ - if(yych <= '\000') goto yy51; - goto yy3; - } else { - if(yych <= ',') goto yy133; - if(yych <= '-') goto yy3; - goto yy49; - } - } else { - if(yych <= '9'){ - if(yych <= '/') goto yy3; - if(yych <= '7') goto yy131; - goto yy132; - } else { - if(yych == 'x') goto yy135; - goto yy3; - } + switch(yych){ + case '\000': goto yy51; + case ',': goto yy133; + case '.': goto yy49; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': goto yy131; + case '8': + case '9': goto yy132; + case 'x': goto yy135; + default: goto yy3; } yy19: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '-'){ - if(yych <= '\000') goto yy51; - if(yych == ',') goto yy47; - goto yy3; - } else { - if(yych <= '.') goto yy49; - if(yych <= '/') goto yy3; - if(yych <= '9') goto yy46; - goto yy3; + switch(yych){ + case '\000': goto yy51; + case ',': goto yy47; + case '.': goto yy49; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy46; + default: goto yy3; } yy20: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'N'){ - if(yych == 'I') goto yy33; - if(yych <= 'M') goto yy3; - goto yy31; - } else { - if(yych <= 'i'){ - if(yych <= 'h') goto yy3; - goto yy32; - } else { - if(yych == 'n') goto yy30; - goto yy3; - } + switch(yych){ + case 'I': goto yy33; + case 'N': goto yy31; + case 'i': goto yy32; + case 'n': goto yy30; + default: goto yy3; } yy21: yych = *++YYCURSOR; if(yych <= '\000') goto yy28; goto yy3; yy22: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == '<') goto yy24; - goto yy3; + switch(yych){ + case '<': goto yy24; + default: goto yy3; + } yy23: yych = *++YYCURSOR; goto yy3; yy24: yych = *++YYCURSOR; @@ -277,24 +270,37 @@ yy29: #line 112 { return "default"; } yy30: yych = *++YYCURSOR; - if(yych == 'a') goto yy45; - goto yy25; + switch(yych){ + case 'a': goto yy45; + default: goto yy25; + } yy31: yych = *++YYCURSOR; - if(yych == 'A') goto yy40; - if(yych == 'a') goto yy41; - goto yy25; + switch(yych){ + case 'A': goto yy40; + case 'a': goto yy41; + default: goto yy25; + } yy32: yych = *++YYCURSOR; - if(yych == 'n') goto yy39; - goto yy25; + switch(yych){ + case 'n': goto yy39; + default: goto yy25; + } yy33: yych = *++YYCURSOR; - if(yych == 'N') goto yy34; - if(yych == 'n') goto yy35; - goto yy25; + switch(yych){ + case 'N': goto yy34; + case 'n': goto yy35; + default: goto yy25; + } yy34: yych = *++YYCURSOR; - if(yych == 'F') goto yy36; - goto yy25; + switch(yych){ + case 'F': goto yy36; + default: goto yy25; + } yy35: yych = *++YYCURSOR; - if(yych != 'f') goto yy25; + switch(yych){ + case 'f': goto yy36; + default: goto yy25; + } yy36: yych = *++YYCURSOR; if(yych >= '\001') goto yy25; yy37: yych = *++YYCURSOR; @@ -302,13 +308,20 @@ yy38: #line 98 { return "float#inf"; } yy39: yych = *++YYCURSOR; - if(yych == 'f') goto yy36; - goto yy25; + switch(yych){ + case 'f': goto yy36; + default: goto yy25; + } yy40: yych = *++YYCURSOR; - if(yych == 'N') goto yy42; - goto yy25; + switch(yych){ + case 'N': goto yy42; + default: goto yy25; + } yy41: yych = *++YYCURSOR; - if(yych != 'N') goto yy25; + switch(yych){ + case 'N': goto yy42; + default: goto yy25; + } yy42: yych = *++YYCURSOR; if(yych >= '\001') goto yy25; yy43: yych = *++YYCURSOR; @@ -316,46 +329,61 @@ yy44: #line 102 { return "float#nan"; } yy45: yych = *++YYCURSOR; - if(yych == 'n') goto yy42; - goto yy25; + switch(yych){ + case 'n': goto yy42; + default: goto yy25; + } yy46: yych = *++YYCURSOR; - if(yych <= '/') goto yy48; - if(yych <= '9') goto yy65; - goto yy48; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy65; + default: goto yy48; + } yy47: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy48: if(yych <= '-'){ - if(yych <= '\000') goto yy51; - if(yych == ',') goto yy47; - goto yy25; - } else { - if(yych <= '.') goto yy49; - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy47; - goto yy25; +yy48: switch(yych){ + case '\000': goto yy51; + case ',': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy47; + case '.': goto yy49; + default: goto yy25; } yy49: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy50: if(yych <= '/'){ - if(yych <= ','){ - if(yych <= '\000') goto yy55; - if(yych <= '+') goto yy25; - goto yy53; - } else { - if(yych == '.') goto yy57; - goto yy25; - } - } else { - if(yych <= 'E'){ - if(yych <= '9') goto yy49; - if(yych <= 'D') goto yy25; - goto yy59; - } else { - if(yych == 'e') goto yy59; - goto yy25; - } +yy50: switch(yych){ + case '\000': goto yy55; + case ',': goto yy53; + case '.': goto yy57; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy49; + case 'E': case 'e': goto yy59; + default: goto yy25; } yy51: yych = *++YYCURSOR; yy52: @@ -364,14 +392,19 @@ yy52: yy53: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy54: if(yych <= ','){ - if(yych <= '\000') goto yy55; - if(yych <= '+') goto yy25; - goto yy53; - } else { - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy53; - goto yy25; +yy54: switch(yych){ + case '\000': goto yy55; + case ',': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy53; + default: goto yy25; } yy55: yych = *++YYCURSOR; yy56: @@ -380,277 +413,671 @@ yy56: yy57: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy58: if(yych <= '9'){ - if(yych == '.') goto yy57; - if(yych <= '/') goto yy25; - goto yy57; - } else { - if(yych <= 'E'){ - if(yych <= 'D') goto yy25; - } else { - if(yych != 'e') goto yy25; - } +yy58: switch(yych){ + case '.': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy57; + case 'E': case 'e': goto yy59; + default: goto yy25; } yy59: yych = *++YYCURSOR; - if(yych == '+') goto yy60; - if(yych != '-') goto yy25; + switch(yych){ + case '+': case '-': goto yy60; + default: goto yy25; + } yy60: yych = *++YYCURSOR; if(yych <= '\000') goto yy25; goto yy62; yy61: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy62: if(yych <= '\000') goto yy63; - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy61; - goto yy25; +yy62: switch(yych){ + case '\000': goto yy63; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy61; + default: goto yy25; + } yy63: yych = *++YYCURSOR; yy64: #line 96 { return "float#exp"; } yy65: yych = *++YYCURSOR; - if(yych <= '/') goto yy48; - if(yych >= ':') goto yy48; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy66; + default: goto yy48; + } yy66: yych = *++YYCURSOR; - if(yych != '-') goto yy48; + switch(yych){ + case '-': goto yy67; + default: goto yy48; + } yy67: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy68; + default: goto yy25; + } yy68: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy69; + default: goto yy25; + } yy69: yych = *++YYCURSOR; - if(yych != '-') goto yy25; + switch(yych){ + case '-': goto yy70; + default: goto yy25; + } yy70: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy71; + default: goto yy25; + } yy71: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy72; + default: goto yy25; + } yy72: yych = *++YYCURSOR; - if(yych <= 'S'){ - if(yych <= '\000') goto yy73; - if(yych <= '/') goto yy78; - if(yych <= '9') goto yy25; - goto yy78; - } else { - if(yych <= 'T') goto yy75; - if(yych == 't') goto yy76; - goto yy78; + switch(yych){ + case '\000': goto yy73; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy25; + case 'T': goto yy75; + case 't': goto yy76; + default: goto yy78; } yy73: yych = *++YYCURSOR; yy74: #line 104 { return "timestamp#ymd"; } yy75: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy117; - goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy117; + default: goto yy25; + } yy76: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy99; - goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy99; + default: goto yy25; + } yy77: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy78: if(yych <= '\037'){ - if(yych == '\t') goto yy77; - goto yy25; - } else { - if(yych <= ' ') goto yy77; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; +yy78: switch(yych){ + case '\t': case ' ': goto yy77; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy79; + default: goto yy25; } yy79: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy80; + default: goto yy25; + } yy80: yych = *++YYCURSOR; - if(yych != ':') goto yy25; + switch(yych){ + case ':': goto yy81; + default: goto yy25; + } yy81: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy82; + default: goto yy25; + } yy82: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy83; + default: goto yy25; + } yy83: yych = *++YYCURSOR; - if(yych != ':') goto yy25; + switch(yych){ + case ':': goto yy84; + default: goto yy25; + } yy84: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy85; + default: goto yy25; + } yy85: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy86; + default: goto yy25; + } yy86: yych = *++YYCURSOR; - if(yych <= '\037'){ - if(yych == '\t') goto yy89; - goto yy25; - } else { - if(yych <= ' ') goto yy89; - if(yych != '.') goto yy25; + switch(yych){ + case '\t': case ' ': goto yy89; + case '.': goto yy87; + default: goto yy25; } yy87: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy88: if(yych <= '\037'){ - if(yych != '\t') goto yy25; - } else { - if(yych <= ' ') goto yy89; - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy87; - goto yy25; +yy88: switch(yych){ + case '\t': case ' ': goto yy89; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy87; + default: goto yy25; } yy89: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy90: if(yych <= '*'){ - if(yych <= '\t'){ - if(yych <= '\b') goto yy25; - goto yy89; - } else { - if(yych == ' ') goto yy89; - goto yy25; - } - } else { - if(yych <= '-'){ - if(yych == ',') goto yy25; - goto yy92; - } else { - if(yych != 'Z') goto yy25; - } +yy90: switch(yych){ + case '\t': case ' ': goto yy89; + case '+': case '-': goto yy92; + case 'Z': goto yy91; + default: goto yy25; } yy91: yych = *++YYCURSOR; if(yych <= '\000') goto yy96; goto yy25; yy92: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy93; + default: goto yy25; + } yy93: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy94; + default: goto yy25; + } yy94: yych = *++YYCURSOR; - if(yych <= '\000') goto yy96; - if(yych != ':') goto yy25; + switch(yych){ + case '\000': goto yy96; + case ':': goto yy95; + default: goto yy25; + } yy95: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy98; - goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy98; + default: goto yy25; + } yy96: yych = *++YYCURSOR; yy97: #line 108 { return "timestamp#spaced"; } yy98: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy91; - goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy91; + default: goto yy25; + } yy99: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy100; + default: goto yy25; + } yy100: yych = *++YYCURSOR; - if(yych != ':') goto yy25; + switch(yych){ + case ':': goto yy101; + default: goto yy25; + } yy101: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy102; + default: goto yy25; + } yy102: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy103; + default: goto yy25; + } yy103: yych = *++YYCURSOR; - if(yych != ':') goto yy25; + switch(yych){ + case ':': goto yy104; + default: goto yy25; + } yy104: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy105; + default: goto yy25; + } yy105: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy106; + default: goto yy25; + } yy106: yych = *++YYCURSOR; - if(yych == '.') goto yy107; - if(yych <= '/') goto yy108; - if(yych <= '9') goto yy25; - goto yy108; + switch(yych){ + case '.': goto yy107; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy25; + default: goto yy108; + } yy107: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy108: if(yych <= '-'){ - if(yych == '+') goto yy110; - if(yych <= ',') goto yy25; - goto yy110; - } else { - if(yych <= '9'){ - if(yych <= '/') goto yy25; - goto yy107; - } else { - if(yych != 'Z') goto yy25; - } +yy108: switch(yych){ + case '+': case '-': goto yy110; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy107; + case 'Z': goto yy109; + default: goto yy25; } yy109: yych = *++YYCURSOR; if(yych <= '\000') goto yy114; goto yy25; yy110: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy111; + default: goto yy25; + } yy111: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy112; + default: goto yy25; + } yy112: yych = *++YYCURSOR; - if(yych <= '\000') goto yy114; - if(yych != ':') goto yy25; + switch(yych){ + case '\000': goto yy114; + case ':': goto yy113; + default: goto yy25; + } yy113: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy116; - goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy116; + default: goto yy25; + } yy114: yych = *++YYCURSOR; yy115: #line 106 { return "timestamp#iso8601"; } yy116: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy109; - goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy109; + default: goto yy25; + } yy117: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy118; + default: goto yy25; + } yy118: yych = *++YYCURSOR; - if(yych != ':') goto yy25; + switch(yych){ + case ':': goto yy119; + default: goto yy25; + } yy119: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy120; + default: goto yy25; + } yy120: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy121; + default: goto yy25; + } yy121: yych = *++YYCURSOR; - if(yych != ':') goto yy25; + switch(yych){ + case ':': goto yy122; + default: goto yy25; + } yy122: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy123; + default: goto yy25; + } yy123: yych = *++YYCURSOR; - if(yych <= '/') goto yy25; - if(yych >= ':') goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy124; + default: goto yy25; + } yy124: yych = *++YYCURSOR; - if(yych <= '/'){ - if(yych != '.') goto yy126; - } else { - if(yych <= '9') goto yy25; - if(yych == 'Z') goto yy127; - goto yy126; + switch(yych){ + case '.': goto yy125; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy25; + case 'Z': goto yy127; + default: goto yy126; } yy125: ++YYCURSOR; if((YYLIMIT - YYCURSOR) < 7) YYFILL(7); yych = *YYCURSOR; -yy126: if(yych <= '/'){ - if(yych <= '+'){ - if(yych <= '*') goto yy25; - goto yy110; - } else { - if(yych == '-') goto yy110; - goto yy25; - } - } else { - if(yych <= '9'){ - if(yych <= '0') goto yy125; - goto yy129; - } else { - if(yych == 'Z') goto yy109; - goto yy25; - } +yy126: switch(yych){ + case '+': case '-': goto yy110; + case '0': goto yy125; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy129; + case 'Z': goto yy109; + default: goto yy25; } yy127: yych = *++YYCURSOR; if(yych >= '\001') goto yy25; @@ -659,48 +1086,66 @@ yy128: yych = *++YYCURSOR; yy129: ++YYCURSOR; if((YYLIMIT - YYCURSOR) < 7) YYFILL(7); yych = *YYCURSOR; -yy130: if(yych <= '/'){ - if(yych <= '+'){ - if(yych <= '*') goto yy25; - goto yy110; - } else { - if(yych == '-') goto yy110; - goto yy25; - } - } else { - if(yych <= '9'){ - if(yych <= '0') goto yy125; - goto yy129; - } else { - if(yych == 'Z') goto yy127; - goto yy25; - } +yy130: switch(yych){ + case '+': case '-': goto yy110; + case '0': goto yy125; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy129; + case 'Z': goto yy127; + default: goto yy25; } yy131: yych = *++YYCURSOR; - if(yych <= '/') goto yy134; - if(yych <= '7') goto yy146; - if(yych <= '9') goto yy144; - goto yy134; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': goto yy146; + case '8': + case '9': goto yy144; + default: goto yy134; + } yy132: yych = *++YYCURSOR; - if(yych <= '/') goto yy143; - if(yych <= '9') goto yy144; - goto yy143; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy144; + default: goto yy143; + } yy133: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy134: if(yych <= '-'){ - if(yych <= '\000') goto yy140; - if(yych == ',') goto yy133; - goto yy25; - } else { - if(yych <= '/'){ - if(yych <= '.') goto yy49; - goto yy25; - } else { - if(yych <= '7') goto yy133; - if(yych <= '9') goto yy142; - goto yy25; - } +yy134: switch(yych){ + case '\000': goto yy140; + case ',': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': goto yy133; + case '.': goto yy49; + case '8': + case '9': goto yy142; + default: goto yy25; } yy135: yych = *++YYCURSOR; if(yych <= '\000') goto yy25; @@ -708,23 +1153,29 @@ yy135: yych = *++YYCURSOR; yy136: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy137: if(yych <= '9'){ - if(yych <= '+'){ - if(yych >= '\001') goto yy25; - } else { - if(yych <= ',') goto yy136; - if(yych <= '/') goto yy25; - goto yy136; - } - } else { - if(yych <= 'F'){ - if(yych <= '@') goto yy25; - goto yy136; - } else { - if(yych <= '`') goto yy25; - if(yych <= 'f') goto yy136; - goto yy25; - } +yy137: switch(yych){ + case '\000': goto yy138; + case ',': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': goto yy136; + default: goto yy25; } yy138: yych = *++YYCURSOR; yy139: @@ -737,49 +1188,91 @@ yy141: yy142: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy143: if(yych <= '-'){ - if(yych == ',') goto yy142; - goto yy25; - } else { - if(yych <= '.') goto yy49; - if(yych <= '/') goto yy25; - if(yych <= '9') goto yy142; - goto yy25; +yy143: switch(yych){ + case ',': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy142; + case '.': goto yy49; + default: goto yy25; } yy144: yych = *++YYCURSOR; - if(yych <= '/') goto yy143; - if(yych >= ':') goto yy143; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy145; + default: goto yy143; + } yy145: yych = *++YYCURSOR; - if(yych == '-') goto yy67; - goto yy143; + switch(yych){ + case '-': goto yy67; + default: goto yy143; + } yy146: yych = *++YYCURSOR; - if(yych <= '/') goto yy134; - if(yych <= '7') goto yy147; - if(yych <= '9') goto yy145; - goto yy134; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': goto yy147; + case '8': + case '9': goto yy145; + default: goto yy134; + } yy147: yych = *++YYCURSOR; - if(yych == '-') goto yy67; - goto yy134; + switch(yych){ + case '-': goto yy67; + default: goto yy134; + } yy148: yych = *++YYCURSOR; - if(yych == 'I') goto yy151; - if(yych == 'i') goto yy150; - goto yy25; + switch(yych){ + case 'I': goto yy151; + case 'i': goto yy150; + default: goto yy25; + } yy149: yych = *++YYCURSOR; - if(yych <= '\000') goto yy51; - if(yych == 'x') goto yy135; - goto yy134; + switch(yych){ + case '\000': goto yy51; + case 'x': goto yy135; + default: goto yy134; + } yy150: yych = *++YYCURSOR; - if(yych == 'n') goto yy157; - goto yy25; + switch(yych){ + case 'n': goto yy157; + default: goto yy25; + } yy151: yych = *++YYCURSOR; - if(yych == 'N') goto yy152; - if(yych == 'n') goto yy153; - goto yy25; + switch(yych){ + case 'N': goto yy152; + case 'n': goto yy153; + default: goto yy25; + } yy152: yych = *++YYCURSOR; - if(yych == 'F') goto yy154; - goto yy25; + switch(yych){ + case 'F': goto yy154; + default: goto yy25; + } yy153: yych = *++YYCURSOR; - if(yych != 'f') goto yy25; + switch(yych){ + case 'f': goto yy154; + default: goto yy25; + } yy154: yych = *++YYCURSOR; if(yych >= '\001') goto yy25; yy155: yych = *++YYCURSOR; @@ -787,21 +1280,36 @@ yy156: #line 100 { return "float#neginf"; } yy157: yych = *++YYCURSOR; - if(yych == 'f') goto yy154; - goto yy25; + switch(yych){ + case 'f': goto yy154; + default: goto yy25; + } yy158: yych = *++YYCURSOR; - if(yych == 'I') goto yy33; - if(yych == 'i') goto yy32; - goto yy25; + switch(yych){ + case 'I': goto yy33; + case 'i': goto yy32; + default: goto yy25; + } yy159: yych = *++YYCURSOR; - if(yych == 'L') goto yy166; - goto yy25; + switch(yych){ + case 'L': goto yy166; + default: goto yy25; + } yy160: yych = *++YYCURSOR; - if(yych != 'l') goto yy25; + switch(yych){ + case 'l': goto yy161; + default: goto yy25; + } yy161: yych = *++YYCURSOR; - if(yych != 's') goto yy25; + switch(yych){ + case 's': goto yy162; + default: goto yy25; + } yy162: yych = *++YYCURSOR; - if(yych != 'e') goto yy25; + switch(yych){ + case 'e': goto yy163; + default: goto yy25; + } yy163: yych = *++YYCURSOR; if(yych >= '\001') goto yy25; yy164: yych = *++YYCURSOR; @@ -809,23 +1317,40 @@ yy165: #line 86 { return "bool#no"; } yy166: yych = *++YYCURSOR; - if(yych != 'S') goto yy25; + switch(yych){ + case 'S': goto yy167; + default: goto yy25; + } yy167: yych = *++YYCURSOR; - if(yych == 'E') goto yy163; - goto yy25; + switch(yych){ + case 'E': goto yy163; + default: goto yy25; + } yy168: yych = *++YYCURSOR; - if(yych != 'l') goto yy25; + switch(yych){ + case 'l': goto yy169; + default: goto yy25; + } yy169: yych = *++YYCURSOR; - if(yych != 's') goto yy25; + switch(yych){ + case 's': goto yy170; + default: goto yy25; + } yy170: yych = *++YYCURSOR; - if(yych == 'e') goto yy163; - goto yy25; + switch(yych){ + case 'e': goto yy163; + default: goto yy25; + } yy171: yych = *++YYCURSOR; - if(yych == 'F') goto yy163; - goto yy25; + switch(yych){ + case 'F': goto yy163; + default: goto yy25; + } yy172: yych = *++YYCURSOR; - if(yych == 'f') goto yy163; - goto yy25; + switch(yych){ + case 'f': goto yy163; + default: goto yy25; + } yy173: yych = *++YYCURSOR; if(yych >= '\001') goto yy25; yy174: yych = *++YYCURSOR; @@ -833,51 +1358,88 @@ yy175: #line 84 { return "bool#yes"; } yy176: yych = *++YYCURSOR; - if(yych == 'f') goto yy163; - goto yy25; + switch(yych){ + case 'f': goto yy163; + default: goto yy25; + } yy177: yych = *++YYCURSOR; - if(yych == 'S') goto yy173; - goto yy25; + switch(yych){ + case 'S': goto yy173; + default: goto yy25; + } yy178: yych = *++YYCURSOR; - if(yych == 's') goto yy173; - goto yy25; + switch(yych){ + case 's': goto yy173; + default: goto yy25; + } yy179: yych = *++YYCURSOR; - if(yych == 's') goto yy173; - goto yy25; + switch(yych){ + case 's': goto yy173; + default: goto yy25; + } yy180: yych = *++YYCURSOR; - if(yych == 'U') goto yy183; - goto yy25; + switch(yych){ + case 'U': goto yy183; + default: goto yy25; + } yy181: yych = *++YYCURSOR; - if(yych != 'u') goto yy25; + switch(yych){ + case 'u': goto yy182; + default: goto yy25; + } yy182: yych = *++YYCURSOR; - if(yych == 'e') goto yy173; - goto yy25; + switch(yych){ + case 'e': goto yy173; + default: goto yy25; + } yy183: yych = *++YYCURSOR; - if(yych == 'E') goto yy173; - goto yy25; + switch(yych){ + case 'E': goto yy173; + default: goto yy25; + } yy184: yych = *++YYCURSOR; - if(yych != 'u') goto yy25; + switch(yych){ + case 'u': goto yy185; + default: goto yy25; + } yy185: yych = *++YYCURSOR; - if(yych == 'e') goto yy173; - goto yy25; + switch(yych){ + case 'e': goto yy173; + default: goto yy25; + } yy186: yych = *++YYCURSOR; - if(yych == 'L') goto yy190; - goto yy25; + switch(yych){ + case 'L': goto yy190; + default: goto yy25; + } yy187: yych = *++YYCURSOR; - if(yych != 'l') goto yy25; + switch(yych){ + case 'l': goto yy188; + default: goto yy25; + } yy188: yych = *++YYCURSOR; - if(yych != 'l') goto yy25; + switch(yych){ + case 'l': goto yy189; + default: goto yy25; + } yy189: yych = *++YYCURSOR; if(yych <= '\000') goto yy6; goto yy25; yy190: yych = *++YYCURSOR; - if(yych == 'L') goto yy189; - goto yy25; + switch(yych){ + case 'L': goto yy189; + default: goto yy25; + } yy191: yych = *++YYCURSOR; - if(yych != 'l') goto yy25; + switch(yych){ + case 'l': goto yy192; + default: goto yy25; + } yy192: yych = *++YYCURSOR; - if(yych == 'l') goto yy189; - goto yy25; + switch(yych){ + case 'l': goto yy189; + default: goto yy25; + } } #line 118 @@ -900,27 +1462,68 @@ yy194: ++YYCURSOR; yy193: if((YYLIMIT - YYCURSOR) < 21) YYFILL(21); yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '\000') goto yy195; - if(yych == '!') goto yy199; - goto yy202; - } else { - if(yych <= '9') goto yy201; - if(yych <= '@') goto yy202; - if(yych <= 'Z') goto yy201; - goto yy202; - } - } else { - if(yych <= 't'){ - if(yych == '`') goto yy202; - if(yych <= 's') goto yy201; - goto yy196; - } else { - if(yych == 'x') goto yy198; - if(yych <= 'z') goto yy201; - goto yy202; - } + switch(yych){ + case '\000': goto yy195; + case '!': goto yy199; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': case 'u': + case 'v': + case 'w': case 'y': + case 'z': goto yy201; + case 't': goto yy196; + case 'x': goto yy198; + default: goto yy202; } yy195: YYCURSOR = YYMARKER; switch(yyaccept){ @@ -928,50 +1531,143 @@ yy195: YYCURSOR = YYMARKER; } yy196: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= '+') goto yy197; - if(yych <= ',') goto yy207; - goto yy203; - } else { - if(yych <= '.') goto yy208; - if(yych <= '/') goto yy209; - if(yych <= '9') goto yy205; - } - } else { - if(yych <= '_'){ - if(yych <= 'Z') goto yy205; - if(yych >= '_') goto yy205; - } else { - if(yych <= '`') goto yy197; - if(yych <= 'a') goto yy237; - if(yych <= 'z') goto yy205; - } + switch(yych){ + case ',': goto yy207; + case '-': goto yy203; + case '.': goto yy208; + case '/': goto yy209; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy205; + case 'a': goto yy237; + default: goto yy197; } yy197: #line 170 { return syck_taguri( YAML_DOMAIN, type_id, strlen( type_id ) ); } yy198: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= ','){ - if(yych <= '+') goto yy197; - goto yy206; - } else { - if(yych <= '-') goto yy227; - if(yych <= '9') goto yy206; - goto yy197; - } - } else { - if(yych <= '_'){ - if(yych <= 'Z') goto yy206; - if(yych <= '^') goto yy197; - goto yy206; - } else { - if(yych <= '`') goto yy197; - if(yych <= 'z') goto yy206; - goto yy197; - } + switch(yych){ + case ',': case '.': + case '/': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy206; + case '-': goto yy227; + default: goto yy197; } yy199: yych = *++YYCURSOR; yy200: @@ -979,93 +1675,291 @@ yy200: { return syck_xprivate( type_id + 1, strlen( type_id ) - 1 ); } yy201: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= '-'){ - if(yych <= '+') goto yy197; - if(yych <= ',') goto yy207; - goto yy203; - } else { - if(yych <= '.') goto yy208; - if(yych <= '/') goto yy209; - goto yy205; - } - } else { - if(yych <= '^'){ - if(yych <= '@') goto yy197; - if(yych <= 'Z') goto yy205; - goto yy197; - } else { - if(yych == '`') goto yy197; - if(yych <= 'z') goto yy205; - goto yy197; - } + switch(yych){ + case ',': goto yy207; + case '-': goto yy203; + case '.': goto yy208; + case '/': goto yy209; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy205; + default: goto yy197; } yy202: yych = *++YYCURSOR; goto yy197; yy203: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy204: if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= ',') goto yy195; - goto yy203; - } else { - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; - } - } else { - if(yych <= '_'){ - if(yych <= 'Z') goto yy205; - if(yych <= '^') goto yy195; - } else { - if(yych <= '`') goto yy195; - if(yych >= '{') goto yy195; - } +yy204: switch(yych){ + case '-': goto yy203; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy205; + default: goto yy195; } yy205: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy206: if(yych <= '9'){ - if(yych <= '-'){ - if(yych <= '+') goto yy195; - if(yych >= '-') goto yy203; - } else { - if(yych <= '.') goto yy208; - if(yych <= '/') goto yy209; - goto yy205; - } - } else { - if(yych <= '^'){ - if(yych <= '@') goto yy195; - if(yych <= 'Z') goto yy205; - goto yy195; - } else { - if(yych == '`') goto yy195; - if(yych <= 'z') goto yy205; - goto yy195; - } +yy206: switch(yych){ + case ',': goto yy207; + case '-': goto yy203; + case '.': goto yy208; + case '/': goto yy209; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy205; + default: goto yy195; } yy207: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych <= '9') goto yy215; - goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy215; + default: goto yy195; + } yy208: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '/') goto yy195; - if(yych <= '9') goto yy211; - if(yych <= '@') goto yy195; - goto yy211; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy195; - goto yy211; - } else { - if(yych <= '`') goto yy195; - if(yych <= 'z') goto yy211; - goto yy195; - } + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy211; + default: goto yy195; } yy209: yych = *++YYCURSOR; yy210: @@ -1085,66 +1979,202 @@ yy210: yy211: ++YYCURSOR; if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; -yy212: if(yych <= '9'){ - if(yych <= '-'){ - if(yych <= '+') goto yy195; - if(yych <= ',') goto yy207; - } else { - if(yych <= '.') goto yy208; - if(yych <= '/') goto yy209; - goto yy211; - } - } else { - if(yych <= '^'){ - if(yych <= '@') goto yy195; - if(yych <= 'Z') goto yy211; - goto yy195; - } else { - if(yych == '`') goto yy195; - if(yych <= 'z') goto yy211; - goto yy195; - } +yy212: switch(yych){ + case ',': goto yy207; + case '-': goto yy213; + case '.': goto yy208; + case '/': goto yy209; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy211; + default: goto yy195; } yy213: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy214: if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= ',') goto yy195; - goto yy213; - } else { - if(yych <= '/') goto yy195; - if(yych <= '9') goto yy211; - goto yy195; - } - } else { - if(yych <= '_'){ - if(yych <= 'Z') goto yy211; - if(yych <= '^') goto yy195; - goto yy211; - } else { - if(yych <= '`') goto yy195; - if(yych <= 'z') goto yy211; - goto yy195; - } +yy214: switch(yych){ + case '-': goto yy213; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy211; + default: goto yy195; } yy215: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy216; + default: goto yy195; + } yy216: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy217; + default: goto yy195; + } yy217: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy218; + default: goto yy195; + } yy218: yych = *++YYCURSOR; - if(yych == '-') goto yy219; - if(yych == '/') goto yy220; - goto yy195; + switch(yych){ + case '-': goto yy219; + case '/': goto yy220; + default: goto yy195; + } yy219: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych <= '9') goto yy222; - goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy222; + default: goto yy195; + } yy220: yych = *++YYCURSOR; yy221: #line 159 @@ -1159,260 +2189,617 @@ yy221: return uri; } yy222: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy223; + default: goto yy195; + } yy223: yych = *++YYCURSOR; - if(yych == '-') goto yy224; - if(yych == '/') goto yy220; - goto yy195; + switch(yych){ + case '-': goto yy224; + case '/': goto yy220; + default: goto yy195; + } yy224: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy225; + default: goto yy195; + } yy225: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy226; + default: goto yy195; + } yy226: yych = *++YYCURSOR; - if(yych == '/') goto yy220; - goto yy195; + switch(yych){ + case '/': goto yy220; + default: goto yy195; + } yy227: yych = *++YYCURSOR; - if(yych != 'p') goto yy204; + switch(yych){ + case 'p': goto yy228; + default: goto yy204; + } yy228: yych = *++YYCURSOR; - if(yych <= '.'){ - if(yych == ',') goto yy207; - if(yych <= '-') goto yy204; - goto yy208; - } else { - if(yych <= '/') goto yy209; - if(yych != 'r') goto yy204; + switch(yych){ + case ',': goto yy207; + case '.': goto yy208; + case '/': goto yy209; + case 'r': goto yy229; + default: goto yy204; } yy229: yych = *++YYCURSOR; - if(yych <= '.'){ - if(yych == ',') goto yy207; - if(yych <= '-') goto yy204; - goto yy208; - } else { - if(yych <= '/') goto yy209; - if(yych != 'i') goto yy204; + switch(yych){ + case ',': goto yy207; + case '.': goto yy208; + case '/': goto yy209; + case 'i': goto yy230; + default: goto yy204; } yy230: yych = *++YYCURSOR; - if(yych <= '.'){ - if(yych == ',') goto yy207; - if(yych <= '-') goto yy204; - goto yy208; - } else { - if(yych <= '/') goto yy209; - if(yych != 'v') goto yy204; + switch(yych){ + case ',': goto yy207; + case '.': goto yy208; + case '/': goto yy209; + case 'v': goto yy231; + default: goto yy204; } yy231: yych = *++YYCURSOR; - if(yych <= '.'){ - if(yych == ',') goto yy207; - if(yych <= '-') goto yy204; - goto yy208; - } else { - if(yych <= '/') goto yy209; - if(yych != 'a') goto yy204; + switch(yych){ + case ',': goto yy207; + case '.': goto yy208; + case '/': goto yy209; + case 'a': goto yy232; + default: goto yy204; } yy232: yych = *++YYCURSOR; - if(yych <= '.'){ - if(yych == ',') goto yy207; - if(yych <= '-') goto yy204; - goto yy208; - } else { - if(yych <= '/') goto yy209; - if(yych != 't') goto yy204; + switch(yych){ + case ',': goto yy207; + case '.': goto yy208; + case '/': goto yy209; + case 't': goto yy233; + default: goto yy204; } yy233: yych = *++YYCURSOR; - if(yych <= '.'){ - if(yych == ',') goto yy207; - if(yych <= '-') goto yy204; - goto yy208; - } else { - if(yych <= '/') goto yy209; - if(yych != 'e') goto yy204; + switch(yych){ + case ',': goto yy207; + case '.': goto yy208; + case '/': goto yy209; + case 'e': goto yy234; + default: goto yy204; } yy234: yych = *++YYCURSOR; - if(yych <= '.'){ - if(yych == ',') goto yy207; - if(yych <= '-') goto yy204; - goto yy208; - } else { - if(yych <= '/') goto yy209; - if(yych != ':') goto yy204; + switch(yych){ + case ',': goto yy207; + case '.': goto yy208; + case '/': goto yy209; + case ':': goto yy235; + default: goto yy204; } yy235: yych = *++YYCURSOR; yy236: #line 142 { return type_id; } yy237: yych = *++YYCURSOR; - if(yych <= '.'){ - if(yych == ',') goto yy207; - if(yych <= '-') goto yy204; - goto yy208; - } else { - if(yych <= '/') goto yy209; - if(yych != 'g') goto yy204; + switch(yych){ + case ',': goto yy207; + case '.': goto yy208; + case '/': goto yy209; + case 'g': goto yy238; + default: goto yy204; } yy238: yych = *++YYCURSOR; - if(yych <= '.'){ - if(yych == ',') goto yy207; - if(yych <= '-') goto yy204; - goto yy208; - } else { - if(yych <= '/') goto yy209; - if(yych != ':') goto yy204; + switch(yych){ + case ',': goto yy207; + case '.': goto yy208; + case '/': goto yy209; + case ':': goto yy239; + default: goto yy204; } yy239: yych = *++YYCURSOR; - if(yych <= '+') goto yy241; - if(yych <= '.') goto yy195; - goto yy241; + switch(yych){ + case ',': + case '-': + case '.': goto yy195; + default: goto yy241; + } yy240: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy241: if(yych <= '9'){ - if(yych <= '-'){ - if(yych <= '+') goto yy195; - if(yych <= ',') goto yy244; - } else { - if(yych <= '.') goto yy245; - if(yych <= '/') goto yy195; - goto yy240; - } - } else { - if(yych <= '^'){ - if(yych <= '@') goto yy195; - if(yych <= 'Z') goto yy240; - goto yy195; - } else { - if(yych == '`') goto yy195; - if(yych <= 'z') goto yy240; - goto yy195; - } +yy241: switch(yych){ + case ',': goto yy244; + case '-': goto yy242; + case '.': goto yy245; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy240; + default: goto yy195; } yy242: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy243: if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= ',') goto yy195; - goto yy242; - } else { - if(yych <= '/') goto yy195; - if(yych <= '9') goto yy240; - goto yy195; - } - } else { - if(yych <= '_'){ - if(yych <= 'Z') goto yy240; - if(yych <= '^') goto yy195; - goto yy240; - } else { - if(yych <= '`') goto yy195; - if(yych <= 'z') goto yy240; - goto yy195; - } +yy243: switch(yych){ + case '-': goto yy242; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy240; + default: goto yy195; } yy244: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych <= '9') goto yy250; - goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy250; + default: goto yy195; + } yy245: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '/') goto yy195; - if(yych <= '9') goto yy246; - if(yych <= '@') goto yy195; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy195; - } else { - if(yych <= '`') goto yy195; - if(yych >= '{') goto yy195; - } + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy246; + default: goto yy195; } yy246: ++YYCURSOR; if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; -yy247: if(yych <= '9'){ - if(yych <= '-'){ - if(yych <= '+') goto yy195; - if(yych <= ',') goto yy244; - } else { - if(yych <= '.') goto yy245; - if(yych <= '/') goto yy195; - goto yy246; - } - } else { - if(yych <= '^'){ - if(yych <= '@') goto yy195; - if(yych <= 'Z') goto yy246; - goto yy195; - } else { - if(yych == '`') goto yy195; - if(yych <= 'z') goto yy246; - goto yy195; - } +yy247: switch(yych){ + case ',': goto yy244; + case '-': goto yy248; + case '.': goto yy245; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy246; + default: goto yy195; } yy248: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy249: if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= ',') goto yy195; - goto yy248; - } else { - if(yych <= '/') goto yy195; - if(yych <= '9') goto yy246; - goto yy195; - } - } else { - if(yych <= '_'){ - if(yych <= 'Z') goto yy246; - if(yych <= '^') goto yy195; - goto yy246; - } else { - if(yych <= '`') goto yy195; - if(yych <= 'z') goto yy246; - goto yy195; - } +yy249: switch(yych){ + case '-': goto yy248; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy246; + default: goto yy195; } yy250: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy251; + default: goto yy195; + } yy251: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy252; + default: goto yy195; + } yy252: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy253; + default: goto yy195; + } yy253: yych = *++YYCURSOR; - if(yych == '-') goto yy254; - if(yych == ':') goto yy255; - goto yy195; + switch(yych){ + case '-': goto yy254; + case ':': goto yy255; + default: goto yy195; + } yy254: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych <= '9') goto yy257; - goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy257; + default: goto yy195; + } yy255: yych = *++YYCURSOR; yy256: #line 140 { return type_id; } yy257: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy258; + default: goto yy195; + } yy258: yych = *++YYCURSOR; - if(yych == '-') goto yy259; - if(yych == ':') goto yy255; - goto yy195; + switch(yych){ + case '-': goto yy259; + case ':': goto yy255; + default: goto yy195; + } yy259: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy260; + default: goto yy195; + } yy260: yych = *++YYCURSOR; - if(yych <= '/') goto yy195; - if(yych >= ':') goto yy195; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy261; + default: goto yy195; + } yy261: yych = *++YYCURSOR; - if(yych == ':') goto yy255; - goto yy195; + switch(yych){ + case ':': goto yy255; + default: goto yy195; + } } #line 172 diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c index aee66c8d41..4f5d4610e8 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -35,8 +35,20 @@ typedef struct RVALUE { } as; } RVALUE; +typedef struct { + long hash; + char *buffer; + long length; + long remaining; + int printed; +} bytestring_t; + #define RUBY_DOMAIN "ruby.yaml.org,2002" +#ifndef StringValue +#define StringValue(v) +#endif + /* * symbols and constants */ @@ -71,6 +83,40 @@ struct parser_xtra { int taint; }; +/* + * Convert YAML to bytecode + */ +VALUE +rb_syck_compile(self, port) + VALUE self, port; +{ + SYMID oid; + int taint; + char *ret; + VALUE bc; + bytestring_t *sav; + + SyckParser *parser = syck_new_parser(); + taint = syck_parser_assign_io(parser, port); + syck_parser_handler( parser, syck_yaml2byte_handler ); + syck_parser_error_handler( parser, NULL ); + syck_parser_implicit_typing( parser, 0 ); + syck_parser_taguri_expansion( parser, 0 ); + oid = syck_parse( parser ); + syck_lookup_sym( parser, oid, (char **)&sav ); + + ret = S_ALLOC_N( char, strlen( sav->buffer ) + 3 ); + ret[0] = '\0'; + strcat( ret, "D\n" ); + strcat( ret, sav->buffer ); + + syck_free_parser( parser ); + + bc = rb_str_new2( ret ); + if ( taint ) OBJ_TAINT( bc ); + return bc; +} + /* * read from io. */ @@ -1278,6 +1324,7 @@ Init_syck() VALUE rb_yaml = rb_define_module( "YAML" ); VALUE rb_syck = rb_define_module_under( rb_yaml, "Syck" ); rb_define_const( rb_syck, "VERSION", rb_str_new2( SYCK_VERSION ) ); + rb_define_module_function( rb_syck, "compile", rb_syck_compile, 1 ); /* * Global symbols diff --git a/ext/syck/syck.c b/ext/syck/syck.c index 9f2f900383..8d319379a3 100644 --- a/ext/syck/syck.c +++ b/ext/syck/syck.c @@ -9,8 +9,8 @@ #include #include -#include "ruby.h" #include "syck.h" +#include "ruby.h" void syck_parser_pop_level( SyckParser * ); @@ -88,7 +88,7 @@ syck_io_str_read( char *buf, SyckIoStr *str, long max_size, long skip ) } if ( beg < str->ptr ) { - len = str->ptr - beg; + len = ( str->ptr - beg ) + 1; S_MEMCPY( buf + skip, beg, char, len ); } len += skip; diff --git a/ext/syck/syck.h b/ext/syck/syck.h index bd5c65858b..5b42b778b0 100644 --- a/ext/syck/syck.h +++ b/ext/syck/syck.h @@ -17,6 +17,7 @@ #define YAML_DOMAIN "yaml.org,2002" #include +#include #include "st.h" #if defined(__cplusplus) @@ -355,6 +356,8 @@ long syck_parser_readlen( SyckParser *, long ); void syck_parser_init( SyckParser *, int ); SYMID syck_parse( SyckParser * ); void syck_default_error_handler( SyckParser *, char * ); +SYMID syck_yaml2byte_handler( SyckParser *, SyckNode * ); +char *syck_yaml2byte( char * ); /* * Allocation prototypes diff --git a/ext/syck/token.c b/ext/syck/token.c index d7fa6e4573..aa7771de75 100644 --- a/ext/syck/token.c +++ b/ext/syck/token.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.5 on Mon Oct 13 18:40:21 2003 */ +/* Generated by re2c 0.5 on Thu Oct 16 14:12:55 2003 */ #line 1 "token.re" /* * token.re @@ -276,30 +276,22 @@ yy1: ++YYCURSOR; yy0: if((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = *YYCURSOR; - 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; - } + switch(yych){ + case '\000': goto yy7; + case '\n': goto yy9; + case '\r': goto yy11; + case ' ': goto yy12; + case '#': goto yy5; + case '-': goto yy2; + case '.': goto yy4; + default: goto yy14; } yy2: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == '-') goto yy28; + switch(yych){ + case '-': goto yy28; + default: goto yy3; + } yy3: #line 333 { YYPOS(0); @@ -307,8 +299,10 @@ yy3: } yy4: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy21; - goto yy3; + switch(yych){ + case '.': goto yy21; + default: goto yy3; + } yy5: yych = *++YYCURSOR; yy6: #line 315 @@ -332,8 +326,10 @@ yy10: goto Header; } yy11: yych = *++YYCURSOR; - if(yych == '\n') goto yy17; - goto yy3; + switch(yych){ + case '\n': goto yy17; + default: goto yy3; + } yy12: yych = *++YYCURSOR; goto yy16; yy13: @@ -346,38 +342,42 @@ yy14: yych = *++YYCURSOR; yy15: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy16: if(yych == ' ') goto yy15; - goto yy13; +yy16: switch(yych){ + case ' ': goto yy15; + default: goto yy13; + } yy17: yyaccept = 1; YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy18: if(yych <= '\f'){ - if(yych == '\n') goto yy17; - goto yy10; - } else { - if(yych <= '\r') goto yy19; - if(yych == ' ') goto yy17; - goto yy10; +yy18: switch(yych){ + case '\n': case ' ': goto yy17; + case '\r': goto yy19; + default: goto yy10; } yy19: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == '\n') goto yy17; + switch(yych){ + case '\n': goto yy17; + default: goto yy20; + } yy20: YYCURSOR = YYMARKER; switch(yyaccept){ case 1: goto yy10; case 0: goto yy3; } yy21: yych = *++YYCURSOR; - if(yych != '.') goto yy20; + switch(yych){ + case '.': goto yy22; + default: goto yy20; + } yy22: yych = *++YYCURSOR; - if(yych <= '\f'){ - if(yych != '\n') goto yy20; - } else { - if(yych <= '\r') goto yy27; - if(yych == ' ') goto yy25; - goto yy20; + switch(yych){ + case '\n': goto yy23; + case '\r': goto yy27; + case ' ': goto yy25; + default: goto yy20; } yy23: yych = *++YYCURSOR; yy24: @@ -398,20 +398,26 @@ yy24: yy25: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy26: if(yych == ' ') goto yy25; - goto yy24; +yy26: switch(yych){ + case ' ': goto yy25; + default: goto yy24; + } yy27: yych = *++YYCURSOR; - if(yych == '\n') goto yy23; - goto yy20; + switch(yych){ + case '\n': goto yy23; + default: goto yy20; + } yy28: yych = *++YYCURSOR; - if(yych != '-') goto yy20; + switch(yych){ + case '-': goto yy29; + default: goto yy20; + } yy29: yych = *++YYCURSOR; - if(yych <= '\f'){ - if(yych != '\n') goto yy20; - } else { - if(yych <= '\r') goto yy34; - if(yych == ' ') goto yy32; - goto yy20; + switch(yych){ + case '\n': goto yy30; + case '\r': goto yy34; + case ' ': goto yy32; + default: goto yy20; } yy30: yych = *++YYCURSOR; yy31: @@ -432,11 +438,15 @@ yy31: yy32: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy33: if(yych == ' ') goto yy32; - goto yy31; +yy33: switch(yych){ + case ' ': goto yy32; + default: goto yy31; + } yy34: yych = *++YYCURSOR; - if(yych == '\n') goto yy30; - goto yy20; + switch(yych){ + case '\n': goto yy30; + default: goto yy20; + } } #line 337 @@ -459,54 +469,23 @@ yy36: ++YYCURSOR; yy35: if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; - 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; - } - } + switch(yych){ + case '\000': goto yy60; + case '\n': goto yy37; + case '\r': goto yy39; + case ' ': goto yy58; + case '!': goto yy49; + case '"': goto yy53; + case '#': goto yy56; + case '&': goto yy47; + case '\'': goto yy51; + case '*': goto yy48; + case ',': case ':': goto yy45; + case '-': case '?': goto yy46; + case '>': case '|': goto yy55; + case '[': case '{': goto yy41; + case ']': case '}': goto yy43; + default: goto yy62; } yy37: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -535,7 +514,10 @@ yy38: return YAML_INDENT; } yy39: yych = *++YYCURSOR; - if(yych == '\n') goto yy89; + switch(yych){ + case '\n': goto yy89; + default: goto yy40; + } yy40: #line 445 { ENSURE_YAML_IOPEN(lvl, doc_level, 1); @@ -557,65 +539,147 @@ yy44: } yy45: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '\f'){ - if(yych == '\n') goto yy84; - goto yy40; - } else { - if(yych <= '\r') goto yy88; - if(yych == ' ') goto yy86; - goto yy40; + switch(yych){ + case '\n': goto yy84; + case '\r': goto yy88; + case ' ': goto yy86; + default: goto yy40; } yy46: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '\f'){ - if(yych == '\n') goto yy79; - goto yy40; - } else { - if(yych <= '\r') goto yy83; - if(yych == ' ') goto yy81; - goto yy40; + switch(yych){ + case '\n': goto yy79; + case '\r': goto yy83; + case ' ': goto yy81; + default: goto yy40; } yy47: yych = *++YYCURSOR; - 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; - } + switch(yych){ + case '-': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy76; + default: goto yy40; } yy48: yych = *++YYCURSOR; - 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; - } + switch(yych){ + case '-': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy73; + default: goto yy40; } yy49: yych = *++YYCURSOR; yy50: @@ -634,25 +698,21 @@ yy54: goto DoubleQuote; } yy55: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - 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; - } + switch(yych){ + case '\n': goto yy68; + case '\r': goto yy72; + case ' ': goto yy70; + case '+': case '-': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy65; + default: goto yy40; } yy56: yych = *++YYCURSOR; yy57: @@ -677,26 +737,28 @@ yy62: yych = *++YYCURSOR; yy63: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy64: if(yych == ' ') goto yy63; - goto yy59; +yy64: switch(yych){ + case ' ': goto yy63; + default: goto yy59; + } yy65: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -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; - } +yy66: switch(yych){ + case '\n': goto yy68; + case '\r': goto yy72; + case ' ': goto yy70; + case '+': case '-': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy65; + default: goto yy67; } yy67: YYCURSOR = YYMARKER; switch(yyaccept){ @@ -715,29 +777,80 @@ yy69: yy70: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy71: if(yych == ' ') goto yy70; - goto yy69; +yy71: switch(yych){ + case ' ': goto yy70; + default: goto yy69; + } yy72: yych = *++YYCURSOR; - if(yych == '\n') goto yy68; - goto yy67; + switch(yych){ + case '\n': goto yy68; + default: goto yy67; + } yy73: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -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; - } +yy74: switch(yych){ + case '-': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy73; + default: goto yy75; } yy75: #line 413 @@ -748,21 +861,68 @@ yy75: yy76: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -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; - } +yy77: switch(yych){ + case '-': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy76; + default: goto yy78; } yy78: #line 401 @@ -796,11 +956,15 @@ yy80: yy81: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy82: if(yych == ' ') goto yy81; - goto yy80; +yy82: switch(yych){ + case ' ': goto yy81; + default: goto yy80; + } yy83: yych = *++YYCURSOR; - if(yych == '\n') goto yy79; - goto yy67; + switch(yych){ + case '\n': goto yy79; + default: goto yy67; + } yy84: yych = *++YYCURSOR; yy85: #line 383 @@ -810,28 +974,31 @@ yy85: yy86: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy87: if(yych == ' ') goto yy86; - goto yy85; +yy87: switch(yych){ + case ' ': goto yy86; + default: goto yy85; + } yy88: yych = *++YYCURSOR; - if(yych == '\n') goto yy84; - goto yy67; + switch(yych){ + case '\n': goto yy84; + default: goto yy67; + } yy89: yyaccept = 0; YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy90: if(yych <= '\f'){ - if(yych == '\n') goto yy89; - goto yy38; - } else { - if(yych <= '\r') goto yy91; - if(yych == ' ') goto yy89; - goto yy38; +yy90: switch(yych){ + case '\n': case ' ': goto yy89; + case '\r': goto yy91; + default: goto yy38; } yy91: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == '\n') goto yy89; - goto yy67; + switch(yych){ + case '\n': goto yy89; + default: goto yy67; + } } #line 449 @@ -849,13 +1016,11 @@ yy93: ++YYCURSOR; yy92: if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if(yych <= ' '){ - if(yych <= '\000') goto yy94; - if(yych <= '\037') goto yy99; - goto yy97; - } else { - if(yych == '%') goto yy95; - goto yy99; + switch(yych){ + case '\000': goto yy94; + case ' ': goto yy97; + case '%': goto yy95; + default: goto yy99; } yy94: YYCURSOR = YYMARKER; switch(yyaccept){ @@ -863,9 +1028,84 @@ yy94: YYCURSOR = YYMARKER; } yy95: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '-') goto yy96; - if(yych == '`') goto yy96; - if(yych <= 'z') goto yy102; + switch(yych){ + case '.': + case '/': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case ':': + case ';': + case '<': + case '=': + case '>': + case '?': + case '@': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '[': + case '\\': + case ']': + case '^': + case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy102; + default: goto yy96; + } yy96: #line 462 { YYCURSOR = YYTOKTMP; @@ -881,29 +1121,250 @@ yy99: yych = *++YYCURSOR; yy100: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy101: if(yych == ' ') goto yy100; - goto yy98; +yy101: switch(yych){ + case ' ': goto yy100; + default: goto yy98; + } yy102: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy103: if(yych <= ':'){ - if(yych <= '-') goto yy94; - if(yych <= '9') goto yy102; - } else { - if(yych == '`') goto yy94; - if(yych <= 'z') goto yy102; - goto yy94; +yy103: switch(yych){ + case '.': + case '/': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case ';': + case '<': + case '=': + case '>': + case '?': + case '@': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '[': + case '\\': + case ']': + case '^': + case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy102; + case ':': goto yy104; + default: goto yy94; } yy104: yych = *++YYCURSOR; - if(yych <= '-') goto yy94; - if(yych == '`') goto yy94; - if(yych >= '{') goto yy94; + switch(yych){ + case '.': + case '/': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case ':': + case ';': + case '<': + case '=': + case '>': + case '?': + case '@': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '[': + case '\\': + case ']': + case '^': + case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy105; + default: goto yy94; + } yy105: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy106: if(yych <= '-') goto yy107; - if(yych == '`') goto yy107; - if(yych <= 'z') goto yy105; +yy106: switch(yych){ + case '.': + case '/': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case ':': + case ';': + case '<': + case '=': + case '>': + case '?': + case '@': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '[': + case '\\': + case ']': + case '^': + case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy105; + default: goto yy107; + } yy107: #line 458 { goto Directive; } @@ -938,25 +1399,15 @@ yy109: ++YYCURSOR; yy108: if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; - 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; - } + switch(yych){ + case '\000': goto yy120; + case '\n': goto yy110; + case '\r': goto yy112; + case ' ': goto yy118; + case ',': goto yy117; + case ':': goto yy114; + case ']': case '}': goto yy115; + default: goto yy122; } yy110: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -995,7 +1446,10 @@ yy111: goto Plain2; } yy112: yych = *++YYCURSOR; - if(yych == '\n') goto yy135; + switch(yych){ + case '\n': goto yy135; + default: goto yy113; + } yy113: #line 542 { QUOTECATS(qstr, qcapa, qidx, YYTOKTMP, YYCURSOR - YYTOKTMP); @@ -1003,13 +1457,11 @@ yy113: } yy114: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '\f'){ - if(yych == '\n') goto yy130; - goto yy113; - } else { - if(yych <= '\r') goto yy134; - if(yych == ' ') goto yy132; - goto yy113; + switch(yych){ + case '\n': goto yy130; + case '\r': goto yy134; + case ' ': goto yy132; + default: goto yy113; } yy115: yych = *++YYCURSOR; yy116: @@ -1027,16 +1479,17 @@ yy116: } yy117: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '\f'){ - if(yych == '\n') goto yy125; - goto yy113; - } else { - if(yych <= '\r') goto yy128; - if(yych == ' ') goto yy126; - goto yy113; + switch(yych){ + case '\n': goto yy125; + case '\r': goto yy128; + case ' ': goto yy126; + default: goto yy113; } yy118: yych = *++YYCURSOR; - if(yych == '#') goto yy123; + switch(yych){ + case '#': goto yy123; + default: goto yy119; + } yy119: #line 540 { goto Plain3; } @@ -1057,10 +1510,15 @@ yy125: yych = *++YYCURSOR; yy126: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy127: if(yych == ' ') goto yy126; - goto yy116; +yy127: switch(yych){ + case ' ': goto yy126; + default: goto yy116; + } yy128: yych = *++YYCURSOR; - if(yych == '\n') goto yy125; + switch(yych){ + case '\n': goto yy125; + default: goto yy129; + } yy129: YYCURSOR = YYMARKER; switch(yyaccept){ case 0: goto yy111; @@ -1073,28 +1531,31 @@ yy131: yy132: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy133: if(yych == ' ') goto yy132; - goto yy131; +yy133: switch(yych){ + case ' ': goto yy132; + default: goto yy131; + } yy134: yych = *++YYCURSOR; - if(yych == '\n') goto yy130; - goto yy129; + switch(yych){ + case '\n': goto yy130; + default: goto yy129; + } yy135: yyaccept = 0; YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy136: if(yych <= '\f'){ - if(yych == '\n') goto yy135; - goto yy111; - } else { - if(yych <= '\r') goto yy137; - if(yych == ' ') goto yy135; - goto yy111; +yy136: switch(yych){ + case '\n': case ' ': goto yy135; + case '\r': goto yy137; + default: goto yy111; } yy137: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == '\n') goto yy135; - goto yy129; + switch(yych){ + case '\n': goto yy135; + default: goto yy129; + } } #line 546 @@ -1117,13 +1578,12 @@ yy139: ++YYCURSOR; yy138: if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - 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; + switch(yych){ + case '\000': goto yy146; + case '\n': goto yy140; + case '\r': goto yy142; + case '\'': goto yy144; + default: goto yy147; } yy140: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -1166,14 +1626,20 @@ yy141: goto SingleQuote2; } yy142: yych = *++YYCURSOR; - if(yych == '\n') goto yy150; + switch(yych){ + case '\n': goto yy150; + default: goto yy143; + } yy143: #line 615 { QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1)); goto SingleQuote2; } yy144: yych = *++YYCURSOR; - if(yych == '\'') goto yy148; + switch(yych){ + case '\'': goto yy148; + default: goto yy145; + } yy145: #line 600 { SyckLevel *lvl; @@ -1204,18 +1670,18 @@ yy150: yyaccept = 0; YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy151: if(yych <= '\f'){ - if(yych == '\n') goto yy150; - goto yy141; - } else { - if(yych <= '\r') goto yy152; - if(yych == ' ') goto yy150; - goto yy141; +yy151: switch(yych){ + case '\n': case ' ': goto yy150; + case '\r': goto yy152; + default: goto yy141; } yy152: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == '\n') goto yy150; + switch(yych){ + case '\n': goto yy150; + default: goto yy153; + } yy153: YYCURSOR = YYMARKER; switch(yyaccept){ case 0: goto yy141; @@ -1246,23 +1712,13 @@ yy155: ++YYCURSOR; yy154: if((YYLIMIT - YYCURSOR) < 4) YYFILL(4); yych = *YYCURSOR; - 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; - } + switch(yych){ + case '\000': goto yy161; + case '\n': goto yy156; + case '\r': goto yy158; + case '"': goto yy163; + case '\\': goto yy160; + default: goto yy164; } yy156: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -1309,7 +1765,10 @@ yy157: goto DoubleQuote2; } yy158: yych = *++YYCURSOR; - if(yych == '\n') goto yy177; + switch(yych){ + case '\n': goto yy177; + default: goto yy159; + } yy159: #line 722 { QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1)); @@ -1317,47 +1776,15 @@ yy159: } yy160: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - 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; - } - } + switch(yych){ + case '\n': goto yy168; + case '\r': goto yy170; + case ' ': goto yy165; + case '"': case '\\': case 'a': + case 'b': case 'e': + case 'f': case 'n': case 'r': case 't': case 'v': goto yy172; + case 'x': goto yy171; + default: goto yy159; } yy161: yych = *++YYCURSOR; yy162: @@ -1383,11 +1810,11 @@ yy164: yych = *++YYCURSOR; yy165: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy166: if(yych <= '\f'){ - if(yych == '\n') goto yy168; - } else { - if(yych <= '\r') goto yy170; - if(yych == ' ') goto yy165; +yy166: switch(yych){ + case '\n': goto yy168; + case '\r': goto yy170; + case ' ': goto yy165; + default: goto yy167; } yy167: YYCURSOR = YYMARKER; switch(yyaccept){ @@ -1402,18 +1829,33 @@ yy169: goto DoubleQuote2; } yy170: yych = *++YYCURSOR; - if(yych == '\n') goto yy168; - goto yy167; + switch(yych){ + case '\n': goto yy168; + default: goto yy167; + } yy171: yych = *++YYCURSOR; - 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; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': goto yy174; + default: goto yy167; } yy172: yych = *++YYCURSOR; yy173: @@ -1434,13 +1876,28 @@ yy173: goto DoubleQuote2; } yy174: yych = *++YYCURSOR; - 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; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': goto yy175; + default: goto yy167; } yy175: yych = *++YYCURSOR; yy176: @@ -1457,19 +1914,18 @@ yy177: yyaccept = 0; YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy178: if(yych <= '\f'){ - if(yych == '\n') goto yy177; - goto yy157; - } else { - if(yych <= '\r') goto yy179; - if(yych == ' ') goto yy177; - goto yy157; +yy178: switch(yych){ + case '\n': case ' ': goto yy177; + case '\r': goto yy179; + default: goto yy157; } yy179: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == '\n') goto yy177; - goto yy167; + switch(yych){ + case '\n': goto yy177; + default: goto yy167; + } } #line 726 @@ -1492,22 +1948,13 @@ yy181: ++YYCURSOR; yy180: if((YYLIMIT - YYCURSOR) < 4) YYFILL(4); yych = *YYCURSOR; - 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; - } + switch(yych){ + case '\000': goto yy182; + case '\n': goto yy183; + case '\r': goto yy186; + case ' ': goto yy185; + case '\\': goto yy188; + default: goto yy189; } yy182: YYCURSOR = YYMARKER; switch(yyaccept){ @@ -1568,7 +2015,10 @@ yy184: yy185: yych = *++YYCURSOR; goto yy196; yy186: yych = *++YYCURSOR; - if(yych == '\n') goto yy194; + switch(yych){ + case '\n': goto yy194; + default: goto yy187; + } yy187: #line 802 { QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1)); @@ -1576,27 +2026,59 @@ yy187: } yy188: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'x') goto yy190; - goto yy187; + switch(yych){ + case 'x': goto yy190; + default: goto yy187; + } yy189: yych = *++YYCURSOR; goto yy187; yy190: yych = *++YYCURSOR; - 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; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': goto yy191; + default: goto yy182; } yy191: yych = *++YYCURSOR; - 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; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': goto yy192; + default: goto yy182; } yy192: yych = *++YYCURSOR; yy193: @@ -1614,8 +2096,10 @@ yy194: yych = *++YYCURSOR; yy195: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy196: if(yych == ' ') goto yy195; - goto yy184; +yy196: switch(yych){ + case ' ': goto yy195; + default: goto yy184; + } } #line 807 @@ -1671,13 +2155,12 @@ yy198: ++YYCURSOR; yy197: if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - 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; + switch(yych){ + case '\000': goto yy205; + case '\n': goto yy199; + case '\r': goto yy201; + case '#': goto yy203; + default: goto yy207; } yy199: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -1750,7 +2233,10 @@ yy200: goto ScalarBlock2; } yy201: yych = *++YYCURSOR; - if(yych == '\n') goto yy208; + switch(yych){ + case '\n': goto yy208; + default: goto yy202; + } yy202: #line 940 { QUOTECAT(qstr, qcapa, qidx, *YYTOKTMP); @@ -1784,18 +2270,18 @@ yy208: yyaccept = 0; YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy209: if(yych <= '\f'){ - if(yych == '\n') goto yy208; - goto yy200; - } else { - if(yych <= '\r') goto yy210; - if(yych == ' ') goto yy208; - goto yy200; +yy209: switch(yych){ + case '\n': case ' ': goto yy208; + case '\r': goto yy210; + default: goto yy200; } yy210: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == '\n') goto yy208; + switch(yych){ + case '\n': goto yy208; + default: goto yy211; + } yy211: YYCURSOR = YYMARKER; switch(yyaccept){ case 0: goto yy200; @@ -1826,13 +2312,11 @@ yy213: ++YYCURSOR; yy212: if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if(yych <= '\n'){ - if(yych <= '\000') goto yy214; - if(yych <= '\t') goto yy219; - goto yy216; - } else { - if(yych == '\r') goto yy217; - goto yy219; + switch(yych){ + case '\000': goto yy214; + case '\n': goto yy216; + case '\r': goto yy217; + default: goto yy219; } yy214: yych = *++YYCURSOR; yy215: @@ -1844,7 +2328,10 @@ yy216: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); goto yy221; yy217: yych = *++YYCURSOR; - if(yych == '\n') goto yy220; + switch(yych){ + case '\n': goto yy220; + default: goto yy218; + } yy218: #line 967 { goto Comment; @@ -1855,12 +2342,18 @@ yy220: yyaccept = 0; YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy221: if(yych == '\n') goto yy220; - if(yych != '\r') goto yy215; +yy221: switch(yych){ + case '\n': goto yy220; + case '\r': goto yy222; + default: goto yy215; + } yy222: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == '\n') goto yy220; + switch(yych){ + case '\n': goto yy220; + default: goto yy223; + } yy223: YYCURSOR = YYMARKER; switch(yyaccept){ case 0: goto yy215; diff --git a/ext/syck/yaml2byte.c b/ext/syck/yaml2byte.c new file mode 100644 index 0000000000..54493c0021 --- /dev/null +++ b/ext/syck/yaml2byte.c @@ -0,0 +1,251 @@ +// +// ybext.c +// +// $Author$ +// $Date$ +// +// Copyright (C) 2003 why the lucky stiff, clark evans +// +// WARNING WARNING WARNING --- THIS IS *NOT JUST* PLAYING +// ANYMORE! -- WHY HAS EMBRACED THIS AS THE REAL THING! +// +#include +#include +#define YAMLBYTE_UTF8 +#include "yamlbyte.h" +#include "ruby.h" + +#include +#define TRACE0(a) \ + do { printf(a); printf("\n"); fflush(stdout); } while(0) +#define TRACE1(a,b) \ + do { printf(a,b); printf("\n"); fflush(stdout); } while(0) +#define TRACE2(a,b,c) \ + do { printf(a,b,c); printf("\n"); fflush(stdout); } while(0) +#define TRACE3(a,b,c,d) \ + do { printf(a,b,c,d); printf("\n"); fflush(stdout); } while(0) + +/* Reinvent the wheel... */ +#define CHUNKSIZE 64 +#define HASH ((long)0xCAFECAFECAFECAFE) +typedef struct { + long hash; + char *buffer; + long length; + long remaining; + int printed; +} bytestring_t; +bytestring_t *bytestring_alloc() { + bytestring_t *ret; + //TRACE0("bytestring_alloc()"); + ret = S_ALLOC(bytestring_t); + ret->hash = HASH; + ret->length = CHUNKSIZE; + ret->remaining = ret->length; + ret->buffer = S_ALLOC_N(char, ret->length + 1 ); + ret->buffer[0] = 0; + ret->printed = 0; + return ret; +} +void bytestring_append(bytestring_t *str, char code, + char *start, char *finish) +{ + long grow; + long length = 2; /* CODE + LF */ + char *curr; + assert(str && HASH == str->hash); + //TRACE0("bytestring_append()"); + if(start) { + if(!finish) + finish = start + strlen(start); + length += (finish-start); + } + if(length > str->remaining) { + grow = (length - str->remaining) + CHUNKSIZE; + str->remaining += grow; + str->length += grow; + str->buffer = S_REALLOC_N( str->buffer, char, str->length + 1 ); + assert(str->buffer); + } + curr = str->buffer + (str->length - str->remaining); + *curr = code; + curr += 1; + if(start) + while(start < finish) + *curr ++ = *start ++; + *curr = '\n'; + curr += 1; + *curr = 0; + str->remaining = str->remaining - length; + assert( (str->buffer + str->length) - str->remaining ); +} +void bytestring_extend(bytestring_t *str, bytestring_t *ext) +{ + char *from; + char *curr; + char *stop; + long grow; + long length; + assert(str && HASH == str->hash); + assert(ext && HASH == ext->hash); + if(ext->printed) { + assert(ext->buffer[0] ==YAMLBYTE_ANCHOR); + curr = ext->buffer; + while( '\n' != *curr) + curr++; + bytestring_append(str, YAMLBYTE_ALIAS, ext->buffer + 1, curr); + } else { + ext->printed = 1; + length = (ext->length - ext->remaining); + if(length > str->remaining) { + grow = (length - str->remaining) + CHUNKSIZE; + str->remaining += grow; + str->length += grow; + str->buffer = S_REALLOC_N( str->buffer, char, str->length + 1 ); + } + curr = str->buffer + (str->length - str->remaining); + from = ext->buffer; + stop = ext->buffer + length; + while( from < stop ) + *curr ++ = *from ++; + *curr = 0; + str->remaining = str->remaining - length; + assert( (str->buffer + str->length) - str->remaining ); + } +} + +/* convert SyckNode into yamlbyte_buffer_t objects */ +SYMID +syck_yaml2byte_handler(p, n) + SyckParser *p; + SyckNode *n; +{ + SYMID oid; + long i; + char ch; + char nextcode; + char *start; + char *current; + char *finish; + bytestring_t *val = NULL; + bytestring_t *sav = NULL; + //TRACE0("syck_yaml2byte_handler()"); + val = bytestring_alloc(); + if(n->anchor) bytestring_append(val,YAMLBYTE_ANCHOR, n->anchor, NULL); + if ( n->type_id ) + { + if ( p->taguri_expansion ) + { + bytestring_append(val,YAMLBYTE_TRANSFER, n->type_id, NULL); + } + else + { + char *type_tag = S_ALLOC_N( char, strlen( n->type_id ) + 1 ); + type_tag[0] = '\0'; + strcat( type_tag, "!" ); + strcat( type_tag, n->type_id ); + bytestring_append( val, YAMLBYTE_TRANSFER, type_tag, NULL); + } + } + switch (n->kind) + { + case syck_str_kind: + nextcode = YAMLBYTE_SCALAR; + start = n->data.str->ptr; + finish = start + n->data.str->len - 1; + current = start; + //TRACE2("SCALAR: %s %d", start, n->data.str->len); + while(1) { + ch = *current; + if('\n' == ch || 0 == ch || current > finish) { + if(current >= start) { + bytestring_append(val, nextcode, start, current); + nextcode = YAMLBYTE_CONTINUE; + } + start = current + 1; + if(current > finish) + { + break; + } + else if('\n' == ch ) + { + bytestring_append(val,YAMLBYTE_NEWLINE,NULL,NULL); + } + else if(0 == ch) + { + bytestring_append(val,YAMLBYTE_NULLCHAR,NULL,NULL); + } + else + { + assert("oops"); + } + } + current += 1; + } + break; + case syck_seq_kind: + bytestring_append(val,YAMLBYTE_SEQUENCE,NULL,NULL); + for ( i = 0; i < n->data.list->idx; i++ ) + { + oid = syck_seq_read( n, i ); + syck_lookup_sym( p, oid, (char **)&sav ); + bytestring_extend(val, sav); + } + bytestring_append(val,YAMLBYTE_END_BRANCH,NULL,NULL); + break; + case syck_map_kind: + bytestring_append(val,YAMLBYTE_MAPPING,NULL,NULL); + for ( i = 0; i < n->data.pairs->idx; i++ ) + { + oid = syck_map_read( n, map_key, i ); + syck_lookup_sym( p, oid, (char **)&sav ); + bytestring_extend(val, sav); + oid = syck_map_read( n, map_value, i ); + syck_lookup_sym( p, oid, (char **)&sav ); + bytestring_extend(val, sav); + } + bytestring_append(val,YAMLBYTE_END_BRANCH,NULL,NULL); + break; + } + oid = syck_add_sym( p, (char *) val ); + //TRACE1("Saving: %s", val->buffer ); + return oid; +} + +char * +syck_yaml2byte(char *yamlstr) +{ + SYMID oid; + char *ret; + bytestring_t *sav; + + SyckParser *parser = syck_new_parser(); + syck_parser_str_auto( parser, yamlstr, NULL ); + syck_parser_handler( parser, syck_yaml2byte_handler ); + syck_parser_error_handler( parser, NULL ); + syck_parser_implicit_typing( parser, 1 ); + syck_parser_taguri_expansion( parser, 1 ); + oid = syck_parse( parser ); + syck_lookup_sym( parser, oid, (char **)&sav ); + + ret = S_ALLOC_N( char, strlen( sav->buffer ) + 3 ); + ret[0] = '\0'; + strcat( ret, "D\n" ); + strcat( ret, sav->buffer ); + + syck_free_parser( parser ); + return ret; +} + +#ifdef TEST_YBEXT +#include +int main() { + char *yaml = "test: 1\nand: \"with new\\nline\\n\"\nalso: &3 three\nmore: *3"; + printf("--- # YAML \n"); + printf(yaml); + printf("\n...\n"); + printf(syck_yaml2byte(yaml)); + return 0; +} +#endif +