diff options
author | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-10-25 00:13:39 +0100 |
---|---|---|
committer | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-10-25 00:13:39 +0100 |
commit | 72691b490943bcaa921a53375585cac83327c432 (patch) | |
tree | b363f1df43949c7d42e943bba55b6a24884318e7 /lexer.gen.c | |
parent | 033d9b2fd55b1fef0f17ce91d864c55e07f3ee5d (diff) |
Fix a bug in string parsing. Closes #35
Diffstat (limited to 'lexer.gen.c')
-rw-r--r-- | lexer.gen.c | 72 |
1 files changed, 42 insertions, 30 deletions
diff --git a/lexer.gen.c b/lexer.gen.c index dbaf0abc..c78730e3 100644 --- a/lexer.gen.c +++ b/lexer.gen.c @@ -9,7 +9,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 @@ -159,7 +159,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -171,11 +179,6 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -198,6 +201,11 @@ typedef size_t yy_size_t; #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) +#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 @@ -215,7 +223,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int 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 @@ -294,7 +302,7 @@ static void jq_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner YY_BUFFER_STATE jq_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE jq_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE jq_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); +YY_BUFFER_STATE jq_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); void *jq_yyalloc (yy_size_t ,yyscan_t yyscanner ); void *jq_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); @@ -326,7 +334,7 @@ void jq_yyfree (void * ,yyscan_t yyscanner ); /* Begin user sect3 */ -#define jq_yywrap(yyscanner) 1 +#define jq_yywrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -522,7 +530,7 @@ struct lexer_param; static int enter(int opening, int state, yyscan_t yyscanner); static int try_exit(int closing, int state, yyscan_t yyscanner); #define YY_NO_INPUT 1 -#line 526 "lexer.gen.c" +#line 534 "lexer.gen.c" #define INITIAL 0 #define IN_PAREN 1 @@ -554,8 +562,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; + int yy_n_chars; + int yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -612,7 +620,7 @@ FILE *jq_yyget_out (yyscan_t yyscanner ); void jq_yyset_out (FILE * out_str ,yyscan_t yyscanner ); -yy_size_t jq_yyget_leng (yyscan_t yyscanner ); +int jq_yyget_leng (yyscan_t yyscanner ); char *jq_yyget_text (yyscan_t yyscanner ); @@ -620,10 +628,6 @@ int jq_yyget_lineno (yyscan_t yyscanner ); void jq_yyset_lineno (int line_number ,yyscan_t yyscanner ); -int jq_yyget_column (yyscan_t yyscanner ); - -void jq_yyset_column (int column_no ,yyscan_t yyscanner ); - YYSTYPE * jq_yyget_lval (yyscan_t yyscanner ); void jq_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); @@ -670,7 +674,12 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -777,7 +786,7 @@ YY_DECL #line 35 "lexer.l" -#line 781 "lexer.gen.c" +#line 790 "lexer.gen.c" yylval = yylval_param; @@ -1069,7 +1078,7 @@ YY_RULE_SETUP #line 110 "lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1073 "lexer.gen.c" +#line 1082 "lexer.gen.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(IN_PAREN): case YY_STATE_EOF(IN_BRACKET): @@ -1261,21 +1270,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - yy_size_t num_to_read = + int 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_LVALUE; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1306,7 +1315,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read ); + yyg->yy_n_chars, (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -1403,7 +1412,6 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 87); - (void)yyg; return yy_is_jam ? 0 : yy_current_state; } @@ -1432,7 +1440,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -1596,6 +1604,10 @@ static void jq_yy_load_buffer_state (yyscan_t yyscanner) jq_yyfree((void *) b ,yyscanner ); } +#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 jq_yyrestart() or at EOF. @@ -1712,7 +1724,7 @@ void jq_yypop_buffer_state (yyscan_t yyscanner) */ static void jq_yyensure_buffer_stack (yyscan_t yyscanner) { - yy_size_t num_to_alloc; + int num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -1810,7 +1822,7 @@ YY_BUFFER_STATE jq_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE jq_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE jq_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; @@ -1965,7 +1977,7 @@ FILE *jq_yyget_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -yy_size_t jq_yyget_leng (yyscan_t yyscanner) +int jq_yyget_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -2001,7 +2013,7 @@ void jq_yyset_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "jq_yyset_lineno called with no buffer" ); + yy_fatal_error( "jq_yyset_lineno called with no buffer" , yyscanner); yylineno = line_number; } @@ -2016,7 +2028,7 @@ void jq_yyset_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "jq_yyset_column called with no buffer" ); + yy_fatal_error( "jq_yyset_column called with no buffer" , yyscanner); yycolumn = column_no; } |