1 #line 2 "/Users/creed/projects/fsl/fromsvr/elftosb/build/elftosb.build/Debug/elftosb.build/DerivedSources/elftosb_lexer.cpp"
3 #line 4 "/Users/creed/projects/fsl/fromsvr/elftosb/build/elftosb.build/Debug/elftosb.build/DerivedSources/elftosb_lexer.cpp"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
18 * following macro. This is required in order to pass the c++-multiple-scanners
19 * test in the regression suite. We get reports that it breaks inheritance.
20 * We will address this in a future release of flex, or omit the C++ scanner
23 #define yyFlexLexer yyFlexLexer
25 /* First, we deal with platform-specific or compiler-specific issues. */
27 /* begin standard C headers. */
29 /* end standard C headers. */
31 /* flex integer type definitions */
36 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
38 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
40 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
41 * if you want the limit (max/min) macros for int types.
43 #ifndef __STDC_LIMIT_MACROS
44 #define __STDC_LIMIT_MACROS 1
48 typedef int8_t flex_int8_t;
49 typedef uint8_t flex_uint8_t;
50 typedef int16_t flex_int16_t;
51 typedef uint16_t flex_uint16_t;
52 typedef int32_t flex_int32_t;
53 typedef uint32_t flex_uint32_t;
55 typedef signed char flex_int8_t;
56 typedef short int flex_int16_t;
57 typedef int flex_int32_t;
58 typedef unsigned char flex_uint8_t;
59 typedef unsigned short int flex_uint16_t;
60 typedef unsigned int flex_uint32_t;
63 /* Limits of integral types. */
65 #define INT8_MIN (-128)
68 #define INT16_MIN (-32767-1)
71 #define INT32_MIN (-2147483647-1)
74 #define INT8_MAX (127)
77 #define INT16_MAX (32767)
80 #define INT32_MAX (2147483647)
83 #define UINT8_MAX (255U)
86 #define UINT16_MAX (65535U)
89 #define UINT32_MAX (4294967295U)
92 #endif /* ! FLEXINT_H */
94 /* begin standard C++ headers. */
99 /* end standard C++ headers. */
103 /* The "const" storage-class-modifier is valid. */
106 #else /* ! __cplusplus */
108 /* C99 requires __STDC__ to be defined as 1. */
109 #if defined (__STDC__)
113 #endif /* defined (__STDC__) */
114 #endif /* ! __cplusplus */
117 #define yyconst const
122 /* Returned upon end-of-file. */
125 /* Promotes a possibly negative, possibly signed char to an unsigned
126 * integer for use as an array index. If the signed char is negative,
127 * we want to instead treat it as an 8-bit unsigned char, hence the
130 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
132 /* Enter a start condition. This macro really ought to take a parameter,
133 * but we do it the disgusting crufty way forced on us by the ()-less
134 * definition of BEGIN.
136 #define BEGIN (yy_start) = 1 + 2 *
138 /* Translate the current start state into a value that can be later handed
139 * to BEGIN to return to the state. The YYSTATE alias is for lex
142 #define YY_START (((yy_start) - 1) / 2)
143 #define YYSTATE YY_START
145 /* Action number for EOF rule of a given start state. */
146 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
148 /* Special action meaning "start processing a new file". */
149 #define YY_NEW_FILE yyrestart( yyin )
151 #define YY_END_OF_BUFFER_CHAR 0
153 /* Size of default input buffer. */
155 #define YY_BUF_SIZE 16384
158 /* The state buf must be large enough to hold one state per character in the main buffer.
160 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
162 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
163 #define YY_TYPEDEF_YY_BUFFER_STATE
164 typedef struct yy_buffer_state *YY_BUFFER_STATE;
167 #ifndef YY_TYPEDEF_YY_SIZE_T
168 #define YY_TYPEDEF_YY_SIZE_T
169 typedef size_t yy_size_t;
172 extern yy_size_t yyleng;
174 #define EOB_ACT_CONTINUE_SCAN 0
175 #define EOB_ACT_END_OF_FILE 1
176 #define EOB_ACT_LAST_MATCH 2
178 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
179 * access to the local variable yy_act. Since yyless() is a macro, it would break
180 * existing scanners that call yyless() from OUTSIDE yylex.
181 * One obvious solution it to make yy_act a global. I tried that, and saw
182 * a 5% performance hit in a non-yylineno scanner, because yy_act is
183 * normally declared as a register variable-- so it is not worth it.
185 #define YY_LESS_LINENO(n) \
188 for ( yyl = n; yyl < yyleng; ++yyl )\
189 if ( yytext[yyl] == '\n' )\
193 /* Return all but the first "n" matched characters back to the input stream. */
197 /* Undo effects of setting up yytext. */ \
198 int yyless_macro_arg = (n); \
199 YY_LESS_LINENO(yyless_macro_arg);\
200 *yy_cp = (yy_hold_char); \
201 YY_RESTORE_YY_MORE_OFFSET \
202 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
203 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
207 #define unput(c) yyunput( c, (yytext_ptr) )
209 #ifndef YY_STRUCT_YY_BUFFER_STATE
210 #define YY_STRUCT_YY_BUFFER_STATE
211 struct yy_buffer_state
214 std::istream* yy_input_file;
216 char *yy_ch_buf; /* input buffer */
217 char *yy_buf_pos; /* current position in input buffer */
219 /* Size of input buffer in bytes, not including room for EOB
222 yy_size_t yy_buf_size;
224 /* Number of characters read into yy_ch_buf, not including EOB
227 yy_size_t yy_n_chars;
229 /* Whether we "own" the buffer - i.e., we know we created it,
230 * and can realloc() it to grow it, and should free() it to
233 int yy_is_our_buffer;
235 /* Whether this is an "interactive" input source; if so, and
236 * if we're using stdio for input, then we want to use getc()
237 * instead of fread(), to make sure we stop fetching input after
240 int yy_is_interactive;
242 /* Whether we're considered to be at the beginning of a line.
243 * If so, '^' rules will be active on the next match, otherwise
248 int yy_bs_lineno; /**< The line count. */
249 int yy_bs_column; /**< The column count. */
251 /* Whether to try to fill the input buffer when we reach the
256 int yy_buffer_status;
258 #define YY_BUFFER_NEW 0
259 #define YY_BUFFER_NORMAL 1
260 /* When an EOF's been seen but there's still some text to process
261 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
262 * shouldn't try reading from the input source any more. We might
263 * still have a bunch of tokens to match, though, because of
264 * possible backing-up.
266 * When we actually see the EOF, we change the status to "new"
267 * (via yyrestart()), so that the user can continue scanning by
268 * just pointing yyin at a new input file.
270 #define YY_BUFFER_EOF_PENDING 2
273 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
275 /* We provide macros for accessing buffer states in case in the
276 * future we want to put the buffer states in a more general
279 * Returns the top of the stack, or NULL.
281 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
282 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
285 /* Same as previous macro, but useful when we know that the buffer stack is not
286 * NULL or when we need an lvalue. For internal use only.
288 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
290 void *yyalloc (yy_size_t );
291 void *yyrealloc (void *,yy_size_t );
292 void yyfree (void * );
294 #define yy_new_buffer yy_create_buffer
296 #define yy_set_interactive(is_interactive) \
298 if ( ! YY_CURRENT_BUFFER ){ \
299 yyensure_buffer_stack (); \
300 YY_CURRENT_BUFFER_LVALUE = \
301 yy_create_buffer( yyin, YY_BUF_SIZE ); \
303 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
306 #define yy_set_bol(at_bol) \
308 if ( ! YY_CURRENT_BUFFER ){\
309 yyensure_buffer_stack (); \
310 YY_CURRENT_BUFFER_LVALUE = \
311 yy_create_buffer( yyin, YY_BUF_SIZE ); \
313 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
316 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
318 /* Begin user sect3 */
319 #define YY_SKIP_YYWRAP
321 typedef unsigned char YY_CHAR;
323 #define yytext_ptr yytext
325 #include <FlexLexer.h>
327 int yyFlexLexer::yywrap() { return 1; }
328 int yyFlexLexer::yylex()
330 LexerError( "yyFlexLexer::yylex invoked but %option yyclass used" );
334 #define YY_DECL int ElftosbLexer::yylex()
336 /* Done after the current pattern has been matched and before the
337 * corresponding action - sets up yytext.
339 #define YY_DO_BEFORE_ACTION \
340 (yytext_ptr) = yy_bp; \
341 yyleng = (size_t) (yy_cp - yy_bp); \
342 (yy_hold_char) = *yy_cp; \
344 (yy_c_buf_p) = yy_cp;
346 #define YY_NUM_RULES 74
347 #define YY_END_OF_BUFFER 75
348 /* This struct is not used in this scanner,
349 but its presence is necessary. */
352 flex_int32_t yy_verify;
355 static yyconst flex_int16_t yy_accept[218] =
357 0, 0, 0, 0, 0, 0, 75, 73, 70, 71,
358 71, 64, 73, 73, 73, 49, 54, 73, 34, 35,
359 47, 45, 39, 46, 42, 48, 27, 27, 40, 41,
360 57, 38, 43, 26, 36, 37, 51, 26, 26, 26,
361 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
362 26, 26, 26, 26, 32, 55, 33, 50, 73, 73,
363 72, 70, 71, 72, 71, 61, 0, 65, 0, 0,
364 69, 29, 62, 0, 0, 56, 44, 30, 0, 0,
365 27, 27, 0, 0, 52, 59, 60, 58, 53, 26,
366 23, 26, 26, 26, 26, 26, 26, 26, 26, 26,
368 26, 26, 13, 26, 26, 26, 26, 26, 25, 26,
369 26, 26, 26, 26, 26, 26, 26, 31, 63, 66,
370 67, 68, 0, 0, 28, 0, 0, 27, 27, 26,
371 26, 20, 26, 26, 26, 26, 26, 26, 26, 21,
372 26, 22, 26, 26, 26, 26, 8, 26, 26, 26,
373 26, 26, 24, 0, 0, 28, 0, 0, 0, 11,
374 26, 26, 14, 26, 26, 26, 26, 7, 16, 10,
375 9, 12, 26, 26, 26, 26, 26, 0, 0, 0,
376 0, 28, 0, 26, 26, 18, 26, 26, 26, 26,
377 26, 26, 26, 28, 0, 28, 0, 26, 26, 6,
379 26, 26, 26, 19, 26, 26, 0, 26, 15, 4,
380 1, 5, 3, 17, 26, 2, 0
383 static yyconst flex_int32_t yy_ec[256] =
385 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
386 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 2, 5, 6, 7, 8, 9, 10, 11, 12,
389 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
390 22, 22, 22, 22, 22, 22, 22, 23, 24, 25,
391 26, 27, 28, 1, 29, 29, 30, 29, 31, 29,
392 32, 33, 33, 33, 32, 33, 32, 33, 33, 33,
393 33, 33, 34, 33, 33, 33, 33, 33, 33, 33,
394 35, 1, 36, 37, 33, 1, 38, 39, 40, 41,
396 42, 43, 44, 45, 46, 47, 33, 48, 49, 50,
397 51, 52, 33, 53, 54, 55, 56, 57, 58, 59,
398 60, 61, 62, 63, 64, 65, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 static yyconst flex_int32_t yy_meta[66] =
417 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 3, 1, 1, 3, 3, 1, 4,
419 4, 4, 1, 1, 1, 1, 1, 3, 4, 4,
420 4, 5, 5, 5, 3, 3, 3, 4, 4, 4,
421 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
422 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
426 static yyconst flex_int16_t yy_base[231] =
428 0, 0, 64, 127, 67, 73, 384, 385, 385, 385,
429 380, 356, 66, 378, 0, 385, 370, 348, 385, 385,
430 364, 385, 385, 385, 359, 59, 78, 94, 385, 385,
431 57, 350, 62, 0, 385, 385, 385, 191, 41, 69,
432 60, 74, 337, 75, 318, 322, 321, 320, 318, 331,
433 92, 315, 329, 324, 303, 301, 385, 385, 0, 299,
434 385, 385, 359, 342, 385, 385, 115, 385, 129, 357,
435 385, 0, 385, 111, 128, 385, 385, 385, 356, 121,
436 152, 385, 70, 0, 385, 385, 385, 385, 385, 0,
437 385, 310, 307, 315, 312, 300, 300, 297, 303, 302,
439 298, 309, 0, 304, 291, 296, 306, 302, 0, 287,
440 283, 300, 278, 282, 281, 283, 281, 385, 385, 385,
441 385, 385, 145, 113, 130, 200, 202, 218, 148, 286,
442 279, 0, 286, 289, 279, 287, 274, 272, 277, 0,
443 274, 0, 272, 282, 280, 275, 0, 265, 277, 265,
444 275, 266, 0, 146, 284, 283, 102, 148, 210, 0,
445 258, 262, 0, 258, 257, 267, 266, 0, 0, 0,
446 0, 0, 256, 257, 247, 253, 242, 270, 153, 160,
447 211, 212, 213, 214, 209, 0, 199, 195, 196, 189,
448 194, 194, 185, 385, 200, 198, 151, 162, 148, 0,
450 134, 132, 135, 0, 129, 111, 214, 90, 0, 0,
451 0, 0, 0, 0, 86, 0, 385, 256, 261, 266,
452 271, 274, 279, 281, 97, 286, 70, 291, 296, 301
455 static yyconst flex_int16_t yy_def[231] =
457 217, 1, 218, 218, 219, 219, 217, 217, 217, 217,
458 217, 217, 220, 221, 222, 217, 217, 223, 217, 217,
459 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
460 217, 217, 217, 224, 217, 217, 217, 224, 224, 224,
461 224, 224, 38, 224, 224, 224, 224, 224, 224, 224,
462 224, 224, 38, 224, 217, 217, 217, 217, 225, 217,
463 217, 217, 217, 217, 217, 217, 220, 217, 220, 221,
464 217, 222, 217, 226, 226, 217, 217, 217, 221, 217,
465 217, 217, 217, 227, 217, 217, 217, 217, 217, 224,
466 217, 224, 224, 224, 224, 224, 224, 224, 224, 224,
468 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
469 224, 224, 224, 224, 224, 224, 224, 217, 217, 217,
470 217, 217, 220, 228, 228, 228, 228, 217, 227, 224,
471 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
472 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
473 224, 224, 224, 220, 229, 229, 229, 229, 230, 224,
474 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
475 224, 224, 224, 224, 224, 224, 224, 217, 217, 217,
476 228, 228, 228, 224, 224, 224, 224, 224, 224, 224,
477 224, 224, 224, 217, 217, 229, 229, 224, 224, 224,
479 224, 224, 224, 224, 224, 224, 228, 224, 224, 224,
480 224, 224, 224, 224, 224, 224, 0, 217, 217, 217,
481 217, 217, 217, 217, 217, 217, 217, 217, 217, 217
484 static yyconst flex_int16_t yy_nxt[451] =
486 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
487 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
488 28, 28, 29, 30, 31, 32, 33, 8, 34, 34,
489 34, 34, 34, 34, 35, 36, 37, 34, 38, 39,
490 40, 41, 42, 34, 43, 44, 45, 46, 47, 48,
491 49, 34, 50, 51, 52, 34, 34, 53, 34, 54,
492 34, 55, 56, 57, 58, 9, 10, 11, 62, 10,
493 63, 68, 78, 129, 62, 10, 63, 79, 92, 80,
494 64, 85, 86, 59, 59, 59, 64, 88, 89, 128,
495 128, 93, 59, 59, 59, 80, 69, 81, 81, 81,
497 120, 59, 59, 59, 59, 59, 59, 96, 94, 82,
498 95, 99, 97, 81, 81, 81, 83, 103, 98, 100,
499 68, 125, 80, 156, 104, 82, 101, 60, 9, 10,
500 11, 105, 179, 112, 68, 180, 84, 113, 125, 216,
501 156, 126, 114, 157, 215, 69, 59, 59, 59, 80,
502 68, 68, 82, 80, 214, 59, 59, 59, 126, 69,
503 157, 127, 123, 194, 59, 59, 59, 59, 59, 59,
504 194, 81, 81, 81, 154, 69, 69, 181, 179, 82,
505 207, 179, 213, 82, 212, 211, 195, 210, 209, 155,
506 60, 91, 91, 91, 91, 91, 91, 91, 91, 91,
508 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
509 156, 208, 156, 91, 91, 91, 91, 91, 91, 80,
510 182, 196, 196, 196, 196, 91, 91, 91, 179, 178,
511 157, 159, 157, 158, 206, 205, 204, 128, 128, 203,
512 183, 157, 157, 157, 157, 202, 197, 201, 200, 82,
513 199, 198, 91, 91, 91, 91, 8, 8, 8, 8,
514 8, 61, 61, 61, 61, 61, 67, 67, 67, 67,
515 67, 70, 70, 70, 70, 70, 72, 72, 72, 74,
516 194, 74, 74, 74, 90, 90, 124, 193, 124, 124,
517 124, 155, 192, 155, 155, 155, 178, 191, 178, 178,
519 178, 181, 190, 181, 181, 181, 189, 188, 109, 187,
520 186, 185, 184, 179, 179, 177, 153, 176, 175, 174,
521 173, 172, 171, 170, 169, 168, 167, 166, 165, 164,
522 163, 162, 161, 160, 153, 152, 151, 150, 149, 148,
523 147, 146, 145, 144, 143, 142, 141, 140, 139, 138,
524 137, 136, 135, 134, 133, 132, 131, 130, 71, 71,
525 122, 65, 121, 119, 118, 117, 116, 115, 111, 110,
526 109, 108, 107, 106, 102, 87, 77, 76, 75, 73,
527 71, 66, 65, 217, 7, 217, 217, 217, 217, 217,
528 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
530 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
531 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
532 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
533 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
534 217, 217, 217, 217, 217, 217, 217, 217, 217, 217
537 static yyconst flex_int16_t yy_chk[451] =
539 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
540 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
541 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
542 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
543 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
544 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
545 1, 1, 1, 1, 1, 3, 3, 3, 5, 5,
546 5, 13, 26, 227, 6, 6, 6, 26, 39, 27,
547 5, 31, 31, 3, 3, 3, 6, 33, 33, 83,
548 83, 39, 3, 3, 3, 28, 13, 27, 27, 27,
550 225, 3, 3, 3, 3, 3, 3, 41, 40, 27,
551 40, 42, 41, 28, 28, 28, 27, 44, 41, 42,
552 67, 74, 80, 124, 44, 28, 42, 3, 4, 4,
553 4, 44, 157, 51, 69, 157, 27, 51, 75, 215,
554 125, 74, 51, 124, 208, 67, 4, 4, 4, 129,
555 123, 154, 80, 81, 206, 4, 4, 4, 75, 69,
556 125, 75, 69, 179, 4, 4, 4, 4, 4, 4,
557 180, 81, 81, 81, 123, 123, 154, 158, 158, 129,
558 197, 197, 205, 81, 203, 202, 179, 201, 199, 180,
559 4, 38, 38, 38, 38, 38, 38, 38, 38, 38,
561 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
562 126, 198, 127, 38, 38, 38, 38, 38, 38, 128,
563 159, 181, 182, 183, 207, 38, 38, 38, 196, 195,
564 126, 127, 127, 126, 193, 192, 191, 128, 128, 190,
565 159, 181, 182, 183, 207, 189, 183, 188, 187, 128,
566 185, 184, 38, 38, 38, 38, 218, 218, 218, 218,
567 218, 219, 219, 219, 219, 219, 220, 220, 220, 220,
568 220, 221, 221, 221, 221, 221, 222, 222, 222, 223,
569 178, 223, 223, 223, 224, 224, 226, 177, 226, 226,
570 226, 228, 176, 228, 228, 228, 229, 175, 229, 229,
572 229, 230, 174, 230, 230, 230, 173, 167, 166, 165,
573 164, 162, 161, 156, 155, 152, 151, 150, 149, 148,
574 146, 145, 144, 143, 141, 139, 138, 137, 136, 135,
575 134, 133, 131, 130, 117, 116, 115, 114, 113, 112,
576 111, 110, 108, 107, 106, 105, 104, 102, 101, 100,
577 99, 98, 97, 96, 95, 94, 93, 92, 79, 70,
578 64, 63, 60, 56, 55, 54, 53, 52, 50, 49,
579 48, 47, 46, 45, 43, 32, 25, 21, 18, 17,
580 14, 12, 11, 7, 217, 217, 217, 217, 217, 217,
581 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
583 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
584 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
585 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
586 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
587 217, 217, 217, 217, 217, 217, 217, 217, 217, 217
590 /* Table of booleans, true if rule could match eol. */
591 static yyconst flex_int32_t yy_rule_can_match_eol[75] =
593 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
594 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
595 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
596 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, };
598 /* The intent behind this definition is that it'll catch
599 * any uses of REJECT which flex missed.
601 #define REJECT reject_used_but_not_detected
602 #define yymore() yymore_used_but_not_detected
603 #define YY_MORE_ADJ 0
604 #define YY_RESTORE_YY_MORE_OFFSET
605 #line 1 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
606 /* %option prefix="Elftosb" */
607 #line 10 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
608 #include "ElftosbLexer.h"
612 #include "HexValues.h"
615 using namespace elftosb;
617 //! Always executed before all other actions when a token is matched.
618 //! This action just assign the first and last lines of the token to
619 //! the current line. In most cases this is correct.
620 #define YY_USER_ACTION do { \
621 m_location.m_firstLine = m_line; \
622 m_location.m_lastLine = m_line; \
625 /* start conditions */
627 #line 628 "/Users/creed/projects/fsl/fromsvr/elftosb/build/elftosb.build/Debug/elftosb.build/DerivedSources/elftosb_lexer.cpp"
633 #ifndef YY_NO_UNISTD_H
634 /* Special case for "unistd.h", since it is non-ANSI. We include it way
635 * down here because we want the user's section 1 to have been scanned first.
636 * The user has a chance to override it with an option.
641 #ifndef YY_EXTRA_TYPE
642 #define YY_EXTRA_TYPE void *
646 static void yy_flex_strncpy (char *,yyconst char *,int );
649 #ifdef YY_NEED_STRLEN
650 static int yy_flex_strlen (yyconst char * );
657 /* Amount of stuff to slurp up with each read. */
658 #ifndef YY_READ_BUF_SIZE
659 #define YY_READ_BUF_SIZE 8192
662 /* Copy whatever the last rule matched to the standard output. */
664 #define ECHO LexerOutput( yytext, yyleng )
667 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
668 * is returned in "result".
671 #define YY_INPUT(buf,result,max_size) \
673 if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
674 YY_FATAL_ERROR( "input in flex scanner failed" );
678 /* No semi-colon after return; correct usage is to write "yyterminate();" -
679 * we don't want an extra ';' after the "return" because that will cause
680 * some compilers to complain about unreachable statements.
683 #define yyterminate() return YY_NULL
686 /* Number of entries by which start-condition stack grows. */
687 #ifndef YY_START_STACK_INCR
688 #define YY_START_STACK_INCR 25
691 /* Report a fatal error. */
692 #ifndef YY_FATAL_ERROR
693 #define YY_FATAL_ERROR(msg) LexerError( msg )
696 /* end tables serialization structures and prototypes */
698 /* Default declaration of generated scanner - a define so the user can
699 * easily add parameters.
702 #define YY_DECL_IS_OURS 1
703 #define YY_DECL int yyFlexLexer::yylex()
704 #endif /* !YY_DECL */
706 /* Code executed at the beginning of each rule, after yytext and yyleng
709 #ifndef YY_USER_ACTION
710 #define YY_USER_ACTION
713 /* Code executed at the end of each rule. */
715 #define YY_BREAK break;
718 #define YY_RULE_SETUP \
721 /** The main scanner function which does all the work.
725 register yy_state_type yy_current_state;
726 register char *yy_cp, *yy_bp;
729 #line 38 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
732 #line 733 "/Users/creed/projects/fsl/fromsvr/elftosb/build/elftosb.build/Debug/elftosb.build/DerivedSources/elftosb_lexer.cpp"
743 (yy_start) = 1; /* first start state */
751 if ( ! YY_CURRENT_BUFFER ) {
752 yyensure_buffer_stack ();
753 YY_CURRENT_BUFFER_LVALUE =
754 yy_create_buffer( yyin, YY_BUF_SIZE );
757 yy_load_buffer_state( );
760 while ( 1 ) /* loops until end-of-file is reached */
762 yy_cp = (yy_c_buf_p);
764 /* Support of yytext. */
765 *yy_cp = (yy_hold_char);
767 /* yy_bp points to the position in yy_ch_buf of the start of
772 yy_current_state = (yy_start);
776 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
777 if ( yy_accept[yy_current_state] )
779 (yy_last_accepting_state) = yy_current_state;
780 (yy_last_accepting_cpos) = yy_cp;
782 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
784 yy_current_state = (int) yy_def[yy_current_state];
785 if ( yy_current_state >= 218 )
786 yy_c = yy_meta[(unsigned int) yy_c];
788 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
791 while ( yy_current_state != 217 );
792 yy_cp = (yy_last_accepting_cpos);
793 yy_current_state = (yy_last_accepting_state);
796 yy_act = yy_accept[yy_current_state];
800 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
803 for ( yyl = 0; yyl < yyleng; ++yyl )
804 if ( yytext[yyl] == '\n' )
810 do_action: /* This label is used only to access EOF actions. */
813 { /* beginning of action switch */
814 case 0: /* must back up */
815 /* undo the effects of YY_DO_BEFORE_ACTION */
816 *yy_cp = (yy_hold_char);
817 yy_cp = (yy_last_accepting_cpos);
818 yy_current_state = (yy_last_accepting_state);
823 #line 40 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
824 { return TOK_OPTIONS; }
828 #line 41 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
829 { return TOK_CONSTANTS; }
833 #line 42 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
834 { return TOK_SOURCES; }
838 #line 43 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
839 { return TOK_FILTERS; }
843 #line 44 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
844 { return TOK_SECTION; }
848 #line 45 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
849 { return TOK_EXTERN; }
853 #line 46 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
858 #line 47 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
863 #line 48 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
868 #line 49 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
873 #line 50 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
878 #line 51 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
883 #line 52 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
888 #line 53 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
893 #line 54 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
894 { return TOK_DEFINED; }
898 #line 55 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
903 #line 56 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
904 { return TOK_WARNING; }
908 #line 57 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
909 { return TOK_ERROR; }
913 #line 58 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
914 { return TOK_SIZEOF; }
918 #line 59 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
923 #line 60 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
928 #line 61 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
932 /* rule 23 can match eol */
933 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
934 (yy_c_buf_p) = yy_cp = yy_bp + 1;
935 YY_DO_BEFORE_ACTION; /* set up yytext again */
937 #line 63 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
938 { // must be followed by any non-ident char
946 theSize = kHalfWordSize;
952 m_symbolValue.m_int = new elftosb::SizedIntegerValue(0, theSize);
958 #line 81 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
960 m_symbolValue.m_int = new elftosb::SizedIntegerValue(1, kWordSize);
961 return TOK_INT_LITERAL;
966 #line 86 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
968 m_symbolValue.m_int = new elftosb::SizedIntegerValue(0, kWordSize);
969 return TOK_INT_LITERAL;
974 #line 91 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
976 m_symbolValue.m_str = new std::string(yytext);
977 if (isSourceName(m_symbolValue.m_str))
979 return TOK_SOURCE_NAME;
989 #line 103 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
995 // check for binary number
996 if (yytext[0] == '0' && yytext[1] == 'b')
998 base = 2; // this is a binary number
999 yytext += 2; // skip over the "0b"
1003 value = (uint32_t)strtoul(yytext, NULL, base);
1006 switch (yytext[strlen(yytext) - 1])
1009 mult = 1024 * 1024 * 1024;
1022 // set resulting symbol value
1023 m_symbolValue.m_int = new elftosb::SizedIntegerValue(value * mult, kWordSize);
1024 return TOK_INT_LITERAL;
1029 #line 140 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1033 int len = strlen(yytext);
1037 theSize = kByteSize;
1041 value = (value << 8) | yytext[2];
1042 theSize = kHalfWordSize;
1046 value = (value << 8) | yytext[3];
1047 value = (value << 8) | yytext[4];
1048 theSize = kWordSize;
1050 m_symbolValue.m_int = new elftosb::SizedIntegerValue(value, theSize);
1051 return TOK_INT_LITERAL;
1056 #line 164 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1058 // remove $ from string
1059 m_symbolValue.m_str = new std::string(&yytext[1]);
1060 return TOK_SECTION_NAME;
1065 #line 171 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1070 #line 173 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1072 m_blob = new Blob();
1073 m_blobFirstLine = yylineno;
1079 #line 179 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1084 #line 181 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1089 #line 183 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1094 #line 185 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1099 #line 187 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1104 #line 189 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1109 #line 191 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1114 #line 193 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1119 #line 195 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1124 #line 197 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1129 #line 199 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1134 #line 201 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1139 #line 203 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1140 { return TOK_DOT_DOT; }
1144 #line 205 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1149 #line 207 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1154 #line 209 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1159 #line 211 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1164 #line 213 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1169 #line 215 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1174 #line 217 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1179 #line 219 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1180 { return TOK_LSHIFT; }
1184 #line 221 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1185 { return TOK_RSHIFT; }
1189 #line 223 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1194 #line 225 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1199 #line 227 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1200 { return TOK_POWER; }
1204 #line 229 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1209 #line 231 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1214 #line 233 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1219 #line 235 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1224 #line 237 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1229 #line 239 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1234 #line 241 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1239 #line 243 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1243 /* rule 65 can match eol */
1245 #line 245 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1247 // get rid of quotes
1249 yytext[strlen(yytext) - 1] = 0;
1250 // processStringEscapes(yytext, yytext);
1251 m_symbolValue.m_str = new std::string(yytext);
1252 return TOK_STRING_LITERAL;
1257 #line 254 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1259 uint8_t x = (hexCharToInt(yytext[0]) << 4) | hexCharToInt(yytext[1]);
1260 m_blob->append(&x, 1);
1265 #line 259 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1268 m_symbolValue.m_blob = m_blob;
1270 m_location.m_firstLine = m_blobFirstLine;
1276 #line 267 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1278 // end of multi-line comment, return to initial state
1283 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
1284 (yy_c_buf_p) = yy_cp -= 1;
1285 YY_DO_BEFORE_ACTION; /* set up yytext again */
1287 #line 273 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1288 /* absorb single-line comment */
1292 #line 275 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1293 /* eat up whitespace in all states */
1296 /* rule 71 can match eol */
1298 #line 277 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1300 /* eat up whitespace and count lines in all states */
1306 #line 282 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1307 /* ignore all other chars in a multi-line comment */
1311 #line 284 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1313 /* all other chars produce errors */
1315 sprintf(msg, "unexpected character '%c' on line %d", yytext[0], m_line);
1321 #line 291 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
1324 #line 1325 "/Users/creed/projects/fsl/fromsvr/elftosb/build/elftosb.build/Debug/elftosb.build/DerivedSources/elftosb_lexer.cpp"
1325 case YY_STATE_EOF(INITIAL):
1326 case YY_STATE_EOF(blob):
1327 case YY_STATE_EOF(mlcmt):
1330 case YY_END_OF_BUFFER:
1332 /* Amount of text matched not including the EOB char. */
1333 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1335 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1336 *yy_cp = (yy_hold_char);
1337 YY_RESTORE_YY_MORE_OFFSET
1339 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1341 /* We're scanning a new file or input source. It's
1342 * possible that this happened because the user
1343 * just pointed yyin at a new source and called
1344 * yylex(). If so, then we have to assure
1345 * consistency between YY_CURRENT_BUFFER and our
1346 * globals. Here is the right place to do so, because
1347 * this is the first action (other than possibly a
1348 * back-up) that will match for the new input source.
1350 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1351 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1352 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1355 /* Note that here we test for yy_c_buf_p "<=" to the position
1356 * of the first EOB in the buffer, since yy_c_buf_p will
1357 * already have been incremented past the NUL character
1358 * (since all states make transitions on EOB to the
1359 * end-of-buffer state). Contrast this with the test
1362 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1363 { /* This was really a NUL. */
1364 yy_state_type yy_next_state;
1366 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1368 yy_current_state = yy_get_previous_state( );
1370 /* Okay, we're now positioned to make the NUL
1371 * transition. We couldn't have
1372 * yy_get_previous_state() go ahead and do it
1373 * for us because it doesn't know how to deal
1374 * with the possibility of jamming (and we don't
1375 * want to build jamming into it because then it
1376 * will run more slowly).
1379 yy_next_state = yy_try_NUL_trans( yy_current_state );
1381 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1383 if ( yy_next_state )
1385 /* Consume the NUL. */
1386 yy_cp = ++(yy_c_buf_p);
1387 yy_current_state = yy_next_state;
1393 yy_cp = (yy_last_accepting_cpos);
1394 yy_current_state = (yy_last_accepting_state);
1395 goto yy_find_action;
1399 else switch ( yy_get_next_buffer( ) )
1401 case EOB_ACT_END_OF_FILE:
1403 (yy_did_buffer_switch_on_eof) = 0;
1407 /* Note: because we've taken care in
1408 * yy_get_next_buffer() to have set up
1409 * yytext, we can now set up
1410 * yy_c_buf_p so that if some total
1411 * hoser (like flex itself) wants to
1412 * call the scanner after we return the
1413 * YY_NULL, it'll still work - another
1414 * YY_NULL will get returned.
1416 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1418 yy_act = YY_STATE_EOF(YY_START);
1424 if ( ! (yy_did_buffer_switch_on_eof) )
1430 case EOB_ACT_CONTINUE_SCAN:
1432 (yytext_ptr) + yy_amount_of_matched_text;
1434 yy_current_state = yy_get_previous_state( );
1436 yy_cp = (yy_c_buf_p);
1437 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1440 case EOB_ACT_LAST_MATCH:
1442 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1444 yy_current_state = yy_get_previous_state( );
1446 yy_cp = (yy_c_buf_p);
1447 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1448 goto yy_find_action;
1455 "fatal flex scanner internal error--no action found" );
1456 } /* end of action switch */
1457 } /* end of scanning one token */
1458 } /* end of yylex */
1460 /* The contents of this function are C++ specific, so the () macro is not used.
1462 yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
1470 yylineno = 1; // this will only get updated if %option yylineno
1472 yy_did_buffer_switch_on_eof = 0;
1474 yy_looking_for_trail_begin = 0;
1477 yy_more_offset = yy_prev_more_offset = 0;
1479 yy_start_stack_ptr = yy_start_stack_depth = 0;
1480 yy_start_stack = NULL;
1482 yy_buffer_stack = 0;
1483 yy_buffer_stack_top = 0;
1484 yy_buffer_stack_max = 0;
1490 /* The contents of this function are C++ specific, so the () macro is not used.
1492 yyFlexLexer::~yyFlexLexer()
1494 delete [] yy_state_buf;
1495 yyfree(yy_start_stack );
1496 yy_delete_buffer( YY_CURRENT_BUFFER );
1497 yyfree(yy_buffer_stack );
1500 /* The contents of this function are C++ specific, so the () macro is not used.
1502 void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
1506 yy_delete_buffer( YY_CURRENT_BUFFER );
1507 yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
1514 #ifdef YY_INTERACTIVE
1515 int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
1517 int yyFlexLexer::LexerInput( char* buf, int max_size )
1520 if ( yyin->eof() || yyin->fail() )
1523 #ifdef YY_INTERACTIVE
1524 yyin->get( buf[0] );
1535 (void) yyin->read( buf, max_size );
1540 return yyin->gcount();
1544 void yyFlexLexer::LexerOutput( const char* buf, int size )
1546 (void) yyout->write( buf, size );
1549 /* yy_get_next_buffer - try to read in a new buffer
1551 * Returns a code representing an action:
1552 * EOB_ACT_LAST_MATCH -
1553 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1554 * EOB_ACT_END_OF_FILE - end of file
1556 int yyFlexLexer::yy_get_next_buffer()
1558 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1559 register char *source = (yytext_ptr);
1560 register int number_to_move, i;
1563 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1565 "fatal flex scanner internal error--end of buffer missed" );
1567 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1568 { /* Don't try to fill the buffer, so this is an EOF. */
1569 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1571 /* We matched a single character, the EOB, so
1572 * treat this as a final EOF.
1574 return EOB_ACT_END_OF_FILE;
1579 /* We matched some text prior to the EOB, first
1582 return EOB_ACT_LAST_MATCH;
1586 /* Try to read more data. */
1588 /* First move last chars to start of buffer. */
1589 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1591 for ( i = 0; i < number_to_move; ++i )
1592 *(dest++) = *(source++);
1594 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1595 /* don't do the read, it's not guaranteed to return an EOF,
1598 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1602 yy_size_t num_to_read =
1603 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1605 while ( num_to_read <= 0 )
1606 { /* Not enough room in the buffer - grow it. */
1608 /* just a shorter name for the current buffer */
1609 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1611 int yy_c_buf_p_offset =
1612 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1614 if ( b->yy_is_our_buffer )
1616 yy_size_t new_size = b->yy_buf_size * 2;
1618 if ( new_size <= 0 )
1619 b->yy_buf_size += b->yy_buf_size / 8;
1621 b->yy_buf_size *= 2;
1623 b->yy_ch_buf = (char *)
1624 /* Include room in for 2 EOB chars. */
1625 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1628 /* Can't grow it, we don't own it. */
1631 if ( ! b->yy_ch_buf )
1633 "fatal error - scanner input buffer overflow" );
1635 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1637 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1642 if ( num_to_read > YY_READ_BUF_SIZE )
1643 num_to_read = YY_READ_BUF_SIZE;
1645 /* Read in more data. */
1646 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1647 (yy_n_chars), num_to_read );
1649 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1652 if ( (yy_n_chars) == 0 )
1654 if ( number_to_move == YY_MORE_ADJ )
1656 ret_val = EOB_ACT_END_OF_FILE;
1662 ret_val = EOB_ACT_LAST_MATCH;
1663 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1664 YY_BUFFER_EOF_PENDING;
1669 ret_val = EOB_ACT_CONTINUE_SCAN;
1671 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1672 /* Extend the array by 50%, plus the number we really need. */
1673 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1674 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1675 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1676 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1679 (yy_n_chars) += number_to_move;
1680 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1681 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1683 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1688 /* yy_get_previous_state - get the state just before the EOB char was reached */
1690 yy_state_type yyFlexLexer::yy_get_previous_state()
1692 register yy_state_type yy_current_state;
1693 register char *yy_cp;
1695 yy_current_state = (yy_start);
1697 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1699 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1700 if ( yy_accept[yy_current_state] )
1702 (yy_last_accepting_state) = yy_current_state;
1703 (yy_last_accepting_cpos) = yy_cp;
1705 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1707 yy_current_state = (int) yy_def[yy_current_state];
1708 if ( yy_current_state >= 218 )
1709 yy_c = yy_meta[(unsigned int) yy_c];
1711 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1714 return yy_current_state;
1717 /* yy_try_NUL_trans - try to make a transition on the NUL character
1720 * next_state = yy_try_NUL_trans( current_state );
1722 yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
1724 register int yy_is_jam;
1725 register char *yy_cp = (yy_c_buf_p);
1727 register YY_CHAR yy_c = 1;
1728 if ( yy_accept[yy_current_state] )
1730 (yy_last_accepting_state) = yy_current_state;
1731 (yy_last_accepting_cpos) = yy_cp;
1733 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1735 yy_current_state = (int) yy_def[yy_current_state];
1736 if ( yy_current_state >= 218 )
1737 yy_c = yy_meta[(unsigned int) yy_c];
1739 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1740 yy_is_jam = (yy_current_state == 217);
1742 return yy_is_jam ? 0 : yy_current_state;
1745 void yyFlexLexer::yyunput( int c, register char* yy_bp)
1747 register char *yy_cp;
1749 yy_cp = (yy_c_buf_p);
1751 /* undo effects of setting up yytext */
1752 *yy_cp = (yy_hold_char);
1754 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1755 { /* need to shift things up to make room */
1756 /* +2 for EOB chars. */
1757 register yy_size_t number_to_move = (yy_n_chars) + 2;
1758 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1759 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1760 register char *source =
1761 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1763 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1764 *--dest = *--source;
1766 yy_cp += (int) (dest - source);
1767 yy_bp += (int) (dest - source);
1768 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1769 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1771 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1772 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1775 *--yy_cp = (char) c;
1781 (yytext_ptr) = yy_bp;
1782 (yy_hold_char) = *yy_cp;
1783 (yy_c_buf_p) = yy_cp;
1786 int yyFlexLexer::yyinput()
1790 *(yy_c_buf_p) = (yy_hold_char);
1792 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1794 /* yy_c_buf_p now points to the character we want to return.
1795 * If this occurs *before* the EOB characters, then it's a
1796 * valid NUL; if not, then we've hit the end of the buffer.
1798 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1799 /* This was really a NUL. */
1800 *(yy_c_buf_p) = '\0';
1803 { /* need more input */
1804 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1807 switch ( yy_get_next_buffer( ) )
1809 case EOB_ACT_LAST_MATCH:
1810 /* This happens because yy_g_n_b()
1811 * sees that we've accumulated a
1812 * token and flags that we need to
1813 * try matching the token before
1814 * proceeding. But for input(),
1815 * there's no matching to consider.
1816 * So convert the EOB_ACT_LAST_MATCH
1817 * to EOB_ACT_END_OF_FILE.
1820 /* Reset buffer status. */
1825 case EOB_ACT_END_OF_FILE:
1830 if ( ! (yy_did_buffer_switch_on_eof) )
1839 case EOB_ACT_CONTINUE_SCAN:
1840 (yy_c_buf_p) = (yytext_ptr) + offset;
1846 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1847 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1848 (yy_hold_char) = *++(yy_c_buf_p);
1858 /** Immediately switch to a different input stream.
1859 * @param input_file A readable stream.
1861 * @note This function does not reset the start condition to @c INITIAL .
1863 void yyFlexLexer::yyrestart( std::istream* input_file )
1866 if ( ! YY_CURRENT_BUFFER ){
1867 yyensure_buffer_stack ();
1868 YY_CURRENT_BUFFER_LVALUE =
1869 yy_create_buffer( yyin, YY_BUF_SIZE );
1872 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1873 yy_load_buffer_state( );
1876 /** Switch to a different input buffer.
1877 * @param new_buffer The new input buffer.
1880 void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1883 /* TODO. We should be able to replace this entire function body
1885 * yypop_buffer_state();
1886 * yypush_buffer_state(new_buffer);
1888 yyensure_buffer_stack ();
1889 if ( YY_CURRENT_BUFFER == new_buffer )
1892 if ( YY_CURRENT_BUFFER )
1894 /* Flush out information for old buffer. */
1895 *(yy_c_buf_p) = (yy_hold_char);
1896 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1897 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1900 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1901 yy_load_buffer_state( );
1903 /* We don't actually know whether we did this switch during
1904 * EOF (yywrap()) processing, but the only time this flag
1905 * is looked at is after yywrap() is called, so it's safe
1906 * to go ahead and always set it.
1908 (yy_did_buffer_switch_on_eof) = 1;
1911 void yyFlexLexer::yy_load_buffer_state()
1913 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1914 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1915 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1916 (yy_hold_char) = *(yy_c_buf_p);
1919 /** Allocate and initialize an input buffer state.
1920 * @param file A readable stream.
1921 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1923 * @return the allocated buffer state.
1925 YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
1929 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1931 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1933 b->yy_buf_size = size;
1935 /* yy_ch_buf has to be 2 characters longer than the size given because
1936 * we need to put in 2 end-of-buffer characters.
1938 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1939 if ( ! b->yy_ch_buf )
1940 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1942 b->yy_is_our_buffer = 1;
1944 yy_init_buffer( b, file );
1949 /** Destroy the buffer.
1950 * @param b a buffer created with yy_create_buffer()
1953 void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
1959 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1960 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1962 if ( b->yy_is_our_buffer )
1963 yyfree((void *) b->yy_ch_buf );
1965 yyfree((void *) b );
1968 /* Initializes or reinitializes a buffer.
1969 * This function is sometimes called more than once on the same buffer,
1970 * such as during a yyrestart() or at EOF.
1972 void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
1977 yy_flush_buffer( b );
1979 b->yy_input_file = file;
1980 b->yy_fill_buffer = 1;
1982 /* If b is the current buffer, then yy_init_buffer was _probably_
1983 * called from yyrestart() or through yy_get_next_buffer.
1984 * In that case, we don't want to reset the lineno or column.
1986 if (b != YY_CURRENT_BUFFER){
1987 b->yy_bs_lineno = 1;
1988 b->yy_bs_column = 0;
1991 b->yy_is_interactive = 0;
1995 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1996 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1999 void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
2006 /* We always need two end-of-buffer characters. The first causes
2007 * a transition to the end-of-buffer state. The second causes
2008 * a jam in that state.
2010 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2011 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2013 b->yy_buf_pos = &b->yy_ch_buf[0];
2016 b->yy_buffer_status = YY_BUFFER_NEW;
2018 if ( b == YY_CURRENT_BUFFER )
2019 yy_load_buffer_state( );
2022 /** Pushes the new state onto the stack. The new state becomes
2023 * the current state. This function will allocate the stack
2025 * @param new_buffer The new state.
2028 void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
2030 if (new_buffer == NULL)
2033 yyensure_buffer_stack();
2035 /* This block is copied from yy_switch_to_buffer. */
2036 if ( YY_CURRENT_BUFFER )
2038 /* Flush out information for old buffer. */
2039 *(yy_c_buf_p) = (yy_hold_char);
2040 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2041 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2044 /* Only push if top exists. Otherwise, replace top. */
2045 if (YY_CURRENT_BUFFER)
2046 (yy_buffer_stack_top)++;
2047 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2049 /* copied from yy_switch_to_buffer. */
2050 yy_load_buffer_state( );
2051 (yy_did_buffer_switch_on_eof) = 1;
2054 /** Removes and deletes the top of the stack, if present.
2055 * The next element becomes the new top.
2058 void yyFlexLexer::yypop_buffer_state (void)
2060 if (!YY_CURRENT_BUFFER)
2063 yy_delete_buffer(YY_CURRENT_BUFFER );
2064 YY_CURRENT_BUFFER_LVALUE = NULL;
2065 if ((yy_buffer_stack_top) > 0)
2066 --(yy_buffer_stack_top);
2068 if (YY_CURRENT_BUFFER) {
2069 yy_load_buffer_state( );
2070 (yy_did_buffer_switch_on_eof) = 1;
2074 /* Allocates the stack if it does not exist.
2075 * Guarantees space for at least one push.
2077 void yyFlexLexer::yyensure_buffer_stack(void)
2079 yy_size_t num_to_alloc;
2081 if (!(yy_buffer_stack)) {
2083 /* First allocation is just for 2 elements, since we don't know if this
2084 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2085 * immediate realloc on the next call.
2088 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2089 (num_to_alloc * sizeof(struct yy_buffer_state*)
2091 if ( ! (yy_buffer_stack) )
2092 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2094 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2096 (yy_buffer_stack_max) = num_to_alloc;
2097 (yy_buffer_stack_top) = 0;
2101 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2103 /* Increase the buffer to prepare for a possible push. */
2104 int grow_size = 8 /* arbitrary grow size */;
2106 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2107 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2109 num_to_alloc * sizeof(struct yy_buffer_state*)
2111 if ( ! (yy_buffer_stack) )
2112 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2114 /* zero only the new slots.*/
2115 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2116 (yy_buffer_stack_max) = num_to_alloc;
2120 void yyFlexLexer::yy_push_state( int new_state )
2122 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
2126 (yy_start_stack_depth) += YY_START_STACK_INCR;
2127 new_size = (yy_start_stack_depth) * sizeof( int );
2129 if ( ! (yy_start_stack) )
2130 (yy_start_stack) = (int *) yyalloc(new_size );
2133 (yy_start_stack) = (int *) yyrealloc((void *) (yy_start_stack),new_size );
2135 if ( ! (yy_start_stack) )
2136 YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2139 (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
2144 void yyFlexLexer::yy_pop_state()
2146 if ( --(yy_start_stack_ptr) < 0 )
2147 YY_FATAL_ERROR( "start-condition stack underflow" );
2149 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
2152 int yyFlexLexer::yy_top_state()
2154 return (yy_start_stack)[(yy_start_stack_ptr) - 1];
2157 #ifndef YY_EXIT_FAILURE
2158 #define YY_EXIT_FAILURE 2
2161 void yyFlexLexer::LexerError( yyconst char msg[] )
2163 std::cerr << msg << std::endl;
2164 exit( YY_EXIT_FAILURE );
2167 /* Redefine yyless() so it works in section 3 code. */
2173 /* Undo effects of setting up yytext. */ \
2174 int yyless_macro_arg = (n); \
2175 YY_LESS_LINENO(yyless_macro_arg);\
2176 yytext[yyleng] = (yy_hold_char); \
2177 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2178 (yy_hold_char) = *(yy_c_buf_p); \
2179 *(yy_c_buf_p) = '\0'; \
2180 yyleng = yyless_macro_arg; \
2184 /* Accessor methods (get/set functions) to struct members. */
2187 * Internal utility routines.
2191 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2194 for ( i = 0; i < n; ++i )
2199 #ifdef YY_NEED_STRLEN
2200 static int yy_flex_strlen (yyconst char * s )
2203 for ( n = 0; s[n]; ++n )
2210 void *yyalloc (yy_size_t size )
2212 return (void *) malloc( size );
2215 void *yyrealloc (void * ptr, yy_size_t size )
2217 /* The cast to (char *) in the following accommodates both
2218 * implementations that use char* generic pointers, and those
2219 * that use void* generic pointers. It works with the latter
2220 * because both ANSI C and C++ allow castless assignment from
2221 * any pointer type to void*, and deal with argument conversions
2222 * as though doing an assignment.
2224 return (void *) realloc( (char *) ptr, size );
2227 void yyfree (void * ptr )
2229 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2232 #define YYTABLES_NAME "yytables"
2234 #line 291 "/Users/creed/projects/fsl/fromsvr/elftosb/elftosb2/elftosb_lexer.l"
2238 // verbatim code copied to the bottom of the output