binutils-gdb/gdb/ada-lex.c
2002-06-04 15:28:49 +00:00

3175 lines
93 KiB
C

/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header$
* $FreeBSD: src/usr.bin/lex/flex.skl,v 1.4 1999/10/27 07:56:44 obrien Exp $
*/
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#include <stdio.h>
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif
#ifdef __cplusplus
#include <stdlib.h>
#include <unistd.h>
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
#if __STDC__
#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
#ifdef __TURBOC__
#pragma warn -rch
#pragma warn -use
#include <io.h>
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN yy_start = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#define YY_BUF_SIZE 16384
typedef struct yy_buffer_state *YY_BUFFER_STATE;
extern int yyleng;
extern FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
/* The funky do-while in the following #define is used to turn the definition
* int a single C statement (which needs a semi-colon terminator). This
* avoids problems with code like:
*
* if ( condition_holds )
* yyless( 5 );
* else
* do_something_else();
*
* Prior to using the do-while the compiler would get upset at the
* "else" because it interpreted the "if" statement as being all
* done when it reached the ';' after the yyless() call.
*/
/* Return all but the first 'n' matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
*yy_cp = yy_hold_char; \
YY_RESTORE_YY_MORE_OFFSET \
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, yytext_ptr )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
*/
typedef unsigned int yy_size_t;
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};
static YY_BUFFER_STATE yy_current_buffer = 0;
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*/
#define YY_CURRENT_BUFFER yy_current_buffer
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 1; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* Flag which is used to allow yywrap()'s to do buffer switches
* instead of setting up a fresh yyin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
void yyrestart YY_PROTO(( FILE *input_file ));
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));
#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
#define YY_USES_REJECT
typedef unsigned char YY_CHAR;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
typedef int yy_state_type;
extern char *yytext;
#define yytext_ptr yytext
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
yytext_ptr = yy_bp; \
yyleng = (int) (yy_cp - yy_bp); \
yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 57
#define YY_END_OF_BUFFER 58
static yyconst short int yy_acclist[386] =
{ 0,
58, 56, 57, 1, 56, 57, 1, 57, 15, 56,
57, 53, 56, 57, 41, 56, 57, 56, 57, 43,
56, 57, 44, 56, 57, 41, 56, 57, 42, 56,
57, 41, 56, 57, 41, 56, 57, 41, 56, 57,
4, 56, 57, 4, 56, 57, 41, 56, 57, 41,
56, 57, 41, 56, 57, 41, 56, 57, 50, 56,
57, 47, 56, 57, 47, 56, 57, 47, 56, 57,
47, 56, 57, 47, 56, 57, 47, 56, 57, 47,
56, 57, 47, 56, 57, 47, 56, 57, 47, 56,
57, 1, 56, 57, 56, 57, 16, 56, 57, 53,
56, 57, 41, 56, 57, 56, 57, 43, 56, 57,
44, 56, 57, 41, 56, 57, 42, 56, 57, 41,
56, 57, 41, 56, 57, 41, 56, 57, 4, 56,
57, 4, 56, 57, 41, 56, 57, 41, 56, 57,
41, 56, 57, 41, 56, 57, 50, 56, 57, 41,
56, 57, 47, 56, 57, 47, 56, 57, 47, 56,
57, 47, 56, 57, 47, 56, 57, 47, 56, 57,
47, 56, 57, 47, 56, 57, 47, 56, 57, 47,
56, 57, 56, 57, 40, 56, 57, 51, 55, 54,
55, 55, 35, 2, 34, 46, 46, 37, 4, 36,
38, 33, 39, 47, 47, 47, 47, 47, 19, 47,
23, 47, 47, 47, 47, 47, 28, 47, 47, 47,
47, 16, 51, 55, 54, 55, 55, 16, 35, 2,
34, 46, 46, 37, 4, 36, 38, 33, 39, 16,
47, 47, 47, 47, 47, 19, 47, 23, 47, 47,
47, 47, 47, 28, 47, 47, 47, 47,16398, 52,
55, 12, 12, 32, 2, 46, 46, 9, 3, 7,
47, 47, 49, 20, 47, 21, 47, 47, 24, 47,
25, 47, 26, 47, 47, 29, 47, 47, 31, 47,
52, 55, 16, 32, 2, 2, 16, 2, 46, 46,
9, 3, 7, 47, 16, 47, 49, 20, 47, 21,
47, 47, 24, 47, 25, 47, 26, 47, 47, 29,
47, 47, 31, 47, 8206, 46, 45, 46, 6, 9,
3, 47, 22, 47, 27, 47, 30, 47, 2, 16,
46, 45, 46, 6, 9, 3, 47, 22, 47, 27,
47, 30, 47, 48, 47, 48, 2, 2, 18, 47,
5, 11, 8, 18, 2, 2, 5, 11, 8, 17,
5, 8, 17, 2, 18, 2, 5, 8, 13, 2,
17, 10, 10, 10, 10
} ;
static yyconst short int yy_accept[364] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 2, 4, 7,
9, 12, 15, 18, 20, 23, 26, 29, 32, 35,
38, 41, 44, 47, 50, 53, 56, 59, 62, 65,
68, 71, 74, 77, 80, 83, 86, 89, 92, 95,
97, 100, 103, 106, 108, 111, 114, 117, 120, 123,
126, 129, 132, 135, 138, 141, 144, 147, 150, 153,
156, 159, 162, 165, 168, 171, 174, 177, 180, 183,
185, 188, 188, 188, 188, 188, 188, 188, 188, 188,
188, 188, 188, 190, 192, 193, 193, 193, 193, 193,
193, 193, 193, 194, 195, 195, 196, 196, 197, 198,
199, 199, 199, 200, 200, 200, 201, 202, 202, 203,
204, 204, 204, 205, 205, 206, 206, 207, 208, 209,
211, 213, 214, 215, 216, 217, 219, 220, 221, 222,
222, 223, 223, 225, 227, 228, 228, 228, 229, 229,
229, 230, 231, 231, 232, 232, 233, 234, 235, 235,
235, 236, 236, 236, 237, 238, 238, 239, 240, 241,
241, 242, 242, 243, 243, 244, 245, 246, 248, 250,
251, 252, 253, 254, 256, 257, 258, 259, 259, 260,
260, 260, 260, 260, 260, 260, 262, 262, 263, 264,
264, 265, 266, 266, 267, 268, 268, 269, 269, 270,
271, 271, 272, 272, 272, 272, 273, 274, 276, 278,
279, 281, 283, 285, 286, 288, 289, 291, 293, 293,
294, 295, 296, 298, 299, 299, 300, 301, 301, 302,
302, 303, 304, 304, 305, 305, 305, 305, 306, 306,
307, 308, 310, 312, 313, 315, 317, 319, 320, 322,
323, 325, 325, 326, 326, 326, 326, 326, 327, 329,
330, 330, 330, 331, 331, 332, 332, 332, 332, 332,
332, 332, 332, 332, 332, 332, 332, 332, 333, 335,
337, 339, 339, 339, 339, 339, 341, 341, 342, 344,
345, 345, 345, 346, 346, 347, 347, 347, 347, 348,
350, 352, 354, 355, 355, 355, 355, 355, 356, 356,
356, 356, 356, 356, 356, 356, 357, 357, 357, 358,
359, 359, 359, 359, 360, 360, 360, 361, 361, 361,
362, 363, 363, 364, 365, 365, 366, 367, 367, 368,
369, 369, 370, 371, 371, 372, 372, 373, 374, 376,
377, 378, 378, 379, 380, 380, 382, 382, 383, 384,
385, 386, 386
} ;
static yyconst int yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 5, 6, 7, 8, 5, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 20,
20, 20, 20, 20, 20, 20, 20, 21, 22, 23,
24, 25, 5, 26, 30, 31, 32, 33, 34, 35,
36, 37, 38, 36, 36, 39, 40, 41, 42, 36,
36, 43, 44, 45, 46, 36, 47, 48, 36, 36,
27, 5, 28, 5, 29, 5, 30, 31, 32, 33,
34, 35, 36, 37, 38, 36, 36, 39, 40, 41,
42, 36, 36, 43, 44, 45, 46, 36, 47, 48,
36, 36, 26, 22, 26, 5, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static yyconst int yy_meta[49] =
{ 0,
1, 2, 3, 4, 5, 6, 7, 8, 5, 9,
5, 5, 5, 5, 5, 5, 10, 5, 11, 11,
9, 5, 12, 13, 14, 5, 5, 5, 15, 16,
16, 16, 16, 16, 16, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17
} ;
static yyconst short int yy_base[385] =
{ 0,
0, 0, 48, 0, 91, 92, 1405, 1771, 1771, 1771,
94, 96, 1771, 142, 1771, 1771, 1391, 1771, 1387, 189,
1378, 188, 194, 1377, 1376, 1374, 1361, 1771, 222, 242,
82, 91, 89, 196, 68, 163, 179, 97, 100, 194,
0, 280, 223, 328, 227, 228, 234, 229, 235, 375,
242, 418, 1335, 243, 463, 247, 251, 252, 254, 510,
168, 1343, 161, 1333, 234, 1331, 1336, 1323, 1316, 0,
558, 1340, 127, 258, 420, 422, 398, 1299, 1285, 1258,
1266, 1257, 411, 413, 0, 605, 1288, 1287, 1286, 1285,
119, 644, 1771, 0, 691, 1771, 0, 0, 1255, 1771,
0, 421, 690, 429, 0, 1771, 1771, 1244, 1771, 1771,
608, 696, 1771, 699, 419, 1247, 420, 422, 582, 583,
586, 587, 624, 625, 591, 590, 627, 628, 684, 430,
1771, 705, 653, 1256, 710, 1252, 731, 0, 1254, 750,
710, 798, 1222, 717, 802, 832, 1199, 720, 875, 730,
1189, 732, 892, 733, 795, 924, 796, 797, 1230, 971,
800, 997, 0, 876, 1183, 1191, 1176, 0, 0, 1174,
1151, 1150, 1097, 0, 1095, 1100, 1089, 1096, 805, 1043,
1047, 1043, 1023, 1016, 1010, 439, 808, 883, 1771, 1027,
1041, 0, 971, 0, 952, 736, 864, 614, 799, 0,
965, 976, 1046, 1061, 0, 1061, 1771, 714, 717, 858,
774, 789, 859, 1042, 860, 953, 954, 1047, 1086, 1108,
0, 1092, 0, 1094, 1140, 0, 950, 1182, 1091, 1110,
1199, 1210, 0, 1244, 981, 0, 0, 0, 1243, 1273,
890, 0, 0, 949, 0, 0, 0, 943, 0, 935,
0, 1120, 1771, 1188, 900, 1303, 895, 1771, 0, 882,
0, 1098, 1174, 440, 1177, 909, 421, 1048, 1093, 1102,
1169, 846, 818, 814, 822, 779, 792, 1249, 1190, 1191,
1192, 1322, 1228, 750, 1331, 1361, 0, 1106, 0, 1229,
1378, 0, 1325, 1326, 1349, 726, 725, 1410, 0, 0,
0, 0, 1771, 722, 839, 713, 644, 1369, 668, 671,
663, 615, 617, 576, 591, 1198, 540, 459, 456, 1440,
1462, 1483, 1458, 1771, 414, 0, 1517, 249, 794, 1238,
237, 258, 1310, 0, 203, 190, 209, 1460, 1477, 1350,
0, 1480, 1771, 131, 1328, 726, 1472, 0, 0, 86,
1516, 1523, 1522, 1385, 835, 0, 1505, 1511, 1527, 1533,
1549, 1771, 1571, 1587, 1592, 1608, 1622, 1639, 1642, 1649,
89, 187, 1656, 1672, 1689, 1701, 1707, 1718, 1720, 1736,
902, 903, 1743, 1754
} ;
static yyconst short int yy_def[385] =
{ 0,
362, 1, 362, 3, 1, 1, 362, 362, 362, 362,
362, 363, 362, 362, 362, 362, 362, 362, 362, 364,
362, 362, 362, 362, 365, 362, 362, 362, 366, 366,
30, 30, 30, 30, 30, 30, 30, 30, 367, 367,
11, 362, 367, 362, 367, 367, 367, 367, 367, 362,
367, 367, 52, 367, 362, 367, 367, 367, 367, 362,
60, 60, 60, 60, 60, 60, 60, 60, 60, 11,
362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 363, 363, 363, 71, 71, 71, 86, 362,
86, 86, 362, 368, 364, 362, 369, 370, 370, 362,
371, 362, 362, 362, 372, 362, 362, 373, 362, 362,
362, 362, 362, 374, 30, 362, 30, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 30, 30, 367,
362, 367, 42, 42, 42, 44, 44, 86, 137, 137,
367, 375, 50, 367, 55, 145, 146, 367, 367, 367,
52, 367, 149, 367, 367, 362, 367, 367, 376, 367,
367, 362, 60, 367, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 92, 362, 362,
362, 362, 362, 362, 362, 363, 362, 362, 362, 86,
92, 368, 377, 370, 370, 378, 362, 362, 362, 372,
373, 362, 374, 362, 379, 380, 362, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 42, 367, 86,
140, 375, 368, 375, 362, 146, 146, 149, 367, 367,
367, 149, 156, 367, 362, 381, 162, 204, 145, 60,
367, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 362, 362, 362, 362, 86, 377, 362, 370, 362,
382, 378, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362, 362, 362, 383, 380, 30, 30,
30, 367, 367, 86, 86, 368, 225, 367, 146, 367,
149, 228, 367, 367, 367, 362, 362, 362, 240, 60,
60, 60, 362, 86, 362, 384, 362, 362, 362, 362,
362, 362, 362, 362, 383, 367, 86, 86, 368, 368,
367, 149, 367, 362, 362, 298, 367, 86, 362, 362,
362, 384, 362, 86, 86, 368, 368, 367, 367, 367,
322, 367, 362, 86, 362, 362, 362, 86, 368, 368,
367, 367, 367, 362, 362, 368, 367, 362, 367, 362,
367, 0, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362
} ;
static yyconst short int yy_nxt[1820] =
{ 0,
8, 9, 10, 9, 8, 11, 8, 12, 13, 14,
15, 16, 17, 13, 18, 19, 20, 21, 22, 23,
24, 13, 25, 26, 27, 28, 13, 13, 29, 30,
29, 29, 29, 31, 29, 29, 29, 32, 29, 33,
34, 35, 36, 29, 37, 29, 29, 38, 8, 9,
10, 39, 40, 41, 40, 42, 43, 44, 45, 46,
47, 43, 48, 49, 50, 51, 52, 53, 54, 43,
55, 56, 57, 58, 59, 43, 60, 61, 60, 60,
60, 62, 60, 60, 60, 63, 60, 64, 65, 66,
67, 60, 68, 60, 60, 69, 70, 70, 115, 196,
71, 71, 72, 83, 196, 131, 73, 72, 115, 72,
126, 74, 115, 356, 84, 84, 75, 72, 76, 115,
119, 115, 115, 77, 190, 120, 132, 115, 188, 115,
122, 121, 179, 78, 79, 80, 81, 115, 129, 72,
354, 82, 86, 87, 87, 88, 89, 89, 89, 89,
89, 90, 89, 89, 89, 89, 89, 89, 89, 89,
89, 89, 89, 89, 89, 89, 89, 89, 91, 89,
89, 92, 92, 92, 92, 92, 92, 92, 92, 92,
92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
95, 95, 95, 115, 101, 168, 127, 200, 165, 131,
101, 169, 200, 115, 102, 96, 103, 103, 166, 115,
102, 97, 103, 103, 350, 128, 103, 349, 99, 115,
132, 104, 103, 111, 111, 112, 115, 104, 131, 123,
348, 113, 131, 131, 131, 105, 115, 124, 114, 131,
131, 125, 116, 111, 111, 112, 141, 131, 131, 132,
142, 113, 131, 132, 132, 132, 131, 131, 114, 159,
132, 132, 116, 179, 331, 148, 154, 171, 132, 132,
346, 157, 117, 132, 158, 172, 344, 132, 132, 173,
132, 72, 118, 130, 130, 131, 130, 133, 130, 130,
130, 130, 130, 130, 130, 130, 130, 130, 134, 134,
130, 130, 130, 130, 130, 130, 132, 130, 135, 135,
135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
135, 135, 135, 135, 135, 135, 135, 135, 86, 87,
87, 136, 137, 138, 137, 137, 137, 130, 137, 137,
137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
137, 137, 137, 137, 139, 137, 137, 140, 140, 140,
140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
140, 140, 140, 140, 140, 140, 95, 95, 143, 130,
131, 130, 130, 130, 130, 130, 130, 130, 130, 130,
130, 144, 130, 130, 130, 130, 130, 145, 130, 130,
130, 132, 130, 146, 147, 146, 146, 146, 146, 146,
146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
146, 146, 146, 131, 149, 179, 308, 179, 180, 186,
186, 84, 84, 266, 150, 131, 151, 151, 181, 197,
197, 343, 198, 72, 132, 72, 151, 199, 199, 115,
115, 152, 115, 307, 209, 307, 132, 186, 186, 115,
115, 336, 115, 208, 335, 153, 130, 130, 131, 130,
130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
130, 130, 130, 130, 130, 130, 155, 130, 130, 132,
130, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 111, 111, 160, 130, 131, 130, 130, 130, 161,
130, 130, 130, 130, 130, 130, 162, 130, 163, 163,
164, 130, 130, 130, 130, 130, 132, 130, 163, 163,
163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
163, 163, 163, 163, 163, 163, 163, 163, 86, 87,
87, 87, 86, 86, 86, 86, 86, 334, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86, 178, 178, 178,
178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
178, 178, 178, 178, 178, 178, 86, 86, 86, 111,
111, 111, 115, 115, 187, 308, 115, 115, 266, 211,
115, 115, 115, 115, 114, 210, 115, 115, 116, 214,
115, 115, 199, 199, 86, 86, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86, 86, 188, 115, 115, 266, 115, 115, 266,
135, 216, 333, 333, 115, 115, 215, 115, 115, 213,
212, 218, 218, 191, 191, 191, 191, 191, 191, 191,
191, 191, 191, 191, 191, 191, 191, 191, 191, 191,
191, 191, 95, 95, 95, 266, 101, 111, 111, 112,
203, 203, 203, 266, 204, 113, 102, 362, 103, 103,
159, 266, 114, 97, 115, 131, 116, 135, 103, 331,
99, 205, 131, 104, 115, 131, 217, 328, 135, 135,
325, 132, 86, 86, 137, 131, 132, 131, 131, 355,
219, 355, 260, 132, 115, 230, 132, 115, 229, 229,
231, 231, 261, 324, 115, 317, 132, 115, 132, 132,
137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
137, 137, 137, 137, 137, 137, 137, 137, 137, 221,
221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
221, 221, 221, 221, 221, 221, 221, 221, 192, 192,
131, 131, 131, 223, 115, 131, 252, 252, 252, 254,
254, 254, 330, 330, 115, 253, 308, 265, 265, 115,
314, 132, 132, 132, 224, 130, 132, 265, 255, 115,
225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
226, 226, 329, 358, 358, 313, 266, 330, 330, 312,
226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
131, 131, 263, 263, 254, 254, 254, 311, 115, 115,
115, 279, 263, 228, 228, 131, 241, 264, 115, 115,
115, 132, 132, 255, 228, 228, 228, 228, 228, 228,
232, 232, 297, 306, 308, 305, 132, 297, 306, 258,
303, 232, 232, 232, 232, 232, 232, 130, 130, 131,
130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
130, 130, 233, 233, 130, 130, 130, 130, 234, 130,
132, 130, 233, 233, 233, 233, 233, 233, 233, 233,
233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
233, 233, 111, 111, 160, 302, 131, 111, 111, 112,
161, 301, 300, 115, 115, 113, 296, 162, 289, 202,
259, 164, 114, 281, 115, 258, 116, 132, 203, 203,
237, 130, 238, 130, 130, 130, 130, 130, 130, 130,
130, 130, 130, 130, 130, 130, 130, 130, 130, 239,
130, 130, 130, 132, 130, 240, 240, 240, 240, 240,
240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
240, 240, 240, 240, 240, 256, 256, 203, 203, 203,
187, 204, 72, 308, 135, 72, 256, 256, 256, 256,
256, 256, 111, 111, 112, 218, 218, 72, 205, 266,
113, 266, 115, 267, 266, 72, 266, 114, 268, 72,
280, 116, 115, 269, 266, 270, 72, 254, 254, 282,
271, 131, 192, 192, 192, 192, 131, 223, 308, 286,
272, 273, 274, 275, 260, 187, 283, 308, 276, 293,
293, 131, 132, 284, 261, 131, 266, 132, 224, 293,
224, 252, 252, 252, 294, 266, 285, 285, 231, 231,
253, 251, 132, 250, 249, 248, 132, 285, 285, 285,
285, 285, 285, 130, 130, 131, 130, 130, 130, 130,
130, 130, 130, 130, 130, 130, 130, 130, 287, 287,
130, 130, 130, 130, 288, 130, 132, 130, 287, 287,
287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
287, 287, 287, 287, 287, 287, 287, 287, 290, 254,
254, 254, 263, 263, 247, 265, 265, 246, 291, 309,
292, 292, 263, 131, 131, 265, 245, 264, 255, 310,
292, 292, 292, 292, 292, 292, 292, 295, 295, 244,
115, 115, 115, 243, 132, 132, 242, 295, 232, 232,
115, 115, 115, 131, 131, 235, 130, 227, 130, 232,
232, 232, 232, 232, 232, 111, 111, 160, 316, 131,
111, 111, 112, 161, 132, 132, 345, 345, 113, 220,
162, 219, 321, 135, 164, 114, 345, 207, 202, 116,
132, 298, 298, 298, 298, 298, 298, 298, 298, 298,
298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
298, 299, 299, 195, 189, 188, 188, 187, 185, 184,
72, 299, 299, 299, 299, 299, 299, 299, 299, 299,
299, 299, 299, 299, 299, 299, 299, 299, 299, 299,
299, 304, 304, 254, 254, 282, 183, 131, 347, 347,
131, 131, 304, 304, 304, 304, 304, 304, 347, 323,
182, 323, 283, 293, 293, 179, 345, 345, 132, 318,
318, 132, 132, 293, 131, 131, 345, 177, 294, 176,
318, 318, 318, 318, 318, 318, 319, 295, 295, 175,
111, 111, 112, 174, 170, 132, 132, 295, 113, 320,
320, 167, 130, 352, 110, 114, 254, 254, 254, 116,
320, 320, 320, 320, 320, 320, 322, 322, 109, 107,
106, 100, 94, 93, 362, 255, 362, 322, 322, 322,
322, 322, 322, 130, 130, 131, 130, 130, 130, 130,
130, 130, 130, 130, 130, 130, 130, 130, 326, 326,
130, 130, 130, 130, 327, 130, 132, 130, 326, 326,
326, 326, 326, 326, 326, 326, 326, 326, 326, 326,
326, 326, 326, 326, 326, 326, 326, 326, 337, 337,
362, 362, 362, 131, 362, 131, 362, 131, 362, 337,
337, 337, 337, 337, 337, 338, 342, 342, 339, 339,
339, 339, 131, 362, 132, 131, 132, 362, 132, 340,
347, 347, 362, 362, 362, 351, 351, 362, 353, 353,
347, 341, 341, 132, 362, 351, 132, 362, 353, 362,
131, 341, 341, 341, 341, 341, 341, 341, 111, 111,
160, 131, 131, 359, 359, 362, 161, 131, 131, 360,
360, 132, 131, 162, 351, 351, 357, 164, 357, 360,
353, 353, 132, 132, 351, 361, 361, 362, 132, 132,
353, 360, 360, 132, 131, 361, 362, 362, 362, 362,
362, 360, 362, 362, 362, 362, 362, 361, 361, 362,
362, 362, 362, 362, 362, 132, 362, 361, 85, 362,
362, 85, 362, 362, 362, 85, 85, 85, 98, 98,
98, 362, 362, 362, 362, 362, 98, 362, 98, 362,
362, 98, 98, 98, 108, 362, 108, 108, 108, 115,
115, 115, 362, 362, 362, 362, 115, 115, 115, 362,
362, 362, 115, 115, 115, 130, 130, 130, 130, 130,
130, 130, 130, 130, 130, 130, 130, 130, 130, 192,
192, 362, 192, 192, 192, 192, 192, 192, 192, 192,
192, 192, 192, 192, 192, 192, 193, 193, 193, 194,
362, 362, 362, 194, 194, 194, 201, 362, 362, 201,
201, 201, 201, 206, 206, 206, 362, 206, 362, 362,
362, 362, 362, 206, 362, 362, 206, 206, 206, 222,
222, 362, 222, 222, 222, 222, 222, 222, 222, 222,
222, 222, 222, 222, 222, 222, 236, 362, 362, 362,
362, 236, 362, 362, 362, 362, 236, 257, 362, 362,
257, 257, 257, 257, 262, 362, 362, 262, 262, 362,
362, 362, 262, 262, 277, 277, 277, 278, 278, 278,
362, 362, 362, 362, 278, 278, 278, 362, 362, 362,
278, 278, 278, 315, 362, 362, 315, 315, 315, 315,
332, 362, 362, 362, 332, 362, 362, 362, 332, 332,
7, 362, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362, 362, 362, 362, 362, 362
} ;
static yyconst short int yy_chk[1820] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 5, 6, 35, 371,
5, 6, 11, 12, 371, 39, 11, 11, 35, 11,
35, 11, 31, 350, 12, 12, 11, 11, 11, 33,
31, 32, 31, 11, 91, 32, 39, 38, 91, 33,
33, 32, 73, 11, 11, 11, 11, 38, 38, 73,
344, 11, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20, 20, 20, 36, 22, 63, 36, 372, 61, 40,
23, 63, 372, 36, 22, 20, 22, 22, 61, 37,
23, 20, 23, 23, 337, 37, 22, 336, 20, 37,
40, 22, 23, 29, 29, 29, 34, 23, 43, 34,
335, 29, 45, 46, 48, 22, 34, 34, 29, 47,
49, 34, 29, 30, 30, 30, 47, 51, 54, 43,
49, 30, 56, 45, 46, 48, 57, 58, 30, 59,
47, 49, 30, 74, 332, 51, 54, 65, 51, 54,
331, 56, 30, 56, 57, 65, 328, 57, 58, 65,
59, 74, 30, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
50, 50, 50, 52, 52, 75, 267, 76, 77, 83,
83, 84, 84, 267, 52, 130, 52, 52, 77, 102,
102, 325, 104, 75, 52, 76, 52, 104, 104, 115,
117, 52, 118, 264, 118, 264, 130, 186, 186, 115,
117, 319, 118, 117, 318, 52, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 71, 71,
71, 71, 71, 71, 71, 71, 71, 317, 71, 71,
71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
71, 71, 71, 71, 71, 71, 86, 86, 86, 111,
111, 111, 119, 120, 86, 315, 121, 122, 314, 122,
126, 125, 119, 120, 111, 119, 121, 122, 111, 125,
126, 125, 198, 198, 86, 86, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86, 86, 92, 123, 124, 313, 127, 128, 312,
133, 128, 307, 307, 123, 124, 127, 127, 128, 124,
123, 133, 133, 92, 92, 92, 92, 92, 92, 92,
92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
92, 92, 95, 95, 95, 311, 103, 112, 112, 112,
114, 114, 114, 310, 114, 112, 103, 95, 103, 103,
132, 309, 112, 95, 129, 141, 112, 135, 103, 306,
95, 114, 144, 103, 129, 148, 129, 304, 135, 135,
297, 132, 137, 137, 137, 150, 141, 152, 154, 346,
137, 346, 196, 144, 208, 152, 148, 209, 150, 150,
152, 152, 196, 296, 208, 284, 150, 209, 152, 154,
137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
137, 137, 137, 137, 137, 137, 137, 137, 137, 140,
140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
140, 140, 140, 140, 140, 140, 140, 140, 142, 142,
155, 157, 158, 142, 211, 161, 179, 179, 179, 187,
187, 187, 329, 329, 211, 179, 277, 199, 199, 212,
276, 155, 157, 158, 142, 145, 161, 199, 187, 212,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
146, 146, 305, 355, 355, 275, 274, 305, 305, 273,
146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
149, 164, 197, 197, 188, 188, 188, 272, 210, 213,
215, 210, 197, 149, 149, 241, 164, 197, 210, 213,
215, 149, 164, 188, 149, 149, 149, 149, 149, 149,
153, 153, 381, 382, 266, 260, 241, 381, 382, 257,
255, 153, 153, 153, 153, 153, 153, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 160, 160, 160, 250, 160, 202, 202, 202,
160, 248, 244, 216, 217, 202, 235, 160, 227, 201,
195, 160, 202, 216, 217, 193, 202, 160, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 190, 190, 203, 203, 203,
191, 203, 185, 268, 218, 184, 190, 190, 190, 190,
190, 190, 206, 206, 206, 218, 218, 183, 203, 204,
206, 268, 214, 204, 204, 182, 204, 206, 204, 181,
214, 206, 214, 204, 204, 204, 180, 219, 219, 219,
204, 219, 222, 222, 224, 224, 229, 222, 269, 224,
204, 204, 204, 204, 262, 178, 219, 270, 204, 229,
229, 288, 219, 220, 262, 230, 269, 229, 222, 229,
224, 252, 252, 252, 229, 270, 220, 220, 230, 230,
252, 177, 288, 176, 175, 173, 230, 220, 220, 220,
220, 220, 220, 225, 225, 225, 225, 225, 225, 225,
225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
225, 225, 225, 225, 225, 225, 225, 225, 228, 254,
254, 254, 263, 263, 172, 265, 265, 171, 228, 271,
228, 228, 263, 316, 231, 265, 170, 263, 254, 271,
228, 228, 228, 228, 228, 228, 228, 231, 231, 167,
279, 280, 281, 166, 316, 231, 165, 231, 232, 232,
279, 280, 281, 283, 290, 159, 151, 147, 143, 232,
232, 232, 232, 232, 232, 234, 234, 234, 283, 234,
278, 278, 278, 234, 283, 290, 330, 330, 278, 139,
234, 136, 290, 134, 234, 278, 330, 116, 108, 278,
234, 239, 239, 239, 239, 239, 239, 239, 239, 239,
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
239, 240, 240, 99, 90, 89, 88, 87, 82, 81,
80, 240, 240, 240, 240, 240, 240, 240, 240, 240,
240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
240, 256, 256, 282, 282, 282, 79, 282, 333, 333,
293, 294, 256, 256, 256, 256, 256, 256, 333, 294,
78, 294, 282, 293, 293, 72, 345, 345, 282, 285,
285, 293, 294, 293, 295, 340, 345, 69, 293, 68,
285, 285, 285, 285, 285, 285, 286, 295, 295, 67,
308, 308, 308, 66, 64, 295, 340, 295, 308, 286,
286, 62, 53, 340, 27, 308, 354, 354, 354, 308,
286, 286, 286, 286, 286, 286, 291, 291, 26, 25,
24, 21, 19, 17, 7, 354, 0, 291, 291, 291,
291, 291, 291, 298, 298, 298, 298, 298, 298, 298,
298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
298, 298, 298, 298, 298, 298, 298, 298, 320, 320,
0, 0, 0, 323, 0, 338, 0, 321, 0, 320,
320, 320, 320, 320, 320, 321, 323, 323, 338, 338,
321, 321, 339, 0, 323, 342, 338, 0, 321, 322,
347, 347, 0, 0, 0, 339, 339, 0, 342, 342,
347, 322, 322, 339, 0, 339, 342, 0, 342, 0,
357, 322, 322, 322, 322, 322, 322, 322, 327, 327,
327, 351, 327, 357, 357, 0, 327, 353, 352, 358,
358, 357, 359, 327, 351, 351, 352, 327, 352, 358,
353, 353, 351, 327, 351, 359, 359, 0, 353, 352,
353, 360, 360, 359, 361, 359, 0, 0, 0, 0,
0, 360, 0, 0, 0, 0, 0, 361, 361, 0,
0, 0, 0, 0, 0, 361, 0, 361, 363, 0,
0, 363, 0, 0, 0, 363, 363, 363, 364, 364,
364, 0, 0, 0, 0, 0, 364, 0, 364, 0,
0, 364, 364, 364, 365, 0, 365, 365, 365, 366,
366, 366, 0, 0, 0, 0, 366, 366, 366, 0,
0, 0, 366, 366, 366, 367, 367, 367, 367, 367,
367, 367, 367, 367, 367, 367, 367, 367, 367, 368,
368, 0, 368, 368, 368, 368, 368, 368, 368, 368,
368, 368, 368, 368, 368, 368, 369, 369, 369, 370,
0, 0, 0, 370, 370, 370, 373, 0, 0, 373,
373, 373, 373, 374, 374, 374, 0, 374, 0, 0,
0, 0, 0, 374, 0, 0, 374, 374, 374, 375,
375, 0, 375, 375, 375, 375, 375, 375, 375, 375,
375, 375, 375, 375, 375, 375, 376, 0, 0, 0,
0, 376, 0, 0, 0, 0, 376, 377, 0, 0,
377, 377, 377, 377, 378, 0, 0, 378, 378, 0,
0, 0, 378, 378, 379, 379, 379, 380, 380, 380,
0, 0, 0, 0, 380, 380, 380, 0, 0, 0,
380, 380, 380, 383, 0, 0, 383, 383, 383, 383,
384, 0, 0, 0, 384, 0, 0, 0, 384, 384,
362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
362, 362, 362, 362, 362, 362, 362, 362, 362
} ;
static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
static char *yy_full_match;
static int yy_lp;
static int yy_looking_for_trail_begin = 0;
static int yy_full_lp;
static int *yy_full_state;
#define YY_TRAILING_MASK 0x2000
#define YY_TRAILING_HEAD_MASK 0x4000
#define REJECT \
{ \
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
yy_cp = yy_full_match; /* restore poss. backed-over text */ \
yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
yy_state_ptr = yy_full_state; /* restore orig. state */ \
yy_current_state = *yy_state_ptr; /* restore curr. state */ \
++yy_lp; \
goto find_rule; \
}
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "./ada-lex.l"
#define INITIAL 0
/* FLEX lexer for Ada expressions, for GDB.
Copyright (C) 1994, 1997, 2000
Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/*----------------------------------------------------------------------*/
/* The converted version of this file is to be included in ada-exp.y, */
/* the Ada parser for gdb. The function yylex obtains characters from */
/* the global pointer lexptr. It returns a syntactic category for */
/* each successive token and places a semantic value into yylval */
/* (ada-lval), defined by the parser. */
/* Run flex with (at least) the -i option (case-insensitive), and the -I */
/* option (interactive---no unnecessary lookahead). */
#line 48 "./ada-lex.l"
#define NUMERAL_WIDTH 256
#define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
/* Temporary staging for numeric literals. */
static char numbuf[NUMERAL_WIDTH];
static void canonicalizeNumeral (char* s1, const char*);
static int processInt (const char*, const char*, const char*);
static int processReal (const char*);
static int processId (const char*, int);
static int processAttribute (const char*);
static int find_dot_all (const char*);
#undef YY_DECL
#define YY_DECL static int yylex ( void )
#undef YY_INPUT
#define YY_INPUT(BUF, RESULT, MAX_SIZE) \
if ( *lexptr == '\000' ) \
(RESULT) = YY_NULL; \
else \
{ \
*(BUF) = *lexptr; \
(RESULT) = 1; \
lexptr += 1; \
}
static char *tempbuf = NULL;
static int tempbufsize = 0;
static int tempbuf_len;
static struct block* left_block_context;
static void resize_tempbuf (unsigned int);
static void block_lookup (char*, char*);
static int name_lookup (char*, char*, int*);
static int find_dot_all (const char*);
#define IN_STRING 1
#define BEFORE_QUAL_QUOTE 2
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap YY_PROTO(( void ));
#else
extern int yywrap YY_PROTO(( void ));
#endif
#endif
#ifndef YY_NO_UNPUT
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
#endif
#ifndef yytext_ptr
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif
#endif
#if YY_STACK_USED
static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
#ifndef YY_NO_PUSH_STATE
static void yy_push_state YY_PROTO(( int new_state ));
#endif
#ifndef YY_NO_POP_STATE
static void yy_pop_state YY_PROTO(( void ));
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state YY_PROTO(( void ));
#endif
#else
#define YY_NO_PUSH_STATE 1
#define YY_NO_POP_STATE 1
#define YY_NO_TOP_STATE 1
#endif
#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
#if __STDC__
#ifndef __cplusplus
#include <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines. This will fail
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
* or sizeof(void*) != sizeof(int).
*/
#endif
#endif
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( yy_current_buffer->yy_is_interactive ) \
{ \
int c = '*', n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
&& ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
*/
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
#endif
/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
*/
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif
#define YY_RULE_SETUP \
YY_USER_ACTION
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
#line 91 "./ada-lex.l"
if ( yy_init )
{
yy_init = 0;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
if ( ! yy_start )
yy_start = 1; /* first start state */
if ( ! yyin )
yyin = stdin;
if ( ! yyout )
yyout = stdout;
if ( ! yy_current_buffer )
yy_current_buffer =
yy_create_buffer( yyin, YY_BUF_SIZE );
yy_load_buffer_state();
}
while ( 1 ) /* loops until end-of-file is reached */
{
yy_cp = yy_c_buf_p;
/* Support of yytext. */
*yy_cp = yy_hold_char;
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
yy_current_state = yy_start;
yy_state_ptr = yy_state_buf;
*yy_state_ptr++ = yy_current_state;
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 363 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
*yy_state_ptr++ = yy_current_state;
++yy_cp;
}
while ( yy_base[yy_current_state] != 1771 );
yy_find_action:
yy_current_state = *--yy_state_ptr;
yy_lp = yy_accept[yy_current_state];
find_rule: /* we branch to this label when backing up */
for ( ; ; ) /* until we find what rule we matched */
{
if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
{
yy_act = yy_acclist[yy_lp];
if ( yy_act & YY_TRAILING_HEAD_MASK ||
yy_looking_for_trail_begin )
{
if ( yy_act == yy_looking_for_trail_begin )
{
yy_looking_for_trail_begin = 0;
yy_act &= ~YY_TRAILING_HEAD_MASK;
break;
}
}
else if ( yy_act & YY_TRAILING_MASK )
{
yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
}
else
{
yy_full_match = yy_cp;
yy_full_state = yy_state_ptr;
yy_full_lp = yy_lp;
break;
}
++yy_lp;
goto find_rule;
}
--yy_cp;
yy_current_state = *--yy_state_ptr;
yy_lp = yy_accept[yy_current_state];
}
YY_DO_BEFORE_ACTION;
do_action: /* This label is used only to access EOF actions. */
switch ( yy_act )
{ /* beginning of action switch */
case 1:
YY_RULE_SETUP
#line 93 "./ada-lex.l"
{ }
YY_BREAK
case 2:
YY_RULE_SETUP
#line 95 "./ada-lex.l"
{ yyterminate(); }
YY_BREAK
case 3:
YY_RULE_SETUP
#line 97 "./ada-lex.l"
{
canonicalizeNumeral (numbuf, yytext);
return processInt (NULL, numbuf, strrchr(numbuf, 'e')+1);
}
YY_BREAK
case 4:
YY_RULE_SETUP
#line 102 "./ada-lex.l"
{
canonicalizeNumeral (numbuf, yytext);
return processInt (NULL, numbuf, NULL);
}
YY_BREAK
case 5:
YY_RULE_SETUP
#line 107 "./ada-lex.l"
{
canonicalizeNumeral (numbuf, yytext);
return processInt (numbuf,
strchr (numbuf, '#') + 1,
strrchr(numbuf, '#') + 1);
}
YY_BREAK
case 6:
YY_RULE_SETUP
#line 114 "./ada-lex.l"
{
canonicalizeNumeral (numbuf, yytext);
return processInt (numbuf, strchr (numbuf, '#') + 1, NULL);
}
YY_BREAK
case 7:
YY_RULE_SETUP
#line 119 "./ada-lex.l"
{
canonicalizeNumeral (numbuf, yytext+2);
return processInt ("16#", numbuf, NULL);
}
YY_BREAK
case 8:
YY_RULE_SETUP
#line 125 "./ada-lex.l"
{
canonicalizeNumeral (numbuf, yytext);
return processReal (numbuf);
}
YY_BREAK
case 9:
YY_RULE_SETUP
#line 130 "./ada-lex.l"
{
canonicalizeNumeral (numbuf, yytext);
return processReal (numbuf);
}
YY_BREAK
case 10:
YY_RULE_SETUP
#line 135 "./ada-lex.l"
{
error ("Based real literals not implemented yet.");
}
YY_BREAK
case 11:
YY_RULE_SETUP
#line 139 "./ada-lex.l"
{
error ("Based real literals not implemented yet.");
}
YY_BREAK
case 12:
YY_RULE_SETUP
#line 143 "./ada-lex.l"
{
yylval.typed_val.type = builtin_type_ada_char;
yylval.typed_val.val = yytext[1];
return CHARLIT;
}
YY_BREAK
case 13:
YY_RULE_SETUP
#line 149 "./ada-lex.l"
{
int v;
yylval.typed_val.type = builtin_type_ada_char;
sscanf (yytext+3, "%2x", &v);
yylval.typed_val.val = v;
return CHARLIT;
}
YY_BREAK
case 14:
YY_RULE_SETUP
#line 157 "./ada-lex.l"
{ return processId (yytext, yyleng); }
YY_BREAK
case 15:
YY_RULE_SETUP
#line 159 "./ada-lex.l"
{
tempbuf_len = 0;
BEGIN IN_STRING;
}
YY_BREAK
case 16:
YY_RULE_SETUP
#line 164 "./ada-lex.l"
{
resize_tempbuf (yyleng+tempbuf_len);
strncpy (tempbuf+tempbuf_len, yytext, yyleng-1);
tempbuf_len += yyleng-1;
yylval.sval.ptr = tempbuf;
yylval.sval.length = tempbuf_len;
BEGIN INITIAL;
return STRING;
}
YY_BREAK
case 17:
YY_RULE_SETUP
#line 174 "./ada-lex.l"
{
int n;
resize_tempbuf (yyleng-5+tempbuf_len+1);
strncpy (tempbuf+tempbuf_len, yytext, yyleng-6);
sscanf(yytext+yyleng-4, "%2x", &n);
tempbuf[yyleng-6+tempbuf_len] = (char) n;
tempbuf_len += yyleng-5;
}
YY_BREAK
case 18:
YY_RULE_SETUP
#line 183 "./ada-lex.l"
{
int n;
resize_tempbuf (yyleng-4+tempbuf_len+1);
strncpy (tempbuf+tempbuf_len, yytext, yyleng-6);
tempbuf[yyleng-5+tempbuf_len] = '"';
tempbuf_len += yyleng-4;
}
YY_BREAK
case 19:
YY_RULE_SETUP
#line 191 "./ada-lex.l"
{
while (*lexptr != 'i' && *lexptr != 'I')
lexptr -= 1;
yyrestart(NULL);
return 0;
}
YY_BREAK
/* ADA KEYWORDS */
case 20:
YY_RULE_SETUP
#line 200 "./ada-lex.l"
{ return ABS; }
YY_BREAK
case 21:
YY_RULE_SETUP
#line 201 "./ada-lex.l"
{ return _AND_; }
YY_BREAK
case 22:
YY_RULE_SETUP
#line 202 "./ada-lex.l"
{ return ELSE; }
YY_BREAK
case 23:
YY_RULE_SETUP
#line 203 "./ada-lex.l"
{ return IN; }
YY_BREAK
case 24:
YY_RULE_SETUP
#line 204 "./ada-lex.l"
{ return MOD; }
YY_BREAK
case 25:
YY_RULE_SETUP
#line 205 "./ada-lex.l"
{ return NEW; }
YY_BREAK
case 26:
YY_RULE_SETUP
#line 206 "./ada-lex.l"
{ return NOT; }
YY_BREAK
case 27:
YY_RULE_SETUP
#line 207 "./ada-lex.l"
{ return NULL_PTR; }
YY_BREAK
case 28:
YY_RULE_SETUP
#line 208 "./ada-lex.l"
{ return OR; }
YY_BREAK
case 29:
YY_RULE_SETUP
#line 209 "./ada-lex.l"
{ return REM; }
YY_BREAK
case 30:
YY_RULE_SETUP
#line 210 "./ada-lex.l"
{ return THEN; }
YY_BREAK
case 31:
YY_RULE_SETUP
#line 211 "./ada-lex.l"
{ return XOR; }
YY_BREAK
/* ATTRIBUTES */
case 32:
YY_RULE_SETUP
#line 215 "./ada-lex.l"
{ return processAttribute (yytext+1); }
YY_BREAK
/* PUNCTUATION */
case 33:
YY_RULE_SETUP
#line 219 "./ada-lex.l"
{ return ARROW; }
YY_BREAK
case 34:
YY_RULE_SETUP
#line 220 "./ada-lex.l"
{ return DOTDOT; }
YY_BREAK
case 35:
YY_RULE_SETUP
#line 221 "./ada-lex.l"
{ return STARSTAR; }
YY_BREAK
case 36:
YY_RULE_SETUP
#line 222 "./ada-lex.l"
{ return ASSIGN; }
YY_BREAK
case 37:
YY_RULE_SETUP
#line 223 "./ada-lex.l"
{ return NOTEQUAL; }
YY_BREAK
case 38:
YY_RULE_SETUP
#line 224 "./ada-lex.l"
{ return LEQ; }
YY_BREAK
case 39:
YY_RULE_SETUP
#line 225 "./ada-lex.l"
{ return GEQ; }
YY_BREAK
case 40:
YY_RULE_SETUP
#line 227 "./ada-lex.l"
{ BEGIN INITIAL; return '\''; }
YY_BREAK
case 41:
YY_RULE_SETUP
#line 229 "./ada-lex.l"
{ return yytext[0]; }
YY_BREAK
case 42:
YY_RULE_SETUP
#line 231 "./ada-lex.l"
{ if (paren_depth == 0 && comma_terminates)
{
lexptr -= 1;
yyrestart(NULL);
return 0;
}
else
return ',';
}
YY_BREAK
case 43:
YY_RULE_SETUP
#line 241 "./ada-lex.l"
{ paren_depth += 1; return '('; }
YY_BREAK
case 44:
YY_RULE_SETUP
#line 242 "./ada-lex.l"
{ if (paren_depth == 0)
{
lexptr -= 1;
yyrestart(NULL);
return 0;
}
else
{
paren_depth -= 1;
return ')';
}
}
YY_BREAK
case 45:
YY_RULE_SETUP
#line 255 "./ada-lex.l"
{ return DOT_ALL; }
YY_BREAK
case 46:
YY_RULE_SETUP
#line 257 "./ada-lex.l"
{
processId (yytext+1, yyleng-1);
return DOT_ID;
}
YY_BREAK
case 47:
YY_RULE_SETUP
#line 262 "./ada-lex.l"
{
int all_posn = find_dot_all (yytext);
int token_type, segments, k;
int quote_follows;
if (all_posn == -1 && yytext[yyleng-1] == '\'')
{
quote_follows = 1;
do {
yyless (yyleng-1);
} while (yytext[yyleng-1] == ' ');
}
else
quote_follows = 0;
if (all_posn >= 0)
yyless (all_posn);
processId(yytext, yyleng);
segments = name_lookup (ada_mangle (yylval.ssym.stoken.ptr),
yylval.ssym.stoken.ptr, &token_type);
left_block_context = NULL;
for (k = yyleng; segments > 0 && k > 0; k -= 1)
{
if (yytext[k-1] == '.')
segments -= 1;
quote_follows = 0;
}
if (k <= 0)
error ("confused by name %s", yytext);
yyless (k);
if (quote_follows)
BEGIN BEFORE_QUAL_QUOTE;
return token_type;
}
YY_BREAK
/* GDB EXPRESSION CONSTRUCTS */
case 48:
YY_RULE_SETUP
#line 300 "./ada-lex.l"
{
processId(yytext, yyleng-2);
block_lookup (yylval.ssym.stoken.ptr, yylval.ssym.stoken.ptr);
return BLOCKNAME;
}
YY_BREAK
case 49:
YY_RULE_SETUP
#line 306 "./ada-lex.l"
{
processId(yytext, yyleng-2);
block_lookup (ada_mangle (yylval.ssym.stoken.ptr),
yylval.ssym.stoken.ptr);
return BLOCKNAME;
}
YY_BREAK
case 50:
YY_RULE_SETUP
#line 313 "./ada-lex.l"
{ return yytext[0]; }
YY_BREAK
case 51:
YY_RULE_SETUP
#line 315 "./ada-lex.l"
{ yylval.lval = -1; return LAST; }
YY_BREAK
case 52:
YY_RULE_SETUP
#line 316 "./ada-lex.l"
{ yylval.lval = -atoi(yytext+2); return LAST; }
YY_BREAK
case 53:
YY_RULE_SETUP
#line 317 "./ada-lex.l"
{ yylval.lval = 0; return LAST; }
YY_BREAK
case 54:
YY_RULE_SETUP
#line 318 "./ada-lex.l"
{ yylval.lval = atoi(yytext+1); return LAST; }
YY_BREAK
/* REGISTERS AND GDB CONVENIENCE VARIABLES */
case 55:
YY_RULE_SETUP
#line 323 "./ada-lex.l"
{
int c;
for (c = 0; c < NUM_REGS; c++)
if (REGISTER_NAME (c) &&
strcmp (yytext + 1, REGISTER_NAME (c)) == 0)
{
yylval.lval = c;
return REGNAME;
}
yylval.sval.ptr = yytext;
yylval.sval.length = yyleng;
yylval.ivar =
lookup_internalvar (copy_name (yylval.sval) + 1);
return INTERNAL_VARIABLE;
}
YY_BREAK
/* CATCH-ALL ERROR CASE */
case 56:
YY_RULE_SETUP
#line 341 "./ada-lex.l"
{ error ("Invalid character '%s' in expression.", yytext); }
YY_BREAK
case 57:
YY_RULE_SETUP
#line 342 "./ada-lex.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(IN_STRING):
case YY_STATE_EOF(BEFORE_QUAL_QUOTE):
yyterminate();
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = yy_hold_char;
YY_RESTORE_YY_MORE_OFFSET
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
* yylex(). If so, then we have to assure
* consistency between yy_current_buffer and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
yy_n_chars = yy_current_buffer->yy_n_chars;
yy_current_buffer->yy_input_file = yyin;
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the
* end-of-buffer state). Contrast this with the test
* in input().
*/
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state();
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we don't
* want to build jamming into it because then it
* will run more slowly).
*/
yy_next_state = yy_try_NUL_trans( yy_current_state );
yy_bp = yytext_ptr + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
yy_cp = ++yy_c_buf_p;
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
yy_cp = yy_c_buf_p;
goto yy_find_action;
}
}
else switch ( yy_get_next_buffer() )
{
case EOB_ACT_END_OF_FILE:
{
yy_did_buffer_switch_on_eof = 0;
if ( yywrap() )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
* yytext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
}
else
{
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p =
yytext_ptr + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yytext_ptr + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
yy_c_buf_p =
&yy_current_buffer->yy_ch_buf[yy_n_chars];
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yytext_ptr + YY_MORE_ADJ;
goto yy_find_action;
}
break;
}
default:
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer()
{
register char *dest = yy_current_buffer->yy_ch_buf;
register char *source = yytext_ptr;
register int number_to_move, i;
int ret_val;
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
if ( yy_current_buffer->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
*/
return EOB_ACT_END_OF_FILE;
}
else
{
/* We matched some text prior to the EOB, first
* process it.
*/
return EOB_ACT_LAST_MATCH;
}
}
/* Try to read more data. */
/* First move last chars to start of buffer. */
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
else
{
int num_to_read =
yy_current_buffer->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
#ifdef YY_USES_REJECT
YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = yy_current_buffer;
int yy_c_buf_p_offset =
(int) (yy_c_buf_p - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
else
b->yy_buf_size *= 2;
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
yy_flex_realloc( (void *) b->yy_ch_buf,
b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
num_to_read = yy_current_buffer->yy_buf_size -
number_to_move - 1;
#endif
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
yy_n_chars, num_to_read );
yy_current_buffer->yy_n_chars = yy_n_chars;
}
if ( yy_n_chars == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
yyrestart( yyin );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
yy_current_buffer->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
else
ret_val = EOB_ACT_CONTINUE_SCAN;
yy_n_chars += number_to_move;
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state()
{
register yy_state_type yy_current_state;
register char *yy_cp;
yy_current_state = yy_start;
yy_state_ptr = yy_state_buf;
*yy_state_ptr++ = yy_current_state;
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
{
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 363 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
*yy_state_ptr++ = yy_current_state;
}
return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
yy_state_type yy_current_state;
#endif
{
register int yy_is_jam;
register YY_CHAR yy_c = 1;
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 363 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 362);
if ( ! yy_is_jam )
*yy_state_ptr++ = yy_current_state;
return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
#else
static void yyunput( c, yy_bp )
int c;
register char *yy_bp;
#endif
{
register char *yy_cp = yy_c_buf_p;
/* undo effects of setting up yytext */
*yy_cp = yy_hold_char;
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = yy_n_chars + 2;
register char *dest = &yy_current_buffer->yy_ch_buf[
yy_current_buffer->yy_buf_size + 2];
register char *source =
&yy_current_buffer->yy_ch_buf[number_to_move];
while ( source > yy_current_buffer->yy_ch_buf )
*--dest = *--source;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
yy_current_buffer->yy_n_chars =
yy_n_chars = yy_current_buffer->yy_buf_size;
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--yy_cp = (char) c;
yytext_ptr = yy_bp;
yy_hold_char = *yy_cp;
yy_c_buf_p = yy_cp;
}
#endif /* ifndef YY_NO_UNPUT */
#ifdef __cplusplus
static int yyinput()
#else
static int input()
#endif
{
int c;
*yy_c_buf_p = yy_hold_char;
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
/* This was really a NUL. */
*yy_c_buf_p = '\0';
else
{ /* need more input */
int offset = yy_c_buf_p - yytext_ptr;
++yy_c_buf_p;
switch ( yy_get_next_buffer() )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
* sees that we've accumulated a
* token and flags that we need to
* try matching the token before
* proceeding. But for input(),
* there's no matching to consider.
* So convert the EOB_ACT_LAST_MATCH
* to EOB_ACT_END_OF_FILE.
*/
/* Reset buffer status. */
yyrestart( yyin );
/* fall through */
case EOB_ACT_END_OF_FILE:
{
if ( yywrap() )
return EOF;
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
#else
return input();
#endif
}
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p = yytext_ptr + offset;
break;
}
}
}
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
*yy_c_buf_p = '\0'; /* preserve yytext */
yy_hold_char = *++yy_c_buf_p;
return c;
}
#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif
{
if ( ! yy_current_buffer )
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
yy_init_buffer( yy_current_buffer, input_file );
yy_load_buffer_state();
}
#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
{
if ( yy_current_buffer == new_buffer )
return;
if ( yy_current_buffer )
{
/* Flush out information for old buffer. */
*yy_c_buf_p = yy_hold_char;
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
yy_current_buffer->yy_n_chars = yy_n_chars;
}
yy_current_buffer = new_buffer;
yy_load_buffer_state();
/* We don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
* is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yy_did_buffer_switch_on_eof = 1;
}
#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
#else
void yy_load_buffer_state()
#endif
{
yy_n_chars = yy_current_buffer->yy_n_chars;
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
yyin = yy_current_buffer->yy_input_file;
yy_hold_char = *yy_c_buf_p;
}
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
yy_init_buffer( b, file );
return b;
}
#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
{
if ( ! b )
return;
if ( b == yy_current_buffer )
yy_current_buffer = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
yy_flex_free( (void *) b->yy_ch_buf );
yy_flex_free( (void *) b );
}
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif
{
yy_flush_buffer( b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
#if YY_ALWAYS_INTERACTIVE
b->yy_is_interactive = 1;
#else
#if YY_NEVER_INTERACTIVE
b->yy_is_interactive = 0;
#else
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
#endif
#endif
}
#ifdef YY_USE_PROTOS
void yy_flush_buffer( YY_BUFFER_STATE b )
#else
void yy_flush_buffer( b )
YY_BUFFER_STATE b;
#endif
{
if ( ! b )
return;
b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->yy_buf_pos = &b->yy_ch_buf[0];
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == yy_current_buffer )
yy_load_buffer_state();
}
#ifndef YY_NO_SCAN_BUFFER
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
#else
YY_BUFFER_STATE yy_scan_buffer( base, size )
char *base;
yy_size_t size;
#endif
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
yy_switch_to_buffer( b );
return b;
}
#endif
#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
#else
YY_BUFFER_STATE yy_scan_string( yy_str )
yyconst char *yy_str;
#endif
{
int len;
for ( len = 0; yy_str[len]; ++len )
;
return yy_scan_bytes( yy_str, len );
}
#endif
#ifndef YY_NO_SCAN_BYTES
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
#else
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
yyconst char *bytes;
int len;
#endif
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = len + 2;
buf = (char *) yy_flex_alloc( n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
for ( i = 0; i < len; ++i )
buf[i] = bytes[i];
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
b = yy_scan_buffer( buf, n );
if ( ! b )
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
*/
b->yy_is_our_buffer = 1;
return b;
}
#endif
#ifndef YY_NO_PUSH_STATE
#ifdef YY_USE_PROTOS
static void yy_push_state( int new_state )
#else
static void yy_push_state( new_state )
int new_state;
#endif
{
if ( yy_start_stack_ptr >= yy_start_stack_depth )
{
yy_size_t new_size;
yy_start_stack_depth += YY_START_STACK_INCR;
new_size = yy_start_stack_depth * sizeof( int );
if ( ! yy_start_stack )
yy_start_stack = (int *) yy_flex_alloc( new_size );
else
yy_start_stack = (int *) yy_flex_realloc(
(void *) yy_start_stack, new_size );
if ( ! yy_start_stack )
YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
}
yy_start_stack[yy_start_stack_ptr++] = YY_START;
BEGIN(new_state);
}
#endif
#ifndef YY_NO_POP_STATE
static void yy_pop_state()
{
if ( --yy_start_stack_ptr < 0 )
YY_FATAL_ERROR( "start-condition stack underflow" );
BEGIN(yy_start_stack[yy_start_stack_ptr]);
}
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state()
{
return yy_start_stack[yy_start_stack_ptr - 1];
}
#endif
#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif
#ifdef YY_USE_PROTOS
static void yy_fatal_error( yyconst char msg[] )
#else
static void yy_fatal_error( msg )
char msg[];
#endif
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
yytext[yyleng] = yy_hold_char; \
yy_c_buf_p = yytext + n; \
yy_hold_char = *yy_c_buf_p; \
*yy_c_buf_p = '\0'; \
yyleng = n; \
} \
while ( 0 )
/* Internal utility routines. */
#ifndef yytext_ptr
#ifdef YY_USE_PROTOS
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
#else
static void yy_flex_strncpy( s1, s2, n )
char *s1;
yyconst char *s2;
int n;
#endif
{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
#ifdef YY_USE_PROTOS
static int yy_flex_strlen( yyconst char *s )
#else
static int yy_flex_strlen( s )
yyconst char *s;
#endif
{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
}
#endif
#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( yy_size_t size )
#else
static void *yy_flex_alloc( size )
yy_size_t size;
#endif
{
return (void *) malloc( size );
}
#ifdef YY_USE_PROTOS
static void *yy_flex_realloc( void *ptr, yy_size_t size )
#else
static void *yy_flex_realloc( ptr, size )
void *ptr;
yy_size_t size;
#endif
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
* because both ANSI C and C++ allow castless assignment from
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
}
#ifdef YY_USE_PROTOS
static void yy_flex_free( void *ptr )
#else
static void yy_flex_free( ptr )
void *ptr;
#endif
{
free( ptr );
}
#if YY_MAIN
int main()
{
yylex();
return 0;
}
#endif
#line 342 "./ada-lex.l"
#include <ctype.h>
#include <string.h>
/* Initialize the lexer for processing new expression */
void
lexer_init (FILE* inp)
{
BEGIN INITIAL;
yyrestart (inp);
}
/* Make sure that tempbuf points at an array at least N characters long. */
static void
resize_tempbuf (n)
unsigned int n;
{
if (tempbufsize < n)
{
tempbufsize = (n+63) & ~63;
tempbuf = (char*) xrealloc (tempbuf, tempbufsize);
}
}
/* Copy S2 to S1, removing all underscores, and downcasing all letters. */
static void
canonicalizeNumeral (s1,s2)
char* s1;
const char* s2;
{
for (; *s2 != '\000'; s2 += 1)
{
if (*s2 != '_')
{
*s1 = tolower(*s2);
s1 += 1;
}
}
s1[0] = '\000';
}
#define HIGH_BYTE_POSN ((sizeof (ULONGEST) - 1) * HOST_CHAR_BIT)
/* True (non-zero) iff DIGIT is a valid digit in radix BASE,
where 2 <= BASE <= 16. */
static int
is_digit_in_base (digit, base)
unsigned char digit;
int base;
{
if (!isxdigit (digit))
return 0;
if (base <= 10)
return (isdigit (digit) && digit < base + '0');
else
return (isdigit (digit) || tolower (digit) < base - 10 + 'a');
}
static int
digit_to_int (c)
unsigned char c;
{
if (isdigit (c))
return c - '0';
else
return tolower (c) - 'a' + 10;
}
/* As for strtoul, but for ULONGEST results. */
ULONGEST
strtoulst (num, trailer, base)
const char *num;
const char **trailer;
int base;
{
unsigned int high_part;
ULONGEST result;
int i;
unsigned char lim;
if (base < 2 || base > 16)
{
errno = EINVAL;
return 0;
}
lim = base - 1 + '0';
result = high_part = 0;
for (i = 0; is_digit_in_base (num[i], base); i += 1)
{
result = result*base + digit_to_int (num[i]);
high_part = high_part*base + (unsigned int) (result >> HIGH_BYTE_POSN);
result &= ((ULONGEST) 1 << HIGH_BYTE_POSN) - 1;
if (high_part > 0xff)
{
errno = ERANGE;
result = high_part = 0;
break;
}
}
if (trailer != NULL)
*trailer = &num[i];
return result + ((ULONGEST) high_part << HIGH_BYTE_POSN);
}
/* Interprets the prefix of NUM that consists of digits of the given BASE
as an integer of that BASE, with the string EXP as an exponent.
Puts value in yylval, and returns INT, if the string is valid. Causes
an error if the number is improperly formated. BASE, if NULL, defaults
to "10", and EXP to "1". The EXP does not contain a leading 'e' or 'E'. */
static int
processInt (base0, num0, exp0)
const char* num0;
const char* base0;
const char* exp0;
{
ULONGEST result;
long exp;
int base;
char* trailer;
if (base0 == NULL)
base = 10;
else
{
base = strtol (base0, (char**) NULL, 10);
if (base < 2 || base > 16)
error ("Invalid base: %d.", base);
}
if (exp0 == NULL)
exp = 0;
else
exp = strtol(exp0, (char**) NULL, 10);
errno = 0;
result = strtoulst (num0, &trailer, base);
if (errno == ERANGE)
error ("Integer literal out of range");
if (isxdigit(*trailer))
error ("Invalid digit `%c' in based literal", *trailer);
while (exp > 0)
{
if (result > (ULONG_MAX / base))
error ("Integer literal out of range");
result *= base;
exp -= 1;
}
if ((result >> (TARGET_INT_BIT-1)) == 0)
yylval.typed_val.type = builtin_type_ada_int;
else if ((result >> (TARGET_LONG_BIT-1)) == 0)
yylval.typed_val.type = builtin_type_ada_long;
else if (((result >> (TARGET_LONG_BIT-1)) >> 1) == 0)
{
/* We have a number representable as an unsigned integer quantity.
For consistency with the C treatment, we will treat it as an
anonymous modular (unsigned) quantity. Alas, the types are such
that we need to store .val as a signed quantity. Sorry
for the mess, but C doesn't officially guarantee that a simple
assignment does the trick (no, it doesn't; read the reference manual).
*/
yylval.typed_val.type = builtin_type_unsigned_long;
if (result & LONGEST_SIGN)
yylval.typed_val.val =
(LONGEST) (result & ~LONGEST_SIGN)
- (LONGEST_SIGN>>1) - (LONGEST_SIGN>>1);
else
yylval.typed_val.val = (LONGEST) result;
return INT;
}
else
yylval.typed_val.type = builtin_type_ada_long_long;
yylval.typed_val.val = (LONGEST) result;
return INT;
}
static int
processReal (num0)
const char* num0;
{
if (sizeof (DOUBLEST) <= sizeof (float))
sscanf (num0, "%g", &yylval.typed_val_float.dval);
else if (sizeof (DOUBLEST) <= sizeof (double))
sscanf (num0, "%lg", &yylval.typed_val_float.dval);
else
{
#ifdef PRINTF_HAS_LONG_DOUBLE
sscanf (num0, "%Lg", &yylval.typed_val_float.dval);
#else
/* Scan it into a double, then convert and assign it to the
long double. This at least wins with values representable
in the range of doubles. */
double temp;
sscanf (num0, "%lg", &temp);
yylval.typed_val_float.dval = temp;
#endif
}
yylval.typed_val_float.type = builtin_type_ada_float;
if (sizeof(DOUBLEST) >= TARGET_DOUBLE_BIT / TARGET_CHAR_BIT)
yylval.typed_val_float.type = builtin_type_ada_double;
if (sizeof(DOUBLEST) >= TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT)
yylval.typed_val_float.type = builtin_type_ada_long_double;
return FLOAT;
}
static int
processId (name0, len)
const char *name0;
int len;
{
char* name = xmalloc (len + 11);
int i0, i;
/* add_name_string_cleanup (name); */
/* FIXME: add_name_string_cleanup should be defined in parse.c */
while (len > 0 && isspace (name0[len-1]))
len -= 1;
i = i0 = 0;
while (i0 < len)
{
if (isalnum (name0[i0]))
{
name[i] = tolower (name0[i0]);
i += 1; i0 += 1;
}
else switch (name0[i0])
{
default:
name[i] = name0[i0];
i += 1; i0 += 1;
break;
case ' ': case '\t':
i0 += 1;
break;
case '\'':
i0 += 1;
while (i0 < len && name0[i0] != '\'')
{
name[i] = name0[i0];
i += 1; i0 += 1;
}
i0 += 1;
break;
case '<':
i0 += 1;
while (i0 < len && name0[i0] != '>')
{
name[i] = name0[i0];
i += 1; i0 += 1;
}
i0 += 1;
break;
}
}
name[i] = '\000';
yylval.ssym.sym = NULL;
yylval.ssym.stoken.ptr = name;
yylval.ssym.stoken.length = i;
return NAME;
}
static void
block_lookup (name, err_name)
char* name;
char* err_name;
{
struct symbol** syms;
struct block** blocks;
int nsyms;
struct symtab *symtab;
nsyms = ada_lookup_symbol_list (name, left_block_context,
VAR_NAMESPACE, &syms, &blocks);
if (left_block_context == NULL &&
(nsyms == 0 || SYMBOL_CLASS (syms[0]) != LOC_BLOCK))
symtab = lookup_symtab (name);
else
symtab = NULL;
if (symtab != NULL)
left_block_context = yylval.bval =
BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
else if (nsyms == 0 || SYMBOL_CLASS (syms[0]) != LOC_BLOCK)
{
if (left_block_context == NULL)
error ("No file or function \"%s\".", err_name);
else
error ("No function \"%s\" in specified context.", err_name);
}
else
{
left_block_context = yylval.bval = SYMBOL_BLOCK_VALUE (syms[0]);
if (nsyms > 1)
warning ("Function name \"%s\" ambiguous here", err_name);
}
}
/* Look up NAME0 (assumed to be mangled) as a name in VAR_NAMESPACE,
setting *TOKEN_TYPE to NAME or TYPENAME, depending on what is
found. Try first the entire name, then the name without the last
segment (i.e., after the last .id), etc., and return the number of
segments that had to be removed to get a match. Calls error if no
matches are found, using ERR_NAME in any error message. When
exactly one symbol match is found, it is placed in yylval. */
static int
name_lookup (name0, err_name, token_type)
char* name0;
char* err_name;
int* token_type;
{
struct symbol** syms;
struct block** blocks;
struct type* type;
int len0 = strlen (name0);
char* name = savestring (name0, len0);
int nsyms;
int segments;
/* add_name_string_cleanup (name);*/
/* FIXME: add_name_string_cleanup should be defined in parse.c */
yylval.ssym.stoken.ptr = name;
yylval.ssym.stoken.length = strlen (name);
for (segments = 0; ; segments += 1)
{
struct type* preferred_type;
int i, preferred_index;
if (left_block_context == NULL)
nsyms = ada_lookup_symbol_list (name, expression_context_block,
VAR_NAMESPACE, &syms, &blocks);
else
nsyms = ada_lookup_symbol_list (name, left_block_context,
VAR_NAMESPACE, &syms, &blocks);
/* Check for a type definition. */
/* Look for a symbol that doesn't denote void. This is (I think) a */
/* temporary kludge to get around problems in GNAT output. */
preferred_index = -1; preferred_type = NULL;
for (i = 0; i < nsyms; i += 1)
switch (SYMBOL_CLASS (syms[i]))
{
case LOC_TYPEDEF:
if (ada_prefer_type (SYMBOL_TYPE (syms[i]), preferred_type))
{
preferred_index = i;
preferred_type = SYMBOL_TYPE (syms[i]);
}
break;
case LOC_REGISTER:
case LOC_ARG:
case LOC_REF_ARG:
case LOC_REGPARM:
case LOC_REGPARM_ADDR:
case LOC_LOCAL:
case LOC_LOCAL_ARG:
case LOC_BASEREG:
case LOC_BASEREG_ARG:
goto NotType;
default:
break;
}
if (preferred_type != NULL)
{
/* if (TYPE_CODE (preferred_type) == TYPE_CODE_VOID)
error ("`%s' matches only void type name(s)",
ada_demangle (name));
*/
/* FIXME: ada_demangle should be defined in defs.h, and is located in ada-lang.c */
/* else*/ if (ada_is_object_renaming (syms[preferred_index]))
{
yylval.ssym.sym = syms[preferred_index];
*token_type = OBJECT_RENAMING;
return segments;
}
else if (ada_renaming_type (SYMBOL_TYPE (syms[preferred_index]))
!= NULL)
{
int result;
const char* renaming =
ada_simple_renamed_entity (syms[preferred_index]);
char* new_name = xmalloc (strlen (renaming) + len0
- yylval.ssym.stoken.length + 1);
/* add_name_string_cleanup (new_name);*/
/* FIXME: add_name_string_cleanup should be defined in parse.c */
strcpy (new_name, renaming);
strcat (new_name, name0 + yylval.ssym.stoken.length);
result = name_lookup (new_name, err_name, token_type);
if (result > segments)
error ("Confused by renamed symbol.");
return result;
}
else if (segments == 0)
{
yylval.tval = preferred_type;
*token_type = TYPENAME;
return 0;
}
}
if (segments == 0)
{
type = lookup_primitive_typename (name);
if (type == NULL && STREQ ("system__address", name))
type = builtin_type_ada_system_address;
if (type != NULL)
{
yylval.tval = type;
*token_type = TYPENAME;
return 0;
}
}
NotType:
if (nsyms == 1)
{
*token_type = NAME;
yylval.ssym.sym = syms[0];
yylval.ssym.msym = NULL;
yylval.ssym.block = blocks[0];
return segments;
}
else if (nsyms == 0) {
int i;
yylval.ssym.msym = ada_lookup_minimal_symbol (name);
if (yylval.ssym.msym != NULL)
{
yylval.ssym.sym = NULL;
yylval.ssym.block = NULL;
*token_type = NAME;
return segments;
}
for (i = yylval.ssym.stoken.length - 1; i > 0; i -= 1)
{
if (name[i] == '.')
{
name[i] = '\0';
yylval.ssym.stoken.length = i;
break;
}
else if (name[i] == '_' && name[i-1] == '_')
{
i -= 1;
name[i] = '\0';
yylval.ssym.stoken.length = i;
break;
}
}
if (i <= 0)
{
if (!have_full_symbols () && !have_partial_symbols ()
&& left_block_context == NULL)
error ("No symbol table is loaded. Use the \"file\" command.");
if (left_block_context == NULL)
error ("No definition of \"%s\" in current context.",
err_name);
else
error ("No definition of \"%s\" in specified context.",
err_name);
}
}
else
{
*token_type = NAME;
yylval.ssym.sym = NULL;
yylval.ssym.msym = NULL;
if (left_block_context == NULL)
yylval.ssym.block = expression_context_block;
else
yylval.ssym.block = left_block_context;
return segments;
}
}
}
/* Returns the position within STR of the '.' in a
'.{WHITE}*all' component of a dotted name, or -1 if there is none. */
static int
find_dot_all (str)
const char* str;
{
int i;
for (i = 0; str[i] != '\000'; i += 1)
{
if (str[i] == '.')
{
int i0 = i;
do
i += 1;
while (isspace (str[i]));
if (strcmp (str+i, "all") == 0
&& ! isalnum (str[i+3]) && str[i+3] != '_')
return i0;
}
}
return -1;
}
/* Returns non-zero iff string SUBSEQ matches a subsequence of STR, ignoring
case. */
static int
subseqMatch (subseq, str)
const char* subseq;
const char* str;
{
if (subseq[0] == '\0')
return 1;
else if (str[0] == '\0')
return 0;
else if (tolower (subseq[0]) == tolower (str[0]))
return subseqMatch (subseq+1, str+1) || subseqMatch (subseq, str+1);
else
return subseqMatch (subseq, str+1);
}
static struct { const char* name; int code; }
attributes[] = {
{ "address", TICK_ADDRESS },
{ "unchecked_access", TICK_ACCESS },
{ "unrestricted_access", TICK_ACCESS },
{ "access", TICK_ACCESS },
{ "first", TICK_FIRST },
{ "last", TICK_LAST },
{ "length", TICK_LENGTH },
{ "max", TICK_MAX },
{ "min", TICK_MIN },
{ "modulus", TICK_MODULUS },
{ "pos", TICK_POS },
{ "range", TICK_RANGE },
{ "size", TICK_SIZE },
{ "tag", TICK_TAG },
{ "val", TICK_VAL },
{ NULL, -1 }
};
/* Return the syntactic code corresponding to the attribute name or
abbreviation STR. */
static int
processAttribute (str)
const char* str;
{
int i, k;
for (i = 0; attributes[i].code != -1; i += 1)
if (strcasecmp (str, attributes[i].name) == 0)
return attributes[i].code;
for (i = 0, k = -1; attributes[i].code != -1; i += 1)
if (subseqMatch (str, attributes[i].name))
{
if (k == -1)
k = i;
else
error ("ambiguous attribute name: `%s'", str);
}
if (k == -1)
error ("unrecognized attribute: `%s'", str);
return attributes[k].code;
}
int
yywrap()
{
return 1;
}