Upgrade GDB from 7.4.1 to 7.6.1 on the vendor branch
[dragonfly.git] / contrib / gdb-7 / gdb / ada-lex.c
CommitLineData
5796c8dc 1#line 2 "ada-lex.c"
5796c8dc 2
ef5ccd6c
JM
3#line 4 "ada-lex.c"
4
5#define YY_INT_ALIGNED short int
6
7/* A lexical scanner generated by flex */
5796c8dc
SS
8
9#define FLEX_SCANNER
10#define YY_FLEX_MAJOR_VERSION 2
11#define YY_FLEX_MINOR_VERSION 5
ef5ccd6c
JM
12#define YY_FLEX_SUBMINOR_VERSION 35
13#if YY_FLEX_SUBMINOR_VERSION > 0
14#define FLEX_BETA
15#endif
5796c8dc 16
ef5ccd6c
JM
17/* First, we deal with platform-specific or compiler-specific issues. */
18
19/* begin standard C headers. */
5796c8dc 20#include <stdio.h>
ef5ccd6c
JM
21#include <string.h>
22#include <errno.h>
23#include <stdlib.h>
5796c8dc 24
ef5ccd6c 25/* end standard C headers. */
5796c8dc 26
ef5ccd6c
JM
27/* flex integer type definitions */
28
29#ifndef FLEXINT_H
30#define FLEXINT_H
31
32/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
36/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
38 */
39#ifndef __STDC_LIMIT_MACROS
40#define __STDC_LIMIT_MACROS 1
41#endif
42
43#include <inttypes.h>
44typedef int8_t flex_int8_t;
45typedef uint8_t flex_uint8_t;
46typedef int16_t flex_int16_t;
47typedef uint16_t flex_uint16_t;
48typedef int32_t flex_int32_t;
49typedef uint32_t flex_uint32_t;
50#else
51typedef signed char flex_int8_t;
52typedef short int flex_int16_t;
53typedef int flex_int32_t;
54typedef unsigned char flex_uint8_t;
55typedef unsigned short int flex_uint16_t;
56typedef unsigned int flex_uint32_t;
57#endif /* ! C99 */
58
59/* Limits of integral types. */
60#ifndef INT8_MIN
61#define INT8_MIN (-128)
62#endif
63#ifndef INT16_MIN
64#define INT16_MIN (-32767-1)
65#endif
66#ifndef INT32_MIN
67#define INT32_MIN (-2147483647-1)
68#endif
69#ifndef INT8_MAX
70#define INT8_MAX (127)
71#endif
72#ifndef INT16_MAX
73#define INT16_MAX (32767)
74#endif
75#ifndef INT32_MAX
76#define INT32_MAX (2147483647)
77#endif
78#ifndef UINT8_MAX
79#define UINT8_MAX (255U)
5796c8dc 80#endif
ef5ccd6c
JM
81#ifndef UINT16_MAX
82#define UINT16_MAX (65535U)
83#endif
84#ifndef UINT32_MAX
85#define UINT32_MAX (4294967295U)
5796c8dc
SS
86#endif
87
ef5ccd6c 88#endif /* ! FLEXINT_H */
5796c8dc
SS
89
90#ifdef __cplusplus
91
5796c8dc
SS
92/* The "const" storage-class-modifier is valid. */
93#define YY_USE_CONST
94
95#else /* ! __cplusplus */
96
ef5ccd6c
JM
97/* C99 requires __STDC__ to be defined as 1. */
98#if defined (__STDC__)
5796c8dc 99
5796c8dc
SS
100#define YY_USE_CONST
101
ef5ccd6c 102#endif /* defined (__STDC__) */
5796c8dc
SS
103#endif /* ! __cplusplus */
104
5796c8dc
SS
105#ifdef YY_USE_CONST
106#define yyconst const
107#else
108#define yyconst
109#endif
110
5796c8dc
SS
111/* Returned upon end-of-file. */
112#define YY_NULL 0
113
114/* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
117 * double cast.
118 */
119#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
121/* Enter a start condition. This macro really ought to take a parameter,
122 * but we do it the disgusting crufty way forced on us by the ()-less
123 * definition of BEGIN.
124 */
ef5ccd6c 125#define BEGIN (yy_start) = 1 + 2 *
5796c8dc
SS
126
127/* Translate the current start state into a value that can be later handed
128 * to BEGIN to return to the state. The YYSTATE alias is for lex
129 * compatibility.
130 */
ef5ccd6c 131#define YY_START (((yy_start) - 1) / 2)
5796c8dc
SS
132#define YYSTATE YY_START
133
134/* Action number for EOF rule of a given start state. */
135#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136
137/* Special action meaning "start processing a new file". */
ef5ccd6c 138#define YY_NEW_FILE yyrestart(yyin )
5796c8dc
SS
139
140#define YY_END_OF_BUFFER_CHAR 0
141
142/* Size of default input buffer. */
ef5ccd6c 143#ifndef YY_BUF_SIZE
5796c8dc 144#define YY_BUF_SIZE 16384
ef5ccd6c
JM
145#endif
146
147/* The state buf must be large enough to hold one state per character in the main buffer.
148 */
149#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
5796c8dc 150
ef5ccd6c
JM
151#ifndef YY_TYPEDEF_YY_BUFFER_STATE
152#define YY_TYPEDEF_YY_BUFFER_STATE
5796c8dc 153typedef struct yy_buffer_state *YY_BUFFER_STATE;
ef5ccd6c 154#endif
5796c8dc
SS
155
156extern int yyleng;
ef5ccd6c 157
5796c8dc
SS
158extern FILE *yyin, *yyout;
159
160#define EOB_ACT_CONTINUE_SCAN 0
161#define EOB_ACT_END_OF_FILE 1
162#define EOB_ACT_LAST_MATCH 2
163
ef5ccd6c
JM
164 #define YY_LESS_LINENO(n)
165
166/* Return all but the first "n" matched characters back to the input stream. */
5796c8dc
SS
167#define yyless(n) \
168 do \
169 { \
170 /* Undo effects of setting up yytext. */ \
ef5ccd6c
JM
171 int yyless_macro_arg = (n); \
172 YY_LESS_LINENO(yyless_macro_arg);\
173 *yy_cp = (yy_hold_char); \
5796c8dc 174 YY_RESTORE_YY_MORE_OFFSET \
ef5ccd6c 175 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
5796c8dc
SS
176 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
177 } \
178 while ( 0 )
179
ef5ccd6c 180#define unput(c) yyunput( c, (yytext_ptr) )
5796c8dc 181
ef5ccd6c
JM
182#ifndef YY_TYPEDEF_YY_SIZE_T
183#define YY_TYPEDEF_YY_SIZE_T
184typedef size_t yy_size_t;
185#endif
5796c8dc 186
ef5ccd6c
JM
187#ifndef YY_STRUCT_YY_BUFFER_STATE
188#define YY_STRUCT_YY_BUFFER_STATE
5796c8dc
SS
189struct yy_buffer_state
190 {
191 FILE *yy_input_file;
192
193 char *yy_ch_buf; /* input buffer */
194 char *yy_buf_pos; /* current position in input buffer */
195
196 /* Size of input buffer in bytes, not including room for EOB
197 * characters.
198 */
199 yy_size_t yy_buf_size;
200
201 /* Number of characters read into yy_ch_buf, not including EOB
202 * characters.
203 */
204 int yy_n_chars;
205
206 /* Whether we "own" the buffer - i.e., we know we created it,
207 * and can xrealloc() it to grow it, and should xfree() it to
208 * delete it.
209 */
210 int yy_is_our_buffer;
211
212 /* Whether this is an "interactive" input source; if so, and
213 * if we're using stdio for input, then we want to use getc()
214 * instead of fread(), to make sure we stop fetching input after
215 * each newline.
216 */
217 int yy_is_interactive;
218
219 /* Whether we're considered to be at the beginning of a line.
220 * If so, '^' rules will be active on the next match, otherwise
221 * not.
222 */
223 int yy_at_bol;
224
ef5ccd6c
JM
225 int yy_bs_lineno; /**< The line count. */
226 int yy_bs_column; /**< The column count. */
227
5796c8dc
SS
228 /* Whether to try to fill the input buffer when we reach the
229 * end of it.
230 */
231 int yy_fill_buffer;
232
233 int yy_buffer_status;
ef5ccd6c 234
5796c8dc
SS
235#define YY_BUFFER_NEW 0
236#define YY_BUFFER_NORMAL 1
237 /* When an EOF's been seen but there's still some text to process
238 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
239 * shouldn't try reading from the input source any more. We might
240 * still have a bunch of tokens to match, though, because of
241 * possible backing-up.
242 *
243 * When we actually see the EOF, we change the status to "new"
244 * (via yyrestart()), so that the user can continue scanning by
245 * just pointing yyin at a new input file.
246 */
247#define YY_BUFFER_EOF_PENDING 2
ef5ccd6c 248
5796c8dc 249 };
ef5ccd6c 250#endif /* !YY_STRUCT_YY_BUFFER_STATE */
5796c8dc 251
ef5ccd6c
JM
252/* Stack of input buffers. */
253static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
254static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
255static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
5796c8dc
SS
256
257/* We provide macros for accessing buffer states in case in the
258 * future we want to put the buffer states in a more general
259 * "scanner state".
ef5ccd6c
JM
260 *
261 * Returns the top of the stack, or NULL.
5796c8dc 262 */
ef5ccd6c
JM
263#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
264 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
265 : NULL)
5796c8dc 266
ef5ccd6c
JM
267/* Same as previous macro, but useful when we know that the buffer stack is not
268 * NULL or when we need an lvalue. For internal use only.
269 */
270#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
5796c8dc
SS
271
272/* yy_hold_char holds the character lost when yytext is formed. */
273static char yy_hold_char;
5796c8dc 274static int yy_n_chars; /* number of characters read into yy_ch_buf */
5796c8dc
SS
275int yyleng;
276
277/* Points to current character in buffer. */
278static char *yy_c_buf_p = (char *) 0;
ef5ccd6c 279static int yy_init = 0; /* whether we need to initialize */
5796c8dc
SS
280static int yy_start = 0; /* start state number */
281
282/* Flag which is used to allow yywrap()'s to do buffer switches
283 * instead of setting up a fresh yyin. A bit of a hack ...
284 */
285static int yy_did_buffer_switch_on_eof;
286
ef5ccd6c
JM
287void yyrestart (FILE *input_file );
288void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
289YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
290void yy_delete_buffer (YY_BUFFER_STATE b );
291void yy_flush_buffer (YY_BUFFER_STATE b );
292void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
293void yypop_buffer_state (void );
5796c8dc 294
ef5ccd6c
JM
295static void yyensure_buffer_stack (void );
296static void yy_load_buffer_state (void );
297static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
5796c8dc 298
ef5ccd6c 299#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
5796c8dc 300
ef5ccd6c
JM
301YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
302YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
303YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
304
305void *yyalloc (yy_size_t );
306void *yyxrealloc (void *,yy_size_t );
307void yyfree (void * );
5796c8dc
SS
308
309#define yy_new_buffer yy_create_buffer
310
311#define yy_set_interactive(is_interactive) \
312 { \
ef5ccd6c
JM
313 if ( ! YY_CURRENT_BUFFER ){ \
314 yyensure_buffer_stack (); \
315 YY_CURRENT_BUFFER_LVALUE = \
316 yy_create_buffer(yyin,YY_BUF_SIZE ); \
317 } \
318 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
5796c8dc
SS
319 }
320
321#define yy_set_bol(at_bol) \
322 { \
ef5ccd6c
JM
323 if ( ! YY_CURRENT_BUFFER ){\
324 yyensure_buffer_stack (); \
325 YY_CURRENT_BUFFER_LVALUE = \
326 yy_create_buffer(yyin,YY_BUF_SIZE ); \
327 } \
328 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
5796c8dc
SS
329 }
330
ef5ccd6c
JM
331#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
332
333/* Begin user sect3 */
5796c8dc
SS
334
335typedef unsigned char YY_CHAR;
ef5ccd6c 336
5796c8dc 337FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
ef5ccd6c 338
5796c8dc 339typedef int yy_state_type;
ef5ccd6c
JM
340
341extern int yylineno;
342
343int yylineno = 1;
344
5796c8dc
SS
345extern char *yytext;
346#define yytext_ptr yytext
347
ef5ccd6c
JM
348static yy_state_type yy_get_previous_state (void );
349static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
350static int yy_get_next_buffer (void );
351static void yy_fatal_error (yyconst char msg[] );
5796c8dc
SS
352
353/* Done after the current pattern has been matched and before the
354 * corresponding action - sets up yytext.
355 */
356#define YY_DO_BEFORE_ACTION \
ef5ccd6c
JM
357 (yytext_ptr) = yy_bp; \
358 yyleng = (size_t) (yy_cp - yy_bp); \
359 (yy_hold_char) = *yy_cp; \
5796c8dc 360 *yy_cp = '\0'; \
ef5ccd6c 361 (yy_c_buf_p) = yy_cp;
5796c8dc 362
ef5ccd6c
JM
363#define YY_NUM_RULES 55
364#define YY_END_OF_BUFFER 56
365/* This struct is not used in this scanner,
366 but its presence is necessary. */
367struct yy_trans_info
368 {
369 flex_int32_t yy_verify;
370 flex_int32_t yy_nxt;
371 };
372static yyconst flex_int16_t yy_accept[207] =
5796c8dc 373 { 0,
ef5ccd6c
JM
374 0, 0, 0, 0, 56, 54, 1, 1, 15, 53,
375 43, 54, 45, 46, 43, 44, 43, 43, 43, 4,
376 4, 43, 43, 43, 43, 52, 49, 49, 49, 49,
377 49, 49, 49, 49, 49, 49, 49, 42, 0, 14,
378 0, 53, 0, 0, 0, 0, 0, 0, 0, 37,
379 2, 0, 36, 0, 48, 48, 39, 0, 0, 4,
380 0, 0, 51, 38, 40, 0, 35, 41, 0, 0,
381 49, 0, 49, 49, 49, 49, 49, 16, 22, 49,
382 49, 49, 49, 27, 49, 49, 49, 49, 49, 49,
383 0, 14, 0, 12, 12, 34, 0, 2, 0, 48,
384
385 48, 0, 9, 0, 3, 7, 0, 49, 0, 0,
386 0, 49, 19, 20, 49, 49, 23, 24, 25, 49,
387 49, 29, 49, 49, 49, 49, 31, 0, 0, 0,
388 0, 0, 0, 48, 47, 6, 0, 0, 9, 0,
cf7f2e2d 389 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
ef5ccd6c
JM
390 0, 0, 0, 49, 21, 49, 26, 49, 17, 30,
391 49, 32, 0, 50, 0, 0, 0, 0, 49, 0,
392 0, 0, 0, 0, 0, 0, 0, 33, 49, 49,
393 0, 0, 5, 11, 0, 8, 0, 0, 0, 0,
394 0, 0, 28, 49, 0, 5, 0, 8, 0, 0,
cf7f2e2d 395
ef5ccd6c 396 13, 0, 18, 10, 10, 0
5796c8dc
SS
397 } ;
398
ef5ccd6c 399static yyconst flex_int32_t yy_ec[256] =
5796c8dc
SS
400 { 0,
401 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 4, 5, 6, 7, 8, 5, 9, 10, 11,
405 12, 13, 14, 15, 16, 17, 18, 19, 20, 20,
406 20, 20, 20, 20, 20, 20, 20, 21, 22, 23,
ef5ccd6c
JM
407 24, 25, 5, 26, 27, 28, 29, 30, 31, 32,
408 33, 34, 35, 33, 36, 37, 38, 39, 40, 33,
409 33, 41, 42, 43, 44, 33, 45, 46, 33, 33,
410 47, 5, 48, 5, 49, 5, 50, 51, 29, 52,
411
412 53, 54, 33, 55, 56, 33, 57, 58, 59, 60,
413 61, 33, 33, 62, 63, 64, 65, 33, 66, 67,
414 33, 33, 26, 22, 26, 5, 1, 1, 1, 1,
5796c8dc
SS
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1
429 } ;
430
ef5ccd6c 431static yyconst flex_int32_t yy_meta[68] =
5796c8dc
SS
432 { 0,
433 1, 2, 3, 4, 5, 6, 7, 8, 5, 9,
434 5, 5, 5, 5, 5, 5, 10, 5, 11, 11,
ef5ccd6c
JM
435 5, 5, 12, 13, 14, 5, 15, 15, 15, 15,
436 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
437 16, 16, 16, 16, 16, 16, 5, 5, 17, 15,
438 15, 15, 15, 15, 16, 16, 16, 16, 16, 16,
439 16, 16, 16, 16, 16, 16, 16
5796c8dc
SS
440 } ;
441
ef5ccd6c 442static yyconst flex_int16_t yy_base[229] =
5796c8dc 443 { 0,
ef5ccd6c
JM
444 0, 0, 649, 638, 646, 1252, 1252, 1252, 62, 0,
445 1252, 109, 1252, 1252, 623, 1252, 619, 175, 606, 174,
446 180, 48, 604, 592, 590, 1252, 204, 71, 214, 186,
447 235, 244, 304, 256, 39, 368, 40, 430, 179, 1252,
448 195, 0, 602, 595, 592, 585, 574, 497, 72, 1252,
449 0, 273, 1252, 0, 39, 0, 1252, 0, 66, 262,
450 75, 0, 1252, 1252, 1252, 557, 1252, 1252, 284, 300,
451 1252, 322, 329, 349, 358, 377, 339, 396, 412, 563,
452 566, 575, 584, 587, 569, 596, 623, 616, 576, 617,
453 571, 568, 334, 380, 1252, 562, 677, 0, 403, 0,
454
455 40, 89, 642, 71, 163, 0, 401, 672, 401, 723,
456 0, 708, 741, 750, 637, 776, 785, 794, 797, 806,
457 775, 827, 831, 843, 818, 819, 883, 415, 0, 712,
458 399, 885, 352, 1252, 0, 191, 0, 202, 772, 170,
459 243, 334, 222, 244, 247, 259, 766, 47, 209, 216,
460 203, 251, 302, 892, 916, 890, 942, 715, 946, 958,
461 930, 974, 274, 1252, 93, 344, 278, 310, 979, 256,
462 264, 337, 270, 274, 352, 355, 215, 984, 995, 1000,
463 299, 354, 589, 355, 223, 603, 209, 204, 198, 189,
464 174, 101, 1004, 1016, 92, 634, 411, 644, 872, 1021,
465
466 717, 373, 1252, 793, 832, 1252, 1055, 1065, 1081, 1086,
467 1102, 1119, 1136, 1139, 1146, 339, 560, 1153, 1169, 1181,
468 1186, 1197, 1200, 1216, 634, 645, 1223, 1234
5796c8dc
SS
469 } ;
470
ef5ccd6c 471static yyconst flex_int16_t yy_def[229] =
5796c8dc 472 { 0,
ef5ccd6c
JM
473 206, 1, 1, 1, 206, 206, 206, 206, 207, 208,
474 206, 206, 206, 206, 206, 206, 206, 209, 206, 206,
475 206, 206, 210, 206, 206, 206, 211, 211, 211, 211,
476 211, 211, 211, 211, 33, 211, 33, 206, 207, 206,
477 207, 208, 212, 38, 38, 212, 206, 206, 212, 206,
478 213, 209, 206, 214, 215, 215, 206, 216, 206, 206,
479 206, 217, 206, 206, 206, 218, 206, 206, 206, 206,
480 206, 219, 211, 211, 211, 211, 211, 211, 211, 211,
481 211, 211, 211, 211, 36, 211, 211, 36, 33, 36,
482 48, 220, 206, 206, 206, 48, 212, 213, 221, 215,
483
484 215, 222, 206, 206, 206, 217, 218, 206, 219, 206,
485 223, 224, 211, 211, 33, 211, 211, 211, 211, 211,
486 33, 211, 211, 211, 33, 33, 211, 206, 225, 206,
487 206, 97, 221, 206, 215, 206, 226, 222, 206, 206,
488 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
489 206, 206, 227, 224, 211, 33, 211, 36, 211, 211,
490 36, 211, 206, 206, 212, 206, 228, 206, 206, 206,
491 206, 206, 206, 206, 206, 206, 227, 211, 211, 211,
492 212, 206, 206, 206, 228, 206, 206, 206, 206, 206,
493 206, 206, 211, 211, 212, 206, 206, 206, 206, 206,
494
495 206, 206, 206, 206, 206, 0, 206, 206, 206, 206,
496 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
497 206, 206, 206, 206, 206, 206, 206, 206
5796c8dc
SS
498 } ;
499
ef5ccd6c 500static yyconst flex_int16_t yy_nxt[1320] =
5796c8dc
SS
501 { 0,
502 6, 7, 8, 7, 6, 9, 6, 10, 11, 12,
503 13, 14, 15, 11, 16, 17, 18, 19, 20, 21,
ef5ccd6c
JM
504 22, 11, 23, 24, 25, 26, 27, 28, 28, 28,
505 29, 30, 28, 28, 31, 28, 28, 32, 33, 34,
506 35, 28, 36, 28, 28, 37, 11, 11, 28, 27,
507 28, 28, 29, 30, 28, 31, 28, 28, 32, 33,
508 34, 35, 28, 36, 28, 28, 37, 40, 63, 86,
509 73, 64, 69, 69, 70, 101, 135, 97, 73, 90,
510 71, 94, 73, 73, 103, 103, 172, 72, 104, 105,
511 105, 86, 73, 105, 105, 136, 101, 135, 181, 73,
512
513 90, 201, 93, 73, 73, 137, 169, 172, 41, 43,
514 44, 44, 45, 46, 46, 46, 46, 46, 47, 46,
515 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
516 46, 46, 46, 46, 46, 48, 48, 48, 48, 48,
517 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
518 48, 48, 48, 48, 48, 49, 46, 46, 48, 48,
519 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
520 48, 48, 48, 48, 48, 48, 52, 52, 52, 169,
521 58, 141, 141, 168, 40, 168, 58, 69, 69, 70,
522 59, 53, 60, 60, 169, 71, 59, 54, 60, 60,
523
524 92, 55, 72, 169, 61, 69, 69, 70, 136, 169,
525 61, 141, 77, 71, 169, 69, 69, 70, 137, 62,
526 72, 166, 60, 71, 55, 41, 61, 169, 60, 184,
527 72, 74, 61, 175, 142, 77, 69, 69, 70, 169,
528 62, 41, 75, 166, 71, 69, 69, 70, 173, 169,
529 76, 72, 169, 71, 74, 175, 174, 69, 69, 70,
530 72, 141, 141, 75, 169, 71, 78, 142, 58, 173,
531 142, 76, 72, 79, 52, 52, 52, 174, 59, 169,
532 60, 60, 142, 80, 184, 69, 69, 69, 78, 206,
533 176, 141, 61, 188, 79, 54, 84, 187, 85, 55,
534
535 72, 69, 69, 70, 80, 69, 69, 70, 93, 71,
536 60, 176, 190, 71, 61, 188, 72, 84, 187, 85,
537 72, 39, 55, 109, 109, 109, 169, 110, 186, 186,
538 69, 69, 70, 190, 81, 130, 130, 130, 71, 169,
539 69, 69, 70, 82, 111, 72, 195, 83, 71, 102,
540 69, 69, 70, 102, 131, 72, 81, 182, 71, 69,
541 69, 70, 183, 183, 82, 72, 189, 71, 83, 69,
542 69, 70, 183, 183, 72, 116, 134, 71, 69, 69,
543 70, 130, 130, 130, 72, 197, 71, 114, 189, 191,
544 113, 204, 204, 72, 87, 192, 116, 69, 69, 70,
545
546 131, 88, 109, 109, 109, 71, 110, 197, 89, 114,
547 191, 113, 72, 69, 69, 70, 192, 87, 115, 164,
548 163, 71, 88, 111, 202, 108, 202, 134, 72, 89,
549 43, 44, 44, 44, 43, 43, 43, 43, 43, 115,
5796c8dc 550 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
ef5ccd6c
JM
551 43, 43, 43, 43, 43, 43, 91, 91, 91, 91,
552 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
553 91, 91, 91, 91, 91, 91, 43, 43, 43, 91,
cf7f2e2d 554 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
ef5ccd6c
JM
555 91, 91, 91, 91, 91, 91, 91, 43, 43, 43,
556
557 43, 43, 43, 43, 43, 43, 94, 43, 43, 43,
558 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
559 43, 43, 43, 96, 96, 96, 96, 96, 96, 96,
560 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
561 96, 96, 96, 43, 43, 43, 96, 96, 96, 96,
562 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
563 96, 96, 96, 96, 69, 69, 70, 69, 69, 70,
564 106, 93, 71, 128, 106, 71, 69, 69, 70, 72,
565 93, 108, 72, 95, 71, 69, 69, 70, 69, 69,
566 70, 72, 117, 71, 94, 73, 71, 69, 69, 70,
567
568 72, 94, 121, 72, 93, 71, 73, 196, 196, 73,
569 118, 93, 72, 68, 117, 73, 67, 119, 73, 126,
570 120, 198, 198, 121, 69, 69, 70, 65, 73, 57,
571 73, 118, 71, 122, 51, 50, 73, 196, 119, 72,
572 126, 120, 73, 73, 128, 206, 124, 38, 128, 73,
573 73, 198, 196, 196, 122, 167, 125, 127, 38, 167,
574 139, 139, 198, 198, 123, 73, 73, 155, 124, 206,
575 73, 73, 140, 69, 69, 70, 73, 125, 127, 206,
576 73, 71, 196, 206, 206, 123, 93, 206, 72, 155,
577 139, 206, 198, 206, 140, 132, 132, 73, 206, 206,
578
579 206, 73, 206, 132, 132, 132, 132, 132, 132, 69,
580 69, 70, 206, 130, 130, 130, 206, 71, 130, 130,
581 130, 206, 206, 206, 72, 206, 132, 132, 132, 132,
582 132, 142, 131, 206, 206, 143, 142, 131, 142, 206,
583 144, 73, 69, 69, 70, 145, 142, 146, 73, 147,
584 71, 69, 69, 70, 206, 179, 206, 72, 206, 71,
585 148, 149, 150, 151, 73, 206, 72, 206, 152, 73,
586 206, 206, 147, 206, 206, 206, 179, 69, 69, 70,
587 206, 148, 149, 150, 151, 71, 69, 69, 70, 152,
588 139, 139, 72, 170, 71, 69, 69, 70, 69, 69,
589
590 70, 72, 140, 71, 171, 158, 71, 69, 69, 70,
591 72, 205, 205, 72, 73, 71, 170, 156, 73, 206,
592 139, 206, 72, 206, 140, 171, 206, 158, 69, 69,
593 70, 206, 69, 69, 70, 73, 71, 206, 156, 73,
594 71, 205, 157, 72, 69, 69, 70, 72, 161, 162,
595 205, 205, 71, 206, 206, 206, 206, 73, 73, 72,
596 206, 73, 73, 157, 206, 206, 159, 206, 206, 206,
597 161, 162, 206, 199, 199, 199, 206, 206, 73, 73,
598 205, 160, 73, 73, 69, 69, 70, 159, 72, 206,
599 203, 203, 71, 69, 69, 70, 206, 206, 206, 72,
600
601 206, 71, 160, 165, 165, 206, 206, 206, 72, 206,
602 206, 165, 165, 165, 165, 165, 165, 69, 69, 70,
603 178, 206, 206, 206, 206, 71, 206, 206, 206, 73,
604 206, 206, 72, 73, 165, 165, 165, 165, 165, 206,
605 206, 206, 178, 69, 69, 70, 206, 69, 69, 70,
606 73, 71, 206, 206, 73, 71, 180, 206, 72, 69,
607 69, 70, 72, 73, 206, 206, 206, 71, 206, 206,
608 73, 206, 206, 206, 72, 69, 69, 70, 206, 180,
609 69, 69, 70, 71, 73, 69, 69, 70, 71, 206,
610 72, 73, 206, 71, 206, 72, 69, 69, 70, 206,
611
612 72, 69, 69, 70, 71, 69, 69, 70, 206, 71,
613 206, 72, 206, 71, 206, 206, 72, 199, 199, 200,
614 72, 206, 199, 199, 200, 71, 206, 206, 206, 194,
615 71, 206, 72, 206, 206, 206, 193, 72, 206, 203,
616 203, 206, 206, 206, 206, 206, 206, 206, 206, 206,
617 206, 194, 206, 206, 206, 206, 206, 193, 39, 39,
618 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
619 39, 39, 42, 206, 206, 42, 206, 206, 206, 42,
620 42, 42, 56, 56, 56, 206, 206, 206, 206, 206,
621 56, 206, 56, 206, 206, 56, 56, 56, 66, 206,
622
623 66, 66, 66, 73, 73, 73, 206, 206, 206, 206,
624 73, 73, 73, 206, 206, 206, 73, 73, 73, 43,
5796c8dc 625 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
ef5ccd6c 626 43, 43, 43, 43, 43, 43, 98, 98, 206, 98,
cf7f2e2d 627 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
ef5ccd6c
JM
628 98, 98, 98, 99, 99, 99, 100, 206, 206, 206,
629 100, 100, 100, 107, 206, 206, 107, 107, 107, 107,
630 112, 112, 112, 206, 112, 206, 206, 206, 206, 206,
631 112, 206, 206, 112, 112, 112, 129, 206, 206, 206,
632 206, 129, 206, 206, 206, 129, 133, 206, 206, 133,
633
634 133, 133, 133, 138, 206, 206, 138, 138, 206, 206,
635 206, 138, 206, 138, 153, 153, 153, 154, 154, 154,
636 206, 206, 206, 206, 154, 154, 154, 206, 206, 206,
637 154, 154, 154, 177, 206, 206, 177, 177, 177, 177,
638 185, 206, 206, 206, 185, 206, 206, 206, 185, 206,
639 185, 5, 206, 206, 206, 206, 206, 206, 206, 206,
640 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
641 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
642 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
643 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
644
645 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
646 206, 206, 206, 206, 206, 206, 206, 206, 206
5796c8dc
SS
647 } ;
648
ef5ccd6c 649static yyconst flex_int16_t yy_chk[1320] =
5796c8dc
SS
650 { 0,
651 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
652 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
653 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
654 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
ef5ccd6c
JM
655 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
656 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
657 1, 1, 1, 1, 1, 1, 1, 9, 22, 35,
658 37, 22, 28, 28, 28, 55, 101, 49, 35, 37,
659 28, 49, 35, 37, 59, 59, 148, 28, 61, 104,
660 104, 35, 37, 61, 61, 102, 55, 101, 165, 35,
661
662 37, 195, 165, 35, 37, 102, 192, 148, 9, 12,
5796c8dc
SS
663 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
664 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
5796c8dc 665 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
cf7f2e2d 666 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
ef5ccd6c
JM
667 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
668 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
669 12, 12, 12, 12, 12, 12, 18, 18, 18, 191,
670 20, 105, 105, 140, 39, 140, 21, 30, 30, 30,
671 20, 18, 20, 20, 190, 30, 21, 18, 21, 21,
672
673 41, 18, 30, 189, 20, 27, 27, 27, 138, 188,
674 21, 105, 30, 27, 187, 29, 29, 29, 138, 20,
675 27, 136, 20, 29, 18, 39, 20, 143, 21, 185,
676 29, 27, 21, 151, 143, 30, 31, 31, 31, 177,
677 20, 41, 27, 136, 31, 32, 32, 32, 149, 144,
678 29, 31, 145, 32, 27, 151, 150, 34, 34, 34,
679 32, 141, 141, 27, 146, 34, 31, 144, 60, 149,
680 145, 29, 34, 31, 52, 52, 52, 150, 60, 174,
681 60, 60, 146, 32, 167, 69, 69, 69, 31, 52,
682 152, 141, 60, 171, 31, 52, 34, 170, 34, 52,
683
684 69, 70, 70, 70, 32, 33, 33, 33, 181, 70,
685 60, 152, 173, 33, 60, 171, 70, 34, 170, 34,
686 33, 163, 52, 72, 72, 72, 153, 72, 168, 168,
687 73, 73, 73, 173, 33, 93, 93, 93, 73, 142,
688 77, 77, 77, 33, 72, 73, 181, 33, 77, 216,
689 74, 74, 74, 216, 93, 77, 33, 166, 74, 75,
690 75, 75, 166, 166, 33, 74, 172, 75, 33, 36,
691 36, 36, 182, 182, 75, 77, 133, 36, 76, 76,
692 76, 94, 94, 94, 36, 184, 76, 75, 172, 175,
693 74, 202, 202, 76, 36, 176, 77, 78, 78, 78,
694
695 94, 36, 109, 109, 109, 78, 109, 184, 36, 75,
696 175, 74, 78, 79, 79, 79, 176, 36, 76, 131,
697 128, 79, 36, 109, 197, 107, 197, 99, 79, 36,
698 38, 38, 38, 38, 38, 38, 38, 38, 38, 76,
5796c8dc
SS
699 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
700 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
cf7f2e2d 701 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
ef5ccd6c
JM
702 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
703 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
704 38, 38, 38, 38, 38, 38, 38, 48, 48, 48,
705
706 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
707 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
708 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
709 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
710 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
711 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
712 48, 48, 48, 48, 80, 80, 80, 81, 81, 81,
713 217, 96, 80, 92, 217, 81, 82, 82, 82, 80,
714 91, 66, 81, 47, 82, 83, 83, 83, 84, 84,
715 84, 82, 80, 83, 46, 85, 84, 86, 86, 86,
716
717 83, 45, 85, 84, 44, 86, 89, 183, 183, 85,
718 81, 43, 86, 25, 80, 89, 24, 82, 85, 89,
719 83, 186, 186, 85, 87, 87, 87, 23, 89, 19,
720 85, 81, 87, 86, 17, 15, 89, 183, 82, 87,
721 89, 83, 88, 90, 225, 5, 88, 4, 225, 88,
722 90, 186, 196, 196, 86, 226, 88, 90, 3, 226,
723 103, 103, 198, 198, 87, 88, 90, 115, 88, 0,
724 88, 90, 103, 108, 108, 108, 115, 88, 90, 0,
725 115, 108, 196, 0, 0, 87, 97, 0, 108, 115,
726 103, 0, 198, 0, 103, 97, 97, 115, 0, 0,
727
728 0, 115, 0, 97, 97, 97, 97, 97, 97, 112,
729 112, 112, 0, 130, 130, 130, 0, 112, 201, 201,
730 201, 0, 0, 0, 112, 0, 97, 97, 97, 97,
731 97, 110, 130, 0, 0, 110, 110, 201, 110, 0,
732 110, 158, 113, 113, 113, 110, 110, 110, 158, 110,
733 113, 114, 114, 114, 0, 158, 0, 113, 0, 114,
734 110, 110, 110, 110, 158, 0, 114, 0, 110, 158,
735 0, 0, 110, 0, 0, 0, 158, 116, 116, 116,
736 0, 110, 110, 110, 110, 116, 117, 117, 117, 110,
737 139, 139, 116, 147, 117, 118, 118, 118, 119, 119,
738
739 119, 117, 139, 118, 147, 121, 119, 120, 120, 120,
740 118, 204, 204, 119, 121, 120, 147, 116, 121, 0,
741 139, 0, 120, 0, 139, 147, 0, 121, 122, 122,
742 122, 0, 123, 123, 123, 121, 122, 0, 116, 121,
743 123, 204, 120, 122, 124, 124, 124, 123, 125, 126,
744 205, 205, 124, 0, 0, 0, 0, 125, 126, 124,
745 0, 125, 126, 120, 0, 0, 123, 0, 0, 0,
746 125, 126, 0, 199, 199, 199, 0, 0, 125, 126,
747 205, 124, 125, 126, 127, 127, 127, 123, 199, 0,
748 199, 199, 127, 154, 154, 154, 0, 0, 0, 127,
749
750 0, 154, 124, 132, 132, 0, 0, 0, 154, 0,
751 0, 132, 132, 132, 132, 132, 132, 155, 155, 155,
752 156, 0, 0, 0, 0, 155, 0, 0, 0, 156,
753 0, 0, 155, 156, 132, 132, 132, 132, 132, 0,
754 0, 0, 156, 157, 157, 157, 0, 159, 159, 159,
755 156, 157, 0, 0, 156, 159, 161, 0, 157, 160,
756 160, 160, 159, 161, 0, 0, 0, 160, 0, 0,
757 161, 0, 0, 0, 160, 162, 162, 162, 0, 161,
758 169, 169, 169, 162, 161, 178, 178, 178, 169, 0,
759 162, 161, 0, 178, 0, 169, 179, 179, 179, 0,
760
761 178, 180, 180, 180, 179, 193, 193, 193, 0, 180,
762 0, 179, 0, 193, 0, 0, 180, 194, 194, 194,
763 193, 0, 200, 200, 200, 194, 0, 0, 0, 180,
764 200, 0, 194, 0, 0, 0, 179, 200, 0, 200,
765 200, 0, 0, 0, 0, 0, 0, 0, 0, 0,
766 0, 180, 0, 0, 0, 0, 0, 179, 207, 207,
767 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
768 207, 207, 208, 0, 0, 208, 0, 0, 0, 208,
769 208, 208, 209, 209, 209, 0, 0, 0, 0, 0,
770 209, 0, 209, 0, 0, 209, 209, 209, 210, 0,
771
772 210, 210, 210, 211, 211, 211, 0, 0, 0, 0,
773 211, 211, 211, 0, 0, 0, 211, 211, 211, 212,
774 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
775 212, 212, 212, 212, 212, 212, 213, 213, 0, 213,
776 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
777 213, 213, 213, 214, 214, 214, 215, 0, 0, 0,
778 215, 215, 215, 218, 0, 0, 218, 218, 218, 218,
779 219, 219, 219, 0, 219, 0, 0, 0, 0, 0,
780 219, 0, 0, 219, 219, 219, 220, 0, 0, 0,
781 0, 220, 0, 0, 0, 220, 221, 0, 0, 221,
782
783 221, 221, 221, 222, 0, 0, 222, 222, 0, 0,
784 0, 222, 0, 222, 223, 223, 223, 224, 224, 224,
785 0, 0, 0, 0, 224, 224, 224, 0, 0, 0,
786 224, 224, 224, 227, 0, 0, 227, 227, 227, 227,
787 228, 0, 0, 0, 228, 0, 0, 0, 228, 0,
788 228, 206, 206, 206, 206, 206, 206, 206, 206, 206,
789 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
790 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
791 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
792 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
793
794 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
795 206, 206, 206, 206, 206, 206, 206, 206, 206
5796c8dc
SS
796 } ;
797
798static yy_state_type yy_last_accepting_state;
799static char *yy_last_accepting_cpos;
800
ef5ccd6c
JM
801extern int yy_flex_debug;
802int yy_flex_debug = 0;
803
5796c8dc
SS
804/* The intent behind this definition is that it'll catch
805 * any uses of REJECT which flex missed.
806 */
807#define REJECT reject_used_but_not_detected
808#define yymore() yymore_used_but_not_detected
809#define YY_MORE_ADJ 0
810#define YY_RESTORE_YY_MORE_OFFSET
811char *yytext;
812#line 1 "ada-lex.l"
5796c8dc 813/* FLEX lexer for Ada expressions, for GDB.
ef5ccd6c 814 Copyright (C) 1994-2013 Free Software Foundation, Inc.
5796c8dc
SS
815
816 This file is part of GDB.
817
818 This program is free software; you can redistribute it and/or modify
819 it under the terms of the GNU General Public License as published by
820 the Free Software Foundation; either version 3 of the License, or
821 (at your option) any later version.
822
823 This program is distributed in the hope that it will be useful,
824 but WITHOUT ANY WARRANTY; without even the implied warranty of
825 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
826 GNU General Public License for more details.
827
828 You should have received a copy of the GNU General Public License
829 along with this program. If not, see <http://www.gnu.org/licenses/>. */
830/*----------------------------------------------------------------------*/
831/* The converted version of this file is to be included in ada-exp.y, */
832/* the Ada parser for gdb. The function yylex obtains characters from */
833/* the global pointer lexptr. It returns a syntactic category for */
834/* each successive token and places a semantic value into yylval */
835/* (ada-lval), defined by the parser. */
ef5ccd6c 836#line 43 "ada-lex.l"
5796c8dc
SS
837
838#define NUMERAL_WIDTH 256
839#define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
840
841/* Temporary staging for numeric literals. */
842static char numbuf[NUMERAL_WIDTH];
843 static void canonicalizeNumeral (char *s1, const char *);
844static struct stoken processString (const char*, int);
845static int processInt (const char *, const char *, const char *);
846static int processReal (const char *);
847static struct stoken processId (const char *, int);
848static int processAttribute (const char *);
849static int find_dot_all (const char *);
ef5ccd6c 850static void rewind_to_char (int);
5796c8dc
SS
851
852#undef YY_DECL
853#define YY_DECL static int yylex ( void )
854
cf7f2e2d
JM
855/* Flex generates a static function "input" which is not used.
856 Defining YY_NO_INPUT comments it out. */
857#define YY_NO_INPUT
858
5796c8dc
SS
859#undef YY_INPUT
860#define YY_INPUT(BUF, RESULT, MAX_SIZE) \
861 if ( *lexptr == '\000' ) \
862 (RESULT) = YY_NULL; \
863 else \
864 { \
865 *(BUF) = *lexptr; \
866 (RESULT) = 1; \
867 lexptr += 1; \
868 }
869
870static int find_dot_all (const char *);
871
ef5ccd6c
JM
872
873#line 874 "ada-lex.c"
874
875#define INITIAL 0
5796c8dc
SS
876#define BEFORE_QUAL_QUOTE 1
877
ef5ccd6c
JM
878#ifndef YY_NO_UNISTD_H
879/* Special case for "unistd.h", since it is non-ANSI. We include it way
880 * down here because we want the user's section 1 to have been scanned first.
881 * The user has a chance to override it with an option.
882 */
883#include <unistd.h>
884#endif
885
886#ifndef YY_EXTRA_TYPE
887#define YY_EXTRA_TYPE void *
888#endif
889
890static int yy_init_globals (void );
891
892/* Accessor methods to globals.
893 These are made visible to non-reentrant scanners for convenience. */
894
895int yylex_destroy (void );
896
897int yyget_debug (void );
898
899void yyset_debug (int debug_flag );
900
901YY_EXTRA_TYPE yyget_extra (void );
902
903void yyset_extra (YY_EXTRA_TYPE user_defined );
904
905FILE *yyget_in (void );
906
907void yyset_in (FILE * in_str );
908
909FILE *yyget_out (void );
910
911void yyset_out (FILE * out_str );
912
913int yyget_leng (void );
914
915char *yyget_text (void );
916
917int yyget_lineno (void );
918
919void yyset_lineno (int line_number );
5796c8dc
SS
920
921/* Macros after this point can all be overridden by user definitions in
922 * section 1.
923 */
924
925#ifndef YY_SKIP_YYWRAP
926#ifdef __cplusplus
ef5ccd6c 927extern "C" int yywrap (void );
5796c8dc 928#else
ef5ccd6c 929extern int yywrap (void );
5796c8dc
SS
930#endif
931#endif
932
ef5ccd6c
JM
933 static void yyunput (int c,char *buf_ptr );
934
5796c8dc 935#ifndef yytext_ptr
ef5ccd6c 936static void yy_flex_strncpy (char *,yyconst char *,int );
5796c8dc
SS
937#endif
938
939#ifdef YY_NEED_STRLEN
ef5ccd6c 940static int yy_flex_strlen (yyconst char * );
5796c8dc
SS
941#endif
942
943#ifndef YY_NO_INPUT
5796c8dc 944
ef5ccd6c
JM
945#ifdef __cplusplus
946static int yyinput (void );
5796c8dc 947#else
ef5ccd6c 948static int input (void );
5796c8dc
SS
949#endif
950
5796c8dc
SS
951#endif
952
953/* Amount of stuff to slurp up with each read. */
954#ifndef YY_READ_BUF_SIZE
955#define YY_READ_BUF_SIZE 8192
956#endif
957
958/* Copy whatever the last rule matched to the standard output. */
5796c8dc
SS
959#ifndef ECHO
960/* This used to be an fputs(), but since the string might contain NUL's,
961 * we now use fwrite().
962 */
ef5ccd6c 963#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
5796c8dc
SS
964#endif
965
966/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
967 * is returned in "result".
968 */
969#ifndef YY_INPUT
970#define YY_INPUT(buf,result,max_size) \
ef5ccd6c 971 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
5796c8dc 972 { \
ef5ccd6c
JM
973 int c = '*'; \
974 unsigned n; \
5796c8dc
SS
975 for ( n = 0; n < max_size && \
976 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
977 buf[n] = (char) c; \
978 if ( c == '\n' ) \
979 buf[n++] = (char) c; \
980 if ( c == EOF && ferror( yyin ) ) \
981 YY_FATAL_ERROR( "input in flex scanner failed" ); \
982 result = n; \
983 } \
ef5ccd6c
JM
984 else \
985 { \
986 errno=0; \
987 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
988 { \
989 if( errno != EINTR) \
990 { \
991 YY_FATAL_ERROR( "input in flex scanner failed" ); \
992 break; \
993 } \
994 errno=0; \
995 clearerr(yyin); \
996 } \
997 }\
998\
999
5796c8dc
SS
1000#endif
1001
1002/* No semi-colon after return; correct usage is to write "yyterminate();" -
1003 * we don't want an extra ';' after the "return" because that will cause
1004 * some compilers to complain about unreachable statements.
1005 */
1006#ifndef yyterminate
1007#define yyterminate() return YY_NULL
1008#endif
1009
1010/* Number of entries by which start-condition stack grows. */
1011#ifndef YY_START_STACK_INCR
1012#define YY_START_STACK_INCR 25
1013#endif
1014
1015/* Report a fatal error. */
1016#ifndef YY_FATAL_ERROR
1017#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1018#endif
1019
ef5ccd6c
JM
1020/* end tables serialization structures and prototypes */
1021
5796c8dc
SS
1022/* Default declaration of generated scanner - a define so the user can
1023 * easily add parameters.
1024 */
1025#ifndef YY_DECL
ef5ccd6c
JM
1026#define YY_DECL_IS_OURS 1
1027
1028extern int yylex (void);
1029
1030#define YY_DECL int yylex (void)
1031#endif /* !YY_DECL */
5796c8dc
SS
1032
1033/* Code executed at the beginning of each rule, after yytext and yyleng
1034 * have been set up.
1035 */
1036#ifndef YY_USER_ACTION
1037#define YY_USER_ACTION
1038#endif
1039
1040/* Code executed at the end of each rule. */
1041#ifndef YY_BREAK
1042#define YY_BREAK break;
1043#endif
1044
1045#define YY_RULE_SETUP \
1046 YY_USER_ACTION
1047
ef5ccd6c
JM
1048/** The main scanner function which does all the work.
1049 */
5796c8dc 1050YY_DECL
ef5ccd6c 1051{
5796c8dc 1052 register yy_state_type yy_current_state;
ef5ccd6c 1053 register char *yy_cp, *yy_bp;
5796c8dc 1054 register int yy_act;
ef5ccd6c 1055
cf7f2e2d 1056#line 84 "ada-lex.l"
5796c8dc
SS
1057
1058
ef5ccd6c 1059#line 1060 "ada-lex.c"
5796c8dc 1060
ef5ccd6c 1061 if ( !(yy_init) )
5796c8dc 1062 {
ef5ccd6c 1063 (yy_init) = 1;
5796c8dc
SS
1064
1065#ifdef YY_USER_INIT
1066 YY_USER_INIT;
1067#endif
1068
ef5ccd6c
JM
1069 if ( ! (yy_start) )
1070 (yy_start) = 1; /* first start state */
5796c8dc
SS
1071
1072 if ( ! yyin )
1073 yyin = stdin;
1074
1075 if ( ! yyout )
1076 yyout = stdout;
1077
ef5ccd6c
JM
1078 if ( ! YY_CURRENT_BUFFER ) {
1079 yyensure_buffer_stack ();
1080 YY_CURRENT_BUFFER_LVALUE =
1081 yy_create_buffer(yyin,YY_BUF_SIZE );
1082 }
5796c8dc 1083
ef5ccd6c 1084 yy_load_buffer_state( );
5796c8dc
SS
1085 }
1086
1087 while ( 1 ) /* loops until end-of-file is reached */
1088 {
ef5ccd6c 1089 yy_cp = (yy_c_buf_p);
5796c8dc
SS
1090
1091 /* Support of yytext. */
ef5ccd6c 1092 *yy_cp = (yy_hold_char);
5796c8dc
SS
1093
1094 /* yy_bp points to the position in yy_ch_buf of the start of
1095 * the current run.
1096 */
1097 yy_bp = yy_cp;
1098
ef5ccd6c 1099 yy_current_state = (yy_start);
5796c8dc
SS
1100yy_match:
1101 do
1102 {
1103 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1104 if ( yy_accept[yy_current_state] )
1105 {
ef5ccd6c
JM
1106 (yy_last_accepting_state) = yy_current_state;
1107 (yy_last_accepting_cpos) = yy_cp;
5796c8dc
SS
1108 }
1109 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1110 {
1111 yy_current_state = (int) yy_def[yy_current_state];
ef5ccd6c 1112 if ( yy_current_state >= 207 )
5796c8dc
SS
1113 yy_c = yy_meta[(unsigned int) yy_c];
1114 }
1115 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1116 ++yy_cp;
1117 }
ef5ccd6c 1118 while ( yy_base[yy_current_state] != 1252 );
5796c8dc
SS
1119
1120yy_find_action:
1121 yy_act = yy_accept[yy_current_state];
1122 if ( yy_act == 0 )
1123 { /* have to back up */
ef5ccd6c
JM
1124 yy_cp = (yy_last_accepting_cpos);
1125 yy_current_state = (yy_last_accepting_state);
5796c8dc
SS
1126 yy_act = yy_accept[yy_current_state];
1127 }
1128
1129 YY_DO_BEFORE_ACTION;
1130
5796c8dc
SS
1131do_action: /* This label is used only to access EOF actions. */
1132
5796c8dc
SS
1133 switch ( yy_act )
1134 { /* beginning of action switch */
1135 case 0: /* must back up */
1136 /* undo the effects of YY_DO_BEFORE_ACTION */
ef5ccd6c
JM
1137 *yy_cp = (yy_hold_char);
1138 yy_cp = (yy_last_accepting_cpos);
1139 yy_current_state = (yy_last_accepting_state);
5796c8dc
SS
1140 goto yy_find_action;
1141
1142case 1:
ef5ccd6c 1143/* rule 1 can match eol */
5796c8dc 1144YY_RULE_SETUP
cf7f2e2d 1145#line 86 "ada-lex.l"
5796c8dc
SS
1146{ }
1147 YY_BREAK
1148case 2:
1149YY_RULE_SETUP
cf7f2e2d 1150#line 88 "ada-lex.l"
5796c8dc
SS
1151{ yyterminate(); }
1152 YY_BREAK
1153case 3:
1154YY_RULE_SETUP
cf7f2e2d 1155#line 90 "ada-lex.l"
5796c8dc
SS
1156{
1157 canonicalizeNumeral (numbuf, yytext);
1158 return processInt (NULL, numbuf, strrchr(numbuf, 'e')+1);
1159 }
1160 YY_BREAK
1161case 4:
1162YY_RULE_SETUP
cf7f2e2d 1163#line 95 "ada-lex.l"
5796c8dc
SS
1164{
1165 canonicalizeNumeral (numbuf, yytext);
1166 return processInt (NULL, numbuf, NULL);
1167 }
1168 YY_BREAK
1169case 5:
1170YY_RULE_SETUP
cf7f2e2d 1171#line 100 "ada-lex.l"
5796c8dc
SS
1172{
1173 canonicalizeNumeral (numbuf, yytext);
1174 return processInt (numbuf,
1175 strchr (numbuf, '#') + 1,
1176 strrchr(numbuf, '#') + 1);
1177 }
1178 YY_BREAK
1179case 6:
1180YY_RULE_SETUP
cf7f2e2d 1181#line 107 "ada-lex.l"
5796c8dc
SS
1182{
1183 canonicalizeNumeral (numbuf, yytext);
1184 return processInt (numbuf, strchr (numbuf, '#') + 1, NULL);
1185 }
1186 YY_BREAK
1187case 7:
1188YY_RULE_SETUP
cf7f2e2d 1189#line 112 "ada-lex.l"
5796c8dc
SS
1190{
1191 canonicalizeNumeral (numbuf, yytext+2);
1192 return processInt ("16#", numbuf, NULL);
1193 }
1194 YY_BREAK
1195case 8:
1196YY_RULE_SETUP
cf7f2e2d 1197#line 118 "ada-lex.l"
5796c8dc
SS
1198{
1199 canonicalizeNumeral (numbuf, yytext);
1200 return processReal (numbuf);
1201 }
1202 YY_BREAK
1203case 9:
1204YY_RULE_SETUP
cf7f2e2d 1205#line 123 "ada-lex.l"
5796c8dc
SS
1206{
1207 canonicalizeNumeral (numbuf, yytext);
1208 return processReal (numbuf);
1209 }
1210 YY_BREAK
1211case 10:
1212YY_RULE_SETUP
cf7f2e2d 1213#line 128 "ada-lex.l"
5796c8dc
SS
1214{
1215 error (_("Based real literals not implemented yet."));
1216 }
1217 YY_BREAK
1218case 11:
1219YY_RULE_SETUP
cf7f2e2d 1220#line 132 "ada-lex.l"
5796c8dc
SS
1221{
1222 error (_("Based real literals not implemented yet."));
1223 }
1224 YY_BREAK
1225case 12:
1226YY_RULE_SETUP
cf7f2e2d 1227#line 136 "ada-lex.l"
5796c8dc
SS
1228{
1229 yylval.typed_val.type = type_char ();
1230 yylval.typed_val.val = yytext[1];
1231 return CHARLIT;
1232 }
1233 YY_BREAK
1234case 13:
1235YY_RULE_SETUP
cf7f2e2d 1236#line 142 "ada-lex.l"
5796c8dc
SS
1237{
1238 int v;
1239 yylval.typed_val.type = type_char ();
1240 sscanf (yytext+3, "%2x", &v);
1241 yylval.typed_val.val = v;
1242 return CHARLIT;
1243 }
1244 YY_BREAK
1245case 14:
1246YY_RULE_SETUP
cf7f2e2d 1247#line 150 "ada-lex.l"
5796c8dc
SS
1248{
1249 yylval.sval = processString (yytext+1, yyleng-2);
1250 return STRING;
1251 }
1252 YY_BREAK
1253case 15:
1254YY_RULE_SETUP
cf7f2e2d 1255#line 155 "ada-lex.l"
5796c8dc
SS
1256{
1257 error (_("ill-formed or non-terminated string literal"));
1258 }
1259 YY_BREAK
1260case 16:
1261YY_RULE_SETUP
cf7f2e2d 1262#line 160 "ada-lex.l"
5796c8dc 1263{
ef5ccd6c 1264 rewind_to_char ('i');
5796c8dc
SS
1265 return 0;
1266 }
1267 YY_BREAK
5796c8dc
SS
1268case 17:
1269YY_RULE_SETUP
ef5ccd6c 1270#line 165 "ada-lex.l"
cf7f2e2d 1271{
ef5ccd6c 1272 rewind_to_char ('t');
cf7f2e2d
JM
1273 return 0;
1274 }
5796c8dc
SS
1275 YY_BREAK
1276case 18:
ef5ccd6c 1277/* rule 18 can match eol */
5796c8dc 1278YY_RULE_SETUP
ef5ccd6c
JM
1279#line 170 "ada-lex.l"
1280{
1281 /* This keyword signals the end of the expression and
1282 will be processed separately. */
1283 rewind_to_char ('t');
1284 return 0;
1285 }
5796c8dc 1286 YY_BREAK
ef5ccd6c 1287/* ADA KEYWORDS */
5796c8dc
SS
1288case 19:
1289YY_RULE_SETUP
cf7f2e2d 1290#line 179 "ada-lex.l"
ef5ccd6c 1291{ return ABS; }
5796c8dc
SS
1292 YY_BREAK
1293case 20:
1294YY_RULE_SETUP
cf7f2e2d 1295#line 180 "ada-lex.l"
ef5ccd6c 1296{ return _AND_; }
5796c8dc
SS
1297 YY_BREAK
1298case 21:
1299YY_RULE_SETUP
cf7f2e2d 1300#line 181 "ada-lex.l"
ef5ccd6c 1301{ return ELSE; }
5796c8dc
SS
1302 YY_BREAK
1303case 22:
1304YY_RULE_SETUP
cf7f2e2d 1305#line 182 "ada-lex.l"
ef5ccd6c 1306{ return IN; }
5796c8dc
SS
1307 YY_BREAK
1308case 23:
1309YY_RULE_SETUP
cf7f2e2d 1310#line 183 "ada-lex.l"
ef5ccd6c 1311{ return MOD; }
5796c8dc
SS
1312 YY_BREAK
1313case 24:
1314YY_RULE_SETUP
cf7f2e2d 1315#line 184 "ada-lex.l"
ef5ccd6c 1316{ return NEW; }
5796c8dc
SS
1317 YY_BREAK
1318case 25:
1319YY_RULE_SETUP
cf7f2e2d 1320#line 185 "ada-lex.l"
ef5ccd6c 1321{ return NOT; }
5796c8dc
SS
1322 YY_BREAK
1323case 26:
1324YY_RULE_SETUP
cf7f2e2d 1325#line 186 "ada-lex.l"
ef5ccd6c 1326{ return NULL_PTR; }
5796c8dc
SS
1327 YY_BREAK
1328case 27:
1329YY_RULE_SETUP
cf7f2e2d 1330#line 187 "ada-lex.l"
ef5ccd6c 1331{ return OR; }
5796c8dc
SS
1332 YY_BREAK
1333case 28:
1334YY_RULE_SETUP
cf7f2e2d 1335#line 188 "ada-lex.l"
ef5ccd6c 1336{ return OTHERS; }
5796c8dc
SS
1337 YY_BREAK
1338case 29:
1339YY_RULE_SETUP
cf7f2e2d 1340#line 189 "ada-lex.l"
ef5ccd6c 1341{ return REM; }
cf7f2e2d
JM
1342 YY_BREAK
1343case 30:
1344YY_RULE_SETUP
1345#line 190 "ada-lex.l"
ef5ccd6c
JM
1346{ return THEN; }
1347 YY_BREAK
1348case 31:
1349YY_RULE_SETUP
1350#line 191 "ada-lex.l"
5796c8dc
SS
1351{ return XOR; }
1352 YY_BREAK
1353/* BOOLEAN "KEYWORDS" */
1354/* True and False are not keywords in Ada, but rather enumeration constants.
1355 However, the boolean type is no longer represented as an enum, so True
1356 and False are no longer defined in symbol tables. We compromise by
1357 making them keywords (when bare). */
ef5ccd6c 1358case 32:
5796c8dc 1359YY_RULE_SETUP
ef5ccd6c 1360#line 200 "ada-lex.l"
5796c8dc
SS
1361{ return TRUEKEYWORD; }
1362 YY_BREAK
ef5ccd6c 1363case 33:
5796c8dc 1364YY_RULE_SETUP
ef5ccd6c 1365#line 201 "ada-lex.l"
5796c8dc
SS
1366{ return FALSEKEYWORD; }
1367 YY_BREAK
1368/* ATTRIBUTES */
ef5ccd6c
JM
1369case 34:
1370/* rule 34 can match eol */
5796c8dc 1371YY_RULE_SETUP
ef5ccd6c 1372#line 205 "ada-lex.l"
5796c8dc
SS
1373{ return processAttribute (yytext+1); }
1374 YY_BREAK
1375/* PUNCTUATION */
cf7f2e2d 1376case 35:
5796c8dc 1377YY_RULE_SETUP
cf7f2e2d 1378#line 209 "ada-lex.l"
ef5ccd6c 1379{ return ARROW; }
5796c8dc 1380 YY_BREAK
cf7f2e2d 1381case 36:
5796c8dc 1382YY_RULE_SETUP
cf7f2e2d 1383#line 210 "ada-lex.l"
ef5ccd6c 1384{ return DOTDOT; }
5796c8dc 1385 YY_BREAK
cf7f2e2d 1386case 37:
5796c8dc 1387YY_RULE_SETUP
cf7f2e2d 1388#line 211 "ada-lex.l"
ef5ccd6c 1389{ return STARSTAR; }
5796c8dc 1390 YY_BREAK
cf7f2e2d 1391case 38:
5796c8dc 1392YY_RULE_SETUP
cf7f2e2d 1393#line 212 "ada-lex.l"
ef5ccd6c 1394{ return ASSIGN; }
5796c8dc 1395 YY_BREAK
cf7f2e2d 1396case 39:
5796c8dc 1397YY_RULE_SETUP
cf7f2e2d 1398#line 213 "ada-lex.l"
ef5ccd6c 1399{ return NOTEQUAL; }
5796c8dc 1400 YY_BREAK
cf7f2e2d 1401case 40:
5796c8dc 1402YY_RULE_SETUP
cf7f2e2d 1403#line 214 "ada-lex.l"
ef5ccd6c 1404{ return LEQ; }
5796c8dc 1405 YY_BREAK
cf7f2e2d 1406case 41:
5796c8dc 1407YY_RULE_SETUP
ef5ccd6c
JM
1408#line 215 "ada-lex.l"
1409{ return GEQ; }
5796c8dc 1410 YY_BREAK
cf7f2e2d 1411case 42:
5796c8dc 1412YY_RULE_SETUP
ef5ccd6c
JM
1413#line 217 "ada-lex.l"
1414{ BEGIN INITIAL; return '\''; }
5796c8dc 1415 YY_BREAK
cf7f2e2d 1416case 43:
5796c8dc 1417YY_RULE_SETUP
ef5ccd6c
JM
1418#line 219 "ada-lex.l"
1419{ return yytext[0]; }
1420 YY_BREAK
1421case 44:
1422YY_RULE_SETUP
1423#line 221 "ada-lex.l"
5796c8dc
SS
1424{ if (paren_depth == 0 && comma_terminates)
1425 {
ef5ccd6c 1426 rewind_to_char (',');
5796c8dc
SS
1427 return 0;
1428 }
1429 else
1430 return ',';
1431 }
1432 YY_BREAK
ef5ccd6c 1433case 45:
5796c8dc 1434YY_RULE_SETUP
cf7f2e2d 1435#line 230 "ada-lex.l"
5796c8dc
SS
1436{ paren_depth += 1; return '('; }
1437 YY_BREAK
ef5ccd6c 1438case 46:
5796c8dc 1439YY_RULE_SETUP
cf7f2e2d 1440#line 231 "ada-lex.l"
5796c8dc
SS
1441{ if (paren_depth == 0)
1442 {
ef5ccd6c 1443 rewind_to_char (')');
5796c8dc
SS
1444 return 0;
1445 }
1446 else
1447 {
1448 paren_depth -= 1;
1449 return ')';
1450 }
1451 }
1452 YY_BREAK
ef5ccd6c
JM
1453case 47:
1454/* rule 47 can match eol */
5796c8dc 1455YY_RULE_SETUP
ef5ccd6c 1456#line 243 "ada-lex.l"
5796c8dc
SS
1457{ return DOT_ALL; }
1458 YY_BREAK
ef5ccd6c
JM
1459case 48:
1460/* rule 48 can match eol */
5796c8dc 1461YY_RULE_SETUP
ef5ccd6c 1462#line 245 "ada-lex.l"
5796c8dc
SS
1463{
1464 yylval.sval = processId (yytext+1, yyleng-1);
1465 return DOT_ID;
1466 }
1467 YY_BREAK
ef5ccd6c
JM
1468case 49:
1469/* rule 49 can match eol */
5796c8dc 1470YY_RULE_SETUP
ef5ccd6c 1471#line 250 "ada-lex.l"
5796c8dc
SS
1472{
1473 int all_posn = find_dot_all (yytext);
1474
1475 if (all_posn == -1 && yytext[yyleng-1] == '\'')
1476 {
1477 BEGIN BEFORE_QUAL_QUOTE;
1478 yyless (yyleng-1);
1479 }
1480 else if (all_posn >= 0)
1481 yyless (all_posn);
1482 yylval.sval = processId (yytext, yyleng);
1483 return NAME;
1484 }
1485 YY_BREAK
1486/* GDB EXPRESSION CONSTRUCTS */
ef5ccd6c
JM
1487case 50:
1488/* rule 50 can match eol */
5796c8dc 1489YY_RULE_SETUP
ef5ccd6c 1490#line 267 "ada-lex.l"
5796c8dc
SS
1491{
1492 yyless (yyleng - 2);
1493 yylval.sval = processId (yytext, yyleng);
1494 return NAME;
1495 }
1496 YY_BREAK
ef5ccd6c 1497case 51:
5796c8dc 1498YY_RULE_SETUP
ef5ccd6c 1499#line 273 "ada-lex.l"
5796c8dc
SS
1500{ return COLONCOLON; }
1501 YY_BREAK
ef5ccd6c 1502case 52:
5796c8dc 1503YY_RULE_SETUP
ef5ccd6c 1504#line 275 "ada-lex.l"
5796c8dc
SS
1505{ return yytext[0]; }
1506 YY_BREAK
1507/* REGISTERS AND GDB CONVENIENCE VARIABLES */
ef5ccd6c 1508case 53:
5796c8dc 1509YY_RULE_SETUP
ef5ccd6c 1510#line 279 "ada-lex.l"
5796c8dc
SS
1511{
1512 yylval.sval.ptr = yytext;
1513 yylval.sval.length = yyleng;
1514 return SPECIAL_VARIABLE;
1515 }
1516 YY_BREAK
1517/* CATCH-ALL ERROR CASE */
ef5ccd6c 1518case 54:
5796c8dc 1519YY_RULE_SETUP
ef5ccd6c 1520#line 287 "ada-lex.l"
5796c8dc
SS
1521{ error (_("Invalid character '%s' in expression."), yytext); }
1522 YY_BREAK
ef5ccd6c 1523case 55:
5796c8dc 1524YY_RULE_SETUP
ef5ccd6c 1525#line 288 "ada-lex.l"
5796c8dc
SS
1526YY_FATAL_ERROR( "flex scanner jammed" );
1527 YY_BREAK
ef5ccd6c 1528#line 1529 "ada-lex.c"
5796c8dc
SS
1529case YY_STATE_EOF(INITIAL):
1530case YY_STATE_EOF(BEFORE_QUAL_QUOTE):
1531 yyterminate();
1532
1533 case YY_END_OF_BUFFER:
1534 {
1535 /* Amount of text matched not including the EOB char. */
ef5ccd6c 1536 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
5796c8dc
SS
1537
1538 /* Undo the effects of YY_DO_BEFORE_ACTION. */
ef5ccd6c 1539 *yy_cp = (yy_hold_char);
5796c8dc
SS
1540 YY_RESTORE_YY_MORE_OFFSET
1541
ef5ccd6c 1542 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
5796c8dc
SS
1543 {
1544 /* We're scanning a new file or input source. It's
1545 * possible that this happened because the user
1546 * just pointed yyin at a new source and called
1547 * yylex(). If so, then we have to assure
ef5ccd6c 1548 * consistency between YY_CURRENT_BUFFER and our
5796c8dc
SS
1549 * globals. Here is the right place to do so, because
1550 * this is the first action (other than possibly a
1551 * back-up) that will match for the new input source.
1552 */
ef5ccd6c
JM
1553 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1554 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1555 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
5796c8dc
SS
1556 }
1557
1558 /* Note that here we test for yy_c_buf_p "<=" to the position
1559 * of the first EOB in the buffer, since yy_c_buf_p will
1560 * already have been incremented past the NUL character
1561 * (since all states make transitions on EOB to the
1562 * end-of-buffer state). Contrast this with the test
1563 * in input().
1564 */
ef5ccd6c 1565 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
5796c8dc
SS
1566 { /* This was really a NUL. */
1567 yy_state_type yy_next_state;
1568
ef5ccd6c 1569 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
5796c8dc 1570
ef5ccd6c 1571 yy_current_state = yy_get_previous_state( );
5796c8dc
SS
1572
1573 /* Okay, we're now positioned to make the NUL
1574 * transition. We couldn't have
1575 * yy_get_previous_state() go ahead and do it
1576 * for us because it doesn't know how to deal
1577 * with the possibility of jamming (and we don't
1578 * want to build jamming into it because then it
1579 * will run more slowly).
1580 */
1581
1582 yy_next_state = yy_try_NUL_trans( yy_current_state );
1583
ef5ccd6c 1584 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
5796c8dc
SS
1585
1586 if ( yy_next_state )
1587 {
1588 /* Consume the NUL. */
ef5ccd6c 1589 yy_cp = ++(yy_c_buf_p);
5796c8dc
SS
1590 yy_current_state = yy_next_state;
1591 goto yy_match;
1592 }
1593
1594 else
1595 {
ef5ccd6c 1596 yy_cp = (yy_c_buf_p);
5796c8dc
SS
1597 goto yy_find_action;
1598 }
1599 }
1600
ef5ccd6c 1601 else switch ( yy_get_next_buffer( ) )
5796c8dc
SS
1602 {
1603 case EOB_ACT_END_OF_FILE:
1604 {
ef5ccd6c 1605 (yy_did_buffer_switch_on_eof) = 0;
5796c8dc 1606
ef5ccd6c 1607 if ( yywrap( ) )
5796c8dc
SS
1608 {
1609 /* Note: because we've taken care in
1610 * yy_get_next_buffer() to have set up
1611 * yytext, we can now set up
1612 * yy_c_buf_p so that if some total
1613 * hoser (like flex itself) wants to
1614 * call the scanner after we return the
1615 * YY_NULL, it'll still work - another
1616 * YY_NULL will get returned.
1617 */
ef5ccd6c 1618 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
5796c8dc
SS
1619
1620 yy_act = YY_STATE_EOF(YY_START);
1621 goto do_action;
1622 }
1623
1624 else
1625 {
ef5ccd6c 1626 if ( ! (yy_did_buffer_switch_on_eof) )
5796c8dc
SS
1627 YY_NEW_FILE;
1628 }
1629 break;
1630 }
1631
1632 case EOB_ACT_CONTINUE_SCAN:
ef5ccd6c
JM
1633 (yy_c_buf_p) =
1634 (yytext_ptr) + yy_amount_of_matched_text;
5796c8dc 1635
ef5ccd6c 1636 yy_current_state = yy_get_previous_state( );
5796c8dc 1637
ef5ccd6c
JM
1638 yy_cp = (yy_c_buf_p);
1639 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
5796c8dc
SS
1640 goto yy_match;
1641
1642 case EOB_ACT_LAST_MATCH:
ef5ccd6c
JM
1643 (yy_c_buf_p) =
1644 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
5796c8dc 1645
ef5ccd6c 1646 yy_current_state = yy_get_previous_state( );
5796c8dc 1647
ef5ccd6c
JM
1648 yy_cp = (yy_c_buf_p);
1649 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
5796c8dc
SS
1650 goto yy_find_action;
1651 }
1652 break;
1653 }
1654
1655 default:
1656 YY_FATAL_ERROR(
1657 "fatal flex scanner internal error--no action found" );
1658 } /* end of action switch */
1659 } /* end of scanning one token */
ef5ccd6c 1660} /* end of yylex */
5796c8dc
SS
1661
1662/* yy_get_next_buffer - try to read in a new buffer
1663 *
1664 * Returns a code representing an action:
1665 * EOB_ACT_LAST_MATCH -
1666 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1667 * EOB_ACT_END_OF_FILE - end of file
1668 */
ef5ccd6c
JM
1669static int yy_get_next_buffer (void)
1670{
1671 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1672 register char *source = (yytext_ptr);
5796c8dc
SS
1673 register int number_to_move, i;
1674 int ret_val;
1675
ef5ccd6c 1676 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
5796c8dc
SS
1677 YY_FATAL_ERROR(
1678 "fatal flex scanner internal error--end of buffer missed" );
1679
ef5ccd6c 1680 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
5796c8dc 1681 { /* Don't try to fill the buffer, so this is an EOF. */
ef5ccd6c 1682 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
5796c8dc
SS
1683 {
1684 /* We matched a single character, the EOB, so
1685 * treat this as a final EOF.
1686 */
1687 return EOB_ACT_END_OF_FILE;
1688 }
1689
1690 else
1691 {
1692 /* We matched some text prior to the EOB, first
1693 * process it.
1694 */
1695 return EOB_ACT_LAST_MATCH;
1696 }
1697 }
1698
1699 /* Try to read more data. */
1700
1701 /* First move last chars to start of buffer. */
ef5ccd6c 1702 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
5796c8dc
SS
1703
1704 for ( i = 0; i < number_to_move; ++i )
1705 *(dest++) = *(source++);
1706
ef5ccd6c 1707 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
5796c8dc
SS
1708 /* don't do the read, it's not guaranteed to return an EOF,
1709 * just force an EOF
1710 */
ef5ccd6c 1711 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
5796c8dc
SS
1712
1713 else
1714 {
ef5ccd6c
JM
1715 int num_to_read =
1716 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
5796c8dc
SS
1717
1718 while ( num_to_read <= 0 )
1719 { /* Not enough room in the buffer - grow it. */
5796c8dc
SS
1720
1721 /* just a shorter name for the current buffer */
ef5ccd6c 1722 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
5796c8dc
SS
1723
1724 int yy_c_buf_p_offset =
ef5ccd6c 1725 (int) ((yy_c_buf_p) - b->yy_ch_buf);
5796c8dc
SS
1726
1727 if ( b->yy_is_our_buffer )
1728 {
1729 int new_size = b->yy_buf_size * 2;
1730
1731 if ( new_size <= 0 )
1732 b->yy_buf_size += b->yy_buf_size / 8;
1733 else
1734 b->yy_buf_size *= 2;
1735
1736 b->yy_ch_buf = (char *)
1737 /* Include room in for 2 EOB chars. */
ef5ccd6c 1738 yyxrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
5796c8dc
SS
1739 }
1740 else
1741 /* Can't grow it, we don't own it. */
1742 b->yy_ch_buf = 0;
1743
1744 if ( ! b->yy_ch_buf )
1745 YY_FATAL_ERROR(
1746 "fatal error - scanner input buffer overflow" );
1747
ef5ccd6c 1748 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
5796c8dc 1749
ef5ccd6c 1750 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
5796c8dc 1751 number_to_move - 1;
ef5ccd6c 1752
5796c8dc
SS
1753 }
1754
1755 if ( num_to_read > YY_READ_BUF_SIZE )
1756 num_to_read = YY_READ_BUF_SIZE;
1757
1758 /* Read in more data. */
ef5ccd6c
JM
1759 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1760 (yy_n_chars), (size_t) num_to_read );
5796c8dc 1761
ef5ccd6c 1762 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
5796c8dc
SS
1763 }
1764
ef5ccd6c 1765 if ( (yy_n_chars) == 0 )
5796c8dc
SS
1766 {
1767 if ( number_to_move == YY_MORE_ADJ )
1768 {
1769 ret_val = EOB_ACT_END_OF_FILE;
ef5ccd6c 1770 yyrestart(yyin );
5796c8dc
SS
1771 }
1772
1773 else
1774 {
1775 ret_val = EOB_ACT_LAST_MATCH;
ef5ccd6c 1776 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
5796c8dc
SS
1777 YY_BUFFER_EOF_PENDING;
1778 }
1779 }
1780
1781 else
1782 ret_val = EOB_ACT_CONTINUE_SCAN;
1783
ef5ccd6c
JM
1784 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1785 /* Extend the array by 50%, plus the number we really need. */
1786 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1787 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyxrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1788 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1789 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1790 }
5796c8dc 1791
ef5ccd6c
JM
1792 (yy_n_chars) += number_to_move;
1793 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1794 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
5796c8dc 1795
ef5ccd6c 1796 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
5796c8dc 1797
ef5ccd6c
JM
1798 return ret_val;
1799}
5796c8dc
SS
1800
1801/* yy_get_previous_state - get the state just before the EOB char was reached */
1802
ef5ccd6c
JM
1803 static yy_state_type yy_get_previous_state (void)
1804{
5796c8dc
SS
1805 register yy_state_type yy_current_state;
1806 register char *yy_cp;
ef5ccd6c
JM
1807
1808 yy_current_state = (yy_start);
5796c8dc 1809
ef5ccd6c 1810 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
5796c8dc
SS
1811 {
1812 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1813 if ( yy_accept[yy_current_state] )
1814 {
ef5ccd6c
JM
1815 (yy_last_accepting_state) = yy_current_state;
1816 (yy_last_accepting_cpos) = yy_cp;
5796c8dc
SS
1817 }
1818 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1819 {
1820 yy_current_state = (int) yy_def[yy_current_state];
ef5ccd6c 1821 if ( yy_current_state >= 207 )
5796c8dc
SS
1822 yy_c = yy_meta[(unsigned int) yy_c];
1823 }
1824 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1825 }
1826
1827 return yy_current_state;
ef5ccd6c 1828}
5796c8dc
SS
1829
1830/* yy_try_NUL_trans - try to make a transition on the NUL character
1831 *
1832 * synopsis
1833 * next_state = yy_try_NUL_trans( current_state );
1834 */
ef5ccd6c
JM
1835 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1836{
5796c8dc 1837 register int yy_is_jam;
ef5ccd6c 1838 register char *yy_cp = (yy_c_buf_p);
5796c8dc
SS
1839
1840 register YY_CHAR yy_c = 1;
1841 if ( yy_accept[yy_current_state] )
1842 {
ef5ccd6c
JM
1843 (yy_last_accepting_state) = yy_current_state;
1844 (yy_last_accepting_cpos) = yy_cp;
5796c8dc
SS
1845 }
1846 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1847 {
1848 yy_current_state = (int) yy_def[yy_current_state];
ef5ccd6c 1849 if ( yy_current_state >= 207 )
5796c8dc
SS
1850 yy_c = yy_meta[(unsigned int) yy_c];
1851 }
1852 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
ef5ccd6c 1853 yy_is_jam = (yy_current_state == 206);
5796c8dc
SS
1854
1855 return yy_is_jam ? 0 : yy_current_state;
ef5ccd6c 1856}
5796c8dc 1857
ef5ccd6c
JM
1858 static void yyunput (int c, register char * yy_bp )
1859{
1860 register char *yy_cp;
1861
1862 yy_cp = (yy_c_buf_p);
5796c8dc
SS
1863
1864 /* undo effects of setting up yytext */
ef5ccd6c 1865 *yy_cp = (yy_hold_char);
5796c8dc 1866
ef5ccd6c 1867 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
5796c8dc
SS
1868 { /* need to shift things up to make room */
1869 /* +2 for EOB chars. */
ef5ccd6c
JM
1870 register int number_to_move = (yy_n_chars) + 2;
1871 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1872 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
5796c8dc 1873 register char *source =
ef5ccd6c 1874 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
5796c8dc 1875
ef5ccd6c 1876 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
5796c8dc
SS
1877 *--dest = *--source;
1878
1879 yy_cp += (int) (dest - source);
1880 yy_bp += (int) (dest - source);
ef5ccd6c
JM
1881 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1882 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
5796c8dc 1883
ef5ccd6c 1884 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
5796c8dc
SS
1885 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1886 }
1887
1888 *--yy_cp = (char) c;
1889
ef5ccd6c
JM
1890 (yytext_ptr) = yy_bp;
1891 (yy_hold_char) = *yy_cp;
1892 (yy_c_buf_p) = yy_cp;
1893}
5796c8dc
SS
1894
1895#ifndef YY_NO_INPUT
1896#ifdef __cplusplus
ef5ccd6c 1897 static int yyinput (void)
5796c8dc 1898#else
ef5ccd6c 1899 static int input (void)
5796c8dc 1900#endif
5796c8dc 1901
ef5ccd6c
JM
1902{
1903 int c;
1904
1905 *(yy_c_buf_p) = (yy_hold_char);
5796c8dc 1906
ef5ccd6c 1907 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
5796c8dc
SS
1908 {
1909 /* yy_c_buf_p now points to the character we want to return.
1910 * If this occurs *before* the EOB characters, then it's a
1911 * valid NUL; if not, then we've hit the end of the buffer.
1912 */
ef5ccd6c 1913 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
5796c8dc 1914 /* This was really a NUL. */
ef5ccd6c 1915 *(yy_c_buf_p) = '\0';
5796c8dc
SS
1916
1917 else
1918 { /* need more input */
ef5ccd6c
JM
1919 int offset = (yy_c_buf_p) - (yytext_ptr);
1920 ++(yy_c_buf_p);
5796c8dc 1921
ef5ccd6c 1922 switch ( yy_get_next_buffer( ) )
5796c8dc
SS
1923 {
1924 case EOB_ACT_LAST_MATCH:
1925 /* This happens because yy_g_n_b()
1926 * sees that we've accumulated a
1927 * token and flags that we need to
1928 * try matching the token before
1929 * proceeding. But for input(),
1930 * there's no matching to consider.
1931 * So convert the EOB_ACT_LAST_MATCH
1932 * to EOB_ACT_END_OF_FILE.
1933 */
1934
1935 /* Reset buffer status. */
ef5ccd6c 1936 yyrestart(yyin );
5796c8dc 1937
ef5ccd6c 1938 /*FALLTHROUGH*/
5796c8dc
SS
1939
1940 case EOB_ACT_END_OF_FILE:
1941 {
ef5ccd6c 1942 if ( yywrap( ) )
5796c8dc
SS
1943 return EOF;
1944
ef5ccd6c 1945 if ( ! (yy_did_buffer_switch_on_eof) )
5796c8dc
SS
1946 YY_NEW_FILE;
1947#ifdef __cplusplus
1948 return yyinput();
1949#else
1950 return input();
1951#endif
1952 }
1953
1954 case EOB_ACT_CONTINUE_SCAN:
ef5ccd6c 1955 (yy_c_buf_p) = (yytext_ptr) + offset;
5796c8dc
SS
1956 break;
1957 }
1958 }
1959 }
1960
ef5ccd6c
JM
1961 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1962 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1963 (yy_hold_char) = *++(yy_c_buf_p);
5796c8dc
SS
1964
1965 return c;
ef5ccd6c
JM
1966}
1967#endif /* ifndef YY_NO_INPUT */
5796c8dc 1968
ef5ccd6c
JM
1969/** Immediately switch to a different input stream.
1970 * @param input_file A readable stream.
1971 *
1972 * @note This function does not reset the start condition to @c INITIAL .
1973 */
1974 void yyrestart (FILE * input_file )
1975{
1976
1977 if ( ! YY_CURRENT_BUFFER ){
1978 yyensure_buffer_stack ();
1979 YY_CURRENT_BUFFER_LVALUE =
1980 yy_create_buffer(yyin,YY_BUF_SIZE );
5796c8dc
SS
1981 }
1982
ef5ccd6c
JM
1983 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1984 yy_load_buffer_state( );
1985}
5796c8dc 1986
ef5ccd6c
JM
1987/** Switch to a different input buffer.
1988 * @param new_buffer The new input buffer.
1989 *
1990 */
1991 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1992{
1993
1994 /* TODO. We should be able to replace this entire function body
1995 * with
1996 * yypop_buffer_state();
1997 * yypush_buffer_state(new_buffer);
1998 */
1999 yyensure_buffer_stack ();
2000 if ( YY_CURRENT_BUFFER == new_buffer )
5796c8dc
SS
2001 return;
2002
ef5ccd6c 2003 if ( YY_CURRENT_BUFFER )
5796c8dc
SS
2004 {
2005 /* Flush out information for old buffer. */
ef5ccd6c
JM
2006 *(yy_c_buf_p) = (yy_hold_char);
2007 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2008 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
5796c8dc
SS
2009 }
2010
ef5ccd6c
JM
2011 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2012 yy_load_buffer_state( );
5796c8dc
SS
2013
2014 /* We don't actually know whether we did this switch during
2015 * EOF (yywrap()) processing, but the only time this flag
2016 * is looked at is after yywrap() is called, so it's safe
2017 * to go ahead and always set it.
2018 */
ef5ccd6c
JM
2019 (yy_did_buffer_switch_on_eof) = 1;
2020}
5796c8dc 2021
ef5ccd6c
JM
2022static void yy_load_buffer_state (void)
2023{
2024 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2025 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2026 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2027 (yy_hold_char) = *(yy_c_buf_p);
2028}
5796c8dc 2029
ef5ccd6c
JM
2030/** Allocate and initialize an input buffer state.
2031 * @param file A readable stream.
2032 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2033 *
2034 * @return the allocated buffer state.
2035 */
2036 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2037{
5796c8dc 2038 YY_BUFFER_STATE b;
ef5ccd6c
JM
2039
2040 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
5796c8dc
SS
2041 if ( ! b )
2042 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2043
2044 b->yy_buf_size = size;
2045
2046 /* yy_ch_buf has to be 2 characters longer than the size given because
2047 * we need to put in 2 end-of-buffer characters.
2048 */
ef5ccd6c 2049 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
5796c8dc
SS
2050 if ( ! b->yy_ch_buf )
2051 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2052
2053 b->yy_is_our_buffer = 1;
2054
ef5ccd6c 2055 yy_init_buffer(b,file );
5796c8dc
SS
2056
2057 return b;
ef5ccd6c 2058}
5796c8dc 2059
ef5ccd6c
JM
2060/** Destroy the buffer.
2061 * @param b a buffer created with yy_create_buffer()
2062 *
2063 */
2064 void yy_delete_buffer (YY_BUFFER_STATE b )
2065{
2066
5796c8dc
SS
2067 if ( ! b )
2068 return;
2069
ef5ccd6c
JM
2070 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2071 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
5796c8dc
SS
2072
2073 if ( b->yy_is_our_buffer )
ef5ccd6c 2074 yyfree((void *) b->yy_ch_buf );
5796c8dc 2075
ef5ccd6c
JM
2076 yyfree((void *) b );
2077}
5796c8dc 2078
ef5ccd6c
JM
2079#ifndef __cplusplus
2080extern int isatty (int );
2081#endif /* __cplusplus */
2082
2083/* Initializes or reinitializes a buffer.
2084 * This function is sometimes called more than once on the same buffer,
2085 * such as during a yyrestart() or at EOF.
2086 */
2087 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
5796c8dc 2088
ef5ccd6c
JM
2089{
2090 int oerrno = errno;
2091
2092 yy_flush_buffer(b );
5796c8dc
SS
2093
2094 b->yy_input_file = file;
2095 b->yy_fill_buffer = 1;
2096
ef5ccd6c
JM
2097 /* If b is the current buffer, then yy_init_buffer was _probably_
2098 * called from yyrestart() or through yy_get_next_buffer.
2099 * In that case, we don't want to reset the lineno or column.
2100 */
2101 if (b != YY_CURRENT_BUFFER){
2102 b->yy_bs_lineno = 1;
2103 b->yy_bs_column = 0;
2104 }
5796c8dc 2105
ef5ccd6c
JM
2106 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2107
2108 errno = oerrno;
2109}
5796c8dc 2110
ef5ccd6c
JM
2111/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2112 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2113 *
2114 */
2115 void yy_flush_buffer (YY_BUFFER_STATE b )
2116{
2117 if ( ! b )
5796c8dc
SS
2118 return;
2119
2120 b->yy_n_chars = 0;
2121
2122 /* We always need two end-of-buffer characters. The first causes
2123 * a transition to the end-of-buffer state. The second causes
2124 * a jam in that state.
2125 */
2126 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2127 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2128
2129 b->yy_buf_pos = &b->yy_ch_buf[0];
2130
2131 b->yy_at_bol = 1;
2132 b->yy_buffer_status = YY_BUFFER_NEW;
2133
ef5ccd6c
JM
2134 if ( b == YY_CURRENT_BUFFER )
2135 yy_load_buffer_state( );
2136}
2137
2138/** Pushes the new state onto the stack. The new state becomes
2139 * the current state. This function will allocate the stack
2140 * if necessary.
2141 * @param new_buffer The new state.
2142 *
2143 */
2144void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2145{
2146 if (new_buffer == NULL)
2147 return;
2148
2149 yyensure_buffer_stack();
2150
2151 /* This block is copied from yy_switch_to_buffer. */
2152 if ( YY_CURRENT_BUFFER )
2153 {
2154 /* Flush out information for old buffer. */
2155 *(yy_c_buf_p) = (yy_hold_char);
2156 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2157 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2158 }
2159
2160 /* Only push if top exists. Otherwise, replace top. */
2161 if (YY_CURRENT_BUFFER)
2162 (yy_buffer_stack_top)++;
2163 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2164
2165 /* copied from yy_switch_to_buffer. */
2166 yy_load_buffer_state( );
2167 (yy_did_buffer_switch_on_eof) = 1;
2168}
2169
2170/** Removes and deletes the top of the stack, if present.
2171 * The next element becomes the new top.
2172 *
2173 */
2174void yypop_buffer_state (void)
2175{
2176 if (!YY_CURRENT_BUFFER)
2177 return;
2178
2179 yy_delete_buffer(YY_CURRENT_BUFFER );
2180 YY_CURRENT_BUFFER_LVALUE = NULL;
2181 if ((yy_buffer_stack_top) > 0)
2182 --(yy_buffer_stack_top);
2183
2184 if (YY_CURRENT_BUFFER) {
2185 yy_load_buffer_state( );
2186 (yy_did_buffer_switch_on_eof) = 1;
5796c8dc 2187 }
ef5ccd6c 2188}
5796c8dc 2189
ef5ccd6c
JM
2190/* Allocates the stack if it does not exist.
2191 * Guarantees space for at least one push.
2192 */
2193static void yyensure_buffer_stack (void)
2194{
2195 int num_to_alloc;
2196
2197 if (!(yy_buffer_stack)) {
2198
2199 /* First allocation is just for 2 elements, since we don't know if this
2200 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2201 * immediate xrealloc on the next call.
2202 */
2203 num_to_alloc = 1;
2204 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2205 (num_to_alloc * sizeof(struct yy_buffer_state*)
2206 );
2207 if ( ! (yy_buffer_stack) )
2208 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2209
2210 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2211
2212 (yy_buffer_stack_max) = num_to_alloc;
2213 (yy_buffer_stack_top) = 0;
2214 return;
2215 }
5796c8dc 2216
ef5ccd6c
JM
2217 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2218
2219 /* Increase the buffer to prepare for a possible push. */
2220 int grow_size = 8 /* arbitrary grow size */;
2221
2222 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2223 (yy_buffer_stack) = (struct yy_buffer_state**)yyxrealloc
2224 ((yy_buffer_stack),
2225 num_to_alloc * sizeof(struct yy_buffer_state*)
2226 );
2227 if ( ! (yy_buffer_stack) )
2228 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2229
2230 /* zero only the new slots.*/
2231 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2232 (yy_buffer_stack_max) = num_to_alloc;
2233 }
2234}
5796c8dc 2235
ef5ccd6c
JM
2236/** Setup the input buffer state to scan directly from a user-specified character buffer.
2237 * @param base the character buffer
2238 * @param size the size in bytes of the character buffer
2239 *
2240 * @return the newly allocated buffer state object.
2241 */
2242YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2243{
2244 YY_BUFFER_STATE b;
2245
5796c8dc
SS
2246 if ( size < 2 ||
2247 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2248 base[size-1] != YY_END_OF_BUFFER_CHAR )
2249 /* They forgot to leave room for the EOB's. */
2250 return 0;
2251
ef5ccd6c 2252 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
5796c8dc
SS
2253 if ( ! b )
2254 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2255
2256 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2257 b->yy_buf_pos = b->yy_ch_buf = base;
2258 b->yy_is_our_buffer = 0;
2259 b->yy_input_file = 0;
2260 b->yy_n_chars = b->yy_buf_size;
2261 b->yy_is_interactive = 0;
2262 b->yy_at_bol = 1;
2263 b->yy_fill_buffer = 0;
2264 b->yy_buffer_status = YY_BUFFER_NEW;
2265
ef5ccd6c 2266 yy_switch_to_buffer(b );
5796c8dc
SS
2267
2268 return b;
ef5ccd6c 2269}
5796c8dc 2270
ef5ccd6c
JM
2271/** Setup the input buffer state to scan a string. The next call to yylex() will
2272 * scan from a @e copy of @a str.
2273 * @param yystr a NUL-terminated string to scan
2274 *
2275 * @return the newly allocated buffer state object.
2276 * @note If you want to scan bytes that may contain NUL values, then use
2277 * yy_scan_bytes() instead.
2278 */
2279YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2280{
2281
2282 return yy_scan_bytes(yystr,strlen(yystr) );
2283}
5796c8dc 2284
ef5ccd6c
JM
2285/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2286 * scan from a @e copy of @a bytes.
2287 * @param bytes the byte buffer to scan
2288 * @param len the number of bytes in the buffer pointed to by @a bytes.
2289 *
2290 * @return the newly allocated buffer state object.
2291 */
2292YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
2293{
5796c8dc
SS
2294 YY_BUFFER_STATE b;
2295 char *buf;
2296 yy_size_t n;
2297 int i;
ef5ccd6c 2298
5796c8dc 2299 /* Get memory for full buffer, including space for trailing EOB's. */
ef5ccd6c
JM
2300 n = _yybytes_len + 2;
2301 buf = (char *) yyalloc(n );
5796c8dc
SS
2302 if ( ! buf )
2303 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2304
ef5ccd6c
JM
2305 for ( i = 0; i < _yybytes_len; ++i )
2306 buf[i] = yybytes[i];
5796c8dc 2307
ef5ccd6c 2308 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
5796c8dc 2309
ef5ccd6c 2310 b = yy_scan_buffer(buf,n );
5796c8dc
SS
2311 if ( ! b )
2312 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2313
2314 /* It's okay to grow etc. this buffer, and we should throw it
2315 * away when we're done.
2316 */
2317 b->yy_is_our_buffer = 1;
2318
2319 return b;
ef5ccd6c
JM
2320}
2321
2322#ifndef YY_EXIT_FAILURE
2323#define YY_EXIT_FAILURE 2
5796c8dc
SS
2324#endif
2325
ef5ccd6c
JM
2326static void yy_fatal_error (yyconst char* msg )
2327{
2328 (void) fprintf( stderr, "%s\n", msg );
2329 exit( YY_EXIT_FAILURE );
2330}
5796c8dc 2331
ef5ccd6c 2332/* Redefine yyless() so it works in section 3 code. */
5796c8dc 2333
ef5ccd6c
JM
2334#undef yyless
2335#define yyless(n) \
2336 do \
2337 { \
2338 /* Undo effects of setting up yytext. */ \
2339 int yyless_macro_arg = (n); \
2340 YY_LESS_LINENO(yyless_macro_arg);\
2341 yytext[yyleng] = (yy_hold_char); \
2342 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2343 (yy_hold_char) = *(yy_c_buf_p); \
2344 *(yy_c_buf_p) = '\0'; \
2345 yyleng = yyless_macro_arg; \
2346 } \
2347 while ( 0 )
5796c8dc 2348
ef5ccd6c 2349/* Accessor methods (get/set functions) to struct members. */
5796c8dc 2350
ef5ccd6c
JM
2351/** Get the current line number.
2352 *
2353 */
2354int yyget_lineno (void)
2355{
2356
2357 return yylineno;
2358}
5796c8dc 2359
ef5ccd6c
JM
2360/** Get the input stream.
2361 *
2362 */
2363FILE *yyget_in (void)
2364{
2365 return yyin;
2366}
5796c8dc 2367
ef5ccd6c
JM
2368/** Get the output stream.
2369 *
2370 */
2371FILE *yyget_out (void)
2372{
2373 return yyout;
2374}
5796c8dc 2375
ef5ccd6c
JM
2376/** Get the length of the current token.
2377 *
2378 */
2379int yyget_leng (void)
2380{
2381 return yyleng;
2382}
5796c8dc 2383
ef5ccd6c
JM
2384/** Get the current token.
2385 *
2386 */
5796c8dc 2387
ef5ccd6c
JM
2388char *yyget_text (void)
2389{
2390 return yytext;
2391}
5796c8dc 2392
ef5ccd6c
JM
2393/** Set the current line number.
2394 * @param line_number
2395 *
2396 */
2397void yyset_lineno (int line_number )
2398{
2399
2400 yylineno = line_number;
2401}
5796c8dc 2402
ef5ccd6c
JM
2403/** Set the input stream. This does not discard the current
2404 * input buffer.
2405 * @param in_str A readable stream.
2406 *
2407 * @see yy_switch_to_buffer
2408 */
2409void yyset_in (FILE * in_str )
2410{
2411 yyin = in_str ;
2412}
5796c8dc 2413
ef5ccd6c
JM
2414void yyset_out (FILE * out_str )
2415{
2416 yyout = out_str ;
2417}
5796c8dc 2418
ef5ccd6c
JM
2419int yyget_debug (void)
2420{
2421 return yy_flex_debug;
2422}
2423
2424void yyset_debug (int bdebug )
2425{
2426 yy_flex_debug = bdebug ;
2427}
5796c8dc 2428
ef5ccd6c
JM
2429static int yy_init_globals (void)
2430{
2431 /* Initialization is the same as for the non-reentrant scanner.
2432 * This function is called from yylex_destroy(), so don't allocate here.
2433 */
2434
2435 (yy_buffer_stack) = 0;
2436 (yy_buffer_stack_top) = 0;
2437 (yy_buffer_stack_max) = 0;
2438 (yy_c_buf_p) = (char *) 0;
2439 (yy_init) = 0;
2440 (yy_start) = 0;
2441
2442/* Defined in main.c */
2443#ifdef YY_STDINIT
2444 yyin = stdin;
2445 yyout = stdout;
5796c8dc 2446#else
ef5ccd6c
JM
2447 yyin = (FILE *) 0;
2448 yyout = (FILE *) 0;
5796c8dc 2449#endif
5796c8dc 2450
ef5ccd6c
JM
2451 /* For future reference: Set errno on error, since we are called by
2452 * yylex_init()
2453 */
2454 return 0;
2455}
5796c8dc 2456
ef5ccd6c
JM
2457/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2458int yylex_destroy (void)
2459{
2460
2461 /* Pop the buffer stack, destroying each element. */
2462 while(YY_CURRENT_BUFFER){
2463 yy_delete_buffer(YY_CURRENT_BUFFER );
2464 YY_CURRENT_BUFFER_LVALUE = NULL;
2465 yypop_buffer_state();
2466 }
5796c8dc 2467
ef5ccd6c
JM
2468 /* Destroy the stack itself. */
2469 yyfree((yy_buffer_stack) );
2470 (yy_buffer_stack) = NULL;
5796c8dc 2471
ef5ccd6c
JM
2472 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2473 * yylex() is called, initialization will occur. */
2474 yy_init_globals( );
5796c8dc 2475
ef5ccd6c
JM
2476 return 0;
2477}
5796c8dc 2478
ef5ccd6c
JM
2479/*
2480 * Internal utility routines.
2481 */
5796c8dc
SS
2482
2483#ifndef yytext_ptr
ef5ccd6c
JM
2484static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2485{
5796c8dc
SS
2486 register int i;
2487 for ( i = 0; i < n; ++i )
2488 s1[i] = s2[i];
ef5ccd6c 2489}
5796c8dc
SS
2490#endif
2491
2492#ifdef YY_NEED_STRLEN
ef5ccd6c
JM
2493static int yy_flex_strlen (yyconst char * s )
2494{
5796c8dc
SS
2495 register int n;
2496 for ( n = 0; s[n]; ++n )
2497 ;
2498
2499 return n;
ef5ccd6c 2500}
5796c8dc
SS
2501#endif
2502
ef5ccd6c
JM
2503void *yyalloc (yy_size_t size )
2504{
5796c8dc 2505 return (void *) xmalloc( size );
ef5ccd6c 2506}
5796c8dc 2507
ef5ccd6c
JM
2508void *yyxrealloc (void * ptr, yy_size_t size )
2509{
5796c8dc
SS
2510 /* The cast to (char *) in the following accommodates both
2511 * implementations that use char* generic pointers, and those
2512 * that use void* generic pointers. It works with the latter
2513 * because both ANSI C and C++ allow castless assignment from
2514 * any pointer type to void*, and deal with argument conversions
2515 * as though doing an assignment.
2516 */
2517 return (void *) xrealloc( (char *) ptr, size );
ef5ccd6c 2518}
5796c8dc 2519
ef5ccd6c
JM
2520void yyfree (void * ptr )
2521{
2522 xfree( (char *) ptr ); /* see yyxrealloc() for (char *) cast */
2523}
2524
2525#define YYTABLES_NAME "yytables"
2526
2527#line 288 "ada-lex.l"
5796c8dc 2528
5796c8dc
SS
2529
2530
2531#include <ctype.h>
2532#include "gdb_string.h"
2533
2534/* Initialize the lexer for processing new expression. */
2535
ef5ccd6c 2536static void
5796c8dc
SS
2537lexer_init (FILE *inp)
2538{
2539 BEGIN INITIAL;
2540 yyrestart (inp);
2541}
2542
2543
2544/* Copy S2 to S1, removing all underscores, and downcasing all letters. */
2545
2546static void
2547canonicalizeNumeral (char *s1, const char *s2)
2548{
2549 for (; *s2 != '\000'; s2 += 1)
2550 {
2551 if (*s2 != '_')
2552 {
2553 *s1 = tolower(*s2);
2554 s1 += 1;
2555 }
2556 }
2557 s1[0] = '\000';
2558}
2559
2560/* Interprets the prefix of NUM that consists of digits of the given BASE
2561 as an integer of that BASE, with the string EXP as an exponent.
2562 Puts value in yylval, and returns INT, if the string is valid. Causes
2563 an error if the number is improperly formated. BASE, if NULL, defaults
2564 to "10", and EXP to "1". The EXP does not contain a leading 'e' or 'E'.
2565 */
2566
2567static int
2568processInt (const char *base0, const char *num0, const char *exp0)
2569{
2570 ULONGEST result;
2571 long exp;
2572 int base;
2573
2574 char *trailer;
2575
2576 if (base0 == NULL)
2577 base = 10;
2578 else
2579 {
2580 base = strtol (base0, (char **) NULL, 10);
2581 if (base < 2 || base > 16)
2582 error (_("Invalid base: %d."), base);
2583 }
2584
2585 if (exp0 == NULL)
2586 exp = 0;
2587 else
2588 exp = strtol(exp0, (char **) NULL, 10);
2589
2590 errno = 0;
2591 result = strtoulst (num0, (const char **) &trailer, base);
2592 if (errno == ERANGE)
2593 error (_("Integer literal out of range"));
2594 if (isxdigit(*trailer))
2595 error (_("Invalid digit `%c' in based literal"), *trailer);
2596
2597 while (exp > 0)
2598 {
2599 if (result > (ULONG_MAX / base))
2600 error (_("Integer literal out of range"));
2601 result *= base;
2602 exp -= 1;
2603 }
2604
2605 if ((result >> (gdbarch_int_bit (parse_gdbarch)-1)) == 0)
2606 yylval.typed_val.type = type_int ();
2607 else if ((result >> (gdbarch_long_bit (parse_gdbarch)-1)) == 0)
2608 yylval.typed_val.type = type_long ();
2609 else if (((result >> (gdbarch_long_bit (parse_gdbarch)-1)) >> 1) == 0)
2610 {
2611 /* We have a number representable as an unsigned integer quantity.
2612 For consistency with the C treatment, we will treat it as an
2613 anonymous modular (unsigned) quantity. Alas, the types are such
2614 that we need to store .val as a signed quantity. Sorry
2615 for the mess, but C doesn't officially guarantee that a simple
2616 assignment does the trick (no, it doesn't; read the reference manual).
2617 */
2618 yylval.typed_val.type
2619 = builtin_type (parse_gdbarch)->builtin_unsigned_long;
2620 if (result & LONGEST_SIGN)
2621 yylval.typed_val.val =
2622 (LONGEST) (result & ~LONGEST_SIGN)
2623 - (LONGEST_SIGN>>1) - (LONGEST_SIGN>>1);
2624 else
2625 yylval.typed_val.val = (LONGEST) result;
2626 return INT;
2627 }
2628 else
2629 yylval.typed_val.type = type_long_long ();
2630
2631 yylval.typed_val.val = (LONGEST) result;
2632 return INT;
2633}
2634
2635static int
2636processReal (const char *num0)
2637{
2638 sscanf (num0, "%" DOUBLEST_SCAN_FORMAT, &yylval.typed_val_float.dval);
2639
2640 yylval.typed_val_float.type = type_float ();
2641 if (sizeof(DOUBLEST) >= gdbarch_double_bit (parse_gdbarch)
2642 / TARGET_CHAR_BIT)
2643 yylval.typed_val_float.type = type_double ();
2644 if (sizeof(DOUBLEST) >= gdbarch_long_double_bit (parse_gdbarch)
2645 / TARGET_CHAR_BIT)
2646 yylval.typed_val_float.type = type_long_double ();
2647
2648 return FLOAT;
2649}
2650
2651
2652/* Store a canonicalized version of NAME0[0..LEN-1] in yylval.ssym. The
ef5ccd6c
JM
2653 resulting string is valid until the next call to ada_parse. If
2654 NAME0 contains the substring "___", it is assumed to be already
2655 encoded and the resulting name is equal to it. Otherwise, it differs
5796c8dc
SS
2656 from NAME0 in that:
2657 + Characters between '...' or <...> are transfered verbatim to
2658 yylval.ssym.
2659 + <, >, and trailing "'" characters in quoted sequences are removed
2660 (a leading quote is preserved to indicate that the name is not to be
2661 GNAT-encoded).
2662 + Unquoted whitespace is removed.
2663 + Unquoted alphabetic characters are mapped to lower case.
2664 Result is returned as a struct stoken, but for convenience, the string
2665 is also null-terminated. Result string valid until the next call of
2666 ada_parse.
2667 */
2668static struct stoken
2669processId (const char *name0, int len)
2670{
2671 char *name = obstack_alloc (&temp_parse_space, len + 11);
2672 int i0, i;
2673 struct stoken result;
2674
ef5ccd6c 2675 result.ptr = name;
5796c8dc
SS
2676 while (len > 0 && isspace (name0[len-1]))
2677 len -= 1;
ef5ccd6c
JM
2678
2679 if (strstr (name0, "___") != NULL)
2680 {
2681 strncpy (name, name0, len);
2682 name[len] = '\000';
2683 result.length = len;
2684 return result;
2685 }
2686
5796c8dc
SS
2687 i = i0 = 0;
2688 while (i0 < len)
2689 {
2690 if (isalnum (name0[i0]))
2691 {
2692 name[i] = tolower (name0[i0]);
2693 i += 1; i0 += 1;
2694 }
2695 else switch (name0[i0])
2696 {
2697 default:
2698 name[i] = name0[i0];
2699 i += 1; i0 += 1;
2700 break;
2701 case ' ': case '\t':
2702 i0 += 1;
2703 break;
2704 case '\'':
2705 do
2706 {
2707 name[i] = name0[i0];
2708 i += 1; i0 += 1;
2709 }
2710 while (i0 < len && name0[i0] != '\'');
2711 i0 += 1;
2712 break;
2713 case '<':
2714 i0 += 1;
2715 while (i0 < len && name0[i0] != '>')
2716 {
2717 name[i] = name0[i0];
2718 i += 1; i0 += 1;
2719 }
2720 i0 += 1;
2721 break;
2722 }
2723 }
2724 name[i] = '\000';
2725
5796c8dc
SS
2726 result.length = i;
2727 return result;
2728}
2729
2730/* Return TEXT[0..LEN-1], a string literal without surrounding quotes,
2731 with special hex character notations replaced with characters.
2732 Result valid until the next call to ada_parse. */
2733
2734static struct stoken
2735processString (const char *text, int len)
2736{
2737 const char *p;
2738 char *q;
2739 const char *lim = text + len;
2740 struct stoken result;
2741
2742 q = result.ptr = obstack_alloc (&temp_parse_space, len);
2743 p = text;
2744 while (p < lim)
2745 {
2746 if (p[0] == '[' && p[1] == '"' && p+2 < lim)
2747 {
2748 if (p[2] == '"') /* "...["""]... */
2749 {
2750 *q = '"';
2751 p += 4;
2752 }
2753 else
2754 {
2755 int chr;
2756 sscanf (p+2, "%2x", &chr);
2757 *q = (char) chr;
2758 p += 5;
2759 }
2760 }
2761 else
2762 *q = *p;
2763 q += 1;
2764 p += 1;
2765 }
2766 result.length = q - result.ptr;
2767 return result;
2768}
2769
2770/* Returns the position within STR of the '.' in a
2771 '.{WHITE}*all' component of a dotted name, or -1 if there is none.
2772 Note: we actually don't need this routine, since 'all' can never be an
2773 Ada identifier. Thus, looking up foo.all or foo.all.x as a name
2774 must fail, and will eventually be interpreted as (foo).all or
2775 (foo).all.x. However, this does avoid an extraneous lookup. */
2776
2777static int
2778find_dot_all (const char *str)
2779{
2780 int i;
2781 for (i = 0; str[i] != '\000'; i += 1)
2782 {
2783 if (str[i] == '.')
2784 {
2785 int i0 = i;
2786 do
2787 i += 1;
2788 while (isspace (str[i]));
2789 if (strncmp (str+i, "all", 3) == 0
2790 && ! isalnum (str[i+3]) && str[i+3] != '_')
2791 return i0;
2792 }
2793 }
2794 return -1;
2795}
2796
2797/* Returns non-zero iff string SUBSEQ matches a subsequence of STR, ignoring
2798 case. */
2799
2800static int
2801subseqMatch (const char *subseq, const char *str)
2802{
2803 if (subseq[0] == '\0')
2804 return 1;
2805 else if (str[0] == '\0')
2806 return 0;
2807 else if (tolower (subseq[0]) == tolower (str[0]))
2808 return subseqMatch (subseq+1, str+1) || subseqMatch (subseq, str+1);
2809 else
2810 return subseqMatch (subseq, str+1);
2811}
2812
2813
2814static struct { const char *name; int code; }
2815attributes[] = {
2816 { "address", TICK_ADDRESS },
2817 { "unchecked_access", TICK_ACCESS },
2818 { "unrestricted_access", TICK_ACCESS },
2819 { "access", TICK_ACCESS },
2820 { "first", TICK_FIRST },
2821 { "last", TICK_LAST },
2822 { "length", TICK_LENGTH },
2823 { "max", TICK_MAX },
2824 { "min", TICK_MIN },
2825 { "modulus", TICK_MODULUS },
2826 { "pos", TICK_POS },
2827 { "range", TICK_RANGE },
2828 { "size", TICK_SIZE },
2829 { "tag", TICK_TAG },
2830 { "val", TICK_VAL },
2831 { NULL, -1 }
2832};
2833
2834/* Return the syntactic code corresponding to the attribute name or
2835 abbreviation STR. */
2836
2837static int
2838processAttribute (const char *str)
2839{
2840 int i, k;
2841
2842 for (i = 0; attributes[i].code != -1; i += 1)
2843 if (strcasecmp (str, attributes[i].name) == 0)
2844 return attributes[i].code;
2845
2846 for (i = 0, k = -1; attributes[i].code != -1; i += 1)
2847 if (subseqMatch (str, attributes[i].name))
2848 {
2849 if (k == -1)
2850 k = i;
2851 else
2852 error (_("ambiguous attribute name: `%s'"), str);
2853 }
2854 if (k == -1)
2855 error (_("unrecognized attribute: `%s'"), str);
2856
2857 return attributes[k].code;
2858}
2859
ef5ccd6c
JM
2860/* Back up lexptr by yyleng and then to the rightmost occurrence of
2861 character CH, case-folded (there must be one). WARNING: since
2862 lexptr points to the next input character that Flex has not yet
2863 transferred to its internal buffer, the use of this function
2864 depends on the assumption that Flex calls YY_INPUT only when it is
2865 logically necessary to do so (thus, there is no reading ahead
2866 farther than needed to identify the next token.) */
2867
2868static void
2869rewind_to_char (int ch)
2870{
2871 lexptr -= yyleng;
2872 while (toupper (*lexptr) != toupper (ch))
2873 lexptr -= 1;
2874 yyrestart (NULL);
2875}
2876
5796c8dc
SS
2877int
2878yywrap(void)
2879{
2880 return 1;
2881}
2882
2883/* Dummy definition to suppress warnings about unused static definitions. */
2884typedef void (*dummy_function) ();
2885dummy_function ada_flex_use[] =
2886{
2887 (dummy_function) yyunput
2888};
ef5ccd6c 2889