1706f2543Smrg 2706f2543Smrg#line 3 "scanner.c" 3706f2543Smrg 4706f2543Smrg#define YY_INT_ALIGNED short int 5706f2543Smrg 6706f2543Smrg/* A lexical scanner generated by flex */ 7706f2543Smrg 8706f2543Smrg#define FLEX_SCANNER 9706f2543Smrg#define YY_FLEX_MAJOR_VERSION 2 10706f2543Smrg#define YY_FLEX_MINOR_VERSION 5 11706f2543Smrg#define YY_FLEX_SUBMINOR_VERSION 35 12706f2543Smrg#if YY_FLEX_SUBMINOR_VERSION > 0 13706f2543Smrg#define FLEX_BETA 14706f2543Smrg#endif 15706f2543Smrg 16706f2543Smrg/* First, we deal with platform-specific or compiler-specific issues. */ 17706f2543Smrg 18706f2543Smrg/* begin standard C headers. */ 19706f2543Smrg#include <stdio.h> 20706f2543Smrg#include <string.h> 21706f2543Smrg#include <errno.h> 22706f2543Smrg#include <stdlib.h> 23706f2543Smrg 24706f2543Smrg/* end standard C headers. */ 25706f2543Smrg 26706f2543Smrg/* flex integer type definitions */ 27706f2543Smrg 28706f2543Smrg#ifndef FLEXINT_H 29706f2543Smrg#define FLEXINT_H 30706f2543Smrg 31706f2543Smrg/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 32706f2543Smrg 33706f2543Smrg#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 34706f2543Smrg 35706f2543Smrg/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 36706f2543Smrg * if you want the limit (max/min) macros for int types. 37706f2543Smrg */ 38706f2543Smrg#ifndef __STDC_LIMIT_MACROS 39706f2543Smrg#define __STDC_LIMIT_MACROS 1 40706f2543Smrg#endif 41706f2543Smrg 42706f2543Smrg#include <inttypes.h> 43706f2543Smrgtypedef int8_t flex_int8_t; 44706f2543Smrgtypedef uint8_t flex_uint8_t; 45706f2543Smrgtypedef int16_t flex_int16_t; 46706f2543Smrgtypedef uint16_t flex_uint16_t; 47706f2543Smrgtypedef int32_t flex_int32_t; 48706f2543Smrgtypedef uint32_t flex_uint32_t; 49706f2543Smrg#else 50706f2543Smrgtypedef signed char flex_int8_t; 51706f2543Smrgtypedef short int flex_int16_t; 52706f2543Smrgtypedef int flex_int32_t; 53706f2543Smrgtypedef unsigned char flex_uint8_t; 54706f2543Smrgtypedef unsigned short int flex_uint16_t; 55706f2543Smrgtypedef unsigned int flex_uint32_t; 56706f2543Smrg#endif /* ! C99 */ 57706f2543Smrg 58706f2543Smrg/* Limits of integral types. */ 59706f2543Smrg#ifndef INT8_MIN 60706f2543Smrg#define INT8_MIN (-128) 61706f2543Smrg#endif 62706f2543Smrg#ifndef INT16_MIN 63706f2543Smrg#define INT16_MIN (-32767-1) 64706f2543Smrg#endif 65706f2543Smrg#ifndef INT32_MIN 66706f2543Smrg#define INT32_MIN (-2147483647-1) 67706f2543Smrg#endif 68706f2543Smrg#ifndef INT8_MAX 69706f2543Smrg#define INT8_MAX (127) 70706f2543Smrg#endif 71706f2543Smrg#ifndef INT16_MAX 72706f2543Smrg#define INT16_MAX (32767) 73706f2543Smrg#endif 74706f2543Smrg#ifndef INT32_MAX 75706f2543Smrg#define INT32_MAX (2147483647) 76706f2543Smrg#endif 77706f2543Smrg#ifndef UINT8_MAX 78706f2543Smrg#define UINT8_MAX (255U) 79706f2543Smrg#endif 80706f2543Smrg#ifndef UINT16_MAX 81706f2543Smrg#define UINT16_MAX (65535U) 82706f2543Smrg#endif 83706f2543Smrg#ifndef UINT32_MAX 84706f2543Smrg#define UINT32_MAX (4294967295U) 85706f2543Smrg#endif 86706f2543Smrg 87706f2543Smrg#endif /* ! FLEXINT_H */ 88706f2543Smrg 89706f2543Smrg#ifdef __cplusplus 90706f2543Smrg 91706f2543Smrg/* The "const" storage-class-modifier is valid. */ 92706f2543Smrg#define YY_USE_CONST 93706f2543Smrg 94706f2543Smrg#else /* ! __cplusplus */ 95706f2543Smrg 96706f2543Smrg/* C99 requires __STDC__ to be defined as 1. */ 97706f2543Smrg#if defined (__STDC__) 98706f2543Smrg 99706f2543Smrg#define YY_USE_CONST 100706f2543Smrg 101706f2543Smrg#endif /* defined (__STDC__) */ 102706f2543Smrg#endif /* ! __cplusplus */ 103706f2543Smrg 104706f2543Smrg#ifdef YY_USE_CONST 105706f2543Smrg#define yyconst const 106706f2543Smrg#else 107706f2543Smrg#define yyconst 108706f2543Smrg#endif 109706f2543Smrg 110706f2543Smrg/* Returned upon end-of-file. */ 111706f2543Smrg#define YY_NULL 0 112706f2543Smrg 113706f2543Smrg/* Promotes a possibly negative, possibly signed char to an unsigned 114706f2543Smrg * integer for use as an array index. If the signed char is negative, 115706f2543Smrg * we want to instead treat it as an 8-bit unsigned char, hence the 116706f2543Smrg * double cast. 117706f2543Smrg */ 118706f2543Smrg#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 119706f2543Smrg 120706f2543Smrg/* Enter a start condition. This macro really ought to take a parameter, 121706f2543Smrg * but we do it the disgusting crufty way forced on us by the ()-less 122706f2543Smrg * definition of BEGIN. 123706f2543Smrg */ 124706f2543Smrg#define BEGIN (yy_start) = 1 + 2 * 125706f2543Smrg 126706f2543Smrg/* Translate the current start state into a value that can be later handed 127706f2543Smrg * to BEGIN to return to the state. The YYSTATE alias is for lex 128706f2543Smrg * compatibility. 129706f2543Smrg */ 130706f2543Smrg#define YY_START (((yy_start) - 1) / 2) 131706f2543Smrg#define YYSTATE YY_START 132706f2543Smrg 133706f2543Smrg/* Action number for EOF rule of a given start state. */ 134706f2543Smrg#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 135706f2543Smrg 136706f2543Smrg/* Special action meaning "start processing a new file". */ 137706f2543Smrg#define YY_NEW_FILE yyrestart(yyin ) 138706f2543Smrg 139706f2543Smrg#define YY_END_OF_BUFFER_CHAR 0 140706f2543Smrg 141706f2543Smrg/* Size of default input buffer. */ 142706f2543Smrg#ifndef YY_BUF_SIZE 143706f2543Smrg#define YY_BUF_SIZE 16384 144706f2543Smrg#endif 145706f2543Smrg 146706f2543Smrg/* The state buf must be large enough to hold one state per character in the main buffer. 147706f2543Smrg */ 148706f2543Smrg#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 149706f2543Smrg 150706f2543Smrg#ifndef YY_TYPEDEF_YY_BUFFER_STATE 151706f2543Smrg#define YY_TYPEDEF_YY_BUFFER_STATE 152706f2543Smrgtypedef struct yy_buffer_state *YY_BUFFER_STATE; 153706f2543Smrg#endif 154706f2543Smrg 155706f2543Smrgextern int yyleng; 156706f2543Smrg 157706f2543Smrgextern FILE *yyin, *yyout; 158706f2543Smrg 159706f2543Smrg#define EOB_ACT_CONTINUE_SCAN 0 160706f2543Smrg#define EOB_ACT_END_OF_FILE 1 161706f2543Smrg#define EOB_ACT_LAST_MATCH 2 162706f2543Smrg 163706f2543Smrg #define YY_LESS_LINENO(n) 164706f2543Smrg 165706f2543Smrg/* Return all but the first "n" matched characters back to the input stream. */ 166706f2543Smrg#define yyless(n) \ 167706f2543Smrg do \ 168706f2543Smrg { \ 169706f2543Smrg /* Undo effects of setting up yytext. */ \ 170706f2543Smrg int yyless_macro_arg = (n); \ 171706f2543Smrg YY_LESS_LINENO(yyless_macro_arg);\ 172706f2543Smrg *yy_cp = (yy_hold_char); \ 173706f2543Smrg YY_RESTORE_YY_MORE_OFFSET \ 174706f2543Smrg (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 175706f2543Smrg YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 176706f2543Smrg } \ 177706f2543Smrg while ( 0 ) 178706f2543Smrg 179706f2543Smrg#define unput(c) yyunput( c, (yytext_ptr) ) 180706f2543Smrg 181706f2543Smrg#ifndef YY_TYPEDEF_YY_SIZE_T 182706f2543Smrg#define YY_TYPEDEF_YY_SIZE_T 183706f2543Smrgtypedef size_t yy_size_t; 184706f2543Smrg#endif 185706f2543Smrg 186706f2543Smrg#ifndef YY_STRUCT_YY_BUFFER_STATE 187706f2543Smrg#define YY_STRUCT_YY_BUFFER_STATE 188706f2543Smrgstruct yy_buffer_state 189706f2543Smrg { 190706f2543Smrg FILE *yy_input_file; 191706f2543Smrg 192706f2543Smrg char *yy_ch_buf; /* input buffer */ 193706f2543Smrg char *yy_buf_pos; /* current position in input buffer */ 194706f2543Smrg 195706f2543Smrg /* Size of input buffer in bytes, not including room for EOB 196706f2543Smrg * characters. 197706f2543Smrg */ 198706f2543Smrg yy_size_t yy_buf_size; 199706f2543Smrg 200706f2543Smrg /* Number of characters read into yy_ch_buf, not including EOB 201706f2543Smrg * characters. 202706f2543Smrg */ 203706f2543Smrg int yy_n_chars; 204706f2543Smrg 205706f2543Smrg /* Whether we "own" the buffer - i.e., we know we created it, 206706f2543Smrg * and can realloc() it to grow it, and should free() it to 207706f2543Smrg * delete it. 208706f2543Smrg */ 209706f2543Smrg int yy_is_our_buffer; 210706f2543Smrg 211706f2543Smrg /* Whether this is an "interactive" input source; if so, and 212706f2543Smrg * if we're using stdio for input, then we want to use getc() 213706f2543Smrg * instead of fread(), to make sure we stop fetching input after 214706f2543Smrg * each newline. 215706f2543Smrg */ 216706f2543Smrg int yy_is_interactive; 217706f2543Smrg 218706f2543Smrg /* Whether we're considered to be at the beginning of a line. 219706f2543Smrg * If so, '^' rules will be active on the next match, otherwise 220706f2543Smrg * not. 221706f2543Smrg */ 222706f2543Smrg int yy_at_bol; 223706f2543Smrg 224706f2543Smrg int yy_bs_lineno; /**< The line count. */ 225706f2543Smrg int yy_bs_column; /**< The column count. */ 226706f2543Smrg 227706f2543Smrg /* Whether to try to fill the input buffer when we reach the 228706f2543Smrg * end of it. 229706f2543Smrg */ 230706f2543Smrg int yy_fill_buffer; 231706f2543Smrg 232706f2543Smrg int yy_buffer_status; 233706f2543Smrg 234706f2543Smrg#define YY_BUFFER_NEW 0 235706f2543Smrg#define YY_BUFFER_NORMAL 1 236706f2543Smrg /* When an EOF's been seen but there's still some text to process 237706f2543Smrg * then we mark the buffer as YY_EOF_PENDING, to indicate that we 238706f2543Smrg * shouldn't try reading from the input source any more. We might 239706f2543Smrg * still have a bunch of tokens to match, though, because of 240706f2543Smrg * possible backing-up. 241706f2543Smrg * 242706f2543Smrg * When we actually see the EOF, we change the status to "new" 243706f2543Smrg * (via yyrestart()), so that the user can continue scanning by 244706f2543Smrg * just pointing yyin at a new input file. 245706f2543Smrg */ 246706f2543Smrg#define YY_BUFFER_EOF_PENDING 2 247706f2543Smrg 248706f2543Smrg }; 249706f2543Smrg#endif /* !YY_STRUCT_YY_BUFFER_STATE */ 250706f2543Smrg 251706f2543Smrg/* Stack of input buffers. */ 252706f2543Smrgstatic size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ 253706f2543Smrgstatic size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 254706f2543Smrgstatic YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ 255706f2543Smrg 256706f2543Smrg/* We provide macros for accessing buffer states in case in the 257706f2543Smrg * future we want to put the buffer states in a more general 258706f2543Smrg * "scanner state". 259706f2543Smrg * 260706f2543Smrg * Returns the top of the stack, or NULL. 261706f2543Smrg */ 262706f2543Smrg#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 263706f2543Smrg ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 264706f2543Smrg : NULL) 265706f2543Smrg 266706f2543Smrg/* Same as previous macro, but useful when we know that the buffer stack is not 267706f2543Smrg * NULL or when we need an lvalue. For internal use only. 268706f2543Smrg */ 269706f2543Smrg#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 270706f2543Smrg 271706f2543Smrg/* yy_hold_char holds the character lost when yytext is formed. */ 272706f2543Smrgstatic char yy_hold_char; 273706f2543Smrgstatic int yy_n_chars; /* number of characters read into yy_ch_buf */ 274706f2543Smrgint yyleng; 275706f2543Smrg 276706f2543Smrg/* Points to current character in buffer. */ 277706f2543Smrgstatic char *yy_c_buf_p = (char *) 0; 278706f2543Smrgstatic int yy_init = 0; /* whether we need to initialize */ 279706f2543Smrgstatic int yy_start = 0; /* start state number */ 280706f2543Smrg 281706f2543Smrg/* Flag which is used to allow yywrap()'s to do buffer switches 282706f2543Smrg * instead of setting up a fresh yyin. A bit of a hack ... 283706f2543Smrg */ 284706f2543Smrgstatic int yy_did_buffer_switch_on_eof; 285706f2543Smrg 286706f2543Smrgvoid yyrestart (FILE *input_file ); 287706f2543Smrgvoid yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 288706f2543SmrgYY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); 289706f2543Smrgvoid yy_delete_buffer (YY_BUFFER_STATE b ); 290706f2543Smrgvoid yy_flush_buffer (YY_BUFFER_STATE b ); 291706f2543Smrgvoid yypush_buffer_state (YY_BUFFER_STATE new_buffer ); 292706f2543Smrgvoid yypop_buffer_state (void ); 293706f2543Smrg 294706f2543Smrgstatic void yyensure_buffer_stack (void ); 295706f2543Smrgstatic void yy_load_buffer_state (void ); 296706f2543Smrgstatic void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); 297706f2543Smrg 298706f2543Smrg#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) 299706f2543Smrg 300706f2543SmrgYY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); 301706f2543SmrgYY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); 302706f2543SmrgYY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); 303706f2543Smrg 304706f2543Smrgvoid *yyalloc (yy_size_t ); 305706f2543Smrgvoid *yyrealloc (void *,yy_size_t ); 306706f2543Smrgvoid yyfree (void * ); 307706f2543Smrg 308706f2543Smrg#define yy_new_buffer yy_create_buffer 309706f2543Smrg 310706f2543Smrg#define yy_set_interactive(is_interactive) \ 311706f2543Smrg { \ 312706f2543Smrg if ( ! YY_CURRENT_BUFFER ){ \ 313706f2543Smrg yyensure_buffer_stack (); \ 314706f2543Smrg YY_CURRENT_BUFFER_LVALUE = \ 315706f2543Smrg yy_create_buffer(yyin,YY_BUF_SIZE ); \ 316706f2543Smrg } \ 317706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 318706f2543Smrg } 319706f2543Smrg 320706f2543Smrg#define yy_set_bol(at_bol) \ 321706f2543Smrg { \ 322706f2543Smrg if ( ! YY_CURRENT_BUFFER ){\ 323706f2543Smrg yyensure_buffer_stack (); \ 324706f2543Smrg YY_CURRENT_BUFFER_LVALUE = \ 325706f2543Smrg yy_create_buffer(yyin,YY_BUF_SIZE ); \ 326706f2543Smrg } \ 327706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 328706f2543Smrg } 329706f2543Smrg 330706f2543Smrg#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 331706f2543Smrg 332706f2543Smrg/* Begin user sect3 */ 333706f2543Smrg 334706f2543Smrgtypedef unsigned char YY_CHAR; 335706f2543Smrg 336706f2543SmrgFILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 337706f2543Smrg 338706f2543Smrgtypedef int yy_state_type; 339706f2543Smrg 340706f2543Smrgextern int yylineno; 341706f2543Smrg 342706f2543Smrgint yylineno = 1; 343706f2543Smrg 344706f2543Smrgextern char *yytext; 345706f2543Smrg#define yytext_ptr yytext 346706f2543Smrg 347706f2543Smrgstatic yy_state_type yy_get_previous_state (void ); 348706f2543Smrgstatic yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 349706f2543Smrgstatic int yy_get_next_buffer (void ); 350706f2543Smrgstatic void yy_fatal_error (yyconst char msg[] ); 351706f2543Smrg 352706f2543Smrg/* Done after the current pattern has been matched and before the 353706f2543Smrg * corresponding action - sets up yytext. 354706f2543Smrg */ 355706f2543Smrg#define YY_DO_BEFORE_ACTION \ 356706f2543Smrg (yytext_ptr) = yy_bp; \ 357706f2543Smrg yyleng = (size_t) (yy_cp - yy_bp); \ 358706f2543Smrg (yy_hold_char) = *yy_cp; \ 359706f2543Smrg *yy_cp = '\0'; \ 360706f2543Smrg (yy_c_buf_p) = yy_cp; 361706f2543Smrg 362706f2543Smrg#define YY_NUM_RULES 20 363706f2543Smrg#define YY_END_OF_BUFFER 21 364706f2543Smrg/* This struct is not used in this scanner, 365706f2543Smrg but its presence is necessary. */ 366706f2543Smrgstruct yy_trans_info 367706f2543Smrg { 368706f2543Smrg flex_int32_t yy_verify; 369706f2543Smrg flex_int32_t yy_nxt; 370706f2543Smrg }; 371706f2543Smrgstatic yyconst flex_int16_t yy_accept[73] = 372706f2543Smrg { 0, 373706f2543Smrg 0, 0, 0, 0, 21, 19, 12, 11, 19, 18, 374706f2543Smrg 19, 19, 16, 19, 15, 19, 19, 19, 19, 19, 375706f2543Smrg 19, 13, 14, 17, 12, 0, 10, 18, 9, 9, 376706f2543Smrg 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 377706f2543Smrg 17, 0, 9, 0, 6, 0, 0, 9, 9, 9, 378706f2543Smrg 9, 9, 0, 0, 7, 8, 9, 9, 9, 9, 379706f2543Smrg 3, 7, 9, 9, 5, 9, 9, 4, 9, 2, 380706f2543Smrg 1, 0 381706f2543Smrg } ; 382706f2543Smrg 383706f2543Smrgstatic yyconst flex_int32_t yy_ec[256] = 384706f2543Smrg { 0, 385706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 386706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 387706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 388706f2543Smrg 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, 389706f2543Smrg 1, 6, 7, 1, 7, 6, 8, 9, 9, 9, 390706f2543Smrg 9, 9, 9, 9, 9, 9, 9, 6, 10, 1, 391706f2543Smrg 1, 1, 1, 11, 6, 6, 6, 6, 6, 6, 392706f2543Smrg 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 393706f2543Smrg 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 394706f2543Smrg 1, 1, 1, 1, 6, 1, 12, 6, 6, 13, 395706f2543Smrg 396706f2543Smrg 6, 6, 6, 6, 14, 6, 6, 15, 16, 17, 397706f2543Smrg 18, 19, 6, 20, 21, 22, 23, 24, 25, 26, 398706f2543Smrg 27, 6, 28, 1, 29, 1, 1, 1, 1, 1, 399706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 400706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 401706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 402706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 403706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 404706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 405706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 406706f2543Smrg 407706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 408706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 409706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 410706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 411706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 412706f2543Smrg 1, 1, 1, 1, 1 413706f2543Smrg } ; 414706f2543Smrg 415706f2543Smrgstatic yyconst flex_int32_t yy_meta[30] = 416706f2543Smrg { 0, 417706f2543Smrg 1, 1, 2, 1, 1, 3, 3, 3, 3, 1, 418706f2543Smrg 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 419706f2543Smrg 3, 3, 3, 3, 3, 3, 3, 1, 1 420706f2543Smrg } ; 421706f2543Smrg 422706f2543Smrgstatic yyconst flex_int16_t yy_base[77] = 423706f2543Smrg { 0, 424706f2543Smrg 0, 101, 0, 100, 104, 107, 101, 107, 98, 0, 425706f2543Smrg 0, 92, 0, 28, 107, 29, 86, 80, 86, 83, 426706f2543Smrg 84, 107, 107, 0, 93, 90, 89, 0, 0, 32, 427706f2543Smrg 30, 31, 33, 34, 42, 71, 69, 70, 69, 73, 428706f2543Smrg 0, 43, 44, 46, 78, 45, 77, 66, 70, 71, 429706f2543Smrg 60, 66, 50, 56, 70, 67, 58, 52, 53, 44, 430706f2543Smrg 0, 57, 52, 46, 0, 50, 34, 0, 45, 0, 431706f2543Smrg 0, 107, 71, 74, 46, 77 432706f2543Smrg } ; 433706f2543Smrg 434706f2543Smrgstatic yyconst flex_int16_t yy_def[77] = 435706f2543Smrg { 0, 436706f2543Smrg 72, 1, 1, 1, 72, 72, 72, 72, 73, 74, 437706f2543Smrg 75, 75, 75, 72, 72, 72, 75, 75, 75, 75, 438706f2543Smrg 75, 72, 72, 76, 72, 73, 72, 74, 75, 75, 439706f2543Smrg 72, 72, 72, 72, 72, 75, 75, 75, 75, 75, 440706f2543Smrg 76, 72, 75, 72, 72, 72, 72, 75, 75, 75, 441706f2543Smrg 75, 75, 72, 72, 75, 72, 75, 75, 75, 75, 442706f2543Smrg 75, 72, 75, 75, 75, 75, 75, 75, 75, 75, 443706f2543Smrg 75, 0, 72, 72, 72, 72 444706f2543Smrg } ; 445706f2543Smrg 446706f2543Smrgstatic yyconst flex_int16_t yy_nxt[137] = 447706f2543Smrg { 0, 448706f2543Smrg 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 449706f2543Smrg 16, 11, 17, 11, 11, 11, 11, 18, 19, 11, 450706f2543Smrg 11, 11, 11, 20, 21, 11, 11, 22, 23, 31, 451706f2543Smrg 34, 31, 31, 42, 44, 34, 32, 35, 43, 32, 452706f2543Smrg 30, 45, 35, 46, 42, 54, 46, 44, 29, 53, 453706f2543Smrg 35, 54, 55, 33, 45, 33, 33, 54, 62, 71, 454706f2543Smrg 70, 69, 68, 67, 62, 62, 66, 47, 65, 64, 455706f2543Smrg 47, 26, 63, 26, 28, 56, 28, 41, 55, 41, 456706f2543Smrg 61, 60, 59, 58, 57, 56, 45, 52, 51, 50, 457706f2543Smrg 49, 48, 26, 27, 25, 40, 39, 38, 37, 36, 458706f2543Smrg 459706f2543Smrg 30, 27, 25, 72, 24, 24, 5, 72, 72, 72, 460706f2543Smrg 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 461706f2543Smrg 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 462706f2543Smrg 72, 72, 72, 72, 72, 72 463706f2543Smrg } ; 464706f2543Smrg 465706f2543Smrgstatic yyconst flex_int16_t yy_chk[137] = 466706f2543Smrg { 0, 467706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 468706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 469706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 14, 470706f2543Smrg 16, 31, 32, 30, 33, 34, 14, 16, 30, 32, 471706f2543Smrg 30, 33, 34, 35, 42, 43, 46, 44, 75, 42, 472706f2543Smrg 35, 53, 43, 14, 44, 31, 32, 54, 53, 69, 473706f2543Smrg 67, 66, 64, 63, 54, 62, 60, 35, 59, 58, 474706f2543Smrg 46, 73, 57, 73, 74, 56, 74, 76, 55, 76, 475706f2543Smrg 52, 51, 50, 49, 48, 47, 45, 40, 39, 38, 476706f2543Smrg 37, 36, 27, 26, 25, 21, 20, 19, 18, 17, 477706f2543Smrg 478706f2543Smrg 12, 9, 7, 5, 4, 2, 72, 72, 72, 72, 479706f2543Smrg 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 480706f2543Smrg 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 481706f2543Smrg 72, 72, 72, 72, 72, 72 482706f2543Smrg } ; 483706f2543Smrg 484706f2543Smrgstatic yy_state_type yy_last_accepting_state; 485706f2543Smrgstatic char *yy_last_accepting_cpos; 486706f2543Smrg 487706f2543Smrgextern int yy_flex_debug; 488706f2543Smrgint yy_flex_debug = 0; 489706f2543Smrg 490706f2543Smrg/* The intent behind this definition is that it'll catch 491706f2543Smrg * any uses of REJECT which flex missed. 492706f2543Smrg */ 493706f2543Smrg#define REJECT reject_used_but_not_detected 494706f2543Smrg#define yymore() yymore_used_but_not_detected 495706f2543Smrg#define YY_MORE_ADJ 0 496706f2543Smrg#define YY_RESTORE_YY_MORE_OFFSET 497706f2543Smrgchar *yytext; 498706f2543Smrg#line 1 "scanner.l" 499706f2543Smrg/* $XFree86$ */ 500706f2543Smrg/* 501706f2543Smrg * Copyright 2002 Red Hat Inc., Durham, North Carolina. 502706f2543Smrg * 503706f2543Smrg * All Rights Reserved. 504706f2543Smrg * 505706f2543Smrg * Permission is hereby granted, free of charge, to any person obtaining 506706f2543Smrg * a copy of this software and associated documentation files (the 507706f2543Smrg * "Software"), to deal in the Software without restriction, including 508706f2543Smrg * without limitation on the rights to use, copy, modify, merge, 509706f2543Smrg * publish, distribute, sublicense, and/or sell copies of the Software, 510706f2543Smrg * and to permit persons to whom the Software is furnished to do so, 511706f2543Smrg * subject to the following conditions: 512706f2543Smrg * 513706f2543Smrg * The above copyright notice and this permission notice (including the 514706f2543Smrg * next paragraph) shall be included in all copies or substantial 515706f2543Smrg * portions of the Software. 516706f2543Smrg * 517706f2543Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 518706f2543Smrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 519706f2543Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 520706f2543Smrg * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS 521706f2543Smrg * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 522706f2543Smrg * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 523706f2543Smrg * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 524706f2543Smrg * SOFTWARE. 525706f2543Smrg */ 526706f2543Smrg/* 527706f2543Smrg * Authors: 528706f2543Smrg * Rickard E. (Rik) Faith <faith@redhat.com> 529706f2543Smrg * 530706f2543Smrg */ 531706f2543Smrg#line 36 "scanner.l" 532706f2543Smrg#ifdef HAVE_DMX_CONFIG_H 533706f2543Smrg#include <dmx-config.h> 534706f2543Smrg#endif 535706f2543Smrg 536706f2543Smrg#include "dmxparse.h" 537706f2543Smrg#include "parser.h" 538706f2543Smrg#include <string.h> 539706f2543Smrg#include <stdlib.h> 540706f2543Smrg#include <ctype.h> 541706f2543Smrgstatic int getdimension(int token, const char *text, int leng); 542706f2543Smrgstatic int getstring(int token, const char *text, int leng); 543706f2543Smrgstatic int gettoken(int token, const char *text, int leng); 544706f2543Smrgstatic int getcomment(int token, const char *text, int leng); 545706f2543Smrgstatic int lineno = 1; 546706f2543Smrg 547706f2543Smrg#line 548 "scanner.c" 548706f2543Smrg 549706f2543Smrg#define INITIAL 0 550706f2543Smrg#define OTHER 1 551706f2543Smrg 552706f2543Smrg#ifndef YY_NO_UNISTD_H 553706f2543Smrg/* Special case for "unistd.h", since it is non-ANSI. We include it way 554706f2543Smrg * down here because we want the user's section 1 to have been scanned first. 555706f2543Smrg * The user has a chance to override it with an option. 556706f2543Smrg */ 557706f2543Smrg#include <unistd.h> 558706f2543Smrg#endif 559706f2543Smrg 560706f2543Smrg#ifndef YY_EXTRA_TYPE 561706f2543Smrg#define YY_EXTRA_TYPE void * 562706f2543Smrg#endif 563706f2543Smrg 564706f2543Smrgstatic int yy_init_globals (void ); 565706f2543Smrg 566706f2543Smrg/* Accessor methods to globals. 567706f2543Smrg These are made visible to non-reentrant scanners for convenience. */ 568706f2543Smrg 569706f2543Smrgint yylex_destroy (void ); 570706f2543Smrg 571706f2543Smrgint yyget_debug (void ); 572706f2543Smrg 573706f2543Smrgvoid yyset_debug (int debug_flag ); 574706f2543Smrg 575706f2543SmrgYY_EXTRA_TYPE yyget_extra (void ); 576706f2543Smrg 577706f2543Smrgvoid yyset_extra (YY_EXTRA_TYPE user_defined ); 578706f2543Smrg 579706f2543SmrgFILE *yyget_in (void ); 580706f2543Smrg 581706f2543Smrgvoid yyset_in (FILE * in_str ); 582706f2543Smrg 583706f2543SmrgFILE *yyget_out (void ); 584706f2543Smrg 585706f2543Smrgvoid yyset_out (FILE * out_str ); 586706f2543Smrg 587706f2543Smrgint yyget_leng (void ); 588706f2543Smrg 589706f2543Smrgchar *yyget_text (void ); 590706f2543Smrg 591706f2543Smrgint yyget_lineno (void ); 592706f2543Smrg 593706f2543Smrgvoid yyset_lineno (int line_number ); 594706f2543Smrg 595706f2543Smrg/* Macros after this point can all be overridden by user definitions in 596706f2543Smrg * section 1. 597706f2543Smrg */ 598706f2543Smrg 599706f2543Smrg#ifndef YY_SKIP_YYWRAP 600706f2543Smrg#ifdef __cplusplus 601706f2543Smrgextern "C" int yywrap (void ); 602706f2543Smrg#else 603706f2543Smrgextern int yywrap (void ); 604706f2543Smrg#endif 605706f2543Smrg#endif 606706f2543Smrg 607706f2543Smrg static void yyunput (int c,char *buf_ptr ); 608706f2543Smrg 609706f2543Smrg#ifndef yytext_ptr 610706f2543Smrgstatic void yy_flex_strncpy (char *,yyconst char *,int ); 611706f2543Smrg#endif 612706f2543Smrg 613706f2543Smrg#ifdef YY_NEED_STRLEN 614706f2543Smrgstatic int yy_flex_strlen (yyconst char * ); 615706f2543Smrg#endif 616706f2543Smrg 617706f2543Smrg#ifndef YY_NO_INPUT 618706f2543Smrg 619706f2543Smrg#ifdef __cplusplus 620706f2543Smrgstatic int yyinput (void ); 621706f2543Smrg#else 622706f2543Smrgstatic int input (void ); 623706f2543Smrg#endif 624706f2543Smrg 625706f2543Smrg#endif 626706f2543Smrg 627706f2543Smrg/* Amount of stuff to slurp up with each read. */ 628706f2543Smrg#ifndef YY_READ_BUF_SIZE 629706f2543Smrg#define YY_READ_BUF_SIZE 8192 630706f2543Smrg#endif 631706f2543Smrg 632706f2543Smrg/* Copy whatever the last rule matched to the standard output. */ 633706f2543Smrg#ifndef ECHO 634706f2543Smrg/* This used to be an fputs(), but since the string might contain NUL's, 635706f2543Smrg * we now use fwrite(). 636706f2543Smrg */ 637706f2543Smrg#define ECHO fwrite( yytext, yyleng, 1, yyout ) 638706f2543Smrg#endif 639706f2543Smrg 640706f2543Smrg/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 641706f2543Smrg * is returned in "result". 642706f2543Smrg */ 643706f2543Smrg#ifndef YY_INPUT 644706f2543Smrg#define YY_INPUT(buf,result,max_size) \ 645706f2543Smrg if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 646706f2543Smrg { \ 647706f2543Smrg int c = '*'; \ 648706f2543Smrg int n; \ 649706f2543Smrg for ( n = 0; n < max_size && \ 650706f2543Smrg (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 651706f2543Smrg buf[n] = (char) c; \ 652706f2543Smrg if ( c == '\n' ) \ 653706f2543Smrg buf[n++] = (char) c; \ 654706f2543Smrg if ( c == EOF && ferror( yyin ) ) \ 655706f2543Smrg YY_FATAL_ERROR( "input in flex scanner failed" ); \ 656706f2543Smrg result = n; \ 657706f2543Smrg } \ 658706f2543Smrg else \ 659706f2543Smrg { \ 660706f2543Smrg errno=0; \ 661706f2543Smrg while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 662706f2543Smrg { \ 663706f2543Smrg if( errno != EINTR) \ 664706f2543Smrg { \ 665706f2543Smrg YY_FATAL_ERROR( "input in flex scanner failed" ); \ 666706f2543Smrg break; \ 667706f2543Smrg } \ 668706f2543Smrg errno=0; \ 669706f2543Smrg clearerr(yyin); \ 670706f2543Smrg } \ 671706f2543Smrg }\ 672706f2543Smrg\ 673706f2543Smrg 674706f2543Smrg#endif 675706f2543Smrg 676706f2543Smrg/* No semi-colon after return; correct usage is to write "yyterminate();" - 677706f2543Smrg * we don't want an extra ';' after the "return" because that will cause 678706f2543Smrg * some compilers to complain about unreachable statements. 679706f2543Smrg */ 680706f2543Smrg#ifndef yyterminate 681706f2543Smrg#define yyterminate() return YY_NULL 682706f2543Smrg#endif 683706f2543Smrg 684706f2543Smrg/* Number of entries by which start-condition stack grows. */ 685706f2543Smrg#ifndef YY_START_STACK_INCR 686706f2543Smrg#define YY_START_STACK_INCR 25 687706f2543Smrg#endif 688706f2543Smrg 689706f2543Smrg/* Report a fatal error. */ 690706f2543Smrg#ifndef YY_FATAL_ERROR 691706f2543Smrg#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 692706f2543Smrg#endif 693706f2543Smrg 694706f2543Smrg/* end tables serialization structures and prototypes */ 695706f2543Smrg 696706f2543Smrg/* Default declaration of generated scanner - a define so the user can 697706f2543Smrg * easily add parameters. 698706f2543Smrg */ 699706f2543Smrg#ifndef YY_DECL 700706f2543Smrg#define YY_DECL_IS_OURS 1 701706f2543Smrg 702706f2543Smrgextern int yylex (void); 703706f2543Smrg 704706f2543Smrg#define YY_DECL int yylex (void) 705706f2543Smrg#endif /* !YY_DECL */ 706706f2543Smrg 707706f2543Smrg/* Code executed at the beginning of each rule, after yytext and yyleng 708706f2543Smrg * have been set up. 709706f2543Smrg */ 710706f2543Smrg#ifndef YY_USER_ACTION 711706f2543Smrg#define YY_USER_ACTION 712706f2543Smrg#endif 713706f2543Smrg 714706f2543Smrg/* Code executed at the end of each rule. */ 715706f2543Smrg#ifndef YY_BREAK 716706f2543Smrg#define YY_BREAK break; 717706f2543Smrg#endif 718706f2543Smrg 719706f2543Smrg#define YY_RULE_SETUP \ 720706f2543Smrg if ( yyleng > 0 ) \ 721706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ 722706f2543Smrg (yytext[yyleng - 1] == '\n'); \ 723706f2543Smrg YY_USER_ACTION 724706f2543Smrg 725706f2543Smrg/** The main scanner function which does all the work. 726706f2543Smrg */ 727706f2543SmrgYY_DECL 728706f2543Smrg{ 729706f2543Smrg register yy_state_type yy_current_state; 730706f2543Smrg register char *yy_cp, *yy_bp; 731706f2543Smrg register int yy_act; 732706f2543Smrg 733706f2543Smrg#line 62 "scanner.l" 734706f2543Smrg 735706f2543Smrg#line 736 "scanner.c" 736706f2543Smrg 737706f2543Smrg if ( !(yy_init) ) 738706f2543Smrg { 739706f2543Smrg (yy_init) = 1; 740706f2543Smrg 741706f2543Smrg#ifdef YY_USER_INIT 742706f2543Smrg YY_USER_INIT; 743706f2543Smrg#endif 744706f2543Smrg 745706f2543Smrg if ( ! (yy_start) ) 746706f2543Smrg (yy_start) = 1; /* first start state */ 747706f2543Smrg 748706f2543Smrg if ( ! yyin ) 749706f2543Smrg yyin = stdin; 750706f2543Smrg 751706f2543Smrg if ( ! yyout ) 752706f2543Smrg yyout = stdout; 753706f2543Smrg 754706f2543Smrg if ( ! YY_CURRENT_BUFFER ) { 755706f2543Smrg yyensure_buffer_stack (); 756706f2543Smrg YY_CURRENT_BUFFER_LVALUE = 757706f2543Smrg yy_create_buffer(yyin,YY_BUF_SIZE ); 758706f2543Smrg } 759706f2543Smrg 760706f2543Smrg yy_load_buffer_state( ); 761706f2543Smrg } 762706f2543Smrg 763706f2543Smrg while ( 1 ) /* loops until end-of-file is reached */ 764706f2543Smrg { 765706f2543Smrg yy_cp = (yy_c_buf_p); 766706f2543Smrg 767706f2543Smrg /* Support of yytext. */ 768706f2543Smrg *yy_cp = (yy_hold_char); 769706f2543Smrg 770706f2543Smrg /* yy_bp points to the position in yy_ch_buf of the start of 771706f2543Smrg * the current run. 772706f2543Smrg */ 773706f2543Smrg yy_bp = yy_cp; 774706f2543Smrg 775706f2543Smrg yy_current_state = (yy_start); 776706f2543Smrg yy_current_state += YY_AT_BOL(); 777706f2543Smrgyy_match: 778706f2543Smrg do 779706f2543Smrg { 780706f2543Smrg register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 781706f2543Smrg if ( yy_accept[yy_current_state] ) 782706f2543Smrg { 783706f2543Smrg (yy_last_accepting_state) = yy_current_state; 784706f2543Smrg (yy_last_accepting_cpos) = yy_cp; 785706f2543Smrg } 786706f2543Smrg while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 787706f2543Smrg { 788706f2543Smrg yy_current_state = (int) yy_def[yy_current_state]; 789706f2543Smrg if ( yy_current_state >= 73 ) 790706f2543Smrg yy_c = yy_meta[(unsigned int) yy_c]; 791706f2543Smrg } 792706f2543Smrg yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 793706f2543Smrg ++yy_cp; 794706f2543Smrg } 795706f2543Smrg while ( yy_base[yy_current_state] != 107 ); 796706f2543Smrg 797706f2543Smrgyy_find_action: 798706f2543Smrg yy_act = yy_accept[yy_current_state]; 799706f2543Smrg if ( yy_act == 0 ) 800706f2543Smrg { /* have to back up */ 801706f2543Smrg yy_cp = (yy_last_accepting_cpos); 802706f2543Smrg yy_current_state = (yy_last_accepting_state); 803706f2543Smrg yy_act = yy_accept[yy_current_state]; 804706f2543Smrg } 805706f2543Smrg 806706f2543Smrg YY_DO_BEFORE_ACTION; 807706f2543Smrg 808706f2543Smrgdo_action: /* This label is used only to access EOF actions. */ 809706f2543Smrg 810706f2543Smrg switch ( yy_act ) 811706f2543Smrg { /* beginning of action switch */ 812706f2543Smrg case 0: /* must back up */ 813706f2543Smrg /* undo the effects of YY_DO_BEFORE_ACTION */ 814706f2543Smrg *yy_cp = (yy_hold_char); 815706f2543Smrg yy_cp = (yy_last_accepting_cpos); 816706f2543Smrg yy_current_state = (yy_last_accepting_state); 817706f2543Smrg goto yy_find_action; 818706f2543Smrg 819706f2543Smrgcase 1: 820706f2543SmrgYY_RULE_SETUP 821706f2543Smrg#line 63 "scanner.l" 822706f2543Smrgreturn gettoken(T_VIRTUAL, yytext, yyleng); 823706f2543Smrg YY_BREAK 824706f2543Smrgcase 2: 825706f2543SmrgYY_RULE_SETUP 826706f2543Smrg#line 64 "scanner.l" 827706f2543Smrgreturn gettoken(T_DISPLAY, yytext, yyleng); 828706f2543Smrg YY_BREAK 829706f2543Smrgcase 3: 830706f2543SmrgYY_RULE_SETUP 831706f2543Smrg#line 65 "scanner.l" 832706f2543Smrgreturn gettoken(T_WALL, yytext, yyleng); 833706f2543Smrg YY_BREAK 834706f2543Smrgcase 4: 835706f2543SmrgYY_RULE_SETUP 836706f2543Smrg#line 66 "scanner.l" 837706f2543Smrgreturn gettoken(T_OPTION, yytext, yyleng); 838706f2543Smrg YY_BREAK 839706f2543Smrgcase 5: 840706f2543SmrgYY_RULE_SETUP 841706f2543Smrg#line 67 "scanner.l" 842706f2543Smrgreturn gettoken(T_PARAM, yytext, yyleng); 843706f2543Smrg YY_BREAK 844706f2543Smrgcase 6: 845706f2543SmrgYY_RULE_SETUP 846706f2543Smrg#line 68 "scanner.l" 847706f2543Smrgreturn getdimension(T_DIMENSION, yytext, yyleng); 848706f2543Smrg YY_BREAK 849706f2543Smrgcase 7: 850706f2543SmrgYY_RULE_SETUP 851706f2543Smrg#line 69 "scanner.l" 852706f2543Smrgreturn getdimension(T_OFFSET, yytext+1, yyleng-1); 853706f2543Smrg YY_BREAK 854706f2543Smrgcase 8: 855706f2543SmrgYY_RULE_SETUP 856706f2543Smrg#line 70 "scanner.l" 857706f2543Smrgreturn getdimension(T_ORIGIN, yytext+1, yyleng-1); 858706f2543Smrg YY_BREAK 859706f2543Smrgcase 9: 860706f2543SmrgYY_RULE_SETUP 861706f2543Smrg#line 71 "scanner.l" 862706f2543Smrgreturn getstring(T_STRING, yytext, yyleng); 863706f2543Smrg YY_BREAK 864706f2543Smrgcase 10: 865706f2543SmrgYY_RULE_SETUP 866706f2543Smrg#line 72 "scanner.l" 867706f2543Smrgreturn getstring(T_STRING, yytext+1, yyleng-2); 868706f2543Smrg YY_BREAK 869706f2543Smrgcase 11: 870706f2543Smrg/* rule 11 can match eol */ 871706f2543SmrgYY_RULE_SETUP 872706f2543Smrg#line 73 "scanner.l" 873706f2543Smrg++lineno; 874706f2543Smrg YY_BREAK 875706f2543Smrgcase 12: 876706f2543SmrgYY_RULE_SETUP 877706f2543Smrg#line 74 "scanner.l" 878706f2543Smrg 879706f2543Smrg YY_BREAK 880706f2543Smrgcase 13: 881706f2543SmrgYY_RULE_SETUP 882706f2543Smrg#line 75 "scanner.l" 883706f2543Smrgreturn gettoken(yytext[0], yytext, yyleng); 884706f2543Smrg YY_BREAK 885706f2543Smrgcase 14: 886706f2543SmrgYY_RULE_SETUP 887706f2543Smrg#line 76 "scanner.l" 888706f2543Smrgreturn gettoken(yytext[0], yytext, yyleng); 889706f2543Smrg YY_BREAK 890706f2543Smrgcase 15: 891706f2543SmrgYY_RULE_SETUP 892706f2543Smrg#line 77 "scanner.l" 893706f2543Smrgreturn gettoken(yytext[0], yytext, yyleng); 894706f2543Smrg YY_BREAK 895706f2543Smrgcase 16: 896706f2543SmrgYY_RULE_SETUP 897706f2543Smrg#line 78 "scanner.l" 898706f2543Smrgreturn gettoken(yytext[0], yytext, yyleng); 899706f2543Smrg YY_BREAK 900706f2543Smrgcase 17: 901706f2543SmrgYY_RULE_SETUP 902706f2543Smrg#line 79 "scanner.l" 903706f2543Smrgreturn getcomment(T_LINE_COMMENT, yytext, yyleng); 904706f2543Smrg YY_BREAK 905706f2543Smrgcase 18: 906706f2543SmrgYY_RULE_SETUP 907706f2543Smrg#line 80 "scanner.l" 908706f2543Smrgreturn getcomment(T_COMMENT, yytext, yyleng); 909706f2543Smrg YY_BREAK 910706f2543Smrgcase 19: 911706f2543SmrgYY_RULE_SETUP 912706f2543Smrg#line 81 "scanner.l" 913706f2543Smrgreturn getstring(T_STRING, yytext, yyleng); 914706f2543Smrg YY_BREAK 915706f2543Smrgcase YY_STATE_EOF(INITIAL): 916706f2543Smrgcase YY_STATE_EOF(OTHER): 917706f2543Smrg#line 82 "scanner.l" 918706f2543Smrgreturn 0; 919706f2543Smrg YY_BREAK 920706f2543Smrgcase 20: 921706f2543SmrgYY_RULE_SETUP 922706f2543Smrg#line 83 "scanner.l" 923706f2543SmrgECHO; 924706f2543Smrg YY_BREAK 925706f2543Smrg#line 926 "scanner.c" 926706f2543Smrg 927706f2543Smrg case YY_END_OF_BUFFER: 928706f2543Smrg { 929706f2543Smrg /* Amount of text matched not including the EOB char. */ 930706f2543Smrg int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 931706f2543Smrg 932706f2543Smrg /* Undo the effects of YY_DO_BEFORE_ACTION. */ 933706f2543Smrg *yy_cp = (yy_hold_char); 934706f2543Smrg YY_RESTORE_YY_MORE_OFFSET 935706f2543Smrg 936706f2543Smrg if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 937706f2543Smrg { 938706f2543Smrg /* We're scanning a new file or input source. It's 939706f2543Smrg * possible that this happened because the user 940706f2543Smrg * just pointed yyin at a new source and called 941706f2543Smrg * yylex(). If so, then we have to assure 942706f2543Smrg * consistency between YY_CURRENT_BUFFER and our 943706f2543Smrg * globals. Here is the right place to do so, because 944706f2543Smrg * this is the first action (other than possibly a 945706f2543Smrg * back-up) that will match for the new input source. 946706f2543Smrg */ 947706f2543Smrg (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 948706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 949706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 950706f2543Smrg } 951706f2543Smrg 952706f2543Smrg /* Note that here we test for yy_c_buf_p "<=" to the position 953706f2543Smrg * of the first EOB in the buffer, since yy_c_buf_p will 954706f2543Smrg * already have been incremented past the NUL character 955706f2543Smrg * (since all states make transitions on EOB to the 956706f2543Smrg * end-of-buffer state). Contrast this with the test 957706f2543Smrg * in input(). 958706f2543Smrg */ 959706f2543Smrg if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 960706f2543Smrg { /* This was really a NUL. */ 961706f2543Smrg yy_state_type yy_next_state; 962706f2543Smrg 963706f2543Smrg (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 964706f2543Smrg 965706f2543Smrg yy_current_state = yy_get_previous_state( ); 966706f2543Smrg 967706f2543Smrg /* Okay, we're now positioned to make the NUL 968706f2543Smrg * transition. We couldn't have 969706f2543Smrg * yy_get_previous_state() go ahead and do it 970706f2543Smrg * for us because it doesn't know how to deal 971706f2543Smrg * with the possibility of jamming (and we don't 972706f2543Smrg * want to build jamming into it because then it 973706f2543Smrg * will run more slowly). 974706f2543Smrg */ 975706f2543Smrg 976706f2543Smrg yy_next_state = yy_try_NUL_trans( yy_current_state ); 977706f2543Smrg 978706f2543Smrg yy_bp = (yytext_ptr) + YY_MORE_ADJ; 979706f2543Smrg 980706f2543Smrg if ( yy_next_state ) 981706f2543Smrg { 982706f2543Smrg /* Consume the NUL. */ 983706f2543Smrg yy_cp = ++(yy_c_buf_p); 984706f2543Smrg yy_current_state = yy_next_state; 985706f2543Smrg goto yy_match; 986706f2543Smrg } 987706f2543Smrg 988706f2543Smrg else 989706f2543Smrg { 990706f2543Smrg yy_cp = (yy_c_buf_p); 991706f2543Smrg goto yy_find_action; 992706f2543Smrg } 993706f2543Smrg } 994706f2543Smrg 995706f2543Smrg else switch ( yy_get_next_buffer( ) ) 996706f2543Smrg { 997706f2543Smrg case EOB_ACT_END_OF_FILE: 998706f2543Smrg { 999706f2543Smrg (yy_did_buffer_switch_on_eof) = 0; 1000706f2543Smrg 1001706f2543Smrg if ( yywrap( ) ) 1002706f2543Smrg { 1003706f2543Smrg /* Note: because we've taken care in 1004706f2543Smrg * yy_get_next_buffer() to have set up 1005706f2543Smrg * yytext, we can now set up 1006706f2543Smrg * yy_c_buf_p so that if some total 1007706f2543Smrg * hoser (like flex itself) wants to 1008706f2543Smrg * call the scanner after we return the 1009706f2543Smrg * YY_NULL, it'll still work - another 1010706f2543Smrg * YY_NULL will get returned. 1011706f2543Smrg */ 1012706f2543Smrg (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 1013706f2543Smrg 1014706f2543Smrg yy_act = YY_STATE_EOF(YY_START); 1015706f2543Smrg goto do_action; 1016706f2543Smrg } 1017706f2543Smrg 1018706f2543Smrg else 1019706f2543Smrg { 1020706f2543Smrg if ( ! (yy_did_buffer_switch_on_eof) ) 1021706f2543Smrg YY_NEW_FILE; 1022706f2543Smrg } 1023706f2543Smrg break; 1024706f2543Smrg } 1025706f2543Smrg 1026706f2543Smrg case EOB_ACT_CONTINUE_SCAN: 1027706f2543Smrg (yy_c_buf_p) = 1028706f2543Smrg (yytext_ptr) + yy_amount_of_matched_text; 1029706f2543Smrg 1030706f2543Smrg yy_current_state = yy_get_previous_state( ); 1031706f2543Smrg 1032706f2543Smrg yy_cp = (yy_c_buf_p); 1033706f2543Smrg yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1034706f2543Smrg goto yy_match; 1035706f2543Smrg 1036706f2543Smrg case EOB_ACT_LAST_MATCH: 1037706f2543Smrg (yy_c_buf_p) = 1038706f2543Smrg &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 1039706f2543Smrg 1040706f2543Smrg yy_current_state = yy_get_previous_state( ); 1041706f2543Smrg 1042706f2543Smrg yy_cp = (yy_c_buf_p); 1043706f2543Smrg yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1044706f2543Smrg goto yy_find_action; 1045706f2543Smrg } 1046706f2543Smrg break; 1047706f2543Smrg } 1048706f2543Smrg 1049706f2543Smrg default: 1050706f2543Smrg YY_FATAL_ERROR( 1051706f2543Smrg "fatal flex scanner internal error--no action found" ); 1052706f2543Smrg } /* end of action switch */ 1053706f2543Smrg } /* end of scanning one token */ 1054706f2543Smrg} /* end of yylex */ 1055706f2543Smrg 1056706f2543Smrg/* yy_get_next_buffer - try to read in a new buffer 1057706f2543Smrg * 1058706f2543Smrg * Returns a code representing an action: 1059706f2543Smrg * EOB_ACT_LAST_MATCH - 1060706f2543Smrg * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 1061706f2543Smrg * EOB_ACT_END_OF_FILE - end of file 1062706f2543Smrg */ 1063706f2543Smrgstatic int yy_get_next_buffer (void) 1064706f2543Smrg{ 1065706f2543Smrg register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 1066706f2543Smrg register char *source = (yytext_ptr); 1067706f2543Smrg register int number_to_move, i; 1068706f2543Smrg int ret_val; 1069706f2543Smrg 1070706f2543Smrg if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 1071706f2543Smrg YY_FATAL_ERROR( 1072706f2543Smrg "fatal flex scanner internal error--end of buffer missed" ); 1073706f2543Smrg 1074706f2543Smrg if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 1075706f2543Smrg { /* Don't try to fill the buffer, so this is an EOF. */ 1076706f2543Smrg if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 1077706f2543Smrg { 1078706f2543Smrg /* We matched a single character, the EOB, so 1079706f2543Smrg * treat this as a final EOF. 1080706f2543Smrg */ 1081706f2543Smrg return EOB_ACT_END_OF_FILE; 1082706f2543Smrg } 1083706f2543Smrg 1084706f2543Smrg else 1085706f2543Smrg { 1086706f2543Smrg /* We matched some text prior to the EOB, first 1087706f2543Smrg * process it. 1088706f2543Smrg */ 1089706f2543Smrg return EOB_ACT_LAST_MATCH; 1090706f2543Smrg } 1091706f2543Smrg } 1092706f2543Smrg 1093706f2543Smrg /* Try to read more data. */ 1094706f2543Smrg 1095706f2543Smrg /* First move last chars to start of buffer. */ 1096706f2543Smrg number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; 1097706f2543Smrg 1098706f2543Smrg for ( i = 0; i < number_to_move; ++i ) 1099706f2543Smrg *(dest++) = *(source++); 1100706f2543Smrg 1101706f2543Smrg if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1102706f2543Smrg /* don't do the read, it's not guaranteed to return an EOF, 1103706f2543Smrg * just force an EOF 1104706f2543Smrg */ 1105706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 1106706f2543Smrg 1107706f2543Smrg else 1108706f2543Smrg { 1109706f2543Smrg int num_to_read = 1110706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 1111706f2543Smrg 1112706f2543Smrg while ( num_to_read <= 0 ) 1113706f2543Smrg { /* Not enough room in the buffer - grow it. */ 1114706f2543Smrg 1115706f2543Smrg /* just a shorter name for the current buffer */ 1116706f2543Smrg YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 1117706f2543Smrg 1118706f2543Smrg int yy_c_buf_p_offset = 1119706f2543Smrg (int) ((yy_c_buf_p) - b->yy_ch_buf); 1120706f2543Smrg 1121706f2543Smrg if ( b->yy_is_our_buffer ) 1122706f2543Smrg { 1123706f2543Smrg int new_size = b->yy_buf_size * 2; 1124706f2543Smrg 1125706f2543Smrg if ( new_size <= 0 ) 1126706f2543Smrg b->yy_buf_size += b->yy_buf_size / 8; 1127706f2543Smrg else 1128706f2543Smrg b->yy_buf_size *= 2; 1129706f2543Smrg 1130706f2543Smrg b->yy_ch_buf = (char *) 1131706f2543Smrg /* Include room in for 2 EOB chars. */ 1132706f2543Smrg yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 1133706f2543Smrg } 1134706f2543Smrg else 1135706f2543Smrg /* Can't grow it, we don't own it. */ 1136706f2543Smrg b->yy_ch_buf = 0; 1137706f2543Smrg 1138706f2543Smrg if ( ! b->yy_ch_buf ) 1139706f2543Smrg YY_FATAL_ERROR( 1140706f2543Smrg "fatal error - scanner input buffer overflow" ); 1141706f2543Smrg 1142706f2543Smrg (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 1143706f2543Smrg 1144706f2543Smrg num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 1145706f2543Smrg number_to_move - 1; 1146706f2543Smrg 1147706f2543Smrg } 1148706f2543Smrg 1149706f2543Smrg if ( num_to_read > YY_READ_BUF_SIZE ) 1150706f2543Smrg num_to_read = YY_READ_BUF_SIZE; 1151706f2543Smrg 1152706f2543Smrg /* Read in more data. */ 1153706f2543Smrg YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 1154706f2543Smrg (yy_n_chars), (size_t) num_to_read ); 1155706f2543Smrg 1156706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1157706f2543Smrg } 1158706f2543Smrg 1159706f2543Smrg if ( (yy_n_chars) == 0 ) 1160706f2543Smrg { 1161706f2543Smrg if ( number_to_move == YY_MORE_ADJ ) 1162706f2543Smrg { 1163706f2543Smrg ret_val = EOB_ACT_END_OF_FILE; 1164706f2543Smrg yyrestart(yyin ); 1165706f2543Smrg } 1166706f2543Smrg 1167706f2543Smrg else 1168706f2543Smrg { 1169706f2543Smrg ret_val = EOB_ACT_LAST_MATCH; 1170706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 1171706f2543Smrg YY_BUFFER_EOF_PENDING; 1172706f2543Smrg } 1173706f2543Smrg } 1174706f2543Smrg 1175706f2543Smrg else 1176706f2543Smrg ret_val = EOB_ACT_CONTINUE_SCAN; 1177706f2543Smrg 1178706f2543Smrg if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 1179706f2543Smrg /* Extend the array by 50%, plus the number we really need. */ 1180706f2543Smrg yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 1181706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); 1182706f2543Smrg if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1183706f2543Smrg YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 1184706f2543Smrg } 1185706f2543Smrg 1186706f2543Smrg (yy_n_chars) += number_to_move; 1187706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 1188706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 1189706f2543Smrg 1190706f2543Smrg (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 1191706f2543Smrg 1192706f2543Smrg return ret_val; 1193706f2543Smrg} 1194706f2543Smrg 1195706f2543Smrg/* yy_get_previous_state - get the state just before the EOB char was reached */ 1196706f2543Smrg 1197706f2543Smrg static yy_state_type yy_get_previous_state (void) 1198706f2543Smrg{ 1199706f2543Smrg register yy_state_type yy_current_state; 1200706f2543Smrg register char *yy_cp; 1201706f2543Smrg 1202706f2543Smrg yy_current_state = (yy_start); 1203706f2543Smrg yy_current_state += YY_AT_BOL(); 1204706f2543Smrg 1205706f2543Smrg for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 1206706f2543Smrg { 1207706f2543Smrg register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1208706f2543Smrg if ( yy_accept[yy_current_state] ) 1209706f2543Smrg { 1210706f2543Smrg (yy_last_accepting_state) = yy_current_state; 1211706f2543Smrg (yy_last_accepting_cpos) = yy_cp; 1212706f2543Smrg } 1213706f2543Smrg while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1214706f2543Smrg { 1215706f2543Smrg yy_current_state = (int) yy_def[yy_current_state]; 1216706f2543Smrg if ( yy_current_state >= 73 ) 1217706f2543Smrg yy_c = yy_meta[(unsigned int) yy_c]; 1218706f2543Smrg } 1219706f2543Smrg yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1220706f2543Smrg } 1221706f2543Smrg 1222706f2543Smrg return yy_current_state; 1223706f2543Smrg} 1224706f2543Smrg 1225706f2543Smrg/* yy_try_NUL_trans - try to make a transition on the NUL character 1226706f2543Smrg * 1227706f2543Smrg * synopsis 1228706f2543Smrg * next_state = yy_try_NUL_trans( current_state ); 1229706f2543Smrg */ 1230706f2543Smrg static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1231706f2543Smrg{ 1232706f2543Smrg register int yy_is_jam; 1233706f2543Smrg register char *yy_cp = (yy_c_buf_p); 1234706f2543Smrg 1235706f2543Smrg register YY_CHAR yy_c = 1; 1236706f2543Smrg if ( yy_accept[yy_current_state] ) 1237706f2543Smrg { 1238706f2543Smrg (yy_last_accepting_state) = yy_current_state; 1239706f2543Smrg (yy_last_accepting_cpos) = yy_cp; 1240706f2543Smrg } 1241706f2543Smrg while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1242706f2543Smrg { 1243706f2543Smrg yy_current_state = (int) yy_def[yy_current_state]; 1244706f2543Smrg if ( yy_current_state >= 73 ) 1245706f2543Smrg yy_c = yy_meta[(unsigned int) yy_c]; 1246706f2543Smrg } 1247706f2543Smrg yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1248706f2543Smrg yy_is_jam = (yy_current_state == 72); 1249706f2543Smrg 1250706f2543Smrg return yy_is_jam ? 0 : yy_current_state; 1251706f2543Smrg} 1252706f2543Smrg 1253706f2543Smrg static void yyunput (int c, register char * yy_bp ) 1254706f2543Smrg{ 1255706f2543Smrg register char *yy_cp; 1256706f2543Smrg 1257706f2543Smrg yy_cp = (yy_c_buf_p); 1258706f2543Smrg 1259706f2543Smrg /* undo effects of setting up yytext */ 1260706f2543Smrg *yy_cp = (yy_hold_char); 1261706f2543Smrg 1262706f2543Smrg if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 1263706f2543Smrg { /* need to shift things up to make room */ 1264706f2543Smrg /* +2 for EOB chars. */ 1265706f2543Smrg register int number_to_move = (yy_n_chars) + 2; 1266706f2543Smrg register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ 1267706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; 1268706f2543Smrg register char *source = 1269706f2543Smrg &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; 1270706f2543Smrg 1271706f2543Smrg while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1272706f2543Smrg *--dest = *--source; 1273706f2543Smrg 1274706f2543Smrg yy_cp += (int) (dest - source); 1275706f2543Smrg yy_bp += (int) (dest - source); 1276706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_n_chars = 1277706f2543Smrg (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; 1278706f2543Smrg 1279706f2543Smrg if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 1280706f2543Smrg YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1281706f2543Smrg } 1282706f2543Smrg 1283706f2543Smrg *--yy_cp = (char) c; 1284706f2543Smrg 1285706f2543Smrg (yytext_ptr) = yy_bp; 1286706f2543Smrg (yy_hold_char) = *yy_cp; 1287706f2543Smrg (yy_c_buf_p) = yy_cp; 1288706f2543Smrg} 1289706f2543Smrg 1290706f2543Smrg#ifndef YY_NO_INPUT 1291706f2543Smrg#ifdef __cplusplus 1292706f2543Smrg static int yyinput (void) 1293706f2543Smrg#else 1294706f2543Smrg static int input (void) 1295706f2543Smrg#endif 1296706f2543Smrg 1297706f2543Smrg{ 1298706f2543Smrg int c; 1299706f2543Smrg 1300706f2543Smrg *(yy_c_buf_p) = (yy_hold_char); 1301706f2543Smrg 1302706f2543Smrg if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 1303706f2543Smrg { 1304706f2543Smrg /* yy_c_buf_p now points to the character we want to return. 1305706f2543Smrg * If this occurs *before* the EOB characters, then it's a 1306706f2543Smrg * valid NUL; if not, then we've hit the end of the buffer. 1307706f2543Smrg */ 1308706f2543Smrg if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 1309706f2543Smrg /* This was really a NUL. */ 1310706f2543Smrg *(yy_c_buf_p) = '\0'; 1311706f2543Smrg 1312706f2543Smrg else 1313706f2543Smrg { /* need more input */ 1314706f2543Smrg int offset = (yy_c_buf_p) - (yytext_ptr); 1315706f2543Smrg ++(yy_c_buf_p); 1316706f2543Smrg 1317706f2543Smrg switch ( yy_get_next_buffer( ) ) 1318706f2543Smrg { 1319706f2543Smrg case EOB_ACT_LAST_MATCH: 1320706f2543Smrg /* This happens because yy_g_n_b() 1321706f2543Smrg * sees that we've accumulated a 1322706f2543Smrg * token and flags that we need to 1323706f2543Smrg * try matching the token before 1324706f2543Smrg * proceeding. But for input(), 1325706f2543Smrg * there's no matching to consider. 1326706f2543Smrg * So convert the EOB_ACT_LAST_MATCH 1327706f2543Smrg * to EOB_ACT_END_OF_FILE. 1328706f2543Smrg */ 1329706f2543Smrg 1330706f2543Smrg /* Reset buffer status. */ 1331706f2543Smrg yyrestart(yyin ); 1332706f2543Smrg 1333706f2543Smrg /*FALLTHROUGH*/ 1334706f2543Smrg 1335706f2543Smrg case EOB_ACT_END_OF_FILE: 1336706f2543Smrg { 1337706f2543Smrg if ( yywrap( ) ) 1338706f2543Smrg return EOF; 1339706f2543Smrg 1340706f2543Smrg if ( ! (yy_did_buffer_switch_on_eof) ) 1341706f2543Smrg YY_NEW_FILE; 1342706f2543Smrg#ifdef __cplusplus 1343706f2543Smrg return yyinput(); 1344706f2543Smrg#else 1345706f2543Smrg return input(); 1346706f2543Smrg#endif 1347706f2543Smrg } 1348706f2543Smrg 1349706f2543Smrg case EOB_ACT_CONTINUE_SCAN: 1350706f2543Smrg (yy_c_buf_p) = (yytext_ptr) + offset; 1351706f2543Smrg break; 1352706f2543Smrg } 1353706f2543Smrg } 1354706f2543Smrg } 1355706f2543Smrg 1356706f2543Smrg c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 1357706f2543Smrg *(yy_c_buf_p) = '\0'; /* preserve yytext */ 1358706f2543Smrg (yy_hold_char) = *++(yy_c_buf_p); 1359706f2543Smrg 1360706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); 1361706f2543Smrg 1362706f2543Smrg return c; 1363706f2543Smrg} 1364706f2543Smrg#endif /* ifndef YY_NO_INPUT */ 1365706f2543Smrg 1366706f2543Smrg/** Immediately switch to a different input stream. 1367706f2543Smrg * @param input_file A readable stream. 1368706f2543Smrg * 1369706f2543Smrg * @note This function does not reset the start condition to @c INITIAL . 1370706f2543Smrg */ 1371706f2543Smrg void yyrestart (FILE * input_file ) 1372706f2543Smrg{ 1373706f2543Smrg 1374706f2543Smrg if ( ! YY_CURRENT_BUFFER ){ 1375706f2543Smrg yyensure_buffer_stack (); 1376706f2543Smrg YY_CURRENT_BUFFER_LVALUE = 1377706f2543Smrg yy_create_buffer(yyin,YY_BUF_SIZE ); 1378706f2543Smrg } 1379706f2543Smrg 1380706f2543Smrg yy_init_buffer(YY_CURRENT_BUFFER,input_file ); 1381706f2543Smrg yy_load_buffer_state( ); 1382706f2543Smrg} 1383706f2543Smrg 1384706f2543Smrg/** Switch to a different input buffer. 1385706f2543Smrg * @param new_buffer The new input buffer. 1386706f2543Smrg * 1387706f2543Smrg */ 1388706f2543Smrg void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 1389706f2543Smrg{ 1390706f2543Smrg 1391706f2543Smrg /* TODO. We should be able to replace this entire function body 1392706f2543Smrg * with 1393706f2543Smrg * yypop_buffer_state(); 1394706f2543Smrg * yypush_buffer_state(new_buffer); 1395706f2543Smrg */ 1396706f2543Smrg yyensure_buffer_stack (); 1397706f2543Smrg if ( YY_CURRENT_BUFFER == new_buffer ) 1398706f2543Smrg return; 1399706f2543Smrg 1400706f2543Smrg if ( YY_CURRENT_BUFFER ) 1401706f2543Smrg { 1402706f2543Smrg /* Flush out information for old buffer. */ 1403706f2543Smrg *(yy_c_buf_p) = (yy_hold_char); 1404706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 1405706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1406706f2543Smrg } 1407706f2543Smrg 1408706f2543Smrg YY_CURRENT_BUFFER_LVALUE = new_buffer; 1409706f2543Smrg yy_load_buffer_state( ); 1410706f2543Smrg 1411706f2543Smrg /* We don't actually know whether we did this switch during 1412706f2543Smrg * EOF (yywrap()) processing, but the only time this flag 1413706f2543Smrg * is looked at is after yywrap() is called, so it's safe 1414706f2543Smrg * to go ahead and always set it. 1415706f2543Smrg */ 1416706f2543Smrg (yy_did_buffer_switch_on_eof) = 1; 1417706f2543Smrg} 1418706f2543Smrg 1419706f2543Smrgstatic void yy_load_buffer_state (void) 1420706f2543Smrg{ 1421706f2543Smrg (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1422706f2543Smrg (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 1423706f2543Smrg yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 1424706f2543Smrg (yy_hold_char) = *(yy_c_buf_p); 1425706f2543Smrg} 1426706f2543Smrg 1427706f2543Smrg/** Allocate and initialize an input buffer state. 1428706f2543Smrg * @param file A readable stream. 1429706f2543Smrg * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 1430706f2543Smrg * 1431706f2543Smrg * @return the allocated buffer state. 1432706f2543Smrg */ 1433706f2543Smrg YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 1434706f2543Smrg{ 1435706f2543Smrg YY_BUFFER_STATE b; 1436706f2543Smrg 1437706f2543Smrg b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 1438706f2543Smrg if ( ! b ) 1439706f2543Smrg YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1440706f2543Smrg 1441706f2543Smrg b->yy_buf_size = size; 1442706f2543Smrg 1443706f2543Smrg /* yy_ch_buf has to be 2 characters longer than the size given because 1444706f2543Smrg * we need to put in 2 end-of-buffer characters. 1445706f2543Smrg */ 1446706f2543Smrg b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); 1447706f2543Smrg if ( ! b->yy_ch_buf ) 1448706f2543Smrg YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1449706f2543Smrg 1450706f2543Smrg b->yy_is_our_buffer = 1; 1451706f2543Smrg 1452706f2543Smrg yy_init_buffer(b,file ); 1453706f2543Smrg 1454706f2543Smrg return b; 1455706f2543Smrg} 1456706f2543Smrg 1457706f2543Smrg/** Destroy the buffer. 1458706f2543Smrg * @param b a buffer created with yy_create_buffer() 1459706f2543Smrg * 1460706f2543Smrg */ 1461706f2543Smrg void yy_delete_buffer (YY_BUFFER_STATE b ) 1462706f2543Smrg{ 1463706f2543Smrg 1464706f2543Smrg if ( ! b ) 1465706f2543Smrg return; 1466706f2543Smrg 1467706f2543Smrg if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 1468706f2543Smrg YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 1469706f2543Smrg 1470706f2543Smrg if ( b->yy_is_our_buffer ) 1471706f2543Smrg yyfree((void *) b->yy_ch_buf ); 1472706f2543Smrg 1473706f2543Smrg yyfree((void *) b ); 1474706f2543Smrg} 1475706f2543Smrg 1476706f2543Smrg#ifndef __cplusplus 1477706f2543Smrgextern int isatty (int ); 1478706f2543Smrg#endif /* __cplusplus */ 1479706f2543Smrg 1480706f2543Smrg/* Initializes or reinitializes a buffer. 1481706f2543Smrg * This function is sometimes called more than once on the same buffer, 1482706f2543Smrg * such as during a yyrestart() or at EOF. 1483706f2543Smrg */ 1484706f2543Smrg static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 1485706f2543Smrg 1486706f2543Smrg{ 1487706f2543Smrg int oerrno = errno; 1488706f2543Smrg 1489706f2543Smrg yy_flush_buffer(b ); 1490706f2543Smrg 1491706f2543Smrg b->yy_input_file = file; 1492706f2543Smrg b->yy_fill_buffer = 1; 1493706f2543Smrg 1494706f2543Smrg /* If b is the current buffer, then yy_init_buffer was _probably_ 1495706f2543Smrg * called from yyrestart() or through yy_get_next_buffer. 1496706f2543Smrg * In that case, we don't want to reset the lineno or column. 1497706f2543Smrg */ 1498706f2543Smrg if (b != YY_CURRENT_BUFFER){ 1499706f2543Smrg b->yy_bs_lineno = 1; 1500706f2543Smrg b->yy_bs_column = 0; 1501706f2543Smrg } 1502706f2543Smrg 1503706f2543Smrg b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1504706f2543Smrg 1505706f2543Smrg errno = oerrno; 1506706f2543Smrg} 1507706f2543Smrg 1508706f2543Smrg/** Discard all buffered characters. On the next scan, YY_INPUT will be called. 1509706f2543Smrg * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 1510706f2543Smrg * 1511706f2543Smrg */ 1512706f2543Smrg void yy_flush_buffer (YY_BUFFER_STATE b ) 1513706f2543Smrg{ 1514706f2543Smrg if ( ! b ) 1515706f2543Smrg return; 1516706f2543Smrg 1517706f2543Smrg b->yy_n_chars = 0; 1518706f2543Smrg 1519706f2543Smrg /* We always need two end-of-buffer characters. The first causes 1520706f2543Smrg * a transition to the end-of-buffer state. The second causes 1521706f2543Smrg * a jam in that state. 1522706f2543Smrg */ 1523706f2543Smrg b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 1524706f2543Smrg b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 1525706f2543Smrg 1526706f2543Smrg b->yy_buf_pos = &b->yy_ch_buf[0]; 1527706f2543Smrg 1528706f2543Smrg b->yy_at_bol = 1; 1529706f2543Smrg b->yy_buffer_status = YY_BUFFER_NEW; 1530706f2543Smrg 1531706f2543Smrg if ( b == YY_CURRENT_BUFFER ) 1532706f2543Smrg yy_load_buffer_state( ); 1533706f2543Smrg} 1534706f2543Smrg 1535706f2543Smrg/** Pushes the new state onto the stack. The new state becomes 1536706f2543Smrg * the current state. This function will allocate the stack 1537706f2543Smrg * if necessary. 1538706f2543Smrg * @param new_buffer The new state. 1539706f2543Smrg * 1540706f2543Smrg */ 1541706f2543Smrgvoid yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 1542706f2543Smrg{ 1543706f2543Smrg if (new_buffer == NULL) 1544706f2543Smrg return; 1545706f2543Smrg 1546706f2543Smrg yyensure_buffer_stack(); 1547706f2543Smrg 1548706f2543Smrg /* This block is copied from yy_switch_to_buffer. */ 1549706f2543Smrg if ( YY_CURRENT_BUFFER ) 1550706f2543Smrg { 1551706f2543Smrg /* Flush out information for old buffer. */ 1552706f2543Smrg *(yy_c_buf_p) = (yy_hold_char); 1553706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 1554706f2543Smrg YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1555706f2543Smrg } 1556706f2543Smrg 1557706f2543Smrg /* Only push if top exists. Otherwise, replace top. */ 1558706f2543Smrg if (YY_CURRENT_BUFFER) 1559706f2543Smrg (yy_buffer_stack_top)++; 1560706f2543Smrg YY_CURRENT_BUFFER_LVALUE = new_buffer; 1561706f2543Smrg 1562706f2543Smrg /* copied from yy_switch_to_buffer. */ 1563706f2543Smrg yy_load_buffer_state( ); 1564706f2543Smrg (yy_did_buffer_switch_on_eof) = 1; 1565706f2543Smrg} 1566706f2543Smrg 1567706f2543Smrg/** Removes and deletes the top of the stack, if present. 1568706f2543Smrg * The next element becomes the new top. 1569706f2543Smrg * 1570706f2543Smrg */ 1571706f2543Smrgvoid yypop_buffer_state (void) 1572706f2543Smrg{ 1573706f2543Smrg if (!YY_CURRENT_BUFFER) 1574706f2543Smrg return; 1575706f2543Smrg 1576706f2543Smrg yy_delete_buffer(YY_CURRENT_BUFFER ); 1577706f2543Smrg YY_CURRENT_BUFFER_LVALUE = NULL; 1578706f2543Smrg if ((yy_buffer_stack_top) > 0) 1579706f2543Smrg --(yy_buffer_stack_top); 1580706f2543Smrg 1581706f2543Smrg if (YY_CURRENT_BUFFER) { 1582706f2543Smrg yy_load_buffer_state( ); 1583706f2543Smrg (yy_did_buffer_switch_on_eof) = 1; 1584706f2543Smrg } 1585706f2543Smrg} 1586706f2543Smrg 1587706f2543Smrg/* Allocates the stack if it does not exist. 1588706f2543Smrg * Guarantees space for at least one push. 1589706f2543Smrg */ 1590706f2543Smrgstatic void yyensure_buffer_stack (void) 1591706f2543Smrg{ 1592706f2543Smrg int num_to_alloc; 1593706f2543Smrg 1594706f2543Smrg if (!(yy_buffer_stack)) { 1595706f2543Smrg 1596706f2543Smrg /* First allocation is just for 2 elements, since we don't know if this 1597706f2543Smrg * scanner will even need a stack. We use 2 instead of 1 to avoid an 1598706f2543Smrg * immediate realloc on the next call. 1599706f2543Smrg */ 1600706f2543Smrg num_to_alloc = 1; 1601706f2543Smrg (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 1602706f2543Smrg (num_to_alloc * sizeof(struct yy_buffer_state*) 1603706f2543Smrg ); 1604706f2543Smrg if ( ! (yy_buffer_stack) ) 1605706f2543Smrg YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 1606706f2543Smrg 1607706f2543Smrg memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 1608706f2543Smrg 1609706f2543Smrg (yy_buffer_stack_max) = num_to_alloc; 1610706f2543Smrg (yy_buffer_stack_top) = 0; 1611706f2543Smrg return; 1612706f2543Smrg } 1613706f2543Smrg 1614706f2543Smrg if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 1615706f2543Smrg 1616706f2543Smrg /* Increase the buffer to prepare for a possible push. */ 1617706f2543Smrg int grow_size = 8 /* arbitrary grow size */; 1618706f2543Smrg 1619706f2543Smrg num_to_alloc = (yy_buffer_stack_max) + grow_size; 1620706f2543Smrg (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 1621706f2543Smrg ((yy_buffer_stack), 1622706f2543Smrg num_to_alloc * sizeof(struct yy_buffer_state*) 1623706f2543Smrg ); 1624706f2543Smrg if ( ! (yy_buffer_stack) ) 1625706f2543Smrg YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 1626706f2543Smrg 1627706f2543Smrg /* zero only the new slots.*/ 1628706f2543Smrg memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 1629706f2543Smrg (yy_buffer_stack_max) = num_to_alloc; 1630706f2543Smrg } 1631706f2543Smrg} 1632706f2543Smrg 1633706f2543Smrg/** Setup the input buffer state to scan directly from a user-specified character buffer. 1634706f2543Smrg * @param base the character buffer 1635706f2543Smrg * @param size the size in bytes of the character buffer 1636706f2543Smrg * 1637706f2543Smrg * @return the newly allocated buffer state object. 1638706f2543Smrg */ 1639706f2543SmrgYY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 1640706f2543Smrg{ 1641706f2543Smrg YY_BUFFER_STATE b; 1642706f2543Smrg 1643706f2543Smrg if ( size < 2 || 1644706f2543Smrg base[size-2] != YY_END_OF_BUFFER_CHAR || 1645706f2543Smrg base[size-1] != YY_END_OF_BUFFER_CHAR ) 1646706f2543Smrg /* They forgot to leave room for the EOB's. */ 1647706f2543Smrg return 0; 1648706f2543Smrg 1649706f2543Smrg b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 1650706f2543Smrg if ( ! b ) 1651706f2543Smrg YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 1652706f2543Smrg 1653706f2543Smrg b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 1654706f2543Smrg b->yy_buf_pos = b->yy_ch_buf = base; 1655706f2543Smrg b->yy_is_our_buffer = 0; 1656706f2543Smrg b->yy_input_file = 0; 1657706f2543Smrg b->yy_n_chars = b->yy_buf_size; 1658706f2543Smrg b->yy_is_interactive = 0; 1659706f2543Smrg b->yy_at_bol = 1; 1660706f2543Smrg b->yy_fill_buffer = 0; 1661706f2543Smrg b->yy_buffer_status = YY_BUFFER_NEW; 1662706f2543Smrg 1663706f2543Smrg yy_switch_to_buffer(b ); 1664706f2543Smrg 1665706f2543Smrg return b; 1666706f2543Smrg} 1667706f2543Smrg 1668706f2543Smrg/** Setup the input buffer state to scan a string. The next call to yylex() will 1669706f2543Smrg * scan from a @e copy of @a str. 1670706f2543Smrg * @param yystr a NUL-terminated string to scan 1671706f2543Smrg * 1672706f2543Smrg * @return the newly allocated buffer state object. 1673706f2543Smrg * @note If you want to scan bytes that may contain NUL values, then use 1674706f2543Smrg * yy_scan_bytes() instead. 1675706f2543Smrg */ 1676706f2543SmrgYY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) 1677706f2543Smrg{ 1678706f2543Smrg 1679706f2543Smrg return yy_scan_bytes(yystr,strlen(yystr) ); 1680706f2543Smrg} 1681706f2543Smrg 1682706f2543Smrg/** Setup the input buffer state to scan the given bytes. The next call to yylex() will 1683706f2543Smrg * scan from a @e copy of @a bytes. 1684706f2543Smrg * @param bytes the byte buffer to scan 1685706f2543Smrg * @param len the number of bytes in the buffer pointed to by @a bytes. 1686706f2543Smrg * 1687706f2543Smrg * @return the newly allocated buffer state object. 1688706f2543Smrg */ 1689706f2543SmrgYY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) 1690706f2543Smrg{ 1691706f2543Smrg YY_BUFFER_STATE b; 1692706f2543Smrg char *buf; 1693706f2543Smrg yy_size_t n; 1694706f2543Smrg int i; 1695706f2543Smrg 1696706f2543Smrg /* Get memory for full buffer, including space for trailing EOB's. */ 1697706f2543Smrg n = _yybytes_len + 2; 1698706f2543Smrg buf = (char *) yyalloc(n ); 1699706f2543Smrg if ( ! buf ) 1700706f2543Smrg YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 1701706f2543Smrg 1702706f2543Smrg for ( i = 0; i < _yybytes_len; ++i ) 1703706f2543Smrg buf[i] = yybytes[i]; 1704706f2543Smrg 1705706f2543Smrg buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 1706706f2543Smrg 1707706f2543Smrg b = yy_scan_buffer(buf,n ); 1708706f2543Smrg if ( ! b ) 1709706f2543Smrg YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 1710706f2543Smrg 1711706f2543Smrg /* It's okay to grow etc. this buffer, and we should throw it 1712706f2543Smrg * away when we're done. 1713706f2543Smrg */ 1714706f2543Smrg b->yy_is_our_buffer = 1; 1715706f2543Smrg 1716706f2543Smrg return b; 1717706f2543Smrg} 1718706f2543Smrg 1719706f2543Smrg#ifndef YY_EXIT_FAILURE 1720706f2543Smrg#define YY_EXIT_FAILURE 2 1721706f2543Smrg#endif 1722706f2543Smrg 1723706f2543Smrgstatic void yy_fatal_error (yyconst char* msg ) 1724706f2543Smrg{ 1725706f2543Smrg (void) fprintf( stderr, "%s\n", msg ); 1726706f2543Smrg exit( YY_EXIT_FAILURE ); 1727706f2543Smrg} 1728706f2543Smrg 1729706f2543Smrg/* Redefine yyless() so it works in section 3 code. */ 1730706f2543Smrg 1731706f2543Smrg#undef yyless 1732706f2543Smrg#define yyless(n) \ 1733706f2543Smrg do \ 1734706f2543Smrg { \ 1735706f2543Smrg /* Undo effects of setting up yytext. */ \ 1736706f2543Smrg int yyless_macro_arg = (n); \ 1737706f2543Smrg YY_LESS_LINENO(yyless_macro_arg);\ 1738706f2543Smrg yytext[yyleng] = (yy_hold_char); \ 1739706f2543Smrg (yy_c_buf_p) = yytext + yyless_macro_arg; \ 1740706f2543Smrg (yy_hold_char) = *(yy_c_buf_p); \ 1741706f2543Smrg *(yy_c_buf_p) = '\0'; \ 1742706f2543Smrg yyleng = yyless_macro_arg; \ 1743706f2543Smrg } \ 1744706f2543Smrg while ( 0 ) 1745706f2543Smrg 1746706f2543Smrg/* Accessor methods (get/set functions) to struct members. */ 1747706f2543Smrg 1748706f2543Smrg/** Get the current line number. 1749706f2543Smrg * 1750706f2543Smrg */ 1751706f2543Smrgint yyget_lineno (void) 1752706f2543Smrg{ 1753706f2543Smrg 1754706f2543Smrg return yylineno; 1755706f2543Smrg} 1756706f2543Smrg 1757706f2543Smrg/** Get the input stream. 1758706f2543Smrg * 1759706f2543Smrg */ 1760706f2543SmrgFILE *yyget_in (void) 1761706f2543Smrg{ 1762706f2543Smrg return yyin; 1763706f2543Smrg} 1764706f2543Smrg 1765706f2543Smrg/** Get the output stream. 1766706f2543Smrg * 1767706f2543Smrg */ 1768706f2543SmrgFILE *yyget_out (void) 1769706f2543Smrg{ 1770706f2543Smrg return yyout; 1771706f2543Smrg} 1772706f2543Smrg 1773706f2543Smrg/** Get the length of the current token. 1774706f2543Smrg * 1775706f2543Smrg */ 1776706f2543Smrgint yyget_leng (void) 1777706f2543Smrg{ 1778706f2543Smrg return yyleng; 1779706f2543Smrg} 1780706f2543Smrg 1781706f2543Smrg/** Get the current token. 1782706f2543Smrg * 1783706f2543Smrg */ 1784706f2543Smrg 1785706f2543Smrgchar *yyget_text (void) 1786706f2543Smrg{ 1787706f2543Smrg return yytext; 1788706f2543Smrg} 1789706f2543Smrg 1790706f2543Smrg/** Set the current line number. 1791706f2543Smrg * @param line_number 1792706f2543Smrg * 1793706f2543Smrg */ 1794706f2543Smrgvoid yyset_lineno (int line_number ) 1795706f2543Smrg{ 1796706f2543Smrg 1797706f2543Smrg yylineno = line_number; 1798706f2543Smrg} 1799706f2543Smrg 1800706f2543Smrg/** Set the input stream. This does not discard the current 1801706f2543Smrg * input buffer. 1802706f2543Smrg * @param in_str A readable stream. 1803706f2543Smrg * 1804706f2543Smrg * @see yy_switch_to_buffer 1805706f2543Smrg */ 1806706f2543Smrgvoid yyset_in (FILE * in_str ) 1807706f2543Smrg{ 1808706f2543Smrg yyin = in_str ; 1809706f2543Smrg} 1810706f2543Smrg 1811706f2543Smrgvoid yyset_out (FILE * out_str ) 1812706f2543Smrg{ 1813706f2543Smrg yyout = out_str ; 1814706f2543Smrg} 1815706f2543Smrg 1816706f2543Smrgint yyget_debug (void) 1817706f2543Smrg{ 1818706f2543Smrg return yy_flex_debug; 1819706f2543Smrg} 1820706f2543Smrg 1821706f2543Smrgvoid yyset_debug (int bdebug ) 1822706f2543Smrg{ 1823706f2543Smrg yy_flex_debug = bdebug ; 1824706f2543Smrg} 1825706f2543Smrg 1826706f2543Smrgstatic int yy_init_globals (void) 1827706f2543Smrg{ 1828706f2543Smrg /* Initialization is the same as for the non-reentrant scanner. 1829706f2543Smrg * This function is called from yylex_destroy(), so don't allocate here. 1830706f2543Smrg */ 1831706f2543Smrg 1832706f2543Smrg (yy_buffer_stack) = 0; 1833706f2543Smrg (yy_buffer_stack_top) = 0; 1834706f2543Smrg (yy_buffer_stack_max) = 0; 1835706f2543Smrg (yy_c_buf_p) = (char *) 0; 1836706f2543Smrg (yy_init) = 0; 1837706f2543Smrg (yy_start) = 0; 1838706f2543Smrg 1839706f2543Smrg/* Defined in main.c */ 1840706f2543Smrg#ifdef YY_STDINIT 1841706f2543Smrg yyin = stdin; 1842706f2543Smrg yyout = stdout; 1843706f2543Smrg#else 1844706f2543Smrg yyin = (FILE *) 0; 1845706f2543Smrg yyout = (FILE *) 0; 1846706f2543Smrg#endif 1847706f2543Smrg 1848706f2543Smrg /* For future reference: Set errno on error, since we are called by 1849706f2543Smrg * yylex_init() 1850706f2543Smrg */ 1851706f2543Smrg return 0; 1852706f2543Smrg} 1853706f2543Smrg 1854706f2543Smrg/* yylex_destroy is for both reentrant and non-reentrant scanners. */ 1855706f2543Smrgint yylex_destroy (void) 1856706f2543Smrg{ 1857706f2543Smrg 1858706f2543Smrg /* Pop the buffer stack, destroying each element. */ 1859706f2543Smrg while(YY_CURRENT_BUFFER){ 1860706f2543Smrg yy_delete_buffer(YY_CURRENT_BUFFER ); 1861706f2543Smrg YY_CURRENT_BUFFER_LVALUE = NULL; 1862706f2543Smrg yypop_buffer_state(); 1863706f2543Smrg } 1864706f2543Smrg 1865706f2543Smrg /* Destroy the stack itself. */ 1866706f2543Smrg yyfree((yy_buffer_stack) ); 1867706f2543Smrg (yy_buffer_stack) = NULL; 1868706f2543Smrg 1869706f2543Smrg /* Reset the globals. This is important in a non-reentrant scanner so the next time 1870706f2543Smrg * yylex() is called, initialization will occur. */ 1871706f2543Smrg yy_init_globals( ); 1872706f2543Smrg 1873706f2543Smrg return 0; 1874706f2543Smrg} 1875706f2543Smrg 1876706f2543Smrg/* 1877706f2543Smrg * Internal utility routines. 1878706f2543Smrg */ 1879706f2543Smrg 1880706f2543Smrg#ifndef yytext_ptr 1881706f2543Smrgstatic void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 1882706f2543Smrg{ 1883706f2543Smrg register int i; 1884706f2543Smrg for ( i = 0; i < n; ++i ) 1885706f2543Smrg s1[i] = s2[i]; 1886706f2543Smrg} 1887706f2543Smrg#endif 1888706f2543Smrg 1889706f2543Smrg#ifdef YY_NEED_STRLEN 1890706f2543Smrgstatic int yy_flex_strlen (yyconst char * s ) 1891706f2543Smrg{ 1892706f2543Smrg register int n; 1893706f2543Smrg for ( n = 0; s[n]; ++n ) 1894706f2543Smrg ; 1895706f2543Smrg 1896706f2543Smrg return n; 1897706f2543Smrg} 1898706f2543Smrg#endif 1899706f2543Smrg 1900706f2543Smrgvoid *yyalloc (yy_size_t size ) 1901706f2543Smrg{ 1902706f2543Smrg return (void *) malloc( size ); 1903706f2543Smrg} 1904706f2543Smrg 1905706f2543Smrgvoid *yyrealloc (void * ptr, yy_size_t size ) 1906706f2543Smrg{ 1907706f2543Smrg /* The cast to (char *) in the following accommodates both 1908706f2543Smrg * implementations that use char* generic pointers, and those 1909706f2543Smrg * that use void* generic pointers. It works with the latter 1910706f2543Smrg * because both ANSI C and C++ allow castless assignment from 1911706f2543Smrg * any pointer type to void*, and deal with argument conversions 1912706f2543Smrg * as though doing an assignment. 1913706f2543Smrg */ 1914706f2543Smrg return (void *) realloc( (char *) ptr, size ); 1915706f2543Smrg} 1916706f2543Smrg 1917706f2543Smrgvoid yyfree (void * ptr ) 1918706f2543Smrg{ 1919706f2543Smrg free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 1920706f2543Smrg} 1921706f2543Smrg 1922706f2543Smrg#define YYTABLES_NAME "yytables" 1923706f2543Smrg 1924706f2543Smrg#line 83 "scanner.l" 1925706f2543Smrg 1926706f2543Smrg 1927706f2543Smrgint yywrap(void) 1928706f2543Smrg{ 1929706f2543Smrg return 1; 1930706f2543Smrg} 1931706f2543Smrg 1932706f2543Smrgvoid yyerror(const char *message) 1933706f2543Smrg{ 1934706f2543Smrg const char *pt, *end; 1935706f2543Smrg struct _entry { 1936706f2543Smrg const char *from; 1937706f2543Smrg const char *to; 1938706f2543Smrg } *entry, list[] = { 1939706f2543Smrg { "T_VIRTUAL", "\"virtual\"" }, 1940706f2543Smrg { "T_DISPLAY", "\"display\"" }, 1941706f2543Smrg { "T_WALL", "\"wall\"" }, 1942706f2543Smrg { "T_OPTION", "\"option\"" }, 1943706f2543Smrg { "T_PARAM", "\"param\"" }, 1944706f2543Smrg { "T_DIMENSION", "dimension (e.g., 2x2 or 1024x768)" }, 1945706f2543Smrg { "T_OFFSET", "display offset (e.g., +10-10)" }, 1946706f2543Smrg { "T_ORIGIN", "tile origin (e.g., @1280x1024)" }, 1947706f2543Smrg { "T_STRING", "string" }, 1948706f2543Smrg { "T_COMMENT", "comment (e.g., #...)" }, 1949706f2543Smrg { "T_LINE_COMMENT", "comment (e.g., #...)" }, 1950706f2543Smrg { NULL, NULL } 1951706f2543Smrg }; 1952706f2543Smrg 1953706f2543Smrg fprintf(stderr, "parse error on line %d at token \"%*.*s\"\n", 1954706f2543Smrg lineno, yyleng, yyleng, yytext); 1955706f2543Smrg end = message + strlen(message); 1956706f2543Smrg for (pt = message; *pt; pt++) { 1957706f2543Smrg if (pt[0] == 'T' && pt[1] == '_') { 1958706f2543Smrg const char *next = strchr(pt, ' '); 1959706f2543Smrg if (!next || !*next) next = strchr(pt, '\0'); 1960706f2543Smrg if (!next) goto bail; 1961706f2543Smrg --next; 1962706f2543Smrg if (next-pt == 1 && next[1] 1963706f2543Smrg && next[2] == '\'' && next[3] == '\'') { 1964706f2543Smrg fprintf(stderr, "\"%c\"", next[1]); 1965706f2543Smrg pt += 4; 1966706f2543Smrg goto cnt; 1967706f2543Smrg } 1968706f2543Smrg for (entry = list; entry->from; ++entry) { 1969706f2543Smrg if (!strncmp(entry->from, pt, strlen(entry->from))) { 1970706f2543Smrg fprintf(stderr, "%s", entry->to); 1971706f2543Smrg pt = next; 1972706f2543Smrg goto cnt; 1973706f2543Smrg } 1974706f2543Smrg } 1975706f2543Smrg } else if (end-pt >= 5 && pt[0] == '\'' && pt[1] == '\'' && pt[3] 1976706f2543Smrg && pt[4] == '\'' && pt[5] == '\'') { 1977706f2543Smrg fprintf(stderr, "\"%c\"", pt[3]); 1978706f2543Smrg pt += 5; 1979706f2543Smrg } else if (end-pt >= 3 && pt[0] == '\'' && pt[1] && pt[2] == '\'') { 1980706f2543Smrg fprintf(stderr, "\"%c\"", pt[1]); 1981706f2543Smrg pt += 3; 1982706f2543Smrg } 1983706f2543Smrg bail: 1984706f2543Smrg putc(*pt, stderr); 1985706f2543Smrg cnt: 1986706f2543Smrg ; 1987706f2543Smrg } 1988706f2543Smrg fprintf(stderr, "\n"); 1989706f2543Smrg exit( 1 ); 1990706f2543Smrg} 1991706f2543Smrg 1992706f2543Smrgstatic int getdimension(int token, const char *text, int leng) 1993706f2543Smrg{ 1994706f2543Smrg char *endptr; 1995706f2543Smrg char *tmp = dmxConfigAlloc(leng+1); 1996706f2543Smrg int x, y; 1997706f2543Smrg 1998706f2543Smrg strncpy(tmp, text, leng); 1999706f2543Smrg x = strtol(tmp, &endptr, 10); 2000706f2543Smrg while (*endptr && !isdigit(*endptr)) ++endptr; 2001706f2543Smrg y = strtol(endptr, NULL, 10); 2002706f2543Smrg dmxConfigFree(tmp); 2003706f2543Smrg yylval.pair = dmxConfigCreatePair(token, lineno, NULL, x, y, 1, 1); 2004706f2543Smrg return token; 2005706f2543Smrg} 2006706f2543Smrg 2007706f2543Smrgstatic int getstring(int token, const char *text, int leng) 2008706f2543Smrg{ 2009706f2543Smrg yylval.string = dmxConfigCreateString(token, lineno, NULL, 2010706f2543Smrg dmxConfigCopyString(leng ? text : "", 2011706f2543Smrg leng)); 2012706f2543Smrg return token; 2013706f2543Smrg} 2014706f2543Smrg 2015706f2543Smrgstatic int gettoken(int token, const char *text, int leng) 2016706f2543Smrg{ 2017706f2543Smrg yylval.token = dmxConfigCreateToken(token, lineno, NULL); 2018706f2543Smrg return token; 2019706f2543Smrg} 2020706f2543Smrg 2021706f2543Smrgstatic int getcomment(int token, const char *text, int leng) 2022706f2543Smrg{ 2023706f2543Smrg yylval.comment = dmxConfigCreateComment(token, lineno, 2024706f2543Smrg dmxConfigCopyString(text + 1, 2025706f2543Smrg leng - 1)); 2026706f2543Smrg return token; 2027706f2543Smrg} 2028706f2543Smrg 2029