2 #pragma GCC diagnostic ignored "-Wsign-compare" 5 # pragma clang diagnostic ignored "-Wdeprecated" 6 # pragma clang diagnostic ignored "-Wnull-conversion" 7 # if 5 <= __clang_major__ 8 # pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" 10 #elif defined __GNUC__ 11 # pragma GCC diagnostic ignored "-Wsuggest-attribute=const" 12 # pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn" 13 # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" 14 # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" 17 #line 1 "lib/vcsn/rat/scan.cc" 21 #define yyterminate() return parser::make_END(loc) 23 #line 7 "lib/vcsn/rat/scan.cc" 25 #define YY_INT_ALIGNED short int 37 #define YY_FLEX_MAJOR_VERSION 2 38 #define YY_FLEX_MINOR_VERSION 6 39 #define YY_FLEX_SUBMINOR_VERSION 4 40 #if YY_FLEX_SUBMINOR_VERSION > 0 51 #define yyFlexLexer yyFlexLexer 78 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 83 #ifndef __STDC_LIMIT_MACROS 84 #define __STDC_LIMIT_MACROS 1 104 #define INT8_MIN (-128) 107 #define INT16_MIN (-32767-1) 110 #define INT32_MIN (-2147483647-1) 113 #define INT8_MAX (127) 116 #define INT16_MAX (32767) 119 #define INT32_MAX (2147483647) 122 #define UINT8_MAX (255U) 125 #define UINT16_MAX (65535U) 128 #define UINT32_MAX (4294967295U) 132 #define SIZE_MAX (~(size_t)0) 152 #define yyconst const 154 #if defined(__GNUC__) && __GNUC__ >= 3 155 #define yynoreturn __attribute__((__noreturn__)) 169 #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) 183 #define BEGIN (yy_start) = 1 + 2 * 188 #define YY_START (((yy_start) - 1) / 2) 189 #define YYSTATE YY_START 191 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 193 #define YY_NEW_FILE yyrestart( yyin ) 194 #define YY_END_OF_BUFFER_CHAR 0 203 #define YY_BUF_SIZE 32768 205 #define YY_BUF_SIZE 16384 211 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 213 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 214 #define YY_TYPEDEF_YY_BUFFER_STATE 218 #ifndef YY_TYPEDEF_YY_SIZE_T 219 #define YY_TYPEDEF_YY_SIZE_T 232 #define EOB_ACT_CONTINUE_SCAN 0 233 #define EOB_ACT_END_OF_FILE 1 234 #define EOB_ACT_LAST_MATCH 2 236 #define YY_LESS_LINENO(n) 237 #define YY_LINENO_REWIND_TO(ptr) 244 int yyless_macro_arg = (n); \ 245 YY_LESS_LINENO(yyless_macro_arg);\ 246 *yy_cp = (yy_hold_char); \ 247 YY_RESTORE_YY_MORE_OFFSET \ 248 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 249 YY_DO_BEFORE_ACTION; \ 252 #define unput(c) yyunput( c, (yytext_ptr) ) 254 #ifndef YY_STRUCT_YY_BUFFER_STATE 255 #define YY_STRUCT_YY_BUFFER_STATE 307 #define YY_BUFFER_NEW 0 308 #define YY_BUFFER_NORMAL 1 319 #define YY_BUFFER_EOF_PENDING 2 338 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 339 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 344 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 358 #define yy_new_buffer yy_create_buffer 359 #define yy_set_interactive(is_interactive) \ 361 if ( ! YY_CURRENT_BUFFER ){ \ 362 yyensure_buffer_stack (); \ 363 YY_CURRENT_BUFFER_LVALUE = \ 364 yy_create_buffer( yyin, YY_BUF_SIZE ); \ 366 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 368 #define yy_set_bol(at_bol) \ 370 if ( ! YY_CURRENT_BUFFER ){\ 371 yyensure_buffer_stack (); \ 372 YY_CURRENT_BUFFER_LVALUE = \ 373 yy_create_buffer( yyin, YY_BUF_SIZE ); \ 375 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 377 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 385 #define yytext_ptr yytext 386 #define YY_INTERACTIVE 398 #define YY_DO_BEFORE_ACTION \ 399 (yytext_ptr) = yy_bp; \ 401 yyleng = (int) (yy_cp - yy_bp); \ 402 (yy_hold_char) = *yy_cp; \ 405 (yy_c_buf_p) = yy_cp; 407 #define YY_NUM_RULES 61 408 #define YY_END_OF_BUFFER 62 418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
419 62, 42, 32, 33, 23, 7, 4, 42, 1, 2,
420 19, 8, 13, 10, 5, 30, 34, 18, 15, 31,
421 42, 3, 34, 14, 42, 42, 42, 42, 61, 37,
422 42, 35, 36, 45, 46, 43, 44, 57, 57, 57,
423 60, 58, 59, 60, 32, 33, 6, 0, 0, 0,
424 9, 41, 41, 17, 41, 16, 0, 0, 0, 0,
425 0, 0, 0, 0, 0, 0, 21, 23, 22, 17,
426 0, 0, 0, 0, 0, 45, 46, 49, 50, 48,
427 0, 60, 0, 38, 0, 38, 0, 0, 0, 27,
429 0, 0, 19, 20, 0, 12, 18, 25, 11, 24,
430 26, 16, 30, 34, 47, 51, 52, 53, 54, 55,
431 56, 58, 59, 0, 29, 0, 39, 40, 28, 0
436 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
438 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
439 1, 2, 4, 1, 5, 1, 6, 7, 8, 9,
440 10, 11, 12, 13, 14, 15, 16, 17, 17, 17,
441 17, 17, 17, 17, 17, 18, 18, 19, 1, 20,
442 1, 21, 22, 23, 24, 24, 24, 24, 24, 24,
443 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
444 1, 1, 1, 25, 1, 1, 1, 1, 1, 1,
445 26, 27, 28, 29, 1, 1, 24, 24, 30, 24,
447 31, 24, 1, 1, 1, 1, 1, 1, 1, 1,
448 1, 1, 1, 1, 1, 32, 1, 1, 1, 33,
449 1, 34, 35, 36, 37, 1, 1, 1, 38, 1,
450 1, 1, 39, 1, 1, 40, 1, 1, 1, 1,
451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452 41, 1, 1, 1, 1, 42, 1, 1, 43, 1,
453 1, 1, 1, 1, 1, 1, 1, 44, 45, 1,
454 1, 46, 1, 1, 1, 47, 1, 48, 49, 50,
455 51, 52, 53, 54, 55, 1, 1, 1, 1, 1,
456 1, 1, 1, 56, 1, 1, 1, 1, 1, 1,
458 1, 1, 1, 1, 1, 57, 1, 1, 1, 1,
459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460 1, 1, 1, 1, 58, 59, 1, 1, 1, 1,
461 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
462 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
468 1, 1, 2, 1, 1, 1, 1, 3, 4, 4,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
470 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
473 1, 1, 1, 1, 1, 1, 1, 1, 6
478 0, 0, 58, 0, 73, 87, 7, 32, 54, 78,
479 270, 271, 267, 264, 271, 271, 225, 215, 214, 271,
480 271, 271, 271, 271, 271, 219, 271, 271, 271, 271,
481 72, 271, 127, 271, 63, 157, 49, 64, 271, 271,
482 75, 271, 271, 0, 204, 271, 271, 271, 71, 168,
483 0, 271, 271, 162, 202, 200, 271, 102, 119, 127,
484 271, 271, 185, 271, 138, 271, 162, 161, 116, 160,
485 148, 159, 158, 156, 155, 141, 271, 271, 271, 271,
486 122, 109, 120, 82, 80, 0, 145, 271, 271, 271,
487 129, 0, 86, 271, 133, 150, 183, 132, 0, 271,
489 119, 170, 271, 271, 172, 271, 271, 271, 271, 271,
490 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
491 271, 271, 271, 125, 271, 107, 271, 271, 271, 271,
492 210, 216, 222, 228, 234, 240, 246, 250, 256, 262
497 130, 1, 1, 3, 131, 131, 132, 132, 133, 133,
498 130, 130, 130, 130, 130, 130, 130, 134, 130, 130,
499 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
500 135, 130, 130, 130, 130, 130, 130, 130, 130, 130,
501 135, 130, 130, 136, 130, 130, 130, 130, 130, 130,
502 137, 130, 130, 130, 130, 130, 130, 134, 138, 130,
503 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
504 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
505 130, 130, 130, 130, 130, 136, 130, 130, 130, 130,
506 130, 137, 130, 130, 134, 134, 138, 139, 140, 130,
508 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
509 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
510 130, 130, 130, 139, 130, 140, 130, 130, 130, 0,
511 130, 130, 130, 130, 130, 130, 130, 130, 130, 130
516 12, 13, 14, 15, 12, 16, 17, 18, 19, 20,
517 21, 22, 23, 12, 24, 12, 12, 12, 25, 26,
518 27, 28, 29, 12, 12, 30, 31, 32, 12, 12,
519 12, 12, 12, 12, 33, 34, 27, 12, 12, 12,
520 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
521 12, 12, 12, 12, 12, 35, 36, 37, 38, 12,
522 39, 12, 49, 12, 12, 50, 12, 12, 12, 12,
523 12, 40, 12, 52, 53, 45, 12, 12, 12, 12,
524 12, 46, 47, 12, 41, 42, 43, 49, 63, 45,
525 50, 63, 12, 12, 12, 46, 47, 52, 53, 81,
527 82, 83, 64, 84, 65, 66, 85, 65, 78, 94,
528 79, 79, 54, 12, 12, 12, 12, 79, 88, 89,
529 112, 58, 103, 113, 114, 90, 96, 129, 59, 122,
530 123, 98, 105, 105, 125, 127, 54, 67, 68, 69,
531 94, 125, 70, 71, 71, 97, 99, 87, 72, 100,
532 110, 73, 77, 74, 102, 102, 75, 94, 76, 59,
533 69, 102, 108, 77, 71, 71, 79, 102, 102, 79,
534 79, 79, 79, 79, 79, 115, 59, 111, 116, 117,
535 118, 119, 120, 121, 77, 58, 128, 128, 105, 105,
536 96, 110, 109, 128, 108, 107, 106, 104, 103, 128,
538 128, 101, 56, 55, 93, 91, 87, 80, 77, 97,
539 44, 44, 44, 44, 44, 44, 48, 48, 48, 48,
540 48, 48, 51, 51, 51, 51, 51, 51, 58, 58,
541 61, 58, 58, 58, 62, 60, 62, 62, 62, 62,
542 86, 59, 86, 57, 86, 86, 92, 92, 92, 92,
543 95, 95, 95, 95, 95, 95, 124, 124, 124, 124,
544 124, 124, 126, 126, 126, 126, 56, 126, 55, 130,
545 11, 130, 130, 130, 130, 130, 130, 130, 130, 130,
546 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
547 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
549 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
550 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
551 130, 130, 130, 130, 130, 130, 130, 130, 130, 130
556 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
557 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
558 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
559 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
560 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
561 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
562 3, 3, 7, 3, 3, 7, 3, 3, 3, 3,
563 3, 3, 3, 9, 9, 5, 3, 3, 3, 3,
564 3, 5, 5, 3, 3, 3, 3, 8, 31, 6,
565 8, 41, 3, 3, 3, 6, 6, 10, 10, 37,
567 37, 38, 31, 38, 31, 31, 38, 41, 35, 58,
568 35, 35, 9, 3, 3, 3, 3, 35, 49, 49,
569 84, 59, 84, 85, 85, 49, 59, 126, 58, 93,
570 93, 60, 69, 69, 124, 101, 10, 33, 33, 33,
571 95, 98, 33, 33, 33, 59, 60, 87, 33, 60,
572 82, 33, 69, 33, 65, 65, 33, 96, 33, 95,
573 71, 65, 81, 33, 71, 71, 83, 65, 65, 83,
574 83, 83, 83, 83, 83, 91, 96, 76, 91, 91,
575 91, 91, 91, 91, 71, 97, 102, 102, 105, 105,
576 97, 75, 74, 102, 73, 72, 70, 68, 67, 102,
578 102, 63, 56, 55, 54, 50, 45, 36, 105, 97,
579 131, 131, 131, 131, 131, 131, 132, 132, 132, 132,
580 132, 132, 133, 133, 133, 133, 133, 133, 134, 134,
581 26, 134, 134, 134, 135, 19, 135, 135, 135, 135,
582 136, 18, 136, 17, 136, 136, 137, 137, 137, 137,
583 138, 138, 138, 138, 138, 138, 139, 139, 139, 139,
584 139, 139, 140, 140, 140, 140, 14, 140, 13, 11,
585 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
586 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
587 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
589 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
590 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
591 130, 130, 130, 130, 130, 130, 130, 130, 130, 130
596 66, 67, 68, 70, 71, 72, 73, 74, 75, 76,
597 77, 78, 79, 80, 81, 82, 83, 86, 87, 88,
598 89, 94, 103, 104, 105, 106, 109, 110, 114, 117,
599 120, 123, 124, 126, 133, 137, 138, 148, 152, 153,
600 154, 155, 160, 164, 177, 178, 187, 188, 189, 190,
601 191, 192, 193, 194, 195, 196, 197, 211, 216, 230
607 #define REJECT reject_used_but_not_detected 608 #define yymore() yymore_used_but_not_detected 609 #define YY_MORE_ADJ 0 610 #define YY_RESTORE_YY_MORE_OFFSET 611 #line 1 "lib/vcsn/rat/scan.ll" 612 #define YY_NO_INPUT 1 614 #line 14 "lib/vcsn/rat/scan.ll" 620 #include <boost/lexical_cast.hpp> 630 loc.end.column = 1; \ 634 #define YY_USER_ACTION \ 638 parser::make_ ## Token (loc) 645 #line 629 "lib/vcsn/rat/scan.cc" 647 #line 49 "lib/vcsn/rat/scan.ll" 649 #line 633 "lib/vcsn/rat/scan.cc" 654 #define SC_EXPONENT 3 657 #ifndef YY_NO_UNISTD_H 669 #ifndef YY_EXTRA_TYPE 670 #define YY_EXTRA_TYPE void * 688 static void yy_flex_strncpy (
char *,
const char *,
int );
691 #ifdef YY_NEED_STRLEN 692 static int yy_flex_strlen (
const char * );
707 #ifndef YY_READ_BUF_SIZE 710 #define YY_READ_BUF_SIZE 16384 712 #define YY_READ_BUF_SIZE 8192 721 #define ECHO LexerOutput( yytext, yyleng ) 729 #define YY_INPUT(buf,result,max_size) \ 733 if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) \ 734 YY_FATAL_ERROR( "input in flex scanner failed" ); 744 #define yyterminate() return YY_NULL 748 #ifndef YY_START_STACK_INCR 749 #define YY_START_STACK_INCR 25 753 #ifndef YY_FATAL_ERROR 757 #define YY_FATAL_ERROR(msg) LexerError( msg ) 776 #define YY_DECL_IS_OURS 1 780 #define YY_DECL int yyFlexLexer::yylex() 787 #ifndef YY_USER_ACTION 788 #define YY_USER_ACTION 793 #define YY_BREAK break; 797 #define YY_RULE_SETUP \ 824 yyin.rdbuf(std::cin.rdbuf());
831 yyout.rdbuf(std::cout.rdbuf());
835 yyensure_buffer_stack ();
840 yy_load_buffer_state( );
845 #line 52 "lib/vcsn/rat/scan.ll" 849 unsigned int nesting = 0;
851 unsigned int exponent = 0;
853 static std::string context;
858 #line 842 "lib/vcsn/rat/scan.cc" 863 yy_cp = (yy_c_buf_p);
866 *yy_cp = (yy_hold_char);
874 yy_current_state = (yy_start);
881 (yy_last_accepting_state) = yy_current_state;
882 (yy_last_accepting_cpos) = yy_cp;
884 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
886 yy_current_state = (int)
yy_def[yy_current_state];
887 if ( yy_current_state >= 131 )
893 while (
yy_base[yy_current_state] != 271 );
900 yy_cp = (yy_last_accepting_cpos);
901 yy_current_state = (yy_last_accepting_state);
915 std::cerr <<
"--scanner backing up\n";
916 else if ( yy_act < 61 )
918 "(\"" << yytext <<
"\")\n";
919 else if ( yy_act == 61 )
920 std::cerr <<
"--accepting default rule (\"" << yytext <<
"\")\n";
921 else if ( yy_act == 62 )
922 std::cerr <<
"--(end of buffer or a NUL)\n";
924 std::cerr <<
"--EOF (start condition " <<
YY_START <<
")\n";
932 *yy_cp = (yy_hold_char);
933 yy_cp = (yy_last_accepting_cpos);
934 yy_current_state = (yy_last_accepting_state);
940 #line 66 "lib/vcsn/rat/scan.ll" 941 return parser::make_LPAREN({}, loc);
945 #line 67 "lib/vcsn/rat/scan.ll" 950 #line 68 "lib/vcsn/rat/scan.ll" 951 return TOK(RBRACKET);
955 #line 70 "lib/vcsn/rat/scan.ll" 956 return TOK(AMPERSAND);
960 #line 71 "lib/vcsn/rat/scan.ll" 965 #line 72 "lib/vcsn/rat/scan.ll" 966 return TOK(AMPERSAND_COLON);
970 #line 73 "lib/vcsn/rat/scan.ll" 975 #line 74 "lib/vcsn/rat/scan.ll" 980 #line 75 "lib/vcsn/rat/scan.ll" 985 #line 76 "lib/vcsn/rat/scan.ll" 990 #line 77 "lib/vcsn/rat/scan.ll" 991 return TOK(BACKSLASH);
995 #line 78 "lib/vcsn/rat/scan.ll" 1000 #line 79 "lib/vcsn/rat/scan.ll" 1005 #line 80 "lib/vcsn/rat/scan.ll" 1010 #line 81 "lib/vcsn/rat/scan.ll" 1015 #line 82 "lib/vcsn/rat/scan.ll" 1020 #line 83 "lib/vcsn/rat/scan.ll" 1026 #line 86 "lib/vcsn/rat/scan.ll" 1027 return parser::make_STAR(std::make_tuple(0, 1), loc);
1031 #line 87 "lib/vcsn/rat/scan.ll" 1032 return parser::make_STAR(std::make_tuple(-1, -1), loc);
1036 #line 88 "lib/vcsn/rat/scan.ll" 1037 return parser::make_STAR(std::make_tuple(1, -1), loc);
1041 #line 89 "lib/vcsn/rat/scan.ll" 1043 return parser::make_STAR(
quantifier(driver_, loc,
1044 {yytext+1,
static_cast<size_t>(
yyleng)-2}),
1050 #line 94 "lib/vcsn/rat/scan.ll" 1061 #line 103 "lib/vcsn/rat/scan.ll" 1066 #line 104 "lib/vcsn/rat/scan.ll" 1067 return TOK(COMPLEMENT);
1071 #line 105 "lib/vcsn/rat/scan.ll" 1072 return TOK(TRANSPOSITION);
1076 #line 106 "lib/vcsn/rat/scan.ll" 1077 return TOK(TRANSPOSE);
1082 #line 109 "lib/vcsn/rat/scan.ll" 1088 #line 110 "lib/vcsn/rat/scan.ll" 1090 return parser::make_LPAREN(
symbol{yytext + 3,
yyleng - 4},
1097 #line 114 "lib/vcsn/rat/scan.ll" 1103 #line 117 "lib/vcsn/rat/scan.ll" 1109 #line 120 "lib/vcsn/rat/scan.ll" 1115 #line 123 "lib/vcsn/rat/scan.ll" 1116 loc.step();
continue;
1121 #line 124 "lib/vcsn/rat/scan.ll" 1126 #line 126 "lib/vcsn/rat/scan.ll" 1128 throw parser::syntax_error(loc,
1129 std::string{
"unexpected character: "} + yytext);
1136 #line 133 "lib/vcsn/rat/scan.ll" 1139 return TOK(RBRACKET);
1144 #line 137 "lib/vcsn/rat/scan.ll" 1149 #line 138 "lib/vcsn/rat/scan.ll" 1153 #line 140 "lib/vcsn/rat/scan.ll" 1155 driver_.error(loc,
"unexpected end of file in a character-class");
1164 #line 148 "lib/vcsn/rat/scan.ll" 1166 return parser::make_LETTER({yytext+1, size_t(
yyleng-2)}, loc);
1170 #line 153 "lib/vcsn/rat/scan.ll" 1172 #line 154 "lib/vcsn/rat/scan.ll" 1174 #line 155 "lib/vcsn/rat/scan.ll" 1177 #line 155 "lib/vcsn/rat/scan.ll" 1178 return parser::make_LETTER({yytext, size_t(
yyleng)}, loc);
1184 #line 160 "lib/vcsn/rat/scan.ll" 1187 context.append(yytext,
yyleng);
1192 #line 164 "lib/vcsn/rat/scan.ll" 1197 context.append(yytext,
yyleng);
1202 driver_.context(context);
1209 #line 177 "lib/vcsn/rat/scan.ll" 1210 context.append(yytext,
yyleng);
1215 #line 178 "lib/vcsn/rat/scan.ll" 1219 #line 180 "lib/vcsn/rat/scan.ll" 1221 driver_.error(loc,
"unexpected end of file in a context comment");
1229 #line 187 "lib/vcsn/rat/scan.ll" 1234 #line 188 "lib/vcsn/rat/scan.ll" 1235 exponent *= 10; exponent += 1;
1239 #line 189 "lib/vcsn/rat/scan.ll" 1240 exponent *= 10; exponent += 2;
1244 #line 190 "lib/vcsn/rat/scan.ll" 1245 exponent *= 10; exponent += 3;
1249 #line 191 "lib/vcsn/rat/scan.ll" 1250 exponent *= 10; exponent += 4;
1254 #line 192 "lib/vcsn/rat/scan.ll" 1255 exponent *= 10; exponent += 5;
1259 #line 193 "lib/vcsn/rat/scan.ll" 1260 exponent *= 10; exponent += 6;
1264 #line 194 "lib/vcsn/rat/scan.ll" 1265 exponent *= 10; exponent += 7;
1269 #line 195 "lib/vcsn/rat/scan.ll" 1270 exponent *= 10; exponent += 8;
1274 #line 196 "lib/vcsn/rat/scan.ll" 1275 exponent *= 10; exponent += 9;
1280 #line 197 "lib/vcsn/rat/scan.ll" 1286 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1290 #line 204 "lib/vcsn/rat/scan.ll" 1293 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1300 #line 211 "lib/vcsn/rat/scan.ll" 1303 s.append(yytext,
yyleng);
1308 #line 216 "lib/vcsn/rat/scan.ll" 1313 s.append(yytext,
yyleng);
1318 return parser::make_WEIGHT(s, loc);
1326 #line 230 "lib/vcsn/rat/scan.ll" 1327 s.append(yytext,
yyleng);
1330 #line 232 "lib/vcsn/rat/scan.ll" 1332 driver_.error(loc,
"unexpected end of file in a weight");
1339 #line 238 "lib/vcsn/rat/scan.ll" 1342 #line 1326 "lib/vcsn/rat/scan.cc" 1349 int yy_amount_of_matched_text = (int) (yy_cp - (
yytext_ptr)) - 1;
1352 *yy_cp = (yy_hold_char);
1386 (yy_c_buf_p) = (
yytext_ptr) + yy_amount_of_matched_text;
1388 yy_current_state = yy_get_previous_state( );
1399 yy_next_state = yy_try_NUL_trans( yy_current_state );
1403 if ( yy_next_state )
1406 yy_cp = ++(yy_c_buf_p);
1407 yy_current_state = yy_next_state;
1414 yy_cp = (yy_c_buf_p);
1415 goto yy_find_action;
1419 else switch ( yy_get_next_buffer( ) )
1423 (yy_did_buffer_switch_on_eof) = 0;
1444 if ( ! (yy_did_buffer_switch_on_eof) )
1454 yy_current_state = yy_get_previous_state( );
1456 yy_cp = (yy_c_buf_p);
1464 yy_current_state = yy_get_previous_state( );
1466 yy_cp = (yy_c_buf_p);
1468 goto yy_find_action;
1475 "fatal flex scanner internal error--no action found" );
1489 yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
1490 yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf())
1498 yyin(arg_yyin.rdbuf()),
1499 yyout(arg_yyout.rdbuf())
1514 yy_did_buffer_switch_on_eof = 0;
1516 yy_looking_for_trail_begin = 0;
1519 yy_more_offset = yy_prev_more_offset = 0;
1521 yy_start_stack_ptr = yy_start_stack_depth = 0;
1522 yy_start_stack = NULL;
1524 yy_buffer_stack = NULL;
1525 yy_buffer_stack_top = 0;
1526 yy_buffer_stack_max = 0;
1536 delete [] yy_state_buf;
1537 yyfree( yy_start_stack );
1539 yyfree( yy_buffer_stack );
1548 yy_switch_to_buffer( yy_create_buffer( new_in,
YY_BUF_SIZE ) );
1551 yyout.rdbuf(new_out.rdbuf());
1566 switch_streams(*new_in, *new_out);
1569 #ifdef YY_INTERACTIVE 1575 if ( yyin.eof() || yyin.fail() )
1578 #ifdef YY_INTERACTIVE 1590 (
void) yyin.read( buf, max_size );
1595 return yyin.gcount();
1601 (
void) yyout.write( buf, size );
1622 int number_to_move, i;
1627 "fatal flex scanner internal error--end of buffer missed" );
1651 number_to_move = (int) ((yy_c_buf_p) - (
yytext_ptr) - 1);
1653 for ( i = 0; i < number_to_move; ++i )
1654 *(dest++) = *(source++);
1667 while ( num_to_read <= 0 )
1673 int yy_c_buf_p_offset =
1680 if ( new_size <= 0 )
1696 "fatal error - scanner input buffer overflow" );
1698 (yy_c_buf_p) = &b->
yy_ch_buf[yy_c_buf_p_offset];
1740 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1767 yy_current_state = (yy_start);
1775 (yy_last_accepting_state) = yy_current_state;
1776 (yy_last_accepting_cpos) = yy_cp;
1778 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1780 yy_current_state = (int)
yy_def[yy_current_state];
1781 if ( yy_current_state >= 131 )
1784 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + yy_c];
1787 return yy_current_state;
1803 char *yy_cp = (yy_c_buf_p);
1808 (yy_last_accepting_state) = yy_current_state;
1809 (yy_last_accepting_cpos) = yy_cp;
1811 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1813 yy_current_state = (int)
yy_def[yy_current_state];
1814 if ( yy_current_state >= 131 )
1817 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + yy_c];
1818 yy_is_jam = (yy_current_state == 130);
1820 return yy_is_jam ? 0 : yy_current_state;
1832 yy_cp = (yy_c_buf_p);
1835 *yy_cp = (yy_hold_char);
1837 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->
yy_ch_buf + 2 )
1847 *--dest = *--source;
1849 yy_cp += (int) (dest - source);
1850 yy_bp += (int) (dest - source);
1854 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->
yy_ch_buf + 2 )
1858 *--yy_cp = (
char) c;
1863 (yy_hold_char) = *yy_cp;
1864 (yy_c_buf_p) = yy_cp;
1878 *(yy_c_buf_p) = (yy_hold_char);
1888 *(yy_c_buf_p) =
'\0';
1892 int offset = (int) ((yy_c_buf_p) - (
yytext_ptr));
1895 switch ( yy_get_next_buffer( ) )
1918 if ( ! (yy_did_buffer_switch_on_eof) )
1934 c = *(
unsigned char *) (yy_c_buf_p);
1935 *(yy_c_buf_p) =
'\0';
1936 (yy_hold_char) = *++(yy_c_buf_p);
1958 yyensure_buffer_stack ();
1964 yy_load_buffer_state( );
1975 if( ! input_file ) {
1978 yyrestart( *input_file );
1998 yyensure_buffer_stack ();
2005 *(yy_c_buf_p) = (yy_hold_char);
2011 yy_load_buffer_state( );
2018 (yy_did_buffer_switch_on_eof) = 1;
2034 (yy_hold_char) = *(yy_c_buf_p);
2066 yy_init_buffer( b, file );
2080 return yy_create_buffer( *file, size );
2120 yy_flush_buffer( b );
2174 yy_load_buffer_state( );
2190 if (new_buffer == NULL)
2193 yyensure_buffer_stack();
2199 *(yy_c_buf_p) = (yy_hold_char);
2206 (yy_buffer_stack_top)++;
2210 yy_load_buffer_state( );
2211 (yy_did_buffer_switch_on_eof) = 1;
2231 if ((yy_buffer_stack_top) > 0)
2232 --(yy_buffer_stack_top);
2235 yy_load_buffer_state( );
2236 (yy_did_buffer_switch_on_eof) = 1;
2253 if (!(yy_buffer_stack)) {
2263 if ( ! (yy_buffer_stack) )
2264 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2266 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
2268 (yy_buffer_stack_max) = num_to_alloc;
2269 (yy_buffer_stack_top) = 0;
2273 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2278 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2283 if ( ! (yy_buffer_stack) )
2284 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2287 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size *
sizeof(
struct yy_buffer_state*));
2288 (yy_buffer_stack_max) = num_to_alloc;
2308 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
2313 new_size = (
yy_size_t) (yy_start_stack_depth) *
sizeof( int );
2315 if ( ! (yy_start_stack) )
2316 (yy_start_stack) = (
int *)
yyalloc( new_size );
2320 (
void *) (yy_start_stack), new_size );
2322 if ( ! (yy_start_stack) )
2323 YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
2326 (yy_start_stack)[(yy_start_stack_ptr)++] =
YY_START;
2337 if ( --(yy_start_stack_ptr) < 0 )
2340 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
2343 #ifndef YY_EXIT_FAILURE 2344 #define YY_EXIT_FAILURE 2 2352 std::cerr << msg << std::endl;
2364 int yyless_macro_arg = (n); \ 2365 YY_LESS_LINENO(yyless_macro_arg);\ 2366 yytext[yyleng] = (yy_hold_char); \ 2367 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 2368 (yy_hold_char) = *(yy_c_buf_p); \ 2369 *(yy_c_buf_p) = '\0'; \ 2370 yyleng = yyless_macro_arg; \ 2401 static void yy_flex_strncpy (
char* s1,
const char * s2,
int n )
2405 for ( i = 0; i < n; ++i )
2410 #ifdef YY_NEED_STRLEN 2411 static int yy_flex_strlen (
const char * s )
2414 for ( n = 0; s[n]; ++n )
2423 return malloc(size);
2436 return realloc(ptr, size);
2441 free( (
char *) ptr );
2446 #define YYTABLES_NAME "yytables" 2451 #line 238 "lib/vcsn/rat/scan.ll" 2456 template <
typename Out>
2464 catch (
const boost::bad_lexical_cast&)
2466 d.error(loc,
"invalid numerical literal: " + s);
2472 int arity(driver& d,
const location& loc,
const std::string& s)
2488 auto arity_re = std::regex{
"([0-9]*)(,?)([0-9]*)", std::regex::extended};
2490 if (!std::regex_match(s, minmax, arity_re))
2491 throw std::runtime_error(
"cannot match arity: " + s);
2493 arity(d, loc, minmax[3].
str())};
2494 if (minmax[2].
str().empty())
2496 std::get<1>(
res) = std::get<0>(
res);
2525 set_debug(!!getenv(
"YYSCAN"));
2527 yy_switch_to_buffer(yy_create_buffer(&f,
YY_BUF_SIZE));
2532 yypop_buffer_state();
#define YY_INPUT(buf, result, max_size)
void yyunput(int c, char *buf_ptr)
static const flex_int16_t yy_accept[131]
void yypop_buffer_state()
Removes and deletes the top of the stack, if present.
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
void yy_init_buffer(yy_buffer_state *b, std::istream *s)
static const flex_int16_t yy_rule_linenum[61]
#define YY_START_STACK_INCR
#define EOB_ACT_END_OF_FILE
void yy_switch_to_buffer(yy_buffer_state *new_buffer)
Switch to a different input buffer.
#define YY_STATE_EOF(state)
void * yyrealloc(void *ptr, yy_size_t size)
virtual void switch_streams(std::istream *new_in, std::ostream *new_out=nullptr)
virtual void LexerOutput(const char *buf, int size)
virtual int LexerInput(char *buf, int max_size)
static const YY_CHAR yy_ec[256]
virtual void LexerError(const char *msg)
static const YY_CHAR yy_meta[60]
static const flex_int16_t yy_def[141]
void * yyalloc(yy_size_t size)
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
irange_type quantifier(driver &d, const location &loc, const std::string &s)
T lexical_cast(const std::string &str)
String to templated type T conversion.
#define YY_CURRENT_BUFFER
void yyensure_buffer_stack(void)
static const flex_int16_t yy_base[141]
vcsn::rat::location location
Pairs of positions in a file/stream.
void scan_open_(std::istream &f)
#define YY_BUFFER_EOF_PENDING
unsigned int flex_uint32_t
#define EOB_ACT_LAST_MATCH
yy_state_type yy_get_previous_state()
#define YY_END_OF_BUFFER_CHAR
unsigned short int flex_uint16_t
#define EOB_ACT_CONTINUE_SCAN
#define YY_RESTORE_YY_MORE_OFFSET
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
void yypush_buffer_state(yy_buffer_state *new_buffer)
Pushes the new state onto the stack.
yy_buffer_state * yy_create_buffer(std::istream *s, int size)
Allocate and initialize an input buffer state.
static const flex_int16_t yy_nxt[331]
void yy_flush_buffer(yy_buffer_state *b)
Discard all buffered characters.
int yy_bs_column
The column count.
void yy_delete_buffer(yy_buffer_state *b)
Destroy the buffer.
void yyrestart(std::istream *s)
Immediately switch to a different input stream.
std::streambuf * yy_input_file
struct yy_buffer_state * YY_BUFFER_STATE
yyFlexLexer(std::istream &arg_yyin, std::ostream &arg_yyout)
Define the vcsn::rat::parser class.
static const flex_int16_t yy_chk[331]
void yy_push_state(int new_state)
int yy_bs_lineno
The line count.
#define YY_FATAL_ERROR(msg)
#define YY_CURRENT_BUFFER_LVALUE
#define YY_FLEX_NAMESPACE_END
void yy_load_buffer_state()
unsigned char flex_uint8_t
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
weightset_mixin< detail::b_impl > b
#define YY_DO_BEFORE_ACTION