1184054Slulf 2184054Slulf#line 3 "lex.rcs.c" 3184054Slulf 4184054Slulf#define YY_INT_ALIGNED short int 5184054Slulf 6184054Slulf/* A lexical scanner generated by flex */ 7184054Slulf 8184054Slulf#define FLEX_SCANNER 9184054Slulf#define YY_FLEX_MAJOR_VERSION 2 10184054Slulf#define YY_FLEX_MINOR_VERSION 5 11184054Slulf#define YY_FLEX_SUBMINOR_VERSION 35 12184054Slulf#if YY_FLEX_SUBMINOR_VERSION > 0 13184054Slulf#define FLEX_BETA 14184054Slulf#endif 15184054Slulf 16184054Slulf/* First, we deal with platform-specific or compiler-specific issues. */ 17184054Slulf 18184054Slulf/* begin standard C headers. */ 19184054Slulf#include <stdio.h> 20184054Slulf#include <string.h> 21184054Slulf#include <errno.h> 22184054Slulf#include <stdlib.h> 23184054Slulf 24184054Slulf/* end standard C headers. */ 25184054Slulf 26184054Slulf/* flex integer type definitions */ 27184054Slulf 28184054Slulf#ifndef FLEXINT_H 29184054Slulf#define FLEXINT_H 30184054Slulf 31184054Slulf/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 32184054Slulf 33184054Slulf#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 34184054Slulf 35184054Slulf/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 36184054Slulf * if you want the limit (max/min) macros for int types. 37184054Slulf */ 38184054Slulf#ifndef __STDC_LIMIT_MACROS 39184054Slulf#define __STDC_LIMIT_MACROS 1 40184054Slulf#endif 41184054Slulf 42184054Slulf#include <inttypes.h> 43184054Slulftypedef int8_t flex_int8_t; 44184054Slulftypedef uint8_t flex_uint8_t; 45184054Slulftypedef int16_t flex_int16_t; 46184054Slulftypedef uint16_t flex_uint16_t; 47184054Slulftypedef int32_t flex_int32_t; 48184054Slulftypedef uint32_t flex_uint32_t; 49184054Slulf#else 50184054Slulftypedef signed char flex_int8_t; 51184054Slulftypedef short int flex_int16_t; 52184054Slulftypedef int flex_int32_t; 53184054Slulftypedef unsigned char flex_uint8_t; 54184054Slulftypedef unsigned short int flex_uint16_t; 55184054Slulftypedef unsigned int flex_uint32_t; 56184054Slulf#endif /* ! C99 */ 57184054Slulf 58184054Slulf/* Limits of integral types. */ 59184054Slulf#ifndef INT8_MIN 60184054Slulf#define INT8_MIN (-128) 61184054Slulf#endif 62184054Slulf#ifndef INT16_MIN 63184054Slulf#define INT16_MIN (-32767-1) 64184054Slulf#endif 65184054Slulf#ifndef INT32_MIN 66184054Slulf#define INT32_MIN (-2147483647-1) 67184054Slulf#endif 68184054Slulf#ifndef INT8_MAX 69184054Slulf#define INT8_MAX (127) 70184054Slulf#endif 71184054Slulf#ifndef INT16_MAX 72184054Slulf#define INT16_MAX (32767) 73184054Slulf#endif 74184054Slulf#ifndef INT32_MAX 75184054Slulf#define INT32_MAX (2147483647) 76184054Slulf#endif 77184054Slulf#ifndef UINT8_MAX 78184054Slulf#define UINT8_MAX (255U) 79184054Slulf#endif 80184054Slulf#ifndef UINT16_MAX 81184054Slulf#define UINT16_MAX (65535U) 82184054Slulf#endif 83184054Slulf#ifndef UINT32_MAX 84184054Slulf#define UINT32_MAX (4294967295U) 85184054Slulf#endif 86184054Slulf 87184054Slulf#endif /* ! FLEXINT_H */ 88184054Slulf 89184054Slulf#ifdef __cplusplus 90184054Slulf 91184054Slulf/* The "const" storage-class-modifier is valid. */ 92184054Slulf#define YY_USE_CONST 93184054Slulf 94184054Slulf#else /* ! __cplusplus */ 95184054Slulf 96184054Slulf/* C99 requires __STDC__ to be defined as 1. */ 97184054Slulf#if defined (__STDC__) 98184054Slulf 99184054Slulf#define YY_USE_CONST 100184054Slulf 101184054Slulf#endif /* defined (__STDC__) */ 102184054Slulf#endif /* ! __cplusplus */ 103184054Slulf 104184054Slulf#ifdef YY_USE_CONST 105184054Slulf#define yyconst const 106184054Slulf#else 107184054Slulf#define yyconst 108184054Slulf#endif 109184054Slulf 110184054Slulf/* Returned upon end-of-file. */ 111184054Slulf#define YY_NULL 0 112184054Slulf 113184054Slulf/* Promotes a possibly negative, possibly signed char to an unsigned 114184054Slulf * integer for use as an array index. If the signed char is negative, 115184054Slulf * we want to instead treat it as an 8-bit unsigned char, hence the 116184054Slulf * double cast. 117184054Slulf */ 118184054Slulf#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 119184054Slulf 120184054Slulf/* An opaque pointer. */ 121184054Slulf#ifndef YY_TYPEDEF_YY_SCANNER_T 122184054Slulf#define YY_TYPEDEF_YY_SCANNER_T 123184054Slulftypedef void* yyscan_t; 124184054Slulf#endif 125184054Slulf 126184054Slulf/* For convenience, these vars (plus the bison vars far below) 127184054Slulf are macros in the reentrant scanner. */ 128184054Slulf#define yyin yyg->yyin_r 129184054Slulf#define yyout yyg->yyout_r 130184054Slulf#define yyextra yyg->yyextra_r 131184054Slulf#define yyleng yyg->yyleng_r 132184054Slulf#define yytext yyg->yytext_r 133184054Slulf#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) 134184054Slulf#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) 135184054Slulf#define yy_flex_debug yyg->yy_flex_debug_r 136184054Slulf 137184054Slulf/* Enter a start condition. This macro really ought to take a parameter, 138184054Slulf * but we do it the disgusting crufty way forced on us by the ()-less 139184054Slulf * definition of BEGIN. 140184054Slulf */ 141184054Slulf#define BEGIN yyg->yy_start = 1 + 2 * 142184054Slulf 143184054Slulf/* Translate the current start state into a value that can be later handed 144184054Slulf * to BEGIN to return to the state. The YYSTATE alias is for lex 145184054Slulf * compatibility. 146184054Slulf */ 147184054Slulf#define YY_START ((yyg->yy_start - 1) / 2) 148184054Slulf#define YYSTATE YY_START 149184054Slulf 150184054Slulf/* Action number for EOF rule of a given start state. */ 151184054Slulf#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 152184054Slulf 153184054Slulf/* Special action meaning "start processing a new file". */ 154184054Slulf#define YY_NEW_FILE rcsrestart(yyin ,yyscanner ) 155184054Slulf 156184054Slulf#define YY_END_OF_BUFFER_CHAR 0 157184054Slulf 158184054Slulf/* Size of default input buffer. */ 159184054Slulf#ifndef YY_BUF_SIZE 160184054Slulf#define YY_BUF_SIZE 16384 161184054Slulf#endif 162184054Slulf 163184054Slulf/* The state buf must be large enough to hold one state per character in the main buffer. 164184054Slulf */ 165184054Slulf#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 166184054Slulf 167184054Slulf#ifndef YY_TYPEDEF_YY_BUFFER_STATE 168184054Slulf#define YY_TYPEDEF_YY_BUFFER_STATE 169184054Slulftypedef struct yy_buffer_state *YY_BUFFER_STATE; 170184054Slulf#endif 171184054Slulf 172184054Slulf#define EOB_ACT_CONTINUE_SCAN 0 173184054Slulf#define EOB_ACT_END_OF_FILE 1 174184054Slulf#define EOB_ACT_LAST_MATCH 2 175184054Slulf 176184054Slulf #define YY_LESS_LINENO(n) 177184054Slulf 178184054Slulf/* Return all but the first "n" matched characters back to the input stream. */ 179184054Slulf#define yyless(n) \ 180184054Slulf do \ 181184054Slulf { \ 182184054Slulf /* Undo effects of setting up yytext. */ \ 183184054Slulf int yyless_macro_arg = (n); \ 184184054Slulf YY_LESS_LINENO(yyless_macro_arg);\ 185184054Slulf *yy_cp = yyg->yy_hold_char; \ 186184054Slulf YY_RESTORE_YY_MORE_OFFSET \ 187184054Slulf yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 188184054Slulf YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 189184054Slulf } \ 190184054Slulf while ( 0 ) 191184054Slulf 192184054Slulf#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) 193184054Slulf 194184054Slulf#ifndef YY_TYPEDEF_YY_SIZE_T 195184054Slulf#define YY_TYPEDEF_YY_SIZE_T 196184054Slulftypedef size_t yy_size_t; 197184054Slulf#endif 198184054Slulf 199184054Slulf#ifndef YY_STRUCT_YY_BUFFER_STATE 200184054Slulf#define YY_STRUCT_YY_BUFFER_STATE 201184054Slulfstruct yy_buffer_state 202184054Slulf { 203184054Slulf FILE *yy_input_file; 204184054Slulf 205184054Slulf char *yy_ch_buf; /* input buffer */ 206184054Slulf char *yy_buf_pos; /* current position in input buffer */ 207184054Slulf 208184054Slulf /* Size of input buffer in bytes, not including room for EOB 209184054Slulf * characters. 210184054Slulf */ 211184054Slulf yy_size_t yy_buf_size; 212184054Slulf 213184054Slulf /* Number of characters read into yy_ch_buf, not including EOB 214184054Slulf * characters. 215184054Slulf */ 216184054Slulf int yy_n_chars; 217184054Slulf 218184054Slulf /* Whether we "own" the buffer - i.e., we know we created it, 219184054Slulf * and can realloc() it to grow it, and should free() it to 220184054Slulf * delete it. 221184054Slulf */ 222184054Slulf int yy_is_our_buffer; 223184054Slulf 224184054Slulf /* Whether this is an "interactive" input source; if so, and 225184054Slulf * if we're using stdio for input, then we want to use getc() 226184054Slulf * instead of fread(), to make sure we stop fetching input after 227184054Slulf * each newline. 228184054Slulf */ 229184054Slulf int yy_is_interactive; 230184054Slulf 231184054Slulf /* Whether we're considered to be at the beginning of a line. 232184054Slulf * If so, '^' rules will be active on the next match, otherwise 233184054Slulf * not. 234184054Slulf */ 235184054Slulf int yy_at_bol; 236184054Slulf 237184054Slulf int yy_bs_lineno; /**< The line count. */ 238184054Slulf int yy_bs_column; /**< The column count. */ 239184054Slulf 240184054Slulf /* Whether to try to fill the input buffer when we reach the 241184054Slulf * end of it. 242184054Slulf */ 243184054Slulf int yy_fill_buffer; 244184054Slulf 245184054Slulf int yy_buffer_status; 246184054Slulf 247184054Slulf#define YY_BUFFER_NEW 0 248184054Slulf#define YY_BUFFER_NORMAL 1 249184054Slulf /* When an EOF's been seen but there's still some text to process 250184054Slulf * then we mark the buffer as YY_EOF_PENDING, to indicate that we 251184054Slulf * shouldn't try reading from the input source any more. We might 252184054Slulf * still have a bunch of tokens to match, though, because of 253184054Slulf * possible backing-up. 254184054Slulf * 255184054Slulf * When we actually see the EOF, we change the status to "new" 256184054Slulf * (via rcsrestart()), so that the user can continue scanning by 257184054Slulf * just pointing yyin at a new input file. 258184054Slulf */ 259184054Slulf#define YY_BUFFER_EOF_PENDING 2 260184054Slulf 261184054Slulf }; 262184054Slulf#endif /* !YY_STRUCT_YY_BUFFER_STATE */ 263184054Slulf 264184054Slulf/* We provide macros for accessing buffer states in case in the 265184054Slulf * future we want to put the buffer states in a more general 266184054Slulf * "scanner state". 267184054Slulf * 268184054Slulf * Returns the top of the stack, or NULL. 269184054Slulf */ 270184054Slulf#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ 271184054Slulf ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ 272184054Slulf : NULL) 273184054Slulf 274184054Slulf/* Same as previous macro, but useful when we know that the buffer stack is not 275184054Slulf * NULL or when we need an lvalue. For internal use only. 276184054Slulf */ 277184054Slulf#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] 278184054Slulf 279184054Slulfvoid rcsrestart (FILE *input_file ,yyscan_t yyscanner ); 280184054Slulfvoid rcs_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); 281184054SlulfYY_BUFFER_STATE rcs_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); 282184054Slulfvoid rcs_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); 283184054Slulfvoid rcs_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); 284184054Slulfvoid rcspush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); 285184054Slulfvoid rcspop_buffer_state (yyscan_t yyscanner ); 286184054Slulf 287184054Slulfstatic void rcsensure_buffer_stack (yyscan_t yyscanner ); 288184054Slulfstatic void rcs_load_buffer_state (yyscan_t yyscanner ); 289184054Slulfstatic void rcs_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); 290184054Slulf 291184054Slulf#define YY_FLUSH_BUFFER rcs_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) 292184054Slulf 293184054SlulfYY_BUFFER_STATE rcs_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); 294184054SlulfYY_BUFFER_STATE rcs_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); 295184054SlulfYY_BUFFER_STATE rcs_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); 296184054Slulf 297184054Slulfvoid *rcsalloc (yy_size_t ,yyscan_t yyscanner ); 298184054Slulfvoid *rcsrealloc (void *,yy_size_t ,yyscan_t yyscanner ); 299184054Slulfvoid rcsfree (void * ,yyscan_t yyscanner ); 300184054Slulf 301184054Slulf#define yy_new_buffer rcs_create_buffer 302184054Slulf 303184054Slulf#define yy_set_interactive(is_interactive) \ 304184054Slulf { \ 305184054Slulf if ( ! YY_CURRENT_BUFFER ){ \ 306184054Slulf rcsensure_buffer_stack (yyscanner); \ 307184054Slulf YY_CURRENT_BUFFER_LVALUE = \ 308184054Slulf rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ 309184054Slulf } \ 310184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 311184054Slulf } 312184054Slulf 313184054Slulf#define yy_set_bol(at_bol) \ 314184054Slulf { \ 315184054Slulf if ( ! YY_CURRENT_BUFFER ){\ 316184054Slulf rcsensure_buffer_stack (yyscanner); \ 317184054Slulf YY_CURRENT_BUFFER_LVALUE = \ 318184054Slulf rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ 319184054Slulf } \ 320184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 321184054Slulf } 322184054Slulf 323184054Slulf#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 324184054Slulf 325184054Slulf/* Begin user sect3 */ 326184054Slulf 327184054Slulf#define rcswrap(n) 1 328184054Slulf#define YY_SKIP_YYWRAP 329184054Slulf 330184054Slulftypedef unsigned char YY_CHAR; 331184054Slulf 332184054Slulftypedef int yy_state_type; 333184054Slulf 334184054Slulf#define yytext_ptr yytext_r 335184054Slulf 336184054Slulfstatic yy_state_type yy_get_previous_state (yyscan_t yyscanner ); 337184054Slulfstatic yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); 338184054Slulfstatic int yy_get_next_buffer (yyscan_t yyscanner ); 339184054Slulfstatic void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); 340184054Slulf 341184054Slulf/* Done after the current pattern has been matched and before the 342184054Slulf * corresponding action - sets up yytext. 343184054Slulf */ 344184054Slulf#define YY_DO_BEFORE_ACTION \ 345184054Slulf yyg->yytext_ptr = yy_bp; \ 346184054Slulf yyleng = (size_t) (yy_cp - yy_bp); \ 347184054Slulf yyg->yy_hold_char = *yy_cp; \ 348184054Slulf *yy_cp = '\0'; \ 349184054Slulf yyg->yy_c_buf_p = yy_cp; 350184054Slulf 351184054Slulf#define YY_NUM_RULES 10 352184054Slulf#define YY_END_OF_BUFFER 11 353184054Slulf/* This struct is not used in this scanner, 354184054Slulf but its presence is necessary. */ 355184054Slulfstruct yy_trans_info 356184054Slulf { 357184054Slulf flex_int32_t yy_verify; 358184054Slulf flex_int32_t yy_nxt; 359184054Slulf }; 360184054Slulfstatic yyconst flex_int16_t yy_accept[89] = 361184054Slulf { 0, 362184054Slulf 0, 0, 11, 5, 9, 8, 10, 4, 4, 7, 363184054Slulf 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 364184054Slulf 5, 5, 5, 5, 5, 9, 5, 4, 4, 5, 365184054Slulf 4, 4, 5, 0, 0, 5, 5, 3, 5, 5, 366184054Slulf 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 367184054Slulf 5, 3, 5, 5, 5, 5, 5, 5, 5, 5, 368184054Slulf 5, 2, 5, 5, 5, 5, 5, 5, 5, 5, 369184054Slulf 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 370184054Slulf 5, 5, 5, 1, 5, 5, 5, 0 371184054Slulf } ; 372184054Slulf 373184054Slulfstatic yyconst flex_int32_t yy_ec[256] = 374184054Slulf { 0, 375184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 376184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 377184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 378184054Slulf 1, 2, 1, 1, 1, 4, 1, 1, 1, 1, 379184054Slulf 1, 1, 1, 4, 1, 5, 1, 6, 6, 6, 380184054Slulf 6, 6, 6, 6, 6, 6, 6, 7, 8, 1, 381184054Slulf 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 382184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 383184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 384184054Slulf 1, 1, 1, 1, 1, 1, 10, 11, 12, 13, 385184054Slulf 386184054Slulf 14, 1, 15, 16, 17, 1, 18, 19, 20, 21, 387184054Slulf 22, 23, 1, 24, 25, 26, 27, 1, 1, 28, 388184054Slulf 29, 1, 1, 1, 1, 1, 1, 1, 1, 1, 389184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 390184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 391184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 392184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 393184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 394184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 395184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 396184054Slulf 397184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 398184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 399184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 400184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 401184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 402184054Slulf 1, 1, 1, 1, 1 403184054Slulf } ; 404184054Slulf 405184054Slulfstatic yyconst flex_int32_t yy_meta[30] = 406184054Slulf { 0, 407184054Slulf 1, 2, 2, 2, 1, 1, 2, 2, 1, 1, 408184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 409184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1 410184054Slulf } ; 411184054Slulf 412184054Slulfstatic yyconst flex_int16_t yy_base[94] = 413184054Slulf { 0, 414184054Slulf 0, 0, 136, 25, 127, 297, 297, 27, 29, 297, 415184054Slulf 297, 34, 39, 41, 47, 44, 50, 54, 57, 66, 416184054Slulf 68, 70, 76, 80, 82, 91, 84, 86, 90, 93, 417184054Slulf 95, 97, 102, 58, 61, 0, 0, 107, 109, 112, 418184054Slulf 114, 117, 120, 122, 125, 129, 137, 127, 135, 145, 419184054Slulf 148, 74, 152, 155, 157, 162, 167, 174, 164, 178, 420184054Slulf 182, 184, 187, 189, 191, 193, 196, 200, 204, 206, 421184054Slulf 214, 211, 218, 224, 228, 230, 236, 239, 241, 243, 422184054Slulf 245, 248, 250, 254, 260, 265, 267, 297, 76, 56, 423184054Slulf 47, 292, 294 424184054Slulf 425184054Slulf } ; 426184054Slulf 427184054Slulfstatic yyconst flex_int16_t yy_def[94] = 428184054Slulf { 0, 429184054Slulf 88, 1, 88, 89, 88, 88, 88, 90, 91, 88, 430184054Slulf 88, 92, 89, 89, 89, 89, 89, 89, 89, 89, 431184054Slulf 89, 89, 89, 89, 89, 88, 89, 90, 91, 89, 432184054Slulf 91, 91, 92, 93, 93, 33, 33, 89, 89, 89, 433184054Slulf 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 434184054Slulf 89, 88, 89, 89, 89, 89, 89, 89, 89, 89, 435184054Slulf 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 436184054Slulf 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 437184054Slulf 89, 89, 89, 89, 89, 89, 89, 0, 88, 88, 438184054Slulf 88, 88, 88 439184054Slulf 440184054Slulf } ; 441184054Slulf 442184054Slulfstatic yyconst flex_int16_t yy_nxt[327] = 443184054Slulf { 0, 444184054Slulf 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 445184054Slulf 14, 15, 16, 17, 4, 18, 4, 4, 19, 4, 446184054Slulf 20, 4, 4, 4, 21, 22, 4, 4, 4, 24, 447184054Slulf 25, 28, 29, 31, 32, 34, 35, 34, 36, 37, 448184054Slulf 34, 34, 38, 24, 25, 24, 25, 30, 24, 25, 449184054Slulf 39, 24, 25, 43, 24, 25, 27, 44, 24, 25, 450184054Slulf 35, 24, 25, 35, 41, 40, 52, 46, 42, 52, 451184054Slulf 24, 25, 24, 25, 24, 25, 23, 45, 47, 48, 452184054Slulf 24, 25, 34, 51, 24, 25, 24, 25, 24, 25, 453184054Slulf 28, 29, 26, 49, 31, 32, 50, 24, 25, 31, 454184054Slulf 455184054Slulf 32, 31, 32, 34, 35, 34, 36, 37, 34, 34, 456184054Slulf 38, 24, 25, 24, 25, 33, 24, 25, 24, 25, 457184054Slulf 53, 24, 25, 55, 24, 25, 24, 25, 26, 24, 458184054Slulf 25, 24, 25, 24, 25, 88, 56, 54, 60, 24, 459184054Slulf 25, 24, 25, 88, 64, 57, 58, 59, 61, 24, 460184054Slulf 25, 62, 24, 25, 63, 88, 24, 25, 65, 24, 461184054Slulf 25, 24, 25, 88, 66, 68, 24, 25, 24, 25, 462184054Slulf 69, 24, 25, 72, 88, 67, 88, 70, 24, 25, 463184054Slulf 62, 71, 24, 25, 88, 62, 24, 25, 24, 25, 464184054Slulf 62, 24, 25, 24, 25, 24, 25, 24, 25, 73, 465184054Slulf 466184054Slulf 24, 25, 88, 76, 24, 25, 88, 75, 24, 25, 467184054Slulf 24, 25, 62, 88, 74, 24, 25, 79, 24, 25, 468184054Slulf 88, 62, 24, 25, 77, 78, 88, 80, 24, 25, 469184054Slulf 88, 81, 24, 25, 24, 25, 88, 62, 88, 82, 470184054Slulf 24, 25, 62, 24, 25, 24, 25, 24, 25, 24, 471184054Slulf 25, 83, 24, 25, 24, 25, 84, 62, 24, 25, 472184054Slulf 62, 88, 62, 85, 24, 25, 88, 87, 86, 24, 473184054Slulf 25, 24, 25, 62, 88, 88, 88, 88, 88, 88, 474184054Slulf 88, 88, 88, 88, 88, 62, 88, 88, 88, 62, 475184054Slulf 88, 62, 33, 33, 34, 34, 3, 88, 88, 88, 476184054Slulf 477184054Slulf 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 478184054Slulf 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 479184054Slulf 88, 88, 88, 88, 88, 88 480184054Slulf } ; 481184054Slulf 482184054Slulfstatic yyconst flex_int16_t yy_chk[327] = 483184054Slulf { 0, 484184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 485184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 486184054Slulf 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 487184054Slulf 4, 8, 8, 9, 9, 12, 12, 12, 12, 12, 488184054Slulf 12, 12, 12, 13, 13, 14, 14, 91, 16, 16, 489184054Slulf 13, 15, 15, 16, 17, 17, 90, 16, 18, 18, 490184054Slulf 34, 19, 19, 35, 14, 13, 34, 18, 15, 35, 491184054Slulf 20, 20, 21, 21, 22, 22, 89, 17, 19, 20, 492184054Slulf 23, 23, 52, 22, 24, 24, 25, 25, 27, 27, 493184054Slulf 28, 28, 26, 21, 29, 29, 21, 30, 30, 31, 494184054Slulf 495184054Slulf 31, 32, 32, 33, 33, 33, 33, 33, 33, 33, 496184054Slulf 33, 38, 38, 39, 39, 38, 40, 40, 41, 41, 497184054Slulf 39, 42, 42, 41, 43, 43, 44, 44, 5, 45, 498184054Slulf 45, 48, 48, 46, 46, 3, 42, 40, 46, 49, 499184054Slulf 49, 47, 47, 0, 49, 43, 44, 45, 47, 50, 500184054Slulf 50, 47, 51, 51, 48, 0, 53, 53, 49, 54, 501184054Slulf 54, 55, 55, 0, 50, 53, 56, 56, 59, 59, 502184054Slulf 54, 57, 57, 59, 0, 51, 0, 55, 58, 58, 503184054Slulf 57, 56, 60, 60, 0, 58, 61, 61, 62, 62, 504184054Slulf 60, 63, 63, 64, 64, 65, 65, 66, 66, 61, 505184054Slulf 506184054Slulf 67, 67, 0, 66, 68, 68, 0, 65, 69, 69, 507184054Slulf 70, 70, 63, 0, 64, 72, 72, 70, 71, 71, 508184054Slulf 0, 67, 73, 73, 68, 69, 0, 71, 74, 74, 509184054Slulf 0, 72, 75, 75, 76, 76, 0, 74, 0, 75, 510184054Slulf 77, 77, 73, 78, 78, 79, 79, 80, 80, 81, 511184054Slulf 81, 76, 82, 82, 83, 83, 79, 81, 84, 84, 512184054Slulf 77, 0, 78, 80, 85, 85, 0, 84, 83, 86, 513184054Slulf 86, 87, 87, 82, 0, 0, 0, 0, 0, 0, 514184054Slulf 0, 0, 0, 0, 0, 85, 0, 0, 0, 86, 515184054Slulf 0, 87, 92, 92, 93, 93, 88, 88, 88, 88, 516184054Slulf 517184054Slulf 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 518184054Slulf 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 519184054Slulf 88, 88, 88, 88, 88, 88 520184054Slulf } ; 521184054Slulf 522184054Slulf/* The intent behind this definition is that it'll catch 523184054Slulf * any uses of REJECT which flex missed. 524184054Slulf */ 525184054Slulf#define REJECT reject_used_but_not_detected 526184054Slulf#define yymore() yymore_used_but_not_detected 527184054Slulf#define YY_MORE_ADJ 0 528184054Slulf#define YY_RESTORE_YY_MORE_OFFSET 529184054Slulf#line 1 "rcstokenizer.l" 530184054Slulf/*- 531184054Slulf * Copyright (c) 2007-2008, Ulf Lilleengen <lulf@FreeBSD.org> 532184054Slulf * All rights reserved. 533184054Slulf * 534184054Slulf * Redistribution and use in source and binary forms, with or without 535184054Slulf * modification, are permitted provided that the following conditions 536184054Slulf * are met: 537184054Slulf * 1. Redistributions of source code must retain the above copyright 538184054Slulf * notice, this list of conditions and the following disclaimer. 539184054Slulf * 2. Redistributions in binary form must reproduce the above copyright 540184054Slulf * notice, this list of conditions and the following disclaimer in the 541184054Slulf * documentation and/or other materials provided with the distribution. 542184054Slulf * 543184054Slulf * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 544184054Slulf * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 545184054Slulf * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 546184054Slulf * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 547184054Slulf * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 548184054Slulf * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 549184054Slulf * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 550184054Slulf * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 551184054Slulf * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 552184054Slulf * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 553184054Slulf * SUCH DAMAGE. 554184054Slulf * 555184054Slulf * $FreeBSD$ 556184054Slulf * 557184054Slulf */ 558184054Slulf/* 559184054Slulf * This tokenizer must be generated by a lexxer with support for reentrancy. 560184054Slulf */ 561184054Slulf#line 34 "rcstokenizer.l" 562184054Slulf#include <string.h> 563184054Slulf#include "misc.h" 564184054Slulf#include "rcsparse.h" 565184054Slulf 566184054Slulf#line 567 "lex.rcs.c" 567184054Slulf 568184054Slulf#define INITIAL 0 569184054Slulf 570184054Slulf#ifndef YY_NO_UNISTD_H 571184054Slulf/* Special case for "unistd.h", since it is non-ANSI. We include it way 572184054Slulf * down here because we want the user's section 1 to have been scanned first. 573184054Slulf * The user has a chance to override it with an option. 574184054Slulf */ 575184054Slulf#include <unistd.h> 576184054Slulf#endif 577184054Slulf 578184054Slulf#ifndef YY_EXTRA_TYPE 579184054Slulf#define YY_EXTRA_TYPE void * 580184054Slulf#endif 581184054Slulf 582184054Slulf/* Holds the entire state of the reentrant scanner. */ 583184054Slulfstruct yyguts_t 584184054Slulf { 585184054Slulf 586184054Slulf /* User-defined. Not touched by flex. */ 587184054Slulf YY_EXTRA_TYPE yyextra_r; 588184054Slulf 589184054Slulf /* The rest are the same as the globals declared in the non-reentrant scanner. */ 590184054Slulf FILE *yyin_r, *yyout_r; 591184054Slulf size_t yy_buffer_stack_top; /**< index of top of stack. */ 592184054Slulf size_t yy_buffer_stack_max; /**< capacity of stack. */ 593184054Slulf YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ 594184054Slulf char yy_hold_char; 595184054Slulf int yy_n_chars; 596184054Slulf int yyleng_r; 597184054Slulf char *yy_c_buf_p; 598184054Slulf int yy_init; 599184054Slulf int yy_start; 600184054Slulf int yy_did_buffer_switch_on_eof; 601184054Slulf int yy_start_stack_ptr; 602184054Slulf int yy_start_stack_depth; 603184054Slulf int *yy_start_stack; 604184054Slulf yy_state_type yy_last_accepting_state; 605184054Slulf char* yy_last_accepting_cpos; 606184054Slulf 607184054Slulf int yylineno_r; 608184054Slulf int yy_flex_debug_r; 609184054Slulf 610184054Slulf char *yytext_r; 611184054Slulf int yy_more_flag; 612184054Slulf int yy_more_len; 613184054Slulf 614184054Slulf }; /* end struct yyguts_t */ 615184054Slulf 616184054Slulfstatic int yy_init_globals (yyscan_t yyscanner ); 617184054Slulf 618184054Slulfint rcslex_init (yyscan_t* scanner); 619184054Slulf 620184054Slulfint rcslex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); 621184054Slulf 622184054Slulf/* Accessor methods to globals. 623184054Slulf These are made visible to non-reentrant scanners for convenience. */ 624184054Slulf 625184054Slulfint rcslex_destroy (yyscan_t yyscanner ); 626184054Slulf 627184054Slulfint rcsget_debug (yyscan_t yyscanner ); 628184054Slulf 629184054Slulfvoid rcsset_debug (int debug_flag ,yyscan_t yyscanner ); 630184054Slulf 631184054SlulfYY_EXTRA_TYPE rcsget_extra (yyscan_t yyscanner ); 632184054Slulf 633184054Slulfvoid rcsset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); 634184054Slulf 635184054SlulfFILE *rcsget_in (yyscan_t yyscanner ); 636184054Slulf 637184054Slulfvoid rcsset_in (FILE * in_str ,yyscan_t yyscanner ); 638184054Slulf 639184054SlulfFILE *rcsget_out (yyscan_t yyscanner ); 640184054Slulf 641184054Slulfvoid rcsset_out (FILE * out_str ,yyscan_t yyscanner ); 642184054Slulf 643184054Slulfint rcsget_leng (yyscan_t yyscanner ); 644184054Slulf 645184054Slulfchar *rcsget_text (yyscan_t yyscanner ); 646184054Slulf 647184054Slulfint rcsget_lineno (yyscan_t yyscanner ); 648184054Slulf 649184054Slulfvoid rcsset_lineno (int line_number ,yyscan_t yyscanner ); 650184054Slulf 651184054Slulf/* Macros after this point can all be overridden by user definitions in 652184054Slulf * section 1. 653184054Slulf */ 654184054Slulf 655184054Slulf#ifndef YY_SKIP_YYWRAP 656184054Slulf#ifdef __cplusplus 657184054Slulfextern "C" int rcswrap (yyscan_t yyscanner ); 658184054Slulf#else 659184054Slulfextern int rcswrap (yyscan_t yyscanner ); 660184054Slulf#endif 661184054Slulf#endif 662184054Slulf 663184054Slulf static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); 664184054Slulf 665184054Slulf#ifndef yytext_ptr 666184054Slulfstatic void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); 667184054Slulf#endif 668184054Slulf 669184054Slulf#ifdef YY_NEED_STRLEN 670184054Slulfstatic int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); 671184054Slulf#endif 672184054Slulf 673184054Slulf#ifndef YY_NO_INPUT 674184054Slulf 675184054Slulf#ifdef __cplusplus 676184054Slulfstatic int yyinput (yyscan_t yyscanner ); 677184054Slulf#else 678184054Slulfstatic int input (yyscan_t yyscanner ); 679184054Slulf#endif 680184054Slulf 681184054Slulf#endif 682184054Slulf 683184054Slulf/* Amount of stuff to slurp up with each read. */ 684184054Slulf#ifndef YY_READ_BUF_SIZE 685184054Slulf#define YY_READ_BUF_SIZE 8192 686184054Slulf#endif 687184054Slulf 688184054Slulf/* Copy whatever the last rule matched to the standard output. */ 689184054Slulf#ifndef ECHO 690184054Slulf/* This used to be an fputs(), but since the string might contain NUL's, 691184054Slulf * we now use fwrite(). 692184054Slulf */ 693184054Slulf#define ECHO fwrite( yytext, yyleng, 1, yyout ) 694184054Slulf#endif 695184054Slulf 696184054Slulf/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 697184054Slulf * is returned in "result". 698184054Slulf */ 699184054Slulf#ifndef YY_INPUT 700184054Slulf#define YY_INPUT(buf,result,max_size) \ 701184054Slulf if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 702184054Slulf { \ 703184054Slulf int c = '*'; \ 704184054Slulf int n; \ 705184054Slulf for ( n = 0; n < max_size && \ 706184054Slulf (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 707184054Slulf buf[n] = (char) c; \ 708184054Slulf if ( c == '\n' ) \ 709184054Slulf buf[n++] = (char) c; \ 710184054Slulf if ( c == EOF && ferror( yyin ) ) \ 711184054Slulf YY_FATAL_ERROR( "input in flex scanner failed" ); \ 712184054Slulf result = n; \ 713184054Slulf } \ 714184054Slulf else \ 715184054Slulf { \ 716184054Slulf errno=0; \ 717184054Slulf while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 718184054Slulf { \ 719184054Slulf if( errno != EINTR) \ 720184054Slulf { \ 721184054Slulf YY_FATAL_ERROR( "input in flex scanner failed" ); \ 722184054Slulf break; \ 723184054Slulf } \ 724184054Slulf errno=0; \ 725184054Slulf clearerr(yyin); \ 726184054Slulf } \ 727184054Slulf }\ 728184054Slulf\ 729184054Slulf 730184054Slulf#endif 731184054Slulf 732184054Slulf/* No semi-colon after return; correct usage is to write "yyterminate();" - 733184054Slulf * we don't want an extra ';' after the "return" because that will cause 734184054Slulf * some compilers to complain about unreachable statements. 735184054Slulf */ 736184054Slulf#ifndef yyterminate 737184054Slulf#define yyterminate() return YY_NULL 738184054Slulf#endif 739184054Slulf 740184054Slulf/* Number of entries by which start-condition stack grows. */ 741184054Slulf#ifndef YY_START_STACK_INCR 742184054Slulf#define YY_START_STACK_INCR 25 743184054Slulf#endif 744184054Slulf 745184054Slulf/* Report a fatal error. */ 746184054Slulf#ifndef YY_FATAL_ERROR 747184054Slulf#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) 748184054Slulf#endif 749184054Slulf 750184054Slulf/* end tables serialization structures and prototypes */ 751184054Slulf 752184054Slulf/* Default declaration of generated scanner - a define so the user can 753184054Slulf * easily add parameters. 754184054Slulf */ 755184054Slulf#ifndef YY_DECL 756184054Slulf#define YY_DECL_IS_OURS 1 757184054Slulf 758184054Slulfextern int rcslex (yyscan_t yyscanner); 759184054Slulf 760184054Slulf#define YY_DECL int rcslex (yyscan_t yyscanner) 761184054Slulf#endif /* !YY_DECL */ 762184054Slulf 763184054Slulf/* Code executed at the beginning of each rule, after yytext and yyleng 764184054Slulf * have been set up. 765184054Slulf */ 766184054Slulf#ifndef YY_USER_ACTION 767184054Slulf#define YY_USER_ACTION 768184054Slulf#endif 769184054Slulf 770184054Slulf/* Code executed at the end of each rule. */ 771184054Slulf#ifndef YY_BREAK 772184054Slulf#define YY_BREAK break; 773184054Slulf#endif 774184054Slulf 775184054Slulf#define YY_RULE_SETUP \ 776184054Slulf YY_USER_ACTION 777184054Slulf 778184054Slulf/** The main scanner function which does all the work. 779184054Slulf */ 780184054SlulfYY_DECL 781184054Slulf{ 782184054Slulf register yy_state_type yy_current_state; 783184054Slulf register char *yy_cp, *yy_bp; 784184054Slulf register int yy_act; 785184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 786184054Slulf 787184054Slulf#line 51 "rcstokenizer.l" 788184054Slulf 789184054Slulf 790184054Slulf#line 791 "lex.rcs.c" 791184054Slulf 792184054Slulf if ( !yyg->yy_init ) 793184054Slulf { 794184054Slulf yyg->yy_init = 1; 795184054Slulf 796184054Slulf#ifdef YY_USER_INIT 797184054Slulf YY_USER_INIT; 798184054Slulf#endif 799184054Slulf 800184054Slulf if ( ! yyg->yy_start ) 801184054Slulf yyg->yy_start = 1; /* first start state */ 802184054Slulf 803184054Slulf if ( ! yyin ) 804184054Slulf yyin = stdin; 805184054Slulf 806184054Slulf if ( ! yyout ) 807184054Slulf yyout = stdout; 808184054Slulf 809184054Slulf if ( ! YY_CURRENT_BUFFER ) { 810184054Slulf rcsensure_buffer_stack (yyscanner); 811184054Slulf YY_CURRENT_BUFFER_LVALUE = 812184054Slulf rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); 813184054Slulf } 814184054Slulf 815184054Slulf rcs_load_buffer_state(yyscanner ); 816184054Slulf } 817184054Slulf 818184054Slulf while ( 1 ) /* loops until end-of-file is reached */ 819184054Slulf { 820184054Slulf yy_cp = yyg->yy_c_buf_p; 821184054Slulf 822184054Slulf /* Support of yytext. */ 823184054Slulf *yy_cp = yyg->yy_hold_char; 824184054Slulf 825184054Slulf /* yy_bp points to the position in yy_ch_buf of the start of 826184054Slulf * the current run. 827184054Slulf */ 828184054Slulf yy_bp = yy_cp; 829184054Slulf 830184054Slulf yy_current_state = yyg->yy_start; 831184054Slulfyy_match: 832184054Slulf do 833184054Slulf { 834184054Slulf register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 835184054Slulf if ( yy_accept[yy_current_state] ) 836184054Slulf { 837184054Slulf yyg->yy_last_accepting_state = yy_current_state; 838184054Slulf yyg->yy_last_accepting_cpos = yy_cp; 839184054Slulf } 840184054Slulf while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 841184054Slulf { 842184054Slulf yy_current_state = (int) yy_def[yy_current_state]; 843184054Slulf if ( yy_current_state >= 89 ) 844184054Slulf yy_c = yy_meta[(unsigned int) yy_c]; 845184054Slulf } 846184054Slulf yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 847184054Slulf ++yy_cp; 848184054Slulf } 849184054Slulf while ( yy_base[yy_current_state] != 297 ); 850184054Slulf 851184054Slulfyy_find_action: 852184054Slulf yy_act = yy_accept[yy_current_state]; 853184054Slulf if ( yy_act == 0 ) 854184054Slulf { /* have to back up */ 855184054Slulf yy_cp = yyg->yy_last_accepting_cpos; 856184054Slulf yy_current_state = yyg->yy_last_accepting_state; 857184054Slulf yy_act = yy_accept[yy_current_state]; 858184054Slulf } 859184054Slulf 860184054Slulf YY_DO_BEFORE_ACTION; 861184054Slulf 862184054Slulfdo_action: /* This label is used only to access EOF actions. */ 863184054Slulf 864184054Slulf switch ( yy_act ) 865184054Slulf { /* beginning of action switch */ 866184054Slulf case 0: /* must back up */ 867184054Slulf /* undo the effects of YY_DO_BEFORE_ACTION */ 868184054Slulf *yy_cp = yyg->yy_hold_char; 869184054Slulf yy_cp = yyg->yy_last_accepting_cpos; 870184054Slulf yy_current_state = yyg->yy_last_accepting_state; 871184054Slulf goto yy_find_action; 872184054Slulf 873184054Slulfcase 1: 874184054SlulfYY_RULE_SETUP 875184054Slulf#line 53 "rcstokenizer.l" 876184054Slulf{ 877184054Slulf return (KEYWORD_TWO); 878184054Slulf} 879184054Slulf YY_BREAK 880184054Slulfcase 2: 881184054SlulfYY_RULE_SETUP 882184054Slulf#line 56 "rcstokenizer.l" 883184054Slulf{ 884184054Slulf return (KEYWORD); 885184054Slulf} 886184054Slulf YY_BREAK 887184054Slulfcase 3: 888184054Slulf/* rule 3 can match eol */ 889184054SlulfYY_RULE_SETUP 890184054Slulf#line 59 "rcstokenizer.l" 891184054Slulf{ 892184054Slulf return (STRING); 893184054Slulf} 894184054Slulf YY_BREAK 895184054Slulfcase 4: 896184054SlulfYY_RULE_SETUP 897184054Slulf#line 62 "rcstokenizer.l" 898184054Slulf{ 899184054Slulf return (NUM); 900184054Slulf} 901184054Slulf YY_BREAK 902184054Slulfcase 5: 903184054SlulfYY_RULE_SETUP 904184054Slulf#line 65 "rcstokenizer.l" 905184054Slulf{ 906184054Slulf/* This will use ID as both ID and SYM. Do extra checking elsewhere.*/ 907184054Slulf return (ID); 908184054Slulf} 909184054Slulf YY_BREAK 910184054Slulfcase 6: 911184054SlulfYY_RULE_SETUP 912184054Slulf#line 69 "rcstokenizer.l" 913184054Slulf{ return (SEMIC); } 914184054Slulf YY_BREAK 915184054Slulfcase 7: 916184054SlulfYY_RULE_SETUP 917184054Slulf#line 70 "rcstokenizer.l" 918184054Slulf{ return (COLON); } 919184054Slulf YY_BREAK 920184054Slulfcase 8: 921184054Slulf/* rule 8 can match eol */ 922184054SlulfYY_RULE_SETUP 923184054Slulf#line 71 "rcstokenizer.l" 924184054Slulf; 925184054Slulf YY_BREAK 926184054Slulfcase 9: 927184054SlulfYY_RULE_SETUP 928184054Slulf#line 72 "rcstokenizer.l" 929184054Slulf; 930184054Slulf YY_BREAK 931184054Slulfcase 10: 932184054SlulfYY_RULE_SETUP 933184054Slulf#line 73 "rcstokenizer.l" 934184054SlulfECHO; 935184054Slulf YY_BREAK 936184054Slulf#line 937 "lex.rcs.c" 937184054Slulfcase YY_STATE_EOF(INITIAL): 938184054Slulf yyterminate(); 939184054Slulf 940184054Slulf case YY_END_OF_BUFFER: 941184054Slulf { 942184054Slulf /* Amount of text matched not including the EOB char. */ 943184054Slulf int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; 944184054Slulf 945184054Slulf /* Undo the effects of YY_DO_BEFORE_ACTION. */ 946184054Slulf *yy_cp = yyg->yy_hold_char; 947184054Slulf YY_RESTORE_YY_MORE_OFFSET 948184054Slulf 949184054Slulf if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 950184054Slulf { 951184054Slulf /* We're scanning a new file or input source. It's 952184054Slulf * possible that this happened because the user 953184054Slulf * just pointed yyin at a new source and called 954184054Slulf * rcslex(). If so, then we have to assure 955184054Slulf * consistency between YY_CURRENT_BUFFER and our 956184054Slulf * globals. Here is the right place to do so, because 957184054Slulf * this is the first action (other than possibly a 958184054Slulf * back-up) that will match for the new input source. 959184054Slulf */ 960184054Slulf yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 961184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 962184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 963184054Slulf } 964184054Slulf 965184054Slulf /* Note that here we test for yy_c_buf_p "<=" to the position 966184054Slulf * of the first EOB in the buffer, since yy_c_buf_p will 967184054Slulf * already have been incremented past the NUL character 968184054Slulf * (since all states make transitions on EOB to the 969184054Slulf * end-of-buffer state). Contrast this with the test 970184054Slulf * in input(). 971184054Slulf */ 972184054Slulf if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) 973184054Slulf { /* This was really a NUL. */ 974184054Slulf yy_state_type yy_next_state; 975184054Slulf 976184054Slulf yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; 977184054Slulf 978184054Slulf yy_current_state = yy_get_previous_state( yyscanner ); 979184054Slulf 980184054Slulf /* Okay, we're now positioned to make the NUL 981184054Slulf * transition. We couldn't have 982184054Slulf * yy_get_previous_state() go ahead and do it 983184054Slulf * for us because it doesn't know how to deal 984184054Slulf * with the possibility of jamming (and we don't 985184054Slulf * want to build jamming into it because then it 986184054Slulf * will run more slowly). 987184054Slulf */ 988184054Slulf 989184054Slulf yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); 990184054Slulf 991184054Slulf yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; 992184054Slulf 993184054Slulf if ( yy_next_state ) 994184054Slulf { 995184054Slulf /* Consume the NUL. */ 996184054Slulf yy_cp = ++yyg->yy_c_buf_p; 997184054Slulf yy_current_state = yy_next_state; 998184054Slulf goto yy_match; 999184054Slulf } 1000184054Slulf 1001184054Slulf else 1002184054Slulf { 1003184054Slulf yy_cp = yyg->yy_c_buf_p; 1004184054Slulf goto yy_find_action; 1005184054Slulf } 1006184054Slulf } 1007184054Slulf 1008184054Slulf else switch ( yy_get_next_buffer( yyscanner ) ) 1009184054Slulf { 1010184054Slulf case EOB_ACT_END_OF_FILE: 1011184054Slulf { 1012184054Slulf yyg->yy_did_buffer_switch_on_eof = 0; 1013184054Slulf 1014184054Slulf if ( rcswrap(yyscanner ) ) 1015184054Slulf { 1016184054Slulf /* Note: because we've taken care in 1017184054Slulf * yy_get_next_buffer() to have set up 1018184054Slulf * yytext, we can now set up 1019184054Slulf * yy_c_buf_p so that if some total 1020184054Slulf * hoser (like flex itself) wants to 1021184054Slulf * call the scanner after we return the 1022184054Slulf * YY_NULL, it'll still work - another 1023184054Slulf * YY_NULL will get returned. 1024184054Slulf */ 1025184054Slulf yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; 1026184054Slulf 1027184054Slulf yy_act = YY_STATE_EOF(YY_START); 1028184054Slulf goto do_action; 1029184054Slulf } 1030184054Slulf 1031184054Slulf else 1032184054Slulf { 1033184054Slulf if ( ! yyg->yy_did_buffer_switch_on_eof ) 1034184054Slulf YY_NEW_FILE; 1035184054Slulf } 1036184054Slulf break; 1037184054Slulf } 1038184054Slulf 1039184054Slulf case EOB_ACT_CONTINUE_SCAN: 1040184054Slulf yyg->yy_c_buf_p = 1041184054Slulf yyg->yytext_ptr + yy_amount_of_matched_text; 1042184054Slulf 1043184054Slulf yy_current_state = yy_get_previous_state( yyscanner ); 1044184054Slulf 1045184054Slulf yy_cp = yyg->yy_c_buf_p; 1046184054Slulf yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; 1047184054Slulf goto yy_match; 1048184054Slulf 1049184054Slulf case EOB_ACT_LAST_MATCH: 1050184054Slulf yyg->yy_c_buf_p = 1051184054Slulf &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; 1052184054Slulf 1053184054Slulf yy_current_state = yy_get_previous_state( yyscanner ); 1054184054Slulf 1055184054Slulf yy_cp = yyg->yy_c_buf_p; 1056184054Slulf yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; 1057184054Slulf goto yy_find_action; 1058184054Slulf } 1059184054Slulf break; 1060184054Slulf } 1061184054Slulf 1062184054Slulf default: 1063184054Slulf YY_FATAL_ERROR( 1064184054Slulf "fatal flex scanner internal error--no action found" ); 1065184054Slulf } /* end of action switch */ 1066184054Slulf } /* end of scanning one token */ 1067184054Slulf} /* end of rcslex */ 1068184054Slulf 1069184054Slulf/* yy_get_next_buffer - try to read in a new buffer 1070184054Slulf * 1071184054Slulf * Returns a code representing an action: 1072184054Slulf * EOB_ACT_LAST_MATCH - 1073184054Slulf * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 1074184054Slulf * EOB_ACT_END_OF_FILE - end of file 1075184054Slulf */ 1076184054Slulfstatic int yy_get_next_buffer (yyscan_t yyscanner) 1077184054Slulf{ 1078184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1079184054Slulf register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 1080184054Slulf register char *source = yyg->yytext_ptr; 1081184054Slulf register int number_to_move, i; 1082184054Slulf int ret_val; 1083184054Slulf 1084184054Slulf if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) 1085184054Slulf YY_FATAL_ERROR( 1086184054Slulf "fatal flex scanner internal error--end of buffer missed" ); 1087184054Slulf 1088184054Slulf if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 1089184054Slulf { /* Don't try to fill the buffer, so this is an EOF. */ 1090184054Slulf if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) 1091184054Slulf { 1092184054Slulf /* We matched a single character, the EOB, so 1093184054Slulf * treat this as a final EOF. 1094184054Slulf */ 1095184054Slulf return EOB_ACT_END_OF_FILE; 1096184054Slulf } 1097184054Slulf 1098184054Slulf else 1099184054Slulf { 1100184054Slulf /* We matched some text prior to the EOB, first 1101184054Slulf * process it. 1102184054Slulf */ 1103184054Slulf return EOB_ACT_LAST_MATCH; 1104184054Slulf } 1105184054Slulf } 1106184054Slulf 1107184054Slulf /* Try to read more data. */ 1108184054Slulf 1109184054Slulf /* First move last chars to start of buffer. */ 1110184054Slulf number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; 1111184054Slulf 1112184054Slulf for ( i = 0; i < number_to_move; ++i ) 1113184054Slulf *(dest++) = *(source++); 1114184054Slulf 1115184054Slulf if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1116184054Slulf /* don't do the read, it's not guaranteed to return an EOF, 1117184054Slulf * just force an EOF 1118184054Slulf */ 1119184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; 1120184054Slulf 1121184054Slulf else 1122184054Slulf { 1123184054Slulf int num_to_read = 1124184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 1125184054Slulf 1126184054Slulf while ( num_to_read <= 0 ) 1127184054Slulf { /* Not enough room in the buffer - grow it. */ 1128184054Slulf 1129184054Slulf /* just a shorter name for the current buffer */ 1130184054Slulf YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 1131184054Slulf 1132184054Slulf int yy_c_buf_p_offset = 1133184054Slulf (int) (yyg->yy_c_buf_p - b->yy_ch_buf); 1134184054Slulf 1135184054Slulf if ( b->yy_is_our_buffer ) 1136184054Slulf { 1137184054Slulf int new_size = b->yy_buf_size * 2; 1138184054Slulf 1139184054Slulf if ( new_size <= 0 ) 1140184054Slulf b->yy_buf_size += b->yy_buf_size / 8; 1141184054Slulf else 1142184054Slulf b->yy_buf_size *= 2; 1143184054Slulf 1144184054Slulf b->yy_ch_buf = (char *) 1145184054Slulf /* Include room in for 2 EOB chars. */ 1146184054Slulf rcsrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); 1147184054Slulf } 1148184054Slulf else 1149184054Slulf /* Can't grow it, we don't own it. */ 1150184054Slulf b->yy_ch_buf = 0; 1151184054Slulf 1152184054Slulf if ( ! b->yy_ch_buf ) 1153184054Slulf YY_FATAL_ERROR( 1154184054Slulf "fatal error - scanner input buffer overflow" ); 1155184054Slulf 1156184054Slulf yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 1157184054Slulf 1158184054Slulf num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 1159184054Slulf number_to_move - 1; 1160184054Slulf 1161184054Slulf } 1162184054Slulf 1163184054Slulf if ( num_to_read > YY_READ_BUF_SIZE ) 1164184054Slulf num_to_read = YY_READ_BUF_SIZE; 1165184054Slulf 1166184054Slulf /* Read in more data. */ 1167184054Slulf YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 1168184054Slulf yyg->yy_n_chars, (size_t) num_to_read ); 1169184054Slulf 1170184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 1171184054Slulf } 1172184054Slulf 1173184054Slulf if ( yyg->yy_n_chars == 0 ) 1174184054Slulf { 1175184054Slulf if ( number_to_move == YY_MORE_ADJ ) 1176184054Slulf { 1177184054Slulf ret_val = EOB_ACT_END_OF_FILE; 1178184054Slulf rcsrestart(yyin ,yyscanner); 1179184054Slulf } 1180184054Slulf 1181184054Slulf else 1182184054Slulf { 1183184054Slulf ret_val = EOB_ACT_LAST_MATCH; 1184184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 1185184054Slulf YY_BUFFER_EOF_PENDING; 1186184054Slulf } 1187184054Slulf } 1188184054Slulf 1189184054Slulf else 1190184054Slulf ret_val = EOB_ACT_CONTINUE_SCAN; 1191184054Slulf 1192184054Slulf if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 1193184054Slulf /* Extend the array by 50%, plus the number we really need. */ 1194184054Slulf yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); 1195184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) rcsrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); 1196184054Slulf if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1197184054Slulf YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 1198184054Slulf } 1199184054Slulf 1200184054Slulf yyg->yy_n_chars += number_to_move; 1201184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; 1202184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 1203184054Slulf 1204184054Slulf yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 1205184054Slulf 1206184054Slulf return ret_val; 1207184054Slulf} 1208184054Slulf 1209184054Slulf/* yy_get_previous_state - get the state just before the EOB char was reached */ 1210184054Slulf 1211184054Slulf static yy_state_type yy_get_previous_state (yyscan_t yyscanner) 1212184054Slulf{ 1213184054Slulf register yy_state_type yy_current_state; 1214184054Slulf register char *yy_cp; 1215184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1216184054Slulf 1217184054Slulf yy_current_state = yyg->yy_start; 1218184054Slulf 1219184054Slulf for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) 1220184054Slulf { 1221184054Slulf register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1222184054Slulf if ( yy_accept[yy_current_state] ) 1223184054Slulf { 1224184054Slulf yyg->yy_last_accepting_state = yy_current_state; 1225184054Slulf yyg->yy_last_accepting_cpos = yy_cp; 1226184054Slulf } 1227184054Slulf while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1228184054Slulf { 1229184054Slulf yy_current_state = (int) yy_def[yy_current_state]; 1230184054Slulf if ( yy_current_state >= 89 ) 1231184054Slulf yy_c = yy_meta[(unsigned int) yy_c]; 1232184054Slulf } 1233184054Slulf yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1234184054Slulf } 1235184054Slulf 1236184054Slulf return yy_current_state; 1237184054Slulf} 1238184054Slulf 1239184054Slulf/* yy_try_NUL_trans - try to make a transition on the NUL character 1240184054Slulf * 1241184054Slulf * synopsis 1242184054Slulf * next_state = yy_try_NUL_trans( current_state ); 1243184054Slulf */ 1244184054Slulf static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) 1245184054Slulf{ 1246184054Slulf register int yy_is_jam; 1247184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ 1248184054Slulf register char *yy_cp = yyg->yy_c_buf_p; 1249184054Slulf 1250184054Slulf register YY_CHAR yy_c = 1; 1251184054Slulf if ( yy_accept[yy_current_state] ) 1252184054Slulf { 1253184054Slulf yyg->yy_last_accepting_state = yy_current_state; 1254184054Slulf yyg->yy_last_accepting_cpos = yy_cp; 1255184054Slulf } 1256184054Slulf while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1257184054Slulf { 1258184054Slulf yy_current_state = (int) yy_def[yy_current_state]; 1259184054Slulf if ( yy_current_state >= 89 ) 1260184054Slulf yy_c = yy_meta[(unsigned int) yy_c]; 1261184054Slulf } 1262184054Slulf yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1263184054Slulf yy_is_jam = (yy_current_state == 88); 1264184054Slulf 1265184054Slulf return yy_is_jam ? 0 : yy_current_state; 1266184054Slulf} 1267184054Slulf 1268184054Slulf static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) 1269184054Slulf{ 1270184054Slulf register char *yy_cp; 1271184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1272184054Slulf 1273184054Slulf yy_cp = yyg->yy_c_buf_p; 1274184054Slulf 1275184054Slulf /* undo effects of setting up yytext */ 1276184054Slulf *yy_cp = yyg->yy_hold_char; 1277184054Slulf 1278184054Slulf if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 1279184054Slulf { /* need to shift things up to make room */ 1280184054Slulf /* +2 for EOB chars. */ 1281184054Slulf register int number_to_move = yyg->yy_n_chars + 2; 1282184054Slulf register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ 1283184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; 1284184054Slulf register char *source = 1285184054Slulf &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; 1286184054Slulf 1287184054Slulf while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1288184054Slulf *--dest = *--source; 1289184054Slulf 1290184054Slulf yy_cp += (int) (dest - source); 1291184054Slulf yy_bp += (int) (dest - source); 1292184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_n_chars = 1293184054Slulf yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; 1294184054Slulf 1295184054Slulf if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 1296184054Slulf YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1297184054Slulf } 1298184054Slulf 1299184054Slulf *--yy_cp = (char) c; 1300184054Slulf 1301184054Slulf yyg->yytext_ptr = yy_bp; 1302184054Slulf yyg->yy_hold_char = *yy_cp; 1303184054Slulf yyg->yy_c_buf_p = yy_cp; 1304184054Slulf} 1305184054Slulf 1306184054Slulf#ifndef YY_NO_INPUT 1307184054Slulf#ifdef __cplusplus 1308184054Slulf static int yyinput (yyscan_t yyscanner) 1309184054Slulf#else 1310184054Slulf static int input (yyscan_t yyscanner) 1311184054Slulf#endif 1312184054Slulf 1313184054Slulf{ 1314184054Slulf int c; 1315184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1316184054Slulf 1317184054Slulf *yyg->yy_c_buf_p = yyg->yy_hold_char; 1318184054Slulf 1319184054Slulf if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 1320184054Slulf { 1321184054Slulf /* yy_c_buf_p now points to the character we want to return. 1322184054Slulf * If this occurs *before* the EOB characters, then it's a 1323184054Slulf * valid NUL; if not, then we've hit the end of the buffer. 1324184054Slulf */ 1325184054Slulf if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) 1326184054Slulf /* This was really a NUL. */ 1327184054Slulf *yyg->yy_c_buf_p = '\0'; 1328184054Slulf 1329184054Slulf else 1330184054Slulf { /* need more input */ 1331184054Slulf int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; 1332184054Slulf ++yyg->yy_c_buf_p; 1333184054Slulf 1334184054Slulf switch ( yy_get_next_buffer( yyscanner ) ) 1335184054Slulf { 1336184054Slulf case EOB_ACT_LAST_MATCH: 1337184054Slulf /* This happens because yy_g_n_b() 1338184054Slulf * sees that we've accumulated a 1339184054Slulf * token and flags that we need to 1340184054Slulf * try matching the token before 1341184054Slulf * proceeding. But for input(), 1342184054Slulf * there's no matching to consider. 1343184054Slulf * So convert the EOB_ACT_LAST_MATCH 1344184054Slulf * to EOB_ACT_END_OF_FILE. 1345184054Slulf */ 1346184054Slulf 1347184054Slulf /* Reset buffer status. */ 1348184054Slulf rcsrestart(yyin ,yyscanner); 1349184054Slulf 1350184054Slulf /*FALLTHROUGH*/ 1351184054Slulf 1352184054Slulf case EOB_ACT_END_OF_FILE: 1353184054Slulf { 1354184054Slulf if ( rcswrap(yyscanner ) ) 1355184054Slulf return EOF; 1356184054Slulf 1357184054Slulf if ( ! yyg->yy_did_buffer_switch_on_eof ) 1358184054Slulf YY_NEW_FILE; 1359184054Slulf#ifdef __cplusplus 1360184054Slulf return yyinput(yyscanner); 1361184054Slulf#else 1362184054Slulf return input(yyscanner); 1363184054Slulf#endif 1364184054Slulf } 1365184054Slulf 1366184054Slulf case EOB_ACT_CONTINUE_SCAN: 1367184054Slulf yyg->yy_c_buf_p = yyg->yytext_ptr + offset; 1368184054Slulf break; 1369184054Slulf } 1370184054Slulf } 1371184054Slulf } 1372184054Slulf 1373184054Slulf c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ 1374184054Slulf *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ 1375184054Slulf yyg->yy_hold_char = *++yyg->yy_c_buf_p; 1376184054Slulf 1377184054Slulf return c; 1378184054Slulf} 1379184054Slulf#endif /* ifndef YY_NO_INPUT */ 1380184054Slulf 1381184054Slulf/** Immediately switch to a different input stream. 1382184054Slulf * @param input_file A readable stream. 1383184054Slulf * @param yyscanner The scanner object. 1384184054Slulf * @note This function does not reset the start condition to @c INITIAL . 1385184054Slulf */ 1386184054Slulf void rcsrestart (FILE * input_file , yyscan_t yyscanner) 1387184054Slulf{ 1388184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1389184054Slulf 1390184054Slulf if ( ! YY_CURRENT_BUFFER ){ 1391184054Slulf rcsensure_buffer_stack (yyscanner); 1392184054Slulf YY_CURRENT_BUFFER_LVALUE = 1393184054Slulf rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); 1394184054Slulf } 1395184054Slulf 1396184054Slulf rcs_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); 1397184054Slulf rcs_load_buffer_state(yyscanner ); 1398184054Slulf} 1399184054Slulf 1400184054Slulf/** Switch to a different input buffer. 1401184054Slulf * @param new_buffer The new input buffer. 1402184054Slulf * @param yyscanner The scanner object. 1403184054Slulf */ 1404184054Slulf void rcs_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) 1405184054Slulf{ 1406184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1407184054Slulf 1408184054Slulf /* TODO. We should be able to replace this entire function body 1409184054Slulf * with 1410184054Slulf * rcspop_buffer_state(); 1411184054Slulf * rcspush_buffer_state(new_buffer); 1412184054Slulf */ 1413184054Slulf rcsensure_buffer_stack (yyscanner); 1414184054Slulf if ( YY_CURRENT_BUFFER == new_buffer ) 1415184054Slulf return; 1416184054Slulf 1417184054Slulf if ( YY_CURRENT_BUFFER ) 1418184054Slulf { 1419184054Slulf /* Flush out information for old buffer. */ 1420184054Slulf *yyg->yy_c_buf_p = yyg->yy_hold_char; 1421184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; 1422184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 1423184054Slulf } 1424184054Slulf 1425184054Slulf YY_CURRENT_BUFFER_LVALUE = new_buffer; 1426184054Slulf rcs_load_buffer_state(yyscanner ); 1427184054Slulf 1428184054Slulf /* We don't actually know whether we did this switch during 1429184054Slulf * EOF (rcswrap()) processing, but the only time this flag 1430184054Slulf * is looked at is after rcswrap() is called, so it's safe 1431184054Slulf * to go ahead and always set it. 1432184054Slulf */ 1433184054Slulf yyg->yy_did_buffer_switch_on_eof = 1; 1434184054Slulf} 1435184054Slulf 1436184054Slulfstatic void rcs_load_buffer_state (yyscan_t yyscanner) 1437184054Slulf{ 1438184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1439184054Slulf yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1440184054Slulf yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 1441184054Slulf yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 1442184054Slulf yyg->yy_hold_char = *yyg->yy_c_buf_p; 1443184054Slulf} 1444184054Slulf 1445184054Slulf/** Allocate and initialize an input buffer state. 1446184054Slulf * @param file A readable stream. 1447184054Slulf * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 1448184054Slulf * @param yyscanner The scanner object. 1449184054Slulf * @return the allocated buffer state. 1450184054Slulf */ 1451184054Slulf YY_BUFFER_STATE rcs_create_buffer (FILE * file, int size , yyscan_t yyscanner) 1452184054Slulf{ 1453184054Slulf YY_BUFFER_STATE b; 1454184054Slulf 1455184054Slulf b = (YY_BUFFER_STATE) rcsalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); 1456184054Slulf if ( ! b ) 1457184054Slulf YY_FATAL_ERROR( "out of dynamic memory in rcs_create_buffer()" ); 1458184054Slulf 1459184054Slulf b->yy_buf_size = size; 1460184054Slulf 1461184054Slulf /* yy_ch_buf has to be 2 characters longer than the size given because 1462184054Slulf * we need to put in 2 end-of-buffer characters. 1463184054Slulf */ 1464184054Slulf b->yy_ch_buf = (char *) rcsalloc(b->yy_buf_size + 2 ,yyscanner ); 1465184054Slulf if ( ! b->yy_ch_buf ) 1466184054Slulf YY_FATAL_ERROR( "out of dynamic memory in rcs_create_buffer()" ); 1467184054Slulf 1468184054Slulf b->yy_is_our_buffer = 1; 1469184054Slulf 1470184054Slulf rcs_init_buffer(b,file ,yyscanner); 1471184054Slulf 1472184054Slulf return b; 1473184054Slulf} 1474184054Slulf 1475184054Slulf/** Destroy the buffer. 1476184054Slulf * @param b a buffer created with rcs_create_buffer() 1477184054Slulf * @param yyscanner The scanner object. 1478184054Slulf */ 1479184054Slulf void rcs_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) 1480184054Slulf{ 1481184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1482184054Slulf 1483184054Slulf if ( ! b ) 1484184054Slulf return; 1485184054Slulf 1486184054Slulf if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 1487184054Slulf YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 1488184054Slulf 1489184054Slulf if ( b->yy_is_our_buffer ) 1490184054Slulf rcsfree((void *) b->yy_ch_buf ,yyscanner ); 1491184054Slulf 1492184054Slulf rcsfree((void *) b ,yyscanner ); 1493184054Slulf} 1494184054Slulf 1495184054Slulf#ifndef __cplusplus 1496184054Slulfextern int isatty (int ); 1497184054Slulf#endif /* __cplusplus */ 1498184054Slulf 1499184054Slulf/* Initializes or reinitializes a buffer. 1500184054Slulf * This function is sometimes called more than once on the same buffer, 1501184054Slulf * such as during a rcsrestart() or at EOF. 1502184054Slulf */ 1503184054Slulf static void rcs_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) 1504184054Slulf 1505184054Slulf{ 1506184054Slulf int oerrno = errno; 1507184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1508184054Slulf 1509184054Slulf rcs_flush_buffer(b ,yyscanner); 1510184054Slulf 1511184054Slulf b->yy_input_file = file; 1512184054Slulf b->yy_fill_buffer = 1; 1513184054Slulf 1514184054Slulf /* If b is the current buffer, then rcs_init_buffer was _probably_ 1515184054Slulf * called from rcsrestart() or through yy_get_next_buffer. 1516184054Slulf * In that case, we don't want to reset the lineno or column. 1517184054Slulf */ 1518184054Slulf if (b != YY_CURRENT_BUFFER){ 1519184054Slulf b->yy_bs_lineno = 1; 1520184054Slulf b->yy_bs_column = 0; 1521184054Slulf } 1522184054Slulf 1523184054Slulf b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1524184054Slulf 1525184054Slulf errno = oerrno; 1526184054Slulf} 1527184054Slulf 1528184054Slulf/** Discard all buffered characters. On the next scan, YY_INPUT will be called. 1529184054Slulf * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 1530184054Slulf * @param yyscanner The scanner object. 1531184054Slulf */ 1532184054Slulf void rcs_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) 1533184054Slulf{ 1534184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1535184054Slulf if ( ! b ) 1536184054Slulf return; 1537184054Slulf 1538184054Slulf b->yy_n_chars = 0; 1539184054Slulf 1540184054Slulf /* We always need two end-of-buffer characters. The first causes 1541184054Slulf * a transition to the end-of-buffer state. The second causes 1542184054Slulf * a jam in that state. 1543184054Slulf */ 1544184054Slulf b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 1545184054Slulf b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 1546184054Slulf 1547184054Slulf b->yy_buf_pos = &b->yy_ch_buf[0]; 1548184054Slulf 1549184054Slulf b->yy_at_bol = 1; 1550184054Slulf b->yy_buffer_status = YY_BUFFER_NEW; 1551184054Slulf 1552184054Slulf if ( b == YY_CURRENT_BUFFER ) 1553184054Slulf rcs_load_buffer_state(yyscanner ); 1554184054Slulf} 1555184054Slulf 1556184054Slulf/** Pushes the new state onto the stack. The new state becomes 1557184054Slulf * the current state. This function will allocate the stack 1558184054Slulf * if necessary. 1559184054Slulf * @param new_buffer The new state. 1560184054Slulf * @param yyscanner The scanner object. 1561184054Slulf */ 1562184054Slulfvoid rcspush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) 1563184054Slulf{ 1564184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1565184054Slulf if (new_buffer == NULL) 1566184054Slulf return; 1567184054Slulf 1568184054Slulf rcsensure_buffer_stack(yyscanner); 1569184054Slulf 1570184054Slulf /* This block is copied from rcs_switch_to_buffer. */ 1571184054Slulf if ( YY_CURRENT_BUFFER ) 1572184054Slulf { 1573184054Slulf /* Flush out information for old buffer. */ 1574184054Slulf *yyg->yy_c_buf_p = yyg->yy_hold_char; 1575184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; 1576184054Slulf YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 1577184054Slulf } 1578184054Slulf 1579184054Slulf /* Only push if top exists. Otherwise, replace top. */ 1580184054Slulf if (YY_CURRENT_BUFFER) 1581184054Slulf yyg->yy_buffer_stack_top++; 1582184054Slulf YY_CURRENT_BUFFER_LVALUE = new_buffer; 1583184054Slulf 1584184054Slulf /* copied from rcs_switch_to_buffer. */ 1585184054Slulf rcs_load_buffer_state(yyscanner ); 1586184054Slulf yyg->yy_did_buffer_switch_on_eof = 1; 1587184054Slulf} 1588184054Slulf 1589184054Slulf/** Removes and deletes the top of the stack, if present. 1590184054Slulf * The next element becomes the new top. 1591184054Slulf * @param yyscanner The scanner object. 1592184054Slulf */ 1593184054Slulfvoid rcspop_buffer_state (yyscan_t yyscanner) 1594184054Slulf{ 1595184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1596184054Slulf if (!YY_CURRENT_BUFFER) 1597184054Slulf return; 1598184054Slulf 1599184054Slulf rcs_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); 1600184054Slulf YY_CURRENT_BUFFER_LVALUE = NULL; 1601184054Slulf if (yyg->yy_buffer_stack_top > 0) 1602184054Slulf --yyg->yy_buffer_stack_top; 1603184054Slulf 1604184054Slulf if (YY_CURRENT_BUFFER) { 1605184054Slulf rcs_load_buffer_state(yyscanner ); 1606184054Slulf yyg->yy_did_buffer_switch_on_eof = 1; 1607184054Slulf } 1608184054Slulf} 1609184054Slulf 1610184054Slulf/* Allocates the stack if it does not exist. 1611184054Slulf * Guarantees space for at least one push. 1612184054Slulf */ 1613184054Slulfstatic void rcsensure_buffer_stack (yyscan_t yyscanner) 1614184054Slulf{ 1615184054Slulf int num_to_alloc; 1616184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1617184054Slulf 1618184054Slulf if (!yyg->yy_buffer_stack) { 1619184054Slulf 1620184054Slulf /* First allocation is just for 2 elements, since we don't know if this 1621184054Slulf * scanner will even need a stack. We use 2 instead of 1 to avoid an 1622184054Slulf * immediate realloc on the next call. 1623184054Slulf */ 1624184054Slulf num_to_alloc = 1; 1625184054Slulf yyg->yy_buffer_stack = (struct yy_buffer_state**)rcsalloc 1626184054Slulf (num_to_alloc * sizeof(struct yy_buffer_state*) 1627184054Slulf , yyscanner); 1628184054Slulf if ( ! yyg->yy_buffer_stack ) 1629184054Slulf YY_FATAL_ERROR( "out of dynamic memory in rcsensure_buffer_stack()" ); 1630184054Slulf 1631184054Slulf memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 1632184054Slulf 1633184054Slulf yyg->yy_buffer_stack_max = num_to_alloc; 1634184054Slulf yyg->yy_buffer_stack_top = 0; 1635184054Slulf return; 1636184054Slulf } 1637184054Slulf 1638184054Slulf if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ 1639184054Slulf 1640184054Slulf /* Increase the buffer to prepare for a possible push. */ 1641184054Slulf int grow_size = 8 /* arbitrary grow size */; 1642184054Slulf 1643184054Slulf num_to_alloc = yyg->yy_buffer_stack_max + grow_size; 1644184054Slulf yyg->yy_buffer_stack = (struct yy_buffer_state**)rcsrealloc 1645184054Slulf (yyg->yy_buffer_stack, 1646184054Slulf num_to_alloc * sizeof(struct yy_buffer_state*) 1647184054Slulf , yyscanner); 1648184054Slulf if ( ! yyg->yy_buffer_stack ) 1649184054Slulf YY_FATAL_ERROR( "out of dynamic memory in rcsensure_buffer_stack()" ); 1650184054Slulf 1651184054Slulf /* zero only the new slots.*/ 1652184054Slulf memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); 1653184054Slulf yyg->yy_buffer_stack_max = num_to_alloc; 1654184054Slulf } 1655184054Slulf} 1656184054Slulf 1657184054Slulf/** Setup the input buffer state to scan directly from a user-specified character buffer. 1658184054Slulf * @param base the character buffer 1659184054Slulf * @param size the size in bytes of the character buffer 1660184054Slulf * @param yyscanner The scanner object. 1661184054Slulf * @return the newly allocated buffer state object. 1662184054Slulf */ 1663184054SlulfYY_BUFFER_STATE rcs_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) 1664184054Slulf{ 1665184054Slulf YY_BUFFER_STATE b; 1666184054Slulf 1667184054Slulf if ( size < 2 || 1668184054Slulf base[size-2] != YY_END_OF_BUFFER_CHAR || 1669184054Slulf base[size-1] != YY_END_OF_BUFFER_CHAR ) 1670184054Slulf /* They forgot to leave room for the EOB's. */ 1671184054Slulf return 0; 1672184054Slulf 1673184054Slulf b = (YY_BUFFER_STATE) rcsalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); 1674184054Slulf if ( ! b ) 1675184054Slulf YY_FATAL_ERROR( "out of dynamic memory in rcs_scan_buffer()" ); 1676184054Slulf 1677184054Slulf b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 1678184054Slulf b->yy_buf_pos = b->yy_ch_buf = base; 1679184054Slulf b->yy_is_our_buffer = 0; 1680184054Slulf b->yy_input_file = 0; 1681184054Slulf b->yy_n_chars = b->yy_buf_size; 1682184054Slulf b->yy_is_interactive = 0; 1683184054Slulf b->yy_at_bol = 1; 1684184054Slulf b->yy_fill_buffer = 0; 1685184054Slulf b->yy_buffer_status = YY_BUFFER_NEW; 1686184054Slulf 1687184054Slulf rcs_switch_to_buffer(b ,yyscanner ); 1688184054Slulf 1689184054Slulf return b; 1690184054Slulf} 1691184054Slulf 1692184054Slulf/** Setup the input buffer state to scan a string. The next call to rcslex() will 1693184054Slulf * scan from a @e copy of @a str. 1694184054Slulf * @param yystr a NUL-terminated string to scan 1695184054Slulf * @param yyscanner The scanner object. 1696184054Slulf * @return the newly allocated buffer state object. 1697184054Slulf * @note If you want to scan bytes that may contain NUL values, then use 1698184054Slulf * rcs_scan_bytes() instead. 1699184054Slulf */ 1700184054SlulfYY_BUFFER_STATE rcs_scan_string (yyconst char * yystr , yyscan_t yyscanner) 1701184054Slulf{ 1702184054Slulf 1703184054Slulf return rcs_scan_bytes(yystr,strlen(yystr) ,yyscanner); 1704184054Slulf} 1705184054Slulf 1706184054Slulf/** Setup the input buffer state to scan the given bytes. The next call to rcslex() will 1707184054Slulf * scan from a @e copy of @a bytes. 1708184054Slulf * @param bytes the byte buffer to scan 1709184054Slulf * @param len the number of bytes in the buffer pointed to by @a bytes. 1710184054Slulf * @param yyscanner The scanner object. 1711184054Slulf * @return the newly allocated buffer state object. 1712184054Slulf */ 1713184054SlulfYY_BUFFER_STATE rcs_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) 1714184054Slulf{ 1715184054Slulf YY_BUFFER_STATE b; 1716184054Slulf char *buf; 1717184054Slulf yy_size_t n; 1718184054Slulf int i; 1719184054Slulf 1720184054Slulf /* Get memory for full buffer, including space for trailing EOB's. */ 1721184054Slulf n = _yybytes_len + 2; 1722184054Slulf buf = (char *) rcsalloc(n ,yyscanner ); 1723184054Slulf if ( ! buf ) 1724184054Slulf YY_FATAL_ERROR( "out of dynamic memory in rcs_scan_bytes()" ); 1725184054Slulf 1726184054Slulf for ( i = 0; i < _yybytes_len; ++i ) 1727184054Slulf buf[i] = yybytes[i]; 1728184054Slulf 1729184054Slulf buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 1730184054Slulf 1731184054Slulf b = rcs_scan_buffer(buf,n ,yyscanner); 1732184054Slulf if ( ! b ) 1733184054Slulf YY_FATAL_ERROR( "bad buffer in rcs_scan_bytes()" ); 1734184054Slulf 1735184054Slulf /* It's okay to grow etc. this buffer, and we should throw it 1736184054Slulf * away when we're done. 1737184054Slulf */ 1738184054Slulf b->yy_is_our_buffer = 1; 1739184054Slulf 1740184054Slulf return b; 1741184054Slulf} 1742184054Slulf 1743184054Slulf#ifndef YY_EXIT_FAILURE 1744184054Slulf#define YY_EXIT_FAILURE 2 1745184054Slulf#endif 1746184054Slulf 1747184054Slulfstatic void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) 1748184054Slulf{ 1749184054Slulf (void) fprintf( stderr, "%s\n", msg ); 1750184054Slulf exit( YY_EXIT_FAILURE ); 1751184054Slulf} 1752184054Slulf 1753184054Slulf/* Redefine yyless() so it works in section 3 code. */ 1754184054Slulf 1755184054Slulf#undef yyless 1756184054Slulf#define yyless(n) \ 1757184054Slulf do \ 1758184054Slulf { \ 1759184054Slulf /* Undo effects of setting up yytext. */ \ 1760184054Slulf int yyless_macro_arg = (n); \ 1761184054Slulf YY_LESS_LINENO(yyless_macro_arg);\ 1762184054Slulf yytext[yyleng] = yyg->yy_hold_char; \ 1763184054Slulf yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ 1764184054Slulf yyg->yy_hold_char = *yyg->yy_c_buf_p; \ 1765184054Slulf *yyg->yy_c_buf_p = '\0'; \ 1766184054Slulf yyleng = yyless_macro_arg; \ 1767184054Slulf } \ 1768184054Slulf while ( 0 ) 1769184054Slulf 1770184054Slulf/* Accessor methods (get/set functions) to struct members. */ 1771184054Slulf 1772184054Slulf/** Get the user-defined data for this scanner. 1773184054Slulf * @param yyscanner The scanner object. 1774184054Slulf */ 1775184054SlulfYY_EXTRA_TYPE rcsget_extra (yyscan_t yyscanner) 1776184054Slulf{ 1777184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1778184054Slulf return yyextra; 1779184054Slulf} 1780184054Slulf 1781184054Slulf/** Get the current line number. 1782184054Slulf * @param yyscanner The scanner object. 1783184054Slulf */ 1784184054Slulfint rcsget_lineno (yyscan_t yyscanner) 1785184054Slulf{ 1786184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1787184054Slulf 1788184054Slulf if (! YY_CURRENT_BUFFER) 1789184054Slulf return 0; 1790184054Slulf 1791184054Slulf return yylineno; 1792184054Slulf} 1793184054Slulf 1794184054Slulf/** Get the current column number. 1795184054Slulf * @param yyscanner The scanner object. 1796184054Slulf */ 1797184054Slulfint rcsget_column (yyscan_t yyscanner) 1798184054Slulf{ 1799184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1800184054Slulf 1801184054Slulf if (! YY_CURRENT_BUFFER) 1802184054Slulf return 0; 1803184054Slulf 1804184054Slulf return yycolumn; 1805184054Slulf} 1806184054Slulf 1807184054Slulf/** Get the input stream. 1808184054Slulf * @param yyscanner The scanner object. 1809184054Slulf */ 1810184054SlulfFILE *rcsget_in (yyscan_t yyscanner) 1811184054Slulf{ 1812184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1813184054Slulf return yyin; 1814184054Slulf} 1815184054Slulf 1816184054Slulf/** Get the output stream. 1817184054Slulf * @param yyscanner The scanner object. 1818184054Slulf */ 1819184054SlulfFILE *rcsget_out (yyscan_t yyscanner) 1820184054Slulf{ 1821184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1822184054Slulf return yyout; 1823184054Slulf} 1824184054Slulf 1825184054Slulf/** Get the length of the current token. 1826184054Slulf * @param yyscanner The scanner object. 1827184054Slulf */ 1828184054Slulfint rcsget_leng (yyscan_t yyscanner) 1829184054Slulf{ 1830184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1831184054Slulf return yyleng; 1832184054Slulf} 1833184054Slulf 1834184054Slulf/** Get the current token. 1835184054Slulf * @param yyscanner The scanner object. 1836184054Slulf */ 1837184054Slulf 1838184054Slulfchar *rcsget_text (yyscan_t yyscanner) 1839184054Slulf{ 1840184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1841184054Slulf return yytext; 1842184054Slulf} 1843184054Slulf 1844184054Slulf/** Set the user-defined data. This data is never touched by the scanner. 1845184054Slulf * @param user_defined The data to be associated with this scanner. 1846184054Slulf * @param yyscanner The scanner object. 1847184054Slulf */ 1848184054Slulfvoid rcsset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) 1849184054Slulf{ 1850184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1851184054Slulf yyextra = user_defined ; 1852184054Slulf} 1853184054Slulf 1854184054Slulf/** Set the current line number. 1855184054Slulf * @param line_number 1856184054Slulf * @param yyscanner The scanner object. 1857184054Slulf */ 1858184054Slulfvoid rcsset_lineno (int line_number , yyscan_t yyscanner) 1859184054Slulf{ 1860184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1861184054Slulf 1862184054Slulf /* lineno is only valid if an input buffer exists. */ 1863184054Slulf if (! YY_CURRENT_BUFFER ) 1864184054Slulf yy_fatal_error( "rcsset_lineno called with no buffer" , yyscanner); 1865184054Slulf 1866184054Slulf yylineno = line_number; 1867184054Slulf} 1868184054Slulf 1869184054Slulf/** Set the current column. 1870184054Slulf * @param line_number 1871184054Slulf * @param yyscanner The scanner object. 1872184054Slulf */ 1873184054Slulfvoid rcsset_column (int column_no , yyscan_t yyscanner) 1874184054Slulf{ 1875184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1876184054Slulf 1877184054Slulf /* column is only valid if an input buffer exists. */ 1878184054Slulf if (! YY_CURRENT_BUFFER ) 1879184054Slulf yy_fatal_error( "rcsset_column called with no buffer" , yyscanner); 1880184054Slulf 1881184054Slulf yycolumn = column_no; 1882184054Slulf} 1883184054Slulf 1884184054Slulf/** Set the input stream. This does not discard the current 1885184054Slulf * input buffer. 1886184054Slulf * @param in_str A readable stream. 1887184054Slulf * @param yyscanner The scanner object. 1888184054Slulf * @see rcs_switch_to_buffer 1889184054Slulf */ 1890184054Slulfvoid rcsset_in (FILE * in_str , yyscan_t yyscanner) 1891184054Slulf{ 1892184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1893184054Slulf yyin = in_str ; 1894184054Slulf} 1895184054Slulf 1896184054Slulfvoid rcsset_out (FILE * out_str , yyscan_t yyscanner) 1897184054Slulf{ 1898184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1899184054Slulf yyout = out_str ; 1900184054Slulf} 1901184054Slulf 1902184054Slulfint rcsget_debug (yyscan_t yyscanner) 1903184054Slulf{ 1904184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1905184054Slulf return yy_flex_debug; 1906184054Slulf} 1907184054Slulf 1908184054Slulfvoid rcsset_debug (int bdebug , yyscan_t yyscanner) 1909184054Slulf{ 1910184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1911184054Slulf yy_flex_debug = bdebug ; 1912184054Slulf} 1913184054Slulf 1914184054Slulf/* Accessor methods for yylval and yylloc */ 1915184054Slulf 1916184054Slulf/* User-visible API */ 1917184054Slulf 1918184054Slulf/* rcslex_init is special because it creates the scanner itself, so it is 1919184054Slulf * the ONLY reentrant function that doesn't take the scanner as the last argument. 1920184054Slulf * That's why we explicitly handle the declaration, instead of using our macros. 1921184054Slulf */ 1922184054Slulf 1923184054Slulfint rcslex_init(yyscan_t* ptr_yy_globals) 1924184054Slulf 1925184054Slulf{ 1926184054Slulf if (ptr_yy_globals == NULL){ 1927184054Slulf errno = EINVAL; 1928184054Slulf return 1; 1929184054Slulf } 1930184054Slulf 1931184054Slulf *ptr_yy_globals = (yyscan_t) rcsalloc ( sizeof( struct yyguts_t ), NULL ); 1932184054Slulf 1933184054Slulf if (*ptr_yy_globals == NULL){ 1934184054Slulf errno = ENOMEM; 1935184054Slulf return 1; 1936184054Slulf } 1937184054Slulf 1938184054Slulf /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ 1939184054Slulf memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 1940184054Slulf 1941184054Slulf return yy_init_globals ( *ptr_yy_globals ); 1942184054Slulf} 1943184054Slulf 1944184054Slulf/* rcslex_init_extra has the same functionality as rcslex_init, but follows the 1945184054Slulf * convention of taking the scanner as the last argument. Note however, that 1946184054Slulf * this is a *pointer* to a scanner, as it will be allocated by this call (and 1947184054Slulf * is the reason, too, why this function also must handle its own declaration). 1948184054Slulf * The user defined value in the first argument will be available to rcsalloc in 1949184054Slulf * the yyextra field. 1950184054Slulf */ 1951184054Slulf 1952184054Slulfint rcslex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) 1953184054Slulf 1954184054Slulf{ 1955184054Slulf struct yyguts_t dummy_yyguts; 1956184054Slulf 1957184054Slulf rcsset_extra (yy_user_defined, &dummy_yyguts); 1958184054Slulf 1959184054Slulf if (ptr_yy_globals == NULL){ 1960184054Slulf errno = EINVAL; 1961184054Slulf return 1; 1962184054Slulf } 1963184054Slulf 1964184054Slulf *ptr_yy_globals = (yyscan_t) rcsalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); 1965184054Slulf 1966184054Slulf if (*ptr_yy_globals == NULL){ 1967184054Slulf errno = ENOMEM; 1968184054Slulf return 1; 1969184054Slulf } 1970184054Slulf 1971184054Slulf /* By setting to 0xAA, we expose bugs in 1972184054Slulf yy_init_globals. Leave at 0x00 for releases. */ 1973184054Slulf memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 1974184054Slulf 1975184054Slulf rcsset_extra (yy_user_defined, *ptr_yy_globals); 1976184054Slulf 1977184054Slulf return yy_init_globals ( *ptr_yy_globals ); 1978184054Slulf} 1979184054Slulf 1980184054Slulfstatic int yy_init_globals (yyscan_t yyscanner) 1981184054Slulf{ 1982184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1983184054Slulf /* Initialization is the same as for the non-reentrant scanner. 1984184054Slulf * This function is called from rcslex_destroy(), so don't allocate here. 1985184054Slulf */ 1986184054Slulf 1987184054Slulf yyg->yy_buffer_stack = 0; 1988184054Slulf yyg->yy_buffer_stack_top = 0; 1989184054Slulf yyg->yy_buffer_stack_max = 0; 1990184054Slulf yyg->yy_c_buf_p = (char *) 0; 1991184054Slulf yyg->yy_init = 0; 1992184054Slulf yyg->yy_start = 0; 1993184054Slulf 1994184054Slulf yyg->yy_start_stack_ptr = 0; 1995184054Slulf yyg->yy_start_stack_depth = 0; 1996184054Slulf yyg->yy_start_stack = NULL; 1997184054Slulf 1998184054Slulf/* Defined in main.c */ 1999184054Slulf#ifdef YY_STDINIT 2000184054Slulf yyin = stdin; 2001184054Slulf yyout = stdout; 2002184054Slulf#else 2003184054Slulf yyin = (FILE *) 0; 2004184054Slulf yyout = (FILE *) 0; 2005184054Slulf#endif 2006184054Slulf 2007184054Slulf /* For future reference: Set errno on error, since we are called by 2008184054Slulf * rcslex_init() 2009184054Slulf */ 2010184054Slulf return 0; 2011184054Slulf} 2012184054Slulf 2013184054Slulf/* rcslex_destroy is for both reentrant and non-reentrant scanners. */ 2014184054Slulfint rcslex_destroy (yyscan_t yyscanner) 2015184054Slulf{ 2016184054Slulf struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2017184054Slulf 2018184054Slulf /* Pop the buffer stack, destroying each element. */ 2019184054Slulf while(YY_CURRENT_BUFFER){ 2020184054Slulf rcs_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); 2021184054Slulf YY_CURRENT_BUFFER_LVALUE = NULL; 2022184054Slulf rcspop_buffer_state(yyscanner); 2023184054Slulf } 2024184054Slulf 2025184054Slulf /* Destroy the stack itself. */ 2026184054Slulf rcsfree(yyg->yy_buffer_stack ,yyscanner); 2027184054Slulf yyg->yy_buffer_stack = NULL; 2028184054Slulf 2029184054Slulf /* Destroy the start condition stack. */ 2030184054Slulf rcsfree(yyg->yy_start_stack ,yyscanner ); 2031184054Slulf yyg->yy_start_stack = NULL; 2032184054Slulf 2033184054Slulf /* Reset the globals. This is important in a non-reentrant scanner so the next time 2034184054Slulf * rcslex() is called, initialization will occur. */ 2035184054Slulf yy_init_globals( yyscanner); 2036184054Slulf 2037184054Slulf /* Destroy the main struct (reentrant only). */ 2038184054Slulf rcsfree ( yyscanner , yyscanner ); 2039184054Slulf yyscanner = NULL; 2040184054Slulf return 0; 2041184054Slulf} 2042184054Slulf 2043184054Slulf/* 2044184054Slulf * Internal utility routines. 2045184054Slulf */ 2046184054Slulf 2047184054Slulf#ifndef yytext_ptr 2048184054Slulfstatic void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) 2049184054Slulf{ 2050184054Slulf register int i; 2051184054Slulf for ( i = 0; i < n; ++i ) 2052184054Slulf s1[i] = s2[i]; 2053184054Slulf} 2054184054Slulf#endif 2055184054Slulf 2056184054Slulf#ifdef YY_NEED_STRLEN 2057184054Slulfstatic int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) 2058184054Slulf{ 2059184054Slulf register int n; 2060184054Slulf for ( n = 0; s[n]; ++n ) 2061184054Slulf ; 2062184054Slulf 2063184054Slulf return n; 2064184054Slulf} 2065184054Slulf#endif 2066184054Slulf 2067184054Slulfvoid *rcsalloc (yy_size_t size , yyscan_t yyscanner) 2068184054Slulf{ 2069184054Slulf return (void *) malloc( size ); 2070184054Slulf} 2071184054Slulf 2072184054Slulfvoid *rcsrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) 2073184054Slulf{ 2074184054Slulf /* The cast to (char *) in the following accommodates both 2075184054Slulf * implementations that use char* generic pointers, and those 2076184054Slulf * that use void* generic pointers. It works with the latter 2077184054Slulf * because both ANSI C and C++ allow castless assignment from 2078184054Slulf * any pointer type to void*, and deal with argument conversions 2079184054Slulf * as though doing an assignment. 2080184054Slulf */ 2081184054Slulf return (void *) realloc( (char *) ptr, size ); 2082184054Slulf} 2083184054Slulf 2084184054Slulfvoid rcsfree (void * ptr , yyscan_t yyscanner) 2085184054Slulf{ 2086184054Slulf free( (char *) ptr ); /* see rcsrealloc() for (char *) cast */ 2087184054Slulf} 2088184054Slulf 2089184054Slulf#define YYTABLES_NAME "yytables" 2090184054Slulf 2091184054Slulf#line 73 "rcstokenizer.l" 2092184054Slulf 2093184054Slulf 2094184054Slulf 2095