diff options
Diffstat (limited to 'skel.c')
-rw-r--r-- | skel.c | 126 |
1 files changed, 64 insertions, 62 deletions
@@ -90,7 +90,7 @@ const char *skel[] = { "#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 37", "#if YY_FLEX_SUBMINOR_VERSION > 0", "#define FLEX_BETA", "#endif", @@ -244,7 +244,6 @@ const char *skel[] = { "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", @@ -275,6 +274,7 @@ const char *skel[] = { "#define UINT32_MAX (4294967295U)", "#endif", "", + "#endif /* ! C99 */", "", "#endif /* ! FLEXINT_H */", "", @@ -285,6 +285,7 @@ const char *skel[] = { "#include <iostream> ", "#include <errno.h>", "#include <cstdlib>", + "#include <cstdio>", "#include <cstring>", "/* end standard C++ headers. */", "%endif", @@ -355,6 +356,8 @@ const char *skel[] = { "", "%# Declare yyguts variable", "m4_define( [[M4_YY_DECL_GUTS_VAR]], [[struct yyguts_t * yyg = (struct yyguts_t*)yyscanner]])", + "%# Perform a noop access on yyguts to prevent unused variable complains", + "m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[(void)yyg]])", "%# For use wherever a Global is accessed or assigned.", "m4_define( [[YY_G]], [[yyg->$1]])", "", @@ -412,6 +415,7 @@ const char *skel[] = { "", "%# Define these macros to be no-ops.", "m4_define( [[M4_YY_DECL_GUTS_VAR]], [[m4_dnl]])", + "m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[m4_dnl]])", "m4_define( [[YY_G]], [[($1)]])", "m4_define( [[M4_YY_PROTO_LAST_ARG]])", "m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[void]])", @@ -526,8 +530,13 @@ const char *skel[] = { "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", + "", "%if-not-reentrant", - "extern int yyleng;", + "extern yy_size_t yyleng;", "%endif", "", "%if-c-only", @@ -589,11 +598,6 @@ const char *skel[] = { "#define unput(c) yyunput( c, YY_G(yytext_ptr) M4_YY_CALL_LAST_ARG )", "]])", "", - "#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", @@ -618,7 +622,7 @@ const char *skel[] = { " /* 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", @@ -707,8 +711,8 @@ const char *skel[] = { "%not-for-header", "/* yy_hold_char holds the character lost when yytext is formed. */", "static char yy_hold_char;", - "static int yy_n_chars; /* number of characters read into yy_ch_buf */", - "int yyleng;", + "static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */", + "yy_size_t yyleng;", "", "/* Points to current character in buffer. */", "static char *yy_c_buf_p = (char *) 0;", @@ -744,7 +748,7 @@ const char *skel[] = { "", "YY_BUFFER_STATE yy_scan_buffer M4_YY_PARAMS( char *base, yy_size_t size M4_YY_PROTO_LAST_ARG );", "YY_BUFFER_STATE yy_scan_string M4_YY_PARAMS( yyconst char *yy_str M4_YY_PROTO_LAST_ARG );", - "YY_BUFFER_STATE yy_scan_bytes M4_YY_PARAMS( yyconst char *bytes, int len M4_YY_PROTO_LAST_ARG );", + "YY_BUFFER_STATE yy_scan_bytes M4_YY_PARAMS( yyconst char *bytes, yy_size_t len M4_YY_PROTO_LAST_ARG );", "", "%endif", "", @@ -870,8 +874,8 @@ const char *skel[] = { " size_t yy_buffer_stack_max; /**< capacity of stack. */", " YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */", " char yy_hold_char;", - " int yy_n_chars;", - " int yyleng_r;", + " yy_size_t yy_n_chars;", + " yy_size_t yyleng_r;", " char *yy_c_buf_p;", " int yy_init;", " int yy_start;", @@ -1008,7 +1012,7 @@ const char *skel[] = { "", "m4_ifdef( [[M4_YY_NO_GET_LENG]],,", "[[", - "int yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", + "yy_size_t yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", "]])", "", "m4_ifdef( [[M4_YY_NO_GET_TEXT]],,", @@ -1026,6 +1030,22 @@ const char *skel[] = { "void yyset_lineno M4_YY_PARAMS( int line_number M4_YY_PROTO_LAST_ARG );", "]])", "", + "m4_ifdef( [[M4_YY_REENTRANT]],", + "[[", + "m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,", + "[[", + "int yyget_column M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", + "]])", + "]])", + "", + "m4_ifdef( [[M4_YY_REENTRANT]],", + "[[", + "m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,", + "[[", + "void yyset_column M4_YY_PARAMS( int column_no M4_YY_PROTO_LAST_ARG );", + "]])", + "]])", + "", "%if-bison-bridge", "m4_ifdef( [[M4_YY_NO_GET_LVAL]],,", "[[", @@ -1141,7 +1161,7 @@ const char *skel[] = { "/* This used to be an fputs(), but since the string might contain NUL's,", " * we now use fwrite().", " */", - "#define ECHO fwrite( yytext, yyleng, 1, yyout )", + "#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)", "%endif", "%if-c++-only C++ definition", "#define ECHO LexerOutput( yytext, yyleng )", @@ -1840,7 +1860,7 @@ const char *skel[] = { "", " 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 )", @@ -1852,14 +1872,14 @@ const char *skel[] = { "]],", "[[", " /* 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_G(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;", @@ -1891,7 +1911,7 @@ const char *skel[] = { "", " /* Read in more data. */", " YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),", - " YY_G(yy_n_chars), (size_t) num_to_read );", + " YY_G(yy_n_chars), num_to_read );", "", " YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);", " }", @@ -1975,6 +1995,7 @@ const char *skel[] = { " M4_YY_DECL_GUTS_VAR(); /* This var may be unused depending upon options. */", "%% [17.0] code to find the next state, and perhaps do backing up, goes here", "", + " M4_YY_NOOP_GUTS_VAR();", " return yy_is_jam ? 0 : yy_current_state;", "}", "", @@ -1999,7 +2020,7 @@ const char *skel[] = { " 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_G(yy_n_chars) + 2;", + " register yy_size_t number_to_move = YY_G(yy_n_chars) + 2;", " register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[", " YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];", " register char *source =", @@ -2065,7 +2086,7 @@ const char *skel[] = { "", " else", " { /* need more input */", - " int offset = YY_G(yy_c_buf_p) - YY_G(yytext_ptr);", + " yy_size_t offset = YY_G(yy_c_buf_p) - YY_G(yytext_ptr);", " ++YY_G(yy_c_buf_p);", "", " switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )", @@ -2261,25 +2282,6 @@ const char *skel[] = { "}", "", "", - "%if-c-only", - "m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]],,", - "[[", - " m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],,", - " [[", - "#ifndef __cplusplus", - "extern int isatty M4_YY_PARAMS( int );", - "#endif /* __cplusplus */", - " ]])", - "]])", - "%endif", - "", - "%if-c++-only", - "m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],,", - "[[", - "extern \"C\" int isatty M4_YY_PARAMS( int );", - "]])", - "%endif", - "", "/* Initializes or reinitializes a buffer.", " * This function is sometimes called more than once on the same buffer,", " * such as during a yyrestart() or at EOF.", @@ -2444,7 +2446,7 @@ const char *skel[] = { "void yyFlexLexer::yyensure_buffer_stack(void)", "%endif", "{", - " int num_to_alloc;", + " yy_size_t num_to_alloc;", " M4_YY_DECL_GUTS_VAR();", "", " if (!YY_G(yy_buffer_stack)) {", @@ -2559,12 +2561,12 @@ const char *skel[] = { "%if-c-only", "/** Setup the input buffer state to scan the given bytes. The next call to yylex() will", " * scan from a @e copy of @a bytes.", - " * @param bytes the byte buffer to scan", - " * @param len the number of bytes in the buffer pointed to by @a bytes.", + " * @param yybytes the byte buffer to scan", + " * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.", " * M4_YY_DOC_PARAM", " * @return the newly allocated buffer state object.", " */", - "YY_BUFFER_STATE yy_scan_bytes YYFARGS2( yyconst char *,yybytes, int ,_yybytes_len)", + "YY_BUFFER_STATE yy_scan_bytes YYFARGS2( yyconst char *,yybytes, yy_size_t ,_yybytes_len)", "{", " YY_BUFFER_STATE b;", " char *buf;", @@ -2790,7 +2792,7 @@ const char *skel[] = { "/** Get the length of the current token.", " * M4_YY_DOC_PARAM", " */", - "int yyget_leng YYFARGS0(void)", + "yy_size_t yyget_leng YYFARGS0(void)", "{", " M4_YY_DECL_GUTS_VAR();", " return yyleng;", @@ -2838,7 +2840,7 @@ const char *skel[] = { " [[", " /* lineno is only valid if an input buffer exists. */", " if (! YY_CURRENT_BUFFER )", - " yy_fatal_error( \"yyset_lineno called with no buffer\" M4_YY_CALL_LAST_ARG); ", + " YY_FATAL_ERROR( \"yyset_lineno called with no buffer\" );", " ]])", " yylineno = line_number;", "}", @@ -2860,7 +2862,7 @@ const char *skel[] = { " [[", " /* column is only valid if an input buffer exists. */", " if (! YY_CURRENT_BUFFER )", - " yy_fatal_error( \"yyset_column called with no buffer\" M4_YY_CALL_LAST_ARG); ", + " YY_FATAL_ERROR( \"yyset_column called with no buffer\" );", " ]])", " yycolumn = column_no;", "}", @@ -3325,7 +3327,7 @@ const char *skel[] = { " return -1;", "", " if (th->th_magic != YYTBL_MAGIC){", - " yy_fatal_error(\"bad magic number\" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"bad magic number\" ); /* TODO: not fatal. */", " return -1;", " }", "", @@ -3336,7 +3338,7 @@ const char *skel[] = { "", " /* Sanity check on header size. Greater than 1k suggests some funny business. */", " if (th->th_hsize < 16 || th->th_hsize > 1024){", - " yy_fatal_error(\"insane header size detected\" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"insane header size detected\" ); /* TODO: not fatal. */", " return -1;", " }", "", @@ -3401,7 +3403,7 @@ const char *skel[] = { " transdmap = yytbl_dmap_lookup (dmap, YYTD_ID_TRANSITION M4_YY_CALL_LAST_ARG);", "", " if ((dmap = yytbl_dmap_lookup (dmap, td.td_id M4_YY_CALL_LAST_ARG)) == NULL){", - " yy_fatal_error(\"table id not found in map.\" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"table id not found in map.\" ); /* TODO: not fatal. */", " return -1;", " }", "", @@ -3468,7 +3470,7 @@ const char *skel[] = { " t32 = t8;", " break;", " default: ", - " yy_fatal_error(\"invalid td_flags\" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"invalid td_flags\" ); /* TODO: not fatal. */", " return -1;", " }", " }", @@ -3488,26 +3490,26 @@ const char *skel[] = { " case sizeof (flex_int32_t):", " if (M4_YY_TABLES_VERIFY){", " if( ((flex_int32_t *) v)[0] != (flex_int32_t) t32)", - " yy_fatal_error(\"tables verification failed at YYTD_STRUCT flex_int32_t\" M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"tables verification failed at YYTD_STRUCT flex_int32_t\" );", " }else", " ((flex_int32_t *) v)[0] = (flex_int32_t) t32;", " break;", " case sizeof (flex_int16_t):", " if (M4_YY_TABLES_VERIFY ){", " if(((flex_int16_t *) v)[0] != (flex_int16_t) t32)", - " yy_fatal_error(\"tables verification failed at YYTD_STRUCT flex_int16_t\" M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"tables verification failed at YYTD_STRUCT flex_int16_t\" );", " }else", " ((flex_int16_t *) v)[0] = (flex_int16_t) t32;", " break;", " case sizeof(flex_int8_t):", " if (M4_YY_TABLES_VERIFY ){", " if( ((flex_int8_t *) v)[0] != (flex_int8_t) t32)", - " yy_fatal_error(\"tables verification failed at YYTD_STRUCT flex_int8_t\" M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"tables verification failed at YYTD_STRUCT flex_int8_t\" );", " }else", " ((flex_int8_t *) v)[0] = (flex_int8_t) t32;", " break;", " default:", - " yy_fatal_error(\"invalid dmap->dm_sz for struct\" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"invalid dmap->dm_sz for struct\" ); /* TODO: not fatal. */", " return -1;", " }", "", @@ -3521,7 +3523,7 @@ const char *skel[] = { "", "", " if (!transdmap){", - " yy_fatal_error(\"transition table not found\" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"transition table not found\" ); /* TODO: not fatal. */", " return -1;", " }", " ", @@ -3532,7 +3534,7 @@ const char *skel[] = { "", " if(M4_YY_TABLES_VERIFY ){", " if( ((struct yy_trans_info **) p)[0] != v)", - " yy_fatal_error(\"tables verification failed at YYTD_PTRANS\" M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"tables verification failed at YYTD_PTRANS\" );", " }else", " ((struct yy_trans_info **) p)[0] = v;", " ", @@ -3545,7 +3547,7 @@ const char *skel[] = { " case sizeof (flex_int32_t):", " if(M4_YY_TABLES_VERIFY ){", " if( ((flex_int32_t *) p)[0] != (flex_int32_t) t32)", - " yy_fatal_error(\"tables verification failed at flex_int32_t\" M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"tables verification failed at flex_int32_t\" );", " }else", " ((flex_int32_t *) p)[0] = (flex_int32_t) t32;", " p = ((flex_int32_t *) p) + 1;", @@ -3553,7 +3555,7 @@ const char *skel[] = { " case sizeof (flex_int16_t):", " if(M4_YY_TABLES_VERIFY ){", " if( ((flex_int16_t *) p)[0] != (flex_int16_t) t32)", - " yy_fatal_error(\"tables verification failed at flex_int16_t\" M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"tables verification failed at flex_int16_t\" );", " }else", " ((flex_int16_t *) p)[0] = (flex_int16_t) t32;", " p = ((flex_int16_t *) p) + 1;", @@ -3561,13 +3563,13 @@ const char *skel[] = { " case sizeof (flex_int8_t):", " if(M4_YY_TABLES_VERIFY ){", " if( ((flex_int8_t *) p)[0] != (flex_int8_t) t32)", - " yy_fatal_error(\"tables verification failed at flex_int8_t\" M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"tables verification failed at flex_int8_t\" );", " }else", " ((flex_int8_t *) p)[0] = (flex_int8_t) t32;", " p = ((flex_int8_t *) p) + 1;", " break;", " default:", - " yy_fatal_error(\"invalid dmap->dm_sz for plain int\" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);", + " YY_FATAL_ERROR( \"invalid dmap->dm_sz for plain int\" ); /* TODO: not fatal. */", " return -1;", " }", " }", |