• R/O
  • SSH
  • HTTPS

naniya: Commit


Commit MetaInfo

Revision246 (tree)
Zeit2010-04-22 19:33:13
Autornotanpe

Log Message

expr*.cをMinGWでつくったものでさしかえ
R245のtranslate.cを取り込み

Ändern Zusammenfassung

Diff

--- branches/mty-makai/expr_parse.c (revision 245)
+++ branches/mty-makai/expr_parse.c (revision 246)
@@ -148,7 +148,7 @@
148148 typedef union YYSTYPE
149149 {
150150
151-/* Line 214 of yacc.c */
151+/* Line 222 of yacc.c */
152152 #line 43 "expr_parse.y"
153153
154154 int a;
@@ -160,7 +160,7 @@
160160
161161
162162
163-/* Line 214 of yacc.c */
163+/* Line 222 of yacc.c */
164164 #line 165 "expr_parse.c"
165165 } YYSTYPE;
166166 # define YYSTYPE_IS_TRIVIAL 1
--- branches/mty-makai/expr_scan.c (revision 245)
+++ branches/mty-makai/expr_scan.c (revision 246)
@@ -54,7 +54,6 @@
5454 typedef unsigned char flex_uint8_t;
5555 typedef unsigned short int flex_uint16_t;
5656 typedef unsigned int flex_uint32_t;
57-#endif /* ! C99 */
5857
5958 /* Limits of integral types. */
6059 #ifndef INT8_MIN
@@ -85,6 +84,8 @@
8584 #define UINT32_MAX (4294967295U)
8685 #endif
8786
87+#endif /* ! C99 */
88+
8889 #endif /* ! FLEXINT_H */
8990
9091 #ifdef __cplusplus
@@ -141,7 +142,15 @@
141142
142143 /* Size of default input buffer. */
143144 #ifndef YY_BUF_SIZE
145+#ifdef __ia64__
146+/* On IA-64, the buffer size is 16k, not 8k.
147+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
148+ * Ditto for the __ia64__ case accordingly.
149+ */
150+#define YY_BUF_SIZE 32768
151+#else
144152 #define YY_BUF_SIZE 16384
153+#endif /* __ia64__ */
145154 #endif
146155
147156 /* The state buf must be large enough to hold one state per character in the main buffer.
@@ -1948,16 +1957,16 @@
19481957 #define YY_RESTORE_YY_MORE_OFFSET
19491958 char *yytext;
19501959 #line 1 "expr_scan.lex"
1951-/***********************************************************************
1952- *
1953- * file: expr_scan.lex
1954- *
1955- * 単純なスキャナ
1956- *
1957- */
1960+/***********************************************************************
1961+ *
1962+ * file: expr_scan.lex
1963+ *
1964+ * 単純なスキャナ
1965+ *
1966+ */
1967+
1968+#line 1969 "expr_scan.c"
19581969
1959-#line 1960 "expr_scan.c"
1960-
19611970 #define INITIAL 0
19621971 #define EXPR_SET 1
19631972
@@ -2038,7 +2047,12 @@
20382047
20392048 /* Amount of stuff to slurp up with each read. */
20402049 #ifndef YY_READ_BUF_SIZE
2050+#ifdef __ia64__
2051+/* On IA-64, the buffer size is 16k, not 8k */
2052+#define YY_READ_BUF_SIZE 16384
2053+#else
20412054 #define YY_READ_BUF_SIZE 8192
2055+#endif /* __ia64__ */
20422056 #endif
20432057
20442058 /* Copy whatever the last rule matched to the standard output. */
@@ -2046,7 +2060,7 @@
20462060 /* This used to be an fputs(), but since the string might contain NUL's,
20472061 * we now use fwrite().
20482062 */
2049-#define ECHO fwrite( yytext, yyleng, 1, yyout )
2063+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
20502064 #endif
20512065
20522066 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -2057,7 +2071,7 @@
20572071 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
20582072 { \
20592073 int c = '*'; \
2060- int n; \
2074+ size_t n; \
20612075 for ( n = 0; n < max_size && \
20622076 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
20632077 buf[n] = (char) c; \
@@ -2141,9 +2155,9 @@
21412155
21422156 #line 33 "expr_scan.lex"
21432157
2158+
2159+#line 2160 "expr_scan.c"
21442160
2145-#line 2146 "expr_scan.c"
2146-
21472161 if ( !(yy_init) )
21482162 {
21492163 (yy_init) = 1;
@@ -2228,134 +2242,134 @@
22282242 case 1:
22292243 YY_RULE_SETUP
22302244 #line 35 "expr_scan.lex"
2231-comment( yytext );
2245+comment( yytext );
22322246 YY_BREAK
22332247 case 2:
22342248 YY_RULE_SETUP
22352249 #line 37 "expr_scan.lex"
2236-expr_error("ターゲット<%s:%d文字くらい>は明らかに長すぎるので無視!", yytext, yyleng); return JUNK;
2250+expr_error("ターゲット<%s:%d文字くらい>は明らかに長すぎるので無視!", yytext, yyleng); return JUNK;
22372251 YY_BREAK
22382252 case 3:
22392253 YY_RULE_SETUP
22402254 #line 39 "expr_scan.lex"
2241-return mkdict(CA_U, 1);
2255+return mkdict(CA_U, 1);
22422256 YY_BREAK
22432257 case 4:
22442258 YY_RULE_SETUP
22452259 #line 40 "expr_scan.lex"
2246-return mkdict(CA_U, 0);
2260+return mkdict(CA_U, 0);
22472261 YY_BREAK
22482262 case 5:
22492263 YY_RULE_SETUP
22502264 #line 42 "expr_scan.lex"
2251-return mkdict(CA_C, 1);
2265+return mkdict(CA_C, 1);
22522266 YY_BREAK
22532267 case 6:
22542268 YY_RULE_SETUP
22552269 #line 43 "expr_scan.lex"
2256-return mkdict(CA_C, 0);
2270+return mkdict(CA_C, 0);
22572271 YY_BREAK
22582272 case 7:
22592273 YY_RULE_SETUP
22602274 #line 45 "expr_scan.lex"
2261-return mkdict(CA_A, 1);
2275+return mkdict(CA_A, 1);
22622276 YY_BREAK
22632277 case 8:
22642278 YY_RULE_SETUP
22652279 #line 46 "expr_scan.lex"
2266-return mkdict(CA_A, 0);
2280+return mkdict(CA_A, 0);
22672281 YY_BREAK
22682282 case 9:
22692283 YY_RULE_SETUP
22702284 #line 48 "expr_scan.lex"
2271-expr_error("ターゲット<%s:%d文字>は明らかに長すぎるので無視!", yytext, yyleng); return JUNK;
2285+expr_error("ターゲット<%s:%d文字>は明らかに長すぎるので無視!", yytext, yyleng); return JUNK;
22722286 YY_BREAK
22732287 case 10:
22742288 YY_RULE_SETUP
22752289 #line 50 "expr_scan.lex"
2276-return mkchx(yytext[1], 1);
2290+return mkchx(yytext[1], 1);
22772291 YY_BREAK
22782292 case 11:
22792293 YY_RULE_SETUP
22802294 #line 51 "expr_scan.lex"
2281-return mkchx(yytext[1], 0);
2295+return mkchx(yytext[1], 0);
22822296 YY_BREAK
22832297 case 12:
22842298 YY_RULE_SETUP
22852299 #line 53 "expr_scan.lex"
2286-BEGIN(0);
2300+BEGIN(0);
22872301 YY_BREAK
22882302 case 13:
22892303 YY_RULE_SETUP
22902304 #line 54 "expr_scan.lex"
2291-yylval.bmp = mkrng(cv64(yytext[0]), cv64(yytext[2])); return RNGS;
2305+yylval.bmp = mkrng(cv64(yytext[0]), cv64(yytext[2])); return RNGS;
22922306 YY_BREAK
22932307 case 14:
22942308 YY_RULE_SETUP
22952309 #line 55 "expr_scan.lex"
2296-yylval.bmp = mkrng(cv64(yytext[0]), (unsigned)-1); return RNGS;
2310+yylval.bmp = mkrng(cv64(yytext[0]), (unsigned)-1); return RNGS;
22972311 YY_BREAK
22982312 case 15:
22992313 /* rule 15 can match eol */
23002314 YY_RULE_SETUP
23012315 #line 56 "expr_scan.lex"
2302-BEGIN(0); expr_error("範囲指定の中で改行するなんて…"); g_lineno++;
2316+BEGIN(0); expr_error("範囲指定の中で改行するなんて…"); g_lineno++;
23032317 YY_BREAK
23042318 case 16:
23052319 YY_RULE_SETUP
23062320 #line 57 "expr_scan.lex"
2307-BEGIN(0); expr_error("文字<%c%c(0x%02X%02X)>は範囲指定に含めるワケにはいかないので無視します。", yytext[0], yytext[1], yytext[0] & 0xFF, yytext[1] & 0xFF);
2321+BEGIN(0); expr_error("文字<%c%c(0x%02X%02X)>は範囲指定に含めるワケにはいかないので無視します。", yytext[0], yytext[1], yytext[0] & 0xFF, yytext[1] & 0xFF);
23082322 YY_BREAK
23092323 case 17:
23102324 YY_RULE_SETUP
23112325 #line 58 "expr_scan.lex"
2312-BEGIN(0); expr_error("文字<%c>は範囲指定に含められないので無視します。", yytext[0]);
2326+BEGIN(0); expr_error("文字<%c>は範囲指定に含められないので無視します。", yytext[0]);
23132327 YY_BREAK
23142328 case 18:
23152329 YY_RULE_SETUP
23162330 #line 59 "expr_scan.lex"
2317-BEGIN(0); expr_error("なんですかこの文字は範囲指定なのに? <0x%02X> 無視っすよ?", yytext[0] & 0xFF);
2331+BEGIN(0); expr_error("なんですかこの文字は範囲指定なのに? <0x%02X> 無視っすよ?", yytext[0] & 0xFF);
23182332 YY_BREAK
23192333 case 19:
23202334 YY_RULE_SETUP
23212335 #line 61 "expr_scan.lex"
2322-return yytext[0];
2336+return yytext[0];
23232337 YY_BREAK
23242338 case 20:
23252339 YY_RULE_SETUP
23262340 #line 62 "expr_scan.lex"
2327-BEGIN(EXPR_SET); return CLS_CMPL;
2341+BEGIN(EXPR_SET); return CLS_CMPL;
23282342 YY_BREAK
23292343 case 21:
23302344 YY_RULE_SETUP
23312345 #line 63 "expr_scan.lex"
2332-BEGIN(EXPR_SET); return CLS;
2346+BEGIN(EXPR_SET); return CLS;
23332347 YY_BREAK
23342348 case 22:
23352349 /* rule 22 can match eol */
23362350 YY_RULE_SETUP
23372351 #line 65 "expr_scan.lex"
2338-g_lineno++; return OR;
2352+g_lineno++; return OR;
23392353 YY_BREAK
23402354 case 23:
23412355 YY_RULE_SETUP
23422356 #line 66 "expr_scan.lex"
2343-return OR;
2357+return OR;
23442358 YY_BREAK
23452359 case 24:
23462360 YY_RULE_SETUP
23472361 #line 68 "expr_scan.lex"
2348-expr_error("文字<%c%c(0x%02X%02X)>はお行儀が悪いので無視します。", yytext[0], yytext[1], yytext[0] & 0xFF, yytext[1] & 0xFF); return JUNK;
2362+expr_error("文字<%c%c(0x%02X%02X)>はお行儀が悪いので無視します。", yytext[0], yytext[1], yytext[0] & 0xFF, yytext[1] & 0xFF); return JUNK;
23492363 YY_BREAK
23502364 case 25:
23512365 YY_RULE_SETUP
23522366 #line 69 "expr_scan.lex"
2353-expr_error("文字<%c>はよくわかってないので無視します。", yytext[0]); return JUNK;
2367+expr_error("文字<%c>はよくわかってないので無視します。", yytext[0]); return JUNK;
23542368 YY_BREAK
23552369 case 26:
23562370 YY_RULE_SETUP
23572371 #line 70 "expr_scan.lex"
2358-expr_error("なんですかこの文字は? <0x%02X> 無視っすよ?", yytext[0] & 0xFF); return JUNK;
2372+expr_error("なんですかこの文字は? <0x%02X> 無視っすよ?", yytext[0] & 0xFF); return JUNK;
23592373 YY_BREAK
23602374 case 27:
23612375 YY_RULE_SETUP
@@ -2362,7 +2376,7 @@
23622376 #line 72 "expr_scan.lex"
23632377 ECHO;
23642378 YY_BREAK
2365-#line 2366 "expr_scan.c"
2379+#line 2380 "expr_scan.c"
23662380 case YY_STATE_EOF(INITIAL):
23672381 case YY_STATE_EOF(EXPR_SET):
23682382 yyterminate();
@@ -3121,8 +3135,8 @@
31213135
31223136 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
31233137 * scan from a @e copy of @a bytes.
3124- * @param bytes the byte buffer to scan
3125- * @param len the number of bytes in the buffer pointed to by @a bytes.
3138+ * @param yybytes the byte buffer to scan
3139+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
31263140 *
31273141 * @return the newly allocated buffer state object.
31283142 */
@@ -3364,11 +3378,11 @@
33643378 #line 72 "expr_scan.lex"
33653379
33663380
3381+
3382+/*
3383+ * Local Variables:
3384+ * tab-width: 4
3385+ * End:
3386+ *
3387+ * EOF */
33673388
3368-/*
3369- * Local Variables:
3370- * tab-width: 4
3371- * End:
3372- *
3373- * EOF */
3374-
--- branches/mty-makai/translate.c (revision 245)
+++ branches/mty-makai/translate.c (revision 246)
@@ -91,6 +91,12 @@
9191 }
9292 ptr[7] ^= 0x80; c0 = ptr[7] << 8;
9393 }
94+ else if ((ptr[n] & 0x7F) == 0x00
95+ && (ptr[n + 1] & 0x7F) != 0x00)
96+ {
97+ /* BSD鯖では失敗 */
98+ return 0;
99+ }
94100 else if (n == 6
95101 && (ptr[6] | 0x80) == 0x81
96102 && (ptr[7] & 0x7F) == 0x40)
Show on old repository browser