52 #if defined(__GNUC__) || defined(__clang__)
53 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
60 # if defined YYENABLE_NLS && YYENABLE_NLS
63 # define YY_(msgid) dgettext ("bison-runtime", msgid)
67 # define YY_(msgid) msgid
74 # if defined __GNUC__ && !defined __EXCEPTIONS
75 # define YY_EXCEPTIONS 0
77 # define YY_EXCEPTIONS 1
81 #define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
86 # ifndef YYLLOC_DEFAULT
87 # define YYLLOC_DEFAULT(Current, Rhs, N) \
91 (Current).begin = YYRHSLOC (Rhs, 1).begin; \
92 (Current).end = YYRHSLOC (Rhs, N).end; \
96 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
106 # define YYCDEBUG if (yydebug_) (*yycdebug_)
108 # define YY_SYMBOL_PRINT(Title, Symbol) \
112 *yycdebug_ << Title << ' '; \
113 yy_print_ (*yycdebug_, Symbol); \
114 *yycdebug_ << '\n'; \
118 # define YY_REDUCE_PRINT(Rule) \
121 yy_reduce_print_ (Rule); \
124 # define YY_STACK_PRINT() \
127 yy_stack_print_ (); \
132 # define YYCDEBUG if (false) std::cerr
133 # define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol)
134 # define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
135 # define YY_STACK_PRINT() static_cast<void> (0)
139 #define yyerrok (yyerrstatus_ = 0)
140 #define yyclearin (yyla.clear ())
142 #define YYACCEPT goto yyacceptlab
143 #define YYABORT goto yyabortlab
144 #define YYERROR goto yyerrorlab
145 #define YYRECOVERING() (!!yyerrstatus_)
148 namespace isc {
namespace eval {
149 #line 150 "parser.cc"
155 yycdebug_ (&std::cerr),
176 : state (empty_state)
179 EvalParser::by_state::by_state (
const by_state& that)
YY_NOEXCEPT
190 EvalParser::by_state::move (by_state& that)
196 EvalParser::by_state::by_state (state_type s)
YY_NOEXCEPT
203 if (state == empty_state)
209 EvalParser::stack_symbol_type::stack_symbol_type ()
212 EvalParser::stack_symbol_type::stack_symbol_type (
YY_RVREF (stack_symbol_type) that)
215 switch (that.kind ())
238 value.YY_MOVE_OR_COPY< int8_t > (
YY_MOVE (that.value));
246 value.YY_MOVE_OR_COPY< std::string > (
YY_MOVE (that.value));
251 value.YY_MOVE_OR_COPY< uint16_t > (
YY_MOVE (that.value));
256 value.YY_MOVE_OR_COPY< uint32_t > (
YY_MOVE (that.value));
263 #if 201103L <= YY_CPLUSPLUS
265 that.state = empty_state;
269 EvalParser::stack_symbol_type::stack_symbol_type (state_type s,
YY_MOVE_REF (symbol_type) that)
270 : super_type (s,
YY_MOVE (that.location))
272 switch (that.kind ())
295 value.move< int8_t > (
YY_MOVE (that.value));
303 value.move< std::string > (
YY_MOVE (that.value));
308 value.move< uint16_t > (
YY_MOVE (that.value));
313 value.move< uint32_t > (
YY_MOVE (that.value));
324 #if YY_CPLUSPLUS < 201103L
325 EvalParser::stack_symbol_type&
326 EvalParser::stack_symbol_type::operator= (
const stack_symbol_type& that)
329 switch (that.kind ())
352 value.copy< int8_t > (that.value);
360 value.copy< std::string > (that.value);
365 value.copy< uint16_t > (that.value);
370 value.copy< uint32_t > (that.value);
377 location = that.location;
381 EvalParser::stack_symbol_type&
382 EvalParser::stack_symbol_type::operator= (stack_symbol_type& that)
385 switch (that.kind ())
408 value.move< int8_t > (that.value);
416 value.move< std::string > (that.value);
421 value.move< uint16_t > (that.value);
426 value.move< uint32_t > (that.value);
433 location = that.location;
435 that.state = empty_state;
440 template <
typename Base>
442 EvalParser::yy_destroy_ (
const char* yymsg, basic_symbol<Base>& yysym)
const
449 template <
typename Base>
451 EvalParser::yy_print_ (std::ostream& yyo,
const basic_symbol<Base>& yysym)
const
453 std::ostream& yyoutput = yyo;
456 yyo <<
"empty symbol";
460 yyo << (yykind <
YYNTOKENS ?
"token" :
"nterm")
461 <<
' ' << yysym.name () <<
" ("
462 << yysym.location <<
": ";
466 #line 127 "parser.yy"
467 { yyoutput << yysym.value.template as < std::string > (); }
468 #line 469 "parser.cc"
472 #line 127 "parser.yy"
473 { yyoutput << yysym.value.template as < std::string > (); }
474 #line 475 "parser.cc"
478 #line 127 "parser.yy"
479 { yyoutput << yysym.value.template as < std::string > (); }
480 #line 481 "parser.cc"
484 #line 127 "parser.yy"
485 { yyoutput << yysym.value.template as < std::string > (); }
486 #line 487 "parser.cc"
490 #line 127 "parser.yy"
491 { yyoutput << yysym.value.template as < std::string > (); }
492 #line 493 "parser.cc"
496 #line 127 "parser.yy"
497 { yyoutput << yysym.value.template as < uint32_t > (); }
498 #line 499 "parser.cc"
502 #line 127 "parser.yy"
503 { yyoutput << yysym.value.template as < uint16_t > (); }
504 #line 505 "parser.cc"
508 #line 127 "parser.yy"
509 { yyoutput << yysym.value.template as < uint16_t > (); }
510 #line 511 "parser.cc"
514 #line 127 "parser.yy"
515 { yyoutput << yysym.value.template as < TokenOption::RepresentationType > (); }
516 #line 517 "parser.cc"
520 #line 127 "parser.yy"
521 { yyoutput << yysym.value.template as < int8_t > (); }
522 #line 523 "parser.cc"
526 #line 127 "parser.yy"
527 { yyoutput << yysym.value.template as < TokenPkt::MetadataType > (); }
528 #line 529 "parser.cc"
532 #line 127 "parser.yy"
533 { yyoutput << yysym.value.template as < uint32_t > (); }
534 #line 535 "parser.cc"
538 #line 127 "parser.yy"
539 { yyoutput << yysym.value.template as < TokenPkt4::FieldType > (); }
540 #line 541 "parser.cc"
544 #line 127 "parser.yy"
545 { yyoutput << yysym.value.template as < TokenPkt6::FieldType > (); }
546 #line 547 "parser.cc"
550 #line 127 "parser.yy"
551 { yyoutput << yysym.value.template as < TokenRelay6Field::FieldType > (); }
552 #line 553 "parser.cc"
564 EvalParser::yypush_ (
const char* m,
YY_MOVE_REF (stack_symbol_type) sym)
572 EvalParser::yypush_ (
const char* m, state_type s,
YY_MOVE_REF (symbol_type) sym)
574 #if 201103L <= YY_CPLUSPLUS
575 yypush_ (m, stack_symbol_type (s, std::move (sym)));
577 stack_symbol_type ss (s, sym);
615 EvalParser::state_type
616 EvalParser::yy_lr_goto_state_ (state_type yystate,
int yysym)
618 int yyr = yypgoto_[yysym -
YYNTOKENS] + yystate;
619 if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
620 return yytable_[yyr];
626 EvalParser::yy_pact_value_is_default_ (
int yyvalue)
YY_NOEXCEPT
628 return yyvalue == yypact_ninf_;
632 EvalParser::yy_table_value_is_error_ (
int yyvalue)
YY_NOEXCEPT
634 return yyvalue == yytable_ninf_;
652 int yyerrstatus_ = 0;
658 stack_symbol_type yyerror_range[3];
675 yypush_ (YY_NULLPTR, 0,
YY_MOVE (yyla));
681 YYCDEBUG <<
"Entering state " << int (yystack_[0].state) <<
'\n';
685 if (yystack_[0].state == yyfinal_)
696 yyn = yypact_[+yystack_[0].state];
697 if (yy_pact_value_is_default_ (yyn))
709 yyla.
move (yylookahead);
714 YYCDEBUG <<
"Caught exception: " << yyexc.what() <<
'\n';
735 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ())
744 if (yy_table_value_is_error_ (yyn))
755 yypush_ (
"Shifting", state_type (yyn),
YY_MOVE (yyla));
763 yyn = yydefact_[+yystack_[0].state];
775 stack_symbol_type yylhs;
776 yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
803 yylhs.value.emplace< int8_t > ();
811 yylhs.value.emplace< std::string > ();
816 yylhs.value.emplace< uint16_t > ();
821 yylhs.value.emplace< uint32_t > ();
833 yyerror_range[1].location = yylhs.location;
845 #line 147 "parser.yy"
850 #line 851 "parser.cc"
854 #line 152 "parser.yy"
859 #line 860 "parser.cc"
863 #line 157 "parser.yy"
868 #line 869 "parser.cc"
872 #line 162 "parser.yy"
877 #line 878 "parser.cc"
881 #line 167 "parser.yy"
886 #line 887 "parser.cc"
890 #line 172 "parser.yy"
892 TokenPtr opt(
new TokenSubOption(yystack_[8].value.as < uint16_t > (), yystack_[3].value.as < uint16_t > (), TokenOption::EXISTS));
895 #line 896 "parser.cc"
899 #line 177 "parser.yy"
916 error(yystack_[5].location,
"relay4 can only be used in DHCPv4.");
919 #line 920 "parser.cc"
923 #line 197 "parser.yy"
928 TokenPtr opt(
new TokenRelay6Option(yystack_[8].value.as < int8_t > (), yystack_[3].value.as < uint16_t > (), TokenOption::EXISTS));
934 error(yystack_[10].location,
"relay6 can only be used in DHCPv6.");
937 #line 938 "parser.cc"
941 #line 211 "parser.yy"
950 #line 951 "parser.cc"
954 #line 220 "parser.yy"
963 #line 964 "parser.cc"
967 #line 229 "parser.yy"
974 TokenPtr exist(
new TokenVendor(ctx.
getUniverse(), yystack_[8].value.as < uint32_t > (), TokenOption::EXISTS, yystack_[3].value.as < uint16_t > ()));
977 #line 978 "parser.cc"
981 #line 239 "parser.yy"
989 std::string cc = yystack_[1].value.as < std::string > ();
991 error(yystack_[1].location,
"Not defined client class '" + cc +
"'");
996 #line 997 "parser.cc"
1000 #line 256 "parser.yy"
1005 #line 1006 "parser.cc"
1009 #line 261 "parser.yy"
1014 #line 1015 "parser.cc"
1018 #line 266 "parser.yy"
1023 #line 1024 "parser.cc"
1027 #line 271 "parser.yy"
1032 #line 1033 "parser.cc"
1036 #line 276 "parser.yy"
1041 #line 1042 "parser.cc"
1045 #line 281 "parser.yy"
1062 error(yystack_[5].location,
"relay4 can only be used in DHCPv4.");
1065 #line 1066 "parser.cc"
1069 #line 302 "parser.yy"
1080 error(yystack_[10].location,
"relay6 can only be used in DHCPv6.");
1083 #line 1084 "parser.cc"
1087 #line 317 "parser.yy"
1092 #line 1093 "parser.cc"
1096 #line 322 "parser.yy"
1107 error(yystack_[2].location,
"pkt4 can only be used in DHCPv4.");
1110 #line 1111 "parser.cc"
1114 #line 336 "parser.yy"
1125 error(yystack_[2].location,
"pkt6 can only be used in DHCPv6.");
1128 #line 1129 "parser.cc"
1132 #line 350 "parser.yy"
1143 error(yystack_[5].location,
"relay6 can only be used in DHCPv6.");
1146 #line 1147 "parser.cc"
1150 #line 365 "parser.yy"
1155 #line 1156 "parser.cc"
1159 #line 370 "parser.yy"
1164 #line 1165 "parser.cc"
1168 #line 375 "parser.yy"
1173 #line 1174 "parser.cc"
1177 #line 380 "parser.yy"
1182 #line 1183 "parser.cc"
1186 #line 385 "parser.yy"
1191 #line 1192 "parser.cc"
1195 #line 390 "parser.yy"
1200 #line 1201 "parser.cc"
1204 #line 395 "parser.yy"
1209 #line 1210 "parser.cc"
1213 #line 400 "parser.yy"
1218 #line 1219 "parser.cc"
1222 #line 405 "parser.yy"
1227 #line 1228 "parser.cc"
1231 #line 410 "parser.yy"
1236 #line 1237 "parser.cc"
1240 #line 415 "parser.yy"
1245 #line 1246 "parser.cc"
1249 #line 420 "parser.yy"
1254 #line 1255 "parser.cc"
1258 #line 425 "parser.yy"
1263 #line 1264 "parser.cc"
1267 #line 430 "parser.yy"
1276 #line 1277 "parser.cc"
1280 #line 439 "parser.yy"
1287 TokenVendor::ENTERPRISE_ID));
1290 #line 1291 "parser.cc"
1294 #line 449 "parser.yy"
1303 #line 1304 "parser.cc"
1307 #line 458 "parser.yy"
1317 TokenVendor::DATA, 0));
1320 #line 1321 "parser.cc"
1324 #line 471 "parser.yy"
1332 uint8_t index = ctx.
convertUint8(yystack_[1].value.as < std::string > (), yystack_[1].location);
1334 TokenVendor::DATA, index));
1337 #line 1338 "parser.cc"
1341 #line 484 "parser.yy"
1346 #line 1347 "parser.cc"
1350 #line 492 "parser.yy"
1352 yylhs.value.as < uint32_t > () = ctx.
convertUint32(yystack_[0].value.as < std::string > (), yystack_[0].location);
1354 #line 1355 "parser.cc"
1358 #line 498 "parser.yy"
1360 yylhs.value.as < uint16_t > () = ctx.
convertOptionCode(yystack_[0].value.as < std::string > (), yystack_[0].location);
1362 #line 1363 "parser.cc"
1366 #line 502 "parser.yy"
1368 yylhs.value.as < uint16_t > () = ctx.
convertOptionName(yystack_[0].value.as < std::string > (), yystack_[0].location);
1370 #line 1371 "parser.cc"
1374 #line 508 "parser.yy"
1376 yylhs.value.as < uint16_t > () = ctx.
convertOptionCode(yystack_[0].value.as < std::string > (), yystack_[0].location);
1378 #line 1379 "parser.cc"
1382 #line 514 "parser.yy"
1386 #line 1387 "parser.cc"
1390 #line 518 "parser.yy"
1394 #line 1395 "parser.cc"
1398 #line 524 "parser.yy"
1400 yylhs.value.as < int8_t > () = ctx.
convertNestLevelNumber(yystack_[0].value.as < std::string > (), yystack_[0].location);
1402 #line 1403 "parser.cc"
1406 #line 533 "parser.yy"
1410 #line 1411 "parser.cc"
1414 #line 537 "parser.yy"
1418 #line 1419 "parser.cc"
1422 #line 541 "parser.yy"
1426 #line 1427 "parser.cc"
1430 #line 545 "parser.yy"
1434 #line 1435 "parser.cc"
1438 #line 551 "parser.yy"
1440 yylhs.value.as < uint32_t > () = ctx.
convertUint32(yystack_[0].value.as < std::string > (), yystack_[0].location);
1442 #line 1443 "parser.cc"
1446 #line 555 "parser.yy"
1448 yylhs.value.as < uint32_t > () = 0;
1450 #line 1451 "parser.cc"
1454 #line 561 "parser.yy"
1458 #line 1459 "parser.cc"
1462 #line 565 "parser.yy"
1466 #line 1467 "parser.cc"
1470 #line 569 "parser.yy"
1474 #line 1475 "parser.cc"
1478 #line 573 "parser.yy"
1482 #line 1483 "parser.cc"
1486 #line 577 "parser.yy"
1490 #line 1491 "parser.cc"
1494 #line 581 "parser.yy"
1498 #line 1499 "parser.cc"
1502 #line 585 "parser.yy"
1506 #line 1507 "parser.cc"
1510 #line 589 "parser.yy"
1514 #line 1515 "parser.cc"
1518 #line 593 "parser.yy"
1522 #line 1523 "parser.cc"
1526 #line 599 "parser.yy"
1530 #line 1531 "parser.cc"
1534 #line 603 "parser.yy"
1538 #line 1539 "parser.cc"
1542 #line 609 "parser.yy"
1546 #line 1547 "parser.cc"
1550 #line 613 "parser.yy"
1554 #line 1555 "parser.cc"
1558 #line 619 "parser.yy"
1563 #line 1564 "parser.cc"
1567 #line 626 "parser.yy"
1572 #line 1573 "parser.cc"
1576 #line 631 "parser.yy"
1581 #line 1582 "parser.cc"
1585 #line 637 "parser.yy"
1590 #line 1591 "parser.cc"
1594 #line 1595 "parser.cc"
1603 YYCDEBUG <<
"Caught exception: " << yyexc.what() <<
'\n';
1613 yypush_ (YY_NULLPTR,
YY_MOVE (yylhs));
1627 std::string msg = yysyntax_error_ (yyctx);
1632 yyerror_range[1].location = yyla.
location;
1633 if (yyerrstatus_ == 3)
1641 else if (!yyla.
empty ())
1643 yy_destroy_ (
"Error: discarding", yyla);
1677 yyn = yypact_[+yystack_[0].state];
1678 if (!yy_pact_value_is_default_ (yyn))
1681 if (0 <= yyn && yyn <= yylast_
1684 yyn = yytable_[yyn];
1691 if (yystack_.size () == 1)
1694 yyerror_range[1].location = yystack_[0].location;
1695 yy_destroy_ (
"Error: popping", yystack_[0]);
1700 stack_symbol_type error_token;
1702 yyerror_range[2].location = yyla.
location;
1706 error_token.state = state_type (yyn);
1707 yypush_ (
"Shifting",
YY_MOVE (error_token));
1733 yy_destroy_ (
"Cleanup: discarding lookahead", yyla);
1739 while (1 < yystack_.size ())
1741 yy_destroy_ (
"Cleanup: popping", yystack_[0]);
1750 YYCDEBUG <<
"Exception caught: cleaning lookahead and stack\n";
1754 yy_destroy_ (YY_NULLPTR, yyla);
1756 while (1 < yystack_.size ())
1758 yy_destroy_ (YY_NULLPTR, yystack_[0]);
1778 EvalParser::yytnamerr_ (
const char *yystr)
1783 char const *yyp = yystr;
1790 goto do_not_strip_quotes;
1794 goto do_not_strip_quotes;
1806 do_not_strip_quotes: ;
1815 return yytnamerr_ (yytname_[yysymbol]);
1822 : yyparser_ (yyparser)
1832 const int yyn = yypact_[+yyparser_.yystack_[0].state];
1833 if (!yy_pact_value_is_default_ (yyn))
1838 const int yyxbegin = yyn < 0 ? -yyn : 0;
1840 const int yychecklim = yylast_ - yyn + 1;
1842 for (
int yyx = yyxbegin; yyx < yyxend; ++yyx)
1844 && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
1848 else if (yycount == yyargn)
1855 if (yyarg && yycount == 0 && 0 < yyargn)
1866 EvalParser::yy_syntax_error_arguments_ (
const context& yyctx,
1897 yyarg[0] = yyctx.
token ();
1898 int yyn = yyctx.
expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1906 EvalParser::yysyntax_error_ (
const context& yyctx)
const
1909 enum { YYARGS_MAX = 5 };
1912 int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX);
1914 char const* yyformat = YY_NULLPTR;
1917 #define YYCASE_(N, S) \
1923 YYCASE_ (1,
YY_(
"syntax error, unexpected %s"));
1924 YYCASE_ (2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1925 YYCASE_ (3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1926 YYCASE_ (4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1927 YYCASE_ (5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1933 std::ptrdiff_t yyi = 0;
1934 for (
char const* yyp = yyformat; *yyp; ++yyp)
1935 if (yyp[0] ==
'%' && yyp[1] ==
's' && yyi < yycount)
1946 const short EvalParser::yypact_ninf_ = -156;
1948 const signed char EvalParser::yytable_ninf_ = -1;
1951 EvalParser::yypact_[] =
1953 43, 109, 156, 20, 109, 109, 73, 94, 98, 90,
1954 79, 111, 133, 142, 157, 168, 177, 180, 185, 189,
1955 190, 192, 211, 219, 207, 112, 131, -156, -156, -156,
1956 -156, -156, 135, 29, -156, 156, 210, 212, 213, 161,
1957 164, 187, -156, 104, 0, -156, -34, 169, 170, 172,
1958 82, 52, 156, 156, 156, 109, 156, 156, 156, 156,
1959 156, 156, 156, 156, 113, -39, 176, -39, 178, 109,
1960 109, 156, 156, 1, -34, 169, 170, -39, -39, -156,
1961 -156, -156, -156, 217, -156, 220, -156, 221, 231, -156,
1962 -156, -156, -156, -156, -156, -156, -156, -156, -156, -156,
1963 -156, -156, -156, -156, 147, 150, 173, 10, 174, 2,
1964 3, 5, 6, 7, 14, 23, -156, -156, -156, -156,
1965 -156, 222, -156, 223, -156, -156, 234, 187, -156, 225,
1966 226, 227, 228, 229, 230, 232, 233, -156, 186, 156,
1967 156, 156, 156, -156, -156, -156, -156, -156, -156, -156,
1968 235, 236, 237, 238, 239, 240, 241, 16, 4, 78,
1969 -156, 214, 181, 25, 184, 26, 11, 77, 80, 188,
1970 81, 193, 250, 245, -156, -156, -156, -156, -156, -156,
1971 246, -156, -156, -156, -17, 202, -156, 156, -156, -156,
1972 248, 249, -156, 251, 252, 253, 169, 169, -156, -156,
1973 261, -156, 265, 28, 215, 169, 169, 169, 169, 254,
1974 255, -156, -156, -156, 256, 257, 258, 260, 262, 263,
1975 264, -156, 266, 267, 268, 269, 97, 106, 155, 188,
1976 188, 188, -156, -156, -156, -156, -156, -156
1980 EvalParser::yydefact_[] =
1982 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1983 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1984 0, 0, 0, 0, 0, 0, 0, 18, 49, 19,
1985 20, 2, 4, 0, 47, 0, 0, 0, 0, 0,
1986 0, 3, 1, 0, 0, 6, 0, 0, 0, 0,
1987 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1988 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1989 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
1990 48, 50, 51, 0, 52, 0, 55, 0, 0, 56,
1991 57, 58, 59, 25, 62, 63, 64, 65, 66, 67,
1992 68, 69, 70, 26, 0, 0, 0, 0, 0, 0,
1993 0, 0, 0, 0, 0, 0, 71, 72, 27, 61,
1994 60, 0, 43, 0, 42, 7, 8, 9, 32, 0,
1995 0, 0, 0, 0, 0, 0, 0, 17, 0, 0,
1996 0, 0, 0, 35, 36, 37, 38, 39, 40, 41,
1997 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1998 75, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1999 0, 0, 0, 0, 53, 54, 10, 21, 12, 23,
2000 0, 73, 74, 28, 0, 0, 31, 0, 34, 14,
2001 45, 0, 15, 0, 0, 0, 0, 0, 77, 76,
2002 0, 78, 0, 0, 0, 0, 0, 0, 0, 0,
2003 0, 29, 30, 33, 0, 0, 0, 0, 0, 0,
2004 0, 46, 0, 0, 0, 0, 0, 0, 0, 0,
2005 0, 0, 11, 22, 13, 24, 16, 44
2009 EvalParser::yypgoto_[] =
2011 -156, -156, -156, 8, -2, -156, 203, -74, -155, 206,
2012 -156, -29, -156, -156, -156, -156, -156, -156
2016 EvalParser::yydefgoto_[] =
2018 0, 3, 31, 32, 33, 34, 83, 85, 177, 87,
2019 93, 121, 103, 118, 183, 161, 200, 202
2023 EvalParser::yytable_[] =
2025 41, 130, 44, 179, 80, 80, 143, 144, 71, 145,
2026 146, 147, 43, 45, 179, 119, 69, 70, 148, 198,
2027 42, 120, 174, 175, 178, 173, 81, 149, 82, 186,
2028 188, 189, 213, 73, 174, 175, 176, 71, 123, 72,
2029 72, 72, 72, 199, 72, 72, 72, 141, 132, 133,
2030 104, 105, 106, 72, 108, 109, 110, 111, 112, 113,
2031 114, 115, 72, 107, 72, 72, 190, 72, 72, 127,
2032 128, 233, 235, 237, 233, 235, 237, 125, 126, 94,
2033 95, 96, 97, 98, 99, 100, 191, 180, 46, 193,
2034 194, 181, 182, 49, 181, 182, 50, 192, 174, 175,
2035 1, 2, 101, 102, 89, 90, 91, 92, 79, 47,
2036 69, 70, 4, 48, 5, 174, 175, 232, 6, 7,
2037 8, 9, 209, 210, 174, 175, 234, 65, 51, 66,
2038 10, 215, 216, 217, 218, 11, 52, 162, 163, 164,
2039 165, 69, 70, 12, 13, 53, 67, 14, 68, 15,
2040 16, 17, 18, 19, 20, 21, 22, 23, 24, 35,
2041 54, 25, 26, 116, 117, 36, 37, 38, 27, 28,
2042 29, 55, 30, 174, 175, 236, 77, 10, 66, 78,
2043 56, 68, 11, 57, 138, 203, 72, 139, 58, 72,
2044 12, 13, 59, 60, 14, 61, 15, 16, 17, 18,
2045 19, 20, 21, 22, 23, 24, 174, 175, 39, 40,
2046 140, 142, 72, 72, 62, 27, 28, 29, 185, 30,
2047 72, 187, 63, 72, 64, 74, 72, 75, 76, 84,
2048 86, 88, 122, 134, 124, 137, 135, 136, 150, 151,
2049 69, 152, 153, 154, 155, 156, 160, 157, 190, 158,
2050 159, 184, 166, 167, 168, 169, 170, 171, 172, 195,
2051 196, 197, 201, 204, 205, 211, 206, 207, 208, 212,
2052 219, 220, 221, 222, 223, 214, 224, 129, 225, 0,
2053 226, 227, 131, 228, 229, 230, 231
2057 EvalParser::yycheck_[] =
2059 2, 75, 4, 158, 4, 4, 4, 4, 8, 4,
2060 4, 4, 4, 5, 169, 54, 6, 7, 4, 36,
2061 0, 60, 18, 19, 20, 9, 60, 4, 62, 4,
2062 4, 20, 4, 35, 18, 19, 20, 8, 67, 39,
2063 39, 39, 39, 60, 39, 39, 39, 37, 77, 78,
2064 52, 53, 54, 39, 56, 57, 58, 59, 60, 61,
2065 62, 63, 39, 55, 39, 39, 55, 39, 39, 71,
2066 72, 226, 227, 228, 229, 230, 231, 69, 70, 27,
2067 28, 29, 30, 31, 32, 33, 9, 9, 15, 9,
2068 9, 13, 14, 3, 13, 14, 17, 20, 18, 19,
2069 57, 58, 50, 51, 22, 23, 24, 25, 4, 15,
2070 6, 7, 3, 15, 5, 18, 19, 20, 9, 10,
2071 11, 12, 196, 197, 18, 19, 20, 15, 17, 17,
2072 21, 205, 206, 207, 208, 26, 3, 139, 140, 141,
2073 142, 6, 7, 34, 35, 3, 15, 38, 17, 40,
2074 41, 42, 43, 44, 45, 46, 47, 48, 49, 3,
2075 3, 52, 53, 50, 51, 9, 10, 11, 59, 60,
2076 61, 3, 63, 18, 19, 20, 15, 21, 17, 15,
2077 3, 17, 26, 3, 37, 187, 39, 37, 3, 39,
2078 34, 35, 3, 3, 38, 3, 40, 41, 42, 43,
2079 44, 45, 46, 47, 48, 49, 18, 19, 52, 53,
2080 37, 37, 39, 39, 3, 59, 60, 61, 37, 63,
2081 39, 37, 3, 39, 17, 15, 39, 15, 15, 60,
2082 60, 59, 56, 16, 56, 4, 16, 16, 16, 16,
2083 6, 16, 16, 16, 16, 16, 60, 17, 55, 17,
2084 17, 37, 17, 17, 17, 17, 17, 17, 17, 9,
2085 15, 15, 60, 15, 15, 4, 15, 15, 15, 4,
2086 16, 16, 16, 16, 16, 60, 16, 74, 16, -1,
2087 17, 17, 76, 17, 17, 17, 17
2091 EvalParser::yystos_[] =
2093 0, 57, 58, 65, 3, 5, 9, 10, 11, 12,
2094 21, 26, 34, 35, 38, 40, 41, 42, 43, 44,
2095 45, 46, 47, 48, 49, 52, 53, 59, 60, 61,
2096 63, 66, 67, 68, 69, 3, 9, 10, 11, 52,
2097 53, 68, 0, 67, 68, 67, 15, 15, 15, 3,
2098 17, 17, 3, 3, 3, 3, 3, 3, 3, 3,
2099 3, 3, 3, 3, 17, 15, 17, 15, 17, 6,
2100 7, 8, 39, 68, 15, 15, 15, 15, 15, 4,
2101 4, 60, 62, 70, 60, 71, 60, 73, 59, 22,
2102 23, 24, 25, 74, 27, 28, 29, 30, 31, 32,
2103 33, 50, 51, 76, 68, 68, 68, 67, 68, 68,
2104 68, 68, 68, 68, 68, 68, 50, 51, 77, 54,
2105 60, 75, 56, 75, 56, 67, 67, 68, 68, 70,
2106 71, 73, 75, 75, 16, 16, 16, 4, 37, 37,
2107 37, 37, 37, 4, 4, 4, 4, 4, 4, 4,
2108 16, 16, 16, 16, 16, 16, 16, 17, 17, 17,
2109 60, 79, 68, 68, 68, 68, 17, 17, 17, 17,
2110 17, 17, 17, 9, 18, 19, 20, 72, 20, 72,
2111 9, 13, 14, 78, 37, 37, 4, 37, 4, 20,
2112 55, 9, 20, 9, 9, 9, 15, 15, 36, 60,
2113 80, 60, 81, 68, 15, 15, 15, 15, 15, 71,
2114 71, 4, 4, 4, 60, 71, 71, 71, 71, 16,
2115 16, 16, 16, 16, 16, 16, 17, 17, 17, 17,
2116 17, 17, 20, 72, 20, 72, 20, 72
2120 EvalParser::yyr1_[] =
2122 0, 64, 65, 65, 66, 67, 67, 67, 67, 67,
2123 67, 67, 67, 67, 67, 67, 67, 67, 68, 68,
2124 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
2125 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
2126 68, 68, 68, 68, 68, 68, 68, 68, 68, 69,
2127 70, 70, 71, 72, 72, 73, 74, 74, 74, 74,
2128 75, 75, 76, 76, 76, 76, 76, 76, 76, 76,
2129 76, 77, 77, 78, 78, 79, 80, 80, 81
2133 EvalParser::yyr2_[] =
2135 0, 2, 2, 2, 1, 3, 2, 3, 3, 3,
2136 6, 11, 6, 11, 6, 6, 11, 4, 1, 1,
2137 1, 6, 11, 6, 11, 3, 3, 3, 6, 8,
2138 8, 6, 3, 8, 6, 4, 4, 4, 4, 4,
2139 4, 4, 3, 3, 11, 6, 9, 1, 3, 1,
2140 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2141 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2142 1, 1, 1, 1, 1, 1, 1, 1, 1
2150 const EvalParser::yytname_[] =
2152 "\"end of file\"",
"error",
"\"invalid token\"",
"\"(\"",
"\")\"",
2153 "\"not\"",
"\"and\"",
"\"or\"",
"\"==\"",
"\"option\"",
"\"relay4\"",
2154 "\"relay6\"",
"\"member\"",
"\"peeraddr\"",
"\"linkaddr\"",
"\"[\"",
2155 "\"]\"",
"\".\"",
"\"text\"",
"\"hex\"",
"\"exists\"",
"\"pkt\"",
2156 "\"iface\"",
"\"src\"",
"\"dst\"",
"\"len\"",
"\"pkt4\"",
"\"mac\"",
2157 "\"hlen\"",
"\"htype\"",
"\"ciaddr\"",
"\"giaddr\"",
"\"yiaddr\"",
2158 "\"siaddr\"",
"\"substring\"",
"\"split\"",
"\"all\"",
"\",\"",
2159 "\"concat\"",
"\"+\"",
"\"ifelse\"",
"\"hexstring\"",
"\"addrtotext\"",
2160 "\"int8totext\"",
"\"int16totext\"",
"\"int32totext\"",
2161 "\"uint8totext\"",
"\"uint16totext\"",
"\"uint32totext\"",
"\"pkt6\"",
2162 "\"msgtype\"",
"\"transid\"",
"\"vendor-class\"",
"\"vendor\"",
"\"*\"",
2163 "\"data\"",
"\"enterprise\"",
"\"top-level bool\"",
2164 "\"top-level string\"",
"\"constant string\"",
"\"integer\"",
2165 "\"constant hexstring\"",
"\"option name\"",
"\"ip address\"",
"$accept",
2166 "start",
"expression",
"bool_expr",
"string_expr",
"integer_expr",
2167 "option_code",
"sub_option_code",
"option_repr_type",
"nest_level",
2168 "pkt_metadata",
"enterprise_id",
"pkt4_field",
"pkt6_field",
2169 "relay6_field",
"start_expr",
"length_expr",
"int_expr", YY_NULLPTR
2176 EvalParser::yyrline_[] =
2178 0, 136, 136, 137, 142, 145, 146, 151, 156, 161,
2179 166, 171, 176, 196, 210, 219, 228, 238, 255, 260,
2180 265, 270, 275, 280, 301, 316, 321, 335, 349, 364,
2181 369, 374, 379, 384, 389, 394, 399, 404, 409, 414,
2182 419, 424, 429, 438, 448, 457, 470, 483, 488, 491,
2183 497, 501, 507, 513, 517, 523, 532, 536, 540, 544,
2184 550, 554, 560, 564, 568, 572, 576, 580, 584, 588,
2185 592, 598, 602, 608, 612, 618, 625, 630, 636
2189 EvalParser::yy_stack_print_ ()
const
2191 *yycdebug_ <<
"Stack now";
2192 for (stack_type::const_iterator
2193 i = yystack_.begin (),
2194 i_end = yystack_.end ();
2196 *yycdebug_ <<
' ' << int (i->state);
2201 EvalParser::yy_reduce_print_ (
int yyrule)
const
2203 int yylno = yyrline_[yyrule];
2204 int yynrhs = yyr2_[yyrule];
2206 *yycdebug_ <<
"Reducing stack by rule " << yyrule - 1
2207 <<
" (line " << yylno <<
"):\n";
2209 for (
int yyi = 0; yyi < yynrhs; yyi++)
2211 yystack_[(yynrhs) - (yyi + 1)]);
2216 #line 14 "parser.yy"
2218 #line 2219 "parser.cc"
2220 #line 643 "parser.yy"
2224 const std::string& what)
2226 ctx.error(loc, what);
#define YY_CAST(Type, Val)
#define YY_MOVE_REF(Type)
Token that represents logical and operator.
Token that represents concat operator (concatenates two other tokens)
Token that represents equality operator (compares two other tokens)
Token representing a constant string in hexadecimal format.
Token that represents an alternative.
Token representing a 16 bit integer as a string.
Token representing a 32 bit integer as a string.
Token representing an 8 bit integer as a string.
Token representing an unsigned 32 bit integer.
Token representing an IP address as a string.
Token representing an IP address as a constant string.
Token that represents client class membership.
Token that represents logical negation operator.
Token that represents a value of an option.
RepresentationType
Token representation type.
Token that represents logical or operator.
Token that represents fields of a DHCPv4 packet.
FieldType
enum value that determines the field.
Token that represents fields of DHCPv6 packet.
FieldType
enum value that determines the field.
Token that represents meta data of a DHCP packet.
MetadataType
enum value that determines the field.
Represents a sub-option inserted by the DHCPv4 relay.
Token that represents a value of a field within a DHCPv6 relay encapsulation.
FieldType
enum value that determines the field.
Token that represents a value of an option within a DHCPv6 relay encapsulation.
The order where Token subtypes are declared should be:
Token that represents sub-options in DHCPv4 and DHCPv6.
Token that represents the substring operator (returns a portion of the supplied string)
Token that converts to hexadecimal string.
Token representing a 16 bit unsigned integer as a string.
Token representing a 32 bit unsigned integer as a string.
Token representing an 8 bit unsigned integer as a string.
Token that represents vendor class options in DHCPv4 and DHCPv6.
Token that represents vendor options in DHCPv4 and DHCPv6.
Evaluation context, an interface to the expression evaluation.
int8_t convertNestLevelNumber(const std::string &nest_level, const isc::eval::location &loc)
Nest level conversion.
uint16_t convertOptionCode(const std::string &option_code, const isc::eval::location &loc)
Option code conversion.
uint16_t convertOptionName(const std::string &option_name, const isc::eval::location &loc)
Option name conversion.
isc::dhcp::Expression expression
Parsed expression (output tokens are stored here)
Option::Universe getUniverse()
Returns the universe (v4 or v6)
static uint32_t convertUint32(const std::string &number, const isc::eval::location &loc)
Attempts to convert string to unsigned 32bit integer.
bool isClientClassDefined(const ClientClass &client_class)
Check if a client class is already defined.
static uint8_t convertUint8(const std::string &number, const isc::eval::location &loc)
Attempts to convert string to unsigned 8bit integer.
const symbol_type & lookahead() const YY_NOEXCEPT
int expected_tokens(symbol_kind_type yyarg[], int yyargn) const
Put in YYARG at most YYARGN of the expected tokens, and return the number of tokens stored in YYARG.
context(const EvalParser &yyparser, const symbol_type &yyla)
symbol_kind_type token() const YY_NOEXCEPT
Present a slice of the top of a stack.
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
debug_level_type debug_level() const YY_ATTRIBUTE_PURE
The current debugging level.
virtual int parse()
Parse.
int debug_level_type
Type for debugging levels.
location location_type
Symbol locations.
void set_debug_stream(std::ostream &)
Set the current debugging stream.
void set_debug_level(debug_level_type l)
Set the current debugging level.
std::ostream & debug_stream() const YY_ATTRIBUTE_PURE
The current debugging stream.
EvalParser(EvalContext &ctx_yyarg)
Build a parser object.
static const symbol_kind_type YYNTOKENS
The number of tokens.
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
static std::string symbol_name(symbol_kind_type yysymbol)
The user-facing name of the symbol whose (internal) number is YYSYMBOL.
boost::shared_ptr< Token > TokenPtr
Pointer to a single Token.
Defines the logger used by the top-level component of kea-lfc.
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YY_REDUCE_PRINT(Rule)
#define YY_SYMBOL_PRINT(Title, Symbol)
Define the isc::eval::parser class.
void move(basic_symbol &s)
Destructive move, s is emptied into this.
location_type location
The location.
bool empty() const YY_NOEXCEPT
Whether empty.
void clear() YY_NOEXCEPT
Destroy contents, and record that is empty.
"External" symbols: returned by the scanner.
Syntax errors thrown from user actions.
~syntax_error() YY_NOEXCEPT YY_NOTHROW