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