Kea 2.7.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
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 // "constant string"
446 // "integer"
447 // "constant hexstring"
448 // "option name"
449 // "ip address"
450 char dummy7[sizeof (std::string)];
451
452 // option_code
453 // sub_option_code
454 char dummy8[sizeof (uint16_t)];
455
456 // integer_expr
457 // enterprise_id
458 char dummy9[sizeof (uint32_t)];
459 };
460
462 enum { size = sizeof (union_type) };
463
465 union
466 {
468 long double yyalign_me_;
470 char yyraw_[size];
471 };
472
474 const std::type_info *yytypeid_;
475 };
476
477#endif
480
482 typedef location location_type;
483
485 struct syntax_error : std::runtime_error
486 {
487 syntax_error (const location_type& l, const std::string& m)
488 : std::runtime_error (m)
489 , location (l)
490 {}
491
493 : std::runtime_error (s.what ())
494 , location (s.location)
495 {}
496
498
500 };
501
503 struct token
504 {
506 {
507 TOKEN_EVALEMPTY = -2,
508 TOKEN_END = 0, // "end of file"
509 TOKEN_EVALerror = 256, // error
510 TOKEN_EVALUNDEF = 257, // "invalid token"
511 TOKEN_LPAREN = 258, // "("
512 TOKEN_RPAREN = 259, // ")"
513 TOKEN_NOT = 260, // "not"
514 TOKEN_AND = 261, // "and"
515 TOKEN_OR = 262, // "or"
516 TOKEN_EQUAL = 263, // "=="
517 TOKEN_OPTION = 264, // "option"
518 TOKEN_RELAY4 = 265, // "relay4"
519 TOKEN_RELAY6 = 266, // "relay6"
520 TOKEN_MEMBER = 267, // "member"
521 TOKEN_PEERADDR = 268, // "peeraddr"
522 TOKEN_LINKADDR = 269, // "linkaddr"
523 TOKEN_LBRACKET = 270, // "["
524 TOKEN_RBRACKET = 271, // "]"
525 TOKEN_DOT = 272, // "."
526 TOKEN_TEXT = 273, // "text"
527 TOKEN_HEX = 274, // "hex"
528 TOKEN_EXISTS = 275, // "exists"
529 TOKEN_PKT = 276, // "pkt"
530 TOKEN_IFACE = 277, // "iface"
531 TOKEN_SRC = 278, // "src"
532 TOKEN_DST = 279, // "dst"
533 TOKEN_LEN = 280, // "len"
534 TOKEN_PKT4 = 281, // "pkt4"
535 TOKEN_CHADDR = 282, // "mac"
536 TOKEN_HLEN = 283, // "hlen"
537 TOKEN_HTYPE = 284, // "htype"
538 TOKEN_CIADDR = 285, // "ciaddr"
539 TOKEN_GIADDR = 286, // "giaddr"
540 TOKEN_YIADDR = 287, // "yiaddr"
541 TOKEN_SIADDR = 288, // "siaddr"
542 TOKEN_SUBSTRING = 289, // "substring"
543 TOKEN_SPLIT = 290, // "split"
544 TOKEN_ALL = 291, // "all"
545 TOKEN_COMA = 292, // ","
546 TOKEN_CONCAT = 293, // "concat"
547 TOKEN_PLUS = 294, // "+"
548 TOKEN_IFELSE = 295, // "ifelse"
549 TOKEN_TOHEXSTRING = 296, // "hexstring"
550 TOKEN_ADDRTOTEXT = 297, // "addrtotext"
551 TOKEN_INT8TOTEXT = 298, // "int8totext"
552 TOKEN_INT16TOTEXT = 299, // "int16totext"
553 TOKEN_INT32TOTEXT = 300, // "int32totext"
554 TOKEN_UINT8TOTEXT = 301, // "uint8totext"
555 TOKEN_UINT16TOTEXT = 302, // "uint16totext"
556 TOKEN_UINT32TOTEXT = 303, // "uint32totext"
557 TOKEN_LCASE = 304, // "lcase"
558 TOKEN_UCASE = 305, // "ucase"
559 TOKEN_PKT6 = 306, // "pkt6"
560 TOKEN_MSGTYPE = 307, // "msgtype"
561 TOKEN_TRANSID = 308, // "transid"
562 TOKEN_VENDOR_CLASS = 309, // "vendor-class"
563 TOKEN_VENDOR = 310, // "vendor"
564 TOKEN_ANY = 311, // "*"
565 TOKEN_DATA = 312, // "data"
566 TOKEN_ENTERPRISE = 313, // "enterprise"
567 TOKEN_MATCH = 314, // "match"
568 TOKEN_TOPLEVEL_BOOL = 315, // "top-level bool"
569 TOKEN_TOPLEVEL_STRING = 316, // "top-level string"
570 TOKEN_STRING = 317, // "constant string"
571 TOKEN_INTEGER = 318, // "integer"
572 TOKEN_HEXSTRING = 319, // "constant hexstring"
573 TOKEN_OPTION_NAME = 320, // "option name"
574 TOKEN_IP_ADDRESS = 321 // "ip address"
575 };
578 };
579
582
585
588 {
590 {
591 YYNTOKENS = 67,
592 S_YYEMPTY = -2,
593 S_YYEOF = 0, // "end of file"
594 S_YYerror = 1, // error
595 S_YYUNDEF = 2, // "invalid token"
596 S_LPAREN = 3, // "("
597 S_RPAREN = 4, // ")"
598 S_NOT = 5, // "not"
599 S_AND = 6, // "and"
600 S_OR = 7, // "or"
601 S_EQUAL = 8, // "=="
602 S_OPTION = 9, // "option"
603 S_RELAY4 = 10, // "relay4"
604 S_RELAY6 = 11, // "relay6"
605 S_MEMBER = 12, // "member"
606 S_PEERADDR = 13, // "peeraddr"
607 S_LINKADDR = 14, // "linkaddr"
608 S_LBRACKET = 15, // "["
609 S_RBRACKET = 16, // "]"
610 S_DOT = 17, // "."
611 S_TEXT = 18, // "text"
612 S_HEX = 19, // "hex"
613 S_EXISTS = 20, // "exists"
614 S_PKT = 21, // "pkt"
615 S_IFACE = 22, // "iface"
616 S_SRC = 23, // "src"
617 S_DST = 24, // "dst"
618 S_LEN = 25, // "len"
619 S_PKT4 = 26, // "pkt4"
620 S_CHADDR = 27, // "mac"
621 S_HLEN = 28, // "hlen"
622 S_HTYPE = 29, // "htype"
623 S_CIADDR = 30, // "ciaddr"
624 S_GIADDR = 31, // "giaddr"
625 S_YIADDR = 32, // "yiaddr"
626 S_SIADDR = 33, // "siaddr"
627 S_SUBSTRING = 34, // "substring"
628 S_SPLIT = 35, // "split"
629 S_ALL = 36, // "all"
630 S_COMA = 37, // ","
631 S_CONCAT = 38, // "concat"
632 S_PLUS = 39, // "+"
633 S_IFELSE = 40, // "ifelse"
634 S_TOHEXSTRING = 41, // "hexstring"
635 S_ADDRTOTEXT = 42, // "addrtotext"
636 S_INT8TOTEXT = 43, // "int8totext"
637 S_INT16TOTEXT = 44, // "int16totext"
638 S_INT32TOTEXT = 45, // "int32totext"
639 S_UINT8TOTEXT = 46, // "uint8totext"
640 S_UINT16TOTEXT = 47, // "uint16totext"
641 S_UINT32TOTEXT = 48, // "uint32totext"
642 S_LCASE = 49, // "lcase"
643 S_UCASE = 50, // "ucase"
644 S_PKT6 = 51, // "pkt6"
645 S_MSGTYPE = 52, // "msgtype"
646 S_TRANSID = 53, // "transid"
647 S_VENDOR_CLASS = 54, // "vendor-class"
648 S_VENDOR = 55, // "vendor"
649 S_ANY = 56, // "*"
650 S_DATA = 57, // "data"
651 S_ENTERPRISE = 58, // "enterprise"
652 S_MATCH = 59, // "match"
653 S_TOPLEVEL_BOOL = 60, // "top-level bool"
654 S_TOPLEVEL_STRING = 61, // "top-level string"
655 S_STRING = 62, // "constant string"
656 S_INTEGER = 63, // "integer"
657 S_HEXSTRING = 64, // "constant hexstring"
658 S_OPTION_NAME = 65, // "option name"
659 S_IP_ADDRESS = 66, // "ip address"
660 S_YYACCEPT = 67, // $accept
661 S_start = 68, // start
662 S_expression = 69, // expression
663 S_bool_expr = 70, // bool_expr
664 S_string_expr = 71, // string_expr
665 S_integer_expr = 72, // integer_expr
666 S_option_code = 73, // option_code
667 S_sub_option_code = 74, // sub_option_code
668 S_option_repr_type = 75, // option_repr_type
669 S_nest_level = 76, // nest_level
670 S_pkt_metadata = 77, // pkt_metadata
671 S_enterprise_id = 78, // enterprise_id
672 S_pkt4_field = 79, // pkt4_field
673 S_pkt6_field = 80, // pkt6_field
674 S_relay6_field = 81, // relay6_field
675 S_start_expr = 82, // start_expr
676 S_length_expr = 83, // length_expr
677 S_int_expr = 84 // int_expr
678 };
679 };
680
683
686
693 template <typename Base>
694 struct basic_symbol : Base
695 {
697 typedef Base super_type;
698
701 : value ()
702 , location ()
703 {}
704
705#if 201103L <= YY_CPLUSPLUS
708 : Base (std::move (that))
709 , value ()
710 , location (std::move (that.location))
711 {
712 switch (this->kind ())
713 {
714 case symbol_kind::S_option_repr_type: // option_repr_type
715 value.move< TokenOption::RepresentationType > (std::move (that.value));
716 break;
717
718 case symbol_kind::S_pkt4_field: // pkt4_field
719 value.move< TokenPkt4::FieldType > (std::move (that.value));
720 break;
721
722 case symbol_kind::S_pkt6_field: // pkt6_field
723 value.move< TokenPkt6::FieldType > (std::move (that.value));
724 break;
725
726 case symbol_kind::S_pkt_metadata: // pkt_metadata
727 value.move< TokenPkt::MetadataType > (std::move (that.value));
728 break;
729
730 case symbol_kind::S_relay6_field: // relay6_field
731 value.move< TokenRelay6Field::FieldType > (std::move (that.value));
732 break;
733
734 case symbol_kind::S_nest_level: // nest_level
735 value.move< int8_t > (std::move (that.value));
736 break;
737
738 case symbol_kind::S_STRING: // "constant string"
739 case symbol_kind::S_INTEGER: // "integer"
740 case symbol_kind::S_HEXSTRING: // "constant hexstring"
741 case symbol_kind::S_OPTION_NAME: // "option name"
742 case symbol_kind::S_IP_ADDRESS: // "ip address"
743 value.move< std::string > (std::move (that.value));
744 break;
745
746 case symbol_kind::S_option_code: // option_code
747 case symbol_kind::S_sub_option_code: // sub_option_code
748 value.move< uint16_t > (std::move (that.value));
749 break;
750
751 case symbol_kind::S_integer_expr: // integer_expr
752 case symbol_kind::S_enterprise_id: // enterprise_id
753 value.move< uint32_t > (std::move (that.value));
754 break;
755
756 default:
757 break;
758 }
759
760 }
761#endif
762
764 basic_symbol (const basic_symbol& that);
765
767#if 201103L <= YY_CPLUSPLUS
768 basic_symbol (typename Base::kind_type t, location_type&& l)
769 : Base (t)
770 , location (std::move (l))
771 {}
772#else
773 basic_symbol (typename Base::kind_type t, const location_type& l)
774 : Base (t)
775 , location (l)
776 {}
777#endif
778
779#if 201103L <= YY_CPLUSPLUS
780 basic_symbol (typename Base::kind_type t, TokenOption::RepresentationType&& v, location_type&& l)
781 : Base (t)
782 , value (std::move (v))
783 , location (std::move (l))
784 {}
785#else
786 basic_symbol (typename Base::kind_type t, const TokenOption::RepresentationType& v, const location_type& l)
787 : Base (t)
788 , value (v)
789 , location (l)
790 {}
791#endif
792
793#if 201103L <= YY_CPLUSPLUS
794 basic_symbol (typename Base::kind_type t, TokenPkt4::FieldType&& v, location_type&& l)
795 : Base (t)
796 , value (std::move (v))
797 , location (std::move (l))
798 {}
799#else
800 basic_symbol (typename Base::kind_type t, const TokenPkt4::FieldType& v, const location_type& l)
801 : Base (t)
802 , value (v)
803 , location (l)
804 {}
805#endif
806
807#if 201103L <= YY_CPLUSPLUS
808 basic_symbol (typename Base::kind_type t, TokenPkt6::FieldType&& v, location_type&& l)
809 : Base (t)
810 , value (std::move (v))
811 , location (std::move (l))
812 {}
813#else
814 basic_symbol (typename Base::kind_type t, const TokenPkt6::FieldType& v, const location_type& l)
815 : Base (t)
816 , value (v)
817 , location (l)
818 {}
819#endif
820
821#if 201103L <= YY_CPLUSPLUS
822 basic_symbol (typename Base::kind_type t, TokenPkt::MetadataType&& v, location_type&& l)
823 : Base (t)
824 , value (std::move (v))
825 , location (std::move (l))
826 {}
827#else
828 basic_symbol (typename Base::kind_type t, const TokenPkt::MetadataType& v, const location_type& l)
829 : Base (t)
830 , value (v)
831 , location (l)
832 {}
833#endif
834
835#if 201103L <= YY_CPLUSPLUS
836 basic_symbol (typename Base::kind_type t, TokenRelay6Field::FieldType&& v, location_type&& l)
837 : Base (t)
838 , value (std::move (v))
839 , location (std::move (l))
840 {}
841#else
842 basic_symbol (typename Base::kind_type t, const TokenRelay6Field::FieldType& v, const location_type& l)
843 : Base (t)
844 , value (v)
845 , location (l)
846 {}
847#endif
848
849#if 201103L <= YY_CPLUSPLUS
850 basic_symbol (typename Base::kind_type t, int8_t&& v, location_type&& l)
851 : Base (t)
852 , value (std::move (v))
853 , location (std::move (l))
854 {}
855#else
856 basic_symbol (typename Base::kind_type t, const int8_t& v, const location_type& l)
857 : Base (t)
858 , value (v)
859 , location (l)
860 {}
861#endif
862
863#if 201103L <= YY_CPLUSPLUS
864 basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l)
865 : Base (t)
866 , value (std::move (v))
867 , location (std::move (l))
868 {}
869#else
870 basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
871 : Base (t)
872 , value (v)
873 , location (l)
874 {}
875#endif
876
877#if 201103L <= YY_CPLUSPLUS
878 basic_symbol (typename Base::kind_type t, uint16_t&& v, location_type&& l)
879 : Base (t)
880 , value (std::move (v))
881 , location (std::move (l))
882 {}
883#else
884 basic_symbol (typename Base::kind_type t, const uint16_t& v, const location_type& l)
885 : Base (t)
886 , value (v)
887 , location (l)
888 {}
889#endif
890
891#if 201103L <= YY_CPLUSPLUS
892 basic_symbol (typename Base::kind_type t, uint32_t&& v, location_type&& l)
893 : Base (t)
894 , value (std::move (v))
895 , location (std::move (l))
896 {}
897#else
898 basic_symbol (typename Base::kind_type t, const uint32_t& v, const location_type& l)
899 : Base (t)
900 , value (v)
901 , location (l)
902 {}
903#endif
904
907 {
908 clear ();
909 }
910
911
912
915 {
916 // User destructor.
917 symbol_kind_type yykind = this->kind ();
918 basic_symbol<Base>& yysym = *this;
919 (void) yysym;
920 switch (yykind)
921 {
922 default:
923 break;
924 }
925
926 // Value type destructor.
927switch (yykind)
928 {
929 case symbol_kind::S_option_repr_type: // option_repr_type
930 value.template destroy< TokenOption::RepresentationType > ();
931 break;
932
933 case symbol_kind::S_pkt4_field: // pkt4_field
934 value.template destroy< TokenPkt4::FieldType > ();
935 break;
936
937 case symbol_kind::S_pkt6_field: // pkt6_field
938 value.template destroy< TokenPkt6::FieldType > ();
939 break;
940
941 case symbol_kind::S_pkt_metadata: // pkt_metadata
942 value.template destroy< TokenPkt::MetadataType > ();
943 break;
944
945 case symbol_kind::S_relay6_field: // relay6_field
946 value.template destroy< TokenRelay6Field::FieldType > ();
947 break;
948
949 case symbol_kind::S_nest_level: // nest_level
950 value.template destroy< int8_t > ();
951 break;
952
953 case symbol_kind::S_STRING: // "constant string"
954 case symbol_kind::S_INTEGER: // "integer"
955 case symbol_kind::S_HEXSTRING: // "constant hexstring"
956 case symbol_kind::S_OPTION_NAME: // "option name"
957 case symbol_kind::S_IP_ADDRESS: // "ip address"
958 value.template destroy< std::string > ();
959 break;
960
961 case symbol_kind::S_option_code: // option_code
962 case symbol_kind::S_sub_option_code: // sub_option_code
963 value.template destroy< uint16_t > ();
964 break;
965
966 case symbol_kind::S_integer_expr: // integer_expr
967 case symbol_kind::S_enterprise_id: // enterprise_id
968 value.template destroy< uint32_t > ();
969 break;
970
971 default:
972 break;
973 }
974
975 Base::clear ();
976 }
977
979 std::string name () const YY_NOEXCEPT
980 {
981 return EvalParser::symbol_name (this->kind ());
982 }
983
985 symbol_kind_type type_get () const YY_NOEXCEPT;
986
988 bool empty () const YY_NOEXCEPT;
989
991 void move (basic_symbol& s);
992
995
998
999 private:
1000#if YY_CPLUSPLUS < 201103L
1002 basic_symbol& operator= (const basic_symbol& that);
1003#endif
1004 };
1005
1007 struct by_kind
1008 {
1011
1014
1015#if 201103L <= YY_CPLUSPLUS
1017 by_kind (by_kind&& that) YY_NOEXCEPT;
1018#endif
1019
1021 by_kind (const by_kind& that) YY_NOEXCEPT;
1022
1025
1026
1027
1029 void clear () YY_NOEXCEPT;
1030
1032 void move (by_kind& that);
1033
1036 symbol_kind_type kind () const YY_NOEXCEPT;
1037
1039 symbol_kind_type type_get () const YY_NOEXCEPT;
1040
1044 };
1045
1048
1051 {
1053 typedef basic_symbol<by_kind> super_type;
1054
1057
1059#if 201103L <= YY_CPLUSPLUS
1060 symbol_type (int tok, location_type l)
1061 : super_type (token_kind_type (tok), std::move (l))
1062#else
1063 symbol_type (int tok, const location_type& l)
1064 : super_type (token_kind_type (tok), l)
1065#endif
1066 {
1067#if !defined _MSC_VER || defined __clang__
1068 EVAL_ASSERT (tok == token::TOKEN_END
1069 || (token::TOKEN_EVALerror <= tok && tok <= token::TOKEN_TOPLEVEL_STRING));
1070#endif
1071 }
1072#if 201103L <= YY_CPLUSPLUS
1073 symbol_type (int tok, std::string v, location_type l)
1074 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1075#else
1076 symbol_type (int tok, const std::string& v, const location_type& l)
1077 : super_type (token_kind_type (tok), v, l)
1078#endif
1079 {
1080#if !defined _MSC_VER || defined __clang__
1081 EVAL_ASSERT ((token::TOKEN_STRING <= tok && tok <= token::TOKEN_IP_ADDRESS));
1082#endif
1083 }
1084 };
1085
1087 EvalParser (EvalContext& ctx_yyarg);
1088 virtual ~EvalParser ();
1089
1090#if 201103L <= YY_CPLUSPLUS
1092 EvalParser (const EvalParser&) = delete;
1094 EvalParser& operator= (const EvalParser&) = delete;
1095#endif
1096
1099 int operator() ();
1100
1103 virtual int parse ();
1104
1105#if EVALDEBUG
1107 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
1109 void set_debug_stream (std::ostream &);
1110
1112 typedef int debug_level_type;
1114 debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
1116 void set_debug_level (debug_level_type l);
1117#endif
1118
1122 virtual void error (const location_type& loc, const std::string& msg);
1123
1125 void error (const syntax_error& err);
1126
1129 static std::string symbol_name (symbol_kind_type yysymbol);
1130
1131 // Implementation of make_symbol for each token kind.
1132#if 201103L <= YY_CPLUSPLUS
1133 static
1134 symbol_type
1135 make_END (location_type l)
1136 {
1137 return symbol_type (token::TOKEN_END, std::move (l));
1138 }
1139#else
1140 static
1141 symbol_type
1143 {
1144 return symbol_type (token::TOKEN_END, l);
1145 }
1146#endif
1147#if 201103L <= YY_CPLUSPLUS
1148 static
1149 symbol_type
1150 make_EVALerror (location_type l)
1151 {
1152 return symbol_type (token::TOKEN_EVALerror, std::move (l));
1153 }
1154#else
1155 static
1156 symbol_type
1158 {
1159 return symbol_type (token::TOKEN_EVALerror, l);
1160 }
1161#endif
1162#if 201103L <= YY_CPLUSPLUS
1163 static
1164 symbol_type
1165 make_EVALUNDEF (location_type l)
1166 {
1167 return symbol_type (token::TOKEN_EVALUNDEF, std::move (l));
1168 }
1169#else
1170 static
1171 symbol_type
1173 {
1174 return symbol_type (token::TOKEN_EVALUNDEF, l);
1175 }
1176#endif
1177#if 201103L <= YY_CPLUSPLUS
1178 static
1179 symbol_type
1180 make_LPAREN (location_type l)
1181 {
1182 return symbol_type (token::TOKEN_LPAREN, std::move (l));
1183 }
1184#else
1185 static
1186 symbol_type
1188 {
1189 return symbol_type (token::TOKEN_LPAREN, l);
1190 }
1191#endif
1192#if 201103L <= YY_CPLUSPLUS
1193 static
1194 symbol_type
1195 make_RPAREN (location_type l)
1196 {
1197 return symbol_type (token::TOKEN_RPAREN, std::move (l));
1198 }
1199#else
1200 static
1201 symbol_type
1203 {
1204 return symbol_type (token::TOKEN_RPAREN, l);
1205 }
1206#endif
1207#if 201103L <= YY_CPLUSPLUS
1208 static
1209 symbol_type
1210 make_NOT (location_type l)
1211 {
1212 return symbol_type (token::TOKEN_NOT, std::move (l));
1213 }
1214#else
1215 static
1216 symbol_type
1218 {
1219 return symbol_type (token::TOKEN_NOT, l);
1220 }
1221#endif
1222#if 201103L <= YY_CPLUSPLUS
1223 static
1224 symbol_type
1225 make_AND (location_type l)
1226 {
1227 return symbol_type (token::TOKEN_AND, std::move (l));
1228 }
1229#else
1230 static
1231 symbol_type
1233 {
1234 return symbol_type (token::TOKEN_AND, l);
1235 }
1236#endif
1237#if 201103L <= YY_CPLUSPLUS
1238 static
1239 symbol_type
1240 make_OR (location_type l)
1241 {
1242 return symbol_type (token::TOKEN_OR, std::move (l));
1243 }
1244#else
1245 static
1246 symbol_type
1248 {
1249 return symbol_type (token::TOKEN_OR, l);
1250 }
1251#endif
1252#if 201103L <= YY_CPLUSPLUS
1253 static
1254 symbol_type
1255 make_EQUAL (location_type l)
1256 {
1257 return symbol_type (token::TOKEN_EQUAL, std::move (l));
1258 }
1259#else
1260 static
1261 symbol_type
1263 {
1264 return symbol_type (token::TOKEN_EQUAL, l);
1265 }
1266#endif
1267#if 201103L <= YY_CPLUSPLUS
1268 static
1269 symbol_type
1270 make_OPTION (location_type l)
1271 {
1272 return symbol_type (token::TOKEN_OPTION, std::move (l));
1273 }
1274#else
1275 static
1276 symbol_type
1278 {
1279 return symbol_type (token::TOKEN_OPTION, l);
1280 }
1281#endif
1282#if 201103L <= YY_CPLUSPLUS
1283 static
1284 symbol_type
1285 make_RELAY4 (location_type l)
1286 {
1287 return symbol_type (token::TOKEN_RELAY4, std::move (l));
1288 }
1289#else
1290 static
1291 symbol_type
1293 {
1294 return symbol_type (token::TOKEN_RELAY4, l);
1295 }
1296#endif
1297#if 201103L <= YY_CPLUSPLUS
1298 static
1299 symbol_type
1300 make_RELAY6 (location_type l)
1301 {
1302 return symbol_type (token::TOKEN_RELAY6, std::move (l));
1303 }
1304#else
1305 static
1306 symbol_type
1308 {
1309 return symbol_type (token::TOKEN_RELAY6, l);
1310 }
1311#endif
1312#if 201103L <= YY_CPLUSPLUS
1313 static
1314 symbol_type
1315 make_MEMBER (location_type l)
1316 {
1317 return symbol_type (token::TOKEN_MEMBER, std::move (l));
1318 }
1319#else
1320 static
1321 symbol_type
1323 {
1324 return symbol_type (token::TOKEN_MEMBER, l);
1325 }
1326#endif
1327#if 201103L <= YY_CPLUSPLUS
1328 static
1329 symbol_type
1330 make_PEERADDR (location_type l)
1331 {
1332 return symbol_type (token::TOKEN_PEERADDR, std::move (l));
1333 }
1334#else
1335 static
1336 symbol_type
1338 {
1339 return symbol_type (token::TOKEN_PEERADDR, l);
1340 }
1341#endif
1342#if 201103L <= YY_CPLUSPLUS
1343 static
1344 symbol_type
1345 make_LINKADDR (location_type l)
1346 {
1347 return symbol_type (token::TOKEN_LINKADDR, std::move (l));
1348 }
1349#else
1350 static
1351 symbol_type
1353 {
1354 return symbol_type (token::TOKEN_LINKADDR, l);
1355 }
1356#endif
1357#if 201103L <= YY_CPLUSPLUS
1358 static
1359 symbol_type
1360 make_LBRACKET (location_type l)
1361 {
1362 return symbol_type (token::TOKEN_LBRACKET, std::move (l));
1363 }
1364#else
1365 static
1366 symbol_type
1368 {
1369 return symbol_type (token::TOKEN_LBRACKET, l);
1370 }
1371#endif
1372#if 201103L <= YY_CPLUSPLUS
1373 static
1374 symbol_type
1375 make_RBRACKET (location_type l)
1376 {
1377 return symbol_type (token::TOKEN_RBRACKET, std::move (l));
1378 }
1379#else
1380 static
1381 symbol_type
1383 {
1384 return symbol_type (token::TOKEN_RBRACKET, l);
1385 }
1386#endif
1387#if 201103L <= YY_CPLUSPLUS
1388 static
1389 symbol_type
1390 make_DOT (location_type l)
1391 {
1392 return symbol_type (token::TOKEN_DOT, std::move (l));
1393 }
1394#else
1395 static
1396 symbol_type
1398 {
1399 return symbol_type (token::TOKEN_DOT, l);
1400 }
1401#endif
1402#if 201103L <= YY_CPLUSPLUS
1403 static
1404 symbol_type
1405 make_TEXT (location_type l)
1406 {
1407 return symbol_type (token::TOKEN_TEXT, std::move (l));
1408 }
1409#else
1410 static
1411 symbol_type
1413 {
1414 return symbol_type (token::TOKEN_TEXT, l);
1415 }
1416#endif
1417#if 201103L <= YY_CPLUSPLUS
1418 static
1419 symbol_type
1420 make_HEX (location_type l)
1421 {
1422 return symbol_type (token::TOKEN_HEX, std::move (l));
1423 }
1424#else
1425 static
1426 symbol_type
1428 {
1429 return symbol_type (token::TOKEN_HEX, l);
1430 }
1431#endif
1432#if 201103L <= YY_CPLUSPLUS
1433 static
1434 symbol_type
1435 make_EXISTS (location_type l)
1436 {
1437 return symbol_type (token::TOKEN_EXISTS, std::move (l));
1438 }
1439#else
1440 static
1441 symbol_type
1443 {
1444 return symbol_type (token::TOKEN_EXISTS, l);
1445 }
1446#endif
1447#if 201103L <= YY_CPLUSPLUS
1448 static
1449 symbol_type
1450 make_PKT (location_type l)
1451 {
1452 return symbol_type (token::TOKEN_PKT, std::move (l));
1453 }
1454#else
1455 static
1456 symbol_type
1458 {
1459 return symbol_type (token::TOKEN_PKT, l);
1460 }
1461#endif
1462#if 201103L <= YY_CPLUSPLUS
1463 static
1464 symbol_type
1465 make_IFACE (location_type l)
1466 {
1467 return symbol_type (token::TOKEN_IFACE, std::move (l));
1468 }
1469#else
1470 static
1471 symbol_type
1473 {
1474 return symbol_type (token::TOKEN_IFACE, l);
1475 }
1476#endif
1477#if 201103L <= YY_CPLUSPLUS
1478 static
1479 symbol_type
1480 make_SRC (location_type l)
1481 {
1482 return symbol_type (token::TOKEN_SRC, std::move (l));
1483 }
1484#else
1485 static
1486 symbol_type
1488 {
1489 return symbol_type (token::TOKEN_SRC, l);
1490 }
1491#endif
1492#if 201103L <= YY_CPLUSPLUS
1493 static
1494 symbol_type
1495 make_DST (location_type l)
1496 {
1497 return symbol_type (token::TOKEN_DST, std::move (l));
1498 }
1499#else
1500 static
1501 symbol_type
1503 {
1504 return symbol_type (token::TOKEN_DST, l);
1505 }
1506#endif
1507#if 201103L <= YY_CPLUSPLUS
1508 static
1509 symbol_type
1510 make_LEN (location_type l)
1511 {
1512 return symbol_type (token::TOKEN_LEN, std::move (l));
1513 }
1514#else
1515 static
1516 symbol_type
1518 {
1519 return symbol_type (token::TOKEN_LEN, l);
1520 }
1521#endif
1522#if 201103L <= YY_CPLUSPLUS
1523 static
1524 symbol_type
1525 make_PKT4 (location_type l)
1526 {
1527 return symbol_type (token::TOKEN_PKT4, std::move (l));
1528 }
1529#else
1530 static
1531 symbol_type
1533 {
1534 return symbol_type (token::TOKEN_PKT4, l);
1535 }
1536#endif
1537#if 201103L <= YY_CPLUSPLUS
1538 static
1539 symbol_type
1540 make_CHADDR (location_type l)
1541 {
1542 return symbol_type (token::TOKEN_CHADDR, std::move (l));
1543 }
1544#else
1545 static
1546 symbol_type
1548 {
1549 return symbol_type (token::TOKEN_CHADDR, l);
1550 }
1551#endif
1552#if 201103L <= YY_CPLUSPLUS
1553 static
1554 symbol_type
1555 make_HLEN (location_type l)
1556 {
1557 return symbol_type (token::TOKEN_HLEN, std::move (l));
1558 }
1559#else
1560 static
1561 symbol_type
1563 {
1564 return symbol_type (token::TOKEN_HLEN, l);
1565 }
1566#endif
1567#if 201103L <= YY_CPLUSPLUS
1568 static
1569 symbol_type
1570 make_HTYPE (location_type l)
1571 {
1572 return symbol_type (token::TOKEN_HTYPE, std::move (l));
1573 }
1574#else
1575 static
1576 symbol_type
1578 {
1579 return symbol_type (token::TOKEN_HTYPE, l);
1580 }
1581#endif
1582#if 201103L <= YY_CPLUSPLUS
1583 static
1584 symbol_type
1585 make_CIADDR (location_type l)
1586 {
1587 return symbol_type (token::TOKEN_CIADDR, std::move (l));
1588 }
1589#else
1590 static
1591 symbol_type
1593 {
1594 return symbol_type (token::TOKEN_CIADDR, l);
1595 }
1596#endif
1597#if 201103L <= YY_CPLUSPLUS
1598 static
1599 symbol_type
1600 make_GIADDR (location_type l)
1601 {
1602 return symbol_type (token::TOKEN_GIADDR, std::move (l));
1603 }
1604#else
1605 static
1606 symbol_type
1608 {
1609 return symbol_type (token::TOKEN_GIADDR, l);
1610 }
1611#endif
1612#if 201103L <= YY_CPLUSPLUS
1613 static
1614 symbol_type
1615 make_YIADDR (location_type l)
1616 {
1617 return symbol_type (token::TOKEN_YIADDR, std::move (l));
1618 }
1619#else
1620 static
1621 symbol_type
1623 {
1624 return symbol_type (token::TOKEN_YIADDR, l);
1625 }
1626#endif
1627#if 201103L <= YY_CPLUSPLUS
1628 static
1629 symbol_type
1630 make_SIADDR (location_type l)
1631 {
1632 return symbol_type (token::TOKEN_SIADDR, std::move (l));
1633 }
1634#else
1635 static
1636 symbol_type
1638 {
1639 return symbol_type (token::TOKEN_SIADDR, l);
1640 }
1641#endif
1642#if 201103L <= YY_CPLUSPLUS
1643 static
1644 symbol_type
1645 make_SUBSTRING (location_type l)
1646 {
1647 return symbol_type (token::TOKEN_SUBSTRING, std::move (l));
1648 }
1649#else
1650 static
1651 symbol_type
1653 {
1654 return symbol_type (token::TOKEN_SUBSTRING, l);
1655 }
1656#endif
1657#if 201103L <= YY_CPLUSPLUS
1658 static
1659 symbol_type
1660 make_SPLIT (location_type l)
1661 {
1662 return symbol_type (token::TOKEN_SPLIT, std::move (l));
1663 }
1664#else
1665 static
1666 symbol_type
1668 {
1669 return symbol_type (token::TOKEN_SPLIT, l);
1670 }
1671#endif
1672#if 201103L <= YY_CPLUSPLUS
1673 static
1674 symbol_type
1675 make_ALL (location_type l)
1676 {
1677 return symbol_type (token::TOKEN_ALL, std::move (l));
1678 }
1679#else
1680 static
1681 symbol_type
1683 {
1684 return symbol_type (token::TOKEN_ALL, l);
1685 }
1686#endif
1687#if 201103L <= YY_CPLUSPLUS
1688 static
1689 symbol_type
1690 make_COMA (location_type l)
1691 {
1692 return symbol_type (token::TOKEN_COMA, std::move (l));
1693 }
1694#else
1695 static
1696 symbol_type
1698 {
1699 return symbol_type (token::TOKEN_COMA, l);
1700 }
1701#endif
1702#if 201103L <= YY_CPLUSPLUS
1703 static
1704 symbol_type
1705 make_CONCAT (location_type l)
1706 {
1707 return symbol_type (token::TOKEN_CONCAT, std::move (l));
1708 }
1709#else
1710 static
1711 symbol_type
1713 {
1714 return symbol_type (token::TOKEN_CONCAT, l);
1715 }
1716#endif
1717#if 201103L <= YY_CPLUSPLUS
1718 static
1719 symbol_type
1720 make_PLUS (location_type l)
1721 {
1722 return symbol_type (token::TOKEN_PLUS, std::move (l));
1723 }
1724#else
1725 static
1726 symbol_type
1728 {
1729 return symbol_type (token::TOKEN_PLUS, l);
1730 }
1731#endif
1732#if 201103L <= YY_CPLUSPLUS
1733 static
1734 symbol_type
1735 make_IFELSE (location_type l)
1736 {
1737 return symbol_type (token::TOKEN_IFELSE, std::move (l));
1738 }
1739#else
1740 static
1741 symbol_type
1743 {
1744 return symbol_type (token::TOKEN_IFELSE, l);
1745 }
1746#endif
1747#if 201103L <= YY_CPLUSPLUS
1748 static
1749 symbol_type
1750 make_TOHEXSTRING (location_type l)
1751 {
1752 return symbol_type (token::TOKEN_TOHEXSTRING, std::move (l));
1753 }
1754#else
1755 static
1756 symbol_type
1758 {
1759 return symbol_type (token::TOKEN_TOHEXSTRING, l);
1760 }
1761#endif
1762#if 201103L <= YY_CPLUSPLUS
1763 static
1764 symbol_type
1765 make_ADDRTOTEXT (location_type l)
1766 {
1767 return symbol_type (token::TOKEN_ADDRTOTEXT, std::move (l));
1768 }
1769#else
1770 static
1771 symbol_type
1773 {
1774 return symbol_type (token::TOKEN_ADDRTOTEXT, l);
1775 }
1776#endif
1777#if 201103L <= YY_CPLUSPLUS
1778 static
1779 symbol_type
1780 make_INT8TOTEXT (location_type l)
1781 {
1782 return symbol_type (token::TOKEN_INT8TOTEXT, std::move (l));
1783 }
1784#else
1785 static
1786 symbol_type
1788 {
1789 return symbol_type (token::TOKEN_INT8TOTEXT, l);
1790 }
1791#endif
1792#if 201103L <= YY_CPLUSPLUS
1793 static
1794 symbol_type
1795 make_INT16TOTEXT (location_type l)
1796 {
1797 return symbol_type (token::TOKEN_INT16TOTEXT, std::move (l));
1798 }
1799#else
1800 static
1801 symbol_type
1803 {
1804 return symbol_type (token::TOKEN_INT16TOTEXT, l);
1805 }
1806#endif
1807#if 201103L <= YY_CPLUSPLUS
1808 static
1809 symbol_type
1810 make_INT32TOTEXT (location_type l)
1811 {
1812 return symbol_type (token::TOKEN_INT32TOTEXT, std::move (l));
1813 }
1814#else
1815 static
1816 symbol_type
1818 {
1819 return symbol_type (token::TOKEN_INT32TOTEXT, l);
1820 }
1821#endif
1822#if 201103L <= YY_CPLUSPLUS
1823 static
1824 symbol_type
1825 make_UINT8TOTEXT (location_type l)
1826 {
1827 return symbol_type (token::TOKEN_UINT8TOTEXT, std::move (l));
1828 }
1829#else
1830 static
1831 symbol_type
1833 {
1834 return symbol_type (token::TOKEN_UINT8TOTEXT, l);
1835 }
1836#endif
1837#if 201103L <= YY_CPLUSPLUS
1838 static
1839 symbol_type
1840 make_UINT16TOTEXT (location_type l)
1841 {
1842 return symbol_type (token::TOKEN_UINT16TOTEXT, std::move (l));
1843 }
1844#else
1845 static
1846 symbol_type
1848 {
1849 return symbol_type (token::TOKEN_UINT16TOTEXT, l);
1850 }
1851#endif
1852#if 201103L <= YY_CPLUSPLUS
1853 static
1854 symbol_type
1855 make_UINT32TOTEXT (location_type l)
1856 {
1857 return symbol_type (token::TOKEN_UINT32TOTEXT, std::move (l));
1858 }
1859#else
1860 static
1861 symbol_type
1863 {
1864 return symbol_type (token::TOKEN_UINT32TOTEXT, l);
1865 }
1866#endif
1867#if 201103L <= YY_CPLUSPLUS
1868 static
1869 symbol_type
1870 make_LCASE (location_type l)
1871 {
1872 return symbol_type (token::TOKEN_LCASE, std::move (l));
1873 }
1874#else
1875 static
1876 symbol_type
1878 {
1879 return symbol_type (token::TOKEN_LCASE, l);
1880 }
1881#endif
1882#if 201103L <= YY_CPLUSPLUS
1883 static
1884 symbol_type
1885 make_UCASE (location_type l)
1886 {
1887 return symbol_type (token::TOKEN_UCASE, std::move (l));
1888 }
1889#else
1890 static
1891 symbol_type
1893 {
1894 return symbol_type (token::TOKEN_UCASE, l);
1895 }
1896#endif
1897#if 201103L <= YY_CPLUSPLUS
1898 static
1899 symbol_type
1900 make_PKT6 (location_type l)
1901 {
1902 return symbol_type (token::TOKEN_PKT6, std::move (l));
1903 }
1904#else
1905 static
1906 symbol_type
1908 {
1909 return symbol_type (token::TOKEN_PKT6, l);
1910 }
1911#endif
1912#if 201103L <= YY_CPLUSPLUS
1913 static
1914 symbol_type
1915 make_MSGTYPE (location_type l)
1916 {
1917 return symbol_type (token::TOKEN_MSGTYPE, std::move (l));
1918 }
1919#else
1920 static
1921 symbol_type
1923 {
1924 return symbol_type (token::TOKEN_MSGTYPE, l);
1925 }
1926#endif
1927#if 201103L <= YY_CPLUSPLUS
1928 static
1929 symbol_type
1930 make_TRANSID (location_type l)
1931 {
1932 return symbol_type (token::TOKEN_TRANSID, std::move (l));
1933 }
1934#else
1935 static
1936 symbol_type
1938 {
1939 return symbol_type (token::TOKEN_TRANSID, l);
1940 }
1941#endif
1942#if 201103L <= YY_CPLUSPLUS
1943 static
1944 symbol_type
1945 make_VENDOR_CLASS (location_type l)
1946 {
1947 return symbol_type (token::TOKEN_VENDOR_CLASS, std::move (l));
1948 }
1949#else
1950 static
1951 symbol_type
1953 {
1954 return symbol_type (token::TOKEN_VENDOR_CLASS, l);
1955 }
1956#endif
1957#if 201103L <= YY_CPLUSPLUS
1958 static
1959 symbol_type
1960 make_VENDOR (location_type l)
1961 {
1962 return symbol_type (token::TOKEN_VENDOR, std::move (l));
1963 }
1964#else
1965 static
1966 symbol_type
1968 {
1969 return symbol_type (token::TOKEN_VENDOR, l);
1970 }
1971#endif
1972#if 201103L <= YY_CPLUSPLUS
1973 static
1974 symbol_type
1975 make_ANY (location_type l)
1976 {
1977 return symbol_type (token::TOKEN_ANY, std::move (l));
1978 }
1979#else
1980 static
1981 symbol_type
1983 {
1984 return symbol_type (token::TOKEN_ANY, l);
1985 }
1986#endif
1987#if 201103L <= YY_CPLUSPLUS
1988 static
1989 symbol_type
1990 make_DATA (location_type l)
1991 {
1992 return symbol_type (token::TOKEN_DATA, std::move (l));
1993 }
1994#else
1995 static
1996 symbol_type
1998 {
1999 return symbol_type (token::TOKEN_DATA, l);
2000 }
2001#endif
2002#if 201103L <= YY_CPLUSPLUS
2003 static
2004 symbol_type
2005 make_ENTERPRISE (location_type l)
2006 {
2007 return symbol_type (token::TOKEN_ENTERPRISE, std::move (l));
2008 }
2009#else
2010 static
2011 symbol_type
2013 {
2014 return symbol_type (token::TOKEN_ENTERPRISE, l);
2015 }
2016#endif
2017#if 201103L <= YY_CPLUSPLUS
2018 static
2019 symbol_type
2020 make_MATCH (location_type l)
2021 {
2022 return symbol_type (token::TOKEN_MATCH, std::move (l));
2023 }
2024#else
2025 static
2026 symbol_type
2028 {
2029 return symbol_type (token::TOKEN_MATCH, l);
2030 }
2031#endif
2032#if 201103L <= YY_CPLUSPLUS
2033 static
2034 symbol_type
2035 make_TOPLEVEL_BOOL (location_type l)
2036 {
2037 return symbol_type (token::TOKEN_TOPLEVEL_BOOL, std::move (l));
2038 }
2039#else
2040 static
2041 symbol_type
2043 {
2044 return symbol_type (token::TOKEN_TOPLEVEL_BOOL, l);
2045 }
2046#endif
2047#if 201103L <= YY_CPLUSPLUS
2048 static
2049 symbol_type
2050 make_TOPLEVEL_STRING (location_type l)
2051 {
2052 return symbol_type (token::TOKEN_TOPLEVEL_STRING, std::move (l));
2053 }
2054#else
2055 static
2056 symbol_type
2058 {
2059 return symbol_type (token::TOKEN_TOPLEVEL_STRING, l);
2060 }
2061#endif
2062#if 201103L <= YY_CPLUSPLUS
2063 static
2064 symbol_type
2065 make_STRING (std::string v, location_type l)
2066 {
2067 return symbol_type (token::TOKEN_STRING, std::move (v), std::move (l));
2068 }
2069#else
2070 static
2071 symbol_type
2072 make_STRING (const std::string& v, const location_type& l)
2073 {
2074 return symbol_type (token::TOKEN_STRING, v, l);
2075 }
2076#endif
2077#if 201103L <= YY_CPLUSPLUS
2078 static
2079 symbol_type
2080 make_INTEGER (std::string v, location_type l)
2081 {
2082 return symbol_type (token::TOKEN_INTEGER, std::move (v), std::move (l));
2083 }
2084#else
2085 static
2086 symbol_type
2087 make_INTEGER (const std::string& v, const location_type& l)
2088 {
2089 return symbol_type (token::TOKEN_INTEGER, v, l);
2090 }
2091#endif
2092#if 201103L <= YY_CPLUSPLUS
2093 static
2094 symbol_type
2095 make_HEXSTRING (std::string v, location_type l)
2096 {
2097 return symbol_type (token::TOKEN_HEXSTRING, std::move (v), std::move (l));
2098 }
2099#else
2100 static
2101 symbol_type
2102 make_HEXSTRING (const std::string& v, const location_type& l)
2103 {
2104 return symbol_type (token::TOKEN_HEXSTRING, v, l);
2105 }
2106#endif
2107#if 201103L <= YY_CPLUSPLUS
2108 static
2109 symbol_type
2110 make_OPTION_NAME (std::string v, location_type l)
2111 {
2112 return symbol_type (token::TOKEN_OPTION_NAME, std::move (v), std::move (l));
2113 }
2114#else
2115 static
2116 symbol_type
2117 make_OPTION_NAME (const std::string& v, const location_type& l)
2118 {
2119 return symbol_type (token::TOKEN_OPTION_NAME, v, l);
2120 }
2121#endif
2122#if 201103L <= YY_CPLUSPLUS
2123 static
2124 symbol_type
2125 make_IP_ADDRESS (std::string v, location_type l)
2126 {
2127 return symbol_type (token::TOKEN_IP_ADDRESS, std::move (v), std::move (l));
2128 }
2129#else
2130 static
2131 symbol_type
2132 make_IP_ADDRESS (const std::string& v, const location_type& l)
2133 {
2134 return symbol_type (token::TOKEN_IP_ADDRESS, v, l);
2135 }
2136#endif
2137
2138
2140 {
2141 public:
2142 context (const EvalParser& yyparser, const symbol_type& yyla);
2143 const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; }
2144 symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); }
2145 const location_type& location () const YY_NOEXCEPT { return yyla_.location; }
2146
2150 int expected_tokens (symbol_kind_type yyarg[], int yyargn) const;
2151
2152 private:
2153 const EvalParser& yyparser_;
2154 const symbol_type& yyla_;
2155 };
2156
2157 private:
2158#if YY_CPLUSPLUS < 201103L
2160 EvalParser (const EvalParser&);
2162 EvalParser& operator= (const EvalParser&);
2163#endif
2164
2165
2167 typedef unsigned char state_type;
2168
2170 int yy_syntax_error_arguments_ (const context& yyctx,
2171 symbol_kind_type yyarg[], int yyargn) const;
2172
2175 virtual std::string yysyntax_error_ (const context& yyctx) const;
2179 static state_type yy_lr_goto_state_ (state_type yystate, int yysym);
2180
2183 static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT;
2184
2187 static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT;
2188
2189 static const short yypact_ninf_;
2190 static const signed char yytable_ninf_;
2191
2195 static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT;
2196
2198 static std::string yytnamerr_ (const char *yystr);
2199
2201 static const char* const yytname_[];
2202
2203
2204 // Tables.
2205 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2206 // STATE-NUM.
2207 static const short yypact_[];
2208
2209 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
2210 // Performed when YYTABLE does not specify something else to do. Zero
2211 // means the default is an error.
2212 static const signed char yydefact_[];
2213
2214 // YYPGOTO[NTERM-NUM].
2215 static const short yypgoto_[];
2216
2217 // YYDEFGOTO[NTERM-NUM].
2218 static const unsigned char yydefgoto_[];
2219
2220 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
2221 // positive, shift that token. If negative, reduce the rule whose
2222 // number is the opposite. If YYTABLE_NINF, syntax error.
2223 static const unsigned char yytable_[];
2224
2225 static const short yycheck_[];
2226
2227 // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
2228 // state STATE-NUM.
2229 static const signed char yystos_[];
2230
2231 // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.
2232 static const signed char yyr1_[];
2233
2234 // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.
2235 static const signed char yyr2_[];
2236
2237
2238#if EVALDEBUG
2239 // YYRLINE[YYN] -- Source line where rule number YYN was defined.
2240 static const short yyrline_[];
2242 virtual void yy_reduce_print_ (int r) const;
2244 virtual void yy_stack_print_ () const;
2245
2247 int yydebug_;
2249 std::ostream* yycdebug_;
2250
2254 template <typename Base>
2255 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
2256#endif
2257
2262 template <typename Base>
2263 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
2264
2265 private:
2267 struct by_state
2268 {
2270 by_state () YY_NOEXCEPT;
2271
2273 typedef state_type kind_type;
2274
2276 by_state (kind_type s) YY_NOEXCEPT;
2277
2279 by_state (const by_state& that) YY_NOEXCEPT;
2280
2282 void clear () YY_NOEXCEPT;
2283
2285 void move (by_state& that);
2286
2289 symbol_kind_type kind () const YY_NOEXCEPT;
2290
2293 enum { empty_state = 0 };
2294
2297 state_type state;
2298 };
2299
2301 struct stack_symbol_type : basic_symbol<by_state>
2302 {
2304 typedef basic_symbol<by_state> super_type;
2306 stack_symbol_type ();
2308 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
2310 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
2311#if YY_CPLUSPLUS < 201103L
2314 stack_symbol_type& operator= (stack_symbol_type& that);
2315
2318 stack_symbol_type& operator= (const stack_symbol_type& that);
2319#endif
2320 };
2321
2323 template <typename T, typename S = std::vector<T> >
2324 class stack
2325 {
2326 public:
2327 // Hide our reversed order.
2328 typedef typename S::iterator iterator;
2329 typedef typename S::const_iterator const_iterator;
2330 typedef typename S::size_type size_type;
2331 typedef typename std::ptrdiff_t index_type;
2332
2333 stack (size_type n = 200) YY_NOEXCEPT
2334 : seq_ (n)
2335 {}
2336
2337#if 201103L <= YY_CPLUSPLUS
2339 stack (const stack&) = delete;
2341 stack& operator= (const stack&) = delete;
2342#endif
2343
2347 const T&
2348 operator[] (index_type i) const
2349 {
2350 return seq_[size_type (size () - 1 - i)];
2351 }
2352
2356 T&
2357 operator[] (index_type i)
2358 {
2359 return seq_[size_type (size () - 1 - i)];
2360 }
2361
2365 void
2366 push (YY_MOVE_REF (T) t)
2367 {
2368 seq_.push_back (T ());
2369 operator[] (0).move (t);
2370 }
2371
2373 void
2374 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
2375 {
2376 for (; 0 < n; --n)
2377 seq_.pop_back ();
2378 }
2379
2381 void
2382 clear () YY_NOEXCEPT
2383 {
2384 seq_.clear ();
2385 }
2386
2388 index_type
2389 size () const YY_NOEXCEPT
2390 {
2391 return index_type (seq_.size ());
2392 }
2393
2395 const_iterator
2396 begin () const YY_NOEXCEPT
2397 {
2398 return seq_.begin ();
2399 }
2400
2402 const_iterator
2403 end () const YY_NOEXCEPT
2404 {
2405 return seq_.end ();
2406 }
2407
2409 class slice
2410 {
2411 public:
2412 slice (const stack& stack, index_type range) YY_NOEXCEPT
2413 : stack_ (stack)
2414 , range_ (range)
2415 {}
2416
2417 const T&
2418 operator[] (index_type i) const
2419 {
2420 return stack_[range_ - i];
2421 }
2422
2423 private:
2424 const stack& stack_;
2425 index_type range_;
2426 };
2427
2428 private:
2429#if YY_CPLUSPLUS < 201103L
2431 stack (const stack&);
2433 stack& operator= (const stack&);
2434#endif
2436 S seq_;
2437 };
2438
2439
2441 typedef stack<stack_symbol_type> stack_type;
2442
2444 stack_type yystack_;
2445
2451 void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
2452
2459 void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
2460
2462 void yypop_ (int n = 1) YY_NOEXCEPT;
2463
2465 enum
2466 {
2467 yylast_ = 309,
2468 yynnts_ = 18,
2469 yyfinal_ = 45
2470 };
2471
2472
2473 // User arguments.
2474 EvalContext& ctx;
2475
2476 };
2477
2478 inline
2480 EvalParser::yytranslate_ (int t) YY_NOEXCEPT
2481 {
2482 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
2483 // TOKEN-NUM as returned by yylex.
2484 static
2485 const signed char
2486 translate_table[] =
2487 {
2488 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2500 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2502 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2503 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2506 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2507 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2508 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2509 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2513 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2514 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2515 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2516 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2517 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2518 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2519 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2520 65, 66
2521 };
2522 // Last valid token kind.
2523 const int code_max = 321;
2524
2525 if (t <= 0)
2526 return symbol_kind::S_YYEOF;
2527 else if (t <= code_max)
2528 return static_cast <symbol_kind_type> (translate_table[t]);
2529 else
2531 }
2532
2533 // basic_symbol.
2534 template <typename Base>
2536 : Base (that)
2537 , value ()
2538 , location (that.location)
2539 {
2540 switch (this->kind ())
2541 {
2542 case symbol_kind::S_option_repr_type: // option_repr_type
2544 break;
2545
2546 case symbol_kind::S_pkt4_field: // pkt4_field
2547 value.copy< TokenPkt4::FieldType > (YY_MOVE (that.value));
2548 break;
2549
2550 case symbol_kind::S_pkt6_field: // pkt6_field
2551 value.copy< TokenPkt6::FieldType > (YY_MOVE (that.value));
2552 break;
2553
2554 case symbol_kind::S_pkt_metadata: // pkt_metadata
2555 value.copy< TokenPkt::MetadataType > (YY_MOVE (that.value));
2556 break;
2557
2558 case symbol_kind::S_relay6_field: // relay6_field
2560 break;
2561
2562 case symbol_kind::S_nest_level: // nest_level
2563 value.copy< int8_t > (YY_MOVE (that.value));
2564 break;
2565
2566 case symbol_kind::S_STRING: // "constant string"
2567 case symbol_kind::S_INTEGER: // "integer"
2568 case symbol_kind::S_HEXSTRING: // "constant hexstring"
2569 case symbol_kind::S_OPTION_NAME: // "option name"
2570 case symbol_kind::S_IP_ADDRESS: // "ip address"
2571 value.copy< std::string > (YY_MOVE (that.value));
2572 break;
2573
2574 case symbol_kind::S_option_code: // option_code
2575 case symbol_kind::S_sub_option_code: // sub_option_code
2576 value.copy< uint16_t > (YY_MOVE (that.value));
2577 break;
2578
2579 case symbol_kind::S_integer_expr: // integer_expr
2580 case symbol_kind::S_enterprise_id: // enterprise_id
2581 value.copy< uint32_t > (YY_MOVE (that.value));
2582 break;
2583
2584 default:
2585 break;
2586 }
2587
2588 }
2589
2590
2591
2592
2593 template <typename Base>
2596 {
2597 return this->kind ();
2598 }
2599
2600
2601 template <typename Base>
2602 bool
2604 {
2605 return this->kind () == symbol_kind::S_YYEMPTY;
2606 }
2607
2608 template <typename Base>
2609 void
2611 {
2612 super_type::move (s);
2613 switch (this->kind ())
2614 {
2615 case symbol_kind::S_option_repr_type: // option_repr_type
2616 value.move< TokenOption::RepresentationType > (YY_MOVE (s.value));
2617 break;
2618
2619 case symbol_kind::S_pkt4_field: // pkt4_field
2620 value.move< TokenPkt4::FieldType > (YY_MOVE (s.value));
2621 break;
2622
2623 case symbol_kind::S_pkt6_field: // pkt6_field
2624 value.move< TokenPkt6::FieldType > (YY_MOVE (s.value));
2625 break;
2626
2627 case symbol_kind::S_pkt_metadata: // pkt_metadata
2628 value.move< TokenPkt::MetadataType > (YY_MOVE (s.value));
2629 break;
2630
2631 case symbol_kind::S_relay6_field: // relay6_field
2632 value.move< TokenRelay6Field::FieldType > (YY_MOVE (s.value));
2633 break;
2634
2635 case symbol_kind::S_nest_level: // nest_level
2636 value.move< int8_t > (YY_MOVE (s.value));
2637 break;
2638
2639 case symbol_kind::S_STRING: // "constant string"
2640 case symbol_kind::S_INTEGER: // "integer"
2641 case symbol_kind::S_HEXSTRING: // "constant hexstring"
2642 case symbol_kind::S_OPTION_NAME: // "option name"
2643 case symbol_kind::S_IP_ADDRESS: // "ip address"
2644 value.move< std::string > (YY_MOVE (s.value));
2645 break;
2646
2647 case symbol_kind::S_option_code: // option_code
2648 case symbol_kind::S_sub_option_code: // sub_option_code
2649 value.move< uint16_t > (YY_MOVE (s.value));
2650 break;
2651
2652 case symbol_kind::S_integer_expr: // integer_expr
2653 case symbol_kind::S_enterprise_id: // enterprise_id
2654 value.move< uint32_t > (YY_MOVE (s.value));
2655 break;
2656
2657 default:
2658 break;
2659 }
2660
2661 location = YY_MOVE (s.location);
2662 }
2663
2664 // by_kind.
2665 inline
2667 : kind_ (symbol_kind::S_YYEMPTY)
2668 {}
2669
2670#if 201103L <= YY_CPLUSPLUS
2671 inline
2673 : kind_ (that.kind_)
2674 {
2675 that.clear ();
2676 }
2677#endif
2678
2679 inline
2681 : kind_ (that.kind_)
2682 {}
2683
2684 inline
2686 : kind_ (yytranslate_ (t))
2687 {}
2688
2689
2690
2691 inline
2692 void
2697
2698 inline
2699 void
2701 {
2702 kind_ = that.kind_;
2703 that.clear ();
2704 }
2705
2706 inline
2709 {
2710 return kind_;
2711 }
2712
2713
2714 inline
2717 {
2718 return this->kind ();
2719 }
2720
2721
2722#line 14 "parser.yy"
2723} } // isc::eval
2724#line 2725 "parser.h"
2725
2726
2727
2728
2729#endif // !YY_EVAL_PARSER_H_INCLUDED
#define YY_RVREF(Type)
#define YY_MOVE_REF(Type)
#define YY_NOEXCEPT
#define YY_ATTRIBUTE_PURE
#define YY_MOVE
#define YY_NOTHROW
RepresentationType
Token representation type.
Definition token.h:386
FieldType
enum value that determines the field.
Definition token.h:594
FieldType
enum value that determines the field.
Definition token.h:647
MetadataType
enum value that determines the field.
Definition token.h:545
FieldType
enum value that determines the field.
Definition token.h:699
Evaluation context, an interface to the expression evaluation.
const location_type & location() const YY_NOEXCEPT
Definition parser.h:2145
const symbol_type & lookahead() const YY_NOEXCEPT
Definition parser.h:2143
symbol_kind_type token() const YY_NOEXCEPT
Definition parser.h:2144
Present a slice of the top of a stack.
Definition parser.h:2410
slice(const stack &stack, index_type range) YY_NOEXCEPT
Definition parser.h:2412
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:468
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:470
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:1307
static symbol_type make_INT8TOTEXT(const location_type &l)
Definition parser.h:1787
static symbol_type make_CONCAT(const location_type &l)
Definition parser.h:1712
static symbol_type make_TEXT(const location_type &l)
Definition parser.h:1412
static symbol_type make_OPTION(const location_type &l)
Definition parser.h:1277
static symbol_type make_AND(const location_type &l)
Definition parser.h:1232
static symbol_type make_HTYPE(const location_type &l)
Definition parser.h:1577
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
Definition parser.h:682
static symbol_type make_MSGTYPE(const location_type &l)
Definition parser.h:1922
static symbol_type make_LINKADDR(const location_type &l)
Definition parser.h:1352
static symbol_type make_TOHEXSTRING(const location_type &l)
Definition parser.h:1757
static symbol_type make_EVALerror(const location_type &l)
Definition parser.h:1157
static symbol_type make_PKT6(const location_type &l)
Definition parser.h:1907
static symbol_type make_END(const location_type &l)
Definition parser.h:1142
static symbol_type make_DST(const location_type &l)
Definition parser.h:1502
static symbol_type make_OR(const location_type &l)
Definition parser.h:1247
static symbol_type make_PLUS(const location_type &l)
Definition parser.h:1727
static symbol_type make_RBRACKET(const location_type &l)
Definition parser.h:1382
static symbol_type make_NOT(const location_type &l)
Definition parser.h:1217
static symbol_type make_INT32TOTEXT(const location_type &l)
Definition parser.h:1817
static symbol_type make_SIADDR(const location_type &l)
Definition parser.h:1637
static symbol_type make_PKT4(const location_type &l)
Definition parser.h:1532
static symbol_type make_IP_ADDRESS(const std::string &v, const location_type &l)
Definition parser.h:2132
static symbol_type make_UINT16TOTEXT(const location_type &l)
Definition parser.h:1847
static symbol_type make_STRING(const std::string &v, const location_type &l)
Definition parser.h:2072
static symbol_type make_TOPLEVEL_BOOL(const location_type &l)
Definition parser.h:2042
static symbol_type make_LPAREN(const location_type &l)
Definition parser.h:1187
static symbol_type make_TOPLEVEL_STRING(const location_type &l)
Definition parser.h:2057
static symbol_type make_GIADDR(const location_type &l)
Definition parser.h:1607
static symbol_type make_MATCH(const location_type &l)
Definition parser.h:2027
static symbol_type make_DATA(const location_type &l)
Definition parser.h:1997
static symbol_type make_CHADDR(const location_type &l)
Definition parser.h:1547
static symbol_type make_INT16TOTEXT(const location_type &l)
Definition parser.h:1802
static symbol_type make_LBRACKET(const location_type &l)
Definition parser.h:1367
static symbol_type make_LEN(const location_type &l)
Definition parser.h:1517
static symbol_type make_IFACE(const location_type &l)
Definition parser.h:1472
static symbol_type make_ANY(const location_type &l)
Definition parser.h:1982
static symbol_type make_DOT(const location_type &l)
Definition parser.h:1397
static symbol_type make_HLEN(const location_type &l)
Definition parser.h:1562
static symbol_type make_ALL(const location_type &l)
Definition parser.h:1682
static symbol_type make_UCASE(const location_type &l)
Definition parser.h:1892
static symbol_type make_COMA(const location_type &l)
Definition parser.h:1697
static symbol_type make_IFELSE(const location_type &l)
Definition parser.h:1742
location location_type
Symbol locations.
Definition parser.h:482
static symbol_type make_YIADDR(const location_type &l)
Definition parser.h:1622
static symbol_type make_SRC(const location_type &l)
Definition parser.h:1487
static symbol_type make_INTEGER(const std::string &v, const location_type &l)
Definition parser.h:2087
static symbol_type make_EQUAL(const location_type &l)
Definition parser.h:1262
token::token_kind_type token_kind_type
Token kind, as returned by yylex.
Definition parser.h:581
static symbol_type make_EXISTS(const location_type &l)
Definition parser.h:1442
static symbol_type make_TRANSID(const location_type &l)
Definition parser.h:1937
token_kind_type token_type
Backward compatibility alias (Bison 3.6).
Definition parser.h:584
static symbol_type make_ADDRTOTEXT(const location_type &l)
Definition parser.h:1772
static symbol_type make_LCASE(const location_type &l)
Definition parser.h:1877
static symbol_type make_RELAY4(const location_type &l)
Definition parser.h:1292
static symbol_type make_PKT(const location_type &l)
Definition parser.h:1457
static symbol_type make_CIADDR(const location_type &l)
Definition parser.h:1592
static symbol_type make_HEXSTRING(const std::string &v, const location_type &l)
Definition parser.h:2102
static symbol_type make_EVALUNDEF(const location_type &l)
Definition parser.h:1172
static symbol_type make_OPTION_NAME(const std::string &v, const location_type &l)
Definition parser.h:2117
static symbol_type make_MEMBER(const location_type &l)
Definition parser.h:1322
static symbol_type make_UINT32TOTEXT(const location_type &l)
Definition parser.h:1862
static symbol_type make_SPLIT(const location_type &l)
Definition parser.h:1667
static symbol_type make_ENTERPRISE(const location_type &l)
Definition parser.h:2012
static symbol_type make_VENDOR(const location_type &l)
Definition parser.h:1967
value_type semantic_type
Backward compatibility (Bison 3.8).
Definition parser.h:479
static symbol_type make_RPAREN(const location_type &l)
Definition parser.h:1202
static symbol_type make_PEERADDR(const location_type &l)
Definition parser.h:1337
static const symbol_kind_type YYNTOKENS
The number of tokens.
Definition parser.h:685
static symbol_type make_SUBSTRING(const location_type &l)
Definition parser.h:1652
static symbol_type make_VENDOR_CLASS(const location_type &l)
Definition parser.h:1952
static symbol_type make_HEX(const location_type &l)
Definition parser.h:1427
static symbol_type make_UINT8TOTEXT(const location_type &l)
Definition parser.h:1832
static std::string symbol_name(symbol_kind_type yysymbol)
The user-facing name of the symbol whose (internal) number is YYSYMBOL.
Definition parser.cc:1844
Forward declaration of the EvalContext class.
@ error
Definition db_log.h:118
Defines the logger used by the top-level component of kea-lfc.
#define EVAL_ASSERT
Definition parser.h:108
void move(basic_symbol &s)
Destructive move, s is emptied into this.
Definition parser.h:2610
location_type location
The location.
Definition parser.h:997
Base super_type
Alias to Base.
Definition parser.h:697
basic_symbol(typename Base::kind_type t, const TokenPkt4::FieldType &v, const location_type &l)
Definition parser.h:800
basic_symbol(typename Base::kind_type t, const uint32_t &v, const location_type &l)
Definition parser.h:898
value_type value
The semantic value.
Definition parser.h:994
basic_symbol(typename Base::kind_type t, const TokenPkt6::FieldType &v, const location_type &l)
Definition parser.h:814
~basic_symbol()
Destroy the symbol.
Definition parser.h:906
bool empty() const YY_NOEXCEPT
Whether empty.
Definition parser.h:2603
symbol_kind_type type_get() const YY_NOEXCEPT
Backward compatibility (Bison 3.6).
Definition parser.h:2595
basic_symbol(typename Base::kind_type t, const uint16_t &v, const location_type &l)
Definition parser.h:884
basic_symbol(typename Base::kind_type t, const TokenPkt::MetadataType &v, const location_type &l)
Definition parser.h:828
std::string name() const YY_NOEXCEPT
The user-facing name of this symbol.
Definition parser.h:979
basic_symbol(typename Base::kind_type t, const TokenOption::RepresentationType &v, const location_type &l)
Definition parser.h:786
basic_symbol(typename Base::kind_type t, const std::string &v, const location_type &l)
Definition parser.h:870
void clear() YY_NOEXCEPT
Destroy contents, and record that is empty.
Definition parser.h:914
basic_symbol() YY_NOEXCEPT
Default constructor.
Definition parser.h:700
basic_symbol(typename Base::kind_type t, const TokenRelay6Field::FieldType &v, const location_type &l)
Definition parser.h:842
basic_symbol(typename Base::kind_type t, const location_type &l)
Constructors for typed symbols.
Definition parser.h:773
basic_symbol(typename Base::kind_type t, const int8_t &v, const location_type &l)
Definition parser.h:856
Type access provider for token (enum) based symbols.
Definition parser.h:1008
symbol_kind_type type_get() const YY_NOEXCEPT
Backward compatibility (Bison 3.6).
Definition parser.h:2716
token_kind_type kind_type
The symbol kind as needed by the constructor.
Definition parser.h:1010
by_kind() YY_NOEXCEPT
Default constructor.
Definition parser.h:2666
void clear() YY_NOEXCEPT
Record that this symbol is empty.
Definition parser.h:2693
symbol_kind_type kind() const YY_NOEXCEPT
The (internal) type number (corresponding to type).
Definition parser.h:2708
void move(by_kind &that)
Steal the symbol kind from that.
Definition parser.h:2700
@ YYNTOKENS
Number of tokens.
Definition parser.h:591
"External" symbols: returned by the scanner.
Definition parser.h:1051
symbol_type() YY_NOEXCEPT
Empty symbol.
Definition parser.h:1056
basic_symbol< by_kind > super_type
Superclass.
Definition parser.h:1053
Syntax errors thrown from user actions.
Definition parser.h:486
syntax_error(const location_type &l, const std::string &m)
Definition parser.h:487
syntax_error(const syntax_error &s)
Definition parser.h:492
~syntax_error() YY_NOEXCEPT YY_NOTHROW
Definition parser.cc:165
token_kind_type yytokentype
Backward compatibility alias (Bison 3.6).
Definition parser.h:577