Subversion Repositories Vertical

Rev

Blame | Last modification | View Log | Download | RSS feed

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