36 #line 37 "./lib/vcsn/rat/parse.cc" // lalr1.cc:399
39 # if defined __cplusplus && 201103L <= __cplusplus
40 # define YY_NULLPTR nullptr
50 #line 51 "./lib/vcsn/rat/parse.cc" // lalr1.cc:407
52 #line 63 "lib/vcsn/rat/parse.yy" // lalr1.cc:408
60 #define TRY(Loc, Stm) \
65 catch (std::exception& e) \
67 error(Loc, e.what()); \
103 #line 104 "./lib/vcsn/rat/parse.cc" // lalr1.cc:408
107 # if defined YYENABLE_NLS && YYENABLE_NLS
109 # include <libintl.h>
110 # define YY_(msgid) dgettext ("bison-runtime", msgid)
114 # define YY_(msgid) msgid
118 #define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
123 # ifndef YYLLOC_DEFAULT
124 # define YYLLOC_DEFAULT(Current, Rhs, N) \
128 (Current).begin = YYRHSLOC (Rhs, 1).begin; \
129 (Current).end = YYRHSLOC (Rhs, N).end; \
133 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
140 #define YYUSE(E) ((void) (E))
146 # define YYCDEBUG if (yydebug_) (*yycdebug_)
148 # define YY_SYMBOL_PRINT(Title, Symbol) \
152 *yycdebug_ << Title << ' '; \
153 yy_print_ (*yycdebug_, Symbol); \
154 *yycdebug_ << std::endl; \
158 # define YY_REDUCE_PRINT(Rule) \
161 yy_reduce_print_ (Rule); \
164 # define YY_STACK_PRINT() \
172 # define YYCDEBUG if (false) std::cerr
173 # define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol)
174 # define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
175 # define YY_STACK_PRINT() static_cast<void>(0)
179 #define yyerrok (yyerrstatus_ = 0)
180 #define yyclearin (yyempty = true)
182 #define YYACCEPT goto yyacceptlab
183 #define YYABORT goto yyabortlab
184 #define YYERROR goto yyerrorlab
185 #define YYRECOVERING() (!!yyerrstatus_)
187 #line 11 "lib/vcsn/rat/parse.yy" // lalr1.cc:474
188 namespace vcsn {
namespace rat {
189 #line 190 "./lib/vcsn/rat/parse.cc" // lalr1.cc:474
201 std::string yyr =
"";
202 char const *yyp = yystr;
209 goto do_not_strip_quotes;
213 goto do_not_strip_quotes;
222 do_not_strip_quotes: ;
234 yycdebug_ (&
std::cerr),
236 driver_ (driver__yyarg)
257 : state (other.state)
277 return state == empty ? 0 :
yystos_[state];
289 switch (that.type_get ())
355 value.copy< std::string > (that.
value);
359 value.copy< std::vector<vcsn::dyn::expression> > (that.
value);
371 template <
typename Base>
381 template <
typename Base>
384 const basic_symbol<Base>& yysym)
const
386 std::ostream& yyoutput = yyo;
389 yyo << (yytype <
yyntokens_ ?
"token" :
"nterm")
391 << yysym.location <<
": ";
396 #line 121 "lib/vcsn/rat/parse.yy" // lalr1.cc:617
397 { yyo <<
'"' << yysym.value.template as< std::string > () <<
'"'; }
398 #line 399 "./lib/vcsn/rat/parse.cc" // lalr1.cc:617
403 #line 128 "lib/vcsn/rat/parse.yy" // lalr1.cc:617
404 { yyo <<
'<' << yysym.value.template as< std::string > () <<
'>'; }
405 #line 406 "./lib/vcsn/rat/parse.cc" // lalr1.cc:617
432 #line 130 "lib/vcsn/rat/parse.yy" // lalr1.cc:617
434 dyn::print(yysym.value.template as< braced_expression > ().exp, yyo);
435 yyo << (yysym.value.template as< braced_expression > ().lparen ?
" (lpar, " :
" (no lpar, ");
436 yyo << (yysym.value.template as< braced_expression > ().rparen ?
"rpar)" :
"no rpar)");
438 #line 439 "./lib/vcsn/rat/parse.cc" // lalr1.cc:617
443 #line 136 "lib/vcsn/rat/parse.yy" // lalr1.cc:617
445 const char* sep =
"[[";
446 for (
auto e: yysym.value.template as< std::vector<vcsn::dyn::expression> > ())
453 #line 454 "./lib/vcsn/rat/parse.cc" // lalr1.cc:617
458 #line 130 "lib/vcsn/rat/parse.yy" // lalr1.cc:617
460 dyn::print(yysym.value.template as< braced_expression > ().exp, yyo);
461 yyo << (yysym.value.template as< braced_expression > ().lparen ?
" (lpar, " :
" (no lpar, ");
462 yyo << (yysym.value.template as< braced_expression > ().rparen ?
"rpar)" :
"no rpar)");
464 #line 465 "./lib/vcsn/rat/parse.cc" // lalr1.cc:617
469 #line 146 "lib/vcsn/rat/parse.yy" // lalr1.cc:617
470 {
dyn::print(yysym.value.template as< dyn::weight > (), yyo); }
471 #line 472 "./lib/vcsn/rat/parse.cc" // lalr1.cc:617
476 #line 123 "lib/vcsn/rat/parse.yy" // lalr1.cc:617
479 for (
auto c: yysym.value.template as< class_t > ()) yyo << c.first <<
"-" << c.second;
482 #line 483 "./lib/vcsn/rat/parse.cc" // lalr1.cc:617
579 int yyerrstatus_ = 0;
594 YYCDEBUG <<
"Starting parse" << std::endl;
598 #line 117 "lib/vcsn/rat/parse.yy" // lalr1.cc:725
603 #line 604 "./lib/vcsn/rat/parse.cc" // lalr1.cc:725
637 yyla.
move (yylookahead);
650 yyn += yyla.type_get ();
672 yypush_ (
"Shifting", yyn, yyla);
722 yylhs.
value.
build< std::vector<vcsn::dyn::expression> > ();
743 #line 203 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
747 if (dim_exp != dim_ctx)
759 #line 760 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
763 #line 221 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
765 #line 766 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
769 #line 222 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
771 #line 772 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
775 #line 223 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
777 #line 778 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
781 #line 227 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
783 #line 784 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
787 #line 228 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
789 #line 790 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
793 #line 234 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
795 #line 796 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
799 #line 235 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
802 if (yystack_[0].value.as< std::vector<vcsn::dyn::expression> > ().size() == 1)
804 else if (yystack_[0].value.as< std::vector<vcsn::dyn::expression> > ().size() ==
driver_.
tape_ctx_.size())
809 +
std::to_string(yystack_[0].value.as< std::vector<vcsn::dyn::expression> > ().size())
813 #line 814 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
817 #line 252 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
821 #line 822 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
825 #line 255 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
827 #line 828 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
831 #line 256 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
833 yylhs.
value.
as< std::vector<vcsn::dyn::expression> > () = yystack_[3].value.as< std::vector<vcsn::dyn::expression> > ();
836 #line 837 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
840 #line 263 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
842 #line 843 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
846 #line 264 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
848 #line 849 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
852 #line 265 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
854 #line 855 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
858 #line 266 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
860 #line 861 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
864 #line 267 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
866 #line 867 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
870 #line 268 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
872 #line 873 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
876 #line 269 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
878 #line 879 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
882 #line 270 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
885 #line 886 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
889 #line 272 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
891 #line 892 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
895 #line 273 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
897 #line 898 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
901 #line 275 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
913 #line 914 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
917 #line 286 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
921 std::get<0>(yystack_[0].value.as<
irange_type > ()), std::get<1>(yystack_[0].value.as<
irange_type > ()))); }
922 #line 923 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
926 #line 290 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
928 #line 929 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
932 #line 291 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
934 #line 935 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
938 #line 292 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
940 #line 941 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
944 #line 293 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
946 #line 947 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
950 #line 294 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
952 #line 953 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
956 #line 295 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
958 #line 959 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
962 #line 296 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
964 #line 965 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
968 #line 297 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
970 #line 971 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
974 #line 298 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
976 #line 977 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
980 #line 302 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
982 #line 983 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
986 #line 303 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
988 #line 989 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
992 #line 307 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
994 #line 995 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
998 #line 308 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
999 { yylhs.
value.
as<
class_t > () = yystack_[1].value.as<
class_t > (); yylhs.
value.
as<
class_t > ().emplace(yystack_[0].value.as< std::string > (), yystack_[0].value.as< std::string > ()); }
1000 #line 1001 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
1004 #line 309 "lib/vcsn/rat/parse.yy" // lalr1.cc:847
1005 { yylhs.
value.
as<
class_t > () = yystack_[3].value.as<
class_t > (); yylhs.
value.
as<
class_t > ().emplace(yystack_[2].value.as< std::string > (), yystack_[0].value.as< std::string > ()); }
1006 #line 1007 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
1010 #line 1011 "./lib/vcsn/rat/parse.cc" // lalr1.cc:847
1039 yyempty ?
yyempty_ : yyla.type_get ()));
1044 if (yyerrstatus_ == 3)
1050 if (yyla.type_get () ==
yyeof_)
1089 yyn =
yypact_[yystack_[0].state];
1102 if (yystack_.size () == 1)
1115 error_token.
state = yyn;
1116 yypush_ (
"Shifting", error_token);
1132 yy_destroy_ (
"Cleanup: discarding lookahead", yyla);
1137 while (1 < yystack_.size ())
1147 YYCDEBUG <<
"Exception caught: cleaning lookahead and stack"
1178 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1180 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1209 yyarg[yycount++] =
yytname_[yytoken];
1216 int yyxbegin = yyn < 0 ? -yyn : 0;
1218 int yychecklim =
yylast_ - yyn + 1;
1220 for (
int yyx = yyxbegin; yyx < yyxend; ++yyx)
1224 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1238 #define YYCASE_(N, S) \
1243 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1244 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1245 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1246 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1247 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1253 for (
char const* yyp = yyformat; *yyp; ++yyp)
1254 if (yyp[0] ==
'%' && yyp[1] ==
's' && yyi < yycount)
1272 -19, 4, -8, -19, 153, -19, -19, -19, -19, -19,
1273 153, 3, -19, -19, -19, -19, -10, 9, 52, 153,
1274 -19, 171, -19, -18, 13, -19, -19, 153, 153, 153,
1275 153, -19, 153, 153, 153, 153, -19, -19, 176, 120,
1276 -5, -17, -19, 10, -19, 153, 125, 125, 148, 125,
1277 176, 77, 102, 148, -19, 7, 52, -19
1283 8, 0, 3, 6, 0, 1, 4, 8, 5, 2,
1284 0, 36, 8, 29, 28, 30, 34, 9, 10, 0,
1285 7, 26, 36, 0, 0, 35, 11, 0, 0, 0,
1286 0, 25, 0, 0, 0, 0, 27, 24, 23, 22,
1287 21, 0, 31, 37, 33, 0, 14, 16, 18, 15,
1288 13, 17, 20, 19, 32, 0, 12, 38
1294 -19, -19, -19, 0, -19, -19, -19, -19, -4, -2,
1301 -1, 1, 9, 2, 3, 4, 17, 45, 38, 19,
1308 18, 6, 42, 54, 5, 31, 21, 20, 43, 43,
1309 22, 7, 24, 8, 25, 40, 39, 16, 36, 39,
1310 37, 55, 0, 46, 47, 48, 49, 26, 50, 51,
1311 52, 53, 7, 57, 44, 40, 39, 41, 39, 0,
1312 0, 56, 0, 0, 39, 39, 39, 39, 39, 39,
1313 39, 39, 0, 0, 39, 27, 28, 29, 10, 0,
1314 30, 0, 31, 0, 32, 11, 12, 33, 13, 34,
1315 0, 0, 0, 0, 35, 36, 14, 37, 15, 16,
1316 27, 28, 29, 10, 0, 30, 0, 31, 0, 32,
1317 11, 12, 0, 13, 34, 0, 0, 0, 0, 35,
1318 36, 14, 37, 15, 16, 27, 28, 29, 10, 0,
1319 30, 0, 31, 0, 32, 11, 12, 0, 13, 0,
1320 0, 0, 0, 0, 35, 36, 14, 37, 15, 16,
1321 29, 10, 0, 11, 12, 31, 13, 32, 11, 12,
1322 0, 13, 0, 0, 14, 0, 15, 35, 36, 14,
1323 37, 15, 16, 29, 10, 0, 0, 0, 31, 10,
1324 32, 11, 12, 0, 13, 0, 11, 12, 0, 13,
1325 0, 36, 14, 37, 15, 16, 0, 14, 0, 15,
1326 16, 31, 0, 32, 11, 12, 31, 13, 0, 11,
1327 12, 0, 13, 0, 36, 14, 37, 15, 16, 36,
1334 4, 9, 20, 20, 0, 10, 10, 7, 26, 26,
1335 7, 19, 12, 21, 16, 19, 18, 27, 23, 21,
1336 25, 11, -1, 27, 28, 29, 30, 18, 32, 33,
1337 34, 35, 19, 26, 21, 39, 38, 22, 40, -1,
1338 -1, 45, -1, -1, 46, 47, 48, 49, 50, 51,
1339 52, 53, -1, -1, 56, 3, 4, 5, 6, -1,
1340 8, -1, 10, -1, 12, 13, 14, 15, 16, 17,
1341 -1, -1, -1, -1, 22, 23, 24, 25, 26, 27,
1342 3, 4, 5, 6, -1, 8, -1, 10, -1, 12,
1343 13, 14, -1, 16, 17, -1, -1, -1, -1, 22,
1344 23, 24, 25, 26, 27, 3, 4, 5, 6, -1,
1345 8, -1, 10, -1, 12, 13, 14, -1, 16, -1,
1346 -1, -1, -1, -1, 22, 23, 24, 25, 26, 27,
1347 5, 6, -1, 13, 14, 10, 16, 12, 13, 14,
1348 -1, 16, -1, -1, 24, -1, 26, 22, 23, 24,
1349 25, 26, 27, 5, 6, -1, -1, -1, 10, 6,
1350 12, 13, 14, -1, 16, -1, 13, 14, -1, 16,
1351 -1, 23, 24, 25, 26, 27, -1, 24, -1, 26,
1352 27, 10, -1, 12, 13, 14, 10, 16, -1, 13,
1353 14, -1, 16, -1, 23, 24, 25, 26, 27, 23,
1360 0, 32, 34, 35, 36, 0, 9, 19, 21, 33,
1361 6, 13, 14, 16, 24, 26, 27, 37, 39, 40,
1362 34, 39, 7, 41, 34, 40, 18, 3, 4, 5,
1363 8, 10, 12, 15, 17, 22, 23, 25, 39, 40,
1364 39, 41, 20, 26, 21, 38, 39, 39, 39, 39,
1365 39, 39, 39, 39, 20, 11, 39, 26
1371 0, 31, 32, 33, 33, 33, 34, 34, 36, 35,
1372 37, 38, 37, 39, 39, 39, 39, 39, 39, 39,
1373 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
1374 39, 39, 39, 39, 40, 40, 41, 41, 41
1380 0, 2, 2, 0, 1, 1, 1, 3, 0, 2,
1381 1, 0, 4, 3, 3, 3, 3, 3, 3, 3,
1382 3, 2, 2, 2, 2, 2, 2, 2, 1, 1,
1383 1, 3, 4, 3, 1, 2, 0, 2, 4
1393 "\"end\"",
"error",
"$undefined",
"\"&\"",
"\"&:\"",
"\"{\\\\}\"",
1394 "\"!\"",
"\"^\"",
"\":\"",
"\",\"",
"\"{c}\"",
"\"-\"",
"\".\"",
"\"[\"",
1395 "\"(\"",
"\"<+\"",
"\"\\\\e\"",
"\"%\"",
"\"|\"",
"\"+\"",
"\"]\"",
1396 "\")\"",
"\"{/}\"",
"\"{T}\"",
"\"\\\\z\"",
"\"*\"",
"\"letter\"",
1397 "\"weight\"",
"CONCAT",
"RWEIGHT",
"LWEIGHT",
"$accept",
"input",
1398 "terminator.opt",
"sum",
"tuple",
"$@1",
"tuple.1",
"$@2",
"exp",
1403 const unsigned short int
1406 0, 202, 202, 221, 222, 223, 227, 228, 234, 234,
1407 251, 255, 255, 263, 264, 265, 266, 267, 268, 269,
1408 270, 272, 273, 274, 286, 290, 291, 292, 293, 294,
1409 295, 296, 297, 298, 302, 303, 307, 308, 309
1429 unsigned int yylno =
yyrline_[yyrule];
1430 int yynrhs =
yyr2_[yyrule];
1432 *
yycdebug_ <<
"Reducing stack by rule " << yyrule - 1
1433 <<
" (line " << yylno <<
"):" << std::endl;
1435 for (
int yyi = 0; yyi < yynrhs; yyi++)
1442 #line 11 "lib/vcsn/rat/parse.yy" // lalr1.cc:1155
1444 #line 1445 "./lib/vcsn/rat/parse.cc" // lalr1.cc:1155
1445 #line 312 "lib/vcsn/rat/parse.yy" // lalr1.cc:1156
1462 driver_.error(l, m);
std::shared_ptr< const detail::weight_base > weight
expression rdiv(const expression &lhs, const expression &rhs)
Right-division of two expressions (lhs \ rhs).
int state_type
State numbers.
T & build()
Instantiate an empty T in here.
void move(by_state &that)
Steal the symbol type from that.
expression expression_zero(const context &c, rat::identities ids)
The expression for \z.
static bool yy_pact_value_is_default_(int yyvalue)
Whether the given yypact_ value indicates a defaulted state.
bool lparen
Whether there was a left-paren.
S::const_reverse_iterator const_iterator
stack_symbol_type & operator=(const stack_symbol_type &that)
Assignment, needed by push_back.
void yy_print_(std::ostream &yyo, const basic_symbol< Base > &yysym) const
Display a symbol type, value and location.
void set_debug_level(debug_level_type l)
Set the current debugging level.
dyn::context ctx_
The context used to read the expression.
#define YYLLOC_DEFAULT(Current, Rhs, N)
T & as()
Accessor to a built T.
virtual void yystack_print_()
Print the state stack on the debug stream.
static const signed char yypact_ninf_
symbol_number_type type_get() const
The (internal) type number (corresponding to state).
The abstract, non-parameterized, root for all rational expression node types.
location location_
The inital location.
void push(T &t)
Steal the contents of t.
static const unsigned short int yyrline_[]
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
virtual std::string yysyntax_error_(state_type yystate, symbol_number_type yytoken) const
Generate an error message.
static parser::symbol_type yylex(driver &d)
Use our local scanner object.
An expressionset can implement several different sets of identities on expressions.
Define the vcsn::rat::parser class.
dyn::expression make_atom(const location &loc, const std::string &s)
From a string, generate an expression.
dyn::expression exp
The expression parsed so far.
rat::identities identities() const
Get the identities.
virtual int parse()
Parse.
automaton right_mult(const automaton &aut, const weight &w, const std::string &algo="auto")
The right-mult automaton with w as weight.
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
static dyn::context ctx(const driver &d)
Get the context of the driver.
Termination state number.
#define YY_REDUCE_PRINT(Rule)
automaton multiply(const automaton &lhs, const automaton &rhs, const std::string &algo="auto")
Multiply (concatenate) two automata.
semantic_type value
The semantic value.
location(const position &b, const position &e)
Construct a location from b to e.
static identities ids(const driver &d)
Get the identities of the driver.
int debug_level_type
Type for debugging levels.
dyn::expression result_
The parsed expression.
dyn::expression make_expression(const location &loc, const class_t &c, bool accept)
From a label class, generate an expression.
int symbol_number_type
Internal symbol number.
static bool yy_table_value_is_error_(int yyvalue)
Whether the given yytable_ value indicates a syntax error.
debug_level_type debug_level() const
The current debugging level.
by_state()
Default constructor.
std::unique_ptr< yyFlexLexer > scanner_
The scanner.
"Internal" symbol: element of the stack.
state_type yy_lr_goto_state_(state_type yystate, int yysym)
Compute post-reduction state.
std::set< std::pair< std::string, std::string >> class_t
A set of label ranges.
void tape_pop()
Pop the tape stack.
void move(basic_symbol &s)
Destructive move, s is emptied into this.
State and public interface for rational expression parsing.
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
static const unsigned char yytable_[]
static const unsigned char yystos_[]
bool rparen
Whether there was a right-paren.
expansion tuple(const std::vector< expansion > &rs)
Build a k-tape expansion from k expansions.
void tape_inc(const location &l)
Increment the top most tape.
static const unsigned char yydefact_[]
void tape_push()
Push a new tape number on the stack.
static const signed char yydefgoto_[]
S::size_type size() const
expression concatenate(const expression &lhs, const expression &rhs)
Concatenate two expressions.
state_type state
The state.
static const short int yypact_[]
void move(self_type &other)
Move the content of other to this.
std::size_t num_tapes(const context &ctx)
The number of input tapes.
context context_of(const automaton &a)
The context of this automaton.
Syntax errors thrown from user actions.
#define YY_SYMBOL_PRINT(Title, Symbol)
stack_symbol_type()
Construct an empty symbol.
dyn::weight make_weight(const location &loc, const std::string &s)
From a string, generate a weight.
std::vector< dyn::context > tape_ctx_
The context for each tape. If single-tape, [0] is ctx_.
static const unsigned char yyr2_[]
void pop(unsigned int n=1)
static const signed char yytable_ninf_
std::string to_string(identities i)
Wrapper around operator<<.
parser(driver &driver__yyarg)
Build a parser object.
static const signed char yycheck_[]
static dyn::expression prefer(const dyn::expression &e, const dyn::expression &f)
Generate an expression for "e <+ f = e % f + f".
const_iterator begin() const
Type access provider for state based symbols.
void set_debug_stream(std::ostream &)
Set the current debugging stream.
void context(const dyn::context &ctx)
Set the expressionset to use from this context.
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
stack_type yystack_
The stack.
void yypush_(const char *m, stack_symbol_type &s)
Push a new state on the stack.
Present a slice of the top of a stack.
std::shared_ptr< detail::expression_base > expression
An expression that "remembers" whether it was in parentheses.
static const unsigned char yyr1_[]
static const signed char yypgoto_[]
std::shared_ptr< const detail::context_base > context
A dyn::context.
void yy_destroy_(const char *yymsg, basic_symbol< Base > &yysym) const
Reclaim the memory associated to a symbol.
location_type location
The location.
expression expression_one(const context &c, rat::identities ids)
The expression for \e.
automaton left_mult(const weight &w, const automaton &aut, const std::string &algo="auto")
The left-multiplication of an automaton with w as weight.
const_iterator end() const
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
std::ostream & debug_stream() const
The current debugging stream.
Container::value_type back(const Container &container)
The last member of this Container.
static const char *const yytname_[]
For a symbol, its name in clear.
std::ostream & print(const automaton &aut, std::ostream &out, const std::string &format="default")
Print automaton a on o using format format.