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 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
59 /* Limits of integral types. */
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
106 #define yyconst const
111 /* Returned upon end-of-file. */
114 /* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121 /* Enter a start condition. This macro really ought to take a parameter,
122 * but we do it the disgusting crufty way forced on us by the ()-less
123 * definition of BEGIN.
125 #define BEGIN (yy_start) = 1 + 2 *
127 /* Translate the current start state into a value that can be later handed
128 * to BEGIN to return to the state. The YYSTATE alias is for lex
131 #define YY_START (((yy_start) - 1) / 2)
132 #define YYSTATE YY_START
134 /* Action number for EOF rule of a given start state. */
135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137 /* Special action meaning "start processing a new file". */
138 #define YY_NEW_FILE yyrestart(yyin )
140 #define YY_END_OF_BUFFER_CHAR 0
142 /* Size of default input buffer. */
144 #define YY_BUF_SIZE 16384
147 /* The state buf must be large enough to hold one state per character in the main buffer.
149 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
151 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
152 #define YY_TYPEDEF_YY_BUFFER_STATE
153 typedef struct yy_buffer_state *YY_BUFFER_STATE;
158 extern FILE *yyin, *yyout;
160 #define EOB_ACT_CONTINUE_SCAN 0
161 #define EOB_ACT_END_OF_FILE 1
162 #define EOB_ACT_LAST_MATCH 2
164 #define YY_LESS_LINENO(n)
166 /* Return all but the first "n" matched characters back to the input stream. */
170 /* Undo effects of setting up yytext. */ \
171 int yyless_macro_arg = (n); \
172 YY_LESS_LINENO(yyless_macro_arg);\
173 *yy_cp = (yy_hold_char); \
174 YY_RESTORE_YY_MORE_OFFSET \
175 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
176 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
180 #define unput(c) yyunput( c, (yytext_ptr) )
182 #ifndef YY_TYPEDEF_YY_SIZE_T
183 #define YY_TYPEDEF_YY_SIZE_T
184 typedef size_t yy_size_t;
187 #ifndef YY_STRUCT_YY_BUFFER_STATE
188 #define YY_STRUCT_YY_BUFFER_STATE
189 struct yy_buffer_state
193 char *yy_ch_buf; /* input buffer */
194 char *yy_buf_pos; /* current position in input buffer */
196 /* Size of input buffer in bytes, not including room for EOB
199 yy_size_t yy_buf_size;
201 /* Number of characters read into yy_ch_buf, not including EOB
206 /* Whether we "own" the buffer - i.e., we know we created it,
207 * and can xrealloc() it to grow it, and should xfree() it to
210 int yy_is_our_buffer;
212 /* Whether this is an "interactive" input source; if so, and
213 * if we're using stdio for input, then we want to use getc()
214 * instead of fread(), to make sure we stop fetching input after
217 int yy_is_interactive;
219 /* Whether we're considered to be at the beginning of a line.
220 * If so, '^' rules will be active on the next match, otherwise
225 int yy_bs_lineno; /**< The line count. */
226 int yy_bs_column; /**< The column count. */
228 /* Whether to try to fill the input buffer when we reach the
233 int yy_buffer_status;
235 #define YY_BUFFER_NEW 0
236 #define YY_BUFFER_NORMAL 1
237 /* When an EOF's been seen but there's still some text to process
238 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
239 * shouldn't try reading from the input source any more. We might
240 * still have a bunch of tokens to match, though, because of
241 * possible backing-up.
243 * When we actually see the EOF, we change the status to "new"
244 * (via yyrestart()), so that the user can continue scanning by
245 * just pointing yyin at a new input file.
247 #define YY_BUFFER_EOF_PENDING 2
250 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
252 /* Stack of input buffers. */
253 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
254 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
255 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
257 /* We provide macros for accessing buffer states in case in the
258 * future we want to put the buffer states in a more general
261 * Returns the top of the stack, or NULL.
263 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
264 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
267 /* Same as previous macro, but useful when we know that the buffer stack is not
268 * NULL or when we need an lvalue. For internal use only.
270 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
272 /* yy_hold_char holds the character lost when yytext is formed. */
273 static char yy_hold_char;
274 static int yy_n_chars; /* number of characters read into yy_ch_buf */
277 /* Points to current character in buffer. */
278 static char *yy_c_buf_p = (char *) 0;
279 static int yy_init = 0; /* whether we need to initialize */
280 static int yy_start = 0; /* start state number */
282 /* Flag which is used to allow yywrap()'s to do buffer switches
283 * instead of setting up a fresh yyin. A bit of a hack ...
285 static int yy_did_buffer_switch_on_eof;
287 void yyrestart (FILE *input_file );
288 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
289 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
290 void yy_delete_buffer (YY_BUFFER_STATE b );
291 void yy_flush_buffer (YY_BUFFER_STATE b );
292 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
293 void yypop_buffer_state (void );
295 static void yyensure_buffer_stack (void );
296 static void yy_load_buffer_state (void );
297 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
299 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
301 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
302 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
303 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
305 void *yyalloc (yy_size_t );
306 void *yyxrealloc (void *,yy_size_t );
307 void yyfree (void * );
309 #define yy_new_buffer yy_create_buffer
311 #define yy_set_interactive(is_interactive) \
313 if ( ! YY_CURRENT_BUFFER ){ \
314 yyensure_buffer_stack (); \
315 YY_CURRENT_BUFFER_LVALUE = \
316 yy_create_buffer(yyin,YY_BUF_SIZE ); \
318 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
321 #define yy_set_bol(at_bol) \
323 if ( ! YY_CURRENT_BUFFER ){\
324 yyensure_buffer_stack (); \
325 YY_CURRENT_BUFFER_LVALUE = \
326 yy_create_buffer(yyin,YY_BUF_SIZE ); \
328 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
331 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
333 /* Begin user sect3 */
335 typedef unsigned char YY_CHAR;
337 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
339 typedef int yy_state_type;
346 #define yytext_ptr yytext
348 static yy_state_type yy_get_previous_state (void );
349 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
350 static int yy_get_next_buffer (void );
351 static void yy_fatal_error (yyconst char msg[] );
353 /* Done after the current pattern has been matched and before the
354 * corresponding action - sets up yytext.
356 #define YY_DO_BEFORE_ACTION \
357 (yytext_ptr) = yy_bp; \
358 yyleng = (size_t) (yy_cp - yy_bp); \
359 (yy_hold_char) = *yy_cp; \
361 (yy_c_buf_p) = yy_cp;
363 #define YY_NUM_RULES 55
364 #define YY_END_OF_BUFFER 56
365 /* This struct is not used in this scanner,
366 but its presence is necessary. */
369 flex_int32_t yy_verify;
372 static yyconst flex_int16_t yy_accept[207] =
374 0, 0, 0, 0, 56, 54, 1, 1, 15, 53,
375 43, 54, 45, 46, 43, 44, 43, 43, 43, 4,
376 4, 43, 43, 43, 43, 52, 49, 49, 49, 49,
377 49, 49, 49, 49, 49, 49, 49, 42, 0, 14,
378 0, 53, 0, 0, 0, 0, 0, 0, 0, 37,
379 2, 0, 36, 0, 48, 48, 39, 0, 0, 4,
380 0, 0, 51, 38, 40, 0, 35, 41, 0, 0,
381 49, 0, 49, 49, 49, 49, 49, 16, 22, 49,
382 49, 49, 49, 27, 49, 49, 49, 49, 49, 49,
383 0, 14, 0, 12, 12, 34, 0, 2, 0, 48,
385 48, 0, 9, 0, 3, 7, 0, 49, 0, 0,
386 0, 49, 19, 20, 49, 49, 23, 24, 25, 49,
387 49, 29, 49, 49, 49, 49, 31, 0, 0, 0,
388 0, 0, 0, 48, 47, 6, 0, 0, 9, 0,
389 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
390 0, 0, 0, 49, 21, 49, 26, 49, 17, 30,
391 49, 32, 0, 50, 0, 0, 0, 0, 49, 0,
392 0, 0, 0, 0, 0, 0, 0, 33, 49, 49,
393 0, 0, 5, 11, 0, 8, 0, 0, 0, 0,
394 0, 0, 28, 49, 0, 5, 0, 8, 0, 0,
399 static yyconst flex_int32_t yy_ec[256] =
401 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 4, 5, 6, 7, 8, 5, 9, 10, 11,
405 12, 13, 14, 15, 16, 17, 18, 19, 20, 20,
406 20, 20, 20, 20, 20, 20, 20, 21, 22, 23,
407 24, 25, 5, 26, 27, 28, 29, 30, 31, 32,
408 33, 34, 35, 33, 36, 37, 38, 39, 40, 33,
409 33, 41, 42, 43, 44, 33, 45, 46, 33, 33,
410 47, 5, 48, 5, 49, 5, 50, 51, 29, 52,
412 53, 54, 33, 55, 56, 33, 57, 58, 59, 60,
413 61, 33, 33, 62, 63, 64, 65, 33, 66, 67,
414 33, 33, 26, 22, 26, 5, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 static yyconst flex_int32_t yy_meta[68] =
433 1, 2, 3, 4, 5, 6, 7, 8, 5, 9,
434 5, 5, 5, 5, 5, 5, 10, 5, 11, 11,
435 5, 5, 12, 13, 14, 5, 15, 15, 15, 15,
436 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
437 16, 16, 16, 16, 16, 16, 5, 5, 17, 15,
438 15, 15, 15, 15, 16, 16, 16, 16, 16, 16,
439 16, 16, 16, 16, 16, 16, 16
442 static yyconst flex_int16_t yy_base[229] =
444 0, 0, 649, 638, 646, 1252, 1252, 1252, 62, 0,
445 1252, 109, 1252, 1252, 623, 1252, 619, 175, 606, 174,
446 180, 48, 604, 592, 590, 1252, 204, 71, 214, 186,
447 235, 244, 304, 256, 39, 368, 40, 430, 179, 1252,
448 195, 0, 602, 595, 592, 585, 574, 497, 72, 1252,
449 0, 273, 1252, 0, 39, 0, 1252, 0, 66, 262,
450 75, 0, 1252, 1252, 1252, 557, 1252, 1252, 284, 300,
451 1252, 322, 329, 349, 358, 377, 339, 396, 412, 563,
452 566, 575, 584, 587, 569, 596, 623, 616, 576, 617,
453 571, 568, 334, 380, 1252, 562, 677, 0, 403, 0,
455 40, 89, 642, 71, 163, 0, 401, 672, 401, 723,
456 0, 708, 741, 750, 637, 776, 785, 794, 797, 806,
457 775, 827, 831, 843, 818, 819, 883, 415, 0, 712,
458 399, 885, 352, 1252, 0, 191, 0, 202, 772, 170,
459 243, 334, 222, 244, 247, 259, 766, 47, 209, 216,
460 203, 251, 302, 892, 916, 890, 942, 715, 946, 958,
461 930, 974, 274, 1252, 93, 344, 278, 310, 979, 256,
462 264, 337, 270, 274, 352, 355, 215, 984, 995, 1000,
463 299, 354, 589, 355, 223, 603, 209, 204, 198, 189,
464 174, 101, 1004, 1016, 92, 634, 411, 644, 872, 1021,
466 717, 373, 1252, 793, 832, 1252, 1055, 1065, 1081, 1086,
467 1102, 1119, 1136, 1139, 1146, 339, 560, 1153, 1169, 1181,
468 1186, 1197, 1200, 1216, 634, 645, 1223, 1234
471 static yyconst flex_int16_t yy_def[229] =
473 206, 1, 1, 1, 206, 206, 206, 206, 207, 208,
474 206, 206, 206, 206, 206, 206, 206, 209, 206, 206,
475 206, 206, 210, 206, 206, 206, 211, 211, 211, 211,
476 211, 211, 211, 211, 33, 211, 33, 206, 207, 206,
477 207, 208, 212, 38, 38, 212, 206, 206, 212, 206,
478 213, 209, 206, 214, 215, 215, 206, 216, 206, 206,
479 206, 217, 206, 206, 206, 218, 206, 206, 206, 206,
480 206, 219, 211, 211, 211, 211, 211, 211, 211, 211,
481 211, 211, 211, 211, 36, 211, 211, 36, 33, 36,
482 48, 220, 206, 206, 206, 48, 212, 213, 221, 215,
484 215, 222, 206, 206, 206, 217, 218, 206, 219, 206,
485 223, 224, 211, 211, 33, 211, 211, 211, 211, 211,
486 33, 211, 211, 211, 33, 33, 211, 206, 225, 206,
487 206, 97, 221, 206, 215, 206, 226, 222, 206, 206,
488 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
489 206, 206, 227, 224, 211, 33, 211, 36, 211, 211,
490 36, 211, 206, 206, 212, 206, 228, 206, 206, 206,
491 206, 206, 206, 206, 206, 206, 227, 211, 211, 211,
492 212, 206, 206, 206, 228, 206, 206, 206, 206, 206,
493 206, 206, 211, 211, 212, 206, 206, 206, 206, 206,
495 206, 206, 206, 206, 206, 0, 206, 206, 206, 206,
496 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
497 206, 206, 206, 206, 206, 206, 206, 206
500 static yyconst flex_int16_t yy_nxt[1320] =
502 6, 7, 8, 7, 6, 9, 6, 10, 11, 12,
503 13, 14, 15, 11, 16, 17, 18, 19, 20, 21,
504 22, 11, 23, 24, 25, 26, 27, 28, 28, 28,
505 29, 30, 28, 28, 31, 28, 28, 32, 33, 34,
506 35, 28, 36, 28, 28, 37, 11, 11, 28, 27,
507 28, 28, 29, 30, 28, 31, 28, 28, 32, 33,
508 34, 35, 28, 36, 28, 28, 37, 40, 63, 86,
509 73, 64, 69, 69, 70, 101, 135, 97, 73, 90,
510 71, 94, 73, 73, 103, 103, 172, 72, 104, 105,
511 105, 86, 73, 105, 105, 136, 101, 135, 181, 73,
513 90, 201, 93, 73, 73, 137, 169, 172, 41, 43,
514 44, 44, 45, 46, 46, 46, 46, 46, 47, 46,
515 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
516 46, 46, 46, 46, 46, 48, 48, 48, 48, 48,
517 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
518 48, 48, 48, 48, 48, 49, 46, 46, 48, 48,
519 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
520 48, 48, 48, 48, 48, 48, 52, 52, 52, 169,
521 58, 141, 141, 168, 40, 168, 58, 69, 69, 70,
522 59, 53, 60, 60, 169, 71, 59, 54, 60, 60,
524 92, 55, 72, 169, 61, 69, 69, 70, 136, 169,
525 61, 141, 77, 71, 169, 69, 69, 70, 137, 62,
526 72, 166, 60, 71, 55, 41, 61, 169, 60, 184,
527 72, 74, 61, 175, 142, 77, 69, 69, 70, 169,
528 62, 41, 75, 166, 71, 69, 69, 70, 173, 169,
529 76, 72, 169, 71, 74, 175, 174, 69, 69, 70,
530 72, 141, 141, 75, 169, 71, 78, 142, 58, 173,
531 142, 76, 72, 79, 52, 52, 52, 174, 59, 169,
532 60, 60, 142, 80, 184, 69, 69, 69, 78, 206,
533 176, 141, 61, 188, 79, 54, 84, 187, 85, 55,
535 72, 69, 69, 70, 80, 69, 69, 70, 93, 71,
536 60, 176, 190, 71, 61, 188, 72, 84, 187, 85,
537 72, 39, 55, 109, 109, 109, 169, 110, 186, 186,
538 69, 69, 70, 190, 81, 130, 130, 130, 71, 169,
539 69, 69, 70, 82, 111, 72, 195, 83, 71, 102,
540 69, 69, 70, 102, 131, 72, 81, 182, 71, 69,
541 69, 70, 183, 183, 82, 72, 189, 71, 83, 69,
542 69, 70, 183, 183, 72, 116, 134, 71, 69, 69,
543 70, 130, 130, 130, 72, 197, 71, 114, 189, 191,
544 113, 204, 204, 72, 87, 192, 116, 69, 69, 70,
546 131, 88, 109, 109, 109, 71, 110, 197, 89, 114,
547 191, 113, 72, 69, 69, 70, 192, 87, 115, 164,
548 163, 71, 88, 111, 202, 108, 202, 134, 72, 89,
549 43, 44, 44, 44, 43, 43, 43, 43, 43, 115,
550 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
551 43, 43, 43, 43, 43, 43, 91, 91, 91, 91,
552 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
553 91, 91, 91, 91, 91, 91, 43, 43, 43, 91,
554 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
555 91, 91, 91, 91, 91, 91, 91, 43, 43, 43,
557 43, 43, 43, 43, 43, 43, 94, 43, 43, 43,
558 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
559 43, 43, 43, 96, 96, 96, 96, 96, 96, 96,
560 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
561 96, 96, 96, 43, 43, 43, 96, 96, 96, 96,
562 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
563 96, 96, 96, 96, 69, 69, 70, 69, 69, 70,
564 106, 93, 71, 128, 106, 71, 69, 69, 70, 72,
565 93, 108, 72, 95, 71, 69, 69, 70, 69, 69,
566 70, 72, 117, 71, 94, 73, 71, 69, 69, 70,
568 72, 94, 121, 72, 93, 71, 73, 196, 196, 73,
569 118, 93, 72, 68, 117, 73, 67, 119, 73, 126,
570 120, 198, 198, 121, 69, 69, 70, 65, 73, 57,
571 73, 118, 71, 122, 51, 50, 73, 196, 119, 72,
572 126, 120, 73, 73, 128, 206, 124, 38, 128, 73,
573 73, 198, 196, 196, 122, 167, 125, 127, 38, 167,
574 139, 139, 198, 198, 123, 73, 73, 155, 124, 206,
575 73, 73, 140, 69, 69, 70, 73, 125, 127, 206,
576 73, 71, 196, 206, 206, 123, 93, 206, 72, 155,
577 139, 206, 198, 206, 140, 132, 132, 73, 206, 206,
579 206, 73, 206, 132, 132, 132, 132, 132, 132, 69,
580 69, 70, 206, 130, 130, 130, 206, 71, 130, 130,
581 130, 206, 206, 206, 72, 206, 132, 132, 132, 132,
582 132, 142, 131, 206, 206, 143, 142, 131, 142, 206,
583 144, 73, 69, 69, 70, 145, 142, 146, 73, 147,
584 71, 69, 69, 70, 206, 179, 206, 72, 206, 71,
585 148, 149, 150, 151, 73, 206, 72, 206, 152, 73,
586 206, 206, 147, 206, 206, 206, 179, 69, 69, 70,
587 206, 148, 149, 150, 151, 71, 69, 69, 70, 152,
588 139, 139, 72, 170, 71, 69, 69, 70, 69, 69,
590 70, 72, 140, 71, 171, 158, 71, 69, 69, 70,
591 72, 205, 205, 72, 73, 71, 170, 156, 73, 206,
592 139, 206, 72, 206, 140, 171, 206, 158, 69, 69,
593 70, 206, 69, 69, 70, 73, 71, 206, 156, 73,
594 71, 205, 157, 72, 69, 69, 70, 72, 161, 162,
595 205, 205, 71, 206, 206, 206, 206, 73, 73, 72,
596 206, 73, 73, 157, 206, 206, 159, 206, 206, 206,
597 161, 162, 206, 199, 199, 199, 206, 206, 73, 73,
598 205, 160, 73, 73, 69, 69, 70, 159, 72, 206,
599 203, 203, 71, 69, 69, 70, 206, 206, 206, 72,
601 206, 71, 160, 165, 165, 206, 206, 206, 72, 206,
602 206, 165, 165, 165, 165, 165, 165, 69, 69, 70,
603 178, 206, 206, 206, 206, 71, 206, 206, 206, 73,
604 206, 206, 72, 73, 165, 165, 165, 165, 165, 206,
605 206, 206, 178, 69, 69, 70, 206, 69, 69, 70,
606 73, 71, 206, 206, 73, 71, 180, 206, 72, 69,
607 69, 70, 72, 73, 206, 206, 206, 71, 206, 206,
608 73, 206, 206, 206, 72, 69, 69, 70, 206, 180,
609 69, 69, 70, 71, 73, 69, 69, 70, 71, 206,
610 72, 73, 206, 71, 206, 72, 69, 69, 70, 206,
612 72, 69, 69, 70, 71, 69, 69, 70, 206, 71,
613 206, 72, 206, 71, 206, 206, 72, 199, 199, 200,
614 72, 206, 199, 199, 200, 71, 206, 206, 206, 194,
615 71, 206, 72, 206, 206, 206, 193, 72, 206, 203,
616 203, 206, 206, 206, 206, 206, 206, 206, 206, 206,
617 206, 194, 206, 206, 206, 206, 206, 193, 39, 39,
618 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
619 39, 39, 42, 206, 206, 42, 206, 206, 206, 42,
620 42, 42, 56, 56, 56, 206, 206, 206, 206, 206,
621 56, 206, 56, 206, 206, 56, 56, 56, 66, 206,
623 66, 66, 66, 73, 73, 73, 206, 206, 206, 206,
624 73, 73, 73, 206, 206, 206, 73, 73, 73, 43,
625 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
626 43, 43, 43, 43, 43, 43, 98, 98, 206, 98,
627 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
628 98, 98, 98, 99, 99, 99, 100, 206, 206, 206,
629 100, 100, 100, 107, 206, 206, 107, 107, 107, 107,
630 112, 112, 112, 206, 112, 206, 206, 206, 206, 206,
631 112, 206, 206, 112, 112, 112, 129, 206, 206, 206,
632 206, 129, 206, 206, 206, 129, 133, 206, 206, 133,
634 133, 133, 133, 138, 206, 206, 138, 138, 206, 206,
635 206, 138, 206, 138, 153, 153, 153, 154, 154, 154,
636 206, 206, 206, 206, 154, 154, 154, 206, 206, 206,
637 154, 154, 154, 177, 206, 206, 177, 177, 177, 177,
638 185, 206, 206, 206, 185, 206, 206, 206, 185, 206,
639 185, 5, 206, 206, 206, 206, 206, 206, 206, 206,
640 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
641 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
642 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
643 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
645 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
646 206, 206, 206, 206, 206, 206, 206, 206, 206
649 static yyconst flex_int16_t yy_chk[1320] =
651 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
652 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
653 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
654 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
655 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
656 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
657 1, 1, 1, 1, 1, 1, 1, 9, 22, 35,
658 37, 22, 28, 28, 28, 55, 101, 49, 35, 37,
659 28, 49, 35, 37, 59, 59, 148, 28, 61, 104,
660 104, 35, 37, 61, 61, 102, 55, 101, 165, 35,
662 37, 195, 165, 35, 37, 102, 192, 148, 9, 12,
663 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
664 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
665 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
666 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
667 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
668 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
669 12, 12, 12, 12, 12, 12, 18, 18, 18, 191,
670 20, 105, 105, 140, 39, 140, 21, 30, 30, 30,
671 20, 18, 20, 20, 190, 30, 21, 18, 21, 21,
673 41, 18, 30, 189, 20, 27, 27, 27, 138, 188,
674 21, 105, 30, 27, 187, 29, 29, 29, 138, 20,
675 27, 136, 20, 29, 18, 39, 20, 143, 21, 185,
676 29, 27, 21, 151, 143, 30, 31, 31, 31, 177,
677 20, 41, 27, 136, 31, 32, 32, 32, 149, 144,
678 29, 31, 145, 32, 27, 151, 150, 34, 34, 34,
679 32, 141, 141, 27, 146, 34, 31, 144, 60, 149,
680 145, 29, 34, 31, 52, 52, 52, 150, 60, 174,
681 60, 60, 146, 32, 167, 69, 69, 69, 31, 52,
682 152, 141, 60, 171, 31, 52, 34, 170, 34, 52,
684 69, 70, 70, 70, 32, 33, 33, 33, 181, 70,
685 60, 152, 173, 33, 60, 171, 70, 34, 170, 34,
686 33, 163, 52, 72, 72, 72, 153, 72, 168, 168,
687 73, 73, 73, 173, 33, 93, 93, 93, 73, 142,
688 77, 77, 77, 33, 72, 73, 181, 33, 77, 216,
689 74, 74, 74, 216, 93, 77, 33, 166, 74, 75,
690 75, 75, 166, 166, 33, 74, 172, 75, 33, 36,
691 36, 36, 182, 182, 75, 77, 133, 36, 76, 76,
692 76, 94, 94, 94, 36, 184, 76, 75, 172, 175,
693 74, 202, 202, 76, 36, 176, 77, 78, 78, 78,
695 94, 36, 109, 109, 109, 78, 109, 184, 36, 75,
696 175, 74, 78, 79, 79, 79, 176, 36, 76, 131,
697 128, 79, 36, 109, 197, 107, 197, 99, 79, 36,
698 38, 38, 38, 38, 38, 38, 38, 38, 38, 76,
699 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
700 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
701 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
702 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
703 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
704 38, 38, 38, 38, 38, 38, 38, 48, 48, 48,
706 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
707 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
708 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
709 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
710 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
711 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
712 48, 48, 48, 48, 80, 80, 80, 81, 81, 81,
713 217, 96, 80, 92, 217, 81, 82, 82, 82, 80,
714 91, 66, 81, 47, 82, 83, 83, 83, 84, 84,
715 84, 82, 80, 83, 46, 85, 84, 86, 86, 86,
717 83, 45, 85, 84, 44, 86, 89, 183, 183, 85,
718 81, 43, 86, 25, 80, 89, 24, 82, 85, 89,
719 83, 186, 186, 85, 87, 87, 87, 23, 89, 19,
720 85, 81, 87, 86, 17, 15, 89, 183, 82, 87,
721 89, 83, 88, 90, 225, 5, 88, 4, 225, 88,
722 90, 186, 196, 196, 86, 226, 88, 90, 3, 226,
723 103, 103, 198, 198, 87, 88, 90, 115, 88, 0,
724 88, 90, 103, 108, 108, 108, 115, 88, 90, 0,
725 115, 108, 196, 0, 0, 87, 97, 0, 108, 115,
726 103, 0, 198, 0, 103, 97, 97, 115, 0, 0,
728 0, 115, 0, 97, 97, 97, 97, 97, 97, 112,
729 112, 112, 0, 130, 130, 130, 0, 112, 201, 201,
730 201, 0, 0, 0, 112, 0, 97, 97, 97, 97,
731 97, 110, 130, 0, 0, 110, 110, 201, 110, 0,
732 110, 158, 113, 113, 113, 110, 110, 110, 158, 110,
733 113, 114, 114, 114, 0, 158, 0, 113, 0, 114,
734 110, 110, 110, 110, 158, 0, 114, 0, 110, 158,
735 0, 0, 110, 0, 0, 0, 158, 116, 116, 116,
736 0, 110, 110, 110, 110, 116, 117, 117, 117, 110,
737 139, 139, 116, 147, 117, 118, 118, 118, 119, 119,
739 119, 117, 139, 118, 147, 121, 119, 120, 120, 120,
740 118, 204, 204, 119, 121, 120, 147, 116, 121, 0,
741 139, 0, 120, 0, 139, 147, 0, 121, 122, 122,
742 122, 0, 123, 123, 123, 121, 122, 0, 116, 121,
743 123, 204, 120, 122, 124, 124, 124, 123, 125, 126,
744 205, 205, 124, 0, 0, 0, 0, 125, 126, 124,
745 0, 125, 126, 120, 0, 0, 123, 0, 0, 0,
746 125, 126, 0, 199, 199, 199, 0, 0, 125, 126,
747 205, 124, 125, 126, 127, 127, 127, 123, 199, 0,
748 199, 199, 127, 154, 154, 154, 0, 0, 0, 127,
750 0, 154, 124, 132, 132, 0, 0, 0, 154, 0,
751 0, 132, 132, 132, 132, 132, 132, 155, 155, 155,
752 156, 0, 0, 0, 0, 155, 0, 0, 0, 156,
753 0, 0, 155, 156, 132, 132, 132, 132, 132, 0,
754 0, 0, 156, 157, 157, 157, 0, 159, 159, 159,
755 156, 157, 0, 0, 156, 159, 161, 0, 157, 160,
756 160, 160, 159, 161, 0, 0, 0, 160, 0, 0,
757 161, 0, 0, 0, 160, 162, 162, 162, 0, 161,
758 169, 169, 169, 162, 161, 178, 178, 178, 169, 0,
759 162, 161, 0, 178, 0, 169, 179, 179, 179, 0,
761 178, 180, 180, 180, 179, 193, 193, 193, 0, 180,
762 0, 179, 0, 193, 0, 0, 180, 194, 194, 194,
763 193, 0, 200, 200, 200, 194, 0, 0, 0, 180,
764 200, 0, 194, 0, 0, 0, 179, 200, 0, 200,
765 200, 0, 0, 0, 0, 0, 0, 0, 0, 0,
766 0, 180, 0, 0, 0, 0, 0, 179, 207, 207,
767 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
768 207, 207, 208, 0, 0, 208, 0, 0, 0, 208,
769 208, 208, 209, 209, 209, 0, 0, 0, 0, 0,
770 209, 0, 209, 0, 0, 209, 209, 209, 210, 0,
772 210, 210, 210, 211, 211, 211, 0, 0, 0, 0,
773 211, 211, 211, 0, 0, 0, 211, 211, 211, 212,
774 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
775 212, 212, 212, 212, 212, 212, 213, 213, 0, 213,
776 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
777 213, 213, 213, 214, 214, 214, 215, 0, 0, 0,
778 215, 215, 215, 218, 0, 0, 218, 218, 218, 218,
779 219, 219, 219, 0, 219, 0, 0, 0, 0, 0,
780 219, 0, 0, 219, 219, 219, 220, 0, 0, 0,
781 0, 220, 0, 0, 0, 220, 221, 0, 0, 221,
783 221, 221, 221, 222, 0, 0, 222, 222, 0, 0,
784 0, 222, 0, 222, 223, 223, 223, 224, 224, 224,
785 0, 0, 0, 0, 224, 224, 224, 0, 0, 0,
786 224, 224, 224, 227, 0, 0, 227, 227, 227, 227,
787 228, 0, 0, 0, 228, 0, 0, 0, 228, 0,
788 228, 206, 206, 206, 206, 206, 206, 206, 206, 206,
789 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
790 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
791 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
792 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
794 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
795 206, 206, 206, 206, 206, 206, 206, 206, 206
798 static yy_state_type yy_last_accepting_state;
799 static char *yy_last_accepting_cpos;
801 extern int yy_flex_debug;
802 int yy_flex_debug = 0;
804 /* The intent behind this definition is that it'll catch
805 * any uses of REJECT which flex missed.
807 #define REJECT reject_used_but_not_detected
808 #define yymore() yymore_used_but_not_detected
809 #define YY_MORE_ADJ 0
810 #define YY_RESTORE_YY_MORE_OFFSET
813 /* FLEX lexer for Ada expressions, for GDB.
814 Copyright (C) 1994-2013 Free Software Foundation, Inc.
816 This file is part of GDB.
818 This program is free software; you can redistribute it and/or modify
819 it under the terms of the GNU General Public License as published by
820 the Free Software Foundation; either version 3 of the License, or
821 (at your option) any later version.
823 This program is distributed in the hope that it will be useful,
824 but WITHOUT ANY WARRANTY; without even the implied warranty of
825 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
826 GNU General Public License for more details.
828 You should have received a copy of the GNU General Public License
829 along with this program. If not, see <http://www.gnu.org/licenses/>. */
830 /*----------------------------------------------------------------------*/
831 /* The converted version of this file is to be included in ada-exp.y, */
832 /* the Ada parser for gdb. The function yylex obtains characters from */
833 /* the global pointer lexptr. It returns a syntactic category for */
834 /* each successive token and places a semantic value into yylval */
835 /* (ada-lval), defined by the parser. */
838 #define NUMERAL_WIDTH 256
839 #define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
841 /* Temporary staging for numeric literals. */
842 static char numbuf[NUMERAL_WIDTH];
843 static void canonicalizeNumeral (char *s1, const char *);
844 static struct stoken processString (const char*, int);
845 static int processInt (const char *, const char *, const char *);
846 static int processReal (const char *);
847 static struct stoken processId (const char *, int);
848 static int processAttribute (const char *);
849 static int find_dot_all (const char *);
850 static void rewind_to_char (int);
853 #define YY_DECL static int yylex ( void )
855 /* Flex generates a static function "input" which is not used.
856 Defining YY_NO_INPUT comments it out. */
860 #define YY_INPUT(BUF, RESULT, MAX_SIZE) \
861 if ( *lexptr == '\000' ) \
862 (RESULT) = YY_NULL; \
870 static int find_dot_all (const char *);
873 #line 874 "ada-lex.c"
876 #define BEFORE_QUAL_QUOTE 1
878 #ifndef YY_NO_UNISTD_H
879 /* Special case for "unistd.h", since it is non-ANSI. We include it way
880 * down here because we want the user's section 1 to have been scanned first.
881 * The user has a chance to override it with an option.
886 #ifndef YY_EXTRA_TYPE
887 #define YY_EXTRA_TYPE void *
890 static int yy_init_globals (void );
892 /* Accessor methods to globals.
893 These are made visible to non-reentrant scanners for convenience. */
895 int yylex_destroy (void );
897 int yyget_debug (void );
899 void yyset_debug (int debug_flag );
901 YY_EXTRA_TYPE yyget_extra (void );
903 void yyset_extra (YY_EXTRA_TYPE user_defined );
905 FILE *yyget_in (void );
907 void yyset_in (FILE * in_str );
909 FILE *yyget_out (void );
911 void yyset_out (FILE * out_str );
913 int yyget_leng (void );
915 char *yyget_text (void );
917 int yyget_lineno (void );
919 void yyset_lineno (int line_number );
921 /* Macros after this point can all be overridden by user definitions in
925 #ifndef YY_SKIP_YYWRAP
927 extern "C" int yywrap (void );
929 extern int yywrap (void );
933 static void yyunput (int c,char *buf_ptr );
936 static void yy_flex_strncpy (char *,yyconst char *,int );
939 #ifdef YY_NEED_STRLEN
940 static int yy_flex_strlen (yyconst char * );
946 static int yyinput (void );
948 static int input (void );
953 /* Amount of stuff to slurp up with each read. */
954 #ifndef YY_READ_BUF_SIZE
955 #define YY_READ_BUF_SIZE 8192
958 /* Copy whatever the last rule matched to the standard output. */
960 /* This used to be an fputs(), but since the string might contain NUL's,
961 * we now use fwrite().
963 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
966 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
967 * is returned in "result".
970 #define YY_INPUT(buf,result,max_size) \
971 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
975 for ( n = 0; n < max_size && \
976 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
979 buf[n++] = (char) c; \
980 if ( c == EOF && ferror( yyin ) ) \
981 YY_FATAL_ERROR( "input in flex scanner failed" ); \
987 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
989 if( errno != EINTR) \
991 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1002 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1003 * we don't want an extra ';' after the "return" because that will cause
1004 * some compilers to complain about unreachable statements.
1007 #define yyterminate() return YY_NULL
1010 /* Number of entries by which start-condition stack grows. */
1011 #ifndef YY_START_STACK_INCR
1012 #define YY_START_STACK_INCR 25
1015 /* Report a fatal error. */
1016 #ifndef YY_FATAL_ERROR
1017 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1020 /* end tables serialization structures and prototypes */
1022 /* Default declaration of generated scanner - a define so the user can
1023 * easily add parameters.
1026 #define YY_DECL_IS_OURS 1
1028 extern int yylex (void);
1030 #define YY_DECL int yylex (void)
1031 #endif /* !YY_DECL */
1033 /* Code executed at the beginning of each rule, after yytext and yyleng
1036 #ifndef YY_USER_ACTION
1037 #define YY_USER_ACTION
1040 /* Code executed at the end of each rule. */
1042 #define YY_BREAK break;
1045 #define YY_RULE_SETUP \
1048 /** The main scanner function which does all the work.
1052 register yy_state_type yy_current_state;
1053 register char *yy_cp, *yy_bp;
1054 register int yy_act;
1056 #line 84 "ada-lex.l"
1059 #line 1060 "ada-lex.c"
1070 (yy_start) = 1; /* first start state */
1078 if ( ! YY_CURRENT_BUFFER ) {
1079 yyensure_buffer_stack ();
1080 YY_CURRENT_BUFFER_LVALUE =
1081 yy_create_buffer(yyin,YY_BUF_SIZE );
1084 yy_load_buffer_state( );
1087 while ( 1 ) /* loops until end-of-file is reached */
1089 yy_cp = (yy_c_buf_p);
1091 /* Support of yytext. */
1092 *yy_cp = (yy_hold_char);
1094 /* yy_bp points to the position in yy_ch_buf of the start of
1099 yy_current_state = (yy_start);
1103 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1104 if ( yy_accept[yy_current_state] )
1106 (yy_last_accepting_state) = yy_current_state;
1107 (yy_last_accepting_cpos) = yy_cp;
1109 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1111 yy_current_state = (int) yy_def[yy_current_state];
1112 if ( yy_current_state >= 207 )
1113 yy_c = yy_meta[(unsigned int) yy_c];
1115 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1118 while ( yy_base[yy_current_state] != 1252 );
1121 yy_act = yy_accept[yy_current_state];
1123 { /* have to back up */
1124 yy_cp = (yy_last_accepting_cpos);
1125 yy_current_state = (yy_last_accepting_state);
1126 yy_act = yy_accept[yy_current_state];
1129 YY_DO_BEFORE_ACTION;
1131 do_action: /* This label is used only to access EOF actions. */
1134 { /* beginning of action switch */
1135 case 0: /* must back up */
1136 /* undo the effects of YY_DO_BEFORE_ACTION */
1137 *yy_cp = (yy_hold_char);
1138 yy_cp = (yy_last_accepting_cpos);
1139 yy_current_state = (yy_last_accepting_state);
1140 goto yy_find_action;
1143 /* rule 1 can match eol */
1145 #line 86 "ada-lex.l"
1150 #line 88 "ada-lex.l"
1155 #line 90 "ada-lex.l"
1157 canonicalizeNumeral (numbuf, yytext);
1158 return processInt (NULL, numbuf, strrchr(numbuf, 'e')+1);
1163 #line 95 "ada-lex.l"
1165 canonicalizeNumeral (numbuf, yytext);
1166 return processInt (NULL, numbuf, NULL);
1171 #line 100 "ada-lex.l"
1173 canonicalizeNumeral (numbuf, yytext);
1174 return processInt (numbuf,
1175 strchr (numbuf, '#') + 1,
1176 strrchr(numbuf, '#') + 1);
1181 #line 107 "ada-lex.l"
1183 canonicalizeNumeral (numbuf, yytext);
1184 return processInt (numbuf, strchr (numbuf, '#') + 1, NULL);
1189 #line 112 "ada-lex.l"
1191 canonicalizeNumeral (numbuf, yytext+2);
1192 return processInt ("16#", numbuf, NULL);
1197 #line 118 "ada-lex.l"
1199 canonicalizeNumeral (numbuf, yytext);
1200 return processReal (numbuf);
1205 #line 123 "ada-lex.l"
1207 canonicalizeNumeral (numbuf, yytext);
1208 return processReal (numbuf);
1213 #line 128 "ada-lex.l"
1215 error (_("Based real literals not implemented yet."));
1220 #line 132 "ada-lex.l"
1222 error (_("Based real literals not implemented yet."));
1227 #line 136 "ada-lex.l"
1229 yylval.typed_val.type = type_char ();
1230 yylval.typed_val.val = yytext[1];
1236 #line 142 "ada-lex.l"
1239 yylval.typed_val.type = type_char ();
1240 sscanf (yytext+3, "%2x", &v);
1241 yylval.typed_val.val = v;
1247 #line 150 "ada-lex.l"
1249 yylval.sval = processString (yytext+1, yyleng-2);
1255 #line 155 "ada-lex.l"
1257 error (_("ill-formed or non-terminated string literal"));
1262 #line 160 "ada-lex.l"
1264 rewind_to_char ('i');
1270 #line 165 "ada-lex.l"
1272 rewind_to_char ('t');
1277 /* rule 18 can match eol */
1279 #line 170 "ada-lex.l"
1281 /* This keyword signals the end of the expression and
1282 will be processed separately. */
1283 rewind_to_char ('t');
1290 #line 179 "ada-lex.l"
1295 #line 180 "ada-lex.l"
1300 #line 181 "ada-lex.l"
1305 #line 182 "ada-lex.l"
1310 #line 183 "ada-lex.l"
1315 #line 184 "ada-lex.l"
1320 #line 185 "ada-lex.l"
1325 #line 186 "ada-lex.l"
1326 { return NULL_PTR; }
1330 #line 187 "ada-lex.l"
1335 #line 188 "ada-lex.l"
1340 #line 189 "ada-lex.l"
1345 #line 190 "ada-lex.l"
1350 #line 191 "ada-lex.l"
1353 /* BOOLEAN "KEYWORDS" */
1354 /* True and False are not keywords in Ada, but rather enumeration constants.
1355 However, the boolean type is no longer represented as an enum, so True
1356 and False are no longer defined in symbol tables. We compromise by
1357 making them keywords (when bare). */
1360 #line 200 "ada-lex.l"
1361 { return TRUEKEYWORD; }
1365 #line 201 "ada-lex.l"
1366 { return FALSEKEYWORD; }
1370 /* rule 34 can match eol */
1372 #line 205 "ada-lex.l"
1373 { return processAttribute (yytext+1); }
1378 #line 209 "ada-lex.l"
1383 #line 210 "ada-lex.l"
1388 #line 211 "ada-lex.l"
1389 { return STARSTAR; }
1393 #line 212 "ada-lex.l"
1398 #line 213 "ada-lex.l"
1399 { return NOTEQUAL; }
1403 #line 214 "ada-lex.l"
1408 #line 215 "ada-lex.l"
1413 #line 217 "ada-lex.l"
1414 { BEGIN INITIAL; return '\''; }
1418 #line 219 "ada-lex.l"
1419 { return yytext[0]; }
1423 #line 221 "ada-lex.l"
1424 { if (paren_depth == 0 && comma_terminates)
1426 rewind_to_char (',');
1435 #line 230 "ada-lex.l"
1436 { paren_depth += 1; return '('; }
1440 #line 231 "ada-lex.l"
1441 { if (paren_depth == 0)
1443 rewind_to_char (')');
1454 /* rule 47 can match eol */
1456 #line 243 "ada-lex.l"
1460 /* rule 48 can match eol */
1462 #line 245 "ada-lex.l"
1464 yylval.sval = processId (yytext+1, yyleng-1);
1469 /* rule 49 can match eol */
1471 #line 250 "ada-lex.l"
1473 int all_posn = find_dot_all (yytext);
1475 if (all_posn == -1 && yytext[yyleng-1] == '\'')
1477 BEGIN BEFORE_QUAL_QUOTE;
1480 else if (all_posn >= 0)
1482 yylval.sval = processId (yytext, yyleng);
1486 /* GDB EXPRESSION CONSTRUCTS */
1488 /* rule 50 can match eol */
1490 #line 267 "ada-lex.l"
1492 yyless (yyleng - 2);
1493 yylval.sval = processId (yytext, yyleng);
1499 #line 273 "ada-lex.l"
1500 { return COLONCOLON; }
1504 #line 275 "ada-lex.l"
1505 { return yytext[0]; }
1507 /* REGISTERS AND GDB CONVENIENCE VARIABLES */
1510 #line 279 "ada-lex.l"
1512 yylval.sval.ptr = yytext;
1513 yylval.sval.length = yyleng;
1514 return SPECIAL_VARIABLE;
1517 /* CATCH-ALL ERROR CASE */
1520 #line 287 "ada-lex.l"
1521 { error (_("Invalid character '%s' in expression."), yytext); }
1525 #line 288 "ada-lex.l"
1526 YY_FATAL_ERROR( "flex scanner jammed" );
1528 #line 1529 "ada-lex.c"
1529 case YY_STATE_EOF(INITIAL):
1530 case YY_STATE_EOF(BEFORE_QUAL_QUOTE):
1533 case YY_END_OF_BUFFER:
1535 /* Amount of text matched not including the EOB char. */
1536 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1538 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1539 *yy_cp = (yy_hold_char);
1540 YY_RESTORE_YY_MORE_OFFSET
1542 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1544 /* We're scanning a new file or input source. It's
1545 * possible that this happened because the user
1546 * just pointed yyin at a new source and called
1547 * yylex(). If so, then we have to assure
1548 * consistency between YY_CURRENT_BUFFER and our
1549 * globals. Here is the right place to do so, because
1550 * this is the first action (other than possibly a
1551 * back-up) that will match for the new input source.
1553 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1554 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1555 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1558 /* Note that here we test for yy_c_buf_p "<=" to the position
1559 * of the first EOB in the buffer, since yy_c_buf_p will
1560 * already have been incremented past the NUL character
1561 * (since all states make transitions on EOB to the
1562 * end-of-buffer state). Contrast this with the test
1565 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1566 { /* This was really a NUL. */
1567 yy_state_type yy_next_state;
1569 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1571 yy_current_state = yy_get_previous_state( );
1573 /* Okay, we're now positioned to make the NUL
1574 * transition. We couldn't have
1575 * yy_get_previous_state() go ahead and do it
1576 * for us because it doesn't know how to deal
1577 * with the possibility of jamming (and we don't
1578 * want to build jamming into it because then it
1579 * will run more slowly).
1582 yy_next_state = yy_try_NUL_trans( yy_current_state );
1584 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1586 if ( yy_next_state )
1588 /* Consume the NUL. */
1589 yy_cp = ++(yy_c_buf_p);
1590 yy_current_state = yy_next_state;
1596 yy_cp = (yy_c_buf_p);
1597 goto yy_find_action;
1601 else switch ( yy_get_next_buffer( ) )
1603 case EOB_ACT_END_OF_FILE:
1605 (yy_did_buffer_switch_on_eof) = 0;
1609 /* Note: because we've taken care in
1610 * yy_get_next_buffer() to have set up
1611 * yytext, we can now set up
1612 * yy_c_buf_p so that if some total
1613 * hoser (like flex itself) wants to
1614 * call the scanner after we return the
1615 * YY_NULL, it'll still work - another
1616 * YY_NULL will get returned.
1618 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1620 yy_act = YY_STATE_EOF(YY_START);
1626 if ( ! (yy_did_buffer_switch_on_eof) )
1632 case EOB_ACT_CONTINUE_SCAN:
1634 (yytext_ptr) + yy_amount_of_matched_text;
1636 yy_current_state = yy_get_previous_state( );
1638 yy_cp = (yy_c_buf_p);
1639 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1642 case EOB_ACT_LAST_MATCH:
1644 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1646 yy_current_state = yy_get_previous_state( );
1648 yy_cp = (yy_c_buf_p);
1649 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1650 goto yy_find_action;
1657 "fatal flex scanner internal error--no action found" );
1658 } /* end of action switch */
1659 } /* end of scanning one token */
1660 } /* end of yylex */
1662 /* yy_get_next_buffer - try to read in a new buffer
1664 * Returns a code representing an action:
1665 * EOB_ACT_LAST_MATCH -
1666 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1667 * EOB_ACT_END_OF_FILE - end of file
1669 static int yy_get_next_buffer (void)
1671 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1672 register char *source = (yytext_ptr);
1673 register int number_to_move, i;
1676 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1678 "fatal flex scanner internal error--end of buffer missed" );
1680 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1681 { /* Don't try to fill the buffer, so this is an EOF. */
1682 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1684 /* We matched a single character, the EOB, so
1685 * treat this as a final EOF.
1687 return EOB_ACT_END_OF_FILE;
1692 /* We matched some text prior to the EOB, first
1695 return EOB_ACT_LAST_MATCH;
1699 /* Try to read more data. */
1701 /* First move last chars to start of buffer. */
1702 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1704 for ( i = 0; i < number_to_move; ++i )
1705 *(dest++) = *(source++);
1707 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1708 /* don't do the read, it's not guaranteed to return an EOF,
1711 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1716 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1718 while ( num_to_read <= 0 )
1719 { /* Not enough room in the buffer - grow it. */
1721 /* just a shorter name for the current buffer */
1722 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1724 int yy_c_buf_p_offset =
1725 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1727 if ( b->yy_is_our_buffer )
1729 int new_size = b->yy_buf_size * 2;
1731 if ( new_size <= 0 )
1732 b->yy_buf_size += b->yy_buf_size / 8;
1734 b->yy_buf_size *= 2;
1736 b->yy_ch_buf = (char *)
1737 /* Include room in for 2 EOB chars. */
1738 yyxrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1741 /* Can't grow it, we don't own it. */
1744 if ( ! b->yy_ch_buf )
1746 "fatal error - scanner input buffer overflow" );
1748 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1750 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1755 if ( num_to_read > YY_READ_BUF_SIZE )
1756 num_to_read = YY_READ_BUF_SIZE;
1758 /* Read in more data. */
1759 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1760 (yy_n_chars), (size_t) num_to_read );
1762 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1765 if ( (yy_n_chars) == 0 )
1767 if ( number_to_move == YY_MORE_ADJ )
1769 ret_val = EOB_ACT_END_OF_FILE;
1775 ret_val = EOB_ACT_LAST_MATCH;
1776 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1777 YY_BUFFER_EOF_PENDING;
1782 ret_val = EOB_ACT_CONTINUE_SCAN;
1784 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1785 /* Extend the array by 50%, plus the number we really need. */
1786 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1787 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyxrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1788 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1789 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1792 (yy_n_chars) += number_to_move;
1793 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1794 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1796 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1801 /* yy_get_previous_state - get the state just before the EOB char was reached */
1803 static yy_state_type yy_get_previous_state (void)
1805 register yy_state_type yy_current_state;
1806 register char *yy_cp;
1808 yy_current_state = (yy_start);
1810 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1812 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1813 if ( yy_accept[yy_current_state] )
1815 (yy_last_accepting_state) = yy_current_state;
1816 (yy_last_accepting_cpos) = yy_cp;
1818 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1820 yy_current_state = (int) yy_def[yy_current_state];
1821 if ( yy_current_state >= 207 )
1822 yy_c = yy_meta[(unsigned int) yy_c];
1824 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1827 return yy_current_state;
1830 /* yy_try_NUL_trans - try to make a transition on the NUL character
1833 * next_state = yy_try_NUL_trans( current_state );
1835 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1837 register int yy_is_jam;
1838 register char *yy_cp = (yy_c_buf_p);
1840 register YY_CHAR yy_c = 1;
1841 if ( yy_accept[yy_current_state] )
1843 (yy_last_accepting_state) = yy_current_state;
1844 (yy_last_accepting_cpos) = yy_cp;
1846 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1848 yy_current_state = (int) yy_def[yy_current_state];
1849 if ( yy_current_state >= 207 )
1850 yy_c = yy_meta[(unsigned int) yy_c];
1852 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1853 yy_is_jam = (yy_current_state == 206);
1855 return yy_is_jam ? 0 : yy_current_state;
1858 static void yyunput (int c, register char * yy_bp )
1860 register char *yy_cp;
1862 yy_cp = (yy_c_buf_p);
1864 /* undo effects of setting up yytext */
1865 *yy_cp = (yy_hold_char);
1867 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1868 { /* need to shift things up to make room */
1869 /* +2 for EOB chars. */
1870 register int number_to_move = (yy_n_chars) + 2;
1871 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1872 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1873 register char *source =
1874 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1876 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1877 *--dest = *--source;
1879 yy_cp += (int) (dest - source);
1880 yy_bp += (int) (dest - source);
1881 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1882 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1884 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1885 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1888 *--yy_cp = (char) c;
1890 (yytext_ptr) = yy_bp;
1891 (yy_hold_char) = *yy_cp;
1892 (yy_c_buf_p) = yy_cp;
1897 static int yyinput (void)
1899 static int input (void)
1905 *(yy_c_buf_p) = (yy_hold_char);
1907 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1909 /* yy_c_buf_p now points to the character we want to return.
1910 * If this occurs *before* the EOB characters, then it's a
1911 * valid NUL; if not, then we've hit the end of the buffer.
1913 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1914 /* This was really a NUL. */
1915 *(yy_c_buf_p) = '\0';
1918 { /* need more input */
1919 int offset = (yy_c_buf_p) - (yytext_ptr);
1922 switch ( yy_get_next_buffer( ) )
1924 case EOB_ACT_LAST_MATCH:
1925 /* This happens because yy_g_n_b()
1926 * sees that we've accumulated a
1927 * token and flags that we need to
1928 * try matching the token before
1929 * proceeding. But for input(),
1930 * there's no matching to consider.
1931 * So convert the EOB_ACT_LAST_MATCH
1932 * to EOB_ACT_END_OF_FILE.
1935 /* Reset buffer status. */
1940 case EOB_ACT_END_OF_FILE:
1945 if ( ! (yy_did_buffer_switch_on_eof) )
1954 case EOB_ACT_CONTINUE_SCAN:
1955 (yy_c_buf_p) = (yytext_ptr) + offset;
1961 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1962 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1963 (yy_hold_char) = *++(yy_c_buf_p);
1967 #endif /* ifndef YY_NO_INPUT */
1969 /** Immediately switch to a different input stream.
1970 * @param input_file A readable stream.
1972 * @note This function does not reset the start condition to @c INITIAL .
1974 void yyrestart (FILE * input_file )
1977 if ( ! YY_CURRENT_BUFFER ){
1978 yyensure_buffer_stack ();
1979 YY_CURRENT_BUFFER_LVALUE =
1980 yy_create_buffer(yyin,YY_BUF_SIZE );
1983 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1984 yy_load_buffer_state( );
1987 /** Switch to a different input buffer.
1988 * @param new_buffer The new input buffer.
1991 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1994 /* TODO. We should be able to replace this entire function body
1996 * yypop_buffer_state();
1997 * yypush_buffer_state(new_buffer);
1999 yyensure_buffer_stack ();
2000 if ( YY_CURRENT_BUFFER == new_buffer )
2003 if ( YY_CURRENT_BUFFER )
2005 /* Flush out information for old buffer. */
2006 *(yy_c_buf_p) = (yy_hold_char);
2007 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2008 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2011 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2012 yy_load_buffer_state( );
2014 /* We don't actually know whether we did this switch during
2015 * EOF (yywrap()) processing, but the only time this flag
2016 * is looked at is after yywrap() is called, so it's safe
2017 * to go ahead and always set it.
2019 (yy_did_buffer_switch_on_eof) = 1;
2022 static void yy_load_buffer_state (void)
2024 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2025 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2026 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2027 (yy_hold_char) = *(yy_c_buf_p);
2030 /** Allocate and initialize an input buffer state.
2031 * @param file A readable stream.
2032 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2034 * @return the allocated buffer state.
2036 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2040 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2042 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2044 b->yy_buf_size = size;
2046 /* yy_ch_buf has to be 2 characters longer than the size given because
2047 * we need to put in 2 end-of-buffer characters.
2049 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
2050 if ( ! b->yy_ch_buf )
2051 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2053 b->yy_is_our_buffer = 1;
2055 yy_init_buffer(b,file );
2060 /** Destroy the buffer.
2061 * @param b a buffer created with yy_create_buffer()
2064 void yy_delete_buffer (YY_BUFFER_STATE b )
2070 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2071 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2073 if ( b->yy_is_our_buffer )
2074 yyfree((void *) b->yy_ch_buf );
2076 yyfree((void *) b );
2080 extern int isatty (int );
2081 #endif /* __cplusplus */
2083 /* Initializes or reinitializes a buffer.
2084 * This function is sometimes called more than once on the same buffer,
2085 * such as during a yyrestart() or at EOF.
2087 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2092 yy_flush_buffer(b );
2094 b->yy_input_file = file;
2095 b->yy_fill_buffer = 1;
2097 /* If b is the current buffer, then yy_init_buffer was _probably_
2098 * called from yyrestart() or through yy_get_next_buffer.
2099 * In that case, we don't want to reset the lineno or column.
2101 if (b != YY_CURRENT_BUFFER){
2102 b->yy_bs_lineno = 1;
2103 b->yy_bs_column = 0;
2106 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2111 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2112 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2115 void yy_flush_buffer (YY_BUFFER_STATE b )
2122 /* We always need two end-of-buffer characters. The first causes
2123 * a transition to the end-of-buffer state. The second causes
2124 * a jam in that state.
2126 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2127 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2129 b->yy_buf_pos = &b->yy_ch_buf[0];
2132 b->yy_buffer_status = YY_BUFFER_NEW;
2134 if ( b == YY_CURRENT_BUFFER )
2135 yy_load_buffer_state( );
2138 /** Pushes the new state onto the stack. The new state becomes
2139 * the current state. This function will allocate the stack
2141 * @param new_buffer The new state.
2144 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2146 if (new_buffer == NULL)
2149 yyensure_buffer_stack();
2151 /* This block is copied from yy_switch_to_buffer. */
2152 if ( YY_CURRENT_BUFFER )
2154 /* Flush out information for old buffer. */
2155 *(yy_c_buf_p) = (yy_hold_char);
2156 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2157 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2160 /* Only push if top exists. Otherwise, replace top. */
2161 if (YY_CURRENT_BUFFER)
2162 (yy_buffer_stack_top)++;
2163 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2165 /* copied from yy_switch_to_buffer. */
2166 yy_load_buffer_state( );
2167 (yy_did_buffer_switch_on_eof) = 1;
2170 /** Removes and deletes the top of the stack, if present.
2171 * The next element becomes the new top.
2174 void yypop_buffer_state (void)
2176 if (!YY_CURRENT_BUFFER)
2179 yy_delete_buffer(YY_CURRENT_BUFFER );
2180 YY_CURRENT_BUFFER_LVALUE = NULL;
2181 if ((yy_buffer_stack_top) > 0)
2182 --(yy_buffer_stack_top);
2184 if (YY_CURRENT_BUFFER) {
2185 yy_load_buffer_state( );
2186 (yy_did_buffer_switch_on_eof) = 1;
2190 /* Allocates the stack if it does not exist.
2191 * Guarantees space for at least one push.
2193 static void yyensure_buffer_stack (void)
2197 if (!(yy_buffer_stack)) {
2199 /* First allocation is just for 2 elements, since we don't know if this
2200 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2201 * immediate xrealloc on the next call.
2204 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2205 (num_to_alloc * sizeof(struct yy_buffer_state*)
2207 if ( ! (yy_buffer_stack) )
2208 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2210 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2212 (yy_buffer_stack_max) = num_to_alloc;
2213 (yy_buffer_stack_top) = 0;
2217 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2219 /* Increase the buffer to prepare for a possible push. */
2220 int grow_size = 8 /* arbitrary grow size */;
2222 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2223 (yy_buffer_stack) = (struct yy_buffer_state**)yyxrealloc
2225 num_to_alloc * sizeof(struct yy_buffer_state*)
2227 if ( ! (yy_buffer_stack) )
2228 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2230 /* zero only the new slots.*/
2231 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2232 (yy_buffer_stack_max) = num_to_alloc;
2236 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2237 * @param base the character buffer
2238 * @param size the size in bytes of the character buffer
2240 * @return the newly allocated buffer state object.
2242 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2247 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2248 base[size-1] != YY_END_OF_BUFFER_CHAR )
2249 /* They forgot to leave room for the EOB's. */
2252 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2254 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2256 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2257 b->yy_buf_pos = b->yy_ch_buf = base;
2258 b->yy_is_our_buffer = 0;
2259 b->yy_input_file = 0;
2260 b->yy_n_chars = b->yy_buf_size;
2261 b->yy_is_interactive = 0;
2263 b->yy_fill_buffer = 0;
2264 b->yy_buffer_status = YY_BUFFER_NEW;
2266 yy_switch_to_buffer(b );
2271 /** Setup the input buffer state to scan a string. The next call to yylex() will
2272 * scan from a @e copy of @a str.
2273 * @param yystr a NUL-terminated string to scan
2275 * @return the newly allocated buffer state object.
2276 * @note If you want to scan bytes that may contain NUL values, then use
2277 * yy_scan_bytes() instead.
2279 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2282 return yy_scan_bytes(yystr,strlen(yystr) );
2285 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2286 * scan from a @e copy of @a bytes.
2287 * @param bytes the byte buffer to scan
2288 * @param len the number of bytes in the buffer pointed to by @a bytes.
2290 * @return the newly allocated buffer state object.
2292 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
2299 /* Get memory for full buffer, including space for trailing EOB's. */
2300 n = _yybytes_len + 2;
2301 buf = (char *) yyalloc(n );
2303 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2305 for ( i = 0; i < _yybytes_len; ++i )
2306 buf[i] = yybytes[i];
2308 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2310 b = yy_scan_buffer(buf,n );
2312 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2314 /* It's okay to grow etc. this buffer, and we should throw it
2315 * away when we're done.
2317 b->yy_is_our_buffer = 1;
2322 #ifndef YY_EXIT_FAILURE
2323 #define YY_EXIT_FAILURE 2
2326 static void yy_fatal_error (yyconst char* msg )
2328 (void) fprintf( stderr, "%s\n", msg );
2329 exit( YY_EXIT_FAILURE );
2332 /* Redefine yyless() so it works in section 3 code. */
2338 /* Undo effects of setting up yytext. */ \
2339 int yyless_macro_arg = (n); \
2340 YY_LESS_LINENO(yyless_macro_arg);\
2341 yytext[yyleng] = (yy_hold_char); \
2342 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2343 (yy_hold_char) = *(yy_c_buf_p); \
2344 *(yy_c_buf_p) = '\0'; \
2345 yyleng = yyless_macro_arg; \
2349 /* Accessor methods (get/set functions) to struct members. */
2351 /** Get the current line number.
2354 int yyget_lineno (void)
2360 /** Get the input stream.
2363 FILE *yyget_in (void)
2368 /** Get the output stream.
2371 FILE *yyget_out (void)
2376 /** Get the length of the current token.
2379 int yyget_leng (void)
2384 /** Get the current token.
2388 char *yyget_text (void)
2393 /** Set the current line number.
2394 * @param line_number
2397 void yyset_lineno (int line_number )
2400 yylineno = line_number;
2403 /** Set the input stream. This does not discard the current
2405 * @param in_str A readable stream.
2407 * @see yy_switch_to_buffer
2409 void yyset_in (FILE * in_str )
2414 void yyset_out (FILE * out_str )
2419 int yyget_debug (void)
2421 return yy_flex_debug;
2424 void yyset_debug (int bdebug )
2426 yy_flex_debug = bdebug ;
2429 static int yy_init_globals (void)
2431 /* Initialization is the same as for the non-reentrant scanner.
2432 * This function is called from yylex_destroy(), so don't allocate here.
2435 (yy_buffer_stack) = 0;
2436 (yy_buffer_stack_top) = 0;
2437 (yy_buffer_stack_max) = 0;
2438 (yy_c_buf_p) = (char *) 0;
2442 /* Defined in main.c */
2451 /* For future reference: Set errno on error, since we are called by
2457 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2458 int yylex_destroy (void)
2461 /* Pop the buffer stack, destroying each element. */
2462 while(YY_CURRENT_BUFFER){
2463 yy_delete_buffer(YY_CURRENT_BUFFER );
2464 YY_CURRENT_BUFFER_LVALUE = NULL;
2465 yypop_buffer_state();
2468 /* Destroy the stack itself. */
2469 yyfree((yy_buffer_stack) );
2470 (yy_buffer_stack) = NULL;
2472 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2473 * yylex() is called, initialization will occur. */
2480 * Internal utility routines.
2484 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2487 for ( i = 0; i < n; ++i )
2492 #ifdef YY_NEED_STRLEN
2493 static int yy_flex_strlen (yyconst char * s )
2496 for ( n = 0; s[n]; ++n )
2503 void *yyalloc (yy_size_t size )
2505 return (void *) xmalloc( size );
2508 void *yyxrealloc (void * ptr, yy_size_t size )
2510 /* The cast to (char *) in the following accommodates both
2511 * implementations that use char* generic pointers, and those
2512 * that use void* generic pointers. It works with the latter
2513 * because both ANSI C and C++ allow castless assignment from
2514 * any pointer type to void*, and deal with argument conversions
2515 * as though doing an assignment.
2517 return (void *) xrealloc( (char *) ptr, size );
2520 void yyfree (void * ptr )
2522 xfree( (char *) ptr ); /* see yyxrealloc() for (char *) cast */
2525 #define YYTABLES_NAME "yytables"
2527 #line 288 "ada-lex.l"
2532 #include "gdb_string.h"
2534 /* Initialize the lexer for processing new expression. */
2537 lexer_init (FILE *inp)
2544 /* Copy S2 to S1, removing all underscores, and downcasing all letters. */
2547 canonicalizeNumeral (char *s1, const char *s2)
2549 for (; *s2 != '\000'; s2 += 1)
2560 /* Interprets the prefix of NUM that consists of digits of the given BASE
2561 as an integer of that BASE, with the string EXP as an exponent.
2562 Puts value in yylval, and returns INT, if the string is valid. Causes
2563 an error if the number is improperly formated. BASE, if NULL, defaults
2564 to "10", and EXP to "1". The EXP does not contain a leading 'e' or 'E'.
2568 processInt (const char *base0, const char *num0, const char *exp0)
2580 base = strtol (base0, (char **) NULL, 10);
2581 if (base < 2 || base > 16)
2582 error (_("Invalid base: %d."), base);
2588 exp = strtol(exp0, (char **) NULL, 10);
2591 result = strtoulst (num0, (const char **) &trailer, base);
2592 if (errno == ERANGE)
2593 error (_("Integer literal out of range"));
2594 if (isxdigit(*trailer))
2595 error (_("Invalid digit `%c' in based literal"), *trailer);
2599 if (result > (ULONG_MAX / base))
2600 error (_("Integer literal out of range"));
2605 if ((result >> (gdbarch_int_bit (parse_gdbarch)-1)) == 0)
2606 yylval.typed_val.type = type_int ();
2607 else if ((result >> (gdbarch_long_bit (parse_gdbarch)-1)) == 0)
2608 yylval.typed_val.type = type_long ();
2609 else if (((result >> (gdbarch_long_bit (parse_gdbarch)-1)) >> 1) == 0)
2611 /* We have a number representable as an unsigned integer quantity.
2612 For consistency with the C treatment, we will treat it as an
2613 anonymous modular (unsigned) quantity. Alas, the types are such
2614 that we need to store .val as a signed quantity. Sorry
2615 for the mess, but C doesn't officially guarantee that a simple
2616 assignment does the trick (no, it doesn't; read the reference manual).
2618 yylval.typed_val.type
2619 = builtin_type (parse_gdbarch)->builtin_unsigned_long;
2620 if (result & LONGEST_SIGN)
2621 yylval.typed_val.val =
2622 (LONGEST) (result & ~LONGEST_SIGN)
2623 - (LONGEST_SIGN>>1) - (LONGEST_SIGN>>1);
2625 yylval.typed_val.val = (LONGEST) result;
2629 yylval.typed_val.type = type_long_long ();
2631 yylval.typed_val.val = (LONGEST) result;
2636 processReal (const char *num0)
2638 sscanf (num0, "%" DOUBLEST_SCAN_FORMAT, &yylval.typed_val_float.dval);
2640 yylval.typed_val_float.type = type_float ();
2641 if (sizeof(DOUBLEST) >= gdbarch_double_bit (parse_gdbarch)
2643 yylval.typed_val_float.type = type_double ();
2644 if (sizeof(DOUBLEST) >= gdbarch_long_double_bit (parse_gdbarch)
2646 yylval.typed_val_float.type = type_long_double ();
2652 /* Store a canonicalized version of NAME0[0..LEN-1] in yylval.ssym. The
2653 resulting string is valid until the next call to ada_parse. If
2654 NAME0 contains the substring "___", it is assumed to be already
2655 encoded and the resulting name is equal to it. Otherwise, it differs
2657 + Characters between '...' or <...> are transfered verbatim to
2659 + <, >, and trailing "'" characters in quoted sequences are removed
2660 (a leading quote is preserved to indicate that the name is not to be
2662 + Unquoted whitespace is removed.
2663 + Unquoted alphabetic characters are mapped to lower case.
2664 Result is returned as a struct stoken, but for convenience, the string
2665 is also null-terminated. Result string valid until the next call of
2668 static struct stoken
2669 processId (const char *name0, int len)
2671 char *name = obstack_alloc (&temp_parse_space, len + 11);
2673 struct stoken result;
2676 while (len > 0 && isspace (name0[len-1]))
2679 if (strstr (name0, "___") != NULL)
2681 strncpy (name, name0, len);
2683 result.length = len;
2690 if (isalnum (name0[i0]))
2692 name[i] = tolower (name0[i0]);
2695 else switch (name0[i0])
2698 name[i] = name0[i0];
2701 case ' ': case '\t':
2707 name[i] = name0[i0];
2710 while (i0 < len && name0[i0] != '\'');
2715 while (i0 < len && name0[i0] != '>')
2717 name[i] = name0[i0];
2730 /* Return TEXT[0..LEN-1], a string literal without surrounding quotes,
2731 with special hex character notations replaced with characters.
2732 Result valid until the next call to ada_parse. */
2734 static struct stoken
2735 processString (const char *text, int len)
2739 const char *lim = text + len;
2740 struct stoken result;
2742 q = result.ptr = obstack_alloc (&temp_parse_space, len);
2746 if (p[0] == '[' && p[1] == '"' && p+2 < lim)
2748 if (p[2] == '"') /* "...["""]... */
2756 sscanf (p+2, "%2x", &chr);
2766 result.length = q - result.ptr;
2770 /* Returns the position within STR of the '.' in a
2771 '.{WHITE}*all' component of a dotted name, or -1 if there is none.
2772 Note: we actually don't need this routine, since 'all' can never be an
2773 Ada identifier. Thus, looking up foo.all or foo.all.x as a name
2774 must fail, and will eventually be interpreted as (foo).all or
2775 (foo).all.x. However, this does avoid an extraneous lookup. */
2778 find_dot_all (const char *str)
2781 for (i = 0; str[i] != '\000'; i += 1)
2788 while (isspace (str[i]));
2789 if (strncmp (str+i, "all", 3) == 0
2790 && ! isalnum (str[i+3]) && str[i+3] != '_')
2797 /* Returns non-zero iff string SUBSEQ matches a subsequence of STR, ignoring
2801 subseqMatch (const char *subseq, const char *str)
2803 if (subseq[0] == '\0')
2805 else if (str[0] == '\0')
2807 else if (tolower (subseq[0]) == tolower (str[0]))
2808 return subseqMatch (subseq+1, str+1) || subseqMatch (subseq, str+1);
2810 return subseqMatch (subseq, str+1);
2814 static struct { const char *name; int code; }
2816 { "address", TICK_ADDRESS },
2817 { "unchecked_access", TICK_ACCESS },
2818 { "unrestricted_access", TICK_ACCESS },
2819 { "access", TICK_ACCESS },
2820 { "first", TICK_FIRST },
2821 { "last", TICK_LAST },
2822 { "length", TICK_LENGTH },
2823 { "max", TICK_MAX },
2824 { "min", TICK_MIN },
2825 { "modulus", TICK_MODULUS },
2826 { "pos", TICK_POS },
2827 { "range", TICK_RANGE },
2828 { "size", TICK_SIZE },
2829 { "tag", TICK_TAG },
2830 { "val", TICK_VAL },
2834 /* Return the syntactic code corresponding to the attribute name or
2835 abbreviation STR. */
2838 processAttribute (const char *str)
2842 for (i = 0; attributes[i].code != -1; i += 1)
2843 if (strcasecmp (str, attributes[i].name) == 0)
2844 return attributes[i].code;
2846 for (i = 0, k = -1; attributes[i].code != -1; i += 1)
2847 if (subseqMatch (str, attributes[i].name))
2852 error (_("ambiguous attribute name: `%s'"), str);
2855 error (_("unrecognized attribute: `%s'"), str);
2857 return attributes[k].code;
2860 /* Back up lexptr by yyleng and then to the rightmost occurrence of
2861 character CH, case-folded (there must be one). WARNING: since
2862 lexptr points to the next input character that Flex has not yet
2863 transferred to its internal buffer, the use of this function
2864 depends on the assumption that Flex calls YY_INPUT only when it is
2865 logically necessary to do so (thus, there is no reading ahead
2866 farther than needed to identify the next token.) */
2869 rewind_to_char (int ch)
2872 while (toupper (*lexptr) != toupper (ch))
2883 /* Dummy definition to suppress warnings about unused static definitions. */
2884 typedef void (*dummy_function) ();
2885 dummy_function ada_flex_use[] =
2887 (dummy_function) yyunput