home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume23 / flex2.3 / part07 / initscan.c.02 next >
Encoding:
Text File  |  1990-10-10  |  17.7 KB  |  851 lines

  1. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  2. yy_c_buf_p = yy_cp = yy_bp + 1;
  3. YY_DO_BEFORE_ACTION; /* set up yytext again */
  4. # line 367 "scan.l"
  5. BEGIN(CARETISBOL); return ( '>' );
  6.     YY_BREAK
  7. case 72:
  8. # line 368 "scan.l"
  9. RETURNNAME;
  10.     YY_BREAK
  11. case 73:
  12. # line 369 "scan.l"
  13. synerr( "bad start condition name" );
  14.     YY_BREAK
  15. case 74:
  16. # line 371 "scan.l"
  17. BEGIN(SECT2); return ( '^' );
  18.     YY_BREAK
  19. case 75:
  20. # line 374 "scan.l"
  21. RETURNCHAR;
  22.     YY_BREAK
  23. case 76:
  24. # line 375 "scan.l"
  25. BEGIN(SECT2); return ( '"' );
  26.     YY_BREAK
  27. case 77:
  28. # line 377 "scan.l"
  29. {
  30.             synerr( "missing quote" );
  31.             BEGIN(SECT2);
  32.             ++linenum;
  33.             return ( '"' );
  34.             }
  35.     YY_BREAK
  36. case 78:
  37. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  38. yy_c_buf_p = yy_cp = yy_bp + 1;
  39. YY_DO_BEFORE_ACTION; /* set up yytext again */
  40. # line 385 "scan.l"
  41. BEGIN(CCL); return ( '^' );
  42.     YY_BREAK
  43. case 79:
  44. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  45. yy_c_buf_p = yy_cp = yy_bp + 1;
  46. YY_DO_BEFORE_ACTION; /* set up yytext again */
  47. # line 386 "scan.l"
  48. return ( '^' );
  49.     YY_BREAK
  50. case 80:
  51. # line 387 "scan.l"
  52. BEGIN(CCL); yylval = '-'; return ( CHAR );
  53.     YY_BREAK
  54. case 81:
  55. # line 388 "scan.l"
  56. BEGIN(CCL); RETURNCHAR;
  57.     YY_BREAK
  58. case 82:
  59. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  60. yy_c_buf_p = yy_cp = yy_bp + 1;
  61. YY_DO_BEFORE_ACTION; /* set up yytext again */
  62. # line 390 "scan.l"
  63. return ( '-' );
  64.     YY_BREAK
  65. case 83:
  66. # line 391 "scan.l"
  67. RETURNCHAR;
  68.     YY_BREAK
  69. case 84:
  70. # line 392 "scan.l"
  71. BEGIN(SECT2); return ( ']' );
  72.     YY_BREAK
  73. case 85:
  74. # line 395 "scan.l"
  75. {
  76.             yylval = myctoi( yytext );
  77.             return ( NUMBER );
  78.             }
  79.     YY_BREAK
  80. case 86:
  81. # line 400 "scan.l"
  82. return ( ',' );
  83.     YY_BREAK
  84. case 87:
  85. # line 401 "scan.l"
  86. BEGIN(SECT2); return ( '}' );
  87.     YY_BREAK
  88. case 88:
  89. # line 403 "scan.l"
  90. {
  91.             synerr( "bad character inside {}'s" );
  92.             BEGIN(SECT2);
  93.             return ( '}' );
  94.             }
  95.     YY_BREAK
  96. case 89:
  97. # line 409 "scan.l"
  98. {
  99.             synerr( "missing }" );
  100.             BEGIN(SECT2);
  101.             ++linenum;
  102.             return ( '}' );
  103.             }
  104.     YY_BREAK
  105. case 90:
  106. # line 417 "scan.l"
  107. synerr( "bad name in {}'s" ); BEGIN(SECT2);
  108.     YY_BREAK
  109. case 91:
  110. # line 418 "scan.l"
  111. synerr( "missing }" ); ++linenum; BEGIN(SECT2);
  112.     YY_BREAK
  113. case 92:
  114. # line 421 "scan.l"
  115. bracelevel = 0;
  116.     YY_BREAK
  117. case 93:
  118. # line 422 "scan.l"
  119. {
  120.             ACTION_ECHO;
  121.             CHECK_REJECT(yytext);
  122.             }
  123.     YY_BREAK
  124. case 94:
  125. # line 426 "scan.l"
  126. {
  127.             ACTION_ECHO;
  128.             CHECK_YYMORE(yytext);
  129.             }
  130.     YY_BREAK
  131. case 95:
  132. # line 430 "scan.l"
  133. ACTION_ECHO;
  134.     YY_BREAK
  135. case 96:
  136. # line 431 "scan.l"
  137. {
  138.             ++linenum;
  139.             ACTION_ECHO;
  140.             if ( bracelevel == 0 ||
  141.                  (doing_codeblock && indented_code) )
  142.                 {
  143.                 if ( ! doing_codeblock )
  144.                 fputs( "\tYY_BREAK\n", temp_action_file );
  145.                 
  146.                 doing_codeblock = false;
  147.                 BEGIN(SECT2);
  148.                 }
  149.             }
  150.     YY_BREAK
  151.     /* Reject and YYmore() are checked for above, in PERCENT_BRACE_ACTION */
  152. case 97:
  153. # line 447 "scan.l"
  154. ACTION_ECHO; ++bracelevel;
  155.     YY_BREAK
  156. case 98:
  157. # line 448 "scan.l"
  158. ACTION_ECHO; --bracelevel;
  159.     YY_BREAK
  160. case 99:
  161. # line 449 "scan.l"
  162. ACTION_ECHO;
  163.     YY_BREAK
  164. case 100:
  165. # line 450 "scan.l"
  166. ACTION_ECHO;
  167.     YY_BREAK
  168. case 101:
  169. # line 451 "scan.l"
  170. ACTION_ECHO; BEGIN(ACTION_COMMENT);
  171.     YY_BREAK
  172. case 102:
  173. # line 452 "scan.l"
  174. ACTION_ECHO; /* character constant */
  175.     YY_BREAK
  176. case 103:
  177. # line 453 "scan.l"
  178. ACTION_ECHO; BEGIN(ACTION_STRING);
  179.     YY_BREAK
  180. case 104:
  181. # line 454 "scan.l"
  182. {
  183.             ++linenum;
  184.             ACTION_ECHO;
  185.             if ( bracelevel == 0 )
  186.                 {
  187.                 fputs( "\tYY_BREAK\n", temp_action_file );
  188.                 BEGIN(SECT2);
  189.                 }
  190.             }
  191.     YY_BREAK
  192. case 105:
  193. # line 463 "scan.l"
  194. ACTION_ECHO;
  195.     YY_BREAK
  196. case 106:
  197. # line 465 "scan.l"
  198. ACTION_ECHO; BEGIN(ACTION);
  199.     YY_BREAK
  200. case 107:
  201. # line 466 "scan.l"
  202. ACTION_ECHO;
  203.     YY_BREAK
  204. case 108:
  205. # line 467 "scan.l"
  206. ACTION_ECHO;
  207.     YY_BREAK
  208. case 109:
  209. # line 468 "scan.l"
  210. ++linenum; ACTION_ECHO;
  211.     YY_BREAK
  212. case 110:
  213. # line 469 "scan.l"
  214. ACTION_ECHO;
  215.     YY_BREAK
  216. case 111:
  217. # line 471 "scan.l"
  218. ACTION_ECHO;
  219.     YY_BREAK
  220. case 112:
  221. # line 472 "scan.l"
  222. ACTION_ECHO;
  223.     YY_BREAK
  224. case 113:
  225. # line 473 "scan.l"
  226. ++linenum; ACTION_ECHO;
  227.     YY_BREAK
  228. case 114:
  229. # line 474 "scan.l"
  230. ACTION_ECHO; BEGIN(ACTION);
  231.     YY_BREAK
  232. case 115:
  233. # line 475 "scan.l"
  234. ACTION_ECHO;
  235.     YY_BREAK
  236. case YY_STATE_EOF(ACTION):
  237. case YY_STATE_EOF(ACTION_COMMENT):
  238. case YY_STATE_EOF(ACTION_STRING):
  239. # line 477 "scan.l"
  240. {
  241.             synerr( "EOF encountered inside an action" );
  242.             yyterminate();
  243.             }
  244.     YY_BREAK
  245. case 117:
  246. # line 483 "scan.l"
  247. {
  248.             yylval = myesc( yytext );
  249.             return ( CHAR );
  250.             }
  251.     YY_BREAK
  252. case 118:
  253. # line 488 "scan.l"
  254. {
  255.             yylval = myesc( yytext );
  256.             BEGIN(CCL);
  257.             return ( CHAR );
  258.             }
  259.     YY_BREAK
  260. case 119:
  261. # line 495 "scan.l"
  262. ECHO;
  263.     YY_BREAK
  264. case 120:
  265. # line 496 "scan.l"
  266. YY_FATAL_ERROR( "flex scanner jammed" );
  267.     YY_BREAK
  268. case YY_STATE_EOF(INITIAL):
  269. case YY_STATE_EOF(SECT2):
  270. case YY_STATE_EOF(SECT3):
  271. case YY_STATE_EOF(CODEBLOCK):
  272. case YY_STATE_EOF(PICKUPDEF):
  273. case YY_STATE_EOF(SC):
  274. case YY_STATE_EOF(CARETISBOL):
  275. case YY_STATE_EOF(NUM):
  276. case YY_STATE_EOF(QUOTE):
  277. case YY_STATE_EOF(FIRSTCCL):
  278. case YY_STATE_EOF(CCL):
  279. case YY_STATE_EOF(RECOVER):
  280. case YY_STATE_EOF(BRACEERROR):
  281. case YY_STATE_EOF(C_COMMENT):
  282. case YY_STATE_EOF(PERCENT_BRACE_ACTION):
  283. case YY_STATE_EOF(USED_LIST):
  284. case YY_STATE_EOF(CODEBLOCK_2):
  285. case YY_STATE_EOF(XLATION):
  286.     yyterminate();
  287.  
  288.         case YY_END_OF_BUFFER:
  289.         {
  290.         /* amount of text matched not including the EOB char */
  291.         int yy_amount_of_matched_text = yy_cp - yytext - 1;
  292.  
  293.         /* undo the effects of YY_DO_BEFORE_ACTION */
  294.         *yy_cp = yy_hold_char;
  295.  
  296.         /* note that here we test for yy_c_buf_p "<=" to the position
  297.          * of the first EOB in the buffer, since yy_c_buf_p will
  298.          * already have been incremented past the NUL character
  299.          * (since all states make transitions on EOB to the end-
  300.          * of-buffer state).  Contrast this with the test in yyinput().
  301.          */
  302.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  303.             /* this was really a NUL */
  304.             {
  305.             yy_state_type yy_next_state;
  306.  
  307.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  308.  
  309.             yy_current_state = yy_get_previous_state();
  310.  
  311.             /* okay, we're now positioned to make the
  312.              * NUL transition.  We couldn't have
  313.              * yy_get_previous_state() go ahead and do it
  314.              * for us because it doesn't know how to deal
  315.              * with the possibility of jamming (and we
  316.              * don't want to build jamming into it because
  317.              * then it will run more slowly)
  318.              */
  319.  
  320.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  321.  
  322.             yy_bp = yytext + YY_MORE_ADJ;
  323.  
  324.             if ( yy_next_state )
  325.             {
  326.             /* consume the NUL */
  327.             yy_cp = ++yy_c_buf_p;
  328.             yy_current_state = yy_next_state;
  329.             goto yy_match;
  330.             }
  331.  
  332.             else
  333.             {
  334.                 yy_cp = yy_last_accepting_cpos;
  335.                 yy_current_state = yy_last_accepting_state;
  336.             goto yy_find_action;
  337.             }
  338.             }
  339.  
  340.         else switch ( yy_get_next_buffer() )
  341.             {
  342.             case EOB_ACT_END_OF_FILE:
  343.             {
  344.             yy_did_buffer_switch_on_eof = 0;
  345.  
  346.             if ( yywrap() )
  347.                 {
  348.                 /* note: because we've taken care in
  349.                  * yy_get_next_buffer() to have set up yytext,
  350.                  * we can now set up yy_c_buf_p so that if some
  351.                  * total hoser (like flex itself) wants
  352.                  * to call the scanner after we return the
  353.                  * YY_NULL, it'll still work - another YY_NULL
  354.                  * will get returned.
  355.                  */
  356.                 yy_c_buf_p = yytext + YY_MORE_ADJ;
  357.  
  358.                 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  359.                 goto do_action;
  360.                 }
  361.  
  362.             else
  363.                 {
  364.                 if ( ! yy_did_buffer_switch_on_eof )
  365.                 YY_NEW_FILE;
  366.                 }
  367.             }
  368.             break;
  369.  
  370.             case EOB_ACT_CONTINUE_SCAN:
  371.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  372.  
  373.             yy_current_state = yy_get_previous_state();
  374.  
  375.             yy_cp = yy_c_buf_p;
  376.             yy_bp = yytext + YY_MORE_ADJ;
  377.             goto yy_match;
  378.  
  379.             case EOB_ACT_LAST_MATCH:
  380.             yy_c_buf_p =
  381.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  382.  
  383.             yy_current_state = yy_get_previous_state();
  384.  
  385.             yy_cp = yy_c_buf_p;
  386.             yy_bp = yytext + YY_MORE_ADJ;
  387.             goto yy_find_action;
  388.             }
  389.         break;
  390.         }
  391.  
  392.         default:
  393. #ifdef FLEX_DEBUG
  394.         printf( "action # %d\n", yy_act );
  395. #endif
  396.         YY_FATAL_ERROR(
  397.             "fatal flex scanner internal error--no action found" );
  398.         }
  399.     }
  400.     }
  401.  
  402.  
  403. /* yy_get_next_buffer - try to read in a new buffer
  404.  *
  405.  * synopsis
  406.  *     int yy_get_next_buffer();
  407.  *     
  408.  * returns a code representing an action
  409.  *     EOB_ACT_LAST_MATCH - 
  410.  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  411.  *     EOB_ACT_END_OF_FILE - end of file
  412.  */
  413.  
  414. static int yy_get_next_buffer()
  415.  
  416.     {
  417.     register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
  418.     register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
  419.     register int number_to_move, i;
  420.     int ret_val;
  421.  
  422.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  423.     YY_FATAL_ERROR(
  424.         "fatal flex scanner internal error--end of buffer missed" );
  425.  
  426.     /* try to read more data */
  427.  
  428.     /* first move last chars to start of buffer */
  429.     number_to_move = yy_c_buf_p - yytext;
  430.  
  431.     for ( i = 0; i < number_to_move; ++i )
  432.     *(dest++) = *(source++);
  433.  
  434.     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  435.     /* don't do the read, it's not guaranteed to return an EOF,
  436.      * just force an EOF
  437.      */
  438.     yy_n_chars = 0;
  439.  
  440.     else
  441.     {
  442.     int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
  443.  
  444.     if ( num_to_read > YY_READ_BUF_SIZE )
  445.         num_to_read = YY_READ_BUF_SIZE;
  446.  
  447.     else if ( num_to_read <= 0 )
  448.         YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
  449.  
  450.     /* read in more data */
  451.     YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  452.           yy_n_chars, num_to_read );
  453.     }
  454.  
  455.     if ( yy_n_chars == 0 )
  456.     {
  457.     if ( number_to_move == 1 )
  458.         {
  459.         ret_val = EOB_ACT_END_OF_FILE;
  460.         yy_current_buffer->yy_eof_status = EOF_DONE;
  461.         }
  462.  
  463.     else
  464.         {
  465.         ret_val = EOB_ACT_LAST_MATCH;
  466.         yy_current_buffer->yy_eof_status = EOF_PENDING;
  467.         }
  468.     }
  469.  
  470.     else
  471.     ret_val = EOB_ACT_CONTINUE_SCAN;
  472.  
  473.     yy_n_chars += number_to_move;
  474.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  475.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  476.  
  477.     /* yytext begins at the second character in yy_ch_buf; the first
  478.      * character is the one which preceded it before reading in the latest
  479.      * buffer; it needs to be kept around in case it's a newline, so
  480.      * yy_get_previous_state() will have with '^' rules active
  481.      */
  482.  
  483.     yytext = &yy_current_buffer->yy_ch_buf[1];
  484.  
  485.     return ( ret_val );
  486.     }
  487.  
  488.  
  489. /* yy_get_previous_state - get the state just before the EOB char was reached
  490.  *
  491.  * synopsis
  492.  *     yy_state_type yy_get_previous_state();
  493.  */
  494.  
  495. static yy_state_type yy_get_previous_state()
  496.  
  497.     {
  498.     register yy_state_type yy_current_state;
  499.     register YY_CHAR *yy_cp;
  500.  
  501.     register YY_CHAR *yy_bp = yytext;
  502.  
  503.     yy_current_state = yy_start;
  504.     if ( yy_bp[-1] == '\n' )
  505.     ++yy_current_state;
  506.  
  507.     for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  508.     {
  509.     register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
  510.     if ( yy_accept[yy_current_state] )
  511.         {
  512.         yy_last_accepting_state = yy_current_state;
  513.         yy_last_accepting_cpos = yy_cp;
  514.         }
  515.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  516.         {
  517.         yy_current_state = yy_def[yy_current_state];
  518.         if ( yy_current_state >= 341 )
  519.         yy_c = yy_meta[yy_c];
  520.         }
  521.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  522.     }
  523.  
  524.     return ( yy_current_state );
  525.     }
  526.  
  527.  
  528. /* yy_try_NUL_trans - try to make a transition on the NUL character
  529.  *
  530.  * synopsis
  531.  *     next_state = yy_try_NUL_trans( current_state );
  532.  */
  533.  
  534. #ifdef YY_USE_PROTOS
  535. static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
  536. #else
  537. static yy_state_type yy_try_NUL_trans( yy_current_state )
  538. register yy_state_type yy_current_state;
  539. #endif
  540.  
  541.     {
  542.     register int yy_is_jam;
  543.     register YY_CHAR *yy_cp = yy_c_buf_p;
  544.  
  545.     register YY_CHAR yy_c = 1;
  546.     if ( yy_accept[yy_current_state] )
  547.     {
  548.     yy_last_accepting_state = yy_current_state;
  549.     yy_last_accepting_cpos = yy_cp;
  550.     }
  551.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  552.     {
  553.     yy_current_state = yy_def[yy_current_state];
  554.     if ( yy_current_state >= 341 )
  555.         yy_c = yy_meta[yy_c];
  556.     }
  557.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  558.     yy_is_jam = (yy_current_state == 340);
  559.  
  560.     return ( yy_is_jam ? 0 : yy_current_state );
  561.     }
  562.  
  563.  
  564. #ifdef YY_USE_PROTOS
  565. static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
  566. #else
  567. static void yyunput( c, yy_bp )
  568. YY_CHAR c;
  569. register YY_CHAR *yy_bp;
  570. #endif
  571.  
  572.     {
  573.     register YY_CHAR *yy_cp = yy_c_buf_p;
  574.  
  575.     /* undo effects of setting up yytext */
  576.     *yy_cp = yy_hold_char;
  577.  
  578.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  579.     { /* need to shift things up to make room */
  580.     register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  581.     register YY_CHAR *dest =
  582.         &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
  583.     register YY_CHAR *source =
  584.         &yy_current_buffer->yy_ch_buf[number_to_move];
  585.  
  586.     while ( source > yy_current_buffer->yy_ch_buf )
  587.         *--dest = *--source;
  588.  
  589.     yy_cp += dest - source;
  590.     yy_bp += dest - source;
  591.     yy_n_chars = yy_current_buffer->yy_buf_size;
  592.  
  593.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  594.         YY_FATAL_ERROR( "flex scanner push-back overflow" );
  595.     }
  596.  
  597.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  598.     yy_cp[-2] = '\n';
  599.  
  600.     *--yy_cp = c;
  601.  
  602.     /* note: the formal parameter *must* be called "yy_bp" for this
  603.      *       macro to now work correctly
  604.      */
  605.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  606.     }
  607.  
  608.  
  609. #ifdef __cplusplus
  610. static int yyinput()
  611. #else
  612. static int input()
  613. #endif
  614.  
  615.     {
  616.     int c;
  617.     YY_CHAR *yy_cp = yy_c_buf_p;
  618.  
  619.     *yy_cp = yy_hold_char;
  620.  
  621.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  622.     {
  623.     /* yy_c_buf_p now points to the character we want to return.
  624.      * If this occurs *before* the EOB characters, then it's a
  625.      * valid NUL; if not, then we've hit the end of the buffer.
  626.      */
  627.     if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  628.         /* this was really a NUL */
  629.         *yy_c_buf_p = '\0';
  630.  
  631.     else
  632.         { /* need more input */
  633.         yytext = yy_c_buf_p;
  634.         ++yy_c_buf_p;
  635.  
  636.         switch ( yy_get_next_buffer() )
  637.         {
  638.         case EOB_ACT_END_OF_FILE:
  639.             {
  640.             if ( yywrap() )
  641.             {
  642.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  643.             return ( EOF );
  644.             }
  645.  
  646.             YY_NEW_FILE;
  647.  
  648. #ifdef __cplusplus
  649.             return ( yyinput() );
  650. #else
  651.             return ( input() );
  652. #endif
  653.             }
  654.             break;
  655.  
  656.         case EOB_ACT_CONTINUE_SCAN:
  657.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  658.             break;
  659.  
  660.         case EOB_ACT_LAST_MATCH:
  661. #ifdef __cplusplus
  662.             YY_FATAL_ERROR( "unexpected last match in yyinput()" );
  663. #else
  664.             YY_FATAL_ERROR( "unexpected last match in input()" );
  665. #endif
  666.         }
  667.         }
  668.     }
  669.  
  670.     c = *yy_c_buf_p;
  671.     yy_hold_char = *++yy_c_buf_p;
  672.  
  673.     return ( c );
  674.     }
  675.  
  676.  
  677. #ifdef YY_USE_PROTOS
  678. void yyrestart( FILE *input_file )
  679. #else
  680. void yyrestart( input_file )
  681. FILE *input_file;
  682. #endif
  683.  
  684.     {
  685.     yy_init_buffer( yy_current_buffer, input_file );
  686.     yy_load_buffer_state();
  687.     }
  688.  
  689.  
  690. #ifdef YY_USE_PROTOS
  691. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  692. #else
  693. void yy_switch_to_buffer( new_buffer )
  694. YY_BUFFER_STATE new_buffer;
  695. #endif
  696.  
  697.     {
  698.     if ( yy_current_buffer == new_buffer )
  699.     return;
  700.  
  701.     if ( yy_current_buffer )
  702.     {
  703.     /* flush out information for old buffer */
  704.     *yy_c_buf_p = yy_hold_char;
  705.     yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  706.     yy_current_buffer->yy_n_chars = yy_n_chars;
  707.     }
  708.  
  709.     yy_current_buffer = new_buffer;
  710.     yy_load_buffer_state();
  711.  
  712.     /* we don't actually know whether we did this switch during
  713.      * EOF (yywrap()) processing, but the only time this flag
  714.      * is looked at is after yywrap() is called, so it's safe
  715.      * to go ahead and always set it.
  716.      */
  717.     yy_did_buffer_switch_on_eof = 1;
  718.     }
  719.  
  720.  
  721. #ifdef YY_USE_PROTOS
  722. void yy_load_buffer_state( void )
  723. #else
  724. void yy_load_buffer_state()
  725. #endif
  726.  
  727.     {
  728.     yy_n_chars = yy_current_buffer->yy_n_chars;
  729.     yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  730.     yyin = yy_current_buffer->yy_input_file;
  731.     yy_hold_char = *yy_c_buf_p;
  732.     }
  733.  
  734.  
  735. #ifdef YY_USE_PROTOS
  736. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  737. #else
  738. YY_BUFFER_STATE yy_create_buffer( file, size )
  739. FILE *file;
  740. int size;
  741. #endif
  742.  
  743.     {
  744.     YY_BUFFER_STATE b;
  745.  
  746.     b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
  747.  
  748.     if ( ! b )
  749.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  750.  
  751.     b->yy_buf_size = size;
  752.  
  753.     /* yy_ch_buf has to be 2 characters longer than the size given because
  754.      * we need to put in 2 end-of-buffer characters.
  755.      */
  756.     b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
  757.  
  758.     if ( ! b->yy_ch_buf )
  759.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  760.  
  761.     yy_init_buffer( b, file );
  762.  
  763.     return ( b );
  764.     }
  765.  
  766.  
  767. #ifdef YY_USE_PROTOS
  768. void yy_delete_buffer( YY_BUFFER_STATE b )
  769. #else
  770. void yy_delete_buffer( b )
  771. YY_BUFFER_STATE b;
  772. #endif
  773.  
  774.     {
  775.     if ( b == yy_current_buffer )
  776.     yy_current_buffer = (YY_BUFFER_STATE) 0;
  777.  
  778.     free( (char *) b->yy_ch_buf );
  779.     free( (char *) b );
  780.     }
  781.  
  782.  
  783. #ifdef YY_USE_PROTOS
  784. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  785. #else
  786. void yy_init_buffer( b, file )
  787. YY_BUFFER_STATE b;
  788. FILE *file;
  789. #endif
  790.  
  791.     {
  792.     b->yy_input_file = file;
  793.  
  794.     /* we put in the '\n' and start reading from [1] so that an
  795.      * initial match-at-newline will be true.
  796.      */
  797.  
  798.     b->yy_ch_buf[0] = '\n';
  799.     b->yy_n_chars = 1;
  800.  
  801.     /* we always need two end-of-buffer characters.  The first causes
  802.      * a transition to the end-of-buffer state.  The second causes
  803.      * a jam in that state.
  804.      */
  805.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  806.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  807.  
  808.     b->yy_buf_pos = &b->yy_ch_buf[1];
  809.  
  810.     b->yy_eof_status = EOF_NOT_SEEN;
  811.     }
  812. # line 496 "scan.l"
  813.  
  814.  
  815.  
  816. int yywrap()
  817.  
  818.     {
  819.     if ( --num_input_files > 0 )
  820.     {
  821.     set_input_file( *++input_files );
  822.     return ( 0 );
  823.     }
  824.  
  825.     else
  826.     return ( 1 );
  827.     }
  828.  
  829.  
  830. /* set_input_file - open the given file (if NULL, stdin) for scanning */
  831.  
  832. void set_input_file( file )
  833. char *file;
  834.  
  835.     {
  836.     if ( file )
  837.     {
  838.     infilename = file;
  839.     yyin = fopen( infilename, "r" );
  840.  
  841.     if ( yyin == NULL )
  842.         lerrsf( "can't open %s", file );
  843.     }
  844.  
  845.     else
  846.     {
  847.     yyin = stdin;
  848.     infilename = "<stdin>";
  849.     }
  850.     }
  851.