Subversion Repositories Vertical

Rev

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

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