4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 35
12 #if YY_FLEX_SUBMINOR_VERSION > 0
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
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;
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;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
87 #endif /* ! FLEXINT_H */
91 /* The "const" storage-class-modifier is valid. */
94 #else /* ! __cplusplus */
96 /* C99 requires __STDC__ to be defined as 1. */
97 #if defined (__STDC__)
101 #endif /* defined (__STDC__) */
102 #endif /* ! __cplusplus */
105 #define yyconst const
110 /* Returned upon end-of-file. */
113 /* Promotes a possibly negative, possibly signed char to an unsigned
114 * integer for use as an array index. If the signed char is negative,
115 * we want to instead treat it as an 8-bit unsigned char, hence the
118 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120 /* An opaque pointer. */
121 #ifndef YY_TYPEDEF_YY_SCANNER_T
122 #define YY_TYPEDEF_YY_SCANNER_T
123 typedef void* yyscan_t;
126 /* For convenience, these vars (plus the bison vars far below)
127 are macros in the reentrant scanner. */
128 #define yyin yyg->yyin_r
129 #define yyout yyg->yyout_r
130 #define yyextra yyg->yyextra_r
131 #define yyleng yyg->yyleng_r
132 #define yytext yyg->yytext_r
133 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
134 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
135 #define yy_flex_debug yyg->yy_flex_debug_r
137 /* Enter a start condition. This macro really ought to take a parameter,
138 * but we do it the disgusting crufty way forced on us by the ()-less
139 * definition of BEGIN.
141 #define BEGIN yyg->yy_start = 1 + 2 *
143 /* Translate the current start state into a value that can be later handed
144 * to BEGIN to return to the state. The YYSTATE alias is for lex
147 #define YY_START ((yyg->yy_start - 1) / 2)
148 #define YYSTATE YY_START
150 /* Action number for EOF rule of a given start state. */
151 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
153 /* Special action meaning "start processing a new file". */
154 #define YY_NEW_FILE rcsrestart(yyin ,yyscanner )
156 #define YY_END_OF_BUFFER_CHAR 0
158 /* Size of default input buffer. */
160 #define YY_BUF_SIZE 16384
163 /* The state buf must be large enough to hold one state per character in the main buffer.
165 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
167 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
168 #define YY_TYPEDEF_YY_BUFFER_STATE
169 typedef struct yy_buffer_state *YY_BUFFER_STATE;
172 #define EOB_ACT_CONTINUE_SCAN 0
173 #define EOB_ACT_END_OF_FILE 1
174 #define EOB_ACT_LAST_MATCH 2
176 #define YY_LESS_LINENO(n)
178 /* Return all but the first "n" matched characters back to the input stream. */
182 /* Undo effects of setting up yytext. */ \
183 int yyless_macro_arg = (n); \
184 YY_LESS_LINENO(yyless_macro_arg);\
185 *yy_cp = yyg->yy_hold_char; \
186 YY_RESTORE_YY_MORE_OFFSET \
187 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
188 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
192 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
194 #ifndef YY_TYPEDEF_YY_SIZE_T
195 #define YY_TYPEDEF_YY_SIZE_T
196 typedef size_t yy_size_t;
199 #ifndef YY_STRUCT_YY_BUFFER_STATE
200 #define YY_STRUCT_YY_BUFFER_STATE
201 struct yy_buffer_state
205 char *yy_ch_buf; /* input buffer */
206 char *yy_buf_pos; /* current position in input buffer */
208 /* Size of input buffer in bytes, not including room for EOB
211 yy_size_t yy_buf_size;
213 /* Number of characters read into yy_ch_buf, not including EOB
218 /* Whether we "own" the buffer - i.e., we know we created it,
219 * and can realloc() it to grow it, and should free() it to
222 int yy_is_our_buffer;
224 /* Whether this is an "interactive" input source; if so, and
225 * if we're using stdio for input, then we want to use getc()
226 * instead of fread(), to make sure we stop fetching input after
229 int yy_is_interactive;
231 /* Whether we're considered to be at the beginning of a line.
232 * If so, '^' rules will be active on the next match, otherwise
237 int yy_bs_lineno; /**< The line count. */
238 int yy_bs_column; /**< The column count. */
240 /* Whether to try to fill the input buffer when we reach the
245 int yy_buffer_status;
247 #define YY_BUFFER_NEW 0
248 #define YY_BUFFER_NORMAL 1
249 /* When an EOF's been seen but there's still some text to process
250 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
251 * shouldn't try reading from the input source any more. We might
252 * still have a bunch of tokens to match, though, because of
253 * possible backing-up.
255 * When we actually see the EOF, we change the status to "new"
256 * (via rcsrestart()), so that the user can continue scanning by
257 * just pointing yyin at a new input file.
259 #define YY_BUFFER_EOF_PENDING 2
262 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
264 /* We provide macros for accessing buffer states in case in the
265 * future we want to put the buffer states in a more general
268 * Returns the top of the stack, or NULL.
270 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
271 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
274 /* Same as previous macro, but useful when we know that the buffer stack is not
275 * NULL or when we need an lvalue. For internal use only.
277 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
279 void rcsrestart (FILE *input_file ,yyscan_t yyscanner );
280 void rcs_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
281 YY_BUFFER_STATE rcs_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
282 void rcs_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
283 void rcs_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
284 void rcspush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
285 void rcspop_buffer_state (yyscan_t yyscanner );
287 static void rcsensure_buffer_stack (yyscan_t yyscanner );
288 static void rcs_load_buffer_state (yyscan_t yyscanner );
289 static void rcs_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
291 #define YY_FLUSH_BUFFER rcs_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
293 YY_BUFFER_STATE rcs_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
294 YY_BUFFER_STATE rcs_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
295 YY_BUFFER_STATE rcs_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
297 void *rcsalloc (yy_size_t ,yyscan_t yyscanner );
298 void *rcsrealloc (void *,yy_size_t ,yyscan_t yyscanner );
299 void rcsfree (void * ,yyscan_t yyscanner );
301 #define yy_new_buffer rcs_create_buffer
303 #define yy_set_interactive(is_interactive) \
305 if ( ! YY_CURRENT_BUFFER ){ \
306 rcsensure_buffer_stack (yyscanner); \
307 YY_CURRENT_BUFFER_LVALUE = \
308 rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
310 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
313 #define yy_set_bol(at_bol) \
315 if ( ! YY_CURRENT_BUFFER ){\
316 rcsensure_buffer_stack (yyscanner); \
317 YY_CURRENT_BUFFER_LVALUE = \
318 rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
320 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
323 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
325 /* Begin user sect3 */
328 #define YY_SKIP_YYWRAP
330 typedef unsigned char YY_CHAR;
332 typedef int yy_state_type;
334 #define yytext_ptr yytext_r
336 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
337 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
338 static int yy_get_next_buffer (yyscan_t yyscanner );
339 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
341 /* Done after the current pattern has been matched and before the
342 * corresponding action - sets up yytext.
344 #define YY_DO_BEFORE_ACTION \
345 yyg->yytext_ptr = yy_bp; \
346 yyleng = (size_t) (yy_cp - yy_bp); \
347 yyg->yy_hold_char = *yy_cp; \
349 yyg->yy_c_buf_p = yy_cp;
351 #define YY_NUM_RULES 10
352 #define YY_END_OF_BUFFER 11
353 /* This struct is not used in this scanner,
354 but its presence is necessary. */
357 flex_int32_t yy_verify;
360 static yyconst flex_int16_t yy_accept[89] =
362 0, 0, 11, 5, 9, 8, 10, 4, 4, 7,
363 6, 5, 5, 5, 5, 5, 5, 5, 5, 5,
364 5, 5, 5, 5, 5, 9, 5, 4, 4, 5,
365 4, 4, 5, 0, 0, 5, 5, 3, 5, 5,
366 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
367 5, 3, 5, 5, 5, 5, 5, 5, 5, 5,
368 5, 2, 5, 5, 5, 5, 5, 5, 5, 5,
369 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
370 5, 5, 5, 1, 5, 5, 5, 0
373 static yyconst flex_int32_t yy_ec[256] =
375 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 2, 1, 1, 1, 4, 1, 1, 1, 1,
379 1, 1, 1, 4, 1, 5, 1, 6, 6, 6,
380 6, 6, 6, 6, 6, 6, 6, 7, 8, 1,
381 1, 1, 1, 9, 1, 1, 1, 1, 1, 1,
382 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 10, 11, 12, 13,
386 14, 1, 15, 16, 17, 1, 18, 19, 20, 21,
387 22, 23, 1, 24, 25, 26, 27, 1, 1, 28,
388 29, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 static yyconst flex_int32_t yy_meta[30] =
407 1, 2, 2, 2, 1, 1, 2, 2, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1
412 static yyconst flex_int16_t yy_base[94] =
414 0, 0, 136, 25, 127, 297, 297, 27, 29, 297,
415 297, 34, 39, 41, 47, 44, 50, 54, 57, 66,
416 68, 70, 76, 80, 82, 91, 84, 86, 90, 93,
417 95, 97, 102, 58, 61, 0, 0, 107, 109, 112,
418 114, 117, 120, 122, 125, 129, 137, 127, 135, 145,
419 148, 74, 152, 155, 157, 162, 167, 174, 164, 178,
420 182, 184, 187, 189, 191, 193, 196, 200, 204, 206,
421 214, 211, 218, 224, 228, 230, 236, 239, 241, 243,
422 245, 248, 250, 254, 260, 265, 267, 297, 76, 56,
427 static yyconst flex_int16_t yy_def[94] =
429 88, 1, 88, 89, 88, 88, 88, 90, 91, 88,
430 88, 92, 89, 89, 89, 89, 89, 89, 89, 89,
431 89, 89, 89, 89, 89, 88, 89, 90, 91, 89,
432 91, 91, 92, 93, 93, 33, 33, 89, 89, 89,
433 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
434 89, 88, 89, 89, 89, 89, 89, 89, 89, 89,
435 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
436 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
437 89, 89, 89, 89, 89, 89, 89, 0, 88, 88,
442 static yyconst flex_int16_t yy_nxt[327] =
444 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
445 14, 15, 16, 17, 4, 18, 4, 4, 19, 4,
446 20, 4, 4, 4, 21, 22, 4, 4, 4, 24,
447 25, 28, 29, 31, 32, 34, 35, 34, 36, 37,
448 34, 34, 38, 24, 25, 24, 25, 30, 24, 25,
449 39, 24, 25, 43, 24, 25, 27, 44, 24, 25,
450 35, 24, 25, 35, 41, 40, 52, 46, 42, 52,
451 24, 25, 24, 25, 24, 25, 23, 45, 47, 48,
452 24, 25, 34, 51, 24, 25, 24, 25, 24, 25,
453 28, 29, 26, 49, 31, 32, 50, 24, 25, 31,
455 32, 31, 32, 34, 35, 34, 36, 37, 34, 34,
456 38, 24, 25, 24, 25, 33, 24, 25, 24, 25,
457 53, 24, 25, 55, 24, 25, 24, 25, 26, 24,
458 25, 24, 25, 24, 25, 88, 56, 54, 60, 24,
459 25, 24, 25, 88, 64, 57, 58, 59, 61, 24,
460 25, 62, 24, 25, 63, 88, 24, 25, 65, 24,
461 25, 24, 25, 88, 66, 68, 24, 25, 24, 25,
462 69, 24, 25, 72, 88, 67, 88, 70, 24, 25,
463 62, 71, 24, 25, 88, 62, 24, 25, 24, 25,
464 62, 24, 25, 24, 25, 24, 25, 24, 25, 73,
466 24, 25, 88, 76, 24, 25, 88, 75, 24, 25,
467 24, 25, 62, 88, 74, 24, 25, 79, 24, 25,
468 88, 62, 24, 25, 77, 78, 88, 80, 24, 25,
469 88, 81, 24, 25, 24, 25, 88, 62, 88, 82,
470 24, 25, 62, 24, 25, 24, 25, 24, 25, 24,
471 25, 83, 24, 25, 24, 25, 84, 62, 24, 25,
472 62, 88, 62, 85, 24, 25, 88, 87, 86, 24,
473 25, 24, 25, 62, 88, 88, 88, 88, 88, 88,
474 88, 88, 88, 88, 88, 62, 88, 88, 88, 62,
475 88, 62, 33, 33, 34, 34, 3, 88, 88, 88,
477 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
478 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
479 88, 88, 88, 88, 88, 88
482 static yyconst flex_int16_t yy_chk[327] =
484 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
486 1, 1, 1, 1, 1, 1, 1, 1, 1, 4,
487 4, 8, 8, 9, 9, 12, 12, 12, 12, 12,
488 12, 12, 12, 13, 13, 14, 14, 91, 16, 16,
489 13, 15, 15, 16, 17, 17, 90, 16, 18, 18,
490 34, 19, 19, 35, 14, 13, 34, 18, 15, 35,
491 20, 20, 21, 21, 22, 22, 89, 17, 19, 20,
492 23, 23, 52, 22, 24, 24, 25, 25, 27, 27,
493 28, 28, 26, 21, 29, 29, 21, 30, 30, 31,
495 31, 32, 32, 33, 33, 33, 33, 33, 33, 33,
496 33, 38, 38, 39, 39, 38, 40, 40, 41, 41,
497 39, 42, 42, 41, 43, 43, 44, 44, 5, 45,
498 45, 48, 48, 46, 46, 3, 42, 40, 46, 49,
499 49, 47, 47, 0, 49, 43, 44, 45, 47, 50,
500 50, 47, 51, 51, 48, 0, 53, 53, 49, 54,
501 54, 55, 55, 0, 50, 53, 56, 56, 59, 59,
502 54, 57, 57, 59, 0, 51, 0, 55, 58, 58,
503 57, 56, 60, 60, 0, 58, 61, 61, 62, 62,
504 60, 63, 63, 64, 64, 65, 65, 66, 66, 61,
506 67, 67, 0, 66, 68, 68, 0, 65, 69, 69,
507 70, 70, 63, 0, 64, 72, 72, 70, 71, 71,
508 0, 67, 73, 73, 68, 69, 0, 71, 74, 74,
509 0, 72, 75, 75, 76, 76, 0, 74, 0, 75,
510 77, 77, 73, 78, 78, 79, 79, 80, 80, 81,
511 81, 76, 82, 82, 83, 83, 79, 81, 84, 84,
512 77, 0, 78, 80, 85, 85, 0, 84, 83, 86,
513 86, 87, 87, 82, 0, 0, 0, 0, 0, 0,
514 0, 0, 0, 0, 0, 85, 0, 0, 0, 86,
515 0, 87, 92, 92, 93, 93, 88, 88, 88, 88,
517 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
518 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
519 88, 88, 88, 88, 88, 88
522 /* The intent behind this definition is that it'll catch
523 * any uses of REJECT which flex missed.
525 #define REJECT reject_used_but_not_detected
526 #define yymore() yymore_used_but_not_detected
527 #define YY_MORE_ADJ 0
528 #define YY_RESTORE_YY_MORE_OFFSET
529 #line 1 "rcstokenizer.l"
531 * Copyright (c) 2007-2008, Ulf Lilleengen <lulf@FreeBSD.org>
532 * All rights reserved.
534 * Redistribution and use in source and binary forms, with or without
535 * modification, are permitted provided that the following conditions
537 * 1. Redistributions of source code must retain the above copyright
538 * notice, this list of conditions and the following disclaimer.
539 * 2. Redistributions in binary form must reproduce the above copyright
540 * notice, this list of conditions and the following disclaimer in the
541 * documentation and/or other materials provided with the distribution.
543 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
544 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
545 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
546 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
547 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
548 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
549 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
550 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
551 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
552 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
559 * This tokenizer must be generated by a lexxer with support for reentrancy.
561 #line 34 "rcstokenizer.l"
564 #include "rcsparse.h"
566 #line 567 "lex.rcs.c"
570 #ifndef YY_NO_UNISTD_H
571 /* Special case for "unistd.h", since it is non-ANSI. We include it way
572 * down here because we want the user's section 1 to have been scanned first.
573 * The user has a chance to override it with an option.
578 #ifndef YY_EXTRA_TYPE
579 #define YY_EXTRA_TYPE void *
582 /* Holds the entire state of the reentrant scanner. */
586 /* User-defined. Not touched by flex. */
587 YY_EXTRA_TYPE yyextra_r;
589 /* The rest are the same as the globals declared in the non-reentrant scanner. */
590 FILE *yyin_r, *yyout_r;
591 size_t yy_buffer_stack_top; /**< index of top of stack. */
592 size_t yy_buffer_stack_max; /**< capacity of stack. */
593 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
600 int yy_did_buffer_switch_on_eof;
601 int yy_start_stack_ptr;
602 int yy_start_stack_depth;
604 yy_state_type yy_last_accepting_state;
605 char* yy_last_accepting_cpos;
614 }; /* end struct yyguts_t */
616 static int yy_init_globals (yyscan_t yyscanner );
618 int rcslex_init (yyscan_t* scanner);
620 int rcslex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
622 /* Accessor methods to globals.
623 These are made visible to non-reentrant scanners for convenience. */
625 int rcslex_destroy (yyscan_t yyscanner );
627 int rcsget_debug (yyscan_t yyscanner );
629 void rcsset_debug (int debug_flag ,yyscan_t yyscanner );
631 YY_EXTRA_TYPE rcsget_extra (yyscan_t yyscanner );
633 void rcsset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
635 FILE *rcsget_in (yyscan_t yyscanner );
637 void rcsset_in (FILE * in_str ,yyscan_t yyscanner );
639 FILE *rcsget_out (yyscan_t yyscanner );
641 void rcsset_out (FILE * out_str ,yyscan_t yyscanner );
643 int rcsget_leng (yyscan_t yyscanner );
645 char *rcsget_text (yyscan_t yyscanner );
647 int rcsget_lineno (yyscan_t yyscanner );
649 void rcsset_lineno (int line_number ,yyscan_t yyscanner );
651 /* Macros after this point can all be overridden by user definitions in
655 #ifndef YY_SKIP_YYWRAP
657 extern "C" int rcswrap (yyscan_t yyscanner );
659 extern int rcswrap (yyscan_t yyscanner );
663 static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
666 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
669 #ifdef YY_NEED_STRLEN
670 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
676 static int yyinput (yyscan_t yyscanner );
678 static int input (yyscan_t yyscanner );
683 /* Amount of stuff to slurp up with each read. */
684 #ifndef YY_READ_BUF_SIZE
685 #define YY_READ_BUF_SIZE 8192
688 /* Copy whatever the last rule matched to the standard output. */
690 /* This used to be an fputs(), but since the string might contain NUL's,
691 * we now use fwrite().
693 #define ECHO fwrite( yytext, yyleng, 1, yyout )
696 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
697 * is returned in "result".
700 #define YY_INPUT(buf,result,max_size) \
701 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
705 for ( n = 0; n < max_size && \
706 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
709 buf[n++] = (char) c; \
710 if ( c == EOF && ferror( yyin ) ) \
711 YY_FATAL_ERROR( "input in flex scanner failed" ); \
717 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
719 if( errno != EINTR) \
721 YY_FATAL_ERROR( "input in flex scanner failed" ); \
732 /* No semi-colon after return; correct usage is to write "yyterminate();" -
733 * we don't want an extra ';' after the "return" because that will cause
734 * some compilers to complain about unreachable statements.
737 #define yyterminate() return YY_NULL
740 /* Number of entries by which start-condition stack grows. */
741 #ifndef YY_START_STACK_INCR
742 #define YY_START_STACK_INCR 25
745 /* Report a fatal error. */
746 #ifndef YY_FATAL_ERROR
747 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
750 /* end tables serialization structures and prototypes */
752 /* Default declaration of generated scanner - a define so the user can
753 * easily add parameters.
756 #define YY_DECL_IS_OURS 1
758 extern int rcslex (yyscan_t yyscanner);
760 #define YY_DECL int rcslex (yyscan_t yyscanner)
761 #endif /* !YY_DECL */
763 /* Code executed at the beginning of each rule, after yytext and yyleng
766 #ifndef YY_USER_ACTION
767 #define YY_USER_ACTION
770 /* Code executed at the end of each rule. */
772 #define YY_BREAK break;
775 #define YY_RULE_SETUP \
778 /** The main scanner function which does all the work.
782 register yy_state_type yy_current_state;
783 register char *yy_cp, *yy_bp;
785 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
787 #line 51 "rcstokenizer.l"
790 #line 791 "lex.rcs.c"
800 if ( ! yyg->yy_start )
801 yyg->yy_start = 1; /* first start state */
809 if ( ! YY_CURRENT_BUFFER ) {
810 rcsensure_buffer_stack (yyscanner);
811 YY_CURRENT_BUFFER_LVALUE =
812 rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
815 rcs_load_buffer_state(yyscanner );
818 while ( 1 ) /* loops until end-of-file is reached */
820 yy_cp = yyg->yy_c_buf_p;
822 /* Support of yytext. */
823 *yy_cp = yyg->yy_hold_char;
825 /* yy_bp points to the position in yy_ch_buf of the start of
830 yy_current_state = yyg->yy_start;
834 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
835 if ( yy_accept[yy_current_state] )
837 yyg->yy_last_accepting_state = yy_current_state;
838 yyg->yy_last_accepting_cpos = yy_cp;
840 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
842 yy_current_state = (int) yy_def[yy_current_state];
843 if ( yy_current_state >= 89 )
844 yy_c = yy_meta[(unsigned int) yy_c];
846 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
849 while ( yy_base[yy_current_state] != 297 );
852 yy_act = yy_accept[yy_current_state];
854 { /* have to back up */
855 yy_cp = yyg->yy_last_accepting_cpos;
856 yy_current_state = yyg->yy_last_accepting_state;
857 yy_act = yy_accept[yy_current_state];
862 do_action: /* This label is used only to access EOF actions. */
865 { /* beginning of action switch */
866 case 0: /* must back up */
867 /* undo the effects of YY_DO_BEFORE_ACTION */
868 *yy_cp = yyg->yy_hold_char;
869 yy_cp = yyg->yy_last_accepting_cpos;
870 yy_current_state = yyg->yy_last_accepting_state;
875 #line 53 "rcstokenizer.l"
877 return (KEYWORD_TWO);
882 #line 56 "rcstokenizer.l"
888 /* rule 3 can match eol */
890 #line 59 "rcstokenizer.l"
897 #line 62 "rcstokenizer.l"
904 #line 65 "rcstokenizer.l"
906 /* This will use ID as both ID and SYM. Do extra checking elsewhere.*/
912 #line 69 "rcstokenizer.l"
917 #line 70 "rcstokenizer.l"
921 /* rule 8 can match eol */
923 #line 71 "rcstokenizer.l"
928 #line 72 "rcstokenizer.l"
933 #line 73 "rcstokenizer.l"
936 #line 937 "lex.rcs.c"
937 case YY_STATE_EOF(INITIAL):
940 case YY_END_OF_BUFFER:
942 /* Amount of text matched not including the EOB char. */
943 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
945 /* Undo the effects of YY_DO_BEFORE_ACTION. */
946 *yy_cp = yyg->yy_hold_char;
947 YY_RESTORE_YY_MORE_OFFSET
949 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
951 /* We're scanning a new file or input source. It's
952 * possible that this happened because the user
953 * just pointed yyin at a new source and called
954 * rcslex(). If so, then we have to assure
955 * consistency between YY_CURRENT_BUFFER and our
956 * globals. Here is the right place to do so, because
957 * this is the first action (other than possibly a
958 * back-up) that will match for the new input source.
960 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
961 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
962 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
965 /* Note that here we test for yy_c_buf_p "<=" to the position
966 * of the first EOB in the buffer, since yy_c_buf_p will
967 * already have been incremented past the NUL character
968 * (since all states make transitions on EOB to the
969 * end-of-buffer state). Contrast this with the test
972 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
973 { /* This was really a NUL. */
974 yy_state_type yy_next_state;
976 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
978 yy_current_state = yy_get_previous_state( yyscanner );
980 /* Okay, we're now positioned to make the NUL
981 * transition. We couldn't have
982 * yy_get_previous_state() go ahead and do it
983 * for us because it doesn't know how to deal
984 * with the possibility of jamming (and we don't
985 * want to build jamming into it because then it
986 * will run more slowly).
989 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
991 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
995 /* Consume the NUL. */
996 yy_cp = ++yyg->yy_c_buf_p;
997 yy_current_state = yy_next_state;
1003 yy_cp = yyg->yy_c_buf_p;
1004 goto yy_find_action;
1008 else switch ( yy_get_next_buffer( yyscanner ) )
1010 case EOB_ACT_END_OF_FILE:
1012 yyg->yy_did_buffer_switch_on_eof = 0;
1014 if ( rcswrap(yyscanner ) )
1016 /* Note: because we've taken care in
1017 * yy_get_next_buffer() to have set up
1018 * yytext, we can now set up
1019 * yy_c_buf_p so that if some total
1020 * hoser (like flex itself) wants to
1021 * call the scanner after we return the
1022 * YY_NULL, it'll still work - another
1023 * YY_NULL will get returned.
1025 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1027 yy_act = YY_STATE_EOF(YY_START);
1033 if ( ! yyg->yy_did_buffer_switch_on_eof )
1039 case EOB_ACT_CONTINUE_SCAN:
1041 yyg->yytext_ptr + yy_amount_of_matched_text;
1043 yy_current_state = yy_get_previous_state( yyscanner );
1045 yy_cp = yyg->yy_c_buf_p;
1046 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1049 case EOB_ACT_LAST_MATCH:
1051 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1053 yy_current_state = yy_get_previous_state( yyscanner );
1055 yy_cp = yyg->yy_c_buf_p;
1056 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1057 goto yy_find_action;
1064 "fatal flex scanner internal error--no action found" );
1065 } /* end of action switch */
1066 } /* end of scanning one token */
1067 } /* end of rcslex */
1069 /* yy_get_next_buffer - try to read in a new buffer
1071 * Returns a code representing an action:
1072 * EOB_ACT_LAST_MATCH -
1073 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1074 * EOB_ACT_END_OF_FILE - end of file
1076 static int yy_get_next_buffer (yyscan_t yyscanner)
1078 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1079 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1080 register char *source = yyg->yytext_ptr;
1081 register int number_to_move, i;
1084 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1086 "fatal flex scanner internal error--end of buffer missed" );
1088 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1089 { /* Don't try to fill the buffer, so this is an EOF. */
1090 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1092 /* We matched a single character, the EOB, so
1093 * treat this as a final EOF.
1095 return EOB_ACT_END_OF_FILE;
1100 /* We matched some text prior to the EOB, first
1103 return EOB_ACT_LAST_MATCH;
1107 /* Try to read more data. */
1109 /* First move last chars to start of buffer. */
1110 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1112 for ( i = 0; i < number_to_move; ++i )
1113 *(dest++) = *(source++);
1115 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1116 /* don't do the read, it's not guaranteed to return an EOF,
1119 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1124 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1126 while ( num_to_read <= 0 )
1127 { /* Not enough room in the buffer - grow it. */
1129 /* just a shorter name for the current buffer */
1130 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1132 int yy_c_buf_p_offset =
1133 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1135 if ( b->yy_is_our_buffer )
1137 int new_size = b->yy_buf_size * 2;
1139 if ( new_size <= 0 )
1140 b->yy_buf_size += b->yy_buf_size / 8;
1142 b->yy_buf_size *= 2;
1144 b->yy_ch_buf = (char *)
1145 /* Include room in for 2 EOB chars. */
1146 rcsrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1149 /* Can't grow it, we don't own it. */
1152 if ( ! b->yy_ch_buf )
1154 "fatal error - scanner input buffer overflow" );
1156 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1158 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1163 if ( num_to_read > YY_READ_BUF_SIZE )
1164 num_to_read = YY_READ_BUF_SIZE;
1166 /* Read in more data. */
1167 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1168 yyg->yy_n_chars, (size_t) num_to_read );
1170 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1173 if ( yyg->yy_n_chars == 0 )
1175 if ( number_to_move == YY_MORE_ADJ )
1177 ret_val = EOB_ACT_END_OF_FILE;
1178 rcsrestart(yyin ,yyscanner);
1183 ret_val = EOB_ACT_LAST_MATCH;
1184 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1185 YY_BUFFER_EOF_PENDING;
1190 ret_val = EOB_ACT_CONTINUE_SCAN;
1192 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1193 /* Extend the array by 50%, plus the number we really need. */
1194 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1195 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) rcsrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1196 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1197 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1200 yyg->yy_n_chars += number_to_move;
1201 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1202 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1204 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1209 /* yy_get_previous_state - get the state just before the EOB char was reached */
1211 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1213 register yy_state_type yy_current_state;
1214 register char *yy_cp;
1215 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1217 yy_current_state = yyg->yy_start;
1219 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1221 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1222 if ( yy_accept[yy_current_state] )
1224 yyg->yy_last_accepting_state = yy_current_state;
1225 yyg->yy_last_accepting_cpos = yy_cp;
1227 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1229 yy_current_state = (int) yy_def[yy_current_state];
1230 if ( yy_current_state >= 89 )
1231 yy_c = yy_meta[(unsigned int) yy_c];
1233 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1236 return yy_current_state;
1239 /* yy_try_NUL_trans - try to make a transition on the NUL character
1242 * next_state = yy_try_NUL_trans( current_state );
1244 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1246 register int yy_is_jam;
1247 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1248 register char *yy_cp = yyg->yy_c_buf_p;
1250 register YY_CHAR yy_c = 1;
1251 if ( yy_accept[yy_current_state] )
1253 yyg->yy_last_accepting_state = yy_current_state;
1254 yyg->yy_last_accepting_cpos = yy_cp;
1256 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1258 yy_current_state = (int) yy_def[yy_current_state];
1259 if ( yy_current_state >= 89 )
1260 yy_c = yy_meta[(unsigned int) yy_c];
1262 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1263 yy_is_jam = (yy_current_state == 88);
1265 return yy_is_jam ? 0 : yy_current_state;
1268 static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
1270 register char *yy_cp;
1271 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1273 yy_cp = yyg->yy_c_buf_p;
1275 /* undo effects of setting up yytext */
1276 *yy_cp = yyg->yy_hold_char;
1278 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1279 { /* need to shift things up to make room */
1280 /* +2 for EOB chars. */
1281 register int number_to_move = yyg->yy_n_chars + 2;
1282 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1283 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1284 register char *source =
1285 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1287 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1288 *--dest = *--source;
1290 yy_cp += (int) (dest - source);
1291 yy_bp += (int) (dest - source);
1292 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1293 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1295 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1296 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1299 *--yy_cp = (char) c;
1301 yyg->yytext_ptr = yy_bp;
1302 yyg->yy_hold_char = *yy_cp;
1303 yyg->yy_c_buf_p = yy_cp;
1308 static int yyinput (yyscan_t yyscanner)
1310 static int input (yyscan_t yyscanner)
1315 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1317 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1319 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1321 /* yy_c_buf_p now points to the character we want to return.
1322 * If this occurs *before* the EOB characters, then it's a
1323 * valid NUL; if not, then we've hit the end of the buffer.
1325 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1326 /* This was really a NUL. */
1327 *yyg->yy_c_buf_p = '\0';
1330 { /* need more input */
1331 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1334 switch ( yy_get_next_buffer( yyscanner ) )
1336 case EOB_ACT_LAST_MATCH:
1337 /* This happens because yy_g_n_b()
1338 * sees that we've accumulated a
1339 * token and flags that we need to
1340 * try matching the token before
1341 * proceeding. But for input(),
1342 * there's no matching to consider.
1343 * So convert the EOB_ACT_LAST_MATCH
1344 * to EOB_ACT_END_OF_FILE.
1347 /* Reset buffer status. */
1348 rcsrestart(yyin ,yyscanner);
1352 case EOB_ACT_END_OF_FILE:
1354 if ( rcswrap(yyscanner ) )
1357 if ( ! yyg->yy_did_buffer_switch_on_eof )
1360 return yyinput(yyscanner);
1362 return input(yyscanner);
1366 case EOB_ACT_CONTINUE_SCAN:
1367 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1373 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1374 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1375 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1379 #endif /* ifndef YY_NO_INPUT */
1381 /** Immediately switch to a different input stream.
1382 * @param input_file A readable stream.
1383 * @param yyscanner The scanner object.
1384 * @note This function does not reset the start condition to @c INITIAL .
1386 void rcsrestart (FILE * input_file , yyscan_t yyscanner)
1388 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1390 if ( ! YY_CURRENT_BUFFER ){
1391 rcsensure_buffer_stack (yyscanner);
1392 YY_CURRENT_BUFFER_LVALUE =
1393 rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1396 rcs_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1397 rcs_load_buffer_state(yyscanner );
1400 /** Switch to a different input buffer.
1401 * @param new_buffer The new input buffer.
1402 * @param yyscanner The scanner object.
1404 void rcs_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1406 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1408 /* TODO. We should be able to replace this entire function body
1410 * rcspop_buffer_state();
1411 * rcspush_buffer_state(new_buffer);
1413 rcsensure_buffer_stack (yyscanner);
1414 if ( YY_CURRENT_BUFFER == new_buffer )
1417 if ( YY_CURRENT_BUFFER )
1419 /* Flush out information for old buffer. */
1420 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1421 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1422 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1425 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1426 rcs_load_buffer_state(yyscanner );
1428 /* We don't actually know whether we did this switch during
1429 * EOF (rcswrap()) processing, but the only time this flag
1430 * is looked at is after rcswrap() is called, so it's safe
1431 * to go ahead and always set it.
1433 yyg->yy_did_buffer_switch_on_eof = 1;
1436 static void rcs_load_buffer_state (yyscan_t yyscanner)
1438 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1439 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1440 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1441 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1442 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1445 /** Allocate and initialize an input buffer state.
1446 * @param file A readable stream.
1447 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1448 * @param yyscanner The scanner object.
1449 * @return the allocated buffer state.
1451 YY_BUFFER_STATE rcs_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1455 b = (YY_BUFFER_STATE) rcsalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1457 YY_FATAL_ERROR( "out of dynamic memory in rcs_create_buffer()" );
1459 b->yy_buf_size = size;
1461 /* yy_ch_buf has to be 2 characters longer than the size given because
1462 * we need to put in 2 end-of-buffer characters.
1464 b->yy_ch_buf = (char *) rcsalloc(b->yy_buf_size + 2 ,yyscanner );
1465 if ( ! b->yy_ch_buf )
1466 YY_FATAL_ERROR( "out of dynamic memory in rcs_create_buffer()" );
1468 b->yy_is_our_buffer = 1;
1470 rcs_init_buffer(b,file ,yyscanner);
1475 /** Destroy the buffer.
1476 * @param b a buffer created with rcs_create_buffer()
1477 * @param yyscanner The scanner object.
1479 void rcs_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1481 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1486 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1487 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1489 if ( b->yy_is_our_buffer )
1490 rcsfree((void *) b->yy_ch_buf ,yyscanner );
1492 rcsfree((void *) b ,yyscanner );
1496 extern int isatty (int );
1497 #endif /* __cplusplus */
1499 /* Initializes or reinitializes a buffer.
1500 * This function is sometimes called more than once on the same buffer,
1501 * such as during a rcsrestart() or at EOF.
1503 static void rcs_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1507 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1509 rcs_flush_buffer(b ,yyscanner);
1511 b->yy_input_file = file;
1512 b->yy_fill_buffer = 1;
1514 /* If b is the current buffer, then rcs_init_buffer was _probably_
1515 * called from rcsrestart() or through yy_get_next_buffer.
1516 * In that case, we don't want to reset the lineno or column.
1518 if (b != YY_CURRENT_BUFFER){
1519 b->yy_bs_lineno = 1;
1520 b->yy_bs_column = 0;
1523 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1528 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1529 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1530 * @param yyscanner The scanner object.
1532 void rcs_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1534 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1540 /* We always need two end-of-buffer characters. The first causes
1541 * a transition to the end-of-buffer state. The second causes
1542 * a jam in that state.
1544 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1545 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1547 b->yy_buf_pos = &b->yy_ch_buf[0];
1550 b->yy_buffer_status = YY_BUFFER_NEW;
1552 if ( b == YY_CURRENT_BUFFER )
1553 rcs_load_buffer_state(yyscanner );
1556 /** Pushes the new state onto the stack. The new state becomes
1557 * the current state. This function will allocate the stack
1559 * @param new_buffer The new state.
1560 * @param yyscanner The scanner object.
1562 void rcspush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1564 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1565 if (new_buffer == NULL)
1568 rcsensure_buffer_stack(yyscanner);
1570 /* This block is copied from rcs_switch_to_buffer. */
1571 if ( YY_CURRENT_BUFFER )
1573 /* Flush out information for old buffer. */
1574 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1575 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1576 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1579 /* Only push if top exists. Otherwise, replace top. */
1580 if (YY_CURRENT_BUFFER)
1581 yyg->yy_buffer_stack_top++;
1582 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1584 /* copied from rcs_switch_to_buffer. */
1585 rcs_load_buffer_state(yyscanner );
1586 yyg->yy_did_buffer_switch_on_eof = 1;
1589 /** Removes and deletes the top of the stack, if present.
1590 * The next element becomes the new top.
1591 * @param yyscanner The scanner object.
1593 void rcspop_buffer_state (yyscan_t yyscanner)
1595 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1596 if (!YY_CURRENT_BUFFER)
1599 rcs_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1600 YY_CURRENT_BUFFER_LVALUE = NULL;
1601 if (yyg->yy_buffer_stack_top > 0)
1602 --yyg->yy_buffer_stack_top;
1604 if (YY_CURRENT_BUFFER) {
1605 rcs_load_buffer_state(yyscanner );
1606 yyg->yy_did_buffer_switch_on_eof = 1;
1610 /* Allocates the stack if it does not exist.
1611 * Guarantees space for at least one push.
1613 static void rcsensure_buffer_stack (yyscan_t yyscanner)
1616 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1618 if (!yyg->yy_buffer_stack) {
1620 /* First allocation is just for 2 elements, since we don't know if this
1621 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1622 * immediate realloc on the next call.
1625 yyg->yy_buffer_stack = (struct yy_buffer_state**)rcsalloc
1626 (num_to_alloc * sizeof(struct yy_buffer_state*)
1628 if ( ! yyg->yy_buffer_stack )
1629 YY_FATAL_ERROR( "out of dynamic memory in rcsensure_buffer_stack()" );
1631 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1633 yyg->yy_buffer_stack_max = num_to_alloc;
1634 yyg->yy_buffer_stack_top = 0;
1638 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1640 /* Increase the buffer to prepare for a possible push. */
1641 int grow_size = 8 /* arbitrary grow size */;
1643 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1644 yyg->yy_buffer_stack = (struct yy_buffer_state**)rcsrealloc
1645 (yyg->yy_buffer_stack,
1646 num_to_alloc * sizeof(struct yy_buffer_state*)
1648 if ( ! yyg->yy_buffer_stack )
1649 YY_FATAL_ERROR( "out of dynamic memory in rcsensure_buffer_stack()" );
1651 /* zero only the new slots.*/
1652 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1653 yyg->yy_buffer_stack_max = num_to_alloc;
1657 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1658 * @param base the character buffer
1659 * @param size the size in bytes of the character buffer
1660 * @param yyscanner The scanner object.
1661 * @return the newly allocated buffer state object.
1663 YY_BUFFER_STATE rcs_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1668 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1669 base[size-1] != YY_END_OF_BUFFER_CHAR )
1670 /* They forgot to leave room for the EOB's. */
1673 b = (YY_BUFFER_STATE) rcsalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1675 YY_FATAL_ERROR( "out of dynamic memory in rcs_scan_buffer()" );
1677 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1678 b->yy_buf_pos = b->yy_ch_buf = base;
1679 b->yy_is_our_buffer = 0;
1680 b->yy_input_file = 0;
1681 b->yy_n_chars = b->yy_buf_size;
1682 b->yy_is_interactive = 0;
1684 b->yy_fill_buffer = 0;
1685 b->yy_buffer_status = YY_BUFFER_NEW;
1687 rcs_switch_to_buffer(b ,yyscanner );
1692 /** Setup the input buffer state to scan a string. The next call to rcslex() will
1693 * scan from a @e copy of @a str.
1694 * @param yystr a NUL-terminated string to scan
1695 * @param yyscanner The scanner object.
1696 * @return the newly allocated buffer state object.
1697 * @note If you want to scan bytes that may contain NUL values, then use
1698 * rcs_scan_bytes() instead.
1700 YY_BUFFER_STATE rcs_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1703 return rcs_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1706 /** Setup the input buffer state to scan the given bytes. The next call to rcslex() will
1707 * scan from a @e copy of @a bytes.
1708 * @param bytes the byte buffer to scan
1709 * @param len the number of bytes in the buffer pointed to by @a bytes.
1710 * @param yyscanner The scanner object.
1711 * @return the newly allocated buffer state object.
1713 YY_BUFFER_STATE rcs_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1720 /* Get memory for full buffer, including space for trailing EOB's. */
1721 n = _yybytes_len + 2;
1722 buf = (char *) rcsalloc(n ,yyscanner );
1724 YY_FATAL_ERROR( "out of dynamic memory in rcs_scan_bytes()" );
1726 for ( i = 0; i < _yybytes_len; ++i )
1727 buf[i] = yybytes[i];
1729 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1731 b = rcs_scan_buffer(buf,n ,yyscanner);
1733 YY_FATAL_ERROR( "bad buffer in rcs_scan_bytes()" );
1735 /* It's okay to grow etc. this buffer, and we should throw it
1736 * away when we're done.
1738 b->yy_is_our_buffer = 1;
1743 #ifndef YY_EXIT_FAILURE
1744 #define YY_EXIT_FAILURE 2
1747 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1749 (void) fprintf( stderr, "%s\n", msg );
1750 exit( YY_EXIT_FAILURE );
1753 /* Redefine yyless() so it works in section 3 code. */
1759 /* Undo effects of setting up yytext. */ \
1760 int yyless_macro_arg = (n); \
1761 YY_LESS_LINENO(yyless_macro_arg);\
1762 yytext[yyleng] = yyg->yy_hold_char; \
1763 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1764 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1765 *yyg->yy_c_buf_p = '\0'; \
1766 yyleng = yyless_macro_arg; \
1770 /* Accessor methods (get/set functions) to struct members. */
1772 /** Get the user-defined data for this scanner.
1773 * @param yyscanner The scanner object.
1775 YY_EXTRA_TYPE rcsget_extra (yyscan_t yyscanner)
1777 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1781 /** Get the current line number.
1782 * @param yyscanner The scanner object.
1784 int rcsget_lineno (yyscan_t yyscanner)
1786 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1788 if (! YY_CURRENT_BUFFER)
1794 /** Get the current column number.
1795 * @param yyscanner The scanner object.
1797 int rcsget_column (yyscan_t yyscanner)
1799 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1801 if (! YY_CURRENT_BUFFER)
1807 /** Get the input stream.
1808 * @param yyscanner The scanner object.
1810 FILE *rcsget_in (yyscan_t yyscanner)
1812 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1816 /** Get the output stream.
1817 * @param yyscanner The scanner object.
1819 FILE *rcsget_out (yyscan_t yyscanner)
1821 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1825 /** Get the length of the current token.
1826 * @param yyscanner The scanner object.
1828 int rcsget_leng (yyscan_t yyscanner)
1830 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1834 /** Get the current token.
1835 * @param yyscanner The scanner object.
1838 char *rcsget_text (yyscan_t yyscanner)
1840 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1844 /** Set the user-defined data. This data is never touched by the scanner.
1845 * @param user_defined The data to be associated with this scanner.
1846 * @param yyscanner The scanner object.
1848 void rcsset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1850 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1851 yyextra = user_defined ;
1854 /** Set the current line number.
1855 * @param line_number
1856 * @param yyscanner The scanner object.
1858 void rcsset_lineno (int line_number , yyscan_t yyscanner)
1860 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1862 /* lineno is only valid if an input buffer exists. */
1863 if (! YY_CURRENT_BUFFER )
1864 yy_fatal_error( "rcsset_lineno called with no buffer" , yyscanner);
1866 yylineno = line_number;
1869 /** Set the current column.
1870 * @param line_number
1871 * @param yyscanner The scanner object.
1873 void rcsset_column (int column_no , yyscan_t yyscanner)
1875 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1877 /* column is only valid if an input buffer exists. */
1878 if (! YY_CURRENT_BUFFER )
1879 yy_fatal_error( "rcsset_column called with no buffer" , yyscanner);
1881 yycolumn = column_no;
1884 /** Set the input stream. This does not discard the current
1886 * @param in_str A readable stream.
1887 * @param yyscanner The scanner object.
1888 * @see rcs_switch_to_buffer
1890 void rcsset_in (FILE * in_str , yyscan_t yyscanner)
1892 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1896 void rcsset_out (FILE * out_str , yyscan_t yyscanner)
1898 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1902 int rcsget_debug (yyscan_t yyscanner)
1904 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1905 return yy_flex_debug;
1908 void rcsset_debug (int bdebug , yyscan_t yyscanner)
1910 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1911 yy_flex_debug = bdebug ;
1914 /* Accessor methods for yylval and yylloc */
1916 /* User-visible API */
1918 /* rcslex_init is special because it creates the scanner itself, so it is
1919 * the ONLY reentrant function that doesn't take the scanner as the last argument.
1920 * That's why we explicitly handle the declaration, instead of using our macros.
1923 int rcslex_init(yyscan_t* ptr_yy_globals)
1926 if (ptr_yy_globals == NULL){
1931 *ptr_yy_globals = (yyscan_t) rcsalloc ( sizeof( struct yyguts_t ), NULL );
1933 if (*ptr_yy_globals == NULL){
1938 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
1939 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
1941 return yy_init_globals ( *ptr_yy_globals );
1944 /* rcslex_init_extra has the same functionality as rcslex_init, but follows the
1945 * convention of taking the scanner as the last argument. Note however, that
1946 * this is a *pointer* to a scanner, as it will be allocated by this call (and
1947 * is the reason, too, why this function also must handle its own declaration).
1948 * The user defined value in the first argument will be available to rcsalloc in
1949 * the yyextra field.
1952 int rcslex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
1955 struct yyguts_t dummy_yyguts;
1957 rcsset_extra (yy_user_defined, &dummy_yyguts);
1959 if (ptr_yy_globals == NULL){
1964 *ptr_yy_globals = (yyscan_t) rcsalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
1966 if (*ptr_yy_globals == NULL){
1971 /* By setting to 0xAA, we expose bugs in
1972 yy_init_globals. Leave at 0x00 for releases. */
1973 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
1975 rcsset_extra (yy_user_defined, *ptr_yy_globals);
1977 return yy_init_globals ( *ptr_yy_globals );
1980 static int yy_init_globals (yyscan_t yyscanner)
1982 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1983 /* Initialization is the same as for the non-reentrant scanner.
1984 * This function is called from rcslex_destroy(), so don't allocate here.
1987 yyg->yy_buffer_stack = 0;
1988 yyg->yy_buffer_stack_top = 0;
1989 yyg->yy_buffer_stack_max = 0;
1990 yyg->yy_c_buf_p = (char *) 0;
1994 yyg->yy_start_stack_ptr = 0;
1995 yyg->yy_start_stack_depth = 0;
1996 yyg->yy_start_stack = NULL;
1998 /* Defined in main.c */
2007 /* For future reference: Set errno on error, since we are called by
2013 /* rcslex_destroy is for both reentrant and non-reentrant scanners. */
2014 int rcslex_destroy (yyscan_t yyscanner)
2016 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2018 /* Pop the buffer stack, destroying each element. */
2019 while(YY_CURRENT_BUFFER){
2020 rcs_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2021 YY_CURRENT_BUFFER_LVALUE = NULL;
2022 rcspop_buffer_state(yyscanner);
2025 /* Destroy the stack itself. */
2026 rcsfree(yyg->yy_buffer_stack ,yyscanner);
2027 yyg->yy_buffer_stack = NULL;
2029 /* Destroy the start condition stack. */
2030 rcsfree(yyg->yy_start_stack ,yyscanner );
2031 yyg->yy_start_stack = NULL;
2033 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2034 * rcslex() is called, initialization will occur. */
2035 yy_init_globals( yyscanner);
2037 /* Destroy the main struct (reentrant only). */
2038 rcsfree ( yyscanner , yyscanner );
2044 * Internal utility routines.
2048 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2051 for ( i = 0; i < n; ++i )
2056 #ifdef YY_NEED_STRLEN
2057 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2060 for ( n = 0; s[n]; ++n )
2067 void *rcsalloc (yy_size_t size , yyscan_t yyscanner)
2069 return (void *) malloc( size );
2072 void *rcsrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2074 /* The cast to (char *) in the following accommodates both
2075 * implementations that use char* generic pointers, and those
2076 * that use void* generic pointers. It works with the latter
2077 * because both ANSI C and C++ allow castless assignment from
2078 * any pointer type to void*, and deal with argument conversions
2079 * as though doing an assignment.
2081 return (void *) realloc( (char *) ptr, size );
2084 void rcsfree (void * ptr , yyscan_t yyscanner)
2086 free( (char *) ptr ); /* see rcsrealloc() for (char *) cast */
2089 #define YYTABLES_NAME "yytables"
2091 #line 73 "rcstokenizer.l"