123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551 |
- #define FLEX_SCANNER
- #define YY_FLEX_MAJOR_VERSION 2
- #define YY_FLEX_MINOR_VERSION 5
- %-
- #include <stdio.h>
- #include <errno.h>
- %*
- #ifdef c_plusplus
- #ifndef __cplusplus
- #define __cplusplus
- #endif
- #endif
- #ifdef __cplusplus
- #include <stdlib.h>
- %+
- #include <iostream>
- class istream;
- using std::cin;
- using std::cout;
- using std::cerr;
- %*
- #ifndef _WIN32
- #include <unistd.h>
- #endif
- #define YY_USE_PROTOS
- #define YY_USE_CONST
- #else
- #if __STDC__
- #define YY_USE_PROTOS
- #define YY_USE_CONST
- #endif
- #endif
- #ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
- #include <io.h>
- #include <stdlib.h>
- #define YY_USE_CONST
- #define YY_USE_PROTOS
- #endif
- #ifdef YY_USE_CONST
- #define yyconst const
- #else
- #define yyconst
- #endif
- #ifdef YY_USE_PROTOS
- #define YY_PROTO(proto) proto
- #else
- #define YY_PROTO(proto) ()
- #endif
- #define YY_NULL 0
- #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
- #define BEGIN yy_start = 1 + 2 *
- #define YY_START ((yy_start - 1) / 2)
- #define YYSTATE YY_START
- #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
- #define YY_NEW_FILE yyrestart( yyin )
- #define YY_END_OF_BUFFER_CHAR 0
- #define YY_BUF_SIZE 16384
- typedef struct yy_buffer_state *YY_BUFFER_STATE;
- extern int yyleng;
- %-
- extern FILE *yyin, *yyout;
- %*
- #define EOB_ACT_CONTINUE_SCAN 0
- #define EOB_ACT_END_OF_FILE 1
- #define EOB_ACT_LAST_MATCH 2
- #define yyless(n) \
- do \
- { \
- \
- *yy_cp = yy_hold_char; \
- YY_RESTORE_YY_MORE_OFFSET \
- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; \
- } \
- while ( 0 )
- #define unput(c) yyunput( c, yytext_ptr )
- typedef unsigned int yy_size_t;
- struct yy_buffer_state
- {
- %-
- FILE *yy_input_file;
- %+
- istream* yy_input_file;
- %*
- char *yy_ch_buf;
- char *yy_buf_pos;
-
- yy_size_t yy_buf_size;
-
- int yy_n_chars;
-
- int yy_is_our_buffer;
-
- int yy_is_interactive;
-
- int yy_at_bol;
-
- int yy_fill_buffer;
- int yy_buffer_status;
- #define YY_BUFFER_NEW 0
- #define YY_BUFFER_NORMAL 1
-
- #define YY_BUFFER_EOF_PENDING 2
- };
- %- Standard (non-C++) definition
- static YY_BUFFER_STATE yy_current_buffer = 0;
- %*
- #define YY_CURRENT_BUFFER yy_current_buffer
- %- Standard (non-C++) definition
- static char yy_hold_char;
- static int yy_n_chars;
- int yyleng;
- static char *yy_c_buf_p = (char *) 0;
- static int yy_init = 1;
- static int yy_start = 0;
- static int yy_did_buffer_switch_on_eof;
- void yyrestart YY_PROTO(( FILE *input_file ));
- void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
- void yy_load_buffer_state YY_PROTO(( void ));
- YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
- void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
- void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
- void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
- #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
- YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
- YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
- YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
- %*
- static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
- static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
- static void yy_flex_free YY_PROTO(( void * ));
- #define yy_new_buffer yy_create_buffer
- #define yy_set_interactive(is_interactive) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_is_interactive = is_interactive; \
- }
- #define yy_set_bol(at_bol) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_at_bol = at_bol; \
- }
- #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
- %% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
- %- Standard (non-C++) definition
- static yy_state_type yy_get_previous_state YY_PROTO(( void ));
- static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
- static int yy_get_next_buffer YY_PROTO(( void ));
- static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
- %*
- #define YY_DO_BEFORE_ACTION \
- yytext_ptr = yy_bp; \
- %% code to fiddle yytext and yyleng for yymore() goes here
- yy_hold_char = *yy_cp; \
- *yy_cp = '\0'; \
- %% code to copy yytext_ptr to yytext[] goes here, if %array
- yy_c_buf_p = yy_cp;
- %% data tables for the DFA and the user's section 1 definitions go here
- #ifndef YY_SKIP_YYWRAP
- #ifdef __cplusplus
- extern "C" int yywrap YY_PROTO(( void ));
- #else
- extern int yywrap YY_PROTO(( void ));
- #endif
- #endif
- %-
- #ifndef YY_NO_UNPUT
- static void yyunput YY_PROTO(( int c, char *buf_ptr ));
- #endif
- %*
- #ifndef yytext_ptr
- static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
- #endif
- #ifdef YY_NEED_STRLEN
- static int yy_flex_strlen YY_PROTO(( yyconst char * ));
- #endif
- #ifndef YY_NO_INPUT
- %- Standard (non-C++) definition
- #ifdef __cplusplus
- static int yyinput YY_PROTO(( void ));
- #else
- static int input YY_PROTO(( void ));
- #endif
- %*
- #endif
- #if YY_STACK_USED
- static int yy_start_stack_ptr = 0;
- static int yy_start_stack_depth = 0;
- static int *yy_start_stack = 0;
- #ifndef YY_NO_PUSH_STATE
- static void yy_push_state YY_PROTO(( int new_state ));
- #endif
- #ifndef YY_NO_POP_STATE
- static void yy_pop_state YY_PROTO(( void ));
- #endif
- #ifndef YY_NO_TOP_STATE
- static int yy_top_state YY_PROTO(( void ));
- #endif
- #else
- #define YY_NO_PUSH_STATE 1
- #define YY_NO_POP_STATE 1
- #define YY_NO_TOP_STATE 1
- #endif
- #ifdef YY_MALLOC_DECL
- YY_MALLOC_DECL
- #else
- #if __STDC__
- #ifndef __cplusplus
- #include <stdlib.h>
- #endif
- #else
- #endif
- #endif
- #ifndef YY_READ_BUF_SIZE
- #define YY_READ_BUF_SIZE 8192
- #endif
- #ifndef ECHO
- %- Standard (non-C++) definition
- #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
- %+ C++ definition
- #define ECHO LexerOutput( yytext, yyleng )
- %*
- #endif
- #ifndef YY_INPUT
- #define YY_INPUT(buf,result,max_size) \
- %% fread()/read() definition of YY_INPUT goes here unless we're doing C++
- %+ C++ definition
- if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
- YY_FATAL_ERROR( "input in flex scanner failed" );
- %*
- #endif
- #ifndef yyterminate
- #define yyterminate() return YY_NULL
- #endif
- #ifndef YY_START_STACK_INCR
- #define YY_START_STACK_INCR 25
- #endif
- #ifndef YY_FATAL_ERROR
- %-
- #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
- %+
- #define YY_FATAL_ERROR(msg) LexerError( msg )
- %*
- #endif
- #ifndef YY_DECL
- %- Standard (non-C++) definition
- #define YY_DECL int yylex YY_PROTO(( void ))
- %+ C++ definition
- #define YY_DECL int yyFlexLexer::yylex()
- %*
- #endif
- #ifndef YY_USER_ACTION
- #define YY_USER_ACTION
- #endif
- #ifndef YY_BREAK
- #define YY_BREAK break;
- #endif
- %% YY_RULE_SETUP definition goes here
- YY_DECL
- {
- yy_state_type yy_current_state;
- char *yy_cp, *yy_bp;
- int yy_act;
- %% user's declarations go here
- if ( yy_init )
- {
- yy_init = 0;
- #ifdef YY_USER_INIT
- YY_USER_INIT;
- #endif
- if ( ! yy_start )
- yy_start = 1;
- if ( ! yyin )
- %-
- yyin = stdin;
- %+
- yyin = &cin;
- %*
- if ( ! yyout )
- %-
- yyout = stdout;
- %+
- yyout = &cout;
- %*
- if ( ! yy_current_buffer )
- yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
- yy_load_buffer_state();
- }
- while ( 1 )
- {
- %% yymore()-related code goes here
- yy_cp = yy_c_buf_p;
-
- *yy_cp = yy_hold_char;
-
- yy_bp = yy_cp;
- %% code to set up and find next match goes here
- yy_find_action:
- %% code to find the action number goes here
- YY_DO_BEFORE_ACTION;
- %% code for yylineno update goes here
- do_action:
- %% debug code goes here
- switch ( yy_act )
- {
- %% actions go here
- case YY_END_OF_BUFFER:
- {
-
- int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
-
- *yy_cp = yy_hold_char;
- YY_RESTORE_YY_MORE_OFFSET
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
- {
-
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yy_current_buffer->yy_input_file = yyin;
- yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- {
- yy_state_type yy_next_state;
- yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
- yy_current_state = yy_get_previous_state();
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
- yy_bp = yytext_ptr + YY_MORE_ADJ;
- if ( yy_next_state )
- {
-
- yy_cp = ++yy_c_buf_p;
- yy_current_state = yy_next_state;
- goto yy_match;
- }
- else
- {
- %% code to do back-up for compressed tables and set up yy_cp goes here
- goto yy_find_action;
- }
- }
- else switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_END_OF_FILE:
- {
- yy_did_buffer_switch_on_eof = 0;
- if ( yywrap() )
- {
-
- yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
- else
- {
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
- }
- break;
- }
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p =
- yytext_ptr + yy_amount_of_matched_text;
- yy_current_state = yy_get_previous_state();
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
- goto yy_match;
- case EOB_ACT_LAST_MATCH:
- yy_c_buf_p =
- &yy_current_buffer->yy_ch_buf[yy_n_chars];
- yy_current_state = yy_get_previous_state();
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- }
- }
- }
- %+
- yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
- {
- yyin = arg_yyin;
- yyout = arg_yyout;
- yy_c_buf_p = 0;
- yy_init = 1;
- yy_start = 0;
- yy_flex_debug = 0;
- yylineno = 1;
- yy_did_buffer_switch_on_eof = 0;
- yy_looking_for_trail_begin = 0;
- yy_more_flag = 0;
- yy_more_len = 0;
- yy_more_offset = yy_prev_more_offset = 0;
- yy_start_stack_ptr = yy_start_stack_depth = 0;
- yy_start_stack = 0;
- yy_current_buffer = 0;
- #ifdef YY_USES_REJECT
- yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
- #else
- yy_state_buf = 0;
- #endif
- }
- yyFlexLexer::~yyFlexLexer()
- {
- delete[] yy_state_buf;
- yy_delete_buffer( yy_current_buffer );
- }
- void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
- {
- if ( new_in )
- {
- yy_delete_buffer( yy_current_buffer );
- yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
- }
- if ( new_out )
- yyout = new_out;
- }
- #ifdef YY_INTERACTIVE
- int yyFlexLexer::LexerInput( char* buf, int )
- #else
- int yyFlexLexer::LexerInput( char* buf, int max_size )
- #endif
- {
- if ( yyin->eof() || yyin->fail() )
- return 0;
- #ifdef YY_INTERACTIVE
- yyin->get( buf[0] );
- if ( yyin->eof() )
- return 0;
- if ( yyin->bad() )
- return -1;
- return 1;
- #else
- (void) yyin->read( buf, max_size );
- if ( yyin->bad() )
- return -1;
- else
- return yyin->gcount();
- #endif
- }
- void yyFlexLexer::LexerOutput( const char* buf, int size )
- {
- (void) yyout->write( buf, size );
- }
- %*
- %-
- static int yy_get_next_buffer()
- %+
- int yyFlexLexer::yy_get_next_buffer()
- %*
- {
- char *dest = yy_current_buffer->yy_ch_buf;
- char *source = yytext_ptr;
- int number_to_move, i;
- int ret_val;
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
- if ( yy_current_buffer->yy_fill_buffer == 0 )
- {
- if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
- {
-
- return EOB_ACT_END_OF_FILE;
- }
- else
- {
-
- return EOB_ACT_LAST_MATCH;
- }
- }
-
-
- number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-
- yy_current_buffer->yy_n_chars = yy_n_chars = 0;
- else
- {
- int num_to_read =
- yy_current_buffer->yy_buf_size - number_to_move - 1;
- while ( num_to_read <= 0 )
- {
- #ifdef YY_USES_REJECT
- YY_FATAL_ERROR(
- "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
- #else
-
- YY_BUFFER_STATE b = yy_current_buffer;
- int yy_c_buf_p_offset =
- (int) (yy_c_buf_p - b->yy_ch_buf);
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
- b->yy_ch_buf = (char *)
-
- yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 );
- }
- else
-
- b->yy_ch_buf = 0;
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
- num_to_read = yy_current_buffer->yy_buf_size -
- number_to_move - 1;
- #endif
- }
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
- yy_n_chars, num_to_read );
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
- if ( yy_n_chars == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
- }
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
- yy_n_chars += number_to_move;
- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
- yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
- return ret_val;
- }
- %-
- static yy_state_type yy_get_previous_state()
- %+
- yy_state_type yyFlexLexer::yy_get_previous_state()
- %*
- {
- yy_state_type yy_current_state;
- char *yy_cp;
- %% code to get the start state into yy_current_state goes here
- for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
- {
- %% code to find the next state goes here
- }
- return yy_current_state;
- }
- %-
- #ifdef YY_USE_PROTOS
- static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
- #else
- static yy_state_type yy_try_NUL_trans( yy_current_state )
- yy_state_type yy_current_state;
- #endif
- %+
- yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
- %*
- {
- int yy_is_jam;
- %% code to find the next state, and perhaps do backing up, goes here
- return yy_is_jam ? 0 : yy_current_state;
- }
- %-
- #ifndef YY_NO_UNPUT
- #ifdef YY_USE_PROTOS
- static void yyunput( int c, char *yy_bp )
- #else
- static void yyunput( c, yy_bp )
- int c;
- char *yy_bp;
- #endif
- %+
- void yyFlexLexer::yyunput( int c, char* yy_bp )
- %*
- {
- char *yy_cp = yy_c_buf_p;
-
- *yy_cp = yy_hold_char;
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- {
-
- int number_to_move = yy_n_chars + 2;
- char *dest = &yy_current_buffer->yy_ch_buf[
- yy_current_buffer->yy_buf_size + 2];
- char *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
- while ( source > yy_current_buffer->yy_ch_buf )
- *--dest = *--source;
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- yy_current_buffer->yy_n_chars =
- yy_n_chars = yy_current_buffer->yy_buf_size;
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
- *--yy_cp = (char) c;
- %% update yylineno here
- yytext_ptr = yy_bp;
- yy_hold_char = *yy_cp;
- yy_c_buf_p = yy_cp;
- }
- %-
- #endif
- %*
- %-
- #ifdef __cplusplus
- static int yyinput()
- #else
- static int input()
- #endif
- %+
- int yyFlexLexer::yyinput()
- %*
- {
- int c;
- *yy_c_buf_p = yy_hold_char;
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
- {
-
- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
-
- *yy_c_buf_p = '\0';
- else
- {
- int offset = yy_c_buf_p - yytext_ptr;
- ++yy_c_buf_p;
- switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_LAST_MATCH:
-
-
- yyrestart( yyin );
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap() )
- return EOF;
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
- #ifdef __cplusplus
- return yyinput();
- #else
- return input();
- #endif
- }
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext_ptr + offset;
- break;
- }
- }
- }
- c = *(unsigned char *) yy_c_buf_p;
- *yy_c_buf_p = '\0';
- yy_hold_char = *++yy_c_buf_p;
- %% update BOL and yylineno
- return c;
- }
- %-
- #ifdef YY_USE_PROTOS
- void yyrestart( FILE *input_file )
- #else
- void yyrestart( input_file )
- FILE *input_file;
- #endif
- %+
- void yyFlexLexer::yyrestart( istream* input_file )
- %*
- {
- if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
- }
- %-
- #ifdef YY_USE_PROTOS
- void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
- #else
- void yy_switch_to_buffer( new_buffer )
- YY_BUFFER_STATE new_buffer;
- #endif
- %+
- void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
- %*
- {
- if ( yy_current_buffer == new_buffer )
- return;
- if ( yy_current_buffer )
- {
-
- *yy_c_buf_p = yy_hold_char;
- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
-
- yy_did_buffer_switch_on_eof = 1;
- }
- %-
- #ifdef YY_USE_PROTOS
- void yy_load_buffer_state( void )
- #else
- void yy_load_buffer_state()
- #endif
- %+
- void yyFlexLexer::yy_load_buffer_state()
- %*
- {
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
- yyin = yy_current_buffer->yy_input_file;
- yy_hold_char = *yy_c_buf_p;
- }
- %-
- #ifdef YY_USE_PROTOS
- YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
- #else
- YY_BUFFER_STATE yy_create_buffer( file, size )
- FILE *file;
- int size;
- #endif
- %+
- YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
- %*
- {
- YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = size;
-
- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_is_our_buffer = 1;
- yy_init_buffer( b, file );
- return b;
- }
- %-
- #ifdef YY_USE_PROTOS
- void yy_delete_buffer( YY_BUFFER_STATE b )
- #else
- void yy_delete_buffer( b )
- YY_BUFFER_STATE b;
- #endif
- %+
- void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
- %*
- {
- if ( ! b )
- return;
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
- if ( b->yy_is_our_buffer )
- yy_flex_free( (void *) b->yy_ch_buf );
- yy_flex_free( (void *) b );
- }
- %-
- #ifndef _WIN32
- #include <unistd.h>
- #else
- #ifndef YY_ALWAYS_INTERACTIVE
- #ifndef YY_NEVER_INTERACTIVE
- extern int isatty YY_PROTO(( int ));
- #endif
- #endif
- #endif
- #ifdef YY_USE_PROTOS
- void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
- #else
- void yy_init_buffer( b, file )
- YY_BUFFER_STATE b;
- FILE *file;
- #endif
- %+
- void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
- %*
- {
- yy_flush_buffer( b );
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
- %-
- #if YY_ALWAYS_INTERACTIVE
- b->yy_is_interactive = 1;
- #else
- #if YY_NEVER_INTERACTIVE
- b->yy_is_interactive = 0;
- #else
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
- #endif
- #endif
- %+
- b->yy_is_interactive = 0;
- %*
- }
- %-
- #ifdef YY_USE_PROTOS
- void yy_flush_buffer( YY_BUFFER_STATE b )
- #else
- void yy_flush_buffer( b )
- YY_BUFFER_STATE b;
- #endif
- %+
- void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
- %*
- {
- if ( ! b )
- return;
- b->yy_n_chars = 0;
-
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
- b->yy_buf_pos = &b->yy_ch_buf[0];
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == yy_current_buffer )
- yy_load_buffer_state();
- }
- %*
- #ifndef YY_NO_SCAN_BUFFER
- %-
- #ifdef YY_USE_PROTOS
- YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
- #else
- YY_BUFFER_STATE yy_scan_buffer( base, size )
- char *base;
- yy_size_t size;
- #endif
- {
- YY_BUFFER_STATE b;
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
-
- return 0;
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2;
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
- yy_switch_to_buffer( b );
- return b;
- }
- %*
- #endif
- #ifndef YY_NO_SCAN_STRING
- %-
- #ifdef YY_USE_PROTOS
- YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
- #else
- YY_BUFFER_STATE yy_scan_string( yy_str )
- yyconst char *yy_str;
- #endif
- {
- int len;
- for ( len = 0; yy_str[len]; ++len )
- ;
- return yy_scan_bytes( yy_str, len );
- }
- %*
- #endif
- #ifndef YY_NO_SCAN_BYTES
- %-
- #ifdef YY_USE_PROTOS
- YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
- #else
- YY_BUFFER_STATE yy_scan_bytes( bytes, len )
- yyconst char *bytes;
- int len;
- #endif
- {
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
-
- n = len + 2;
- buf = (char *) yy_flex_alloc( n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
- for ( i = 0; i < len; ++i )
- buf[i] = bytes[i];
- buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer( buf, n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
- b->yy_is_our_buffer = 1;
- return b;
- }
- %*
- #endif
- #ifndef YY_NO_PUSH_STATE
- %-
- #ifdef YY_USE_PROTOS
- static void yy_push_state( int new_state )
- #else
- static void yy_push_state( new_state )
- int new_state;
- #endif
- %+
- void yyFlexLexer::yy_push_state( int new_state )
- %*
- {
- if ( yy_start_stack_ptr >= yy_start_stack_depth )
- {
- yy_size_t new_size;
- yy_start_stack_depth += YY_START_STACK_INCR;
- new_size = yy_start_stack_depth * sizeof( int );
- if ( ! yy_start_stack )
- yy_start_stack = (int *) yy_flex_alloc( new_size );
- else
- yy_start_stack = (int *) yy_flex_realloc(
- (void *) yy_start_stack, new_size );
- if ( ! yy_start_stack )
- YY_FATAL_ERROR(
- "out of memory expanding start-condition stack" );
- }
- yy_start_stack[yy_start_stack_ptr++] = YY_START;
- BEGIN(new_state);
- }
- #endif
- #ifndef YY_NO_POP_STATE
- %-
- static void yy_pop_state()
- %+
- void yyFlexLexer::yy_pop_state()
- %*
- {
- if ( --yy_start_stack_ptr < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
- BEGIN(yy_start_stack[yy_start_stack_ptr]);
- }
- #endif
- #ifndef YY_NO_TOP_STATE
- %-
- static int yy_top_state()
- %+
- int yyFlexLexer::yy_top_state()
- %*
- {
- return yy_start_stack[yy_start_stack_ptr - 1];
- }
- #endif
- #ifndef YY_EXIT_FAILURE
- #define YY_EXIT_FAILURE 2
- #endif
- %-
- #ifdef YY_USE_PROTOS
- static void yy_fatal_error( yyconst char msg[] )
- #else
- static void yy_fatal_error( msg )
- char msg[];
- #endif
- {
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
- }
- %+
- void yyFlexLexer::LexerError( yyconst char msg[] )
- {
- cerr << msg << '\n';
- exit( YY_EXIT_FAILURE );
- }
- %*
- #undef yyless
- #define yyless(n) \
- do \
- { \
- \
- yytext[yyleng] = yy_hold_char; \
- yy_c_buf_p = yytext + n; \
- yy_hold_char = *yy_c_buf_p; \
- *yy_c_buf_p = '\0'; \
- yyleng = n; \
- } \
- while ( 0 )
- #ifndef yytext_ptr
- #ifdef YY_USE_PROTOS
- static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
- #else
- static void yy_flex_strncpy( s1, s2, n )
- char *s1;
- yyconst char *s2;
- int n;
- #endif
- {
- int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
- }
- #endif
- #ifdef YY_NEED_STRLEN
- #ifdef YY_USE_PROTOS
- static int yy_flex_strlen( yyconst char *s )
- #else
- static int yy_flex_strlen( s )
- yyconst char *s;
- #endif
- {
- int n;
- for ( n = 0; s[n]; ++n )
- ;
- return n;
- }
- #endif
- #ifdef YY_USE_PROTOS
- static void *yy_flex_alloc( yy_size_t size )
- #else
- static void *yy_flex_alloc( size )
- yy_size_t size;
- #endif
- {
- return (void *) malloc( size );
- }
- #ifdef YY_USE_PROTOS
- static void *yy_flex_realloc( void *ptr, yy_size_t size )
- #else
- static void *yy_flex_realloc( ptr, size )
- void *ptr;
- yy_size_t size;
- #endif
- {
-
- return (void *) realloc( (char *) ptr, size );
- }
- #ifdef YY_USE_PROTOS
- static void yy_flex_free( void *ptr )
- #else
- static void yy_flex_free( ptr )
- void *ptr;
- #endif
- {
- free( ptr );
- }
- #if YY_MAIN
- int main()
- {
- yylex();
- return 0;
- }
- #endif
|