2 #pragma GCC diagnostic ignored "-Wsign-compare" 6 # pragma clang diagnostic ignored "-Wdeprecated" 7 # pragma clang diagnostic ignored "-Wnull-conversion" 9 # pragma GCC diagnostic ignored "-Wsuggest-attribute=const" 10 # pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn" 11 # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" 12 # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" 15 #line 2 "lib/vcsn/rat/scan.cc" 16 #line 7 "lib/vcsn/rat/scan.ll" 20 #define yyterminate() return parser::make_END(loc) 24 #line 11 "lib/vcsn/rat/scan.cc" 26 #define YY_INT_ALIGNED short int 39 #define YY_FLEX_MAJOR_VERSION 2 40 #define YY_FLEX_MINOR_VERSION 6 41 #define YY_FLEX_SUBMINOR_VERSION 0 42 #if YY_FLEX_SUBMINOR_VERSION > 0 53 #define yyFlexLexer yyFlexLexer 80 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 85 #ifndef __STDC_LIMIT_MACROS 86 #define __STDC_LIMIT_MACROS 1 106 #define INT8_MIN (-128) 109 #define INT16_MIN (-32767-1) 112 #define INT32_MIN (-2147483647-1) 115 #define INT8_MAX (127) 118 #define INT16_MAX (32767) 121 #define INT32_MAX (2147483647) 124 #define UINT8_MAX (255U) 127 #define UINT16_MAX (65535U) 130 #define UINT32_MAX (4294967295U) 157 #if defined (__STDC__) 165 #define yyconst const 183 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 197 #define BEGIN (yy_start) = 1 + 2 * 203 #define YY_START (((yy_start) - 1) / 2) 204 #define YYSTATE YY_START 207 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 210 #define YY_NEW_FILE yyrestart( yyin ) 212 #define YY_END_OF_BUFFER_CHAR 0 221 #define YY_BUF_SIZE 32768 223 #define YY_BUF_SIZE 16384 229 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 231 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 232 #define YY_TYPEDEF_YY_BUFFER_STATE 236 #ifndef YY_TYPEDEF_YY_SIZE_T 237 #define YY_TYPEDEF_YY_SIZE_T 250 #define EOB_ACT_CONTINUE_SCAN 0 251 #define EOB_ACT_END_OF_FILE 1 252 #define EOB_ACT_LAST_MATCH 2 254 #define YY_LESS_LINENO(n) 255 #define YY_LINENO_REWIND_TO(ptr) 262 int yyless_macro_arg = (n); \ 263 YY_LESS_LINENO(yyless_macro_arg);\ 264 *yy_cp = (yy_hold_char); \ 265 YY_RESTORE_YY_MORE_OFFSET \ 266 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 267 YY_DO_BEFORE_ACTION; \ 271 #define unput(c) yyunput( c, (yytext_ptr) ) 273 #ifndef YY_STRUCT_YY_BUFFER_STATE 274 #define YY_STRUCT_YY_BUFFER_STATE 326 #define YY_BUFFER_NEW 0 327 #define YY_BUFFER_NORMAL 1 338 #define YY_BUFFER_EOF_PENDING 2 358 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 359 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 365 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 380 #define yy_new_buffer yy_create_buffer 382 #define yy_set_interactive(is_interactive) \ 384 if ( ! YY_CURRENT_BUFFER ){ \ 385 yyensure_buffer_stack (); \ 386 YY_CURRENT_BUFFER_LVALUE = \ 387 yy_create_buffer( yyin, YY_BUF_SIZE ); \ 389 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 392 #define yy_set_bol(at_bol) \ 394 if ( ! YY_CURRENT_BUFFER ){\ 395 yyensure_buffer_stack (); \ 396 YY_CURRENT_BUFFER_LVALUE = \ 397 yy_create_buffer( yyin, YY_BUF_SIZE ); \ 399 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 402 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 411 #define yytext_ptr yytext 412 #define YY_INTERACTIVE 424 #define YY_DO_BEFORE_ACTION \ 425 (yytext_ptr) = yy_bp; \ 427 yyleng = (size_t) (yy_cp - yy_bp); \ 428 (yy_hold_char) = *yy_cp; \ 431 (yy_c_buf_p) = yy_cp; 434 #define YY_NUM_RULES 59 435 #define YY_END_OF_BUFFER 60 445 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
446 60, 40, 30, 31, 22, 6, 3, 40, 1, 2,
447 18, 7, 12, 9, 4, 28, 32, 17, 14, 29,
448 40, 32, 13, 40, 40, 40, 40, 59, 35, 40,
449 33, 34, 43, 44, 41, 42, 55, 55, 55, 58,
450 56, 57, 58, 30, 31, 5, 0, 0, 0, 8,
451 39, 39, 16, 39, 15, 0, 0, 0, 0, 0,
452 0, 0, 0, 0, 0, 20, 22, 21, 16, 0,
453 0, 0, 0, 0, 43, 44, 47, 48, 46, 0,
454 58, 0, 36, 0, 36, 0, 0, 26, 0, 0,
456 18, 19, 0, 11, 17, 24, 10, 23, 25, 15,
457 28, 32, 45, 49, 50, 51, 52, 53, 54, 56,
463 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
464 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
465 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
466 1, 2, 4, 1, 5, 1, 6, 7, 8, 9,
467 10, 11, 12, 13, 14, 15, 16, 17, 17, 17,
468 17, 17, 17, 17, 17, 18, 18, 19, 1, 20,
469 1, 21, 22, 23, 24, 24, 24, 24, 24, 24,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 25, 1, 1, 1, 1, 1, 1,
472 26, 27, 28, 29, 1, 1, 24, 24, 30, 24,
474 31, 24, 1, 1, 1, 1, 1, 1, 1, 1,
475 1, 1, 1, 1, 1, 32, 1, 1, 1, 33,
476 1, 34, 35, 36, 37, 1, 1, 1, 38, 1,
477 1, 1, 39, 1, 1, 40, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 41, 1, 1, 1, 1, 42, 1, 1, 43, 1,
480 1, 1, 1, 1, 1, 1, 1, 44, 45, 1,
481 1, 46, 1, 1, 1, 47, 1, 48, 49, 50,
482 51, 52, 53, 54, 55, 1, 1, 1, 1, 1,
483 1, 1, 1, 56, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 57, 1, 1, 1, 1,
486 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
487 1, 1, 1, 1, 58, 59, 1, 1, 1, 1,
488 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
489 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
495 1, 1, 2, 1, 1, 1, 1, 3, 4, 4,
496 1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
497 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
498 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
499 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
500 1, 1, 1, 1, 1, 1, 1, 1, 5
505 0, 0, 58, 0, 73, 87, 7, 32, 54, 78,
506 255, 256, 237, 234, 256, 256, 213, 201, 186, 256,
507 256, 256, 256, 256, 256, 195, 256, 256, 256, 256,
508 72, 127, 256, 63, 155, 49, 64, 256, 256, 75,
509 256, 256, 0, 202, 256, 256, 256, 71, 166, 0,
510 256, 256, 160, 200, 196, 256, 102, 119, 118, 256,
511 256, 181, 256, 138, 256, 160, 159, 113, 158, 148,
512 156, 155, 141, 126, 123, 256, 256, 256, 256, 112,
513 109, 120, 93, 80, 0, 145, 256, 256, 256, 129,
514 0, 91, 256, 120, 150, 183, 132, 256, 116, 170,
516 256, 256, 172, 256, 256, 256, 256, 256, 256, 256,
517 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
518 256, 111, 256, 256, 256, 256, 210, 215, 220, 225,
519 230, 235, 240, 244, 249
524 126, 1, 1, 3, 127, 127, 128, 128, 129, 129,
525 126, 126, 126, 126, 126, 126, 126, 130, 126, 126,
526 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
527 131, 126, 126, 126, 126, 126, 126, 126, 126, 131,
528 126, 126, 132, 126, 126, 126, 126, 126, 126, 133,
529 126, 126, 126, 126, 126, 126, 130, 134, 126, 126,
530 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
531 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
532 126, 126, 126, 126, 132, 126, 126, 126, 126, 126,
533 133, 126, 126, 130, 130, 134, 135, 126, 126, 126,
535 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
536 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
537 126, 135, 126, 126, 126, 0, 126, 126, 126, 126,
538 126, 126, 126, 126, 126
543 12, 13, 14, 15, 12, 16, 17, 18, 19, 20,
544 21, 22, 23, 12, 24, 12, 12, 12, 25, 26,
545 27, 28, 29, 12, 12, 30, 31, 12, 12, 12,
546 12, 12, 12, 12, 32, 33, 27, 12, 12, 12,
547 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
548 12, 12, 12, 12, 12, 34, 35, 36, 37, 12,
549 38, 12, 48, 12, 12, 49, 12, 12, 12, 12,
550 12, 39, 12, 51, 52, 44, 12, 12, 12, 12,
551 12, 45, 46, 12, 40, 41, 42, 48, 62, 44,
552 49, 62, 12, 12, 12, 45, 46, 51, 52, 80,
554 81, 82, 63, 83, 64, 65, 84, 64, 77, 93,
555 78, 78, 53, 12, 12, 12, 12, 78, 87, 88,
556 123, 57, 97, 111, 112, 89, 95, 93, 58, 103,
557 103, 110, 124, 101, 120, 121, 53, 66, 67, 68,
558 98, 123, 69, 70, 70, 96, 58, 86, 71, 76,
559 108, 72, 106, 73, 100, 100, 74, 93, 75, 109,
560 68, 100, 108, 76, 70, 70, 78, 100, 100, 78,
561 78, 78, 78, 78, 78, 113, 58, 107, 114, 115,
562 116, 117, 118, 119, 76, 57, 125, 125, 103, 103,
563 95, 106, 105, 125, 104, 102, 101, 99, 55, 125,
565 125, 54, 92, 90, 86, 79, 60, 59, 76, 96,
566 43, 43, 43, 43, 43, 47, 47, 47, 47, 47,
567 50, 50, 50, 50, 50, 57, 57, 58, 57, 57,
568 61, 56, 61, 61, 61, 85, 55, 85, 54, 85,
569 91, 91, 91, 91, 94, 94, 94, 94, 94, 122,
570 122, 122, 122, 122, 126, 11, 126, 126, 126, 126,
571 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
572 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
573 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
574 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
576 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
577 126, 126, 126, 126, 126
582 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
583 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
584 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
585 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
586 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
587 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
588 3, 3, 7, 3, 3, 7, 3, 3, 3, 3,
589 3, 3, 3, 9, 9, 5, 3, 3, 3, 3,
590 3, 5, 5, 3, 3, 3, 3, 8, 31, 6,
591 8, 40, 3, 3, 3, 6, 6, 10, 10, 36,
593 36, 37, 31, 37, 31, 31, 37, 40, 34, 57,
594 34, 34, 9, 3, 3, 3, 3, 34, 48, 48,
595 122, 58, 59, 84, 84, 48, 58, 94, 57, 68,
596 68, 83, 99, 83, 92, 92, 10, 32, 32, 32,
597 59, 97, 32, 32, 32, 58, 94, 86, 32, 68,
598 81, 32, 80, 32, 64, 64, 32, 95, 32, 75,
599 70, 64, 74, 32, 70, 70, 82, 64, 64, 82,
600 82, 82, 82, 82, 82, 90, 95, 73, 90, 90,
601 90, 90, 90, 90, 70, 96, 100, 100, 103, 103,
602 96, 72, 71, 100, 69, 67, 66, 62, 55, 100,
604 100, 54, 53, 49, 44, 35, 26, 19, 103, 96,
605 127, 127, 127, 127, 127, 128, 128, 128, 128, 128,
606 129, 129, 129, 129, 129, 130, 130, 18, 130, 130,
607 131, 17, 131, 131, 131, 132, 14, 132, 13, 132,
608 133, 133, 133, 133, 134, 134, 134, 134, 134, 135,
609 135, 135, 135, 135, 11, 126, 126, 126, 126, 126,
610 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
611 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
612 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
613 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
615 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
616 126, 126, 126, 126, 126
621 62, 63, 65, 66, 67, 68, 69, 70, 71, 72,
622 73, 74, 75, 76, 77, 78, 81, 82, 83, 84,
623 89, 98, 99, 100, 101, 104, 105, 108, 111, 114,
624 115, 117, 124, 128, 129, 139, 143, 144, 145, 146,
625 151, 155, 168, 169, 178, 179, 180, 181, 182, 183,
626 184, 185, 186, 187, 188, 202, 207, 221
632 #define REJECT reject_used_but_not_detected 633 #define yymore() yymore_used_but_not_detected 634 #define YY_MORE_ADJ 0 635 #define YY_RESTORE_YY_MORE_OFFSET 636 #line 1 "lib/vcsn/rat/scan.ll" 637 #define YY_NO_INPUT 1 639 #line 14 "lib/vcsn/rat/scan.ll" 645 #include <boost/lexical_cast.hpp> 655 loc.end.column = 1; \ 659 #define YY_USER_ACTION \ 663 parser::make_ ## Token (loc) 671 #line 658 "lib/vcsn/rat/scan.cc" 676 #define SC_EXPONENT 3 679 #ifndef YY_NO_UNISTD_H 691 #ifndef YY_EXTRA_TYPE 692 #define YY_EXTRA_TYPE void * 711 static void yy_flex_strncpy (
char *,
yyconst char *,
int );
714 #ifdef YY_NEED_STRLEN 715 static int yy_flex_strlen (
yyconst char * );
731 #ifndef YY_READ_BUF_SIZE 734 #define YY_READ_BUF_SIZE 16384 736 #define YY_READ_BUF_SIZE 8192 745 #define ECHO LexerOutput( yytext, yyleng ) 753 #define YY_INPUT(buf,result,max_size) \ 757 if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) \ 758 YY_FATAL_ERROR( "input in flex scanner failed" ); 768 #define yyterminate() return YY_NULL 772 #ifndef YY_START_STACK_INCR 773 #define YY_START_STACK_INCR 25 777 #ifndef YY_FATAL_ERROR 781 #define YY_FATAL_ERROR(msg) LexerError( msg ) 802 #define YY_DECL_IS_OURS 1 806 #define YY_DECL int yyFlexLexer::yylex() 813 #ifndef YY_USER_ACTION 814 #define YY_USER_ACTION 819 #define YY_BREAK break; 823 #define YY_RULE_SETUP \ 851 yyin.rdbuf(std::cin.rdbuf());
858 yyout.rdbuf(std::cout.rdbuf());
862 yyensure_buffer_stack ();
867 yy_load_buffer_state( );
872 #line 48 "lib/vcsn/rat/scan.ll" 876 unsigned int nesting = 0;
878 unsigned int exponent = 0;
880 static std::string context;
885 #line 872 "lib/vcsn/rat/scan.cc" 890 yy_cp = (yy_c_buf_p);
893 *yy_cp = (yy_hold_char);
901 yy_current_state = (yy_start);
908 (yy_last_accepting_state) = yy_current_state;
909 (yy_last_accepting_cpos) = yy_cp;
911 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
913 yy_current_state = (int)
yy_def[yy_current_state];
914 if ( yy_current_state >= 127 )
915 yy_c =
yy_meta[(
unsigned int) yy_c];
917 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + (
unsigned int) yy_c];
920 while (
yy_base[yy_current_state] != 256 );
927 yy_cp = (yy_last_accepting_cpos);
928 yy_current_state = (yy_last_accepting_state);
942 std::cerr <<
"--scanner backing up\n";
943 else if ( yy_act < 59 )
945 "(\"" << yytext <<
"\")\n";
946 else if ( yy_act == 59 )
947 std::cerr <<
"--accepting default rule (\"" << yytext <<
"\")\n";
948 else if ( yy_act == 60 )
949 std::cerr <<
"--(end of buffer or a NUL)\n";
951 std::cerr <<
"--EOF (start condition " <<
YY_START <<
")\n";
959 *yy_cp = (yy_hold_char);
960 yy_cp = (yy_last_accepting_cpos);
961 yy_current_state = (yy_last_accepting_state);
967 #line 62 "lib/vcsn/rat/scan.ll" 972 #line 63 "lib/vcsn/rat/scan.ll" 977 #line 65 "lib/vcsn/rat/scan.ll" 978 return TOK(AMPERSAND);
982 #line 66 "lib/vcsn/rat/scan.ll" 987 #line 67 "lib/vcsn/rat/scan.ll" 988 return TOK(AMPERSAND_COLON);
992 #line 68 "lib/vcsn/rat/scan.ll" 997 #line 69 "lib/vcsn/rat/scan.ll" 1002 #line 70 "lib/vcsn/rat/scan.ll" 1003 return TOK(LT_PLUS);
1007 #line 71 "lib/vcsn/rat/scan.ll" 1012 #line 72 "lib/vcsn/rat/scan.ll" 1013 return TOK(BACKSLASH);
1017 #line 73 "lib/vcsn/rat/scan.ll" 1022 #line 74 "lib/vcsn/rat/scan.ll" 1027 #line 75 "lib/vcsn/rat/scan.ll" 1032 #line 76 "lib/vcsn/rat/scan.ll" 1037 #line 77 "lib/vcsn/rat/scan.ll" 1042 #line 78 "lib/vcsn/rat/scan.ll" 1048 #line 81 "lib/vcsn/rat/scan.ll" 1049 return parser::make_STAR(std::make_tuple(0, 1), loc);
1053 #line 82 "lib/vcsn/rat/scan.ll" 1054 return parser::make_STAR(std::make_tuple(-1, -1), loc);
1058 #line 83 "lib/vcsn/rat/scan.ll" 1059 return parser::make_STAR(std::make_tuple(1, -1), loc);
1063 #line 84 "lib/vcsn/rat/scan.ll" 1065 return parser::make_STAR(
quantifier(driver_, loc,
1066 {yytext+1,
static_cast<size_t>(
yyleng)-2}),
1072 #line 89 "lib/vcsn/rat/scan.ll" 1083 #line 98 "lib/vcsn/rat/scan.ll" 1088 #line 99 "lib/vcsn/rat/scan.ll" 1089 return TOK(COMPLEMENT);
1093 #line 100 "lib/vcsn/rat/scan.ll" 1094 return TOK(TRANSPOSITION);
1098 #line 101 "lib/vcsn/rat/scan.ll" 1099 return TOK(TRANSPOSE);
1104 #line 104 "lib/vcsn/rat/scan.ll" 1110 #line 105 "lib/vcsn/rat/scan.ll" 1116 #line 108 "lib/vcsn/rat/scan.ll" 1122 #line 111 "lib/vcsn/rat/scan.ll" 1123 yy_push_state(
SC_CLASS);
return parser::make_LBRACKET(loc);
1128 #line 114 "lib/vcsn/rat/scan.ll" 1129 loc.step();
continue;
1134 #line 115 "lib/vcsn/rat/scan.ll" 1139 #line 117 "lib/vcsn/rat/scan.ll" 1141 throw parser::syntax_error(loc,
1142 std::string{
"unexpected character: "} + yytext);
1149 #line 124 "lib/vcsn/rat/scan.ll" 1152 return parser::make_RBRACKET(loc);
1157 #line 128 "lib/vcsn/rat/scan.ll" 1158 return parser::make_CARET(loc);
1162 #line 129 "lib/vcsn/rat/scan.ll" 1163 return parser::make_DASH(loc);
1166 #line 131 "lib/vcsn/rat/scan.ll" 1168 driver_.error(loc,
"unexpected end of file in a character-class");
1177 #line 139 "lib/vcsn/rat/scan.ll" 1179 return parser::make_LETTER({yytext+1, size_t(
yyleng-2)}, loc);
1183 #line 144 "lib/vcsn/rat/scan.ll" 1185 #line 145 "lib/vcsn/rat/scan.ll" 1187 #line 146 "lib/vcsn/rat/scan.ll" 1190 #line 146 "lib/vcsn/rat/scan.ll" 1191 return parser::make_LETTER({yytext, size_t(
yyleng)}, loc);
1197 #line 151 "lib/vcsn/rat/scan.ll" 1200 context.append(yytext,
yyleng);
1205 #line 155 "lib/vcsn/rat/scan.ll" 1210 context.append(yytext,
yyleng);
1215 driver_.context(context);
1222 #line 168 "lib/vcsn/rat/scan.ll" 1223 context.append(yytext,
yyleng);
1228 #line 169 "lib/vcsn/rat/scan.ll" 1232 #line 171 "lib/vcsn/rat/scan.ll" 1234 driver_.error(loc,
"unexpected end of file in a context comment");
1242 #line 178 "lib/vcsn/rat/scan.ll" 1247 #line 179 "lib/vcsn/rat/scan.ll" 1248 exponent *= 10; exponent += 1;
1252 #line 180 "lib/vcsn/rat/scan.ll" 1253 exponent *= 10; exponent += 2;
1257 #line 181 "lib/vcsn/rat/scan.ll" 1258 exponent *= 10; exponent += 3;
1262 #line 182 "lib/vcsn/rat/scan.ll" 1263 exponent *= 10; exponent += 4;
1267 #line 183 "lib/vcsn/rat/scan.ll" 1268 exponent *= 10; exponent += 5;
1272 #line 184 "lib/vcsn/rat/scan.ll" 1273 exponent *= 10; exponent += 6;
1277 #line 185 "lib/vcsn/rat/scan.ll" 1278 exponent *= 10; exponent += 7;
1282 #line 186 "lib/vcsn/rat/scan.ll" 1283 exponent *= 10; exponent += 8;
1287 #line 187 "lib/vcsn/rat/scan.ll" 1288 exponent *= 10; exponent += 9;
1293 #line 188 "lib/vcsn/rat/scan.ll" 1299 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1303 #line 195 "lib/vcsn/rat/scan.ll" 1306 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1313 #line 202 "lib/vcsn/rat/scan.ll" 1316 s.append(yytext,
yyleng);
1321 #line 207 "lib/vcsn/rat/scan.ll" 1326 s.append(yytext,
yyleng);
1331 return parser::make_WEIGHT(s, loc);
1339 #line 221 "lib/vcsn/rat/scan.ll" 1340 s.append(yytext,
yyleng);
1343 #line 223 "lib/vcsn/rat/scan.ll" 1345 driver_.error(loc,
"unexpected end of file in a weight");
1352 #line 229 "lib/vcsn/rat/scan.ll" 1355 #line 1342 "lib/vcsn/rat/scan.cc" 1362 int yy_amount_of_matched_text = (int) (yy_cp - (
yytext_ptr)) - 1;
1365 *yy_cp = (yy_hold_char);
1399 (yy_c_buf_p) = (
yytext_ptr) + yy_amount_of_matched_text;
1401 yy_current_state = yy_get_previous_state( );
1412 yy_next_state = yy_try_NUL_trans( yy_current_state );
1416 if ( yy_next_state )
1419 yy_cp = ++(yy_c_buf_p);
1420 yy_current_state = yy_next_state;
1427 yy_cp = (yy_c_buf_p);
1428 goto yy_find_action;
1432 else switch ( yy_get_next_buffer( ) )
1436 (yy_did_buffer_switch_on_eof) = 0;
1457 if ( ! (yy_did_buffer_switch_on_eof) )
1467 yy_current_state = yy_get_previous_state( );
1469 yy_cp = (yy_c_buf_p);
1477 yy_current_state = yy_get_previous_state( );
1479 yy_cp = (yy_c_buf_p);
1481 goto yy_find_action;
1488 "fatal flex scanner internal error--no action found" );
1503 yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
1504 yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf())
1512 yyin(arg_yyin.rdbuf()),
1513 yyout(arg_yyout.rdbuf())
1528 yy_did_buffer_switch_on_eof = 0;
1530 yy_looking_for_trail_begin = 0;
1533 yy_more_offset = yy_prev_more_offset = 0;
1535 yy_start_stack_ptr = yy_start_stack_depth = 0;
1536 yy_start_stack = NULL;
1538 yy_buffer_stack = 0;
1539 yy_buffer_stack_top = 0;
1540 yy_buffer_stack_max = 0;
1550 delete [] yy_state_buf;
1553 yyfree(yy_buffer_stack );
1562 yy_switch_to_buffer( yy_create_buffer( new_in,
YY_BUF_SIZE ) );
1565 yyout.rdbuf(new_out.rdbuf());
1580 switch_streams(*new_in, *new_out);
1583 #ifdef YY_INTERACTIVE 1589 if ( yyin.eof() || yyin.fail() )
1592 #ifdef YY_INTERACTIVE 1604 (
void) yyin.read( buf, max_size );
1609 return yyin.gcount();
1615 (
void) yyout.write( buf, size );
1641 "fatal flex scanner internal error--end of buffer missed" );
1667 for ( i = 0; i < number_to_move; ++i )
1668 *(dest++) = *(source++);
1681 while ( num_to_read <= 0 )
1687 int yy_c_buf_p_offset =
1694 if ( new_size <= 0 )
1709 "fatal error - scanner input buffer overflow" );
1711 (yy_c_buf_p) = &b->
yy_ch_buf[yy_c_buf_p_offset];
1752 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1778 yy_current_state = (yy_start);
1786 (yy_last_accepting_state) = yy_current_state;
1787 (yy_last_accepting_cpos) = yy_cp;
1789 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1791 yy_current_state = (int)
yy_def[yy_current_state];
1792 if ( yy_current_state >= 127 )
1793 yy_c =
yy_meta[(
unsigned int) yy_c];
1795 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + (
unsigned int) yy_c];
1798 return yy_current_state;
1814 char *yy_cp = (yy_c_buf_p);
1819 (yy_last_accepting_state) = yy_current_state;
1820 (yy_last_accepting_cpos) = yy_cp;
1822 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1824 yy_current_state = (int)
yy_def[yy_current_state];
1825 if ( yy_current_state >= 127 )
1826 yy_c =
yy_meta[(
unsigned int) yy_c];
1828 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + (
unsigned int) yy_c];
1829 yy_is_jam = (yy_current_state == 126);
1831 return yy_is_jam ? 0 : yy_current_state;
1843 yy_cp = (yy_c_buf_p);
1846 *yy_cp = (yy_hold_char);
1848 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->
yy_ch_buf + 2 )
1858 *--dest = *--source;
1860 yy_cp += (int) (dest - source);
1861 yy_bp += (int) (dest - source);
1865 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->
yy_ch_buf + 2 )
1869 *--yy_cp = (
char) c;
1874 (yy_hold_char) = *yy_cp;
1875 (yy_c_buf_p) = yy_cp;
1889 *(yy_c_buf_p) = (yy_hold_char);
1899 *(yy_c_buf_p) =
'\0';
1906 switch ( yy_get_next_buffer( ) )
1929 if ( ! (yy_did_buffer_switch_on_eof) )
1945 c = *(
unsigned char *) (yy_c_buf_p);
1946 *(yy_c_buf_p) =
'\0';
1947 (yy_hold_char) = *++(yy_c_buf_p);
1969 yyensure_buffer_stack ();
1975 yy_load_buffer_state( );
1986 yyrestart( *input_file );
2006 yyensure_buffer_stack ();
2013 *(yy_c_buf_p) = (yy_hold_char);
2019 yy_load_buffer_state( );
2026 (yy_did_buffer_switch_on_eof) = 1;
2042 (yy_hold_char) = *(yy_c_buf_p);
2074 yy_init_buffer( b, file );
2088 return yy_create_buffer( *file, size );
2128 yy_flush_buffer( b );
2182 yy_load_buffer_state( );
2198 if (new_buffer == NULL)
2201 yyensure_buffer_stack();
2207 *(yy_c_buf_p) = (yy_hold_char);
2214 (yy_buffer_stack_top)++;
2218 yy_load_buffer_state( );
2219 (yy_did_buffer_switch_on_eof) = 1;
2239 if ((yy_buffer_stack_top) > 0)
2240 --(yy_buffer_stack_top);
2243 yy_load_buffer_state( );
2244 (yy_did_buffer_switch_on_eof) = 1;
2261 if (!(yy_buffer_stack)) {
2271 if ( ! (yy_buffer_stack) )
2272 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2274 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
2276 (yy_buffer_stack_max) = num_to_alloc;
2277 (yy_buffer_stack_top) = 0;
2281 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2286 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2291 if ( ! (yy_buffer_stack) )
2292 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2295 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size *
sizeof(
struct yy_buffer_state*));
2296 (yy_buffer_stack_max) = num_to_alloc;
2316 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
2321 new_size = (yy_start_stack_depth) *
sizeof(
int );
2323 if ( ! (yy_start_stack) )
2324 (yy_start_stack) = (
int *)
yyalloc(new_size );
2327 (yy_start_stack) = (
int *)
yyrealloc((
void *) (yy_start_stack),new_size );
2329 if ( ! (yy_start_stack) )
2330 YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
2333 (yy_start_stack)[(yy_start_stack_ptr)++] =
YY_START;
2344 if ( --(yy_start_stack_ptr) < 0 )
2347 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
2350 #ifndef YY_EXIT_FAILURE 2351 #define YY_EXIT_FAILURE 2 2359 std::cerr << msg << std::endl;
2371 int yyless_macro_arg = (n); \ 2372 YY_LESS_LINENO(yyless_macro_arg);\ 2373 yytext[yyleng] = (yy_hold_char); \ 2374 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 2375 (yy_hold_char) = *(yy_c_buf_p); \ 2376 *(yy_c_buf_p) = '\0'; \ 2377 yyleng = yyless_macro_arg; \ 2408 static void yy_flex_strncpy (
char* s1,
yyconst char * s2,
int n )
2412 for ( i = 0; i < n; ++i )
2417 #ifdef YY_NEED_STRLEN 2418 static int yy_flex_strlen (
yyconst char * s )
2421 for ( n = 0; s[n]; ++n )
2430 return (
void *) malloc( size );
2443 return (
void *) realloc( (
char *) ptr, size );
2448 free( (
char *) ptr );
2453 #define YYTABLES_NAME "yytables" 2458 #line 229 "lib/vcsn/rat/scan.ll" 2464 template <
typename Out>
2472 catch (
const boost::bad_lexical_cast&)
2474 d.error(loc,
"invalid numerical literal: " + s);
2480 int arity(driver& d,
const location& loc,
const std::string& s)
2496 auto arity_re = std::regex{
"([0-9]*)(,?)([0-9]*)", std::regex::extended};
2498 if (!std::regex_match(s, minmax, arity_re))
2499 throw std::runtime_error(
"cannot match arity: " + s);
2501 arity(d, loc, minmax[3].
str())};
2502 if (minmax[2].
str().empty())
2504 std::get<1>(
res) = std::get<0>(
res);
2533 set_debug(!!getenv(
"YYSCAN"));
2535 yy_switch_to_buffer(yy_create_buffer(&f,
YY_BUF_SIZE));
2540 yypop_buffer_state();
void scan_open_(std::istream &f)
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
virtual void LexerError(const char *msg)
void yy_delete_buffer(yy_buffer_state *b)
Destroy the buffer.
T lexical_cast(const std::string &str)
String to templated type T conversion.
unsigned short int flex_uint16_t
irange_type quantifier(driver &d, const location &loc, const std::string &s)
void yypush_buffer_state(yy_buffer_state *new_buffer)
Pushes the new state onto the stack.
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
void yy_flush_buffer(yy_buffer_state *b)
Discard all buffered characters.
weightset_mixin< detail::b_impl > b
static YY_CHAR yy_meta[60]
static flex_uint16_t yy_nxt[316]
void yy_push_state(int new_state)
#define YY_CURRENT_BUFFER
#define YY_RESTORE_YY_MORE_OFFSET
void * yyalloc(yy_size_t size)
#define YY_INPUT(buf, result, max_size)
#define EOB_ACT_CONTINUE_SCAN
#define EOB_ACT_LAST_MATCH
static flex_int16_t yy_rule_linenum[59]
void yy_switch_to_buffer(yy_buffer_state *new_buffer)
Switch to a different input buffer.
#define YY_END_OF_BUFFER_CHAR
#define YY_FATAL_ERROR(msg)
#define YY_FLEX_NAMESPACE_END
void yypop_buffer_state()
Removes and deletes the top of the stack, if present.
void yyrestart(std::istream *s)
Immediately switch to a different input stream.
vcsn::rat::location location
Pairs of positions in a file/stream.
unsigned char flex_uint8_t
unsigned int flex_uint32_t
yyFlexLexer(std::istream &arg_yyin, std::ostream &arg_yyout)
void yyunput(int c, char *buf_ptr)
#define EOB_ACT_END_OF_FILE
void yy_init_buffer(yy_buffer_state *b, std::istream *s)
virtual void LexerOutput(const char *buf, int size)
static flex_int16_t yy_chk[316]
#define YY_START_STACK_INCR
#define YY_DO_BEFORE_ACTION
void yy_load_buffer_state()
int yy_bs_column
The column count.
static flex_int16_t yy_accept[127]
std::streambuf * yy_input_file
void * yyrealloc(void *ptr, yy_size_t size)
Define the vcsn::rat::parser class.
int yy_bs_lineno
The line count.
#define YY_STATE_EOF(state)
virtual int LexerInput(char *buf, int max_size)
static flex_int16_t yy_def[136]
static YY_CHAR yy_ec[256]
#define YY_CURRENT_BUFFER_LVALUE
virtual void switch_streams(std::istream *new_in, std::ostream *new_out=nullptr)
#define YY_BUFFER_EOF_PENDING
yy_state_type yy_get_previous_state()
static flex_uint16_t yy_base[136]
yy_buffer_state * yy_create_buffer(std::istream *s, int size)
Allocate and initialize an input buffer state.
struct yy_buffer_state * YY_BUFFER_STATE
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
void yyensure_buffer_stack(void)