Mercurial > hg > Members > nobuyasu > myCompiler
diff Bison-Flex/Compiler-StackBase/UTF8/script-scanner.cc @ 5:caede627f691
chage encoding
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 17 May 2011 12:45:07 +0900 |
parents | 805d39d28230 |
children | 86c0a38332fe |
line wrap: on
line diff
--- a/Bison-Flex/Compiler-StackBase/UTF8/script-scanner.cc Tue May 17 08:00:38 2011 +0900 +++ b/Bison-Flex/Compiler-StackBase/UTF8/script-scanner.cc Tue May 17 12:45:07 2011 +0900 @@ -9,7 +9,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -31,7 +31,7 @@ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#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. @@ -94,11 +94,12 @@ #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -152,7 +153,12 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int yyleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; extern FILE *yyin, *yyout; @@ -178,16 +184,6 @@ #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -205,7 +201,7 @@ /* 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 @@ -275,8 +271,8 @@ /* 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; @@ -304,7 +300,7 @@ YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); @@ -336,7 +332,7 @@ /* Begin user sect3 */ -#define yywrap() 1 +#define yywrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -367,8 +363,8 @@ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 51 -#define YY_END_OF_BUFFER 52 +#define YY_NUM_RULES 52 +#define YY_END_OF_BUFFER 53 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -376,22 +372,23 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[129] = +static yyconst flex_int16_t yy_accept[135] = { 0, - 0, 0, 46, 46, 44, 44, 0, 0, 52, 37, - 32, 1, 37, 33, 18, 18, 18, 18, 18, 18, - 18, 35, 34, 18, 18, 18, 36, 37, 37, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 18, - 46, 47, 48, 44, 45, 40, 38, 43, 51, 40, - 32, 22, 31, 19, 29, 27, 28, 4, 3, 30, - 34, 25, 24, 21, 23, 26, 36, 17, 2, 36, - 36, 36, 36, 36, 5, 36, 36, 36, 36, 36, - 36, 20, 46, 47, 48, 49, 48, 50, 44, 40, - 42, 41, 39, 39, 36, 36, 36, 36, 7, 14, + 0, 0, 47, 47, 45, 45, 0, 0, 53, 38, + 33, 1, 38, 34, 19, 19, 19, 19, 19, 19, + 19, 36, 35, 19, 19, 19, 37, 38, 38, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 19, 47, 48, 49, 45, 46, 41, 39, 44, 52, + 41, 33, 23, 32, 20, 30, 28, 29, 4, 3, + 31, 35, 26, 25, 22, 24, 27, 37, 18, 2, + 37, 37, 37, 37, 37, 37, 5, 37, 37, 37, + 37, 37, 37, 21, 47, 48, 49, 50, 49, 51, + 45, 41, 43, 42, 40, 40, 37, 37, 37, 37, - 36, 36, 36, 36, 36, 40, 0, 36, 10, 36, - 6, 36, 36, 36, 15, 36, 12, 36, 36, 36, - 36, 8, 36, 16, 13, 9, 11, 0 + 37, 7, 14, 37, 37, 37, 37, 37, 41, 0, + 37, 37, 10, 37, 6, 37, 37, 37, 15, 37, + 37, 12, 37, 37, 37, 37, 8, 16, 37, 17, + 13, 9, 11, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -405,14 +402,14 @@ 17, 18, 1, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 21, 22, 21, 23, 20, 19, 24, 25, 26, 27, + 21, 22, 21, 23, 24, 19, 25, 26, 27, 28, - 28, 29, 30, 31, 32, 20, 33, 34, 20, 35, - 36, 20, 20, 37, 38, 39, 40, 41, 42, 20, - 20, 20, 21, 43, 21, 19, 1, 19, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 19, + 29, 30, 31, 32, 33, 20, 34, 35, 20, 36, + 37, 20, 20, 38, 39, 40, 41, 42, 43, 20, + 20, 20, 21, 44, 21, 19, 1, 19, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, @@ -420,127 +417,133 @@ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 19, + 19, 19, 19, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[45] = +static yyconst flex_int32_t yy_meta[46] = { 0, 1, 1, 2, 1, 3, 1, 1, 1, 1, 4, 1, 1, 1, 5, 5, 1, 1, 1, 6, 7, 6, 8, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 6, 6 + 7, 7, 7, 6, 6 } ; -static yyconst flex_int16_t yy_base[139] = +static yyconst flex_int16_t yy_base[146] = { 0, - 0, 0, 42, 43, 242, 241, 44, 45, 243, 246, - 240, 246, 224, 246, 223, 231, 246, 221, 220, 219, - 41, 246, 41, 43, 218, 44, 0, 231, 227, 195, - 207, 202, 195, 192, 28, 199, 26, 190, 194, 181, - 220, 246, 61, 0, 246, 0, 246, 246, 219, 89, - 219, 246, 246, 246, 246, 246, 246, 246, 246, 246, - 55, 246, 246, 246, 246, 246, 0, 246, 246, 192, - 181, 189, 179, 179, 0, 176, 175, 176, 180, 179, - 178, 246, 206, 246, 69, 246, 70, 246, 0, 0, - 246, 246, 164, 163, 182, 177, 180, 175, 0, 0, + 0, 0, 43, 44, 246, 245, 45, 46, 247, 250, + 244, 250, 228, 250, 227, 235, 250, 225, 224, 223, + 42, 250, 42, 44, 222, 45, 0, 235, 231, 212, + 197, 209, 204, 197, 194, 28, 201, 26, 192, 196, + 183, 223, 250, 62, 0, 250, 0, 250, 250, 222, + 91, 222, 250, 250, 250, 250, 250, 250, 250, 250, + 250, 56, 250, 250, 250, 250, 250, 0, 250, 250, + 196, 193, 182, 190, 180, 180, 0, 177, 176, 177, + 181, 180, 171, 250, 200, 250, 70, 250, 71, 250, + 0, 0, 250, 250, 144, 143, 143, 141, 132, 109, - 147, 154, 139, 137, 125, 0, 0, 61, 0, 52, - 0, 50, 51, 59, 0, 56, 0, 47, 43, 47, - 45, 0, 36, 0, 0, 0, 0, 246, 133, 141, - 149, 153, 160, 168, 176, 184, 191, 194 + 104, 0, 0, 91, 85, 76, 84, 76, 113, 0, + 82, 62, 0, 53, 0, 51, 52, 60, 0, 57, + 56, 0, 47, 43, 47, 45, 0, 0, 36, 0, + 0, 0, 0, 250, 135, 143, 151, 155, 162, 170, + 178, 186, 193, 201, 204 } ; -static yyconst flex_int16_t yy_def[139] = +static yyconst flex_int16_t yy_def[146] = { 0, - 128, 1, 129, 129, 130, 130, 131, 131, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 132, 128, 128, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 128, - 133, 128, 134, 135, 128, 136, 128, 128, 137, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 132, 128, 128, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 128, 133, 128, 134, 128, 134, 128, 135, 136, - 128, 128, 136, 128, 132, 132, 132, 132, 132, 132, + 134, 1, 135, 135, 136, 136, 137, 137, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 138, 134, 134, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 134, 139, 134, 140, 141, 134, 142, 134, 134, 143, + 144, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 138, 134, 134, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 134, 139, 134, 140, 134, 140, 134, + 141, 142, 134, 134, 142, 134, 138, 138, 138, 138, - 132, 132, 132, 132, 132, 50, 138, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 0, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128 + 138, 138, 138, 138, 138, 138, 138, 138, 144, 145, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 0, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134 } ; -static yyconst flex_int16_t yy_nxt[291] = +static yyconst flex_int16_t yy_nxt[296] = { 0, 10, 11, 12, 13, 14, 10, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 10, 27, - 17, 28, 29, 27, 30, 31, 32, 33, 34, 27, - 27, 35, 27, 27, 27, 27, 36, 37, 27, 27, - 38, 39, 40, 10, 42, 42, 47, 47, 48, 48, - 58, 43, 43, 59, 61, 61, 75, 60, 62, 63, - 65, 66, 76, 86, 78, 49, 49, 79, 61, 61, - 87, 86, 86, 88, 127, 126, 125, 124, 128, 87, - 123, 128, 88, 122, 121, 120, 119, 50, 50, 90, - 90, 118, 90, 117, 90, 90, 90, 90, 90, 90, + 17, 28, 29, 30, 27, 31, 32, 33, 34, 35, + 27, 27, 36, 27, 27, 27, 27, 37, 38, 27, + 27, 39, 40, 41, 10, 43, 43, 48, 48, 49, + 49, 59, 44, 44, 60, 62, 62, 77, 61, 63, + 64, 66, 67, 78, 88, 80, 50, 50, 81, 62, + 62, 89, 88, 88, 90, 133, 132, 131, 130, 134, + 89, 129, 134, 90, 128, 127, 126, 125, 124, 51, + 51, 92, 92, 123, 92, 122, 92, 92, 92, 92, - 90, 90, 90, 90, 90, 90, 90, 93, 93, 93, - 94, 93, 93, 93, 93, 93, 93, 93, 93, 93, - 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, - 93, 93, 93, 41, 41, 41, 41, 41, 41, 41, - 41, 44, 44, 44, 44, 44, 44, 44, 44, 46, - 46, 46, 46, 46, 46, 46, 46, 67, 116, 67, - 83, 83, 83, 115, 83, 83, 83, 83, 85, 85, - 85, 85, 85, 85, 85, 85, 89, 114, 89, 89, - 89, 89, 89, 89, 90, 113, 112, 90, 90, 90, - 90, 91, 91, 91, 91, 91, 91, 91, 91, 94, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 121, + 120, 119, 96, 92, 92, 118, 92, 117, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 116, 115, 114, 96, 42, 42, 42, 42, 42, + 42, 42, 42, 45, 45, 45, 45, 45, 45, 45, + 45, 47, 47, 47, 47, 47, 47, 47, 47, 68, + 113, 68, 85, 85, 85, 112, 85, 85, 85, 85, + 87, 87, 87, 87, 87, 87, 87, 87, 91, 111, + 91, 91, 91, 91, 91, 91, 92, 110, 109, 92, + 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, - 94, 94, 111, 110, 109, 108, 107, 106, 84, 105, - 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, - 51, 92, 84, 82, 81, 80, 77, 74, 73, 72, - 71, 70, 69, 68, 64, 57, 56, 55, 54, 53, - 52, 51, 128, 45, 45, 9, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 + 93, 95, 86, 108, 95, 95, 95, 95, 95, 96, + 96, 96, 107, 106, 105, 104, 103, 102, 101, 100, + 99, 98, 97, 52, 94, 86, 84, 83, 82, 79, + 76, 75, 74, 73, 72, 71, 70, 69, 65, 58, + 57, 56, 55, 54, 53, 52, 134, 46, 46, 9, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134 + } ; -static yyconst flex_int16_t yy_chk[291] = +static yyconst flex_int16_t yy_chk[296] = { 0, 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, 3, 4, 7, 8, 7, 8, - 21, 3, 4, 21, 23, 23, 35, 21, 24, 24, - 26, 26, 35, 43, 37, 7, 8, 37, 61, 61, - 43, 85, 87, 43, 123, 121, 120, 119, 85, 87, - 118, 85, 87, 116, 114, 113, 112, 7, 8, 50, - 50, 110, 50, 108, 50, 50, 50, 50, 50, 50, + 1, 1, 1, 1, 1, 3, 4, 7, 8, 7, + 8, 21, 3, 4, 21, 23, 23, 36, 21, 24, + 24, 26, 26, 36, 44, 38, 7, 8, 38, 62, + 62, 44, 87, 89, 44, 129, 126, 125, 124, 87, + 89, 123, 87, 89, 121, 120, 118, 117, 116, 7, + 8, 51, 51, 114, 51, 112, 51, 51, 51, 51, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 129, 129, 129, 129, 129, 129, 129, - 129, 130, 130, 130, 130, 130, 130, 130, 130, 131, - 131, 131, 131, 131, 131, 131, 131, 132, 105, 132, - 133, 133, 133, 104, 133, 133, 133, 133, 134, 134, - 134, 134, 134, 134, 134, 134, 135, 103, 135, 135, - 135, 135, 135, 135, 136, 102, 101, 136, 136, 136, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 111, + 108, 107, 51, 109, 109, 106, 109, 105, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 104, 101, 100, 109, 135, 135, 135, 135, 135, + 135, 135, 135, 136, 136, 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 138, + 99, 138, 139, 139, 139, 98, 139, 139, 139, 139, + 140, 140, 140, 140, 140, 140, 140, 140, 141, 97, + 141, 141, 141, 141, 141, 141, 142, 96, 95, 142, + 142, 142, 142, 143, 143, 143, 143, 143, 143, 143, - 138, 138, 98, 97, 96, 95, 94, 93, 83, 81, - 80, 79, 78, 77, 76, 74, 73, 72, 71, 70, - 51, 49, 41, 40, 39, 38, 36, 34, 33, 32, - 31, 30, 29, 28, 25, 20, 19, 18, 16, 15, - 13, 11, 9, 6, 5, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 + 143, 144, 85, 83, 144, 144, 144, 144, 144, 145, + 145, 145, 82, 81, 80, 79, 78, 76, 75, 74, + 73, 72, 71, 52, 50, 42, 41, 40, 39, 37, + 35, 34, 33, 32, 31, 30, 29, 28, 25, 20, + 19, 18, 16, 15, 13, 11, 9, 6, 5, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134 + } ; static yy_state_type yy_last_accepting_state; @@ -583,7 +586,7 @@ #line 39 "script-scanner.ll" #define YY_USER_ACTION yylloc->columns(yyleng); -#line 587 "script-scanner.cc" +#line 590 "script-scanner.cc" #define INITIAL 0 #define C_COMMENT 1 @@ -604,6 +607,35 @@ static int yy_init_globals (void ); +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +yy_size_t yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -644,7 +676,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -655,7 +687,7 @@ 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( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -746,7 +778,7 @@ std::string string_buffer; -#line 750 "script-scanner.cc" +#line 782 "script-scanner.cc" if ( !(yy_init) ) { @@ -799,13 +831,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 129 ) + if ( yy_current_state >= 135 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 128 ); + while ( yy_current_state != 134 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -903,174 +935,179 @@ YY_BREAK case 16: YY_RULE_SETUP -#line 68 "script-scanner.ll" -return token::TK_RETURN; +#line 67 "script-scanner.ll" +return token::TK_CODE; YY_BREAK case 17: -/* rule 17 can match eol */ YY_RULE_SETUP -#line 70 "script-scanner.ll" -yylloc->lines(); +#line 69 "script-scanner.ll" +return token::TK_RETURN; YY_BREAK case 18: +/* rule 18 can match eol */ YY_RULE_SETUP -#line 72 "script-scanner.ll" -return yy::script_parser::token_type(yytext[0]); +#line 71 "script-scanner.ll" +yylloc->lines(); YY_BREAK case 19: YY_RULE_SETUP -#line 74 "script-scanner.ll" -return token::TK_LOGAND; +#line 73 "script-scanner.ll" +return yy::script_parser::token_type(yytext[0]); YY_BREAK case 20: YY_RULE_SETUP #line 75 "script-scanner.ll" -return token::TK_LOGOR; +return token::TK_LOGAND; YY_BREAK case 21: YY_RULE_SETUP #line 76 "script-scanner.ll" -return token::TK_EQ; +return token::TK_LOGOR; YY_BREAK case 22: YY_RULE_SETUP #line 77 "script-scanner.ll" -return token::TK_NE; +return token::TK_EQ; YY_BREAK case 23: YY_RULE_SETUP #line 78 "script-scanner.ll" -return token::TK_GE; +return token::TK_NE; YY_BREAK case 24: YY_RULE_SETUP #line 79 "script-scanner.ll" -return token::TK_LE; +return token::TK_GE; YY_BREAK case 25: YY_RULE_SETUP #line 80 "script-scanner.ll" -return token::TK_LSHIFT; +return token::TK_LE; YY_BREAK case 26: YY_RULE_SETUP #line 81 "script-scanner.ll" -return token::TK_RSHIFT; +return token::TK_LSHIFT; YY_BREAK case 27: YY_RULE_SETUP -#line 83 "script-scanner.ll" -return token::TK_ADD_ASSIGN; +#line 82 "script-scanner.ll" +return token::TK_RSHIFT; YY_BREAK case 28: YY_RULE_SETUP #line 84 "script-scanner.ll" -return token::TK_SUB_ASSIGN; +return token::TK_ADD_ASSIGN; YY_BREAK case 29: YY_RULE_SETUP #line 85 "script-scanner.ll" -return token::TK_MUL_ASSIGN; +return token::TK_SUB_ASSIGN; YY_BREAK case 30: YY_RULE_SETUP #line 86 "script-scanner.ll" -return token::TK_DIV_ASSIGN; +return token::TK_MUL_ASSIGN; YY_BREAK case 31: YY_RULE_SETUP #line 87 "script-scanner.ll" -return token::TK_MOD_ASSIGN; +return token::TK_DIV_ASSIGN; YY_BREAK case 32: YY_RULE_SETUP -#line 89 "script-scanner.ll" -yylloc->step(); +#line 88 "script-scanner.ll" +return token::TK_MOD_ASSIGN; YY_BREAK case 33: YY_RULE_SETUP #line 90 "script-scanner.ll" +yylloc->step(); + YY_BREAK +case 34: +YY_RULE_SETUP +#line 91 "script-scanner.ll" { yylloc->step(); string_buffer.clear(); BEGIN(STRING); } YY_BREAK -case 34: +case 35: YY_RULE_SETUP -#line 95 "script-scanner.ll" +#line 96 "script-scanner.ll" { errno = 0; long n = strtol(yytext, NULL, 10); if (n < LONG_MIN || n > LONG_MAX || errno == ERANGE) - driver.error(*yylloc, "整数が範囲外です。"); + driver.error(*yylloc, "贋違膀峨с"); yylval->ival = n; return token::TK_IVAL; } YY_BREAK -case 35: +case 36: YY_RULE_SETUP -#line 103 "script-scanner.ll" +#line 104 "script-scanner.ll" { yylval->ival = 0; return token::TK_IVAL; } YY_BREAK -case 36: +case 37: YY_RULE_SETUP -#line 107 "script-scanner.ll" +#line 108 "script-scanner.ll" { yylval->sval = new std::string(yytext); return token::TK_IDENTIFIER; } YY_BREAK -case 37: +case 38: YY_RULE_SETUP -#line 111 "script-scanner.ll" -driver.error(*yylloc, "この文字を識別子で使用することはできません。"); +#line 112 "script-scanner.ll" +driver.error(*yylloc, "絖茘ュт戎с障"); YY_BREAK -case 38: -/* rule 38 can match eol */ +case 39: +/* rule 39 can match eol */ YY_RULE_SETUP -#line 114 "script-scanner.ll" +#line 115 "script-scanner.ll" { yylloc->lines(); - driver.error(*yylloc, "文字列がとじられていません"); + driver.error(*yylloc, "絖障"); string_buffer.clear(); BEGIN(INITIAL); } YY_BREAK case YY_STATE_EOF(STRING): -#line 120 "script-scanner.ll" +#line 121 "script-scanner.ll" { - driver.error(*yylloc, "文字列の途中でファイルが終了しました"); + driver.error(*yylloc, "絖筝с<ゃ腟篋障"); string_buffer.clear(); BEGIN(INITIAL); } YY_BREAK -case 39: +case 40: YY_RULE_SETUP -#line 125 "script-scanner.ll" +#line 126 "script-scanner.ll" { string_buffer += yytext; } YY_BREAK -case 40: +case 41: YY_RULE_SETUP -#line 128 "script-scanner.ll" +#line 129 "script-scanner.ll" { string_buffer += yytext; } YY_BREAK -case 41: -/* rule 41 can match eol */ +case 42: +/* rule 42 can match eol */ YY_RULE_SETUP -#line 129 "script-scanner.ll" +#line 130 "script-scanner.ll" yylloc->lines(); YY_BREAK -case 42: +case 43: YY_RULE_SETUP -#line 130 "script-scanner.ll" +#line 131 "script-scanner.ll" { switch (yytext[yyleng-1]) { case 'n': @@ -1083,9 +1120,9 @@ } } YY_BREAK -case 43: +case 44: YY_RULE_SETUP -#line 141 "script-scanner.ll" +#line 142 "script-scanner.ll" { BEGIN(INITIAL); yylval->sval = new std::string(string_buffer); @@ -1094,15 +1131,15 @@ YY_BREAK -case 44: +case 45: YY_RULE_SETUP -#line 148 "script-scanner.ll" +#line 149 "script-scanner.ll" YY_BREAK -case 45: -/* rule 45 can match eol */ +case 46: +/* rule 46 can match eol */ YY_RULE_SETUP -#line 149 "script-scanner.ll" +#line 150 "script-scanner.ll" { yylloc->lines(); yylloc->step(); @@ -1111,44 +1148,44 @@ YY_BREAK -case 46: -YY_RULE_SETUP -#line 156 "script-scanner.ll" - - YY_BREAK case 47: -/* rule 47 can match eol */ YY_RULE_SETUP #line 157 "script-scanner.ll" -{ yylloc->lines(); } + YY_BREAK case 48: +/* rule 48 can match eol */ YY_RULE_SETUP #line 158 "script-scanner.ll" -/* 余分な*を探す */ +{ yylloc->lines(); } YY_BREAK case 49: -/* rule 49 can match eol */ YY_RULE_SETUP #line 159 "script-scanner.ll" +/* 篏*「 */ + YY_BREAK +case 50: +/* rule 50 can match eol */ +YY_RULE_SETUP +#line 160 "script-scanner.ll" { yylloc->lines(); } YY_BREAK case YY_STATE_EOF(C_COMMENT): -#line 160 "script-scanner.ll" -driver.error(*yylloc, "コメントの途中でファイルが終了しました"); +#line 161 "script-scanner.ll" +driver.error(*yylloc, "潟<潟筝с<ゃ腟篋障"); YY_BREAK -case 50: +case 51: YY_RULE_SETUP -#line 161 "script-scanner.ll" +#line 162 "script-scanner.ll" BEGIN(INITIAL); YY_BREAK -case 51: +case 52: YY_RULE_SETUP -#line 163 "script-scanner.ll" +#line 164 "script-scanner.ll" ECHO; YY_BREAK -#line 1152 "script-scanner.cc" +#line 1189 "script-scanner.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(CPP_COMMENT): yyterminate(); @@ -1336,7 +1373,7 @@ 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 ) @@ -1350,7 +1387,7 @@ 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; @@ -1381,7 +1418,7 @@ /* 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); } @@ -1405,6 +1442,14 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -1434,7 +1479,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 129 ) + if ( yy_current_state >= 135 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1462,11 +1507,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 129 ) + if ( yy_current_state >= 135 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 128); + yy_is_jam = (yy_current_state == 134); return yy_is_jam ? 0 : yy_current_state; } @@ -1495,7 +1540,7 @@ 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( ) ) @@ -1519,7 +1564,7 @@ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1767,7 +1812,7 @@ */ static void yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -1779,7 +1824,9 @@ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -1797,6 +1844,8 @@ ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1861,7 +1910,7 @@ /** Get the length of the current token. * */ -int yyget_leng (void) +yy_size_t yyget_leng (void) { return yyleng; } @@ -2009,14 +2058,14 @@ #define YYTABLES_NAME "yytables" -#line 163 "script-scanner.ll" +#line 164 "script-scanner.ll" void compiler::scan_begin() { if ((yyin = fopen(file.c_str(), "r")) == 0) - error(file + " がオープンできません。"); + error(file + " 若潟с障"); } void compiler::scan_end()