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