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 5
41 #define YY_FLEX_SUBMINOR_VERSION 39
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 63
435 #define YY_END_OF_BUFFER 64
445 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
446 64, 44, 28, 29, 21, 6, 3, 44, 1, 2,
447 17, 7, 12, 9, 4, 26, 16, 27, 44, 44,
448 13, 44, 44, 44, 44, 63, 32, 44, 30, 31,
449 47, 48, 45, 46, 59, 59, 59, 62, 60, 61,
450 62, 28, 29, 5, 0, 0, 0, 8, 43, 43,
451 36, 37, 15, 38, 39, 40, 41, 42, 43, 14,
452 0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
453 21, 20, 15, 0, 0, 0, 0, 0, 47, 48,
454 51, 52, 50, 0, 62, 0, 33, 0, 33, 0,
456 0, 24, 0, 0, 17, 18, 0, 11, 16, 23,
457 10, 22, 14, 26, 49, 53, 54, 55, 56, 57,
458 58, 60, 61, 0, 25, 34, 35, 0
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, 30, 31, 32, 24,
474 33, 34, 1, 1, 1, 1, 1, 1, 1, 35,
475 1, 1, 1, 36, 1, 37, 1, 38, 1, 39,
476 1, 40, 41, 42, 43, 1, 1, 1, 44, 1,
477 1, 1, 45, 1, 1, 46, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 47, 1, 1, 1, 1, 48, 1, 1, 49, 1,
480 1, 1, 1, 1, 1, 1, 1, 50, 51, 1,
481 1, 52, 1, 1, 1, 53, 1, 54, 55, 56,
482 57, 58, 59, 60, 61, 1, 1, 1, 1, 1,
483 1, 1, 1, 62, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 63, 1, 1, 1, 1,
486 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
487 1, 1, 1, 1, 64, 65, 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, 1, 1,
506 0, 64, 20, 29, 15, 26, 16, 20, 24, 30,
507 185, 274, 181, 179, 274, 274, 155, 145, 149, 274,
508 274, 274, 274, 274, 274, 157, 274, 274, 113, 143,
509 274, 0, 110, 2, 48, 274, 274, 79, 274, 274,
510 0, 163, 274, 274, 274, 46, 120, 0, 274, 274,
511 108, 140, 133, 274, 6, 13, 64, 274, 274, 118,
512 274, 274, 274, 274, 274, 274, 274, 274, 107, 274,
513 91, 90, 102, 89, 145, 80, 78, 68, 65, 274,
514 274, 274, 274, 41, 32, 120, 57, 3, 0, 35,
515 274, 274, 274, 134, 0, 48, 274, 85, 95, 181,
517 21, 274, 13, 179, 274, 274, 181, 274, 274, 274,
518 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
519 274, 274, 274, 7, 274, 274, 274, 274, 224, 229,
520 234, 239, 244, 249, 254, 259, 263, 268
525 129, 129, 129, 129, 130, 130, 131, 131, 132, 132,
526 128, 128, 128, 128, 128, 128, 128, 133, 128, 128,
527 128, 128, 128, 128, 128, 128, 128, 128, 134, 128,
528 128, 128, 128, 128, 128, 128, 128, 134, 128, 128,
529 135, 128, 128, 128, 128, 128, 128, 136, 128, 128,
530 128, 128, 128, 128, 133, 137, 128, 128, 128, 128,
531 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
532 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
533 128, 128, 128, 128, 128, 128, 128, 128, 135, 128,
534 128, 128, 128, 128, 136, 128, 128, 133, 133, 137,
536 138, 128, 128, 128, 128, 128, 128, 128, 128, 128,
537 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
538 128, 128, 128, 138, 128, 128, 128, 0, 128, 128,
539 128, 128, 128, 128, 128, 128, 128, 128
544 128, 13, 14, 15, 128, 16, 17, 18, 19, 20,
545 21, 22, 23, 97, 24, 55, 125, 42, 25, 26,
546 99, 27, 36, 43, 44, 28, 29, 18, 42, 126,
547 125, 36, 56, 37, 43, 44, 18, 90, 128, 100,
548 30, 31, 37, 49, 50, 128, 38, 39, 40, 49,
549 50, 81, 114, 82, 82, 38, 39, 40, 84, 85,
550 82, 32, 33, 34, 35, 13, 14, 15, 101, 16,
551 17, 18, 19, 20, 21, 22, 23, 46, 24, 112,
552 47, 46, 25, 26, 47, 27, 102, 110, 51, 28,
553 29, 86, 97, 87, 51, 60, 88, 122, 123, 91,
555 92, 113, 97, 105, 30, 31, 93, 112, 61, 62,
556 111, 56, 64, 65, 66, 67, 68, 69, 107, 107,
557 110, 56, 109, 104, 104, 32, 33, 34, 35, 60,
558 104, 108, 106, 105, 103, 53, 104, 104, 104, 104,
559 104, 52, 61, 62, 80, 63, 64, 65, 66, 67,
560 68, 69, 70, 71, 72, 73, 96, 73, 74, 75,
561 75, 75, 75, 94, 76, 90, 83, 77, 58, 78,
562 57, 56, 82, 54, 79, 82, 82, 82, 82, 82,
563 82, 53, 52, 55, 128, 80, 115, 80, 99, 116,
564 117, 118, 119, 120, 121, 127, 127, 107, 107, 128,
566 128, 128, 127, 128, 128, 128, 128, 100, 127, 127,
567 127, 127, 127, 128, 128, 128, 128, 128, 128, 128,
568 128, 128, 128, 80, 12, 12, 12, 12, 12, 41,
569 41, 41, 41, 41, 45, 45, 45, 45, 45, 48,
570 48, 48, 48, 48, 55, 55, 128, 55, 55, 59,
571 128, 59, 59, 59, 89, 128, 89, 128, 89, 95,
572 95, 95, 95, 98, 98, 98, 98, 98, 124, 124,
573 124, 124, 124, 11, 128, 128, 128, 128, 128, 128,
574 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
575 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
577 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
578 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
579 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
580 128, 128, 128, 128, 128, 128, 128, 128, 128
585 0, 1, 1, 1, 0, 1, 1, 1, 1, 1,
586 1, 1, 1, 55, 1, 56, 124, 5, 1, 1,
587 56, 1, 3, 5, 5, 1, 1, 3, 6, 103,
588 101, 4, 55, 3, 6, 6, 4, 90, 0, 56,
589 1, 1, 4, 9, 9, 0, 3, 3, 3, 10,
590 10, 32, 88, 32, 32, 4, 4, 4, 34, 34,
591 32, 1, 1, 1, 1, 2, 2, 2, 57, 2,
592 2, 2, 2, 2, 2, 2, 2, 7, 2, 85,
593 7, 8, 2, 2, 8, 2, 57, 84, 9, 2,
594 2, 35, 98, 35, 10, 38, 35, 96, 96, 46,
596 46, 87, 99, 87, 2, 2, 46, 79, 38, 38,
597 78, 98, 38, 38, 38, 38, 38, 38, 73, 73,
598 77, 99, 76, 69, 69, 2, 2, 2, 2, 29,
599 69, 74, 72, 71, 60, 53, 69, 69, 69, 69,
600 69, 52, 29, 29, 73, 29, 29, 29, 29, 29,
601 29, 29, 29, 30, 30, 30, 51, 75, 30, 30,
602 30, 75, 75, 47, 30, 42, 33, 30, 26, 30,
603 19, 18, 86, 17, 30, 86, 86, 86, 86, 86,
604 86, 14, 13, 100, 11, 30, 94, 75, 100, 94,
605 94, 94, 94, 94, 94, 104, 104, 107, 107, 0,
607 0, 0, 104, 0, 0, 0, 0, 100, 104, 104,
608 104, 104, 104, 0, 0, 0, 0, 0, 0, 0,
609 0, 0, 0, 107, 129, 129, 129, 129, 129, 130,
610 130, 130, 130, 130, 131, 131, 131, 131, 131, 132,
611 132, 132, 132, 132, 133, 133, 0, 133, 133, 134,
612 0, 134, 134, 134, 135, 0, 135, 0, 135, 136,
613 136, 136, 136, 137, 137, 137, 137, 137, 138, 138,
614 138, 138, 138, 128, 128, 128, 128, 128, 128, 128,
615 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
616 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
618 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
619 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
620 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
621 128, 128, 128, 128, 128, 128, 128, 128, 128
626 62, 63, 65, 66, 67, 68, 69, 70, 71, 72,
627 73, 74, 75, 76, 77, 80, 81, 82, 83, 88,
628 97, 98, 99, 102, 103, 106, 109, 112, 113, 117,
629 121, 122, 132, 136, 143, 147, 148, 149, 150, 151,
630 152, 153, 154, 155, 160, 164, 177, 178, 187, 188,
631 189, 190, 191, 192, 193, 194, 195, 196, 197, 211,
638 #define REJECT reject_used_but_not_detected
639 #define yymore() yymore_used_but_not_detected
640 #define YY_MORE_ADJ 0
641 #define YY_RESTORE_YY_MORE_OFFSET
642 #line 1 "lib/vcsn/rat/scan.ll"
643 #define YY_NO_INPUT 1
645 #line 14 "lib/vcsn/rat/scan.ll"
651 #include <boost/lexical_cast.hpp>
661 loc.end.column = 1; \
665 #define YY_USER_ACTION \
669 parser::make_ ## Token (loc)
677 #line 664 "lib/vcsn/rat/scan.cc"
682 #define SC_EXPONENT 3
685 #ifndef YY_NO_UNISTD_H
697 #ifndef YY_EXTRA_TYPE
698 #define YY_EXTRA_TYPE void *
717 static void yy_flex_strncpy (
char *,
yyconst char *,
int );
720 #ifdef YY_NEED_STRLEN
721 static int yy_flex_strlen (
yyconst char * );
737 #ifndef YY_READ_BUF_SIZE
740 #define YY_READ_BUF_SIZE 16384
742 #define YY_READ_BUF_SIZE 8192
751 #define ECHO LexerOutput( yytext, yyleng )
759 #define YY_INPUT(buf,result,max_size) \
763 if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
764 YY_FATAL_ERROR( "input in flex scanner failed" );
774 #define yyterminate() return YY_NULL
778 #ifndef YY_START_STACK_INCR
779 #define YY_START_STACK_INCR 25
783 #ifndef YY_FATAL_ERROR
787 #define YY_FATAL_ERROR(msg) LexerError( msg )
808 #define YY_DECL_IS_OURS 1
812 #define YY_DECL int yyFlexLexer::yylex()
819 #ifndef YY_USER_ACTION
820 #define YY_USER_ACTION
825 #define YY_BREAK break;
829 #define YY_RULE_SETUP \
839 register char *yy_cp, *yy_bp;
868 yyensure_buffer_stack ();
873 yy_load_buffer_state( );
878 #line 48 "lib/vcsn/rat/scan.ll"
882 unsigned int nesting = 0;
884 unsigned int exponent = 0;
891 #line 878 "lib/vcsn/rat/scan.cc"
896 yy_cp = (yy_c_buf_p);
899 *yy_cp = (yy_hold_char);
907 yy_current_state = (yy_start);
914 (yy_last_accepting_state) = yy_current_state;
915 (yy_last_accepting_cpos) = yy_cp;
917 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
919 yy_current_state = (int)
yy_def[yy_current_state];
920 if ( yy_current_state >= 129 )
921 yy_c =
yy_meta[(
unsigned int) yy_c];
923 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + (
unsigned int) yy_c];
926 while (
yy_base[yy_current_state] != 274 );
933 yy_cp = (yy_last_accepting_cpos);
934 yy_current_state = (yy_last_accepting_state);
948 std::cerr <<
"--scanner backing up\n";
949 else if ( yy_act < 63 )
951 "(\"" << yytext <<
"\")\n";
952 else if ( yy_act == 63 )
953 std::cerr <<
"--accepting default rule (\"" << yytext <<
"\")\n";
954 else if ( yy_act == 64 )
955 std::cerr <<
"--(end of buffer or a NUL)\n";
957 std::cerr <<
"--EOF (start condition " <<
YY_START <<
")\n";
965 *yy_cp = (yy_hold_char);
966 yy_cp = (yy_last_accepting_cpos);
967 yy_current_state = (yy_last_accepting_state);
973 #line 62 "lib/vcsn/rat/scan.ll"
978 #line 63 "lib/vcsn/rat/scan.ll"
983 #line 65 "lib/vcsn/rat/scan.ll"
984 return TOK(AMPERSAND);
988 #line 66 "lib/vcsn/rat/scan.ll"
993 #line 67 "lib/vcsn/rat/scan.ll"
994 return TOK(AMPERSAND_COLON);
998 #line 68 "lib/vcsn/rat/scan.ll"
1003 #line 69 "lib/vcsn/rat/scan.ll"
1008 #line 70 "lib/vcsn/rat/scan.ll"
1009 return TOK(LT_PLUS);
1013 #line 71 "lib/vcsn/rat/scan.ll"
1018 #line 72 "lib/vcsn/rat/scan.ll"
1019 return TOK(BACKSLASH);
1023 #line 73 "lib/vcsn/rat/scan.ll"
1028 #line 74 "lib/vcsn/rat/scan.ll"
1033 #line 75 "lib/vcsn/rat/scan.ll"
1038 #line 76 "lib/vcsn/rat/scan.ll"
1043 #line 77 "lib/vcsn/rat/scan.ll"
1049 #line 80 "lib/vcsn/rat/scan.ll"
1050 return parser::make_STAR(std::make_tuple(0, 1), loc);
1054 #line 81 "lib/vcsn/rat/scan.ll"
1055 return parser::make_STAR(std::make_tuple(-1, -1), loc);
1059 #line 82 "lib/vcsn/rat/scan.ll"
1060 return parser::make_STAR(std::make_tuple(1, -1), loc);
1064 #line 83 "lib/vcsn/rat/scan.ll"
1066 return parser::make_STAR(
quantifier(driver_, loc,
1067 {yytext+1,
static_cast<size_t>(
yyleng)-2}),
1073 #line 88 "lib/vcsn/rat/scan.ll"
1084 #line 97 "lib/vcsn/rat/scan.ll"
1089 #line 98 "lib/vcsn/rat/scan.ll"
1090 return TOK(COMPLEMENT);
1094 #line 99 "lib/vcsn/rat/scan.ll"
1095 return TOK(TRANSPOSITION);
1100 #line 102 "lib/vcsn/rat/scan.ll"
1106 #line 103 "lib/vcsn/rat/scan.ll"
1112 #line 106 "lib/vcsn/rat/scan.ll"
1118 #line 109 "lib/vcsn/rat/scan.ll"
1119 yy_push_state(
SC_CLASS);
return parser::make_LBRACKET(loc);
1124 #line 112 "lib/vcsn/rat/scan.ll"
1125 loc.step();
continue;
1130 #line 113 "lib/vcsn/rat/scan.ll"
1137 #line 117 "lib/vcsn/rat/scan.ll"
1140 return parser::make_RBRACKET(loc);
1145 #line 121 "lib/vcsn/rat/scan.ll"
1146 return parser::make_CARET(loc);
1150 #line 122 "lib/vcsn/rat/scan.ll"
1151 return parser::make_DASH(loc);
1154 #line 124 "lib/vcsn/rat/scan.ll"
1156 driver_.error(loc,
"unexpected end of file in a character-class");
1165 #line 132 "lib/vcsn/rat/scan.ll"
1167 return parser::make_LETTER({yytext+1, size_t(
yyleng-2)}, loc);
1172 #line 136 "lib/vcsn/rat/scan.ll"
1174 long c = strtol(yytext + 1, 0, 8);
1176 driver_.error(loc,
"invalid escape: " +
str_escape(yytext));
1177 return parser::make_LETTER({
char(c)}, loc);
1182 #line 143 "lib/vcsn/rat/scan.ll"
1184 return parser::make_LETTER({
char(strtol(yytext + 2, 0, 16))}, loc);
1189 #line 147 "lib/vcsn/rat/scan.ll"
1190 return parser::make_LETTER({
'\a'}, loc);
1194 #line 148 "lib/vcsn/rat/scan.ll"
1195 return parser::make_LETTER({
'\b'}, loc);
1199 #line 149 "lib/vcsn/rat/scan.ll"
1200 return parser::make_LETTER({
'\f'}, loc);
1204 #line 150 "lib/vcsn/rat/scan.ll"
1205 return parser::make_LETTER({
'\n'}, loc);
1209 #line 151 "lib/vcsn/rat/scan.ll"
1210 return parser::make_LETTER({
'\r'}, loc);
1214 #line 152 "lib/vcsn/rat/scan.ll"
1215 return parser::make_LETTER({
'\t'}, loc);
1219 #line 153 "lib/vcsn/rat/scan.ll"
1220 return parser::make_LETTER({
'\v'}, loc);
1224 #line 154 "lib/vcsn/rat/scan.ll"
1225 return parser::make_LETTER(yytext+1, loc+1);
1229 #line 155 "lib/vcsn/rat/scan.ll"
1230 return parser::make_LETTER(yytext, loc);
1236 #line 160 "lib/vcsn/rat/scan.ll"
1239 context.append(yytext,
yyleng);
1244 #line 164 "lib/vcsn/rat/scan.ll"
1249 context.append(yytext,
yyleng);
1254 driver_.context(context);
1261 #line 177 "lib/vcsn/rat/scan.ll"
1262 context.append(yytext,
yyleng);
1267 #line 178 "lib/vcsn/rat/scan.ll"
1271 #line 180 "lib/vcsn/rat/scan.ll"
1273 driver_.error(loc,
"unexpected end of file in a context comment");
1281 #line 187 "lib/vcsn/rat/scan.ll"
1286 #line 188 "lib/vcsn/rat/scan.ll"
1287 exponent *= 10; exponent += 1;
1291 #line 189 "lib/vcsn/rat/scan.ll"
1292 exponent *= 10; exponent += 2;
1296 #line 190 "lib/vcsn/rat/scan.ll"
1297 exponent *= 10; exponent += 3;
1301 #line 191 "lib/vcsn/rat/scan.ll"
1302 exponent *= 10; exponent += 4;
1306 #line 192 "lib/vcsn/rat/scan.ll"
1307 exponent *= 10; exponent += 5;
1311 #line 193 "lib/vcsn/rat/scan.ll"
1312 exponent *= 10; exponent += 6;
1316 #line 194 "lib/vcsn/rat/scan.ll"
1317 exponent *= 10; exponent += 7;
1321 #line 195 "lib/vcsn/rat/scan.ll"
1322 exponent *= 10; exponent += 8;
1326 #line 196 "lib/vcsn/rat/scan.ll"
1327 exponent *= 10; exponent += 9;
1332 #line 197 "lib/vcsn/rat/scan.ll"
1338 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1342 #line 204 "lib/vcsn/rat/scan.ll"
1345 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1352 #line 211 "lib/vcsn/rat/scan.ll"
1355 s.append(yytext,
yyleng);
1360 #line 216 "lib/vcsn/rat/scan.ll"
1365 s.append(yytext,
yyleng);
1370 return parser::make_WEIGHT(s, loc);
1378 #line 230 "lib/vcsn/rat/scan.ll"
1379 s.append(yytext,
yyleng);
1382 #line 232 "lib/vcsn/rat/scan.ll"
1384 driver_.error(loc,
"unexpected end of file in a weight");
1391 #line 238 "lib/vcsn/rat/scan.ll"
1394 #line 1381 "lib/vcsn/rat/scan.cc"
1401 int yy_amount_of_matched_text = (int) (yy_cp - (
yytext_ptr)) - 1;
1404 *yy_cp = (yy_hold_char);
1434 (yy_c_buf_p) = (
yytext_ptr) + yy_amount_of_matched_text;
1436 yy_current_state = yy_get_previous_state( );
1447 yy_next_state = yy_try_NUL_trans( yy_current_state );
1451 if ( yy_next_state )
1454 yy_cp = ++(yy_c_buf_p);
1455 yy_current_state = yy_next_state;
1462 yy_cp = (yy_c_buf_p);
1463 goto yy_find_action;
1467 else switch ( yy_get_next_buffer( ) )
1471 (yy_did_buffer_switch_on_eof) = 0;
1492 if ( ! (yy_did_buffer_switch_on_eof) )
1502 yy_current_state = yy_get_previous_state( );
1504 yy_cp = (yy_c_buf_p);
1512 yy_current_state = yy_get_previous_state( );
1514 yy_cp = (yy_c_buf_p);
1516 goto yy_find_action;
1523 "fatal flex scanner internal error--no action found" );
1587 #ifdef YY_INTERACTIVE
1593 if ( yyin->eof() || yyin->fail() )
1596 #ifdef YY_INTERACTIVE
1597 yyin->get( buf[0] );
1608 (
void) yyin->read( buf, max_size );
1613 return yyin->gcount();
1640 register int number_to_move, i;
1645 "fatal flex scanner internal error--end of buffer missed" );
1671 for ( i = 0; i < number_to_move; ++i )
1672 *(dest++) = *(source++);
1685 while ( num_to_read <= 0 )
1691 int yy_c_buf_p_offset =
1698 if ( new_size <= 0 )
1713 "fatal error - scanner input buffer overflow" );
1756 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1779 register char *yy_cp;
1793 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1795 yy_current_state = (int)
yy_def[yy_current_state];
1796 if ( yy_current_state >= 129 )
1797 yy_c =
yy_meta[(
unsigned int) yy_c];
1799 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + (
unsigned int) yy_c];
1802 return yy_current_state;
1816 register int yy_is_jam;
1826 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1828 yy_current_state = (int)
yy_def[yy_current_state];
1829 if ( yy_current_state >= 129 )
1830 yy_c =
yy_meta[(
unsigned int) yy_c];
1832 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + (
unsigned int) yy_c];
1833 yy_is_jam = (yy_current_state == 128);
1835 return yy_is_jam ? 0 : yy_current_state;
1844 register char *yy_cp;
1851 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1857 register char *source =
1861 *--dest = *--source;
1863 yy_cp += (int) (dest - source);
1864 yy_bp += (int) (dest - source);
1868 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1872 *--yy_cp = (
char) c;
2167 if (new_buffer == NULL)
2241 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2261 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2299 YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
2319 #ifndef YY_EXIT_FAILURE
2320 #define YY_EXIT_FAILURE 2
2328 std::cerr << msg << std::endl;
2340 int yyless_macro_arg = (n); \
2341 YY_LESS_LINENO(yyless_macro_arg);\
2342 yytext[yyleng] = (yy_hold_char); \
2343 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2344 (yy_hold_char) = *(yy_c_buf_p); \
2345 *(yy_c_buf_p) = '\0'; \
2346 yyleng = yyless_macro_arg; \
2377 static void yy_flex_strncpy (
char* s1,
yyconst char * s2,
int n )
2380 for ( i = 0; i < n; ++i )
2385 #ifdef YY_NEED_STRLEN
2386 static int yy_flex_strlen (
yyconst char * s )
2389 for ( n = 0; s[n]; ++n )
2398 return (
void *) malloc( size );
2410 return (
void *) realloc( (
char *) ptr, size );
2415 free( (
char *) ptr );
2420 #define YYTABLES_NAME "yytables"
2425 #line 237 "lib/vcsn/rat/scan.ll"
2431 template <
typename Out>
2433 lexical_cast(driver& d,
const location& loc,
const std::string& s)
2437 return boost::lexical_cast<Out>(s);
2439 catch (
const boost::bad_lexical_cast&)
2441 d.error(loc,
"invalid numerical literal: " + s);
2447 int arity(driver& d,
const location& loc,
const std::string& s)
2452 return lexical_cast<
int>(d, loc, s);
2463 auto arity_re = std::regex{
"([0-9]*)(,?)([0-9]*)", std::regex::extended};
2465 if (!std::regex_match(s, minmax, arity_re))
2466 throw std::runtime_error(
"cannot match arity: " + s);
2467 auto res =
irange_type{arity(d, loc, minmax[1].str()),
2468 arity(d, loc, minmax[3].str())};
2469 if (minmax[2].str().empty())
2471 std::get<1>(res) = std::get<0>(res);
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
void yy_switch_to_buffer(yy_buffer_state *new_buffer)
Switch to a different input buffer.
#define YY_RESTORE_YY_MORE_OFFSET
std::ostream & str_escape(std::ostream &os, const std::string &str, const char *special=nullptr)
Output a string, escaping special characters.
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
static flex_int16_t yy_accept[129]
#define YY_START_STACK_INCR
#define YY_CURRENT_BUFFER_LVALUE
#define YY_BUFFER_EOF_PENDING
#define YY_INPUT(buf, result, max_size)
yyFlexLexer(std::istream &arg_yyin, std::ostream &arg_yyout)
unsigned int flex_uint32_t
#define YY_DO_BEFORE_ACTION
void yypop_buffer_state()
Removes and deletes the top of the stack, if present.
#define YY_STATE_EOF(state)
void yypush_buffer_state(yy_buffer_state *new_buffer)
Pushes the new state onto the stack.
void * yyrealloc(void *ptr, yy_size_t size)
virtual void LexerOutput(const char *buf, int size)
Define the vcsn::rat::parser class.
struct yy_buffer_state * YY_BUFFER_STATE
unsigned short int flex_uint16_t
virtual void LexerError(const char *msg)
static flex_int32_t yy_ec[256]
int yy_looking_for_trail_begin
static flex_int16_t yy_def[139]
size_t yy_buffer_stack_max
capacity of stack.
int yy_did_buffer_switch_on_eof
#define EOB_ACT_CONTINUE_SCAN
int yy_bs_column
The column count.
yy_state_type yy_last_accepting_state
static flex_int16_t yy_chk[340]
vcsn::rat::location location
static flex_int16_t yy_base[139]
void scan_open_(std::istream &f)
size_t yy_buffer_stack_top
index of top of stack.
weightset_mixin< detail::b_impl > b
void yyensure_buffer_stack(void)
std::istream * yy_input_file
void yy_flush_buffer(yy_buffer_state *b)
Discard all buffered characters.
int yy_bs_lineno
The line count.
yy_buffer_state ** yy_buffer_stack
Stack as an array.
char * yy_last_accepting_cpos
virtual void switch_streams(std::istream *new_in, std::ostream *new_out=nullptr)
yy_state_type yy_get_previous_state()
#define YY_CURRENT_BUFFER
unsigned char flex_uint8_t
#define EOB_ACT_END_OF_FILE
static flex_int16_t yy_nxt[340]
#define YY_FLEX_NAMESPACE_END
void yyrestart(std::istream *s)
Immediately switch to a different input stream.
void yyunput(int c, char *buf_ptr)
virtual int LexerInput(char *buf, int max_size)
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
void yy_load_buffer_state()
void * yyalloc(yy_size_t size)
yy_buffer_state * yy_create_buffer(std::istream *s, int size)
Allocate and initialize an input buffer state.
static flex_int32_t yy_meta[66]
void yy_push_state(int new_state)
yy_state_type * yy_state_buf
std::shared_ptr< const detail::context_base > context
A dyn::context.
void yy_init_buffer(yy_buffer_state *b, std::istream *s)
static flex_int16_t yy_rule_linenum[63]
#define YY_END_OF_BUFFER_CHAR
#define YY_FATAL_ERROR(msg)
#define EOB_ACT_LAST_MATCH
irange_type quantifier(driver &d, const location &loc, const std::string &s)
void yy_delete_buffer(yy_buffer_state *b)
Destroy the buffer.