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 1 "lib/vcsn/rat/scan.cc" 19 #define yyterminate() return parser::make_END(loc) 21 #line 7 "lib/vcsn/rat/scan.cc" 23 #define YY_INT_ALIGNED short int 35 #define YY_FLEX_MAJOR_VERSION 2 36 #define YY_FLEX_MINOR_VERSION 6 37 #define YY_FLEX_SUBMINOR_VERSION 4 38 #if YY_FLEX_SUBMINOR_VERSION > 0 49 #define yyFlexLexer yyFlexLexer 76 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 81 #ifndef __STDC_LIMIT_MACROS 82 #define __STDC_LIMIT_MACROS 1 102 #define INT8_MIN (-128) 105 #define INT16_MIN (-32767-1) 108 #define INT32_MIN (-2147483647-1) 111 #define INT8_MAX (127) 114 #define INT16_MAX (32767) 117 #define INT32_MAX (2147483647) 120 #define UINT8_MAX (255U) 123 #define UINT16_MAX (65535U) 126 #define UINT32_MAX (4294967295U) 130 #define SIZE_MAX (~(size_t)0) 150 #define yyconst const 152 #if defined(__GNUC__) && __GNUC__ >= 3 153 #define yynoreturn __attribute__((__noreturn__)) 167 #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) 181 #define BEGIN (yy_start) = 1 + 2 * 186 #define YY_START (((yy_start) - 1) / 2) 187 #define YYSTATE YY_START 189 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 191 #define YY_NEW_FILE yyrestart( yyin ) 192 #define YY_END_OF_BUFFER_CHAR 0 201 #define YY_BUF_SIZE 32768 203 #define YY_BUF_SIZE 16384 209 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 211 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 212 #define YY_TYPEDEF_YY_BUFFER_STATE 216 #ifndef YY_TYPEDEF_YY_SIZE_T 217 #define YY_TYPEDEF_YY_SIZE_T 230 #define EOB_ACT_CONTINUE_SCAN 0 231 #define EOB_ACT_END_OF_FILE 1 232 #define EOB_ACT_LAST_MATCH 2 234 #define YY_LESS_LINENO(n) 235 #define YY_LINENO_REWIND_TO(ptr) 242 int yyless_macro_arg = (n); \ 243 YY_LESS_LINENO(yyless_macro_arg);\ 244 *yy_cp = (yy_hold_char); \ 245 YY_RESTORE_YY_MORE_OFFSET \ 246 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 247 YY_DO_BEFORE_ACTION; \ 250 #define unput(c) yyunput( c, (yytext_ptr) ) 252 #ifndef YY_STRUCT_YY_BUFFER_STATE 253 #define YY_STRUCT_YY_BUFFER_STATE 305 #define YY_BUFFER_NEW 0 306 #define YY_BUFFER_NORMAL 1 317 #define YY_BUFFER_EOF_PENDING 2 336 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 337 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 342 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 356 #define yy_new_buffer yy_create_buffer 357 #define yy_set_interactive(is_interactive) \ 359 if ( ! YY_CURRENT_BUFFER ){ \ 360 yyensure_buffer_stack (); \ 361 YY_CURRENT_BUFFER_LVALUE = \ 362 yy_create_buffer( yyin, YY_BUF_SIZE ); \ 364 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 366 #define yy_set_bol(at_bol) \ 368 if ( ! YY_CURRENT_BUFFER ){\ 369 yyensure_buffer_stack (); \ 370 YY_CURRENT_BUFFER_LVALUE = \ 371 yy_create_buffer( yyin, YY_BUF_SIZE ); \ 373 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 375 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 383 #define yytext_ptr yytext 384 #define YY_INTERACTIVE 396 #define YY_DO_BEFORE_ACTION \ 397 (yytext_ptr) = yy_bp; \ 399 yyleng = (int) (yy_cp - yy_bp); \ 400 (yy_hold_char) = *yy_cp; \ 403 (yy_c_buf_p) = yy_cp; 405 #define YY_NUM_RULES 61 406 #define YY_END_OF_BUFFER 62 416 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
417 62, 42, 32, 33, 23, 7, 4, 42, 1, 2,
418 19, 8, 13, 10, 5, 30, 34, 18, 15, 31,
419 42, 3, 34, 14, 42, 42, 42, 42, 61, 37,
420 42, 35, 36, 45, 46, 43, 44, 57, 57, 57,
421 60, 58, 59, 60, 32, 33, 6, 0, 0, 0,
422 9, 41, 41, 17, 41, 16, 0, 0, 0, 0,
423 0, 0, 0, 0, 0, 0, 21, 23, 22, 17,
424 0, 0, 0, 0, 0, 45, 46, 49, 50, 48,
425 0, 60, 0, 38, 0, 38, 0, 0, 0, 27,
427 0, 0, 19, 20, 0, 12, 18, 25, 11, 24,
428 26, 16, 30, 34, 47, 51, 52, 53, 54, 55,
429 56, 58, 59, 0, 29, 0, 39, 40, 28, 0
434 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 2, 4, 1, 5, 1, 6, 7, 8, 9,
438 10, 11, 12, 13, 14, 15, 16, 17, 17, 17,
439 17, 17, 17, 17, 17, 18, 18, 19, 1, 20,
440 1, 21, 22, 23, 24, 24, 24, 24, 24, 24,
441 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
442 1, 1, 1, 25, 1, 1, 1, 1, 1, 1,
443 26, 27, 28, 29, 1, 1, 24, 24, 30, 24,
445 31, 24, 1, 1, 1, 1, 1, 1, 1, 1,
446 1, 1, 1, 1, 1, 32, 1, 1, 1, 33,
447 1, 34, 35, 36, 37, 1, 1, 1, 38, 1,
448 1, 1, 39, 1, 1, 40, 1, 1, 1, 1,
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 41, 1, 1, 1, 1, 42, 1, 1, 43, 1,
451 1, 1, 1, 1, 1, 1, 1, 44, 45, 1,
452 1, 46, 1, 1, 1, 47, 1, 48, 49, 50,
453 51, 52, 53, 54, 55, 1, 1, 1, 1, 1,
454 1, 1, 1, 56, 1, 1, 1, 1, 1, 1,
456 1, 1, 1, 1, 1, 57, 1, 1, 1, 1,
457 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
458 1, 1, 1, 1, 58, 59, 1, 1, 1, 1,
459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
466 1, 1, 2, 1, 1, 1, 1, 3, 4, 4,
467 1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
468 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 6
476 0, 0, 58, 0, 73, 87, 7, 32, 54, 78,
477 270, 271, 267, 264, 271, 271, 225, 215, 214, 271,
478 271, 271, 271, 271, 271, 219, 271, 271, 271, 271,
479 72, 271, 127, 271, 63, 157, 49, 64, 271, 271,
480 75, 271, 271, 0, 204, 271, 271, 271, 71, 168,
481 0, 271, 271, 162, 202, 200, 271, 102, 119, 127,
482 271, 271, 185, 271, 138, 271, 162, 161, 116, 160,
483 148, 159, 158, 156, 155, 141, 271, 271, 271, 271,
484 122, 109, 120, 82, 80, 0, 145, 271, 271, 271,
485 129, 0, 86, 271, 133, 150, 183, 132, 0, 271,
487 119, 170, 271, 271, 172, 271, 271, 271, 271, 271,
488 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
489 271, 271, 271, 125, 271, 107, 271, 271, 271, 271,
490 210, 216, 222, 228, 234, 240, 246, 250, 256, 262
495 130, 1, 1, 3, 131, 131, 132, 132, 133, 133,
496 130, 130, 130, 130, 130, 130, 130, 134, 130, 130,
497 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
498 135, 130, 130, 130, 130, 130, 130, 130, 130, 130,
499 135, 130, 130, 136, 130, 130, 130, 130, 130, 130,
500 137, 130, 130, 130, 130, 130, 130, 134, 138, 130,
501 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
502 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
503 130, 130, 130, 130, 130, 136, 130, 130, 130, 130,
504 130, 137, 130, 130, 134, 134, 138, 139, 140, 130,
506 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
507 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
508 130, 130, 130, 139, 130, 140, 130, 130, 130, 0,
509 130, 130, 130, 130, 130, 130, 130, 130, 130, 130
514 12, 13, 14, 15, 12, 16, 17, 18, 19, 20,
515 21, 22, 23, 12, 24, 12, 12, 12, 25, 26,
516 27, 28, 29, 12, 12, 30, 31, 32, 12, 12,
517 12, 12, 12, 12, 33, 34, 27, 12, 12, 12,
518 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
519 12, 12, 12, 12, 12, 35, 36, 37, 38, 12,
520 39, 12, 49, 12, 12, 50, 12, 12, 12, 12,
521 12, 40, 12, 52, 53, 45, 12, 12, 12, 12,
522 12, 46, 47, 12, 41, 42, 43, 49, 63, 45,
523 50, 63, 12, 12, 12, 46, 47, 52, 53, 81,
525 82, 83, 64, 84, 65, 66, 85, 65, 78, 94,
526 79, 79, 54, 12, 12, 12, 12, 79, 88, 89,
527 112, 58, 103, 113, 114, 90, 96, 129, 59, 122,
528 123, 98, 105, 105, 125, 127, 54, 67, 68, 69,
529 94, 125, 70, 71, 71, 97, 99, 87, 72, 100,
530 110, 73, 77, 74, 102, 102, 75, 94, 76, 59,
531 69, 102, 108, 77, 71, 71, 79, 102, 102, 79,
532 79, 79, 79, 79, 79, 115, 59, 111, 116, 117,
533 118, 119, 120, 121, 77, 58, 128, 128, 105, 105,
534 96, 110, 109, 128, 108, 107, 106, 104, 103, 128,
536 128, 101, 56, 55, 93, 91, 87, 80, 77, 97,
537 44, 44, 44, 44, 44, 44, 48, 48, 48, 48,
538 48, 48, 51, 51, 51, 51, 51, 51, 58, 58,
539 61, 58, 58, 58, 62, 60, 62, 62, 62, 62,
540 86, 59, 86, 57, 86, 86, 92, 92, 92, 92,
541 95, 95, 95, 95, 95, 95, 124, 124, 124, 124,
542 124, 124, 126, 126, 126, 126, 56, 126, 55, 130,
543 11, 130, 130, 130, 130, 130, 130, 130, 130, 130,
544 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
545 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
547 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
548 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
549 130, 130, 130, 130, 130, 130, 130, 130, 130, 130
554 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
555 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 3,
560 3, 3, 7, 3, 3, 7, 3, 3, 3, 3,
561 3, 3, 3, 9, 9, 5, 3, 3, 3, 3,
562 3, 5, 5, 3, 3, 3, 3, 8, 31, 6,
563 8, 41, 3, 3, 3, 6, 6, 10, 10, 37,
565 37, 38, 31, 38, 31, 31, 38, 41, 35, 58,
566 35, 35, 9, 3, 3, 3, 3, 35, 49, 49,
567 84, 59, 84, 85, 85, 49, 59, 126, 58, 93,
568 93, 60, 69, 69, 124, 101, 10, 33, 33, 33,
569 95, 98, 33, 33, 33, 59, 60, 87, 33, 60,
570 82, 33, 69, 33, 65, 65, 33, 96, 33, 95,
571 71, 65, 81, 33, 71, 71, 83, 65, 65, 83,
572 83, 83, 83, 83, 83, 91, 96, 76, 91, 91,
573 91, 91, 91, 91, 71, 97, 102, 102, 105, 105,
574 97, 75, 74, 102, 73, 72, 70, 68, 67, 102,
576 102, 63, 56, 55, 54, 50, 45, 36, 105, 97,
577 131, 131, 131, 131, 131, 131, 132, 132, 132, 132,
578 132, 132, 133, 133, 133, 133, 133, 133, 134, 134,
579 26, 134, 134, 134, 135, 19, 135, 135, 135, 135,
580 136, 18, 136, 17, 136, 136, 137, 137, 137, 137,
581 138, 138, 138, 138, 138, 138, 139, 139, 139, 139,
582 139, 139, 140, 140, 140, 140, 14, 140, 13, 11,
583 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
584 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
585 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
587 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
588 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
589 130, 130, 130, 130, 130, 130, 130, 130, 130, 130
594 66, 67, 68, 70, 71, 72, 73, 74, 75, 76,
595 77, 78, 79, 80, 81, 82, 83, 86, 87, 88,
596 89, 94, 103, 104, 105, 106, 109, 110, 114, 117,
597 120, 123, 124, 126, 133, 137, 138, 148, 152, 153,
598 154, 155, 160, 164, 177, 178, 187, 188, 189, 190,
599 191, 192, 193, 194, 195, 196, 197, 211, 216, 230
605 #define REJECT reject_used_but_not_detected 606 #define yymore() yymore_used_but_not_detected 607 #define YY_MORE_ADJ 0 608 #define YY_RESTORE_YY_MORE_OFFSET 609 #line 1 "lib/vcsn/rat/scan.ll" 610 #define YY_NO_INPUT 1 612 #line 14 "lib/vcsn/rat/scan.ll" 618 #include <boost/lexical_cast.hpp> 628 loc.end.column = 1; \ 632 #define YY_USER_ACTION \ 636 parser::make_ ## Token (loc) 643 #line 629 "lib/vcsn/rat/scan.cc" 645 #line 49 "lib/vcsn/rat/scan.ll" 647 #line 633 "lib/vcsn/rat/scan.cc" 652 #define SC_EXPONENT 3 655 #ifndef YY_NO_UNISTD_H 667 #ifndef YY_EXTRA_TYPE 668 #define YY_EXTRA_TYPE void * 686 static void yy_flex_strncpy (
char *,
const char *,
int );
689 #ifdef YY_NEED_STRLEN 690 static int yy_flex_strlen (
const char * );
705 #ifndef YY_READ_BUF_SIZE 708 #define YY_READ_BUF_SIZE 16384 710 #define YY_READ_BUF_SIZE 8192 719 #define ECHO LexerOutput( yytext, yyleng ) 727 #define YY_INPUT(buf,result,max_size) \ 731 if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) \ 732 YY_FATAL_ERROR( "input in flex scanner failed" ); 742 #define yyterminate() return YY_NULL 746 #ifndef YY_START_STACK_INCR 747 #define YY_START_STACK_INCR 25 751 #ifndef YY_FATAL_ERROR 755 #define YY_FATAL_ERROR(msg) LexerError( msg ) 774 #define YY_DECL_IS_OURS 1 778 #define YY_DECL int yyFlexLexer::yylex() 785 #ifndef YY_USER_ACTION 786 #define YY_USER_ACTION 791 #define YY_BREAK break; 795 #define YY_RULE_SETUP \ 822 yyin.rdbuf(std::cin.rdbuf());
829 yyout.rdbuf(std::cout.rdbuf());
833 yyensure_buffer_stack ();
838 yy_load_buffer_state( );
843 #line 52 "lib/vcsn/rat/scan.ll" 847 unsigned int nesting = 0;
849 unsigned int exponent = 0;
851 static std::string context;
856 #line 842 "lib/vcsn/rat/scan.cc" 861 yy_cp = (yy_c_buf_p);
864 *yy_cp = (yy_hold_char);
872 yy_current_state = (yy_start);
879 (yy_last_accepting_state) = yy_current_state;
880 (yy_last_accepting_cpos) = yy_cp;
882 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
884 yy_current_state = (int)
yy_def[yy_current_state];
885 if ( yy_current_state >= 131 )
891 while (
yy_base[yy_current_state] != 271 );
898 yy_cp = (yy_last_accepting_cpos);
899 yy_current_state = (yy_last_accepting_state);
913 std::cerr <<
"--scanner backing up\n";
914 else if ( yy_act < 61 )
916 "(\"" << yytext <<
"\")\n";
917 else if ( yy_act == 61 )
918 std::cerr <<
"--accepting default rule (\"" << yytext <<
"\")\n";
919 else if ( yy_act == 62 )
920 std::cerr <<
"--(end of buffer or a NUL)\n";
922 std::cerr <<
"--EOF (start condition " <<
YY_START <<
")\n";
930 *yy_cp = (yy_hold_char);
931 yy_cp = (yy_last_accepting_cpos);
932 yy_current_state = (yy_last_accepting_state);
938 #line 66 "lib/vcsn/rat/scan.ll" 939 return parser::make_LPAREN({}, loc);
943 #line 67 "lib/vcsn/rat/scan.ll" 948 #line 68 "lib/vcsn/rat/scan.ll" 949 return TOK(RBRACKET);
953 #line 70 "lib/vcsn/rat/scan.ll" 954 return TOK(AMPERSAND);
958 #line 71 "lib/vcsn/rat/scan.ll" 963 #line 72 "lib/vcsn/rat/scan.ll" 964 return TOK(AMPERSAND_COLON);
968 #line 73 "lib/vcsn/rat/scan.ll" 973 #line 74 "lib/vcsn/rat/scan.ll" 978 #line 75 "lib/vcsn/rat/scan.ll" 983 #line 76 "lib/vcsn/rat/scan.ll" 988 #line 77 "lib/vcsn/rat/scan.ll" 989 return TOK(BACKSLASH);
993 #line 78 "lib/vcsn/rat/scan.ll" 998 #line 79 "lib/vcsn/rat/scan.ll" 1003 #line 80 "lib/vcsn/rat/scan.ll" 1008 #line 81 "lib/vcsn/rat/scan.ll" 1013 #line 82 "lib/vcsn/rat/scan.ll" 1018 #line 83 "lib/vcsn/rat/scan.ll" 1024 #line 86 "lib/vcsn/rat/scan.ll" 1025 return parser::make_STAR(std::make_tuple(0, 1), loc);
1029 #line 87 "lib/vcsn/rat/scan.ll" 1030 return parser::make_STAR(std::make_tuple(-1, -1), loc);
1034 #line 88 "lib/vcsn/rat/scan.ll" 1035 return parser::make_STAR(std::make_tuple(1, -1), loc);
1039 #line 89 "lib/vcsn/rat/scan.ll" 1041 return parser::make_STAR(
quantifier(driver_, loc,
1042 {yytext+1,
static_cast<size_t>(
yyleng)-2}),
1048 #line 94 "lib/vcsn/rat/scan.ll" 1059 #line 103 "lib/vcsn/rat/scan.ll" 1064 #line 104 "lib/vcsn/rat/scan.ll" 1065 return TOK(COMPLEMENT);
1069 #line 105 "lib/vcsn/rat/scan.ll" 1070 return TOK(TRANSPOSITION);
1074 #line 106 "lib/vcsn/rat/scan.ll" 1075 return TOK(TRANSPOSE);
1080 #line 109 "lib/vcsn/rat/scan.ll" 1086 #line 110 "lib/vcsn/rat/scan.ll" 1088 return parser::make_LPAREN(
symbol{yytext + 3,
yyleng - 4},
1095 #line 114 "lib/vcsn/rat/scan.ll" 1101 #line 117 "lib/vcsn/rat/scan.ll" 1107 #line 120 "lib/vcsn/rat/scan.ll" 1113 #line 123 "lib/vcsn/rat/scan.ll" 1114 loc.step();
continue;
1119 #line 124 "lib/vcsn/rat/scan.ll" 1124 #line 126 "lib/vcsn/rat/scan.ll" 1126 throw parser::syntax_error(loc,
1127 std::string{
"unexpected character: "} + yytext);
1134 #line 133 "lib/vcsn/rat/scan.ll" 1137 return TOK(RBRACKET);
1142 #line 137 "lib/vcsn/rat/scan.ll" 1147 #line 138 "lib/vcsn/rat/scan.ll" 1151 #line 140 "lib/vcsn/rat/scan.ll" 1153 driver_.error(loc,
"unexpected end of file in a character-class");
1162 #line 148 "lib/vcsn/rat/scan.ll" 1164 return parser::make_LETTER({yytext+1, size_t(
yyleng-2)}, loc);
1168 #line 153 "lib/vcsn/rat/scan.ll" 1170 #line 154 "lib/vcsn/rat/scan.ll" 1172 #line 155 "lib/vcsn/rat/scan.ll" 1175 #line 155 "lib/vcsn/rat/scan.ll" 1176 return parser::make_LETTER({yytext, size_t(
yyleng)}, loc);
1182 #line 160 "lib/vcsn/rat/scan.ll" 1185 context.append(yytext,
yyleng);
1190 #line 164 "lib/vcsn/rat/scan.ll" 1195 context.append(yytext,
yyleng);
1200 driver_.context(context);
1207 #line 177 "lib/vcsn/rat/scan.ll" 1208 context.append(yytext,
yyleng);
1213 #line 178 "lib/vcsn/rat/scan.ll" 1217 #line 180 "lib/vcsn/rat/scan.ll" 1219 driver_.error(loc,
"unexpected end of file in a context comment");
1227 #line 187 "lib/vcsn/rat/scan.ll" 1232 #line 188 "lib/vcsn/rat/scan.ll" 1233 exponent *= 10; exponent += 1;
1237 #line 189 "lib/vcsn/rat/scan.ll" 1238 exponent *= 10; exponent += 2;
1242 #line 190 "lib/vcsn/rat/scan.ll" 1243 exponent *= 10; exponent += 3;
1247 #line 191 "lib/vcsn/rat/scan.ll" 1248 exponent *= 10; exponent += 4;
1252 #line 192 "lib/vcsn/rat/scan.ll" 1253 exponent *= 10; exponent += 5;
1257 #line 193 "lib/vcsn/rat/scan.ll" 1258 exponent *= 10; exponent += 6;
1262 #line 194 "lib/vcsn/rat/scan.ll" 1263 exponent *= 10; exponent += 7;
1267 #line 195 "lib/vcsn/rat/scan.ll" 1268 exponent *= 10; exponent += 8;
1272 #line 196 "lib/vcsn/rat/scan.ll" 1273 exponent *= 10; exponent += 9;
1278 #line 197 "lib/vcsn/rat/scan.ll" 1284 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1288 #line 204 "lib/vcsn/rat/scan.ll" 1291 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1298 #line 211 "lib/vcsn/rat/scan.ll" 1301 s.append(yytext,
yyleng);
1306 #line 216 "lib/vcsn/rat/scan.ll" 1311 s.append(yytext,
yyleng);
1316 return parser::make_WEIGHT(s, loc);
1324 #line 230 "lib/vcsn/rat/scan.ll" 1325 s.append(yytext,
yyleng);
1328 #line 232 "lib/vcsn/rat/scan.ll" 1330 driver_.error(loc,
"unexpected end of file in a weight");
1337 #line 238 "lib/vcsn/rat/scan.ll" 1340 #line 1326 "lib/vcsn/rat/scan.cc" 1347 int yy_amount_of_matched_text = (int) (yy_cp - (
yytext_ptr)) - 1;
1350 *yy_cp = (yy_hold_char);
1384 (yy_c_buf_p) = (
yytext_ptr) + yy_amount_of_matched_text;
1386 yy_current_state = yy_get_previous_state( );
1397 yy_next_state = yy_try_NUL_trans( yy_current_state );
1401 if ( yy_next_state )
1404 yy_cp = ++(yy_c_buf_p);
1405 yy_current_state = yy_next_state;
1412 yy_cp = (yy_c_buf_p);
1413 goto yy_find_action;
1417 else switch ( yy_get_next_buffer( ) )
1421 (yy_did_buffer_switch_on_eof) = 0;
1442 if ( ! (yy_did_buffer_switch_on_eof) )
1452 yy_current_state = yy_get_previous_state( );
1454 yy_cp = (yy_c_buf_p);
1462 yy_current_state = yy_get_previous_state( );
1464 yy_cp = (yy_c_buf_p);
1466 goto yy_find_action;
1473 "fatal flex scanner internal error--no action found" );
1487 yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
1488 yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf())
1496 yyin(arg_yyin.rdbuf()),
1497 yyout(arg_yyout.rdbuf())
1512 yy_did_buffer_switch_on_eof = 0;
1514 yy_looking_for_trail_begin = 0;
1517 yy_more_offset = yy_prev_more_offset = 0;
1519 yy_start_stack_ptr = yy_start_stack_depth = 0;
1520 yy_start_stack = NULL;
1522 yy_buffer_stack = NULL;
1523 yy_buffer_stack_top = 0;
1524 yy_buffer_stack_max = 0;
1534 delete [] yy_state_buf;
1535 yyfree( yy_start_stack );
1537 yyfree( yy_buffer_stack );
1546 yy_switch_to_buffer( yy_create_buffer( new_in,
YY_BUF_SIZE ) );
1549 yyout.rdbuf(new_out.rdbuf());
1564 switch_streams(*new_in, *new_out);
1567 #ifdef YY_INTERACTIVE 1573 if ( yyin.eof() || yyin.fail() )
1576 #ifdef YY_INTERACTIVE 1588 (
void) yyin.read( buf, max_size );
1593 return yyin.gcount();
1599 (
void) yyout.write( buf, size );
1620 int number_to_move, i;
1625 "fatal flex scanner internal error--end of buffer missed" );
1649 number_to_move = (int) ((yy_c_buf_p) - (
yytext_ptr) - 1);
1651 for ( i = 0; i < number_to_move; ++i )
1652 *(dest++) = *(source++);
1665 while ( num_to_read <= 0 )
1671 int yy_c_buf_p_offset =
1678 if ( new_size <= 0 )
1694 "fatal error - scanner input buffer overflow" );
1696 (yy_c_buf_p) = &b->
yy_ch_buf[yy_c_buf_p_offset];
1738 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1765 yy_current_state = (yy_start);
1773 (yy_last_accepting_state) = yy_current_state;
1774 (yy_last_accepting_cpos) = yy_cp;
1776 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1778 yy_current_state = (int)
yy_def[yy_current_state];
1779 if ( yy_current_state >= 131 )
1782 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + yy_c];
1785 return yy_current_state;
1801 char *yy_cp = (yy_c_buf_p);
1806 (yy_last_accepting_state) = yy_current_state;
1807 (yy_last_accepting_cpos) = yy_cp;
1809 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1811 yy_current_state = (int)
yy_def[yy_current_state];
1812 if ( yy_current_state >= 131 )
1815 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + yy_c];
1816 yy_is_jam = (yy_current_state == 130);
1818 return yy_is_jam ? 0 : yy_current_state;
1830 yy_cp = (yy_c_buf_p);
1833 *yy_cp = (yy_hold_char);
1835 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->
yy_ch_buf + 2 )
1845 *--dest = *--source;
1847 yy_cp += (int) (dest - source);
1848 yy_bp += (int) (dest - source);
1852 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->
yy_ch_buf + 2 )
1856 *--yy_cp = (
char) c;
1861 (yy_hold_char) = *yy_cp;
1862 (yy_c_buf_p) = yy_cp;
1876 *(yy_c_buf_p) = (yy_hold_char);
1886 *(yy_c_buf_p) =
'\0';
1890 int offset = (int) ((yy_c_buf_p) - (
yytext_ptr));
1893 switch ( yy_get_next_buffer( ) )
1916 if ( ! (yy_did_buffer_switch_on_eof) )
1932 c = *(
unsigned char *) (yy_c_buf_p);
1933 *(yy_c_buf_p) =
'\0';
1934 (yy_hold_char) = *++(yy_c_buf_p);
1956 yyensure_buffer_stack ();
1962 yy_load_buffer_state( );
1973 if( ! input_file ) {
1976 yyrestart( *input_file );
1996 yyensure_buffer_stack ();
2003 *(yy_c_buf_p) = (yy_hold_char);
2009 yy_load_buffer_state( );
2016 (yy_did_buffer_switch_on_eof) = 1;
2032 (yy_hold_char) = *(yy_c_buf_p);
2064 yy_init_buffer( b, file );
2078 return yy_create_buffer( *file, size );
2118 yy_flush_buffer( b );
2172 yy_load_buffer_state( );
2188 if (new_buffer == NULL)
2191 yyensure_buffer_stack();
2197 *(yy_c_buf_p) = (yy_hold_char);
2204 (yy_buffer_stack_top)++;
2208 yy_load_buffer_state( );
2209 (yy_did_buffer_switch_on_eof) = 1;
2229 if ((yy_buffer_stack_top) > 0)
2230 --(yy_buffer_stack_top);
2233 yy_load_buffer_state( );
2234 (yy_did_buffer_switch_on_eof) = 1;
2251 if (!(yy_buffer_stack)) {
2261 if ( ! (yy_buffer_stack) )
2262 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2264 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
2266 (yy_buffer_stack_max) = num_to_alloc;
2267 (yy_buffer_stack_top) = 0;
2271 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2276 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2281 if ( ! (yy_buffer_stack) )
2282 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2285 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size *
sizeof(
struct yy_buffer_state*));
2286 (yy_buffer_stack_max) = num_to_alloc;
2306 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
2311 new_size = (
yy_size_t) (yy_start_stack_depth) *
sizeof( int );
2313 if ( ! (yy_start_stack) )
2314 (yy_start_stack) = (
int *)
yyalloc( new_size );
2318 (
void *) (yy_start_stack), new_size );
2320 if ( ! (yy_start_stack) )
2321 YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
2324 (yy_start_stack)[(yy_start_stack_ptr)++] =
YY_START;
2335 if ( --(yy_start_stack_ptr) < 0 )
2338 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
2341 #ifndef YY_EXIT_FAILURE 2342 #define YY_EXIT_FAILURE 2 2350 std::cerr << msg << std::endl;
2362 int yyless_macro_arg = (n); \ 2363 YY_LESS_LINENO(yyless_macro_arg);\ 2364 yytext[yyleng] = (yy_hold_char); \ 2365 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 2366 (yy_hold_char) = *(yy_c_buf_p); \ 2367 *(yy_c_buf_p) = '\0'; \ 2368 yyleng = yyless_macro_arg; \ 2399 static void yy_flex_strncpy (
char* s1,
const char * s2,
int n )
2403 for ( i = 0; i < n; ++i )
2408 #ifdef YY_NEED_STRLEN 2409 static int yy_flex_strlen (
const char * s )
2412 for ( n = 0; s[n]; ++n )
2421 return malloc(size);
2434 return realloc(ptr, size);
2439 free( (
char *) ptr );
2444 #define YYTABLES_NAME "yytables" 2449 #line 238 "lib/vcsn/rat/scan.ll" 2454 template <
typename Out>
2462 catch (
const boost::bad_lexical_cast&)
2464 d.error(loc,
"invalid numerical literal: " + s);
2470 int arity(driver& d,
const location& loc,
const std::string& s)
2486 auto arity_re = std::regex{
"([0-9]*)(,?)([0-9]*)", std::regex::extended};
2488 if (!std::regex_match(s, minmax, arity_re))
2489 throw std::runtime_error(
"cannot match arity: " + s);
2491 arity(d, loc, minmax[3].
str())};
2492 if (minmax[2].
str().empty())
2494 std::get<1>(
res) = std::get<0>(
res);
2523 set_debug(!!getenv(
"YYSCAN"));
2525 yy_switch_to_buffer(yy_create_buffer(&f,
YY_BUF_SIZE));
2530 yypop_buffer_state();
#define YY_RESTORE_YY_MORE_OFFSET
struct yy_buffer_state * YY_BUFFER_STATE
#define YY_START_STACK_INCR
vcsn::rat::location location
Pairs of positions in a file/stream.
virtual int LexerInput(char *buf, int max_size)
yyFlexLexer(std::istream &arg_yyin, std::ostream &arg_yyout)
void yy_flush_buffer(yy_buffer_state *b)
Discard all buffered characters.
void yyunput(int c, char *buf_ptr)
unsigned int flex_uint32_t
yy_state_type yy_get_previous_state()
void yy_push_state(int new_state)
#define YY_INPUT(buf, result, max_size)
static const flex_int16_t yy_rule_linenum[61]
void yyensure_buffer_stack(void)
#define EOB_ACT_CONTINUE_SCAN
void * yyalloc(yy_size_t size)
static const YY_CHAR yy_ec[256]
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
std::streambuf * yy_input_file
void * yyrealloc(void *ptr, yy_size_t size)
#define YY_CURRENT_BUFFER
void yypop_buffer_state()
Removes and deletes the top of the stack, if present.
#define YY_FLEX_NAMESPACE_END
void yypush_buffer_state(yy_buffer_state *new_buffer)
Pushes the new state onto the stack.
void yy_init_buffer(yy_buffer_state *b, std::istream *s)
void yy_load_buffer_state()
virtual void LexerOutput(const char *buf, int size)
#define EOB_ACT_END_OF_FILE
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
virtual void LexerError(const char *msg)
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
#define YY_BUFFER_EOF_PENDING
static const flex_int16_t yy_chk[331]
#define EOB_ACT_LAST_MATCH
void yy_delete_buffer(yy_buffer_state *b)
Destroy the buffer.
#define YY_DO_BEFORE_ACTION
int yy_bs_lineno
The line count.
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)
unsigned char flex_uint8_t
#define YY_CURRENT_BUFFER_LVALUE
unsigned short int flex_uint16_t
void yy_switch_to_buffer(yy_buffer_state *new_buffer)
Switch to a different input buffer.
static const flex_int16_t yy_accept[131]
int yy_bs_column
The column count.
static const YY_CHAR yy_meta[60]
static const flex_int16_t yy_nxt[331]
void yyrestart(std::istream *s)
Immediately switch to a different input stream.
static const flex_int16_t yy_def[141]
virtual void switch_streams(std::istream *new_in, std::ostream *new_out=nullptr)
yy_buffer_state * yy_create_buffer(std::istream *s, int size)
Allocate and initialize an input buffer state.
Define the vcsn::rat::parser class.
T lexical_cast(const std::string &str)
String to templated type T conversion.
weightset_mixin< detail::b_impl > b
#define YY_END_OF_BUFFER_CHAR
#define YY_STATE_EOF(state)
#define YY_FATAL_ERROR(msg)
static const flex_int16_t yy_base[141]
void scan_open_(std::istream &f)