/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define elpYY_FLEX_MAJOR_VERSION 2 #define elpYY_FLEX_MINOR_VERSION 5 #include #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include /* Use prototypes in function declarations. */ #define elpYY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define elpYY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define elpYY_USE_PROTOS #define elpYY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define elpYY_USE_CONST #define elpYY_USE_PROTOS #endif #ifdef elpYY_USE_CONST #define elpyyconst const #else #define elpyyconst #endif #ifdef elpYY_USE_PROTOS #define elpYY_PROTO(proto) proto #else #define elpYY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define elpYY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define elpYY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN elpyy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The elpYYSTATE alias is for lex * compatibility. */ #define elpYY_START ((elpyy_start - 1) / 2) #define elpYYSTATE elpYY_START /* Action number for EOF rule of a given start state. */ #define elpYY_STATE_EOF(state) (elpYY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define elpYY_NEW_FILE elpyyrestart( elpyyin ) #define elpYY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define elpYY_BUF_SIZE 16384 typedef struct elpyy_buffer_state *elpYY_BUFFER_STATE; extern int elpyyleng; extern FILE *elpyyin, *elpyyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * elpyyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the elpyyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define elpyyless(n) \ do \ { \ /* Undo effects of setting up elpyytext. */ \ *elpyy_cp = elpyy_hold_char; \ elpYY_RESTORE_elpYY_MORE_OFFSET \ elpyy_c_buf_p = elpyy_cp = elpyy_bp + n - elpYY_MORE_ADJ; \ elpYY_DO_BEFORE_ACTION; /* set up elpyytext again */ \ } \ while ( 0 ) #define unput(c) elpyyunput( c, elpyytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int elpyy_size_t; struct elpyy_buffer_state { FILE *elpyy_input_file; char *elpyy_ch_buf; /* input buffer */ char *elpyy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ elpyy_size_t elpyy_buf_size; /* Number of characters read into elpyy_ch_buf, not including EOB * characters. */ int elpyy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int elpyy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int elpyy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int elpyy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int elpyy_fill_buffer; int elpyy_buffer_status; #define elpYY_BUFFER_NEW 0 #define elpYY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as elpYY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via elpyyrestart()), so that the user can continue scanning by * just pointing elpyyin at a new input file. */ #define elpYY_BUFFER_EOF_PENDING 2 }; static elpYY_BUFFER_STATE elpyy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define elpYY_CURRENT_BUFFER elpyy_current_buffer /* elpyy_hold_char holds the character lost when elpyytext is formed. */ static char elpyy_hold_char; static int elpyy_n_chars; /* number of characters read into elpyy_ch_buf */ int elpyyleng; /* Points to current character in buffer. */ static char *elpyy_c_buf_p = (char *) 0; static int elpyy_init = 1; /* whether we need to initialize */ static int elpyy_start = 0; /* start state number */ /* Flag which is used to allow elpyywrap()'s to do buffer switches * instead of setting up a fresh elpyyin. A bit of a hack ... */ static int elpyy_did_buffer_switch_on_eof; void elpyyrestart elpYY_PROTO(( FILE *input_file )); void elpyy_switch_to_buffer elpYY_PROTO(( elpYY_BUFFER_STATE new_buffer )); void elpyy_load_buffer_state elpYY_PROTO(( void )); elpYY_BUFFER_STATE elpyy_create_buffer elpYY_PROTO(( FILE *file, int size )); void elpyy_delete_buffer elpYY_PROTO(( elpYY_BUFFER_STATE b )); void elpyy_init_buffer elpYY_PROTO(( elpYY_BUFFER_STATE b, FILE *file )); void elpyy_flush_buffer elpYY_PROTO(( elpYY_BUFFER_STATE b )); #define elpYY_FLUSH_BUFFER elpyy_flush_buffer( elpyy_current_buffer ) elpYY_BUFFER_STATE elpyy_scan_buffer elpYY_PROTO(( char *base, elpyy_size_t size )); elpYY_BUFFER_STATE elpyy_scan_string elpYY_PROTO(( elpyyconst char *elpyy_str )); elpYY_BUFFER_STATE elpyy_scan_bytes elpYY_PROTO(( elpyyconst char *bytes, int len )); static void *elpyy_flex_alloc elpYY_PROTO(( elpyy_size_t )); static void *elpyy_flex_realloc elpYY_PROTO(( void *, elpyy_size_t )); static void elpyy_flex_free elpYY_PROTO(( void * )); #define elpyy_new_buffer elpyy_create_buffer #define elpyy_set_interactive(is_interactive) \ { \ if ( ! elpyy_current_buffer ) \ elpyy_current_buffer = elpyy_create_buffer( elpyyin, elpYY_BUF_SIZE ); \ elpyy_current_buffer->elpyy_is_interactive = is_interactive; \ } #define elpyy_set_bol(at_bol) \ { \ if ( ! elpyy_current_buffer ) \ elpyy_current_buffer = elpyy_create_buffer( elpyyin, elpYY_BUF_SIZE ); \ elpyy_current_buffer->elpyy_at_bol = at_bol; \ } #define elpYY_AT_BOL() (elpyy_current_buffer->elpyy_at_bol) typedef unsigned char elpYY_CHAR; FILE *elpyyin = (FILE *) 0, *elpyyout = (FILE *) 0; typedef int elpyy_state_type; extern char *elpyytext; #define elpyytext_ptr elpyytext static elpyy_state_type elpyy_get_previous_state elpYY_PROTO(( void )); static elpyy_state_type elpyy_try_NUL_trans elpYY_PROTO(( elpyy_state_type current_state )); static int elpyy_get_next_buffer elpYY_PROTO(( void )); static void elpyy_fatal_error elpYY_PROTO(( elpyyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up elpyytext. */ #define elpYY_DO_BEFORE_ACTION \ elpyytext_ptr = elpyy_bp; \ elpyyleng = (int) (elpyy_cp - elpyy_bp); \ elpyy_hold_char = *elpyy_cp; \ *elpyy_cp = '\0'; \ elpyy_c_buf_p = elpyy_cp; #define elpYY_NUM_RULES 56 #define elpYY_END_OF_BUFFER 57 static elpyyconst short int elpyy_accept[158] = { 0, 0, 0, 57, 56, 2, 55, 54, 56, 3, 55, 55, 55, 55, 54, 55, 55, 55, 55, 55, 55, 55, 54, 55, 55, 56, 2, 55, 54, 0, 55, 17, 21, 18, 22, 55, 55, 55, 55, 55, 54, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 0, 1, 0, 0, 51, 55, 55, 55, 55, 55, 55, 55, 55, 55, 14, 12, 8, 10, 15, 13, 9, 11, 55, 55, 55, 55, 19, 23, 55, 55, 55, 55, 55, 55, 16, 20, 55, 55, 0, 0, 33, 36, 32, 35, 34, 37, 46, 44, 29, 31, 47, 45, 28, 30, 39, 42, 38, 41, 40, 43, 48, 55, 6, 55, 55, 52, 55, 55, 55, 55, 27, 55, 7, 0, 0, 50, 49, 53, 55, 55, 55, 55, 55, 0, 0, 55, 25, 24, 26, 55, 0, 5, 55, 5, 0, 55, 0, 55, 0, 55, 4, 4, 0 } ; static elpyyconst int elpyy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 1, 5, 4, 4, 4, 1, 6, 6, 1, 7, 8, 7, 7, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 10, 1, 9, 1, 4, 1, 11, 12, 13, 14, 15, 4, 16, 17, 18, 4, 4, 19, 20, 21, 22, 23, 4, 24, 25, 26, 4, 27, 28, 4, 4, 4, 1, 1, 1, 1, 4, 1, 29, 4, 30, 31, 32, 4, 33, 34, 35, 4, 4, 36, 37, 38, 39, 4, 4, 40, 41, 42, 4, 43, 4, 44, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static elpyyconst int elpyy_meta[45] = { 0, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static elpyyconst short int elpyy_base[160] = { 0, 0, 194, 198, 200, 43, 0, 40, 165, 200, 35, 28, 36, 35, 50, 44, 174, 39, 176, 51, 53, 174, 61, 161, 160, 188, 67, 0, 66, 44, 170, 0, 0, 0, 0, 63, 76, 64, 81, 91, 93, 171, 161, 168, 172, 159, 158, 161, 162, 151, 166, 154, 86, 138, 158, 173, 200, 141, 133, 0, 90, 94, 95, 105, 100, 112, 101, 107, 108, 0, 0, 0, 0, 0, 0, 0, 0, 153, 157, 145, 155, 0, 0, 146, 145, 133, 101, 135, 141, 0, 0, 123, 137, 124, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, 0, 140, 143, 0, 119, 124, 126, 122, 0, 118, 0, 113, 112, 0, 0, 0, 111, 116, 104, 114, 107, 109, 106, 107, 0, 0, 0, 104, 102, 200, 98, 0, 103, 101, 75, 62, 62, 48, 200, 0, 200, 70, 138 } ; static elpyyconst short int elpyy_def[160] = { 0, 157, 1, 157, 157, 157, 158, 157, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 159, 157, 158, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 159, 157, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 157, 157, 158, 158, 158, 158, 158, 157, 157, 158, 158, 157, 158, 157, 158, 157, 158, 157, 158, 0, 157, 157 } ; static elpyyconst short int elpyy_nxt[245] = { 0, 4, 5, 5, 6, 4, 4, 7, 8, 9, 5, 10, 11, 12, 13, 14, 6, 6, 6, 15, 16, 6, 6, 6, 17, 18, 19, 20, 21, 6, 6, 6, 22, 6, 6, 6, 6, 6, 6, 6, 6, 6, 23, 24, 6, 26, 26, 28, 30, 33, 35, 34, 36, 26, 38, 28, 31, 40, 32, 42, 45, 37, 46, 39, 43, 40, 48, 50, 40, 26, 26, 27, 28, 28, 57, 41, 40, 26, 51, 52, 156, 28, 40, 49, 58, 53, 60, 66, 61, 67, 63, 62, 68, 40, 155, 69, 70, 154, 28, 64, 40, 65, 71, 88, 72, 73, 74, 89, 40, 90, 153, 95, 75, 96, 76, 97, 99, 98, 100, 101, 102, 103, 109, 104, 110, 40, 105, 106, 111, 113, 112, 114, 122, 107, 152, 108, 151, 150, 123, 55, 55, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 121, 120, 119, 118, 117, 116, 115, 94, 93, 56, 92, 91, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 59, 56, 53, 49, 54, 47, 44, 29, 157, 25, 3, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157 } ; static elpyyconst short int elpyy_chk[245] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 7, 10, 11, 12, 11, 12, 5, 13, 7, 10, 14, 10, 15, 17, 12, 17, 13, 15, 14, 19, 20, 22, 26, 26, 158, 7, 28, 29, 14, 22, 26, 20, 20, 154, 28, 14, 19, 29, 20, 35, 37, 35, 37, 36, 35, 37, 22, 153, 38, 38, 152, 28, 36, 40, 36, 38, 52, 38, 39, 39, 52, 40, 52, 151, 60, 39, 60, 39, 61, 62, 61, 62, 63, 63, 64, 66, 64, 66, 40, 65, 65, 67, 68, 67, 68, 86, 65, 150, 65, 149, 147, 86, 159, 159, 145, 144, 140, 139, 138, 137, 136, 135, 134, 133, 129, 128, 126, 124, 123, 122, 121, 119, 118, 116, 94, 93, 92, 91, 88, 87, 85, 84, 83, 80, 79, 78, 77, 58, 57, 55, 54, 53, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 30, 25, 24, 23, 21, 18, 16, 8, 3, 2, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157 } ; static elpyy_state_type elpyy_last_accepting_state; static char *elpyy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define elpyymore() elpyymore_used_but_not_detected #define elpYY_MORE_ADJ 0 #define elpYY_RESTORE_elpYY_MORE_OFFSET char *elpyytext; #line 1 "../../../src/elp/src/elp_l.l" #define INITIAL 0 #line 2 "../../../src/elp/src/elp_l.l" #include #include "elp_y.h" #undef ECHO #define ECHO extern double atof() ; /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef elpYY_SKIP_elpYYWRAP #ifdef __cplusplus extern "C" int elpyywrap elpYY_PROTO(( void )); #else extern int elpyywrap elpYY_PROTO(( void )); #endif #endif #ifndef elpYY_NO_UNPUT static void elpyyunput elpYY_PROTO(( int c, char *buf_ptr )); #endif #ifndef elpyytext_ptr static void elpyy_flex_strncpy elpYY_PROTO(( char *, elpyyconst char *, int )); #endif #ifdef elpYY_NEED_STRLEN static int elpyy_flex_strlen elpYY_PROTO(( elpyyconst char * )); #endif #ifndef elpYY_NO_INPUT #ifdef __cplusplus static int elpyyinput elpYY_PROTO(( void )); #else static int input elpYY_PROTO(( void )); #endif #endif #if elpYY_STACK_USED static int elpyy_start_stack_ptr = 0; static int elpyy_start_stack_depth = 0; static int *elpyy_start_stack = 0; #ifndef elpYY_NO_PUSH_STATE static void elpyy_push_state elpYY_PROTO(( int new_state )); #endif #ifndef elpYY_NO_POP_STATE static void elpyy_pop_state elpYY_PROTO(( void )); #endif #ifndef elpYY_NO_TOP_STATE static int elpyy_top_state elpYY_PROTO(( void )); #endif #else #define elpYY_NO_PUSH_STATE 1 #define elpYY_NO_POP_STATE 1 #define elpYY_NO_TOP_STATE 1 #endif #ifdef elpYY_MALLOC_DECL elpYY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef elpYY_READ_BUF_SIZE #define elpYY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( elpyytext, elpyyleng, 1, elpyyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or elpYY_NULL, * is returned in "result". */ #ifndef elpYY_INPUT #define elpYY_INPUT(buf,result,max_size) \ if ( elpyy_current_buffer->elpyy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( elpyyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( elpyyin ) ) \ elpYY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, elpyyin )) == 0) \ && ferror( elpyyin ) ) \ elpYY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "elpyyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef elpyyterminate #define elpyyterminate() return elpYY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef elpYY_START_STACK_INCR #define elpYY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef elpYY_FATAL_ERROR #define elpYY_FATAL_ERROR(msg) elpyy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef elpYY_DECL #define elpYY_DECL int elpyylex elpYY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after elpyytext and elpyyleng * have been set up. */ #ifndef elpYY_USER_ACTION #define elpYY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef elpYY_BREAK #define elpYY_BREAK break; #endif #define elpYY_RULE_SETUP \ if ( elpyyleng > 0 ) \ elpyy_current_buffer->elpyy_at_bol = \ (elpyytext[elpyyleng - 1] == '\n'); \ elpYY_USER_ACTION elpYY_DECL { register elpyy_state_type elpyy_current_state; register char *elpyy_cp = NULL, *elpyy_bp = NULL; register int elpyy_act; #line 12 "../../../src/elp/src/elp_l.l" if ( elpyy_init ) { elpyy_init = 0; #ifdef elpYY_USER_INIT elpYY_USER_INIT; #endif if ( ! elpyy_start ) elpyy_start = 1; /* first start state */ if ( ! elpyyin ) elpyyin = stdin; if ( ! elpyyout ) elpyyout = stdout; if ( ! elpyy_current_buffer ) elpyy_current_buffer = elpyy_create_buffer( elpyyin, elpYY_BUF_SIZE ); elpyy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { elpyy_cp = elpyy_c_buf_p; /* Support of elpyytext. */ *elpyy_cp = elpyy_hold_char; /* elpyy_bp points to the position in elpyy_ch_buf of the start of * the current run. */ elpyy_bp = elpyy_cp; elpyy_current_state = elpyy_start; elpyy_current_state += elpYY_AT_BOL(); elpyy_match: do { register elpYY_CHAR elpyy_c = elpyy_ec[elpYY_SC_TO_UI(*elpyy_cp)]; if ( elpyy_accept[elpyy_current_state] ) { elpyy_last_accepting_state = elpyy_current_state; elpyy_last_accepting_cpos = elpyy_cp; } while ( elpyy_chk[elpyy_base[elpyy_current_state] + elpyy_c] != elpyy_current_state ) { elpyy_current_state = (int) elpyy_def[elpyy_current_state]; if ( elpyy_current_state >= 158 ) elpyy_c = elpyy_meta[(unsigned int) elpyy_c]; } elpyy_current_state = elpyy_nxt[elpyy_base[elpyy_current_state] + (unsigned int) elpyy_c]; ++elpyy_cp; } while ( elpyy_base[elpyy_current_state] != 200 ); elpyy_find_action: elpyy_act = elpyy_accept[elpyy_current_state]; if ( elpyy_act == 0 ) { /* have to back up */ elpyy_cp = elpyy_last_accepting_cpos; elpyy_current_state = elpyy_last_accepting_state; elpyy_act = elpyy_accept[elpyy_current_state]; } elpYY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( elpyy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of elpYY_DO_BEFORE_ACTION */ *elpyy_cp = elpyy_hold_char; elpyy_cp = elpyy_last_accepting_cpos; elpyy_current_state = elpyy_last_accepting_state; goto elpyy_find_action; case 1: *elpyy_cp = elpyy_hold_char; /* undo effects of setting up elpyytext */ elpyy_c_buf_p = elpyy_cp -= 1; elpYY_DO_BEFORE_ACTION; /* set up elpyytext again */ elpYY_RULE_SETUP #line 13 "../../../src/elp/src/elp_l.l" {ECHO ; } elpYY_BREAK case 2: elpYY_RULE_SETUP #line 14 "../../../src/elp/src/elp_l.l" {ECHO ; } elpYY_BREAK case 3: elpYY_RULE_SETUP #line 15 "../../../src/elp/src/elp_l.l" {ECHO ; return *elpyytext ;} elpYY_BREAK case 4: elpYY_RULE_SETUP #line 16 "../../../src/elp/src/elp_l.l" {ECHO ; return telpTECNAME ;} elpYY_BREAK case 5: elpYY_RULE_SETUP #line 17 "../../../src/elp/src/elp_l.l" {ECHO ; return telpTECVER ;} elpYY_BREAK case 6: elpYY_RULE_SETUP #line 18 "../../../src/elp/src/elp_l.l" {ECHO ; return telpLMLT ;} elpYY_BREAK case 7: elpYY_RULE_SETUP #line 19 "../../../src/elp/src/elp_l.l" {ECHO ; return telpWMLT ;} elpYY_BREAK case 8: elpYY_RULE_SETUP #line 20 "../../../src/elp/src/elp_l.l" {ECHO ; return telpDLN ;} elpYY_BREAK case 9: elpYY_RULE_SETUP #line 21 "../../../src/elp/src/elp_l.l" {ECHO ; return telpDWN ;} elpYY_BREAK case 10: elpYY_RULE_SETUP #line 22 "../../../src/elp/src/elp_l.l" {ECHO ; return telpDLP ;} elpYY_BREAK case 11: elpYY_RULE_SETUP #line 23 "../../../src/elp/src/elp_l.l" {ECHO ; return telpDWP ;} elpYY_BREAK case 12: elpYY_RULE_SETUP #line 24 "../../../src/elp/src/elp_l.l" {ECHO ; return telpDLE ;} elpYY_BREAK case 13: elpYY_RULE_SETUP #line 25 "../../../src/elp/src/elp_l.l" {ECHO ; return telpDWE ;} elpYY_BREAK case 14: elpYY_RULE_SETUP #line 26 "../../../src/elp/src/elp_l.l" {ECHO ; return telpDLD ;} elpYY_BREAK case 15: elpYY_RULE_SETUP #line 27 "../../../src/elp/src/elp_l.l" {ECHO ; return telpDWD ;} elpYY_BREAK case 16: elpYY_RULE_SETUP #line 28 "../../../src/elp/src/elp_l.l" {ECHO ; return telpVTN ;} elpYY_BREAK case 17: elpYY_RULE_SETUP #line 29 "../../../src/elp/src/elp_l.l" {ECHO ; return telpAN ;} elpYY_BREAK case 18: elpYY_RULE_SETUP #line 30 "../../../src/elp/src/elp_l.l" {ECHO ; return telpBN ;} elpYY_BREAK case 19: elpYY_RULE_SETUP #line 31 "../../../src/elp/src/elp_l.l" {ECHO ; return telpRNT ;} elpYY_BREAK case 20: elpYY_RULE_SETUP #line 32 "../../../src/elp/src/elp_l.l" {ECHO ; return telpVTP ;} elpYY_BREAK case 21: elpYY_RULE_SETUP #line 33 "../../../src/elp/src/elp_l.l" {ECHO ; return telpAP ;} elpYY_BREAK case 22: elpYY_RULE_SETUP #line 34 "../../../src/elp/src/elp_l.l" {ECHO ; return telpBP ;} elpYY_BREAK case 23: elpYY_RULE_SETUP #line 35 "../../../src/elp/src/elp_l.l" {ECHO ; return telpRPT ;} elpYY_BREAK case 24: elpYY_RULE_SETUP #line 36 "../../../src/elp/src/elp_l.l" {ECHO ; return telpVDDmax ;} elpYY_BREAK case 25: elpYY_RULE_SETUP #line 37 "../../../src/elp/src/elp_l.l" {ECHO ; return telpVDDdeg ;} elpYY_BREAK case 26: elpYY_RULE_SETUP #line 38 "../../../src/elp/src/elp_l.l" {ECHO ; return telpVSSdeg ;} elpYY_BREAK case 27: elpYY_RULE_SETUP #line 39 "../../../src/elp/src/elp_l.l" {ECHO ; return telpVTHR ;} elpYY_BREAK case 28: elpYY_RULE_SETUP #line 40 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCGSN ;} elpYY_BREAK case 29: elpYY_RULE_SETUP #line 41 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCGPN ;} elpYY_BREAK case 30: elpYY_RULE_SETUP #line 42 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCGSP ;} elpYY_BREAK case 31: elpYY_RULE_SETUP #line 43 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCGPP ;} elpYY_BREAK case 32: elpYY_RULE_SETUP #line 44 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCDSN ;} elpYY_BREAK case 33: elpYY_RULE_SETUP #line 45 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCDPN ;} elpYY_BREAK case 34: elpYY_RULE_SETUP #line 46 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCDWN ;} elpYY_BREAK case 35: elpYY_RULE_SETUP #line 47 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCDSP ;} elpYY_BREAK case 36: elpYY_RULE_SETUP #line 48 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCDPP ;} elpYY_BREAK case 37: elpYY_RULE_SETUP #line 49 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCDWP ;} elpYY_BREAK case 38: elpYY_RULE_SETUP #line 50 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCSSN ;} elpYY_BREAK case 39: elpYY_RULE_SETUP #line 51 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCSPN ;} elpYY_BREAK case 40: elpYY_RULE_SETUP #line 52 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCSWN ;} elpYY_BREAK case 41: elpYY_RULE_SETUP #line 53 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCSSP ;} elpYY_BREAK case 42: elpYY_RULE_SETUP #line 54 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCSPP ;} elpYY_BREAK case 43: elpYY_RULE_SETUP #line 55 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCSWP ;} elpYY_BREAK case 44: elpYY_RULE_SETUP #line 56 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCGDE ;} elpYY_BREAK case 45: elpYY_RULE_SETUP #line 57 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCGSE ;} elpYY_BREAK case 46: elpYY_RULE_SETUP #line 58 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCGDD ;} elpYY_BREAK case 47: elpYY_RULE_SETUP #line 59 "../../../src/elp/src/elp_l.l" {ECHO ; return telpCGSD ;} elpYY_BREAK case 48: elpYY_RULE_SETUP #line 60 "../../../src/elp/src/elp_l.l" {ECHO ; return telpESIM ;} elpYY_BREAK case 49: elpYY_RULE_SETUP #line 61 "../../../src/elp/src/elp_l.l" {ECHO ; return telpMODEL ;} elpYY_BREAK case 50: elpYY_RULE_SETUP #line 62 "../../../src/elp/src/elp_l.l" {ECHO ; return telpLEVEL ;} elpYY_BREAK case 51: elpYY_RULE_SETUP #line 63 "../../../src/elp/src/elp_l.l" {ECHO ; return telpACM ;} elpYY_BREAK case 52: elpYY_RULE_SETUP #line 64 "../../../src/elp/src/elp_l.l" {ECHO ; return telpTEMP ;} elpYY_BREAK case 53: elpYY_RULE_SETUP #line 65 "../../../src/elp/src/elp_l.l" {ECHO ; return telpSLOPE ;} elpYY_BREAK case 54: elpYY_RULE_SETUP #line 66 "../../../src/elp/src/elp_l.l" { ECHO ; elpyylval.elpdbl = atof(elpyytext) ; return telpDOUBLE ; } elpYY_BREAK case 55: elpYY_RULE_SETUP #line 71 "../../../src/elp/src/elp_l.l" { ECHO ; strcpy(elpyylval.elpstr,elpyytext) ; return telpSTRING ; } elpYY_BREAK case 56: elpYY_RULE_SETUP #line 77 "../../../src/elp/src/elp_l.l" ECHO; elpYY_BREAK case elpYY_STATE_EOF(INITIAL): elpyyterminate(); case elpYY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int elpyy_amount_of_matched_text = (int) (elpyy_cp - elpyytext_ptr) - 1; /* Undo the effects of elpYY_DO_BEFORE_ACTION. */ *elpyy_cp = elpyy_hold_char; elpYY_RESTORE_elpYY_MORE_OFFSET if ( elpyy_current_buffer->elpyy_buffer_status == elpYY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed elpyyin at a new source and called * elpyylex(). If so, then we have to assure * consistency between elpyy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ elpyy_n_chars = elpyy_current_buffer->elpyy_n_chars; elpyy_current_buffer->elpyy_input_file = elpyyin; elpyy_current_buffer->elpyy_buffer_status = elpYY_BUFFER_NORMAL; } /* Note that here we test for elpyy_c_buf_p "<=" to the position * of the first EOB in the buffer, since elpyy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( elpyy_c_buf_p <= &elpyy_current_buffer->elpyy_ch_buf[elpyy_n_chars] ) { /* This was really a NUL. */ elpyy_state_type elpyy_next_state; elpyy_c_buf_p = elpyytext_ptr + elpyy_amount_of_matched_text; elpyy_current_state = elpyy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * elpyy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ elpyy_next_state = elpyy_try_NUL_trans( elpyy_current_state ); elpyy_bp = elpyytext_ptr + elpYY_MORE_ADJ; if ( elpyy_next_state ) { /* Consume the NUL. */ elpyy_cp = ++elpyy_c_buf_p; elpyy_current_state = elpyy_next_state; goto elpyy_match; } else { elpyy_cp = elpyy_c_buf_p; goto elpyy_find_action; } } else switch ( elpyy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { elpyy_did_buffer_switch_on_eof = 0; if ( elpyywrap() ) { /* Note: because we've taken care in * elpyy_get_next_buffer() to have set up * elpyytext, we can now set up * elpyy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * elpYY_NULL, it'll still work - another * elpYY_NULL will get returned. */ elpyy_c_buf_p = elpyytext_ptr + elpYY_MORE_ADJ; elpyy_act = elpYY_STATE_EOF(elpYY_START); goto do_action; } else { if ( ! elpyy_did_buffer_switch_on_eof ) elpYY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: elpyy_c_buf_p = elpyytext_ptr + elpyy_amount_of_matched_text; elpyy_current_state = elpyy_get_previous_state(); elpyy_cp = elpyy_c_buf_p; elpyy_bp = elpyytext_ptr + elpYY_MORE_ADJ; goto elpyy_match; case EOB_ACT_LAST_MATCH: elpyy_c_buf_p = &elpyy_current_buffer->elpyy_ch_buf[elpyy_n_chars]; elpyy_current_state = elpyy_get_previous_state(); elpyy_cp = elpyy_c_buf_p; elpyy_bp = elpyytext_ptr + elpYY_MORE_ADJ; goto elpyy_find_action; } break; } default: elpYY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of elpyylex */ /* elpyy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int elpyy_get_next_buffer() { register char *dest = elpyy_current_buffer->elpyy_ch_buf; register char *source = elpyytext_ptr; register int number_to_move, i; int ret_val; if ( elpyy_c_buf_p > &elpyy_current_buffer->elpyy_ch_buf[elpyy_n_chars + 1] ) elpYY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( elpyy_current_buffer->elpyy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( elpyy_c_buf_p - elpyytext_ptr - elpYY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (elpyy_c_buf_p - elpyytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( elpyy_current_buffer->elpyy_buffer_status == elpYY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ elpyy_current_buffer->elpyy_n_chars = elpyy_n_chars = 0; else { int num_to_read = elpyy_current_buffer->elpyy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef elpYY_USES_REJECT elpYY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ elpYY_BUFFER_STATE b = elpyy_current_buffer; int elpyy_c_buf_p_offset = (int) (elpyy_c_buf_p - b->elpyy_ch_buf); if ( b->elpyy_is_our_buffer ) { int new_size = b->elpyy_buf_size * 2; if ( new_size <= 0 ) b->elpyy_buf_size += b->elpyy_buf_size / 8; else b->elpyy_buf_size *= 2; b->elpyy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ elpyy_flex_realloc( (void *) b->elpyy_ch_buf, b->elpyy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->elpyy_ch_buf = 0; if ( ! b->elpyy_ch_buf ) elpYY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); elpyy_c_buf_p = &b->elpyy_ch_buf[elpyy_c_buf_p_offset]; num_to_read = elpyy_current_buffer->elpyy_buf_size - number_to_move - 1; #endif } if ( num_to_read > elpYY_READ_BUF_SIZE ) num_to_read = elpYY_READ_BUF_SIZE; /* Read in more data. */ elpYY_INPUT( (&elpyy_current_buffer->elpyy_ch_buf[number_to_move]), elpyy_n_chars, num_to_read ); elpyy_current_buffer->elpyy_n_chars = elpyy_n_chars; } if ( elpyy_n_chars == 0 ) { if ( number_to_move == elpYY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; elpyyrestart( elpyyin ); } else { ret_val = EOB_ACT_LAST_MATCH; elpyy_current_buffer->elpyy_buffer_status = elpYY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; elpyy_n_chars += number_to_move; elpyy_current_buffer->elpyy_ch_buf[elpyy_n_chars] = elpYY_END_OF_BUFFER_CHAR; elpyy_current_buffer->elpyy_ch_buf[elpyy_n_chars + 1] = elpYY_END_OF_BUFFER_CHAR; elpyytext_ptr = &elpyy_current_buffer->elpyy_ch_buf[0]; return ret_val; } /* elpyy_get_previous_state - get the state just before the EOB char was reached */ static elpyy_state_type elpyy_get_previous_state() { register elpyy_state_type elpyy_current_state; register char *elpyy_cp; elpyy_current_state = elpyy_start; elpyy_current_state += elpYY_AT_BOL(); for ( elpyy_cp = elpyytext_ptr + elpYY_MORE_ADJ; elpyy_cp < elpyy_c_buf_p; ++elpyy_cp ) { register elpYY_CHAR elpyy_c = (*elpyy_cp ? elpyy_ec[elpYY_SC_TO_UI(*elpyy_cp)] : 1); if ( elpyy_accept[elpyy_current_state] ) { elpyy_last_accepting_state = elpyy_current_state; elpyy_last_accepting_cpos = elpyy_cp; } while ( elpyy_chk[elpyy_base[elpyy_current_state] + elpyy_c] != elpyy_current_state ) { elpyy_current_state = (int) elpyy_def[elpyy_current_state]; if ( elpyy_current_state >= 158 ) elpyy_c = elpyy_meta[(unsigned int) elpyy_c]; } elpyy_current_state = elpyy_nxt[elpyy_base[elpyy_current_state] + (unsigned int) elpyy_c]; } return elpyy_current_state; } /* elpyy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = elpyy_try_NUL_trans( current_state ); */ #ifdef elpYY_USE_PROTOS static elpyy_state_type elpyy_try_NUL_trans( elpyy_state_type elpyy_current_state ) #else static elpyy_state_type elpyy_try_NUL_trans( elpyy_current_state ) elpyy_state_type elpyy_current_state; #endif { register int elpyy_is_jam; register char *elpyy_cp = elpyy_c_buf_p; register elpYY_CHAR elpyy_c = 1; if ( elpyy_accept[elpyy_current_state] ) { elpyy_last_accepting_state = elpyy_current_state; elpyy_last_accepting_cpos = elpyy_cp; } while ( elpyy_chk[elpyy_base[elpyy_current_state] + elpyy_c] != elpyy_current_state ) { elpyy_current_state = (int) elpyy_def[elpyy_current_state]; if ( elpyy_current_state >= 158 ) elpyy_c = elpyy_meta[(unsigned int) elpyy_c]; } elpyy_current_state = elpyy_nxt[elpyy_base[elpyy_current_state] + (unsigned int) elpyy_c]; elpyy_is_jam = (elpyy_current_state == 157); return elpyy_is_jam ? 0 : elpyy_current_state; } #ifndef elpYY_NO_UNPUT #ifdef elpYY_USE_PROTOS static void elpyyunput( int c, register char *elpyy_bp ) #else static void elpyyunput( c, elpyy_bp ) int c; register char *elpyy_bp; #endif { register char *elpyy_cp = elpyy_c_buf_p; /* undo effects of setting up elpyytext */ *elpyy_cp = elpyy_hold_char; if ( elpyy_cp < elpyy_current_buffer->elpyy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = elpyy_n_chars + 2; register char *dest = &elpyy_current_buffer->elpyy_ch_buf[ elpyy_current_buffer->elpyy_buf_size + 2]; register char *source = &elpyy_current_buffer->elpyy_ch_buf[number_to_move]; while ( source > elpyy_current_buffer->elpyy_ch_buf ) *--dest = *--source; elpyy_cp += (int) (dest - source); elpyy_bp += (int) (dest - source); elpyy_current_buffer->elpyy_n_chars = elpyy_n_chars = elpyy_current_buffer->elpyy_buf_size; if ( elpyy_cp < elpyy_current_buffer->elpyy_ch_buf + 2 ) elpYY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--elpyy_cp = (char) c; elpyytext_ptr = elpyy_bp; elpyy_hold_char = *elpyy_cp; elpyy_c_buf_p = elpyy_cp; } #endif /* ifndef elpYY_NO_UNPUT */ #ifndef elpYY_NO_INPUT #ifdef __cplusplus static int elpyyinput() #else static int input() #endif { int c; *elpyy_c_buf_p = elpyy_hold_char; if ( *elpyy_c_buf_p == elpYY_END_OF_BUFFER_CHAR ) { /* elpyy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( elpyy_c_buf_p < &elpyy_current_buffer->elpyy_ch_buf[elpyy_n_chars] ) /* This was really a NUL. */ *elpyy_c_buf_p = '\0'; else { /* need more input */ int offset = elpyy_c_buf_p - elpyytext_ptr; ++elpyy_c_buf_p; switch ( elpyy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because elpyy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ elpyyrestart( elpyyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( elpyywrap() ) return EOF; if ( ! elpyy_did_buffer_switch_on_eof ) elpYY_NEW_FILE; #ifdef __cplusplus return elpyyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: elpyy_c_buf_p = elpyytext_ptr + offset; break; } } } c = *(unsigned char *) elpyy_c_buf_p; /* cast for 8-bit char's */ *elpyy_c_buf_p = '\0'; /* preserve elpyytext */ elpyy_hold_char = *++elpyy_c_buf_p; elpyy_current_buffer->elpyy_at_bol = (c == '\n'); return c; } #endif /* elpYY_NO_INPUT */ #ifdef elpYY_USE_PROTOS void elpyyrestart( FILE *input_file ) #else void elpyyrestart( input_file ) FILE *input_file; #endif { if ( ! elpyy_current_buffer ) elpyy_current_buffer = elpyy_create_buffer( elpyyin, elpYY_BUF_SIZE ); elpyy_init_buffer( elpyy_current_buffer, input_file ); elpyy_load_buffer_state(); } #ifdef elpYY_USE_PROTOS void elpyy_switch_to_buffer( elpYY_BUFFER_STATE new_buffer ) #else void elpyy_switch_to_buffer( new_buffer ) elpYY_BUFFER_STATE new_buffer; #endif { if ( elpyy_current_buffer == new_buffer ) return; if ( elpyy_current_buffer ) { /* Flush out information for old buffer. */ *elpyy_c_buf_p = elpyy_hold_char; elpyy_current_buffer->elpyy_buf_pos = elpyy_c_buf_p; elpyy_current_buffer->elpyy_n_chars = elpyy_n_chars; } elpyy_current_buffer = new_buffer; elpyy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (elpyywrap()) processing, but the only time this flag * is looked at is after elpyywrap() is called, so it's safe * to go ahead and always set it. */ elpyy_did_buffer_switch_on_eof = 1; } #ifdef elpYY_USE_PROTOS void elpyy_load_buffer_state( void ) #else void elpyy_load_buffer_state() #endif { elpyy_n_chars = elpyy_current_buffer->elpyy_n_chars; elpyytext_ptr = elpyy_c_buf_p = elpyy_current_buffer->elpyy_buf_pos; elpyyin = elpyy_current_buffer->elpyy_input_file; elpyy_hold_char = *elpyy_c_buf_p; } #ifdef elpYY_USE_PROTOS elpYY_BUFFER_STATE elpyy_create_buffer( FILE *file, int size ) #else elpYY_BUFFER_STATE elpyy_create_buffer( file, size ) FILE *file; int size; #endif { elpYY_BUFFER_STATE b; b = (elpYY_BUFFER_STATE) elpyy_flex_alloc( sizeof( struct elpyy_buffer_state ) ); if ( ! b ) elpYY_FATAL_ERROR( "out of dynamic memory in elpyy_create_buffer()" ); b->elpyy_buf_size = size; /* elpyy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->elpyy_ch_buf = (char *) elpyy_flex_alloc( b->elpyy_buf_size + 2 ); if ( ! b->elpyy_ch_buf ) elpYY_FATAL_ERROR( "out of dynamic memory in elpyy_create_buffer()" ); b->elpyy_is_our_buffer = 1; elpyy_init_buffer( b, file ); return b; } #ifdef elpYY_USE_PROTOS void elpyy_delete_buffer( elpYY_BUFFER_STATE b ) #else void elpyy_delete_buffer( b ) elpYY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == elpyy_current_buffer ) elpyy_current_buffer = (elpYY_BUFFER_STATE) 0; if ( b->elpyy_is_our_buffer ) elpyy_flex_free( (void *) b->elpyy_ch_buf ); elpyy_flex_free( (void *) b ); } #ifdef elpYY_USE_PROTOS void elpyy_init_buffer( elpYY_BUFFER_STATE b, FILE *file ) #else void elpyy_init_buffer( b, file ) elpYY_BUFFER_STATE b; FILE *file; #endif { elpyy_flush_buffer( b ); b->elpyy_input_file = file; b->elpyy_fill_buffer = 1; #if elpYY_ALWAYS_INTERACTIVE b->elpyy_is_interactive = 1; #else #if elpYY_NEVER_INTERACTIVE b->elpyy_is_interactive = 0; #else b->elpyy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef elpYY_USE_PROTOS void elpyy_flush_buffer( elpYY_BUFFER_STATE b ) #else void elpyy_flush_buffer( b ) elpYY_BUFFER_STATE b; #endif { if ( ! b ) return; b->elpyy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->elpyy_ch_buf[0] = elpYY_END_OF_BUFFER_CHAR; b->elpyy_ch_buf[1] = elpYY_END_OF_BUFFER_CHAR; b->elpyy_buf_pos = &b->elpyy_ch_buf[0]; b->elpyy_at_bol = 1; b->elpyy_buffer_status = elpYY_BUFFER_NEW; if ( b == elpyy_current_buffer ) elpyy_load_buffer_state(); } #ifndef elpYY_NO_SCAN_BUFFER #ifdef elpYY_USE_PROTOS elpYY_BUFFER_STATE elpyy_scan_buffer( char *base, elpyy_size_t size ) #else elpYY_BUFFER_STATE elpyy_scan_buffer( base, size ) char *base; elpyy_size_t size; #endif { elpYY_BUFFER_STATE b; if ( size < 2 || base[size-2] != elpYY_END_OF_BUFFER_CHAR || base[size-1] != elpYY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (elpYY_BUFFER_STATE) elpyy_flex_alloc( sizeof( struct elpyy_buffer_state ) ); if ( ! b ) elpYY_FATAL_ERROR( "out of dynamic memory in elpyy_scan_buffer()" ); b->elpyy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->elpyy_buf_pos = b->elpyy_ch_buf = base; b->elpyy_is_our_buffer = 0; b->elpyy_input_file = 0; b->elpyy_n_chars = b->elpyy_buf_size; b->elpyy_is_interactive = 0; b->elpyy_at_bol = 1; b->elpyy_fill_buffer = 0; b->elpyy_buffer_status = elpYY_BUFFER_NEW; elpyy_switch_to_buffer( b ); return b; } #endif #ifndef elpYY_NO_SCAN_STRING #ifdef elpYY_USE_PROTOS elpYY_BUFFER_STATE elpyy_scan_string( elpyyconst char *elpyy_str ) #else elpYY_BUFFER_STATE elpyy_scan_string( elpyy_str ) elpyyconst char *elpyy_str; #endif { int len; for ( len = 0; elpyy_str[len]; ++len ) ; return elpyy_scan_bytes( elpyy_str, len ); } #endif #ifndef elpYY_NO_SCAN_BYTES #ifdef elpYY_USE_PROTOS elpYY_BUFFER_STATE elpyy_scan_bytes( elpyyconst char *bytes, int len ) #else elpYY_BUFFER_STATE elpyy_scan_bytes( bytes, len ) elpyyconst char *bytes; int len; #endif { elpYY_BUFFER_STATE b; char *buf; elpyy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) elpyy_flex_alloc( n ); if ( ! buf ) elpYY_FATAL_ERROR( "out of dynamic memory in elpyy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = elpYY_END_OF_BUFFER_CHAR; b = elpyy_scan_buffer( buf, n ); if ( ! b ) elpYY_FATAL_ERROR( "bad buffer in elpyy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->elpyy_is_our_buffer = 1; return b; } #endif #ifndef elpYY_NO_PUSH_STATE #ifdef elpYY_USE_PROTOS static void elpyy_push_state( int new_state ) #else static void elpyy_push_state( new_state ) int new_state; #endif { if ( elpyy_start_stack_ptr >= elpyy_start_stack_depth ) { elpyy_size_t new_size; elpyy_start_stack_depth += elpYY_START_STACK_INCR; new_size = elpyy_start_stack_depth * sizeof( int ); if ( ! elpyy_start_stack ) elpyy_start_stack = (int *) elpyy_flex_alloc( new_size ); else elpyy_start_stack = (int *) elpyy_flex_realloc( (void *) elpyy_start_stack, new_size ); if ( ! elpyy_start_stack ) elpYY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } elpyy_start_stack[elpyy_start_stack_ptr++] = elpYY_START; BEGIN(new_state); } #endif #ifndef elpYY_NO_POP_STATE static void elpyy_pop_state() { if ( --elpyy_start_stack_ptr < 0 ) elpYY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(elpyy_start_stack[elpyy_start_stack_ptr]); } #endif #ifndef elpYY_NO_TOP_STATE static int elpyy_top_state() { return elpyy_start_stack[elpyy_start_stack_ptr - 1]; } #endif #ifndef elpYY_EXIT_FAILURE #define elpYY_EXIT_FAILURE 2 #endif #ifdef elpYY_USE_PROTOS static void elpyy_fatal_error( elpyyconst char msg[] ) #else static void elpyy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( elpYY_EXIT_FAILURE ); } /* Redefine elpyyless() so it works in section 3 code. */ #undef elpyyless #define elpyyless(n) \ do \ { \ /* Undo effects of setting up elpyytext. */ \ elpyytext[elpyyleng] = elpyy_hold_char; \ elpyy_c_buf_p = elpyytext + n; \ elpyy_hold_char = *elpyy_c_buf_p; \ *elpyy_c_buf_p = '\0'; \ elpyyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef elpyytext_ptr #ifdef elpYY_USE_PROTOS static void elpyy_flex_strncpy( char *s1, elpyyconst char *s2, int n ) #else static void elpyy_flex_strncpy( s1, s2, n ) char *s1; elpyyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef elpYY_NEED_STRLEN #ifdef elpYY_USE_PROTOS static int elpyy_flex_strlen( elpyyconst char *s ) #else static int elpyy_flex_strlen( s ) elpyyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef elpYY_USE_PROTOS static void *elpyy_flex_alloc( elpyy_size_t size ) #else static void *elpyy_flex_alloc( size ) elpyy_size_t size; #endif { return (void *) malloc( size ); } #ifdef elpYY_USE_PROTOS static void *elpyy_flex_realloc( void *ptr, elpyy_size_t size ) #else static void *elpyy_flex_realloc( ptr, size ) void *ptr; elpyy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef elpYY_USE_PROTOS static void elpyy_flex_free( void *ptr ) #else static void elpyy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if elpYY_MAIN int main() { elpyylex(); return 0; } #endif #line 77 "../../../src/elp/src/elp_l.l"