/home/enzo/treballs/fib/pfc/nanocomp/src/lex.nanocomp.cpp

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

Generated on Fri Sep 1 23:55:14 2006 for NanoComp by  doxygen 1.4.6