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" 19 #define yyterminate() return parser::make_END(loc) 21 #line 8 "lib/vcsn/rat/scan.cc" 23 #define YY_INT_ALIGNED short int 36 #define YY_FLEX_MAJOR_VERSION 2 37 #define YY_FLEX_MINOR_VERSION 6 38 #define YY_FLEX_SUBMINOR_VERSION 1 39 #if YY_FLEX_SUBMINOR_VERSION > 0 50 #define yyFlexLexer yyFlexLexer 77 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 82 #ifndef __STDC_LIMIT_MACROS 83 #define __STDC_LIMIT_MACROS 1 103 #define INT8_MIN (-128) 106 #define INT16_MIN (-32767-1) 109 #define INT32_MIN (-2147483647-1) 112 #define INT8_MAX (127) 115 #define INT16_MAX (32767) 118 #define INT32_MAX (2147483647) 121 #define UINT8_MAX (255U) 124 #define UINT16_MAX (65535U) 127 #define UINT32_MAX (4294967295U) 147 #define yyconst const 149 #if defined(__GNUC__) && __GNUC__ >= 3 150 #define yynoreturn __attribute__((__noreturn__)) 168 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 182 #define BEGIN (yy_start) = 1 + 2 * 188 #define YY_START (((yy_start) - 1) / 2) 189 #define YYSTATE YY_START 192 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 195 #define YY_NEW_FILE yyrestart( yyin ) 197 #define YY_END_OF_BUFFER_CHAR 0 206 #define YY_BUF_SIZE 32768 208 #define YY_BUF_SIZE 16384 214 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 216 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 217 #define YY_TYPEDEF_YY_BUFFER_STATE 221 #ifndef YY_TYPEDEF_YY_SIZE_T 222 #define YY_TYPEDEF_YY_SIZE_T 235 #define EOB_ACT_CONTINUE_SCAN 0 236 #define EOB_ACT_END_OF_FILE 1 237 #define EOB_ACT_LAST_MATCH 2 239 #define YY_LESS_LINENO(n) 240 #define YY_LINENO_REWIND_TO(ptr) 247 int yyless_macro_arg = (n); \ 248 YY_LESS_LINENO(yyless_macro_arg);\ 249 *yy_cp = (yy_hold_char); \ 250 YY_RESTORE_YY_MORE_OFFSET \ 251 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 252 YY_DO_BEFORE_ACTION; \ 256 #define unput(c) yyunput( c, (yytext_ptr) ) 258 #ifndef YY_STRUCT_YY_BUFFER_STATE 259 #define YY_STRUCT_YY_BUFFER_STATE 311 #define YY_BUFFER_NEW 0 312 #define YY_BUFFER_NORMAL 1 323 #define YY_BUFFER_EOF_PENDING 2 343 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 344 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 350 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 365 #define yy_new_buffer yy_create_buffer 367 #define yy_set_interactive(is_interactive) \ 369 if ( ! YY_CURRENT_BUFFER ){ \ 370 yyensure_buffer_stack (); \ 371 YY_CURRENT_BUFFER_LVALUE = \ 372 yy_create_buffer( yyin, YY_BUF_SIZE ); \ 374 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 377 #define yy_set_bol(at_bol) \ 379 if ( ! YY_CURRENT_BUFFER ){\ 380 yyensure_buffer_stack (); \ 381 YY_CURRENT_BUFFER_LVALUE = \ 382 yy_create_buffer( yyin, YY_BUF_SIZE ); \ 384 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 387 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 396 #define yytext_ptr yytext 397 #define YY_INTERACTIVE 409 #define YY_DO_BEFORE_ACTION \ 410 (yytext_ptr) = yy_bp; \ 412 yyleng = (int) (yy_cp - yy_bp); \ 413 (yy_hold_char) = *yy_cp; \ 416 (yy_c_buf_p) = yy_cp; 419 #define YY_NUM_RULES 61 420 #define YY_END_OF_BUFFER 62 430 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
431 62, 42, 32, 33, 23, 7, 4, 42, 1, 2,
432 19, 8, 13, 10, 5, 30, 34, 18, 15, 31,
433 42, 3, 34, 14, 42, 42, 42, 42, 61, 37,
434 42, 35, 36, 45, 46, 43, 44, 57, 57, 57,
435 60, 58, 59, 60, 32, 33, 6, 0, 0, 0,
436 9, 41, 41, 17, 41, 16, 0, 0, 0, 0,
437 0, 0, 0, 0, 0, 0, 21, 23, 22, 17,
438 0, 0, 0, 0, 0, 45, 46, 49, 50, 48,
439 0, 60, 0, 38, 0, 38, 0, 0, 0, 27,
441 0, 0, 19, 20, 0, 12, 18, 25, 11, 24,
442 26, 16, 30, 34, 47, 51, 52, 53, 54, 55,
443 56, 58, 59, 0, 29, 0, 39, 40, 28, 0
448 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451 1, 2, 4, 1, 5, 1, 6, 7, 8, 9,
452 10, 11, 12, 13, 14, 15, 16, 17, 17, 17,
453 17, 17, 17, 17, 17, 18, 18, 19, 1, 20,
454 1, 21, 22, 23, 24, 24, 24, 24, 24, 24,
455 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
456 1, 1, 1, 25, 1, 1, 1, 1, 1, 1,
457 26, 27, 28, 29, 1, 1, 24, 24, 30, 24,
459 31, 24, 1, 1, 1, 1, 1, 1, 1, 1,
460 1, 1, 1, 1, 1, 32, 1, 1, 1, 33,
461 1, 34, 35, 36, 37, 1, 1, 1, 38, 1,
462 1, 1, 39, 1, 1, 40, 1, 1, 1, 1,
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 41, 1, 1, 1, 1, 42, 1, 1, 43, 1,
465 1, 1, 1, 1, 1, 1, 1, 44, 45, 1,
466 1, 46, 1, 1, 1, 47, 1, 48, 49, 50,
467 51, 52, 53, 54, 55, 1, 1, 1, 1, 1,
468 1, 1, 1, 56, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 57, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 58, 59, 1, 1, 1, 1,
473 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1, 1, 2, 1, 1, 1, 1, 3, 4, 4,
481 1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
482 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
484 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 1, 1, 1, 6
490 0, 0, 58, 0, 73, 87, 7, 32, 54, 78,
491 270, 271, 267, 264, 271, 271, 225, 215, 214, 271,
492 271, 271, 271, 271, 271, 219, 271, 271, 271, 271,
493 72, 271, 127, 271, 63, 157, 49, 64, 271, 271,
494 75, 271, 271, 0, 204, 271, 271, 271, 71, 168,
495 0, 271, 271, 162, 202, 200, 271, 102, 119, 127,
496 271, 271, 185, 271, 138, 271, 162, 161, 116, 160,
497 148, 159, 158, 156, 155, 141, 271, 271, 271, 271,
498 122, 109, 120, 82, 80, 0, 145, 271, 271, 271,
499 129, 0, 86, 271, 133, 150, 183, 132, 0, 271,
501 119, 170, 271, 271, 172, 271, 271, 271, 271, 271,
502 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
503 271, 271, 271, 125, 271, 107, 271, 271, 271, 271,
504 210, 216, 222, 228, 234, 240, 246, 250, 256, 262
509 130, 1, 1, 3, 131, 131, 132, 132, 133, 133,
510 130, 130, 130, 130, 130, 130, 130, 134, 130, 130,
511 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
512 135, 130, 130, 130, 130, 130, 130, 130, 130, 130,
513 135, 130, 130, 136, 130, 130, 130, 130, 130, 130,
514 137, 130, 130, 130, 130, 130, 130, 134, 138, 130,
515 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
516 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
517 130, 130, 130, 130, 130, 136, 130, 130, 130, 130,
518 130, 137, 130, 130, 134, 134, 138, 139, 140, 130,
520 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
521 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
522 130, 130, 130, 139, 130, 140, 130, 130, 130, 0,
523 130, 130, 130, 130, 130, 130, 130, 130, 130, 130
528 12, 13, 14, 15, 12, 16, 17, 18, 19, 20,
529 21, 22, 23, 12, 24, 12, 12, 12, 25, 26,
530 27, 28, 29, 12, 12, 30, 31, 32, 12, 12,
531 12, 12, 12, 12, 33, 34, 27, 12, 12, 12,
532 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
533 12, 12, 12, 12, 12, 35, 36, 37, 38, 12,
534 39, 12, 49, 12, 12, 50, 12, 12, 12, 12,
535 12, 40, 12, 52, 53, 45, 12, 12, 12, 12,
536 12, 46, 47, 12, 41, 42, 43, 49, 63, 45,
537 50, 63, 12, 12, 12, 46, 47, 52, 53, 81,
539 82, 83, 64, 84, 65, 66, 85, 65, 78, 94,
540 79, 79, 54, 12, 12, 12, 12, 79, 88, 89,
541 112, 58, 103, 113, 114, 90, 96, 129, 59, 122,
542 123, 98, 105, 105, 125, 127, 54, 67, 68, 69,
543 94, 125, 70, 71, 71, 97, 99, 87, 72, 100,
544 110, 73, 77, 74, 102, 102, 75, 94, 76, 59,
545 69, 102, 108, 77, 71, 71, 79, 102, 102, 79,
546 79, 79, 79, 79, 79, 115, 59, 111, 116, 117,
547 118, 119, 120, 121, 77, 58, 128, 128, 105, 105,
548 96, 110, 109, 128, 108, 107, 106, 104, 103, 128,
550 128, 101, 56, 55, 93, 91, 87, 80, 77, 97,
551 44, 44, 44, 44, 44, 44, 48, 48, 48, 48,
552 48, 48, 51, 51, 51, 51, 51, 51, 58, 58,
553 61, 58, 58, 58, 62, 60, 62, 62, 62, 62,
554 86, 59, 86, 57, 86, 86, 92, 92, 92, 92,
555 95, 95, 95, 95, 95, 95, 124, 124, 124, 124,
556 124, 124, 126, 126, 126, 126, 56, 126, 55, 130,
557 11, 130, 130, 130, 130, 130, 130, 130, 130, 130,
558 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
559 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
561 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
562 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
563 130, 130, 130, 130, 130, 130, 130, 130, 130, 130
568 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
569 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
570 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
571 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
572 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
573 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
574 3, 3, 7, 3, 3, 7, 3, 3, 3, 3,
575 3, 3, 3, 9, 9, 5, 3, 3, 3, 3,
576 3, 5, 5, 3, 3, 3, 3, 8, 31, 6,
577 8, 41, 3, 3, 3, 6, 6, 10, 10, 37,
579 37, 38, 31, 38, 31, 31, 38, 41, 35, 58,
580 35, 35, 9, 3, 3, 3, 3, 35, 49, 49,
581 84, 59, 84, 85, 85, 49, 59, 126, 58, 93,
582 93, 60, 69, 69, 124, 101, 10, 33, 33, 33,
583 95, 98, 33, 33, 33, 59, 60, 87, 33, 60,
584 82, 33, 69, 33, 65, 65, 33, 96, 33, 95,
585 71, 65, 81, 33, 71, 71, 83, 65, 65, 83,
586 83, 83, 83, 83, 83, 91, 96, 76, 91, 91,
587 91, 91, 91, 91, 71, 97, 102, 102, 105, 105,
588 97, 75, 74, 102, 73, 72, 70, 68, 67, 102,
590 102, 63, 56, 55, 54, 50, 45, 36, 105, 97,
591 131, 131, 131, 131, 131, 131, 132, 132, 132, 132,
592 132, 132, 133, 133, 133, 133, 133, 133, 134, 134,
593 26, 134, 134, 134, 135, 19, 135, 135, 135, 135,
594 136, 18, 136, 17, 136, 136, 137, 137, 137, 137,
595 138, 138, 138, 138, 138, 138, 139, 139, 139, 139,
596 139, 139, 140, 140, 140, 140, 14, 140, 13, 11,
597 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
598 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
599 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
601 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
602 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
603 130, 130, 130, 130, 130, 130, 130, 130, 130, 130
608 65, 66, 67, 69, 70, 71, 72, 73, 74, 75,
609 76, 77, 78, 79, 80, 81, 82, 85, 86, 87,
610 88, 93, 102, 103, 104, 105, 108, 109, 113, 116,
611 119, 122, 123, 125, 132, 136, 137, 147, 151, 152,
612 153, 154, 159, 163, 176, 177, 186, 187, 188, 189,
613 190, 191, 192, 193, 194, 195, 196, 210, 215, 229
619 #define REJECT reject_used_but_not_detected 620 #define yymore() yymore_used_but_not_detected 621 #define YY_MORE_ADJ 0 622 #define YY_RESTORE_YY_MORE_OFFSET 623 #line 1 "lib/vcsn/rat/scan.ll" 624 #define YY_NO_INPUT 1 626 #line 14 "lib/vcsn/rat/scan.ll" 632 #include <boost/lexical_cast.hpp> 642 loc.end.column = 1; \ 646 #define YY_USER_ACTION \ 650 parser::make_ ## Token (loc) 659 #line 646 "lib/vcsn/rat/scan.cc" 664 #define SC_EXPONENT 3 667 #ifndef YY_NO_UNISTD_H 679 #ifndef YY_EXTRA_TYPE 680 #define YY_EXTRA_TYPE void * 699 static void yy_flex_strncpy (
char *,
yyconst char *,
int );
702 #ifdef YY_NEED_STRLEN 703 static int yy_flex_strlen (
yyconst char * );
719 #ifndef YY_READ_BUF_SIZE 722 #define YY_READ_BUF_SIZE 16384 724 #define YY_READ_BUF_SIZE 8192 733 #define ECHO LexerOutput( yytext, yyleng ) 741 #define YY_INPUT(buf,result,max_size) \ 745 if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) \ 746 YY_FATAL_ERROR( "input in flex scanner failed" ); 756 #define yyterminate() return YY_NULL 760 #ifndef YY_START_STACK_INCR 761 #define YY_START_STACK_INCR 25 765 #ifndef YY_FATAL_ERROR 769 #define YY_FATAL_ERROR(msg) LexerError( msg ) 790 #define YY_DECL_IS_OURS 1 794 #define YY_DECL int yyFlexLexer::yylex() 801 #ifndef YY_USER_ACTION 802 #define YY_USER_ACTION 807 #define YY_BREAK break; 811 #define YY_RULE_SETUP \ 839 yyin.rdbuf(std::cin.rdbuf());
846 yyout.rdbuf(std::cout.rdbuf());
850 yyensure_buffer_stack ();
855 yy_load_buffer_state( );
860 #line 51 "lib/vcsn/rat/scan.ll" 864 unsigned int nesting = 0;
866 unsigned int exponent = 0;
868 static std::string context;
873 #line 860 "lib/vcsn/rat/scan.cc" 878 yy_cp = (yy_c_buf_p);
881 *yy_cp = (yy_hold_char);
889 yy_current_state = (yy_start);
896 (yy_last_accepting_state) = yy_current_state;
897 (yy_last_accepting_cpos) = yy_cp;
899 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
901 yy_current_state = (int)
yy_def[yy_current_state];
902 if ( yy_current_state >= 131 )
903 yy_c =
yy_meta[(
unsigned int) yy_c];
908 while (
yy_base[yy_current_state] != 271 );
915 yy_cp = (yy_last_accepting_cpos);
916 yy_current_state = (yy_last_accepting_state);
930 std::cerr <<
"--scanner backing up\n";
931 else if ( yy_act < 61 )
933 "(\"" << yytext <<
"\")\n";
934 else if ( yy_act == 61 )
935 std::cerr <<
"--accepting default rule (\"" << yytext <<
"\")\n";
936 else if ( yy_act == 62 )
937 std::cerr <<
"--(end of buffer or a NUL)\n";
939 std::cerr <<
"--EOF (start condition " <<
YY_START <<
")\n";
947 *yy_cp = (yy_hold_char);
948 yy_cp = (yy_last_accepting_cpos);
949 yy_current_state = (yy_last_accepting_state);
955 #line 65 "lib/vcsn/rat/scan.ll" 956 return parser::make_LPAREN({}, loc);
960 #line 66 "lib/vcsn/rat/scan.ll" 965 #line 67 "lib/vcsn/rat/scan.ll" 966 return TOK(RBRACKET);
970 #line 69 "lib/vcsn/rat/scan.ll" 971 return TOK(AMPERSAND);
975 #line 70 "lib/vcsn/rat/scan.ll" 980 #line 71 "lib/vcsn/rat/scan.ll" 981 return TOK(AMPERSAND_COLON);
985 #line 72 "lib/vcsn/rat/scan.ll" 990 #line 73 "lib/vcsn/rat/scan.ll" 995 #line 74 "lib/vcsn/rat/scan.ll" 1000 #line 75 "lib/vcsn/rat/scan.ll" 1005 #line 76 "lib/vcsn/rat/scan.ll" 1006 return TOK(BACKSLASH);
1010 #line 77 "lib/vcsn/rat/scan.ll" 1015 #line 78 "lib/vcsn/rat/scan.ll" 1020 #line 79 "lib/vcsn/rat/scan.ll" 1025 #line 80 "lib/vcsn/rat/scan.ll" 1030 #line 81 "lib/vcsn/rat/scan.ll" 1035 #line 82 "lib/vcsn/rat/scan.ll" 1041 #line 85 "lib/vcsn/rat/scan.ll" 1042 return parser::make_STAR(std::make_tuple(0, 1), loc);
1046 #line 86 "lib/vcsn/rat/scan.ll" 1047 return parser::make_STAR(std::make_tuple(-1, -1), loc);
1051 #line 87 "lib/vcsn/rat/scan.ll" 1052 return parser::make_STAR(std::make_tuple(1, -1), loc);
1056 #line 88 "lib/vcsn/rat/scan.ll" 1058 return parser::make_STAR(
quantifier(driver_, loc,
1059 {yytext+1,
static_cast<size_t>(
yyleng)-2}),
1065 #line 93 "lib/vcsn/rat/scan.ll" 1076 #line 102 "lib/vcsn/rat/scan.ll" 1081 #line 103 "lib/vcsn/rat/scan.ll" 1082 return TOK(COMPLEMENT);
1086 #line 104 "lib/vcsn/rat/scan.ll" 1087 return TOK(TRANSPOSITION);
1091 #line 105 "lib/vcsn/rat/scan.ll" 1092 return TOK(TRANSPOSE);
1097 #line 108 "lib/vcsn/rat/scan.ll" 1103 #line 109 "lib/vcsn/rat/scan.ll" 1105 return parser::make_LPAREN(
symbol{yytext + 3,
yyleng - 4},
1112 #line 113 "lib/vcsn/rat/scan.ll" 1118 #line 116 "lib/vcsn/rat/scan.ll" 1124 #line 119 "lib/vcsn/rat/scan.ll" 1130 #line 122 "lib/vcsn/rat/scan.ll" 1131 loc.step();
continue;
1136 #line 123 "lib/vcsn/rat/scan.ll" 1141 #line 125 "lib/vcsn/rat/scan.ll" 1143 throw parser::syntax_error(loc,
1144 std::string{
"unexpected character: "} + yytext);
1151 #line 132 "lib/vcsn/rat/scan.ll" 1154 return TOK(RBRACKET);
1159 #line 136 "lib/vcsn/rat/scan.ll" 1164 #line 137 "lib/vcsn/rat/scan.ll" 1168 #line 139 "lib/vcsn/rat/scan.ll" 1170 driver_.error(loc,
"unexpected end of file in a character-class");
1179 #line 147 "lib/vcsn/rat/scan.ll" 1181 return parser::make_LETTER({yytext+1, size_t(
yyleng-2)}, loc);
1185 #line 152 "lib/vcsn/rat/scan.ll" 1187 #line 153 "lib/vcsn/rat/scan.ll" 1189 #line 154 "lib/vcsn/rat/scan.ll" 1192 #line 154 "lib/vcsn/rat/scan.ll" 1193 return parser::make_LETTER({yytext, size_t(
yyleng)}, loc);
1199 #line 159 "lib/vcsn/rat/scan.ll" 1202 context.append(yytext,
yyleng);
1207 #line 163 "lib/vcsn/rat/scan.ll" 1212 context.append(yytext,
yyleng);
1217 driver_.context(context);
1224 #line 176 "lib/vcsn/rat/scan.ll" 1225 context.append(yytext,
yyleng);
1230 #line 177 "lib/vcsn/rat/scan.ll" 1234 #line 179 "lib/vcsn/rat/scan.ll" 1236 driver_.error(loc,
"unexpected end of file in a context comment");
1244 #line 186 "lib/vcsn/rat/scan.ll" 1249 #line 187 "lib/vcsn/rat/scan.ll" 1250 exponent *= 10; exponent += 1;
1254 #line 188 "lib/vcsn/rat/scan.ll" 1255 exponent *= 10; exponent += 2;
1259 #line 189 "lib/vcsn/rat/scan.ll" 1260 exponent *= 10; exponent += 3;
1264 #line 190 "lib/vcsn/rat/scan.ll" 1265 exponent *= 10; exponent += 4;
1269 #line 191 "lib/vcsn/rat/scan.ll" 1270 exponent *= 10; exponent += 5;
1274 #line 192 "lib/vcsn/rat/scan.ll" 1275 exponent *= 10; exponent += 6;
1279 #line 193 "lib/vcsn/rat/scan.ll" 1280 exponent *= 10; exponent += 7;
1284 #line 194 "lib/vcsn/rat/scan.ll" 1285 exponent *= 10; exponent += 8;
1289 #line 195 "lib/vcsn/rat/scan.ll" 1290 exponent *= 10; exponent += 9;
1295 #line 196 "lib/vcsn/rat/scan.ll" 1301 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1305 #line 203 "lib/vcsn/rat/scan.ll" 1308 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1315 #line 210 "lib/vcsn/rat/scan.ll" 1318 s.append(yytext,
yyleng);
1323 #line 215 "lib/vcsn/rat/scan.ll" 1328 s.append(yytext,
yyleng);
1333 return parser::make_WEIGHT(s, loc);
1341 #line 229 "lib/vcsn/rat/scan.ll" 1342 s.append(yytext,
yyleng);
1345 #line 231 "lib/vcsn/rat/scan.ll" 1347 driver_.error(loc,
"unexpected end of file in a weight");
1354 #line 237 "lib/vcsn/rat/scan.ll" 1357 #line 1344 "lib/vcsn/rat/scan.cc" 1364 int yy_amount_of_matched_text = (int) (yy_cp - (
yytext_ptr)) - 1;
1367 *yy_cp = (yy_hold_char);
1401 (yy_c_buf_p) = (
yytext_ptr) + yy_amount_of_matched_text;
1403 yy_current_state = yy_get_previous_state( );
1414 yy_next_state = yy_try_NUL_trans( yy_current_state );
1418 if ( yy_next_state )
1421 yy_cp = ++(yy_c_buf_p);
1422 yy_current_state = yy_next_state;
1429 yy_cp = (yy_c_buf_p);
1430 goto yy_find_action;
1434 else switch ( yy_get_next_buffer( ) )
1438 (yy_did_buffer_switch_on_eof) = 0;
1459 if ( ! (yy_did_buffer_switch_on_eof) )
1469 yy_current_state = yy_get_previous_state( );
1471 yy_cp = (yy_c_buf_p);
1479 yy_current_state = yy_get_previous_state( );
1481 yy_cp = (yy_c_buf_p);
1483 goto yy_find_action;
1490 "fatal flex scanner internal error--no action found" );
1505 yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
1506 yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf())
1514 yyin(arg_yyin.rdbuf()),
1515 yyout(arg_yyout.rdbuf())
1530 yy_did_buffer_switch_on_eof = 0;
1532 yy_looking_for_trail_begin = 0;
1535 yy_more_offset = yy_prev_more_offset = 0;
1537 yy_start_stack_ptr = yy_start_stack_depth = 0;
1538 yy_start_stack = NULL;
1540 yy_buffer_stack = NULL;
1541 yy_buffer_stack_top = 0;
1542 yy_buffer_stack_max = 0;
1552 delete [] yy_state_buf;
1555 yyfree(yy_buffer_stack );
1564 yy_switch_to_buffer( yy_create_buffer( new_in,
YY_BUF_SIZE ) );
1567 yyout.rdbuf(new_out.rdbuf());
1582 switch_streams(*new_in, *new_out);
1585 #ifdef YY_INTERACTIVE 1591 if ( yyin.eof() || yyin.fail() )
1594 #ifdef YY_INTERACTIVE 1606 (
void) yyin.read( buf, max_size );
1611 return yyin.gcount();
1617 (
void) yyout.write( buf, size );
1643 "fatal flex scanner internal error--end of buffer missed" );
1669 for ( i = 0; i < number_to_move; ++i )
1670 *(dest++) = *(source++);
1683 while ( num_to_read <= 0 )
1689 int yy_c_buf_p_offset =
1696 if ( new_size <= 0 )
1711 "fatal error - scanner input buffer overflow" );
1713 (yy_c_buf_p) = &b->
yy_ch_buf[yy_c_buf_p_offset];
1754 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1780 yy_current_state = (yy_start);
1788 (yy_last_accepting_state) = yy_current_state;
1789 (yy_last_accepting_cpos) = yy_cp;
1791 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1793 yy_current_state = (int)
yy_def[yy_current_state];
1794 if ( yy_current_state >= 131 )
1795 yy_c =
yy_meta[(
unsigned int) yy_c];
1800 return yy_current_state;
1816 char *yy_cp = (yy_c_buf_p);
1821 (yy_last_accepting_state) = yy_current_state;
1822 (yy_last_accepting_cpos) = yy_cp;
1824 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1826 yy_current_state = (int)
yy_def[yy_current_state];
1827 if ( yy_current_state >= 131 )
1828 yy_c =
yy_meta[(
unsigned int) yy_c];
1831 yy_is_jam = (yy_current_state == 130);
1833 return yy_is_jam ? 0 : yy_current_state;
1845 yy_cp = (yy_c_buf_p);
1848 *yy_cp = (yy_hold_char);
1850 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->
yy_ch_buf + 2 )
1860 *--dest = *--source;
1862 yy_cp += (int) (dest - source);
1863 yy_bp += (int) (dest - source);
1867 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->
yy_ch_buf + 2 )
1871 *--yy_cp = (
char) c;
1876 (yy_hold_char) = *yy_cp;
1877 (yy_c_buf_p) = yy_cp;
1891 *(yy_c_buf_p) = (yy_hold_char);
1901 *(yy_c_buf_p) =
'\0';
1908 switch ( yy_get_next_buffer( ) )
1931 if ( ! (yy_did_buffer_switch_on_eof) )
1947 c = *(
unsigned char *) (yy_c_buf_p);
1948 *(yy_c_buf_p) =
'\0';
1949 (yy_hold_char) = *++(yy_c_buf_p);
1971 yyensure_buffer_stack ();
1977 yy_load_buffer_state( );
1988 yyrestart( *input_file );
2008 yyensure_buffer_stack ();
2015 *(yy_c_buf_p) = (yy_hold_char);
2021 yy_load_buffer_state( );
2028 (yy_did_buffer_switch_on_eof) = 1;
2044 (yy_hold_char) = *(yy_c_buf_p);
2076 yy_init_buffer( b, file );
2090 return yy_create_buffer( *file, size );
2130 yy_flush_buffer( b );
2184 yy_load_buffer_state( );
2200 if (new_buffer == NULL)
2203 yyensure_buffer_stack();
2209 *(yy_c_buf_p) = (yy_hold_char);
2216 (yy_buffer_stack_top)++;
2220 yy_load_buffer_state( );
2221 (yy_did_buffer_switch_on_eof) = 1;
2241 if ((yy_buffer_stack_top) > 0)
2242 --(yy_buffer_stack_top);
2245 yy_load_buffer_state( );
2246 (yy_did_buffer_switch_on_eof) = 1;
2263 if (!(yy_buffer_stack)) {
2273 if ( ! (yy_buffer_stack) )
2274 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2276 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
2278 (yy_buffer_stack_max) = num_to_alloc;
2279 (yy_buffer_stack_top) = 0;
2283 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2288 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2293 if ( ! (yy_buffer_stack) )
2294 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2297 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size *
sizeof(
struct yy_buffer_state*));
2298 (yy_buffer_stack_max) = num_to_alloc;
2318 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
2323 new_size = (
yy_size_t) (yy_start_stack_depth) *
sizeof( int );
2325 if ( ! (yy_start_stack) )
2326 (yy_start_stack) = (
int *)
yyalloc(new_size );
2329 (yy_start_stack) = (
int *)
yyrealloc((
void *) (yy_start_stack),new_size );
2331 if ( ! (yy_start_stack) )
2332 YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
2335 (yy_start_stack)[(yy_start_stack_ptr)++] =
YY_START;
2346 if ( --(yy_start_stack_ptr) < 0 )
2349 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
2352 #ifndef YY_EXIT_FAILURE 2353 #define YY_EXIT_FAILURE 2 2361 std::cerr << msg << std::endl;
2373 int yyless_macro_arg = (n); \ 2374 YY_LESS_LINENO(yyless_macro_arg);\ 2375 yytext[yyleng] = (yy_hold_char); \ 2376 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 2377 (yy_hold_char) = *(yy_c_buf_p); \ 2378 *(yy_c_buf_p) = '\0'; \ 2379 yyleng = yyless_macro_arg; \ 2410 static void yy_flex_strncpy (
char* s1,
yyconst char * s2,
int n )
2414 for ( i = 0; i < n; ++i )
2419 #ifdef YY_NEED_STRLEN 2420 static int yy_flex_strlen (
yyconst char * s )
2423 for ( n = 0; s[n]; ++n )
2432 return malloc(size);
2445 return realloc(ptr, size);
2450 free( (
char *) ptr );
2455 #define YYTABLES_NAME "yytables" 2460 #line 237 "lib/vcsn/rat/scan.ll" 2466 template <
typename Out>
2474 catch (
const boost::bad_lexical_cast&)
2476 d.error(loc,
"invalid numerical literal: " + s);
2482 int arity(driver& d,
const location& loc,
const std::string& s)
2498 auto arity_re = std::regex{
"([0-9]*)(,?)([0-9]*)", std::regex::extended};
2500 if (!std::regex_match(s, minmax, arity_re))
2501 throw std::runtime_error(
"cannot match arity: " + s);
2503 arity(d, loc, minmax[3].
str())};
2504 if (minmax[2].
str().empty())
2506 std::get<1>(
res) = std::get<0>(
res);
2535 set_debug(!!getenv(
"YYSCAN"));
2537 yy_switch_to_buffer(yy_create_buffer(&f,
YY_BUF_SIZE));
2542 yypop_buffer_state();
static const flex_uint16_t yy_nxt[331]
void yy_switch_to_buffer(yy_buffer_state *new_buffer)
Switch to a different input buffer.
#define YY_INPUT(buf, result, max_size)
void * yyalloc(yy_size_t size)
int yy_bs_column
The column count.
void yy_init_buffer(yy_buffer_state *b, std::istream *s)
#define YY_CURRENT_BUFFER_LVALUE
#define EOB_ACT_END_OF_FILE
vcsn::rat::location location
Pairs of positions in a file/stream.
unsigned int flex_uint32_t
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
#define YY_CURRENT_BUFFER
virtual void switch_streams(std::istream *new_in, std::ostream *new_out=nullptr)
yyFlexLexer(std::istream &arg_yyin, std::ostream &arg_yyout)
#define YY_END_OF_BUFFER_CHAR
Define the vcsn::rat::parser class.
void * yyrealloc(void *ptr, yy_size_t size)
static const YY_CHAR yy_meta[60]
void yy_load_buffer_state()
void yy_delete_buffer(yy_buffer_state *b)
Destroy the buffer.
static const flex_int16_t yy_rule_linenum[61]
virtual void LexerError(const char *msg)
static const flex_int16_t yy_chk[331]
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
yy_state_type yy_get_previous_state()
#define YY_FATAL_ERROR(msg)
static const flex_int16_t yy_accept[131]
void scan_open_(std::istream &f)
unsigned short int flex_uint16_t
static const flex_int16_t yy_def[141]
#define YY_RESTORE_YY_MORE_OFFSET
#define YY_START_STACK_INCR
virtual void LexerOutput(const char *buf, int size)
void yyensure_buffer_stack(void)
void yy_push_state(int new_state)
virtual int LexerInput(char *buf, int max_size)
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
std::streambuf * yy_input_file
struct yy_buffer_state * YY_BUFFER_STATE
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
#define YY_DO_BEFORE_ACTION
int yy_bs_lineno
The line count.
static const flex_uint16_t yy_base[141]
irange_type quantifier(driver &d, const location &loc, const std::string &s)
#define EOB_ACT_CONTINUE_SCAN
void yy_flush_buffer(yy_buffer_state *b)
Discard all buffered characters.
void yyunput(int c, char *buf_ptr)
unsigned char flex_uint8_t
yy_buffer_state * yy_create_buffer(std::istream *s, int size)
Allocate and initialize an input buffer state.
#define YY_BUFFER_EOF_PENDING
#define YY_FLEX_NAMESPACE_END
void yyrestart(std::istream *s)
Immediately switch to a different input stream.
#define EOB_ACT_LAST_MATCH
#define YY_STATE_EOF(state)
static const YY_CHAR yy_ec[256]
T lexical_cast(const std::string &str)
String to templated type T conversion.
weightset_mixin< detail::b_impl > b
void yypop_buffer_state()
Removes and deletes the top of the stack, if present.
void yypush_buffer_state(yy_buffer_state *new_buffer)
Pushes the new state onto the stack.