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