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 58
435 #define YY_END_OF_BUFFER 59
445 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
446 59, 39, 30, 31, 22, 6, 3, 39, 1, 2,
447 18, 7, 12, 9, 4, 28, 17, 14, 29, 39,
448 39, 13, 39, 39, 39, 39, 58, 34, 39, 32,
449 33, 42, 43, 40, 41, 54, 54, 54, 57, 55,
450 56, 57, 30, 31, 5, 0, 0, 0, 8, 38,
451 38, 16, 38, 15, 0, 0, 0, 0, 0, 0,
452 0, 0, 0, 0, 20, 22, 21, 16, 0, 0,
453 0, 0, 0, 42, 43, 46, 47, 45, 0, 57,
454 0, 35, 0, 35, 0, 0, 26, 0, 0, 18,
456 19, 0, 11, 17, 24, 10, 23, 25, 15, 28,
457 44, 48, 49, 50, 51, 52, 53, 55, 56, 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, 24, 24, 30, 24,
474 31, 24, 1, 1, 1, 1, 1, 1, 1, 1,
475 1, 1, 1, 1, 1, 32, 1, 1, 1, 33,
476 1, 34, 35, 36, 37, 1, 1, 1, 38, 1,
477 1, 1, 39, 1, 1, 40, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 41, 1, 1, 1, 1, 42, 1, 1, 43, 1,
480 1, 1, 1, 1, 1, 1, 1, 44, 45, 1,
481 1, 46, 1, 1, 1, 47, 1, 48, 49, 50,
482 51, 52, 53, 54, 55, 1, 1, 1, 1, 1,
483 1, 1, 1, 56, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 57, 1, 1, 1, 1,
486 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
487 1, 1, 1, 1, 58, 59, 1, 1, 1, 1,
488 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
489 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
495 1, 1, 2, 1, 1, 1, 1, 3, 4, 4,
496 1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
497 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
498 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
499 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
500 1, 1, 1, 1, 1, 1, 1, 1, 5
505 0, 0, 58, 0, 73, 86, 7, 32, 54, 77,
506 252, 253, 249, 247, 253, 253, 230, 206, 209, 253,
507 253, 253, 253, 253, 253, 214, 253, 253, 253, 73,
508 126, 253, 53, 171, 58, 80, 253, 253, 86, 253,
509 253, 0, 200, 253, 253, 253, 73, 164, 0, 253,
510 253, 158, 198, 196, 253, 84, 97, 107, 253, 253,
511 181, 253, 116, 253, 160, 157, 108, 156, 137, 155,
512 154, 153, 151, 150, 253, 253, 253, 253, 145, 131,
513 114, 88, 126, 0, 156, 253, 253, 253, 125, 0,
514 87, 253, 133, 144, 154, 139, 253, 118, 165, 253,
516 253, 167, 253, 253, 253, 253, 253, 253, 253, 253,
517 253, 253, 253, 253, 253, 253, 253, 253, 253, 69,
518 253, 253, 253, 253, 204, 209, 214, 219, 224, 229,
524 124, 1, 1, 3, 125, 125, 126, 126, 127, 127,
525 124, 124, 124, 124, 124, 124, 124, 128, 124, 124,
526 124, 124, 124, 124, 124, 124, 124, 124, 124, 129,
527 124, 124, 124, 124, 124, 124, 124, 124, 129, 124,
528 124, 130, 124, 124, 124, 124, 124, 124, 131, 124,
529 124, 124, 124, 124, 124, 128, 132, 124, 124, 124,
530 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
531 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
532 124, 124, 124, 130, 124, 124, 124, 124, 124, 131,
533 124, 124, 128, 128, 132, 133, 124, 124, 124, 124,
535 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
536 124, 124, 124, 124, 124, 124, 124, 124, 124, 133,
537 124, 124, 124, 0, 124, 124, 124, 124, 124, 124,
543 12, 13, 14, 15, 12, 16, 17, 18, 19, 20,
544 21, 22, 23, 12, 24, 12, 12, 12, 25, 26,
545 12, 27, 28, 12, 12, 29, 30, 12, 12, 12,
546 12, 12, 12, 12, 31, 32, 12, 12, 12, 12,
547 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
548 12, 12, 12, 12, 12, 33, 34, 35, 36, 12,
549 37, 12, 47, 12, 12, 48, 12, 12, 12, 12,
550 12, 38, 12, 50, 51, 43, 12, 12, 121, 12,
551 12, 44, 45, 12, 39, 40, 41, 47, 43, 61,
552 48, 92, 12, 12, 44, 45, 50, 51, 76, 56,
554 77, 77, 61, 62, 94, 63, 64, 77, 79, 80,
555 57, 96, 52, 12, 12, 12, 12, 81, 63, 82,
556 86, 87, 83, 95, 102, 102, 109, 88, 100, 97,
557 118, 119, 99, 99, 122, 52, 65, 66, 67, 99,
558 92, 68, 69, 69, 75, 99, 99, 70, 121, 67,
559 71, 92, 72, 69, 69, 73, 56, 74, 85, 57,
560 77, 94, 75, 77, 77, 77, 77, 77, 77, 110,
561 57, 111, 107, 75, 112, 113, 114, 115, 116, 117,
562 95, 123, 123, 102, 102, 105, 108, 107, 123, 106,
563 105, 104, 103, 101, 123, 123, 100, 98, 54, 53,
565 91, 89, 85, 75, 42, 42, 42, 42, 42, 46,
566 46, 46, 46, 46, 49, 49, 49, 49, 49, 56,
567 56, 78, 56, 56, 60, 59, 60, 60, 60, 84,
568 58, 84, 57, 84, 90, 90, 90, 90, 93, 93,
569 93, 93, 93, 120, 120, 120, 120, 120, 55, 54,
570 53, 124, 11, 124, 124, 124, 124, 124, 124, 124,
571 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
572 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
573 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
574 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
576 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
582 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
583 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
584 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
585 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
586 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
587 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
588 3, 3, 7, 3, 3, 7, 3, 3, 3, 3,
589 3, 3, 3, 9, 9, 5, 3, 3, 120, 3,
590 3, 5, 5, 3, 3, 3, 3, 8, 6, 30,
591 8, 56, 3, 3, 6, 6, 10, 10, 33, 57,
593 33, 33, 39, 30, 57, 30, 30, 33, 35, 35,
594 56, 58, 9, 3, 3, 3, 3, 36, 39, 36,
595 47, 47, 36, 57, 67, 67, 82, 47, 82, 58,
596 91, 91, 63, 63, 98, 10, 31, 31, 31, 63,
597 93, 31, 31, 31, 67, 63, 63, 31, 96, 69,
598 31, 94, 31, 69, 69, 31, 95, 31, 85, 93,
599 81, 95, 31, 81, 81, 81, 81, 81, 81, 83,
600 94, 89, 80, 69, 89, 89, 89, 89, 89, 89,
601 95, 99, 99, 102, 102, 79, 74, 73, 99, 72,
602 71, 70, 68, 66, 99, 99, 65, 61, 54, 53,
604 52, 48, 43, 102, 125, 125, 125, 125, 125, 126,
605 126, 126, 126, 126, 127, 127, 127, 127, 127, 128,
606 128, 34, 128, 128, 129, 26, 129, 129, 129, 130,
607 19, 130, 18, 130, 131, 131, 131, 131, 132, 132,
608 132, 132, 132, 133, 133, 133, 133, 133, 17, 14,
609 13, 11, 124, 124, 124, 124, 124, 124, 124, 124,
610 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
611 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
612 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
613 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
615 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
621 62, 63, 65, 66, 67, 68, 69, 70, 71, 72,
622 73, 74, 75, 76, 77, 78, 81, 82, 83, 84,
623 89, 98, 99, 100, 101, 104, 105, 108, 111, 114,
624 115, 119, 123, 124, 134, 138, 139, 140, 141, 146,
625 150, 163, 164, 173, 174, 175, 176, 177, 178, 179,
626 180, 181, 182, 183, 197, 202, 216
632 #define REJECT reject_used_but_not_detected
633 #define yymore() yymore_used_but_not_detected
634 #define YY_MORE_ADJ 0
635 #define YY_RESTORE_YY_MORE_OFFSET
636 #line 1 "lib/vcsn/rat/scan.ll"
637 #define YY_NO_INPUT 1
639 #line 14 "lib/vcsn/rat/scan.ll"
645 #include <boost/lexical_cast.hpp>
655 loc.end.column = 1; \
659 #define YY_USER_ACTION \
663 parser::make_ ## Token (loc)
671 #line 658 "lib/vcsn/rat/scan.cc"
676 #define SC_EXPONENT 3
679 #ifndef YY_NO_UNISTD_H
691 #ifndef YY_EXTRA_TYPE
692 #define YY_EXTRA_TYPE void *
711 static void yy_flex_strncpy (
char *,
yyconst char *,
int );
714 #ifdef YY_NEED_STRLEN
715 static int yy_flex_strlen (
yyconst char * );
731 #ifndef YY_READ_BUF_SIZE
734 #define YY_READ_BUF_SIZE 16384
736 #define YY_READ_BUF_SIZE 8192
745 #define ECHO LexerOutput( yytext, yyleng )
753 #define YY_INPUT(buf,result,max_size) \
757 if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
758 YY_FATAL_ERROR( "input in flex scanner failed" );
768 #define yyterminate() return YY_NULL
772 #ifndef YY_START_STACK_INCR
773 #define YY_START_STACK_INCR 25
777 #ifndef YY_FATAL_ERROR
781 #define YY_FATAL_ERROR(msg) LexerError( msg )
802 #define YY_DECL_IS_OURS 1
806 #define YY_DECL int yyFlexLexer::yylex()
813 #ifndef YY_USER_ACTION
814 #define YY_USER_ACTION
819 #define YY_BREAK break;
823 #define YY_RULE_SETUP \
833 register char *yy_cp, *yy_bp;
862 yyensure_buffer_stack ();
867 yy_load_buffer_state( );
872 #line 48 "lib/vcsn/rat/scan.ll"
876 unsigned int nesting = 0;
878 unsigned int exponent = 0;
880 static std::string context;
885 #line 872 "lib/vcsn/rat/scan.cc"
890 yy_cp = (yy_c_buf_p);
893 *yy_cp = (yy_hold_char);
901 yy_current_state = (yy_start);
908 (yy_last_accepting_state) = yy_current_state;
909 (yy_last_accepting_cpos) = yy_cp;
911 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
913 yy_current_state = (int)
yy_def[yy_current_state];
914 if ( yy_current_state >= 125 )
915 yy_c =
yy_meta[(
unsigned int) yy_c];
917 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + (
unsigned int) yy_c];
920 while (
yy_base[yy_current_state] != 253 );
927 yy_cp = (yy_last_accepting_cpos);
928 yy_current_state = (yy_last_accepting_state);
942 std::cerr <<
"--scanner backing up\n";
943 else if ( yy_act < 58 )
945 "(\"" << yytext <<
"\")\n";
946 else if ( yy_act == 58 )
947 std::cerr <<
"--accepting default rule (\"" << yytext <<
"\")\n";
948 else if ( yy_act == 59 )
949 std::cerr <<
"--(end of buffer or a NUL)\n";
951 std::cerr <<
"--EOF (start condition " <<
YY_START <<
")\n";
959 *yy_cp = (yy_hold_char);
960 yy_cp = (yy_last_accepting_cpos);
961 yy_current_state = (yy_last_accepting_state);
967 #line 62 "lib/vcsn/rat/scan.ll"
972 #line 63 "lib/vcsn/rat/scan.ll"
977 #line 65 "lib/vcsn/rat/scan.ll"
978 return TOK(AMPERSAND);
982 #line 66 "lib/vcsn/rat/scan.ll"
987 #line 67 "lib/vcsn/rat/scan.ll"
988 return TOK(AMPERSAND_COLON);
992 #line 68 "lib/vcsn/rat/scan.ll"
997 #line 69 "lib/vcsn/rat/scan.ll"
1002 #line 70 "lib/vcsn/rat/scan.ll"
1003 return TOK(LT_PLUS);
1007 #line 71 "lib/vcsn/rat/scan.ll"
1012 #line 72 "lib/vcsn/rat/scan.ll"
1013 return TOK(BACKSLASH);
1017 #line 73 "lib/vcsn/rat/scan.ll"
1022 #line 74 "lib/vcsn/rat/scan.ll"
1027 #line 75 "lib/vcsn/rat/scan.ll"
1032 #line 76 "lib/vcsn/rat/scan.ll"
1037 #line 77 "lib/vcsn/rat/scan.ll"
1042 #line 78 "lib/vcsn/rat/scan.ll"
1048 #line 81 "lib/vcsn/rat/scan.ll"
1049 return parser::make_STAR(std::make_tuple(0, 1), loc);
1053 #line 82 "lib/vcsn/rat/scan.ll"
1054 return parser::make_STAR(std::make_tuple(-1, -1), loc);
1058 #line 83 "lib/vcsn/rat/scan.ll"
1059 return parser::make_STAR(std::make_tuple(1, -1), loc);
1063 #line 84 "lib/vcsn/rat/scan.ll"
1065 return parser::make_STAR(
quantifier(driver_, loc,
1066 {yytext+1,
static_cast<size_t>(
yyleng)-2}),
1072 #line 89 "lib/vcsn/rat/scan.ll"
1083 #line 98 "lib/vcsn/rat/scan.ll"
1088 #line 99 "lib/vcsn/rat/scan.ll"
1089 return TOK(COMPLEMENT);
1093 #line 100 "lib/vcsn/rat/scan.ll"
1094 return TOK(TRANSPOSITION);
1098 #line 101 "lib/vcsn/rat/scan.ll"
1099 return TOK(TRANSPOSE);
1104 #line 104 "lib/vcsn/rat/scan.ll"
1110 #line 105 "lib/vcsn/rat/scan.ll"
1116 #line 108 "lib/vcsn/rat/scan.ll"
1122 #line 111 "lib/vcsn/rat/scan.ll"
1123 yy_push_state(
SC_CLASS);
return parser::make_LBRACKET(loc);
1128 #line 114 "lib/vcsn/rat/scan.ll"
1129 loc.step();
continue;
1134 #line 115 "lib/vcsn/rat/scan.ll"
1141 #line 119 "lib/vcsn/rat/scan.ll"
1144 return parser::make_RBRACKET(loc);
1149 #line 123 "lib/vcsn/rat/scan.ll"
1150 return parser::make_CARET(loc);
1154 #line 124 "lib/vcsn/rat/scan.ll"
1155 return parser::make_DASH(loc);
1158 #line 126 "lib/vcsn/rat/scan.ll"
1160 driver_.error(loc,
"unexpected end of file in a character-class");
1169 #line 134 "lib/vcsn/rat/scan.ll"
1171 return parser::make_LETTER({yytext+1, size_t(
yyleng-2)}, loc);
1175 #line 139 "lib/vcsn/rat/scan.ll"
1177 #line 140 "lib/vcsn/rat/scan.ll"
1179 #line 141 "lib/vcsn/rat/scan.ll"
1182 #line 141 "lib/vcsn/rat/scan.ll"
1183 return parser::make_LETTER({yytext, size_t(
yyleng)}, loc);
1189 #line 146 "lib/vcsn/rat/scan.ll"
1192 context.append(yytext,
yyleng);
1197 #line 150 "lib/vcsn/rat/scan.ll"
1202 context.append(yytext,
yyleng);
1207 driver_.context(context);
1214 #line 163 "lib/vcsn/rat/scan.ll"
1215 context.append(yytext,
yyleng);
1220 #line 164 "lib/vcsn/rat/scan.ll"
1224 #line 166 "lib/vcsn/rat/scan.ll"
1226 driver_.error(loc,
"unexpected end of file in a context comment");
1234 #line 173 "lib/vcsn/rat/scan.ll"
1239 #line 174 "lib/vcsn/rat/scan.ll"
1240 exponent *= 10; exponent += 1;
1244 #line 175 "lib/vcsn/rat/scan.ll"
1245 exponent *= 10; exponent += 2;
1249 #line 176 "lib/vcsn/rat/scan.ll"
1250 exponent *= 10; exponent += 3;
1254 #line 177 "lib/vcsn/rat/scan.ll"
1255 exponent *= 10; exponent += 4;
1259 #line 178 "lib/vcsn/rat/scan.ll"
1260 exponent *= 10; exponent += 5;
1264 #line 179 "lib/vcsn/rat/scan.ll"
1265 exponent *= 10; exponent += 6;
1269 #line 180 "lib/vcsn/rat/scan.ll"
1270 exponent *= 10; exponent += 7;
1274 #line 181 "lib/vcsn/rat/scan.ll"
1275 exponent *= 10; exponent += 8;
1279 #line 182 "lib/vcsn/rat/scan.ll"
1280 exponent *= 10; exponent += 9;
1285 #line 183 "lib/vcsn/rat/scan.ll"
1291 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1295 #line 190 "lib/vcsn/rat/scan.ll"
1298 return parser::make_STAR(std::make_tuple(exponent, exponent), loc);
1305 #line 197 "lib/vcsn/rat/scan.ll"
1308 s.append(yytext,
yyleng);
1313 #line 202 "lib/vcsn/rat/scan.ll"
1318 s.append(yytext,
yyleng);
1323 return parser::make_WEIGHT(s, loc);
1331 #line 216 "lib/vcsn/rat/scan.ll"
1332 s.append(yytext,
yyleng);
1335 #line 218 "lib/vcsn/rat/scan.ll"
1337 driver_.error(loc,
"unexpected end of file in a weight");
1344 #line 224 "lib/vcsn/rat/scan.ll"
1347 #line 1334 "lib/vcsn/rat/scan.cc"
1354 int yy_amount_of_matched_text = (int) (yy_cp - (
yytext_ptr)) - 1;
1357 *yy_cp = (yy_hold_char);
1387 (yy_c_buf_p) = (
yytext_ptr) + yy_amount_of_matched_text;
1389 yy_current_state = yy_get_previous_state( );
1400 yy_next_state = yy_try_NUL_trans( yy_current_state );
1404 if ( yy_next_state )
1407 yy_cp = ++(yy_c_buf_p);
1408 yy_current_state = yy_next_state;
1415 yy_cp = (yy_c_buf_p);
1416 goto yy_find_action;
1420 else switch ( yy_get_next_buffer( ) )
1424 (yy_did_buffer_switch_on_eof) = 0;
1445 if ( ! (yy_did_buffer_switch_on_eof) )
1455 yy_current_state = yy_get_previous_state( );
1457 yy_cp = (yy_c_buf_p);
1465 yy_current_state = yy_get_previous_state( );
1467 yy_cp = (yy_c_buf_p);
1469 goto yy_find_action;
1476 "fatal flex scanner internal error--no action found" );
1540 #ifdef YY_INTERACTIVE
1546 if ( yyin->eof() || yyin->fail() )
1549 #ifdef YY_INTERACTIVE
1550 yyin->get( buf[0] );
1561 (
void) yyin->read( buf, max_size );
1566 return yyin->gcount();
1593 register int number_to_move, i;
1598 "fatal flex scanner internal error--end of buffer missed" );
1624 for ( i = 0; i < number_to_move; ++i )
1625 *(dest++) = *(source++);
1638 while ( num_to_read <= 0 )
1644 int yy_c_buf_p_offset =
1651 if ( new_size <= 0 )
1666 "fatal error - scanner input buffer overflow" );
1709 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1732 register char *yy_cp;
1746 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1748 yy_current_state = (int)
yy_def[yy_current_state];
1749 if ( yy_current_state >= 125 )
1750 yy_c =
yy_meta[(
unsigned int) yy_c];
1752 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + (
unsigned int) yy_c];
1755 return yy_current_state;
1769 register int yy_is_jam;
1779 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1781 yy_current_state = (int)
yy_def[yy_current_state];
1782 if ( yy_current_state >= 125 )
1783 yy_c =
yy_meta[(
unsigned int) yy_c];
1785 yy_current_state =
yy_nxt[
yy_base[yy_current_state] + (
unsigned int) yy_c];
1786 yy_is_jam = (yy_current_state == 124);
1788 return yy_is_jam ? 0 : yy_current_state;
1797 register char *yy_cp;
1804 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1810 register char *source =
1814 *--dest = *--source;
1816 yy_cp += (int) (dest - source);
1817 yy_bp += (int) (dest - source);
1821 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1825 *--yy_cp = (
char) c;
2120 if (new_buffer == NULL)
2194 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2214 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
2252 YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
2272 #ifndef YY_EXIT_FAILURE
2273 #define YY_EXIT_FAILURE 2
2281 std::cerr << msg << std::endl;
2293 int yyless_macro_arg = (n); \
2294 YY_LESS_LINENO(yyless_macro_arg);\
2295 yytext[yyleng] = (yy_hold_char); \
2296 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2297 (yy_hold_char) = *(yy_c_buf_p); \
2298 *(yy_c_buf_p) = '\0'; \
2299 yyleng = yyless_macro_arg; \
2330 static void yy_flex_strncpy (
char* s1,
yyconst char * s2,
int n )
2333 for ( i = 0; i < n; ++i )
2338 #ifdef YY_NEED_STRLEN
2339 static int yy_flex_strlen (
yyconst char * s )
2342 for ( n = 0; s[n]; ++n )
2351 return (
void *) malloc( size );
2363 return (
void *) realloc( (
char *) ptr, size );
2368 free( (
char *) ptr );
2373 #define YYTABLES_NAME "yytables"
2378 #line 223 "lib/vcsn/rat/scan.ll"
2384 template <
typename Out>
2392 catch (
const boost::bad_lexical_cast&)
2394 d.error(loc,
"invalid numerical literal: " + s);
2400 int arity(driver& d,
const location& loc,
const std::string& s)
2416 auto arity_re = std::regex{
"([0-9]*)(,?)([0-9]*)", std::regex::extended};
2418 if (!std::regex_match(s, minmax, arity_re))
2419 throw std::runtime_error(
"cannot match arity: " + s);
2421 arity(d, loc, minmax[3].str())};
2422 if (minmax[2].str().empty())
2424 std::get<1>(
res) = std::get<0>(
res);
yy_state_type * yy_state_buf
#define YY_INPUT(buf, result, max_size)
char * yy_last_accepting_cpos
#define YY_FATAL_ERROR(msg)
#define YY_CURRENT_BUFFER_LVALUE
static flex_int16_t yy_rule_linenum[58]
#define YY_FLEX_NAMESPACE_END
yy_state_type yy_get_previous_state()
#define YY_START_STACK_INCR
size_t yy_buffer_stack_top
index of top of stack.
void yyunput(int c, char *buf_ptr)
virtual void LexerError(const char *msg)
weightset_mixin< detail::b_impl > b
void yyrestart(std::istream *s)
Immediately switch to a different input stream.
virtual void switch_streams(std::istream *new_in, std::ostream *new_out=nullptr)
void yy_init_buffer(yy_buffer_state *b, std::istream *s)
static flex_int16_t yy_nxt[313]
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
irange_type quantifier(driver &d, const location &loc, const std::string &s)
#define YY_BUFFER_EOF_PENDING
#define EOB_ACT_LAST_MATCH
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
#define YY_STATE_EOF(state)
void yy_switch_to_buffer(yy_buffer_state *new_buffer)
Switch to a different input buffer.
unsigned int flex_uint32_t
virtual int LexerInput(char *buf, int max_size)
#define YY_RESTORE_YY_MORE_OFFSET
void yy_load_buffer_state()
void yy_delete_buffer(yy_buffer_state *b)
Destroy the buffer.
T lexical_cast(const std::string &str)
String to templated type T conversion.
void yy_push_state(int new_state)
yy_buffer_state * yy_create_buffer(std::istream *s, int size)
Allocate and initialize an input buffer state.
#define EOB_ACT_CONTINUE_SCAN
yyFlexLexer(std::istream &arg_yyin, std::ostream &arg_yyout)
void * yyrealloc(void *ptr, yy_size_t size)
#define YY_CURRENT_BUFFER
size_t yy_buffer_stack_max
capacity of stack.
void * yyalloc(yy_size_t size)
Define the vcsn::rat::parser class.
#define YY_END_OF_BUFFER_CHAR
static flex_int16_t yy_chk[313]
unsigned short int flex_uint16_t
void yypop_buffer_state()
Removes and deletes the top of the stack, if present.
static flex_int16_t yy_base[134]
void yy_flush_buffer(yy_buffer_state *b)
Discard all buffered characters.
int yy_did_buffer_switch_on_eof
void yypush_buffer_state(yy_buffer_state *new_buffer)
Pushes the new state onto the stack.
struct yy_buffer_state * YY_BUFFER_STATE
static flex_int32_t yy_meta[60]
#define YY_DO_BEFORE_ACTION
int yy_looking_for_trail_begin
int yy_bs_column
The column count.
static flex_int32_t yy_ec[256]
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
static flex_int16_t yy_def[134]
virtual void LexerOutput(const char *buf, int size)
int yy_bs_lineno
The line count.
yy_buffer_state ** yy_buffer_stack
Stack as an array.
std::istream * yy_input_file
void yyensure_buffer_stack(void)
unsigned char flex_uint8_t
static flex_int16_t yy_accept[125]
vcsn::rat::location location
void scan_open_(std::istream &f)
#define EOB_ACT_END_OF_FILE
yy_state_type yy_last_accepting_state