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