X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/49e85177c669d793e84242983a1b1f430e47184e..91f89571fd9b96107be2af0cadbb5638e30efe83:/src/xbt/automaton/automaton_lexer.yy.c diff --git a/src/xbt/automaton/automaton_lexer.yy.c b/src/xbt/automaton/automaton_lexer.yy.c index 9a91800cdd..d0d4d027ff 100644 --- a/src/xbt/automaton/automaton_lexer.yy.c +++ b/src/xbt/automaton/automaton_lexer.yy.c @@ -28,7 +28,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -53,7 +53,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -70,7 +70,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -181,7 +181,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int xbt_automaton_parser_leng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t xbt_automaton_parser_leng; extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out; @@ -190,7 +195,8 @@ extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -207,11 +213,6 @@ extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -229,7 +230,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -252,7 +253,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -299,8 +300,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when xbt_automaton_parser_text is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int xbt_automaton_parser_leng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t xbt_automaton_parser_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -328,7 +329,7 @@ static void xbt_automaton_parser__init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char *bytes,yy_size_t len ); void *xbt_automaton_parser_alloc (yy_size_t ); void *xbt_automaton_parser_realloc (void *,yy_size_t ); @@ -360,7 +361,7 @@ void xbt_automaton_parser_free (void * ); /* Begin user sect3 */ -#define xbt_automaton_parser_wrap(n) 1 +#define xbt_automaton_parser_wrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -530,10 +531,10 @@ char *xbt_automaton_parser_text; #include #include "parserPromela.tab.hacc" - + extern YYSTYPE yylval; - -#line 537 "automaton_lexer.yy.c" + +#line 538 "automaton_lexer.yy.c" #define INITIAL 0 @@ -572,7 +573,7 @@ FILE *xbt_automaton_parser_get_out (void ); void xbt_automaton_parser_set_out (FILE * out_str ); -int xbt_automaton_parser_get_leng (void ); +yy_size_t xbt_automaton_parser_get_leng (void ); char *xbt_automaton_parser_get_text (void ); @@ -593,7 +594,7 @@ extern int xbt_automaton_parser_wrap (void ); #endif static void yyunput (int c,char *buf_ptr ); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -716,14 +717,9 @@ extern int xbt_automaton_parser_lex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 34 "parserPromela.lex" - - -#line 727 "automaton_lexer.yy.c" + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; if ( !(yy_init) ) { @@ -751,6 +747,12 @@ YY_DECL xbt_automaton_parser__load_buffer_state( ); } + { +#line 34 "parserPromela.lex" + + +#line 755 "automaton_lexer.yy.c" + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -767,7 +769,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -900,13 +902,13 @@ YY_RULE_SETUP case 19: YY_RULE_SETUP #line 59 "parserPromela.lex" -{ sscanf(xbt_automaton_parser_text,"%lf",&yylval.real); +{ sscanf(xbt_automaton_parser_text,"%lf",&yylval.real); return (LITT_REEL); } YY_BREAK case 20: YY_RULE_SETUP #line 62 "parserPromela.lex" -{ sscanf(xbt_automaton_parser_text,"%d",&yylval.integer); +{ sscanf(xbt_automaton_parser_text,"%d",&yylval.integer); return (LITT_ENT); } YY_BREAK case 21: @@ -914,7 +916,7 @@ case 21: YY_RULE_SETUP #line 65 "parserPromela.lex" { yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1); - sscanf(xbt_automaton_parser_text,"%s",yylval.string); + sscanf(xbt_automaton_parser_text,"%s",yylval.string); return (LITT_CHAINE); } YY_BREAK case 22: @@ -940,7 +942,7 @@ YY_RULE_SETUP #line 77 "parserPromela.lex" ECHO; YY_BREAK -#line 944 "automaton_lexer.yy.c" +#line 946 "automaton_lexer.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1071,6 +1073,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of xbt_automaton_parser_lex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1082,9 +1085,9 @@ case YY_STATE_EOF(INITIAL): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1126,21 +1129,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; 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; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1171,7 +1174,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1216,14 +1219,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; - + yy_state_type yy_current_state; + char *yy_cp; + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1248,10 +1251,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1266,13 +1269,13 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 53); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) + static void yyunput (int c, char * yy_bp ) { - register char *yy_cp; - + char *yy_cp; + yy_cp = (yy_c_buf_p); /* undo effects of setting up xbt_automaton_parser_text */ @@ -1281,10 +1284,10 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + yy_size_t number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1315,7 +1318,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1330,7 +1333,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1382,12 +1385,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void xbt_automaton_parser_restart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ xbt_automaton_parser_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -1400,11 +1403,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void xbt_automaton_parser__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * xbt_automaton_parser_pop_buffer_state(); @@ -1444,13 +1447,13 @@ static void xbt_automaton_parser__load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE xbt_automaton_parser__create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" ); @@ -1473,11 +1476,11 @@ static void xbt_automaton_parser__load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with xbt_automaton_parser__create_buffer() - * + * */ void xbt_automaton_parser__delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -1490,10 +1493,6 @@ static void xbt_automaton_parser__load_buffer_state (void) xbt_automaton_parser_free((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a xbt_automaton_parser_restart() or at EOF. @@ -1502,7 +1501,7 @@ extern int isatty (int ); { int oerrno = errno; - + xbt_automaton_parser__flush_buffer(b ); b->yy_input_file = file; @@ -1518,13 +1517,13 @@ extern int isatty (int ); } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void xbt_automaton_parser__flush_buffer (YY_BUFFER_STATE b ) { @@ -1553,7 +1552,7 @@ extern int isatty (int ); * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -1583,7 +1582,7 @@ void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void xbt_automaton_parser_pop_buffer_state (void) { @@ -1606,8 +1605,8 @@ void xbt_automaton_parser_pop_buffer_state (void) */ static void xbt_automaton_parser_ensure_buffer_stack (void) { - int num_to_alloc; - + yy_size_t num_to_alloc; + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -1620,9 +1619,9 @@ static void xbt_automaton_parser_ensure_buffer_stack (void) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1650,13 +1649,13 @@ static void xbt_automaton_parser_ensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -1685,14 +1684,14 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char * base, yy_size_t size /** Setup the input buffer state to scan a string. The next call to xbt_automaton_parser_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * xbt_automaton_parser__scan_bytes() instead. */ YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr ) { - + return xbt_automaton_parser__scan_bytes(yystr,strlen(yystr) ); } @@ -1700,16 +1699,16 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; - + yy_size_t i; + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) xbt_automaton_parser_alloc(n ); @@ -1763,16 +1762,16 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int xbt_automaton_parser_get_lineno (void) { - + return xbt_automaton_parser_lineno; } /** Get the input stream. - * + * */ FILE *xbt_automaton_parser_get_in (void) { @@ -1780,7 +1779,7 @@ FILE *xbt_automaton_parser_get_in (void) } /** Get the output stream. - * + * */ FILE *xbt_automaton_parser_get_out (void) { @@ -1788,15 +1787,15 @@ FILE *xbt_automaton_parser_get_out (void) } /** Get the length of the current token. - * + * */ -int xbt_automaton_parser_get_leng (void) +yy_size_t xbt_automaton_parser_get_leng (void) { return xbt_automaton_parser_leng; } /** Get the current token. - * + * */ char *xbt_automaton_parser_get_text (void) @@ -1806,18 +1805,18 @@ char *xbt_automaton_parser_get_text (void) /** Set the current line number. * @param line_number - * + * */ void xbt_automaton_parser_set_lineno (int line_number ) { - + xbt_automaton_parser_lineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see xbt_automaton_parser__switch_to_buffer */ void xbt_automaton_parser_set_in (FILE * in_str ) @@ -1871,7 +1870,7 @@ static int yy_init_globals (void) /* xbt_automaton_parser_lex_destroy is for both reentrant and non-reentrant scanners. */ int xbt_automaton_parser_lex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER ); @@ -1897,7 +1896,7 @@ int xbt_automaton_parser_lex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -1906,7 +1905,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -1938,7 +1937,7 @@ void xbt_automaton_parser_free (void * ptr ) #define YYTABLES_NAME "yytables" -#line 77 "parserPromela.lex" +#line 76 "parserPromela.lex"