2 /* A lexical scanner generated by flex */
4 /* Scanner skeleton version:
5 * $Header: /pub/NetBSD/misc/repositories/cvsroot/src/gnu/dist/gdb6/gdb/ada-lex.c,v 1.1.1.2 2006/07/02 20:15:35 nathanw Exp $
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
16 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
28 /* Use prototypes in function declarations. */
31 /* The "const" storage-class-modifier is valid. */
34 #else /* ! __cplusplus */
42 #endif /* ! __cplusplus */
61 #define YY_PROTO(proto) proto
63 #define YY_PROTO(proto) ()
66 /* Returned upon end-of-file. */
69 /* Promotes a possibly negative, possibly signed char to an unsigned
70 * integer for use as an array index. If the signed char is negative,
71 * we want to instead treat it as an 8-bit unsigned char, hence the
74 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
76 /* Enter a start condition. This macro really ought to take a parameter,
77 * but we do it the disgusting crufty way forced on us by the ()-less
78 * definition of BEGIN.
80 #define BEGIN yy_start = 1 + 2 *
82 /* Translate the current start state into a value that can be later handed
83 * to BEGIN to return to the state. The YYSTATE alias is for lex
86 #define YY_START ((yy_start - 1) / 2)
87 #define YYSTATE YY_START
89 /* Action number for EOF rule of a given start state. */
90 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
92 /* Special action meaning "start processing a new file". */
93 #define YY_NEW_FILE yyrestart( yyin )
95 #define YY_END_OF_BUFFER_CHAR 0
97 /* Size of default input buffer. */
98 #define YY_BUF_SIZE 16384
100 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
103 extern FILE *yyin
, *yyout
;
105 #define EOB_ACT_CONTINUE_SCAN 0
106 #define EOB_ACT_END_OF_FILE 1
107 #define EOB_ACT_LAST_MATCH 2
109 /* The funky do-while in the following #define is used to turn the definition
110 * int a single C statement (which needs a semi-colon terminator). This
111 * avoids problems with code like:
113 * if ( condition_holds )
116 * do_something_else();
118 * Prior to using the do-while the compiler would get upset at the
119 * "else" because it interpreted the "if" statement as being all
120 * done when it reached the ';' after the yyless() call.
123 /* Return all but the first 'n' matched characters back to the input stream. */
128 /* Undo effects of setting up yytext. */ \
129 *yy_cp = yy_hold_char; \
130 YY_RESTORE_YY_MORE_OFFSET \
131 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
132 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
136 #define unput(c) yyunput( c, yytext_ptr )
138 /* The following is because we cannot portably get our hands on size_t
139 * (without autoconf's help, which isn't available because we want
140 * flex-generated scanners to compile on their own).
142 typedef unsigned int yy_size_t
;
145 struct yy_buffer_state
149 char *yy_ch_buf
; /* input buffer */
150 char *yy_buf_pos
; /* current position in input buffer */
152 /* Size of input buffer in bytes, not including room for EOB
155 yy_size_t yy_buf_size
;
157 /* Number of characters read into yy_ch_buf, not including EOB
162 /* Whether we "own" the buffer - i.e., we know we created it,
163 * and can xrealloc() it to grow it, and should free() it to
166 int yy_is_our_buffer
;
168 /* Whether this is an "interactive" input source; if so, and
169 * if we're using stdio for input, then we want to use getc()
170 * instead of fread(), to make sure we stop fetching input after
173 int yy_is_interactive
;
175 /* Whether we're considered to be at the beginning of a line.
176 * If so, '^' rules will be active on the next match, otherwise
181 /* Whether to try to fill the input buffer when we reach the
186 int yy_buffer_status
;
187 #define YY_BUFFER_NEW 0
188 #define YY_BUFFER_NORMAL 1
189 /* When an EOF's been seen but there's still some text to process
190 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
191 * shouldn't try reading from the input source any more. We might
192 * still have a bunch of tokens to match, though, because of
193 * possible backing-up.
195 * When we actually see the EOF, we change the status to "new"
196 * (via yyrestart()), so that the user can continue scanning by
197 * just pointing yyin at a new input file.
199 #define YY_BUFFER_EOF_PENDING 2
202 static YY_BUFFER_STATE yy_current_buffer
= 0;
204 /* We provide macros for accessing buffer states in case in the
205 * future we want to put the buffer states in a more general
208 #define YY_CURRENT_BUFFER yy_current_buffer
211 /* yy_hold_char holds the character lost when yytext is formed. */
212 static char yy_hold_char
;
214 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
219 /* Points to current character in buffer. */
220 static char *yy_c_buf_p
= (char *) 0;
221 static int yy_init
= 1; /* whether we need to initialize */
222 static int yy_start
= 0; /* start state number */
224 /* Flag which is used to allow yywrap()'s to do buffer switches
225 * instead of setting up a fresh yyin. A bit of a hack ...
227 static int yy_did_buffer_switch_on_eof
;
229 void yyrestart
YY_PROTO(( FILE *input_file
));
231 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
232 void yy_load_buffer_state
YY_PROTO(( void ));
233 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
234 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
235 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
236 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
237 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
239 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
240 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
241 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
243 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
244 static void *yyxrealloc
YY_PROTO(( void *, yy_size_t
));
245 static void yy_flex_free
YY_PROTO(( void * ));
247 #define yy_new_buffer yy_create_buffer
249 #define yy_set_interactive(is_interactive) \
251 if ( ! yy_current_buffer ) \
252 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
253 yy_current_buffer->yy_is_interactive = is_interactive; \
256 #define yy_set_bol(at_bol) \
258 if ( ! yy_current_buffer ) \
259 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
260 yy_current_buffer->yy_at_bol = at_bol; \
263 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
265 typedef unsigned char YY_CHAR
;
266 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
267 typedef int yy_state_type
;
269 #define yytext_ptr yytext
271 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
272 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
273 static int yy_get_next_buffer
YY_PROTO(( void ));
274 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
276 /* Done after the current pattern has been matched and before the
277 * corresponding action - sets up yytext.
279 #define YY_DO_BEFORE_ACTION \
280 yytext_ptr = yy_bp; \
281 yyleng = (int) (yy_cp - yy_bp); \
282 yy_hold_char = *yy_cp; \
286 #define YY_NUM_RULES 51
287 #define YY_END_OF_BUFFER 52
288 static yyconst
short int yy_accept
[182] =
290 0, 0, 0, 0, 52, 50, 1, 1, 15, 49,
291 39, 50, 41, 42, 39, 40, 39, 39, 39, 4,
292 4, 39, 39, 39, 39, 48, 45, 45, 45, 45,
293 45, 45, 45, 45, 45, 45, 38, 0, 14, 0,
294 49, 0, 0, 0, 0, 0, 0, 0, 33, 2,
295 0, 32, 0, 44, 44, 35, 0, 0, 4, 0,
296 0, 47, 34, 36, 0, 31, 37, 0, 0, 45,
297 0, 45, 45, 45, 45, 16, 20, 45, 45, 45,
298 45, 25, 45, 45, 45, 45, 0, 14, 0, 12,
299 12, 0, 30, 2, 0, 44, 44, 0, 9, 0,
301 3, 7, 0, 45, 0, 0, 0, 45, 17, 18,
302 45, 21, 22, 23, 45, 45, 27, 45, 29, 0,
303 0, 0, 0, 0, 0, 44, 43, 6, 0, 0,
304 9, 0, 3, 0, 0, 0, 0, 0, 0, 0,
305 0, 0, 0, 0, 0, 45, 19, 24, 45, 28,
306 0, 46, 0, 0, 0, 0, 45, 0, 0, 0,
307 0, 0, 0, 0, 45, 0, 0, 5, 11, 0,
308 8, 26, 0, 5, 0, 8, 13, 0, 10, 10,
312 static yyconst
int yy_ec
[256] =
314 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
315 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
316 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
317 1, 4, 5, 6, 7, 8, 5, 9, 10, 11,
318 12, 13, 14, 15, 16, 17, 18, 19, 20, 20,
319 20, 20, 20, 20, 20, 20, 20, 21, 22, 23,
320 24, 25, 5, 26, 30, 31, 32, 33, 34, 35,
321 36, 37, 38, 36, 36, 39, 40, 41, 42, 36,
322 36, 43, 44, 45, 46, 36, 47, 48, 36, 36,
323 27, 5, 28, 5, 29, 5, 30, 31, 32, 33,
325 34, 35, 36, 37, 38, 36, 36, 39, 40, 41,
326 42, 36, 36, 43, 44, 45, 46, 36, 47, 48,
327 36, 36, 26, 22, 26, 5, 1, 1, 1, 1,
328 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
329 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
330 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
333 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
344 static yyconst
int yy_meta
[49] =
346 1, 2, 3, 4, 5, 6, 7, 8, 5, 9,
347 5, 5, 5, 5, 5, 5, 10, 5, 11, 11,
348 5, 5, 12, 13, 14, 5, 5, 5, 15, 16,
349 16, 16, 16, 16, 16, 17, 17, 17, 17, 17,
350 17, 17, 17, 17, 17, 17, 17, 17
353 static yyconst
short int yy_base
[203] =
355 0, 0, 575, 568, 573, 712, 712, 712, 43, 0,
356 712, 70, 712, 712, 559, 712, 554, 117, 544, 116,
357 122, 29, 543, 541, 541, 712, 52, 150, 20, 91,
358 26, 124, 118, 96, 107, 131, 191, 119, 712, 151,
359 0, 238, 554, 546, 545, 543, 54, 277, 712, 0,
360 324, 712, 0, 0, 495, 712, 0, 46, 323, 155,
361 0, 712, 712, 712, 508, 712, 712, 184, 241, 712,
362 330, 148, 215, 149, 216, 221, 222, 257, 258, 261,
363 262, 223, 224, 298, 263, 315, 522, 525, 346, 357,
364 712, 360, 511, 0, 485, 0, 469, 328, 343, 157,
366 345, 0, 479, 366, 382, 397, 0, 397, 340, 356,
367 378, 367, 385, 387, 392, 401, 393, 405, 410, 490,
368 0, 445, 450, 448, 431, 712, 0, 418, 0, 436,
369 435, 169, 441, 444, 118, 243, 331, 438, 432, 383,
370 375, 361, 362, 347, 357, 455, 443, 444, 445, 446,
371 338, 712, 345, 475, 337, 276, 488, 287, 267, 258,
372 221, 210, 141, 146, 462, 140, 383, 480, 109, 121,
373 482, 466, 42, 493, 359, 495, 514, 410, 500, 507,
374 712, 533, 543, 559, 564, 580, 597, 600, 607, 47,
375 512, 614, 630, 642, 648, 659, 661, 677, 514, 541,
380 static yyconst
short int yy_def
[203] =
382 181, 1, 1, 1, 181, 181, 181, 181, 182, 183,
383 181, 181, 181, 181, 181, 181, 181, 184, 181, 181,
384 181, 181, 185, 181, 181, 181, 186, 186, 28, 28,
385 28, 28, 28, 28, 28, 28, 181, 182, 181, 182,
386 183, 37, 37, 37, 42, 181, 42, 42, 181, 187,
387 184, 181, 188, 189, 189, 181, 190, 181, 181, 181,
388 191, 181, 181, 181, 192, 181, 181, 181, 181, 181,
389 193, 28, 28, 28, 28, 28, 28, 28, 28, 28,
390 28, 28, 28, 28, 28, 28, 48, 194, 181, 181,
391 181, 42, 48, 187, 195, 189, 189, 196, 181, 181,
393 181, 191, 192, 181, 193, 181, 197, 198, 28, 28,
394 28, 28, 28, 28, 28, 28, 28, 28, 28, 181,
395 199, 181, 181, 42, 195, 181, 189, 181, 200, 196,
396 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
397 181, 181, 181, 181, 201, 198, 28, 28, 28, 28,
398 181, 181, 42, 181, 202, 181, 181, 181, 181, 181,
399 181, 181, 181, 201, 28, 42, 181, 181, 181, 202,
400 181, 28, 42, 181, 181, 181, 181, 181, 181, 181,
401 0, 181, 181, 181, 181, 181, 181, 181, 181, 181,
402 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
407 static yyconst
short int yy_nxt
[761] =
409 6, 7, 8, 7, 6, 9, 6, 10, 11, 12,
410 13, 14, 15, 11, 16, 17, 18, 19, 20, 21,
411 22, 11, 23, 24, 25, 26, 11, 11, 27, 28,
412 27, 27, 27, 29, 27, 27, 27, 30, 27, 31,
413 32, 33, 34, 27, 35, 27, 27, 36, 39, 62,
414 72, 177, 63, 68, 68, 69, 72, 98, 75, 92,
415 72, 70, 98, 90, 99, 99, 72, 78, 71, 40,
416 42, 43, 43, 44, 45, 45, 45, 45, 45, 46,
417 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
418 45, 45, 45, 45, 45, 45, 47, 45, 45, 48,
420 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
421 48, 48, 48, 48, 48, 48, 48, 48, 51, 51,
422 51, 72, 57, 157, 39, 76, 72, 169, 57, 84,
423 134, 77, 58, 52, 59, 59, 72, 72, 58, 53,
424 59, 59, 175, 85, 59, 40, 55, 72, 72, 60,
425 59, 68, 68, 69, 72, 60, 88, 79, 72, 70,
426 82, 72, 83, 61, 72, 80, 71, 173, 100, 81,
427 157, 72, 86, 101, 101, 101, 101, 40, 72, 72,
428 73, 110, 156, 134, 156, 68, 68, 68, 72, 72,
429 74, 42, 43, 43, 43, 42, 42, 42, 42, 42,
431 71, 42, 42, 42, 42, 42, 42, 42, 42, 42,
432 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
433 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
434 87, 87, 87, 87, 87, 87, 87, 87, 87, 42,
435 42, 42, 68, 68, 69, 72, 72, 89, 157, 134,
436 70, 72, 72, 72, 72, 72, 72, 71, 109, 111,
437 116, 72, 72, 72, 72, 134, 134, 42, 42, 42,
438 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
439 42, 42, 42, 42, 42, 42, 90, 72, 72, 112,
440 134, 72, 72, 72, 171, 171, 118, 72, 72, 134,
442 115, 72, 72, 72, 113, 114, 93, 93, 93, 93,
443 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
444 93, 93, 93, 93, 93, 51, 51, 51, 72, 57,
445 134, 105, 105, 105, 128, 106, 157, 117, 72, 58,
446 181, 59, 59, 169, 129, 72, 53, 122, 122, 122,
447 166, 59, 107, 55, 134, 72, 60, 119, 122, 122,
448 122, 131, 131, 133, 133, 38, 123, 68, 68, 69,
449 72, 131, 178, 133, 178, 70, 132, 123, 124, 124,
450 72, 157, 71, 105, 105, 105, 72, 106, 163, 124,
451 124, 124, 124, 124, 124, 162, 72, 72, 68, 68,
453 69, 168, 168, 134, 107, 134, 70, 72, 72, 135,
454 134, 147, 134, 71, 136, 72, 161, 72, 72, 137,
455 134, 138, 72, 72, 160, 72, 139, 72, 179, 179,
456 148, 72, 72, 72, 149, 72, 140, 141, 142, 143,
457 72, 72, 128, 157, 144, 150, 122, 122, 122, 157,
458 72, 154, 129, 131, 131, 126, 68, 68, 69, 133,
459 133, 134, 158, 131, 70, 123, 153, 153, 132, 133,
460 152, 71, 159, 72, 72, 72, 72, 153, 153, 153,
461 153, 153, 153, 72, 72, 72, 72, 165, 167, 68,
462 68, 69, 72, 168, 168, 151, 72, 70, 174, 174,
464 176, 176, 72, 104, 71, 172, 72, 127, 174, 126,
465 176, 174, 174, 176, 176, 122, 122, 122, 180, 180,
466 89, 174, 102, 176, 120, 180, 180, 102, 180, 120,
467 120, 89, 104, 97, 123, 180, 38, 38, 38, 38,
468 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
469 41, 155, 91, 41, 90, 90, 155, 41, 41, 41,
470 54, 54, 54, 89, 67, 66, 64, 56, 54, 50,
471 54, 49, 181, 54, 54, 54, 65, 37, 65, 65,
472 65, 72, 72, 72, 37, 181, 181, 181, 72, 72,
473 72, 181, 181, 181, 72, 72, 72, 94, 94, 181,
475 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
476 94, 94, 94, 94, 95, 95, 95, 96, 181, 181,
477 181, 96, 96, 96, 103, 181, 181, 103, 103, 103,
478 103, 108, 108, 108, 181, 108, 181, 181, 181, 181,
479 181, 108, 181, 181, 108, 108, 108, 121, 181, 181,
480 181, 181, 121, 181, 181, 181, 181, 121, 125, 181,
481 181, 125, 125, 125, 125, 130, 181, 181, 130, 130,
482 181, 181, 181, 130, 130, 145, 145, 145, 146, 146,
483 146, 181, 181, 181, 181, 146, 146, 146, 181, 181,
484 181, 146, 146, 146, 164, 181, 181, 164, 164, 164,
486 164, 170, 181, 181, 181, 170, 181, 181, 181, 170,
487 170, 5, 181, 181, 181, 181, 181, 181, 181, 181,
488 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
489 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
490 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
491 181, 181, 181, 181, 181, 181, 181, 181, 181, 181
494 static yyconst
short int yy_chk
[761] =
496 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
497 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
498 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
499 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
500 1, 1, 1, 1, 1, 1, 1, 1, 9, 22,
501 29, 173, 22, 27, 27, 27, 31, 190, 29, 47,
502 29, 27, 190, 47, 58, 58, 31, 31, 27, 9,
503 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
504 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
505 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
507 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
508 12, 12, 12, 12, 12, 12, 12, 12, 18, 18,
509 18, 30, 20, 135, 38, 30, 34, 170, 21, 34,
510 135, 30, 20, 18, 20, 20, 34, 35, 21, 18,
511 21, 21, 169, 35, 20, 38, 18, 35, 33, 20,
512 21, 28, 28, 28, 32, 21, 40, 32, 33, 28,
513 33, 36, 33, 20, 32, 32, 28, 166, 60, 32,
514 164, 36, 36, 60, 60, 100, 100, 40, 72, 74,
515 28, 74, 132, 163, 132, 68, 68, 68, 72, 74,
516 28, 37, 37, 37, 37, 37, 37, 37, 37, 37,
518 68, 37, 37, 37, 37, 37, 37, 37, 37, 37,
519 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
520 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
521 37, 37, 37, 37, 37, 37, 37, 37, 37, 42,
522 42, 42, 69, 69, 69, 73, 75, 42, 136, 162,
523 69, 76, 77, 82, 83, 73, 75, 69, 73, 75,
524 83, 76, 77, 82, 83, 161, 136, 42, 42, 42,
525 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
526 42, 42, 42, 42, 42, 42, 48, 78, 79, 78,
527 160, 80, 81, 85, 156, 156, 85, 78, 79, 159,
529 81, 80, 81, 85, 79, 80, 48, 48, 48, 48,
530 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
531 48, 48, 48, 48, 48, 51, 51, 51, 84, 59,
532 158, 71, 71, 71, 98, 71, 137, 84, 84, 59,
533 51, 59, 59, 155, 98, 86, 51, 89, 89, 89,
534 153, 59, 71, 51, 137, 86, 59, 86, 90, 90,
535 90, 99, 99, 101, 101, 151, 89, 104, 104, 104,
536 109, 99, 175, 101, 175, 104, 99, 90, 92, 92,
537 109, 145, 104, 105, 105, 105, 110, 105, 144, 92,
538 92, 92, 92, 92, 92, 143, 110, 112, 108, 108,
540 108, 167, 167, 142, 105, 106, 108, 112, 111, 106,
541 106, 111, 106, 108, 106, 113, 141, 114, 111, 106,
542 106, 106, 115, 117, 140, 113, 106, 114, 178, 178,
543 115, 116, 115, 117, 116, 118, 106, 106, 106, 106,
544 119, 116, 130, 138, 106, 118, 122, 122, 122, 134,
545 119, 128, 130, 131, 131, 125, 146, 146, 146, 133,
546 133, 138, 139, 131, 146, 122, 124, 124, 131, 133,
547 123, 146, 139, 147, 148, 149, 150, 124, 124, 124,
548 124, 124, 124, 147, 148, 149, 150, 149, 154, 157,
549 157, 157, 165, 154, 154, 120, 172, 157, 168, 168,
551 171, 171, 165, 103, 157, 165, 172, 97, 168, 95,
552 171, 174, 174, 176, 176, 177, 177, 177, 179, 179,
553 93, 174, 191, 176, 199, 180, 180, 191, 179, 199,
554 88, 87, 65, 55, 177, 180, 182, 182, 182, 182,
555 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
556 183, 200, 46, 183, 45, 44, 200, 183, 183, 183,
557 184, 184, 184, 43, 25, 24, 23, 19, 184, 17,
558 184, 15, 5, 184, 184, 184, 185, 4, 185, 185,
559 185, 186, 186, 186, 3, 0, 0, 0, 186, 186,
560 186, 0, 0, 0, 186, 186, 186, 187, 187, 0,
562 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
563 187, 187, 187, 187, 188, 188, 188, 189, 0, 0,
564 0, 189, 189, 189, 192, 0, 0, 192, 192, 192,
565 192, 193, 193, 193, 0, 193, 0, 0, 0, 0,
566 0, 193, 0, 0, 193, 193, 193, 194, 0, 0,
567 0, 0, 194, 0, 0, 0, 0, 194, 195, 0,
568 0, 195, 195, 195, 195, 196, 0, 0, 196, 196,
569 0, 0, 0, 196, 196, 197, 197, 197, 198, 198,
570 198, 0, 0, 0, 0, 198, 198, 198, 0, 0,
571 0, 198, 198, 198, 201, 0, 0, 201, 201, 201,
573 201, 202, 0, 0, 0, 202, 0, 0, 0, 202,
574 202, 181, 181, 181, 181, 181, 181, 181, 181, 181,
575 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
576 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
577 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
578 181, 181, 181, 181, 181, 181, 181, 181, 181, 181
581 static yy_state_type yy_last_accepting_state
;
582 static char *yy_last_accepting_cpos
;
584 /* The intent behind this definition is that it'll catch
585 * any uses of REJECT which flex missed.
587 #define REJECT reject_used_but_not_detected
588 #define yymore() yymore_used_but_not_detected
589 #define YY_MORE_ADJ 0
590 #define YY_RESTORE_YY_MORE_OFFSET
594 /* FLEX lexer for Ada expressions, for GDB.
595 Copyright (C) 1994, 1997, 1998, 2000, 2001, 2002, 2003
596 Free Software Foundation, Inc.
598 This file is part of GDB.
600 This program is free software; you can redistribute it and/or modify
601 it under the terms of the GNU General Public License as published by
602 the Free Software Foundation; either version 2 of the License, or
603 (at your option) any later version.
605 This program is distributed in the hope that it will be useful,
606 but WITHOUT ANY WARRANTY; without even the implied warranty of
607 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
608 GNU General Public License for more details.
610 You should have received a copy of the GNU General Public License
611 along with this program; if not, write to the Free Software
612 Foundation, Inc., 51 Franklin Street, Fifth Floor,
613 Boston, MA 02110-1301, USA. */
614 /*----------------------------------------------------------------------*/
615 /* The converted version of this file is to be included in ada-exp.y, */
616 /* the Ada parser for gdb. The function yylex obtains characters from */
617 /* the global pointer lexptr. It returns a syntactic category for */
618 /* each successive token and places a semantic value into yylval */
619 /* (ada-lval), defined by the parser. */
622 #define NUMERAL_WIDTH 256
623 #define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
625 /* Temporary staging for numeric literals. */
626 static char numbuf
[NUMERAL_WIDTH
];
627 static void canonicalizeNumeral (char *s1
, const char *);
628 static struct stoken
processString (const char*, int);
629 static int processInt (const char *, const char *, const char *);
630 static int processReal (const char *);
631 static struct stoken
processId (const char *, int);
632 static int processAttribute (const char *);
633 static int find_dot_all (const char *);
636 #define YY_DECL static int yylex ( void )
639 #define YY_INPUT(BUF, RESULT, MAX_SIZE) \
640 if ( *lexptr == '\000' ) \
641 (RESULT) = YY_NULL; \
649 static int find_dot_all (const char *);
651 #define BEFORE_QUAL_QUOTE 1
653 #line 654 "ada-lex.c"
655 /* Macros after this point can all be overridden by user definitions in
659 #ifndef YY_SKIP_YYWRAP
661 extern "C" int yywrap
YY_PROTO(( void ));
663 extern int yywrap
YY_PROTO(( void ));
668 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
672 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
675 #ifdef YY_NEED_STRLEN
676 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
681 static int yyinput
YY_PROTO(( void ));
683 static int input
YY_PROTO(( void ));
688 static int yy_start_stack_ptr
= 0;
689 static int yy_start_stack_depth
= 0;
690 static int *yy_start_stack
= 0;
691 #ifndef YY_NO_PUSH_STATE
692 static void yy_push_state
YY_PROTO(( int new_state
));
694 #ifndef YY_NO_POP_STATE
695 static void yy_pop_state
YY_PROTO(( void ));
697 #ifndef YY_NO_TOP_STATE
698 static int yy_top_state
YY_PROTO(( void ));
702 #define YY_NO_PUSH_STATE 1
703 #define YY_NO_POP_STATE 1
704 #define YY_NO_TOP_STATE 1
707 #ifdef YY_MALLOC_DECL
715 /* Just try to get by without declaring the routines. This will fail
716 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
717 * or sizeof(void*) != sizeof(int).
722 /* Amount of stuff to slurp up with each read. */
723 #ifndef YY_READ_BUF_SIZE
724 #define YY_READ_BUF_SIZE 8192
727 /* Copy whatever the last rule matched to the standard output. */
730 /* This used to be an fputs(), but since the string might contain NUL's,
731 * we now use fwrite().
733 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
736 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
737 * is returned in "result".
740 #define YY_INPUT(buf,result,max_size) \
741 if ( yy_current_buffer->yy_is_interactive ) \
744 for ( n = 0; n < max_size && \
745 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
748 buf[n++] = (char) c; \
749 if ( c == EOF && ferror( yyin ) ) \
750 YY_FATAL_ERROR( "input in flex scanner failed" ); \
753 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
754 && ferror( yyin ) ) \
755 YY_FATAL_ERROR( "input in flex scanner failed" );
758 /* No semi-colon after return; correct usage is to write "yyterminate();" -
759 * we don't want an extra ';' after the "return" because that will cause
760 * some compilers to complain about unreachable statements.
763 #define yyterminate() return YY_NULL
766 /* Number of entries by which start-condition stack grows. */
767 #ifndef YY_START_STACK_INCR
768 #define YY_START_STACK_INCR 25
771 /* Report a fatal error. */
772 #ifndef YY_FATAL_ERROR
773 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
776 /* Default declaration of generated scanner - a define so the user can
777 * easily add parameters.
780 #define YY_DECL int yylex YY_PROTO(( void ))
783 /* Code executed at the beginning of each rule, after yytext and yyleng
786 #ifndef YY_USER_ACTION
787 #define YY_USER_ACTION
790 /* Code executed at the end of each rule. */
792 #define YY_BREAK break;
795 #define YY_RULE_SETUP \
800 register yy_state_type yy_current_state
;
801 register char *yy_cp
= NULL
, *yy_bp
= NULL
;
807 #line 808 "ada-lex.c"
818 yy_start
= 1; /* first start state */
826 if ( ! yy_current_buffer
)
828 yy_create_buffer( yyin
, YY_BUF_SIZE
);
830 yy_load_buffer_state();
833 while ( 1 ) /* loops until end-of-file is reached */
837 /* Support of yytext. */
838 *yy_cp
= yy_hold_char
;
840 /* yy_bp points to the position in yy_ch_buf of the start of
845 yy_current_state
= yy_start
;
849 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
850 if ( yy_accept
[yy_current_state
] )
852 yy_last_accepting_state
= yy_current_state
;
853 yy_last_accepting_cpos
= yy_cp
;
855 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
857 yy_current_state
= (int) yy_def
[yy_current_state
];
858 if ( yy_current_state
>= 182 )
859 yy_c
= yy_meta
[(unsigned int) yy_c
];
861 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
864 while ( yy_base
[yy_current_state
] != 712 );
867 yy_act
= yy_accept
[yy_current_state
];
869 { /* have to back up */
870 yy_cp
= yy_last_accepting_cpos
;
871 yy_current_state
= yy_last_accepting_state
;
872 yy_act
= yy_accept
[yy_current_state
];
878 do_action
: /* This label is used only to access EOF actions. */
882 { /* beginning of action switch */
883 case 0: /* must back up */
884 /* undo the effects of YY_DO_BEFORE_ACTION */
885 *yy_cp
= yy_hold_char
;
886 yy_cp
= yy_last_accepting_cpos
;
887 yy_current_state
= yy_last_accepting_state
;
904 canonicalizeNumeral (numbuf
, yytext
);
905 return processInt (NULL
, numbuf
, strrchr(numbuf
, 'e')+1);
912 canonicalizeNumeral (numbuf
, yytext
);
913 return processInt (NULL
, numbuf
, NULL
);
920 canonicalizeNumeral (numbuf
, yytext
);
921 return processInt (numbuf
,
922 strchr (numbuf
, '#') + 1,
923 strrchr(numbuf
, '#') + 1);
928 #line 105 "ada-lex.l"
930 canonicalizeNumeral (numbuf
, yytext
);
931 return processInt (numbuf
, strchr (numbuf
, '#') + 1, NULL
);
936 #line 110 "ada-lex.l"
938 canonicalizeNumeral (numbuf
, yytext
+2);
939 return processInt ("16#", numbuf
, NULL
);
944 #line 116 "ada-lex.l"
946 canonicalizeNumeral (numbuf
, yytext
);
947 return processReal (numbuf
);
952 #line 121 "ada-lex.l"
954 canonicalizeNumeral (numbuf
, yytext
);
955 return processReal (numbuf
);
960 #line 126 "ada-lex.l"
962 error (_("Based real literals not implemented yet."));
967 #line 130 "ada-lex.l"
969 error (_("Based real literals not implemented yet."));
974 #line 134 "ada-lex.l"
976 yylval
.typed_val
.type
= type_char ();
977 yylval
.typed_val
.val
= yytext
[1];
983 #line 140 "ada-lex.l"
986 yylval
.typed_val
.type
= type_char ();
987 sscanf (yytext
+3, "%2x", &v
);
988 yylval
.typed_val
.val
= v
;
994 #line 148 "ada-lex.l"
996 yylval
.sval
= processString (yytext
+1, yyleng
-2);
1002 #line 153 "ada-lex.l"
1004 error (_("ill-formed or non-terminated string literal"));
1009 #line 158 "ada-lex.l"
1011 while (*lexptr
!= 'i' && *lexptr
!= 'I')
1020 #line 167 "ada-lex.l"
1025 #line 168 "ada-lex.l"
1030 #line 169 "ada-lex.l"
1035 #line 170 "ada-lex.l"
1040 #line 171 "ada-lex.l"
1045 #line 172 "ada-lex.l"
1050 #line 173 "ada-lex.l"
1055 #line 174 "ada-lex.l"
1056 { return NULL_PTR
; }
1060 #line 175 "ada-lex.l"
1065 #line 176 "ada-lex.l"
1070 #line 177 "ada-lex.l"
1075 #line 178 "ada-lex.l"
1080 #line 179 "ada-lex.l"
1086 #line 183 "ada-lex.l"
1087 { return processAttribute (yytext
+1); }
1092 #line 187 "ada-lex.l"
1097 #line 188 "ada-lex.l"
1102 #line 189 "ada-lex.l"
1103 { return STARSTAR
; }
1107 #line 190 "ada-lex.l"
1112 #line 191 "ada-lex.l"
1113 { return NOTEQUAL
; }
1117 #line 192 "ada-lex.l"
1122 #line 193 "ada-lex.l"
1127 #line 195 "ada-lex.l"
1128 { BEGIN INITIAL
; return '\''; }
1132 #line 197 "ada-lex.l"
1133 { return yytext
[0]; }
1137 #line 199 "ada-lex.l"
1138 { if (paren_depth
== 0 && comma_terminates
)
1150 #line 209 "ada-lex.l"
1151 { paren_depth
+= 1; return '('; }
1155 #line 210 "ada-lex.l"
1156 { if (paren_depth
== 0)
1171 #line 223 "ada-lex.l"
1176 #line 225 "ada-lex.l"
1178 yylval
.sval
= processId (yytext
+1, yyleng
-1);
1184 #line 230 "ada-lex.l"
1186 int all_posn
= find_dot_all (yytext
);
1188 if (all_posn
== -1 && yytext
[yyleng
-1] == '\'')
1190 BEGIN BEFORE_QUAL_QUOTE
;
1193 else if (all_posn
>= 0)
1195 yylval
.sval
= processId (yytext
, yyleng
);
1199 /* GDB EXPRESSION CONSTRUCTS */
1202 #line 247 "ada-lex.l"
1204 yyless (yyleng
- 2);
1205 yylval
.sval
= processId (yytext
, yyleng
);
1211 #line 253 "ada-lex.l"
1212 { return COLONCOLON
; }
1216 #line 255 "ada-lex.l"
1217 { return yytext
[0]; }
1219 /* REGISTERS AND GDB CONVENIENCE VARIABLES */
1222 #line 259 "ada-lex.l"
1224 yylval
.sval
.ptr
= yytext
;
1225 yylval
.sval
.length
= yyleng
;
1226 return SPECIAL_VARIABLE
;
1229 /* CATCH-ALL ERROR CASE */
1232 #line 267 "ada-lex.l"
1233 { error (_("Invalid character '%s' in expression."), yytext
); }
1237 #line 268 "ada-lex.l"
1238 YY_FATAL_ERROR( "flex scanner jammed" );
1240 #line 1241 "ada-lex.c"
1241 case YY_STATE_EOF(INITIAL
):
1242 case YY_STATE_EOF(BEFORE_QUAL_QUOTE
):
1245 case YY_END_OF_BUFFER
:
1247 /* Amount of text matched not including the EOB char. */
1248 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
1250 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1251 *yy_cp
= yy_hold_char
;
1252 YY_RESTORE_YY_MORE_OFFSET
1254 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1256 /* We're scanning a new file or input source. It's
1257 * possible that this happened because the user
1258 * just pointed yyin at a new source and called
1259 * yylex(). If so, then we have to assure
1260 * consistency between yy_current_buffer and our
1261 * globals. Here is the right place to do so, because
1262 * this is the first action (other than possibly a
1263 * back-up) that will match for the new input source.
1265 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1266 yy_current_buffer
->yy_input_file
= yyin
;
1267 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1270 /* Note that here we test for yy_c_buf_p "<=" to the position
1271 * of the first EOB in the buffer, since yy_c_buf_p will
1272 * already have been incremented past the NUL character
1273 * (since all states make transitions on EOB to the
1274 * end-of-buffer state). Contrast this with the test
1277 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1278 { /* This was really a NUL. */
1279 yy_state_type yy_next_state
;
1281 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1283 yy_current_state
= yy_get_previous_state();
1285 /* Okay, we're now positioned to make the NUL
1286 * transition. We couldn't have
1287 * yy_get_previous_state() go ahead and do it
1288 * for us because it doesn't know how to deal
1289 * with the possibility of jamming (and we don't
1290 * want to build jamming into it because then it
1291 * will run more slowly).
1294 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1296 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1298 if ( yy_next_state
)
1300 /* Consume the NUL. */
1301 yy_cp
= ++yy_c_buf_p
;
1302 yy_current_state
= yy_next_state
;
1309 goto yy_find_action
;
1313 else switch ( yy_get_next_buffer() )
1315 case EOB_ACT_END_OF_FILE
:
1317 yy_did_buffer_switch_on_eof
= 0;
1321 /* Note: because we've taken care in
1322 * yy_get_next_buffer() to have set up
1323 * yytext, we can now set up
1324 * yy_c_buf_p so that if some total
1325 * hoser (like flex itself) wants to
1326 * call the scanner after we return the
1327 * YY_NULL, it'll still work - another
1328 * YY_NULL will get returned.
1330 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
1332 yy_act
= YY_STATE_EOF(YY_START
);
1338 if ( ! yy_did_buffer_switch_on_eof
)
1344 case EOB_ACT_CONTINUE_SCAN
:
1346 yytext_ptr
+ yy_amount_of_matched_text
;
1348 yy_current_state
= yy_get_previous_state();
1351 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1354 case EOB_ACT_LAST_MATCH
:
1356 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
1358 yy_current_state
= yy_get_previous_state();
1361 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1362 goto yy_find_action
;
1369 "fatal flex scanner internal error--no action found" );
1370 } /* end of action switch */
1371 } /* end of scanning one token */
1372 } /* end of yylex */
1375 /* yy_get_next_buffer - try to read in a new buffer
1377 * Returns a code representing an action:
1378 * EOB_ACT_LAST_MATCH -
1379 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1380 * EOB_ACT_END_OF_FILE - end of file
1383 static int yy_get_next_buffer()
1385 register char *dest
= yy_current_buffer
->yy_ch_buf
;
1386 register char *source
= yytext_ptr
;
1387 register int number_to_move
, i
;
1390 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
1392 "fatal flex scanner internal error--end of buffer missed" );
1394 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
1395 { /* Don't try to fill the buffer, so this is an EOF. */
1396 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
1398 /* We matched a single character, the EOB, so
1399 * treat this as a final EOF.
1401 return EOB_ACT_END_OF_FILE
;
1406 /* We matched some text prior to the EOB, first
1409 return EOB_ACT_LAST_MATCH
;
1413 /* Try to read more data. */
1415 /* First move last chars to start of buffer. */
1416 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
1418 for ( i
= 0; i
< number_to_move
; ++i
)
1419 *(dest
++) = *(source
++);
1421 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1422 /* don't do the read, it's not guaranteed to return an EOF,
1425 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
1430 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
1432 while ( num_to_read
<= 0 )
1433 { /* Not enough room in the buffer - grow it. */
1434 #ifdef YY_USES_REJECT
1436 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1439 /* just a shorter name for the current buffer */
1440 YY_BUFFER_STATE b
= yy_current_buffer
;
1442 int yy_c_buf_p_offset
=
1443 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
1445 if ( b
->yy_is_our_buffer
)
1447 int new_size
= b
->yy_buf_size
* 2;
1449 if ( new_size
<= 0 )
1450 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1452 b
->yy_buf_size
*= 2;
1454 b
->yy_ch_buf
= (char *)
1455 /* Include room in for 2 EOB chars. */
1456 yyxrealloc( (void *) b
->yy_ch_buf
,
1457 b
->yy_buf_size
+ 2 );
1460 /* Can't grow it, we don't own it. */
1463 if ( ! b
->yy_ch_buf
)
1465 "fatal error - scanner input buffer overflow" );
1467 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1469 num_to_read
= yy_current_buffer
->yy_buf_size
-
1474 if ( num_to_read
> YY_READ_BUF_SIZE
)
1475 num_to_read
= YY_READ_BUF_SIZE
;
1477 /* Read in more data. */
1478 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
1479 yy_n_chars
, num_to_read
);
1481 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1484 if ( yy_n_chars
== 0 )
1486 if ( number_to_move
== YY_MORE_ADJ
)
1488 ret_val
= EOB_ACT_END_OF_FILE
;
1494 ret_val
= EOB_ACT_LAST_MATCH
;
1495 yy_current_buffer
->yy_buffer_status
=
1496 YY_BUFFER_EOF_PENDING
;
1501 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1503 yy_n_chars
+= number_to_move
;
1504 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1505 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1507 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
1513 /* yy_get_previous_state - get the state just before the EOB char was reached */
1515 static yy_state_type
yy_get_previous_state()
1517 register yy_state_type yy_current_state
;
1518 register char *yy_cp
;
1520 yy_current_state
= yy_start
;
1522 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
1524 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1525 if ( yy_accept
[yy_current_state
] )
1527 yy_last_accepting_state
= yy_current_state
;
1528 yy_last_accepting_cpos
= yy_cp
;
1530 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1532 yy_current_state
= (int) yy_def
[yy_current_state
];
1533 if ( yy_current_state
>= 182 )
1534 yy_c
= yy_meta
[(unsigned int) yy_c
];
1536 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1539 return yy_current_state
;
1543 /* yy_try_NUL_trans - try to make a transition on the NUL character
1546 * next_state = yy_try_NUL_trans( current_state );
1549 #ifdef YY_USE_PROTOS
1550 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
1552 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
1553 yy_state_type yy_current_state
;
1556 register int yy_is_jam
;
1557 register char *yy_cp
= yy_c_buf_p
;
1559 register YY_CHAR yy_c
= 1;
1560 if ( yy_accept
[yy_current_state
] )
1562 yy_last_accepting_state
= yy_current_state
;
1563 yy_last_accepting_cpos
= yy_cp
;
1565 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1567 yy_current_state
= (int) yy_def
[yy_current_state
];
1568 if ( yy_current_state
>= 182 )
1569 yy_c
= yy_meta
[(unsigned int) yy_c
];
1571 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1572 yy_is_jam
= (yy_current_state
== 181);
1574 return yy_is_jam
? 0 : yy_current_state
;
1579 #ifdef YY_USE_PROTOS
1580 static void yyunput( int c
, register char *yy_bp
)
1582 static void yyunput( c
, yy_bp
)
1584 register char *yy_bp
;
1587 register char *yy_cp
= yy_c_buf_p
;
1589 /* undo effects of setting up yytext */
1590 *yy_cp
= yy_hold_char
;
1592 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1593 { /* need to shift things up to make room */
1594 /* +2 for EOB chars. */
1595 register int number_to_move
= yy_n_chars
+ 2;
1596 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
1597 yy_current_buffer
->yy_buf_size
+ 2];
1598 register char *source
=
1599 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1601 while ( source
> yy_current_buffer
->yy_ch_buf
)
1602 *--dest
= *--source
;
1604 yy_cp
+= (int) (dest
- source
);
1605 yy_bp
+= (int) (dest
- source
);
1606 yy_current_buffer
->yy_n_chars
=
1607 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1609 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1610 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1613 *--yy_cp
= (char) c
;
1617 yy_hold_char
= *yy_cp
;
1620 #endif /* ifndef YY_NO_UNPUT */
1625 static int yyinput()
1632 *yy_c_buf_p
= yy_hold_char
;
1634 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1636 /* yy_c_buf_p now points to the character we want to return.
1637 * If this occurs *before* the EOB characters, then it's a
1638 * valid NUL; if not, then we've hit the end of the buffer.
1640 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1641 /* This was really a NUL. */
1645 { /* need more input */
1646 int offset
= yy_c_buf_p
- yytext_ptr
;
1649 switch ( yy_get_next_buffer() )
1651 case EOB_ACT_LAST_MATCH
:
1652 /* This happens because yy_g_n_b()
1653 * sees that we've accumulated a
1654 * token and flags that we need to
1655 * try matching the token before
1656 * proceeding. But for input(),
1657 * there's no matching to consider.
1658 * So convert the EOB_ACT_LAST_MATCH
1659 * to EOB_ACT_END_OF_FILE.
1662 /* Reset buffer status. */
1667 case EOB_ACT_END_OF_FILE
:
1672 if ( ! yy_did_buffer_switch_on_eof
)
1681 case EOB_ACT_CONTINUE_SCAN
:
1682 yy_c_buf_p
= yytext_ptr
+ offset
;
1688 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
1689 *yy_c_buf_p
= '\0'; /* preserve yytext */
1690 yy_hold_char
= *++yy_c_buf_p
;
1695 #endif /* YY_NO_INPUT */
1697 #ifdef YY_USE_PROTOS
1698 void yyrestart( FILE *input_file
)
1700 void yyrestart( input_file
)
1704 if ( ! yy_current_buffer
)
1705 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
1707 yy_init_buffer( yy_current_buffer
, input_file
);
1708 yy_load_buffer_state();
1712 #ifdef YY_USE_PROTOS
1713 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1715 void yy_switch_to_buffer( new_buffer
)
1716 YY_BUFFER_STATE new_buffer
;
1719 if ( yy_current_buffer
== new_buffer
)
1722 if ( yy_current_buffer
)
1724 /* Flush out information for old buffer. */
1725 *yy_c_buf_p
= yy_hold_char
;
1726 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1727 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1730 yy_current_buffer
= new_buffer
;
1731 yy_load_buffer_state();
1733 /* We don't actually know whether we did this switch during
1734 * EOF (yywrap()) processing, but the only time this flag
1735 * is looked at is after yywrap() is called, so it's safe
1736 * to go ahead and always set it.
1738 yy_did_buffer_switch_on_eof
= 1;
1742 #ifdef YY_USE_PROTOS
1743 void yy_load_buffer_state( void )
1745 void yy_load_buffer_state()
1748 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1749 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1750 yyin
= yy_current_buffer
->yy_input_file
;
1751 yy_hold_char
= *yy_c_buf_p
;
1755 #ifdef YY_USE_PROTOS
1756 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1758 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1765 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1767 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1769 b
->yy_buf_size
= size
;
1771 /* yy_ch_buf has to be 2 characters longer than the size given because
1772 * we need to put in 2 end-of-buffer characters.
1774 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
1775 if ( ! b
->yy_ch_buf
)
1776 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1778 b
->yy_is_our_buffer
= 1;
1780 yy_init_buffer( b
, file
);
1786 #ifdef YY_USE_PROTOS
1787 void yy_delete_buffer( YY_BUFFER_STATE b
)
1789 void yy_delete_buffer( b
)
1796 if ( b
== yy_current_buffer
)
1797 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1799 if ( b
->yy_is_our_buffer
)
1800 yy_flex_free( (void *) b
->yy_ch_buf
);
1802 yy_flex_free( (void *) b
);
1807 #ifdef YY_USE_PROTOS
1808 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1810 void yy_init_buffer( b
, file
)
1817 yy_flush_buffer( b
);
1819 b
->yy_input_file
= file
;
1820 b
->yy_fill_buffer
= 1;
1822 #if YY_ALWAYS_INTERACTIVE
1823 b
->yy_is_interactive
= 1;
1825 #if YY_NEVER_INTERACTIVE
1826 b
->yy_is_interactive
= 0;
1828 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1834 #ifdef YY_USE_PROTOS
1835 void yy_flush_buffer( YY_BUFFER_STATE b
)
1837 void yy_flush_buffer( b
)
1847 /* We always need two end-of-buffer characters. The first causes
1848 * a transition to the end-of-buffer state. The second causes
1849 * a jam in that state.
1851 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1852 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1854 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1857 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1859 if ( b
== yy_current_buffer
)
1860 yy_load_buffer_state();
1864 #ifndef YY_NO_SCAN_BUFFER
1865 #ifdef YY_USE_PROTOS
1866 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
1868 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
1876 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1877 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1878 /* They forgot to leave room for the EOB's. */
1881 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1883 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1885 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1886 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1887 b
->yy_is_our_buffer
= 0;
1888 b
->yy_input_file
= 0;
1889 b
->yy_n_chars
= b
->yy_buf_size
;
1890 b
->yy_is_interactive
= 0;
1892 b
->yy_fill_buffer
= 0;
1893 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1895 yy_switch_to_buffer( b
);
1902 #ifndef YY_NO_SCAN_STRING
1903 #ifdef YY_USE_PROTOS
1904 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
1906 YY_BUFFER_STATE
yy_scan_string( yy_str
)
1907 yyconst
char *yy_str
;
1911 for ( len
= 0; yy_str
[len
]; ++len
)
1914 return yy_scan_bytes( yy_str
, len
);
1919 #ifndef YY_NO_SCAN_BYTES
1920 #ifdef YY_USE_PROTOS
1921 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
1923 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
1924 yyconst
char *bytes
;
1933 /* Get memory for full buffer, including space for trailing EOB's. */
1935 buf
= (char *) yy_flex_alloc( n
);
1937 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1939 for ( i
= 0; i
< len
; ++i
)
1942 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
1944 b
= yy_scan_buffer( buf
, n
);
1946 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1948 /* It's okay to grow etc. this buffer, and we should throw it
1949 * away when we're done.
1951 b
->yy_is_our_buffer
= 1;
1958 #ifndef YY_NO_PUSH_STATE
1959 #ifdef YY_USE_PROTOS
1960 static void yy_push_state( int new_state
)
1962 static void yy_push_state( new_state
)
1966 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
1970 yy_start_stack_depth
+= YY_START_STACK_INCR
;
1971 new_size
= yy_start_stack_depth
* sizeof( int );
1973 if ( ! yy_start_stack
)
1974 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
1977 yy_start_stack
= (int *) yyxrealloc(
1978 (void *) yy_start_stack
, new_size
);
1980 if ( ! yy_start_stack
)
1982 "out of memory expanding start-condition stack" );
1985 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
1992 #ifndef YY_NO_POP_STATE
1993 static void yy_pop_state()
1995 if ( --yy_start_stack_ptr
< 0 )
1996 YY_FATAL_ERROR( "start-condition stack underflow" );
1998 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2003 #ifndef YY_NO_TOP_STATE
2004 static int yy_top_state()
2006 return yy_start_stack
[yy_start_stack_ptr
- 1];
2010 #ifndef YY_EXIT_FAILURE
2011 #define YY_EXIT_FAILURE 2
2014 #ifdef YY_USE_PROTOS
2015 static void yy_fatal_error( yyconst
char msg
[] )
2017 static void yy_fatal_error( msg
)
2021 (void) fprintf( stderr
, "%s\n", msg
);
2022 exit( YY_EXIT_FAILURE
);
2027 /* Redefine yyless() so it works in section 3 code. */
2033 /* Undo effects of setting up yytext. */ \
2034 yytext[yyleng] = yy_hold_char; \
2035 yy_c_buf_p = yytext + n; \
2036 yy_hold_char = *yy_c_buf_p; \
2037 *yy_c_buf_p = '\0'; \
2043 /* Internal utility routines. */
2046 #ifdef YY_USE_PROTOS
2047 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2049 static void yy_flex_strncpy( s1
, s2
, n
)
2056 for ( i
= 0; i
< n
; ++i
)
2061 #ifdef YY_NEED_STRLEN
2062 #ifdef YY_USE_PROTOS
2063 static int yy_flex_strlen( yyconst
char *s
)
2065 static int yy_flex_strlen( s
)
2070 for ( n
= 0; s
[n
]; ++n
)
2078 #ifdef YY_USE_PROTOS
2079 static void *yy_flex_alloc( yy_size_t size
)
2081 static void *yy_flex_alloc( size
)
2085 return (void *) xmalloc( size
);
2088 #ifdef YY_USE_PROTOS
2089 static void *yyxrealloc( void *ptr
, yy_size_t size
)
2091 static void *yyxrealloc( ptr
, size
)
2096 /* The cast to (char *) in the following accommodates both
2097 * implementations that use char* generic pointers, and those
2098 * that use void* generic pointers. It works with the latter
2099 * because both ANSI C and C++ allow castless assignment from
2100 * any pointer type to void*, and deal with argument conversions
2101 * as though doing an assignment.
2103 return (void *) xrealloc( (char *) ptr
, size
);
2106 #ifdef YY_USE_PROTOS
2107 static void yy_flex_free( void *ptr
)
2109 static void yy_flex_free( ptr
)
2123 #line 268 "ada-lex.l"
2127 #include "gdb_string.h"
2129 /* Initialize the lexer for processing new expression. */
2132 lexer_init (FILE *inp
)
2139 /* Copy S2 to S1, removing all underscores, and downcasing all letters. */
2142 canonicalizeNumeral (char *s1
, const char *s2
)
2144 for (; *s2
!= '\000'; s2
+= 1)
2155 #define HIGH_BYTE_POSN ((sizeof (ULONGEST) - 1) * HOST_CHAR_BIT)
2157 /* True (non-zero) iff DIGIT is a valid digit in radix BASE,
2158 where 2 <= BASE <= 16. */
2161 is_digit_in_base (unsigned char digit
, int base
)
2163 if (!isxdigit (digit
))
2166 return (isdigit (digit
) && digit
< base
+ '0');
2168 return (isdigit (digit
) || tolower (digit
) < base
- 10 + 'a');
2172 digit_to_int (unsigned char c
)
2177 return tolower (c
) - 'a' + 10;
2180 /* As for strtoul, but for ULONGEST results. */
2183 strtoulst (const char *num
, const char **trailer
, int base
)
2185 unsigned int high_part
;
2190 if (base
< 2 || base
> 16)
2195 lim
= base
- 1 + '0';
2197 result
= high_part
= 0;
2198 for (i
= 0; is_digit_in_base (num
[i
], base
); i
+= 1)
2200 result
= result
*base
+ digit_to_int (num
[i
]);
2201 high_part
= high_part
*base
+ (unsigned int) (result
>> HIGH_BYTE_POSN
);
2202 result
&= ((ULONGEST
) 1 << HIGH_BYTE_POSN
) - 1;
2203 if (high_part
> 0xff)
2206 result
= high_part
= 0;
2211 if (trailer
!= NULL
)
2214 return result
+ ((ULONGEST
) high_part
<< HIGH_BYTE_POSN
);
2217 /* Interprets the prefix of NUM that consists of digits of the given BASE
2218 as an integer of that BASE, with the string EXP as an exponent.
2219 Puts value in yylval, and returns INT, if the string is valid. Causes
2220 an error if the number is improperly formated. BASE, if NULL, defaults
2221 to "10", and EXP to "1". The EXP does not contain a leading 'e' or 'E'.
2225 processInt (const char *base0
, const char *num0
, const char *exp0
)
2237 base
= strtol (base0
, (char **) NULL
, 10);
2238 if (base
< 2 || base
> 16)
2239 error (_("Invalid base: %d."), base
);
2245 exp
= strtol(exp0
, (char **) NULL
, 10);
2248 result
= strtoulst (num0
, (const char **) &trailer
, base
);
2249 if (errno
== ERANGE
)
2250 error (_("Integer literal out of range"));
2251 if (isxdigit(*trailer
))
2252 error (_("Invalid digit `%c' in based literal"), *trailer
);
2256 if (result
> (ULONG_MAX
/ base
))
2257 error (_("Integer literal out of range"));
2262 if ((result
>> (TARGET_INT_BIT
-1)) == 0)
2263 yylval
.typed_val
.type
= type_int ();
2264 else if ((result
>> (TARGET_LONG_BIT
-1)) == 0)
2265 yylval
.typed_val
.type
= type_long ();
2266 else if (((result
>> (TARGET_LONG_BIT
-1)) >> 1) == 0)
2268 /* We have a number representable as an unsigned integer quantity.
2269 For consistency with the C treatment, we will treat it as an
2270 anonymous modular (unsigned) quantity. Alas, the types are such
2271 that we need to store .val as a signed quantity. Sorry
2272 for the mess, but C doesn't officially guarantee that a simple
2273 assignment does the trick (no, it doesn't; read the reference manual).
2275 yylval
.typed_val
.type
= builtin_type_unsigned_long
;
2276 if (result
& LONGEST_SIGN
)
2277 yylval
.typed_val
.val
=
2278 (LONGEST
) (result
& ~LONGEST_SIGN
)
2279 - (LONGEST_SIGN
>>1) - (LONGEST_SIGN
>>1);
2281 yylval
.typed_val
.val
= (LONGEST
) result
;
2285 yylval
.typed_val
.type
= type_long_long ();
2287 yylval
.typed_val
.val
= (LONGEST
) result
;
2292 processReal (const char *num0
)
2294 sscanf (num0
, DOUBLEST_SCAN_FORMAT
, &yylval
.typed_val_float
.dval
);
2296 yylval
.typed_val_float
.type
= type_float ();
2297 if (sizeof(DOUBLEST
) >= TARGET_DOUBLE_BIT
/ TARGET_CHAR_BIT
)
2298 yylval
.typed_val_float
.type
= type_double ();
2299 if (sizeof(DOUBLEST
) >= TARGET_LONG_DOUBLE_BIT
/ TARGET_CHAR_BIT
)
2300 yylval
.typed_val_float
.type
= type_long_double ();
2306 /* Store a canonicalized version of NAME0[0..LEN-1] in yylval.ssym. The
2307 resulting string is valid until the next call to ada_parse. It differs
2309 + Characters between '...' or <...> are transfered verbatim to
2311 + <, >, and trailing "'" characters in quoted sequences are removed
2312 (a leading quote is preserved to indicate that the name is not to be
2314 + Unquoted whitespace is removed.
2315 + Unquoted alphabetic characters are mapped to lower case.
2316 Result is returned as a struct stoken, but for convenience, the string
2317 is also null-terminated. Result string valid until the next call of
2320 static struct stoken
2321 processId (const char *name0
, int len
)
2323 char *name
= obstack_alloc (&temp_parse_space
, len
+ 11);
2325 struct stoken result
;
2327 while (len
> 0 && isspace (name0
[len
-1]))
2332 if (isalnum (name0
[i0
]))
2334 name
[i
] = tolower (name0
[i0
]);
2337 else switch (name0
[i0
])
2340 name
[i
] = name0
[i0
];
2343 case ' ': case '\t':
2349 name
[i
] = name0
[i0
];
2352 while (i0
< len
&& name0
[i0
] != '\'');
2357 while (i0
< len
&& name0
[i0
] != '>')
2359 name
[i
] = name0
[i0
];
2373 /* Return TEXT[0..LEN-1], a string literal without surrounding quotes,
2374 with special hex character notations replaced with characters.
2375 Result valid until the next call to ada_parse. */
2377 static struct stoken
2378 processString (const char *text
, int len
)
2382 const char *lim
= text
+ len
;
2383 struct stoken result
;
2385 q
= result
.ptr
= obstack_alloc (&temp_parse_space
, len
);
2389 if (p
[0] == '[' && p
[1] == '"' && p
+2 < lim
)
2391 if (p
[2] == '"') /* "...["""]... */
2399 sscanf (p
+2, "%2x", &chr
);
2409 result
.length
= q
- result
.ptr
;
2413 /* Returns the position within STR of the '.' in a
2414 '.{WHITE}*all' component of a dotted name, or -1 if there is none.
2415 Note: we actually don't need this routine, since 'all' can never be an
2416 Ada identifier. Thus, looking up foo.all or foo.all.x as a name
2417 must fail, and will eventually be interpreted as (foo).all or
2418 (foo).all.x. However, this does avoid an extraneous lookup. */
2421 find_dot_all (const char *str
)
2424 for (i
= 0; str
[i
] != '\000'; i
+= 1)
2431 while (isspace (str
[i
]));
2432 if (strncmp (str
+i
, "all", 3) == 0
2433 && ! isalnum (str
[i
+3]) && str
[i
+3] != '_')
2440 /* Returns non-zero iff string SUBSEQ matches a subsequence of STR, ignoring
2444 subseqMatch (const char *subseq
, const char *str
)
2446 if (subseq
[0] == '\0')
2448 else if (str
[0] == '\0')
2450 else if (tolower (subseq
[0]) == tolower (str
[0]))
2451 return subseqMatch (subseq
+1, str
+1) || subseqMatch (subseq
, str
+1);
2453 return subseqMatch (subseq
, str
+1);
2457 static struct { const char *name
; int code
; }
2459 { "address", TICK_ADDRESS
},
2460 { "unchecked_access", TICK_ACCESS
},
2461 { "unrestricted_access", TICK_ACCESS
},
2462 { "access", TICK_ACCESS
},
2463 { "first", TICK_FIRST
},
2464 { "last", TICK_LAST
},
2465 { "length", TICK_LENGTH
},
2466 { "max", TICK_MAX
},
2467 { "min", TICK_MIN
},
2468 { "modulus", TICK_MODULUS
},
2469 { "pos", TICK_POS
},
2470 { "range", TICK_RANGE
},
2471 { "size", TICK_SIZE
},
2472 { "tag", TICK_TAG
},
2473 { "val", TICK_VAL
},
2477 /* Return the syntactic code corresponding to the attribute name or
2478 abbreviation STR. */
2481 processAttribute (const char *str
)
2485 for (i
= 0; attributes
[i
].code
!= -1; i
+= 1)
2486 if (strcasecmp (str
, attributes
[i
].name
) == 0)
2487 return attributes
[i
].code
;
2489 for (i
= 0, k
= -1; attributes
[i
].code
!= -1; i
+= 1)
2490 if (subseqMatch (str
, attributes
[i
].name
))
2495 error (_("ambiguous attribute name: `%s'"), str
);
2498 error (_("unrecognized attribute: `%s'"), str
);
2500 return attributes
[k
].code
;
2509 /* Dummy definition to suppress warnings about unused static definitions. */
2510 typedef void (*dummy_function
) ();
2511 dummy_function ada_flex_use
[] =
2513 (dummy_function
) yyunput