TSP: The Transport Sample Protocol



Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

tsp_ascii_writer_config_yy.c

Go to the documentation of this file.
00001 #line 2 "tsp_ascii_writer_config_yy.c"
00002 /* A lexical scanner generated by flex */
00003 
00004 /* Scanner skeleton version:
00005  * $Header: /cvsroot/tsp/tsp/src/consumers/ascii_writer/tsp_ascii_writer_config_yy.c,v 1.2 2004/09/22 20:18:56 erk Exp $
00006  */
00007 
00008 #define FLEX_SCANNER
00009 #define YY_FLEX_MAJOR_VERSION 2
00010 #define YY_FLEX_MINOR_VERSION 5
00011 
00012 #include <stdio.h>
00013 #include <unistd.h>
00014 
00015 
00016 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
00017 #ifdef c_plusplus
00018 #ifndef __cplusplus
00019 #define __cplusplus
00020 #endif
00021 #endif
00022 
00023 
00024 #ifdef __cplusplus
00025 
00026 #include <stdlib.h>
00027 
00028 /* Use prototypes in function declarations. */
00029 #define YY_USE_PROTOS
00030 
00031 /* The "const" storage-class-modifier is valid. */
00032 #define YY_USE_CONST
00033 
00034 #else   /* ! __cplusplus */
00035 
00036 #if __STDC__
00037 
00038 #define YY_USE_PROTOS
00039 #define YY_USE_CONST
00040 
00041 #endif  /* __STDC__ */
00042 #endif  /* ! __cplusplus */
00043 
00044 #ifdef __TURBOC__
00045  #pragma warn -rch
00046  #pragma warn -use
00047 #include <io.h>
00048 #include <stdlib.h>
00049 #define YY_USE_CONST
00050 #define YY_USE_PROTOS
00051 #endif
00052 
00053 #ifdef YY_USE_CONST
00054 #define yyconst const
00055 #else
00056 #define yyconst
00057 #endif
00058 
00059 
00060 #ifdef YY_USE_PROTOS
00061 #define YY_PROTO(proto) proto
00062 #else
00063 #define YY_PROTO(proto) ()
00064 #endif
00065 
00066 /* Returned upon end-of-file. */
00067 #define YY_NULL 0
00068 
00069 /* Promotes a possibly negative, possibly signed char to an unsigned
00070  * integer for use as an array index.  If the signed char is negative,
00071  * we want to instead treat it as an 8-bit unsigned char, hence the
00072  * double cast.
00073  */
00074 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00075 
00076 /* Enter a start condition.  This macro really ought to take a parameter,
00077  * but we do it the disgusting crufty way forced on us by the ()-less
00078  * definition of BEGIN.
00079  */
00080 #define BEGIN yy_start = 1 + 2 *
00081 
00082 /* Translate the current start state into a value that can be later handed
00083  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00084  * compatibility.
00085  */
00086 #define YY_START ((yy_start - 1) / 2)
00087 #define YYSTATE YY_START
00088 
00089 /* Action number for EOF rule of a given start state. */
00090 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00091 
00092 /* Special action meaning "start processing a new file". */
00093 #define YY_NEW_FILE yyrestart( yyin )
00094 
00095 #define YY_END_OF_BUFFER_CHAR 0
00096 
00097 /* Size of default input buffer. */
00098 #define YY_BUF_SIZE 16384
00099 
00100 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00101 
00102 extern int yyleng;
00103 extern FILE *yyin, *yyout;
00104 
00105 #define EOB_ACT_CONTINUE_SCAN 0
00106 #define EOB_ACT_END_OF_FILE 1
00107 #define EOB_ACT_LAST_MATCH 2
00108 
00109 /* The funky do-while in the following #define is used to turn the definition
00110  * int a single C statement (which needs a semi-colon terminator).  This
00111  * avoids problems with code like:
00112  *
00113  *      if ( condition_holds )
00114  *              yyless( 5 );
00115  *      else
00116  *              do_something_else();
00117  *
00118  * Prior to using the do-while the compiler would get upset at the
00119  * "else" because it interpreted the "if" statement as being all
00120  * done when it reached the ';' after the yyless() call.
00121  */
00122 
00123 /* Return all but the first 'n' matched characters back to the input stream. */
00124 
00125 #define yyless(n) \
00126         do \
00127                 { \
00128                 /* Undo effects of setting up yytext. */ \
00129                 *yy_cp = yy_hold_char; \
00130                 YY_RESTORE_YY_MORE_OFFSET \
00131                 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
00132                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
00133                 } \
00134         while ( 0 )
00135 
00136 #define unput(c) yyunput( c, yytext_ptr )
00137 
00138 /* The following is because we cannot portably get our hands on size_t
00139  * (without autoconf's help, which isn't available because we want
00140  * flex-generated scanners to compile on their own).
00141  */
00142 typedef unsigned int yy_size_t;
00143 
00144 
00145 struct yy_buffer_state
00146         {
00147         FILE *yy_input_file;
00148 
00149         char *yy_ch_buf;                /* input buffer */
00150         char *yy_buf_pos;               /* current position in input buffer */
00151 
00152         /* Size of input buffer in bytes, not including room for EOB
00153          * characters.
00154          */
00155         yy_size_t yy_buf_size;
00156 
00157         /* Number of characters read into yy_ch_buf, not including EOB
00158          * characters.
00159          */
00160         int yy_n_chars;
00161 
00162         /* Whether we "own" the buffer - i.e., we know we created it,
00163          * and can realloc() it to grow it, and should free() it to
00164          * delete it.
00165          */
00166         int yy_is_our_buffer;
00167 
00168         /* Whether this is an "interactive" input source; if so, and
00169          * if we're using stdio for input, then we want to use getc()
00170          * instead of fread(), to make sure we stop fetching input after
00171          * each newline.
00172          */
00173         int yy_is_interactive;
00174 
00175         /* Whether we're considered to be at the beginning of a line.
00176          * If so, '^' rules will be active on the next match, otherwise
00177          * not.
00178          */
00179         int yy_at_bol;
00180 
00181         /* Whether to try to fill the input buffer when we reach the
00182          * end of it.
00183          */
00184         int yy_fill_buffer;
00185 
00186         int yy_buffer_status;
00187 #define YY_BUFFER_NEW 0
00188 #define YY_BUFFER_NORMAL 1
00189         /* When an EOF's been seen but there's still some text to process
00190          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00191          * shouldn't try reading from the input source any more.  We might
00192          * still have a bunch of tokens to match, though, because of
00193          * possible backing-up.
00194          *
00195          * When we actually see the EOF, we change the status to "new"
00196          * (via yyrestart()), so that the user can continue scanning by
00197          * just pointing yyin at a new input file.
00198          */
00199 #define YY_BUFFER_EOF_PENDING 2
00200         };
00201 
00202 static YY_BUFFER_STATE yy_current_buffer = 0;
00203 
00204 /* We provide macros for accessing buffer states in case in the
00205  * future we want to put the buffer states in a more general
00206  * "scanner state".
00207  */
00208 #define YY_CURRENT_BUFFER yy_current_buffer
00209 
00210 
00211 /* yy_hold_char holds the character lost when yytext is formed. */
00212 static char yy_hold_char;
00213 
00214 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
00215 
00216 
00217 int yyleng;
00218 
00219 /* Points to current character in buffer. */
00220 static char *yy_c_buf_p = (char *) 0;
00221 static int yy_init = 1;         /* whether we need to initialize */
00222 static int yy_start = 0;        /* start state number */
00223 
00224 /* Flag which is used to allow yywrap()'s to do buffer switches
00225  * instead of setting up a fresh yyin.  A bit of a hack ...
00226  */
00227 static int yy_did_buffer_switch_on_eof;
00228 
00229 void yyrestart YY_PROTO(( FILE *input_file ));
00230 
00231 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
00232 void yy_load_buffer_state YY_PROTO(( void ));
00233 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
00234 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00235 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
00236 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00237 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
00238 
00239 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
00240 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
00241 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
00242 
00243 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
00244 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
00245 static void yy_flex_free YY_PROTO(( void * ));
00246 
00247 #define yy_new_buffer yy_create_buffer
00248 
00249 #define yy_set_interactive(is_interactive) \
00250         { \
00251         if ( ! yy_current_buffer ) \
00252                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00253         yy_current_buffer->yy_is_interactive = is_interactive; \
00254         }
00255 
00256 #define yy_set_bol(at_bol) \
00257         { \
00258         if ( ! yy_current_buffer ) \
00259                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00260         yy_current_buffer->yy_at_bol = at_bol; \
00261         }
00262 
00263 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
00264 
00265 typedef unsigned char YY_CHAR;
00266 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
00267 typedef int yy_state_type;
00268 extern char *yytext;
00269 #define yytext_ptr yytext
00270 
00271 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
00272 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
00273 static int yy_get_next_buffer YY_PROTO(( void ));
00274 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
00275 
00276 /* Done after the current pattern has been matched and before the
00277  * corresponding action - sets up yytext.
00278  */
00279 #define YY_DO_BEFORE_ACTION \
00280         yytext_ptr = yy_bp; \
00281         yyleng = (int) (yy_cp - yy_bp); \
00282         yy_hold_char = *yy_cp; \
00283         *yy_cp = '\0'; \
00284         yy_c_buf_p = yy_cp;
00285 
00286 #define YY_NUM_RULES 6
00287 #define YY_END_OF_BUFFER 7
00288 static yyconst short int yy_accept[18] =
00289     {   0,
00290         2,    2,    7,    6,    5,    3,    5,    4,    2,    1,
00291         5,    3,    5,    4,    2,    1,    0
00292     } ;
00293 
00294 static yyconst int yy_ec[256] =
00295     {   0,
00296         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00297         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00298         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00299         1,    4,    1,    1,    5,    1,    1,    1,    1,    1,
00300         1,    1,    1,    1,    1,    1,    1,    6,    6,    6,
00301         6,    6,    6,    6,    6,    6,    6,    1,    1,    1,
00302         1,    1,    1,    1,    7,    7,    7,    7,    7,    7,
00303         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00304         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00305         8,    1,    8,    1,    8,    1,    7,    7,    7,    7,
00306 
00307         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00308         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00309         7,    7,    1,    1,    1,    1,    1,    1,    1,    1,
00310         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00311         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00312         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00313         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00314         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00315         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00316         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00317 
00318         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00319         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00320         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00321         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00322         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00323         1,    1,    1,    1,    1
00324     } ;
00325 
00326 static yyconst int yy_meta[9] =
00327     {   0,
00328         1,    2,    3,    2,    1,    4,    4,    4
00329     } ;
00330 
00331 static yyconst short int yy_base[21] =
00332     {   0,
00333         0,    0,   19,   20,    7,   20,    0,    0,   12,    0,
00334         0,   20,    0,    0,   11,    0,   20,   14,   11,   10
00335     } ;
00336 
00337 static yyconst short int yy_def[21] =
00338     {   0,
00339        17,    1,   17,   17,   17,   17,   18,   19,   17,   20,
00340         5,   17,   18,   19,   17,   20,    0,   17,   17,   17
00341     } ;
00342 
00343 static yyconst short int yy_nxt[29] =
00344     {   0,
00345         4,    5,    6,    7,    8,    9,   10,    4,   11,   12,
00346        13,   14,   14,   16,   14,   13,   15,   15,   17,    3,
00347        17,   17,   17,   17,   17,   17,   17,   17
00348     } ;
00349 
00350 static yyconst short int yy_chk[29] =
00351     {   0,
00352         1,    1,    1,    1,    1,    1,    1,    1,    5,    5,
00353         5,   19,   19,   20,   19,   18,   15,    9,    3,   17,
00354        17,   17,   17,   17,   17,   17,   17,   17
00355     } ;
00356 
00357 static yy_state_type yy_last_accepting_state;
00358 static char *yy_last_accepting_cpos;
00359 
00360 /* The intent behind this definition is that it'll catch
00361  * any uses of REJECT which flex missed.
00362  */
00363 #define REJECT reject_used_but_not_detected
00364 #define yymore() yymore_used_but_not_detected
00365 #define YY_MORE_ADJ 0
00366 #define YY_RESTORE_YY_MORE_OFFSET
00367 char *yytext;
00368 #line 1 "tsp_ascii_writer_config.lex"
00369 #define INITIAL 0
00370 
00406 #line 38 "tsp_ascii_writer_config.lex"
00407   /* for atoi() see below */
00408 #include <math.h>
00409 #include <stdio.h>
00410 #include <tsp_ascii_writer.h>
00411 #include "tsp_ascii_writer_config.tab.h"
00412   extern char* yytext;
00413 int yyerror(char *msg) {
00414   printf("tsp_ascii_writer_config: line %d, col %d : %s at '%s'\n", 
00415          tsp_ascii_writer_lineno, tsp_ascii_writer_colno, msg, yytext);
00416   ++tsp_ascii_writer_parse_error;
00417   return 0;
00418 }
00419 #line 420 "tsp_ascii_writer_config_yy.c"
00420 
00421 /* Macros after this point can all be overridden by user definitions in
00422  * section 1.
00423  */
00424 
00425 #ifndef YY_SKIP_YYWRAP
00426 #ifdef __cplusplus
00427 extern "C" int yywrap YY_PROTO(( void ));
00428 #else
00429 extern int yywrap YY_PROTO(( void ));
00430 #endif
00431 #endif
00432 
00433 #ifndef YY_NO_UNPUT
00434 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
00435 #endif
00436 
00437 #ifndef yytext_ptr
00438 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
00439 #endif
00440 
00441 #ifdef YY_NEED_STRLEN
00442 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
00443 #endif
00444 
00445 #ifndef YY_NO_INPUT
00446 #ifdef __cplusplus
00447 static int yyinput YY_PROTO(( void ));
00448 #else
00449 static int input YY_PROTO(( void ));
00450 #endif
00451 #endif
00452 
00453 #if YY_STACK_USED
00454 static int yy_start_stack_ptr = 0;
00455 static int yy_start_stack_depth = 0;
00456 static int *yy_start_stack = 0;
00457 #ifndef YY_NO_PUSH_STATE
00458 static void yy_push_state YY_PROTO(( int new_state ));
00459 #endif
00460 #ifndef YY_NO_POP_STATE
00461 static void yy_pop_state YY_PROTO(( void ));
00462 #endif
00463 #ifndef YY_NO_TOP_STATE
00464 static int yy_top_state YY_PROTO(( void ));
00465 #endif
00466 
00467 #else
00468 #define YY_NO_PUSH_STATE 1
00469 #define YY_NO_POP_STATE 1
00470 #define YY_NO_TOP_STATE 1
00471 #endif
00472 
00473 #ifdef YY_MALLOC_DECL
00474 YY_MALLOC_DECL
00475 #else
00476 #if __STDC__
00477 #ifndef __cplusplus
00478 #include <stdlib.h>
00479 #endif
00480 #else
00481 /* Just try to get by without declaring the routines.  This will fail
00482  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
00483  * or sizeof(void*) != sizeof(int).
00484  */
00485 #endif
00486 #endif
00487 
00488 /* Amount of stuff to slurp up with each read. */
00489 #ifndef YY_READ_BUF_SIZE
00490 #define YY_READ_BUF_SIZE 8192
00491 #endif
00492 
00493 /* Copy whatever the last rule matched to the standard output. */
00494 
00495 #ifndef ECHO
00496 /* This used to be an fputs(), but since the string might contain NUL's,
00497  * we now use fwrite().
00498  */
00499 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
00500 #endif
00501 
00502 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00503  * is returned in "result".
00504  */
00505 #ifndef YY_INPUT
00506 #define YY_INPUT(buf,result,max_size) \
00507         if ( yy_current_buffer->yy_is_interactive ) \
00508                 { \
00509                 int c = '*', n; \
00510                 for ( n = 0; n < max_size && \
00511                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00512                         buf[n] = (char) c; \
00513                 if ( c == '\n' ) \
00514                         buf[n++] = (char) c; \
00515                 if ( c == EOF && ferror( yyin ) ) \
00516                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
00517                 result = n; \
00518                 } \
00519         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
00520                   && ferror( yyin ) ) \
00521                 YY_FATAL_ERROR( "input in flex scanner failed" );
00522 #endif
00523 
00524 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00525  * we don't want an extra ';' after the "return" because that will cause
00526  * some compilers to complain about unreachable statements.
00527  */
00528 #ifndef yyterminate
00529 #define yyterminate() return YY_NULL
00530 #endif
00531 
00532 /* Number of entries by which start-condition stack grows. */
00533 #ifndef YY_START_STACK_INCR
00534 #define YY_START_STACK_INCR 25
00535 #endif
00536 
00537 /* Report a fatal error. */
00538 #ifndef YY_FATAL_ERROR
00539 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00540 #endif
00541 
00542 /* Default declaration of generated scanner - a define so the user can
00543  * easily add parameters.
00544  */
00545 #ifndef YY_DECL
00546 #define YY_DECL int yylex YY_PROTO(( void ))
00547 #endif
00548 
00549 /* Code executed at the beginning of each rule, after yytext and yyleng
00550  * have been set up.
00551  */
00552 #ifndef YY_USER_ACTION
00553 #define YY_USER_ACTION
00554 #endif
00555 
00556 /* Code executed at the end of each rule. */
00557 #ifndef YY_BREAK
00558 #define YY_BREAK break;
00559 #endif
00560 
00561 #define YY_RULE_SETUP \
00562         YY_USER_ACTION
00563 
00564 YY_DECL
00565         {
00566         register yy_state_type yy_current_state;
00567         register char *yy_cp, *yy_bp;
00568         register int yy_act;
00569 
00570 #line 56 "tsp_ascii_writer_config.lex"
00571 
00572 #line 573 "tsp_ascii_writer_config_yy.c"
00573 
00574         if ( yy_init )
00575                 {
00576                 yy_init = 0;
00577 
00578 #ifdef YY_USER_INIT
00579                 YY_USER_INIT;
00580 #endif
00581 
00582                 if ( ! yy_start )
00583                         yy_start = 1;   /* first start state */
00584 
00585                 if ( ! yyin )
00586                         yyin = stdin;
00587 
00588                 if ( ! yyout )
00589                         yyout = stdout;
00590 
00591                 if ( ! yy_current_buffer )
00592                         yy_current_buffer =
00593                                 yy_create_buffer( yyin, YY_BUF_SIZE );
00594 
00595                 yy_load_buffer_state();
00596                 }
00597 
00598         while ( 1 )             /* loops until end-of-file is reached */
00599                 {
00600                 yy_cp = yy_c_buf_p;
00601 
00602                 /* Support of yytext. */
00603                 *yy_cp = yy_hold_char;
00604 
00605                 /* yy_bp points to the position in yy_ch_buf of the start of
00606                  * the current run.
00607                  */
00608                 yy_bp = yy_cp;
00609 
00610                 yy_current_state = yy_start;
00611 yy_match:
00612                 do
00613                         {
00614                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00615                         if ( yy_accept[yy_current_state] )
00616                                 {
00617                                 yy_last_accepting_state = yy_current_state;
00618                                 yy_last_accepting_cpos = yy_cp;
00619                                 }
00620                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00621                                 {
00622                                 yy_current_state = (int) yy_def[yy_current_state];
00623                                 if ( yy_current_state >= 18 )
00624                                         yy_c = yy_meta[(unsigned int) yy_c];
00625                                 }
00626                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00627                         ++yy_cp;
00628                         }
00629                 while ( yy_base[yy_current_state] != 20 );
00630 
00631 yy_find_action:
00632                 yy_act = yy_accept[yy_current_state];
00633                 if ( yy_act == 0 )
00634                         { /* have to back up */
00635                         yy_cp = yy_last_accepting_cpos;
00636                         yy_current_state = yy_last_accepting_state;
00637                         yy_act = yy_accept[yy_current_state];
00638                         }
00639 
00640                 YY_DO_BEFORE_ACTION;
00641 
00642 
00643 do_action:      /* This label is used only to access EOF actions. */
00644 
00645 
00646                 switch ( yy_act )
00647         { /* beginning of action switch */
00648                         case 0: /* must back up */
00649                         /* undo the effects of YY_DO_BEFORE_ACTION */
00650                         *yy_cp = yy_hold_char;
00651                         yy_cp = yy_last_accepting_cpos;
00652                         yy_current_state = yy_last_accepting_state;
00653                         goto yy_find_action;
00654 
00655 case 1:
00656 YY_RULE_SETUP
00657 #line 57 "tsp_ascii_writer_config.lex"
00658 {tsp_ascii_writer_add_var(yytext); tsp_ascii_writer_colno+=yyleng; return T_SAMPLE_SYMBOL;}
00659         YY_BREAK
00660 case 2:
00661 YY_RULE_SETUP
00662 #line 58 "tsp_ascii_writer_config.lex"
00663 {tsp_ascii_writer_add_var_period(atoi(yytext)); tsp_ascii_writer_colno+=yyleng; return T_PERIOD;}
00664         YY_BREAK
00665 case 3:
00666 YY_RULE_SETUP
00667 #line 59 "tsp_ascii_writer_config.lex"
00668 {++tsp_ascii_writer_lineno;tsp_ascii_writer_colno = 0;  return T_NEWLINE;}
00669         YY_BREAK
00670 case 4:
00671 YY_RULE_SETUP
00672 #line 60 "tsp_ascii_writer_config.lex"
00673 {tsp_ascii_writer_add_comment(yytext); tsp_ascii_writer_colno+=yyleng; return T_COMMENT;}
00674         YY_BREAK
00675 case 5:
00676 YY_RULE_SETUP
00677 #line 61 "tsp_ascii_writer_config.lex"
00678 {tsp_ascii_writer_colno+=yyleng; return T_SPACE;}
00679         YY_BREAK
00680 case 6:
00681 YY_RULE_SETUP
00682 #line 62 "tsp_ascii_writer_config.lex"
00683 ECHO;
00684         YY_BREAK
00685 #line 686 "tsp_ascii_writer_config_yy.c"
00686 case YY_STATE_EOF(INITIAL):
00687         yyterminate();
00688 
00689         case YY_END_OF_BUFFER:
00690                 {
00691                 /* Amount of text matched not including the EOB char. */
00692                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
00693 
00694                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
00695                 *yy_cp = yy_hold_char;
00696                 YY_RESTORE_YY_MORE_OFFSET
00697 
00698                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
00699                         {
00700                         /* We're scanning a new file or input source.  It's
00701                          * possible that this happened because the user
00702                          * just pointed yyin at a new source and called
00703                          * yylex().  If so, then we have to assure
00704                          * consistency between yy_current_buffer and our
00705                          * globals.  Here is the right place to do so, because
00706                          * this is the first action (other than possibly a
00707                          * back-up) that will match for the new input source.
00708                          */
00709                         yy_n_chars = yy_current_buffer->yy_n_chars;
00710                         yy_current_buffer->yy_input_file = yyin;
00711                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
00712                         }
00713 
00714                 /* Note that here we test for yy_c_buf_p "<=" to the position
00715                  * of the first EOB in the buffer, since yy_c_buf_p will
00716                  * already have been incremented past the NUL character
00717                  * (since all states make transitions on EOB to the
00718                  * end-of-buffer state).  Contrast this with the test
00719                  * in input().
00720                  */
00721                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
00722                         { /* This was really a NUL. */
00723                         yy_state_type yy_next_state;
00724 
00725                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
00726 
00727                         yy_current_state = yy_get_previous_state();
00728 
00729                         /* Okay, we're now positioned to make the NUL
00730                          * transition.  We couldn't have
00731                          * yy_get_previous_state() go ahead and do it
00732                          * for us because it doesn't know how to deal
00733                          * with the possibility of jamming (and we don't
00734                          * want to build jamming into it because then it
00735                          * will run more slowly).
00736                          */
00737 
00738                         yy_next_state = yy_try_NUL_trans( yy_current_state );
00739 
00740                         yy_bp = yytext_ptr + YY_MORE_ADJ;
00741 
00742                         if ( yy_next_state )
00743                                 {
00744                                 /* Consume the NUL. */
00745                                 yy_cp = ++yy_c_buf_p;
00746                                 yy_current_state = yy_next_state;
00747                                 goto yy_match;
00748                                 }
00749 
00750                         else
00751                                 {
00752                                 yy_cp = yy_c_buf_p;
00753                                 goto yy_find_action;
00754                                 }
00755                         }
00756 
00757                 else switch ( yy_get_next_buffer() )
00758                         {
00759                         case EOB_ACT_END_OF_FILE:
00760                                 {
00761                                 yy_did_buffer_switch_on_eof = 0;
00762 
00763                                 if ( yywrap() )
00764                                         {
00765                                         /* Note: because we've taken care in
00766                                          * yy_get_next_buffer() to have set up
00767                                          * yytext, we can now set up
00768                                          * yy_c_buf_p so that if some total
00769                                          * hoser (like flex itself) wants to
00770                                          * call the scanner after we return the
00771                                          * YY_NULL, it'll still work - another
00772                                          * YY_NULL will get returned.
00773                                          */
00774                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
00775 
00776                                         yy_act = YY_STATE_EOF(YY_START);
00777                                         goto do_action;
00778                                         }
00779 
00780                                 else
00781                                         {
00782                                         if ( ! yy_did_buffer_switch_on_eof )
00783                                                 YY_NEW_FILE;
00784                                         }
00785                                 break;
00786                                 }
00787 
00788                         case EOB_ACT_CONTINUE_SCAN:
00789                                 yy_c_buf_p =
00790                                         yytext_ptr + yy_amount_of_matched_text;
00791 
00792                                 yy_current_state = yy_get_previous_state();
00793 
00794                                 yy_cp = yy_c_buf_p;
00795                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
00796                                 goto yy_match;
00797 
00798                         case EOB_ACT_LAST_MATCH:
00799                                 yy_c_buf_p =
00800                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
00801 
00802                                 yy_current_state = yy_get_previous_state();
00803 
00804                                 yy_cp = yy_c_buf_p;
00805                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
00806                                 goto yy_find_action;
00807                         }
00808                 break;
00809                 }
00810 
00811         default:
00812                 YY_FATAL_ERROR(
00813                         "fatal flex scanner internal error--no action found" );
00814         } /* end of action switch */
00815                 } /* end of scanning one token */
00816         } /* end of yylex */
00817 
00818 
00819 /* yy_get_next_buffer - try to read in a new buffer
00820  *
00821  * Returns a code representing an action:
00822  *      EOB_ACT_LAST_MATCH -
00823  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
00824  *      EOB_ACT_END_OF_FILE - end of file
00825  */
00826 
00827 static int yy_get_next_buffer()
00828         {
00829         register char *dest = yy_current_buffer->yy_ch_buf;
00830         register char *source = yytext_ptr;
00831         register int number_to_move, i;
00832         int ret_val;
00833 
00834         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
00835                 YY_FATAL_ERROR(
00836                 "fatal flex scanner internal error--end of buffer missed" );
00837 
00838         if ( yy_current_buffer->yy_fill_buffer == 0 )
00839                 { /* Don't try to fill the buffer, so this is an EOF. */
00840                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
00841                         {
00842                         /* We matched a single character, the EOB, so
00843                          * treat this as a final EOF.
00844                          */
00845                         return EOB_ACT_END_OF_FILE;
00846                         }
00847 
00848                 else
00849                         {
00850                         /* We matched some text prior to the EOB, first
00851                          * process it.
00852                          */
00853                         return EOB_ACT_LAST_MATCH;
00854                         }
00855                 }
00856 
00857         /* Try to read more data. */
00858 
00859         /* First move last chars to start of buffer. */
00860         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
00861 
00862         for ( i = 0; i < number_to_move; ++i )
00863                 *(dest++) = *(source++);
00864 
00865         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
00866                 /* don't do the read, it's not guaranteed to return an EOF,
00867                  * just force an EOF
00868                  */
00869                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
00870 
00871         else
00872                 {
00873                 int num_to_read =
00874                         yy_current_buffer->yy_buf_size - number_to_move - 1;
00875 
00876                 while ( num_to_read <= 0 )
00877                         { /* Not enough room in the buffer - grow it. */
00878 #ifdef YY_USES_REJECT
00879                         YY_FATAL_ERROR(
00880 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
00881 #else
00882 
00883                         /* just a shorter name for the current buffer */
00884                         YY_BUFFER_STATE b = yy_current_buffer;
00885 
00886                         int yy_c_buf_p_offset =
00887                                 (int) (yy_c_buf_p - b->yy_ch_buf);
00888 
00889                         if ( b->yy_is_our_buffer )
00890                                 {
00891                                 int new_size = b->yy_buf_size * 2;
00892 
00893                                 if ( new_size <= 0 )
00894                                         b->yy_buf_size += b->yy_buf_size / 8;
00895                                 else
00896                                         b->yy_buf_size *= 2;
00897 
00898                                 b->yy_ch_buf = (char *)
00899                                         /* Include room in for 2 EOB chars. */
00900                                         yy_flex_realloc( (void *) b->yy_ch_buf,
00901                                                          b->yy_buf_size + 2 );
00902                                 }
00903                         else
00904                                 /* Can't grow it, we don't own it. */
00905                                 b->yy_ch_buf = 0;
00906 
00907                         if ( ! b->yy_ch_buf )
00908                                 YY_FATAL_ERROR(
00909                                 "fatal error - scanner input buffer overflow" );
00910 
00911                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
00912 
00913                         num_to_read = yy_current_buffer->yy_buf_size -
00914                                                 number_to_move - 1;
00915 #endif
00916                         }
00917 
00918                 if ( num_to_read > YY_READ_BUF_SIZE )
00919                         num_to_read = YY_READ_BUF_SIZE;
00920 
00921                 /* Read in more data. */
00922                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
00923                         yy_n_chars, num_to_read );
00924 
00925                 yy_current_buffer->yy_n_chars = yy_n_chars;
00926                 }
00927 
00928         if ( yy_n_chars == 0 )
00929                 {
00930                 if ( number_to_move == YY_MORE_ADJ )
00931                         {
00932                         ret_val = EOB_ACT_END_OF_FILE;
00933                         yyrestart( yyin );
00934                         }
00935 
00936                 else
00937                         {
00938                         ret_val = EOB_ACT_LAST_MATCH;
00939                         yy_current_buffer->yy_buffer_status =
00940                                 YY_BUFFER_EOF_PENDING;
00941                         }
00942                 }
00943 
00944         else
00945                 ret_val = EOB_ACT_CONTINUE_SCAN;
00946 
00947         yy_n_chars += number_to_move;
00948         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
00949         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
00950 
00951         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
00952 
00953         return ret_val;
00954         }
00955 
00956 
00957 /* yy_get_previous_state - get the state just before the EOB char was reached */
00958 
00959 static yy_state_type yy_get_previous_state()
00960         {
00961         register yy_state_type yy_current_state;
00962         register char *yy_cp;
00963 
00964         yy_current_state = yy_start;
00965 
00966         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
00967                 {
00968                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
00969                 if ( yy_accept[yy_current_state] )
00970                         {
00971                         yy_last_accepting_state = yy_current_state;
00972                         yy_last_accepting_cpos = yy_cp;
00973                         }
00974                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00975                         {
00976                         yy_current_state = (int) yy_def[yy_current_state];
00977                         if ( yy_current_state >= 18 )
00978                                 yy_c = yy_meta[(unsigned int) yy_c];
00979                         }
00980                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00981                 }
00982 
00983         return yy_current_state;
00984         }
00985 
00986 
00987 /* yy_try_NUL_trans - try to make a transition on the NUL character
00988  *
00989  * synopsis
00990  *      next_state = yy_try_NUL_trans( current_state );
00991  */
00992 
00993 #ifdef YY_USE_PROTOS
00994 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
00995 #else
00996 static yy_state_type yy_try_NUL_trans( yy_current_state )
00997 yy_state_type yy_current_state;
00998 #endif
00999         {
01000         register int yy_is_jam;
01001         register char *yy_cp = yy_c_buf_p;
01002 
01003         register YY_CHAR yy_c = 1;
01004         if ( yy_accept[yy_current_state] )
01005                 {
01006                 yy_last_accepting_state = yy_current_state;
01007                 yy_last_accepting_cpos = yy_cp;
01008                 }
01009         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01010                 {
01011                 yy_current_state = (int) yy_def[yy_current_state];
01012                 if ( yy_current_state >= 18 )
01013                         yy_c = yy_meta[(unsigned int) yy_c];
01014                 }
01015         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01016         yy_is_jam = (yy_current_state == 17);
01017 
01018         return yy_is_jam ? 0 : yy_current_state;
01019         }
01020 
01021 
01022 #ifndef YY_NO_UNPUT
01023 #ifdef YY_USE_PROTOS
01024 static void yyunput( int c, register char *yy_bp )
01025 #else
01026 static void yyunput( c, yy_bp )
01027 int c;
01028 register char *yy_bp;
01029 #endif
01030         {
01031         register char *yy_cp = yy_c_buf_p;
01032 
01033         /* undo effects of setting up yytext */
01034         *yy_cp = yy_hold_char;
01035 
01036         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01037                 { /* need to shift things up to make room */
01038                 /* +2 for EOB chars. */
01039                 register int number_to_move = yy_n_chars + 2;
01040                 register char *dest = &yy_current_buffer->yy_ch_buf[
01041                                         yy_current_buffer->yy_buf_size + 2];
01042                 register char *source =
01043                                 &yy_current_buffer->yy_ch_buf[number_to_move];
01044 
01045                 while ( source > yy_current_buffer->yy_ch_buf )
01046                         *--dest = *--source;
01047 
01048                 yy_cp += (int) (dest - source);
01049                 yy_bp += (int) (dest - source);
01050                 yy_current_buffer->yy_n_chars =
01051                         yy_n_chars = yy_current_buffer->yy_buf_size;
01052 
01053                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01054                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
01055                 }
01056 
01057         *--yy_cp = (char) c;
01058 
01059 
01060         yytext_ptr = yy_bp;
01061         yy_hold_char = *yy_cp;
01062         yy_c_buf_p = yy_cp;
01063         }
01064 #endif  /* ifndef YY_NO_UNPUT */
01065 
01066 
01067 #ifdef __cplusplus
01068 static int yyinput()
01069 #else
01070 static int input()
01071 #endif
01072         {
01073         int c;
01074 
01075         *yy_c_buf_p = yy_hold_char;
01076 
01077         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
01078                 {
01079                 /* yy_c_buf_p now points to the character we want to return.
01080                  * If this occurs *before* the EOB characters, then it's a
01081                  * valid NUL; if not, then we've hit the end of the buffer.
01082                  */
01083                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01084                         /* This was really a NUL. */
01085                         *yy_c_buf_p = '\0';
01086 
01087                 else
01088                         { /* need more input */
01089                         int offset = yy_c_buf_p - yytext_ptr;
01090                         ++yy_c_buf_p;
01091 
01092                         switch ( yy_get_next_buffer() )
01093                                 {
01094                                 case EOB_ACT_LAST_MATCH:
01095                                         /* This happens because yy_g_n_b()
01096                                          * sees that we've accumulated a
01097                                          * token and flags that we need to
01098                                          * try matching the token before
01099                                          * proceeding.  But for input(),
01100                                          * there's no matching to consider.
01101                                          * So convert the EOB_ACT_LAST_MATCH
01102                                          * to EOB_ACT_END_OF_FILE.
01103                                          */
01104 
01105                                         /* Reset buffer status. */
01106                                         yyrestart( yyin );
01107 
01108                                         /* fall through */
01109 
01110                                 case EOB_ACT_END_OF_FILE:
01111                                         {
01112                                         if ( yywrap() )
01113                                                 return EOF;
01114 
01115                                         if ( ! yy_did_buffer_switch_on_eof )
01116                                                 YY_NEW_FILE;
01117 #ifdef __cplusplus
01118                                         return yyinput();
01119 #else
01120                                         return input();
01121 #endif
01122                                         }
01123 
01124                                 case EOB_ACT_CONTINUE_SCAN:
01125                                         yy_c_buf_p = yytext_ptr + offset;
01126                                         break;
01127                                 }
01128                         }
01129                 }
01130 
01131         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
01132         *yy_c_buf_p = '\0';     /* preserve yytext */
01133         yy_hold_char = *++yy_c_buf_p;
01134 
01135 
01136         return c;
01137         }
01138 
01139 
01140 #ifdef YY_USE_PROTOS
01141 void yyrestart( FILE *input_file )
01142 #else
01143 void yyrestart( input_file )
01144 FILE *input_file;
01145 #endif
01146         {
01147         if ( ! yy_current_buffer )
01148                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
01149 
01150         yy_init_buffer( yy_current_buffer, input_file );
01151         yy_load_buffer_state();
01152         }
01153 
01154 
01155 #ifdef YY_USE_PROTOS
01156 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
01157 #else
01158 void yy_switch_to_buffer( new_buffer )
01159 YY_BUFFER_STATE new_buffer;
01160 #endif
01161         {
01162         if ( yy_current_buffer == new_buffer )
01163                 return;
01164 
01165         if ( yy_current_buffer )
01166                 {
01167                 /* Flush out information for old buffer. */
01168                 *yy_c_buf_p = yy_hold_char;
01169                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
01170                 yy_current_buffer->yy_n_chars = yy_n_chars;
01171                 }
01172 
01173         yy_current_buffer = new_buffer;
01174         yy_load_buffer_state();
01175 
01176         /* We don't actually know whether we did this switch during
01177          * EOF (yywrap()) processing, but the only time this flag
01178          * is looked at is after yywrap() is called, so it's safe
01179          * to go ahead and always set it.
01180          */
01181         yy_did_buffer_switch_on_eof = 1;
01182         }
01183 
01184 
01185 #ifdef YY_USE_PROTOS
01186 void yy_load_buffer_state( void )
01187 #else
01188 void yy_load_buffer_state()
01189 #endif
01190         {
01191         yy_n_chars = yy_current_buffer->yy_n_chars;
01192         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
01193         yyin = yy_current_buffer->yy_input_file;
01194         yy_hold_char = *yy_c_buf_p;
01195         }
01196 
01197 
01198 #ifdef YY_USE_PROTOS
01199 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
01200 #else
01201 YY_BUFFER_STATE yy_create_buffer( file, size )
01202 FILE *file;
01203 int size;
01204 #endif
01205         {
01206         YY_BUFFER_STATE b;
01207 
01208         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
01209         if ( ! b )
01210                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01211 
01212         b->yy_buf_size = size;
01213 
01214         /* yy_ch_buf has to be 2 characters longer than the size given because
01215          * we need to put in 2 end-of-buffer characters.
01216          */
01217         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
01218         if ( ! b->yy_ch_buf )
01219                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01220 
01221         b->yy_is_our_buffer = 1;
01222 
01223         yy_init_buffer( b, file );
01224 
01225         return b;
01226         }
01227 
01228 
01229 #ifdef YY_USE_PROTOS
01230 void yy_delete_buffer( YY_BUFFER_STATE b )
01231 #else
01232 void yy_delete_buffer( b )
01233 YY_BUFFER_STATE b;
01234 #endif
01235         {
01236         if ( ! b )
01237                 return;
01238 
01239         if ( b == yy_current_buffer )
01240                 yy_current_buffer = (YY_BUFFER_STATE) 0;
01241 
01242         if ( b->yy_is_our_buffer )
01243                 yy_flex_free( (void *) b->yy_ch_buf );
01244 
01245         yy_flex_free( (void *) b );
01246         }
01247 
01248 
01249 
01250 #ifdef YY_USE_PROTOS
01251 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
01252 #else
01253 void yy_init_buffer( b, file )
01254 YY_BUFFER_STATE b;
01255 FILE *file;
01256 #endif
01257 
01258 
01259         {
01260         yy_flush_buffer( b );
01261 
01262         b->yy_input_file = file;
01263         b->yy_fill_buffer = 1;
01264 
01265 #if YY_ALWAYS_INTERACTIVE
01266         b->yy_is_interactive = 1;
01267 #else
01268 #if YY_NEVER_INTERACTIVE
01269         b->yy_is_interactive = 0;
01270 #else
01271         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01272 #endif
01273 #endif
01274         }
01275 
01276 
01277 #ifdef YY_USE_PROTOS
01278 void yy_flush_buffer( YY_BUFFER_STATE b )
01279 #else
01280 void yy_flush_buffer( b )
01281 YY_BUFFER_STATE b;
01282 #endif
01283 
01284         {
01285         if ( ! b )
01286                 return;
01287 
01288         b->yy_n_chars = 0;
01289 
01290         /* We always need two end-of-buffer characters.  The first causes
01291          * a transition to the end-of-buffer state.  The second causes
01292          * a jam in that state.
01293          */
01294         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01295         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01296 
01297         b->yy_buf_pos = &b->yy_ch_buf[0];
01298 
01299         b->yy_at_bol = 1;
01300         b->yy_buffer_status = YY_BUFFER_NEW;
01301 
01302         if ( b == yy_current_buffer )
01303                 yy_load_buffer_state();
01304         }
01305 
01306 
01307 #ifndef YY_NO_SCAN_BUFFER
01308 #ifdef YY_USE_PROTOS
01309 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
01310 #else
01311 YY_BUFFER_STATE yy_scan_buffer( base, size )
01312 char *base;
01313 yy_size_t size;
01314 #endif
01315         {
01316         YY_BUFFER_STATE b;
01317 
01318         if ( size < 2 ||
01319              base[size-2] != YY_END_OF_BUFFER_CHAR ||
01320              base[size-1] != YY_END_OF_BUFFER_CHAR )
01321                 /* They forgot to leave room for the EOB's. */
01322                 return 0;
01323 
01324         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
01325         if ( ! b )
01326                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
01327 
01328         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
01329         b->yy_buf_pos = b->yy_ch_buf = base;
01330         b->yy_is_our_buffer = 0;
01331         b->yy_input_file = 0;
01332         b->yy_n_chars = b->yy_buf_size;
01333         b->yy_is_interactive = 0;
01334         b->yy_at_bol = 1;
01335         b->yy_fill_buffer = 0;
01336         b->yy_buffer_status = YY_BUFFER_NEW;
01337 
01338         yy_switch_to_buffer( b );
01339 
01340         return b;
01341         }
01342 #endif
01343 
01344 
01345 #ifndef YY_NO_SCAN_STRING
01346 #ifdef YY_USE_PROTOS
01347 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
01348 #else
01349 YY_BUFFER_STATE yy_scan_string( yy_str )
01350 yyconst char *yy_str;
01351 #endif
01352         {
01353         int len;
01354         for ( len = 0; yy_str[len]; ++len )
01355                 ;
01356 
01357         return yy_scan_bytes( yy_str, len );
01358         }
01359 #endif
01360 
01361 
01362 #ifndef YY_NO_SCAN_BYTES
01363 #ifdef YY_USE_PROTOS
01364 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
01365 #else
01366 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
01367 yyconst char *bytes;
01368 int len;
01369 #endif
01370         {
01371         YY_BUFFER_STATE b;
01372         char *buf;
01373         yy_size_t n;
01374         int i;
01375 
01376         /* Get memory for full buffer, including space for trailing EOB's. */
01377         n = len + 2;
01378         buf = (char *) yy_flex_alloc( n );
01379         if ( ! buf )
01380                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
01381 
01382         for ( i = 0; i < len; ++i )
01383                 buf[i] = bytes[i];
01384 
01385         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
01386 
01387         b = yy_scan_buffer( buf, n );
01388         if ( ! b )
01389                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
01390 
01391         /* It's okay to grow etc. this buffer, and we should throw it
01392          * away when we're done.
01393          */
01394         b->yy_is_our_buffer = 1;
01395 
01396         return b;
01397         }
01398 #endif
01399 
01400 
01401 #ifndef YY_NO_PUSH_STATE
01402 #ifdef YY_USE_PROTOS
01403 static void yy_push_state( int new_state )
01404 #else
01405 static void yy_push_state( new_state )
01406 int new_state;
01407 #endif
01408         {
01409         if ( yy_start_stack_ptr >= yy_start_stack_depth )
01410                 {
01411                 yy_size_t new_size;
01412 
01413                 yy_start_stack_depth += YY_START_STACK_INCR;
01414                 new_size = yy_start_stack_depth * sizeof( int );
01415 
01416                 if ( ! yy_start_stack )
01417                         yy_start_stack = (int *) yy_flex_alloc( new_size );
01418 
01419                 else
01420                         yy_start_stack = (int *) yy_flex_realloc(
01421                                         (void *) yy_start_stack, new_size );
01422 
01423                 if ( ! yy_start_stack )
01424                         YY_FATAL_ERROR(
01425                         "out of memory expanding start-condition stack" );
01426                 }
01427 
01428         yy_start_stack[yy_start_stack_ptr++] = YY_START;
01429 
01430         BEGIN(new_state);
01431         }
01432 #endif
01433 
01434 
01435 #ifndef YY_NO_POP_STATE
01436 static void yy_pop_state()
01437         {
01438         if ( --yy_start_stack_ptr < 0 )
01439                 YY_FATAL_ERROR( "start-condition stack underflow" );
01440 
01441         BEGIN(yy_start_stack[yy_start_stack_ptr]);
01442         }
01443 #endif
01444 
01445 
01446 #ifndef YY_NO_TOP_STATE
01447 static int yy_top_state()
01448         {
01449         return yy_start_stack[yy_start_stack_ptr - 1];
01450         }
01451 #endif
01452 
01453 #ifndef YY_EXIT_FAILURE
01454 #define YY_EXIT_FAILURE 2
01455 #endif
01456 
01457 #ifdef YY_USE_PROTOS
01458 static void yy_fatal_error( yyconst char msg[] )
01459 #else
01460 static void yy_fatal_error( msg )
01461 char msg[];
01462 #endif
01463         {
01464         (void) fprintf( stderr, "%s\n", msg );
01465         exit( YY_EXIT_FAILURE );
01466         }
01467 
01468 
01469 
01470 /* Redefine yyless() so it works in section 3 code. */
01471 
01472 #undef yyless
01473 #define yyless(n) \
01474         do \
01475                 { \
01476                 /* Undo effects of setting up yytext. */ \
01477                 yytext[yyleng] = yy_hold_char; \
01478                 yy_c_buf_p = yytext + n; \
01479                 yy_hold_char = *yy_c_buf_p; \
01480                 *yy_c_buf_p = '\0'; \
01481                 yyleng = n; \
01482                 } \
01483         while ( 0 )
01484 
01485 
01486 /* Internal utility routines. */
01487 
01488 #ifndef yytext_ptr
01489 #ifdef YY_USE_PROTOS
01490 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
01491 #else
01492 static void yy_flex_strncpy( s1, s2, n )
01493 char *s1;
01494 yyconst char *s2;
01495 int n;
01496 #endif
01497         {
01498         register int i;
01499         for ( i = 0; i < n; ++i )
01500                 s1[i] = s2[i];
01501         }
01502 #endif
01503 
01504 #ifdef YY_NEED_STRLEN
01505 #ifdef YY_USE_PROTOS
01506 static int yy_flex_strlen( yyconst char *s )
01507 #else
01508 static int yy_flex_strlen( s )
01509 yyconst char *s;
01510 #endif
01511         {
01512         register int n;
01513         for ( n = 0; s[n]; ++n )
01514                 ;
01515 
01516         return n;
01517         }
01518 #endif
01519 
01520 
01521 #ifdef YY_USE_PROTOS
01522 static void *yy_flex_alloc( yy_size_t size )
01523 #else
01524 static void *yy_flex_alloc( size )
01525 yy_size_t size;
01526 #endif
01527         {
01528         return (void *) malloc( size );
01529         }
01530 
01531 #ifdef YY_USE_PROTOS
01532 static void *yy_flex_realloc( void *ptr, yy_size_t size )
01533 #else
01534 static void *yy_flex_realloc( ptr, size )
01535 void *ptr;
01536 yy_size_t size;
01537 #endif
01538         {
01539         /* The cast to (char *) in the following accommodates both
01540          * implementations that use char* generic pointers, and those
01541          * that use void* generic pointers.  It works with the latter
01542          * because both ANSI C and C++ allow castless assignment from
01543          * any pointer type to void*, and deal with argument conversions
01544          * as though doing an assignment.
01545          */
01546         return (void *) realloc( (char *) ptr, size );
01547         }
01548 
01549 #ifdef YY_USE_PROTOS
01550 static void yy_flex_free( void *ptr )
01551 #else
01552 static void yy_flex_free( ptr )
01553 void *ptr;
01554 #endif
01555         {
01556         free( ptr );
01557         }
01558 
01559 #if YY_MAIN
01560 int main()
01561         {
01562         yylex();
01563         return 0;
01564         }
01565 #endif
01566 #line 62 "tsp_ascii_writer_config.lex"
01567 
01568  
Framework Home Page.

Beware !! TSP wave is coming...