"Fossies" - the Fresh Open Source Software Archive

Member "ragel-6.10/examples/rlscan.cpp" (24 Mar 2017, 17666 Bytes) of package /linux/misc/ragel-6.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "rlscan.cpp" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 6.9_vs_6.10.

    1 
    2 #line 1 "rlscan.rl"
    3 /*
    4  * Lexes Ragel input files.
    5  */
    6 
    7 #include <iostream>
    8 #include <stdlib.h>
    9 #include <stdio.h>
   10 #include <string.h>
   11 
   12 using namespace std;
   13 
   14 void escapeXML( char *data )
   15 {
   16     while ( *data != 0 ) {
   17         switch ( *data ) {
   18             case '<': cout << "&lt;"; break;
   19             case '>': cout << "&gt;"; break;
   20             case '&': cout << "&amp;"; break;
   21             default: cout << *data; break;
   22         }
   23         data += 1;
   24     }
   25 }
   26 
   27 void escapeXML( char c )
   28 {
   29     switch ( c ) {
   30         case '<': cout << "&lt;"; break;
   31         case '>': cout << "&gt;"; break;
   32         case '&': cout << "&amp;"; break;
   33         default: cout << c; break;
   34     }
   35 }
   36 
   37 void escapeXML( char *data, int len )
   38 {
   39     for ( char *end = data + len; data != end; data++  ) {
   40         switch ( *data ) {
   41             case '<': cout << "&lt;"; break;
   42             case '>': cout << "&gt;"; break;
   43             case '&': cout << "&amp;"; break;
   44             default: cout << *data; break;
   45         }
   46     }
   47 }
   48 
   49 inline void write( const char *data )
   50 {
   51     cout << data;
   52 }
   53 
   54 inline void write( char c )
   55 {
   56     cout << c;
   57 }
   58 
   59 inline void write( char *data, int len )
   60 {
   61     cout.write( data, len );
   62 }
   63 
   64 
   65 
   66 #line 237 "rlscan.rl"
   67 
   68 
   69 
   70 #line 71 "rlscan.cpp"
   71 static const int RagelScan_start = 24;
   72 static const int RagelScan_error = 0;
   73 
   74 static const int RagelScan_en_c_comment = 6;
   75 static const int RagelScan_en_ilscan = 31;
   76 static const int RagelScan_en_rlscan = 35;
   77 static const int RagelScan_en_main = 24;
   78 
   79 
   80 #line 240 "rlscan.rl"
   81 
   82 #define BUFSIZE 2048
   83 
   84 int main()
   85 {
   86     std::ios::sync_with_stdio(false);
   87 
   88     int cs, act;
   89     char *ts, *te;
   90     int stack[1], top;
   91 
   92     static char inbuf[BUFSIZE];
   93     bool single_line = false;
   94     int inline_depth = 0;
   95 
   96     
   97 #line 98 "rlscan.cpp"
   98     {
   99     cs = RagelScan_start;
  100     top = 0;
  101     ts = 0;
  102     te = 0;
  103     act = 0;
  104     }
  105 
  106 #line 256 "rlscan.rl"
  107 
  108     bool done = false;
  109     int have = 0;
  110     while ( !done ) {
  111         /* How much space is in the buffer? */
  112         int space = BUFSIZE - have;
  113         if ( space == 0 ) {
  114             /* Buffer is full. */
  115             cerr << "TOKEN TOO BIG" << endl;
  116             exit(1);
  117         }
  118 
  119         /* Read in a block. */
  120         char *p = inbuf + have;
  121         cin.read( p, space );
  122         int len = cin.gcount();
  123         char *pe = p + len;
  124         char *eof = 0;
  125 
  126         /* Check for EOF. */
  127         if ( len == 0 ) {
  128             eof = pe;
  129             done = true;
  130         }
  131 
  132         
  133 #line 134 "rlscan.cpp"
  134     {
  135     if ( p == pe )
  136         goto _test_eof;
  137     goto _resume;
  138 
  139 _again:
  140     switch ( cs ) {
  141         case 24: goto st24;
  142         case 25: goto st25;
  143         case 1: goto st1;
  144         case 2: goto st2;
  145         case 26: goto st26;
  146         case 27: goto st27;
  147         case 28: goto st28;
  148         case 3: goto st3;
  149         case 4: goto st4;
  150         case 29: goto st29;
  151         case 5: goto st5;
  152         case 6: goto st6;
  153         case 0: goto st0;
  154         case 7: goto st7;
  155         case 30: goto st30;
  156         case 31: goto st31;
  157         case 32: goto st32;
  158         case 8: goto st8;
  159         case 9: goto st9;
  160         case 33: goto st33;
  161         case 10: goto st10;
  162         case 11: goto st11;
  163         case 34: goto st34;
  164         case 12: goto st12;
  165         case 35: goto st35;
  166         case 36: goto st36;
  167         case 13: goto st13;
  168         case 14: goto st14;
  169         case 37: goto st37;
  170         case 15: goto st15;
  171         case 38: goto st38;
  172         case 16: goto st16;
  173         case 17: goto st17;
  174         case 39: goto st39;
  175         case 18: goto st18;
  176         case 19: goto st19;
  177         case 40: goto st40;
  178         case 41: goto st41;
  179         case 20: goto st20;
  180         case 42: goto st42;
  181         case 43: goto st43;
  182         case 44: goto st44;
  183         case 21: goto st21;
  184         case 22: goto st22;
  185         case 45: goto st45;
  186         case 23: goto st23;
  187     default: break;
  188     }
  189 
  190     if ( ++p == pe )
  191         goto _test_eof;
  192 _resume:
  193     switch ( cs )
  194     {
  195 tr0:
  196 #line 230 "rlscan.rl"
  197     {{p = ((te))-1;}{ 
  198             escapeXML( *ts );
  199         }}
  200     goto st24;
  201 tr2:
  202 #line 79 "rlscan.rl"
  203     {te = p+1;{
  204         escapeXML( ts, te-ts );
  205     }}
  206     goto st24;
  207 tr5:
  208 #line 79 "rlscan.rl"
  209     {te = p+1;{
  210         escapeXML( ts, te-ts );
  211     }}
  212     goto st24;
  213 tr8:
  214 #line 79 "rlscan.rl"
  215     {te = p+1;{
  216         escapeXML( ts, te-ts );
  217     }}
  218     goto st24;
  219 tr40:
  220 #line 230 "rlscan.rl"
  221     {te = p+1;{ 
  222             escapeXML( *ts );
  223         }}
  224     goto st24;
  225 tr41:
  226 #line 235 "rlscan.rl"
  227     {te = p+1;}
  228     goto st24;
  229 tr46:
  230 #line 230 "rlscan.rl"
  231     {te = p;p--;{ 
  232             escapeXML( *ts );
  233         }}
  234     goto st24;
  235 tr48:
  236 #line 224 "rlscan.rl"
  237     {te = p;p--;{
  238             write( "<section>\n" ); 
  239             single_line = true; 
  240             {goto st35;}
  241         }}
  242     goto st24;
  243 tr49:
  244 #line 218 "rlscan.rl"
  245     {te = p+1;{ 
  246             write( "<section>\n" );
  247             single_line = false;
  248             {goto st35;}
  249         }}
  250     goto st24;
  251 tr50:
  252 #line 211 "rlscan.rl"
  253     {te = p+1;{
  254             escapeXML( ts, te-ts );
  255             {stack[top++] = 24;goto st6;}
  256         }}
  257     goto st24;
  258 st24:
  259 #line 1 "NONE"
  260     {ts = 0;}
  261     if ( ++p == pe )
  262         goto _test_eof24;
  263 case 24:
  264 #line 1 "NONE"
  265     {ts = p;}
  266 #line 267 "rlscan.cpp"
  267     switch( (*p) ) {
  268         case 0: goto tr41;
  269         case 34: goto tr42;
  270         case 37: goto st26;
  271         case 39: goto tr44;
  272         case 47: goto tr45;
  273     }
  274     goto tr40;
  275 tr42:
  276 #line 1 "NONE"
  277     {te = p+1;}
  278     goto st25;
  279 st25:
  280     if ( ++p == pe )
  281         goto _test_eof25;
  282 case 25:
  283 #line 284 "rlscan.cpp"
  284     switch( (*p) ) {
  285         case 34: goto tr2;
  286         case 92: goto st2;
  287     }
  288     goto st1;
  289 st1:
  290     if ( ++p == pe )
  291         goto _test_eof1;
  292 case 1:
  293     switch( (*p) ) {
  294         case 34: goto tr2;
  295         case 92: goto st2;
  296     }
  297     goto st1;
  298 st2:
  299     if ( ++p == pe )
  300         goto _test_eof2;
  301 case 2:
  302     goto st1;
  303 st26:
  304     if ( ++p == pe )
  305         goto _test_eof26;
  306 case 26:
  307     if ( (*p) == 37 )
  308         goto st27;
  309     goto tr46;
  310 st27:
  311     if ( ++p == pe )
  312         goto _test_eof27;
  313 case 27:
  314     if ( (*p) == 123 )
  315         goto tr49;
  316     goto tr48;
  317 tr44:
  318 #line 1 "NONE"
  319     {te = p+1;}
  320     goto st28;
  321 st28:
  322     if ( ++p == pe )
  323         goto _test_eof28;
  324 case 28:
  325 #line 326 "rlscan.cpp"
  326     switch( (*p) ) {
  327         case 39: goto tr5;
  328         case 92: goto st4;
  329     }
  330     goto st3;
  331 st3:
  332     if ( ++p == pe )
  333         goto _test_eof3;
  334 case 3:
  335     switch( (*p) ) {
  336         case 39: goto tr5;
  337         case 92: goto st4;
  338     }
  339     goto st3;
  340 st4:
  341     if ( ++p == pe )
  342         goto _test_eof4;
  343 case 4:
  344     goto st3;
  345 tr45:
  346 #line 1 "NONE"
  347     {te = p+1;}
  348     goto st29;
  349 st29:
  350     if ( ++p == pe )
  351         goto _test_eof29;
  352 case 29:
  353 #line 354 "rlscan.cpp"
  354     switch( (*p) ) {
  355         case 42: goto tr50;
  356         case 47: goto st5;
  357     }
  358     goto tr46;
  359 st5:
  360     if ( ++p == pe )
  361         goto _test_eof5;
  362 case 5:
  363     if ( (*p) == 10 )
  364         goto tr8;
  365     goto st5;
  366 tr9:
  367 #line 76 "rlscan.rl"
  368     { escapeXML( (*p) ); }
  369     goto st6;
  370 st6:
  371 #line 1 "NONE"
  372     {ts = 0;}
  373     if ( ++p == pe )
  374         goto _test_eof6;
  375 case 6:
  376 #line 377 "rlscan.cpp"
  377     switch( (*p) ) {
  378         case 0: goto st0;
  379         case 42: goto tr11;
  380     }
  381     goto tr9;
  382 st0:
  383 cs = 0;
  384     goto _out;
  385 tr11:
  386 #line 76 "rlscan.rl"
  387     { escapeXML( (*p) ); }
  388     goto st7;
  389 st7:
  390     if ( ++p == pe )
  391         goto _test_eof7;
  392 case 7:
  393 #line 394 "rlscan.cpp"
  394     switch( (*p) ) {
  395         case 0: goto st0;
  396         case 42: goto tr11;
  397         case 47: goto tr12;
  398     }
  399     goto tr9;
  400 tr12:
  401 #line 76 "rlscan.rl"
  402     { escapeXML( (*p) ); }
  403 #line 77 "rlscan.rl"
  404     { {cs = stack[--top];goto _again;} }
  405     goto st30;
  406 st30:
  407     if ( ++p == pe )
  408         goto _test_eof30;
  409 case 30:
  410 #line 411 "rlscan.cpp"
  411     goto st0;
  412 tr13:
  413 #line 112 "rlscan.rl"
  414     {{p = ((te))-1;}{ escapeXML( *ts ); }}
  415     goto st31;
  416 tr15:
  417 #line 79 "rlscan.rl"
  418     {te = p+1;{
  419         escapeXML( ts, te-ts );
  420     }}
  421     goto st31;
  422 tr18:
  423 #line 79 "rlscan.rl"
  424     {te = p+1;{
  425         escapeXML( ts, te-ts );
  426     }}
  427     goto st31;
  428 tr21:
  429 #line 79 "rlscan.rl"
  430     {te = p+1;{
  431         escapeXML( ts, te-ts );
  432     }}
  433     goto st31;
  434 tr51:
  435 #line 112 "rlscan.rl"
  436     {te = p+1;{ escapeXML( *ts ); }}
  437     goto st31;
  438 tr55:
  439 #line 97 "rlscan.rl"
  440     {te = p+1;{
  441             write( '{' );
  442             inline_depth += 1; 
  443         }}
  444     goto st31;
  445 tr56:
  446 #line 102 "rlscan.rl"
  447     {te = p+1;{
  448             write( '}' );
  449             /* If dropping down to the last } then return 
  450              * to ragel code. */
  451             if ( --inline_depth == 0 ) {
  452                 write( "</inline>\n" );
  453                 {goto st35;}
  454             }
  455         }}
  456     goto st31;
  457 tr57:
  458 #line 112 "rlscan.rl"
  459     {te = p;p--;{ escapeXML( *ts ); }}
  460     goto st31;
  461 tr58:
  462 #line 91 "rlscan.rl"
  463     {te = p+1;{
  464             write( "/*" );
  465             {stack[top++] = 31;goto st6;}
  466         }}
  467     goto st31;
  468 st31:
  469 #line 1 "NONE"
  470     {ts = 0;}
  471     if ( ++p == pe )
  472         goto _test_eof31;
  473 case 31:
  474 #line 1 "NONE"
  475     {ts = p;}
  476 #line 477 "rlscan.cpp"
  477     switch( (*p) ) {
  478         case 0: goto st0;
  479         case 34: goto tr52;
  480         case 39: goto tr53;
  481         case 47: goto tr54;
  482         case 123: goto tr55;
  483         case 125: goto tr56;
  484     }
  485     goto tr51;
  486 tr52:
  487 #line 1 "NONE"
  488     {te = p+1;}
  489     goto st32;
  490 st32:
  491     if ( ++p == pe )
  492         goto _test_eof32;
  493 case 32:
  494 #line 495 "rlscan.cpp"
  495     switch( (*p) ) {
  496         case 34: goto tr15;
  497         case 92: goto st9;
  498     }
  499     goto st8;
  500 st8:
  501     if ( ++p == pe )
  502         goto _test_eof8;
  503 case 8:
  504     switch( (*p) ) {
  505         case 34: goto tr15;
  506         case 92: goto st9;
  507     }
  508     goto st8;
  509 st9:
  510     if ( ++p == pe )
  511         goto _test_eof9;
  512 case 9:
  513     goto st8;
  514 tr53:
  515 #line 1 "NONE"
  516     {te = p+1;}
  517     goto st33;
  518 st33:
  519     if ( ++p == pe )
  520         goto _test_eof33;
  521 case 33:
  522 #line 523 "rlscan.cpp"
  523     switch( (*p) ) {
  524         case 39: goto tr18;
  525         case 92: goto st11;
  526     }
  527     goto st10;
  528 st10:
  529     if ( ++p == pe )
  530         goto _test_eof10;
  531 case 10:
  532     switch( (*p) ) {
  533         case 39: goto tr18;
  534         case 92: goto st11;
  535     }
  536     goto st10;
  537 st11:
  538     if ( ++p == pe )
  539         goto _test_eof11;
  540 case 11:
  541     goto st10;
  542 tr54:
  543 #line 1 "NONE"
  544     {te = p+1;}
  545     goto st34;
  546 st34:
  547     if ( ++p == pe )
  548         goto _test_eof34;
  549 case 34:
  550 #line 551 "rlscan.cpp"
  551     switch( (*p) ) {
  552         case 42: goto tr58;
  553         case 47: goto st12;
  554     }
  555     goto tr57;
  556 st12:
  557     if ( ++p == pe )
  558         goto _test_eof12;
  559 case 12:
  560     if ( (*p) == 10 )
  561         goto tr21;
  562     goto st12;
  563 tr22:
  564 #line 193 "rlscan.rl"
  565     {{p = ((te))-1;}{
  566             write( "<symbol>" );
  567             escapeXML( (*p) );
  568             write( "</symbol>\n" );
  569         }}
  570     goto st35;
  571 tr24:
  572 #line 166 "rlscan.rl"
  573     {te = p+1;{
  574             write( "<double_lit>" );
  575             escapeXML( ts, te-ts );
  576             write( "</double_lit>\n" );
  577         }}
  578     goto st35;
  579 tr27:
  580 #line 156 "rlscan.rl"
  581     {te = p+1;}
  582     goto st35;
  583 tr29:
  584 #line 159 "rlscan.rl"
  585     {te = p+1;{
  586             write( "<single_lit>" );
  587             escapeXML( ts, te-ts );
  588             write( "</single_lit>\n" );
  589         }}
  590     goto st35;
  591 tr32:
  592 #line 180 "rlscan.rl"
  593     {te = p+1;{
  594             write( "<re_lit>" );
  595             escapeXML( ts, te-ts );
  596             write( "</re_lit>\n" );
  597         }}
  598     goto st35;
  599 tr34:
  600 #line 142 "rlscan.rl"
  601     {{p = ((te))-1;}{
  602             write( "<int>" );
  603             write( ts, te-ts );
  604             write( "</int>\n" );
  605         }}
  606     goto st35;
  607 tr38:
  608 #line 173 "rlscan.rl"
  609     {te = p+1;{
  610             write( "<or_lit>" );
  611             escapeXML( ts, te-ts );
  612             write( "</or_lit>\n" );
  613         }}
  614     goto st35;
  615 tr39:
  616 #line 120 "rlscan.rl"
  617     {te = p+1;{
  618             if ( !single_line ) {
  619                 write( "</section>\n" );
  620                 {goto st24;}
  621             }
  622         }}
  623     goto st35;
  624 tr59:
  625 #line 199 "rlscan.rl"
  626     {te = p+1;}
  627     goto st35;
  628 tr60:
  629 #line 127 "rlscan.rl"
  630     {te = p+1;{
  631             if ( single_line ) {
  632                 write( "</section>\n" );
  633                 {goto st24;}
  634             }
  635         }}
  636     goto st35;
  637 tr61:
  638 #line 193 "rlscan.rl"
  639     {te = p+1;{
  640             write( "<symbol>" );
  641             escapeXML( (*p) );
  642             write( "</symbol>\n" );
  643         }}
  644     goto st35;
  645 tr70:
  646 #line 187 "rlscan.rl"
  647     {te = p+1;{
  648             inline_depth = 1;
  649             write( "<inline>{" );
  650             {goto st31;}
  651         }}
  652     goto st35;
  653 tr72:
  654 #line 193 "rlscan.rl"
  655     {te = p;p--;{
  656             write( "<symbol>" );
  657             escapeXML( (*p) );
  658             write( "</symbol>\n" );
  659         }}
  660     goto st35;
  661 tr73:
  662 #line 142 "rlscan.rl"
  663     {te = p;p--;{
  664             write( "<int>" );
  665             write( ts, te-ts );
  666             write( "</int>\n" );
  667         }}
  668     goto st35;
  669 tr75:
  670 #line 149 "rlscan.rl"
  671     {te = p;p--;{
  672             write( "<hex>" );
  673             write( ts, te-ts );
  674             write( "</hex>\n" );
  675         }}
  676     goto st35;
  677 tr76:
  678 #line 135 "rlscan.rl"
  679     {te = p;p--;{
  680             write( "<word>" );
  681             write( ts, te-ts );
  682             write( "</word>\n" );
  683         }}
  684     goto st35;
  685 st35:
  686 #line 1 "NONE"
  687     {ts = 0;}
  688     if ( ++p == pe )
  689         goto _test_eof35;
  690 case 35:
  691 #line 1 "NONE"
  692     {ts = p;}
  693 #line 694 "rlscan.cpp"
  694     switch( (*p) ) {
  695         case 0: goto st0;
  696         case 10: goto tr60;
  697         case 34: goto tr62;
  698         case 35: goto tr63;
  699         case 39: goto tr64;
  700         case 47: goto tr65;
  701         case 48: goto tr66;
  702         case 91: goto tr69;
  703         case 95: goto st43;
  704         case 123: goto tr70;
  705         case 125: goto tr71;
  706     }
  707     if ( (*p) < 65 ) {
  708         if ( (*p) < 49 ) {
  709             if ( 33 <= (*p) && (*p) <= 46 )
  710                 goto tr61;
  711         } else if ( (*p) > 57 ) {
  712             if ( 58 <= (*p) && (*p) <= 64 )
  713                 goto tr61;
  714         } else
  715             goto st41;
  716     } else if ( (*p) > 90 ) {
  717         if ( (*p) < 97 ) {
  718             if ( 92 <= (*p) && (*p) <= 96 )
  719                 goto tr61;
  720         } else if ( (*p) > 122 ) {
  721             if ( 124 <= (*p) && (*p) <= 126 )
  722                 goto tr61;
  723         } else
  724             goto st43;
  725     } else
  726         goto st43;
  727     goto tr59;
  728 tr62:
  729 #line 1 "NONE"
  730     {te = p+1;}
  731     goto st36;
  732 st36:
  733     if ( ++p == pe )
  734         goto _test_eof36;
  735 case 36:
  736 #line 737 "rlscan.cpp"
  737     switch( (*p) ) {
  738         case 34: goto tr24;
  739         case 92: goto st14;
  740     }
  741     goto st13;
  742 st13:
  743     if ( ++p == pe )
  744         goto _test_eof13;
  745 case 13:
  746     switch( (*p) ) {
  747         case 34: goto tr24;
  748         case 92: goto st14;
  749     }
  750     goto st13;
  751 st14:
  752     if ( ++p == pe )
  753         goto _test_eof14;
  754 case 14:
  755     goto st13;
  756 tr63:
  757 #line 1 "NONE"
  758     {te = p+1;}
  759     goto st37;
  760 st37:
  761     if ( ++p == pe )
  762         goto _test_eof37;
  763 case 37:
  764 #line 765 "rlscan.cpp"
  765     if ( (*p) == 10 )
  766         goto tr27;
  767     goto st15;
  768 st15:
  769     if ( ++p == pe )
  770         goto _test_eof15;
  771 case 15:
  772     if ( (*p) == 10 )
  773         goto tr27;
  774     goto st15;
  775 tr64:
  776 #line 1 "NONE"
  777     {te = p+1;}
  778     goto st38;
  779 st38:
  780     if ( ++p == pe )
  781         goto _test_eof38;
  782 case 38:
  783 #line 784 "rlscan.cpp"
  784     switch( (*p) ) {
  785         case 39: goto tr29;
  786         case 92: goto st17;
  787     }
  788     goto st16;
  789 st16:
  790     if ( ++p == pe )
  791         goto _test_eof16;
  792 case 16:
  793     switch( (*p) ) {
  794         case 39: goto tr29;
  795         case 92: goto st17;
  796     }
  797     goto st16;
  798 st17:
  799     if ( ++p == pe )
  800         goto _test_eof17;
  801 case 17:
  802     goto st16;
  803 tr65:
  804 #line 1 "NONE"
  805     {te = p+1;}
  806     goto st39;
  807 st39:
  808     if ( ++p == pe )
  809         goto _test_eof39;
  810 case 39:
  811 #line 812 "rlscan.cpp"
  812     switch( (*p) ) {
  813         case 47: goto tr32;
  814         case 92: goto st19;
  815     }
  816     goto st18;
  817 st18:
  818     if ( ++p == pe )
  819         goto _test_eof18;
  820 case 18:
  821     switch( (*p) ) {
  822         case 47: goto tr32;
  823         case 92: goto st19;
  824     }
  825     goto st18;
  826 st19:
  827     if ( ++p == pe )
  828         goto _test_eof19;
  829 case 19:
  830     goto st18;
  831 tr66:
  832 #line 1 "NONE"
  833     {te = p+1;}
  834     goto st40;
  835 st40:
  836     if ( ++p == pe )
  837         goto _test_eof40;
  838 case 40:
  839 #line 840 "rlscan.cpp"
  840     if ( (*p) == 120 )
  841         goto st20;
  842     if ( 48 <= (*p) && (*p) <= 57 )
  843         goto st41;
  844     goto tr73;
  845 st41:
  846     if ( ++p == pe )
  847         goto _test_eof41;
  848 case 41:
  849     if ( 48 <= (*p) && (*p) <= 57 )
  850         goto st41;
  851     goto tr73;
  852 st20:
  853     if ( ++p == pe )
  854         goto _test_eof20;
  855 case 20:
  856     if ( (*p) < 65 ) {
  857         if ( 48 <= (*p) && (*p) <= 57 )
  858             goto st42;
  859     } else if ( (*p) > 70 ) {
  860         if ( 97 <= (*p) && (*p) <= 102 )
  861             goto st42;
  862     } else
  863         goto st42;
  864     goto tr34;
  865 st42:
  866     if ( ++p == pe )
  867         goto _test_eof42;
  868 case 42:
  869     if ( (*p) < 65 ) {
  870         if ( 48 <= (*p) && (*p) <= 57 )
  871             goto st42;
  872     } else if ( (*p) > 70 ) {
  873         if ( 97 <= (*p) && (*p) <= 102 )
  874             goto st42;
  875     } else
  876         goto st42;
  877     goto tr75;
  878 st43:
  879     if ( ++p == pe )
  880         goto _test_eof43;
  881 case 43:
  882     if ( (*p) == 95 )
  883         goto st43;
  884     if ( (*p) < 65 ) {
  885         if ( 48 <= (*p) && (*p) <= 57 )
  886             goto st43;
  887     } else if ( (*p) > 90 ) {
  888         if ( 97 <= (*p) && (*p) <= 122 )
  889             goto st43;
  890     } else
  891         goto st43;
  892     goto tr76;
  893 tr69:
  894 #line 1 "NONE"
  895     {te = p+1;}
  896     goto st44;
  897 st44:
  898     if ( ++p == pe )
  899         goto _test_eof44;
  900 case 44:
  901 #line 902 "rlscan.cpp"
  902     switch( (*p) ) {
  903         case 92: goto st22;
  904         case 93: goto tr38;
  905     }
  906     goto st21;
  907 st21:
  908     if ( ++p == pe )
  909         goto _test_eof21;
  910 case 21:
  911     switch( (*p) ) {
  912         case 92: goto st22;
  913         case 93: goto tr38;
  914     }
  915     goto st21;
  916 st22:
  917     if ( ++p == pe )
  918         goto _test_eof22;
  919 case 22:
  920     goto st21;
  921 tr71:
  922 #line 1 "NONE"
  923     {te = p+1;}
  924     goto st45;
  925 st45:
  926     if ( ++p == pe )
  927         goto _test_eof45;
  928 case 45:
  929 #line 930 "rlscan.cpp"
  930     if ( (*p) == 37 )
  931         goto st23;
  932     goto tr72;
  933 st23:
  934     if ( ++p == pe )
  935         goto _test_eof23;
  936 case 23:
  937     if ( (*p) == 37 )
  938         goto tr39;
  939     goto tr22;
  940     }
  941     _test_eof24: cs = 24; goto _test_eof; 
  942     _test_eof25: cs = 25; goto _test_eof; 
  943     _test_eof1: cs = 1; goto _test_eof; 
  944     _test_eof2: cs = 2; goto _test_eof; 
  945     _test_eof26: cs = 26; goto _test_eof; 
  946     _test_eof27: cs = 27; goto _test_eof; 
  947     _test_eof28: cs = 28; goto _test_eof; 
  948     _test_eof3: cs = 3; goto _test_eof; 
  949     _test_eof4: cs = 4; goto _test_eof; 
  950     _test_eof29: cs = 29; goto _test_eof; 
  951     _test_eof5: cs = 5; goto _test_eof; 
  952     _test_eof6: cs = 6; goto _test_eof; 
  953     _test_eof7: cs = 7; goto _test_eof; 
  954     _test_eof30: cs = 30; goto _test_eof; 
  955     _test_eof31: cs = 31; goto _test_eof; 
  956     _test_eof32: cs = 32; goto _test_eof; 
  957     _test_eof8: cs = 8; goto _test_eof; 
  958     _test_eof9: cs = 9; goto _test_eof; 
  959     _test_eof33: cs = 33; goto _test_eof; 
  960     _test_eof10: cs = 10; goto _test_eof; 
  961     _test_eof11: cs = 11; goto _test_eof; 
  962     _test_eof34: cs = 34; goto _test_eof; 
  963     _test_eof12: cs = 12; goto _test_eof; 
  964     _test_eof35: cs = 35; goto _test_eof; 
  965     _test_eof36: cs = 36; goto _test_eof; 
  966     _test_eof13: cs = 13; goto _test_eof; 
  967     _test_eof14: cs = 14; goto _test_eof; 
  968     _test_eof37: cs = 37; goto _test_eof; 
  969     _test_eof15: cs = 15; goto _test_eof; 
  970     _test_eof38: cs = 38; goto _test_eof; 
  971     _test_eof16: cs = 16; goto _test_eof; 
  972     _test_eof17: cs = 17; goto _test_eof; 
  973     _test_eof39: cs = 39; goto _test_eof; 
  974     _test_eof18: cs = 18; goto _test_eof; 
  975     _test_eof19: cs = 19; goto _test_eof; 
  976     _test_eof40: cs = 40; goto _test_eof; 
  977     _test_eof41: cs = 41; goto _test_eof; 
  978     _test_eof20: cs = 20; goto _test_eof; 
  979     _test_eof42: cs = 42; goto _test_eof; 
  980     _test_eof43: cs = 43; goto _test_eof; 
  981     _test_eof44: cs = 44; goto _test_eof; 
  982     _test_eof21: cs = 21; goto _test_eof; 
  983     _test_eof22: cs = 22; goto _test_eof; 
  984     _test_eof45: cs = 45; goto _test_eof; 
  985     _test_eof23: cs = 23; goto _test_eof; 
  986 
  987     _test_eof: {}
  988     if ( p == eof )
  989     {
  990     switch ( cs ) {
  991     case 25: goto tr46;
  992     case 1: goto tr0;
  993     case 2: goto tr0;
  994     case 26: goto tr46;
  995     case 27: goto tr48;
  996     case 28: goto tr46;
  997     case 3: goto tr0;
  998     case 4: goto tr0;
  999     case 29: goto tr46;
 1000     case 5: goto tr0;
 1001     case 32: goto tr57;
 1002     case 8: goto tr13;
 1003     case 9: goto tr13;
 1004     case 33: goto tr57;
 1005     case 10: goto tr13;
 1006     case 11: goto tr13;
 1007     case 34: goto tr57;
 1008     case 12: goto tr13;
 1009     case 36: goto tr72;
 1010     case 13: goto tr22;
 1011     case 14: goto tr22;
 1012     case 37: goto tr72;
 1013     case 15: goto tr22;
 1014     case 38: goto tr72;
 1015     case 16: goto tr22;
 1016     case 17: goto tr22;
 1017     case 39: goto tr72;
 1018     case 18: goto tr22;
 1019     case 19: goto tr22;
 1020     case 40: goto tr73;
 1021     case 41: goto tr73;
 1022     case 20: goto tr34;
 1023     case 42: goto tr75;
 1024     case 43: goto tr76;
 1025     case 44: goto tr72;
 1026     case 21: goto tr22;
 1027     case 22: goto tr22;
 1028     case 45: goto tr72;
 1029     case 23: goto tr22;
 1030     }
 1031     }
 1032 
 1033     _out: {}
 1034     }
 1035 
 1036 #line 282 "rlscan.rl"
 1037 
 1038         if ( cs == RagelScan_error ) {
 1039             /* Machine failed before finding a token. */
 1040             cerr << "PARSE ERROR" << endl;
 1041             exit(1);
 1042         }
 1043 
 1044         if ( ts == 0 )
 1045             have = 0;
 1046         else {
 1047             /* There is a prefix to preserve, shift it over. */
 1048             have = pe - ts;
 1049             memmove( inbuf, ts, have );
 1050             te = inbuf + (te-ts);
 1051             ts = inbuf;
 1052         }
 1053     }
 1054     return 0;
 1055 }