comparison 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
comparison
equal deleted inserted replaced
4:805d39d28230 5:caede627f691
7 /* A lexical scanner generated by flex */ 7 /* A lexical scanner generated by flex */
8 8
9 #define FLEX_SCANNER 9 #define FLEX_SCANNER
10 #define YY_FLEX_MAJOR_VERSION 2 10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5 11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 33 12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0 13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA 14 #define FLEX_BETA
15 #endif 15 #endif
16 16
17 /* First, we deal with platform-specific or compiler-specific issues. */ 17 /* First, we deal with platform-specific or compiler-specific issues. */
29 #ifndef FLEXINT_H 29 #ifndef FLEXINT_H
30 #define FLEXINT_H 30 #define FLEXINT_H
31 31
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 33
34 #if __STDC_VERSION__ >= 199901L 34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 35
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types. 37 * if you want the limit (max/min) macros for int types.
38 */ 38 */
39 #ifndef __STDC_LIMIT_MACROS 39 #ifndef __STDC_LIMIT_MACROS
92 /* The "const" storage-class-modifier is valid. */ 92 /* The "const" storage-class-modifier is valid. */
93 #define YY_USE_CONST 93 #define YY_USE_CONST
94 94
95 #else /* ! __cplusplus */ 95 #else /* ! __cplusplus */
96 96
97 #if __STDC__ 97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
98 99
99 #define YY_USE_CONST 100 #define YY_USE_CONST
100 101
101 #endif /* __STDC__ */ 102 #endif /* defined (__STDC__) */
102 #endif /* ! __cplusplus */ 103 #endif /* ! __cplusplus */
103 104
104 #ifdef YY_USE_CONST 105 #ifdef YY_USE_CONST
105 #define yyconst const 106 #define yyconst const
106 #else 107 #else
150 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 151 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
151 #define YY_TYPEDEF_YY_BUFFER_STATE 152 #define YY_TYPEDEF_YY_BUFFER_STATE
152 typedef struct yy_buffer_state *YY_BUFFER_STATE; 153 typedef struct yy_buffer_state *YY_BUFFER_STATE;
153 #endif 154 #endif
154 155
155 extern int yyleng; 156 #ifndef YY_TYPEDEF_YY_SIZE_T
157 #define YY_TYPEDEF_YY_SIZE_T
158 typedef size_t yy_size_t;
159 #endif
160
161 extern yy_size_t yyleng;
156 162
157 extern FILE *yyin, *yyout; 163 extern FILE *yyin, *yyout;
158 164
159 #define EOB_ACT_CONTINUE_SCAN 0 165 #define EOB_ACT_CONTINUE_SCAN 0
160 #define EOB_ACT_END_OF_FILE 1 166 #define EOB_ACT_END_OF_FILE 1
176 } \ 182 } \
177 while ( 0 ) 183 while ( 0 )
178 184
179 #define unput(c) yyunput( c, (yytext_ptr) ) 185 #define unput(c) yyunput( c, (yytext_ptr) )
180 186
181 /* The following is because we cannot portably get our hands on size_t
182 * (without autoconf's help, which isn't available because we want
183 * flex-generated scanners to compile on their own).
184 */
185
186 #ifndef YY_TYPEDEF_YY_SIZE_T
187 #define YY_TYPEDEF_YY_SIZE_T
188 typedef unsigned int yy_size_t;
189 #endif
190
191 #ifndef YY_STRUCT_YY_BUFFER_STATE 187 #ifndef YY_STRUCT_YY_BUFFER_STATE
192 #define YY_STRUCT_YY_BUFFER_STATE 188 #define YY_STRUCT_YY_BUFFER_STATE
193 struct yy_buffer_state 189 struct yy_buffer_state
194 { 190 {
195 FILE *yy_input_file; 191 FILE *yy_input_file;
203 yy_size_t yy_buf_size; 199 yy_size_t yy_buf_size;
204 200
205 /* Number of characters read into yy_ch_buf, not including EOB 201 /* Number of characters read into yy_ch_buf, not including EOB
206 * characters. 202 * characters.
207 */ 203 */
208 int yy_n_chars; 204 yy_size_t yy_n_chars;
209 205
210 /* Whether we "own" the buffer - i.e., we know we created it, 206 /* Whether we "own" the buffer - i.e., we know we created it,
211 * and can realloc() it to grow it, and should free() it to 207 * and can realloc() it to grow it, and should free() it to
212 * delete it. 208 * delete it.
213 */ 209 */
273 */ 269 */
274 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 270 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
275 271
276 /* yy_hold_char holds the character lost when yytext is formed. */ 272 /* yy_hold_char holds the character lost when yytext is formed. */
277 static char yy_hold_char; 273 static char yy_hold_char;
278 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 274 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
279 int yyleng; 275 yy_size_t yyleng;
280 276
281 /* Points to current character in buffer. */ 277 /* Points to current character in buffer. */
282 static char *yy_c_buf_p = (char *) 0; 278 static char *yy_c_buf_p = (char *) 0;
283 static int yy_init = 0; /* whether we need to initialize */ 279 static int yy_init = 0; /* whether we need to initialize */
284 static int yy_start = 0; /* start state number */ 280 static int yy_start = 0; /* start state number */
302 298
303 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) 299 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
304 300
305 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); 301 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
306 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); 302 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
307 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); 303 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
308 304
309 void *yyalloc (yy_size_t ); 305 void *yyalloc (yy_size_t );
310 void *yyrealloc (void *,yy_size_t ); 306 void *yyrealloc (void *,yy_size_t );
311 void yyfree (void * ); 307 void yyfree (void * );
312 308
334 330
335 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 331 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
336 332
337 /* Begin user sect3 */ 333 /* Begin user sect3 */
338 334
339 #define yywrap() 1 335 #define yywrap(n) 1
340 #define YY_SKIP_YYWRAP 336 #define YY_SKIP_YYWRAP
341 337
342 typedef unsigned char YY_CHAR; 338 typedef unsigned char YY_CHAR;
343 339
344 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 340 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
365 yyleng = (size_t) (yy_cp - yy_bp); \ 361 yyleng = (size_t) (yy_cp - yy_bp); \
366 (yy_hold_char) = *yy_cp; \ 362 (yy_hold_char) = *yy_cp; \
367 *yy_cp = '\0'; \ 363 *yy_cp = '\0'; \
368 (yy_c_buf_p) = yy_cp; 364 (yy_c_buf_p) = yy_cp;
369 365
370 #define YY_NUM_RULES 51 366 #define YY_NUM_RULES 52
371 #define YY_END_OF_BUFFER 52 367 #define YY_END_OF_BUFFER 53
372 /* This struct is not used in this scanner, 368 /* This struct is not used in this scanner,
373 but its presence is necessary. */ 369 but its presence is necessary. */
374 struct yy_trans_info 370 struct yy_trans_info
375 { 371 {
376 flex_int32_t yy_verify; 372 flex_int32_t yy_verify;
377 flex_int32_t yy_nxt; 373 flex_int32_t yy_nxt;
378 }; 374 };
379 static yyconst flex_int16_t yy_accept[129] = 375 static yyconst flex_int16_t yy_accept[135] =
380 { 0, 376 { 0,
381 0, 0, 46, 46, 44, 44, 0, 0, 52, 37, 377 0, 0, 47, 47, 45, 45, 0, 0, 53, 38,
382 32, 1, 37, 33, 18, 18, 18, 18, 18, 18, 378 33, 1, 38, 34, 19, 19, 19, 19, 19, 19,
383 18, 35, 34, 18, 18, 18, 36, 37, 37, 36, 379 19, 36, 35, 19, 19, 19, 37, 38, 38, 37,
384 36, 36, 36, 36, 36, 36, 36, 36, 36, 18, 380 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
385 46, 47, 48, 44, 45, 40, 38, 43, 51, 40, 381 19, 47, 48, 49, 45, 46, 41, 39, 44, 52,
386 32, 22, 31, 19, 29, 27, 28, 4, 3, 30, 382 41, 33, 23, 32, 20, 30, 28, 29, 4, 3,
387 34, 25, 24, 21, 23, 26, 36, 17, 2, 36, 383 31, 35, 26, 25, 22, 24, 27, 37, 18, 2,
388 36, 36, 36, 36, 5, 36, 36, 36, 36, 36, 384 37, 37, 37, 37, 37, 37, 5, 37, 37, 37,
389 36, 20, 46, 47, 48, 49, 48, 50, 44, 40, 385 37, 37, 37, 21, 47, 48, 49, 50, 49, 51,
390 42, 41, 39, 39, 36, 36, 36, 36, 7, 14, 386 45, 41, 43, 42, 40, 40, 37, 37, 37, 37,
391 387
392 36, 36, 36, 36, 36, 40, 0, 36, 10, 36, 388 37, 7, 14, 37, 37, 37, 37, 37, 41, 0,
393 6, 36, 36, 36, 15, 36, 12, 36, 36, 36, 389 37, 37, 10, 37, 6, 37, 37, 37, 15, 37,
394 36, 8, 36, 16, 13, 9, 11, 0 390 37, 12, 37, 37, 37, 37, 8, 16, 37, 17,
391 13, 9, 11, 0
395 } ; 392 } ;
396 393
397 static yyconst flex_int32_t yy_ec[256] = 394 static yyconst flex_int32_t yy_ec[256] =
398 { 0, 395 { 0,
399 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 396 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
403 9, 10, 11, 9, 12, 1, 13, 14, 15, 15, 400 9, 10, 11, 9, 12, 1, 13, 14, 15, 15,
404 15, 15, 15, 15, 15, 15, 15, 9, 9, 16, 401 15, 15, 15, 15, 15, 15, 15, 9, 9, 16,
405 17, 18, 1, 19, 20, 20, 20, 20, 20, 20, 402 17, 18, 1, 19, 20, 20, 20, 20, 20, 20,
406 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 403 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
407 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 404 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
408 21, 22, 21, 23, 20, 19, 24, 25, 26, 27, 405 21, 22, 21, 23, 24, 19, 25, 26, 27, 28,
409 406
410 28, 29, 30, 31, 32, 20, 33, 34, 20, 35, 407 29, 30, 31, 32, 33, 20, 34, 35, 20, 36,
411 36, 20, 20, 37, 38, 39, 40, 41, 42, 20, 408 37, 20, 20, 38, 39, 40, 41, 42, 43, 20,
412 20, 20, 21, 43, 21, 19, 1, 19, 44, 44, 409 20, 20, 21, 44, 21, 19, 1, 19, 45, 45,
413 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 410 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
414 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 411 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
415 44, 44, 44, 44, 44, 44, 44, 44, 44, 19, 412 45, 45, 45, 45, 45, 45, 45, 45, 45, 19,
416 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 413 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
417 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 414 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
418 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 415 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
419 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 416 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
420 417
421 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 418 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
422 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 419 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
423 19, 19, 19, 44, 44, 44, 44, 44, 44, 44, 420 19, 19, 19, 45, 45, 45, 45, 45, 45, 45,
424 44, 44, 44, 44, 44, 44, 44, 44, 44, 19, 421 45, 45, 45, 45, 45, 45, 45, 45, 45, 19,
425 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 422 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
426 19, 19, 1, 1, 1 423 19, 19, 1, 1, 1
427 } ; 424 } ;
428 425
429 static yyconst flex_int32_t yy_meta[45] = 426 static yyconst flex_int32_t yy_meta[46] =
430 { 0, 427 { 0,
431 1, 1, 2, 1, 3, 1, 1, 1, 1, 4, 428 1, 1, 2, 1, 3, 1, 1, 1, 1, 4,
432 1, 1, 1, 5, 5, 1, 1, 1, 6, 7, 429 1, 1, 1, 5, 5, 1, 1, 1, 6, 7,
433 6, 8, 6, 7, 7, 7, 7, 7, 7, 7, 430 6, 8, 6, 7, 7, 7, 7, 7, 7, 7,
434 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 431 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
435 7, 7, 6, 6 432 7, 7, 7, 6, 6
436 } ; 433 } ;
437 434
438 static yyconst flex_int16_t yy_base[139] = 435 static yyconst flex_int16_t yy_base[146] =
439 { 0, 436 { 0,
440 0, 0, 42, 43, 242, 241, 44, 45, 243, 246, 437 0, 0, 43, 44, 246, 245, 45, 46, 247, 250,
441 240, 246, 224, 246, 223, 231, 246, 221, 220, 219, 438 244, 250, 228, 250, 227, 235, 250, 225, 224, 223,
442 41, 246, 41, 43, 218, 44, 0, 231, 227, 195, 439 42, 250, 42, 44, 222, 45, 0, 235, 231, 212,
443 207, 202, 195, 192, 28, 199, 26, 190, 194, 181, 440 197, 209, 204, 197, 194, 28, 201, 26, 192, 196,
444 220, 246, 61, 0, 246, 0, 246, 246, 219, 89, 441 183, 223, 250, 62, 0, 250, 0, 250, 250, 222,
445 219, 246, 246, 246, 246, 246, 246, 246, 246, 246, 442 91, 222, 250, 250, 250, 250, 250, 250, 250, 250,
446 55, 246, 246, 246, 246, 246, 0, 246, 246, 192, 443 250, 56, 250, 250, 250, 250, 250, 0, 250, 250,
447 181, 189, 179, 179, 0, 176, 175, 176, 180, 179, 444 196, 193, 182, 190, 180, 180, 0, 177, 176, 177,
448 178, 246, 206, 246, 69, 246, 70, 246, 0, 0, 445 181, 180, 171, 250, 200, 250, 70, 250, 71, 250,
449 246, 246, 164, 163, 182, 177, 180, 175, 0, 0, 446 0, 0, 250, 250, 144, 143, 143, 141, 132, 109,
450 447
451 147, 154, 139, 137, 125, 0, 0, 61, 0, 52, 448 104, 0, 0, 91, 85, 76, 84, 76, 113, 0,
452 0, 50, 51, 59, 0, 56, 0, 47, 43, 47, 449 82, 62, 0, 53, 0, 51, 52, 60, 0, 57,
453 45, 0, 36, 0, 0, 0, 0, 246, 133, 141, 450 56, 0, 47, 43, 47, 45, 0, 0, 36, 0,
454 149, 153, 160, 168, 176, 184, 191, 194 451 0, 0, 0, 250, 135, 143, 151, 155, 162, 170,
452 178, 186, 193, 201, 204
455 } ; 453 } ;
456 454
457 static yyconst flex_int16_t yy_def[139] = 455 static yyconst flex_int16_t yy_def[146] =
458 { 0, 456 { 0,
459 128, 1, 129, 129, 130, 130, 131, 131, 128, 128, 457 134, 1, 135, 135, 136, 136, 137, 137, 134, 134,
460 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 458 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
461 128, 128, 128, 128, 128, 128, 132, 128, 128, 132, 459 134, 134, 134, 134, 134, 134, 138, 134, 134, 138,
462 132, 132, 132, 132, 132, 132, 132, 132, 132, 128, 460 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
463 133, 128, 134, 135, 128, 136, 128, 128, 137, 128, 461 134, 139, 134, 140, 141, 134, 142, 134, 134, 143,
464 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 462 144, 134, 134, 134, 134, 134, 134, 134, 134, 134,
465 128, 128, 128, 128, 128, 128, 132, 128, 128, 132, 463 134, 134, 134, 134, 134, 134, 134, 138, 134, 134,
466 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 464 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
467 132, 128, 133, 128, 134, 128, 134, 128, 135, 136, 465 138, 138, 138, 134, 139, 134, 140, 134, 140, 134,
468 128, 128, 136, 128, 132, 132, 132, 132, 132, 132, 466 141, 142, 134, 134, 142, 134, 138, 138, 138, 138,
469 467
470 132, 132, 132, 132, 132, 50, 138, 132, 132, 132, 468 138, 138, 138, 138, 138, 138, 138, 138, 144, 145,
471 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 469 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
472 132, 132, 132, 132, 132, 132, 132, 0, 128, 128, 470 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
473 128, 128, 128, 128, 128, 128, 128, 128 471 138, 138, 138, 0, 134, 134, 134, 134, 134, 134,
472 134, 134, 134, 134, 134
474 } ; 473 } ;
475 474
476 static yyconst flex_int16_t yy_nxt[291] = 475 static yyconst flex_int16_t yy_nxt[296] =
477 { 0, 476 { 0,
478 10, 11, 12, 13, 14, 10, 15, 16, 17, 18, 477 10, 11, 12, 13, 14, 10, 15, 16, 17, 18,
479 19, 20, 21, 22, 23, 24, 25, 26, 10, 27, 478 19, 20, 21, 22, 23, 24, 25, 26, 10, 27,
480 17, 28, 29, 27, 30, 31, 32, 33, 34, 27, 479 17, 28, 29, 30, 27, 31, 32, 33, 34, 35,
481 27, 35, 27, 27, 27, 27, 36, 37, 27, 27, 480 27, 27, 36, 27, 27, 27, 27, 37, 38, 27,
482 38, 39, 40, 10, 42, 42, 47, 47, 48, 48, 481 27, 39, 40, 41, 10, 43, 43, 48, 48, 49,
483 58, 43, 43, 59, 61, 61, 75, 60, 62, 63, 482 49, 59, 44, 44, 60, 62, 62, 77, 61, 63,
484 65, 66, 76, 86, 78, 49, 49, 79, 61, 61, 483 64, 66, 67, 78, 88, 80, 50, 50, 81, 62,
485 87, 86, 86, 88, 127, 126, 125, 124, 128, 87, 484 62, 89, 88, 88, 90, 133, 132, 131, 130, 134,
486 123, 128, 88, 122, 121, 120, 119, 50, 50, 90, 485 89, 129, 134, 90, 128, 127, 126, 125, 124, 51,
487 90, 118, 90, 117, 90, 90, 90, 90, 90, 90, 486 51, 92, 92, 123, 92, 122, 92, 92, 92, 92,
488 487
489 90, 90, 90, 90, 90, 90, 90, 93, 93, 93, 488 92, 92, 92, 92, 92, 92, 92, 92, 92, 121,
490 94, 93, 93, 93, 93, 93, 93, 93, 93, 93, 489 120, 119, 96, 92, 92, 118, 92, 117, 92, 92,
491 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 490 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
492 93, 93, 93, 41, 41, 41, 41, 41, 41, 41, 491 92, 116, 115, 114, 96, 42, 42, 42, 42, 42,
493 41, 44, 44, 44, 44, 44, 44, 44, 44, 46, 492 42, 42, 42, 45, 45, 45, 45, 45, 45, 45,
494 46, 46, 46, 46, 46, 46, 46, 67, 116, 67, 493 45, 47, 47, 47, 47, 47, 47, 47, 47, 68,
495 83, 83, 83, 115, 83, 83, 83, 83, 85, 85, 494 113, 68, 85, 85, 85, 112, 85, 85, 85, 85,
496 85, 85, 85, 85, 85, 85, 89, 114, 89, 89, 495 87, 87, 87, 87, 87, 87, 87, 87, 91, 111,
497 89, 89, 89, 89, 90, 113, 112, 90, 90, 90, 496 91, 91, 91, 91, 91, 91, 92, 110, 109, 92,
498 90, 91, 91, 91, 91, 91, 91, 91, 91, 94, 497 92, 92, 92, 93, 93, 93, 93, 93, 93, 93,
499 498
500 94, 94, 111, 110, 109, 108, 107, 106, 84, 105, 499 93, 95, 86, 108, 95, 95, 95, 95, 95, 96,
501 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 500 96, 96, 107, 106, 105, 104, 103, 102, 101, 100,
502 51, 92, 84, 82, 81, 80, 77, 74, 73, 72, 501 99, 98, 97, 52, 94, 86, 84, 83, 82, 79,
503 71, 70, 69, 68, 64, 57, 56, 55, 54, 53, 502 76, 75, 74, 73, 72, 71, 70, 69, 65, 58,
504 52, 51, 128, 45, 45, 9, 128, 128, 128, 128, 503 57, 56, 55, 54, 53, 52, 134, 46, 46, 9,
505 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 504 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
506 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 505 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
507 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 506 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
508 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 507 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
508 134, 134, 134, 134, 134
509
509 } ; 510 } ;
510 511
511 static yyconst flex_int16_t yy_chk[291] = 512 static yyconst flex_int16_t yy_chk[296] =
512 { 0, 513 { 0,
513 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 514 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
514 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 515 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
515 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 516 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
516 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 517 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
517 1, 1, 1, 1, 3, 4, 7, 8, 7, 8, 518 1, 1, 1, 1, 1, 3, 4, 7, 8, 7,
518 21, 3, 4, 21, 23, 23, 35, 21, 24, 24, 519 8, 21, 3, 4, 21, 23, 23, 36, 21, 24,
519 26, 26, 35, 43, 37, 7, 8, 37, 61, 61, 520 24, 26, 26, 36, 44, 38, 7, 8, 38, 62,
520 43, 85, 87, 43, 123, 121, 120, 119, 85, 87, 521 62, 44, 87, 89, 44, 129, 126, 125, 124, 87,
521 118, 85, 87, 116, 114, 113, 112, 7, 8, 50, 522 89, 123, 87, 89, 121, 120, 118, 117, 116, 7,
522 50, 110, 50, 108, 50, 50, 50, 50, 50, 50, 523 8, 51, 51, 114, 51, 112, 51, 51, 51, 51,
523 524
524 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 525 51, 51, 51, 51, 51, 51, 51, 51, 51, 111,
525 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 526 108, 107, 51, 109, 109, 106, 109, 105, 109, 109,
526 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 527 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
527 50, 50, 50, 129, 129, 129, 129, 129, 129, 129, 528 109, 104, 101, 100, 109, 135, 135, 135, 135, 135,
528 129, 130, 130, 130, 130, 130, 130, 130, 130, 131, 529 135, 135, 135, 136, 136, 136, 136, 136, 136, 136,
529 131, 131, 131, 131, 131, 131, 131, 132, 105, 132,
530 133, 133, 133, 104, 133, 133, 133, 133, 134, 134,
531 134, 134, 134, 134, 134, 134, 135, 103, 135, 135,
532 135, 135, 135, 135, 136, 102, 101, 136, 136, 136,
533 136, 137, 137, 137, 137, 137, 137, 137, 137, 138, 530 136, 137, 137, 137, 137, 137, 137, 137, 137, 138,
534 531 99, 138, 139, 139, 139, 98, 139, 139, 139, 139,
535 138, 138, 98, 97, 96, 95, 94, 93, 83, 81, 532 140, 140, 140, 140, 140, 140, 140, 140, 141, 97,
536 80, 79, 78, 77, 76, 74, 73, 72, 71, 70, 533 141, 141, 141, 141, 141, 141, 142, 96, 95, 142,
537 51, 49, 41, 40, 39, 38, 36, 34, 33, 32, 534 142, 142, 142, 143, 143, 143, 143, 143, 143, 143,
538 31, 30, 29, 28, 25, 20, 19, 18, 16, 15, 535
539 13, 11, 9, 6, 5, 128, 128, 128, 128, 128, 536 143, 144, 85, 83, 144, 144, 144, 144, 144, 145,
540 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 537 145, 145, 82, 81, 80, 79, 78, 76, 75, 74,
541 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 538 73, 72, 71, 52, 50, 42, 41, 40, 39, 37,
542 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 539 35, 34, 33, 32, 31, 30, 29, 28, 25, 20,
543 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 540 19, 18, 16, 15, 13, 11, 9, 6, 5, 134,
541 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
542 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
543 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
544 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
545 134, 134, 134, 134, 134
546
544 } ; 547 } ;
545 548
546 static yy_state_type yy_last_accepting_state; 549 static yy_state_type yy_last_accepting_state;
547 static char *yy_last_accepting_cpos; 550 static char *yy_last_accepting_cpos;
548 551
581 584
582 585
583 586
584 #line 39 "script-scanner.ll" 587 #line 39 "script-scanner.ll"
585 #define YY_USER_ACTION yylloc->columns(yyleng); 588 #define YY_USER_ACTION yylloc->columns(yyleng);
586 #line 587 "script-scanner.cc" 589 #line 590 "script-scanner.cc"
587 590
588 #define INITIAL 0 591 #define INITIAL 0
589 #define C_COMMENT 1 592 #define C_COMMENT 1
590 #define CPP_COMMENT 2 593 #define CPP_COMMENT 2
591 #define STRING 3 594 #define STRING 3
601 #ifndef YY_EXTRA_TYPE 604 #ifndef YY_EXTRA_TYPE
602 #define YY_EXTRA_TYPE void * 605 #define YY_EXTRA_TYPE void *
603 #endif 606 #endif
604 607
605 static int yy_init_globals (void ); 608 static int yy_init_globals (void );
609
610 /* Accessor methods to globals.
611 These are made visible to non-reentrant scanners for convenience. */
612
613 int yylex_destroy (void );
614
615 int yyget_debug (void );
616
617 void yyset_debug (int debug_flag );
618
619 YY_EXTRA_TYPE yyget_extra (void );
620
621 void yyset_extra (YY_EXTRA_TYPE user_defined );
622
623 FILE *yyget_in (void );
624
625 void yyset_in (FILE * in_str );
626
627 FILE *yyget_out (void );
628
629 void yyset_out (FILE * out_str );
630
631 yy_size_t yyget_leng (void );
632
633 char *yyget_text (void );
634
635 int yyget_lineno (void );
636
637 void yyset_lineno (int line_number );
606 638
607 /* Macros after this point can all be overridden by user definitions in 639 /* Macros after this point can all be overridden by user definitions in
608 * section 1. 640 * section 1.
609 */ 641 */
610 642
642 /* Copy whatever the last rule matched to the standard output. */ 674 /* Copy whatever the last rule matched to the standard output. */
643 #ifndef ECHO 675 #ifndef ECHO
644 /* This used to be an fputs(), but since the string might contain NUL's, 676 /* This used to be an fputs(), but since the string might contain NUL's,
645 * we now use fwrite(). 677 * we now use fwrite().
646 */ 678 */
647 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) 679 #define ECHO fwrite( yytext, yyleng, 1, yyout )
648 #endif 680 #endif
649 681
650 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 682 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
651 * is returned in "result". 683 * is returned in "result".
652 */ 684 */
653 #ifndef YY_INPUT 685 #ifndef YY_INPUT
654 #define YY_INPUT(buf,result,max_size) \ 686 #define YY_INPUT(buf,result,max_size) \
655 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 687 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
656 { \ 688 { \
657 int c = '*'; \ 689 int c = '*'; \
658 size_t n; \ 690 yy_size_t n; \
659 for ( n = 0; n < max_size && \ 691 for ( n = 0; n < max_size && \
660 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 692 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
661 buf[n] = (char) c; \ 693 buf[n] = (char) c; \
662 if ( c == '\n' ) \ 694 if ( c == '\n' ) \
663 buf[n++] = (char) c; \ 695 buf[n++] = (char) c; \
744 776
745 yylloc->step(); 777 yylloc->step();
746 778
747 std::string string_buffer; 779 std::string string_buffer;
748 780
749 #line 750 "script-scanner.cc" 781 #line 782 "script-scanner.cc"
750 782
751 if ( !(yy_init) ) 783 if ( !(yy_init) )
752 { 784 {
753 (yy_init) = 1; 785 (yy_init) = 1;
754 786
797 (yy_last_accepting_cpos) = yy_cp; 829 (yy_last_accepting_cpos) = yy_cp;
798 } 830 }
799 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 831 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
800 { 832 {
801 yy_current_state = (int) yy_def[yy_current_state]; 833 yy_current_state = (int) yy_def[yy_current_state];
802 if ( yy_current_state >= 129 ) 834 if ( yy_current_state >= 135 )
803 yy_c = yy_meta[(unsigned int) yy_c]; 835 yy_c = yy_meta[(unsigned int) yy_c];
804 } 836 }
805 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 837 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
806 ++yy_cp; 838 ++yy_cp;
807 } 839 }
808 while ( yy_current_state != 128 ); 840 while ( yy_current_state != 134 );
809 yy_cp = (yy_last_accepting_cpos); 841 yy_cp = (yy_last_accepting_cpos);
810 yy_current_state = (yy_last_accepting_state); 842 yy_current_state = (yy_last_accepting_state);
811 843
812 yy_find_action: 844 yy_find_action:
813 yy_act = yy_accept[yy_current_state]; 845 yy_act = yy_accept[yy_current_state];
901 #line 66 "script-scanner.ll" 933 #line 66 "script-scanner.ll"
902 return token::TK_VOID; 934 return token::TK_VOID;
903 YY_BREAK 935 YY_BREAK
904 case 16: 936 case 16:
905 YY_RULE_SETUP 937 YY_RULE_SETUP
906 #line 68 "script-scanner.ll" 938 #line 67 "script-scanner.ll"
939 return token::TK_CODE;
940 YY_BREAK
941 case 17:
942 YY_RULE_SETUP
943 #line 69 "script-scanner.ll"
907 return token::TK_RETURN; 944 return token::TK_RETURN;
908 YY_BREAK 945 YY_BREAK
909 case 17: 946 case 18:
910 /* rule 17 can match eol */ 947 /* rule 18 can match eol */
911 YY_RULE_SETUP 948 YY_RULE_SETUP
912 #line 70 "script-scanner.ll" 949 #line 71 "script-scanner.ll"
913 yylloc->lines(); 950 yylloc->lines();
914 YY_BREAK 951 YY_BREAK
915 case 18: 952 case 19:
916 YY_RULE_SETUP 953 YY_RULE_SETUP
917 #line 72 "script-scanner.ll" 954 #line 73 "script-scanner.ll"
918 return yy::script_parser::token_type(yytext[0]); 955 return yy::script_parser::token_type(yytext[0]);
919 YY_BREAK 956 YY_BREAK
920 case 19: 957 case 20:
921 YY_RULE_SETUP 958 YY_RULE_SETUP
922 #line 74 "script-scanner.ll" 959 #line 75 "script-scanner.ll"
923 return token::TK_LOGAND; 960 return token::TK_LOGAND;
924 YY_BREAK 961 YY_BREAK
925 case 20: 962 case 21:
926 YY_RULE_SETUP 963 YY_RULE_SETUP
927 #line 75 "script-scanner.ll" 964 #line 76 "script-scanner.ll"
928 return token::TK_LOGOR; 965 return token::TK_LOGOR;
929 YY_BREAK 966 YY_BREAK
930 case 21: 967 case 22:
931 YY_RULE_SETUP 968 YY_RULE_SETUP
932 #line 76 "script-scanner.ll" 969 #line 77 "script-scanner.ll"
933 return token::TK_EQ; 970 return token::TK_EQ;
934 YY_BREAK 971 YY_BREAK
935 case 22: 972 case 23:
936 YY_RULE_SETUP 973 YY_RULE_SETUP
937 #line 77 "script-scanner.ll" 974 #line 78 "script-scanner.ll"
938 return token::TK_NE; 975 return token::TK_NE;
939 YY_BREAK 976 YY_BREAK
940 case 23: 977 case 24:
941 YY_RULE_SETUP 978 YY_RULE_SETUP
942 #line 78 "script-scanner.ll" 979 #line 79 "script-scanner.ll"
943 return token::TK_GE; 980 return token::TK_GE;
944 YY_BREAK 981 YY_BREAK
945 case 24: 982 case 25:
946 YY_RULE_SETUP 983 YY_RULE_SETUP
947 #line 79 "script-scanner.ll" 984 #line 80 "script-scanner.ll"
948 return token::TK_LE; 985 return token::TK_LE;
949 YY_BREAK 986 YY_BREAK
950 case 25: 987 case 26:
951 YY_RULE_SETUP 988 YY_RULE_SETUP
952 #line 80 "script-scanner.ll" 989 #line 81 "script-scanner.ll"
953 return token::TK_LSHIFT; 990 return token::TK_LSHIFT;
954 YY_BREAK 991 YY_BREAK
955 case 26: 992 case 27:
956 YY_RULE_SETUP 993 YY_RULE_SETUP
957 #line 81 "script-scanner.ll" 994 #line 82 "script-scanner.ll"
958 return token::TK_RSHIFT; 995 return token::TK_RSHIFT;
959 YY_BREAK 996 YY_BREAK
960 case 27: 997 case 28:
961 YY_RULE_SETUP 998 YY_RULE_SETUP
962 #line 83 "script-scanner.ll" 999 #line 84 "script-scanner.ll"
963 return token::TK_ADD_ASSIGN; 1000 return token::TK_ADD_ASSIGN;
964 YY_BREAK 1001 YY_BREAK
965 case 28: 1002 case 29:
966 YY_RULE_SETUP 1003 YY_RULE_SETUP
967 #line 84 "script-scanner.ll" 1004 #line 85 "script-scanner.ll"
968 return token::TK_SUB_ASSIGN; 1005 return token::TK_SUB_ASSIGN;
969 YY_BREAK 1006 YY_BREAK
970 case 29: 1007 case 30:
971 YY_RULE_SETUP 1008 YY_RULE_SETUP
972 #line 85 "script-scanner.ll" 1009 #line 86 "script-scanner.ll"
973 return token::TK_MUL_ASSIGN; 1010 return token::TK_MUL_ASSIGN;
974 YY_BREAK 1011 YY_BREAK
975 case 30: 1012 case 31:
976 YY_RULE_SETUP 1013 YY_RULE_SETUP
977 #line 86 "script-scanner.ll" 1014 #line 87 "script-scanner.ll"
978 return token::TK_DIV_ASSIGN; 1015 return token::TK_DIV_ASSIGN;
979 YY_BREAK 1016 YY_BREAK
980 case 31: 1017 case 32:
981 YY_RULE_SETUP 1018 YY_RULE_SETUP
982 #line 87 "script-scanner.ll" 1019 #line 88 "script-scanner.ll"
983 return token::TK_MOD_ASSIGN; 1020 return token::TK_MOD_ASSIGN;
984 YY_BREAK 1021 YY_BREAK
985 case 32: 1022 case 33:
986 YY_RULE_SETUP 1023 YY_RULE_SETUP
987 #line 89 "script-scanner.ll" 1024 #line 90 "script-scanner.ll"
988 yylloc->step(); 1025 yylloc->step();
989 YY_BREAK 1026 YY_BREAK
990 case 33: 1027 case 34:
991 YY_RULE_SETUP 1028 YY_RULE_SETUP
992 #line 90 "script-scanner.ll" 1029 #line 91 "script-scanner.ll"
993 { 1030 {
994 yylloc->step(); 1031 yylloc->step();
995 string_buffer.clear(); 1032 string_buffer.clear();
996 BEGIN(STRING); 1033 BEGIN(STRING);
997 } 1034 }
998 YY_BREAK 1035 YY_BREAK
999 case 34: 1036 case 35:
1000 YY_RULE_SETUP 1037 YY_RULE_SETUP
1001 #line 95 "script-scanner.ll" 1038 #line 96 "script-scanner.ll"
1002 { 1039 {
1003 errno = 0; 1040 errno = 0;
1004 long n = strtol(yytext, NULL, 10); 1041 long n = strtol(yytext, NULL, 10);
1005 if (n < LONG_MIN || n > LONG_MAX || errno == ERANGE) 1042 if (n < LONG_MIN || n > LONG_MAX || errno == ERANGE)
1006 driver.error(*yylloc, "整数が範囲外です。"); 1043 driver.error(*yylloc, "贋違膀峨с");
1007 yylval->ival = n; 1044 yylval->ival = n;
1008 return token::TK_IVAL; 1045 return token::TK_IVAL;
1009 } 1046 }
1010 YY_BREAK 1047 YY_BREAK
1011 case 35: 1048 case 36:
1012 YY_RULE_SETUP 1049 YY_RULE_SETUP
1013 #line 103 "script-scanner.ll" 1050 #line 104 "script-scanner.ll"
1014 { 1051 {
1015 yylval->ival = 0; 1052 yylval->ival = 0;
1016 return token::TK_IVAL; 1053 return token::TK_IVAL;
1017 } 1054 }
1018 YY_BREAK 1055 YY_BREAK
1019 case 36: 1056 case 37:
1020 YY_RULE_SETUP 1057 YY_RULE_SETUP
1021 #line 107 "script-scanner.ll" 1058 #line 108 "script-scanner.ll"
1022 { 1059 {
1023 yylval->sval = new std::string(yytext); 1060 yylval->sval = new std::string(yytext);
1024 return token::TK_IDENTIFIER; 1061 return token::TK_IDENTIFIER;
1025 } 1062 }
1026 YY_BREAK 1063 YY_BREAK
1027 case 37:
1028 YY_RULE_SETUP
1029 #line 111 "script-scanner.ll"
1030 driver.error(*yylloc, "この文字を識別子で使用することはできません。");
1031 YY_BREAK
1032
1033
1034 case 38: 1064 case 38:
1035 /* rule 38 can match eol */ 1065 YY_RULE_SETUP
1036 YY_RULE_SETUP 1066 #line 112 "script-scanner.ll"
1037 #line 114 "script-scanner.ll" 1067 driver.error(*yylloc, "絖茘ュт戎с障");
1068 YY_BREAK
1069
1070
1071 case 39:
1072 /* rule 39 can match eol */
1073 YY_RULE_SETUP
1074 #line 115 "script-scanner.ll"
1038 { 1075 {
1039 yylloc->lines(); 1076 yylloc->lines();
1040 driver.error(*yylloc, "文字列がとじられていません"); 1077 driver.error(*yylloc, "絖障");
1041 string_buffer.clear(); 1078 string_buffer.clear();
1042 BEGIN(INITIAL); 1079 BEGIN(INITIAL);
1043 } 1080 }
1044 YY_BREAK 1081 YY_BREAK
1045 case YY_STATE_EOF(STRING): 1082 case YY_STATE_EOF(STRING):
1046 #line 120 "script-scanner.ll" 1083 #line 121 "script-scanner.ll"
1047 { 1084 {
1048 driver.error(*yylloc, "文字列の途中でファイルが終了しました"); 1085 driver.error(*yylloc, "絖筝с<ゃ腟篋障");
1049 string_buffer.clear(); 1086 string_buffer.clear();
1050 BEGIN(INITIAL); 1087 BEGIN(INITIAL);
1051 } 1088 }
1052 YY_BREAK 1089 YY_BREAK
1053 case 39: 1090 case 40:
1054 YY_RULE_SETUP 1091 YY_RULE_SETUP
1055 #line 125 "script-scanner.ll" 1092 #line 126 "script-scanner.ll"
1056 { 1093 {
1057 string_buffer += yytext; 1094 string_buffer += yytext;
1058 } 1095 }
1059 YY_BREAK 1096 YY_BREAK
1060 case 40: 1097 case 41:
1061 YY_RULE_SETUP 1098 YY_RULE_SETUP
1062 #line 128 "script-scanner.ll" 1099 #line 129 "script-scanner.ll"
1063 { string_buffer += yytext; } 1100 { string_buffer += yytext; }
1064 YY_BREAK 1101 YY_BREAK
1065 case 41: 1102 case 42:
1066 /* rule 41 can match eol */ 1103 /* rule 42 can match eol */
1067 YY_RULE_SETUP 1104 YY_RULE_SETUP
1068 #line 129 "script-scanner.ll" 1105 #line 130 "script-scanner.ll"
1069 yylloc->lines(); 1106 yylloc->lines();
1070 YY_BREAK 1107 YY_BREAK
1071 case 42: 1108 case 43:
1072 YY_RULE_SETUP 1109 YY_RULE_SETUP
1073 #line 130 "script-scanner.ll" 1110 #line 131 "script-scanner.ll"
1074 { 1111 {
1075 switch (yytext[yyleng-1]) { 1112 switch (yytext[yyleng-1]) {
1076 case 'n': 1113 case 'n':
1077 string_buffer += '\n'; 1114 string_buffer += '\n';
1078 break; 1115 break;
1081 string_buffer += yytext[yyleng-1]; 1118 string_buffer += yytext[yyleng-1];
1082 break; 1119 break;
1083 } 1120 }
1084 } 1121 }
1085 YY_BREAK 1122 YY_BREAK
1086 case 43: 1123 case 44:
1087 YY_RULE_SETUP 1124 YY_RULE_SETUP
1088 #line 141 "script-scanner.ll" 1125 #line 142 "script-scanner.ll"
1089 { 1126 {
1090 BEGIN(INITIAL); 1127 BEGIN(INITIAL);
1091 yylval->sval = new std::string(string_buffer); 1128 yylval->sval = new std::string(string_buffer);
1092 return token::TK_SVAL; 1129 return token::TK_SVAL;
1093 } 1130 }
1094 YY_BREAK 1131 YY_BREAK
1095 1132
1096 1133
1097 case 44:
1098 YY_RULE_SETUP
1099 #line 148 "script-scanner.ll"
1100
1101 YY_BREAK
1102 case 45: 1134 case 45:
1103 /* rule 45 can match eol */
1104 YY_RULE_SETUP 1135 YY_RULE_SETUP
1105 #line 149 "script-scanner.ll" 1136 #line 149 "script-scanner.ll"
1137
1138 YY_BREAK
1139 case 46:
1140 /* rule 46 can match eol */
1141 YY_RULE_SETUP
1142 #line 150 "script-scanner.ll"
1106 { 1143 {
1107 yylloc->lines(); 1144 yylloc->lines();
1108 yylloc->step(); 1145 yylloc->step();
1109 BEGIN(INITIAL); 1146 BEGIN(INITIAL);
1110 } 1147 }
1111 YY_BREAK 1148 YY_BREAK
1112 1149
1113 1150
1114 case 46:
1115 YY_RULE_SETUP
1116 #line 156 "script-scanner.ll"
1117
1118 YY_BREAK
1119 case 47: 1151 case 47:
1120 /* rule 47 can match eol */
1121 YY_RULE_SETUP 1152 YY_RULE_SETUP
1122 #line 157 "script-scanner.ll" 1153 #line 157 "script-scanner.ll"
1154
1155 YY_BREAK
1156 case 48:
1157 /* rule 48 can match eol */
1158 YY_RULE_SETUP
1159 #line 158 "script-scanner.ll"
1123 { yylloc->lines(); } 1160 { yylloc->lines(); }
1124 YY_BREAK 1161 YY_BREAK
1125 case 48:
1126 YY_RULE_SETUP
1127 #line 158 "script-scanner.ll"
1128 /* 余分な*を探す */
1129 YY_BREAK
1130 case 49: 1162 case 49:
1131 /* rule 49 can match eol */
1132 YY_RULE_SETUP 1163 YY_RULE_SETUP
1133 #line 159 "script-scanner.ll" 1164 #line 159 "script-scanner.ll"
1165 /* 篏*「 */
1166 YY_BREAK
1167 case 50:
1168 /* rule 50 can match eol */
1169 YY_RULE_SETUP
1170 #line 160 "script-scanner.ll"
1134 { yylloc->lines(); } 1171 { yylloc->lines(); }
1135 YY_BREAK 1172 YY_BREAK
1136 case YY_STATE_EOF(C_COMMENT): 1173 case YY_STATE_EOF(C_COMMENT):
1137 #line 160 "script-scanner.ll"
1138 driver.error(*yylloc, "コメントの途中でファイルが終了しました");
1139 YY_BREAK
1140 case 50:
1141 YY_RULE_SETUP
1142 #line 161 "script-scanner.ll" 1174 #line 161 "script-scanner.ll"
1175 driver.error(*yylloc, "潟<潟筝с<ゃ腟篋障");
1176 YY_BREAK
1177 case 51:
1178 YY_RULE_SETUP
1179 #line 162 "script-scanner.ll"
1143 BEGIN(INITIAL); 1180 BEGIN(INITIAL);
1144 YY_BREAK 1181 YY_BREAK
1145 1182
1146 case 51: 1183 case 52:
1147 YY_RULE_SETUP 1184 YY_RULE_SETUP
1148 #line 163 "script-scanner.ll" 1185 #line 164 "script-scanner.ll"
1149 ECHO; 1186 ECHO;
1150 YY_BREAK 1187 YY_BREAK
1151 #line 1152 "script-scanner.cc" 1188 #line 1189 "script-scanner.cc"
1152 case YY_STATE_EOF(INITIAL): 1189 case YY_STATE_EOF(INITIAL):
1153 case YY_STATE_EOF(CPP_COMMENT): 1190 case YY_STATE_EOF(CPP_COMMENT):
1154 yyterminate(); 1191 yyterminate();
1155 1192
1156 case YY_END_OF_BUFFER: 1193 case YY_END_OF_BUFFER:
1334 */ 1371 */
1335 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 1372 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1336 1373
1337 else 1374 else
1338 { 1375 {
1339 int num_to_read = 1376 yy_size_t num_to_read =
1340 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 1377 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1341 1378
1342 while ( num_to_read <= 0 ) 1379 while ( num_to_read <= 0 )
1343 { /* Not enough room in the buffer - grow it. */ 1380 { /* Not enough room in the buffer - grow it. */
1344 1381
1348 int yy_c_buf_p_offset = 1385 int yy_c_buf_p_offset =
1349 (int) ((yy_c_buf_p) - b->yy_ch_buf); 1386 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1350 1387
1351 if ( b->yy_is_our_buffer ) 1388 if ( b->yy_is_our_buffer )
1352 { 1389 {
1353 int new_size = b->yy_buf_size * 2; 1390 yy_size_t new_size = b->yy_buf_size * 2;
1354 1391
1355 if ( new_size <= 0 ) 1392 if ( new_size <= 0 )
1356 b->yy_buf_size += b->yy_buf_size / 8; 1393 b->yy_buf_size += b->yy_buf_size / 8;
1357 else 1394 else
1358 b->yy_buf_size *= 2; 1395 b->yy_buf_size *= 2;
1379 if ( num_to_read > YY_READ_BUF_SIZE ) 1416 if ( num_to_read > YY_READ_BUF_SIZE )
1380 num_to_read = YY_READ_BUF_SIZE; 1417 num_to_read = YY_READ_BUF_SIZE;
1381 1418
1382 /* Read in more data. */ 1419 /* Read in more data. */
1383 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 1420 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1384 (yy_n_chars), (size_t) num_to_read ); 1421 (yy_n_chars), num_to_read );
1385 1422
1386 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1423 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1387 } 1424 }
1388 1425
1389 if ( (yy_n_chars) == 0 ) 1426 if ( (yy_n_chars) == 0 )
1402 } 1439 }
1403 } 1440 }
1404 1441
1405 else 1442 else
1406 ret_val = EOB_ACT_CONTINUE_SCAN; 1443 ret_val = EOB_ACT_CONTINUE_SCAN;
1444
1445 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1446 /* Extend the array by 50%, plus the number we really need. */
1447 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1448 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1449 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1450 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1451 }
1407 1452
1408 (yy_n_chars) += number_to_move; 1453 (yy_n_chars) += number_to_move;
1409 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 1454 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1410 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 1455 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1411 1456
1432 (yy_last_accepting_cpos) = yy_cp; 1477 (yy_last_accepting_cpos) = yy_cp;
1433 } 1478 }
1434 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1479 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1435 { 1480 {
1436 yy_current_state = (int) yy_def[yy_current_state]; 1481 yy_current_state = (int) yy_def[yy_current_state];
1437 if ( yy_current_state >= 129 ) 1482 if ( yy_current_state >= 135 )
1438 yy_c = yy_meta[(unsigned int) yy_c]; 1483 yy_c = yy_meta[(unsigned int) yy_c];
1439 } 1484 }
1440 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1485 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1441 } 1486 }
1442 1487
1460 (yy_last_accepting_cpos) = yy_cp; 1505 (yy_last_accepting_cpos) = yy_cp;
1461 } 1506 }
1462 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1507 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1463 { 1508 {
1464 yy_current_state = (int) yy_def[yy_current_state]; 1509 yy_current_state = (int) yy_def[yy_current_state];
1465 if ( yy_current_state >= 129 ) 1510 if ( yy_current_state >= 135 )
1466 yy_c = yy_meta[(unsigned int) yy_c]; 1511 yy_c = yy_meta[(unsigned int) yy_c];
1467 } 1512 }
1468 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1513 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1469 yy_is_jam = (yy_current_state == 128); 1514 yy_is_jam = (yy_current_state == 134);
1470 1515
1471 return yy_is_jam ? 0 : yy_current_state; 1516 return yy_is_jam ? 0 : yy_current_state;
1472 } 1517 }
1473 1518
1474 #ifndef YY_NO_INPUT 1519 #ifndef YY_NO_INPUT
1493 /* This was really a NUL. */ 1538 /* This was really a NUL. */
1494 *(yy_c_buf_p) = '\0'; 1539 *(yy_c_buf_p) = '\0';
1495 1540
1496 else 1541 else
1497 { /* need more input */ 1542 { /* need more input */
1498 int offset = (yy_c_buf_p) - (yytext_ptr); 1543 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1499 ++(yy_c_buf_p); 1544 ++(yy_c_buf_p);
1500 1545
1501 switch ( yy_get_next_buffer( ) ) 1546 switch ( yy_get_next_buffer( ) )
1502 { 1547 {
1503 case EOB_ACT_LAST_MATCH: 1548 case EOB_ACT_LAST_MATCH:
1517 /*FALLTHROUGH*/ 1562 /*FALLTHROUGH*/
1518 1563
1519 case EOB_ACT_END_OF_FILE: 1564 case EOB_ACT_END_OF_FILE:
1520 { 1565 {
1521 if ( yywrap( ) ) 1566 if ( yywrap( ) )
1522 return EOF; 1567 return 0;
1523 1568
1524 if ( ! (yy_did_buffer_switch_on_eof) ) 1569 if ( ! (yy_did_buffer_switch_on_eof) )
1525 YY_NEW_FILE; 1570 YY_NEW_FILE;
1526 #ifdef __cplusplus 1571 #ifdef __cplusplus
1527 return yyinput(); 1572 return yyinput();
1765 /* Allocates the stack if it does not exist. 1810 /* Allocates the stack if it does not exist.
1766 * Guarantees space for at least one push. 1811 * Guarantees space for at least one push.
1767 */ 1812 */
1768 static void yyensure_buffer_stack (void) 1813 static void yyensure_buffer_stack (void)
1769 { 1814 {
1770 int num_to_alloc; 1815 yy_size_t num_to_alloc;
1771 1816
1772 if (!(yy_buffer_stack)) { 1817 if (!(yy_buffer_stack)) {
1773 1818
1774 /* First allocation is just for 2 elements, since we don't know if this 1819 /* First allocation is just for 2 elements, since we don't know if this
1775 * scanner will even need a stack. We use 2 instead of 1 to avoid an 1820 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1777 */ 1822 */
1778 num_to_alloc = 1; 1823 num_to_alloc = 1;
1779 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 1824 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1780 (num_to_alloc * sizeof(struct yy_buffer_state*) 1825 (num_to_alloc * sizeof(struct yy_buffer_state*)
1781 ); 1826 );
1782 1827 if ( ! (yy_buffer_stack) )
1828 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1829
1783 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 1830 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1784 1831
1785 (yy_buffer_stack_max) = num_to_alloc; 1832 (yy_buffer_stack_max) = num_to_alloc;
1786 (yy_buffer_stack_top) = 0; 1833 (yy_buffer_stack_top) = 0;
1787 return; 1834 return;
1795 num_to_alloc = (yy_buffer_stack_max) + grow_size; 1842 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1796 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 1843 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1797 ((yy_buffer_stack), 1844 ((yy_buffer_stack),
1798 num_to_alloc * sizeof(struct yy_buffer_state*) 1845 num_to_alloc * sizeof(struct yy_buffer_state*)
1799 ); 1846 );
1847 if ( ! (yy_buffer_stack) )
1848 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1800 1849
1801 /* zero only the new slots.*/ 1850 /* zero only the new slots.*/
1802 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 1851 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1803 (yy_buffer_stack_max) = num_to_alloc; 1852 (yy_buffer_stack_max) = num_to_alloc;
1804 } 1853 }
1859 } 1908 }
1860 1909
1861 /** Get the length of the current token. 1910 /** Get the length of the current token.
1862 * 1911 *
1863 */ 1912 */
1864 int yyget_leng (void) 1913 yy_size_t yyget_leng (void)
1865 { 1914 {
1866 return yyleng; 1915 return yyleng;
1867 } 1916 }
1868 1917
1869 /** Get the current token. 1918 /** Get the current token.
2007 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 2056 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2008 } 2057 }
2009 2058
2010 #define YYTABLES_NAME "yytables" 2059 #define YYTABLES_NAME "yytables"
2011 2060
2012 #line 163 "script-scanner.ll" 2061 #line 164 "script-scanner.ll"
2013 2062
2014 2063
2015 2064
2016 void compiler::scan_begin() 2065 void compiler::scan_begin()
2017 { 2066 {
2018 if ((yyin = fopen(file.c_str(), "r")) == 0) 2067 if ((yyin = fopen(file.c_str(), "r")) == 0)
2019 error(file + " がオープンできません。"); 2068 error(file + " 若潟с障");
2020 } 2069 }
2021 2070
2022 void compiler::scan_end() 2071 void compiler::scan_end()
2023 { 2072 {
2024 fclose(yyin); 2073 fclose(yyin);