home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / f / fle236ax.zip / FLEX.SKE < prev    next >
Text File  |  1992-02-22  |  21KB  |  843 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* scanner skeleton version:
  4.  * $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.16 90/08/03 14:09:36 vern Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8.  
  9. #include <stdio.h>
  10.  
  11.  
  12. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  13. #ifdef c_plusplus
  14. #ifndef __cplusplus
  15. #define __cplusplus
  16. #endif
  17. #endif
  18.  
  19.  
  20. #ifdef __cplusplus
  21.  
  22. #include <stdlib.h>
  23. #include <osfcn.h>
  24.  
  25. /* use prototypes in function declarations */
  26. #define YY_USE_PROTOS
  27.  
  28. /* the "const" storage-class-modifier is valid */
  29. #define YY_USE_CONST
  30.  
  31. #else    /* ! __cplusplus */
  32.  
  33. #ifdef __STDC__
  34.  
  35. #ifdef __GNUC__
  36. #include <stddef.h>
  37. void *malloc( size_t );
  38. void free( void* );
  39. #else
  40. #include <stdlib.h>
  41. #endif    /* __GNUC__ */
  42.  
  43. #define YY_USE_PROTOS
  44. #define YY_USE_CONST
  45.  
  46. #endif    /* __STDC__ */
  47. #endif    /* ! __cplusplus */
  48.  
  49. #ifdef MSDOS
  50. #if defined (_MSC_VER) && (_MSC_VER == 600)
  51. #define register        /* MSC 6.0 Compiler dies with fatal internal */
  52. #pragma optimize ("e", off)    /* error during register allocation ... */
  53. #endif /* MSC 6.0 */
  54. #endif /* MSDOS */
  55.  
  56. #ifdef __TURBOC__
  57. #define YY_USE_CONST
  58. #endif
  59.  
  60.  
  61. #ifndef YY_USE_CONST
  62. #define const
  63. #endif
  64.  
  65.  
  66. #ifdef YY_USE_PROTOS
  67. #define YY_PROTO(proto) proto
  68. #else
  69. #define YY_PROTO(proto) ()
  70. /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
  71.  * so it's got to be a K&R compiler, and therefore there's no standard
  72.  * place from which to include these definitions
  73.  */
  74. char *malloc();
  75. int free();
  76. int read();
  77. #endif
  78.  
  79.  
  80. /* amount of stuff to slurp up with each read */
  81. #ifndef YY_READ_BUF_SIZE
  82. #define YY_READ_BUF_SIZE 8192
  83. #endif
  84.  
  85. /* returned upon end-of-file */
  86. #define YY_END_TOK 0
  87.  
  88. /* copy whatever the last rule matched to the standard output */
  89.  
  90. /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
  91. /* this used to be an fputs(), but since the string might contain NUL's,
  92.  * we now use fwrite()
  93.  */
  94. #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
  95.  
  96. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  97.  * is returned in "result".
  98.  */
  99. #define YY_INPUT(buf,result,max_size) \
  100.     if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
  101.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  102. #define YY_NULL 0
  103.  
  104. /* no semi-colon after return; correct usage is to write "yyterminate();" -
  105.  * we don't want an extra ';' after the "return" because that will cause
  106.  * some compilers to complain about unreachable statements.
  107.  */
  108. #define yyterminate() return ( YY_NULL )
  109.  
  110. /* report a fatal error */
  111.  
  112. /* The funky do-while is used to turn this macro definition into
  113.  * a single C statement (which needs a semi-colon terminator).
  114.  * This avoids problems with code like:
  115.  *
  116.  *     if ( something_happens )
  117.  *        YY_FATAL_ERROR( "oops, the something happened" );
  118.  *    else
  119.  *        everything_okay();
  120.  *
  121.  * Prior to using the do-while the compiler would get upset at the
  122.  * "else" because it interpreted the "if" statement as being all
  123.  * done when it reached the ';' after the YY_FATAL_ERROR() call.
  124.  */
  125.  
  126. #define YY_FATAL_ERROR(msg) \
  127.     do \
  128.         { \
  129.         (void) fputs( msg, stderr ); \
  130.         (void) putc( '\n', stderr ); \
  131.         exit( 1 ); \
  132.         } \
  133.     while ( 0 )
  134.  
  135. /* default yywrap function - always treat EOF as an EOF */
  136. #define yywrap() 1
  137.  
  138. /* enter a start condition.  This macro really ought to take a parameter,
  139.  * but we do it the disgusting crufty way forced on us by the ()-less
  140.  * definition of BEGIN
  141.  */
  142. #define BEGIN yy_start = 1 + 2 *
  143.  
  144. /* action number for EOF rule of a given start state */
  145. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  146.  
  147. /* special action meaning "start processing a new file" */
  148. #define YY_NEW_FILE \
  149.     do \
  150.         { \
  151.         yy_init_buffer( yy_current_buffer, yyin ); \
  152.         yy_load_buffer_state(); \
  153.         } \
  154.     while ( 0 )
  155.  
  156. /* default declaration of generated scanner - a define so the user can
  157.  * easily add parameters
  158.  */
  159. #define YY_DECL int yylex YY_PROTO(( void )) 
  160.  
  161. /* code executed at the end of each rule */
  162. #define YY_BREAK break;
  163.  
  164. #define YY_END_OF_BUFFER_CHAR 0
  165.  
  166. #ifndef YY_BUF_SIZE
  167. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
  168. #endif
  169.  
  170. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  171.  
  172. %% section 1 definitions go here
  173.  
  174. /* done after the current pattern has been matched and before the
  175.  * corresponding action - sets up yytext
  176.  */
  177. #define YY_DO_BEFORE_ACTION \
  178.     yytext = yy_bp; \
  179. %% code to fiddle yytext and yyleng for yymore() goes here
  180.     yy_hold_char = *yy_cp; \
  181.     *yy_cp = '\0'; \
  182.     yy_c_buf_p = yy_cp;
  183.  
  184. #define EOB_ACT_CONTINUE_SCAN 0
  185. #define EOB_ACT_END_OF_FILE 1
  186. #define EOB_ACT_LAST_MATCH 2
  187.  
  188. /* return all but the first 'n' matched characters back to the input stream */
  189. #define yyless(n) \
  190.     do \
  191.         { \
  192.         /* undo effects of setting up yytext */ \
  193.         *yy_cp = yy_hold_char; \
  194.         yy_c_buf_p = yy_cp = yy_bp + n; \
  195.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  196.         } \
  197.     while ( 0 )
  198.  
  199. #define unput(c) yyunput( c, yytext )
  200.  
  201.  
  202. struct yy_buffer_state
  203.     {
  204.     FILE *yy_input_file;
  205.  
  206.     YY_CHAR *yy_ch_buf;        /* input buffer */
  207.     YY_CHAR *yy_buf_pos;    /* current position in input buffer */
  208.  
  209.     /* size of input buffer in bytes, not including room for EOB characters*/
  210.     int yy_buf_size;    
  211.  
  212.     /* number of characters read into yy_ch_buf, not including EOB characters */
  213.     int yy_n_chars;
  214.  
  215.     int yy_eof_status;        /* whether we've seen an EOF on this buffer */
  216. #define EOF_NOT_SEEN 0
  217.     /* "pending" happens when the EOF has been seen but there's still
  218.      * some text process
  219.      */
  220. #define EOF_PENDING 1
  221. #define EOF_DONE 2
  222.     };
  223.  
  224. static YY_BUFFER_STATE yy_current_buffer;
  225.  
  226. /* we provide macros for accessing buffer states in case in the
  227.  * future we want to put the buffer states in a more general
  228.  * "scanner state"
  229.  */
  230. #define YY_CURRENT_BUFFER yy_current_buffer
  231.  
  232.  
  233. /* yy_hold_char holds the character lost when yytext is formed */
  234. static YY_CHAR yy_hold_char;
  235.  
  236. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  237.  
  238.  
  239.  
  240. #ifndef YY_USER_ACTION
  241. #define YY_USER_ACTION
  242. #endif
  243.  
  244. #ifndef YY_USER_INIT
  245. #define YY_USER_INIT
  246. #endif
  247.  
  248. extern YY_CHAR *yytext;
  249. extern int yyleng;
  250. extern FILE *yyin, *yyout;
  251.  
  252. YY_CHAR *yytext;
  253. int yyleng;
  254.  
  255. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  256.  
  257. %% data tables for the DFA go here
  258.  
  259. /* these variables are all declared out here so that section 3 code can
  260.  * manipulate them
  261.  */
  262. /* points to current character in buffer */
  263. static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
  264. static int yy_init = 1;        /* whether we need to initialize */
  265. static int yy_start = 0;    /* start state number */
  266.  
  267. /* flag which is used to allow yywrap()'s to do buffer switches
  268.  * instead of setting up a fresh yyin.  A bit of a hack ...
  269.  */
  270. static int yy_did_buffer_switch_on_eof;
  271.  
  272. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  273. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  274. static int yy_get_next_buffer YY_PROTO(( void ));
  275. static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
  276. void yyrestart YY_PROTO(( FILE *input_file ));
  277. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  278. void yy_load_buffer_state YY_PROTO(( void ));
  279. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  280. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  281. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  282.  
  283. #define yy_new_buffer yy_create_buffer
  284.  
  285. #ifdef __cplusplus
  286. static int yyinput YY_PROTO(( void ));
  287. #else
  288. static int input YY_PROTO(( void ));
  289. #endif
  290.  
  291. YY_DECL
  292.     {
  293.     register yy_state_type yy_current_state;
  294.     register YY_CHAR *yy_cp, *yy_bp;
  295.     register int yy_act;
  296.  
  297. %% user's declarations go here
  298.  
  299.     if ( yy_init )
  300.     {
  301.     YY_USER_INIT;
  302.  
  303.     if ( ! yy_start )
  304.         yy_start = 1;    /* first start state */
  305.  
  306.     if ( ! yyin )
  307.         yyin = stdin;
  308.  
  309.     if ( ! yyout )
  310.         yyout = stdout;
  311.  
  312.     if ( yy_current_buffer )
  313.         yy_init_buffer( yy_current_buffer, yyin );
  314.     else
  315.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  316.  
  317.     yy_load_buffer_state();
  318.  
  319.     yy_init = 0;
  320.     }
  321.  
  322.     while ( 1 )        /* loops until end-of-file is reached */
  323.     {
  324. %% yymore()-related code goes here
  325.     yy_cp = yy_c_buf_p;
  326.  
  327.     /* support of yytext */
  328.     *yy_cp = yy_hold_char;
  329.  
  330.     /* yy_bp points to the position in yy_ch_buf of the start of the
  331.      * current run.
  332.      */
  333.     yy_bp = yy_cp;
  334.  
  335. %% code to set up and find next match goes here
  336.  
  337. yy_find_action:
  338. %% code to find the action number goes here
  339.  
  340.     YY_DO_BEFORE_ACTION;
  341.     YY_USER_ACTION;
  342.  
  343. do_action:    /* this label is used only to access EOF actions */
  344.  
  345. %% debug code goes here
  346.  
  347.     switch ( yy_act )
  348.         {
  349. %% actions go here
  350.  
  351.         case YY_END_OF_BUFFER:
  352.         {
  353.         /* amount of text matched not including the EOB char */
  354.         int yy_amount_of_matched_text = yy_cp - yytext - 1;
  355.  
  356.         /* undo the effects of YY_DO_BEFORE_ACTION */
  357.         *yy_cp = yy_hold_char;
  358.  
  359.         /* note that here we test for yy_c_buf_p "<=" to the position
  360.          * of the first EOB in the buffer, since yy_c_buf_p will
  361.          * already have been incremented past the NUL character
  362.          * (since all states make transitions on EOB to the end-
  363.          * of-buffer state).  Contrast this with the test in yyinput().
  364.          */
  365.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  366.             /* this was really a NUL */
  367.             {
  368.             yy_state_type yy_next_state;
  369.  
  370.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  371.  
  372.             yy_current_state = yy_get_previous_state();
  373.  
  374.             /* okay, we're now positioned to make the
  375.              * NUL transition.  We couldn't have
  376.              * yy_get_previous_state() go ahead and do it
  377.              * for us because it doesn't know how to deal
  378.              * with the possibility of jamming (and we
  379.              * don't want to build jamming into it because
  380.              * then it will run more slowly)
  381.              */
  382.  
  383.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  384.  
  385.             yy_bp = yytext + YY_MORE_ADJ;
  386.  
  387.             if ( yy_next_state )
  388.             {
  389.             /* consume the NUL */
  390.             yy_cp = ++yy_c_buf_p;
  391.             yy_current_state = yy_next_state;
  392.             goto yy_match;
  393.             }
  394.  
  395.             else
  396.             {
  397. %% code to do backtracking for compressed tables and set up yy_cp goes here
  398.             goto yy_find_action;
  399.             }
  400.             }
  401.  
  402.         else switch ( yy_get_next_buffer() )
  403.             {
  404.             case EOB_ACT_END_OF_FILE:
  405.             {
  406.             yy_did_buffer_switch_on_eof = 0;
  407.  
  408.             if ( yywrap() )
  409.                 {
  410.                 /* note: because we've taken care in
  411.                  * yy_get_next_buffer() to have set up yytext,
  412.                  * we can now set up yy_c_buf_p so that if some
  413.                  * total hoser (like flex itself) wants
  414.                  * to call the scanner after we return the
  415.                  * YY_NULL, it'll still work - another YY_NULL
  416.                  * will get returned.
  417.                  */
  418.                 yy_c_buf_p = yytext + YY_MORE_ADJ;
  419.  
  420.                 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  421.                 goto do_action;
  422.                 }
  423.  
  424.             else
  425.                 {
  426.                 if ( ! yy_did_buffer_switch_on_eof )
  427.                 YY_NEW_FILE;
  428.                 }
  429.             }
  430.             break;
  431.  
  432.             case EOB_ACT_CONTINUE_SCAN:
  433.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  434.  
  435.             yy_current_state = yy_get_previous_state();
  436.  
  437.             yy_cp = yy_c_buf_p;
  438.             yy_bp = yytext + YY_MORE_ADJ;
  439.             goto yy_match;
  440.  
  441.             case EOB_ACT_LAST_MATCH:
  442.             yy_c_buf_p =
  443.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  444.  
  445.             yy_current_state = yy_get_previous_state();
  446.  
  447.             yy_cp = yy_c_buf_p;
  448.             yy_bp = yytext + YY_MORE_ADJ;
  449.             goto yy_find_action;
  450.             }
  451.         break;
  452.         }
  453.  
  454.         default:
  455. #ifdef FLEX_DEBUG
  456.         printf( "action # %d\n", yy_act );
  457. #endif
  458.         YY_FATAL_ERROR(
  459.             "fatal flex scanner internal error--no action found" );
  460.         }
  461.     }
  462.     }
  463.  
  464.  
  465. /* yy_get_next_buffer - try to read in a new buffer
  466.  *
  467.  * synopsis
  468.  *     int yy_get_next_buffer();
  469.  *     
  470.  * returns a code representing an action
  471.  *     EOB_ACT_LAST_MATCH - 
  472.  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  473.  *     EOB_ACT_END_OF_FILE - end of file
  474.  */
  475.  
  476. static int yy_get_next_buffer()
  477.  
  478.     {
  479.     register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
  480.     register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
  481.     register int number_to_move, i;
  482.     int ret_val;
  483.  
  484.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  485.     YY_FATAL_ERROR(
  486.         "fatal flex scanner internal error--end of buffer missed" );
  487.  
  488.     /* try to read more data */
  489.  
  490.     /* first move last chars to start of buffer */
  491.     number_to_move = yy_c_buf_p - yytext;
  492.  
  493.     for ( i = 0; i < number_to_move; ++i )
  494.     *(dest++) = *(source++);
  495.  
  496.     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  497.     /* don't do the read, it's not guaranteed to return an EOF,
  498.      * just force an EOF
  499.      */
  500.     yy_n_chars = 0;
  501.  
  502.     else
  503.     {
  504.     int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
  505.  
  506.     if ( num_to_read > YY_READ_BUF_SIZE )
  507.         num_to_read = YY_READ_BUF_SIZE;
  508.  
  509.     else if ( num_to_read <= 0 )
  510.         YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
  511.  
  512.     /* read in more data */
  513.     YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  514.           yy_n_chars, num_to_read );
  515.     }
  516.  
  517.     if ( yy_n_chars == 0 )
  518.     {
  519.     if ( number_to_move == 1 )
  520.         {
  521.         ret_val = EOB_ACT_END_OF_FILE;
  522.         yy_current_buffer->yy_eof_status = EOF_DONE;
  523.         }
  524.  
  525.     else
  526.         {
  527.         ret_val = EOB_ACT_LAST_MATCH;
  528.         yy_current_buffer->yy_eof_status = EOF_PENDING;
  529.         }
  530.     }
  531.  
  532.     else
  533.     ret_val = EOB_ACT_CONTINUE_SCAN;
  534.  
  535.     yy_n_chars += number_to_move;
  536.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  537.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  538.  
  539.     /* yytext begins at the second character in yy_ch_buf; the first
  540.      * character is the one which preceded it before reading in the latest
  541.      * buffer; it needs to be kept around in case it's a newline, so
  542.      * yy_get_previous_state() will have with '^' rules active
  543.      */
  544.  
  545.     yytext = &yy_current_buffer->yy_ch_buf[1];
  546.  
  547.     return ( ret_val );
  548.     }
  549.  
  550.  
  551. /* yy_get_previous_state - get the state just before the EOB char was reached
  552.  *
  553.  * synopsis
  554.  *     yy_state_type yy_get_previous_state();
  555.  */
  556.  
  557. static yy_state_type yy_get_previous_state()
  558.  
  559.     {
  560.     register yy_state_type yy_current_state;
  561.     register YY_CHAR *yy_cp;
  562.  
  563. %% code to get the start state into yy_current_state goes here
  564.  
  565.     for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  566.     {
  567. %% code to find the next state goes here
  568.     }
  569.  
  570.     return ( yy_current_state );
  571.     }
  572.  
  573.  
  574. /* yy_try_NUL_trans - try to make a transition on the NUL character
  575.  *
  576.  * synopsis
  577.  *     next_state = yy_try_NUL_trans( current_state );
  578.  */
  579.  
  580. #ifdef YY_USE_PROTOS
  581. static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
  582. #else
  583. static yy_state_type yy_try_NUL_trans( yy_current_state )
  584. register yy_state_type yy_current_state;
  585. #endif
  586.  
  587.     {
  588.     register int yy_is_jam;
  589. %% code to find the next state, and perhaps do backtracking, goes here
  590.  
  591.     return ( yy_is_jam ? 0 : yy_current_state );
  592.     }
  593.  
  594.  
  595. #ifdef YY_USE_PROTOS
  596. static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
  597. #else
  598. static void yyunput( c, yy_bp )
  599. YY_CHAR c;
  600. register YY_CHAR *yy_bp;
  601. #endif
  602.  
  603.     {
  604.     register YY_CHAR *yy_cp = yy_c_buf_p;
  605.  
  606.     /* undo effects of setting up yytext */
  607.     *yy_cp = yy_hold_char;
  608.  
  609.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  610.     { /* need to shift things up to make room */
  611.     register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  612.     register YY_CHAR *dest =
  613.         &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
  614.     register YY_CHAR *source =
  615.         &yy_current_buffer->yy_ch_buf[number_to_move];
  616.  
  617.     while ( source > yy_current_buffer->yy_ch_buf )
  618.         *--dest = *--source;
  619.  
  620.     yy_cp += dest - source;
  621.     yy_bp += dest - source;
  622.     yy_n_chars = yy_current_buffer->yy_buf_size;
  623.  
  624.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  625.         YY_FATAL_ERROR( "flex scanner push-back overflow" );
  626.     }
  627.  
  628.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  629.     yy_cp[-2] = '\n';
  630.  
  631.     *--yy_cp = c;
  632.  
  633.     /* note: the formal parameter *must* be called "yy_bp" for this
  634.      *       macro to now work correctly
  635.      */
  636.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  637.     }
  638.  
  639.  
  640. #ifdef __cplusplus
  641. static int yyinput()
  642. #else
  643. static int input()
  644. #endif
  645.  
  646.     {
  647.     int c;
  648.     YY_CHAR *yy_cp = yy_c_buf_p;
  649.  
  650.     *yy_cp = yy_hold_char;
  651.  
  652.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  653.     {
  654.     /* yy_c_buf_p now points to the character we want to return.
  655.      * If this occurs *before* the EOB characters, then it's a
  656.      * valid NUL; if not, then we've hit the end of the buffer.
  657.      */
  658.     if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  659.         /* this was really a NUL */
  660.         *yy_c_buf_p = '\0';
  661.  
  662.     else
  663.         { /* need more input */
  664.         yytext = yy_c_buf_p;
  665.         ++yy_c_buf_p;
  666.  
  667.         switch ( yy_get_next_buffer() )
  668.         {
  669.         case EOB_ACT_END_OF_FILE:
  670.             {
  671.             if ( yywrap() )
  672.             {
  673.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  674.             return ( EOF );
  675.             }
  676.  
  677.             YY_NEW_FILE;
  678.  
  679. #ifdef __cplusplus
  680.             return ( yyinput() );
  681. #else
  682.             return ( input() );
  683. #endif
  684.             }
  685.             break;
  686.  
  687.         case EOB_ACT_CONTINUE_SCAN:
  688.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  689.             break;
  690.  
  691.         case EOB_ACT_LAST_MATCH:
  692. #ifdef __cplusplus
  693.             YY_FATAL_ERROR( "unexpected last match in yyinput()" );
  694. #else
  695.             YY_FATAL_ERROR( "unexpected last match in input()" );
  696. #endif
  697.         }
  698.         }
  699.     }
  700.  
  701.     c = *yy_c_buf_p;
  702.     yy_hold_char = *++yy_c_buf_p;
  703.  
  704.     return ( c );
  705.     }
  706.  
  707.  
  708. #ifdef YY_USE_PROTOS
  709. void yyrestart( FILE *input_file )
  710. #else
  711. void yyrestart( input_file )
  712. FILE *input_file;
  713. #endif
  714.  
  715.     {
  716.     yy_init_buffer( yy_current_buffer, input_file );
  717.     yy_load_buffer_state();
  718.     }
  719.  
  720.  
  721. #ifdef YY_USE_PROTOS
  722. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  723. #else
  724. void yy_switch_to_buffer( new_buffer )
  725. YY_BUFFER_STATE new_buffer;
  726. #endif
  727.  
  728.     {
  729.     if ( yy_current_buffer == new_buffer )
  730.     return;
  731.  
  732.     if ( yy_current_buffer )
  733.     {
  734.     /* flush out information for old buffer */
  735.     *yy_c_buf_p = yy_hold_char;
  736.     yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  737.     yy_current_buffer->yy_n_chars = yy_n_chars;
  738.     }
  739.  
  740.     yy_current_buffer = new_buffer;
  741.     yy_load_buffer_state();
  742.  
  743.     /* we don't actually know whether we did this switch during
  744.      * EOF (yywrap()) processing, but the only time this flag
  745.      * is looked at is after yywrap() is called, so it's safe
  746.      * to go ahead and always set it.
  747.      */
  748.     yy_did_buffer_switch_on_eof = 1;
  749.     }
  750.  
  751.  
  752. #ifdef YY_USE_PROTOS
  753. void yy_load_buffer_state( void )
  754. #else
  755. void yy_load_buffer_state()
  756. #endif
  757.  
  758.     {
  759.     yy_n_chars = yy_current_buffer->yy_n_chars;
  760.     yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  761.     yyin = yy_current_buffer->yy_input_file;
  762.     yy_hold_char = *yy_c_buf_p;
  763.     }
  764.  
  765.  
  766. #ifdef YY_USE_PROTOS
  767. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  768. #else
  769. YY_BUFFER_STATE yy_create_buffer( file, size )
  770. FILE *file;
  771. int size;
  772. #endif
  773.  
  774.     {
  775.     YY_BUFFER_STATE b;
  776.  
  777.     b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
  778.  
  779.     if ( ! b )
  780.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  781.  
  782.     b->yy_buf_size = size;
  783.  
  784.     /* yy_ch_buf has to be 2 characters longer than the size given because
  785.      * we need to put in 2 end-of-buffer characters.
  786.      */
  787.     b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
  788.  
  789.     if ( ! b->yy_ch_buf )
  790.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  791.  
  792.     yy_init_buffer( b, file );
  793.  
  794.     return ( b );
  795.     }
  796.  
  797.  
  798. #ifdef YY_USE_PROTOS
  799. void yy_delete_buffer( YY_BUFFER_STATE b )
  800. #else
  801. void yy_delete_buffer( b )
  802. YY_BUFFER_STATE b;
  803. #endif
  804.  
  805.     {
  806.     if ( b == yy_current_buffer )
  807.     yy_current_buffer = (YY_BUFFER_STATE) 0;
  808.  
  809.     free( (char *) b->yy_ch_buf );
  810.     free( (char *) b );
  811.     }
  812.  
  813.  
  814. #ifdef YY_USE_PROTOS
  815. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  816. #else
  817. void yy_init_buffer( b, file )
  818. YY_BUFFER_STATE b;
  819. FILE *file;
  820. #endif
  821.  
  822.     {
  823.     b->yy_input_file = file;
  824.  
  825.     /* we put in the '\n' and start reading from [1] so that an
  826.      * initial match-at-newline will be true.
  827.      */
  828.  
  829.     b->yy_ch_buf[0] = '\n';
  830.     b->yy_n_chars = 1;
  831.  
  832.     /* we always need two end-of-buffer characters.  The first causes
  833.      * a transition to the end-of-buffer state.  The second causes
  834.      * a jam in that state.
  835.      */
  836.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  837.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  838.  
  839.     b->yy_buf_pos = &b->yy_ch_buf[1];
  840.  
  841.     b->yy_eof_status = EOF_NOT_SEEN;
  842.     }
  843.