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