* config/i386/tm-i386.h (PARM_BOUNDARY, CALL_DUMMY,
[deliverable/binutils-gdb.git] / gdb / ada-lex.c
1 /* A lexical scanner generated by flex */
2
3 /* Scanner skeleton version:
4 * $Header$
5 * $FreeBSD: src/usr.bin/lex/flex.skl,v 1.4 1999/10/27 07:56:44 obrien 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
14
15 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
16 #ifdef c_plusplus
17 #ifndef __cplusplus
18 #define __cplusplus
19 #endif
20 #endif
21
22
23 #ifdef __cplusplus
24
25 #include <stdlib.h>
26 #include <unistd.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 realloc() it to grow it, and should free() 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 *yy_flex_realloc 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
266 #define YY_USES_REJECT
267 typedef unsigned char YY_CHAR;
268 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
269 typedef int yy_state_type;
270 extern char *yytext;
271 #define yytext_ptr yytext
272
273 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
274 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
275 static int yy_get_next_buffer YY_PROTO(( void ));
276 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
277
278 /* Done after the current pattern has been matched and before the
279 * corresponding action - sets up yytext.
280 */
281 #define YY_DO_BEFORE_ACTION \
282 yytext_ptr = yy_bp; \
283 yyleng = (int) (yy_cp - yy_bp); \
284 yy_hold_char = *yy_cp; \
285 *yy_cp = '\0'; \
286 yy_c_buf_p = yy_cp;
287
288 #define YY_NUM_RULES 57
289 #define YY_END_OF_BUFFER 58
290 static yyconst short int yy_acclist[386] =
291 { 0,
292 58, 56, 57, 1, 56, 57, 1, 57, 15, 56,
293 57, 53, 56, 57, 41, 56, 57, 56, 57, 43,
294 56, 57, 44, 56, 57, 41, 56, 57, 42, 56,
295 57, 41, 56, 57, 41, 56, 57, 41, 56, 57,
296 4, 56, 57, 4, 56, 57, 41, 56, 57, 41,
297 56, 57, 41, 56, 57, 41, 56, 57, 50, 56,
298 57, 47, 56, 57, 47, 56, 57, 47, 56, 57,
299 47, 56, 57, 47, 56, 57, 47, 56, 57, 47,
300 56, 57, 47, 56, 57, 47, 56, 57, 47, 56,
301 57, 1, 56, 57, 56, 57, 16, 56, 57, 53,
302
303 56, 57, 41, 56, 57, 56, 57, 43, 56, 57,
304 44, 56, 57, 41, 56, 57, 42, 56, 57, 41,
305 56, 57, 41, 56, 57, 41, 56, 57, 4, 56,
306 57, 4, 56, 57, 41, 56, 57, 41, 56, 57,
307 41, 56, 57, 41, 56, 57, 50, 56, 57, 41,
308 56, 57, 47, 56, 57, 47, 56, 57, 47, 56,
309 57, 47, 56, 57, 47, 56, 57, 47, 56, 57,
310 47, 56, 57, 47, 56, 57, 47, 56, 57, 47,
311 56, 57, 56, 57, 40, 56, 57, 51, 55, 54,
312 55, 55, 35, 2, 34, 46, 46, 37, 4, 36,
313
314 38, 33, 39, 47, 47, 47, 47, 47, 19, 47,
315 23, 47, 47, 47, 47, 47, 28, 47, 47, 47,
316 47, 16, 51, 55, 54, 55, 55, 16, 35, 2,
317 34, 46, 46, 37, 4, 36, 38, 33, 39, 16,
318 47, 47, 47, 47, 47, 19, 47, 23, 47, 47,
319 47, 47, 47, 28, 47, 47, 47, 47,16398, 52,
320 55, 12, 12, 32, 2, 46, 46, 9, 3, 7,
321 47, 47, 49, 20, 47, 21, 47, 47, 24, 47,
322 25, 47, 26, 47, 47, 29, 47, 47, 31, 47,
323 52, 55, 16, 32, 2, 2, 16, 2, 46, 46,
324
325 9, 3, 7, 47, 16, 47, 49, 20, 47, 21,
326 47, 47, 24, 47, 25, 47, 26, 47, 47, 29,
327 47, 47, 31, 47, 8206, 46, 45, 46, 6, 9,
328 3, 47, 22, 47, 27, 47, 30, 47, 2, 16,
329 46, 45, 46, 6, 9, 3, 47, 22, 47, 27,
330 47, 30, 47, 48, 47, 48, 2, 2, 18, 47,
331 5, 11, 8, 18, 2, 2, 5, 11, 8, 17,
332 5, 8, 17, 2, 18, 2, 5, 8, 13, 2,
333 17, 10, 10, 10, 10
334 } ;
335
336 static yyconst short int yy_accept[364] =
337 { 0,
338 1, 1, 1, 1, 1, 1, 1, 2, 4, 7,
339 9, 12, 15, 18, 20, 23, 26, 29, 32, 35,
340 38, 41, 44, 47, 50, 53, 56, 59, 62, 65,
341 68, 71, 74, 77, 80, 83, 86, 89, 92, 95,
342 97, 100, 103, 106, 108, 111, 114, 117, 120, 123,
343 126, 129, 132, 135, 138, 141, 144, 147, 150, 153,
344 156, 159, 162, 165, 168, 171, 174, 177, 180, 183,
345 185, 188, 188, 188, 188, 188, 188, 188, 188, 188,
346 188, 188, 188, 190, 192, 193, 193, 193, 193, 193,
347 193, 193, 193, 194, 195, 195, 196, 196, 197, 198,
348
349 199, 199, 199, 200, 200, 200, 201, 202, 202, 203,
350 204, 204, 204, 205, 205, 206, 206, 207, 208, 209,
351 211, 213, 214, 215, 216, 217, 219, 220, 221, 222,
352 222, 223, 223, 225, 227, 228, 228, 228, 229, 229,
353 229, 230, 231, 231, 232, 232, 233, 234, 235, 235,
354 235, 236, 236, 236, 237, 238, 238, 239, 240, 241,
355 241, 242, 242, 243, 243, 244, 245, 246, 248, 250,
356 251, 252, 253, 254, 256, 257, 258, 259, 259, 260,
357 260, 260, 260, 260, 260, 260, 262, 262, 263, 264,
358 264, 265, 266, 266, 267, 268, 268, 269, 269, 270,
359
360 271, 271, 272, 272, 272, 272, 273, 274, 276, 278,
361 279, 281, 283, 285, 286, 288, 289, 291, 293, 293,
362 294, 295, 296, 298, 299, 299, 300, 301, 301, 302,
363 302, 303, 304, 304, 305, 305, 305, 305, 306, 306,
364 307, 308, 310, 312, 313, 315, 317, 319, 320, 322,
365 323, 325, 325, 326, 326, 326, 326, 326, 327, 329,
366 330, 330, 330, 331, 331, 332, 332, 332, 332, 332,
367 332, 332, 332, 332, 332, 332, 332, 332, 333, 335,
368 337, 339, 339, 339, 339, 339, 341, 341, 342, 344,
369 345, 345, 345, 346, 346, 347, 347, 347, 347, 348,
370
371 350, 352, 354, 355, 355, 355, 355, 355, 356, 356,
372 356, 356, 356, 356, 356, 356, 357, 357, 357, 358,
373 359, 359, 359, 359, 360, 360, 360, 361, 361, 361,
374 362, 363, 363, 364, 365, 365, 366, 367, 367, 368,
375 369, 369, 370, 371, 371, 372, 372, 373, 374, 376,
376 377, 378, 378, 379, 380, 380, 382, 382, 383, 384,
377 385, 386, 386
378 } ;
379
380 static yyconst int yy_ec[256] =
381 { 0,
382 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 4, 5, 6, 7, 8, 5, 9, 10, 11,
386 12, 13, 14, 15, 16, 17, 18, 19, 20, 20,
387 20, 20, 20, 20, 20, 20, 20, 21, 22, 23,
388 24, 25, 5, 26, 30, 31, 32, 33, 34, 35,
389 36, 37, 38, 36, 36, 39, 40, 41, 42, 36,
390 36, 43, 44, 45, 46, 36, 47, 48, 36, 36,
391 27, 5, 28, 5, 29, 5, 30, 31, 32, 33,
392
393 34, 35, 36, 37, 38, 36, 36, 39, 40, 41,
394 42, 36, 36, 43, 44, 45, 46, 36, 47, 48,
395 36, 36, 26, 22, 26, 5, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1
410 } ;
411
412 static yyconst int yy_meta[49] =
413 { 0,
414 1, 2, 3, 4, 5, 6, 7, 8, 5, 9,
415 5, 5, 5, 5, 5, 5, 10, 5, 11, 11,
416 9, 5, 12, 13, 14, 5, 5, 5, 15, 16,
417 16, 16, 16, 16, 16, 17, 17, 17, 17, 17,
418 17, 17, 17, 17, 17, 17, 17, 17
419 } ;
420
421 static yyconst short int yy_base[385] =
422 { 0,
423 0, 0, 48, 0, 91, 92, 1405, 1771, 1771, 1771,
424 94, 96, 1771, 142, 1771, 1771, 1391, 1771, 1387, 189,
425 1378, 188, 194, 1377, 1376, 1374, 1361, 1771, 222, 242,
426 82, 91, 89, 196, 68, 163, 179, 97, 100, 194,
427 0, 280, 223, 328, 227, 228, 234, 229, 235, 375,
428 242, 418, 1335, 243, 463, 247, 251, 252, 254, 510,
429 168, 1343, 161, 1333, 234, 1331, 1336, 1323, 1316, 0,
430 558, 1340, 127, 258, 420, 422, 398, 1299, 1285, 1258,
431 1266, 1257, 411, 413, 0, 605, 1288, 1287, 1286, 1285,
432 119, 644, 1771, 0, 691, 1771, 0, 0, 1255, 1771,
433
434 0, 421, 690, 429, 0, 1771, 1771, 1244, 1771, 1771,
435 608, 696, 1771, 699, 419, 1247, 420, 422, 582, 583,
436 586, 587, 624, 625, 591, 590, 627, 628, 684, 430,
437 1771, 705, 653, 1256, 710, 1252, 731, 0, 1254, 750,
438 710, 798, 1222, 717, 802, 832, 1199, 720, 875, 730,
439 1189, 732, 892, 733, 795, 924, 796, 797, 1230, 971,
440 800, 997, 0, 876, 1183, 1191, 1176, 0, 0, 1174,
441 1151, 1150, 1097, 0, 1095, 1100, 1089, 1096, 805, 1043,
442 1047, 1043, 1023, 1016, 1010, 439, 808, 883, 1771, 1027,
443 1041, 0, 971, 0, 952, 736, 864, 614, 799, 0,
444
445 965, 976, 1046, 1061, 0, 1061, 1771, 714, 717, 858,
446 774, 789, 859, 1042, 860, 953, 954, 1047, 1086, 1108,
447 0, 1092, 0, 1094, 1140, 0, 950, 1182, 1091, 1110,
448 1199, 1210, 0, 1244, 981, 0, 0, 0, 1243, 1273,
449 890, 0, 0, 949, 0, 0, 0, 943, 0, 935,
450 0, 1120, 1771, 1188, 900, 1303, 895, 1771, 0, 882,
451 0, 1098, 1174, 440, 1177, 909, 421, 1048, 1093, 1102,
452 1169, 846, 818, 814, 822, 779, 792, 1249, 1190, 1191,
453 1192, 1322, 1228, 750, 1331, 1361, 0, 1106, 0, 1229,
454 1378, 0, 1325, 1326, 1349, 726, 725, 1410, 0, 0,
455
456 0, 0, 1771, 722, 839, 713, 644, 1369, 668, 671,
457 663, 615, 617, 576, 591, 1198, 540, 459, 456, 1440,
458 1462, 1483, 1458, 1771, 414, 0, 1517, 249, 794, 1238,
459 237, 258, 1310, 0, 203, 190, 209, 1460, 1477, 1350,
460 0, 1480, 1771, 131, 1328, 726, 1472, 0, 0, 86,
461 1516, 1523, 1522, 1385, 835, 0, 1505, 1511, 1527, 1533,
462 1549, 1771, 1571, 1587, 1592, 1608, 1622, 1639, 1642, 1649,
463 89, 187, 1656, 1672, 1689, 1701, 1707, 1718, 1720, 1736,
464 902, 903, 1743, 1754
465 } ;
466
467 static yyconst short int yy_def[385] =
468 { 0,
469 362, 1, 362, 3, 1, 1, 362, 362, 362, 362,
470 362, 363, 362, 362, 362, 362, 362, 362, 362, 364,
471 362, 362, 362, 362, 365, 362, 362, 362, 366, 366,
472 30, 30, 30, 30, 30, 30, 30, 30, 367, 367,
473 11, 362, 367, 362, 367, 367, 367, 367, 367, 362,
474 367, 367, 52, 367, 362, 367, 367, 367, 367, 362,
475 60, 60, 60, 60, 60, 60, 60, 60, 60, 11,
476 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
477 362, 362, 363, 363, 363, 71, 71, 71, 86, 362,
478 86, 86, 362, 368, 364, 362, 369, 370, 370, 362,
479
480 371, 362, 362, 362, 372, 362, 362, 373, 362, 362,
481 362, 362, 362, 374, 30, 362, 30, 30, 30, 30,
482 30, 30, 30, 30, 30, 30, 30, 30, 30, 367,
483 362, 367, 42, 42, 42, 44, 44, 86, 137, 137,
484 367, 375, 50, 367, 55, 145, 146, 367, 367, 367,
485 52, 367, 149, 367, 367, 362, 367, 367, 376, 367,
486 367, 362, 60, 367, 60, 60, 60, 60, 60, 60,
487 60, 60, 60, 60, 60, 60, 60, 92, 362, 362,
488 362, 362, 362, 362, 362, 363, 362, 362, 362, 86,
489 92, 368, 377, 370, 370, 378, 362, 362, 362, 372,
490
491 373, 362, 374, 362, 379, 380, 362, 30, 30, 30,
492 30, 30, 30, 30, 30, 30, 30, 42, 367, 86,
493 140, 375, 368, 375, 362, 146, 146, 149, 367, 367,
494 367, 149, 156, 367, 362, 381, 162, 204, 145, 60,
495 367, 60, 60, 60, 60, 60, 60, 60, 60, 60,
496 60, 362, 362, 362, 362, 86, 377, 362, 370, 362,
497 382, 378, 362, 362, 362, 362, 362, 362, 362, 362,
498 362, 362, 362, 362, 362, 362, 383, 380, 30, 30,
499 30, 367, 367, 86, 86, 368, 225, 367, 146, 367,
500 149, 228, 367, 367, 367, 362, 362, 362, 240, 60,
501
502 60, 60, 362, 86, 362, 384, 362, 362, 362, 362,
503 362, 362, 362, 362, 383, 367, 86, 86, 368, 368,
504 367, 149, 367, 362, 362, 298, 367, 86, 362, 362,
505 362, 384, 362, 86, 86, 368, 368, 367, 367, 367,
506 322, 367, 362, 86, 362, 362, 362, 86, 368, 368,
507 367, 367, 367, 362, 362, 368, 367, 362, 367, 362,
508 367, 0, 362, 362, 362, 362, 362, 362, 362, 362,
509 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
510 362, 362, 362, 362
511 } ;
512
513 static yyconst short int yy_nxt[1820] =
514 { 0,
515 8, 9, 10, 9, 8, 11, 8, 12, 13, 14,
516 15, 16, 17, 13, 18, 19, 20, 21, 22, 23,
517 24, 13, 25, 26, 27, 28, 13, 13, 29, 30,
518 29, 29, 29, 31, 29, 29, 29, 32, 29, 33,
519 34, 35, 36, 29, 37, 29, 29, 38, 8, 9,
520 10, 39, 40, 41, 40, 42, 43, 44, 45, 46,
521 47, 43, 48, 49, 50, 51, 52, 53, 54, 43,
522 55, 56, 57, 58, 59, 43, 60, 61, 60, 60,
523 60, 62, 60, 60, 60, 63, 60, 64, 65, 66,
524 67, 60, 68, 60, 60, 69, 70, 70, 115, 196,
525
526 71, 71, 72, 83, 196, 131, 73, 72, 115, 72,
527 126, 74, 115, 356, 84, 84, 75, 72, 76, 115,
528 119, 115, 115, 77, 190, 120, 132, 115, 188, 115,
529 122, 121, 179, 78, 79, 80, 81, 115, 129, 72,
530 354, 82, 86, 87, 87, 88, 89, 89, 89, 89,
531 89, 90, 89, 89, 89, 89, 89, 89, 89, 89,
532 89, 89, 89, 89, 89, 89, 89, 89, 91, 89,
533 89, 92, 92, 92, 92, 92, 92, 92, 92, 92,
534 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
535 95, 95, 95, 115, 101, 168, 127, 200, 165, 131,
536
537 101, 169, 200, 115, 102, 96, 103, 103, 166, 115,
538 102, 97, 103, 103, 350, 128, 103, 349, 99, 115,
539 132, 104, 103, 111, 111, 112, 115, 104, 131, 123,
540 348, 113, 131, 131, 131, 105, 115, 124, 114, 131,
541 131, 125, 116, 111, 111, 112, 141, 131, 131, 132,
542 142, 113, 131, 132, 132, 132, 131, 131, 114, 159,
543 132, 132, 116, 179, 331, 148, 154, 171, 132, 132,
544 346, 157, 117, 132, 158, 172, 344, 132, 132, 173,
545 132, 72, 118, 130, 130, 131, 130, 133, 130, 130,
546 130, 130, 130, 130, 130, 130, 130, 130, 134, 134,
547
548 130, 130, 130, 130, 130, 130, 132, 130, 135, 135,
549 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
550 135, 135, 135, 135, 135, 135, 135, 135, 86, 87,
551 87, 136, 137, 138, 137, 137, 137, 130, 137, 137,
552 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
553 137, 137, 137, 137, 139, 137, 137, 140, 140, 140,
554 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
555 140, 140, 140, 140, 140, 140, 95, 95, 143, 130,
556 131, 130, 130, 130, 130, 130, 130, 130, 130, 130,
557 130, 144, 130, 130, 130, 130, 130, 145, 130, 130,
558
559 130, 132, 130, 146, 147, 146, 146, 146, 146, 146,
560 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
561 146, 146, 146, 131, 149, 179, 308, 179, 180, 186,
562 186, 84, 84, 266, 150, 131, 151, 151, 181, 197,
563 197, 343, 198, 72, 132, 72, 151, 199, 199, 115,
564 115, 152, 115, 307, 209, 307, 132, 186, 186, 115,
565 115, 336, 115, 208, 335, 153, 130, 130, 131, 130,
566 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
567 130, 130, 130, 130, 130, 130, 155, 130, 130, 132,
568 130, 156, 156, 156, 156, 156, 156, 156, 156, 156,
569
570 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
571 156, 111, 111, 160, 130, 131, 130, 130, 130, 161,
572 130, 130, 130, 130, 130, 130, 162, 130, 163, 163,
573 164, 130, 130, 130, 130, 130, 132, 130, 163, 163,
574 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
575 163, 163, 163, 163, 163, 163, 163, 163, 86, 87,
576 87, 87, 86, 86, 86, 86, 86, 334, 86, 86,
577 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
578 86, 86, 86, 86, 86, 86, 86, 178, 178, 178,
579 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
580
581 178, 178, 178, 178, 178, 178, 86, 86, 86, 111,
582 111, 111, 115, 115, 187, 308, 115, 115, 266, 211,
583 115, 115, 115, 115, 114, 210, 115, 115, 116, 214,
584 115, 115, 199, 199, 86, 86, 86, 86, 86, 86,
585 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
586 86, 86, 86, 188, 115, 115, 266, 115, 115, 266,
587 135, 216, 333, 333, 115, 115, 215, 115, 115, 213,
588 212, 218, 218, 191, 191, 191, 191, 191, 191, 191,
589 191, 191, 191, 191, 191, 191, 191, 191, 191, 191,
590 191, 191, 95, 95, 95, 266, 101, 111, 111, 112,
591
592 203, 203, 203, 266, 204, 113, 102, 362, 103, 103,
593 159, 266, 114, 97, 115, 131, 116, 135, 103, 331,
594 99, 205, 131, 104, 115, 131, 217, 328, 135, 135,
595 325, 132, 86, 86, 137, 131, 132, 131, 131, 355,
596 219, 355, 260, 132, 115, 230, 132, 115, 229, 229,
597 231, 231, 261, 324, 115, 317, 132, 115, 132, 132,
598 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
599 137, 137, 137, 137, 137, 137, 137, 137, 137, 221,
600 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
601 221, 221, 221, 221, 221, 221, 221, 221, 192, 192,
602
603 131, 131, 131, 223, 115, 131, 252, 252, 252, 254,
604 254, 254, 330, 330, 115, 253, 308, 265, 265, 115,
605 314, 132, 132, 132, 224, 130, 132, 265, 255, 115,
606 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
607 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
608 226, 226, 329, 358, 358, 313, 266, 330, 330, 312,
609 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
610 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
611 131, 131, 263, 263, 254, 254, 254, 311, 115, 115,
612 115, 279, 263, 228, 228, 131, 241, 264, 115, 115,
613
614 115, 132, 132, 255, 228, 228, 228, 228, 228, 228,
615 232, 232, 297, 306, 308, 305, 132, 297, 306, 258,
616 303, 232, 232, 232, 232, 232, 232, 130, 130, 131,
617 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
618 130, 130, 233, 233, 130, 130, 130, 130, 234, 130,
619 132, 130, 233, 233, 233, 233, 233, 233, 233, 233,
620 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
621 233, 233, 111, 111, 160, 302, 131, 111, 111, 112,
622 161, 301, 300, 115, 115, 113, 296, 162, 289, 202,
623 259, 164, 114, 281, 115, 258, 116, 132, 203, 203,
624
625 237, 130, 238, 130, 130, 130, 130, 130, 130, 130,
626 130, 130, 130, 130, 130, 130, 130, 130, 130, 239,
627 130, 130, 130, 132, 130, 240, 240, 240, 240, 240,
628 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
629 240, 240, 240, 240, 240, 256, 256, 203, 203, 203,
630 187, 204, 72, 308, 135, 72, 256, 256, 256, 256,
631 256, 256, 111, 111, 112, 218, 218, 72, 205, 266,
632 113, 266, 115, 267, 266, 72, 266, 114, 268, 72,
633 280, 116, 115, 269, 266, 270, 72, 254, 254, 282,
634 271, 131, 192, 192, 192, 192, 131, 223, 308, 286,
635
636 272, 273, 274, 275, 260, 187, 283, 308, 276, 293,
637 293, 131, 132, 284, 261, 131, 266, 132, 224, 293,
638 224, 252, 252, 252, 294, 266, 285, 285, 231, 231,
639 253, 251, 132, 250, 249, 248, 132, 285, 285, 285,
640 285, 285, 285, 130, 130, 131, 130, 130, 130, 130,
641 130, 130, 130, 130, 130, 130, 130, 130, 287, 287,
642 130, 130, 130, 130, 288, 130, 132, 130, 287, 287,
643 287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
644 287, 287, 287, 287, 287, 287, 287, 287, 290, 254,
645 254, 254, 263, 263, 247, 265, 265, 246, 291, 309,
646
647 292, 292, 263, 131, 131, 265, 245, 264, 255, 310,
648 292, 292, 292, 292, 292, 292, 292, 295, 295, 244,
649 115, 115, 115, 243, 132, 132, 242, 295, 232, 232,
650 115, 115, 115, 131, 131, 235, 130, 227, 130, 232,
651 232, 232, 232, 232, 232, 111, 111, 160, 316, 131,
652 111, 111, 112, 161, 132, 132, 345, 345, 113, 220,
653 162, 219, 321, 135, 164, 114, 345, 207, 202, 116,
654 132, 298, 298, 298, 298, 298, 298, 298, 298, 298,
655 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
656 298, 299, 299, 195, 189, 188, 188, 187, 185, 184,
657
658 72, 299, 299, 299, 299, 299, 299, 299, 299, 299,
659 299, 299, 299, 299, 299, 299, 299, 299, 299, 299,
660 299, 304, 304, 254, 254, 282, 183, 131, 347, 347,
661 131, 131, 304, 304, 304, 304, 304, 304, 347, 323,
662 182, 323, 283, 293, 293, 179, 345, 345, 132, 318,
663 318, 132, 132, 293, 131, 131, 345, 177, 294, 176,
664 318, 318, 318, 318, 318, 318, 319, 295, 295, 175,
665 111, 111, 112, 174, 170, 132, 132, 295, 113, 320,
666 320, 167, 130, 352, 110, 114, 254, 254, 254, 116,
667 320, 320, 320, 320, 320, 320, 322, 322, 109, 107,
668
669 106, 100, 94, 93, 362, 255, 362, 322, 322, 322,
670 322, 322, 322, 130, 130, 131, 130, 130, 130, 130,
671 130, 130, 130, 130, 130, 130, 130, 130, 326, 326,
672 130, 130, 130, 130, 327, 130, 132, 130, 326, 326,
673 326, 326, 326, 326, 326, 326, 326, 326, 326, 326,
674 326, 326, 326, 326, 326, 326, 326, 326, 337, 337,
675 362, 362, 362, 131, 362, 131, 362, 131, 362, 337,
676 337, 337, 337, 337, 337, 338, 342, 342, 339, 339,
677 339, 339, 131, 362, 132, 131, 132, 362, 132, 340,
678 347, 347, 362, 362, 362, 351, 351, 362, 353, 353,
679
680 347, 341, 341, 132, 362, 351, 132, 362, 353, 362,
681 131, 341, 341, 341, 341, 341, 341, 341, 111, 111,
682 160, 131, 131, 359, 359, 362, 161, 131, 131, 360,
683 360, 132, 131, 162, 351, 351, 357, 164, 357, 360,
684 353, 353, 132, 132, 351, 361, 361, 362, 132, 132,
685 353, 360, 360, 132, 131, 361, 362, 362, 362, 362,
686 362, 360, 362, 362, 362, 362, 362, 361, 361, 362,
687 362, 362, 362, 362, 362, 132, 362, 361, 85, 362,
688 362, 85, 362, 362, 362, 85, 85, 85, 98, 98,
689 98, 362, 362, 362, 362, 362, 98, 362, 98, 362,
690
691 362, 98, 98, 98, 108, 362, 108, 108, 108, 115,
692 115, 115, 362, 362, 362, 362, 115, 115, 115, 362,
693 362, 362, 115, 115, 115, 130, 130, 130, 130, 130,
694 130, 130, 130, 130, 130, 130, 130, 130, 130, 192,
695 192, 362, 192, 192, 192, 192, 192, 192, 192, 192,
696 192, 192, 192, 192, 192, 192, 193, 193, 193, 194,
697 362, 362, 362, 194, 194, 194, 201, 362, 362, 201,
698 201, 201, 201, 206, 206, 206, 362, 206, 362, 362,
699 362, 362, 362, 206, 362, 362, 206, 206, 206, 222,
700 222, 362, 222, 222, 222, 222, 222, 222, 222, 222,
701
702 222, 222, 222, 222, 222, 222, 236, 362, 362, 362,
703 362, 236, 362, 362, 362, 362, 236, 257, 362, 362,
704 257, 257, 257, 257, 262, 362, 362, 262, 262, 362,
705 362, 362, 262, 262, 277, 277, 277, 278, 278, 278,
706 362, 362, 362, 362, 278, 278, 278, 362, 362, 362,
707 278, 278, 278, 315, 362, 362, 315, 315, 315, 315,
708 332, 362, 362, 362, 332, 362, 362, 362, 332, 332,
709 7, 362, 362, 362, 362, 362, 362, 362, 362, 362,
710 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
711 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
712
713 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
714 362, 362, 362, 362, 362, 362, 362, 362, 362
715 } ;
716
717 static yyconst short int yy_chk[1820] =
718 { 0,
719 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
720 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
721 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
722 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
723 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
724 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
725 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
726 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
727 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
728 3, 3, 3, 3, 3, 3, 5, 6, 35, 371,
729
730 5, 6, 11, 12, 371, 39, 11, 11, 35, 11,
731 35, 11, 31, 350, 12, 12, 11, 11, 11, 33,
732 31, 32, 31, 11, 91, 32, 39, 38, 91, 33,
733 33, 32, 73, 11, 11, 11, 11, 38, 38, 73,
734 344, 11, 14, 14, 14, 14, 14, 14, 14, 14,
735 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
736 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
737 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
738 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
739 20, 20, 20, 36, 22, 63, 36, 372, 61, 40,
740
741 23, 63, 372, 36, 22, 20, 22, 22, 61, 37,
742 23, 20, 23, 23, 337, 37, 22, 336, 20, 37,
743 40, 22, 23, 29, 29, 29, 34, 23, 43, 34,
744 335, 29, 45, 46, 48, 22, 34, 34, 29, 47,
745 49, 34, 29, 30, 30, 30, 47, 51, 54, 43,
746 49, 30, 56, 45, 46, 48, 57, 58, 30, 59,
747 47, 49, 30, 74, 332, 51, 54, 65, 51, 54,
748 331, 56, 30, 56, 57, 65, 328, 57, 58, 65,
749 59, 74, 30, 42, 42, 42, 42, 42, 42, 42,
750 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
751
752 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
753 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
754 42, 42, 42, 42, 42, 42, 42, 42, 44, 44,
755 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
756 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
757 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
758 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
759 44, 44, 44, 44, 44, 44, 50, 50, 50, 50,
760 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
761 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
762
763 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
764 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
765 50, 50, 50, 52, 52, 75, 267, 76, 77, 83,
766 83, 84, 84, 267, 52, 130, 52, 52, 77, 102,
767 102, 325, 104, 75, 52, 76, 52, 104, 104, 115,
768 117, 52, 118, 264, 118, 264, 130, 186, 186, 115,
769 117, 319, 118, 117, 318, 52, 55, 55, 55, 55,
770 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
771 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
772 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
773
774 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
775 55, 60, 60, 60, 60, 60, 60, 60, 60, 60,
776 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
777 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
778 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
779 60, 60, 60, 60, 60, 60, 60, 60, 71, 71,
780 71, 71, 71, 71, 71, 71, 71, 317, 71, 71,
781 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
782 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
783 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
784
785 71, 71, 71, 71, 71, 71, 86, 86, 86, 111,
786 111, 111, 119, 120, 86, 315, 121, 122, 314, 122,
787 126, 125, 119, 120, 111, 119, 121, 122, 111, 125,
788 126, 125, 198, 198, 86, 86, 86, 86, 86, 86,
789 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
790 86, 86, 86, 92, 123, 124, 313, 127, 128, 312,
791 133, 128, 307, 307, 123, 124, 127, 127, 128, 124,
792 123, 133, 133, 92, 92, 92, 92, 92, 92, 92,
793 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
794 92, 92, 95, 95, 95, 311, 103, 112, 112, 112,
795
796 114, 114, 114, 310, 114, 112, 103, 95, 103, 103,
797 132, 309, 112, 95, 129, 141, 112, 135, 103, 306,
798 95, 114, 144, 103, 129, 148, 129, 304, 135, 135,
799 297, 132, 137, 137, 137, 150, 141, 152, 154, 346,
800 137, 346, 196, 144, 208, 152, 148, 209, 150, 150,
801 152, 152, 196, 296, 208, 284, 150, 209, 152, 154,
802 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
803 137, 137, 137, 137, 137, 137, 137, 137, 137, 140,
804 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
805 140, 140, 140, 140, 140, 140, 140, 140, 142, 142,
806
807 155, 157, 158, 142, 211, 161, 179, 179, 179, 187,
808 187, 187, 329, 329, 211, 179, 277, 199, 199, 212,
809 276, 155, 157, 158, 142, 145, 161, 199, 187, 212,
810 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
811 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
812 146, 146, 305, 355, 355, 275, 274, 305, 305, 273,
813 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
814 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
815 149, 164, 197, 197, 188, 188, 188, 272, 210, 213,
816 215, 210, 197, 149, 149, 241, 164, 197, 210, 213,
817
818 215, 149, 164, 188, 149, 149, 149, 149, 149, 149,
819 153, 153, 381, 382, 266, 260, 241, 381, 382, 257,
820 255, 153, 153, 153, 153, 153, 153, 156, 156, 156,
821 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
822 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
823 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
824 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
825 156, 156, 160, 160, 160, 250, 160, 202, 202, 202,
826 160, 248, 244, 216, 217, 202, 235, 160, 227, 201,
827 195, 160, 202, 216, 217, 193, 202, 160, 162, 162,
828
829 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
830 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
831 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
832 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
833 162, 162, 162, 162, 162, 190, 190, 203, 203, 203,
834 191, 203, 185, 268, 218, 184, 190, 190, 190, 190,
835 190, 190, 206, 206, 206, 218, 218, 183, 203, 204,
836 206, 268, 214, 204, 204, 182, 204, 206, 204, 181,
837 214, 206, 214, 204, 204, 204, 180, 219, 219, 219,
838 204, 219, 222, 222, 224, 224, 229, 222, 269, 224,
839
840 204, 204, 204, 204, 262, 178, 219, 270, 204, 229,
841 229, 288, 219, 220, 262, 230, 269, 229, 222, 229,
842 224, 252, 252, 252, 229, 270, 220, 220, 230, 230,
843 252, 177, 288, 176, 175, 173, 230, 220, 220, 220,
844 220, 220, 220, 225, 225, 225, 225, 225, 225, 225,
845 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
846 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
847 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
848 225, 225, 225, 225, 225, 225, 225, 225, 228, 254,
849 254, 254, 263, 263, 172, 265, 265, 171, 228, 271,
850
851 228, 228, 263, 316, 231, 265, 170, 263, 254, 271,
852 228, 228, 228, 228, 228, 228, 228, 231, 231, 167,
853 279, 280, 281, 166, 316, 231, 165, 231, 232, 232,
854 279, 280, 281, 283, 290, 159, 151, 147, 143, 232,
855 232, 232, 232, 232, 232, 234, 234, 234, 283, 234,
856 278, 278, 278, 234, 283, 290, 330, 330, 278, 139,
857 234, 136, 290, 134, 234, 278, 330, 116, 108, 278,
858 234, 239, 239, 239, 239, 239, 239, 239, 239, 239,
859 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
860 239, 240, 240, 99, 90, 89, 88, 87, 82, 81,
861
862 80, 240, 240, 240, 240, 240, 240, 240, 240, 240,
863 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
864 240, 256, 256, 282, 282, 282, 79, 282, 333, 333,
865 293, 294, 256, 256, 256, 256, 256, 256, 333, 294,
866 78, 294, 282, 293, 293, 72, 345, 345, 282, 285,
867 285, 293, 294, 293, 295, 340, 345, 69, 293, 68,
868 285, 285, 285, 285, 285, 285, 286, 295, 295, 67,
869 308, 308, 308, 66, 64, 295, 340, 295, 308, 286,
870 286, 62, 53, 340, 27, 308, 354, 354, 354, 308,
871 286, 286, 286, 286, 286, 286, 291, 291, 26, 25,
872
873 24, 21, 19, 17, 7, 354, 0, 291, 291, 291,
874 291, 291, 291, 298, 298, 298, 298, 298, 298, 298,
875 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
876 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
877 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
878 298, 298, 298, 298, 298, 298, 298, 298, 320, 320,
879 0, 0, 0, 323, 0, 338, 0, 321, 0, 320,
880 320, 320, 320, 320, 320, 321, 323, 323, 338, 338,
881 321, 321, 339, 0, 323, 342, 338, 0, 321, 322,
882 347, 347, 0, 0, 0, 339, 339, 0, 342, 342,
883
884 347, 322, 322, 339, 0, 339, 342, 0, 342, 0,
885 357, 322, 322, 322, 322, 322, 322, 322, 327, 327,
886 327, 351, 327, 357, 357, 0, 327, 353, 352, 358,
887 358, 357, 359, 327, 351, 351, 352, 327, 352, 358,
888 353, 353, 351, 327, 351, 359, 359, 0, 353, 352,
889 353, 360, 360, 359, 361, 359, 0, 0, 0, 0,
890 0, 360, 0, 0, 0, 0, 0, 361, 361, 0,
891 0, 0, 0, 0, 0, 361, 0, 361, 363, 0,
892 0, 363, 0, 0, 0, 363, 363, 363, 364, 364,
893 364, 0, 0, 0, 0, 0, 364, 0, 364, 0,
894
895 0, 364, 364, 364, 365, 0, 365, 365, 365, 366,
896 366, 366, 0, 0, 0, 0, 366, 366, 366, 0,
897 0, 0, 366, 366, 366, 367, 367, 367, 367, 367,
898 367, 367, 367, 367, 367, 367, 367, 367, 367, 368,
899 368, 0, 368, 368, 368, 368, 368, 368, 368, 368,
900 368, 368, 368, 368, 368, 368, 369, 369, 369, 370,
901 0, 0, 0, 370, 370, 370, 373, 0, 0, 373,
902 373, 373, 373, 374, 374, 374, 0, 374, 0, 0,
903 0, 0, 0, 374, 0, 0, 374, 374, 374, 375,
904 375, 0, 375, 375, 375, 375, 375, 375, 375, 375,
905
906 375, 375, 375, 375, 375, 375, 376, 0, 0, 0,
907 0, 376, 0, 0, 0, 0, 376, 377, 0, 0,
908 377, 377, 377, 377, 378, 0, 0, 378, 378, 0,
909 0, 0, 378, 378, 379, 379, 379, 380, 380, 380,
910 0, 0, 0, 0, 380, 380, 380, 0, 0, 0,
911 380, 380, 380, 383, 0, 0, 383, 383, 383, 383,
912 384, 0, 0, 0, 384, 0, 0, 0, 384, 384,
913 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
914 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
915 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
916
917 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
918 362, 362, 362, 362, 362, 362, 362, 362, 362
919 } ;
920
921 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
922 static char *yy_full_match;
923 static int yy_lp;
924 static int yy_looking_for_trail_begin = 0;
925 static int yy_full_lp;
926 static int *yy_full_state;
927 #define YY_TRAILING_MASK 0x2000
928 #define YY_TRAILING_HEAD_MASK 0x4000
929 #define REJECT \
930 { \
931 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
932 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
933 yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
934 yy_state_ptr = yy_full_state; /* restore orig. state */ \
935 yy_current_state = *yy_state_ptr; /* restore curr. state */ \
936 ++yy_lp; \
937 goto find_rule; \
938 }
939 #define yymore() yymore_used_but_not_detected
940 #define YY_MORE_ADJ 0
941 #define YY_RESTORE_YY_MORE_OFFSET
942 char *yytext;
943 #line 1 "./ada-lex.l"
944 #define INITIAL 0
945 /* FLEX lexer for Ada expressions, for GDB.
946 Copyright (C) 1994, 1997, 2000
947 Free Software Foundation, Inc.
948
949 This file is part of GDB.
950
951 This program is free software; you can redistribute it and/or modify
952 it under the terms of the GNU General Public License as published by
953 the Free Software Foundation; either version 2 of the License, or
954 (at your option) any later version.
955
956 This program is distributed in the hope that it will be useful,
957 but WITHOUT ANY WARRANTY; without even the implied warranty of
958 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
959 GNU General Public License for more details.
960
961 You should have received a copy of the GNU General Public License
962 along with this program; if not, write to the Free Software
963 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
964 /*----------------------------------------------------------------------*/
965 /* The converted version of this file is to be included in ada-exp.y, */
966 /* the Ada parser for gdb. The function yylex obtains characters from */
967 /* the global pointer lexptr. It returns a syntactic category for */
968 /* each successive token and places a semantic value into yylval */
969 /* (ada-lval), defined by the parser. */
970 /* Run flex with (at least) the -i option (case-insensitive), and the -I */
971 /* option (interactive---no unnecessary lookahead). */
972 #line 48 "./ada-lex.l"
973 #define NUMERAL_WIDTH 256
974 #define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
975
976 /* Temporary staging for numeric literals. */
977 static char numbuf[NUMERAL_WIDTH];
978 static void canonicalizeNumeral (char* s1, const char*);
979 static int processInt (const char*, const char*, const char*);
980 static int processReal (const char*);
981 static int processId (const char*, int);
982 static int processAttribute (const char*);
983 static int find_dot_all (const char*);
984
985 #undef YY_DECL
986 #define YY_DECL static int yylex ( void )
987
988 #undef YY_INPUT
989 #define YY_INPUT(BUF, RESULT, MAX_SIZE) \
990 if ( *lexptr == '\000' ) \
991 (RESULT) = YY_NULL; \
992 else \
993 { \
994 *(BUF) = *lexptr; \
995 (RESULT) = 1; \
996 lexptr += 1; \
997 }
998
999 static char *tempbuf = NULL;
1000 static int tempbufsize = 0;
1001 static int tempbuf_len;
1002 static struct block* left_block_context;
1003
1004 static void resize_tempbuf (unsigned int);
1005
1006 static void block_lookup (char*, char*);
1007
1008 static int name_lookup (char*, char*, int*);
1009
1010 static int find_dot_all (const char*);
1011
1012 #define IN_STRING 1
1013 #define BEFORE_QUAL_QUOTE 2
1014
1015
1016 /* Macros after this point can all be overridden by user definitions in
1017 * section 1.
1018 */
1019
1020 #ifndef YY_SKIP_YYWRAP
1021 #ifdef __cplusplus
1022 extern "C" int yywrap YY_PROTO(( void ));
1023 #else
1024 extern int yywrap YY_PROTO(( void ));
1025 #endif
1026 #endif
1027
1028 #ifndef YY_NO_UNPUT
1029 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
1030 #endif
1031
1032 #ifndef yytext_ptr
1033 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
1034 #endif
1035
1036 #ifdef YY_NEED_STRLEN
1037 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
1038 #endif
1039
1040 #ifndef YY_NO_INPUT
1041 #ifdef __cplusplus
1042 static int yyinput YY_PROTO(( void ));
1043 #else
1044 static int input YY_PROTO(( void ));
1045 #endif
1046 #endif
1047
1048 #if YY_STACK_USED
1049 static int yy_start_stack_ptr = 0;
1050 static int yy_start_stack_depth = 0;
1051 static int *yy_start_stack = 0;
1052 #ifndef YY_NO_PUSH_STATE
1053 static void yy_push_state YY_PROTO(( int new_state ));
1054 #endif
1055 #ifndef YY_NO_POP_STATE
1056 static void yy_pop_state YY_PROTO(( void ));
1057 #endif
1058 #ifndef YY_NO_TOP_STATE
1059 static int yy_top_state YY_PROTO(( void ));
1060 #endif
1061
1062 #else
1063 #define YY_NO_PUSH_STATE 1
1064 #define YY_NO_POP_STATE 1
1065 #define YY_NO_TOP_STATE 1
1066 #endif
1067
1068 #ifdef YY_MALLOC_DECL
1069 YY_MALLOC_DECL
1070 #else
1071 #if __STDC__
1072 #ifndef __cplusplus
1073 #include <stdlib.h>
1074 #endif
1075 #else
1076 /* Just try to get by without declaring the routines. This will fail
1077 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1078 * or sizeof(void*) != sizeof(int).
1079 */
1080 #endif
1081 #endif
1082
1083 /* Amount of stuff to slurp up with each read. */
1084 #ifndef YY_READ_BUF_SIZE
1085 #define YY_READ_BUF_SIZE 8192
1086 #endif
1087
1088 /* Copy whatever the last rule matched to the standard output. */
1089
1090 #ifndef ECHO
1091 /* This used to be an fputs(), but since the string might contain NUL's,
1092 * we now use fwrite().
1093 */
1094 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1095 #endif
1096
1097 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1098 * is returned in "result".
1099 */
1100 #ifndef YY_INPUT
1101 #define YY_INPUT(buf,result,max_size) \
1102 if ( yy_current_buffer->yy_is_interactive ) \
1103 { \
1104 int c = '*', n; \
1105 for ( n = 0; n < max_size && \
1106 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1107 buf[n] = (char) c; \
1108 if ( c == '\n' ) \
1109 buf[n++] = (char) c; \
1110 if ( c == EOF && ferror( yyin ) ) \
1111 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1112 result = n; \
1113 } \
1114 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1115 && ferror( yyin ) ) \
1116 YY_FATAL_ERROR( "input in flex scanner failed" );
1117 #endif
1118
1119 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1120 * we don't want an extra ';' after the "return" because that will cause
1121 * some compilers to complain about unreachable statements.
1122 */
1123 #ifndef yyterminate
1124 #define yyterminate() return YY_NULL
1125 #endif
1126
1127 /* Number of entries by which start-condition stack grows. */
1128 #ifndef YY_START_STACK_INCR
1129 #define YY_START_STACK_INCR 25
1130 #endif
1131
1132 /* Report a fatal error. */
1133 #ifndef YY_FATAL_ERROR
1134 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1135 #endif
1136
1137 /* Default declaration of generated scanner - a define so the user can
1138 * easily add parameters.
1139 */
1140 #ifndef YY_DECL
1141 #define YY_DECL int yylex YY_PROTO(( void ))
1142 #endif
1143
1144 /* Code executed at the beginning of each rule, after yytext and yyleng
1145 * have been set up.
1146 */
1147 #ifndef YY_USER_ACTION
1148 #define YY_USER_ACTION
1149 #endif
1150
1151 /* Code executed at the end of each rule. */
1152 #ifndef YY_BREAK
1153 #define YY_BREAK break;
1154 #endif
1155
1156 #define YY_RULE_SETUP \
1157 YY_USER_ACTION
1158
1159 YY_DECL
1160 {
1161 register yy_state_type yy_current_state;
1162 register char *yy_cp, *yy_bp;
1163 register int yy_act;
1164
1165 #line 91 "./ada-lex.l"
1166
1167
1168
1169 if ( yy_init )
1170 {
1171 yy_init = 0;
1172
1173 #ifdef YY_USER_INIT
1174 YY_USER_INIT;
1175 #endif
1176
1177 if ( ! yy_start )
1178 yy_start = 1; /* first start state */
1179
1180 if ( ! yyin )
1181 yyin = stdin;
1182
1183 if ( ! yyout )
1184 yyout = stdout;
1185
1186 if ( ! yy_current_buffer )
1187 yy_current_buffer =
1188 yy_create_buffer( yyin, YY_BUF_SIZE );
1189
1190 yy_load_buffer_state();
1191 }
1192
1193 while ( 1 ) /* loops until end-of-file is reached */
1194 {
1195 yy_cp = yy_c_buf_p;
1196
1197 /* Support of yytext. */
1198 *yy_cp = yy_hold_char;
1199
1200 /* yy_bp points to the position in yy_ch_buf of the start of
1201 * the current run.
1202 */
1203 yy_bp = yy_cp;
1204
1205 yy_current_state = yy_start;
1206 yy_state_ptr = yy_state_buf;
1207 *yy_state_ptr++ = yy_current_state;
1208 yy_match:
1209 do
1210 {
1211 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1212 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1213 {
1214 yy_current_state = (int) yy_def[yy_current_state];
1215 if ( yy_current_state >= 363 )
1216 yy_c = yy_meta[(unsigned int) yy_c];
1217 }
1218 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1219 *yy_state_ptr++ = yy_current_state;
1220 ++yy_cp;
1221 }
1222 while ( yy_base[yy_current_state] != 1771 );
1223
1224 yy_find_action:
1225 yy_current_state = *--yy_state_ptr;
1226 yy_lp = yy_accept[yy_current_state];
1227 find_rule: /* we branch to this label when backing up */
1228 for ( ; ; ) /* until we find what rule we matched */
1229 {
1230 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
1231 {
1232 yy_act = yy_acclist[yy_lp];
1233 if ( yy_act & YY_TRAILING_HEAD_MASK ||
1234 yy_looking_for_trail_begin )
1235 {
1236 if ( yy_act == yy_looking_for_trail_begin )
1237 {
1238 yy_looking_for_trail_begin = 0;
1239 yy_act &= ~YY_TRAILING_HEAD_MASK;
1240 break;
1241 }
1242 }
1243 else if ( yy_act & YY_TRAILING_MASK )
1244 {
1245 yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
1246 yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
1247 }
1248 else
1249 {
1250 yy_full_match = yy_cp;
1251 yy_full_state = yy_state_ptr;
1252 yy_full_lp = yy_lp;
1253 break;
1254 }
1255 ++yy_lp;
1256 goto find_rule;
1257 }
1258 --yy_cp;
1259 yy_current_state = *--yy_state_ptr;
1260 yy_lp = yy_accept[yy_current_state];
1261 }
1262
1263 YY_DO_BEFORE_ACTION;
1264
1265
1266 do_action: /* This label is used only to access EOF actions. */
1267
1268
1269 switch ( yy_act )
1270 { /* beginning of action switch */
1271 case 1:
1272 YY_RULE_SETUP
1273 #line 93 "./ada-lex.l"
1274 { }
1275 YY_BREAK
1276 case 2:
1277 YY_RULE_SETUP
1278 #line 95 "./ada-lex.l"
1279 { yyterminate(); }
1280 YY_BREAK
1281 case 3:
1282 YY_RULE_SETUP
1283 #line 97 "./ada-lex.l"
1284 {
1285 canonicalizeNumeral (numbuf, yytext);
1286 return processInt (NULL, numbuf, strrchr(numbuf, 'e')+1);
1287 }
1288 YY_BREAK
1289 case 4:
1290 YY_RULE_SETUP
1291 #line 102 "./ada-lex.l"
1292 {
1293 canonicalizeNumeral (numbuf, yytext);
1294 return processInt (NULL, numbuf, NULL);
1295 }
1296 YY_BREAK
1297 case 5:
1298 YY_RULE_SETUP
1299 #line 107 "./ada-lex.l"
1300 {
1301 canonicalizeNumeral (numbuf, yytext);
1302 return processInt (numbuf,
1303 strchr (numbuf, '#') + 1,
1304 strrchr(numbuf, '#') + 1);
1305 }
1306 YY_BREAK
1307 case 6:
1308 YY_RULE_SETUP
1309 #line 114 "./ada-lex.l"
1310 {
1311 canonicalizeNumeral (numbuf, yytext);
1312 return processInt (numbuf, strchr (numbuf, '#') + 1, NULL);
1313 }
1314 YY_BREAK
1315 case 7:
1316 YY_RULE_SETUP
1317 #line 119 "./ada-lex.l"
1318 {
1319 canonicalizeNumeral (numbuf, yytext+2);
1320 return processInt ("16#", numbuf, NULL);
1321 }
1322 YY_BREAK
1323 case 8:
1324 YY_RULE_SETUP
1325 #line 125 "./ada-lex.l"
1326 {
1327 canonicalizeNumeral (numbuf, yytext);
1328 return processReal (numbuf);
1329 }
1330 YY_BREAK
1331 case 9:
1332 YY_RULE_SETUP
1333 #line 130 "./ada-lex.l"
1334 {
1335 canonicalizeNumeral (numbuf, yytext);
1336 return processReal (numbuf);
1337 }
1338 YY_BREAK
1339 case 10:
1340 YY_RULE_SETUP
1341 #line 135 "./ada-lex.l"
1342 {
1343 error ("Based real literals not implemented yet.");
1344 }
1345 YY_BREAK
1346 case 11:
1347 YY_RULE_SETUP
1348 #line 139 "./ada-lex.l"
1349 {
1350 error ("Based real literals not implemented yet.");
1351 }
1352 YY_BREAK
1353 case 12:
1354 YY_RULE_SETUP
1355 #line 143 "./ada-lex.l"
1356 {
1357 yylval.typed_val.type = builtin_type_ada_char;
1358 yylval.typed_val.val = yytext[1];
1359 return CHARLIT;
1360 }
1361 YY_BREAK
1362 case 13:
1363 YY_RULE_SETUP
1364 #line 149 "./ada-lex.l"
1365 {
1366 int v;
1367 yylval.typed_val.type = builtin_type_ada_char;
1368 sscanf (yytext+3, "%2x", &v);
1369 yylval.typed_val.val = v;
1370 return CHARLIT;
1371 }
1372 YY_BREAK
1373 case 14:
1374 YY_RULE_SETUP
1375 #line 157 "./ada-lex.l"
1376 { return processId (yytext, yyleng); }
1377 YY_BREAK
1378 case 15:
1379 YY_RULE_SETUP
1380 #line 159 "./ada-lex.l"
1381 {
1382 tempbuf_len = 0;
1383 BEGIN IN_STRING;
1384 }
1385 YY_BREAK
1386 case 16:
1387 YY_RULE_SETUP
1388 #line 164 "./ada-lex.l"
1389 {
1390 resize_tempbuf (yyleng+tempbuf_len);
1391 strncpy (tempbuf+tempbuf_len, yytext, yyleng-1);
1392 tempbuf_len += yyleng-1;
1393 yylval.sval.ptr = tempbuf;
1394 yylval.sval.length = tempbuf_len;
1395 BEGIN INITIAL;
1396 return STRING;
1397 }
1398 YY_BREAK
1399 case 17:
1400 YY_RULE_SETUP
1401 #line 174 "./ada-lex.l"
1402 {
1403 int n;
1404 resize_tempbuf (yyleng-5+tempbuf_len+1);
1405 strncpy (tempbuf+tempbuf_len, yytext, yyleng-6);
1406 sscanf(yytext+yyleng-4, "%2x", &n);
1407 tempbuf[yyleng-6+tempbuf_len] = (char) n;
1408 tempbuf_len += yyleng-5;
1409 }
1410 YY_BREAK
1411 case 18:
1412 YY_RULE_SETUP
1413 #line 183 "./ada-lex.l"
1414 {
1415 int n;
1416 resize_tempbuf (yyleng-4+tempbuf_len+1);
1417 strncpy (tempbuf+tempbuf_len, yytext, yyleng-6);
1418 tempbuf[yyleng-5+tempbuf_len] = '"';
1419 tempbuf_len += yyleng-4;
1420 }
1421 YY_BREAK
1422 case 19:
1423 YY_RULE_SETUP
1424 #line 191 "./ada-lex.l"
1425 {
1426 while (*lexptr != 'i' && *lexptr != 'I')
1427 lexptr -= 1;
1428 yyrestart(NULL);
1429 return 0;
1430 }
1431 YY_BREAK
1432 /* ADA KEYWORDS */
1433 case 20:
1434 YY_RULE_SETUP
1435 #line 200 "./ada-lex.l"
1436 { return ABS; }
1437 YY_BREAK
1438 case 21:
1439 YY_RULE_SETUP
1440 #line 201 "./ada-lex.l"
1441 { return _AND_; }
1442 YY_BREAK
1443 case 22:
1444 YY_RULE_SETUP
1445 #line 202 "./ada-lex.l"
1446 { return ELSE; }
1447 YY_BREAK
1448 case 23:
1449 YY_RULE_SETUP
1450 #line 203 "./ada-lex.l"
1451 { return IN; }
1452 YY_BREAK
1453 case 24:
1454 YY_RULE_SETUP
1455 #line 204 "./ada-lex.l"
1456 { return MOD; }
1457 YY_BREAK
1458 case 25:
1459 YY_RULE_SETUP
1460 #line 205 "./ada-lex.l"
1461 { return NEW; }
1462 YY_BREAK
1463 case 26:
1464 YY_RULE_SETUP
1465 #line 206 "./ada-lex.l"
1466 { return NOT; }
1467 YY_BREAK
1468 case 27:
1469 YY_RULE_SETUP
1470 #line 207 "./ada-lex.l"
1471 { return NULL_PTR; }
1472 YY_BREAK
1473 case 28:
1474 YY_RULE_SETUP
1475 #line 208 "./ada-lex.l"
1476 { return OR; }
1477 YY_BREAK
1478 case 29:
1479 YY_RULE_SETUP
1480 #line 209 "./ada-lex.l"
1481 { return REM; }
1482 YY_BREAK
1483 case 30:
1484 YY_RULE_SETUP
1485 #line 210 "./ada-lex.l"
1486 { return THEN; }
1487 YY_BREAK
1488 case 31:
1489 YY_RULE_SETUP
1490 #line 211 "./ada-lex.l"
1491 { return XOR; }
1492 YY_BREAK
1493 /* ATTRIBUTES */
1494 case 32:
1495 YY_RULE_SETUP
1496 #line 215 "./ada-lex.l"
1497 { return processAttribute (yytext+1); }
1498 YY_BREAK
1499 /* PUNCTUATION */
1500 case 33:
1501 YY_RULE_SETUP
1502 #line 219 "./ada-lex.l"
1503 { return ARROW; }
1504 YY_BREAK
1505 case 34:
1506 YY_RULE_SETUP
1507 #line 220 "./ada-lex.l"
1508 { return DOTDOT; }
1509 YY_BREAK
1510 case 35:
1511 YY_RULE_SETUP
1512 #line 221 "./ada-lex.l"
1513 { return STARSTAR; }
1514 YY_BREAK
1515 case 36:
1516 YY_RULE_SETUP
1517 #line 222 "./ada-lex.l"
1518 { return ASSIGN; }
1519 YY_BREAK
1520 case 37:
1521 YY_RULE_SETUP
1522 #line 223 "./ada-lex.l"
1523 { return NOTEQUAL; }
1524 YY_BREAK
1525 case 38:
1526 YY_RULE_SETUP
1527 #line 224 "./ada-lex.l"
1528 { return LEQ; }
1529 YY_BREAK
1530 case 39:
1531 YY_RULE_SETUP
1532 #line 225 "./ada-lex.l"
1533 { return GEQ; }
1534 YY_BREAK
1535 case 40:
1536 YY_RULE_SETUP
1537 #line 227 "./ada-lex.l"
1538 { BEGIN INITIAL; return '\''; }
1539 YY_BREAK
1540 case 41:
1541 YY_RULE_SETUP
1542 #line 229 "./ada-lex.l"
1543 { return yytext[0]; }
1544 YY_BREAK
1545 case 42:
1546 YY_RULE_SETUP
1547 #line 231 "./ada-lex.l"
1548 { if (paren_depth == 0 && comma_terminates)
1549 {
1550 lexptr -= 1;
1551 yyrestart(NULL);
1552 return 0;
1553 }
1554 else
1555 return ',';
1556 }
1557 YY_BREAK
1558 case 43:
1559 YY_RULE_SETUP
1560 #line 241 "./ada-lex.l"
1561 { paren_depth += 1; return '('; }
1562 YY_BREAK
1563 case 44:
1564 YY_RULE_SETUP
1565 #line 242 "./ada-lex.l"
1566 { if (paren_depth == 0)
1567 {
1568 lexptr -= 1;
1569 yyrestart(NULL);
1570 return 0;
1571 }
1572 else
1573 {
1574 paren_depth -= 1;
1575 return ')';
1576 }
1577 }
1578 YY_BREAK
1579 case 45:
1580 YY_RULE_SETUP
1581 #line 255 "./ada-lex.l"
1582 { return DOT_ALL; }
1583 YY_BREAK
1584 case 46:
1585 YY_RULE_SETUP
1586 #line 257 "./ada-lex.l"
1587 {
1588 processId (yytext+1, yyleng-1);
1589 return DOT_ID;
1590 }
1591 YY_BREAK
1592 case 47:
1593 YY_RULE_SETUP
1594 #line 262 "./ada-lex.l"
1595 {
1596 int all_posn = find_dot_all (yytext);
1597 int token_type, segments, k;
1598 int quote_follows;
1599
1600 if (all_posn == -1 && yytext[yyleng-1] == '\'')
1601 {
1602 quote_follows = 1;
1603 do {
1604 yyless (yyleng-1);
1605 } while (yytext[yyleng-1] == ' ');
1606 }
1607 else
1608 quote_follows = 0;
1609
1610 if (all_posn >= 0)
1611 yyless (all_posn);
1612 processId(yytext, yyleng);
1613 segments = name_lookup (ada_mangle (yylval.ssym.stoken.ptr),
1614 yylval.ssym.stoken.ptr, &token_type);
1615 left_block_context = NULL;
1616 for (k = yyleng; segments > 0 && k > 0; k -= 1)
1617 {
1618 if (yytext[k-1] == '.')
1619 segments -= 1;
1620 quote_follows = 0;
1621 }
1622 if (k <= 0)
1623 error ("confused by name %s", yytext);
1624 yyless (k);
1625 if (quote_follows)
1626 BEGIN BEFORE_QUAL_QUOTE;
1627 return token_type;
1628 }
1629 YY_BREAK
1630 /* GDB EXPRESSION CONSTRUCTS */
1631 case 48:
1632 YY_RULE_SETUP
1633 #line 300 "./ada-lex.l"
1634 {
1635 processId(yytext, yyleng-2);
1636 block_lookup (yylval.ssym.stoken.ptr, yylval.ssym.stoken.ptr);
1637 return BLOCKNAME;
1638 }
1639 YY_BREAK
1640 case 49:
1641 YY_RULE_SETUP
1642 #line 306 "./ada-lex.l"
1643 {
1644 processId(yytext, yyleng-2);
1645 block_lookup (ada_mangle (yylval.ssym.stoken.ptr),
1646 yylval.ssym.stoken.ptr);
1647 return BLOCKNAME;
1648 }
1649 YY_BREAK
1650 case 50:
1651 YY_RULE_SETUP
1652 #line 313 "./ada-lex.l"
1653 { return yytext[0]; }
1654 YY_BREAK
1655 case 51:
1656 YY_RULE_SETUP
1657 #line 315 "./ada-lex.l"
1658 { yylval.lval = -1; return LAST; }
1659 YY_BREAK
1660 case 52:
1661 YY_RULE_SETUP
1662 #line 316 "./ada-lex.l"
1663 { yylval.lval = -atoi(yytext+2); return LAST; }
1664 YY_BREAK
1665 case 53:
1666 YY_RULE_SETUP
1667 #line 317 "./ada-lex.l"
1668 { yylval.lval = 0; return LAST; }
1669 YY_BREAK
1670 case 54:
1671 YY_RULE_SETUP
1672 #line 318 "./ada-lex.l"
1673 { yylval.lval = atoi(yytext+1); return LAST; }
1674 YY_BREAK
1675 /* REGISTERS AND GDB CONVENIENCE VARIABLES */
1676 case 55:
1677 YY_RULE_SETUP
1678 #line 323 "./ada-lex.l"
1679 {
1680 int c;
1681 for (c = 0; c < NUM_REGS; c++)
1682 if (REGISTER_NAME (c) &&
1683 strcmp (yytext + 1, REGISTER_NAME (c)) == 0)
1684 {
1685 yylval.lval = c;
1686 return REGNAME;
1687 }
1688 yylval.sval.ptr = yytext;
1689 yylval.sval.length = yyleng;
1690 yylval.ivar =
1691 lookup_internalvar (copy_name (yylval.sval) + 1);
1692 return INTERNAL_VARIABLE;
1693 }
1694 YY_BREAK
1695 /* CATCH-ALL ERROR CASE */
1696 case 56:
1697 YY_RULE_SETUP
1698 #line 341 "./ada-lex.l"
1699 { error ("Invalid character '%s' in expression.", yytext); }
1700 YY_BREAK
1701 case 57:
1702 YY_RULE_SETUP
1703 #line 342 "./ada-lex.l"
1704 YY_FATAL_ERROR( "flex scanner jammed" );
1705 YY_BREAK
1706 case YY_STATE_EOF(INITIAL):
1707 case YY_STATE_EOF(IN_STRING):
1708 case YY_STATE_EOF(BEFORE_QUAL_QUOTE):
1709 yyterminate();
1710
1711 case YY_END_OF_BUFFER:
1712 {
1713 /* Amount of text matched not including the EOB char. */
1714 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1715
1716 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1717 *yy_cp = yy_hold_char;
1718 YY_RESTORE_YY_MORE_OFFSET
1719
1720 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1721 {
1722 /* We're scanning a new file or input source. It's
1723 * possible that this happened because the user
1724 * just pointed yyin at a new source and called
1725 * yylex(). If so, then we have to assure
1726 * consistency between yy_current_buffer and our
1727 * globals. Here is the right place to do so, because
1728 * this is the first action (other than possibly a
1729 * back-up) that will match for the new input source.
1730 */
1731 yy_n_chars = yy_current_buffer->yy_n_chars;
1732 yy_current_buffer->yy_input_file = yyin;
1733 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1734 }
1735
1736 /* Note that here we test for yy_c_buf_p "<=" to the position
1737 * of the first EOB in the buffer, since yy_c_buf_p will
1738 * already have been incremented past the NUL character
1739 * (since all states make transitions on EOB to the
1740 * end-of-buffer state). Contrast this with the test
1741 * in input().
1742 */
1743 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1744 { /* This was really a NUL. */
1745 yy_state_type yy_next_state;
1746
1747 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1748
1749 yy_current_state = yy_get_previous_state();
1750
1751 /* Okay, we're now positioned to make the NUL
1752 * transition. We couldn't have
1753 * yy_get_previous_state() go ahead and do it
1754 * for us because it doesn't know how to deal
1755 * with the possibility of jamming (and we don't
1756 * want to build jamming into it because then it
1757 * will run more slowly).
1758 */
1759
1760 yy_next_state = yy_try_NUL_trans( yy_current_state );
1761
1762 yy_bp = yytext_ptr + YY_MORE_ADJ;
1763
1764 if ( yy_next_state )
1765 {
1766 /* Consume the NUL. */
1767 yy_cp = ++yy_c_buf_p;
1768 yy_current_state = yy_next_state;
1769 goto yy_match;
1770 }
1771
1772 else
1773 {
1774 yy_cp = yy_c_buf_p;
1775 goto yy_find_action;
1776 }
1777 }
1778
1779 else switch ( yy_get_next_buffer() )
1780 {
1781 case EOB_ACT_END_OF_FILE:
1782 {
1783 yy_did_buffer_switch_on_eof = 0;
1784
1785 if ( yywrap() )
1786 {
1787 /* Note: because we've taken care in
1788 * yy_get_next_buffer() to have set up
1789 * yytext, we can now set up
1790 * yy_c_buf_p so that if some total
1791 * hoser (like flex itself) wants to
1792 * call the scanner after we return the
1793 * YY_NULL, it'll still work - another
1794 * YY_NULL will get returned.
1795 */
1796 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1797
1798 yy_act = YY_STATE_EOF(YY_START);
1799 goto do_action;
1800 }
1801
1802 else
1803 {
1804 if ( ! yy_did_buffer_switch_on_eof )
1805 YY_NEW_FILE;
1806 }
1807 break;
1808 }
1809
1810 case EOB_ACT_CONTINUE_SCAN:
1811 yy_c_buf_p =
1812 yytext_ptr + yy_amount_of_matched_text;
1813
1814 yy_current_state = yy_get_previous_state();
1815
1816 yy_cp = yy_c_buf_p;
1817 yy_bp = yytext_ptr + YY_MORE_ADJ;
1818 goto yy_match;
1819
1820 case EOB_ACT_LAST_MATCH:
1821 yy_c_buf_p =
1822 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1823
1824 yy_current_state = yy_get_previous_state();
1825
1826 yy_cp = yy_c_buf_p;
1827 yy_bp = yytext_ptr + YY_MORE_ADJ;
1828 goto yy_find_action;
1829 }
1830 break;
1831 }
1832
1833 default:
1834 YY_FATAL_ERROR(
1835 "fatal flex scanner internal error--no action found" );
1836 } /* end of action switch */
1837 } /* end of scanning one token */
1838 } /* end of yylex */
1839
1840
1841 /* yy_get_next_buffer - try to read in a new buffer
1842 *
1843 * Returns a code representing an action:
1844 * EOB_ACT_LAST_MATCH -
1845 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1846 * EOB_ACT_END_OF_FILE - end of file
1847 */
1848
1849 static int yy_get_next_buffer()
1850 {
1851 register char *dest = yy_current_buffer->yy_ch_buf;
1852 register char *source = yytext_ptr;
1853 register int number_to_move, i;
1854 int ret_val;
1855
1856 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1857 YY_FATAL_ERROR(
1858 "fatal flex scanner internal error--end of buffer missed" );
1859
1860 if ( yy_current_buffer->yy_fill_buffer == 0 )
1861 { /* Don't try to fill the buffer, so this is an EOF. */
1862 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1863 {
1864 /* We matched a single character, the EOB, so
1865 * treat this as a final EOF.
1866 */
1867 return EOB_ACT_END_OF_FILE;
1868 }
1869
1870 else
1871 {
1872 /* We matched some text prior to the EOB, first
1873 * process it.
1874 */
1875 return EOB_ACT_LAST_MATCH;
1876 }
1877 }
1878
1879 /* Try to read more data. */
1880
1881 /* First move last chars to start of buffer. */
1882 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1883
1884 for ( i = 0; i < number_to_move; ++i )
1885 *(dest++) = *(source++);
1886
1887 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1888 /* don't do the read, it's not guaranteed to return an EOF,
1889 * just force an EOF
1890 */
1891 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1892
1893 else
1894 {
1895 int num_to_read =
1896 yy_current_buffer->yy_buf_size - number_to_move - 1;
1897
1898 while ( num_to_read <= 0 )
1899 { /* Not enough room in the buffer - grow it. */
1900 #ifdef YY_USES_REJECT
1901 YY_FATAL_ERROR(
1902 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1903 #else
1904
1905 /* just a shorter name for the current buffer */
1906 YY_BUFFER_STATE b = yy_current_buffer;
1907
1908 int yy_c_buf_p_offset =
1909 (int) (yy_c_buf_p - b->yy_ch_buf);
1910
1911 if ( b->yy_is_our_buffer )
1912 {
1913 int new_size = b->yy_buf_size * 2;
1914
1915 if ( new_size <= 0 )
1916 b->yy_buf_size += b->yy_buf_size / 8;
1917 else
1918 b->yy_buf_size *= 2;
1919
1920 b->yy_ch_buf = (char *)
1921 /* Include room in for 2 EOB chars. */
1922 yy_flex_realloc( (void *) b->yy_ch_buf,
1923 b->yy_buf_size + 2 );
1924 }
1925 else
1926 /* Can't grow it, we don't own it. */
1927 b->yy_ch_buf = 0;
1928
1929 if ( ! b->yy_ch_buf )
1930 YY_FATAL_ERROR(
1931 "fatal error - scanner input buffer overflow" );
1932
1933 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1934
1935 num_to_read = yy_current_buffer->yy_buf_size -
1936 number_to_move - 1;
1937 #endif
1938 }
1939
1940 if ( num_to_read > YY_READ_BUF_SIZE )
1941 num_to_read = YY_READ_BUF_SIZE;
1942
1943 /* Read in more data. */
1944 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1945 yy_n_chars, num_to_read );
1946
1947 yy_current_buffer->yy_n_chars = yy_n_chars;
1948 }
1949
1950 if ( yy_n_chars == 0 )
1951 {
1952 if ( number_to_move == YY_MORE_ADJ )
1953 {
1954 ret_val = EOB_ACT_END_OF_FILE;
1955 yyrestart( yyin );
1956 }
1957
1958 else
1959 {
1960 ret_val = EOB_ACT_LAST_MATCH;
1961 yy_current_buffer->yy_buffer_status =
1962 YY_BUFFER_EOF_PENDING;
1963 }
1964 }
1965
1966 else
1967 ret_val = EOB_ACT_CONTINUE_SCAN;
1968
1969 yy_n_chars += number_to_move;
1970 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1971 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1972
1973 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1974
1975 return ret_val;
1976 }
1977
1978
1979 /* yy_get_previous_state - get the state just before the EOB char was reached */
1980
1981 static yy_state_type yy_get_previous_state()
1982 {
1983 register yy_state_type yy_current_state;
1984 register char *yy_cp;
1985
1986 yy_current_state = yy_start;
1987 yy_state_ptr = yy_state_buf;
1988 *yy_state_ptr++ = yy_current_state;
1989
1990 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1991 {
1992 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1993 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1994 {
1995 yy_current_state = (int) yy_def[yy_current_state];
1996 if ( yy_current_state >= 363 )
1997 yy_c = yy_meta[(unsigned int) yy_c];
1998 }
1999 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2000 *yy_state_ptr++ = yy_current_state;
2001 }
2002
2003 return yy_current_state;
2004 }
2005
2006
2007 /* yy_try_NUL_trans - try to make a transition on the NUL character
2008 *
2009 * synopsis
2010 * next_state = yy_try_NUL_trans( current_state );
2011 */
2012
2013 #ifdef YY_USE_PROTOS
2014 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
2015 #else
2016 static yy_state_type yy_try_NUL_trans( yy_current_state )
2017 yy_state_type yy_current_state;
2018 #endif
2019 {
2020 register int yy_is_jam;
2021
2022 register YY_CHAR yy_c = 1;
2023 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2024 {
2025 yy_current_state = (int) yy_def[yy_current_state];
2026 if ( yy_current_state >= 363 )
2027 yy_c = yy_meta[(unsigned int) yy_c];
2028 }
2029 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2030 yy_is_jam = (yy_current_state == 362);
2031 if ( ! yy_is_jam )
2032 *yy_state_ptr++ = yy_current_state;
2033
2034 return yy_is_jam ? 0 : yy_current_state;
2035 }
2036
2037
2038 #ifndef YY_NO_UNPUT
2039 #ifdef YY_USE_PROTOS
2040 static void yyunput( int c, register char *yy_bp )
2041 #else
2042 static void yyunput( c, yy_bp )
2043 int c;
2044 register char *yy_bp;
2045 #endif
2046 {
2047 register char *yy_cp = yy_c_buf_p;
2048
2049 /* undo effects of setting up yytext */
2050 *yy_cp = yy_hold_char;
2051
2052 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2053 { /* need to shift things up to make room */
2054 /* +2 for EOB chars. */
2055 register int number_to_move = yy_n_chars + 2;
2056 register char *dest = &yy_current_buffer->yy_ch_buf[
2057 yy_current_buffer->yy_buf_size + 2];
2058 register char *source =
2059 &yy_current_buffer->yy_ch_buf[number_to_move];
2060
2061 while ( source > yy_current_buffer->yy_ch_buf )
2062 *--dest = *--source;
2063
2064 yy_cp += (int) (dest - source);
2065 yy_bp += (int) (dest - source);
2066 yy_current_buffer->yy_n_chars =
2067 yy_n_chars = yy_current_buffer->yy_buf_size;
2068
2069 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2070 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2071 }
2072
2073 *--yy_cp = (char) c;
2074
2075
2076 yytext_ptr = yy_bp;
2077 yy_hold_char = *yy_cp;
2078 yy_c_buf_p = yy_cp;
2079 }
2080 #endif /* ifndef YY_NO_UNPUT */
2081
2082
2083 #ifdef __cplusplus
2084 static int yyinput()
2085 #else
2086 static int input()
2087 #endif
2088 {
2089 int c;
2090
2091 *yy_c_buf_p = yy_hold_char;
2092
2093 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2094 {
2095 /* yy_c_buf_p now points to the character we want to return.
2096 * If this occurs *before* the EOB characters, then it's a
2097 * valid NUL; if not, then we've hit the end of the buffer.
2098 */
2099 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2100 /* This was really a NUL. */
2101 *yy_c_buf_p = '\0';
2102
2103 else
2104 { /* need more input */
2105 int offset = yy_c_buf_p - yytext_ptr;
2106 ++yy_c_buf_p;
2107
2108 switch ( yy_get_next_buffer() )
2109 {
2110 case EOB_ACT_LAST_MATCH:
2111 /* This happens because yy_g_n_b()
2112 * sees that we've accumulated a
2113 * token and flags that we need to
2114 * try matching the token before
2115 * proceeding. But for input(),
2116 * there's no matching to consider.
2117 * So convert the EOB_ACT_LAST_MATCH
2118 * to EOB_ACT_END_OF_FILE.
2119 */
2120
2121 /* Reset buffer status. */
2122 yyrestart( yyin );
2123
2124 /* fall through */
2125
2126 case EOB_ACT_END_OF_FILE:
2127 {
2128 if ( yywrap() )
2129 return EOF;
2130
2131 if ( ! yy_did_buffer_switch_on_eof )
2132 YY_NEW_FILE;
2133 #ifdef __cplusplus
2134 return yyinput();
2135 #else
2136 return input();
2137 #endif
2138 }
2139
2140 case EOB_ACT_CONTINUE_SCAN:
2141 yy_c_buf_p = yytext_ptr + offset;
2142 break;
2143 }
2144 }
2145 }
2146
2147 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
2148 *yy_c_buf_p = '\0'; /* preserve yytext */
2149 yy_hold_char = *++yy_c_buf_p;
2150
2151
2152 return c;
2153 }
2154
2155
2156 #ifdef YY_USE_PROTOS
2157 void yyrestart( FILE *input_file )
2158 #else
2159 void yyrestart( input_file )
2160 FILE *input_file;
2161 #endif
2162 {
2163 if ( ! yy_current_buffer )
2164 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2165
2166 yy_init_buffer( yy_current_buffer, input_file );
2167 yy_load_buffer_state();
2168 }
2169
2170
2171 #ifdef YY_USE_PROTOS
2172 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2173 #else
2174 void yy_switch_to_buffer( new_buffer )
2175 YY_BUFFER_STATE new_buffer;
2176 #endif
2177 {
2178 if ( yy_current_buffer == new_buffer )
2179 return;
2180
2181 if ( yy_current_buffer )
2182 {
2183 /* Flush out information for old buffer. */
2184 *yy_c_buf_p = yy_hold_char;
2185 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2186 yy_current_buffer->yy_n_chars = yy_n_chars;
2187 }
2188
2189 yy_current_buffer = new_buffer;
2190 yy_load_buffer_state();
2191
2192 /* We don't actually know whether we did this switch during
2193 * EOF (yywrap()) processing, but the only time this flag
2194 * is looked at is after yywrap() is called, so it's safe
2195 * to go ahead and always set it.
2196 */
2197 yy_did_buffer_switch_on_eof = 1;
2198 }
2199
2200
2201 #ifdef YY_USE_PROTOS
2202 void yy_load_buffer_state( void )
2203 #else
2204 void yy_load_buffer_state()
2205 #endif
2206 {
2207 yy_n_chars = yy_current_buffer->yy_n_chars;
2208 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2209 yyin = yy_current_buffer->yy_input_file;
2210 yy_hold_char = *yy_c_buf_p;
2211 }
2212
2213
2214 #ifdef YY_USE_PROTOS
2215 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2216 #else
2217 YY_BUFFER_STATE yy_create_buffer( file, size )
2218 FILE *file;
2219 int size;
2220 #endif
2221 {
2222 YY_BUFFER_STATE b;
2223
2224 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2225 if ( ! b )
2226 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2227
2228 b->yy_buf_size = size;
2229
2230 /* yy_ch_buf has to be 2 characters longer than the size given because
2231 * we need to put in 2 end-of-buffer characters.
2232 */
2233 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2234 if ( ! b->yy_ch_buf )
2235 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2236
2237 b->yy_is_our_buffer = 1;
2238
2239 yy_init_buffer( b, file );
2240
2241 return b;
2242 }
2243
2244
2245 #ifdef YY_USE_PROTOS
2246 void yy_delete_buffer( YY_BUFFER_STATE b )
2247 #else
2248 void yy_delete_buffer( b )
2249 YY_BUFFER_STATE b;
2250 #endif
2251 {
2252 if ( ! b )
2253 return;
2254
2255 if ( b == yy_current_buffer )
2256 yy_current_buffer = (YY_BUFFER_STATE) 0;
2257
2258 if ( b->yy_is_our_buffer )
2259 yy_flex_free( (void *) b->yy_ch_buf );
2260
2261 yy_flex_free( (void *) b );
2262 }
2263
2264
2265 #ifndef YY_ALWAYS_INTERACTIVE
2266 #ifndef YY_NEVER_INTERACTIVE
2267 extern int isatty YY_PROTO(( int ));
2268 #endif
2269 #endif
2270
2271 #ifdef YY_USE_PROTOS
2272 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2273 #else
2274 void yy_init_buffer( b, file )
2275 YY_BUFFER_STATE b;
2276 FILE *file;
2277 #endif
2278
2279
2280 {
2281 yy_flush_buffer( b );
2282
2283 b->yy_input_file = file;
2284 b->yy_fill_buffer = 1;
2285
2286 #if YY_ALWAYS_INTERACTIVE
2287 b->yy_is_interactive = 1;
2288 #else
2289 #if YY_NEVER_INTERACTIVE
2290 b->yy_is_interactive = 0;
2291 #else
2292 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2293 #endif
2294 #endif
2295 }
2296
2297
2298 #ifdef YY_USE_PROTOS
2299 void yy_flush_buffer( YY_BUFFER_STATE b )
2300 #else
2301 void yy_flush_buffer( b )
2302 YY_BUFFER_STATE b;
2303 #endif
2304
2305 {
2306 if ( ! b )
2307 return;
2308
2309 b->yy_n_chars = 0;
2310
2311 /* We always need two end-of-buffer characters. The first causes
2312 * a transition to the end-of-buffer state. The second causes
2313 * a jam in that state.
2314 */
2315 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2316 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2317
2318 b->yy_buf_pos = &b->yy_ch_buf[0];
2319
2320 b->yy_at_bol = 1;
2321 b->yy_buffer_status = YY_BUFFER_NEW;
2322
2323 if ( b == yy_current_buffer )
2324 yy_load_buffer_state();
2325 }
2326
2327
2328 #ifndef YY_NO_SCAN_BUFFER
2329 #ifdef YY_USE_PROTOS
2330 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2331 #else
2332 YY_BUFFER_STATE yy_scan_buffer( base, size )
2333 char *base;
2334 yy_size_t size;
2335 #endif
2336 {
2337 YY_BUFFER_STATE b;
2338
2339 if ( size < 2 ||
2340 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2341 base[size-1] != YY_END_OF_BUFFER_CHAR )
2342 /* They forgot to leave room for the EOB's. */
2343 return 0;
2344
2345 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2346 if ( ! b )
2347 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2348
2349 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2350 b->yy_buf_pos = b->yy_ch_buf = base;
2351 b->yy_is_our_buffer = 0;
2352 b->yy_input_file = 0;
2353 b->yy_n_chars = b->yy_buf_size;
2354 b->yy_is_interactive = 0;
2355 b->yy_at_bol = 1;
2356 b->yy_fill_buffer = 0;
2357 b->yy_buffer_status = YY_BUFFER_NEW;
2358
2359 yy_switch_to_buffer( b );
2360
2361 return b;
2362 }
2363 #endif
2364
2365
2366 #ifndef YY_NO_SCAN_STRING
2367 #ifdef YY_USE_PROTOS
2368 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2369 #else
2370 YY_BUFFER_STATE yy_scan_string( yy_str )
2371 yyconst char *yy_str;
2372 #endif
2373 {
2374 int len;
2375 for ( len = 0; yy_str[len]; ++len )
2376 ;
2377
2378 return yy_scan_bytes( yy_str, len );
2379 }
2380 #endif
2381
2382
2383 #ifndef YY_NO_SCAN_BYTES
2384 #ifdef YY_USE_PROTOS
2385 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2386 #else
2387 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2388 yyconst char *bytes;
2389 int len;
2390 #endif
2391 {
2392 YY_BUFFER_STATE b;
2393 char *buf;
2394 yy_size_t n;
2395 int i;
2396
2397 /* Get memory for full buffer, including space for trailing EOB's. */
2398 n = len + 2;
2399 buf = (char *) yy_flex_alloc( n );
2400 if ( ! buf )
2401 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2402
2403 for ( i = 0; i < len; ++i )
2404 buf[i] = bytes[i];
2405
2406 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2407
2408 b = yy_scan_buffer( buf, n );
2409 if ( ! b )
2410 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2411
2412 /* It's okay to grow etc. this buffer, and we should throw it
2413 * away when we're done.
2414 */
2415 b->yy_is_our_buffer = 1;
2416
2417 return b;
2418 }
2419 #endif
2420
2421
2422 #ifndef YY_NO_PUSH_STATE
2423 #ifdef YY_USE_PROTOS
2424 static void yy_push_state( int new_state )
2425 #else
2426 static void yy_push_state( new_state )
2427 int new_state;
2428 #endif
2429 {
2430 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2431 {
2432 yy_size_t new_size;
2433
2434 yy_start_stack_depth += YY_START_STACK_INCR;
2435 new_size = yy_start_stack_depth * sizeof( int );
2436
2437 if ( ! yy_start_stack )
2438 yy_start_stack = (int *) yy_flex_alloc( new_size );
2439
2440 else
2441 yy_start_stack = (int *) yy_flex_realloc(
2442 (void *) yy_start_stack, new_size );
2443
2444 if ( ! yy_start_stack )
2445 YY_FATAL_ERROR(
2446 "out of memory expanding start-condition stack" );
2447 }
2448
2449 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2450
2451 BEGIN(new_state);
2452 }
2453 #endif
2454
2455
2456 #ifndef YY_NO_POP_STATE
2457 static void yy_pop_state()
2458 {
2459 if ( --yy_start_stack_ptr < 0 )
2460 YY_FATAL_ERROR( "start-condition stack underflow" );
2461
2462 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2463 }
2464 #endif
2465
2466
2467 #ifndef YY_NO_TOP_STATE
2468 static int yy_top_state()
2469 {
2470 return yy_start_stack[yy_start_stack_ptr - 1];
2471 }
2472 #endif
2473
2474 #ifndef YY_EXIT_FAILURE
2475 #define YY_EXIT_FAILURE 2
2476 #endif
2477
2478 #ifdef YY_USE_PROTOS
2479 static void yy_fatal_error( yyconst char msg[] )
2480 #else
2481 static void yy_fatal_error( msg )
2482 char msg[];
2483 #endif
2484 {
2485 (void) fprintf( stderr, "%s\n", msg );
2486 exit( YY_EXIT_FAILURE );
2487 }
2488
2489
2490
2491 /* Redefine yyless() so it works in section 3 code. */
2492
2493 #undef yyless
2494 #define yyless(n) \
2495 do \
2496 { \
2497 /* Undo effects of setting up yytext. */ \
2498 yytext[yyleng] = yy_hold_char; \
2499 yy_c_buf_p = yytext + n; \
2500 yy_hold_char = *yy_c_buf_p; \
2501 *yy_c_buf_p = '\0'; \
2502 yyleng = n; \
2503 } \
2504 while ( 0 )
2505
2506
2507 /* Internal utility routines. */
2508
2509 #ifndef yytext_ptr
2510 #ifdef YY_USE_PROTOS
2511 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2512 #else
2513 static void yy_flex_strncpy( s1, s2, n )
2514 char *s1;
2515 yyconst char *s2;
2516 int n;
2517 #endif
2518 {
2519 register int i;
2520 for ( i = 0; i < n; ++i )
2521 s1[i] = s2[i];
2522 }
2523 #endif
2524
2525 #ifdef YY_NEED_STRLEN
2526 #ifdef YY_USE_PROTOS
2527 static int yy_flex_strlen( yyconst char *s )
2528 #else
2529 static int yy_flex_strlen( s )
2530 yyconst char *s;
2531 #endif
2532 {
2533 register int n;
2534 for ( n = 0; s[n]; ++n )
2535 ;
2536
2537 return n;
2538 }
2539 #endif
2540
2541
2542 #ifdef YY_USE_PROTOS
2543 static void *yy_flex_alloc( yy_size_t size )
2544 #else
2545 static void *yy_flex_alloc( size )
2546 yy_size_t size;
2547 #endif
2548 {
2549 return (void *) malloc( size );
2550 }
2551
2552 #ifdef YY_USE_PROTOS
2553 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2554 #else
2555 static void *yy_flex_realloc( ptr, size )
2556 void *ptr;
2557 yy_size_t size;
2558 #endif
2559 {
2560 /* The cast to (char *) in the following accommodates both
2561 * implementations that use char* generic pointers, and those
2562 * that use void* generic pointers. It works with the latter
2563 * because both ANSI C and C++ allow castless assignment from
2564 * any pointer type to void*, and deal with argument conversions
2565 * as though doing an assignment.
2566 */
2567 return (void *) realloc( (char *) ptr, size );
2568 }
2569
2570 #ifdef YY_USE_PROTOS
2571 static void yy_flex_free( void *ptr )
2572 #else
2573 static void yy_flex_free( ptr )
2574 void *ptr;
2575 #endif
2576 {
2577 free( ptr );
2578 }
2579
2580 #if YY_MAIN
2581 int main()
2582 {
2583 yylex();
2584 return 0;
2585 }
2586 #endif
2587 #line 342 "./ada-lex.l"
2588
2589
2590 #include <ctype.h>
2591 #include <string.h>
2592
2593 /* Initialize the lexer for processing new expression */
2594 void
2595 lexer_init (FILE* inp)
2596 {
2597 BEGIN INITIAL;
2598 yyrestart (inp);
2599 }
2600
2601
2602 /* Make sure that tempbuf points at an array at least N characters long. */
2603
2604 static void
2605 resize_tempbuf (n)
2606 unsigned int n;
2607 {
2608 if (tempbufsize < n)
2609 {
2610 tempbufsize = (n+63) & ~63;
2611 tempbuf = (char*) xrealloc (tempbuf, tempbufsize);
2612 }
2613 }
2614
2615 /* Copy S2 to S1, removing all underscores, and downcasing all letters. */
2616
2617 static void
2618 canonicalizeNumeral (s1,s2)
2619 char* s1;
2620 const char* s2;
2621 {
2622 for (; *s2 != '\000'; s2 += 1)
2623 {
2624 if (*s2 != '_')
2625 {
2626 *s1 = tolower(*s2);
2627 s1 += 1;
2628 }
2629 }
2630 s1[0] = '\000';
2631 }
2632
2633 #define HIGH_BYTE_POSN ((sizeof (ULONGEST) - 1) * HOST_CHAR_BIT)
2634
2635 /* True (non-zero) iff DIGIT is a valid digit in radix BASE,
2636 where 2 <= BASE <= 16. */
2637
2638 static int
2639 is_digit_in_base (digit, base)
2640 unsigned char digit;
2641 int base;
2642 {
2643 if (!isxdigit (digit))
2644 return 0;
2645 if (base <= 10)
2646 return (isdigit (digit) && digit < base + '0');
2647 else
2648 return (isdigit (digit) || tolower (digit) < base - 10 + 'a');
2649 }
2650
2651 static int
2652 digit_to_int (c)
2653 unsigned char c;
2654 {
2655 if (isdigit (c))
2656 return c - '0';
2657 else
2658 return tolower (c) - 'a' + 10;
2659 }
2660
2661 /* As for strtoul, but for ULONGEST results. */
2662 ULONGEST
2663 strtoulst (num, trailer, base)
2664 const char *num;
2665 const char **trailer;
2666 int base;
2667 {
2668 unsigned int high_part;
2669 ULONGEST result;
2670 int i;
2671 unsigned char lim;
2672
2673 if (base < 2 || base > 16)
2674 {
2675 errno = EINVAL;
2676 return 0;
2677 }
2678 lim = base - 1 + '0';
2679
2680 result = high_part = 0;
2681 for (i = 0; is_digit_in_base (num[i], base); i += 1)
2682 {
2683 result = result*base + digit_to_int (num[i]);
2684 high_part = high_part*base + (unsigned int) (result >> HIGH_BYTE_POSN);
2685 result &= ((ULONGEST) 1 << HIGH_BYTE_POSN) - 1;
2686 if (high_part > 0xff)
2687 {
2688 errno = ERANGE;
2689 result = high_part = 0;
2690 break;
2691 }
2692 }
2693
2694 if (trailer != NULL)
2695 *trailer = &num[i];
2696
2697 return result + ((ULONGEST) high_part << HIGH_BYTE_POSN);
2698 }
2699
2700
2701
2702 /* Interprets the prefix of NUM that consists of digits of the given BASE
2703 as an integer of that BASE, with the string EXP as an exponent.
2704 Puts value in yylval, and returns INT, if the string is valid. Causes
2705 an error if the number is improperly formated. BASE, if NULL, defaults
2706 to "10", and EXP to "1". The EXP does not contain a leading 'e' or 'E'. */
2707
2708 static int
2709 processInt (base0, num0, exp0)
2710 const char* num0;
2711 const char* base0;
2712 const char* exp0;
2713 {
2714 ULONGEST result;
2715 long exp;
2716 int base;
2717
2718 char* trailer;
2719
2720 if (base0 == NULL)
2721 base = 10;
2722 else
2723 {
2724 base = strtol (base0, (char**) NULL, 10);
2725 if (base < 2 || base > 16)
2726 error ("Invalid base: %d.", base);
2727 }
2728
2729 if (exp0 == NULL)
2730 exp = 0;
2731 else
2732 exp = strtol(exp0, (char**) NULL, 10);
2733
2734 errno = 0;
2735 result = strtoulst (num0, &trailer, base);
2736 if (errno == ERANGE)
2737 error ("Integer literal out of range");
2738 if (isxdigit(*trailer))
2739 error ("Invalid digit `%c' in based literal", *trailer);
2740
2741 while (exp > 0)
2742 {
2743 if (result > (ULONG_MAX / base))
2744 error ("Integer literal out of range");
2745 result *= base;
2746 exp -= 1;
2747 }
2748
2749 if ((result >> (TARGET_INT_BIT-1)) == 0)
2750 yylval.typed_val.type = builtin_type_ada_int;
2751 else if ((result >> (TARGET_LONG_BIT-1)) == 0)
2752 yylval.typed_val.type = builtin_type_ada_long;
2753 else if (((result >> (TARGET_LONG_BIT-1)) >> 1) == 0)
2754 {
2755 /* We have a number representable as an unsigned integer quantity.
2756 For consistency with the C treatment, we will treat it as an
2757 anonymous modular (unsigned) quantity. Alas, the types are such
2758 that we need to store .val as a signed quantity. Sorry
2759 for the mess, but C doesn't officially guarantee that a simple
2760 assignment does the trick (no, it doesn't; read the reference manual).
2761 */
2762 yylval.typed_val.type = builtin_type_unsigned_long;
2763 if (result & LONGEST_SIGN)
2764 yylval.typed_val.val =
2765 (LONGEST) (result & ~LONGEST_SIGN)
2766 - (LONGEST_SIGN>>1) - (LONGEST_SIGN>>1);
2767 else
2768 yylval.typed_val.val = (LONGEST) result;
2769 return INT;
2770 }
2771 else
2772 yylval.typed_val.type = builtin_type_ada_long_long;
2773
2774 yylval.typed_val.val = (LONGEST) result;
2775 return INT;
2776 }
2777
2778 static int
2779 processReal (num0)
2780 const char* num0;
2781 {
2782 if (sizeof (DOUBLEST) <= sizeof (float))
2783 sscanf (num0, "%g", &yylval.typed_val_float.dval);
2784 else if (sizeof (DOUBLEST) <= sizeof (double))
2785 sscanf (num0, "%lg", &yylval.typed_val_float.dval);
2786 else
2787 {
2788 #ifdef PRINTF_HAS_LONG_DOUBLE
2789 sscanf (num0, "%Lg", &yylval.typed_val_float.dval);
2790 #else
2791 /* Scan it into a double, then convert and assign it to the
2792 long double. This at least wins with values representable
2793 in the range of doubles. */
2794 double temp;
2795 sscanf (num0, "%lg", &temp);
2796 yylval.typed_val_float.dval = temp;
2797 #endif
2798 }
2799
2800 yylval.typed_val_float.type = builtin_type_ada_float;
2801 if (sizeof(DOUBLEST) >= TARGET_DOUBLE_BIT / TARGET_CHAR_BIT)
2802 yylval.typed_val_float.type = builtin_type_ada_double;
2803 if (sizeof(DOUBLEST) >= TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT)
2804 yylval.typed_val_float.type = builtin_type_ada_long_double;
2805
2806 return FLOAT;
2807 }
2808
2809 static int
2810 processId (name0, len)
2811 const char *name0;
2812 int len;
2813 {
2814 char* name = xmalloc (len + 11);
2815 int i0, i;
2816
2817 /* add_name_string_cleanup (name); */
2818 /* FIXME: add_name_string_cleanup should be defined in parse.c */
2819 while (len > 0 && isspace (name0[len-1]))
2820 len -= 1;
2821 i = i0 = 0;
2822 while (i0 < len)
2823 {
2824 if (isalnum (name0[i0]))
2825 {
2826 name[i] = tolower (name0[i0]);
2827 i += 1; i0 += 1;
2828 }
2829 else switch (name0[i0])
2830 {
2831 default:
2832 name[i] = name0[i0];
2833 i += 1; i0 += 1;
2834 break;
2835 case ' ': case '\t':
2836 i0 += 1;
2837 break;
2838 case '\'':
2839 i0 += 1;
2840 while (i0 < len && name0[i0] != '\'')
2841 {
2842 name[i] = name0[i0];
2843 i += 1; i0 += 1;
2844 }
2845 i0 += 1;
2846 break;
2847 case '<':
2848 i0 += 1;
2849 while (i0 < len && name0[i0] != '>')
2850 {
2851 name[i] = name0[i0];
2852 i += 1; i0 += 1;
2853 }
2854 i0 += 1;
2855 break;
2856 }
2857 }
2858 name[i] = '\000';
2859
2860 yylval.ssym.sym = NULL;
2861 yylval.ssym.stoken.ptr = name;
2862 yylval.ssym.stoken.length = i;
2863 return NAME;
2864 }
2865
2866 static void
2867 block_lookup (name, err_name)
2868 char* name;
2869 char* err_name;
2870 {
2871 struct symbol** syms;
2872 struct block** blocks;
2873 int nsyms;
2874 struct symtab *symtab;
2875 nsyms = ada_lookup_symbol_list (name, left_block_context,
2876 VAR_NAMESPACE, &syms, &blocks);
2877 if (left_block_context == NULL &&
2878 (nsyms == 0 || SYMBOL_CLASS (syms[0]) != LOC_BLOCK))
2879 symtab = lookup_symtab (name);
2880 else
2881 symtab = NULL;
2882
2883 if (symtab != NULL)
2884 left_block_context = yylval.bval =
2885 BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
2886 else if (nsyms == 0 || SYMBOL_CLASS (syms[0]) != LOC_BLOCK)
2887 {
2888 if (left_block_context == NULL)
2889 error ("No file or function \"%s\".", err_name);
2890 else
2891 error ("No function \"%s\" in specified context.", err_name);
2892 }
2893 else
2894 {
2895 left_block_context = yylval.bval = SYMBOL_BLOCK_VALUE (syms[0]);
2896 if (nsyms > 1)
2897 warning ("Function name \"%s\" ambiguous here", err_name);
2898 }
2899 }
2900
2901 /* Look up NAME0 (assumed to be mangled) as a name in VAR_NAMESPACE,
2902 setting *TOKEN_TYPE to NAME or TYPENAME, depending on what is
2903 found. Try first the entire name, then the name without the last
2904 segment (i.e., after the last .id), etc., and return the number of
2905 segments that had to be removed to get a match. Calls error if no
2906 matches are found, using ERR_NAME in any error message. When
2907 exactly one symbol match is found, it is placed in yylval. */
2908
2909 static int
2910 name_lookup (name0, err_name, token_type)
2911 char* name0;
2912 char* err_name;
2913 int* token_type;
2914 {
2915 struct symbol** syms;
2916 struct block** blocks;
2917 struct type* type;
2918 int len0 = strlen (name0);
2919 char* name = savestring (name0, len0);
2920 int nsyms;
2921 int segments;
2922
2923 /* add_name_string_cleanup (name);*/
2924 /* FIXME: add_name_string_cleanup should be defined in parse.c */
2925 yylval.ssym.stoken.ptr = name;
2926 yylval.ssym.stoken.length = strlen (name);
2927 for (segments = 0; ; segments += 1)
2928 {
2929 struct type* preferred_type;
2930 int i, preferred_index;
2931
2932 if (left_block_context == NULL)
2933 nsyms = ada_lookup_symbol_list (name, expression_context_block,
2934 VAR_NAMESPACE, &syms, &blocks);
2935 else
2936 nsyms = ada_lookup_symbol_list (name, left_block_context,
2937 VAR_NAMESPACE, &syms, &blocks);
2938
2939 /* Check for a type definition. */
2940
2941 /* Look for a symbol that doesn't denote void. This is (I think) a */
2942 /* temporary kludge to get around problems in GNAT output. */
2943 preferred_index = -1; preferred_type = NULL;
2944 for (i = 0; i < nsyms; i += 1)
2945 switch (SYMBOL_CLASS (syms[i]))
2946 {
2947 case LOC_TYPEDEF:
2948 if (ada_prefer_type (SYMBOL_TYPE (syms[i]), preferred_type))
2949 {
2950 preferred_index = i;
2951 preferred_type = SYMBOL_TYPE (syms[i]);
2952 }
2953 break;
2954 case LOC_REGISTER:
2955 case LOC_ARG:
2956 case LOC_REF_ARG:
2957 case LOC_REGPARM:
2958 case LOC_REGPARM_ADDR:
2959 case LOC_LOCAL:
2960 case LOC_LOCAL_ARG:
2961 case LOC_BASEREG:
2962 case LOC_BASEREG_ARG:
2963 goto NotType;
2964 default:
2965 break;
2966 }
2967 if (preferred_type != NULL)
2968 {
2969 /* if (TYPE_CODE (preferred_type) == TYPE_CODE_VOID)
2970 error ("`%s' matches only void type name(s)",
2971 ada_demangle (name));
2972 */
2973 /* FIXME: ada_demangle should be defined in defs.h, and is located in ada-lang.c */
2974 /* else*/ if (ada_is_object_renaming (syms[preferred_index]))
2975 {
2976 yylval.ssym.sym = syms[preferred_index];
2977 *token_type = OBJECT_RENAMING;
2978 return segments;
2979 }
2980 else if (ada_renaming_type (SYMBOL_TYPE (syms[preferred_index]))
2981 != NULL)
2982 {
2983 int result;
2984 const char* renaming =
2985 ada_simple_renamed_entity (syms[preferred_index]);
2986 char* new_name = xmalloc (strlen (renaming) + len0
2987 - yylval.ssym.stoken.length + 1);
2988 /* add_name_string_cleanup (new_name);*/
2989 /* FIXME: add_name_string_cleanup should be defined in parse.c */
2990 strcpy (new_name, renaming);
2991 strcat (new_name, name0 + yylval.ssym.stoken.length);
2992 result = name_lookup (new_name, err_name, token_type);
2993 if (result > segments)
2994 error ("Confused by renamed symbol.");
2995 return result;
2996 }
2997 else if (segments == 0)
2998 {
2999 yylval.tval = preferred_type;
3000 *token_type = TYPENAME;
3001 return 0;
3002 }
3003 }
3004
3005 if (segments == 0)
3006 {
3007 type = lookup_primitive_typename (name);
3008 if (type == NULL && STREQ ("system__address", name))
3009 type = builtin_type_ada_system_address;
3010 if (type != NULL)
3011 {
3012 yylval.tval = type;
3013 *token_type = TYPENAME;
3014 return 0;
3015 }
3016 }
3017
3018 NotType:
3019 if (nsyms == 1)
3020 {
3021 *token_type = NAME;
3022 yylval.ssym.sym = syms[0];
3023 yylval.ssym.msym = NULL;
3024 yylval.ssym.block = blocks[0];
3025 return segments;
3026 }
3027 else if (nsyms == 0) {
3028 int i;
3029 yylval.ssym.msym = ada_lookup_minimal_symbol (name);
3030 if (yylval.ssym.msym != NULL)
3031 {
3032 yylval.ssym.sym = NULL;
3033 yylval.ssym.block = NULL;
3034 *token_type = NAME;
3035 return segments;
3036 }
3037
3038 for (i = yylval.ssym.stoken.length - 1; i > 0; i -= 1)
3039 {
3040 if (name[i] == '.')
3041 {
3042 name[i] = '\0';
3043 yylval.ssym.stoken.length = i;
3044 break;
3045 }
3046 else if (name[i] == '_' && name[i-1] == '_')
3047 {
3048 i -= 1;
3049 name[i] = '\0';
3050 yylval.ssym.stoken.length = i;
3051 break;
3052 }
3053 }
3054 if (i <= 0)
3055 {
3056 if (!have_full_symbols () && !have_partial_symbols ()
3057 && left_block_context == NULL)
3058 error ("No symbol table is loaded. Use the \"file\" command.");
3059 if (left_block_context == NULL)
3060 error ("No definition of \"%s\" in current context.",
3061 err_name);
3062 else
3063 error ("No definition of \"%s\" in specified context.",
3064 err_name);
3065 }
3066 }
3067 else
3068 {
3069 *token_type = NAME;
3070 yylval.ssym.sym = NULL;
3071 yylval.ssym.msym = NULL;
3072 if (left_block_context == NULL)
3073 yylval.ssym.block = expression_context_block;
3074 else
3075 yylval.ssym.block = left_block_context;
3076 return segments;
3077 }
3078 }
3079 }
3080
3081 /* Returns the position within STR of the '.' in a
3082 '.{WHITE}*all' component of a dotted name, or -1 if there is none. */
3083 static int
3084 find_dot_all (str)
3085 const char* str;
3086 {
3087 int i;
3088 for (i = 0; str[i] != '\000'; i += 1)
3089 {
3090 if (str[i] == '.')
3091 {
3092 int i0 = i;
3093 do
3094 i += 1;
3095 while (isspace (str[i]));
3096 if (strcmp (str+i, "all") == 0
3097 && ! isalnum (str[i+3]) && str[i+3] != '_')
3098 return i0;
3099 }
3100 }
3101 return -1;
3102 }
3103
3104 /* Returns non-zero iff string SUBSEQ matches a subsequence of STR, ignoring
3105 case. */
3106
3107 static int
3108 subseqMatch (subseq, str)
3109 const char* subseq;
3110 const char* str;
3111 {
3112 if (subseq[0] == '\0')
3113 return 1;
3114 else if (str[0] == '\0')
3115 return 0;
3116 else if (tolower (subseq[0]) == tolower (str[0]))
3117 return subseqMatch (subseq+1, str+1) || subseqMatch (subseq, str+1);
3118 else
3119 return subseqMatch (subseq, str+1);
3120 }
3121
3122
3123 static struct { const char* name; int code; }
3124 attributes[] = {
3125 { "address", TICK_ADDRESS },
3126 { "unchecked_access", TICK_ACCESS },
3127 { "unrestricted_access", TICK_ACCESS },
3128 { "access", TICK_ACCESS },
3129 { "first", TICK_FIRST },
3130 { "last", TICK_LAST },
3131 { "length", TICK_LENGTH },
3132 { "max", TICK_MAX },
3133 { "min", TICK_MIN },
3134 { "modulus", TICK_MODULUS },
3135 { "pos", TICK_POS },
3136 { "range", TICK_RANGE },
3137 { "size", TICK_SIZE },
3138 { "tag", TICK_TAG },
3139 { "val", TICK_VAL },
3140 { NULL, -1 }
3141 };
3142
3143 /* Return the syntactic code corresponding to the attribute name or
3144 abbreviation STR. */
3145
3146 static int
3147 processAttribute (str)
3148 const char* str;
3149 {
3150 int i, k;
3151
3152 for (i = 0; attributes[i].code != -1; i += 1)
3153 if (strcasecmp (str, attributes[i].name) == 0)
3154 return attributes[i].code;
3155
3156 for (i = 0, k = -1; attributes[i].code != -1; i += 1)
3157 if (subseqMatch (str, attributes[i].name))
3158 {
3159 if (k == -1)
3160 k = i;
3161 else
3162 error ("ambiguous attribute name: `%s'", str);
3163 }
3164 if (k == -1)
3165 error ("unrecognized attribute: `%s'", str);
3166
3167 return attributes[k].code;
3168 }
3169
3170 int
3171 yywrap()
3172 {
3173 return 1;
3174 }
This page took 0.452653 seconds and 4 git commands to generate.