The fasta parser should not have unrecognized characters anymore

This commit is contained in:
Celine Mercier
2016-02-22 15:28:33 +01:00
parent fa22ffb493
commit 0c4c37d5ab
2 changed files with 47 additions and 41 deletions

View File

@ -27,7 +27,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 37
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@ -65,6 +65,7 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
@ -72,6 +73,7 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@ -102,8 +104,6 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@ -374,7 +374,7 @@ static void yy_fatal_error (yyconst char msg[] );
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
header_yyleng = (size_t) (yy_cp - yy_bp); \
header_yyleng = (yy_size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
@ -390,9 +390,9 @@ struct yy_trans_info
};
static yyconst flex_int16_t yy_accept[29] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 13, 12,
3, 2, 1, 5, 4, 7, 6, 9, 8, 10,
11, 3, 2, 5, 4, 9, 8, 0
0, 0, 0, 0, 0, 0, 0, 0, 13, 2,
3, 1, 12, 4, 5, 7, 6, 8, 9, 10,
11, 2, 3, 4, 5, 8, 9, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@ -400,17 +400,17 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 1, 3, 3, 1, 3, 3, 3, 3,
3, 1, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 4, 1,
5, 6, 1, 1, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 1, 3, 1, 3, 1, 3, 3, 3, 3,
1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
4, 5, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 6, 1, 1, 1, 1, 1, 1, 1, 1,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 6,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -429,38 +429,38 @@ static yyconst flex_int32_t yy_ec[256] =
static yyconst flex_int32_t yy_meta[7] =
{ 0,
1, 2, 3, 4, 4, 1
1, 2, 3, 3, 4, 4
} ;
static yyconst flex_int16_t yy_base[35] =
{ 0,
0, 0, 22, 21, 6, 0, 12, 0, 26, 29,
0, 0, 29, 0, 0, 29, 29, 0, 0, 29,
29, 0, 0, 0, 0, 0, 0, 29, 23, 16,
22, 20, 20, 18
0, 0, 23, 22, 6, 0, 12, 0, 26, 0,
0, 29, 29, 0, 0, 29, 29, 0, 0, 29,
29, 0, 0, 0, 0, 0, 0, 29, 18, 23,
23, 21, 21, 18
} ;
static yyconst flex_int16_t yy_def[35] =
{ 0,
28, 1, 1, 1, 28, 5, 28, 7, 28, 28,
29, 30, 28, 31, 32, 28, 28, 33, 34, 28,
28, 1, 1, 1, 28, 5, 28, 7, 28, 29,
30, 28, 28, 31, 32, 28, 28, 33, 34, 28,
28, 29, 30, 31, 32, 33, 34, 0, 28, 28,
28, 28, 28, 28
} ;
static yyconst flex_int16_t yy_nxt[36] =
{ 0,
10, 11, 12, 12, 12, 13, 10, 14, 15, 16,
17, 10, 10, 18, 19, 20, 21, 10, 23, 23,
27, 26, 25, 24, 22, 28, 10, 10, 9, 28,
10, 11, 10, 10, 12, 13, 14, 15, 16, 17,
13, 13, 18, 19, 20, 21, 13, 13, 22, 27,
22, 26, 25, 24, 23, 28, 13, 13, 9, 28,
28, 28, 28, 28, 28
} ;
static yyconst flex_int16_t yy_chk[36] =
{ 0,
1, 1, 1, 1, 1, 1, 5, 5, 5, 5,
5, 5, 7, 7, 7, 7, 7, 7, 30, 30,
34, 33, 32, 31, 29, 9, 4, 3, 28, 28,
5, 5, 7, 7, 7, 7, 7, 7, 29, 34,
29, 33, 32, 31, 30, 9, 4, 3, 28, 28,
28, 28, 28, 28, 28
} ;
@ -590,7 +590,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO do { if (fwrite( header_yytext, header_yyleng, 1, header_yyout )) {} } while (0)
#define ECHO fwrite( header_yytext, header_yyleng, 1, header_yyout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@ -601,7 +601,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
size_t n; \
yy_size_t n; \
for ( n = 0; n < max_size && \
(c = getc( header_yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@ -784,6 +784,7 @@ YY_RULE_SETUP
}
YY_BREAK
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
#line 45 "fasta_header_parser.l"
{
@ -808,6 +809,7 @@ YY_RULE_SETUP
}
YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
#line 64 "fasta_header_parser.l"
{
@ -846,6 +848,7 @@ YY_RULE_SETUP
}
YY_BREAK
case 8:
/* rule 8 can match eol */
YY_RULE_SETUP
#line 90 "fasta_header_parser.l"
{
@ -911,7 +914,7 @@ YY_RULE_SETUP
#line 136 "fasta_header_parser.l"
ECHO;
YY_BREAK
#line 915 "<stdout>"
#line 918 "<stdout>"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(REGID):
yyterminate();
@ -1105,7 +1108,7 @@ static int yy_get_next_buffer (void)
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
@ -1238,7 +1241,7 @@ 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 == 28);
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 )
@ -1326,7 +1329,7 @@ static int yy_get_next_buffer (void)
case EOB_ACT_END_OF_FILE:
{
if ( header_yywrap( ) )
return EOF;
return 0;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
@ -1462,6 +1465,10 @@ static void header_yy_load_buffer_state (void)
header_yyfree((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 header_yyrestart() or at EOF.
@ -1666,8 +1673,8 @@ YY_BUFFER_STATE header_yy_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to header_yylex() will
* 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.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
@ -1675,8 +1682,7 @@ YY_BUFFER_STATE header_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybyt
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
yy_size_t n, i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;

View File

@ -21,8 +21,8 @@
%}
WORD [[:alnum:]:\-.{},'_()\#\[\]\|\&\"\'\/\%\+]+
WORDID [[:alnum:]:\-.{},'_()\#\[\]\|\&\"\'\/\%\+=;]+
WORD [^>\\n[:blank:]=;]+
WORDID [^>\\n[:blank:]]+
SUP >
EOL \n
SEP ;