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