home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / flexpp.zip / FLEX / FLEXSKEL.CC < prev    next >
C/C++ Source or Header  |  1994-10-24  |  28KB  |  1,070 lines

  1. /* A lexical scanner generated by flex */
  2. /* MODIFIED FOR C++ CLASS BY Alain Coetmeur: coetmeur(at)icdc.fr */
  3. /* Note that (at) mean the 'at' symbol that I cannot write */
  4. /* because it is expanded to the class name */
  5. /* made at Informatique-CDC, Research&development department */
  6. /* company from the Caisse Des Depots et Consignations */
  7. /* institutional financial group  */
  8.  
  9. /* Modified to support cheap/builtin linecount, 1994/10/24.
  10. ** by Gregor Buehler 100440.2470(at)compuserve.com
  11. ** Changes: included YY_(at)_LINENO/yy___lineno definitions like for YY_(at)_LENG
  12. **          included YY_LINECOUNT_UP in YY_DO_BEFORE_ACTION
  13. **          included YY_LINECOUNT_DOWN in yyless and yyunput
  14. **          included related member (C++) or static/extern (C) variables
  15. */
  16.  
  17. /* theses symbols are added before this file */
  18. /* #define YY_CHAR 'unsigned char' if 8bit or 'char' if 7bit */
  19. /* #define FLEX_DEBUG if debug mode */
  20. #define FLEX_SCANNER
  21. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  22. #ifdef c_plusplus
  23. #ifndef __cplusplus
  24. #define __cplusplus
  25. #endif
  26. #endif
  27. /* Old MSC, before c7 */
  28. #ifdef MSDOS
  29. #ifndef _MSDOS
  30. #define _MSDOS
  31. #endif
  32. #endif
  33. /* turboc */
  34. #ifdef __MSDOS__
  35. #ifndef _MSDOS
  36. #define _MSDOS
  37. #endif
  38. #endif
  39.  
  40. #ifdef __cplusplus
  41. #include <stdlib.h>
  42. #define YY_USE_CONST
  43. #define YY_USE_PROTOS
  44. #ifndef YY_USE_CLASS
  45. #define YY_USE_CLASS
  46. #endif
  47. #ifndef _MSDOS
  48. #include <osfcn.h>
  49. #endif
  50. #else   /* ! __cplusplus */
  51. #ifdef __STDC__
  52. #ifdef __GNUC__
  53. #include <stddef.h>
  54. void *malloc( size_t );
  55. void free( void* );
  56. int read();
  57. #else
  58. #include <stdlib.h>
  59. #endif  /* __GNUC__ */
  60. #define YY_USE_PROTOS
  61. #define YY_USE_CONST
  62. #endif  /* __STDC__ */
  63. #endif  /* ! __cplusplus */
  64. #ifdef __TURBOC__
  65. #define YY_USE_CONST
  66. #endif
  67. #include <stdio.h>
  68.  
  69.  
  70. /*********************************************/
  71. /* COMPILER DEPENDENT   MACROS               */
  72. /*********************************************/
  73. /* use prototypes in function declarations */
  74. /* the "const" storage-class-modifier is valid */
  75. #ifndef YY_USE_CONST
  76. #define const
  77. #endif
  78. /* use prototypes in function declarations */
  79. #ifndef YY_PROTO
  80. #ifdef YY_USE_PROTOS
  81. #define YY_PROTO(proto) proto
  82. #else
  83. #define YY_PROTO(proto) ()
  84. #endif
  85. #endif
  86.  
  87.  
  88. /*********************/
  89. /* parameters        */
  90.  
  91. /* amount of stuff to slurp up with each read */
  92. #ifndef YY_READ_BUF_SIZE
  93. #define YY_READ_BUF_SIZE 8192
  94. #endif
  95. /* size of default input buffer */
  96. #ifndef YY_BUF_SIZE
  97. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) 
  98. #endif
  99.  
  100. /***********************************/
  101. /* to be redefined for application */
  102.  
  103. /* returned upon end-of-file */
  104. #define YY_END_TOK 0
  105. /* no semi-colon after return; correct usage is to write "yyterminate();" -
  106.  * we don't want an extra ';' after the "return" because that will cause
  107.  * some compilers to complain about unreachable statements.
  108.  */
  109. #define yyterminate() return ( YY_NULL )
  110.  
  111. /* code executed at the end of each rule */
  112. #define YY_BREAK break;
  113.  
  114. /* #define YY_USER_ACTION */
  115. /* #define YY_USER_INIT */
  116.  
  117.  
  118. #ifndef YY_USE_CLASS
  119. /* copy whatever the last rule matched to the standard output */
  120. /* cast to (char *) is because for 8-bit chars, yy___text is (unsigned char *) */
  121. /* this used to be an fputs(), but since the string might contain NUL's,
  122.  * we now use fwrite()
  123.  */
  124. #define ECHO (void) fwrite( (char *) yy___text, yy___leng, 1, yy___out )
  125.  
  126. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  127.  * is returned in "result".
  128.  */
  129. #ifdef _MSDOS
  130. #define YY_INPUT(buf,result,max_size) \
  131.     if ( (result = fread(buf,1,max_size,yy___in)) < 0 ) \
  132.         YY_FATAL_ERROR( "fread() in flex scanner failed" );
  133. #else
  134. #define YY_INPUT(buf,result,max_size) \
  135.     if ( (result = read( fileno(yy___in), (char *) buf, max_size )) < 0 ) \
  136.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  137.  
  138. #endif
  139. /* report a fatal error */
  140.  
  141. /* The funky do-while is used to turn this macro definition into
  142.  * a single C statement (which needs a semi-colon terminator).
  143.  * This avoids problems with code like:
  144.  *
  145.  *      if ( something_happens )
  146.  *              YY_FATAL_ERROR( "oops, the something happened" );
  147.  *      else
  148.  *              everything_okay();
  149.  *
  150.  * Prior to using the do-while the compiler would get upset at the
  151.  * "else" because it interpreted the "if" statement as being all
  152.  * done when it reached the ';' after the YY_FATAL_ERROR() call.
  153.  */
  154.  
  155. #define YY_FATAL_ERROR(msg) \
  156.     do \
  157.         { \
  158.         (void) fputs( msg, yy___stderr  ); \
  159.         (void) putc( '\n', yy___stderr  ); \
  160.         exit( 1 ); \
  161.         } \
  162.     while ( 0 )
  163.  
  164. /* default yywrap function - always treat EOF as an EOF */
  165. #define yywrap() 1
  166.  
  167.  
  168. /* default declaration of generated scanner - a define so the user can
  169.  * easily add parameters
  170.  */
  171. #define YY_DECL int yylex YY_PROTO(( void )) 
  172. #else 
  173. /* c++ */
  174. #define ECHO yy___echo()
  175. #define YY_INPUT(buf,result,max_size) \
  176.     if ( yy___input((char *)buf, result,max_size) < 0 ) \
  177.         YY_FATAL_ERROR( "YY_INPUT() in flex scanner failed" );
  178.  
  179. #define YY_FATAL_ERROR(msg) yy___fatal_error(msg)
  180. #define yywrap() yy___wrap()
  181.  
  182. #endif
  183. /***********************************/
  184. /* not to be changed */
  185. #define YY_NULL 0
  186. #define YY_END_OF_BUFFER_CHAR 0
  187. /* special action meaning "start processing a new file" */
  188. #define YY_NEW_FILE yy___newfile 
  189. /* enter a start condition.  This macro really ought to take a parameter,
  190.  * but we do it the disgusting crufty way forced on us by the ()-less
  191.  * definition of BEGIN
  192.  */
  193. #define BEGIN yy_start = 1 + 2 *
  194.  
  195. /* action number for EOF rule of a given start state */
  196. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  197.  
  198.  
  199.  
  200. %% section 1 definitions go here
  201.  
  202. #define yy___stderr YY_@_ERRFILE
  203. #define yy___text YY_@_TEXT
  204. #define yy___leng YY_@_LENG
  205. #define yy___lineno YY_@_LINENO
  206. #define yy___in YY_@_IN
  207. #define yy___out YY_@_OUT
  208. #define yy___newfile \
  209.     do \
  210.         { \
  211.         YY_@_INIT_BUFFER( YY_@_CURRENT_BUFFER, yy___in ); \
  212.         YY_@_LOAD_BUFFER_STATE(); \
  213.         } \
  214.     while ( 0 )
  215. #if YY_@_DEBUG != 0
  216. #define yy___flex_debug YY_@_DEBUG_FLAG
  217. #endif
  218.  
  219.  
  220. #ifdef YY_USE_CLASS
  221.  
  222. #define yy___echo YY_@_ECHO
  223. #define yy___input YY_@_INPUT
  224. #define yy___fatal_error YY_@_FATAL_ERROR
  225. #define yy___wrap YY_@_WRAP
  226.  
  227. #endif
  228.  
  229. #define YY_LINECOUNT_UP {register char* yy_cpi=(yy___text); \
  230.              register char yy_c; register int yy_no = 0; \
  231.                    while ( (yy_c = *yy_cpi++) != '\0' ) {\
  232.                  if ( (yy_c) == '\n' ) yy_no++;\
  233.                    }\
  234.                                yy___lineno += (yy_last_no_of_newline = yy_no);\
  235.                 }
  236. #define YY_LINECOUNT_DOWN {yy___lineno -= yy_last_no_of_newline;}
  237.  
  238. /* done after the current pattern has been matched and before the
  239.  * corresponding action - sets up yy___text
  240.  */
  241. #define YY_DO_BEFORE_ACTION \
  242.     yy___text = yy_bp; \
  243. %% code to fiddle yy___text and yy___leng for yymore() goes here
  244.     yy_hold_char = *yy_cp; \
  245.     *yy_cp = '\0'; \
  246.     yy_c_buf_p = yy_cp;\
  247.     YY_LINECOUNT_UP;
  248.  
  249. #define EOB_ACT_CONTINUE_SCAN 0
  250. #define EOB_ACT_END_OF_FILE 1
  251. #define EOB_ACT_LAST_MATCH 2
  252.  
  253. /* return all but the first 'n' matched characters back to the input stream */
  254. #define yyless(n) \
  255.     do \
  256.         { \
  257.         /* undo effects of setting up yy___text */ \
  258.         *yy_cp = yy_hold_char; \
  259.         yy_c_buf_p = yy_cp = yy_bp + n; \
  260.         YY_LINECOUNT_DOWN; \
  261.         YY_DO_BEFORE_ACTION; /* set up yy___text again */ \
  262.         } \
  263.     while ( 0 )
  264.  
  265. #define unput(c) yyunput( c, yy___text )
  266.  
  267.  
  268.  
  269. struct yy_buffer_state
  270.     {
  271.     YY_@_IFILE  *yy_input_file;
  272.  
  273.     YY_@_CHAR *yy_ch_buf;               /* input buffer */
  274.     YY_@_CHAR *yy_buf_pos;      /* current position in input buffer */
  275.  
  276.     /* size of input buffer in bytes, not including room for EOB characters */
  277.     int yy_buf_size;    
  278.  
  279.     /* number of characters read into yy_ch_buf, not including EOB characters */
  280.     int yy_n_chars;
  281.  
  282.     int yy_eof_status;          /* whether we've seen an EOF on this buffer */
  283. #define EOF_NOT_SEEN 0
  284.     /* "pending" happens when the EOF has been seen but there's still
  285.      * some text process
  286.      */
  287. #define EOF_PENDING 1
  288. #define EOF_DONE 2
  289.     };
  290.  
  291. /* we provide macros for accessing buffer states in case in the
  292.  * future we want to put the buffer states in a more general
  293.  * "scanner state"
  294.  */
  295.  
  296. #ifndef YY_USE_CLASS
  297.  
  298. #if YY_@_DEBUG != 0
  299. int YY_@_DEBUG_FLAG=YY_@_DEBUG_INIT;
  300. #endif
  301. #define YY_CURRENT_BUFFER YY_@_CURRENT_BUFFER
  302. static YY_BUFFER_STATE YY_@_CURRENT_BUFFER;
  303. /* yy_hold_char holds the character lost when yy___text is formed */
  304. static YY_@_CHAR yy_hold_char;
  305.  
  306. static int yy_n_chars;          /* number of characters read into yy_ch_buf */
  307.  
  308. /* GLOBAL */
  309. YY_@_CHAR *yy___text;
  310. int yy___leng;
  311. int yy___lineno;
  312. static int yy_last_no_of_newline=0;   /* used for linecount macros */
  313.  
  314.  
  315. YY_@_IFILE  *yy___in = (YY_@_IFILE  *) 0;
  316. YY_@_OFILE *yy___out = (YY_@_OFILE  *) 0;
  317.  
  318. #ifdef __cplusplus
  319. static int yyinput YY_PROTO(( void ));
  320. #else
  321. static int input YY_PROTO(( void ));
  322. #endif
  323. /* these variables are all declared out here so that section 3 code can
  324.  * manipulate them
  325.  */
  326. /* points to current character in buffer */
  327. static YY_@_CHAR *yy_c_buf_p = (YY_@_CHAR *) 0;
  328. static int yy_init = 1;         /* whether we need to initialize */
  329. static int yy_start = 0;        /* start state number */
  330.  
  331. /* flag which is used to allow yywrap()'s to do buffer switches
  332.  * instead of setting up a fresh yy___in.  A bit of a hack ...
  333.  */
  334. static int yy_did_buffer_switch_on_eof;
  335.  
  336. static int yy_get_next_buffer YY_PROTO(( void ));
  337. static void yyunput YY_PROTO(( YY_@_CHAR c, YY_@_CHAR *buf_ptr ));
  338.  
  339. #else
  340. /* c++ */
  341. #ifndef YY_@_ECHO_NOCODE
  342. void YY_@_CLASS::yy___echo()
  343. {YY_@_ECHO_CODE
  344. }
  345. #endif
  346. #ifndef YY_@_INPUT_NOCODE
  347. int  YY_@_CLASS::yy___input(char * buffer,int &result,int max_size)
  348. {YY_@_INPUT_CODE
  349. }
  350. #endif
  351. #ifndef YY_@_FATAL_ERROR_NOCODE
  352. void YY_@_CLASS::yy___fatal_error(const char *msg)
  353. {YY_@_FATAL_ERROR_CODE
  354. }
  355. #endif
  356. #ifndef YY_@_WRAP_NOCODE
  357. int  YY_@_CLASS::yy___wrap()
  358. {YY_@_WRAP_CODE
  359. }
  360. #endif
  361. void YY_@_CLASS::yy_initialize()
  362. {
  363.  yy___in=0;yy___out=0;yy_init = 1;
  364.  yy_start=0;
  365.  yy___text=0;yy___leng=0;yy___lineno=1;
  366.  YY_@_CURRENT_BUFFER=0;
  367.  yy_did_buffer_switch_on_eof=0;
  368.  yy_c_buf_p=0;yy_hold_char=0;yy_n_chars=0;
  369. #if YY_@_DEBUG != 0
  370.  YY_@_DEBUG_FLAG=YY_@_DEBUG_INIT;
  371. #endif
  372. }
  373.  
  374. YY_@_CLASS::YY_@_CLASS(YY_@_CONSTRUCTOR_PARAM) YY_@_CONSTRUCTOR_INIT
  375. {yy_initialize();
  376.  YY_@_CONSTRUCTOR_CODE;
  377. }
  378. YY_@_CLASS::~YY_@_CLASS() 
  379. {YY_@_DESTRUCTOR_CODE;
  380.  if(YY_@_CURRENT_BUFFER)
  381.   YY_@_DELETE_BUFFER(YY_@_CURRENT_BUFFER);
  382. }
  383.  
  384. #endif
  385.  
  386.  
  387. #ifndef YY_USER_ACTION
  388. #define YY_USER_ACTION
  389. #endif
  390.  
  391. #ifndef YY_USER_INIT
  392. #define YY_USER_INIT
  393. #endif
  394.  
  395. %% data tables for the DFA go here
  396. #ifndef YY_USE_CLASS
  397. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  398. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  399. #else
  400. #define yy_get_previous_state() ((yy_state_type)(yy_get_previous_state_()))
  401. #define yy_try_NUL_trans(c) ((yy_state_type)(yy_try_NUL_trans_(c)))
  402. #endif
  403.  
  404. #ifndef YY_USE_CLASS
  405. #ifdef YY_@_LEX_DEFINED
  406. YY_@_LEX_RETURN YY_@_LEX ( YY_@_LEX_PARAM )
  407. YY_@_LEX_PARAM_DEF
  408. #else
  409. YY_DECL
  410. #endif
  411. #else
  412. YY_@_LEX_RETURN YY_@_CLASS::YY_@_LEX ( YY_@_LEX_PARAM)
  413.  
  414. #endif
  415.     {
  416.     register yy_state_type yy_current_state;
  417.     register YY_@_CHAR *yy_cp, *yy_bp;
  418.     register int yy_act;
  419.  
  420. %% user's declarations go here
  421.  
  422.     if ( yy_init )
  423.     {
  424.      
  425.      {
  426.      YY_USER_INIT;
  427.      }
  428.     if ( ! yy_start )
  429.         yy_start = 1;       /* first start state */
  430.  
  431.     if ( ! yy___in )
  432.         yy___in = YY_@_IFILE_DEFAULT;
  433.  
  434.     if ( ! yy___out )
  435.         yy___out = YY_@_OFILE_DEFAULT;
  436.  
  437.     if ( YY_@_CURRENT_BUFFER )
  438.         YY_@_INIT_BUFFER( YY_@_CURRENT_BUFFER, yy___in );
  439.     else
  440.         YY_@_CURRENT_BUFFER = YY_@_CREATE_BUFFER( yy___in, YY_BUF_SIZE );
  441.  
  442.     YY_@_LOAD_BUFFER_STATE();
  443.     yy_init=0;
  444.     }
  445.  
  446.     while ( 1 )         /* loops until end-of-file is reached */
  447.     {
  448. %% yymore()-related code goes here
  449.     yy_cp = yy_c_buf_p;
  450.  
  451.     /* support of yy___text */
  452.     *yy_cp = yy_hold_char;
  453.  
  454.     /* yy_bp points to the position in yy_ch_buf of the start of the
  455.      * current run.
  456.      */
  457.     yy_bp = yy_cp;
  458.  
  459. %% code to set up and find next match goes here
  460.  
  461. yy_find_action:
  462. %% code to find the action number goes here
  463.  
  464.     YY_DO_BEFORE_ACTION;
  465.     YY_USER_ACTION;
  466.  
  467. do_action:      /* this label is used only to access EOF actions */
  468. #if YY_@_DEBUG != 0
  469.     if ( yy___flex_debug )
  470.         {
  471.         if ( yy_act == 0 )
  472. #ifndef YY_@_IOSTREAM
  473.             fprintf( yy___stderr , "--scanner backtracking\n" );
  474. #else
  475.             yy___stderr <<"--scanner backtracking"<<endl;
  476. #endif
  477.         else if ( yy_act < YY_END_OF_BUFFER -1 )
  478. #ifndef YY_@_IOSTREAM
  479.             fprintf( yy___stderr , 
  480.              "--accepting rule at line %d (\"%s\")\n",
  481.              yy_rule_linenum[yy_act], yy___text );
  482. #else
  483.             yy___stderr <<"--accepting rule at line "
  484.                           <<(int)yy_rule_linenum[yy_act]
  485.                           <<" (\""<<(char *)yy___text<<"\")"<<endl;
  486. #endif
  487.         else if ( yy_act == YY_END_OF_BUFFER -1 )
  488. #ifndef YY_@_IOSTREAM
  489.             fprintf( yy___stderr , 
  490.              "--accepting default rule (\"%s\")\n",
  491.              yy___text );
  492. #else
  493.             yy___stderr <<"--accepting default rule"
  494.                           <<" (\""<<(char *)yy___text<<"\")"<<endl;
  495. #endif
  496.         else if ( yy_act == YY_END_OF_BUFFER )
  497. #ifndef YY_@_IOSTREAM
  498.             fprintf( yy___stderr , "--(end of buffer or a NUL)\n" );
  499. #else
  500.             yy___stderr <<"--(end of buffer or a NUL)"<<endl;
  501. #endif
  502.         else
  503. #ifndef YY_@_IOSTREAM
  504.             fprintf( yy___stderr , "--EOF\n" );
  505. #else
  506.             yy___stderr <<"--EOF"<<endl;
  507. #endif
  508.         }
  509. #endif
  510.     switch ( yy_act )
  511.         {
  512. %% actions go here
  513.  
  514.         case YY_END_OF_BUFFER:
  515.         {
  516.         /* amount of text matched not including the EOB char */
  517.         int yy_amount_of_matched_text = yy_cp - yy___text - 1;
  518.  
  519.         /* undo the effects of YY_DO_BEFORE_ACTION */
  520.         *yy_cp = yy_hold_char;
  521.  
  522.         /* note that here we test for yy_c_buf_p "<=" to the position
  523.          * of the first EOB in the buffer, since yy_c_buf_p will
  524.          * already have been incremented past the NUL character
  525.          * (since all states make transitions on EOB to the end-
  526.          * of-buffer state).  Contrast this with the test in yyinput().
  527.          */
  528.         if ( yy_c_buf_p <= &YY_@_CURRENT_BUFFER->yy_ch_buf[yy_n_chars] )
  529.             /* this was really a NUL */
  530.             {
  531.             yy_state_type yy_next_state;
  532.  
  533.             yy_c_buf_p = yy___text + yy_amount_of_matched_text;
  534.  
  535.             yy_current_state = yy_get_previous_state();
  536.  
  537.             /* okay, we're now positioned to make the
  538.              * NUL transition.  We couldn't have
  539.              * yy_get_previous_state() go ahead and do it
  540.              * for us because it doesn't know how to deal
  541.              * with the possibility of jamming (and we
  542.              * don't want to build jamming into it because
  543.              * then it will run more slowly)
  544.              */
  545.  
  546.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  547.  
  548.             yy_bp = yy___text + YY_MORE_ADJ;
  549.  
  550.             if ( yy_next_state )
  551.             {
  552.             /* consume the NUL */
  553.             yy_cp = ++yy_c_buf_p;
  554.             yy_current_state = yy_next_state;
  555.             goto yy_match;
  556.             }
  557.  
  558.             else
  559.             {
  560. %% code to do backtracking for compressed tables and set up yy_cp goes here
  561.             goto yy_find_action;
  562.             }
  563.             }
  564.  
  565.         else switch ( yy_get_next_buffer() )
  566.             {
  567.             case EOB_ACT_END_OF_FILE:
  568.             {
  569.             yy_did_buffer_switch_on_eof = 0;
  570.  
  571.             if ( yywrap() )
  572.                 {
  573.                 /* note: because we've taken care in
  574.                  * yy_get_next_buffer() to have set up yy___text,
  575.                  * we can now set up yy_c_buf_p so that if some
  576.                  * total hoser (like flex itself) wants
  577.                  * to call the scanner after we return the
  578.                  * YY_NULL, it'll still work - another YY_NULL
  579.                  * will get returned.
  580.                  */
  581.                 yy_c_buf_p = yy___text + YY_MORE_ADJ;
  582.  
  583.                 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  584.                 goto do_action;
  585.                 }
  586.  
  587.             else
  588.                 {
  589.                 if ( ! yy_did_buffer_switch_on_eof )
  590.                 YY_NEW_FILE;
  591.                 }
  592.             }
  593.             break;
  594.  
  595.             case EOB_ACT_CONTINUE_SCAN:
  596.             yy_c_buf_p = yy___text + yy_amount_of_matched_text;
  597.  
  598.             yy_current_state = yy_get_previous_state();
  599.  
  600.             yy_cp = yy_c_buf_p;
  601.             yy_bp = yy___text + YY_MORE_ADJ;
  602.             goto yy_match;
  603.  
  604.             case EOB_ACT_LAST_MATCH:
  605.             yy_c_buf_p =
  606.                 &YY_@_CURRENT_BUFFER->yy_ch_buf[yy_n_chars];
  607.  
  608.             yy_current_state = yy_get_previous_state();
  609.  
  610.             yy_cp = yy_c_buf_p;
  611.             yy_bp = yy___text + YY_MORE_ADJ;
  612.             goto yy_find_action;
  613.             }
  614.         break;
  615.         }
  616.  
  617.         default:
  618. #if YY_@_DEBUG != 0
  619. #ifndef YY_@_IOSTREAM
  620.         fprintf(yy___stderr , "action # %d\n", yy_act );
  621. #else
  622.         yy___stderr <<"action # "<<(int)yy_act<<endl;
  623. #endif
  624. #endif
  625.         YY_FATAL_ERROR(
  626.             "fatal flex scanner internal error--no action found" );
  627.         }
  628.     }
  629.     yyterminate();/* avoid the no return value error message on MS-C7/dos */
  630.     }
  631.  
  632.  
  633. /* yy_get_next_buffer - try to read in a new buffer
  634.  *
  635.  * synopsis
  636.  *     int yy_get_next_buffer();
  637.  *     
  638.  * returns a code representing an action
  639.  *     EOB_ACT_LAST_MATCH - 
  640.  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  641.  *     EOB_ACT_END_OF_FILE - end of file
  642.  */
  643. #ifndef YY_USE_CLASS
  644. static int yy_get_next_buffer()
  645. #else
  646. int YY_@_CLASS::yy_get_next_buffer()
  647. #endif
  648.     {
  649.     register YY_@_CHAR *dest = YY_@_CURRENT_BUFFER->yy_ch_buf;
  650.     register YY_@_CHAR *source = yy___text - 1; /* copy prev. char, too */
  651.     register int number_to_move, i;
  652.     int ret_val;
  653.  
  654.     if ( yy_c_buf_p > &YY_@_CURRENT_BUFFER->yy_ch_buf[yy_n_chars + 1] )
  655.     YY_FATAL_ERROR(
  656.         "fatal flex scanner internal error--end of buffer missed" );
  657.  
  658.     /* try to read more data */
  659.  
  660.     /* first move last chars to start of buffer */
  661.     number_to_move = yy_c_buf_p - yy___text;
  662.  
  663.     for ( i = 0; i < number_to_move; ++i )
  664.     *(dest++) = *(source++);
  665.  
  666.     if ( YY_@_CURRENT_BUFFER->yy_eof_status != EOF_NOT_SEEN )
  667.     /* don't do the read, it's not guaranteed to return an EOF,
  668.      * just force an EOF
  669.      */
  670.     yy_n_chars = 0;
  671.  
  672.     else
  673.     {
  674.     int num_to_read = YY_@_CURRENT_BUFFER->yy_buf_size - number_to_move - 1;
  675.  
  676.     if ( num_to_read > YY_READ_BUF_SIZE )
  677.         num_to_read = YY_READ_BUF_SIZE;
  678.  
  679.     else if ( num_to_read <= 0 )
  680.         YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
  681.  
  682.     /* read in more data */
  683.     YY_INPUT( (&YY_@_CURRENT_BUFFER->yy_ch_buf[number_to_move]),
  684.           yy_n_chars, num_to_read );
  685.     }
  686.  
  687.     if ( yy_n_chars == 0 )
  688.     {
  689.     if ( number_to_move - YY_MORE_ADJ == 1 )
  690.         {
  691.         ret_val = EOB_ACT_END_OF_FILE;
  692.         YY_@_CURRENT_BUFFER->yy_eof_status = EOF_DONE;
  693.         }
  694.  
  695.     else
  696.         {
  697.         ret_val = EOB_ACT_LAST_MATCH;
  698.         YY_@_CURRENT_BUFFER->yy_eof_status = EOF_PENDING;
  699.         }
  700.     }
  701.  
  702.     else
  703.     ret_val = EOB_ACT_CONTINUE_SCAN;
  704.  
  705.     yy_n_chars += number_to_move;
  706.     YY_@_CURRENT_BUFFER->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  707.     YY_@_CURRENT_BUFFER->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  708.  
  709.     /* yy___text begins at the second character in yy_ch_buf; the first
  710.      * character is the one which preceded it before reading in the latest
  711.      * buffer; it needs to be kept around in case it's a newline, so
  712.      * yy_get_previous_state() will have with '^' rules active
  713.      */
  714.  
  715.     yy___text = &YY_@_CURRENT_BUFFER->yy_ch_buf[1];
  716.  
  717.     return ( ret_val );
  718.     }
  719.  
  720.  
  721. /* yy_get_previous_state - get the state just before the EOB char was reached
  722.  *
  723.  * synopsis
  724.  *     yy_state_type yy_get_previous_state();
  725.  */
  726.  
  727. #ifndef YY_USE_CLASS
  728. static yy_state_type yy_get_previous_state()
  729. #else
  730. long YY_@_CLASS::yy_get_previous_state_()
  731. #endif
  732.     {
  733.     register yy_state_type yy_current_state;
  734.     register YY_@_CHAR *yy_cp;
  735.  
  736. %% code to get the start state into yy_current_state goes here
  737.  
  738.     for ( yy_cp = yy___text + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  739.     {
  740. %% code to find the next state goes here
  741.     }
  742.  
  743. #ifndef YY_USE_CLASS
  744.     return ( yy_current_state );
  745. #else
  746.     return (long)( yy_current_state );
  747. #endif
  748.     }
  749.  
  750.  
  751. /* yy_try_NUL_trans - try to make a transition on the NUL character
  752.  *
  753.  * synopsis
  754.  *     next_state = yy_try_NUL_trans( current_state );
  755.  */
  756.  
  757. #ifndef YY_USE_CLASS
  758. #ifdef YY_USE_PROTOS
  759. static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
  760. #else
  761. static yy_state_type yy_try_NUL_trans( yy_current_state )
  762. register yy_state_type yy_current_state;
  763. #endif
  764. #else
  765. long YY_@_CLASS::yy_try_NUL_trans_(long yy_current_state_)
  766. #endif
  767.  
  768.     {
  769. #ifndef YY_USE_CLASS
  770. #else
  771.     yy_state_type yy_current_state=(yy_state_type)yy_current_state_;
  772. #endif
  773.     register int yy_is_jam;
  774. %% code to find the next state, and perhaps do backtracking, goes here
  775.  
  776. #ifndef YY_USE_CLASS
  777.     return ( yy_is_jam ? 0 : yy_current_state );
  778. #else
  779.     return (long)( yy_is_jam ? 0 : yy_current_state );
  780. #endif
  781.     }
  782.  
  783. #ifndef YY_USE_CLASS
  784. #ifdef YY_USE_PROTOS
  785. static void yyunput( YY_@_CHAR c, register YY_@_CHAR *yy_bp )
  786. #else
  787. static void yyunput( c, yy_bp )
  788. YY_@_CHAR c;
  789. register YY_@_CHAR *yy_bp;
  790. #endif
  791. #else
  792. void YY_@_CLASS::yyunput( YY_@_CHAR c, YY_@_CHAR *yy_bp )
  793. #endif
  794.  
  795.     {
  796.     register YY_@_CHAR *yy_cp = yy_c_buf_p;
  797.  
  798.     /* undo effects of setting up yy___text */
  799.     *yy_cp = yy_hold_char;
  800.  
  801.     if ( yy_cp < YY_@_CURRENT_BUFFER->yy_ch_buf + 2 )
  802.     { /* need to shift things up to make room */
  803.     register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  804.     register YY_@_CHAR *dest =
  805.         &YY_@_CURRENT_BUFFER->yy_ch_buf[YY_@_CURRENT_BUFFER->yy_buf_size + 2];
  806.     register YY_@_CHAR *source =
  807.         &YY_@_CURRENT_BUFFER->yy_ch_buf[number_to_move];
  808.  
  809.     while ( source > YY_@_CURRENT_BUFFER->yy_ch_buf )
  810.         *--dest = *--source;
  811.  
  812.     yy_cp += dest - source;
  813.     yy_bp += dest - source;
  814.     yy_n_chars = YY_@_CURRENT_BUFFER->yy_buf_size;
  815.  
  816.     if ( yy_cp < YY_@_CURRENT_BUFFER->yy_ch_buf + 2 )
  817.         YY_FATAL_ERROR( "flex scanner push-back overflow" );
  818.     }
  819.  
  820.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  821.     yy_cp[-2] = '\n';
  822.  
  823.     *--yy_cp = c;
  824.  
  825.     /* note: the formal parameter *must* be called "yy_bp" for this
  826.      *       macro to now work correctly
  827.      */
  828.  
  829.     YY_LINECOUNT_DOWN;   /* restore old yy___lineno before last token read */
  830.     YY_DO_BEFORE_ACTION; /* set up yy___text and yy___lineno again */
  831.     }
  832.  
  833. #ifndef YY_USE_CLASS
  834. #ifdef __cplusplus
  835. static int yyinput()
  836. #else
  837. static int input()
  838. #endif
  839. #else
  840. int YY_@_CLASS::input()
  841. #endif
  842.     {
  843.     int c;
  844.     YY_@_CHAR *yy_cp = yy_c_buf_p;
  845.  
  846.     *yy_cp = yy_hold_char;
  847.  
  848.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  849.     {
  850.     /* yy_c_buf_p now points to the character we want to return.
  851.      * If this occurs *before* the EOB characters, then it's a
  852.      * valid NUL; if not, then we've hit the end of the buffer.
  853.      */
  854.     if ( yy_c_buf_p < &YY_@_CURRENT_BUFFER->yy_ch_buf[yy_n_chars] )
  855.         /* this was really a NUL */
  856.         *yy_c_buf_p = '\0';
  857.  
  858.     else
  859.         { /* need more input */
  860.         yy___text = yy_c_buf_p;
  861.         ++yy_c_buf_p;
  862.  
  863.         switch ( yy_get_next_buffer() )
  864.         {
  865.         case EOB_ACT_END_OF_FILE:
  866.             {
  867.             if ( yywrap() )
  868.             {
  869.             yy_c_buf_p = yy___text + YY_MORE_ADJ;
  870.             return ( EOF );
  871.             }
  872.  
  873.             YY_NEW_FILE;
  874. #ifndef YY_USE_CLASS
  875. #ifdef __cplusplus
  876.             return ( yyinput() );
  877. #else
  878.             return ( input() );
  879. #endif
  880. #else
  881.             return ( input() );
  882. #endif
  883.             }
  884.             break;
  885.  
  886.         case EOB_ACT_CONTINUE_SCAN:
  887.             yy_c_buf_p = yy___text + YY_MORE_ADJ;
  888.             break;
  889.  
  890.         case EOB_ACT_LAST_MATCH:
  891. #ifndef YY_USE_CLASS
  892. #ifdef __cplusplus
  893.             YY_FATAL_ERROR( "unexpected last match in yyinput()" );
  894. #else
  895.             YY_FATAL_ERROR( "unexpected last match in input()" );
  896. #endif
  897. #else
  898.             YY_FATAL_ERROR( "unexpected last match in YY_@_CLASS::input()" );
  899. #endif
  900.         }
  901.         }
  902.     }
  903.  
  904.     c = *yy_c_buf_p;
  905.     yy_hold_char = *++yy_c_buf_p;
  906.  
  907.     return ( c );
  908.     }
  909.  
  910.  
  911. #ifndef YY_USE_CLASS
  912. #ifdef YY_USE_PROTOS
  913. void YY_@_RESTART( YY_@_IFILE  *input_file )
  914. #else
  915. void YY_@_RESTART( input_file )
  916. YY_@_IFILE  *input_file;
  917. #endif
  918. #else
  919. void YY_@_CLASS::YY_@_RESTART ( YY_@_IFILE  *input_file )
  920. #endif
  921.  
  922.     {
  923.     YY_@_INIT_BUFFER( YY_@_CURRENT_BUFFER, input_file );
  924.     YY_@_LOAD_BUFFER_STATE();
  925.     }
  926.  
  927.  
  928. #ifndef YY_USE_CLASS
  929. #ifdef YY_USE_PROTOS
  930. void YY_@_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer )
  931. #else
  932. void YY_@_SWITCH_TO_BUFFER( new_buffer )
  933. YY_BUFFER_STATE new_buffer;
  934. #endif
  935. #else
  936. void YY_@_CLASS::YY_@_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer )
  937. #endif
  938.  
  939.     {
  940.     if ( YY_@_CURRENT_BUFFER == new_buffer )
  941.     return;
  942.  
  943.     if ( YY_@_CURRENT_BUFFER )
  944.     {
  945.     /* flush out information for old buffer */
  946.     *yy_c_buf_p = yy_hold_char;
  947.     YY_@_CURRENT_BUFFER->yy_buf_pos = yy_c_buf_p;
  948.     YY_@_CURRENT_BUFFER->yy_n_chars = yy_n_chars;
  949.     }
  950.  
  951.     YY_@_CURRENT_BUFFER = new_buffer;
  952.     YY_@_LOAD_BUFFER_STATE();
  953.  
  954.     /* we don't actually know whether we did this switch during
  955.      * EOF (yywrap()) processing, but the only time this flag
  956.      * is looked at is after yywrap() is called, so it's safe
  957.      * to go ahead and always set it.
  958.      */
  959.     yy_did_buffer_switch_on_eof = 1;
  960.     }
  961.  
  962.  
  963. #ifndef YY_USE_CLASS
  964. #ifdef YY_USE_PROTOS
  965. void YY_@_LOAD_BUFFER_STATE( void )
  966. #else
  967. void YY_@_LOAD_BUFFER_STATE()
  968. #endif
  969. #else
  970. void YY_@_CLASS::YY_@_LOAD_BUFFER_STATE(  )
  971. #endif
  972.  
  973.     {
  974.     yy_n_chars = YY_@_CURRENT_BUFFER->yy_n_chars;
  975.     yy___text = yy_c_buf_p = YY_@_CURRENT_BUFFER->yy_buf_pos;
  976.     yy___in = YY_@_CURRENT_BUFFER->yy_input_file;
  977.     yy_hold_char = *yy_c_buf_p;
  978.     }
  979.  
  980.  
  981. #ifndef YY_USE_CLASS
  982. #ifdef YY_USE_PROTOS
  983. YY_BUFFER_STATE YY_@_CREATE_BUFFER( YY_@_IFILE  *file, int size )
  984. #else
  985. YY_BUFFER_STATE YY_@_CREATE_BUFFER( file, size )
  986. YY_@_IFILE  *file;
  987. int size;
  988. #endif
  989. #else
  990. YY_BUFFER_STATE YY_@_CLASS::YY_@_CREATE_BUFFER( YY_@_IFILE  *file, int size )
  991. #endif
  992.  
  993.     {
  994.     YY_BUFFER_STATE b;
  995.  
  996.     b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
  997.  
  998.     if ( ! b )
  999.     YY_FATAL_ERROR( "out of dynamic memory in YY_@_CREATE_BUFFER()" );
  1000.  
  1001.     b->yy_buf_size = size;
  1002.  
  1003.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1004.      * we need to put in 2 end-of-buffer characters.
  1005.      */
  1006.     b->yy_ch_buf = (YY_@_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
  1007.  
  1008.     if ( ! b->yy_ch_buf )
  1009.     YY_FATAL_ERROR( "out of dynamic memory in YY_@_CREATE_BUFFER()" );
  1010.  
  1011.     YY_@_INIT_BUFFER( b, file );
  1012.  
  1013.     return ( b );
  1014.     }
  1015.  
  1016.  
  1017. #ifndef YY_USE_CLASS
  1018. #ifdef YY_USE_PROTOS
  1019. void YY_@_DELETE_BUFFER( YY_BUFFER_STATE b )
  1020. #else
  1021. void YY_@_DELETE_BUFFER( b )
  1022. YY_BUFFER_STATE b;
  1023. #endif
  1024. #else
  1025. void YY_@_CLASS::YY_@_DELETE_BUFFER( YY_BUFFER_STATE b )
  1026. #endif
  1027.  
  1028.     {
  1029.     if ( b == YY_@_CURRENT_BUFFER )
  1030.     YY_@_CURRENT_BUFFER = (YY_BUFFER_STATE) 0;
  1031.  
  1032.     free( (char *) b->yy_ch_buf );
  1033.     free( (char *) b );
  1034.     }
  1035.  
  1036.  
  1037. #ifndef YY_USE_CLASS
  1038. #ifdef YY_USE_PROTOS
  1039. void YY_@_INIT_BUFFER( YY_BUFFER_STATE b, YY_@_IFILE  *file )
  1040. #else
  1041. void YY_@_INIT_BUFFER( b, file )
  1042. YY_BUFFER_STATE b;
  1043. YY_@_IFILE  *file;
  1044. #endif
  1045. #else
  1046. void YY_@_CLASS::YY_@_INIT_BUFFER( YY_BUFFER_STATE b, YY_@_IFILE  *file)
  1047. #endif
  1048.  
  1049.     {
  1050.     b->yy_input_file = file;
  1051.  
  1052.     /* we put in the '\n' and start reading from [1] so that an
  1053.      * initial match-at-newline will be true.
  1054.      */
  1055.  
  1056.     b->yy_ch_buf[0] = '\n';
  1057.     b->yy_n_chars = 1;
  1058.  
  1059.     /* we always need two end-of-buffer characters.  The first causes
  1060.      * a transition to the end-of-buffer state.  The second causes
  1061.      * a jam in that state.
  1062.      */
  1063.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1064.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  1065.  
  1066.     b->yy_buf_pos = &b->yy_ch_buf[1];
  1067.  
  1068.     b->yy_eof_status = EOF_NOT_SEEN;
  1069.     }
  1070.