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