Kea 3.3.1
parser.h
Go to the documentation of this file.
1// A Bison parser, made by GNU Bison 3.8.2.
2
3// Skeleton interface for Bison LALR(1) parsers in C++
4
5// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
6
7// This program is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <https://www.gnu.org/licenses/>.
19
20// As a special exception, you may create a larger work that contains
21// part or all of the Bison parser skeleton and distribute that work
22// under terms of your choice, so long as that work isn't itself a
23// parser generator using the skeleton or a modified version thereof
24// as a parser skeleton. Alternatively, if you modify or redistribute
25// the parser skeleton itself, you may (at your option) remove this
26// special exception, which will cause the skeleton and the resulting
27// Bison output files to be licensed under the GNU General Public
28// License without this special exception.
29
30// This special exception was added by the Free Software Foundation in
31// version 2.2 of Bison.
32
33
38
39// C++ LALR(1) parser skeleton written by Akim Demaille.
40
41// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
42// especially those whose name start with YY_ or yy_. They are
43// private implementation details that can be changed or removed.
44
45#ifndef YY_EVAL_PARSER_H_INCLUDED
46# define YY_EVAL_PARSER_H_INCLUDED
47// "%code requires" blocks.
48#line 17 "parser.yy"
49
50#include <string>
51#include <eval/token.h>
53#include <dhcp/option.h>
54#include <boost/lexical_cast.hpp>
55
56using namespace isc::dhcp;
57using namespace isc::eval;
58
59#line 60 "parser.h"
60
61# include <cassert>
62# include <cstdlib> // std::abort
63# include <iostream>
64# include <stdexcept>
65# include <string>
66# include <vector>
67
68#if defined __cplusplus
69# define YY_CPLUSPLUS __cplusplus
70#else
71# define YY_CPLUSPLUS 199711L
72#endif
73
74// Support move semantics when possible.
75#if 201103L <= YY_CPLUSPLUS
76# define YY_MOVE std::move
77# define YY_MOVE_OR_COPY move
78# define YY_MOVE_REF(Type) Type&&
79# define YY_RVREF(Type) Type&&
80# define YY_COPY(Type) Type
81#else
82# define YY_MOVE
83# define YY_MOVE_OR_COPY copy
84# define YY_MOVE_REF(Type) Type&
85# define YY_RVREF(Type) const Type&
86# define YY_COPY(Type) const Type&
87#endif
88
89// Support noexcept when possible.
90#if 201103L <= YY_CPLUSPLUS
91# define YY_NOEXCEPT noexcept
92# define YY_NOTHROW
93#else
94# define YY_NOEXCEPT
95# define YY_NOTHROW throw ()
96#endif
97
98// Support constexpr when possible.
99#if 201703 <= YY_CPLUSPLUS
100# define YY_CONSTEXPR constexpr
101#else
102# define YY_CONSTEXPR
103#endif
104# include "location.hh"
105#include <typeinfo>
106#ifndef EVAL_ASSERT
107# include <cassert>
108# define EVAL_ASSERT assert
109#endif
110
111
112#ifndef YY_ATTRIBUTE_PURE
113# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
114# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
115# else
116# define YY_ATTRIBUTE_PURE
117# endif
118#endif
119
120#ifndef YY_ATTRIBUTE_UNUSED
121# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
122# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
123# else
124# define YY_ATTRIBUTE_UNUSED
125# endif
126#endif
127
128/* Suppress unused-variable warnings by "using" E. */
129#if ! defined lint || defined __GNUC__
130# define YY_USE(E) ((void) (E))
131#else
132# define YY_USE(E) /* empty */
133#endif
134
135/* Suppress an incorrect diagnostic about yylval being uninitialized. */
136#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
137# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
138# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
139 _Pragma ("GCC diagnostic push") \
140 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
141# else
142# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
143 _Pragma ("GCC diagnostic push") \
144 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
145 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
146# endif
147# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
148 _Pragma ("GCC diagnostic pop")
149#else
150# define YY_INITIAL_VALUE(Value) Value
151#endif
152#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
153# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
154# define YY_IGNORE_MAYBE_UNINITIALIZED_END
155#endif
156#ifndef YY_INITIAL_VALUE
157# define YY_INITIAL_VALUE(Value) /* Nothing. */
158#endif
159
160#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
161# define YY_IGNORE_USELESS_CAST_BEGIN \
162 _Pragma ("GCC diagnostic push") \
163 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
164# define YY_IGNORE_USELESS_CAST_END \
165 _Pragma ("GCC diagnostic pop")
166#endif
167#ifndef YY_IGNORE_USELESS_CAST_BEGIN
168# define YY_IGNORE_USELESS_CAST_BEGIN
169# define YY_IGNORE_USELESS_CAST_END
170#endif
171
172# ifndef YY_CAST
173# ifdef __cplusplus
174# define YY_CAST(Type, Val) static_cast<Type> (Val)
175# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
176# else
177# define YY_CAST(Type, Val) ((Type) (Val))
178# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
179# endif
180# endif
181# ifndef YY_NULLPTR
182# if defined __cplusplus
183# if 201103L <= __cplusplus
184# define YY_NULLPTR nullptr
185# else
186# define YY_NULLPTR 0
187# endif
188# else
189# define YY_NULLPTR ((void*)0)
190# endif
191# endif
192
193/* Debug traces. */
194#ifndef EVALDEBUG
195# if defined YYDEBUG
196#if YYDEBUG
197# define EVALDEBUG 1
198# else
199# define EVALDEBUG 0
200# endif
201# else /* ! defined YYDEBUG */
202# define EVALDEBUG 1
203# endif /* ! defined YYDEBUG */
204#endif /* ! defined EVALDEBUG */
205
206#line 14 "parser.yy"
207namespace isc { namespace eval {
208#line 209 "parser.h"
209
210
211
212
215 {
216 public:
217#ifdef EVALSTYPE
218# ifdef __GNUC__
219# pragma GCC message "bison: do not #define EVALSTYPE in C++, use %define api.value.type"
220# endif
221 typedef EVALSTYPE value_type;
222#else
229 {
230 public:
233
236 : yyraw_ ()
237 , yytypeid_ (YY_NULLPTR)
238 {}
239
241 template <typename T>
243 : yytypeid_ (&typeid (T))
244 {
245 EVAL_ASSERT (sizeof (T) <= size);
246 new (yyas_<T> ()) T (YY_MOVE (t));
247 }
248
249#if 201103L <= YY_CPLUSPLUS
251 value_type (const self_type&) = delete;
253 self_type& operator= (const self_type&) = delete;
254#endif
255
258 {
259 EVAL_ASSERT (!yytypeid_);
260 }
261
262# if 201103L <= YY_CPLUSPLUS
264 template <typename T, typename... U>
265 T&
266 emplace (U&&... u)
267 {
268 EVAL_ASSERT (!yytypeid_);
269 EVAL_ASSERT (sizeof (T) <= size);
270 yytypeid_ = & typeid (T);
271 return *new (yyas_<T> ()) T (std::forward <U>(u)...);
272 }
273# else
275 template <typename T>
276 T&
278 {
279 EVAL_ASSERT (!yytypeid_);
280 EVAL_ASSERT (sizeof (T) <= size);
281 yytypeid_ = & typeid (T);
282 return *new (yyas_<T> ()) T ();
283 }
284
286 template <typename T>
287 T&
288 emplace (const T& t)
289 {
290 EVAL_ASSERT (!yytypeid_);
291 EVAL_ASSERT (sizeof (T) <= size);
292 yytypeid_ = & typeid (T);
293 return *new (yyas_<T> ()) T (t);
294 }
295# endif
296
299 template <typename T>
300 T&
302 {
303 return emplace<T> ();
304 }
305
308 template <typename T>
309 T&
310 build (const T& t)
311 {
312 return emplace<T> (t);
313 }
314
316 template <typename T>
317 T&
319 {
320 EVAL_ASSERT (yytypeid_);
321 EVAL_ASSERT (*yytypeid_ == typeid (T));
322 EVAL_ASSERT (sizeof (T) <= size);
323 return *yyas_<T> ();
324 }
325
327 template <typename T>
328 const T&
330 {
331 EVAL_ASSERT (yytypeid_);
332 EVAL_ASSERT (*yytypeid_ == typeid (T));
333 EVAL_ASSERT (sizeof (T) <= size);
334 return *yyas_<T> ();
335 }
336
345 template <typename T>
346 void
348 {
349 EVAL_ASSERT (yytypeid_);
350 EVAL_ASSERT (*yytypeid_ == *that.yytypeid_);
351 std::swap (as<T> (), that.as<T> ());
352 }
353
357 template <typename T>
358 void
360 {
361# if 201103L <= YY_CPLUSPLUS
362 emplace<T> (std::move (that.as<T> ()));
363# else
364 emplace<T> ();
365 swap<T> (that);
366# endif
367 that.destroy<T> ();
368 }
369
370# if 201103L <= YY_CPLUSPLUS
372 template <typename T>
373 void
374 move (self_type&& that)
375 {
376 emplace<T> (std::move (that.as<T> ()));
377 that.destroy<T> ();
378 }
379#endif
380
382 template <typename T>
383 void
384 copy (const self_type& that)
385 {
386 emplace<T> (that.as<T> ());
387 }
388
390 template <typename T>
391 void
393 {
394 as<T> ().~T ();
395 yytypeid_ = YY_NULLPTR;
396 }
397
398 private:
399#if YY_CPLUSPLUS < 201103L
401 value_type (const self_type&);
403 self_type& operator= (const self_type&);
404#endif
405
407 template <typename T>
408 T*
409 yyas_ () YY_NOEXCEPT
410 {
411 void *yyp = yyraw_;
412 return static_cast<T*> (yyp);
413 }
414
416 template <typename T>
417 const T*
418 yyas_ () const YY_NOEXCEPT
419 {
420 const void *yyp = yyraw_;
421 return static_cast<const T*> (yyp);
422 }
423
425 union union_type
426 {
427 // option_repr_type
428 char dummy1[sizeof (TokenOption::RepresentationType)];
429
430 // pkt4_field
431 char dummy2[sizeof (TokenPkt4::FieldType)];
432
433 // pkt6_field
434 char dummy3[sizeof (TokenPkt6::FieldType)];
435
436 // pkt_metadata
437 char dummy4[sizeof (TokenPkt::MetadataType)];
438
439 // relay6_field
440 char dummy5[sizeof (TokenRelay6Field::FieldType)];
441
442 // nest_level
443 char dummy6[sizeof (int8_t)];
444
445 // relay6_option_chain
446 char dummy7[sizeof (std::pair<int8_t, std::vector<uint16_t>>)];
447
448 // vendor_option_chain
449 char dummy8[sizeof (std::pair<uint32_t, std::vector<uint16_t>>)];
450
451 // "constant string"
452 // "integer"
453 // "constant hexstring"
454 // "option name"
455 // "ip address"
456 char dummy9[sizeof (std::string)];
457
458 // option_chain
459 // relay4_option_chain
460 char dummy10[sizeof (std::vector<uint16_t>)];
461
462 // option_code
463 // sub_option_code
464 char dummy11[sizeof (uint16_t)];
465
466 // integer_expr
467 // enterprise_id
468 char dummy12[sizeof (uint32_t)];
469 };
470
472 enum { size = sizeof (union_type) };
473
475 union
476 {
478 long double yyalign_me_;
480 char yyraw_[size];
481 };
482
484 const std::type_info *yytypeid_;
485 };
486
487#endif
490
492 typedef location location_type;
493
495 struct syntax_error : std::runtime_error
496 {
497 syntax_error (const location_type& l, const std::string& m)
498 : std::runtime_error (m)
499 , location (l)
500 {}
501
503 : std::runtime_error (s.what ())
504 , location (s.location)
505 {}
506
508
510 };
511
513 struct token
514 {
516 {
518 TOKEN_END = 0, // "end of file"
519 TOKEN_EVALerror = 256, // error
520 TOKEN_EVALUNDEF = 257, // "invalid token"
521 TOKEN_LPAREN = 258, // "("
522 TOKEN_RPAREN = 259, // ")"
523 TOKEN_NOT = 260, // "not"
524 TOKEN_AND = 261, // "and"
525 TOKEN_SAND = 262, // "sand"
526 TOKEN_OR = 263, // "or"
527 TOKEN_SOR = 264, // "sor"
528 TOKEN_EQUAL = 265, // "=="
529 TOKEN_OPTION = 266, // "option"
530 TOKEN_RELAY4 = 267, // "relay4"
531 TOKEN_RELAY6 = 268, // "relay6"
532 TOKEN_MEMBER = 269, // "member"
533 TOKEN_PEERADDR = 270, // "peeraddr"
534 TOKEN_LINKADDR = 271, // "linkaddr"
535 TOKEN_LBRACKET = 272, // "["
536 TOKEN_RBRACKET = 273, // "]"
537 TOKEN_DOT = 274, // "."
538 TOKEN_TEXT = 275, // "text"
539 TOKEN_HEX = 276, // "hex"
540 TOKEN_EXISTS = 277, // "exists"
541 TOKEN_PKT = 278, // "pkt"
542 TOKEN_IFACE = 279, // "iface"
543 TOKEN_SRC = 280, // "src"
544 TOKEN_DST = 281, // "dst"
545 TOKEN_LEN = 282, // "len"
546 TOKEN_PKT4 = 283, // "pkt4"
547 TOKEN_CHADDR = 284, // "mac"
548 TOKEN_HLEN = 285, // "hlen"
549 TOKEN_HTYPE = 286, // "htype"
550 TOKEN_CIADDR = 287, // "ciaddr"
551 TOKEN_GIADDR = 288, // "giaddr"
552 TOKEN_YIADDR = 289, // "yiaddr"
553 TOKEN_SIADDR = 290, // "siaddr"
554 TOKEN_SUBSTRING = 291, // "substring"
555 TOKEN_SPLIT = 292, // "split"
556 TOKEN_ALL = 293, // "all"
557 TOKEN_COMA = 294, // ","
558 TOKEN_CONCAT = 295, // "concat"
559 TOKEN_PLUS = 296, // "+"
560 TOKEN_IFELSE = 297, // "ifelse"
561 TOKEN_SIFELSE = 298, // "sifelse"
562 TOKEN_TOHEXSTRING = 299, // "hexstring"
563 TOKEN_ADDRTOTEXT = 300, // "addrtotext"
564 TOKEN_INT8TOTEXT = 301, // "int8totext"
565 TOKEN_INT16TOTEXT = 302, // "int16totext"
566 TOKEN_INT32TOTEXT = 303, // "int32totext"
567 TOKEN_UINT8TOTEXT = 304, // "uint8totext"
568 TOKEN_UINT16TOTEXT = 305, // "uint16totext"
569 TOKEN_UINT32TOTEXT = 306, // "uint32totext"
570 TOKEN_LCASE = 307, // "lcase"
571 TOKEN_UCASE = 308, // "ucase"
572 TOKEN_PKT6 = 309, // "pkt6"
573 TOKEN_MSGTYPE = 310, // "msgtype"
574 TOKEN_TRANSID = 311, // "transid"
575 TOKEN_VENDOR_CLASS = 312, // "vendor-class"
576 TOKEN_VENDOR = 313, // "vendor"
577 TOKEN_ANY = 314, // "*"
578 TOKEN_DATA = 315, // "data"
579 TOKEN_ENTERPRISE = 316, // "enterprise"
580 TOKEN_MATCH = 317, // "match"
581 TOKEN_TOPLEVEL_BOOL = 318, // "top-level bool"
582 TOKEN_TOPLEVEL_STRING = 319, // "top-level string"
583 TOKEN_STRING = 320, // "constant string"
584 TOKEN_INTEGER = 321, // "integer"
585 TOKEN_HEXSTRING = 322, // "constant hexstring"
586 TOKEN_OPTION_NAME = 323, // "option name"
587 TOKEN_IP_ADDRESS = 324 // "ip address"
588 };
589
591 };
592
595
598
601 {
603 {
606 S_YYEOF = 0, // "end of file"
607 S_YYerror = 1, // error
608 S_YYUNDEF = 2, // "invalid token"
609 S_LPAREN = 3, // "("
610 S_RPAREN = 4, // ")"
611 S_NOT = 5, // "not"
612 S_AND = 6, // "and"
613 S_SAND = 7, // "sand"
614 S_OR = 8, // "or"
615 S_SOR = 9, // "sor"
616 S_EQUAL = 10, // "=="
617 S_OPTION = 11, // "option"
618 S_RELAY4 = 12, // "relay4"
619 S_RELAY6 = 13, // "relay6"
620 S_MEMBER = 14, // "member"
621 S_PEERADDR = 15, // "peeraddr"
622 S_LINKADDR = 16, // "linkaddr"
623 S_LBRACKET = 17, // "["
624 S_RBRACKET = 18, // "]"
625 S_DOT = 19, // "."
626 S_TEXT = 20, // "text"
627 S_HEX = 21, // "hex"
628 S_EXISTS = 22, // "exists"
629 S_PKT = 23, // "pkt"
630 S_IFACE = 24, // "iface"
631 S_SRC = 25, // "src"
632 S_DST = 26, // "dst"
633 S_LEN = 27, // "len"
634 S_PKT4 = 28, // "pkt4"
635 S_CHADDR = 29, // "mac"
636 S_HLEN = 30, // "hlen"
637 S_HTYPE = 31, // "htype"
638 S_CIADDR = 32, // "ciaddr"
639 S_GIADDR = 33, // "giaddr"
640 S_YIADDR = 34, // "yiaddr"
641 S_SIADDR = 35, // "siaddr"
642 S_SUBSTRING = 36, // "substring"
643 S_SPLIT = 37, // "split"
644 S_ALL = 38, // "all"
645 S_COMA = 39, // ","
646 S_CONCAT = 40, // "concat"
647 S_PLUS = 41, // "+"
648 S_IFELSE = 42, // "ifelse"
649 S_SIFELSE = 43, // "sifelse"
650 S_TOHEXSTRING = 44, // "hexstring"
651 S_ADDRTOTEXT = 45, // "addrtotext"
652 S_INT8TOTEXT = 46, // "int8totext"
653 S_INT16TOTEXT = 47, // "int16totext"
654 S_INT32TOTEXT = 48, // "int32totext"
655 S_UINT8TOTEXT = 49, // "uint8totext"
656 S_UINT16TOTEXT = 50, // "uint16totext"
657 S_UINT32TOTEXT = 51, // "uint32totext"
658 S_LCASE = 52, // "lcase"
659 S_UCASE = 53, // "ucase"
660 S_PKT6 = 54, // "pkt6"
661 S_MSGTYPE = 55, // "msgtype"
662 S_TRANSID = 56, // "transid"
663 S_VENDOR_CLASS = 57, // "vendor-class"
664 S_VENDOR = 58, // "vendor"
665 S_ANY = 59, // "*"
666 S_DATA = 60, // "data"
667 S_ENTERPRISE = 61, // "enterprise"
668 S_MATCH = 62, // "match"
669 S_TOPLEVEL_BOOL = 63, // "top-level bool"
670 S_TOPLEVEL_STRING = 64, // "top-level string"
671 S_STRING = 65, // "constant string"
672 S_INTEGER = 66, // "integer"
673 S_HEXSTRING = 67, // "constant hexstring"
674 S_OPTION_NAME = 68, // "option name"
675 S_IP_ADDRESS = 69, // "ip address"
676 S_YYACCEPT = 70, // $accept
677 S_start = 71, // start
678 S_expression = 72, // expression
679 S_option_chain = 73, // option_chain
680 S_relay4_option_chain = 74, // relay4_option_chain
681 S_relay6_option_chain = 75, // relay6_option_chain
682 S_vendor_option_chain = 76, // vendor_option_chain
683 S_bool_expr = 77, // bool_expr
684 S_78_1 = 78, // $@1
685 S_79_2 = 79, // $@2
686 S_string_expr = 80, // string_expr
687 S_81_3 = 81, // $@3
688 S_82_4 = 82, // $@4
689 S_integer_expr = 83, // integer_expr
690 S_option_code = 84, // option_code
691 S_sub_option_code = 85, // sub_option_code
692 S_option_repr_type = 86, // option_repr_type
693 S_nest_level = 87, // nest_level
694 S_pkt_metadata = 88, // pkt_metadata
695 S_enterprise_id = 89, // enterprise_id
696 S_pkt4_field = 90, // pkt4_field
697 S_pkt6_field = 91, // pkt6_field
698 S_relay6_field = 92, // relay6_field
699 S_start_expr = 93, // start_expr
700 S_length_expr = 94, // length_expr
701 S_int_expr = 95 // int_expr
702 };
703 };
704
707
710
717 template <typename Base>
718 struct basic_symbol : Base
719 {
721 typedef Base super_type;
722
725 : value ()
726 , location ()
727 {}
728
729#if 201103L <= YY_CPLUSPLUS
732 : Base (std::move (that))
733 , value ()
734 , location (std::move (that.location))
735 {
736 switch (this->kind ())
737 {
738 case symbol_kind::S_option_repr_type: // option_repr_type
739 value.move< TokenOption::RepresentationType > (std::move (that.value));
740 break;
741
742 case symbol_kind::S_pkt4_field: // pkt4_field
743 value.move< TokenPkt4::FieldType > (std::move (that.value));
744 break;
745
746 case symbol_kind::S_pkt6_field: // pkt6_field
747 value.move< TokenPkt6::FieldType > (std::move (that.value));
748 break;
749
750 case symbol_kind::S_pkt_metadata: // pkt_metadata
751 value.move< TokenPkt::MetadataType > (std::move (that.value));
752 break;
753
754 case symbol_kind::S_relay6_field: // relay6_field
755 value.move< TokenRelay6Field::FieldType > (std::move (that.value));
756 break;
757
758 case symbol_kind::S_nest_level: // nest_level
759 value.move< int8_t > (std::move (that.value));
760 break;
761
762 case symbol_kind::S_relay6_option_chain: // relay6_option_chain
763 value.move< std::pair<int8_t, std::vector<uint16_t>> > (std::move (that.value));
764 break;
765
766 case symbol_kind::S_vendor_option_chain: // vendor_option_chain
767 value.move< std::pair<uint32_t, std::vector<uint16_t>> > (std::move (that.value));
768 break;
769
770 case symbol_kind::S_STRING: // "constant string"
771 case symbol_kind::S_INTEGER: // "integer"
772 case symbol_kind::S_HEXSTRING: // "constant hexstring"
773 case symbol_kind::S_OPTION_NAME: // "option name"
774 case symbol_kind::S_IP_ADDRESS: // "ip address"
775 value.move< std::string > (std::move (that.value));
776 break;
777
778 case symbol_kind::S_option_chain: // option_chain
779 case symbol_kind::S_relay4_option_chain: // relay4_option_chain
780 value.move< std::vector<uint16_t> > (std::move (that.value));
781 break;
782
783 case symbol_kind::S_option_code: // option_code
784 case symbol_kind::S_sub_option_code: // sub_option_code
785 value.move< uint16_t > (std::move (that.value));
786 break;
787
788 case symbol_kind::S_integer_expr: // integer_expr
789 case symbol_kind::S_enterprise_id: // enterprise_id
790 value.move< uint32_t > (std::move (that.value));
791 break;
792
793 default:
794 break;
795 }
796
797 }
798#endif
799
802
804#if 201103L <= YY_CPLUSPLUS
805 basic_symbol (typename Base::kind_type t, location_type&& l)
806 : Base (t)
807 , location (std::move (l))
808 {}
809#else
810 basic_symbol (typename Base::kind_type t, const location_type& l)
811 : Base (t)
812 , location (l)
813 {}
814#endif
815
816#if 201103L <= YY_CPLUSPLUS
817 basic_symbol (typename Base::kind_type t, TokenOption::RepresentationType&& v, location_type&& l)
818 : Base (t)
819 , value (std::move (v))
820 , location (std::move (l))
821 {}
822#else
823 basic_symbol (typename Base::kind_type t, const TokenOption::RepresentationType& v, const location_type& l)
824 : Base (t)
825 , value (v)
826 , location (l)
827 {}
828#endif
829
830#if 201103L <= YY_CPLUSPLUS
831 basic_symbol (typename Base::kind_type t, TokenPkt4::FieldType&& v, location_type&& l)
832 : Base (t)
833 , value (std::move (v))
834 , location (std::move (l))
835 {}
836#else
837 basic_symbol (typename Base::kind_type t, const TokenPkt4::FieldType& v, const location_type& l)
838 : Base (t)
839 , value (v)
840 , location (l)
841 {}
842#endif
843
844#if 201103L <= YY_CPLUSPLUS
845 basic_symbol (typename Base::kind_type t, TokenPkt6::FieldType&& v, location_type&& l)
846 : Base (t)
847 , value (std::move (v))
848 , location (std::move (l))
849 {}
850#else
851 basic_symbol (typename Base::kind_type t, const TokenPkt6::FieldType& v, const location_type& l)
852 : Base (t)
853 , value (v)
854 , location (l)
855 {}
856#endif
857
858#if 201103L <= YY_CPLUSPLUS
859 basic_symbol (typename Base::kind_type t, TokenPkt::MetadataType&& v, location_type&& l)
860 : Base (t)
861 , value (std::move (v))
862 , location (std::move (l))
863 {}
864#else
865 basic_symbol (typename Base::kind_type t, const TokenPkt::MetadataType& v, const location_type& l)
866 : Base (t)
867 , value (v)
868 , location (l)
869 {}
870#endif
871
872#if 201103L <= YY_CPLUSPLUS
873 basic_symbol (typename Base::kind_type t, TokenRelay6Field::FieldType&& v, location_type&& l)
874 : Base (t)
875 , value (std::move (v))
876 , location (std::move (l))
877 {}
878#else
879 basic_symbol (typename Base::kind_type t, const TokenRelay6Field::FieldType& v, const location_type& l)
880 : Base (t)
881 , value (v)
882 , location (l)
883 {}
884#endif
885
886#if 201103L <= YY_CPLUSPLUS
887 basic_symbol (typename Base::kind_type t, int8_t&& v, location_type&& l)
888 : Base (t)
889 , value (std::move (v))
890 , location (std::move (l))
891 {}
892#else
893 basic_symbol (typename Base::kind_type t, const int8_t& v, const location_type& l)
894 : Base (t)
895 , value (v)
896 , location (l)
897 {}
898#endif
899
900#if 201103L <= YY_CPLUSPLUS
901 basic_symbol (typename Base::kind_type t, std::pair<int8_t, std::vector<uint16_t>>&& v, location_type&& l)
902 : Base (t)
903 , value (std::move (v))
904 , location (std::move (l))
905 {}
906#else
907 basic_symbol (typename Base::kind_type t, const std::pair<int8_t, std::vector<uint16_t>>& v, const location_type& l)
908 : Base (t)
909 , value (v)
910 , location (l)
911 {}
912#endif
913
914#if 201103L <= YY_CPLUSPLUS
915 basic_symbol (typename Base::kind_type t, std::pair<uint32_t, std::vector<uint16_t>>&& v, location_type&& l)
916 : Base (t)
917 , value (std::move (v))
918 , location (std::move (l))
919 {}
920#else
921 basic_symbol (typename Base::kind_type t, const std::pair<uint32_t, std::vector<uint16_t>>& v, const location_type& l)
922 : Base (t)
923 , value (v)
924 , location (l)
925 {}
926#endif
927
928#if 201103L <= YY_CPLUSPLUS
929 basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l)
930 : Base (t)
931 , value (std::move (v))
932 , location (std::move (l))
933 {}
934#else
935 basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
936 : Base (t)
937 , value (v)
938 , location (l)
939 {}
940#endif
941
942#if 201103L <= YY_CPLUSPLUS
943 basic_symbol (typename Base::kind_type t, std::vector<uint16_t>&& v, location_type&& l)
944 : Base (t)
945 , value (std::move (v))
946 , location (std::move (l))
947 {}
948#else
949 basic_symbol (typename Base::kind_type t, const std::vector<uint16_t>& v, const location_type& l)
950 : Base (t)
951 , value (v)
952 , location (l)
953 {}
954#endif
955
956#if 201103L <= YY_CPLUSPLUS
957 basic_symbol (typename Base::kind_type t, uint16_t&& v, location_type&& l)
958 : Base (t)
959 , value (std::move (v))
960 , location (std::move (l))
961 {}
962#else
963 basic_symbol (typename Base::kind_type t, const uint16_t& v, const location_type& l)
964 : Base (t)
965 , value (v)
966 , location (l)
967 {}
968#endif
969
970#if 201103L <= YY_CPLUSPLUS
971 basic_symbol (typename Base::kind_type t, uint32_t&& v, location_type&& l)
972 : Base (t)
973 , value (std::move (v))
974 , location (std::move (l))
975 {}
976#else
977 basic_symbol (typename Base::kind_type t, const uint32_t& v, const location_type& l)
978 : Base (t)
979 , value (v)
980 , location (l)
981 {}
982#endif
983
986 {
987 clear ();
988 }
989
990
991
994 {
995 // User destructor.
996 symbol_kind_type yykind = this->kind ();
997 basic_symbol<Base>& yysym = *this;
998 (void) yysym;
999 switch (yykind)
1000 {
1001 default:
1002 break;
1003 }
1004
1005 // Value type destructor.
1006switch (yykind)
1007 {
1008 case symbol_kind::S_option_repr_type: // option_repr_type
1009 value.template destroy< TokenOption::RepresentationType > ();
1010 break;
1011
1012 case symbol_kind::S_pkt4_field: // pkt4_field
1013 value.template destroy< TokenPkt4::FieldType > ();
1014 break;
1015
1016 case symbol_kind::S_pkt6_field: // pkt6_field
1017 value.template destroy< TokenPkt6::FieldType > ();
1018 break;
1019
1020 case symbol_kind::S_pkt_metadata: // pkt_metadata
1021 value.template destroy< TokenPkt::MetadataType > ();
1022 break;
1023
1024 case symbol_kind::S_relay6_field: // relay6_field
1025 value.template destroy< TokenRelay6Field::FieldType > ();
1026 break;
1027
1028 case symbol_kind::S_nest_level: // nest_level
1029 value.template destroy< int8_t > ();
1030 break;
1031
1032 case symbol_kind::S_relay6_option_chain: // relay6_option_chain
1033 value.template destroy< std::pair<int8_t, std::vector<uint16_t>> > ();
1034 break;
1035
1036 case symbol_kind::S_vendor_option_chain: // vendor_option_chain
1037 value.template destroy< std::pair<uint32_t, std::vector<uint16_t>> > ();
1038 break;
1039
1040 case symbol_kind::S_STRING: // "constant string"
1041 case symbol_kind::S_INTEGER: // "integer"
1042 case symbol_kind::S_HEXSTRING: // "constant hexstring"
1043 case symbol_kind::S_OPTION_NAME: // "option name"
1044 case symbol_kind::S_IP_ADDRESS: // "ip address"
1045 value.template destroy< std::string > ();
1046 break;
1047
1048 case symbol_kind::S_option_chain: // option_chain
1049 case symbol_kind::S_relay4_option_chain: // relay4_option_chain
1050 value.template destroy< std::vector<uint16_t> > ();
1051 break;
1052
1053 case symbol_kind::S_option_code: // option_code
1054 case symbol_kind::S_sub_option_code: // sub_option_code
1055 value.template destroy< uint16_t > ();
1056 break;
1057
1058 case symbol_kind::S_integer_expr: // integer_expr
1059 case symbol_kind::S_enterprise_id: // enterprise_id
1060 value.template destroy< uint32_t > ();
1061 break;
1062
1063 default:
1064 break;
1065 }
1066
1067 Base::clear ();
1068 }
1069
1071 std::string name () const YY_NOEXCEPT
1072 {
1073 return EvalParser::symbol_name (this->kind ());
1074 }
1075
1078
1080 bool empty () const YY_NOEXCEPT;
1081
1084
1087
1090
1091 private:
1092#if YY_CPLUSPLUS < 201103L
1094 basic_symbol& operator= (const basic_symbol& that);
1095#endif
1096 };
1097
1099 struct by_kind
1100 {
1103
1106
1107#if 201103L <= YY_CPLUSPLUS
1109 by_kind (by_kind&& that) YY_NOEXCEPT;
1110#endif
1111
1113 by_kind (const by_kind& that) YY_NOEXCEPT;
1114
1117
1118
1119
1121 void clear () YY_NOEXCEPT;
1122
1124 void move (by_kind& that);
1125
1129
1132
1136 };
1137
1140
1143 {
1146
1149
1151#if 201103L <= YY_CPLUSPLUS
1152 symbol_type (int tok, location_type l)
1153 : super_type (token_kind_type (tok), std::move (l))
1154#else
1155 symbol_type (int tok, const location_type& l)
1156 : super_type (token_kind_type (tok), l)
1157#endif
1158 {
1159#if !defined _MSC_VER || defined __clang__
1162#endif
1163 }
1164#if 201103L <= YY_CPLUSPLUS
1165 symbol_type (int tok, std::string v, location_type l)
1166 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1167#else
1168 symbol_type (int tok, const std::string& v, const location_type& l)
1169 : super_type (token_kind_type (tok), v, l)
1170#endif
1171 {
1172#if !defined _MSC_VER || defined __clang__
1174#endif
1175 }
1176 };
1177
1179 EvalParser (EvalContext& ctx_yyarg);
1180 virtual ~EvalParser ();
1181
1182#if 201103L <= YY_CPLUSPLUS
1184 EvalParser (const EvalParser&) = delete;
1186 EvalParser& operator= (const EvalParser&) = delete;
1187#endif
1188
1191 int operator() ();
1192
1195 virtual int parse ();
1196
1197#if EVALDEBUG
1199 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
1201 void set_debug_stream (std::ostream &);
1202
1204 typedef int debug_level_type;
1206 debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
1208 void set_debug_level (debug_level_type l);
1209#endif
1210
1214 virtual void error (const location_type& loc, const std::string& msg);
1215
1217 void error (const syntax_error& err);
1218
1221 static std::string symbol_name (symbol_kind_type yysymbol);
1222
1223 // Implementation of make_symbol for each token kind.
1224#if 201103L <= YY_CPLUSPLUS
1225 static
1226 symbol_type
1227 make_END (location_type l)
1228 {
1229 return symbol_type (token::TOKEN_END, std::move (l));
1230 }
1231#else
1232 static
1233 symbol_type
1235 {
1236 return symbol_type (token::TOKEN_END, l);
1237 }
1238#endif
1239#if 201103L <= YY_CPLUSPLUS
1240 static
1241 symbol_type
1242 make_EVALerror (location_type l)
1243 {
1244 return symbol_type (token::TOKEN_EVALerror, std::move (l));
1245 }
1246#else
1247 static
1248 symbol_type
1250 {
1252 }
1253#endif
1254#if 201103L <= YY_CPLUSPLUS
1255 static
1256 symbol_type
1257 make_EVALUNDEF (location_type l)
1258 {
1259 return symbol_type (token::TOKEN_EVALUNDEF, std::move (l));
1260 }
1261#else
1262 static
1263 symbol_type
1265 {
1267 }
1268#endif
1269#if 201103L <= YY_CPLUSPLUS
1270 static
1271 symbol_type
1272 make_LPAREN (location_type l)
1273 {
1274 return symbol_type (token::TOKEN_LPAREN, std::move (l));
1275 }
1276#else
1277 static
1278 symbol_type
1280 {
1281 return symbol_type (token::TOKEN_LPAREN, l);
1282 }
1283#endif
1284#if 201103L <= YY_CPLUSPLUS
1285 static
1286 symbol_type
1287 make_RPAREN (location_type l)
1288 {
1289 return symbol_type (token::TOKEN_RPAREN, std::move (l));
1290 }
1291#else
1292 static
1293 symbol_type
1295 {
1296 return symbol_type (token::TOKEN_RPAREN, l);
1297 }
1298#endif
1299#if 201103L <= YY_CPLUSPLUS
1300 static
1301 symbol_type
1302 make_NOT (location_type l)
1303 {
1304 return symbol_type (token::TOKEN_NOT, std::move (l));
1305 }
1306#else
1307 static
1308 symbol_type
1310 {
1311 return symbol_type (token::TOKEN_NOT, l);
1312 }
1313#endif
1314#if 201103L <= YY_CPLUSPLUS
1315 static
1316 symbol_type
1317 make_AND (location_type l)
1318 {
1319 return symbol_type (token::TOKEN_AND, std::move (l));
1320 }
1321#else
1322 static
1323 symbol_type
1325 {
1326 return symbol_type (token::TOKEN_AND, l);
1327 }
1328#endif
1329#if 201103L <= YY_CPLUSPLUS
1330 static
1331 symbol_type
1332 make_SAND (location_type l)
1333 {
1334 return symbol_type (token::TOKEN_SAND, std::move (l));
1335 }
1336#else
1337 static
1338 symbol_type
1340 {
1341 return symbol_type (token::TOKEN_SAND, l);
1342 }
1343#endif
1344#if 201103L <= YY_CPLUSPLUS
1345 static
1346 symbol_type
1347 make_OR (location_type l)
1348 {
1349 return symbol_type (token::TOKEN_OR, std::move (l));
1350 }
1351#else
1352 static
1353 symbol_type
1355 {
1356 return symbol_type (token::TOKEN_OR, l);
1357 }
1358#endif
1359#if 201103L <= YY_CPLUSPLUS
1360 static
1361 symbol_type
1362 make_SOR (location_type l)
1363 {
1364 return symbol_type (token::TOKEN_SOR, std::move (l));
1365 }
1366#else
1367 static
1368 symbol_type
1370 {
1371 return symbol_type (token::TOKEN_SOR, l);
1372 }
1373#endif
1374#if 201103L <= YY_CPLUSPLUS
1375 static
1376 symbol_type
1377 make_EQUAL (location_type l)
1378 {
1379 return symbol_type (token::TOKEN_EQUAL, std::move (l));
1380 }
1381#else
1382 static
1383 symbol_type
1385 {
1386 return symbol_type (token::TOKEN_EQUAL, l);
1387 }
1388#endif
1389#if 201103L <= YY_CPLUSPLUS
1390 static
1391 symbol_type
1392 make_OPTION (location_type l)
1393 {
1394 return symbol_type (token::TOKEN_OPTION, std::move (l));
1395 }
1396#else
1397 static
1398 symbol_type
1400 {
1401 return symbol_type (token::TOKEN_OPTION, l);
1402 }
1403#endif
1404#if 201103L <= YY_CPLUSPLUS
1405 static
1406 symbol_type
1407 make_RELAY4 (location_type l)
1408 {
1409 return symbol_type (token::TOKEN_RELAY4, std::move (l));
1410 }
1411#else
1412 static
1413 symbol_type
1415 {
1416 return symbol_type (token::TOKEN_RELAY4, l);
1417 }
1418#endif
1419#if 201103L <= YY_CPLUSPLUS
1420 static
1421 symbol_type
1422 make_RELAY6 (location_type l)
1423 {
1424 return symbol_type (token::TOKEN_RELAY6, std::move (l));
1425 }
1426#else
1427 static
1428 symbol_type
1430 {
1431 return symbol_type (token::TOKEN_RELAY6, l);
1432 }
1433#endif
1434#if 201103L <= YY_CPLUSPLUS
1435 static
1436 symbol_type
1437 make_MEMBER (location_type l)
1438 {
1439 return symbol_type (token::TOKEN_MEMBER, std::move (l));
1440 }
1441#else
1442 static
1443 symbol_type
1445 {
1446 return symbol_type (token::TOKEN_MEMBER, l);
1447 }
1448#endif
1449#if 201103L <= YY_CPLUSPLUS
1450 static
1451 symbol_type
1452 make_PEERADDR (location_type l)
1453 {
1454 return symbol_type (token::TOKEN_PEERADDR, std::move (l));
1455 }
1456#else
1457 static
1458 symbol_type
1460 {
1462 }
1463#endif
1464#if 201103L <= YY_CPLUSPLUS
1465 static
1466 symbol_type
1467 make_LINKADDR (location_type l)
1468 {
1469 return symbol_type (token::TOKEN_LINKADDR, std::move (l));
1470 }
1471#else
1472 static
1473 symbol_type
1475 {
1477 }
1478#endif
1479#if 201103L <= YY_CPLUSPLUS
1480 static
1481 symbol_type
1482 make_LBRACKET (location_type l)
1483 {
1484 return symbol_type (token::TOKEN_LBRACKET, std::move (l));
1485 }
1486#else
1487 static
1488 symbol_type
1490 {
1492 }
1493#endif
1494#if 201103L <= YY_CPLUSPLUS
1495 static
1496 symbol_type
1497 make_RBRACKET (location_type l)
1498 {
1499 return symbol_type (token::TOKEN_RBRACKET, std::move (l));
1500 }
1501#else
1502 static
1503 symbol_type
1505 {
1507 }
1508#endif
1509#if 201103L <= YY_CPLUSPLUS
1510 static
1511 symbol_type
1512 make_DOT (location_type l)
1513 {
1514 return symbol_type (token::TOKEN_DOT, std::move (l));
1515 }
1516#else
1517 static
1518 symbol_type
1520 {
1521 return symbol_type (token::TOKEN_DOT, l);
1522 }
1523#endif
1524#if 201103L <= YY_CPLUSPLUS
1525 static
1526 symbol_type
1527 make_TEXT (location_type l)
1528 {
1529 return symbol_type (token::TOKEN_TEXT, std::move (l));
1530 }
1531#else
1532 static
1533 symbol_type
1535 {
1536 return symbol_type (token::TOKEN_TEXT, l);
1537 }
1538#endif
1539#if 201103L <= YY_CPLUSPLUS
1540 static
1541 symbol_type
1542 make_HEX (location_type l)
1543 {
1544 return symbol_type (token::TOKEN_HEX, std::move (l));
1545 }
1546#else
1547 static
1548 symbol_type
1550 {
1551 return symbol_type (token::TOKEN_HEX, l);
1552 }
1553#endif
1554#if 201103L <= YY_CPLUSPLUS
1555 static
1556 symbol_type
1557 make_EXISTS (location_type l)
1558 {
1559 return symbol_type (token::TOKEN_EXISTS, std::move (l));
1560 }
1561#else
1562 static
1563 symbol_type
1565 {
1566 return symbol_type (token::TOKEN_EXISTS, l);
1567 }
1568#endif
1569#if 201103L <= YY_CPLUSPLUS
1570 static
1571 symbol_type
1572 make_PKT (location_type l)
1573 {
1574 return symbol_type (token::TOKEN_PKT, std::move (l));
1575 }
1576#else
1577 static
1578 symbol_type
1580 {
1581 return symbol_type (token::TOKEN_PKT, l);
1582 }
1583#endif
1584#if 201103L <= YY_CPLUSPLUS
1585 static
1586 symbol_type
1587 make_IFACE (location_type l)
1588 {
1589 return symbol_type (token::TOKEN_IFACE, std::move (l));
1590 }
1591#else
1592 static
1593 symbol_type
1595 {
1596 return symbol_type (token::TOKEN_IFACE, l);
1597 }
1598#endif
1599#if 201103L <= YY_CPLUSPLUS
1600 static
1601 symbol_type
1602 make_SRC (location_type l)
1603 {
1604 return symbol_type (token::TOKEN_SRC, std::move (l));
1605 }
1606#else
1607 static
1608 symbol_type
1610 {
1611 return symbol_type (token::TOKEN_SRC, l);
1612 }
1613#endif
1614#if 201103L <= YY_CPLUSPLUS
1615 static
1616 symbol_type
1617 make_DST (location_type l)
1618 {
1619 return symbol_type (token::TOKEN_DST, std::move (l));
1620 }
1621#else
1622 static
1623 symbol_type
1625 {
1626 return symbol_type (token::TOKEN_DST, l);
1627 }
1628#endif
1629#if 201103L <= YY_CPLUSPLUS
1630 static
1631 symbol_type
1632 make_LEN (location_type l)
1633 {
1634 return symbol_type (token::TOKEN_LEN, std::move (l));
1635 }
1636#else
1637 static
1638 symbol_type
1640 {
1641 return symbol_type (token::TOKEN_LEN, l);
1642 }
1643#endif
1644#if 201103L <= YY_CPLUSPLUS
1645 static
1646 symbol_type
1647 make_PKT4 (location_type l)
1648 {
1649 return symbol_type (token::TOKEN_PKT4, std::move (l));
1650 }
1651#else
1652 static
1653 symbol_type
1655 {
1656 return symbol_type (token::TOKEN_PKT4, l);
1657 }
1658#endif
1659#if 201103L <= YY_CPLUSPLUS
1660 static
1661 symbol_type
1662 make_CHADDR (location_type l)
1663 {
1664 return symbol_type (token::TOKEN_CHADDR, std::move (l));
1665 }
1666#else
1667 static
1668 symbol_type
1670 {
1671 return symbol_type (token::TOKEN_CHADDR, l);
1672 }
1673#endif
1674#if 201103L <= YY_CPLUSPLUS
1675 static
1676 symbol_type
1677 make_HLEN (location_type l)
1678 {
1679 return symbol_type (token::TOKEN_HLEN, std::move (l));
1680 }
1681#else
1682 static
1683 symbol_type
1685 {
1686 return symbol_type (token::TOKEN_HLEN, l);
1687 }
1688#endif
1689#if 201103L <= YY_CPLUSPLUS
1690 static
1691 symbol_type
1692 make_HTYPE (location_type l)
1693 {
1694 return symbol_type (token::TOKEN_HTYPE, std::move (l));
1695 }
1696#else
1697 static
1698 symbol_type
1700 {
1701 return symbol_type (token::TOKEN_HTYPE, l);
1702 }
1703#endif
1704#if 201103L <= YY_CPLUSPLUS
1705 static
1706 symbol_type
1707 make_CIADDR (location_type l)
1708 {
1709 return symbol_type (token::TOKEN_CIADDR, std::move (l));
1710 }
1711#else
1712 static
1713 symbol_type
1715 {
1716 return symbol_type (token::TOKEN_CIADDR, l);
1717 }
1718#endif
1719#if 201103L <= YY_CPLUSPLUS
1720 static
1721 symbol_type
1722 make_GIADDR (location_type l)
1723 {
1724 return symbol_type (token::TOKEN_GIADDR, std::move (l));
1725 }
1726#else
1727 static
1728 symbol_type
1730 {
1731 return symbol_type (token::TOKEN_GIADDR, l);
1732 }
1733#endif
1734#if 201103L <= YY_CPLUSPLUS
1735 static
1736 symbol_type
1737 make_YIADDR (location_type l)
1738 {
1739 return symbol_type (token::TOKEN_YIADDR, std::move (l));
1740 }
1741#else
1742 static
1743 symbol_type
1745 {
1746 return symbol_type (token::TOKEN_YIADDR, l);
1747 }
1748#endif
1749#if 201103L <= YY_CPLUSPLUS
1750 static
1751 symbol_type
1752 make_SIADDR (location_type l)
1753 {
1754 return symbol_type (token::TOKEN_SIADDR, std::move (l));
1755 }
1756#else
1757 static
1758 symbol_type
1760 {
1761 return symbol_type (token::TOKEN_SIADDR, l);
1762 }
1763#endif
1764#if 201103L <= YY_CPLUSPLUS
1765 static
1766 symbol_type
1767 make_SUBSTRING (location_type l)
1768 {
1769 return symbol_type (token::TOKEN_SUBSTRING, std::move (l));
1770 }
1771#else
1772 static
1773 symbol_type
1775 {
1777 }
1778#endif
1779#if 201103L <= YY_CPLUSPLUS
1780 static
1781 symbol_type
1782 make_SPLIT (location_type l)
1783 {
1784 return symbol_type (token::TOKEN_SPLIT, std::move (l));
1785 }
1786#else
1787 static
1788 symbol_type
1790 {
1791 return symbol_type (token::TOKEN_SPLIT, l);
1792 }
1793#endif
1794#if 201103L <= YY_CPLUSPLUS
1795 static
1796 symbol_type
1797 make_ALL (location_type l)
1798 {
1799 return symbol_type (token::TOKEN_ALL, std::move (l));
1800 }
1801#else
1802 static
1803 symbol_type
1805 {
1806 return symbol_type (token::TOKEN_ALL, l);
1807 }
1808#endif
1809#if 201103L <= YY_CPLUSPLUS
1810 static
1811 symbol_type
1812 make_COMA (location_type l)
1813 {
1814 return symbol_type (token::TOKEN_COMA, std::move (l));
1815 }
1816#else
1817 static
1818 symbol_type
1820 {
1821 return symbol_type (token::TOKEN_COMA, l);
1822 }
1823#endif
1824#if 201103L <= YY_CPLUSPLUS
1825 static
1826 symbol_type
1827 make_CONCAT (location_type l)
1828 {
1829 return symbol_type (token::TOKEN_CONCAT, std::move (l));
1830 }
1831#else
1832 static
1833 symbol_type
1835 {
1836 return symbol_type (token::TOKEN_CONCAT, l);
1837 }
1838#endif
1839#if 201103L <= YY_CPLUSPLUS
1840 static
1841 symbol_type
1842 make_PLUS (location_type l)
1843 {
1844 return symbol_type (token::TOKEN_PLUS, std::move (l));
1845 }
1846#else
1847 static
1848 symbol_type
1850 {
1851 return symbol_type (token::TOKEN_PLUS, l);
1852 }
1853#endif
1854#if 201103L <= YY_CPLUSPLUS
1855 static
1856 symbol_type
1857 make_IFELSE (location_type l)
1858 {
1859 return symbol_type (token::TOKEN_IFELSE, std::move (l));
1860 }
1861#else
1862 static
1863 symbol_type
1865 {
1866 return symbol_type (token::TOKEN_IFELSE, l);
1867 }
1868#endif
1869#if 201103L <= YY_CPLUSPLUS
1870 static
1871 symbol_type
1872 make_SIFELSE (location_type l)
1873 {
1874 return symbol_type (token::TOKEN_SIFELSE, std::move (l));
1875 }
1876#else
1877 static
1878 symbol_type
1880 {
1882 }
1883#endif
1884#if 201103L <= YY_CPLUSPLUS
1885 static
1886 symbol_type
1887 make_TOHEXSTRING (location_type l)
1888 {
1889 return symbol_type (token::TOKEN_TOHEXSTRING, std::move (l));
1890 }
1891#else
1892 static
1893 symbol_type
1895 {
1897 }
1898#endif
1899#if 201103L <= YY_CPLUSPLUS
1900 static
1901 symbol_type
1902 make_ADDRTOTEXT (location_type l)
1903 {
1904 return symbol_type (token::TOKEN_ADDRTOTEXT, std::move (l));
1905 }
1906#else
1907 static
1908 symbol_type
1910 {
1912 }
1913#endif
1914#if 201103L <= YY_CPLUSPLUS
1915 static
1916 symbol_type
1917 make_INT8TOTEXT (location_type l)
1918 {
1919 return symbol_type (token::TOKEN_INT8TOTEXT, std::move (l));
1920 }
1921#else
1922 static
1923 symbol_type
1925 {
1927 }
1928#endif
1929#if 201103L <= YY_CPLUSPLUS
1930 static
1931 symbol_type
1932 make_INT16TOTEXT (location_type l)
1933 {
1934 return symbol_type (token::TOKEN_INT16TOTEXT, std::move (l));
1935 }
1936#else
1937 static
1938 symbol_type
1940 {
1942 }
1943#endif
1944#if 201103L <= YY_CPLUSPLUS
1945 static
1946 symbol_type
1947 make_INT32TOTEXT (location_type l)
1948 {
1949 return symbol_type (token::TOKEN_INT32TOTEXT, std::move (l));
1950 }
1951#else
1952 static
1953 symbol_type
1955 {
1957 }
1958#endif
1959#if 201103L <= YY_CPLUSPLUS
1960 static
1961 symbol_type
1962 make_UINT8TOTEXT (location_type l)
1963 {
1964 return symbol_type (token::TOKEN_UINT8TOTEXT, std::move (l));
1965 }
1966#else
1967 static
1968 symbol_type
1970 {
1972 }
1973#endif
1974#if 201103L <= YY_CPLUSPLUS
1975 static
1976 symbol_type
1977 make_UINT16TOTEXT (location_type l)
1978 {
1979 return symbol_type (token::TOKEN_UINT16TOTEXT, std::move (l));
1980 }
1981#else
1982 static
1983 symbol_type
1985 {
1987 }
1988#endif
1989#if 201103L <= YY_CPLUSPLUS
1990 static
1991 symbol_type
1992 make_UINT32TOTEXT (location_type l)
1993 {
1994 return symbol_type (token::TOKEN_UINT32TOTEXT, std::move (l));
1995 }
1996#else
1997 static
1998 symbol_type
2000 {
2002 }
2003#endif
2004#if 201103L <= YY_CPLUSPLUS
2005 static
2006 symbol_type
2007 make_LCASE (location_type l)
2008 {
2009 return symbol_type (token::TOKEN_LCASE, std::move (l));
2010 }
2011#else
2012 static
2013 symbol_type
2015 {
2016 return symbol_type (token::TOKEN_LCASE, l);
2017 }
2018#endif
2019#if 201103L <= YY_CPLUSPLUS
2020 static
2021 symbol_type
2022 make_UCASE (location_type l)
2023 {
2024 return symbol_type (token::TOKEN_UCASE, std::move (l));
2025 }
2026#else
2027 static
2028 symbol_type
2030 {
2031 return symbol_type (token::TOKEN_UCASE, l);
2032 }
2033#endif
2034#if 201103L <= YY_CPLUSPLUS
2035 static
2036 symbol_type
2037 make_PKT6 (location_type l)
2038 {
2039 return symbol_type (token::TOKEN_PKT6, std::move (l));
2040 }
2041#else
2042 static
2043 symbol_type
2045 {
2046 return symbol_type (token::TOKEN_PKT6, l);
2047 }
2048#endif
2049#if 201103L <= YY_CPLUSPLUS
2050 static
2051 symbol_type
2052 make_MSGTYPE (location_type l)
2053 {
2054 return symbol_type (token::TOKEN_MSGTYPE, std::move (l));
2055 }
2056#else
2057 static
2058 symbol_type
2060 {
2062 }
2063#endif
2064#if 201103L <= YY_CPLUSPLUS
2065 static
2066 symbol_type
2067 make_TRANSID (location_type l)
2068 {
2069 return symbol_type (token::TOKEN_TRANSID, std::move (l));
2070 }
2071#else
2072 static
2073 symbol_type
2075 {
2077 }
2078#endif
2079#if 201103L <= YY_CPLUSPLUS
2080 static
2081 symbol_type
2082 make_VENDOR_CLASS (location_type l)
2083 {
2084 return symbol_type (token::TOKEN_VENDOR_CLASS, std::move (l));
2085 }
2086#else
2087 static
2088 symbol_type
2090 {
2092 }
2093#endif
2094#if 201103L <= YY_CPLUSPLUS
2095 static
2096 symbol_type
2097 make_VENDOR (location_type l)
2098 {
2099 return symbol_type (token::TOKEN_VENDOR, std::move (l));
2100 }
2101#else
2102 static
2103 symbol_type
2105 {
2106 return symbol_type (token::TOKEN_VENDOR, l);
2107 }
2108#endif
2109#if 201103L <= YY_CPLUSPLUS
2110 static
2111 symbol_type
2112 make_ANY (location_type l)
2113 {
2114 return symbol_type (token::TOKEN_ANY, std::move (l));
2115 }
2116#else
2117 static
2118 symbol_type
2120 {
2121 return symbol_type (token::TOKEN_ANY, l);
2122 }
2123#endif
2124#if 201103L <= YY_CPLUSPLUS
2125 static
2126 symbol_type
2127 make_DATA (location_type l)
2128 {
2129 return symbol_type (token::TOKEN_DATA, std::move (l));
2130 }
2131#else
2132 static
2133 symbol_type
2135 {
2136 return symbol_type (token::TOKEN_DATA, l);
2137 }
2138#endif
2139#if 201103L <= YY_CPLUSPLUS
2140 static
2141 symbol_type
2142 make_ENTERPRISE (location_type l)
2143 {
2144 return symbol_type (token::TOKEN_ENTERPRISE, std::move (l));
2145 }
2146#else
2147 static
2148 symbol_type
2150 {
2152 }
2153#endif
2154#if 201103L <= YY_CPLUSPLUS
2155 static
2156 symbol_type
2157 make_MATCH (location_type l)
2158 {
2159 return symbol_type (token::TOKEN_MATCH, std::move (l));
2160 }
2161#else
2162 static
2163 symbol_type
2165 {
2166 return symbol_type (token::TOKEN_MATCH, l);
2167 }
2168#endif
2169#if 201103L <= YY_CPLUSPLUS
2170 static
2171 symbol_type
2172 make_TOPLEVEL_BOOL (location_type l)
2173 {
2174 return symbol_type (token::TOKEN_TOPLEVEL_BOOL, std::move (l));
2175 }
2176#else
2177 static
2178 symbol_type
2183#endif
2184#if 201103L <= YY_CPLUSPLUS
2185 static
2186 symbol_type
2187 make_TOPLEVEL_STRING (location_type l)
2188 {
2189 return symbol_type (token::TOKEN_TOPLEVEL_STRING, std::move (l));
2190 }
2191#else
2192 static
2193 symbol_type
2198#endif
2199#if 201103L <= YY_CPLUSPLUS
2200 static
2201 symbol_type
2202 make_STRING (std::string v, location_type l)
2203 {
2204 return symbol_type (token::TOKEN_STRING, std::move (v), std::move (l));
2205 }
2206#else
2207 static
2208 symbol_type
2209 make_STRING (const std::string& v, const location_type& l)
2210 {
2211 return symbol_type (token::TOKEN_STRING, v, l);
2212 }
2213#endif
2214#if 201103L <= YY_CPLUSPLUS
2215 static
2216 symbol_type
2217 make_INTEGER (std::string v, location_type l)
2218 {
2219 return symbol_type (token::TOKEN_INTEGER, std::move (v), std::move (l));
2220 }
2221#else
2222 static
2223 symbol_type
2224 make_INTEGER (const std::string& v, const location_type& l)
2225 {
2226 return symbol_type (token::TOKEN_INTEGER, v, l);
2227 }
2228#endif
2229#if 201103L <= YY_CPLUSPLUS
2230 static
2231 symbol_type
2232 make_HEXSTRING (std::string v, location_type l)
2233 {
2234 return symbol_type (token::TOKEN_HEXSTRING, std::move (v), std::move (l));
2235 }
2236#else
2237 static
2238 symbol_type
2239 make_HEXSTRING (const std::string& v, const location_type& l)
2240 {
2241 return symbol_type (token::TOKEN_HEXSTRING, v, l);
2242 }
2243#endif
2244#if 201103L <= YY_CPLUSPLUS
2245 static
2246 symbol_type
2247 make_OPTION_NAME (std::string v, location_type l)
2248 {
2249 return symbol_type (token::TOKEN_OPTION_NAME, std::move (v), std::move (l));
2250 }
2251#else
2252 static
2253 symbol_type
2254 make_OPTION_NAME (const std::string& v, const location_type& l)
2255 {
2257 }
2258#endif
2259#if 201103L <= YY_CPLUSPLUS
2260 static
2261 symbol_type
2262 make_IP_ADDRESS (std::string v, location_type l)
2263 {
2264 return symbol_type (token::TOKEN_IP_ADDRESS, std::move (v), std::move (l));
2265 }
2266#else
2267 static
2268 symbol_type
2269 make_IP_ADDRESS (const std::string& v, const location_type& l)
2270 {
2271 return symbol_type (token::TOKEN_IP_ADDRESS, v, l);
2272 }
2273#endif
2274
2275
2277 {
2278 public:
2279 context (const EvalParser& yyparser, const symbol_type& yyla);
2280 const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; }
2281 symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); }
2282 const location_type& location () const YY_NOEXCEPT { return yyla_.location; }
2283
2287 int expected_tokens (symbol_kind_type yyarg[], int yyargn) const;
2288
2289 private:
2290 const EvalParser& yyparser_;
2291 const symbol_type& yyla_;
2292 };
2293
2294 private:
2295#if YY_CPLUSPLUS < 201103L
2297 EvalParser (const EvalParser&);
2299 EvalParser& operator= (const EvalParser&);
2300#endif
2301
2302
2304 typedef short state_type;
2305
2307 int yy_syntax_error_arguments_ (const context& yyctx,
2308 symbol_kind_type yyarg[], int yyargn) const;
2309
2312 virtual std::string yysyntax_error_ (const context& yyctx) const;
2316 static state_type yy_lr_goto_state_ (state_type yystate, int yysym);
2317
2320 static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT;
2321
2324 static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT;
2325
2326 static const short yypact_ninf_;
2327 static const signed char yytable_ninf_;
2328
2332 static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT;
2333
2335 static std::string yytnamerr_ (const char *yystr);
2336
2338 static const char* const yytname_[];
2339
2340
2341 // Tables.
2342 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2343 // STATE-NUM.
2344 static const short yypact_[];
2345
2346 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
2347 // Performed when YYTABLE does not specify something else to do. Zero
2348 // means the default is an error.
2349 static const signed char yydefact_[];
2350
2351 // YYPGOTO[NTERM-NUM].
2352 static const short yypgoto_[];
2353
2354 // YYDEFGOTO[NTERM-NUM].
2355 static const unsigned char yydefgoto_[];
2356
2357 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
2358 // positive, shift that token. If negative, reduce the rule whose
2359 // number is the opposite. If YYTABLE_NINF, syntax error.
2360 static const short yytable_[];
2361
2362 static const short yycheck_[];
2363
2364 // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
2365 // state STATE-NUM.
2366 static const signed char yystos_[];
2367
2368 // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.
2369 static const signed char yyr1_[];
2370
2371 // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.
2372 static const signed char yyr2_[];
2373
2374
2375#if EVALDEBUG
2376 // YYRLINE[YYN] -- Source line where rule number YYN was defined.
2377 static const short yyrline_[];
2379 virtual void yy_reduce_print_ (int r) const;
2381 virtual void yy_stack_print_ () const;
2382
2384 int yydebug_;
2386 std::ostream* yycdebug_;
2387
2391 template <typename Base>
2392 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
2393#endif
2394
2399 template <typename Base>
2400 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
2401
2402 private:
2404 struct by_state
2405 {
2407 by_state () YY_NOEXCEPT;
2408
2410 typedef state_type kind_type;
2411
2413 by_state (kind_type s) YY_NOEXCEPT;
2414
2416 by_state (const by_state& that) YY_NOEXCEPT;
2417
2419 void clear () YY_NOEXCEPT;
2420
2422 void move (by_state& that);
2423
2426 symbol_kind_type kind () const YY_NOEXCEPT;
2427
2430 enum { empty_state = 0 };
2431
2434 state_type state;
2435 };
2436
2438 struct stack_symbol_type : basic_symbol<by_state>
2439 {
2441 typedef basic_symbol<by_state> super_type;
2443 stack_symbol_type ();
2445 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
2447 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
2448#if YY_CPLUSPLUS < 201103L
2451 stack_symbol_type& operator= (stack_symbol_type& that);
2452
2455 stack_symbol_type& operator= (const stack_symbol_type& that);
2456#endif
2457 };
2458
2460 template <typename T, typename S = std::vector<T> >
2461 class stack
2462 {
2463 public:
2464 // Hide our reversed order.
2465 typedef typename S::iterator iterator;
2466 typedef typename S::const_iterator const_iterator;
2467 typedef typename S::size_type size_type;
2468 typedef typename std::ptrdiff_t index_type;
2469
2470 stack (size_type n = 200) YY_NOEXCEPT
2471 : seq_ (n)
2472 {}
2473
2474#if 201103L <= YY_CPLUSPLUS
2476 stack (const stack&) = delete;
2478 stack& operator= (const stack&) = delete;
2479#endif
2480
2484 const T&
2485 operator[] (index_type i) const
2486 {
2487 return seq_[size_type (size () - 1 - i)];
2488 }
2489
2493 T&
2494 operator[] (index_type i)
2495 {
2496 return seq_[size_type (size () - 1 - i)];
2497 }
2498
2502 void
2503 push (YY_MOVE_REF (T) t)
2504 {
2505 seq_.push_back (T ());
2506 operator[] (0).move (t);
2507 }
2508
2510 void
2511 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
2512 {
2513 for (; 0 < n; --n)
2514 seq_.pop_back ();
2515 }
2516
2518 void
2519 clear () YY_NOEXCEPT
2520 {
2521 seq_.clear ();
2522 }
2523
2525 index_type
2526 size () const YY_NOEXCEPT
2527 {
2528 return index_type (seq_.size ());
2529 }
2530
2532 const_iterator
2533 begin () const YY_NOEXCEPT
2534 {
2535 return seq_.begin ();
2536 }
2537
2539 const_iterator
2540 end () const YY_NOEXCEPT
2541 {
2542 return seq_.end ();
2543 }
2544
2546 class slice
2547 {
2548 public:
2549 slice (const stack& stack, index_type range) YY_NOEXCEPT
2550 : stack_ (stack)
2551 , range_ (range)
2552 {}
2553
2554 const T&
2555 operator[] (index_type i) const
2556 {
2557 return stack_[range_ - i];
2558 }
2559
2560 private:
2561 const stack& stack_;
2562 index_type range_;
2563 };
2564
2565 private:
2566#if YY_CPLUSPLUS < 201103L
2568 stack (const stack&);
2570 stack& operator= (const stack&);
2571#endif
2573 S seq_;
2574 };
2575
2576
2578 typedef stack<stack_symbol_type> stack_type;
2579
2581 stack_type yystack_;
2582
2588 void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
2589
2596 void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
2597
2599 void yypop_ (int n = 1) YY_NOEXCEPT;
2600
2602 enum
2603 {
2604 yylast_ = 359,
2605 yynnts_ = 26,
2606 yyfinal_ = 51
2607 };
2608
2609
2610 // User arguments.
2611 EvalContext& ctx;
2612
2613 };
2614
2615 inline
2617 EvalParser::yytranslate_ (int t) YY_NOEXCEPT
2618 {
2619 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
2620 // TOKEN-NUM as returned by yylex.
2621 static
2622 const signed char
2623 translate_table[] =
2624 {
2625 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2650 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2651 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2652 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2653 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2654 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2655 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2656 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2657 65, 66, 67, 68, 69
2658 };
2659 // Last valid token kind.
2660 const int code_max = 324;
2661
2662 if (t <= 0)
2663 return symbol_kind::S_YYEOF;
2664 else if (t <= code_max)
2665 return static_cast <symbol_kind_type> (translate_table[t]);
2666 else
2668 }
2669
2670 // basic_symbol.
2671 template <typename Base>
2673 : Base (that)
2674 , value ()
2675 , location (that.location)
2676 {
2677 switch (this->kind ())
2678 {
2679 case symbol_kind::S_option_repr_type: // option_repr_type
2681 break;
2682
2683 case symbol_kind::S_pkt4_field: // pkt4_field
2684 value.copy< TokenPkt4::FieldType > (YY_MOVE (that.value));
2685 break;
2686
2687 case symbol_kind::S_pkt6_field: // pkt6_field
2688 value.copy< TokenPkt6::FieldType > (YY_MOVE (that.value));
2689 break;
2690
2691 case symbol_kind::S_pkt_metadata: // pkt_metadata
2692 value.copy< TokenPkt::MetadataType > (YY_MOVE (that.value));
2693 break;
2694
2695 case symbol_kind::S_relay6_field: // relay6_field
2697 break;
2698
2699 case symbol_kind::S_nest_level: // nest_level
2700 value.copy< int8_t > (YY_MOVE (that.value));
2701 break;
2702
2703 case symbol_kind::S_relay6_option_chain: // relay6_option_chain
2704 value.copy< std::pair<int8_t, std::vector<uint16_t>> > (YY_MOVE (that.value));
2705 break;
2706
2707 case symbol_kind::S_vendor_option_chain: // vendor_option_chain
2708 value.copy< std::pair<uint32_t, std::vector<uint16_t>> > (YY_MOVE (that.value));
2709 break;
2710
2711 case symbol_kind::S_STRING: // "constant string"
2712 case symbol_kind::S_INTEGER: // "integer"
2713 case symbol_kind::S_HEXSTRING: // "constant hexstring"
2714 case symbol_kind::S_OPTION_NAME: // "option name"
2715 case symbol_kind::S_IP_ADDRESS: // "ip address"
2716 value.copy< std::string > (YY_MOVE (that.value));
2717 break;
2718
2719 case symbol_kind::S_option_chain: // option_chain
2720 case symbol_kind::S_relay4_option_chain: // relay4_option_chain
2721 value.copy< std::vector<uint16_t> > (YY_MOVE (that.value));
2722 break;
2723
2724 case symbol_kind::S_option_code: // option_code
2725 case symbol_kind::S_sub_option_code: // sub_option_code
2726 value.copy< uint16_t > (YY_MOVE (that.value));
2727 break;
2728
2729 case symbol_kind::S_integer_expr: // integer_expr
2730 case symbol_kind::S_enterprise_id: // enterprise_id
2731 value.copy< uint32_t > (YY_MOVE (that.value));
2732 break;
2733
2734 default:
2735 break;
2736 }
2737
2738 }
2739
2740
2741
2742
2743 template <typename Base>
2746 {
2747 return this->kind ();
2748 }
2749
2750
2751 template <typename Base>
2752 bool
2754 {
2755 return this->kind () == symbol_kind::S_YYEMPTY;
2756 }
2757
2758 template <typename Base>
2759 void
2761 {
2762 super_type::move (s);
2763 switch (this->kind ())
2764 {
2765 case symbol_kind::S_option_repr_type: // option_repr_type
2767 break;
2768
2769 case symbol_kind::S_pkt4_field: // pkt4_field
2771 break;
2772
2773 case symbol_kind::S_pkt6_field: // pkt6_field
2775 break;
2776
2777 case symbol_kind::S_pkt_metadata: // pkt_metadata
2779 break;
2780
2781 case symbol_kind::S_relay6_field: // relay6_field
2783 break;
2784
2785 case symbol_kind::S_nest_level: // nest_level
2786 value.move< int8_t > (YY_MOVE (s.value));
2787 break;
2788
2789 case symbol_kind::S_relay6_option_chain: // relay6_option_chain
2790 value.move< std::pair<int8_t, std::vector<uint16_t>> > (YY_MOVE (s.value));
2791 break;
2792
2793 case symbol_kind::S_vendor_option_chain: // vendor_option_chain
2794 value.move< std::pair<uint32_t, std::vector<uint16_t>> > (YY_MOVE (s.value));
2795 break;
2796
2797 case symbol_kind::S_STRING: // "constant string"
2798 case symbol_kind::S_INTEGER: // "integer"
2799 case symbol_kind::S_HEXSTRING: // "constant hexstring"
2800 case symbol_kind::S_OPTION_NAME: // "option name"
2801 case symbol_kind::S_IP_ADDRESS: // "ip address"
2802 value.move< std::string > (YY_MOVE (s.value));
2803 break;
2804
2805 case symbol_kind::S_option_chain: // option_chain
2806 case symbol_kind::S_relay4_option_chain: // relay4_option_chain
2807 value.move< std::vector<uint16_t> > (YY_MOVE (s.value));
2808 break;
2809
2810 case symbol_kind::S_option_code: // option_code
2811 case symbol_kind::S_sub_option_code: // sub_option_code
2812 value.move< uint16_t > (YY_MOVE (s.value));
2813 break;
2814
2815 case symbol_kind::S_integer_expr: // integer_expr
2816 case symbol_kind::S_enterprise_id: // enterprise_id
2817 value.move< uint32_t > (YY_MOVE (s.value));
2818 break;
2819
2820 default:
2821 break;
2822 }
2823
2825 }
2826
2827 // by_kind.
2828 inline
2832
2833#if 201103L <= YY_CPLUSPLUS
2834 inline
2836 : kind_ (that.kind_)
2837 {
2838 that.clear ();
2839 }
2840#endif
2841
2842 inline
2844 : kind_ (that.kind_)
2845 {}
2846
2847 inline
2849 : kind_ (yytranslate_ (t))
2850 {}
2851
2852
2853
2854 inline
2855 void
2860
2861 inline
2862 void
2864 {
2865 kind_ = that.kind_;
2866 that.clear ();
2867 }
2868
2869 inline
2872 {
2873 return kind_;
2874 }
2875
2876
2877 inline
2880 {
2881 return this->kind ();
2882 }
2883
2884
2885#line 14 "parser.yy"
2886} } // isc::eval
2887#line 2888 "parser.h"
2888
2889
2890
2891
2892#endif // !YY_EVAL_PARSER_H_INCLUDED
RepresentationType
Token representation type.
Definition token.h:417
FieldType
enum value that determines the field.
Definition token.h:636
FieldType
enum value that determines the field.
Definition token.h:690
MetadataType
enum value that determines the field.
Definition token.h:586
FieldType
enum value that determines the field.
Definition token.h:743
Evaluation context, an interface to the expression evaluation.
const location_type & location() const YY_NOEXCEPT
Definition parser.h:2282
const symbol_type & lookahead() const YY_NOEXCEPT
Definition parser.h:2280
context(const EvalParser &yyparser, const symbol_type &yyla)
Definition parser.cc:2100
symbol_kind_type token() const YY_NOEXCEPT
Definition parser.h:2281
slice(const stack &stack, index_type range) YY_NOEXCEPT
Definition parser.h:2549
A buffer to store and retrieve objects.
Definition parser.h:229
T & emplace(const T &t)
Instantiate a T in here from t.
Definition parser.h:288
T & as() YY_NOEXCEPT
Accessor to a built T.
Definition parser.h:318
void move(self_type &that)
Move the content of that to this.
Definition parser.h:359
T & build(const T &t)
Instantiate a T in here from t.
Definition parser.h:310
value_type(YY_RVREF(T) t)
Construct and fill.
Definition parser.h:242
long double yyalign_me_
Strongest alignment constraints.
Definition parser.h:478
const T & as() const YY_NOEXCEPT
Const accessor to a built T (for printer).
Definition parser.h:329
T & build()
Instantiate an empty T in here.
Definition parser.h:301
void copy(const self_type &that)
Copy the content of that to this.
Definition parser.h:384
~value_type() YY_NOEXCEPT
Destruction, allowed only if empty.
Definition parser.h:257
void destroy()
Destroy the stored T.
Definition parser.h:392
void swap(self_type &that) YY_NOEXCEPT
Swap the content with that, of same type.
Definition parser.h:347
T & emplace()
Instantiate an empty T in here.
Definition parser.h:277
char yyraw_[size]
A buffer large enough to store any of the semantic values.
Definition parser.h:480
value_type() YY_NOEXCEPT
Empty construction.
Definition parser.h:235
value_type self_type
Type of *this.
Definition parser.h:232
A Bison parser.
Definition parser.h:215
static symbol_type make_RELAY6(const location_type &l)
Definition parser.h:1429
static symbol_type make_INT8TOTEXT(const location_type &l)
Definition parser.h:1924
static symbol_type make_CONCAT(const location_type &l)
Definition parser.h:1834
static symbol_type make_TEXT(const location_type &l)
Definition parser.h:1534
static symbol_type make_OPTION(const location_type &l)
Definition parser.h:1399
static symbol_type make_AND(const location_type &l)
Definition parser.h:1324
static symbol_type make_HTYPE(const location_type &l)
Definition parser.h:1699
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
Definition parser.h:706
static symbol_type make_MSGTYPE(const location_type &l)
Definition parser.h:2059
static symbol_type make_LINKADDR(const location_type &l)
Definition parser.h:1474
static symbol_type make_TOHEXSTRING(const location_type &l)
Definition parser.h:1894
static symbol_type make_EVALerror(const location_type &l)
Definition parser.h:1249
static symbol_type make_PKT6(const location_type &l)
Definition parser.h:2044
static symbol_type make_END(const location_type &l)
Definition parser.h:1234
static symbol_type make_DST(const location_type &l)
Definition parser.h:1624
static symbol_type make_OR(const location_type &l)
Definition parser.h:1354
static symbol_type make_PLUS(const location_type &l)
Definition parser.h:1849
static symbol_type make_RBRACKET(const location_type &l)
Definition parser.h:1504
static symbol_type make_NOT(const location_type &l)
Definition parser.h:1309
static symbol_type make_INT32TOTEXT(const location_type &l)
Definition parser.h:1954
static symbol_type make_SIADDR(const location_type &l)
Definition parser.h:1759
static symbol_type make_PKT4(const location_type &l)
Definition parser.h:1654
static symbol_type make_SOR(const location_type &l)
Definition parser.h:1369
static symbol_type make_IP_ADDRESS(const std::string &v, const location_type &l)
Definition parser.h:2269
static symbol_type make_UINT16TOTEXT(const location_type &l)
Definition parser.h:1984
static symbol_type make_STRING(const std::string &v, const location_type &l)
Definition parser.h:2209
static symbol_type make_TOPLEVEL_BOOL(const location_type &l)
Definition parser.h:2179
static symbol_type make_LPAREN(const location_type &l)
Definition parser.h:1279
static symbol_type make_TOPLEVEL_STRING(const location_type &l)
Definition parser.h:2194
static symbol_type make_GIADDR(const location_type &l)
Definition parser.h:1729
static symbol_type make_MATCH(const location_type &l)
Definition parser.h:2164
static symbol_type make_DATA(const location_type &l)
Definition parser.h:2134
static symbol_type make_CHADDR(const location_type &l)
Definition parser.h:1669
static symbol_type make_INT16TOTEXT(const location_type &l)
Definition parser.h:1939
static symbol_type make_LBRACKET(const location_type &l)
Definition parser.h:1489
static symbol_type make_LEN(const location_type &l)
Definition parser.h:1639
static symbol_type make_IFACE(const location_type &l)
Definition parser.h:1594
static symbol_type make_SAND(const location_type &l)
Definition parser.h:1339
static symbol_type make_ANY(const location_type &l)
Definition parser.h:2119
static symbol_type make_DOT(const location_type &l)
Definition parser.h:1519
by_kind by_type
Backward compatibility for a private implementation detail (Bison 3.6).
Definition parser.h:1139
static symbol_type make_HLEN(const location_type &l)
Definition parser.h:1684
static symbol_type make_ALL(const location_type &l)
Definition parser.h:1804
static symbol_type make_UCASE(const location_type &l)
Definition parser.h:2029
static symbol_type make_COMA(const location_type &l)
Definition parser.h:1819
static symbol_type make_IFELSE(const location_type &l)
Definition parser.h:1864
location location_type
Symbol locations.
Definition parser.h:492
static symbol_type make_YIADDR(const location_type &l)
Definition parser.h:1744
static symbol_type make_SRC(const location_type &l)
Definition parser.h:1609
static symbol_type make_INTEGER(const std::string &v, const location_type &l)
Definition parser.h:2224
static symbol_type make_EQUAL(const location_type &l)
Definition parser.h:1384
token::token_kind_type token_kind_type
Token kind, as returned by yylex.
Definition parser.h:594
static symbol_type make_EXISTS(const location_type &l)
Definition parser.h:1564
static symbol_type make_TRANSID(const location_type &l)
Definition parser.h:2074
token_kind_type token_type
Backward compatibility alias (Bison 3.6).
Definition parser.h:597
static symbol_type make_SIFELSE(const location_type &l)
Definition parser.h:1879
static symbol_type make_ADDRTOTEXT(const location_type &l)
Definition parser.h:1909
static symbol_type make_LCASE(const location_type &l)
Definition parser.h:2014
static symbol_type make_RELAY4(const location_type &l)
Definition parser.h:1414
static symbol_type make_PKT(const location_type &l)
Definition parser.h:1579
static symbol_type make_CIADDR(const location_type &l)
Definition parser.h:1714
static symbol_type make_HEXSTRING(const std::string &v, const location_type &l)
Definition parser.h:2239
static symbol_type make_EVALUNDEF(const location_type &l)
Definition parser.h:1264
static symbol_type make_OPTION_NAME(const std::string &v, const location_type &l)
Definition parser.h:2254
static symbol_type make_MEMBER(const location_type &l)
Definition parser.h:1444
static symbol_type make_UINT32TOTEXT(const location_type &l)
Definition parser.h:1999
EvalParser(EvalContext &ctx_yyarg)
Build a parser object.
Definition parser.cc:152
static symbol_type make_SPLIT(const location_type &l)
Definition parser.h:1789
static symbol_type make_ENTERPRISE(const location_type &l)
Definition parser.h:2149
static symbol_type make_VENDOR(const location_type &l)
Definition parser.h:2104
value_type semantic_type
Backward compatibility (Bison 3.8).
Definition parser.h:489
static symbol_type make_RPAREN(const location_type &l)
Definition parser.h:1294
static symbol_type make_PEERADDR(const location_type &l)
Definition parser.h:1459
static const symbol_kind_type YYNTOKENS
The number of tokens.
Definition parser.h:709
static symbol_type make_SUBSTRING(const location_type &l)
Definition parser.h:1774
static symbol_type make_VENDOR_CLASS(const location_type &l)
Definition parser.h:2089
static symbol_type make_HEX(const location_type &l)
Definition parser.h:1549
static symbol_type make_UINT8TOTEXT(const location_type &l)
Definition parser.h:1969
static std::string symbol_name(symbol_kind_type yysymbol)
The user-facing name of the symbol whose (internal) number is YYSYMBOL.
Definition parser.cc:2092
#define YY_RVREF(Type)
Definition d2_parser.h:87
#define YY_MOVE_REF(Type)
Definition d2_parser.h:86
#define YY_NOEXCEPT
Definition d2_parser.h:96
#define YY_ATTRIBUTE_PURE
Definition d2_parser.h:118
#define YY_MOVE
Definition d2_parser.h:84
#define YY_NOTHROW
Definition d2_parser.h:97
Forward declaration of the EvalContext class.
@ error
Definition db_log.h:126
Defines the logger used by the top-level component of kea-lfc.
#define EVAL_ASSERT
Definition parser.h:108
basic_symbol(const basic_symbol &that)
Copy constructor.
Definition parser.h:2672
basic_symbol(typename Base::kind_type t, const std::vector< uint16_t > &v, const location_type &l)
Definition parser.h:949
Base super_type
Alias to Base.
Definition parser.h:721
basic_symbol(typename Base::kind_type t, const TokenPkt4::FieldType &v, const location_type &l)
Definition parser.h:837
basic_symbol(typename Base::kind_type t, const std::pair< uint32_t, std::vector< uint16_t > > &v, const location_type &l)
Definition parser.h:921
basic_symbol(typename Base::kind_type t, const uint32_t &v, const location_type &l)
Definition parser.h:977
basic_symbol(typename Base::kind_type t, const std::pair< int8_t, std::vector< uint16_t > > &v, const location_type &l)
Definition parser.h:907
basic_symbol(typename Base::kind_type t, const TokenPkt6::FieldType &v, const location_type &l)
Definition parser.h:851
~basic_symbol()
Destroy the symbol.
Definition parser.h:985
symbol_kind_type type_get() const YY_NOEXCEPT
Backward compatibility (Bison 3.6).
Definition parser.h:2745
basic_symbol(typename Base::kind_type t, const uint16_t &v, const location_type &l)
Definition parser.h:963
basic_symbol(typename Base::kind_type t, const TokenPkt::MetadataType &v, const location_type &l)
Definition parser.h:865
std::string name() const YY_NOEXCEPT
The user-facing name of this symbol.
Definition parser.h:1071
basic_symbol(typename Base::kind_type t, const TokenOption::RepresentationType &v, const location_type &l)
Definition parser.h:823
basic_symbol(typename Base::kind_type t, const std::string &v, const location_type &l)
Definition parser.h:935
basic_symbol() YY_NOEXCEPT
Default constructor.
Definition parser.h:724
basic_symbol(typename Base::kind_type t, const TokenRelay6Field::FieldType &v, const location_type &l)
Definition parser.h:879
basic_symbol(typename Base::kind_type t, const location_type &l)
Constructors for typed symbols.
Definition parser.h:810
basic_symbol(typename Base::kind_type t, const int8_t &v, const location_type &l)
Definition parser.h:893
Type access provider for token (enum) based symbols.
Definition parser.h:1100
symbol_kind_type type_get() const YY_NOEXCEPT
Backward compatibility (Bison 3.6).
Definition parser.h:2879
token_kind_type kind_type
The symbol kind as needed by the constructor.
Definition parser.h:1102
by_kind() YY_NOEXCEPT
Default constructor.
Definition parser.h:2829
symbol_kind_type kind_
The symbol kind.
Definition parser.h:1135
void clear() YY_NOEXCEPT
Record that this symbol is empty.
Definition parser.h:2856
symbol_kind_type kind() const YY_NOEXCEPT
The (internal) type number (corresponding to type).
Definition parser.h:2871
void move(by_kind &that)
Steal the symbol kind from that.
Definition parser.h:2863
@ YYNTOKENS
Number of tokens.
Definition parser.h:604
"External" symbols: returned by the scanner.
Definition parser.h:1143
symbol_type() YY_NOEXCEPT
Empty symbol.
Definition parser.h:1148
basic_symbol< by_kind > super_type
Superclass.
Definition parser.h:1145
syntax_error(const location_type &l, const std::string &m)
Definition parser.h:497
syntax_error(const syntax_error &s)
Definition parser.h:502
~syntax_error() YY_NOEXCEPT YY_NOTHROW
Definition parser.cc:165
token_kind_type yytokentype
Backward compatibility alias (Bison 3.6).
Definition parser.h:590