Ruby 1.9.3p327(2012-11-10revision37606)
ext/syck/bytecode.c
Go to the documentation of this file.
00001 /* Generated by re2c 0.9.10 on Mon Sep 19 23:21:26 2005 */
00002 #line 1 "bytecode.re"
00003 /*
00004  * bytecode.re
00005  *
00006  * $Author: naruse $
00007  *
00008  * Copyright (C) 2003 why the lucky stiff
00009  */
00010 #include "ruby/ruby.h"
00011 #include "syck.h"
00012 #include "gram.h"
00013 
00014 #define QUOTELEN 128
00015 
00016 /*
00017  * They do my bidding...
00018  */
00019 #define YYCTYPE     char
00020 #define YYCURSOR    parser->cursor
00021 #define YYMARKER    parser->marker
00022 #define YYLIMIT     parser->limit
00023 #define YYTOKEN     parser->token
00024 #define YYTOKTMP    parser->toktmp
00025 #define YYLINEPTR   parser->lineptr
00026 #define YYLINECTPTR parser->linectptr
00027 #define YYLINE      parser->linect
00028 #define YYFILL(n)   syck_parser_read(parser)
00029 
00030 extern SyckParser *syck_parser_ptr;
00031 
00032 char *get_inline( SyckParser *parser );
00033 
00034 /*
00035  * Repositions the cursor at `n' offset from the token start.
00036  * Only works in `Header' and `Document' sections.
00037  */
00038 #define YYPOS(n)    YYCURSOR = YYTOKEN + n
00039 
00040 /*
00041  * Track line numbers
00042  */
00043 #define CHK_NL(ptr)    if ( *( ptr - 1 ) == '\n' && ptr > YYLINECTPTR ) { YYLINEPTR = ptr; YYLINE++; YYLINECTPTR = YYLINEPTR; }
00044 
00045 /*
00046  * I like seeing the level operations as macros...
00047  */
00048 #define ADD_LEVEL(len, status)  syck_parser_add_level( parser, len, status )
00049 #define POP_LEVEL()     syck_parser_pop_level( parser )
00050 #define CURRENT_LEVEL() syck_parser_current_level( parser )
00051 
00052 /*
00053  * Force a token next time around sycklex()
00054  */
00055 #define FORCE_NEXT_TOKEN(tok)    parser->force_token = tok;
00056 
00057 /*
00058  * Adding levels in bytecode requires us to make sure
00059  * we've got all our tokens worked out.
00060  */
00061 #define ADD_BYTE_LEVEL(lvl, len, s ) \
00062         switch ( lvl->status ) \
00063         { \
00064             case syck_lvl_seq: \
00065                 lvl->ncount++; \
00066                 ADD_LEVEL(len, syck_lvl_open); \
00067                 YYPOS(0); \
00068             return '-'; \
00069         \
00070             case syck_lvl_map: \
00071                 lvl->ncount++; \
00072                 ADD_LEVEL(len, s); \
00073             break; \
00074         \
00075             case syck_lvl_open: \
00076                 lvl->status = s; \
00077             break; \
00078         \
00079             default: \
00080                 ADD_LEVEL(len, s); \
00081             break; \
00082         }
00083 
00084 /*
00085  * Nice little macro to ensure we're YAML_IOPENed to the current level.
00086  * * Only use this macro in the "Document" section *
00087  */
00088 #define ENSURE_YAML_IOPEN(last_lvl, lvl_type, to_len, reset) \
00089         if ( last_lvl->spaces < to_len ) \
00090         { \
00091             if ( last_lvl->status == syck_lvl_iseq || last_lvl->status == syck_lvl_imap ) \
00092             { \
00093                 goto Document; \
00094             } \
00095             else \
00096             { \
00097                 ADD_LEVEL( to_len, lvl_type ); \
00098                 if ( reset == 1 ) YYPOS(0); \
00099                 return YAML_IOPEN; \
00100             } \
00101         }
00102 
00103 /*
00104  * Nice little macro to ensure closure of levels.
00105  * * Only use this macro in the "Document" section *
00106  */
00107 #define ENSURE_YAML_IEND(last_lvl, to_len) \
00108         if ( last_lvl->spaces > to_len ) \
00109         { \
00110             syck_parser_pop_level( parser ); \
00111             YYPOS(0); \
00112             return YAML_IEND; \
00113         }
00114 
00115 /*
00116  * Concatenates string items and manages allocation
00117  * to the string
00118  */
00119 #define CAT(s, c, i, l) \
00120         { \
00121             if ( i + 1 >= c ) \
00122             { \
00123                 c += QUOTELEN; \
00124                 S_REALLOC_N( s, char, c ); \
00125             } \
00126             s[i++] = l; \
00127             s[i] = '\0'; \
00128         }
00129 
00130 /*
00131  * Parser for standard YAML Bytecode [UTF-8]
00132  */
00133 int
00134 sycklex_bytecode_utf8( YYSTYPE *sycklval, SyckParser *parser )
00135 {
00136     SyckLevel *lvl;
00137     syck_parser_ptr = parser;
00138     if ( YYCURSOR == NULL )
00139     {
00140         syck_parser_read( parser );
00141     }
00142 
00143     if ( parser->force_token != 0 )
00144     {
00145         int t = parser->force_token;
00146         parser->force_token = 0;
00147         return t;
00148     }
00149 
00150 #line 172 "bytecode.re"
00151 
00152 
00153     lvl = CURRENT_LEVEL();
00154     if ( lvl->status == syck_lvl_doc )
00155     {
00156         goto Document;
00157     }
00158 
00159 /* Header: */
00160 
00161     YYTOKEN = YYCURSOR;
00162 
00163 
00164 #line 165 "<stdout>"
00165 {
00166         YYCTYPE yych;
00167         unsigned int yyaccept = 0;
00168         goto yy0;
00169         ++YYCURSOR;
00170 yy0:
00171         if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
00172         yych = *YYCURSOR;
00173         switch(yych){
00174         case 0x00:      goto yy2;
00175         case 'D':       goto yy3;
00176         default:        goto yy5;
00177         }
00178 yy2:    YYCURSOR = YYMARKER;
00179         switch(yyaccept){
00180         case 0: goto yy4;
00181         }
00182 yy3:    yyaccept = 0;
00183         yych = *(YYMARKER = ++YYCURSOR);
00184         switch(yych){
00185         case 0x0A:      goto yy6;
00186         case 0x0D:      goto yy8;
00187         default:        goto yy4;
00188         }
00189 yy4:
00190 #line 199 "bytecode.re"
00191 {   YYPOS(0);
00192             goto Document;
00193         }
00194 #line 195 "<stdout>"
00195 yy5:    yych = *++YYCURSOR;
00196         goto yy4;
00197 yy6:    ++YYCURSOR;
00198         goto yy7;
00199 yy7:
00200 #line 186 "bytecode.re"
00201 {   if ( lvl->status == syck_lvl_header )
00202             {
00203                 CHK_NL(YYCURSOR);
00204                 goto Directive;
00205             }
00206             else
00207             {
00208                 ENSURE_YAML_IEND(lvl, -1);
00209                 YYPOS(0);
00210                 return 0;
00211             }
00212         }
00213 #line 214 "<stdout>"
00214 yy8:    ++YYCURSOR;
00215         switch((yych = *YYCURSOR)) {
00216         case 0x0A:      goto yy6;
00217         default:        goto yy2;
00218         }
00219 }
00220 #line 203 "bytecode.re"
00221 
00222 
00223 Document:
00224     {
00225         lvl = CURRENT_LEVEL();
00226         if ( lvl->status == syck_lvl_header )
00227         {
00228             lvl->status = syck_lvl_doc;
00229         }
00230 
00231         YYTOKEN = YYCURSOR;
00232 
00233 
00234 #line 235 "<stdout>"
00235 {
00236         YYCTYPE yych;
00237         goto yy9;
00238         ++YYCURSOR;
00239 yy9:
00240         if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
00241         yych = *YYCURSOR;
00242         switch(yych){
00243         case 0x00:      goto yy30;
00244         case 0x0A:      goto yy27;
00245         case 0x0D:      goto yy29;
00246         case 'A':       goto yy19;
00247         case 'D':       goto yy12;
00248         case 'E':       goto yy16;
00249         case 'M':       goto yy14;
00250         case 'P':       goto yy13;
00251         case 'Q':       goto yy15;
00252         case 'R':       goto yy21;
00253         case 'S':       goto yy17;
00254         case 'T':       goto yy23;
00255         case 'c':       goto yy25;
00256         default:        goto yy11;
00257         }
00258 yy11:yy12:      yych = *++YYCURSOR;
00259         switch(yych){
00260         case 0x0A:      goto yy41;
00261         case 0x0D:      goto yy44;
00262         default:        goto yy11;
00263         }
00264 yy13:   yych = *++YYCURSOR;
00265         switch(yych){
00266         case 0x0A:      goto yy41;
00267         case 0x0D:      goto yy43;
00268         default:        goto yy11;
00269         }
00270 yy14:   yych = *++YYCURSOR;
00271         switch(yych){
00272         case 0x0A:      goto yy38;
00273         case 0x0D:      goto yy40;
00274         default:        goto yy11;
00275         }
00276 yy15:   yych = *++YYCURSOR;
00277         switch(yych){
00278         case 0x0A:      goto yy35;
00279         case 0x0D:      goto yy37;
00280         default:        goto yy11;
00281         }
00282 yy16:   yych = *++YYCURSOR;
00283         switch(yych){
00284         case 0x0A:      goto yy32;
00285         case 0x0D:      goto yy34;
00286         default:        goto yy11;
00287         }
00288 yy17:   ++YYCURSOR;
00289         goto yy18;
00290 yy18:
00291 #line 288 "bytecode.re"
00292 {   ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str);
00293             goto Scalar;
00294         }
00295 #line 296 "<stdout>"
00296 yy19:   ++YYCURSOR;
00297         goto yy20;
00298 yy20:
00299 #line 292 "bytecode.re"
00300 {   ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open);
00301             sycklval->name = get_inline( parser );
00302             syck_hdlr_remove_anchor( parser, sycklval->name );
00303             CHK_NL(YYCURSOR);
00304             return YAML_ANCHOR;
00305         }
00306 #line 307 "<stdout>"
00307 yy21:   ++YYCURSOR;
00308         goto yy22;
00309 yy22:
00310 #line 299 "bytecode.re"
00311 {   ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str);
00312             sycklval->name = get_inline( parser );
00313             POP_LEVEL();
00314             if ( *( YYCURSOR - 1 ) == '\n' ) YYCURSOR--;
00315             return YAML_ALIAS;
00316         }
00317 #line 318 "<stdout>"
00318 yy23:   ++YYCURSOR;
00319         goto yy24;
00320 yy24:
00321 #line 306 "bytecode.re"
00322 {   char *qstr;
00323             ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open);
00324             qstr = get_inline( parser );
00325             CHK_NL(YYCURSOR);
00326             if ( qstr[0] == '!' )
00327             {
00328                 size_t qidx = strlen( qstr );
00329                 if ( qstr[1] == '\0' )
00330                 {
00331                     free( qstr );
00332                     return YAML_ITRANSFER;
00333                 }
00334 
00335                 lvl = CURRENT_LEVEL();
00336 
00337                 /*
00338                  * URL Prefixing
00339                  */
00340                 if ( qstr[1] == '^' )
00341                 {
00342                     sycklval->name = S_ALLOC_N( char, qidx + strlen( lvl->domain ) );
00343                     sycklval->name[0] = '\0';
00344                     strcat( sycklval->name, lvl->domain );
00345                     strncat( sycklval->name, qstr + 2, qidx - 2 );
00346                     free( qstr );
00347                 }
00348                 else
00349                 {
00350                     char *carat = qstr + 1;
00351                     char *qend = qstr + qidx;
00352                     while ( (++carat) < qend )
00353                     {
00354                         if ( *carat == '^' )
00355                             break;
00356                     }
00357 
00358                     if ( carat < qend )
00359                     {
00360                         free( lvl->domain );
00361                         lvl->domain = syck_strndup( qstr + 1, carat - ( qstr + 1 ) );
00362                         sycklval->name = S_ALLOC_N( char, ( qend - carat ) + strlen( lvl->domain ) );
00363                         sycklval->name[0] = '\0';
00364                         strcat( sycklval->name, lvl->domain );
00365                         strncat( sycklval->name, carat + 1, ( qend - carat ) - 1 );
00366                         free( qstr );
00367                     }
00368                     else
00369                     {
00370                         sycklval->name = S_ALLOC_N( char, strlen( qstr ) );
00371                         sycklval->name[0] = '\0';
00372                         S_MEMCPY( sycklval->name, qstr + 1, char, strlen( qstr ) );
00373                         free( qstr );
00374                     }
00375                 }
00376                 return YAML_TRANSFER;
00377             }
00378             sycklval->name = qstr;
00379             return YAML_TAGURI;
00380         }
00381 #line 382 "<stdout>"
00382 yy25:   ++YYCURSOR;
00383         goto yy26;
00384 yy26:
00385 #line 366 "bytecode.re"
00386 {   goto Comment; }
00387 #line 388 "<stdout>"
00388 yy27:   ++YYCURSOR;
00389         goto yy28;
00390 yy28:
00391 #line 368 "bytecode.re"
00392 {   CHK_NL(YYCURSOR);
00393             if ( lvl->status == syck_lvl_seq )
00394             {
00395                 return YAML_INDENT;
00396             }
00397             else if ( lvl->status == syck_lvl_map )
00398             {
00399                 if ( lvl->ncount % 2 == 1 ) return ':';
00400                 else                        return YAML_INDENT;
00401             }
00402             goto Document;
00403         }
00404 #line 405 "<stdout>"
00405 yy29:   yych = *++YYCURSOR;
00406         switch(yych){
00407         case 0x0A:      goto yy27;
00408         default:        goto yy11;
00409         }
00410 yy30:   ++YYCURSOR;
00411         goto yy31;
00412 yy31:
00413 #line 381 "bytecode.re"
00414 {   ENSURE_YAML_IEND(lvl, -1);
00415             YYPOS(0);
00416             return 0;
00417         }
00418 #line 419 "<stdout>"
00419 yy32:   ++YYCURSOR;
00420         goto yy33;
00421 yy33:
00422 #line 252 "bytecode.re"
00423 {   if ( lvl->status == syck_lvl_seq && lvl->ncount == 0 )
00424             {
00425                 lvl->ncount++;
00426                 YYPOS(0);
00427                 FORCE_NEXT_TOKEN( ']' );
00428                 return '[';
00429             }
00430             else if ( lvl->status == syck_lvl_map && lvl->ncount == 0 )
00431             {
00432                 lvl->ncount++;
00433                 YYPOS(0);
00434                 FORCE_NEXT_TOKEN( '}' );
00435                 return '{';
00436             }
00437 
00438             POP_LEVEL();
00439             lvl = CURRENT_LEVEL();
00440             if ( lvl->status == syck_lvl_seq )
00441             {
00442                 FORCE_NEXT_TOKEN(YAML_INDENT);
00443             }
00444             else if ( lvl->status == syck_lvl_map )
00445             {
00446                 if ( lvl->ncount % 2 == 1 )
00447                 {
00448                     FORCE_NEXT_TOKEN(':');
00449                 }
00450                 else
00451                 {
00452                     FORCE_NEXT_TOKEN(YAML_INDENT);
00453                 }
00454             }
00455             CHK_NL(YYCURSOR);
00456             return YAML_IEND;
00457         }
00458 #line 459 "<stdout>"
00459 yy34:   yych = *++YYCURSOR;
00460         switch(yych){
00461         case 0x0A:      goto yy32;
00462         default:        goto yy11;
00463         }
00464 yy35:   ++YYCURSOR;
00465         goto yy36;
00466 yy36:
00467 #line 237 "bytecode.re"
00468 {   int complex = 0;
00469             if ( lvl->ncount % 2 == 0 && ( lvl->status == syck_lvl_map || lvl->status == syck_lvl_seq ) )
00470             {
00471                 complex = 1;
00472             }
00473             ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_seq);
00474             CHK_NL(YYCURSOR);
00475             if ( complex )
00476             {
00477                 FORCE_NEXT_TOKEN( YAML_IOPEN );
00478                 return '?';
00479             }
00480             return YAML_IOPEN;
00481         }
00482 #line 483 "<stdout>"
00483 yy37:   yych = *++YYCURSOR;
00484         switch(yych){
00485         case 0x0A:      goto yy35;
00486         default:        goto yy11;
00487         }
00488 yy38:   ++YYCURSOR;
00489         goto yy39;
00490 yy39:
00491 #line 222 "bytecode.re"
00492 {   int complex = 0;
00493             if ( lvl->ncount % 2 == 0 && ( lvl->status == syck_lvl_map || lvl->status == syck_lvl_seq ) )
00494             {
00495                 complex = 1;
00496             }
00497             ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_map);
00498             CHK_NL(YYCURSOR);
00499             if ( complex )
00500             {
00501                 FORCE_NEXT_TOKEN( YAML_IOPEN );
00502                 return '?';
00503             }
00504             return YAML_IOPEN;
00505         }
00506 #line 507 "<stdout>"
00507 yy40:   yych = *++YYCURSOR;
00508         switch(yych){
00509         case 0x0A:      goto yy38;
00510         default:        goto yy11;
00511         }
00512 yy41:   ++YYCURSOR;
00513         goto yy42;
00514 yy42:
00515 #line 217 "bytecode.re"
00516 {   ENSURE_YAML_IEND(lvl, -1);
00517                 YYPOS(0);
00518                 return 0;
00519             }
00520 #line 521 "<stdout>"
00521 yy43:   yych = *++YYCURSOR;
00522         switch(yych){
00523         case 0x0A:      goto yy41;
00524         default:        goto yy11;
00525         }
00526 yy44:   ++YYCURSOR;
00527         switch((yych = *YYCURSOR)) {
00528         case 0x0A:      goto yy41;
00529         default:        goto yy11;
00530         }
00531 }
00532 #line 386 "bytecode.re"
00533 
00534 
00535     }
00536 
00537 Directive:
00538     {
00539         YYTOKEN = YYCURSOR;
00540 
00541 
00542 #line 543 "<stdout>"
00543 {
00544         YYCTYPE yych;
00545         unsigned int yyaccept = 0;
00546         goto yy45;
00547         ++YYCURSOR;
00548 yy45:
00549         if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
00550         yych = *YYCURSOR;
00551         switch(yych){
00552         case 0x00:      goto yy47;
00553         case 'V':       goto yy48;
00554         default:        goto yy50;
00555         }
00556 yy47:   YYCURSOR = YYMARKER;
00557         switch(yyaccept){
00558         case 0: goto yy49;
00559         }
00560 yy48:   yyaccept = 0;
00561         yych = *(YYMARKER = ++YYCURSOR);
00562         switch(yych){
00563         case '.':
00564         case '/':
00565         case '0':
00566         case '1':
00567         case '2':
00568         case '3':
00569         case '4':
00570         case '5':
00571         case '6':
00572         case '7':
00573         case '8':
00574         case '9':
00575         case ':':
00576         case ';':
00577         case '<':
00578         case '=':
00579         case '>':
00580         case '?':
00581         case '@':
00582         case 'A':
00583         case 'B':
00584         case 'C':
00585         case 'D':
00586         case 'E':
00587         case 'F':
00588         case 'G':
00589         case 'H':
00590         case 'I':
00591         case 'J':
00592         case 'K':
00593         case 'L':
00594         case 'M':
00595         case 'N':
00596         case 'O':
00597         case 'P':
00598         case 'Q':
00599         case 'R':
00600         case 'S':
00601         case 'T':
00602         case 'U':
00603         case 'V':
00604         case 'W':
00605         case 'X':
00606         case 'Y':
00607         case 'Z':
00608         case '[':
00609         case '\\':
00610         case ']':
00611         case '^':
00612         case '_':       case 'a':
00613         case 'b':
00614         case 'c':
00615         case 'd':
00616         case 'e':
00617         case 'f':
00618         case 'g':
00619         case 'h':
00620         case 'i':
00621         case 'j':
00622         case 'k':
00623         case 'l':
00624         case 'm':
00625         case 'n':
00626         case 'o':
00627         case 'p':
00628         case 'q':
00629         case 'r':
00630         case 's':
00631         case 't':
00632         case 'u':
00633         case 'v':
00634         case 'w':
00635         case 'x':
00636         case 'y':
00637         case 'z':       goto yy51;
00638         default:        goto yy49;
00639         }
00640 yy49:
00641 #line 399 "bytecode.re"
00642 {   YYCURSOR = YYTOKEN;
00643                return YAML_DOCSEP;
00644            }
00645 #line 646 "<stdout>"
00646 yy50:   yych = *++YYCURSOR;
00647         goto yy49;
00648 yy51:   ++YYCURSOR;
00649         if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
00650         yych = *YYCURSOR;
00651         goto yy52;
00652 yy52:   switch(yych){
00653         case '.':
00654         case '/':
00655         case '0':
00656         case '1':
00657         case '2':
00658         case '3':
00659         case '4':
00660         case '5':
00661         case '6':
00662         case '7':
00663         case '8':
00664         case '9':       case ';':
00665         case '<':
00666         case '=':
00667         case '>':
00668         case '?':
00669         case '@':
00670         case 'A':
00671         case 'B':
00672         case 'C':
00673         case 'D':
00674         case 'E':
00675         case 'F':
00676         case 'G':
00677         case 'H':
00678         case 'I':
00679         case 'J':
00680         case 'K':
00681         case 'L':
00682         case 'M':
00683         case 'N':
00684         case 'O':
00685         case 'P':
00686         case 'Q':
00687         case 'R':
00688         case 'S':
00689         case 'T':
00690         case 'U':
00691         case 'V':
00692         case 'W':
00693         case 'X':
00694         case 'Y':
00695         case 'Z':
00696         case '[':
00697         case '\\':
00698         case ']':
00699         case '^':
00700         case '_':       case 'a':
00701         case 'b':
00702         case 'c':
00703         case 'd':
00704         case 'e':
00705         case 'f':
00706         case 'g':
00707         case 'h':
00708         case 'i':
00709         case 'j':
00710         case 'k':
00711         case 'l':
00712         case 'm':
00713         case 'n':
00714         case 'o':
00715         case 'p':
00716         case 'q':
00717         case 'r':
00718         case 's':
00719         case 't':
00720         case 'u':
00721         case 'v':
00722         case 'w':
00723         case 'x':
00724         case 'y':
00725         case 'z':       goto yy51;
00726         case ':':       goto yy53;
00727         default:        goto yy47;
00728         }
00729 yy53:   yych = *++YYCURSOR;
00730         switch(yych){
00731         case '.':
00732         case '/':
00733         case '0':
00734         case '1':
00735         case '2':
00736         case '3':
00737         case '4':
00738         case '5':
00739         case '6':
00740         case '7':
00741         case '8':
00742         case '9':
00743         case ':':
00744         case ';':
00745         case '<':
00746         case '=':
00747         case '>':
00748         case '?':
00749         case '@':
00750         case 'A':
00751         case 'B':
00752         case 'C':
00753         case 'D':
00754         case 'E':
00755         case 'F':
00756         case 'G':
00757         case 'H':
00758         case 'I':
00759         case 'J':
00760         case 'K':
00761         case 'L':
00762         case 'M':
00763         case 'N':
00764         case 'O':
00765         case 'P':
00766         case 'Q':
00767         case 'R':
00768         case 'S':
00769         case 'T':
00770         case 'U':
00771         case 'V':
00772         case 'W':
00773         case 'X':
00774         case 'Y':
00775         case 'Z':
00776         case '[':
00777         case '\\':
00778         case ']':
00779         case '^':
00780         case '_':       case 'a':
00781         case 'b':
00782         case 'c':
00783         case 'd':
00784         case 'e':
00785         case 'f':
00786         case 'g':
00787         case 'h':
00788         case 'i':
00789         case 'j':
00790         case 'k':
00791         case 'l':
00792         case 'm':
00793         case 'n':
00794         case 'o':
00795         case 'p':
00796         case 'q':
00797         case 'r':
00798         case 's':
00799         case 't':
00800         case 'u':
00801         case 'v':
00802         case 'w':
00803         case 'x':
00804         case 'y':
00805         case 'z':       goto yy54;
00806         default:        goto yy47;
00807         }
00808 yy54:   ++YYCURSOR;
00809         if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
00810         yych = *YYCURSOR;
00811         goto yy55;
00812 yy55:   switch(yych){
00813         case 0x0A:      goto yy56;
00814         case 0x0D:      goto yy58;
00815         case '.':
00816         case '/':
00817         case '0':
00818         case '1':
00819         case '2':
00820         case '3':
00821         case '4':
00822         case '5':
00823         case '6':
00824         case '7':
00825         case '8':
00826         case '9':
00827         case ':':
00828         case ';':
00829         case '<':
00830         case '=':
00831         case '>':
00832         case '?':
00833         case '@':
00834         case 'A':
00835         case 'B':
00836         case 'C':
00837         case 'D':
00838         case 'E':
00839         case 'F':
00840         case 'G':
00841         case 'H':
00842         case 'I':
00843         case 'J':
00844         case 'K':
00845         case 'L':
00846         case 'M':
00847         case 'N':
00848         case 'O':
00849         case 'P':
00850         case 'Q':
00851         case 'R':
00852         case 'S':
00853         case 'T':
00854         case 'U':
00855         case 'V':
00856         case 'W':
00857         case 'X':
00858         case 'Y':
00859         case 'Z':
00860         case '[':
00861         case '\\':
00862         case ']':
00863         case '^':
00864         case '_':       case 'a':
00865         case 'b':
00866         case 'c':
00867         case 'd':
00868         case 'e':
00869         case 'f':
00870         case 'g':
00871         case 'h':
00872         case 'i':
00873         case 'j':
00874         case 'k':
00875         case 'l':
00876         case 'm':
00877         case 'n':
00878         case 'o':
00879         case 'p':
00880         case 'q':
00881         case 'r':
00882         case 's':
00883         case 't':
00884         case 'u':
00885         case 'v':
00886         case 'w':
00887         case 'x':
00888         case 'y':
00889         case 'z':       goto yy54;
00890         default:        goto yy47;
00891         }
00892 yy56:   ++YYCURSOR;
00893         goto yy57;
00894 yy57:
00895 #line 396 "bytecode.re"
00896 {   CHK_NL(YYCURSOR);
00897                goto Directive; }
00898 #line 899 "<stdout>"
00899 yy58:   ++YYCURSOR;
00900         switch((yych = *YYCURSOR)) {
00901         case 0x0A:      goto yy56;
00902         default:        goto yy47;
00903         }
00904 }
00905 #line 402 "bytecode.re"
00906 
00907 
00908     }
00909 
00910 Comment:
00911     {
00912         YYTOKEN = YYCURSOR;
00913 
00914 
00915 #line 916 "<stdout>"
00916 {
00917         YYCTYPE yych;
00918         goto yy59;
00919         ++YYCURSOR;
00920 yy59:
00921         if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
00922         yych = *YYCURSOR;
00923         switch(yych){
00924         case 0x00:      goto yy61;
00925         case 0x0A:      goto yy62;
00926         case 0x0D:      goto yy64;
00927         default:        goto yy66;
00928         }
00929 yy61:yy62:      ++YYCURSOR;
00930         goto yy63;
00931 yy63:
00932 #line 412 "bytecode.re"
00933 {   CHK_NL(YYCURSOR);
00934                 goto Document; }
00935 #line 936 "<stdout>"
00936 yy64:   ++YYCURSOR;
00937         switch((yych = *YYCURSOR)) {
00938         case 0x0A:      goto yy67;
00939         default:        goto yy65;
00940         }
00941 yy65:
00942 #line 415 "bytecode.re"
00943 {   goto Comment; }
00944 #line 945 "<stdout>"
00945 yy66:   yych = *++YYCURSOR;
00946         goto yy65;
00947 yy67:   ++YYCURSOR;
00948         yych = *YYCURSOR;
00949         goto yy63;
00950 }
00951 #line 417 "bytecode.re"
00952 
00953 
00954     }
00955 
00956 Scalar:
00957     {
00958     int idx = 0;
00959     int cap = 100;
00960     char *str = S_ALLOC_N( char, cap );
00961     char *tok;
00962 
00963     str[0] = '\0';
00964 
00965 Scalar2:
00966     tok = YYCURSOR;
00967 
00968 
00969 #line 970 "<stdout>"
00970 {
00971         YYCTYPE yych;
00972         goto yy68;
00973         ++YYCURSOR;
00974 yy68:
00975         if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
00976         yych = *YYCURSOR;
00977         switch(yych){
00978         case 0x00:      goto yy74;
00979         case 0x0A:      goto yy70;
00980         case 0x0D:      goto yy72;
00981         default:        goto yy76;
00982         }
00983 yy70:   ++YYCURSOR;
00984         switch((yych = *YYCURSOR)) {
00985         case 'C':       goto yy78;
00986         case 'N':       goto yy80;
00987         case 'Z':       goto yy83;
00988         default:        goto yy71;
00989         }
00990 yy71:
00991 #line 461 "bytecode.re"
00992 {   YYCURSOR = tok;
00993             goto ScalarEnd;
00994         }
00995 #line 996 "<stdout>"
00996 yy72:   ++YYCURSOR;
00997         switch((yych = *YYCURSOR)) {
00998         case 0x0A:      goto yy77;
00999         default:        goto yy73;
01000         }
01001 yy73:
01002 #line 469 "bytecode.re"
01003 {   CAT(str, cap, idx, tok[0]);
01004             goto Scalar2;
01005         }
01006 #line 1007 "<stdout>"
01007 yy74:   ++YYCURSOR;
01008         goto yy75;
01009 yy75:
01010 #line 465 "bytecode.re"
01011 {   YYCURSOR = tok;
01012             goto ScalarEnd;
01013         }
01014 #line 1015 "<stdout>"
01015 yy76:   yych = *++YYCURSOR;
01016         goto yy73;
01017 yy77:   yych = *++YYCURSOR;
01018         switch(yych){
01019         case 'C':       goto yy78;
01020         case 'N':       goto yy80;
01021         case 'Z':       goto yy83;
01022         default:        goto yy71;
01023         }
01024 yy78:   ++YYCURSOR;
01025         goto yy79;
01026 yy79:
01027 #line 435 "bytecode.re"
01028 {   CHK_NL(tok+1);
01029             goto Scalar2; }
01030 #line 1031 "<stdout>"
01031 yy80:   ++YYCURSOR;
01032         if(YYLIMIT == YYCURSOR) YYFILL(1);
01033         yych = *YYCURSOR;
01034         goto yy81;
01035 yy81:   switch(yych){
01036         case '0':
01037         case '1':
01038         case '2':
01039         case '3':
01040         case '4':
01041         case '5':
01042         case '6':
01043         case '7':
01044         case '8':
01045         case '9':       goto yy80;
01046         default:        goto yy82;
01047         }
01048 yy82:
01049 #line 438 "bytecode.re"
01050 {   CHK_NL(tok+1);
01051             if ( tok + 2 < YYCURSOR )
01052             {
01053                 char *count = tok + 2;
01054                 int total = strtod( count, NULL );
01055                 int i;
01056                 for ( i = 0; i < total; i++ )
01057                 {
01058                     CAT(str, cap, idx, '\n');
01059                 }
01060             }
01061             else
01062             {
01063                 CAT(str, cap, idx, '\n');
01064             }
01065             goto Scalar2;
01066         }
01067 #line 1068 "<stdout>"
01068 yy83:   ++YYCURSOR;
01069         goto yy84;
01070 yy84:
01071 #line 456 "bytecode.re"
01072 {   CHK_NL(tok+1);
01073             CAT(str, cap, idx, '\0');
01074             goto Scalar2;
01075         }
01076 #line 1077 "<stdout>"
01077 }
01078 #line 473 "bytecode.re"
01079 
01080 
01081 ScalarEnd:
01082         {
01083             SyckNode *n = syck_alloc_str();
01084             n->data.str->ptr = str;
01085             n->data.str->len = idx;
01086             sycklval->nodeData = n;
01087             POP_LEVEL();
01088             if ( parser->implicit_typing == 1 )
01089             {
01090                 try_tag_implicit( sycklval->nodeData, parser->taguri_expansion );
01091             }
01092             return YAML_PLAIN;
01093         }
01094     }
01095 
01096 }
01097 
01098 char *
01099 get_inline( SyckParser *parser )
01100 {
01101     int idx = 0;
01102     int cap = 100;
01103     char *str = S_ALLOC_N( char, cap );
01104     char *tok;
01105 
01106     str[0] = '\0';
01107 
01108 Inline:
01109     {
01110         tok = YYCURSOR;
01111 
01112 
01113 #line 1114 "<stdout>"
01114 {
01115         YYCTYPE yych;
01116         goto yy85;
01117         ++YYCURSOR;
01118 yy85:
01119         if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
01120         yych = *YYCURSOR;
01121         switch(yych){
01122         case 0x00:      goto yy91;
01123         case 0x0A:      goto yy87;
01124         case 0x0D:      goto yy89;
01125         default:        goto yy93;
01126         }
01127 yy87:   ++YYCURSOR;
01128         goto yy88;
01129 yy88:
01130 #line 508 "bytecode.re"
01131 {   CHK_NL(YYCURSOR);
01132                 return str; }
01133 #line 1134 "<stdout>"
01134 yy89:   ++YYCURSOR;
01135         switch((yych = *YYCURSOR)) {
01136         case 0x0A:      goto yy94;
01137         default:        goto yy90;
01138         }
01139 yy90:
01140 #line 515 "bytecode.re"
01141 {   CAT(str, cap, idx, tok[0]);
01142                 goto Inline;
01143             }
01144 #line 1145 "<stdout>"
01145 yy91:   ++YYCURSOR;
01146         goto yy92;
01147 yy92:
01148 #line 511 "bytecode.re"
01149 {   YYCURSOR = tok;
01150                 return str;
01151             }
01152 #line 1153 "<stdout>"
01153 yy93:   yych = *++YYCURSOR;
01154         goto yy90;
01155 yy94:   ++YYCURSOR;
01156         yych = *YYCURSOR;
01157         goto yy88;
01158 }
01159 #line 519 "bytecode.re"
01160 
01161 
01162     }
01163 
01164 }
01165 
01166