2 /* A lexical scanner generated by flex */
4 /* Scanner skeleton version:
5 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern 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 xfree() 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 53
287 #define YY_END_OF_BUFFER 54
288 static yyconst
short int yy_accept
[190] =
290 0, 0, 0, 0, 54, 52, 1, 1, 15, 51,
291 41, 52, 43, 44, 41, 42, 41, 41, 41, 4,
292 4, 41, 41, 41, 41, 50, 47, 47, 47, 47,
293 47, 47, 47, 47, 47, 47, 47, 40, 0, 14,
294 0, 51, 0, 0, 0, 0, 0, 0, 0, 35,
295 2, 0, 34, 0, 46, 46, 37, 0, 0, 4,
296 0, 0, 49, 36, 38, 0, 33, 39, 0, 0,
297 47, 0, 47, 47, 47, 47, 47, 16, 20, 47,
298 47, 47, 47, 25, 47, 47, 47, 47, 47, 0,
299 14, 0, 12, 12, 0, 32, 2, 0, 46, 46,
301 0, 9, 0, 3, 7, 0, 47, 0, 0, 0,
302 47, 17, 18, 47, 47, 21, 22, 23, 47, 47,
303 27, 47, 47, 29, 0, 0, 0, 0, 0, 0,
304 46, 45, 6, 0, 0, 9, 0, 3, 0, 0,
305 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
306 47, 19, 47, 24, 47, 28, 30, 0, 48, 0,
307 0, 0, 0, 47, 0, 0, 0, 0, 0, 0,
308 0, 31, 47, 0, 0, 5, 11, 0, 8, 26,
309 0, 5, 0, 8, 13, 0, 10, 10, 0
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
[211] =
355 0, 0, 592, 587, 596, 736, 736, 736, 43, 0,
356 736, 70, 736, 736, 581, 736, 576, 117, 567, 116,
357 122, 29, 566, 564, 564, 736, 52, 150, 20, 27,
358 91, 96, 124, 118, 137, 142, 145, 191, 119, 736,
359 142, 0, 238, 571, 570, 569, 567, 54, 277, 736,
360 0, 324, 736, 0, 0, 537, 736, 0, 46, 155,
361 230, 0, 736, 736, 736, 534, 736, 736, 243, 249,
362 736, 327, 149, 223, 224, 257, 258, 259, 261, 262,
363 301, 304, 265, 303, 315, 320, 324, 322, 326, 541,
364 543, 368, 371, 736, 374, 526, 0, 509, 0, 453,
366 359, 361, 111, 358, 0, 458, 381, 397, 412, 0,
367 412, 355, 371, 393, 400, 382, 402, 407, 408, 425,
368 409, 420, 431, 426, 471, 0, 466, 450, 469, 433,
369 736, 0, 412, 0, 456, 456, 242, 462, 439, 330,
370 237, 358, 373, 433, 390, 377, 375, 383, 346, 337,
371 476, 453, 464, 465, 466, 477, 479, 331, 736, 334,
372 497, 331, 124, 511, 261, 261, 258, 156, 148, 114,
373 103, 481, 488, 96, 243, 504, 33, 56, 506, 496,
374 42, 511, 323, 519, 539, 391, 525, 527, 736, 557,
375 567, 583, 588, 604, 621, 624, 631, 166, 539, 638,
377 654, 666, 672, 683, 685, 701, 541, 542, 708, 719
380 static yyconst
short int yy_def
[211] =
382 189, 1, 1, 1, 189, 189, 189, 189, 190, 191,
383 189, 189, 189, 189, 189, 189, 189, 192, 189, 189,
384 189, 189, 193, 189, 189, 189, 194, 194, 28, 28,
385 28, 28, 28, 28, 28, 28, 28, 189, 190, 189,
386 190, 191, 38, 38, 38, 43, 189, 43, 43, 189,
387 195, 192, 189, 196, 197, 197, 189, 198, 189, 189,
388 189, 199, 189, 189, 189, 200, 189, 189, 189, 189,
389 189, 201, 28, 28, 28, 28, 28, 28, 28, 28,
390 28, 28, 28, 28, 28, 28, 28, 28, 28, 49,
391 202, 189, 189, 189, 43, 49, 195, 203, 197, 197,
393 204, 189, 189, 189, 199, 200, 189, 201, 189, 205,
394 206, 28, 28, 28, 28, 28, 28, 28, 28, 28,
395 28, 28, 28, 28, 189, 207, 189, 189, 43, 203,
396 189, 197, 189, 208, 204, 189, 189, 189, 189, 189,
397 189, 189, 189, 189, 189, 189, 189, 189, 189, 209,
398 206, 28, 28, 28, 28, 28, 28, 189, 189, 43,
399 189, 210, 189, 189, 189, 189, 189, 189, 189, 189,
400 209, 28, 28, 43, 189, 189, 189, 210, 189, 28,
401 43, 189, 189, 189, 189, 189, 189, 189, 0, 189,
402 189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
404 189, 189, 189, 189, 189, 189, 189, 189, 189, 189
407 static yyconst
short int yy_nxt
[785] =
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, 30, 27, 27, 31, 27, 32,
413 33, 34, 35, 27, 36, 27, 27, 37, 40, 63,
414 73, 185, 64, 69, 69, 70, 77, 73, 76, 95,
415 73, 71, 177, 93, 102, 102, 183, 73, 72, 41,
416 43, 44, 44, 45, 46, 46, 46, 46, 46, 47,
417 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
418 46, 46, 46, 46, 46, 46, 48, 46, 46, 49,
420 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
421 49, 49, 49, 49, 49, 49, 49, 49, 52, 52,
422 52, 73, 58, 181, 40, 78, 73, 164, 58, 104,
423 104, 79, 59, 53, 60, 60, 73, 80, 59, 54,
424 60, 60, 179, 179, 60, 41, 56, 91, 73, 61,
425 60, 69, 69, 70, 73, 61, 139, 81, 73, 71,
426 84, 58, 85, 62, 73, 82, 72, 73, 41, 83,
427 86, 59, 73, 60, 60, 73, 101, 73, 87, 73,
428 74, 101, 73, 60, 88, 73, 89, 139, 61, 73,
429 75, 43, 44, 44, 44, 43, 43, 43, 43, 43,
431 139, 43, 43, 43, 43, 43, 43, 43, 43, 43,
432 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
433 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
434 90, 90, 90, 90, 90, 90, 90, 90, 90, 43,
435 43, 43, 164, 103, 69, 69, 69, 92, 104, 104,
436 69, 69, 70, 73, 73, 163, 113, 163, 71, 72,
437 139, 176, 176, 73, 73, 72, 112, 43, 43, 43,
438 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
439 43, 43, 43, 43, 43, 43, 93, 73, 73, 73,
440 139, 73, 73, 139, 116, 73, 115, 73, 73, 73,
442 114, 73, 73, 119, 139, 73, 96, 96, 96, 96,
443 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
444 96, 96, 96, 96, 96, 52, 52, 52, 108, 108,
445 108, 73, 109, 73, 73, 164, 186, 177, 186, 174,
446 189, 73, 139, 73, 73, 73, 54, 117, 118, 110,
447 73, 120, 73, 56, 73, 73, 73, 122, 39, 121,
448 73, 164, 73, 164, 73, 133, 73, 123, 124, 127,
449 127, 127, 127, 127, 127, 134, 138, 138, 164, 136,
450 136, 139, 69, 69, 70, 73, 138, 170, 128, 136,
451 71, 128, 129, 129, 137, 73, 139, 72, 108, 108,
453 108, 73, 109, 129, 129, 129, 129, 129, 129, 187,
454 187, 73, 73, 69, 69, 70, 169, 139, 168, 110,
455 139, 71, 73, 73, 140, 139, 152, 139, 72, 141,
456 73, 167, 73, 73, 142, 139, 143, 73, 73, 73,
457 73, 144, 73, 153, 164, 161, 154, 73, 73, 73,
458 73, 145, 146, 147, 148, 73, 73, 131, 155, 149,
459 156, 73, 133, 165, 157, 73, 73, 127, 127, 127,
460 159, 73, 134, 166, 136, 136, 158, 69, 69, 70,
461 138, 138, 107, 73, 136, 71, 128, 160, 160, 137,
462 138, 132, 72, 73, 73, 73, 73, 172, 160, 160,
464 160, 160, 160, 160, 73, 73, 73, 73, 173, 73,
465 175, 73, 69, 69, 70, 176, 176, 73, 73, 73,
466 71, 73, 182, 182, 184, 184, 73, 72, 73, 182,
467 182, 180, 182, 131, 184, 92, 73, 184, 184, 182,
468 127, 127, 127, 188, 188, 188, 188, 184, 125, 105,
469 92, 125, 162, 188, 105, 188, 125, 162, 107, 128,
470 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
471 39, 39, 39, 39, 42, 100, 94, 42, 93, 93,
472 92, 42, 42, 42, 55, 55, 55, 68, 67, 65,
473 57, 51, 55, 50, 55, 189, 38, 55, 55, 55,
475 66, 38, 66, 66, 66, 73, 73, 73, 189, 189,
476 189, 189, 73, 73, 73, 189, 189, 189, 73, 73,
477 73, 97, 97, 189, 97, 97, 97, 97, 97, 97,
478 97, 97, 97, 97, 97, 97, 97, 97, 98, 98,
479 98, 99, 189, 189, 189, 99, 99, 99, 106, 189,
480 189, 106, 106, 106, 106, 111, 111, 111, 189, 111,
481 189, 189, 189, 189, 189, 111, 189, 189, 111, 111,
482 111, 126, 189, 189, 189, 189, 126, 189, 189, 189,
483 189, 126, 130, 189, 189, 130, 130, 130, 130, 135,
484 189, 189, 135, 135, 189, 189, 189, 135, 135, 150,
486 150, 150, 151, 151, 151, 189, 189, 189, 189, 151,
487 151, 151, 189, 189, 189, 151, 151, 151, 171, 189,
488 189, 171, 171, 171, 171, 178, 189, 189, 189, 178,
489 189, 189, 189, 178, 178, 5, 189, 189, 189, 189,
490 189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
491 189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
492 189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
493 189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
497 static yyconst
short int yy_chk
[785] =
499 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
500 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
501 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
502 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
503 1, 1, 1, 1, 1, 1, 1, 1, 9, 22,
504 29, 181, 22, 27, 27, 27, 30, 30, 29, 48,
505 29, 27, 178, 48, 59, 59, 177, 30, 27, 9,
506 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, 12, 12,
510 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
511 12, 12, 12, 12, 12, 12, 12, 12, 18, 18,
512 18, 31, 20, 174, 39, 31, 32, 171, 21, 103,
513 103, 31, 20, 18, 20, 20, 32, 32, 21, 18,
514 21, 21, 163, 163, 20, 39, 18, 41, 34, 20,
515 21, 28, 28, 28, 33, 21, 170, 33, 34, 28,
516 34, 60, 34, 20, 33, 33, 28, 35, 41, 33,
517 35, 60, 36, 60, 60, 37, 198, 35, 36, 73,
518 28, 198, 36, 60, 36, 37, 37, 169, 60, 73,
519 28, 38, 38, 38, 38, 38, 38, 38, 38, 38,
521 168, 38, 38, 38, 38, 38, 38, 38, 38, 38,
522 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
523 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
524 38, 38, 38, 38, 38, 38, 38, 38, 38, 43,
525 43, 43, 141, 61, 69, 69, 69, 43, 61, 61,
526 70, 70, 70, 74, 75, 137, 75, 137, 70, 69,
527 141, 175, 175, 74, 75, 70, 74, 43, 43, 43,
528 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
529 43, 43, 43, 43, 43, 43, 49, 76, 77, 78,
530 167, 79, 80, 166, 80, 83, 77, 76, 77, 78,
532 76, 79, 80, 83, 165, 83, 49, 49, 49, 49,
533 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
534 49, 49, 49, 49, 49, 52, 52, 52, 72, 72,
535 72, 81, 72, 84, 82, 140, 183, 162, 183, 160,
536 52, 81, 140, 84, 82, 85, 52, 81, 82, 72,
537 86, 85, 88, 52, 87, 85, 89, 87, 158, 86,
538 86, 150, 88, 142, 87, 101, 89, 88, 89, 92,
539 92, 92, 93, 93, 93, 101, 104, 104, 143, 102,
540 102, 142, 107, 107, 107, 112, 104, 149, 92, 102,
541 107, 93, 95, 95, 102, 112, 143, 107, 108, 108,
543 108, 113, 108, 95, 95, 95, 95, 95, 95, 186,
544 186, 113, 116, 111, 111, 111, 148, 147, 146, 108,
545 109, 111, 116, 114, 109, 109, 114, 109, 111, 109,
546 115, 145, 117, 114, 109, 109, 109, 118, 119, 121,
547 115, 109, 117, 115, 139, 133, 119, 118, 119, 121,
548 122, 109, 109, 109, 109, 120, 124, 130, 120, 109,
549 122, 123, 135, 144, 123, 120, 124, 127, 127, 127,
550 128, 123, 135, 144, 136, 136, 125, 151, 151, 151,
551 138, 138, 106, 152, 136, 151, 127, 129, 129, 136,
552 138, 100, 151, 152, 153, 154, 155, 153, 129, 129,
554 129, 129, 129, 129, 153, 154, 155, 156, 155, 157,
555 161, 172, 164, 164, 164, 161, 161, 156, 173, 157,
556 164, 172, 176, 176, 179, 179, 180, 164, 173, 182,
557 182, 173, 176, 98, 179, 96, 180, 184, 184, 182,
558 185, 185, 185, 187, 187, 188, 188, 184, 91, 199,
559 90, 207, 208, 187, 199, 188, 207, 208, 66, 185,
560 190, 190, 190, 190, 190, 190, 190, 190, 190, 190,
561 190, 190, 190, 190, 191, 56, 47, 191, 46, 45,
562 44, 191, 191, 191, 192, 192, 192, 25, 24, 23,
563 19, 17, 192, 15, 192, 5, 4, 192, 192, 192,
565 193, 3, 193, 193, 193, 194, 194, 194, 0, 0,
566 0, 0, 194, 194, 194, 0, 0, 0, 194, 194,
567 194, 195, 195, 0, 195, 195, 195, 195, 195, 195,
568 195, 195, 195, 195, 195, 195, 195, 195, 196, 196,
569 196, 197, 0, 0, 0, 197, 197, 197, 200, 0,
570 0, 200, 200, 200, 200, 201, 201, 201, 0, 201,
571 0, 0, 0, 0, 0, 201, 0, 0, 201, 201,
572 201, 202, 0, 0, 0, 0, 202, 0, 0, 0,
573 0, 202, 203, 0, 0, 203, 203, 203, 203, 204,
574 0, 0, 204, 204, 0, 0, 0, 204, 204, 205,
576 205, 205, 206, 206, 206, 0, 0, 0, 0, 206,
577 206, 206, 0, 0, 0, 206, 206, 206, 209, 0,
578 0, 209, 209, 209, 209, 210, 0, 0, 0, 210,
579 0, 0, 0, 210, 210, 189, 189, 189, 189, 189,
580 189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
581 189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
582 189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
583 189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
587 static yy_state_type yy_last_accepting_state
;
588 static char *yy_last_accepting_cpos
;
590 /* The intent behind this definition is that it'll catch
591 * any uses of REJECT which flex missed.
593 #define REJECT reject_used_but_not_detected
594 #define yymore() yymore_used_but_not_detected
595 #define YY_MORE_ADJ 0
596 #define YY_RESTORE_YY_MORE_OFFSET
600 /* FLEX lexer for Ada expressions, for GDB.
601 Copyright (C) 1994, 1997, 1998, 2000, 2001, 2002, 2003, 2007, 2008, 2009
602 Free Software Foundation, Inc.
604 This file is part of GDB.
606 This program is free software; you can redistribute it and/or modify
607 it under the terms of the GNU General Public License as published by
608 the Free Software Foundation; either version 3 of the License, or
609 (at your option) any later version.
611 This program is distributed in the hope that it will be useful,
612 but WITHOUT ANY WARRANTY; without even the implied warranty of
613 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
614 GNU General Public License for more details.
616 You should have received a copy of the GNU General Public License
617 along with this program. If not, see <http://www.gnu.org/licenses/>. */
618 /*----------------------------------------------------------------------*/
619 /* The converted version of this file is to be included in ada-exp.y, */
620 /* the Ada parser for gdb. The function yylex obtains characters from */
621 /* the global pointer lexptr. It returns a syntactic category for */
622 /* each successive token and places a semantic value into yylval */
623 /* (ada-lval), defined by the parser. */
626 #define NUMERAL_WIDTH 256
627 #define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
629 /* Temporary staging for numeric literals. */
630 static char numbuf
[NUMERAL_WIDTH
];
631 static void canonicalizeNumeral (char *s1
, const char *);
632 static struct stoken
processString (const char*, int);
633 static int processInt (const char *, const char *, const char *);
634 static int processReal (const char *);
635 static struct stoken
processId (const char *, int);
636 static int processAttribute (const char *);
637 static int find_dot_all (const char *);
640 #define YY_DECL static int yylex ( void )
643 #define YY_INPUT(BUF, RESULT, MAX_SIZE) \
644 if ( *lexptr == '\000' ) \
645 (RESULT) = YY_NULL; \
653 static int find_dot_all (const char *);
655 #define BEFORE_QUAL_QUOTE 1
657 #line 658 "ada-lex.c"
659 /* Macros after this point can all be overridden by user definitions in
663 #ifndef YY_SKIP_YYWRAP
665 extern "C" int yywrap
YY_PROTO(( void ));
667 extern int yywrap
YY_PROTO(( void ));
672 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
676 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
679 #ifdef YY_NEED_STRLEN
680 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
685 static int yyinput
YY_PROTO(( void ));
687 static int input
YY_PROTO(( void ));
692 static int yy_start_stack_ptr
= 0;
693 static int yy_start_stack_depth
= 0;
694 static int *yy_start_stack
= 0;
695 #ifndef YY_NO_PUSH_STATE
696 static void yy_push_state
YY_PROTO(( int new_state
));
698 #ifndef YY_NO_POP_STATE
699 static void yy_pop_state
YY_PROTO(( void ));
701 #ifndef YY_NO_TOP_STATE
702 static int yy_top_state
YY_PROTO(( void ));
706 #define YY_NO_PUSH_STATE 1
707 #define YY_NO_POP_STATE 1
708 #define YY_NO_TOP_STATE 1
711 #ifdef YY_MALLOC_DECL
719 /* Just try to get by without declaring the routines. This will fail
720 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
721 * or sizeof(void*) != sizeof(int).
726 /* Amount of stuff to slurp up with each read. */
727 #ifndef YY_READ_BUF_SIZE
728 #define YY_READ_BUF_SIZE 8192
731 /* Copy whatever the last rule matched to the standard output. */
734 /* This used to be an fputs(), but since the string might contain NUL's,
735 * we now use fwrite().
737 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
740 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
741 * is returned in "result".
744 #define YY_INPUT(buf,result,max_size) \
745 if ( yy_current_buffer->yy_is_interactive ) \
748 for ( n = 0; n < max_size && \
749 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
752 buf[n++] = (char) c; \
753 if ( c == EOF && ferror( yyin ) ) \
754 YY_FATAL_ERROR( "input in flex scanner failed" ); \
757 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
758 && ferror( yyin ) ) \
759 YY_FATAL_ERROR( "input in flex scanner failed" );
762 /* No semi-colon after return; correct usage is to write "yyterminate();" -
763 * we don't want an extra ';' after the "return" because that will cause
764 * some compilers to complain about unreachable statements.
767 #define yyterminate() return YY_NULL
770 /* Number of entries by which start-condition stack grows. */
771 #ifndef YY_START_STACK_INCR
772 #define YY_START_STACK_INCR 25
775 /* Report a fatal error. */
776 #ifndef YY_FATAL_ERROR
777 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
780 /* Default declaration of generated scanner - a define so the user can
781 * easily add parameters.
784 #define YY_DECL int yylex YY_PROTO(( void ))
787 /* Code executed at the beginning of each rule, after yytext and yyleng
790 #ifndef YY_USER_ACTION
791 #define YY_USER_ACTION
794 /* Code executed at the end of each rule. */
796 #define YY_BREAK break;
799 #define YY_RULE_SETUP \
804 register yy_state_type yy_current_state
;
805 register char *yy_cp
= NULL
, *yy_bp
= NULL
;
811 #line 812 "ada-lex.c"
822 yy_start
= 1; /* first start state */
830 if ( ! yy_current_buffer
)
832 yy_create_buffer( yyin
, YY_BUF_SIZE
);
834 yy_load_buffer_state();
837 while ( 1 ) /* loops until end-of-file is reached */
841 /* Support of yytext. */
842 *yy_cp
= yy_hold_char
;
844 /* yy_bp points to the position in yy_ch_buf of the start of
849 yy_current_state
= yy_start
;
853 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
854 if ( yy_accept
[yy_current_state
] )
856 yy_last_accepting_state
= yy_current_state
;
857 yy_last_accepting_cpos
= yy_cp
;
859 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
861 yy_current_state
= (int) yy_def
[yy_current_state
];
862 if ( yy_current_state
>= 190 )
863 yy_c
= yy_meta
[(unsigned int) yy_c
];
865 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
868 while ( yy_base
[yy_current_state
] != 736 );
871 yy_act
= yy_accept
[yy_current_state
];
873 { /* have to back up */
874 yy_cp
= yy_last_accepting_cpos
;
875 yy_current_state
= yy_last_accepting_state
;
876 yy_act
= yy_accept
[yy_current_state
];
882 do_action
: /* This label is used only to access EOF actions. */
886 { /* beginning of action switch */
887 case 0: /* must back up */
888 /* undo the effects of YY_DO_BEFORE_ACTION */
889 *yy_cp
= yy_hold_char
;
890 yy_cp
= yy_last_accepting_cpos
;
891 yy_current_state
= yy_last_accepting_state
;
908 canonicalizeNumeral (numbuf
, yytext
);
909 return processInt (NULL
, numbuf
, strrchr(numbuf
, 'e')+1);
916 canonicalizeNumeral (numbuf
, yytext
);
917 return processInt (NULL
, numbuf
, NULL
);
924 canonicalizeNumeral (numbuf
, yytext
);
925 return processInt (numbuf
,
926 strchr (numbuf
, '#') + 1,
927 strrchr(numbuf
, '#') + 1);
932 #line 103 "ada-lex.l"
934 canonicalizeNumeral (numbuf
, yytext
);
935 return processInt (numbuf
, strchr (numbuf
, '#') + 1, NULL
);
940 #line 108 "ada-lex.l"
942 canonicalizeNumeral (numbuf
, yytext
+2);
943 return processInt ("16#", numbuf
, NULL
);
948 #line 114 "ada-lex.l"
950 canonicalizeNumeral (numbuf
, yytext
);
951 return processReal (numbuf
);
956 #line 119 "ada-lex.l"
958 canonicalizeNumeral (numbuf
, yytext
);
959 return processReal (numbuf
);
964 #line 124 "ada-lex.l"
966 error (_("Based real literals not implemented yet."));
971 #line 128 "ada-lex.l"
973 error (_("Based real literals not implemented yet."));
978 #line 132 "ada-lex.l"
980 yylval
.typed_val
.type
= type_char ();
981 yylval
.typed_val
.val
= yytext
[1];
987 #line 138 "ada-lex.l"
990 yylval
.typed_val
.type
= type_char ();
991 sscanf (yytext
+3, "%2x", &v
);
992 yylval
.typed_val
.val
= v
;
998 #line 146 "ada-lex.l"
1000 yylval
.sval
= processString (yytext
+1, yyleng
-2);
1006 #line 151 "ada-lex.l"
1008 error (_("ill-formed or non-terminated string literal"));
1013 #line 156 "ada-lex.l"
1015 while (*lexptr
!= 'i' && *lexptr
!= 'I')
1024 #line 165 "ada-lex.l"
1029 #line 166 "ada-lex.l"
1034 #line 167 "ada-lex.l"
1039 #line 168 "ada-lex.l"
1044 #line 169 "ada-lex.l"
1049 #line 170 "ada-lex.l"
1054 #line 171 "ada-lex.l"
1059 #line 172 "ada-lex.l"
1060 { return NULL_PTR
; }
1064 #line 173 "ada-lex.l"
1069 #line 174 "ada-lex.l"
1074 #line 175 "ada-lex.l"
1079 #line 176 "ada-lex.l"
1084 #line 177 "ada-lex.l"
1087 /* BOOLEAN "KEYWORDS" */
1088 /* True and False are not keywords in Ada, but rather enumeration constants.
1089 However, the boolean type is no longer represented as an enum, so True
1090 and False are no longer defined in symbol tables. We compromise by
1091 making them keywords (when bare). */
1094 #line 186 "ada-lex.l"
1095 { return TRUEKEYWORD
; }
1099 #line 187 "ada-lex.l"
1100 { return FALSEKEYWORD
; }
1105 #line 191 "ada-lex.l"
1106 { return processAttribute (yytext
+1); }
1111 #line 195 "ada-lex.l"
1116 #line 196 "ada-lex.l"
1121 #line 197 "ada-lex.l"
1122 { return STARSTAR
; }
1126 #line 198 "ada-lex.l"
1131 #line 199 "ada-lex.l"
1132 { return NOTEQUAL
; }
1136 #line 200 "ada-lex.l"
1141 #line 201 "ada-lex.l"
1146 #line 203 "ada-lex.l"
1147 { BEGIN INITIAL
; return '\''; }
1151 #line 205 "ada-lex.l"
1152 { return yytext
[0]; }
1156 #line 207 "ada-lex.l"
1157 { if (paren_depth
== 0 && comma_terminates
)
1169 #line 217 "ada-lex.l"
1170 { paren_depth
+= 1; return '('; }
1174 #line 218 "ada-lex.l"
1175 { if (paren_depth
== 0)
1190 #line 231 "ada-lex.l"
1195 #line 233 "ada-lex.l"
1197 yylval
.sval
= processId (yytext
+1, yyleng
-1);
1203 #line 238 "ada-lex.l"
1205 int all_posn
= find_dot_all (yytext
);
1207 if (all_posn
== -1 && yytext
[yyleng
-1] == '\'')
1209 BEGIN BEFORE_QUAL_QUOTE
;
1212 else if (all_posn
>= 0)
1214 yylval
.sval
= processId (yytext
, yyleng
);
1218 /* GDB EXPRESSION CONSTRUCTS */
1221 #line 255 "ada-lex.l"
1223 yyless (yyleng
- 2);
1224 yylval
.sval
= processId (yytext
, yyleng
);
1230 #line 261 "ada-lex.l"
1231 { return COLONCOLON
; }
1235 #line 263 "ada-lex.l"
1236 { return yytext
[0]; }
1238 /* REGISTERS AND GDB CONVENIENCE VARIABLES */
1241 #line 267 "ada-lex.l"
1243 yylval
.sval
.ptr
= yytext
;
1244 yylval
.sval
.length
= yyleng
;
1245 return SPECIAL_VARIABLE
;
1248 /* CATCH-ALL ERROR CASE */
1251 #line 275 "ada-lex.l"
1252 { error (_("Invalid character '%s' in expression."), yytext
); }
1256 #line 276 "ada-lex.l"
1257 YY_FATAL_ERROR( "flex scanner jammed" );
1259 #line 1260 "ada-lex.c"
1260 case YY_STATE_EOF(INITIAL
):
1261 case YY_STATE_EOF(BEFORE_QUAL_QUOTE
):
1264 case YY_END_OF_BUFFER
:
1266 /* Amount of text matched not including the EOB char. */
1267 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
1269 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1270 *yy_cp
= yy_hold_char
;
1271 YY_RESTORE_YY_MORE_OFFSET
1273 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1275 /* We're scanning a new file or input source. It's
1276 * possible that this happened because the user
1277 * just pointed yyin at a new source and called
1278 * yylex(). If so, then we have to assure
1279 * consistency between yy_current_buffer and our
1280 * globals. Here is the right place to do so, because
1281 * this is the first action (other than possibly a
1282 * back-up) that will match for the new input source.
1284 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1285 yy_current_buffer
->yy_input_file
= yyin
;
1286 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1289 /* Note that here we test for yy_c_buf_p "<=" to the position
1290 * of the first EOB in the buffer, since yy_c_buf_p will
1291 * already have been incremented past the NUL character
1292 * (since all states make transitions on EOB to the
1293 * end-of-buffer state). Contrast this with the test
1296 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1297 { /* This was really a NUL. */
1298 yy_state_type yy_next_state
;
1300 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1302 yy_current_state
= yy_get_previous_state();
1304 /* Okay, we're now positioned to make the NUL
1305 * transition. We couldn't have
1306 * yy_get_previous_state() go ahead and do it
1307 * for us because it doesn't know how to deal
1308 * with the possibility of jamming (and we don't
1309 * want to build jamming into it because then it
1310 * will run more slowly).
1313 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1315 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1317 if ( yy_next_state
)
1319 /* Consume the NUL. */
1320 yy_cp
= ++yy_c_buf_p
;
1321 yy_current_state
= yy_next_state
;
1328 goto yy_find_action
;
1332 else switch ( yy_get_next_buffer() )
1334 case EOB_ACT_END_OF_FILE
:
1336 yy_did_buffer_switch_on_eof
= 0;
1340 /* Note: because we've taken care in
1341 * yy_get_next_buffer() to have set up
1342 * yytext, we can now set up
1343 * yy_c_buf_p so that if some total
1344 * hoser (like flex itself) wants to
1345 * call the scanner after we return the
1346 * YY_NULL, it'll still work - another
1347 * YY_NULL will get returned.
1349 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
1351 yy_act
= YY_STATE_EOF(YY_START
);
1357 if ( ! yy_did_buffer_switch_on_eof
)
1363 case EOB_ACT_CONTINUE_SCAN
:
1365 yytext_ptr
+ yy_amount_of_matched_text
;
1367 yy_current_state
= yy_get_previous_state();
1370 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1373 case EOB_ACT_LAST_MATCH
:
1375 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
1377 yy_current_state
= yy_get_previous_state();
1380 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1381 goto yy_find_action
;
1388 "fatal flex scanner internal error--no action found" );
1389 } /* end of action switch */
1390 } /* end of scanning one token */
1391 } /* end of yylex */
1394 /* yy_get_next_buffer - try to read in a new buffer
1396 * Returns a code representing an action:
1397 * EOB_ACT_LAST_MATCH -
1398 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1399 * EOB_ACT_END_OF_FILE - end of file
1402 static int yy_get_next_buffer()
1404 register char *dest
= yy_current_buffer
->yy_ch_buf
;
1405 register char *source
= yytext_ptr
;
1406 register int number_to_move
, i
;
1409 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
1411 "fatal flex scanner internal error--end of buffer missed" );
1413 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
1414 { /* Don't try to fill the buffer, so this is an EOF. */
1415 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
1417 /* We matched a single character, the EOB, so
1418 * treat this as a final EOF.
1420 return EOB_ACT_END_OF_FILE
;
1425 /* We matched some text prior to the EOB, first
1428 return EOB_ACT_LAST_MATCH
;
1432 /* Try to read more data. */
1434 /* First move last chars to start of buffer. */
1435 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
1437 for ( i
= 0; i
< number_to_move
; ++i
)
1438 *(dest
++) = *(source
++);
1440 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1441 /* don't do the read, it's not guaranteed to return an EOF,
1444 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
1449 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
1451 while ( num_to_read
<= 0 )
1452 { /* Not enough room in the buffer - grow it. */
1453 #ifdef YY_USES_REJECT
1455 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1458 /* just a shorter name for the current buffer */
1459 YY_BUFFER_STATE b
= yy_current_buffer
;
1461 int yy_c_buf_p_offset
=
1462 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
1464 if ( b
->yy_is_our_buffer
)
1466 int new_size
= b
->yy_buf_size
* 2;
1468 if ( new_size
<= 0 )
1469 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1471 b
->yy_buf_size
*= 2;
1473 b
->yy_ch_buf
= (char *)
1474 /* Include room in for 2 EOB chars. */
1475 yyxrealloc( (void *) b
->yy_ch_buf
,
1476 b
->yy_buf_size
+ 2 );
1479 /* Can't grow it, we don't own it. */
1482 if ( ! b
->yy_ch_buf
)
1484 "fatal error - scanner input buffer overflow" );
1486 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1488 num_to_read
= yy_current_buffer
->yy_buf_size
-
1493 if ( num_to_read
> YY_READ_BUF_SIZE
)
1494 num_to_read
= YY_READ_BUF_SIZE
;
1496 /* Read in more data. */
1497 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
1498 yy_n_chars
, num_to_read
);
1500 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1503 if ( yy_n_chars
== 0 )
1505 if ( number_to_move
== YY_MORE_ADJ
)
1507 ret_val
= EOB_ACT_END_OF_FILE
;
1513 ret_val
= EOB_ACT_LAST_MATCH
;
1514 yy_current_buffer
->yy_buffer_status
=
1515 YY_BUFFER_EOF_PENDING
;
1520 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1522 yy_n_chars
+= number_to_move
;
1523 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1524 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1526 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
1532 /* yy_get_previous_state - get the state just before the EOB char was reached */
1534 static yy_state_type
yy_get_previous_state()
1536 register yy_state_type yy_current_state
;
1537 register char *yy_cp
;
1539 yy_current_state
= yy_start
;
1541 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
1543 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1544 if ( yy_accept
[yy_current_state
] )
1546 yy_last_accepting_state
= yy_current_state
;
1547 yy_last_accepting_cpos
= yy_cp
;
1549 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1551 yy_current_state
= (int) yy_def
[yy_current_state
];
1552 if ( yy_current_state
>= 190 )
1553 yy_c
= yy_meta
[(unsigned int) yy_c
];
1555 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1558 return yy_current_state
;
1562 /* yy_try_NUL_trans - try to make a transition on the NUL character
1565 * next_state = yy_try_NUL_trans( current_state );
1568 #ifdef YY_USE_PROTOS
1569 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
1571 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
1572 yy_state_type yy_current_state
;
1575 register int yy_is_jam
;
1576 register char *yy_cp
= yy_c_buf_p
;
1578 register YY_CHAR yy_c
= 1;
1579 if ( yy_accept
[yy_current_state
] )
1581 yy_last_accepting_state
= yy_current_state
;
1582 yy_last_accepting_cpos
= yy_cp
;
1584 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1586 yy_current_state
= (int) yy_def
[yy_current_state
];
1587 if ( yy_current_state
>= 190 )
1588 yy_c
= yy_meta
[(unsigned int) yy_c
];
1590 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1591 yy_is_jam
= (yy_current_state
== 189);
1593 return yy_is_jam
? 0 : yy_current_state
;
1598 #ifdef YY_USE_PROTOS
1599 static void yyunput( int c
, register char *yy_bp
)
1601 static void yyunput( c
, yy_bp
)
1603 register char *yy_bp
;
1606 register char *yy_cp
= yy_c_buf_p
;
1608 /* undo effects of setting up yytext */
1609 *yy_cp
= yy_hold_char
;
1611 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1612 { /* need to shift things up to make room */
1613 /* +2 for EOB chars. */
1614 register int number_to_move
= yy_n_chars
+ 2;
1615 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
1616 yy_current_buffer
->yy_buf_size
+ 2];
1617 register char *source
=
1618 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1620 while ( source
> yy_current_buffer
->yy_ch_buf
)
1621 *--dest
= *--source
;
1623 yy_cp
+= (int) (dest
- source
);
1624 yy_bp
+= (int) (dest
- source
);
1625 yy_current_buffer
->yy_n_chars
=
1626 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1628 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1629 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1632 *--yy_cp
= (char) c
;
1636 yy_hold_char
= *yy_cp
;
1639 #endif /* ifndef YY_NO_UNPUT */
1644 static int yyinput()
1651 *yy_c_buf_p
= yy_hold_char
;
1653 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1655 /* yy_c_buf_p now points to the character we want to return.
1656 * If this occurs *before* the EOB characters, then it's a
1657 * valid NUL; if not, then we've hit the end of the buffer.
1659 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1660 /* This was really a NUL. */
1664 { /* need more input */
1665 int offset
= yy_c_buf_p
- yytext_ptr
;
1668 switch ( yy_get_next_buffer() )
1670 case EOB_ACT_LAST_MATCH
:
1671 /* This happens because yy_g_n_b()
1672 * sees that we've accumulated a
1673 * token and flags that we need to
1674 * try matching the token before
1675 * proceeding. But for input(),
1676 * there's no matching to consider.
1677 * So convert the EOB_ACT_LAST_MATCH
1678 * to EOB_ACT_END_OF_FILE.
1681 /* Reset buffer status. */
1686 case EOB_ACT_END_OF_FILE
:
1691 if ( ! yy_did_buffer_switch_on_eof
)
1700 case EOB_ACT_CONTINUE_SCAN
:
1701 yy_c_buf_p
= yytext_ptr
+ offset
;
1707 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
1708 *yy_c_buf_p
= '\0'; /* preserve yytext */
1709 yy_hold_char
= *++yy_c_buf_p
;
1714 #endif /* YY_NO_INPUT */
1716 #ifdef YY_USE_PROTOS
1717 void yyrestart( FILE *input_file
)
1719 void yyrestart( input_file
)
1723 if ( ! yy_current_buffer
)
1724 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
1726 yy_init_buffer( yy_current_buffer
, input_file
);
1727 yy_load_buffer_state();
1731 #ifdef YY_USE_PROTOS
1732 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1734 void yy_switch_to_buffer( new_buffer
)
1735 YY_BUFFER_STATE new_buffer
;
1738 if ( yy_current_buffer
== new_buffer
)
1741 if ( yy_current_buffer
)
1743 /* Flush out information for old buffer. */
1744 *yy_c_buf_p
= yy_hold_char
;
1745 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1746 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1749 yy_current_buffer
= new_buffer
;
1750 yy_load_buffer_state();
1752 /* We don't actually know whether we did this switch during
1753 * EOF (yywrap()) processing, but the only time this flag
1754 * is looked at is after yywrap() is called, so it's safe
1755 * to go ahead and always set it.
1757 yy_did_buffer_switch_on_eof
= 1;
1761 #ifdef YY_USE_PROTOS
1762 void yy_load_buffer_state( void )
1764 void yy_load_buffer_state()
1767 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1768 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1769 yyin
= yy_current_buffer
->yy_input_file
;
1770 yy_hold_char
= *yy_c_buf_p
;
1774 #ifdef YY_USE_PROTOS
1775 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1777 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1784 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1786 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1788 b
->yy_buf_size
= size
;
1790 /* yy_ch_buf has to be 2 characters longer than the size given because
1791 * we need to put in 2 end-of-buffer characters.
1793 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
1794 if ( ! b
->yy_ch_buf
)
1795 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1797 b
->yy_is_our_buffer
= 1;
1799 yy_init_buffer( b
, file
);
1805 #ifdef YY_USE_PROTOS
1806 void yy_delete_buffer( YY_BUFFER_STATE b
)
1808 void yy_delete_buffer( b
)
1815 if ( b
== yy_current_buffer
)
1816 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1818 if ( b
->yy_is_our_buffer
)
1819 yy_flex_free( (void *) b
->yy_ch_buf
);
1821 yy_flex_free( (void *) b
);
1826 #ifdef YY_USE_PROTOS
1827 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1829 void yy_init_buffer( b
, file
)
1836 yy_flush_buffer( b
);
1838 b
->yy_input_file
= file
;
1839 b
->yy_fill_buffer
= 1;
1841 #if YY_ALWAYS_INTERACTIVE
1842 b
->yy_is_interactive
= 1;
1844 #if YY_NEVER_INTERACTIVE
1845 b
->yy_is_interactive
= 0;
1847 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1853 #ifdef YY_USE_PROTOS
1854 void yy_flush_buffer( YY_BUFFER_STATE b
)
1856 void yy_flush_buffer( b
)
1866 /* We always need two end-of-buffer characters. The first causes
1867 * a transition to the end-of-buffer state. The second causes
1868 * a jam in that state.
1870 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1871 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1873 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1876 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1878 if ( b
== yy_current_buffer
)
1879 yy_load_buffer_state();
1883 #ifndef YY_NO_SCAN_BUFFER
1884 #ifdef YY_USE_PROTOS
1885 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
1887 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
1895 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1896 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1897 /* They forgot to leave room for the EOB's. */
1900 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1902 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1904 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1905 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1906 b
->yy_is_our_buffer
= 0;
1907 b
->yy_input_file
= 0;
1908 b
->yy_n_chars
= b
->yy_buf_size
;
1909 b
->yy_is_interactive
= 0;
1911 b
->yy_fill_buffer
= 0;
1912 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1914 yy_switch_to_buffer( b
);
1921 #ifndef YY_NO_SCAN_STRING
1922 #ifdef YY_USE_PROTOS
1923 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
1925 YY_BUFFER_STATE
yy_scan_string( yy_str
)
1926 yyconst
char *yy_str
;
1930 for ( len
= 0; yy_str
[len
]; ++len
)
1933 return yy_scan_bytes( yy_str
, len
);
1938 #ifndef YY_NO_SCAN_BYTES
1939 #ifdef YY_USE_PROTOS
1940 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
1942 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
1943 yyconst
char *bytes
;
1952 /* Get memory for full buffer, including space for trailing EOB's. */
1954 buf
= (char *) yy_flex_alloc( n
);
1956 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1958 for ( i
= 0; i
< len
; ++i
)
1961 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
1963 b
= yy_scan_buffer( buf
, n
);
1965 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1967 /* It's okay to grow etc. this buffer, and we should throw it
1968 * away when we're done.
1970 b
->yy_is_our_buffer
= 1;
1977 #ifndef YY_NO_PUSH_STATE
1978 #ifdef YY_USE_PROTOS
1979 static void yy_push_state( int new_state
)
1981 static void yy_push_state( new_state
)
1985 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
1989 yy_start_stack_depth
+= YY_START_STACK_INCR
;
1990 new_size
= yy_start_stack_depth
* sizeof( int );
1992 if ( ! yy_start_stack
)
1993 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
1996 yy_start_stack
= (int *) yyxrealloc(
1997 (void *) yy_start_stack
, new_size
);
1999 if ( ! yy_start_stack
)
2001 "out of memory expanding start-condition stack" );
2004 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2011 #ifndef YY_NO_POP_STATE
2012 static void yy_pop_state()
2014 if ( --yy_start_stack_ptr
< 0 )
2015 YY_FATAL_ERROR( "start-condition stack underflow" );
2017 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2022 #ifndef YY_NO_TOP_STATE
2023 static int yy_top_state()
2025 return yy_start_stack
[yy_start_stack_ptr
- 1];
2029 #ifndef YY_EXIT_FAILURE
2030 #define YY_EXIT_FAILURE 2
2033 #ifdef YY_USE_PROTOS
2034 static void yy_fatal_error( yyconst
char msg
[] )
2036 static void yy_fatal_error( msg
)
2040 (void) fprintf( stderr
, "%s\n", msg
);
2041 exit( YY_EXIT_FAILURE
);
2046 /* Redefine yyless() so it works in section 3 code. */
2052 /* Undo effects of setting up yytext. */ \
2053 yytext[yyleng] = yy_hold_char; \
2054 yy_c_buf_p = yytext + n; \
2055 yy_hold_char = *yy_c_buf_p; \
2056 *yy_c_buf_p = '\0'; \
2062 /* Internal utility routines. */
2065 #ifdef YY_USE_PROTOS
2066 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2068 static void yy_flex_strncpy( s1
, s2
, n
)
2075 for ( i
= 0; i
< n
; ++i
)
2080 #ifdef YY_NEED_STRLEN
2081 #ifdef YY_USE_PROTOS
2082 static int yy_flex_strlen( yyconst
char *s
)
2084 static int yy_flex_strlen( s
)
2089 for ( n
= 0; s
[n
]; ++n
)
2097 #ifdef YY_USE_PROTOS
2098 static void *yy_flex_alloc( yy_size_t size
)
2100 static void *yy_flex_alloc( size
)
2104 return (void *) xmalloc( size
);
2107 #ifdef YY_USE_PROTOS
2108 static void *yyxrealloc( void *ptr
, yy_size_t size
)
2110 static void *yyxrealloc( ptr
, size
)
2115 /* The cast to (char *) in the following accommodates both
2116 * implementations that use char* generic pointers, and those
2117 * that use void* generic pointers. It works with the latter
2118 * because both ANSI C and C++ allow castless assignment from
2119 * any pointer type to void*, and deal with argument conversions
2120 * as though doing an assignment.
2122 return (void *) xrealloc( (char *) ptr
, size
);
2125 #ifdef YY_USE_PROTOS
2126 static void yy_flex_free( void *ptr
)
2128 static void yy_flex_free( ptr
)
2142 #line 276 "ada-lex.l"
2146 #include "gdb_string.h"
2148 /* Initialize the lexer for processing new expression. */
2151 lexer_init (FILE *inp
)
2158 /* Copy S2 to S1, removing all underscores, and downcasing all letters. */
2161 canonicalizeNumeral (char *s1
, const char *s2
)
2163 for (; *s2
!= '\000'; s2
+= 1)
2174 /* Interprets the prefix of NUM that consists of digits of the given BASE
2175 as an integer of that BASE, with the string EXP as an exponent.
2176 Puts value in yylval, and returns INT, if the string is valid. Causes
2177 an error if the number is improperly formated. BASE, if NULL, defaults
2178 to "10", and EXP to "1". The EXP does not contain a leading 'e' or 'E'.
2182 processInt (const char *base0
, const char *num0
, const char *exp0
)
2194 base
= strtol (base0
, (char **) NULL
, 10);
2195 if (base
< 2 || base
> 16)
2196 error (_("Invalid base: %d."), base
);
2202 exp
= strtol(exp0
, (char **) NULL
, 10);
2205 result
= strtoulst (num0
, (const char **) &trailer
, base
);
2206 if (errno
== ERANGE
)
2207 error (_("Integer literal out of range"));
2208 if (isxdigit(*trailer
))
2209 error (_("Invalid digit `%c' in based literal"), *trailer
);
2213 if (result
> (ULONG_MAX
/ base
))
2214 error (_("Integer literal out of range"));
2219 if ((result
>> (gdbarch_int_bit (parse_gdbarch
)-1)) == 0)
2220 yylval
.typed_val
.type
= type_int ();
2221 else if ((result
>> (gdbarch_long_bit (parse_gdbarch
)-1)) == 0)
2222 yylval
.typed_val
.type
= type_long ();
2223 else if (((result
>> (gdbarch_long_bit (parse_gdbarch
)-1)) >> 1) == 0)
2225 /* We have a number representable as an unsigned integer quantity.
2226 For consistency with the C treatment, we will treat it as an
2227 anonymous modular (unsigned) quantity. Alas, the types are such
2228 that we need to store .val as a signed quantity. Sorry
2229 for the mess, but C doesn't officially guarantee that a simple
2230 assignment does the trick (no, it doesn't; read the reference manual).
2232 yylval
.typed_val
.type
2233 = builtin_type (parse_gdbarch
)->builtin_unsigned_long
;
2234 if (result
& LONGEST_SIGN
)
2235 yylval
.typed_val
.val
=
2236 (LONGEST
) (result
& ~LONGEST_SIGN
)
2237 - (LONGEST_SIGN
>>1) - (LONGEST_SIGN
>>1);
2239 yylval
.typed_val
.val
= (LONGEST
) result
;
2243 yylval
.typed_val
.type
= type_long_long ();
2245 yylval
.typed_val
.val
= (LONGEST
) result
;
2250 processReal (const char *num0
)
2252 sscanf (num0
, "%" DOUBLEST_SCAN_FORMAT
, &yylval
.typed_val_float
.dval
);
2254 yylval
.typed_val_float
.type
= type_float ();
2255 if (sizeof(DOUBLEST
) >= gdbarch_double_bit (parse_gdbarch
)
2257 yylval
.typed_val_float
.type
= type_double ();
2258 if (sizeof(DOUBLEST
) >= gdbarch_long_double_bit (parse_gdbarch
)
2260 yylval
.typed_val_float
.type
= type_long_double ();
2266 /* Store a canonicalized version of NAME0[0..LEN-1] in yylval.ssym. The
2267 resulting string is valid until the next call to ada_parse. It differs
2269 + Characters between '...' or <...> are transfered verbatim to
2271 + <, >, and trailing "'" characters in quoted sequences are removed
2272 (a leading quote is preserved to indicate that the name is not to be
2274 + Unquoted whitespace is removed.
2275 + Unquoted alphabetic characters are mapped to lower case.
2276 Result is returned as a struct stoken, but for convenience, the string
2277 is also null-terminated. Result string valid until the next call of
2280 static struct stoken
2281 processId (const char *name0
, int len
)
2283 char *name
= obstack_alloc (&temp_parse_space
, len
+ 11);
2285 struct stoken result
;
2287 while (len
> 0 && isspace (name0
[len
-1]))
2292 if (isalnum (name0
[i0
]))
2294 name
[i
] = tolower (name0
[i0
]);
2297 else switch (name0
[i0
])
2300 name
[i
] = name0
[i0
];
2303 case ' ': case '\t':
2309 name
[i
] = name0
[i0
];
2312 while (i0
< len
&& name0
[i0
] != '\'');
2317 while (i0
< len
&& name0
[i0
] != '>')
2319 name
[i
] = name0
[i0
];
2333 /* Return TEXT[0..LEN-1], a string literal without surrounding quotes,
2334 with special hex character notations replaced with characters.
2335 Result valid until the next call to ada_parse. */
2337 static struct stoken
2338 processString (const char *text
, int len
)
2342 const char *lim
= text
+ len
;
2343 struct stoken result
;
2345 q
= result
.ptr
= obstack_alloc (&temp_parse_space
, len
);
2349 if (p
[0] == '[' && p
[1] == '"' && p
+2 < lim
)
2351 if (p
[2] == '"') /* "...["""]... */
2359 sscanf (p
+2, "%2x", &chr
);
2369 result
.length
= q
- result
.ptr
;
2373 /* Returns the position within STR of the '.' in a
2374 '.{WHITE}*all' component of a dotted name, or -1 if there is none.
2375 Note: we actually don't need this routine, since 'all' can never be an
2376 Ada identifier. Thus, looking up foo.all or foo.all.x as a name
2377 must fail, and will eventually be interpreted as (foo).all or
2378 (foo).all.x. However, this does avoid an extraneous lookup. */
2381 find_dot_all (const char *str
)
2384 for (i
= 0; str
[i
] != '\000'; i
+= 1)
2391 while (isspace (str
[i
]));
2392 if (strncmp (str
+i
, "all", 3) == 0
2393 && ! isalnum (str
[i
+3]) && str
[i
+3] != '_')
2400 /* Returns non-zero iff string SUBSEQ matches a subsequence of STR, ignoring
2404 subseqMatch (const char *subseq
, const char *str
)
2406 if (subseq
[0] == '\0')
2408 else if (str
[0] == '\0')
2410 else if (tolower (subseq
[0]) == tolower (str
[0]))
2411 return subseqMatch (subseq
+1, str
+1) || subseqMatch (subseq
, str
+1);
2413 return subseqMatch (subseq
, str
+1);
2417 static struct { const char *name
; int code
; }
2419 { "address", TICK_ADDRESS
},
2420 { "unchecked_access", TICK_ACCESS
},
2421 { "unrestricted_access", TICK_ACCESS
},
2422 { "access", TICK_ACCESS
},
2423 { "first", TICK_FIRST
},
2424 { "last", TICK_LAST
},
2425 { "length", TICK_LENGTH
},
2426 { "max", TICK_MAX
},
2427 { "min", TICK_MIN
},
2428 { "modulus", TICK_MODULUS
},
2429 { "pos", TICK_POS
},
2430 { "range", TICK_RANGE
},
2431 { "size", TICK_SIZE
},
2432 { "tag", TICK_TAG
},
2433 { "val", TICK_VAL
},
2437 /* Return the syntactic code corresponding to the attribute name or
2438 abbreviation STR. */
2441 processAttribute (const char *str
)
2445 for (i
= 0; attributes
[i
].code
!= -1; i
+= 1)
2446 if (strcasecmp (str
, attributes
[i
].name
) == 0)
2447 return attributes
[i
].code
;
2449 for (i
= 0, k
= -1; attributes
[i
].code
!= -1; i
+= 1)
2450 if (subseqMatch (str
, attributes
[i
].name
))
2455 error (_("ambiguous attribute name: `%s'"), str
);
2458 error (_("unrecognized attribute: `%s'"), str
);
2460 return attributes
[k
].code
;
2469 /* Dummy definition to suppress warnings about unused static definitions. */
2470 typedef void (*dummy_function
) ();
2471 dummy_function ada_flex_use
[] =
2473 (dummy_function
) yyunput