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