1
2 #line 3 "command_lexer.cpp"
3
4 #define YY_INT_ALIGNED short int
5
6 /* A lexical scanner generated by flex */
7
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 6
11 #define YY_FLEX_SUBMINOR_VERSION 0
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
15
16 /* First, we deal with platform-specific or compiler-specific issues. */
17
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
23
24 /* end standard C headers. */
25
26 /* flex integer type definitions */
27
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
30
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
37 */
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
40 #endif
41
42 #include <inttypes.h>
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
49 #else
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
56
57 /* Limits of integral types. */
58 #ifndef INT8_MIN
59 #define INT8_MIN (-128)
60 #endif
61 #ifndef INT16_MIN
62 #define INT16_MIN (-32767-1)
63 #endif
64 #ifndef INT32_MIN
65 #define INT32_MIN (-2147483647-1)
66 #endif
67 #ifndef INT8_MAX
68 #define INT8_MAX (127)
69 #endif
70 #ifndef INT16_MAX
71 #define INT16_MAX (32767)
72 #endif
73 #ifndef INT32_MAX
74 #define INT32_MAX (2147483647)
75 #endif
76 #ifndef UINT8_MAX
77 #define UINT8_MAX (255U)
78 #endif
79 #ifndef UINT16_MAX
80 #define UINT16_MAX (65535U)
81 #endif
82 #ifndef UINT32_MAX
83 #define UINT32_MAX (4294967295U)
84 #endif
85
86 #endif /* ! C99 */
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 #ifdef __ia64__
145 /* On IA-64, the buffer size is 16k, not 8k.
146 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
147 * Ditto for the __ia64__ case accordingly.
148 */
149 #define YY_BUF_SIZE 32768
150 #else
151 #define YY_BUF_SIZE 16384
152 #endif /* __ia64__ */
153 #endif
154
155 /* The state buf must be large enough to hold one state per character in the main buffer.
156 */
157 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
158
159 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
160 #define YY_TYPEDEF_YY_BUFFER_STATE
161 typedef struct yy_buffer_state *YY_BUFFER_STATE;
162 #endif
163
164 #ifndef YY_TYPEDEF_YY_SIZE_T
165 #define YY_TYPEDEF_YY_SIZE_T
166 typedef size_t yy_size_t;
167 #endif
168
169 extern yy_size_t yyleng;
170
171 extern FILE *yyin, *yyout;
172
173 #define EOB_ACT_CONTINUE_SCAN 0
174 #define EOB_ACT_END_OF_FILE 1
175 #define EOB_ACT_LAST_MATCH 2
176
177 #define YY_LESS_LINENO(n)
178 #define YY_LINENO_REWIND_TO(ptr)
179
180 /* Return all but the first "n" matched characters back to the input stream. */
181 #define yyless(n) \
182 do \
183 { \
184 /* Undo effects of setting up yytext. */ \
185 int yyless_macro_arg = (n); \
186 YY_LESS_LINENO(yyless_macro_arg);\
187 *yy_cp = (yy_hold_char); \
188 YY_RESTORE_YY_MORE_OFFSET \
189 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
190 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
191 } \
192 while ( 0 )
193
194 #define unput(c) yyunput( c, (yytext_ptr) )
195
196 #ifndef YY_STRUCT_YY_BUFFER_STATE
197 #define YY_STRUCT_YY_BUFFER_STATE
198 struct yy_buffer_state
199 {
200 FILE *yy_input_file;
201
202 char *yy_ch_buf; /* input buffer */
203 char *yy_buf_pos; /* current position in input buffer */
204
205 /* Size of input buffer in bytes, not including room for EOB
206 * characters.
207 */
208 yy_size_t yy_buf_size;
209
210 /* Number of characters read into yy_ch_buf, not including EOB
211 * characters.
212 */
213 int yy_n_chars;
214
215 /* Whether we "own" the buffer - i.e., we know we created it,
216 * and can realloc() it to grow it, and should free() it to
217 * delete it.
218 */
219 int yy_is_our_buffer;
220
221 /* Whether this is an "interactive" input source; if so, and
222 * if we're using stdio for input, then we want to use getc()
223 * instead of fread(), to make sure we stop fetching input after
224 * each newline.
225 */
226 int yy_is_interactive;
227
228 /* Whether we're considered to be at the beginning of a line.
229 * If so, '^' rules will be active on the next match, otherwise
230 * not.
231 */
232 int yy_at_bol;
233
234 int yy_bs_lineno; /**< The line count. */
235 int yy_bs_column; /**< The column count. */
236
237 /* Whether to try to fill the input buffer when we reach the
238 * end of it.
239 */
240 int yy_fill_buffer;
241
242 int yy_buffer_status;
243
244 #define YY_BUFFER_NEW 0
245 #define YY_BUFFER_NORMAL 1
246 /* When an EOF's been seen but there's still some text to process
247 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
248 * shouldn't try reading from the input source any more. We might
249 * still have a bunch of tokens to match, though, because of
250 * possible backing-up.
251 *
252 * When we actually see the EOF, we change the status to "new"
253 * (via yyrestart()), so that the user can continue scanning by
254 * just pointing yyin at a new input file.
255 */
256 #define YY_BUFFER_EOF_PENDING 2
257
258 };
259 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
260
261 /* Stack of input buffers. */
262 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
263 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
264 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
265
266 /* We provide macros for accessing buffer states in case in the
267 * future we want to put the buffer states in a more general
268 * "scanner state".
269 *
270 * Returns the top of the stack, or NULL.
271 */
272 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
273 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
274 : NULL)
275
276 /* Same as previous macro, but useful when we know that the buffer stack is not
277 * NULL or when we need an lvalue. For internal use only.
278 */
279 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
280
281 /* yy_hold_char holds the character lost when yytext is formed. */
282 static char yy_hold_char;
283 static int yy_n_chars; /* number of characters read into yy_ch_buf */
284 yy_size_t yyleng;
285
286 /* Points to current character in buffer. */
287 static char *yy_c_buf_p = (char *) 0;
288 static int yy_init = 0; /* whether we need to initialize */
289 static int yy_start = 0; /* start state number */
290
291 /* Flag which is used to allow yywrap()'s to do buffer switches
292 * instead of setting up a fresh yyin. A bit of a hack ...
293 */
294 static int yy_did_buffer_switch_on_eof;
295
296 void yyrestart (FILE *input_file );
297 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
298 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
299 void yy_delete_buffer (YY_BUFFER_STATE b );
300 void yy_flush_buffer (YY_BUFFER_STATE b );
301 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
302 void yypop_buffer_state (void );
303
304 static void yyensure_buffer_stack (void );
305 static void yy_load_buffer_state (void );
306 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
307
308 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
309
310 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
311 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
312 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
313
314 void *yyalloc (yy_size_t );
315 void *yyrealloc (void *,yy_size_t );
316 void yyfree (void * );
317
318 #define yy_new_buffer yy_create_buffer
319
320 #define yy_set_interactive(is_interactive) \
321 { \
322 if ( ! YY_CURRENT_BUFFER ){ \
323 yyensure_buffer_stack (); \
324 YY_CURRENT_BUFFER_LVALUE = \
325 yy_create_buffer(yyin,YY_BUF_SIZE ); \
326 } \
327 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
328 }
329
330 #define yy_set_bol(at_bol) \
331 { \
332 if ( ! YY_CURRENT_BUFFER ){\
333 yyensure_buffer_stack (); \
334 YY_CURRENT_BUFFER_LVALUE = \
335 yy_create_buffer(yyin,YY_BUF_SIZE ); \
336 } \
337 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
338 }
339
340 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
341
342 /* Begin user sect3 */
343
344 #define yywrap() (/*CONSTCOND*/1)
345 #define YY_SKIP_YYWRAP
346
347 typedef unsigned char YY_CHAR;
348
349 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
350
351 typedef int yy_state_type;
352
353 extern int yylineno;
354
355 int yylineno = 1;
356
357 extern char *yytext;
358 #ifdef yytext_ptr
359 #undef yytext_ptr
360 #endif
361 #define yytext_ptr yytext
362
363 static yy_state_type yy_get_previous_state (void );
364 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
365 static int yy_get_next_buffer (void );
366 #if defined(__GNUC__) && __GNUC__ >= 3
367 __attribute__((__noreturn__))
368 #endif
369 static void yy_fatal_error (yyconst char msg[] );
370
371 /* Done after the current pattern has been matched and before the
372 * corresponding action - sets up yytext.
373 */
374 #define YY_DO_BEFORE_ACTION \
375 (yytext_ptr) = yy_bp; \
376 yyleng = (size_t) (yy_cp - yy_bp); \
377 (yy_hold_char) = *yy_cp; \
378 *yy_cp = '\0'; \
379 (yy_c_buf_p) = yy_cp;
380
381 #define YY_NUM_RULES 18
382 #define YY_END_OF_BUFFER 19
383 /* This struct is not used in this scanner,
384 but its presence is necessary. */
385 struct yy_trans_info
386 {
387 flex_int32_t yy_verify;
388 flex_int32_t yy_nxt;
389 };
390 static yyconst flex_int16_t yy_accept[58] =
391 { 0,
392 0, 0, 0, 0, 19, 14, 13, 12, 12, 14,
393 1, 14, 11, 7, 10, 14, 9, 6, 6, 6,
394 6, 6, 17, 16, 15, 15, 18, 12, 0, 8,
395 0, 1, 7, 0, 0, 6, 6, 6, 0, 6,
396 6, 6, 6, 6, 17, 15, 6, 6, 6, 3,
397 6, 4, 6, 6, 5, 2, 0
398 } ;
399
400 static yyconst YY_CHAR yy_ec[256] =
401 { 0,
402 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
403 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 5, 6, 7, 8, 1, 1, 1, 1, 1,
406 1, 1, 9, 10, 9, 1, 1, 11, 11, 11,
407 11, 11, 11, 11, 11, 11, 11, 1, 12, 13,
408 14, 15, 1, 1, 16, 16, 16, 16, 16, 16,
409 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
410 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
411 1, 17, 1, 1, 16, 1, 18, 19, 20, 21,
412
413 22, 16, 16, 16, 23, 16, 16, 16, 24, 25,
414 26, 16, 16, 27, 28, 29, 30, 16, 16, 16,
415 16, 16, 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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423
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, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1
430 } ;
431
432 static yyconst YY_CHAR yy_meta[31] =
433 { 0,
434 1, 2, 3, 2, 2, 4, 1, 1, 1, 1,
435 5, 1, 4, 1, 1, 4, 1, 4, 4, 4,
436 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
437 } ;
438
439 static yyconst flex_uint16_t yy_base[64] =
440 { 0,
441 0, 0, 29, 33, 140, 141, 141, 135, 135, 32,
442 0, 126, 141, 125, 141, 49, 141, 34, 74, 23,
443 20, 58, 0, 141, 141, 132, 141, 141, 75, 141,
444 131, 0, 122, 0, 0, 78, 141, 109, 0, 106,
445 63, 70, 66, 71, 0, 141, 105, 75, 21, 99,
446 78, 85, 79, 80, 84, 83, 141, 109, 114, 119,
447 121, 126, 100
448 } ;
449
450 static yyconst flex_int16_t yy_def[64] =
451 { 0,
452 57, 1, 58, 58, 57, 57, 57, 57, 57, 59,
453 60, 57, 57, 57, 57, 57, 57, 61, 61, 19,
454 19, 19, 62, 57, 57, 57, 57, 57, 59, 57,
455 59, 60, 57, 16, 16, 63, 57, 19, 16, 19,
456 19, 19, 19, 19, 62, 57, 19, 19, 19, 19,
457 19, 19, 19, 19, 19, 19, 0, 57, 57, 57,
458 57, 57, 57
459 } ;
460
461 static yyconst flex_uint16_t yy_nxt[172] =
462 { 0,
463 6, 7, 8, 9, 7, 6, 10, 11, 12, 13,
464 14, 15, 16, 17, 6, 18, 6, 18, 19, 18,
465 18, 18, 18, 20, 18, 18, 18, 21, 18, 22,
466 24, 25, 26, 27, 24, 25, 26, 27, 30, 37,
467 42, 43, 40, 40, 38, 40, 39, 53, 31, 34,
468 34, 34, 34, 34, 34, 34, 34, 34, 34, 35,
469 34, 34, 34, 36, 35, 34, 35, 35, 35, 35,
470 35, 35, 35, 35, 35, 35, 35, 35, 35, 37,
471 40, 30, 44, 37, 38, 40, 39, 48, 40, 49,
472 39, 31, 40, 40, 50, 52, 41, 40, 51, 54,
473
474 40, 40, 40, 47, 55, 40, 40, 40, 56, 23,
475 23, 23, 23, 23, 29, 29, 29, 29, 29, 32,
476 32, 40, 32, 32, 40, 40, 45, 40, 40, 45,
477 45, 40, 33, 57, 46, 33, 33, 28, 28, 57,
478 5, 57, 57, 57, 57, 57, 57, 57, 57, 57,
479 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
480 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
481 57
482 } ;
483
484 static yyconst flex_int16_t yy_chk[172] =
485 { 0,
486 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
487 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
488 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
489 3, 3, 3, 3, 4, 4, 4, 4, 10, 18,
490 20, 21, 21, 49, 18, 20, 18, 49, 10, 16,
491 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
492 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
493 16, 16, 16, 16, 16, 16, 16, 16, 16, 19,
494 22, 29, 22, 36, 19, 41, 19, 41, 43, 42,
495 36, 29, 42, 44, 43, 48, 19, 48, 44, 51,
496
497 51, 53, 54, 63, 53, 56, 55, 52, 54, 58,
498 58, 58, 58, 58, 59, 59, 59, 59, 59, 60,
499 60, 50, 60, 60, 61, 61, 62, 47, 40, 62,
500 62, 38, 33, 31, 26, 14, 12, 9, 8, 5,
501 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
502 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
503 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
504 57
505 } ;
506
507 static yy_state_type yy_last_accepting_state;
508 static char *yy_last_accepting_cpos;
509
510 extern int yy_flex_debug;
511 int yy_flex_debug = 0;
512
513 /* The intent behind this definition is that it'll catch
514 * any uses of REJECT which flex missed.
515 */
516 #define REJECT reject_used_but_not_detected
517 #define yymore() yymore_used_but_not_detected
518 #define YY_MORE_ADJ 0
519 #define YY_RESTORE_YY_MORE_OFFSET
520 char *yytext;
521 #line 1 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
522 #define YY_NO_INPUT 1
523 #line 9 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
524 /* config_lexer.c
525 * --------------
526 * THIS FILE IS GENERATED, DO NOT EDIT
527 */
528
529 #include <string.h>
530 #include "command_lexer.h"
531
get_token(void)532 const char * get_token( void )
533 {
534 return yytext;
535 }
536
537
538 int enter_map_id = 0;
539 /* An identifier used in a map like command */
540
541 #line 542 "command_lexer.cpp"
542
543 #define INITIAL 0
544 #define MAP_ID 1
545
546 #ifndef YY_NO_UNISTD_H
547 /* Special case for "unistd.h", since it is non-ANSI. We include it way
548 * down here because we want the user's section 1 to have been scanned first.
549 * The user has a chance to override it with an option.
550 */
551 #include <unistd.h>
552 #endif
553
554 #ifndef YY_EXTRA_TYPE
555 #define YY_EXTRA_TYPE void *
556 #endif
557
558 static int yy_init_globals (void );
559
560 /* Accessor methods to globals.
561 These are made visible to non-reentrant scanners for convenience. */
562
563 int yylex_destroy (void );
564
565 int yyget_debug (void );
566
567 void yyset_debug (int debug_flag );
568
569 YY_EXTRA_TYPE yyget_extra (void );
570
571 void yyset_extra (YY_EXTRA_TYPE user_defined );
572
573 FILE *yyget_in (void );
574
575 void yyset_in (FILE * _in_str );
576
577 FILE *yyget_out (void );
578
579 void yyset_out (FILE * _out_str );
580
581 yy_size_t yyget_leng (void );
582
583 char *yyget_text (void );
584
585 int yyget_lineno (void );
586
587 void yyset_lineno (int _line_number );
588
589 /* Macros after this point can all be overridden by user definitions in
590 * section 1.
591 */
592
593 #ifndef YY_SKIP_YYWRAP
594 #ifdef __cplusplus
595 extern "C" int yywrap (void );
596 #else
597 extern int yywrap (void );
598 #endif
599 #endif
600
601 #ifndef YY_NO_UNPUT
602
603 #endif
604
605 #ifndef yytext_ptr
606 static void yy_flex_strncpy (char *,yyconst char *,int );
607 #endif
608
609 #ifdef YY_NEED_STRLEN
610 static int yy_flex_strlen (yyconst char * );
611 #endif
612
613 #ifndef YY_NO_INPUT
614
615 #ifdef __cplusplus
616 static int yyinput (void );
617 #else
618 static int input (void );
619 #endif
620
621 #endif
622
623 /* Amount of stuff to slurp up with each read. */
624 #ifndef YY_READ_BUF_SIZE
625 #ifdef __ia64__
626 /* On IA-64, the buffer size is 16k, not 8k */
627 #define YY_READ_BUF_SIZE 16384
628 #else
629 #define YY_READ_BUF_SIZE 8192
630 #endif /* __ia64__ */
631 #endif
632
633 /* Copy whatever the last rule matched to the standard output. */
634 #ifndef ECHO
635 /* This used to be an fputs(), but since the string might contain NUL's,
636 * we now use fwrite().
637 */
638 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
639 #endif
640
641 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
642 * is returned in "result".
643 */
644 #ifndef YY_INPUT
645 #define YY_INPUT(buf,result,max_size) \
646 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
647 { \
648 int c = '*'; \
649 size_t n; \
650 for ( n = 0; n < max_size && \
651 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
652 buf[n] = (char) c; \
653 if ( c == '\n' ) \
654 buf[n++] = (char) c; \
655 if ( c == EOF && ferror( yyin ) ) \
656 YY_FATAL_ERROR( "input in flex scanner failed" ); \
657 result = n; \
658 } \
659 else \
660 { \
661 errno=0; \
662 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
663 { \
664 if( errno != EINTR) \
665 { \
666 YY_FATAL_ERROR( "input in flex scanner failed" ); \
667 break; \
668 } \
669 errno=0; \
670 clearerr(yyin); \
671 } \
672 }\
673 \
674
675 #endif
676
677 /* No semi-colon after return; correct usage is to write "yyterminate();" -
678 * we don't want an extra ';' after the "return" because that will cause
679 * some compilers to complain about unreachable statements.
680 */
681 #ifndef yyterminate
682 #define yyterminate() return YY_NULL
683 #endif
684
685 /* Number of entries by which start-condition stack grows. */
686 #ifndef YY_START_STACK_INCR
687 #define YY_START_STACK_INCR 25
688 #endif
689
690 /* Report a fatal error. */
691 #ifndef YY_FATAL_ERROR
692 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
693 #endif
694
695 /* end tables serialization structures and prototypes */
696
697 /* Default declaration of generated scanner - a define so the user can
698 * easily add parameters.
699 */
700 #ifndef YY_DECL
701 #define YY_DECL_IS_OURS 1
702
703 extern int yylex (void);
704
705 #define YY_DECL int yylex (void)
706 #endif /* !YY_DECL */
707
708 /* Code executed at the beginning of each rule, after yytext and yyleng
709 * have been set up.
710 */
711 #ifndef YY_USER_ACTION
712 #define YY_USER_ACTION
713 #endif
714
715 /* Code executed at the end of each rule. */
716 #ifndef YY_BREAK
717 #define YY_BREAK /*LINTED*/break;
718 #endif
719
720 #define YY_RULE_SETUP \
721 YY_USER_ACTION
722
723 /** The main scanner function which does all the work.
724 */
725 YY_DECL
726 {
727 yy_state_type yy_current_state;
728 char *yy_cp, *yy_bp;
729 int yy_act;
730
731 if ( !(yy_init) )
732 {
733 (yy_init) = 1;
734
735 #ifdef YY_USER_INIT
736 YY_USER_INIT;
737 #endif
738
739 if ( ! (yy_start) )
740 (yy_start) = 1; /* first start state */
741
742 if ( ! yyin )
743 yyin = stdin;
744
745 if ( ! yyout )
746 yyout = stdout;
747
748 if ( ! YY_CURRENT_BUFFER ) {
749 yyensure_buffer_stack ();
750 YY_CURRENT_BUFFER_LVALUE =
751 yy_create_buffer(yyin,YY_BUF_SIZE );
752 }
753
754 yy_load_buffer_state( );
755 }
756
757 {
758 #line 30 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
759
760 if (enter_map_id)
761 BEGIN (MAP_ID);
762 else
763 BEGIN (INITIAL);
764
765 #line 766 "command_lexer.cpp"
766
767 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
768 {
769 yy_cp = (yy_c_buf_p);
770
771 /* Support of yytext. */
772 *yy_cp = (yy_hold_char);
773
774 /* yy_bp points to the position in yy_ch_buf of the start of
775 * the current run.
776 */
777 yy_bp = yy_cp;
778
779 yy_current_state = (yy_start);
780 yy_match:
781 do
782 {
783 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
784 if ( yy_accept[yy_current_state] )
785 {
786 (yy_last_accepting_state) = yy_current_state;
787 (yy_last_accepting_cpos) = yy_cp;
788 }
789 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
790 {
791 yy_current_state = (int) yy_def[yy_current_state];
792 if ( yy_current_state >= 58 )
793 yy_c = yy_meta[(unsigned int) yy_c];
794 }
795 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
796 ++yy_cp;
797 }
798 while ( yy_base[yy_current_state] != 141 );
799
800 yy_find_action:
801 yy_act = yy_accept[yy_current_state];
802 if ( yy_act == 0 )
803 { /* have to back up */
804 yy_cp = (yy_last_accepting_cpos);
805 yy_current_state = (yy_last_accepting_state);
806 yy_act = yy_accept[yy_current_state];
807 }
808
809 YY_DO_BEFORE_ACTION;
810
811 do_action: /* This label is used only to access EOF actions. */
812
813 switch ( yy_act )
814 { /* beginning of action switch */
815 case 0: /* must back up */
816 /* undo the effects of YY_DO_BEFORE_ACTION */
817 *yy_cp = (yy_hold_char);
818 yy_cp = (yy_last_accepting_cpos);
819 yy_current_state = (yy_last_accepting_state);
820 goto yy_find_action;
821
822 case 1:
823 YY_RULE_SETUP
824 #line 38 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
825 { /* ignore comments */ }
826 YY_BREAK
827 case 2:
828 YY_RULE_SETUP
829 #line 39 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
830 { return UNSET; }
831 YY_BREAK
832 case 3:
833 YY_RULE_SETUP
834 #line 40 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
835 { return SET; }
836 YY_BREAK
837 case 4:
838 YY_RULE_SETUP
839 #line 41 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
840 { return BIND; }
841 YY_BREAK
842 case 5:
843 YY_RULE_SETUP
844 #line 42 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
845 { return MACRO; }
846 YY_BREAK
847 case 6:
848 /* rule 6 can match eol */
849 YY_RULE_SETUP
850 #line 44 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
851 { return IDENTIFIER; }
852 YY_BREAK
853 case 7:
854 YY_RULE_SETUP
855 #line 45 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
856 { return NUMBER; }
857 YY_BREAK
858 case 8:
859 /* rule 8 can match eol */
860 YY_RULE_SETUP
861 #line 46 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
862 { return STRING; }
863 YY_BREAK
864 case 9:
865 YY_RULE_SETUP
866 #line 48 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
867 { return '='; }
868 YY_BREAK
869 case 10:
870 YY_RULE_SETUP
871 #line 49 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
872 { return ';'; }
873 YY_BREAK
874 case 11:
875 YY_RULE_SETUP
876 #line 50 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
877 { return ','; }
878 YY_BREAK
879 case 12:
880 /* rule 12 can match eol */
881 YY_RULE_SETUP
882 #line 53 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
883 { return EOL; }
884 YY_BREAK
885 case 13:
886 YY_RULE_SETUP
887 #line 54 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
888 { /* ignore white-space */ }
889 YY_BREAK
890 case 14:
891 YY_RULE_SETUP
892 #line 55 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
893 { /* ignore bad-characters */ }
894 YY_BREAK
895
896
897
898 case 15:
899 /* rule 15 can match eol */
900 YY_RULE_SETUP
901 #line 60 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
902 { return EOL; }
903 YY_BREAK
904 case 16:
905 YY_RULE_SETUP
906 #line 61 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
907 { /* ignore white space */ }
908 YY_BREAK
909 case 17:
910 YY_RULE_SETUP
911 #line 62 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
912 { return IDENTIFIER; }
913 YY_BREAK
914
915 case 18:
916 YY_RULE_SETUP
917 #line 65 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
918 ECHO;
919 YY_BREAK
920 #line 921 "command_lexer.cpp"
921 case YY_STATE_EOF(INITIAL):
922 case YY_STATE_EOF(MAP_ID):
923 yyterminate();
924
925 case YY_END_OF_BUFFER:
926 {
927 /* Amount of text matched not including the EOB char. */
928 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
929
930 /* Undo the effects of YY_DO_BEFORE_ACTION. */
931 *yy_cp = (yy_hold_char);
932 YY_RESTORE_YY_MORE_OFFSET
933
934 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
935 {
936 /* We're scanning a new file or input source. It's
937 * possible that this happened because the user
938 * just pointed yyin at a new source and called
939 * yylex(). If so, then we have to assure
940 * consistency between YY_CURRENT_BUFFER and our
941 * globals. Here is the right place to do so, because
942 * this is the first action (other than possibly a
943 * back-up) that will match for the new input source.
944 */
945 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
946 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
947 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
948 }
949
950 /* Note that here we test for yy_c_buf_p "<=" to the position
951 * of the first EOB in the buffer, since yy_c_buf_p will
952 * already have been incremented past the NUL character
953 * (since all states make transitions on EOB to the
954 * end-of-buffer state). Contrast this with the test
955 * in input().
956 */
957 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
958 { /* This was really a NUL. */
959 yy_state_type yy_next_state;
960
961 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
962
963 yy_current_state = yy_get_previous_state( );
964
965 /* Okay, we're now positioned to make the NUL
966 * transition. We couldn't have
967 * yy_get_previous_state() go ahead and do it
968 * for us because it doesn't know how to deal
969 * with the possibility of jamming (and we don't
970 * want to build jamming into it because then it
971 * will run more slowly).
972 */
973
974 yy_next_state = yy_try_NUL_trans( yy_current_state );
975
976 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
977
978 if ( yy_next_state )
979 {
980 /* Consume the NUL. */
981 yy_cp = ++(yy_c_buf_p);
982 yy_current_state = yy_next_state;
983 goto yy_match;
984 }
985
986 else
987 {
988 yy_cp = (yy_c_buf_p);
989 goto yy_find_action;
990 }
991 }
992
993 else switch ( yy_get_next_buffer( ) )
994 {
995 case EOB_ACT_END_OF_FILE:
996 {
997 (yy_did_buffer_switch_on_eof) = 0;
998
999 if ( yywrap( ) )
1000 {
1001 /* Note: because we've taken care in
1002 * yy_get_next_buffer() to have set up
1003 * yytext, we can now set up
1004 * yy_c_buf_p so that if some total
1005 * hoser (like flex itself) wants to
1006 * call the scanner after we return the
1007 * YY_NULL, it'll still work - another
1008 * YY_NULL will get returned.
1009 */
1010 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1011
1012 yy_act = YY_STATE_EOF(YY_START);
1013 goto do_action;
1014 }
1015
1016 else
1017 {
1018 if ( ! (yy_did_buffer_switch_on_eof) )
1019 YY_NEW_FILE;
1020 }
1021 break;
1022 }
1023
1024 case EOB_ACT_CONTINUE_SCAN:
1025 (yy_c_buf_p) =
1026 (yytext_ptr) + yy_amount_of_matched_text;
1027
1028 yy_current_state = yy_get_previous_state( );
1029
1030 yy_cp = (yy_c_buf_p);
1031 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1032 goto yy_match;
1033
1034 case EOB_ACT_LAST_MATCH:
1035 (yy_c_buf_p) =
1036 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1037
1038 yy_current_state = yy_get_previous_state( );
1039
1040 yy_cp = (yy_c_buf_p);
1041 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1042 goto yy_find_action;
1043 }
1044 break;
1045 }
1046
1047 default:
1048 YY_FATAL_ERROR(
1049 "fatal flex scanner internal error--no action found" );
1050 } /* end of action switch */
1051 } /* end of scanning one token */
1052 } /* end of user's declarations */
1053 } /* end of yylex */
1054
1055 /* yy_get_next_buffer - try to read in a new buffer
1056 *
1057 * Returns a code representing an action:
1058 * EOB_ACT_LAST_MATCH -
1059 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1060 * EOB_ACT_END_OF_FILE - end of file
1061 */
1062 static int yy_get_next_buffer (void)
1063 {
1064 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1065 char *source = (yytext_ptr);
1066 yy_size_t number_to_move, i;
1067 int ret_val;
1068
1069 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1070 YY_FATAL_ERROR(
1071 "fatal flex scanner internal error--end of buffer missed" );
1072
1073 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1074 { /* Don't try to fill the buffer, so this is an EOF. */
1075 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1076 {
1077 /* We matched a single character, the EOB, so
1078 * treat this as a final EOF.
1079 */
1080 return EOB_ACT_END_OF_FILE;
1081 }
1082
1083 else
1084 {
1085 /* We matched some text prior to the EOB, first
1086 * process it.
1087 */
1088 return EOB_ACT_LAST_MATCH;
1089 }
1090 }
1091
1092 /* Try to read more data. */
1093
1094 /* First move last chars to start of buffer. */
1095 number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1096
1097 for ( i = 0; i < number_to_move; ++i )
1098 *(dest++) = *(source++);
1099
1100 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1101 /* don't do the read, it's not guaranteed to return an EOF,
1102 * just force an EOF
1103 */
1104 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1105
1106 else
1107 {
1108 yy_size_t num_to_read =
1109 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1110
1111 while ( num_to_read <= 0 )
1112 { /* Not enough room in the buffer - grow it. */
1113
1114 /* just a shorter name for the current buffer */
1115 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1116
1117 int yy_c_buf_p_offset =
1118 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1119
1120 if ( b->yy_is_our_buffer )
1121 {
1122 yy_size_t new_size = b->yy_buf_size * 2;
1123
1124 if ( new_size <= 0 )
1125 b->yy_buf_size += b->yy_buf_size / 8;
1126 else
1127 b->yy_buf_size *= 2;
1128
1129 b->yy_ch_buf = (char *)
1130 /* Include room in for 2 EOB chars. */
1131 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1132 }
1133 else
1134 /* Can't grow it, we don't own it. */
1135 b->yy_ch_buf = 0;
1136
1137 if ( ! b->yy_ch_buf )
1138 YY_FATAL_ERROR(
1139 "fatal error - scanner input buffer overflow" );
1140
1141 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1142
1143 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1144 number_to_move - 1;
1145
1146 }
1147
1148 if ( num_to_read > YY_READ_BUF_SIZE )
1149 num_to_read = YY_READ_BUF_SIZE;
1150
1151 /* Read in more data. */
1152 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1153 (yy_n_chars), num_to_read );
1154
1155 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1156 }
1157
1158 if ( (yy_n_chars) == 0 )
1159 {
1160 if ( number_to_move == YY_MORE_ADJ )
1161 {
1162 ret_val = EOB_ACT_END_OF_FILE;
1163 yyrestart(yyin );
1164 }
1165
1166 else
1167 {
1168 ret_val = EOB_ACT_LAST_MATCH;
1169 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1170 YY_BUFFER_EOF_PENDING;
1171 }
1172 }
1173
1174 else
1175 ret_val = EOB_ACT_CONTINUE_SCAN;
1176
1177 if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1178 /* Extend the array by 50%, plus the number we really need. */
1179 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1180 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1181 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1182 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1183 }
1184
1185 (yy_n_chars) += number_to_move;
1186 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1187 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1188
1189 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1190
1191 return ret_val;
1192 }
1193
1194 /* yy_get_previous_state - get the state just before the EOB char was reached */
1195
yy_get_previous_state(void)1196 static yy_state_type yy_get_previous_state (void)
1197 {
1198 yy_state_type yy_current_state;
1199 char *yy_cp;
1200
1201 yy_current_state = (yy_start);
1202
1203 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1204 {
1205 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1206 if ( yy_accept[yy_current_state] )
1207 {
1208 (yy_last_accepting_state) = yy_current_state;
1209 (yy_last_accepting_cpos) = yy_cp;
1210 }
1211 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1212 {
1213 yy_current_state = (int) yy_def[yy_current_state];
1214 if ( yy_current_state >= 58 )
1215 yy_c = yy_meta[(unsigned int) yy_c];
1216 }
1217 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1218 }
1219
1220 return yy_current_state;
1221 }
1222
1223 /* yy_try_NUL_trans - try to make a transition on the NUL character
1224 *
1225 * synopsis
1226 * next_state = yy_try_NUL_trans( current_state );
1227 */
yy_try_NUL_trans(yy_state_type yy_current_state)1228 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1229 {
1230 int yy_is_jam;
1231 char *yy_cp = (yy_c_buf_p);
1232
1233 YY_CHAR yy_c = 1;
1234 if ( yy_accept[yy_current_state] )
1235 {
1236 (yy_last_accepting_state) = yy_current_state;
1237 (yy_last_accepting_cpos) = yy_cp;
1238 }
1239 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1240 {
1241 yy_current_state = (int) yy_def[yy_current_state];
1242 if ( yy_current_state >= 58 )
1243 yy_c = yy_meta[(unsigned int) yy_c];
1244 }
1245 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1246 yy_is_jam = (yy_current_state == 57);
1247
1248 return yy_is_jam ? 0 : yy_current_state;
1249 }
1250
1251 #ifndef YY_NO_UNPUT
1252
1253 #endif
1254
1255 #ifndef YY_NO_INPUT
1256 #ifdef __cplusplus
yyinput(void)1257 static int yyinput (void)
1258 #else
1259 static int input (void)
1260 #endif
1261
1262 {
1263 int c;
1264
1265 *(yy_c_buf_p) = (yy_hold_char);
1266
1267 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1268 {
1269 /* yy_c_buf_p now points to the character we want to return.
1270 * If this occurs *before* the EOB characters, then it's a
1271 * valid NUL; if not, then we've hit the end of the buffer.
1272 */
1273 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1274 /* This was really a NUL. */
1275 *(yy_c_buf_p) = '\0';
1276
1277 else
1278 { /* need more input */
1279 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1280 ++(yy_c_buf_p);
1281
1282 switch ( yy_get_next_buffer( ) )
1283 {
1284 case EOB_ACT_LAST_MATCH:
1285 /* This happens because yy_g_n_b()
1286 * sees that we've accumulated a
1287 * token and flags that we need to
1288 * try matching the token before
1289 * proceeding. But for input(),
1290 * there's no matching to consider.
1291 * So convert the EOB_ACT_LAST_MATCH
1292 * to EOB_ACT_END_OF_FILE.
1293 */
1294
1295 /* Reset buffer status. */
1296 yyrestart(yyin );
1297
1298 /*FALLTHROUGH*/
1299
1300 case EOB_ACT_END_OF_FILE:
1301 {
1302 if ( yywrap( ) )
1303 return EOF;
1304
1305 if ( ! (yy_did_buffer_switch_on_eof) )
1306 YY_NEW_FILE;
1307 #ifdef __cplusplus
1308 return yyinput();
1309 #else
1310 return input();
1311 #endif
1312 }
1313
1314 case EOB_ACT_CONTINUE_SCAN:
1315 (yy_c_buf_p) = (yytext_ptr) + offset;
1316 break;
1317 }
1318 }
1319 }
1320
1321 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1322 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1323 (yy_hold_char) = *++(yy_c_buf_p);
1324
1325 return c;
1326 }
1327 #endif /* ifndef YY_NO_INPUT */
1328
1329 /** Immediately switch to a different input stream.
1330 * @param input_file A readable stream.
1331 *
1332 * @note This function does not reset the start condition to @c INITIAL .
1333 */
yyrestart(FILE * input_file)1334 void yyrestart (FILE * input_file )
1335 {
1336
1337 if ( ! YY_CURRENT_BUFFER ){
1338 yyensure_buffer_stack ();
1339 YY_CURRENT_BUFFER_LVALUE =
1340 yy_create_buffer(yyin,YY_BUF_SIZE );
1341 }
1342
1343 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1344 yy_load_buffer_state( );
1345 }
1346
1347 /** Switch to a different input buffer.
1348 * @param new_buffer The new input buffer.
1349 *
1350 */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)1351 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1352 {
1353
1354 /* TODO. We should be able to replace this entire function body
1355 * with
1356 * yypop_buffer_state();
1357 * yypush_buffer_state(new_buffer);
1358 */
1359 yyensure_buffer_stack ();
1360 if ( YY_CURRENT_BUFFER == new_buffer )
1361 return;
1362
1363 if ( YY_CURRENT_BUFFER )
1364 {
1365 /* Flush out information for old buffer. */
1366 *(yy_c_buf_p) = (yy_hold_char);
1367 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1368 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1369 }
1370
1371 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1372 yy_load_buffer_state( );
1373
1374 /* We don't actually know whether we did this switch during
1375 * EOF (yywrap()) processing, but the only time this flag
1376 * is looked at is after yywrap() is called, so it's safe
1377 * to go ahead and always set it.
1378 */
1379 (yy_did_buffer_switch_on_eof) = 1;
1380 }
1381
yy_load_buffer_state(void)1382 static void yy_load_buffer_state (void)
1383 {
1384 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1385 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1386 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1387 (yy_hold_char) = *(yy_c_buf_p);
1388 }
1389
1390 /** Allocate and initialize an input buffer state.
1391 * @param file A readable stream.
1392 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1393 *
1394 * @return the allocated buffer state.
1395 */
yy_create_buffer(FILE * file,int size)1396 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1397 {
1398 YY_BUFFER_STATE b;
1399
1400 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1401 if ( ! b )
1402 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1403
1404 b->yy_buf_size = (yy_size_t)size;
1405
1406 /* yy_ch_buf has to be 2 characters longer than the size given because
1407 * we need to put in 2 end-of-buffer characters.
1408 */
1409 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1410 if ( ! b->yy_ch_buf )
1411 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1412
1413 b->yy_is_our_buffer = 1;
1414
1415 yy_init_buffer(b,file );
1416
1417 return b;
1418 }
1419
1420 /** Destroy the buffer.
1421 * @param b a buffer created with yy_create_buffer()
1422 *
1423 */
yy_delete_buffer(YY_BUFFER_STATE b)1424 void yy_delete_buffer (YY_BUFFER_STATE b )
1425 {
1426
1427 if ( ! b )
1428 return;
1429
1430 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1431 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1432
1433 if ( b->yy_is_our_buffer )
1434 yyfree((void *) b->yy_ch_buf );
1435
1436 yyfree((void *) b );
1437 }
1438
1439 /* Initializes or reinitializes a buffer.
1440 * This function is sometimes called more than once on the same buffer,
1441 * such as during a yyrestart() or at EOF.
1442 */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file)1443 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1444
1445 {
1446 int oerrno = errno;
1447
1448 yy_flush_buffer(b );
1449
1450 b->yy_input_file = file;
1451 b->yy_fill_buffer = 1;
1452
1453 /* If b is the current buffer, then yy_init_buffer was _probably_
1454 * called from yyrestart() or through yy_get_next_buffer.
1455 * In that case, we don't want to reset the lineno or column.
1456 */
1457 if (b != YY_CURRENT_BUFFER){
1458 b->yy_bs_lineno = 1;
1459 b->yy_bs_column = 0;
1460 }
1461
1462 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1463
1464 errno = oerrno;
1465 }
1466
1467 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1468 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1469 *
1470 */
yy_flush_buffer(YY_BUFFER_STATE b)1471 void yy_flush_buffer (YY_BUFFER_STATE b )
1472 {
1473 if ( ! b )
1474 return;
1475
1476 b->yy_n_chars = 0;
1477
1478 /* We always need two end-of-buffer characters. The first causes
1479 * a transition to the end-of-buffer state. The second causes
1480 * a jam in that state.
1481 */
1482 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1483 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1484
1485 b->yy_buf_pos = &b->yy_ch_buf[0];
1486
1487 b->yy_at_bol = 1;
1488 b->yy_buffer_status = YY_BUFFER_NEW;
1489
1490 if ( b == YY_CURRENT_BUFFER )
1491 yy_load_buffer_state( );
1492 }
1493
1494 /** Pushes the new state onto the stack. The new state becomes
1495 * the current state. This function will allocate the stack
1496 * if necessary.
1497 * @param new_buffer The new state.
1498 *
1499 */
yypush_buffer_state(YY_BUFFER_STATE new_buffer)1500 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1501 {
1502 if (new_buffer == NULL)
1503 return;
1504
1505 yyensure_buffer_stack();
1506
1507 /* This block is copied from yy_switch_to_buffer. */
1508 if ( YY_CURRENT_BUFFER )
1509 {
1510 /* Flush out information for old buffer. */
1511 *(yy_c_buf_p) = (yy_hold_char);
1512 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1513 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1514 }
1515
1516 /* Only push if top exists. Otherwise, replace top. */
1517 if (YY_CURRENT_BUFFER)
1518 (yy_buffer_stack_top)++;
1519 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1520
1521 /* copied from yy_switch_to_buffer. */
1522 yy_load_buffer_state( );
1523 (yy_did_buffer_switch_on_eof) = 1;
1524 }
1525
1526 /** Removes and deletes the top of the stack, if present.
1527 * The next element becomes the new top.
1528 *
1529 */
yypop_buffer_state(void)1530 void yypop_buffer_state (void)
1531 {
1532 if (!YY_CURRENT_BUFFER)
1533 return;
1534
1535 yy_delete_buffer(YY_CURRENT_BUFFER );
1536 YY_CURRENT_BUFFER_LVALUE = NULL;
1537 if ((yy_buffer_stack_top) > 0)
1538 --(yy_buffer_stack_top);
1539
1540 if (YY_CURRENT_BUFFER) {
1541 yy_load_buffer_state( );
1542 (yy_did_buffer_switch_on_eof) = 1;
1543 }
1544 }
1545
1546 /* Allocates the stack if it does not exist.
1547 * Guarantees space for at least one push.
1548 */
yyensure_buffer_stack(void)1549 static void yyensure_buffer_stack (void)
1550 {
1551 yy_size_t num_to_alloc;
1552
1553 if (!(yy_buffer_stack)) {
1554
1555 /* First allocation is just for 2 elements, since we don't know if this
1556 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1557 * immediate realloc on the next call.
1558 */
1559 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1560 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1561 (num_to_alloc * sizeof(struct yy_buffer_state*)
1562 );
1563 if ( ! (yy_buffer_stack) )
1564 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1565
1566 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1567
1568 (yy_buffer_stack_max) = num_to_alloc;
1569 (yy_buffer_stack_top) = 0;
1570 return;
1571 }
1572
1573 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1574
1575 /* Increase the buffer to prepare for a possible push. */
1576 yy_size_t grow_size = 8 /* arbitrary grow size */;
1577
1578 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1579 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1580 ((yy_buffer_stack),
1581 num_to_alloc * sizeof(struct yy_buffer_state*)
1582 );
1583 if ( ! (yy_buffer_stack) )
1584 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1585
1586 /* zero only the new slots.*/
1587 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1588 (yy_buffer_stack_max) = num_to_alloc;
1589 }
1590 }
1591
1592 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1593 * @param base the character buffer
1594 * @param size the size in bytes of the character buffer
1595 *
1596 * @return the newly allocated buffer state object.
1597 */
yy_scan_buffer(char * base,yy_size_t size)1598 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1599 {
1600 YY_BUFFER_STATE b;
1601
1602 if ( size < 2 ||
1603 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1604 base[size-1] != YY_END_OF_BUFFER_CHAR )
1605 /* They forgot to leave room for the EOB's. */
1606 return 0;
1607
1608 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1609 if ( ! b )
1610 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1611
1612 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1613 b->yy_buf_pos = b->yy_ch_buf = base;
1614 b->yy_is_our_buffer = 0;
1615 b->yy_input_file = 0;
1616 b->yy_n_chars = b->yy_buf_size;
1617 b->yy_is_interactive = 0;
1618 b->yy_at_bol = 1;
1619 b->yy_fill_buffer = 0;
1620 b->yy_buffer_status = YY_BUFFER_NEW;
1621
1622 yy_switch_to_buffer(b );
1623
1624 return b;
1625 }
1626
1627 /** Setup the input buffer state to scan a string. The next call to yylex() will
1628 * scan from a @e copy of @a str.
1629 * @param yystr a NUL-terminated string to scan
1630 *
1631 * @return the newly allocated buffer state object.
1632 * @note If you want to scan bytes that may contain NUL values, then use
1633 * yy_scan_bytes() instead.
1634 */
yy_scan_string(yyconst char * yystr)1635 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1636 {
1637
1638 return yy_scan_bytes(yystr,strlen(yystr) );
1639 }
1640
1641 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1642 * scan from a @e copy of @a bytes.
1643 * @param yybytes the byte buffer to scan
1644 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1645 *
1646 * @return the newly allocated buffer state object.
1647 */
yy_scan_bytes(yyconst char * yybytes,yy_size_t _yybytes_len)1648 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1649 {
1650 YY_BUFFER_STATE b;
1651 char *buf;
1652 yy_size_t n;
1653 yy_size_t i;
1654
1655 /* Get memory for full buffer, including space for trailing EOB's. */
1656 n = _yybytes_len + 2;
1657 buf = (char *) yyalloc(n );
1658 if ( ! buf )
1659 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1660
1661 for ( i = 0; i < _yybytes_len; ++i )
1662 buf[i] = yybytes[i];
1663
1664 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1665
1666 b = yy_scan_buffer(buf,n );
1667 if ( ! b )
1668 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1669
1670 /* It's okay to grow etc. this buffer, and we should throw it
1671 * away when we're done.
1672 */
1673 b->yy_is_our_buffer = 1;
1674
1675 return b;
1676 }
1677
1678 #ifndef YY_EXIT_FAILURE
1679 #define YY_EXIT_FAILURE 2
1680 #endif
1681
yy_fatal_error(yyconst char * msg)1682 static void yy_fatal_error (yyconst char* msg )
1683 {
1684 (void) fprintf( stderr, "%s\n", msg );
1685 exit( YY_EXIT_FAILURE );
1686 }
1687
1688 /* Redefine yyless() so it works in section 3 code. */
1689
1690 #undef yyless
1691 #define yyless(n) \
1692 do \
1693 { \
1694 /* Undo effects of setting up yytext. */ \
1695 int yyless_macro_arg = (n); \
1696 YY_LESS_LINENO(yyless_macro_arg);\
1697 yytext[yyleng] = (yy_hold_char); \
1698 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1699 (yy_hold_char) = *(yy_c_buf_p); \
1700 *(yy_c_buf_p) = '\0'; \
1701 yyleng = yyless_macro_arg; \
1702 } \
1703 while ( 0 )
1704
1705 /* Accessor methods (get/set functions) to struct members. */
1706
1707 /** Get the current line number.
1708 *
1709 */
yyget_lineno(void)1710 int yyget_lineno (void)
1711 {
1712
1713 return yylineno;
1714 }
1715
1716 /** Get the input stream.
1717 *
1718 */
yyget_in(void)1719 FILE *yyget_in (void)
1720 {
1721 return yyin;
1722 }
1723
1724 /** Get the output stream.
1725 *
1726 */
yyget_out(void)1727 FILE *yyget_out (void)
1728 {
1729 return yyout;
1730 }
1731
1732 /** Get the length of the current token.
1733 *
1734 */
yyget_leng(void)1735 yy_size_t yyget_leng (void)
1736 {
1737 return yyleng;
1738 }
1739
1740 /** Get the current token.
1741 *
1742 */
1743
yyget_text(void)1744 char *yyget_text (void)
1745 {
1746 return yytext;
1747 }
1748
1749 /** Set the current line number.
1750 * @param _line_number line number
1751 *
1752 */
yyset_lineno(int _line_number)1753 void yyset_lineno (int _line_number )
1754 {
1755
1756 yylineno = _line_number;
1757 }
1758
1759 /** Set the input stream. This does not discard the current
1760 * input buffer.
1761 * @param _in_str A readable stream.
1762 *
1763 * @see yy_switch_to_buffer
1764 */
yyset_in(FILE * _in_str)1765 void yyset_in (FILE * _in_str )
1766 {
1767 yyin = _in_str ;
1768 }
1769
yyset_out(FILE * _out_str)1770 void yyset_out (FILE * _out_str )
1771 {
1772 yyout = _out_str ;
1773 }
1774
yyget_debug(void)1775 int yyget_debug (void)
1776 {
1777 return yy_flex_debug;
1778 }
1779
yyset_debug(int _bdebug)1780 void yyset_debug (int _bdebug )
1781 {
1782 yy_flex_debug = _bdebug ;
1783 }
1784
yy_init_globals(void)1785 static int yy_init_globals (void)
1786 {
1787 /* Initialization is the same as for the non-reentrant scanner.
1788 * This function is called from yylex_destroy(), so don't allocate here.
1789 */
1790
1791 (yy_buffer_stack) = 0;
1792 (yy_buffer_stack_top) = 0;
1793 (yy_buffer_stack_max) = 0;
1794 (yy_c_buf_p) = (char *) 0;
1795 (yy_init) = 0;
1796 (yy_start) = 0;
1797
1798 /* Defined in main.c */
1799 #ifdef YY_STDINIT
1800 yyin = stdin;
1801 yyout = stdout;
1802 #else
1803 yyin = (FILE *) 0;
1804 yyout = (FILE *) 0;
1805 #endif
1806
1807 /* For future reference: Set errno on error, since we are called by
1808 * yylex_init()
1809 */
1810 return 0;
1811 }
1812
1813 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(void)1814 int yylex_destroy (void)
1815 {
1816
1817 /* Pop the buffer stack, destroying each element. */
1818 while(YY_CURRENT_BUFFER){
1819 yy_delete_buffer(YY_CURRENT_BUFFER );
1820 YY_CURRENT_BUFFER_LVALUE = NULL;
1821 yypop_buffer_state();
1822 }
1823
1824 /* Destroy the stack itself. */
1825 yyfree((yy_buffer_stack) );
1826 (yy_buffer_stack) = NULL;
1827
1828 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1829 * yylex() is called, initialization will occur. */
1830 yy_init_globals( );
1831
1832 return 0;
1833 }
1834
1835 /*
1836 * Internal utility routines.
1837 */
1838
1839 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,yyconst char * s2,int n)1840 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1841 {
1842
1843 int i;
1844 for ( i = 0; i < n; ++i )
1845 s1[i] = s2[i];
1846 }
1847 #endif
1848
1849 #ifdef YY_NEED_STRLEN
yy_flex_strlen(yyconst char * s)1850 static int yy_flex_strlen (yyconst char * s )
1851 {
1852 int n;
1853 for ( n = 0; s[n]; ++n )
1854 ;
1855
1856 return n;
1857 }
1858 #endif
1859
yyalloc(yy_size_t size)1860 void *yyalloc (yy_size_t size )
1861 {
1862 return (void *) malloc( size );
1863 }
1864
yyrealloc(void * ptr,yy_size_t size)1865 void *yyrealloc (void * ptr, yy_size_t size )
1866 {
1867
1868 /* The cast to (char *) in the following accommodates both
1869 * implementations that use char* generic pointers, and those
1870 * that use void* generic pointers. It works with the latter
1871 * because both ANSI C and C++ allow castless assignment from
1872 * any pointer type to void*, and deal with argument conversions
1873 * as though doing an assignment.
1874 */
1875 return (void *) realloc( (char *) ptr, size );
1876 }
1877
yyfree(void * ptr)1878 void yyfree (void * ptr )
1879 {
1880 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1881 }
1882
1883 #define YYTABLES_NAME "yytables"
1884
1885 #line 65 "/home/bob/rcs/git/cgdb/master/cgdb/cgdb/command_lexer.lpp"
1886
1887
1888
1889