ret2HAPPY

lex.yy.c

Jun 8th, 2020
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #line 3 "lex.yy.c"
  3.  
  4. #define  YY_INT_ALIGNED short int
  5.  
  6. /* A lexical scanner generated by flex */
  7.  
  8. #define FLEX_SCANNER
  9. #define YY_FLEX_MAJOR_VERSION 2
  10. #define YY_FLEX_MINOR_VERSION 6
  11. #define YY_FLEX_SUBMINOR_VERSION 0
  12. #if YY_FLEX_SUBMINOR_VERSION > 0
  13. #define FLEX_BETA
  14. #endif
  15.  
  16. /* First, we deal with  platform-specific or compiler-specific issues. */
  17.  
  18. /* begin standard C headers. */
  19. #include <stdio.h>
  20. #include <string.h>
  21. #include <errno.h>
  22. #include <stdlib.h>
  23.  
  24. /* end standard C headers. */
  25.  
  26. /* flex integer type definitions */
  27.  
  28. #ifndef FLEXINT_H
  29. #define FLEXINT_H
  30.  
  31. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  32.  
  33. #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  34.  
  35. /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  36.  * if you want the limit (max/min) macros for int types.
  37.  */
  38. #ifndef __STDC_LIMIT_MACROS
  39. #define __STDC_LIMIT_MACROS 1
  40. #endif
  41.  
  42. #include <inttypes.h>
  43. typedef int8_t flex_int8_t;
  44. typedef uint8_t flex_uint8_t;
  45. typedef int16_t flex_int16_t;
  46. typedef uint16_t flex_uint16_t;
  47. typedef int32_t flex_int32_t;
  48. typedef uint32_t flex_uint32_t;
  49. #else
  50. typedef signed char flex_int8_t;
  51. typedef short int flex_int16_t;
  52. typedef int flex_int32_t;
  53. typedef unsigned char flex_uint8_t;
  54. typedef unsigned short int flex_uint16_t;
  55. typedef unsigned int flex_uint32_t;
  56.  
  57. /* Limits of integral types. */
  58. #ifndef INT8_MIN
  59. #define INT8_MIN               (-128)
  60. #endif
  61. #ifndef INT16_MIN
  62. #define INT16_MIN              (-32767-1)
  63. #endif
  64. #ifndef INT32_MIN
  65. #define INT32_MIN              (-2147483647-1)
  66. #endif
  67. #ifndef INT8_MAX
  68. #define INT8_MAX               (127)
  69. #endif
  70. #ifndef INT16_MAX
  71. #define INT16_MAX              (32767)
  72. #endif
  73. #ifndef INT32_MAX
  74. #define INT32_MAX              (2147483647)
  75. #endif
  76. #ifndef UINT8_MAX
  77. #define UINT8_MAX              (255U)
  78. #endif
  79. #ifndef UINT16_MAX
  80. #define UINT16_MAX             (65535U)
  81. #endif
  82. #ifndef UINT32_MAX
  83. #define UINT32_MAX             (4294967295U)
  84. #endif
  85.  
  86. #endif /* ! C99 */
  87.  
  88. #endif /* ! FLEXINT_H */
  89.  
  90. #ifdef __cplusplus
  91.  
  92. /* The "const" storage-class-modifier is valid. */
  93. #define YY_USE_CONST
  94.  
  95. #else   /* ! __cplusplus */
  96.  
  97. /* C99 requires __STDC__ to be defined as 1. */
  98. #if defined (__STDC__)
  99.  
  100. #define YY_USE_CONST
  101.  
  102. #endif  /* defined (__STDC__) */
  103. #endif  /* ! __cplusplus */
  104.  
  105. #ifdef YY_USE_CONST
  106. #define yyconst const
  107. #else
  108. #define yyconst
  109. #endif
  110.  
  111. /* Returned upon end-of-file. */
  112. #define YY_NULL 0
  113.  
  114. /* Promotes a possibly negative, possibly signed char to an unsigned
  115.  * integer for use as an array index.  If the signed char is negative,
  116.  * we want to instead treat it as an 8-bit unsigned char, hence the
  117.  * double cast.
  118.  */
  119. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  120.  
  121. /* Enter a start condition.  This macro really ought to take a parameter,
  122.  * but we do it the disgusting crufty way forced on us by the ()-less
  123.  * definition of BEGIN.
  124.  */
  125. #define BEGIN (yy_start) = 1 + 2 *
  126.  
  127. /* Translate the current start state into a value that can be later handed
  128.  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  129.  * compatibility.
  130.  */
  131. #define YY_START (((yy_start) - 1) / 2)
  132. #define YYSTATE YY_START
  133.  
  134. /* Action number for EOF rule of a given start state. */
  135. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  136.  
  137. /* Special action meaning "start processing a new file". */
  138. #define YY_NEW_FILE yyrestart(yyin  )
  139.  
  140. #define YY_END_OF_BUFFER_CHAR 0
  141.  
  142. /* Size of default input buffer. */
  143. #ifndef YY_BUF_SIZE
  144. #ifdef __ia64__
  145. /* On IA-64, the buffer size is 16k, not 8k.
  146.  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
  147.  * Ditto for the __ia64__ case accordingly.
  148.  */
  149. #define YY_BUF_SIZE 32768
  150. #else
  151. #define YY_BUF_SIZE 16384
  152. #endif /* __ia64__ */
  153. #endif
  154.  
  155. /* The state buf must be large enough to hold one state per character in the main buffer.
  156.  */
  157. #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  158.  
  159. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  160. #define YY_TYPEDEF_YY_BUFFER_STATE
  161. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  162. #endif
  163.  
  164. #ifndef YY_TYPEDEF_YY_SIZE_T
  165. #define YY_TYPEDEF_YY_SIZE_T
  166. typedef size_t yy_size_t;
  167. #endif
  168.  
  169. extern yy_size_t yyleng;
  170.  
  171. extern FILE *yyin, *yyout;
  172.  
  173. #define EOB_ACT_CONTINUE_SCAN 0
  174. #define EOB_ACT_END_OF_FILE 1
  175. #define EOB_ACT_LAST_MATCH 2
  176.  
  177.     #define YY_LESS_LINENO(n)
  178.     #define YY_LINENO_REWIND_TO(ptr)
  179.    
  180. /* Return all but the first "n" matched characters back to the input stream. */
  181. #define yyless(n) \
  182.     do \
  183.         { \
  184.         /* Undo effects of setting up yytext. */ \
  185.         int yyless_macro_arg = (n); \
  186.         YY_LESS_LINENO(yyless_macro_arg);\
  187.         *yy_cp = (yy_hold_char); \
  188.         YY_RESTORE_YY_MORE_OFFSET \
  189.         (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  190.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  191.         } \
  192.     while ( 0 )
  193.  
  194. #define unput(c) yyunput( c, (yytext_ptr)  )
  195.  
  196. #ifndef YY_STRUCT_YY_BUFFER_STATE
  197. #define YY_STRUCT_YY_BUFFER_STATE
  198. struct yy_buffer_state
  199.     {
  200.     FILE *yy_input_file;
  201.  
  202.     char *yy_ch_buf;        /* input buffer */
  203.     char *yy_buf_pos;       /* current position in input buffer */
  204.  
  205.     /* Size of input buffer in bytes, not including room for EOB
  206.      * characters.
  207.      */
  208.     yy_size_t yy_buf_size;
  209.  
  210.     /* Number of characters read into yy_ch_buf, not including EOB
  211.      * characters.
  212.      */
  213.     int yy_n_chars;
  214.  
  215.     /* Whether we "own" the buffer - i.e., we know we created it,
  216.      * and can realloc() it to grow it, and should free() it to
  217.      * delete it.
  218.      */
  219.     int yy_is_our_buffer;
  220.  
  221.     /* Whether this is an "interactive" input source; if so, and
  222.      * if we're using stdio for input, then we want to use getc()
  223.      * instead of fread(), to make sure we stop fetching input after
  224.      * each newline.
  225.      */
  226.     int yy_is_interactive;
  227.  
  228.     /* Whether we're considered to be at the beginning of a line.
  229.      * If so, '^' rules will be active on the next match, otherwise
  230.      * not.
  231.      */
  232.     int yy_at_bol;
  233.  
  234.     int yy_bs_lineno; /**< The line count. */
  235.     int yy_bs_column; /**< The column count. */
  236.    
  237.     /* Whether to try to fill the input buffer when we reach the
  238.      * end of it.
  239.      */
  240.     int yy_fill_buffer;
  241.  
  242.     int yy_buffer_status;
  243.  
  244. #define YY_BUFFER_NEW 0
  245. #define YY_BUFFER_NORMAL 1
  246.     /* When an EOF's been seen but there's still some text to process
  247.      * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  248.      * shouldn't try reading from the input source any more.  We might
  249.      * still have a bunch of tokens to match, though, because of
  250.      * possible backing-up.
  251.      *
  252.      * When we actually see the EOF, we change the status to "new"
  253.      * (via yyrestart()), so that the user can continue scanning by
  254.      * just pointing yyin at a new input file.
  255.      */
  256. #define YY_BUFFER_EOF_PENDING 2
  257.  
  258.     };
  259. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  260.  
  261. /* Stack of input buffers. */
  262. static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
  263. static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
  264. static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
  265.  
  266. /* We provide macros for accessing buffer states in case in the
  267.  * future we want to put the buffer states in a more general
  268.  * "scanner state".
  269.  *
  270.  * Returns the top of the stack, or NULL.
  271.  */
  272. #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
  273.                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
  274.                           : NULL)
  275.  
  276. /* Same as previous macro, but useful when we know that the buffer stack is not
  277.  * NULL or when we need an lvalue. For internal use only.
  278.  */
  279. #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
  280.  
  281. /* yy_hold_char holds the character lost when yytext is formed. */
  282. static char yy_hold_char;
  283. static int yy_n_chars;      /* number of characters read into yy_ch_buf */
  284. yy_size_t yyleng;
  285.  
  286. /* Points to current character in buffer. */
  287. static char *yy_c_buf_p = (char *) 0;
  288. static int yy_init = 0;     /* whether we need to initialize */
  289. static int yy_start = 0;    /* start state number */
  290.  
  291. /* Flag which is used to allow yywrap()'s to do buffer switches
  292.  * instead of setting up a fresh yyin.  A bit of a hack ...
  293.  */
  294. static int yy_did_buffer_switch_on_eof;
  295.  
  296. void yyrestart (FILE *input_file  );
  297. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
  298. YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
  299. void yy_delete_buffer (YY_BUFFER_STATE b  );
  300. void yy_flush_buffer (YY_BUFFER_STATE b  );
  301. void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
  302. void yypop_buffer_state (void );
  303.  
  304. static void yyensure_buffer_stack (void );
  305. static void yy_load_buffer_state (void );
  306. static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
  307.  
  308. #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
  309.  
  310. YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
  311. YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
  312. YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  );
  313.  
  314. void *yyalloc (yy_size_t  );
  315. void *yyrealloc (void *,yy_size_t  );
  316. void yyfree (void *  );
  317.  
  318. #define yy_new_buffer yy_create_buffer
  319.  
  320. #define yy_set_interactive(is_interactive) \
  321.     { \
  322.     if ( ! YY_CURRENT_BUFFER ){ \
  323.         yyensure_buffer_stack (); \
  324.         YY_CURRENT_BUFFER_LVALUE =    \
  325.             yy_create_buffer(yyin,YY_BUF_SIZE ); \
  326.     } \
  327.     YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  328.     }
  329.  
  330. #define yy_set_bol(at_bol) \
  331.     { \
  332.     if ( ! YY_CURRENT_BUFFER ){\
  333.         yyensure_buffer_stack (); \
  334.         YY_CURRENT_BUFFER_LVALUE =    \
  335.             yy_create_buffer(yyin,YY_BUF_SIZE ); \
  336.     } \
  337.     YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  338.     }
  339.  
  340. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  341.  
  342. typedef unsigned char YY_CHAR;
  343.  
  344. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  345.  
  346. typedef int yy_state_type;
  347.  
  348. extern int yylineno;
  349.  
  350. int yylineno = 1;
  351.  
  352. extern char *yytext;
  353. #ifdef yytext_ptr
  354. #undef yytext_ptr
  355. #endif
  356. #define yytext_ptr yytext
  357.  
  358. static yy_state_type yy_get_previous_state (void );
  359. static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
  360. static int yy_get_next_buffer (void );
  361. #if defined(__GNUC__) && __GNUC__ >= 3
  362. __attribute__((__noreturn__))
  363. #endif
  364. static void yy_fatal_error (yyconst char msg[]  );
  365.  
  366. /* Done after the current pattern has been matched and before the
  367.  * corresponding action - sets up yytext.
  368.  */
  369. #define YY_DO_BEFORE_ACTION \
  370.     (yytext_ptr) = yy_bp; \
  371.     yyleng = (size_t) (yy_cp - yy_bp); \
  372.     (yy_hold_char) = *yy_cp; \
  373.     *yy_cp = '\0'; \
  374.     (yy_c_buf_p) = yy_cp;
  375.  
  376. #define YY_NUM_RULES 1
  377. #define YY_END_OF_BUFFER 2
  378. /* This struct is not used in this scanner,
  379.    but its presence is necessary. */
  380. struct yy_trans_info
  381.     {
  382.     flex_int32_t yy_verify;
  383.     flex_int32_t yy_nxt;
  384.     };
  385. static yyconst flex_int16_t yy_accept[6] =
  386.     {   0,
  387.         0,    0,    2,    1,    0
  388.     } ;
  389.  
  390. static yyconst YY_CHAR yy_ec[256] =
  391.     {   0,
  392.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  393.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  394.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  395.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  396.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  397.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  398.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  399.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  400.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  401.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  402.  
  403.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  404.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  405.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  406.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  407.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  408.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  409.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  410.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  411.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  412.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  413.  
  414.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  415.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  416.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  417.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  418.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  419.         1,    1,    1,    1,    1
  420.     } ;
  421.  
  422. static yyconst YY_CHAR yy_meta[2] =
  423.     {   0,
  424.         1
  425.     } ;
  426.  
  427. static yyconst flex_uint16_t yy_base[7] =
  428.     {   0,
  429.         0,    0,    2,    3,    3,    0
  430.     } ;
  431.  
  432. static yyconst flex_int16_t yy_def[7] =
  433.     {   0,
  434.         6,    6,    5,    5,    0,    5
  435.     } ;
  436.  
  437. static yyconst flex_uint16_t yy_nxt[5] =
  438.     {   0,
  439.         4,    5,    3,    5
  440.     } ;
  441.  
  442. static yyconst flex_int16_t yy_chk[5] =
  443.     {   0,
  444.         6,    3,    5,    5
  445.     } ;
  446.  
  447. static yy_state_type yy_last_accepting_state;
  448. static char *yy_last_accepting_cpos;
  449.  
  450. extern int yy_flex_debug;
  451. int yy_flex_debug = 0;
  452.  
  453. /* The intent behind this definition is that it'll catch
  454.  * any uses of REJECT which flex missed.
  455.  */
  456. #define REJECT reject_used_but_not_detected
  457. #define yymore() yymore_used_but_not_detected
  458. #define YY_MORE_ADJ 0
  459. #define YY_RESTORE_YY_MORE_OFFSET
  460. char *yytext;
  461. #line 1 "happy.l"
  462. #line 463 "lex.yy.c"
  463.  
  464. #define INITIAL 0
  465.  
  466. #ifndef YY_NO_UNISTD_H
  467. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  468.  * down here because we want the user's section 1 to have been scanned first.
  469.  * The user has a chance to override it with an option.
  470.  */
  471. #include <unistd.h>
  472. #endif
  473.  
  474. #ifndef YY_EXTRA_TYPE
  475. #define YY_EXTRA_TYPE void *
  476. #endif
  477.  
  478. static int yy_init_globals (void );
  479.  
  480. /* Accessor methods to globals.
  481.    These are made visible to non-reentrant scanners for convenience. */
  482.  
  483. int yylex_destroy (void );
  484.  
  485. int yyget_debug (void );
  486.  
  487. void yyset_debug (int debug_flag  );
  488.  
  489. YY_EXTRA_TYPE yyget_extra (void );
  490.  
  491. void yyset_extra (YY_EXTRA_TYPE user_defined  );
  492.  
  493. FILE *yyget_in (void );
  494.  
  495. void yyset_in  (FILE * _in_str  );
  496.  
  497. FILE *yyget_out (void );
  498.  
  499. void yyset_out  (FILE * _out_str  );
  500.  
  501. yy_size_t yyget_leng (void );
  502.  
  503. char *yyget_text (void );
  504.  
  505. int yyget_lineno (void );
  506.  
  507. void yyset_lineno (int _line_number  );
  508.  
  509. /* Macros after this point can all be overridden by user definitions in
  510.  * section 1.
  511.  */
  512.  
  513. #ifndef YY_SKIP_YYWRAP
  514. #ifdef __cplusplus
  515. extern "C" int yywrap (void );
  516. #else
  517. extern int yywrap (void );
  518. #endif
  519. #endif
  520.  
  521. #ifndef YY_NO_UNPUT
  522.    
  523.     static void yyunput (int c,char *buf_ptr  );
  524.    
  525. #endif
  526.  
  527. #ifndef yytext_ptr
  528. static void yy_flex_strncpy (char *,yyconst char *,int );
  529. #endif
  530.  
  531. #ifdef YY_NEED_STRLEN
  532. static int yy_flex_strlen (yyconst char * );
  533. #endif
  534.  
  535. #ifndef YY_NO_INPUT
  536.  
  537. #ifdef __cplusplus
  538. static int yyinput (void );
  539. #else
  540. static int input (void );
  541. #endif
  542.  
  543. #endif
  544.  
  545. /* Amount of stuff to slurp up with each read. */
  546. #ifndef YY_READ_BUF_SIZE
  547. #ifdef __ia64__
  548. /* On IA-64, the buffer size is 16k, not 8k */
  549. #define YY_READ_BUF_SIZE 16384
  550. #else
  551. #define YY_READ_BUF_SIZE 8192
  552. #endif /* __ia64__ */
  553. #endif
  554.  
  555. /* Copy whatever the last rule matched to the standard output. */
  556. #ifndef ECHO
  557. /* This used to be an fputs(), but since the string might contain NUL's,
  558.  * we now use fwrite().
  559.  */
  560. #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
  561. #endif
  562.  
  563. /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  564.  * is returned in "result".
  565.  */
  566. #ifndef YY_INPUT
  567. #define YY_INPUT(buf,result,max_size) \
  568.     if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  569.         { \
  570.         int c = '*'; \
  571.         size_t n; \
  572.         for ( n = 0; n < max_size && \
  573.                  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  574.             buf[n] = (char) c; \
  575.         if ( c == '\n' ) \
  576.             buf[n++] = (char) c; \
  577.         if ( c == EOF && ferror( yyin ) ) \
  578.             YY_FATAL_ERROR( "input in flex scanner failed" ); \
  579.         result = n; \
  580.         } \
  581.     else \
  582.         { \
  583.         errno=0; \
  584.         while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
  585.             { \
  586.             if( errno != EINTR) \
  587.                 { \
  588.                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
  589.                 break; \
  590.                 } \
  591.             errno=0; \
  592.             clearerr(yyin); \
  593.             } \
  594.         }\
  595. \
  596.  
  597. #endif
  598.  
  599. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  600.  * we don't want an extra ';' after the "return" because that will cause
  601.  * some compilers to complain about unreachable statements.
  602.  */
  603. #ifndef yyterminate
  604. #define yyterminate() return YY_NULL
  605. #endif
  606.  
  607. /* Number of entries by which start-condition stack grows. */
  608. #ifndef YY_START_STACK_INCR
  609. #define YY_START_STACK_INCR 25
  610. #endif
  611.  
  612. /* Report a fatal error. */
  613. #ifndef YY_FATAL_ERROR
  614. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  615. #endif
  616.  
  617. /* end tables serialization structures and prototypes */
  618.  
  619. /* Default declaration of generated scanner - a define so the user can
  620.  * easily add parameters.
  621.  */
  622. #ifndef YY_DECL
  623. #define YY_DECL_IS_OURS 1
  624.  
  625. extern int yylex (void);
  626.  
  627. #define YY_DECL int yylex (void)
  628. #endif /* !YY_DECL */
  629.  
  630. /* Code executed at the beginning of each rule, after yytext and yyleng
  631.  * have been set up.
  632.  */
  633. #ifndef YY_USER_ACTION
  634. #define YY_USER_ACTION
  635. #endif
  636.  
  637. /* Code executed at the end of each rule. */
  638. #ifndef YY_BREAK
  639. #define YY_BREAK /*LINTED*/break;
  640. #endif
  641.  
  642. #define YY_RULE_SETUP \
  643.     YY_USER_ACTION
  644.  
  645. /** The main scanner function which does all the work.
  646.  */
  647. YY_DECL
  648. {
  649.     yy_state_type yy_current_state;
  650.     char *yy_cp, *yy_bp;
  651.     int yy_act;
  652.    
  653.     if ( !(yy_init) )
  654.         {
  655.         (yy_init) = 1;
  656.  
  657. #ifdef YY_USER_INIT
  658.         YY_USER_INIT;
  659. #endif
  660.  
  661.         if ( ! (yy_start) )
  662.             (yy_start) = 1; /* first start state */
  663.  
  664.         if ( ! yyin )
  665.             yyin = stdin;
  666.  
  667.         if ( ! yyout )
  668.             yyout = stdout;
  669.  
  670.         if ( ! YY_CURRENT_BUFFER ) {
  671.             yyensure_buffer_stack ();
  672.             YY_CURRENT_BUFFER_LVALUE =
  673.                 yy_create_buffer(yyin,YY_BUF_SIZE );
  674.         }
  675.  
  676.         yy_load_buffer_state( );
  677.         }
  678.  
  679.     {
  680. #line 1 "happy.l"
  681. #line 682 "lex.yy.c"
  682.  
  683.     while ( /*CONSTCOND*/1 )        /* loops until end-of-file is reached */
  684.         {
  685.         yy_cp = (yy_c_buf_p);
  686.  
  687.         /* Support of yytext. */
  688.         *yy_cp = (yy_hold_char);
  689.  
  690.         /* yy_bp points to the position in yy_ch_buf of the start of
  691.          * the current run.
  692.          */
  693.         yy_bp = yy_cp;
  694.  
  695.         yy_current_state = (yy_start);
  696. yy_match:
  697.         do
  698.             {
  699.             YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
  700.             if ( yy_accept[yy_current_state] )
  701.                 {
  702.                 (yy_last_accepting_state) = yy_current_state;
  703.                 (yy_last_accepting_cpos) = yy_cp;
  704.                 }
  705.             while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  706.                 {
  707.                 yy_current_state = (int) yy_def[yy_current_state];
  708.                 if ( yy_current_state >= 6 )
  709.                     yy_c = yy_meta[(unsigned int) yy_c];
  710.                 }
  711.             yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  712.             ++yy_cp;
  713.             }
  714.         while ( yy_base[yy_current_state] != 3 );
  715.  
  716. yy_find_action:
  717.         yy_act = yy_accept[yy_current_state];
  718.         if ( yy_act == 0 )
  719.             { /* have to back up */
  720.             yy_cp = (yy_last_accepting_cpos);
  721.             yy_current_state = (yy_last_accepting_state);
  722.             yy_act = yy_accept[yy_current_state];
  723.             }
  724.  
  725.         YY_DO_BEFORE_ACTION;
  726.  
  727. do_action:  /* This label is used only to access EOF actions. */
  728.  
  729.         switch ( yy_act )
  730.     { /* beginning of action switch */
  731.             case 0: /* must back up */
  732.             /* undo the effects of YY_DO_BEFORE_ACTION */
  733.             *yy_cp = (yy_hold_char);
  734.             yy_cp = (yy_last_accepting_cpos);
  735.             yy_current_state = (yy_last_accepting_state);
  736.             goto yy_find_action;
  737.  
  738. case 1:
  739. YY_RULE_SETUP
  740. #line 1 "happy.l"
  741. ECHO;
  742.     YY_BREAK
  743. #line 744 "lex.yy.c"
  744. case YY_STATE_EOF(INITIAL):
  745.     yyterminate();
  746.  
  747.     case YY_END_OF_BUFFER:
  748.         {
  749.         /* Amount of text matched not including the EOB char. */
  750.         int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
  751.  
  752.         /* Undo the effects of YY_DO_BEFORE_ACTION. */
  753.         *yy_cp = (yy_hold_char);
  754.         YY_RESTORE_YY_MORE_OFFSET
  755.  
  756.         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  757.             {
  758.             /* We're scanning a new file or input source.  It's
  759.              * possible that this happened because the user
  760.              * just pointed yyin at a new source and called
  761.              * yylex().  If so, then we have to assure
  762.              * consistency between YY_CURRENT_BUFFER and our
  763.              * globals.  Here is the right place to do so, because
  764.              * this is the first action (other than possibly a
  765.              * back-up) that will match for the new input source.
  766.              */
  767.             (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  768.             YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  769.             YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  770.             }
  771.  
  772.         /* Note that here we test for yy_c_buf_p "<=" to the position
  773.          * of the first EOB in the buffer, since yy_c_buf_p will
  774.          * already have been incremented past the NUL character
  775.          * (since all states make transitions on EOB to the
  776.          * end-of-buffer state).  Contrast this with the test
  777.          * in input().
  778.          */
  779.         if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  780.             { /* This was really a NUL. */
  781.             yy_state_type yy_next_state;
  782.  
  783.             (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
  784.  
  785.             yy_current_state = yy_get_previous_state(  );
  786.  
  787.             /* Okay, we're now positioned to make the NUL
  788.              * transition.  We couldn't have
  789.              * yy_get_previous_state() go ahead and do it
  790.              * for us because it doesn't know how to deal
  791.              * with the possibility of jamming (and we don't
  792.              * want to build jamming into it because then it
  793.              * will run more slowly).
  794.              */
  795.  
  796.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  797.  
  798.             yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  799.  
  800.             if ( yy_next_state )
  801.                 {
  802.                 /* Consume the NUL. */
  803.                 yy_cp = ++(yy_c_buf_p);
  804.                 yy_current_state = yy_next_state;
  805.                 goto yy_match;
  806.                 }
  807.  
  808.             else
  809.                 {
  810.                 yy_cp = (yy_c_buf_p);
  811.                 goto yy_find_action;
  812.                 }
  813.             }
  814.  
  815.         else switch ( yy_get_next_buffer(  ) )
  816.             {
  817.             case EOB_ACT_END_OF_FILE:
  818.                 {
  819.                 (yy_did_buffer_switch_on_eof) = 0;
  820.  
  821.                 if ( yywrap( ) )
  822.                     {
  823.                     /* Note: because we've taken care in
  824.                      * yy_get_next_buffer() to have set up
  825.                      * yytext, we can now set up
  826.                      * yy_c_buf_p so that if some total
  827.                      * hoser (like flex itself) wants to
  828.                      * call the scanner after we return the
  829.                      * YY_NULL, it'll still work - another
  830.                      * YY_NULL will get returned.
  831.                      */
  832.                     (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
  833.  
  834.                     yy_act = YY_STATE_EOF(YY_START);
  835.                     goto do_action;
  836.                     }
  837.  
  838.                 else
  839.                     {
  840.                     if ( ! (yy_did_buffer_switch_on_eof) )
  841.                         YY_NEW_FILE;
  842.                     }
  843.                 break;
  844.                 }
  845.  
  846.             case EOB_ACT_CONTINUE_SCAN:
  847.                 (yy_c_buf_p) =
  848.                     (yytext_ptr) + yy_amount_of_matched_text;
  849.  
  850.                 yy_current_state = yy_get_previous_state(  );
  851.  
  852.                 yy_cp = (yy_c_buf_p);
  853.                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  854.                 goto yy_match;
  855.  
  856.             case EOB_ACT_LAST_MATCH:
  857.                 (yy_c_buf_p) =
  858.                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
  859.  
  860.                 yy_current_state = yy_get_previous_state(  );
  861.  
  862.                 yy_cp = (yy_c_buf_p);
  863.                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  864.                 goto yy_find_action;
  865.             }
  866.         break;
  867.         }
  868.  
  869.     default:
  870.         YY_FATAL_ERROR(
  871.             "fatal flex scanner internal error--no action found" );
  872.     } /* end of action switch */
  873.         } /* end of scanning one token */
  874.     } /* end of user's declarations */
  875. } /* end of yylex */
  876.  
  877. /* yy_get_next_buffer - try to read in a new buffer
  878.  *
  879.  * Returns a code representing an action:
  880.  *  EOB_ACT_LAST_MATCH -
  881.  *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  882.  *  EOB_ACT_END_OF_FILE - end of file
  883.  */
  884. static int yy_get_next_buffer (void)
  885. {
  886.         char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  887.     char *source = (yytext_ptr);
  888.     yy_size_t number_to_move, i;
  889.     int ret_val;
  890.  
  891.     if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
  892.         YY_FATAL_ERROR(
  893.         "fatal flex scanner internal error--end of buffer missed" );
  894.  
  895.     if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  896.         { /* Don't try to fill the buffer, so this is an EOF. */
  897.         if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
  898.             {
  899.             /* We matched a single character, the EOB, so
  900.              * treat this as a final EOF.
  901.              */
  902.             return EOB_ACT_END_OF_FILE;
  903.             }
  904.  
  905.         else
  906.             {
  907.             /* We matched some text prior to the EOB, first
  908.              * process it.
  909.              */
  910.             return EOB_ACT_LAST_MATCH;
  911.             }
  912.         }
  913.  
  914.     /* Try to read more data. */
  915.  
  916.     /* First move last chars to start of buffer. */
  917.     number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
  918.  
  919.     for ( i = 0; i < number_to_move; ++i )
  920.         *(dest++) = *(source++);
  921.  
  922.     if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  923.         /* don't do the read, it's not guaranteed to return an EOF,
  924.          * just force an EOF
  925.          */
  926.         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
  927.  
  928.     else
  929.         {
  930.             yy_size_t num_to_read =
  931.             YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  932.  
  933.         while ( num_to_read <= 0 )
  934.             { /* Not enough room in the buffer - grow it. */
  935.  
  936.             /* just a shorter name for the current buffer */
  937.             YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
  938.  
  939.             int yy_c_buf_p_offset =
  940.                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
  941.  
  942.             if ( b->yy_is_our_buffer )
  943.                 {
  944.                 yy_size_t new_size = b->yy_buf_size * 2;
  945.  
  946.                 if ( new_size <= 0 )
  947.                     b->yy_buf_size += b->yy_buf_size / 8;
  948.                 else
  949.                     b->yy_buf_size *= 2;
  950.  
  951.                 b->yy_ch_buf = (char *)
  952.                     /* Include room in for 2 EOB chars. */
  953.                     yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
  954.                 }
  955.             else
  956.                 /* Can't grow it, we don't own it. */
  957.                 b->yy_ch_buf = 0;
  958.  
  959.             if ( ! b->yy_ch_buf )
  960.                 YY_FATAL_ERROR(
  961.                 "fatal error - scanner input buffer overflow" );
  962.  
  963.             (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
  964.  
  965.             num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  966.                         number_to_move - 1;
  967.  
  968.             }
  969.  
  970.         if ( num_to_read > YY_READ_BUF_SIZE )
  971.             num_to_read = YY_READ_BUF_SIZE;
  972.  
  973.         /* Read in more data. */
  974.         YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  975.             (yy_n_chars), num_to_read );
  976.  
  977.         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  978.         }
  979.  
  980.     if ( (yy_n_chars) == 0 )
  981.         {
  982.         if ( number_to_move == YY_MORE_ADJ )
  983.             {
  984.             ret_val = EOB_ACT_END_OF_FILE;
  985.             yyrestart(yyin  );
  986.             }
  987.  
  988.         else
  989.             {
  990.             ret_val = EOB_ACT_LAST_MATCH;
  991.             YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  992.                 YY_BUFFER_EOF_PENDING;
  993.             }
  994.         }
  995.  
  996.     else
  997.         ret_val = EOB_ACT_CONTINUE_SCAN;
  998.  
  999.     if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  1000.         /* Extend the array by 50%, plus the number we really need. */
  1001.         int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
  1002.         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
  1003.         if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1004.             YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  1005.     }
  1006.  
  1007.     (yy_n_chars) += number_to_move;
  1008.     YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
  1009.     YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
  1010.  
  1011.     (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  1012.  
  1013.     return ret_val;
  1014. }
  1015.  
  1016. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1017.  
  1018.     static yy_state_type yy_get_previous_state (void)
  1019. {
  1020.     yy_state_type yy_current_state;
  1021.     char *yy_cp;
  1022.    
  1023.     yy_current_state = (yy_start);
  1024.  
  1025.     for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
  1026.         {
  1027.         YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1028.         if ( yy_accept[yy_current_state] )
  1029.             {
  1030.             (yy_last_accepting_state) = yy_current_state;
  1031.             (yy_last_accepting_cpos) = yy_cp;
  1032.             }
  1033.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1034.             {
  1035.             yy_current_state = (int) yy_def[yy_current_state];
  1036.             if ( yy_current_state >= 6 )
  1037.                 yy_c = yy_meta[(unsigned int) yy_c];
  1038.             }
  1039.         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1040.         }
  1041.  
  1042.     return yy_current_state;
  1043. }
  1044.  
  1045. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1046.  *
  1047.  * synopsis
  1048.  *  next_state = yy_try_NUL_trans( current_state );
  1049.  */
  1050.     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
  1051. {
  1052.     int yy_is_jam;
  1053.         char *yy_cp = (yy_c_buf_p);
  1054.  
  1055.     YY_CHAR yy_c = 1;
  1056.     if ( yy_accept[yy_current_state] )
  1057.         {
  1058.         (yy_last_accepting_state) = yy_current_state;
  1059.         (yy_last_accepting_cpos) = yy_cp;
  1060.         }
  1061.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1062.         {
  1063.         yy_current_state = (int) yy_def[yy_current_state];
  1064.         if ( yy_current_state >= 6 )
  1065.             yy_c = yy_meta[(unsigned int) yy_c];
  1066.         }
  1067.     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1068.     yy_is_jam = (yy_current_state == 5);
  1069.  
  1070.         return yy_is_jam ? 0 : yy_current_state;
  1071. }
  1072.  
  1073. #ifndef YY_NO_UNPUT
  1074.  
  1075.     static void yyunput (int c, char * yy_bp )
  1076. {
  1077.     char *yy_cp;
  1078.    
  1079.     yy_cp = (yy_c_buf_p);
  1080.  
  1081.     /* undo effects of setting up yytext */
  1082.     *yy_cp = (yy_hold_char);
  1083.  
  1084.     if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1085.         { /* need to shift things up to make room */
  1086.         /* +2 for EOB chars. */
  1087.         yy_size_t number_to_move = (yy_n_chars) + 2;
  1088.         char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1089.                     YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1090.         char *source =
  1091.                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1092.  
  1093.         while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1094.             *--dest = *--source;
  1095.  
  1096.         yy_cp += (int) (dest - source);
  1097.         yy_bp += (int) (dest - source);
  1098.         YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1099.             (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1100.  
  1101.         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1102.             YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1103.         }
  1104.  
  1105.     *--yy_cp = (char) c;
  1106.  
  1107.     (yytext_ptr) = yy_bp;
  1108.     (yy_hold_char) = *yy_cp;
  1109.     (yy_c_buf_p) = yy_cp;
  1110. }
  1111.  
  1112. #endif
  1113.  
  1114. #ifndef YY_NO_INPUT
  1115. #ifdef __cplusplus
  1116.     static int yyinput (void)
  1117. #else
  1118.     static int input  (void)
  1119. #endif
  1120.  
  1121. {
  1122.     int c;
  1123.    
  1124.     *(yy_c_buf_p) = (yy_hold_char);
  1125.  
  1126.     if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
  1127.         {
  1128.         /* yy_c_buf_p now points to the character we want to return.
  1129.          * If this occurs *before* the EOB characters, then it's a
  1130.          * valid NUL; if not, then we've hit the end of the buffer.
  1131.          */
  1132.         if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  1133.             /* This was really a NUL. */
  1134.             *(yy_c_buf_p) = '\0';
  1135.  
  1136.         else
  1137.             { /* need more input */
  1138.             yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
  1139.             ++(yy_c_buf_p);
  1140.  
  1141.             switch ( yy_get_next_buffer(  ) )
  1142.                 {
  1143.                 case EOB_ACT_LAST_MATCH:
  1144.                     /* This happens because yy_g_n_b()
  1145.                      * sees that we've accumulated a
  1146.                      * token and flags that we need to
  1147.                      * try matching the token before
  1148.                      * proceeding.  But for input(),
  1149.                      * there's no matching to consider.
  1150.                      * So convert the EOB_ACT_LAST_MATCH
  1151.                      * to EOB_ACT_END_OF_FILE.
  1152.                      */
  1153.  
  1154.                     /* Reset buffer status. */
  1155.                     yyrestart(yyin );
  1156.  
  1157.                     /*FALLTHROUGH*/
  1158.  
  1159.                 case EOB_ACT_END_OF_FILE:
  1160.                     {
  1161.                     if ( yywrap( ) )
  1162.                         return EOF;
  1163.  
  1164.                     if ( ! (yy_did_buffer_switch_on_eof) )
  1165.                         YY_NEW_FILE;
  1166. #ifdef __cplusplus
  1167.                     return yyinput();
  1168. #else
  1169.                     return input();
  1170. #endif
  1171.                     }
  1172.  
  1173.                 case EOB_ACT_CONTINUE_SCAN:
  1174.                     (yy_c_buf_p) = (yytext_ptr) + offset;
  1175.                     break;
  1176.                 }
  1177.             }
  1178.         }
  1179.  
  1180.     c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
  1181.     *(yy_c_buf_p) = '\0';   /* preserve yytext */
  1182.     (yy_hold_char) = *++(yy_c_buf_p);
  1183.  
  1184.     return c;
  1185. }
  1186. #endif  /* ifndef YY_NO_INPUT */
  1187.  
  1188. /** Immediately switch to a different input stream.
  1189.  * @param input_file A readable stream.
  1190.  *
  1191.  * @note This function does not reset the start condition to @c INITIAL .
  1192.  */
  1193.     void yyrestart  (FILE * input_file )
  1194. {
  1195.    
  1196.     if ( ! YY_CURRENT_BUFFER ){
  1197.         yyensure_buffer_stack ();
  1198.         YY_CURRENT_BUFFER_LVALUE =
  1199.             yy_create_buffer(yyin,YY_BUF_SIZE );
  1200.     }
  1201.  
  1202.     yy_init_buffer(YY_CURRENT_BUFFER,input_file );
  1203.     yy_load_buffer_state( );
  1204. }
  1205.  
  1206. /** Switch to a different input buffer.
  1207.  * @param new_buffer The new input buffer.
  1208.  *
  1209.  */
  1210.     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
  1211. {
  1212.    
  1213.     /* TODO. We should be able to replace this entire function body
  1214.      * with
  1215.      *      yypop_buffer_state();
  1216.      *      yypush_buffer_state(new_buffer);
  1217.      */
  1218.     yyensure_buffer_stack ();
  1219.     if ( YY_CURRENT_BUFFER == new_buffer )
  1220.         return;
  1221.  
  1222.     if ( YY_CURRENT_BUFFER )
  1223.         {
  1224.         /* Flush out information for old buffer. */
  1225.         *(yy_c_buf_p) = (yy_hold_char);
  1226.         YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1227.         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1228.         }
  1229.  
  1230.     YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1231.     yy_load_buffer_state( );
  1232.  
  1233.     /* We don't actually know whether we did this switch during
  1234.      * EOF (yywrap()) processing, but the only time this flag
  1235.      * is looked at is after yywrap() is called, so it's safe
  1236.      * to go ahead and always set it.
  1237.      */
  1238.     (yy_did_buffer_switch_on_eof) = 1;
  1239. }
  1240.  
  1241. static void yy_load_buffer_state  (void)
  1242. {
  1243.         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1244.     (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1245.     yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1246.     (yy_hold_char) = *(yy_c_buf_p);
  1247. }
  1248.  
  1249. /** Allocate and initialize an input buffer state.
  1250.  * @param file A readable stream.
  1251.  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1252.  *
  1253.  * @return the allocated buffer state.
  1254.  */
  1255.     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
  1256. {
  1257.     YY_BUFFER_STATE b;
  1258.    
  1259.     b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
  1260.     if ( ! b )
  1261.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1262.  
  1263.     b->yy_buf_size = (yy_size_t)size;
  1264.  
  1265.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1266.      * we need to put in 2 end-of-buffer characters.
  1267.      */
  1268.     b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
  1269.     if ( ! b->yy_ch_buf )
  1270.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1271.  
  1272.     b->yy_is_our_buffer = 1;
  1273.  
  1274.     yy_init_buffer(b,file );
  1275.  
  1276.     return b;
  1277. }
  1278.  
  1279. /** Destroy the buffer.
  1280.  * @param b a buffer created with yy_create_buffer()
  1281.  *
  1282.  */
  1283.     void yy_delete_buffer (YY_BUFFER_STATE  b )
  1284. {
  1285.    
  1286.     if ( ! b )
  1287.         return;
  1288.  
  1289.     if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1290.         YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1291.  
  1292.     if ( b->yy_is_our_buffer )
  1293.         yyfree((void *) b->yy_ch_buf  );
  1294.  
  1295.     yyfree((void *) b  );
  1296. }
  1297.  
  1298. /* Initializes or reinitializes a buffer.
  1299.  * This function is sometimes called more than once on the same buffer,
  1300.  * such as during a yyrestart() or at EOF.
  1301.  */
  1302.     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
  1303.  
  1304. {
  1305.     int oerrno = errno;
  1306.    
  1307.     yy_flush_buffer(b );
  1308.  
  1309.     b->yy_input_file = file;
  1310.     b->yy_fill_buffer = 1;
  1311.  
  1312.     /* If b is the current buffer, then yy_init_buffer was _probably_
  1313.      * called from yyrestart() or through yy_get_next_buffer.
  1314.      * In that case, we don't want to reset the lineno or column.
  1315.      */
  1316.     if (b != YY_CURRENT_BUFFER){
  1317.         b->yy_bs_lineno = 1;
  1318.         b->yy_bs_column = 0;
  1319.     }
  1320.  
  1321.         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1322.    
  1323.     errno = oerrno;
  1324. }
  1325.  
  1326. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1327.  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1328.  *
  1329.  */
  1330.     void yy_flush_buffer (YY_BUFFER_STATE  b )
  1331. {
  1332.         if ( ! b )
  1333.         return;
  1334.  
  1335.     b->yy_n_chars = 0;
  1336.  
  1337.     /* We always need two end-of-buffer characters.  The first causes
  1338.      * a transition to the end-of-buffer state.  The second causes
  1339.      * a jam in that state.
  1340.      */
  1341.     b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1342.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1343.  
  1344.     b->yy_buf_pos = &b->yy_ch_buf[0];
  1345.  
  1346.     b->yy_at_bol = 1;
  1347.     b->yy_buffer_status = YY_BUFFER_NEW;
  1348.  
  1349.     if ( b == YY_CURRENT_BUFFER )
  1350.         yy_load_buffer_state( );
  1351. }
  1352.  
  1353. /** Pushes the new state onto the stack. The new state becomes
  1354.  *  the current state. This function will allocate the stack
  1355.  *  if necessary.
  1356.  *  @param new_buffer The new state.
  1357.  *  
  1358.  */
  1359. void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
  1360. {
  1361.         if (new_buffer == NULL)
  1362.         return;
  1363.  
  1364.     yyensure_buffer_stack();
  1365.  
  1366.     /* This block is copied from yy_switch_to_buffer. */
  1367.     if ( YY_CURRENT_BUFFER )
  1368.         {
  1369.         /* Flush out information for old buffer. */
  1370.         *(yy_c_buf_p) = (yy_hold_char);
  1371.         YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1372.         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1373.         }
  1374.  
  1375.     /* Only push if top exists. Otherwise, replace top. */
  1376.     if (YY_CURRENT_BUFFER)
  1377.         (yy_buffer_stack_top)++;
  1378.     YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1379.  
  1380.     /* copied from yy_switch_to_buffer. */
  1381.     yy_load_buffer_state( );
  1382.     (yy_did_buffer_switch_on_eof) = 1;
  1383. }
  1384.  
  1385. /** Removes and deletes the top of the stack, if present.
  1386.  *  The next element becomes the new top.
  1387.  *  
  1388.  */
  1389. void yypop_buffer_state (void)
  1390. {
  1391.         if (!YY_CURRENT_BUFFER)
  1392.         return;
  1393.  
  1394.     yy_delete_buffer(YY_CURRENT_BUFFER );
  1395.     YY_CURRENT_BUFFER_LVALUE = NULL;
  1396.     if ((yy_buffer_stack_top) > 0)
  1397.         --(yy_buffer_stack_top);
  1398.  
  1399.     if (YY_CURRENT_BUFFER) {
  1400.         yy_load_buffer_state( );
  1401.         (yy_did_buffer_switch_on_eof) = 1;
  1402.     }
  1403. }
  1404.  
  1405. /* Allocates the stack if it does not exist.
  1406.  *  Guarantees space for at least one push.
  1407.  */
  1408. static void yyensure_buffer_stack (void)
  1409. {
  1410.     yy_size_t num_to_alloc;
  1411.    
  1412.     if (!(yy_buffer_stack)) {
  1413.  
  1414.         /* First allocation is just for 2 elements, since we don't know if this
  1415.          * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1416.          * immediate realloc on the next call.
  1417.          */
  1418.         num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
  1419.         (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
  1420.                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
  1421.                                 );
  1422.         if ( ! (yy_buffer_stack) )
  1423.             YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1424.                                  
  1425.         memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1426.                
  1427.         (yy_buffer_stack_max) = num_to_alloc;
  1428.         (yy_buffer_stack_top) = 0;
  1429.         return;
  1430.     }
  1431.  
  1432.     if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
  1433.  
  1434.         /* Increase the buffer to prepare for a possible push. */
  1435.         yy_size_t grow_size = 8 /* arbitrary grow size */;
  1436.  
  1437.         num_to_alloc = (yy_buffer_stack_max) + grow_size;
  1438.         (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
  1439.                                 ((yy_buffer_stack),
  1440.                                 num_to_alloc * sizeof(struct yy_buffer_state*)
  1441.                                 );
  1442.         if ( ! (yy_buffer_stack) )
  1443.             YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1444.  
  1445.         /* zero only the new slots.*/
  1446.         memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
  1447.         (yy_buffer_stack_max) = num_to_alloc;
  1448.     }
  1449. }
  1450.  
  1451. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  1452.  * @param base the character buffer
  1453.  * @param size the size in bytes of the character buffer
  1454.  *
  1455.  * @return the newly allocated buffer state object.
  1456.  */
  1457. YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
  1458. {
  1459.     YY_BUFFER_STATE b;
  1460.    
  1461.     if ( size < 2 ||
  1462.          base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1463.          base[size-1] != YY_END_OF_BUFFER_CHAR )
  1464.         /* They forgot to leave room for the EOB's. */
  1465.         return 0;
  1466.  
  1467.     b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
  1468.     if ( ! b )
  1469.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1470.  
  1471.     b->yy_buf_size = size - 2;  /* "- 2" to take care of EOB's */
  1472.     b->yy_buf_pos = b->yy_ch_buf = base;
  1473.     b->yy_is_our_buffer = 0;
  1474.     b->yy_input_file = 0;
  1475.     b->yy_n_chars = b->yy_buf_size;
  1476.     b->yy_is_interactive = 0;
  1477.     b->yy_at_bol = 1;
  1478.     b->yy_fill_buffer = 0;
  1479.     b->yy_buffer_status = YY_BUFFER_NEW;
  1480.  
  1481.     yy_switch_to_buffer(b  );
  1482.  
  1483.     return b;
  1484. }
  1485.  
  1486. /** Setup the input buffer state to scan a string. The next call to yylex() will
  1487.  * scan from a @e copy of @a str.
  1488.  * @param yystr a NUL-terminated string to scan
  1489.  *
  1490.  * @return the newly allocated buffer state object.
  1491.  * @note If you want to scan bytes that may contain NUL values, then use
  1492.  *       yy_scan_bytes() instead.
  1493.  */
  1494. YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
  1495. {
  1496.    
  1497.     return yy_scan_bytes(yystr,strlen(yystr) );
  1498. }
  1499.  
  1500. /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  1501.  * scan from a @e copy of @a bytes.
  1502.  * @param yybytes the byte buffer to scan
  1503.  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  1504.  *
  1505.  * @return the newly allocated buffer state object.
  1506.  */
  1507. YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
  1508. {
  1509.     YY_BUFFER_STATE b;
  1510.     char *buf;
  1511.     yy_size_t n;
  1512.     yy_size_t i;
  1513.    
  1514.     /* Get memory for full buffer, including space for trailing EOB's. */
  1515.     n = _yybytes_len + 2;
  1516.     buf = (char *) yyalloc(n  );
  1517.     if ( ! buf )
  1518.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1519.  
  1520.     for ( i = 0; i < _yybytes_len; ++i )
  1521.         buf[i] = yybytes[i];
  1522.  
  1523.     buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  1524.  
  1525.     b = yy_scan_buffer(buf,n );
  1526.     if ( ! b )
  1527.         YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1528.  
  1529.     /* It's okay to grow etc. this buffer, and we should throw it
  1530.      * away when we're done.
  1531.      */
  1532.     b->yy_is_our_buffer = 1;
  1533.  
  1534.     return b;
  1535. }
  1536.  
  1537. #ifndef YY_EXIT_FAILURE
  1538. #define YY_EXIT_FAILURE 2
  1539. #endif
  1540.  
  1541. static void yy_fatal_error (yyconst char* msg )
  1542. {
  1543.             (void) fprintf( stderr, "%s\n", msg );
  1544.     exit( YY_EXIT_FAILURE );
  1545. }
  1546.  
  1547. /* Redefine yyless() so it works in section 3 code. */
  1548.  
  1549. #undef yyless
  1550. #define yyless(n) \
  1551.     do \
  1552.         { \
  1553.         /* Undo effects of setting up yytext. */ \
  1554.         int yyless_macro_arg = (n); \
  1555.         YY_LESS_LINENO(yyless_macro_arg);\
  1556.         yytext[yyleng] = (yy_hold_char); \
  1557.         (yy_c_buf_p) = yytext + yyless_macro_arg; \
  1558.         (yy_hold_char) = *(yy_c_buf_p); \
  1559.         *(yy_c_buf_p) = '\0'; \
  1560.         yyleng = yyless_macro_arg; \
  1561.         } \
  1562.     while ( 0 )
  1563.  
  1564. /* Accessor  methods (get/set functions) to struct members. */
  1565.  
  1566. /** Get the current line number.
  1567.  *
  1568.  */
  1569. int yyget_lineno  (void)
  1570. {
  1571.        
  1572.     return yylineno;
  1573. }
  1574.  
  1575. /** Get the input stream.
  1576.  *
  1577.  */
  1578. FILE *yyget_in  (void)
  1579. {
  1580.         return yyin;
  1581. }
  1582.  
  1583. /** Get the output stream.
  1584.  *
  1585.  */
  1586. FILE *yyget_out  (void)
  1587. {
  1588.         return yyout;
  1589. }
  1590.  
  1591. /** Get the length of the current token.
  1592.  *
  1593.  */
  1594. yy_size_t yyget_leng  (void)
  1595. {
  1596.         return yyleng;
  1597. }
  1598.  
  1599. /** Get the current token.
  1600.  *
  1601.  */
  1602.  
  1603. char *yyget_text  (void)
  1604. {
  1605.         return yytext;
  1606. }
  1607.  
  1608. /** Set the current line number.
  1609.  * @param _line_number line number
  1610.  *
  1611.  */
  1612. void yyset_lineno (int  _line_number )
  1613. {
  1614.    
  1615.     yylineno = _line_number;
  1616. }
  1617.  
  1618. /** Set the input stream. This does not discard the current
  1619.  * input buffer.
  1620.  * @param _in_str A readable stream.
  1621.  *
  1622.  * @see yy_switch_to_buffer
  1623.  */
  1624. void yyset_in (FILE *  _in_str )
  1625. {
  1626.         yyin = _in_str ;
  1627. }
  1628.  
  1629. void yyset_out (FILE *  _out_str )
  1630. {
  1631.         yyout = _out_str ;
  1632. }
  1633.  
  1634. int yyget_debug  (void)
  1635. {
  1636.         return yy_flex_debug;
  1637. }
  1638.  
  1639. void yyset_debug (int  _bdebug )
  1640. {
  1641.         yy_flex_debug = _bdebug ;
  1642. }
  1643.  
  1644. static int yy_init_globals (void)
  1645. {
  1646.         /* Initialization is the same as for the non-reentrant scanner.
  1647.      * This function is called from yylex_destroy(), so don't allocate here.
  1648.      */
  1649.  
  1650.     (yy_buffer_stack) = 0;
  1651.     (yy_buffer_stack_top) = 0;
  1652.     (yy_buffer_stack_max) = 0;
  1653.     (yy_c_buf_p) = (char *) 0;
  1654.     (yy_init) = 0;
  1655.     (yy_start) = 0;
  1656.  
  1657. /* Defined in main.c */
  1658. #ifdef YY_STDINIT
  1659.     yyin = stdin;
  1660.     yyout = stdout;
  1661. #else
  1662.     yyin = (FILE *) 0;
  1663.     yyout = (FILE *) 0;
  1664. #endif
  1665.  
  1666.     /* For future reference: Set errno on error, since we are called by
  1667.      * yylex_init()
  1668.      */
  1669.     return 0;
  1670. }
  1671.  
  1672. /* yylex_destroy is for both reentrant and non-reentrant scanners. */
  1673. int yylex_destroy  (void)
  1674. {
  1675.    
  1676.     /* Pop the buffer stack, destroying each element. */
  1677.     while(YY_CURRENT_BUFFER){
  1678.         yy_delete_buffer(YY_CURRENT_BUFFER  );
  1679.         YY_CURRENT_BUFFER_LVALUE = NULL;
  1680.         yypop_buffer_state();
  1681.     }
  1682.  
  1683.     /* Destroy the stack itself. */
  1684.     yyfree((yy_buffer_stack) );
  1685.     (yy_buffer_stack) = NULL;
  1686.  
  1687.     /* Reset the globals. This is important in a non-reentrant scanner so the next time
  1688.      * yylex() is called, initialization will occur. */
  1689.     yy_init_globals( );
  1690.  
  1691.     return 0;
  1692. }
  1693.  
  1694. /*
  1695.  * Internal utility routines.
  1696.  */
  1697.  
  1698. #ifndef yytext_ptr
  1699. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
  1700. {
  1701.        
  1702.     int i;
  1703.     for ( i = 0; i < n; ++i )
  1704.         s1[i] = s2[i];
  1705. }
  1706. #endif
  1707.  
  1708. #ifdef YY_NEED_STRLEN
  1709. static int yy_flex_strlen (yyconst char * s )
  1710. {
  1711.     int n;
  1712.     for ( n = 0; s[n]; ++n )
  1713.         ;
  1714.  
  1715.     return n;
  1716. }
  1717. #endif
  1718.  
  1719. void *yyalloc (yy_size_t  size )
  1720. {
  1721.             return (void *) malloc( size );
  1722. }
  1723.  
  1724. void *yyrealloc  (void * ptr, yy_size_t  size )
  1725. {
  1726.        
  1727.     /* The cast to (char *) in the following accommodates both
  1728.      * implementations that use char* generic pointers, and those
  1729.      * that use void* generic pointers.  It works with the latter
  1730.      * because both ANSI C and C++ allow castless assignment from
  1731.      * any pointer type to void*, and deal with argument conversions
  1732.      * as though doing an assignment.
  1733.      */
  1734.     return (void *) realloc( (char *) ptr, size );
  1735. }
  1736.  
  1737. void yyfree (void * ptr )
  1738. {
  1739.             free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
  1740. }
  1741.  
  1742. #define YYTABLES_NAME "yytables"
  1743.  
  1744. #line 1 "happy.l"
RAW Paste Data