1178825Sdfr 2178825Sdfr#line 3 "lex.c" 3178825Sdfr 4178825Sdfr#define YY_INT_ALIGNED short int 5178825Sdfr 6178825Sdfr/* A lexical scanner generated by flex */ 7178825Sdfr 8178825Sdfr#define FLEX_SCANNER 9178825Sdfr#define YY_FLEX_MAJOR_VERSION 2 10178825Sdfr#define YY_FLEX_MINOR_VERSION 5 11233294Sstas#define YY_FLEX_SUBMINOR_VERSION 35 12178825Sdfr#if YY_FLEX_SUBMINOR_VERSION > 0 13178825Sdfr#define FLEX_BETA 14178825Sdfr#endif 15178825Sdfr 16178825Sdfr/* First, we deal with platform-specific or compiler-specific issues. */ 17178825Sdfr 18178825Sdfr/* begin standard C headers. */ 19178825Sdfr#include <stdio.h> 20178825Sdfr#include <string.h> 21178825Sdfr#include <errno.h> 22178825Sdfr#include <stdlib.h> 23178825Sdfr 24178825Sdfr/* end standard C headers. */ 25178825Sdfr 26178825Sdfr/* flex integer type definitions */ 27178825Sdfr 28178825Sdfr#ifndef FLEXINT_H 29178825Sdfr#define FLEXINT_H 30178825Sdfr 31178825Sdfr/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 32178825Sdfr 33233294Sstas#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 34178825Sdfr 35178825Sdfr/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 36178825Sdfr * if you want the limit (max/min) macros for int types. 37178825Sdfr */ 38178825Sdfr#ifndef __STDC_LIMIT_MACROS 39178825Sdfr#define __STDC_LIMIT_MACROS 1 40178825Sdfr#endif 41178825Sdfr 42178825Sdfr#include <inttypes.h> 43178825Sdfrtypedef int8_t flex_int8_t; 44178825Sdfrtypedef uint8_t flex_uint8_t; 45178825Sdfrtypedef int16_t flex_int16_t; 46178825Sdfrtypedef uint16_t flex_uint16_t; 47178825Sdfrtypedef int32_t flex_int32_t; 48178825Sdfrtypedef uint32_t flex_uint32_t; 49178825Sdfr#else 50178825Sdfrtypedef signed char flex_int8_t; 51178825Sdfrtypedef short int flex_int16_t; 52178825Sdfrtypedef int flex_int32_t; 53178825Sdfrtypedef unsigned char flex_uint8_t; 54178825Sdfrtypedef unsigned short int flex_uint16_t; 55178825Sdfrtypedef unsigned int flex_uint32_t; 56178825Sdfr#endif /* ! C99 */ 57178825Sdfr 58178825Sdfr/* Limits of integral types. */ 59178825Sdfr#ifndef INT8_MIN 60178825Sdfr#define INT8_MIN (-128) 61178825Sdfr#endif 62178825Sdfr#ifndef INT16_MIN 63178825Sdfr#define INT16_MIN (-32767-1) 64178825Sdfr#endif 65178825Sdfr#ifndef INT32_MIN 66178825Sdfr#define INT32_MIN (-2147483647-1) 67178825Sdfr#endif 68178825Sdfr#ifndef INT8_MAX 69178825Sdfr#define INT8_MAX (127) 70178825Sdfr#endif 71178825Sdfr#ifndef INT16_MAX 72178825Sdfr#define INT16_MAX (32767) 73178825Sdfr#endif 74178825Sdfr#ifndef INT32_MAX 75178825Sdfr#define INT32_MAX (2147483647) 76178825Sdfr#endif 77178825Sdfr#ifndef UINT8_MAX 78178825Sdfr#define UINT8_MAX (255U) 79178825Sdfr#endif 80178825Sdfr#ifndef UINT16_MAX 81178825Sdfr#define UINT16_MAX (65535U) 82178825Sdfr#endif 83178825Sdfr#ifndef UINT32_MAX 84178825Sdfr#define UINT32_MAX (4294967295U) 85178825Sdfr#endif 86178825Sdfr 87178825Sdfr#endif /* ! FLEXINT_H */ 88178825Sdfr 89178825Sdfr#ifdef __cplusplus 90178825Sdfr 91178825Sdfr/* The "const" storage-class-modifier is valid. */ 92178825Sdfr#define YY_USE_CONST 93178825Sdfr 94178825Sdfr#else /* ! __cplusplus */ 95178825Sdfr 96233294Sstas/* C99 requires __STDC__ to be defined as 1. */ 97233294Sstas#if defined (__STDC__) 98178825Sdfr 99178825Sdfr#define YY_USE_CONST 100178825Sdfr 101233294Sstas#endif /* defined (__STDC__) */ 102178825Sdfr#endif /* ! __cplusplus */ 103178825Sdfr 104178825Sdfr#ifdef YY_USE_CONST 105178825Sdfr#define yyconst const 106178825Sdfr#else 107178825Sdfr#define yyconst 108178825Sdfr#endif 109178825Sdfr 110178825Sdfr/* Returned upon end-of-file. */ 111178825Sdfr#define YY_NULL 0 112178825Sdfr 113178825Sdfr/* Promotes a possibly negative, possibly signed char to an unsigned 114178825Sdfr * integer for use as an array index. If the signed char is negative, 115178825Sdfr * we want to instead treat it as an 8-bit unsigned char, hence the 116178825Sdfr * double cast. 117178825Sdfr */ 118178825Sdfr#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 119178825Sdfr 120178825Sdfr/* Enter a start condition. This macro really ought to take a parameter, 121178825Sdfr * but we do it the disgusting crufty way forced on us by the ()-less 122178825Sdfr * definition of BEGIN. 123178825Sdfr */ 124178825Sdfr#define BEGIN (yy_start) = 1 + 2 * 125178825Sdfr 126178825Sdfr/* Translate the current start state into a value that can be later handed 127178825Sdfr * to BEGIN to return to the state. The YYSTATE alias is for lex 128178825Sdfr * compatibility. 129178825Sdfr */ 130178825Sdfr#define YY_START (((yy_start) - 1) / 2) 131178825Sdfr#define YYSTATE YY_START 132178825Sdfr 133178825Sdfr/* Action number for EOF rule of a given start state. */ 134178825Sdfr#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 135178825Sdfr 136178825Sdfr/* Special action meaning "start processing a new file". */ 137178825Sdfr#define YY_NEW_FILE yyrestart(yyin ) 138178825Sdfr 139178825Sdfr#define YY_END_OF_BUFFER_CHAR 0 140178825Sdfr 141178825Sdfr/* Size of default input buffer. */ 142178825Sdfr#ifndef YY_BUF_SIZE 143178825Sdfr#define YY_BUF_SIZE 16384 144178825Sdfr#endif 145178825Sdfr 146178825Sdfr/* The state buf must be large enough to hold one state per character in the main buffer. 147178825Sdfr */ 148178825Sdfr#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 149178825Sdfr 150178825Sdfr#ifndef YY_TYPEDEF_YY_BUFFER_STATE 151178825Sdfr#define YY_TYPEDEF_YY_BUFFER_STATE 152178825Sdfrtypedef struct yy_buffer_state *YY_BUFFER_STATE; 153178825Sdfr#endif 154178825Sdfr 155233294Sstas#ifndef YY_TYPEDEF_YY_SIZE_T 156233294Sstas#define YY_TYPEDEF_YY_SIZE_T 157233294Sstastypedef size_t yy_size_t; 158233294Sstas#endif 159178825Sdfr 160233294Sstasextern yy_size_t yyleng; 161233294Sstas 162178825Sdfrextern FILE *yyin, *yyout; 163178825Sdfr 164178825Sdfr#define EOB_ACT_CONTINUE_SCAN 0 165178825Sdfr#define EOB_ACT_END_OF_FILE 1 166178825Sdfr#define EOB_ACT_LAST_MATCH 2 167178825Sdfr 168178825Sdfr #define YY_LESS_LINENO(n) 169178825Sdfr 170178825Sdfr/* Return all but the first "n" matched characters back to the input stream. */ 171178825Sdfr#define yyless(n) \ 172178825Sdfr do \ 173178825Sdfr { \ 174178825Sdfr /* Undo effects of setting up yytext. */ \ 175178825Sdfr int yyless_macro_arg = (n); \ 176178825Sdfr YY_LESS_LINENO(yyless_macro_arg);\ 177178825Sdfr *yy_cp = (yy_hold_char); \ 178178825Sdfr YY_RESTORE_YY_MORE_OFFSET \ 179178825Sdfr (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 180178825Sdfr YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 181178825Sdfr } \ 182178825Sdfr while ( 0 ) 183178825Sdfr 184178825Sdfr#define unput(c) yyunput( c, (yytext_ptr) ) 185178825Sdfr 186178825Sdfr#ifndef YY_STRUCT_YY_BUFFER_STATE 187178825Sdfr#define YY_STRUCT_YY_BUFFER_STATE 188178825Sdfrstruct yy_buffer_state 189178825Sdfr { 190178825Sdfr FILE *yy_input_file; 191178825Sdfr 192178825Sdfr char *yy_ch_buf; /* input buffer */ 193178825Sdfr char *yy_buf_pos; /* current position in input buffer */ 194178825Sdfr 195178825Sdfr /* Size of input buffer in bytes, not including room for EOB 196178825Sdfr * characters. 197178825Sdfr */ 198178825Sdfr yy_size_t yy_buf_size; 199178825Sdfr 200178825Sdfr /* Number of characters read into yy_ch_buf, not including EOB 201178825Sdfr * characters. 202178825Sdfr */ 203233294Sstas yy_size_t yy_n_chars; 204178825Sdfr 205178825Sdfr /* Whether we "own" the buffer - i.e., we know we created it, 206178825Sdfr * and can realloc() it to grow it, and should free() it to 207178825Sdfr * delete it. 208178825Sdfr */ 209178825Sdfr int yy_is_our_buffer; 210178825Sdfr 211178825Sdfr /* Whether this is an "interactive" input source; if so, and 212178825Sdfr * if we're using stdio for input, then we want to use getc() 213178825Sdfr * instead of fread(), to make sure we stop fetching input after 214178825Sdfr * each newline. 215178825Sdfr */ 216178825Sdfr int yy_is_interactive; 217178825Sdfr 218178825Sdfr /* Whether we're considered to be at the beginning of a line. 219178825Sdfr * If so, '^' rules will be active on the next match, otherwise 220178825Sdfr * not. 221178825Sdfr */ 222178825Sdfr int yy_at_bol; 223178825Sdfr 224178825Sdfr int yy_bs_lineno; /**< The line count. */ 225178825Sdfr int yy_bs_column; /**< The column count. */ 226178825Sdfr 227178825Sdfr /* Whether to try to fill the input buffer when we reach the 228178825Sdfr * end of it. 229178825Sdfr */ 230178825Sdfr int yy_fill_buffer; 231178825Sdfr 232178825Sdfr int yy_buffer_status; 233178825Sdfr 234178825Sdfr#define YY_BUFFER_NEW 0 235178825Sdfr#define YY_BUFFER_NORMAL 1 236178825Sdfr /* When an EOF's been seen but there's still some text to process 237178825Sdfr * then we mark the buffer as YY_EOF_PENDING, to indicate that we 238178825Sdfr * shouldn't try reading from the input source any more. We might 239178825Sdfr * still have a bunch of tokens to match, though, because of 240178825Sdfr * possible backing-up. 241178825Sdfr * 242178825Sdfr * When we actually see the EOF, we change the status to "new" 243178825Sdfr * (via yyrestart()), so that the user can continue scanning by 244178825Sdfr * just pointing yyin at a new input file. 245178825Sdfr */ 246178825Sdfr#define YY_BUFFER_EOF_PENDING 2 247178825Sdfr 248178825Sdfr }; 249178825Sdfr#endif /* !YY_STRUCT_YY_BUFFER_STATE */ 250178825Sdfr 251178825Sdfr/* Stack of input buffers. */ 252178825Sdfrstatic size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ 253178825Sdfrstatic size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 254178825Sdfrstatic YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ 255178825Sdfr 256178825Sdfr/* We provide macros for accessing buffer states in case in the 257178825Sdfr * future we want to put the buffer states in a more general 258178825Sdfr * "scanner state". 259178825Sdfr * 260178825Sdfr * Returns the top of the stack, or NULL. 261178825Sdfr */ 262178825Sdfr#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 263178825Sdfr ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 264178825Sdfr : NULL) 265178825Sdfr 266178825Sdfr/* Same as previous macro, but useful when we know that the buffer stack is not 267178825Sdfr * NULL or when we need an lvalue. For internal use only. 268178825Sdfr */ 269178825Sdfr#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 270178825Sdfr 271178825Sdfr/* yy_hold_char holds the character lost when yytext is formed. */ 272178825Sdfrstatic char yy_hold_char; 273233294Sstasstatic yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ 274233294Sstasyy_size_t yyleng; 275178825Sdfr 276178825Sdfr/* Points to current character in buffer. */ 277178825Sdfrstatic char *yy_c_buf_p = (char *) 0; 278178825Sdfrstatic int yy_init = 0; /* whether we need to initialize */ 279178825Sdfrstatic int yy_start = 0; /* start state number */ 280178825Sdfr 281178825Sdfr/* Flag which is used to allow yywrap()'s to do buffer switches 282178825Sdfr * instead of setting up a fresh yyin. A bit of a hack ... 283178825Sdfr */ 284178825Sdfrstatic int yy_did_buffer_switch_on_eof; 285178825Sdfr 286178825Sdfrvoid yyrestart (FILE *input_file ); 287178825Sdfrvoid yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 288178825SdfrYY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); 289178825Sdfrvoid yy_delete_buffer (YY_BUFFER_STATE b ); 290178825Sdfrvoid yy_flush_buffer (YY_BUFFER_STATE b ); 291178825Sdfrvoid yypush_buffer_state (YY_BUFFER_STATE new_buffer ); 292178825Sdfrvoid yypop_buffer_state (void ); 293178825Sdfr 294178825Sdfrstatic void yyensure_buffer_stack (void ); 295178825Sdfrstatic void yy_load_buffer_state (void ); 296178825Sdfrstatic void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); 297178825Sdfr 298178825Sdfr#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) 299178825Sdfr 300178825SdfrYY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); 301178825SdfrYY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); 302233294SstasYY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); 303178825Sdfr 304178825Sdfrvoid *yyalloc (yy_size_t ); 305178825Sdfrvoid *yyrealloc (void *,yy_size_t ); 306178825Sdfrvoid yyfree (void * ); 307178825Sdfr 308178825Sdfr#define yy_new_buffer yy_create_buffer 309178825Sdfr 310178825Sdfr#define yy_set_interactive(is_interactive) \ 311178825Sdfr { \ 312178825Sdfr if ( ! YY_CURRENT_BUFFER ){ \ 313178825Sdfr yyensure_buffer_stack (); \ 314178825Sdfr YY_CURRENT_BUFFER_LVALUE = \ 315178825Sdfr yy_create_buffer(yyin,YY_BUF_SIZE ); \ 316178825Sdfr } \ 317178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 318178825Sdfr } 319178825Sdfr 320178825Sdfr#define yy_set_bol(at_bol) \ 321178825Sdfr { \ 322178825Sdfr if ( ! YY_CURRENT_BUFFER ){\ 323178825Sdfr yyensure_buffer_stack (); \ 324178825Sdfr YY_CURRENT_BUFFER_LVALUE = \ 325178825Sdfr yy_create_buffer(yyin,YY_BUF_SIZE ); \ 326178825Sdfr } \ 327178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 328178825Sdfr } 329178825Sdfr 330178825Sdfr#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 331178825Sdfr 332178825Sdfr/* Begin user sect3 */ 333178825Sdfr 334178825Sdfrtypedef unsigned char YY_CHAR; 335178825Sdfr 336178825SdfrFILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 337178825Sdfr 338178825Sdfrtypedef int yy_state_type; 339178825Sdfr 340178825Sdfrextern int yylineno; 341178825Sdfr 342178825Sdfrint yylineno = 1; 343178825Sdfr 344178825Sdfrextern char *yytext; 345178825Sdfr#define yytext_ptr yytext 346178825Sdfr 347178825Sdfrstatic yy_state_type yy_get_previous_state (void ); 348178825Sdfrstatic yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 349178825Sdfrstatic int yy_get_next_buffer (void ); 350178825Sdfrstatic void yy_fatal_error (yyconst char msg[] ); 351178825Sdfr 352178825Sdfr/* Done after the current pattern has been matched and before the 353178825Sdfr * corresponding action - sets up yytext. 354178825Sdfr */ 355178825Sdfr#define YY_DO_BEFORE_ACTION \ 356178825Sdfr (yytext_ptr) = yy_bp; \ 357178825Sdfr yyleng = (size_t) (yy_cp - yy_bp); \ 358178825Sdfr (yy_hold_char) = *yy_cp; \ 359178825Sdfr *yy_cp = '\0'; \ 360178825Sdfr (yy_c_buf_p) = yy_cp; 361178825Sdfr 362178825Sdfr#define YY_NUM_RULES 16 363178825Sdfr#define YY_END_OF_BUFFER 17 364178825Sdfr/* This struct is not used in this scanner, 365178825Sdfr but its presence is necessary. */ 366178825Sdfrstruct yy_trans_info 367178825Sdfr { 368178825Sdfr flex_int32_t yy_verify; 369178825Sdfr flex_int32_t yy_nxt; 370178825Sdfr }; 371178825Sdfrstatic yyconst flex_int16_t yy_accept[46] = 372178825Sdfr { 0, 373178825Sdfr 0, 0, 17, 15, 11, 12, 13, 10, 9, 14, 374178825Sdfr 14, 14, 14, 10, 9, 14, 3, 14, 14, 1, 375178825Sdfr 7, 14, 14, 8, 14, 14, 14, 14, 14, 14, 376178825Sdfr 14, 6, 14, 14, 5, 14, 14, 14, 14, 14, 377178825Sdfr 14, 4, 14, 2, 0 378178825Sdfr } ; 379178825Sdfr 380178825Sdfrstatic yyconst flex_int32_t yy_ec[256] = 381178825Sdfr { 0, 382178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 383178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 384178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 385178825Sdfr 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, 386178825Sdfr 1, 1, 1, 1, 1, 1, 1, 6, 6, 6, 387178825Sdfr 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 388178825Sdfr 1, 1, 1, 1, 7, 7, 7, 7, 7, 7, 389178825Sdfr 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 390178825Sdfr 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 391178825Sdfr 1, 1, 1, 1, 8, 1, 9, 10, 11, 12, 392178825Sdfr 393178825Sdfr 13, 14, 7, 7, 15, 7, 7, 16, 7, 17, 394178825Sdfr 18, 19, 7, 20, 7, 21, 7, 7, 7, 22, 395178825Sdfr 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 396178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 397178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 398178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 399178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 400178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 401178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 402178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 403178825Sdfr 404178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 405178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 406178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 407178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 408178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 409178825Sdfr 1, 1, 1, 1, 1 410178825Sdfr } ; 411178825Sdfr 412178825Sdfrstatic yyconst flex_int32_t yy_meta[23] = 413178825Sdfr { 0, 414178825Sdfr 1, 1, 2, 1, 1, 3, 3, 3, 3, 3, 415178825Sdfr 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 416178825Sdfr 3, 3 417178825Sdfr } ; 418178825Sdfr 419178825Sdfrstatic yyconst flex_int16_t yy_base[48] = 420178825Sdfr { 0, 421178825Sdfr 0, 0, 56, 57, 57, 57, 57, 0, 49, 0, 422178825Sdfr 12, 13, 34, 0, 47, 0, 0, 40, 31, 0, 423178825Sdfr 0, 38, 36, 0, 30, 34, 32, 25, 22, 28, 424178825Sdfr 34, 0, 19, 13, 0, 22, 30, 26, 26, 18, 425178825Sdfr 12, 0, 14, 0, 57, 34, 23 426178825Sdfr } ; 427178825Sdfr 428178825Sdfrstatic yyconst flex_int16_t yy_def[48] = 429178825Sdfr { 0, 430178825Sdfr 45, 1, 45, 45, 45, 45, 45, 46, 47, 47, 431178825Sdfr 47, 47, 47, 46, 47, 47, 47, 47, 47, 47, 432178825Sdfr 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 433178825Sdfr 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 434178825Sdfr 47, 47, 47, 47, 0, 45, 45 435178825Sdfr } ; 436178825Sdfr 437178825Sdfrstatic yyconst flex_int16_t yy_nxt[80] = 438178825Sdfr { 0, 439178825Sdfr 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 440178825Sdfr 10, 10, 11, 10, 12, 10, 10, 10, 13, 10, 441178825Sdfr 10, 10, 17, 36, 21, 16, 44, 43, 18, 22, 442178825Sdfr 42, 19, 20, 37, 14, 41, 14, 40, 39, 38, 443178825Sdfr 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 444178825Sdfr 25, 24, 15, 23, 15, 45, 3, 45, 45, 45, 445178825Sdfr 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 446178825Sdfr 45, 45, 45, 45, 45, 45, 45, 45, 45 447178825Sdfr } ; 448178825Sdfr 449178825Sdfrstatic yyconst flex_int16_t yy_chk[80] = 450178825Sdfr { 0, 451178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 452178825Sdfr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 453178825Sdfr 1, 1, 11, 34, 12, 47, 43, 41, 11, 12, 454178825Sdfr 40, 11, 11, 34, 46, 39, 46, 38, 37, 36, 455178825Sdfr 33, 31, 30, 29, 28, 27, 26, 25, 23, 22, 456178825Sdfr 19, 18, 15, 13, 9, 3, 45, 45, 45, 45, 457178825Sdfr 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 458178825Sdfr 45, 45, 45, 45, 45, 45, 45, 45, 45 459178825Sdfr } ; 460178825Sdfr 461178825Sdfrstatic yy_state_type yy_last_accepting_state; 462178825Sdfrstatic char *yy_last_accepting_cpos; 463178825Sdfr 464178825Sdfrextern int yy_flex_debug; 465178825Sdfrint yy_flex_debug = 0; 466178825Sdfr 467178825Sdfr/* The intent behind this definition is that it'll catch 468178825Sdfr * any uses of REJECT which flex missed. 469178825Sdfr */ 470178825Sdfr#define REJECT reject_used_but_not_detected 471178825Sdfr#define yymore() yymore_used_but_not_detected 472178825Sdfr#define YY_MORE_ADJ 0 473178825Sdfr#define YY_RESTORE_YY_MORE_OFFSET 474178825Sdfrchar *yytext; 475178825Sdfr#line 1 "lex.l" 476178825Sdfr#line 2 "lex.l" 477178825Sdfr/* 478233294Sstas * Copyright (c) 1998 - 2000 Kungliga Tekniska H��gskolan 479233294Sstas * (Royal Institute of Technology, Stockholm, Sweden). 480233294Sstas * All rights reserved. 481178825Sdfr * 482233294Sstas * Redistribution and use in source and binary forms, with or without 483233294Sstas * modification, are permitted provided that the following conditions 484233294Sstas * are met: 485178825Sdfr * 486233294Sstas * 1. Redistributions of source code must retain the above copyright 487233294Sstas * notice, this list of conditions and the following disclaimer. 488178825Sdfr * 489233294Sstas * 2. Redistributions in binary form must reproduce the above copyright 490233294Sstas * notice, this list of conditions and the following disclaimer in the 491233294Sstas * documentation and/or other materials provided with the distribution. 492178825Sdfr * 493233294Sstas * 3. Neither the name of the Institute nor the names of its contributors 494233294Sstas * may be used to endorse or promote products derived from this software 495233294Sstas * without specific prior written permission. 496178825Sdfr * 497233294Sstas * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 498233294Sstas * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 499233294Sstas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 500233294Sstas * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 501233294Sstas * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 502233294Sstas * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 503233294Sstas * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 504233294Sstas * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 505233294Sstas * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 506233294Sstas * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 507233294Sstas * SUCH DAMAGE. 508178825Sdfr */ 509178825Sdfr 510178825Sdfr/* 511178825Sdfr * This is to handle the definition of this symbol in some AIX 512178825Sdfr * headers, which will conflict with the definition that lex will 513178825Sdfr * generate for it. It's only a problem for AIX lex. 514178825Sdfr */ 515178825Sdfr 516178825Sdfr#undef ECHO 517178825Sdfr 518178825Sdfr#include "compile_et.h" 519178825Sdfr#include "parse.h" 520178825Sdfr#include "lex.h" 521178825Sdfr 522178825Sdfrstatic unsigned lineno = 1; 523178825Sdfrstatic int getstring(void); 524178825Sdfr 525178825Sdfr#define YY_NO_UNPUT 526178825Sdfr 527178825Sdfr#undef ECHO 528178825Sdfr 529233294Sstas#line 530 "lex.c" 530178825Sdfr 531178825Sdfr#define INITIAL 0 532178825Sdfr 533178825Sdfr#ifndef YY_NO_UNISTD_H 534178825Sdfr/* Special case for "unistd.h", since it is non-ANSI. We include it way 535178825Sdfr * down here because we want the user's section 1 to have been scanned first. 536178825Sdfr * The user has a chance to override it with an option. 537178825Sdfr */ 538178825Sdfr#include <unistd.h> 539178825Sdfr#endif 540178825Sdfr 541178825Sdfr#ifndef YY_EXTRA_TYPE 542178825Sdfr#define YY_EXTRA_TYPE void * 543178825Sdfr#endif 544178825Sdfr 545178825Sdfrstatic int yy_init_globals (void ); 546178825Sdfr 547233294Sstas/* Accessor methods to globals. 548233294Sstas These are made visible to non-reentrant scanners for convenience. */ 549233294Sstas 550233294Sstasint yylex_destroy (void ); 551233294Sstas 552233294Sstasint yyget_debug (void ); 553233294Sstas 554233294Sstasvoid yyset_debug (int debug_flag ); 555233294Sstas 556233294SstasYY_EXTRA_TYPE yyget_extra (void ); 557233294Sstas 558233294Sstasvoid yyset_extra (YY_EXTRA_TYPE user_defined ); 559233294Sstas 560233294SstasFILE *yyget_in (void ); 561233294Sstas 562233294Sstasvoid yyset_in (FILE * in_str ); 563233294Sstas 564233294SstasFILE *yyget_out (void ); 565233294Sstas 566233294Sstasvoid yyset_out (FILE * out_str ); 567233294Sstas 568233294Sstasyy_size_t yyget_leng (void ); 569233294Sstas 570233294Sstaschar *yyget_text (void ); 571233294Sstas 572233294Sstasint yyget_lineno (void ); 573233294Sstas 574233294Sstasvoid yyset_lineno (int line_number ); 575233294Sstas 576178825Sdfr/* Macros after this point can all be overridden by user definitions in 577178825Sdfr * section 1. 578178825Sdfr */ 579178825Sdfr 580178825Sdfr#ifndef YY_SKIP_YYWRAP 581178825Sdfr#ifdef __cplusplus 582178825Sdfrextern "C" int yywrap (void ); 583178825Sdfr#else 584178825Sdfrextern int yywrap (void ); 585178825Sdfr#endif 586178825Sdfr#endif 587178825Sdfr 588178825Sdfr#ifndef yytext_ptr 589178825Sdfrstatic void yy_flex_strncpy (char *,yyconst char *,int ); 590178825Sdfr#endif 591178825Sdfr 592178825Sdfr#ifdef YY_NEED_STRLEN 593178825Sdfrstatic int yy_flex_strlen (yyconst char * ); 594178825Sdfr#endif 595178825Sdfr 596178825Sdfr#ifndef YY_NO_INPUT 597178825Sdfr 598178825Sdfr#ifdef __cplusplus 599178825Sdfrstatic int yyinput (void ); 600178825Sdfr#else 601178825Sdfrstatic int input (void ); 602178825Sdfr#endif 603178825Sdfr 604178825Sdfr#endif 605178825Sdfr 606178825Sdfr/* Amount of stuff to slurp up with each read. */ 607178825Sdfr#ifndef YY_READ_BUF_SIZE 608178825Sdfr#define YY_READ_BUF_SIZE 8192 609178825Sdfr#endif 610178825Sdfr 611178825Sdfr/* Copy whatever the last rule matched to the standard output. */ 612178825Sdfr#ifndef ECHO 613178825Sdfr/* This used to be an fputs(), but since the string might contain NUL's, 614178825Sdfr * we now use fwrite(). 615178825Sdfr */ 616233294Sstas#define ECHO fwrite( yytext, yyleng, 1, yyout ) 617178825Sdfr#endif 618178825Sdfr 619178825Sdfr/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 620178825Sdfr * is returned in "result". 621178825Sdfr */ 622178825Sdfr#ifndef YY_INPUT 623178825Sdfr#define YY_INPUT(buf,result,max_size) \ 624178825Sdfr if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 625178825Sdfr { \ 626178825Sdfr int c = '*'; \ 627233294Sstas yy_size_t n; \ 628178825Sdfr for ( n = 0; n < max_size && \ 629178825Sdfr (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 630178825Sdfr buf[n] = (char) c; \ 631178825Sdfr if ( c == '\n' ) \ 632178825Sdfr buf[n++] = (char) c; \ 633178825Sdfr if ( c == EOF && ferror( yyin ) ) \ 634178825Sdfr YY_FATAL_ERROR( "input in flex scanner failed" ); \ 635178825Sdfr result = n; \ 636178825Sdfr } \ 637178825Sdfr else \ 638178825Sdfr { \ 639178825Sdfr errno=0; \ 640178825Sdfr while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 641178825Sdfr { \ 642178825Sdfr if( errno != EINTR) \ 643178825Sdfr { \ 644178825Sdfr YY_FATAL_ERROR( "input in flex scanner failed" ); \ 645178825Sdfr break; \ 646178825Sdfr } \ 647178825Sdfr errno=0; \ 648178825Sdfr clearerr(yyin); \ 649178825Sdfr } \ 650178825Sdfr }\ 651178825Sdfr\ 652178825Sdfr 653178825Sdfr#endif 654178825Sdfr 655178825Sdfr/* No semi-colon after return; correct usage is to write "yyterminate();" - 656178825Sdfr * we don't want an extra ';' after the "return" because that will cause 657178825Sdfr * some compilers to complain about unreachable statements. 658178825Sdfr */ 659178825Sdfr#ifndef yyterminate 660178825Sdfr#define yyterminate() return YY_NULL 661178825Sdfr#endif 662178825Sdfr 663178825Sdfr/* Number of entries by which start-condition stack grows. */ 664178825Sdfr#ifndef YY_START_STACK_INCR 665178825Sdfr#define YY_START_STACK_INCR 25 666178825Sdfr#endif 667178825Sdfr 668178825Sdfr/* Report a fatal error. */ 669178825Sdfr#ifndef YY_FATAL_ERROR 670178825Sdfr#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 671178825Sdfr#endif 672178825Sdfr 673178825Sdfr/* end tables serialization structures and prototypes */ 674178825Sdfr 675178825Sdfr/* Default declaration of generated scanner - a define so the user can 676178825Sdfr * easily add parameters. 677178825Sdfr */ 678178825Sdfr#ifndef YY_DECL 679178825Sdfr#define YY_DECL_IS_OURS 1 680178825Sdfr 681178825Sdfrextern int yylex (void); 682178825Sdfr 683178825Sdfr#define YY_DECL int yylex (void) 684178825Sdfr#endif /* !YY_DECL */ 685178825Sdfr 686178825Sdfr/* Code executed at the beginning of each rule, after yytext and yyleng 687178825Sdfr * have been set up. 688178825Sdfr */ 689178825Sdfr#ifndef YY_USER_ACTION 690178825Sdfr#define YY_USER_ACTION 691178825Sdfr#endif 692178825Sdfr 693178825Sdfr/* Code executed at the end of each rule. */ 694178825Sdfr#ifndef YY_BREAK 695178825Sdfr#define YY_BREAK break; 696178825Sdfr#endif 697178825Sdfr 698178825Sdfr#define YY_RULE_SETUP \ 699178825Sdfr YY_USER_ACTION 700178825Sdfr 701178825Sdfr/** The main scanner function which does all the work. 702178825Sdfr */ 703178825SdfrYY_DECL 704178825Sdfr{ 705178825Sdfr register yy_state_type yy_current_state; 706178825Sdfr register char *yy_cp, *yy_bp; 707178825Sdfr register int yy_act; 708178825Sdfr 709233294Sstas#line 58 "lex.l" 710178825Sdfr 711233294Sstas#line 712 "lex.c" 712178825Sdfr 713178825Sdfr if ( !(yy_init) ) 714178825Sdfr { 715178825Sdfr (yy_init) = 1; 716178825Sdfr 717178825Sdfr#ifdef YY_USER_INIT 718178825Sdfr YY_USER_INIT; 719178825Sdfr#endif 720178825Sdfr 721178825Sdfr if ( ! (yy_start) ) 722178825Sdfr (yy_start) = 1; /* first start state */ 723178825Sdfr 724178825Sdfr if ( ! yyin ) 725178825Sdfr yyin = stdin; 726178825Sdfr 727178825Sdfr if ( ! yyout ) 728178825Sdfr yyout = stdout; 729178825Sdfr 730178825Sdfr if ( ! YY_CURRENT_BUFFER ) { 731178825Sdfr yyensure_buffer_stack (); 732178825Sdfr YY_CURRENT_BUFFER_LVALUE = 733178825Sdfr yy_create_buffer(yyin,YY_BUF_SIZE ); 734178825Sdfr } 735178825Sdfr 736178825Sdfr yy_load_buffer_state( ); 737178825Sdfr } 738178825Sdfr 739178825Sdfr while ( 1 ) /* loops until end-of-file is reached */ 740178825Sdfr { 741178825Sdfr yy_cp = (yy_c_buf_p); 742178825Sdfr 743178825Sdfr /* Support of yytext. */ 744178825Sdfr *yy_cp = (yy_hold_char); 745178825Sdfr 746178825Sdfr /* yy_bp points to the position in yy_ch_buf of the start of 747178825Sdfr * the current run. 748178825Sdfr */ 749178825Sdfr yy_bp = yy_cp; 750178825Sdfr 751178825Sdfr yy_current_state = (yy_start); 752178825Sdfryy_match: 753178825Sdfr do 754178825Sdfr { 755178825Sdfr register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 756178825Sdfr if ( yy_accept[yy_current_state] ) 757178825Sdfr { 758178825Sdfr (yy_last_accepting_state) = yy_current_state; 759178825Sdfr (yy_last_accepting_cpos) = yy_cp; 760178825Sdfr } 761178825Sdfr while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 762178825Sdfr { 763178825Sdfr yy_current_state = (int) yy_def[yy_current_state]; 764178825Sdfr if ( yy_current_state >= 46 ) 765178825Sdfr yy_c = yy_meta[(unsigned int) yy_c]; 766178825Sdfr } 767178825Sdfr yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 768178825Sdfr ++yy_cp; 769178825Sdfr } 770178825Sdfr while ( yy_base[yy_current_state] != 57 ); 771178825Sdfr 772178825Sdfryy_find_action: 773178825Sdfr yy_act = yy_accept[yy_current_state]; 774178825Sdfr if ( yy_act == 0 ) 775178825Sdfr { /* have to back up */ 776178825Sdfr yy_cp = (yy_last_accepting_cpos); 777178825Sdfr yy_current_state = (yy_last_accepting_state); 778178825Sdfr yy_act = yy_accept[yy_current_state]; 779178825Sdfr } 780178825Sdfr 781178825Sdfr YY_DO_BEFORE_ACTION; 782178825Sdfr 783178825Sdfrdo_action: /* This label is used only to access EOF actions. */ 784178825Sdfr 785178825Sdfr switch ( yy_act ) 786178825Sdfr { /* beginning of action switch */ 787178825Sdfr case 0: /* must back up */ 788178825Sdfr /* undo the effects of YY_DO_BEFORE_ACTION */ 789178825Sdfr *yy_cp = (yy_hold_char); 790178825Sdfr yy_cp = (yy_last_accepting_cpos); 791178825Sdfr yy_current_state = (yy_last_accepting_state); 792178825Sdfr goto yy_find_action; 793178825Sdfr 794178825Sdfrcase 1: 795178825SdfrYY_RULE_SETUP 796233294Sstas#line 59 "lex.l" 797178825Sdfr{ return ET; } 798178825Sdfr YY_BREAK 799178825Sdfrcase 2: 800178825SdfrYY_RULE_SETUP 801233294Sstas#line 60 "lex.l" 802178825Sdfr{ return ET; } 803178825Sdfr YY_BREAK 804178825Sdfrcase 3: 805178825SdfrYY_RULE_SETUP 806233294Sstas#line 61 "lex.l" 807178825Sdfr{ return EC; } 808178825Sdfr YY_BREAK 809178825Sdfrcase 4: 810178825SdfrYY_RULE_SETUP 811233294Sstas#line 62 "lex.l" 812178825Sdfr{ return EC; } 813178825Sdfr YY_BREAK 814178825Sdfrcase 5: 815178825SdfrYY_RULE_SETUP 816233294Sstas#line 63 "lex.l" 817178825Sdfr{ return PREFIX; } 818178825Sdfr YY_BREAK 819178825Sdfrcase 6: 820178825SdfrYY_RULE_SETUP 821233294Sstas#line 64 "lex.l" 822178825Sdfr{ return INDEX; } 823178825Sdfr YY_BREAK 824178825Sdfrcase 7: 825178825SdfrYY_RULE_SETUP 826233294Sstas#line 65 "lex.l" 827178825Sdfr{ return ID; } 828178825Sdfr YY_BREAK 829178825Sdfrcase 8: 830178825SdfrYY_RULE_SETUP 831233294Sstas#line 66 "lex.l" 832178825Sdfr{ return END; } 833178825Sdfr YY_BREAK 834178825Sdfrcase 9: 835178825SdfrYY_RULE_SETUP 836233294Sstas#line 67 "lex.l" 837178825Sdfr{ yylval.number = atoi(yytext); return NUMBER; } 838178825Sdfr YY_BREAK 839178825Sdfrcase 10: 840178825SdfrYY_RULE_SETUP 841233294Sstas#line 68 "lex.l" 842178825Sdfr; 843178825Sdfr YY_BREAK 844178825Sdfrcase 11: 845178825SdfrYY_RULE_SETUP 846233294Sstas#line 69 "lex.l" 847178825Sdfr; 848178825Sdfr YY_BREAK 849178825Sdfrcase 12: 850178825Sdfr/* rule 12 can match eol */ 851178825SdfrYY_RULE_SETUP 852233294Sstas#line 70 "lex.l" 853178825Sdfr{ lineno++; } 854178825Sdfr YY_BREAK 855178825Sdfrcase 13: 856178825SdfrYY_RULE_SETUP 857233294Sstas#line 71 "lex.l" 858178825Sdfr{ return getstring(); } 859178825Sdfr YY_BREAK 860178825Sdfrcase 14: 861178825SdfrYY_RULE_SETUP 862233294Sstas#line 72 "lex.l" 863178825Sdfr{ yylval.string = strdup(yytext); return STRING; } 864178825Sdfr YY_BREAK 865178825Sdfrcase 15: 866178825SdfrYY_RULE_SETUP 867233294Sstas#line 73 "lex.l" 868178825Sdfr{ return *yytext; } 869178825Sdfr YY_BREAK 870178825Sdfrcase 16: 871178825SdfrYY_RULE_SETUP 872233294Sstas#line 74 "lex.l" 873178825SdfrECHO; 874178825Sdfr YY_BREAK 875233294Sstas#line 876 "lex.c" 876178825Sdfrcase YY_STATE_EOF(INITIAL): 877178825Sdfr yyterminate(); 878178825Sdfr 879178825Sdfr case YY_END_OF_BUFFER: 880178825Sdfr { 881178825Sdfr /* Amount of text matched not including the EOB char. */ 882178825Sdfr int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 883178825Sdfr 884178825Sdfr /* Undo the effects of YY_DO_BEFORE_ACTION. */ 885178825Sdfr *yy_cp = (yy_hold_char); 886178825Sdfr YY_RESTORE_YY_MORE_OFFSET 887178825Sdfr 888178825Sdfr if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 889178825Sdfr { 890178825Sdfr /* We're scanning a new file or input source. It's 891178825Sdfr * possible that this happened because the user 892178825Sdfr * just pointed yyin at a new source and called 893178825Sdfr * yylex(). If so, then we have to assure 894178825Sdfr * consistency between YY_CURRENT_BUFFER and our 895178825Sdfr * globals. Here is the right place to do so, because 896178825Sdfr * this is the first action (other than possibly a 897178825Sdfr * back-up) that will match for the new input source. 898178825Sdfr */ 899178825Sdfr (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 900178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 901178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 902178825Sdfr } 903178825Sdfr 904178825Sdfr /* Note that here we test for yy_c_buf_p "<=" to the position 905178825Sdfr * of the first EOB in the buffer, since yy_c_buf_p will 906178825Sdfr * already have been incremented past the NUL character 907178825Sdfr * (since all states make transitions on EOB to the 908178825Sdfr * end-of-buffer state). Contrast this with the test 909178825Sdfr * in input(). 910178825Sdfr */ 911178825Sdfr if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 912178825Sdfr { /* This was really a NUL. */ 913178825Sdfr yy_state_type yy_next_state; 914178825Sdfr 915178825Sdfr (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 916178825Sdfr 917178825Sdfr yy_current_state = yy_get_previous_state( ); 918178825Sdfr 919178825Sdfr /* Okay, we're now positioned to make the NUL 920178825Sdfr * transition. We couldn't have 921178825Sdfr * yy_get_previous_state() go ahead and do it 922178825Sdfr * for us because it doesn't know how to deal 923178825Sdfr * with the possibility of jamming (and we don't 924178825Sdfr * want to build jamming into it because then it 925178825Sdfr * will run more slowly). 926178825Sdfr */ 927178825Sdfr 928178825Sdfr yy_next_state = yy_try_NUL_trans( yy_current_state ); 929178825Sdfr 930178825Sdfr yy_bp = (yytext_ptr) + YY_MORE_ADJ; 931178825Sdfr 932178825Sdfr if ( yy_next_state ) 933178825Sdfr { 934178825Sdfr /* Consume the NUL. */ 935178825Sdfr yy_cp = ++(yy_c_buf_p); 936178825Sdfr yy_current_state = yy_next_state; 937178825Sdfr goto yy_match; 938178825Sdfr } 939178825Sdfr 940178825Sdfr else 941178825Sdfr { 942178825Sdfr yy_cp = (yy_c_buf_p); 943178825Sdfr goto yy_find_action; 944178825Sdfr } 945178825Sdfr } 946178825Sdfr 947178825Sdfr else switch ( yy_get_next_buffer( ) ) 948178825Sdfr { 949178825Sdfr case EOB_ACT_END_OF_FILE: 950178825Sdfr { 951178825Sdfr (yy_did_buffer_switch_on_eof) = 0; 952178825Sdfr 953178825Sdfr if ( yywrap( ) ) 954178825Sdfr { 955178825Sdfr /* Note: because we've taken care in 956178825Sdfr * yy_get_next_buffer() to have set up 957178825Sdfr * yytext, we can now set up 958178825Sdfr * yy_c_buf_p so that if some total 959178825Sdfr * hoser (like flex itself) wants to 960178825Sdfr * call the scanner after we return the 961178825Sdfr * YY_NULL, it'll still work - another 962178825Sdfr * YY_NULL will get returned. 963178825Sdfr */ 964178825Sdfr (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 965178825Sdfr 966178825Sdfr yy_act = YY_STATE_EOF(YY_START); 967178825Sdfr goto do_action; 968178825Sdfr } 969178825Sdfr 970178825Sdfr else 971178825Sdfr { 972178825Sdfr if ( ! (yy_did_buffer_switch_on_eof) ) 973178825Sdfr YY_NEW_FILE; 974178825Sdfr } 975178825Sdfr break; 976178825Sdfr } 977178825Sdfr 978178825Sdfr case EOB_ACT_CONTINUE_SCAN: 979178825Sdfr (yy_c_buf_p) = 980178825Sdfr (yytext_ptr) + yy_amount_of_matched_text; 981178825Sdfr 982178825Sdfr yy_current_state = yy_get_previous_state( ); 983178825Sdfr 984178825Sdfr yy_cp = (yy_c_buf_p); 985178825Sdfr yy_bp = (yytext_ptr) + YY_MORE_ADJ; 986178825Sdfr goto yy_match; 987178825Sdfr 988178825Sdfr case EOB_ACT_LAST_MATCH: 989178825Sdfr (yy_c_buf_p) = 990178825Sdfr &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 991178825Sdfr 992178825Sdfr yy_current_state = yy_get_previous_state( ); 993178825Sdfr 994178825Sdfr yy_cp = (yy_c_buf_p); 995178825Sdfr yy_bp = (yytext_ptr) + YY_MORE_ADJ; 996178825Sdfr goto yy_find_action; 997178825Sdfr } 998178825Sdfr break; 999178825Sdfr } 1000178825Sdfr 1001178825Sdfr default: 1002178825Sdfr YY_FATAL_ERROR( 1003178825Sdfr "fatal flex scanner internal error--no action found" ); 1004178825Sdfr } /* end of action switch */ 1005178825Sdfr } /* end of scanning one token */ 1006178825Sdfr} /* end of yylex */ 1007178825Sdfr 1008178825Sdfr/* yy_get_next_buffer - try to read in a new buffer 1009178825Sdfr * 1010178825Sdfr * Returns a code representing an action: 1011178825Sdfr * EOB_ACT_LAST_MATCH - 1012178825Sdfr * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 1013178825Sdfr * EOB_ACT_END_OF_FILE - end of file 1014178825Sdfr */ 1015178825Sdfrstatic int yy_get_next_buffer (void) 1016178825Sdfr{ 1017178825Sdfr register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 1018178825Sdfr register char *source = (yytext_ptr); 1019178825Sdfr register int number_to_move, i; 1020178825Sdfr int ret_val; 1021178825Sdfr 1022178825Sdfr if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 1023178825Sdfr YY_FATAL_ERROR( 1024178825Sdfr "fatal flex scanner internal error--end of buffer missed" ); 1025178825Sdfr 1026178825Sdfr if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 1027178825Sdfr { /* Don't try to fill the buffer, so this is an EOF. */ 1028178825Sdfr if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 1029178825Sdfr { 1030178825Sdfr /* We matched a single character, the EOB, so 1031178825Sdfr * treat this as a final EOF. 1032178825Sdfr */ 1033178825Sdfr return EOB_ACT_END_OF_FILE; 1034178825Sdfr } 1035178825Sdfr 1036178825Sdfr else 1037178825Sdfr { 1038178825Sdfr /* We matched some text prior to the EOB, first 1039178825Sdfr * process it. 1040178825Sdfr */ 1041178825Sdfr return EOB_ACT_LAST_MATCH; 1042178825Sdfr } 1043178825Sdfr } 1044178825Sdfr 1045178825Sdfr /* Try to read more data. */ 1046178825Sdfr 1047178825Sdfr /* First move last chars to start of buffer. */ 1048178825Sdfr number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; 1049178825Sdfr 1050178825Sdfr for ( i = 0; i < number_to_move; ++i ) 1051178825Sdfr *(dest++) = *(source++); 1052178825Sdfr 1053178825Sdfr if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1054178825Sdfr /* don't do the read, it's not guaranteed to return an EOF, 1055178825Sdfr * just force an EOF 1056178825Sdfr */ 1057178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 1058178825Sdfr 1059178825Sdfr else 1060178825Sdfr { 1061233294Sstas yy_size_t num_to_read = 1062178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 1063178825Sdfr 1064178825Sdfr while ( num_to_read <= 0 ) 1065178825Sdfr { /* Not enough room in the buffer - grow it. */ 1066178825Sdfr 1067178825Sdfr /* just a shorter name for the current buffer */ 1068178825Sdfr YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 1069178825Sdfr 1070178825Sdfr int yy_c_buf_p_offset = 1071178825Sdfr (int) ((yy_c_buf_p) - b->yy_ch_buf); 1072178825Sdfr 1073178825Sdfr if ( b->yy_is_our_buffer ) 1074178825Sdfr { 1075233294Sstas yy_size_t new_size = b->yy_buf_size * 2; 1076178825Sdfr 1077178825Sdfr if ( new_size <= 0 ) 1078178825Sdfr b->yy_buf_size += b->yy_buf_size / 8; 1079178825Sdfr else 1080178825Sdfr b->yy_buf_size *= 2; 1081178825Sdfr 1082178825Sdfr b->yy_ch_buf = (char *) 1083178825Sdfr /* Include room in for 2 EOB chars. */ 1084178825Sdfr yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 1085178825Sdfr } 1086178825Sdfr else 1087178825Sdfr /* Can't grow it, we don't own it. */ 1088178825Sdfr b->yy_ch_buf = 0; 1089178825Sdfr 1090178825Sdfr if ( ! b->yy_ch_buf ) 1091178825Sdfr YY_FATAL_ERROR( 1092178825Sdfr "fatal error - scanner input buffer overflow" ); 1093178825Sdfr 1094178825Sdfr (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 1095178825Sdfr 1096178825Sdfr num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 1097178825Sdfr number_to_move - 1; 1098178825Sdfr 1099178825Sdfr } 1100178825Sdfr 1101178825Sdfr if ( num_to_read > YY_READ_BUF_SIZE ) 1102178825Sdfr num_to_read = YY_READ_BUF_SIZE; 1103178825Sdfr 1104178825Sdfr /* Read in more data. */ 1105178825Sdfr YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 1106178825Sdfr (yy_n_chars), num_to_read ); 1107178825Sdfr 1108178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1109178825Sdfr } 1110178825Sdfr 1111178825Sdfr if ( (yy_n_chars) == 0 ) 1112178825Sdfr { 1113178825Sdfr if ( number_to_move == YY_MORE_ADJ ) 1114178825Sdfr { 1115178825Sdfr ret_val = EOB_ACT_END_OF_FILE; 1116178825Sdfr yyrestart(yyin ); 1117178825Sdfr } 1118178825Sdfr 1119178825Sdfr else 1120178825Sdfr { 1121178825Sdfr ret_val = EOB_ACT_LAST_MATCH; 1122178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 1123178825Sdfr YY_BUFFER_EOF_PENDING; 1124178825Sdfr } 1125178825Sdfr } 1126178825Sdfr 1127178825Sdfr else 1128178825Sdfr ret_val = EOB_ACT_CONTINUE_SCAN; 1129178825Sdfr 1130233294Sstas if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 1131233294Sstas /* Extend the array by 50%, plus the number we really need. */ 1132233294Sstas yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 1133233294Sstas YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); 1134233294Sstas if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1135233294Sstas YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 1136233294Sstas } 1137233294Sstas 1138178825Sdfr (yy_n_chars) += number_to_move; 1139178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 1140178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 1141178825Sdfr 1142178825Sdfr (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 1143178825Sdfr 1144178825Sdfr return ret_val; 1145178825Sdfr} 1146178825Sdfr 1147178825Sdfr/* yy_get_previous_state - get the state just before the EOB char was reached */ 1148178825Sdfr 1149178825Sdfr static yy_state_type yy_get_previous_state (void) 1150178825Sdfr{ 1151178825Sdfr register yy_state_type yy_current_state; 1152178825Sdfr register char *yy_cp; 1153178825Sdfr 1154178825Sdfr yy_current_state = (yy_start); 1155178825Sdfr 1156178825Sdfr for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 1157178825Sdfr { 1158178825Sdfr register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1159178825Sdfr if ( yy_accept[yy_current_state] ) 1160178825Sdfr { 1161178825Sdfr (yy_last_accepting_state) = yy_current_state; 1162178825Sdfr (yy_last_accepting_cpos) = yy_cp; 1163178825Sdfr } 1164178825Sdfr while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1165178825Sdfr { 1166178825Sdfr yy_current_state = (int) yy_def[yy_current_state]; 1167178825Sdfr if ( yy_current_state >= 46 ) 1168178825Sdfr yy_c = yy_meta[(unsigned int) yy_c]; 1169178825Sdfr } 1170178825Sdfr yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1171178825Sdfr } 1172178825Sdfr 1173178825Sdfr return yy_current_state; 1174178825Sdfr} 1175178825Sdfr 1176178825Sdfr/* yy_try_NUL_trans - try to make a transition on the NUL character 1177178825Sdfr * 1178178825Sdfr * synopsis 1179178825Sdfr * next_state = yy_try_NUL_trans( current_state ); 1180178825Sdfr */ 1181178825Sdfr static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1182178825Sdfr{ 1183178825Sdfr register int yy_is_jam; 1184178825Sdfr register char *yy_cp = (yy_c_buf_p); 1185178825Sdfr 1186178825Sdfr register YY_CHAR yy_c = 1; 1187178825Sdfr if ( yy_accept[yy_current_state] ) 1188178825Sdfr { 1189178825Sdfr (yy_last_accepting_state) = yy_current_state; 1190178825Sdfr (yy_last_accepting_cpos) = yy_cp; 1191178825Sdfr } 1192178825Sdfr while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1193178825Sdfr { 1194178825Sdfr yy_current_state = (int) yy_def[yy_current_state]; 1195178825Sdfr if ( yy_current_state >= 46 ) 1196178825Sdfr yy_c = yy_meta[(unsigned int) yy_c]; 1197178825Sdfr } 1198178825Sdfr yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1199178825Sdfr yy_is_jam = (yy_current_state == 45); 1200178825Sdfr 1201178825Sdfr return yy_is_jam ? 0 : yy_current_state; 1202178825Sdfr} 1203178825Sdfr 1204178825Sdfr#ifndef YY_NO_INPUT 1205178825Sdfr#ifdef __cplusplus 1206178825Sdfr static int yyinput (void) 1207178825Sdfr#else 1208178825Sdfr static int input (void) 1209178825Sdfr#endif 1210178825Sdfr 1211178825Sdfr{ 1212178825Sdfr int c; 1213178825Sdfr 1214178825Sdfr *(yy_c_buf_p) = (yy_hold_char); 1215178825Sdfr 1216178825Sdfr if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 1217178825Sdfr { 1218178825Sdfr /* yy_c_buf_p now points to the character we want to return. 1219178825Sdfr * If this occurs *before* the EOB characters, then it's a 1220178825Sdfr * valid NUL; if not, then we've hit the end of the buffer. 1221178825Sdfr */ 1222178825Sdfr if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 1223178825Sdfr /* This was really a NUL. */ 1224178825Sdfr *(yy_c_buf_p) = '\0'; 1225178825Sdfr 1226178825Sdfr else 1227178825Sdfr { /* need more input */ 1228233294Sstas yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); 1229178825Sdfr ++(yy_c_buf_p); 1230178825Sdfr 1231178825Sdfr switch ( yy_get_next_buffer( ) ) 1232178825Sdfr { 1233178825Sdfr case EOB_ACT_LAST_MATCH: 1234178825Sdfr /* This happens because yy_g_n_b() 1235178825Sdfr * sees that we've accumulated a 1236178825Sdfr * token and flags that we need to 1237178825Sdfr * try matching the token before 1238178825Sdfr * proceeding. But for input(), 1239178825Sdfr * there's no matching to consider. 1240178825Sdfr * So convert the EOB_ACT_LAST_MATCH 1241178825Sdfr * to EOB_ACT_END_OF_FILE. 1242178825Sdfr */ 1243178825Sdfr 1244178825Sdfr /* Reset buffer status. */ 1245178825Sdfr yyrestart(yyin ); 1246178825Sdfr 1247178825Sdfr /*FALLTHROUGH*/ 1248178825Sdfr 1249178825Sdfr case EOB_ACT_END_OF_FILE: 1250178825Sdfr { 1251178825Sdfr if ( yywrap( ) ) 1252178825Sdfr return 0; 1253178825Sdfr 1254178825Sdfr if ( ! (yy_did_buffer_switch_on_eof) ) 1255178825Sdfr YY_NEW_FILE; 1256178825Sdfr#ifdef __cplusplus 1257178825Sdfr return yyinput(); 1258178825Sdfr#else 1259178825Sdfr return input(); 1260178825Sdfr#endif 1261178825Sdfr } 1262178825Sdfr 1263178825Sdfr case EOB_ACT_CONTINUE_SCAN: 1264178825Sdfr (yy_c_buf_p) = (yytext_ptr) + offset; 1265178825Sdfr break; 1266178825Sdfr } 1267178825Sdfr } 1268178825Sdfr } 1269178825Sdfr 1270178825Sdfr c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 1271178825Sdfr *(yy_c_buf_p) = '\0'; /* preserve yytext */ 1272178825Sdfr (yy_hold_char) = *++(yy_c_buf_p); 1273178825Sdfr 1274178825Sdfr return c; 1275178825Sdfr} 1276178825Sdfr#endif /* ifndef YY_NO_INPUT */ 1277178825Sdfr 1278178825Sdfr/** Immediately switch to a different input stream. 1279178825Sdfr * @param input_file A readable stream. 1280178825Sdfr * 1281178825Sdfr * @note This function does not reset the start condition to @c INITIAL . 1282178825Sdfr */ 1283178825Sdfr void yyrestart (FILE * input_file ) 1284178825Sdfr{ 1285178825Sdfr 1286178825Sdfr if ( ! YY_CURRENT_BUFFER ){ 1287178825Sdfr yyensure_buffer_stack (); 1288178825Sdfr YY_CURRENT_BUFFER_LVALUE = 1289178825Sdfr yy_create_buffer(yyin,YY_BUF_SIZE ); 1290178825Sdfr } 1291178825Sdfr 1292178825Sdfr yy_init_buffer(YY_CURRENT_BUFFER,input_file ); 1293178825Sdfr yy_load_buffer_state( ); 1294178825Sdfr} 1295178825Sdfr 1296178825Sdfr/** Switch to a different input buffer. 1297178825Sdfr * @param new_buffer The new input buffer. 1298178825Sdfr * 1299178825Sdfr */ 1300178825Sdfr void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 1301178825Sdfr{ 1302178825Sdfr 1303178825Sdfr /* TODO. We should be able to replace this entire function body 1304178825Sdfr * with 1305178825Sdfr * yypop_buffer_state(); 1306178825Sdfr * yypush_buffer_state(new_buffer); 1307178825Sdfr */ 1308178825Sdfr yyensure_buffer_stack (); 1309178825Sdfr if ( YY_CURRENT_BUFFER == new_buffer ) 1310178825Sdfr return; 1311178825Sdfr 1312178825Sdfr if ( YY_CURRENT_BUFFER ) 1313178825Sdfr { 1314178825Sdfr /* Flush out information for old buffer. */ 1315178825Sdfr *(yy_c_buf_p) = (yy_hold_char); 1316178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 1317178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1318178825Sdfr } 1319178825Sdfr 1320178825Sdfr YY_CURRENT_BUFFER_LVALUE = new_buffer; 1321178825Sdfr yy_load_buffer_state( ); 1322178825Sdfr 1323178825Sdfr /* We don't actually know whether we did this switch during 1324178825Sdfr * EOF (yywrap()) processing, but the only time this flag 1325178825Sdfr * is looked at is after yywrap() is called, so it's safe 1326178825Sdfr * to go ahead and always set it. 1327178825Sdfr */ 1328178825Sdfr (yy_did_buffer_switch_on_eof) = 1; 1329178825Sdfr} 1330178825Sdfr 1331178825Sdfrstatic void yy_load_buffer_state (void) 1332178825Sdfr{ 1333178825Sdfr (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1334178825Sdfr (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 1335178825Sdfr yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 1336178825Sdfr (yy_hold_char) = *(yy_c_buf_p); 1337178825Sdfr} 1338178825Sdfr 1339178825Sdfr/** Allocate and initialize an input buffer state. 1340178825Sdfr * @param file A readable stream. 1341178825Sdfr * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 1342178825Sdfr * 1343178825Sdfr * @return the allocated buffer state. 1344178825Sdfr */ 1345178825Sdfr YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 1346178825Sdfr{ 1347178825Sdfr YY_BUFFER_STATE b; 1348178825Sdfr 1349178825Sdfr b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 1350178825Sdfr if ( ! b ) 1351178825Sdfr YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1352178825Sdfr 1353178825Sdfr b->yy_buf_size = size; 1354178825Sdfr 1355178825Sdfr /* yy_ch_buf has to be 2 characters longer than the size given because 1356178825Sdfr * we need to put in 2 end-of-buffer characters. 1357178825Sdfr */ 1358178825Sdfr b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); 1359178825Sdfr if ( ! b->yy_ch_buf ) 1360178825Sdfr YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1361178825Sdfr 1362178825Sdfr b->yy_is_our_buffer = 1; 1363178825Sdfr 1364178825Sdfr yy_init_buffer(b,file ); 1365178825Sdfr 1366178825Sdfr return b; 1367178825Sdfr} 1368178825Sdfr 1369178825Sdfr/** Destroy the buffer. 1370178825Sdfr * @param b a buffer created with yy_create_buffer() 1371178825Sdfr * 1372178825Sdfr */ 1373178825Sdfr void yy_delete_buffer (YY_BUFFER_STATE b ) 1374178825Sdfr{ 1375178825Sdfr 1376178825Sdfr if ( ! b ) 1377178825Sdfr return; 1378178825Sdfr 1379178825Sdfr if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 1380178825Sdfr YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 1381178825Sdfr 1382178825Sdfr if ( b->yy_is_our_buffer ) 1383178825Sdfr yyfree((void *) b->yy_ch_buf ); 1384178825Sdfr 1385178825Sdfr yyfree((void *) b ); 1386178825Sdfr} 1387178825Sdfr 1388178825Sdfr#ifndef __cplusplus 1389178825Sdfrextern int isatty (int ); 1390178825Sdfr#endif /* __cplusplus */ 1391178825Sdfr 1392178825Sdfr/* Initializes or reinitializes a buffer. 1393178825Sdfr * This function is sometimes called more than once on the same buffer, 1394178825Sdfr * such as during a yyrestart() or at EOF. 1395178825Sdfr */ 1396178825Sdfr static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 1397178825Sdfr 1398178825Sdfr{ 1399178825Sdfr int oerrno = errno; 1400178825Sdfr 1401178825Sdfr yy_flush_buffer(b ); 1402178825Sdfr 1403178825Sdfr b->yy_input_file = file; 1404178825Sdfr b->yy_fill_buffer = 1; 1405178825Sdfr 1406178825Sdfr /* If b is the current buffer, then yy_init_buffer was _probably_ 1407178825Sdfr * called from yyrestart() or through yy_get_next_buffer. 1408178825Sdfr * In that case, we don't want to reset the lineno or column. 1409178825Sdfr */ 1410178825Sdfr if (b != YY_CURRENT_BUFFER){ 1411178825Sdfr b->yy_bs_lineno = 1; 1412178825Sdfr b->yy_bs_column = 0; 1413178825Sdfr } 1414178825Sdfr 1415178825Sdfr b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1416178825Sdfr 1417178825Sdfr errno = oerrno; 1418178825Sdfr} 1419178825Sdfr 1420178825Sdfr/** Discard all buffered characters. On the next scan, YY_INPUT will be called. 1421178825Sdfr * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 1422178825Sdfr * 1423178825Sdfr */ 1424178825Sdfr void yy_flush_buffer (YY_BUFFER_STATE b ) 1425178825Sdfr{ 1426178825Sdfr if ( ! b ) 1427178825Sdfr return; 1428178825Sdfr 1429178825Sdfr b->yy_n_chars = 0; 1430178825Sdfr 1431178825Sdfr /* We always need two end-of-buffer characters. The first causes 1432178825Sdfr * a transition to the end-of-buffer state. The second causes 1433178825Sdfr * a jam in that state. 1434178825Sdfr */ 1435178825Sdfr b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 1436178825Sdfr b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 1437178825Sdfr 1438178825Sdfr b->yy_buf_pos = &b->yy_ch_buf[0]; 1439178825Sdfr 1440178825Sdfr b->yy_at_bol = 1; 1441178825Sdfr b->yy_buffer_status = YY_BUFFER_NEW; 1442178825Sdfr 1443178825Sdfr if ( b == YY_CURRENT_BUFFER ) 1444178825Sdfr yy_load_buffer_state( ); 1445178825Sdfr} 1446178825Sdfr 1447178825Sdfr/** Pushes the new state onto the stack. The new state becomes 1448178825Sdfr * the current state. This function will allocate the stack 1449178825Sdfr * if necessary. 1450178825Sdfr * @param new_buffer The new state. 1451178825Sdfr * 1452178825Sdfr */ 1453178825Sdfrvoid yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 1454178825Sdfr{ 1455178825Sdfr if (new_buffer == NULL) 1456178825Sdfr return; 1457178825Sdfr 1458178825Sdfr yyensure_buffer_stack(); 1459178825Sdfr 1460178825Sdfr /* This block is copied from yy_switch_to_buffer. */ 1461178825Sdfr if ( YY_CURRENT_BUFFER ) 1462178825Sdfr { 1463178825Sdfr /* Flush out information for old buffer. */ 1464178825Sdfr *(yy_c_buf_p) = (yy_hold_char); 1465178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 1466178825Sdfr YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1467178825Sdfr } 1468178825Sdfr 1469178825Sdfr /* Only push if top exists. Otherwise, replace top. */ 1470178825Sdfr if (YY_CURRENT_BUFFER) 1471178825Sdfr (yy_buffer_stack_top)++; 1472178825Sdfr YY_CURRENT_BUFFER_LVALUE = new_buffer; 1473178825Sdfr 1474178825Sdfr /* copied from yy_switch_to_buffer. */ 1475178825Sdfr yy_load_buffer_state( ); 1476178825Sdfr (yy_did_buffer_switch_on_eof) = 1; 1477178825Sdfr} 1478178825Sdfr 1479178825Sdfr/** Removes and deletes the top of the stack, if present. 1480178825Sdfr * The next element becomes the new top. 1481178825Sdfr * 1482178825Sdfr */ 1483178825Sdfrvoid yypop_buffer_state (void) 1484178825Sdfr{ 1485178825Sdfr if (!YY_CURRENT_BUFFER) 1486178825Sdfr return; 1487178825Sdfr 1488178825Sdfr yy_delete_buffer(YY_CURRENT_BUFFER ); 1489178825Sdfr YY_CURRENT_BUFFER_LVALUE = NULL; 1490178825Sdfr if ((yy_buffer_stack_top) > 0) 1491178825Sdfr --(yy_buffer_stack_top); 1492178825Sdfr 1493178825Sdfr if (YY_CURRENT_BUFFER) { 1494178825Sdfr yy_load_buffer_state( ); 1495178825Sdfr (yy_did_buffer_switch_on_eof) = 1; 1496178825Sdfr } 1497178825Sdfr} 1498178825Sdfr 1499178825Sdfr/* Allocates the stack if it does not exist. 1500178825Sdfr * Guarantees space for at least one push. 1501178825Sdfr */ 1502178825Sdfrstatic void yyensure_buffer_stack (void) 1503178825Sdfr{ 1504233294Sstas yy_size_t num_to_alloc; 1505178825Sdfr 1506178825Sdfr if (!(yy_buffer_stack)) { 1507178825Sdfr 1508178825Sdfr /* First allocation is just for 2 elements, since we don't know if this 1509178825Sdfr * scanner will even need a stack. We use 2 instead of 1 to avoid an 1510178825Sdfr * immediate realloc on the next call. 1511178825Sdfr */ 1512178825Sdfr num_to_alloc = 1; 1513178825Sdfr (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 1514178825Sdfr (num_to_alloc * sizeof(struct yy_buffer_state*) 1515178825Sdfr ); 1516233294Sstas if ( ! (yy_buffer_stack) ) 1517233294Sstas YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 1518233294Sstas 1519178825Sdfr memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 1520178825Sdfr 1521178825Sdfr (yy_buffer_stack_max) = num_to_alloc; 1522178825Sdfr (yy_buffer_stack_top) = 0; 1523178825Sdfr return; 1524178825Sdfr } 1525178825Sdfr 1526178825Sdfr if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 1527178825Sdfr 1528178825Sdfr /* Increase the buffer to prepare for a possible push. */ 1529178825Sdfr int grow_size = 8 /* arbitrary grow size */; 1530178825Sdfr 1531178825Sdfr num_to_alloc = (yy_buffer_stack_max) + grow_size; 1532178825Sdfr (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 1533178825Sdfr ((yy_buffer_stack), 1534178825Sdfr num_to_alloc * sizeof(struct yy_buffer_state*) 1535178825Sdfr ); 1536233294Sstas if ( ! (yy_buffer_stack) ) 1537233294Sstas YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 1538178825Sdfr 1539178825Sdfr /* zero only the new slots.*/ 1540178825Sdfr memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 1541178825Sdfr (yy_buffer_stack_max) = num_to_alloc; 1542178825Sdfr } 1543178825Sdfr} 1544178825Sdfr 1545178825Sdfr/** Setup the input buffer state to scan directly from a user-specified character buffer. 1546178825Sdfr * @param base the character buffer 1547178825Sdfr * @param size the size in bytes of the character buffer 1548178825Sdfr * 1549178825Sdfr * @return the newly allocated buffer state object. 1550178825Sdfr */ 1551178825SdfrYY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 1552178825Sdfr{ 1553178825Sdfr YY_BUFFER_STATE b; 1554178825Sdfr 1555178825Sdfr if ( size < 2 || 1556178825Sdfr base[size-2] != YY_END_OF_BUFFER_CHAR || 1557178825Sdfr base[size-1] != YY_END_OF_BUFFER_CHAR ) 1558178825Sdfr /* They forgot to leave room for the EOB's. */ 1559178825Sdfr return 0; 1560178825Sdfr 1561178825Sdfr b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 1562178825Sdfr if ( ! b ) 1563178825Sdfr YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 1564178825Sdfr 1565178825Sdfr b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 1566178825Sdfr b->yy_buf_pos = b->yy_ch_buf = base; 1567178825Sdfr b->yy_is_our_buffer = 0; 1568178825Sdfr b->yy_input_file = 0; 1569178825Sdfr b->yy_n_chars = b->yy_buf_size; 1570178825Sdfr b->yy_is_interactive = 0; 1571178825Sdfr b->yy_at_bol = 1; 1572178825Sdfr b->yy_fill_buffer = 0; 1573178825Sdfr b->yy_buffer_status = YY_BUFFER_NEW; 1574178825Sdfr 1575178825Sdfr yy_switch_to_buffer(b ); 1576178825Sdfr 1577178825Sdfr return b; 1578178825Sdfr} 1579178825Sdfr 1580178825Sdfr/** Setup the input buffer state to scan a string. The next call to yylex() will 1581178825Sdfr * scan from a @e copy of @a str. 1582233294Sstas * @param yystr a NUL-terminated string to scan 1583178825Sdfr * 1584178825Sdfr * @return the newly allocated buffer state object. 1585178825Sdfr * @note If you want to scan bytes that may contain NUL values, then use 1586178825Sdfr * yy_scan_bytes() instead. 1587178825Sdfr */ 1588178825SdfrYY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) 1589178825Sdfr{ 1590178825Sdfr 1591178825Sdfr return yy_scan_bytes(yystr,strlen(yystr) ); 1592178825Sdfr} 1593178825Sdfr 1594178825Sdfr/** Setup the input buffer state to scan the given bytes. The next call to yylex() will 1595178825Sdfr * scan from a @e copy of @a bytes. 1596178825Sdfr * @param bytes the byte buffer to scan 1597178825Sdfr * @param len the number of bytes in the buffer pointed to by @a bytes. 1598178825Sdfr * 1599178825Sdfr * @return the newly allocated buffer state object. 1600178825Sdfr */ 1601233294SstasYY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) 1602178825Sdfr{ 1603178825Sdfr YY_BUFFER_STATE b; 1604178825Sdfr char *buf; 1605233294Sstas yy_size_t n, i; 1606178825Sdfr 1607178825Sdfr /* Get memory for full buffer, including space for trailing EOB's. */ 1608178825Sdfr n = _yybytes_len + 2; 1609178825Sdfr buf = (char *) yyalloc(n ); 1610178825Sdfr if ( ! buf ) 1611178825Sdfr YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 1612178825Sdfr 1613178825Sdfr for ( i = 0; i < _yybytes_len; ++i ) 1614178825Sdfr buf[i] = yybytes[i]; 1615178825Sdfr 1616178825Sdfr buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 1617178825Sdfr 1618178825Sdfr b = yy_scan_buffer(buf,n ); 1619178825Sdfr if ( ! b ) 1620178825Sdfr YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 1621178825Sdfr 1622178825Sdfr /* It's okay to grow etc. this buffer, and we should throw it 1623178825Sdfr * away when we're done. 1624178825Sdfr */ 1625178825Sdfr b->yy_is_our_buffer = 1; 1626178825Sdfr 1627178825Sdfr return b; 1628178825Sdfr} 1629178825Sdfr 1630178825Sdfr#ifndef YY_EXIT_FAILURE 1631178825Sdfr#define YY_EXIT_FAILURE 2 1632178825Sdfr#endif 1633178825Sdfr 1634178825Sdfrstatic void yy_fatal_error (yyconst char* msg ) 1635178825Sdfr{ 1636178825Sdfr (void) fprintf( stderr, "%s\n", msg ); 1637178825Sdfr exit( YY_EXIT_FAILURE ); 1638178825Sdfr} 1639178825Sdfr 1640178825Sdfr/* Redefine yyless() so it works in section 3 code. */ 1641178825Sdfr 1642178825Sdfr#undef yyless 1643178825Sdfr#define yyless(n) \ 1644178825Sdfr do \ 1645178825Sdfr { \ 1646178825Sdfr /* Undo effects of setting up yytext. */ \ 1647178825Sdfr int yyless_macro_arg = (n); \ 1648178825Sdfr YY_LESS_LINENO(yyless_macro_arg);\ 1649178825Sdfr yytext[yyleng] = (yy_hold_char); \ 1650178825Sdfr (yy_c_buf_p) = yytext + yyless_macro_arg; \ 1651178825Sdfr (yy_hold_char) = *(yy_c_buf_p); \ 1652178825Sdfr *(yy_c_buf_p) = '\0'; \ 1653178825Sdfr yyleng = yyless_macro_arg; \ 1654178825Sdfr } \ 1655178825Sdfr while ( 0 ) 1656178825Sdfr 1657178825Sdfr/* Accessor methods (get/set functions) to struct members. */ 1658178825Sdfr 1659178825Sdfr/** Get the current line number. 1660178825Sdfr * 1661178825Sdfr */ 1662178825Sdfrint yyget_lineno (void) 1663178825Sdfr{ 1664178825Sdfr 1665178825Sdfr return yylineno; 1666178825Sdfr} 1667178825Sdfr 1668178825Sdfr/** Get the input stream. 1669178825Sdfr * 1670178825Sdfr */ 1671178825SdfrFILE *yyget_in (void) 1672178825Sdfr{ 1673178825Sdfr return yyin; 1674178825Sdfr} 1675178825Sdfr 1676178825Sdfr/** Get the output stream. 1677178825Sdfr * 1678178825Sdfr */ 1679178825SdfrFILE *yyget_out (void) 1680178825Sdfr{ 1681178825Sdfr return yyout; 1682178825Sdfr} 1683178825Sdfr 1684178825Sdfr/** Get the length of the current token. 1685178825Sdfr * 1686178825Sdfr */ 1687233294Sstasyy_size_t yyget_leng (void) 1688178825Sdfr{ 1689178825Sdfr return yyleng; 1690178825Sdfr} 1691178825Sdfr 1692178825Sdfr/** Get the current token. 1693178825Sdfr * 1694178825Sdfr */ 1695178825Sdfr 1696178825Sdfrchar *yyget_text (void) 1697178825Sdfr{ 1698178825Sdfr return yytext; 1699178825Sdfr} 1700178825Sdfr 1701178825Sdfr/** Set the current line number. 1702178825Sdfr * @param line_number 1703178825Sdfr * 1704178825Sdfr */ 1705178825Sdfrvoid yyset_lineno (int line_number ) 1706178825Sdfr{ 1707178825Sdfr 1708178825Sdfr yylineno = line_number; 1709178825Sdfr} 1710178825Sdfr 1711178825Sdfr/** Set the input stream. This does not discard the current 1712178825Sdfr * input buffer. 1713178825Sdfr * @param in_str A readable stream. 1714178825Sdfr * 1715178825Sdfr * @see yy_switch_to_buffer 1716178825Sdfr */ 1717178825Sdfrvoid yyset_in (FILE * in_str ) 1718178825Sdfr{ 1719178825Sdfr yyin = in_str ; 1720178825Sdfr} 1721178825Sdfr 1722178825Sdfrvoid yyset_out (FILE * out_str ) 1723178825Sdfr{ 1724178825Sdfr yyout = out_str ; 1725178825Sdfr} 1726178825Sdfr 1727178825Sdfrint yyget_debug (void) 1728178825Sdfr{ 1729178825Sdfr return yy_flex_debug; 1730178825Sdfr} 1731178825Sdfr 1732178825Sdfrvoid yyset_debug (int bdebug ) 1733178825Sdfr{ 1734178825Sdfr yy_flex_debug = bdebug ; 1735178825Sdfr} 1736178825Sdfr 1737178825Sdfrstatic int yy_init_globals (void) 1738178825Sdfr{ 1739178825Sdfr /* Initialization is the same as for the non-reentrant scanner. 1740178825Sdfr * This function is called from yylex_destroy(), so don't allocate here. 1741178825Sdfr */ 1742178825Sdfr 1743178825Sdfr (yy_buffer_stack) = 0; 1744178825Sdfr (yy_buffer_stack_top) = 0; 1745178825Sdfr (yy_buffer_stack_max) = 0; 1746178825Sdfr (yy_c_buf_p) = (char *) 0; 1747178825Sdfr (yy_init) = 0; 1748178825Sdfr (yy_start) = 0; 1749178825Sdfr 1750178825Sdfr/* Defined in main.c */ 1751178825Sdfr#ifdef YY_STDINIT 1752178825Sdfr yyin = stdin; 1753178825Sdfr yyout = stdout; 1754178825Sdfr#else 1755178825Sdfr yyin = (FILE *) 0; 1756178825Sdfr yyout = (FILE *) 0; 1757178825Sdfr#endif 1758178825Sdfr 1759178825Sdfr /* For future reference: Set errno on error, since we are called by 1760178825Sdfr * yylex_init() 1761178825Sdfr */ 1762178825Sdfr return 0; 1763178825Sdfr} 1764178825Sdfr 1765178825Sdfr/* yylex_destroy is for both reentrant and non-reentrant scanners. */ 1766178825Sdfrint yylex_destroy (void) 1767178825Sdfr{ 1768178825Sdfr 1769178825Sdfr /* Pop the buffer stack, destroying each element. */ 1770178825Sdfr while(YY_CURRENT_BUFFER){ 1771178825Sdfr yy_delete_buffer(YY_CURRENT_BUFFER ); 1772178825Sdfr YY_CURRENT_BUFFER_LVALUE = NULL; 1773178825Sdfr yypop_buffer_state(); 1774178825Sdfr } 1775178825Sdfr 1776178825Sdfr /* Destroy the stack itself. */ 1777178825Sdfr yyfree((yy_buffer_stack) ); 1778178825Sdfr (yy_buffer_stack) = NULL; 1779178825Sdfr 1780178825Sdfr /* Reset the globals. This is important in a non-reentrant scanner so the next time 1781178825Sdfr * yylex() is called, initialization will occur. */ 1782178825Sdfr yy_init_globals( ); 1783178825Sdfr 1784178825Sdfr return 0; 1785178825Sdfr} 1786178825Sdfr 1787178825Sdfr/* 1788178825Sdfr * Internal utility routines. 1789178825Sdfr */ 1790178825Sdfr 1791178825Sdfr#ifndef yytext_ptr 1792178825Sdfrstatic void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 1793178825Sdfr{ 1794178825Sdfr register int i; 1795178825Sdfr for ( i = 0; i < n; ++i ) 1796178825Sdfr s1[i] = s2[i]; 1797178825Sdfr} 1798178825Sdfr#endif 1799178825Sdfr 1800178825Sdfr#ifdef YY_NEED_STRLEN 1801178825Sdfrstatic int yy_flex_strlen (yyconst char * s ) 1802178825Sdfr{ 1803178825Sdfr register int n; 1804178825Sdfr for ( n = 0; s[n]; ++n ) 1805178825Sdfr ; 1806178825Sdfr 1807178825Sdfr return n; 1808178825Sdfr} 1809178825Sdfr#endif 1810178825Sdfr 1811178825Sdfrvoid *yyalloc (yy_size_t size ) 1812178825Sdfr{ 1813178825Sdfr return (void *) malloc( size ); 1814178825Sdfr} 1815178825Sdfr 1816178825Sdfrvoid *yyrealloc (void * ptr, yy_size_t size ) 1817178825Sdfr{ 1818178825Sdfr /* The cast to (char *) in the following accommodates both 1819178825Sdfr * implementations that use char* generic pointers, and those 1820178825Sdfr * that use void* generic pointers. It works with the latter 1821178825Sdfr * because both ANSI C and C++ allow castless assignment from 1822178825Sdfr * any pointer type to void*, and deal with argument conversions 1823178825Sdfr * as though doing an assignment. 1824178825Sdfr */ 1825178825Sdfr return (void *) realloc( (char *) ptr, size ); 1826178825Sdfr} 1827178825Sdfr 1828178825Sdfrvoid yyfree (void * ptr ) 1829178825Sdfr{ 1830178825Sdfr free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 1831178825Sdfr} 1832178825Sdfr 1833178825Sdfr#define YYTABLES_NAME "yytables" 1834178825Sdfr 1835233294Sstas#line 74 "lex.l" 1836178825Sdfr 1837178825Sdfr 1838178825Sdfr 1839178825Sdfr#ifndef yywrap /* XXX */ 1840178825Sdfrint 1841233294Sstasyywrap () 1842178825Sdfr{ 1843178825Sdfr return 1; 1844178825Sdfr} 1845178825Sdfr#endif 1846178825Sdfr 1847178825Sdfrstatic int 1848178825Sdfrgetstring(void) 1849178825Sdfr{ 1850178825Sdfr char x[128]; 1851178825Sdfr int i = 0; 1852178825Sdfr int c; 1853178825Sdfr int quote = 0; 1854178825Sdfr while(i < sizeof(x) - 1 && (c = input()) != EOF){ 1855178825Sdfr if(quote) { 1856178825Sdfr x[i++] = c; 1857178825Sdfr quote = 0; 1858178825Sdfr continue; 1859178825Sdfr } 1860178825Sdfr if(c == '\n'){ 1861233294Sstas _lex_error_message("unterminated string"); 1862178825Sdfr lineno++; 1863178825Sdfr break; 1864178825Sdfr } 1865178825Sdfr if(c == '\\'){ 1866178825Sdfr quote++; 1867178825Sdfr continue; 1868178825Sdfr } 1869178825Sdfr if(c == '\"') 1870178825Sdfr break; 1871178825Sdfr x[i++] = c; 1872178825Sdfr } 1873178825Sdfr x[i] = '\0'; 1874178825Sdfr yylval.string = strdup(x); 1875178825Sdfr if (yylval.string == NULL) 1876178825Sdfr err(1, "malloc"); 1877178825Sdfr return STRING; 1878178825Sdfr} 1879178825Sdfr 1880178825Sdfrvoid 1881233294Sstas_lex_error_message (const char *format, ...) 1882178825Sdfr{ 1883178825Sdfr va_list args; 1884178825Sdfr 1885178825Sdfr va_start (args, format); 1886178825Sdfr fprintf (stderr, "%s:%d:", filename, lineno); 1887178825Sdfr vfprintf (stderr, format, args); 1888178825Sdfr va_end (args); 1889178825Sdfr numerror++; 1890178825Sdfr} 1891178825Sdfr 1892