Kea 2.0.0
parser.h
Go to the documentation of this file.
1// A Bison parser, made by GNU Bison 3.7.6.
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#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
136/* Suppress an incorrect diagnostic about yylval being uninitialized. */
137# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
138 _Pragma ("GCC diagnostic push") \
139 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
140 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
141# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
142 _Pragma ("GCC diagnostic pop")
143#else
144# define YY_INITIAL_VALUE(Value) Value
145#endif
146#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
147# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
148# define YY_IGNORE_MAYBE_UNINITIALIZED_END
149#endif
150#ifndef YY_INITIAL_VALUE
151# define YY_INITIAL_VALUE(Value) /* Nothing. */
152#endif
153
154#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
155# define YY_IGNORE_USELESS_CAST_BEGIN \
156 _Pragma ("GCC diagnostic push") \
157 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
158# define YY_IGNORE_USELESS_CAST_END \
159 _Pragma ("GCC diagnostic pop")
160#endif
161#ifndef YY_IGNORE_USELESS_CAST_BEGIN
162# define YY_IGNORE_USELESS_CAST_BEGIN
163# define YY_IGNORE_USELESS_CAST_END
164#endif
165
166# ifndef YY_CAST
167# ifdef __cplusplus
168# define YY_CAST(Type, Val) static_cast<Type> (Val)
169# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
170# else
171# define YY_CAST(Type, Val) ((Type) (Val))
172# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
173# endif
174# endif
175# ifndef YY_NULLPTR
176# if defined __cplusplus
177# if 201103L <= __cplusplus
178# define YY_NULLPTR nullptr
179# else
180# define YY_NULLPTR 0
181# endif
182# else
183# define YY_NULLPTR ((void*)0)
184# endif
185# endif
186
187/* Debug traces. */
188#ifndef EVALDEBUG
189# if defined YYDEBUG
190#if YYDEBUG
191# define EVALDEBUG 1
192# else
193# define EVALDEBUG 0
194# endif
195# else /* ! defined YYDEBUG */
196# define EVALDEBUG 1
197# endif /* ! defined YYDEBUG */
198#endif /* ! defined EVALDEBUG */
199
200#line 14 "parser.yy"
201namespace isc { namespace eval {
202#line 203 "parser.h"
203
204
205
206
209 {
210 public:
211#ifndef EVALSTYPE
218 {
219 public:
222
225 : yybuffer_ ()
226 , yytypeid_ (YY_NULLPTR)
227 {}
228
230 template <typename T>
232 : yytypeid_ (&typeid (T))
233 {
234 EVAL_ASSERT (sizeof (T) <= size);
235 new (yyas_<T> ()) T (YY_MOVE (t));
236 }
237
238#if 201103L <= YY_CPLUSPLUS
240 semantic_type (const self_type&) = delete;
242 self_type& operator= (const self_type&) = delete;
243#endif
244
247 {
248 EVAL_ASSERT (!yytypeid_);
249 }
250
251# if 201103L <= YY_CPLUSPLUS
253 template <typename T, typename... U>
254 T&
255 emplace (U&&... u)
256 {
257 EVAL_ASSERT (!yytypeid_);
258 EVAL_ASSERT (sizeof (T) <= size);
259 yytypeid_ = & typeid (T);
260 return *new (yyas_<T> ()) T (std::forward <U>(u)...);
261 }
262# else
264 template <typename T>
265 T&
267 {
268 EVAL_ASSERT (!yytypeid_);
269 EVAL_ASSERT (sizeof (T) <= size);
270 yytypeid_ = & typeid (T);
271 return *new (yyas_<T> ()) T ();
272 }
273
275 template <typename T>
276 T&
277 emplace (const T& t)
278 {
279 EVAL_ASSERT (!yytypeid_);
280 EVAL_ASSERT (sizeof (T) <= size);
281 yytypeid_ = & typeid (T);
282 return *new (yyas_<T> ()) T (t);
283 }
284# endif
285
288 template <typename T>
289 T&
291 {
292 return emplace<T> ();
293 }
294
297 template <typename T>
298 T&
299 build (const T& t)
300 {
301 return emplace<T> (t);
302 }
303
305 template <typename T>
306 T&
308 {
309 EVAL_ASSERT (yytypeid_);
310 EVAL_ASSERT (*yytypeid_ == typeid (T));
311 EVAL_ASSERT (sizeof (T) <= size);
312 return *yyas_<T> ();
313 }
314
316 template <typename T>
317 const T&
319 {
320 EVAL_ASSERT (yytypeid_);
321 EVAL_ASSERT (*yytypeid_ == typeid (T));
322 EVAL_ASSERT (sizeof (T) <= size);
323 return *yyas_<T> ();
324 }
325
334 template <typename T>
335 void
337 {
338 EVAL_ASSERT (yytypeid_);
339 EVAL_ASSERT (*yytypeid_ == *that.yytypeid_);
340 std::swap (as<T> (), that.as<T> ());
341 }
342
346 template <typename T>
347 void
349 {
350# if 201103L <= YY_CPLUSPLUS
351 emplace<T> (std::move (that.as<T> ()));
352# else
353 emplace<T> ();
354 swap<T> (that);
355# endif
356 that.destroy<T> ();
357 }
358
359# if 201103L <= YY_CPLUSPLUS
361 template <typename T>
362 void
363 move (self_type&& that)
364 {
365 emplace<T> (std::move (that.as<T> ()));
366 that.destroy<T> ();
367 }
368#endif
369
371 template <typename T>
372 void
373 copy (const self_type& that)
374 {
375 emplace<T> (that.as<T> ());
376 }
377
379 template <typename T>
380 void
382 {
383 as<T> ().~T ();
384 yytypeid_ = YY_NULLPTR;
385 }
386
387 private:
388#if YY_CPLUSPLUS < 201103L
390 semantic_type (const self_type&);
392 self_type& operator= (const self_type&);
393#endif
394
396 template <typename T>
397 T*
398 yyas_ () YY_NOEXCEPT
399 {
400 void *yyp = yybuffer_.yyraw;
401 return static_cast<T*> (yyp);
402 }
403
405 template <typename T>
406 const T*
407 yyas_ () const YY_NOEXCEPT
408 {
409 const void *yyp = yybuffer_.yyraw;
410 return static_cast<const T*> (yyp);
411 }
412
414 union union_type
415 {
416 // option_repr_type
417 char dummy1[sizeof (TokenOption::RepresentationType)];
418
419 // pkt4_field
420 char dummy2[sizeof (TokenPkt4::FieldType)];
421
422 // pkt6_field
423 char dummy3[sizeof (TokenPkt6::FieldType)];
424
425 // pkt_metadata
426 char dummy4[sizeof (TokenPkt::MetadataType)];
427
428 // relay6_field
429 char dummy5[sizeof (TokenRelay6Field::FieldType)];
430
431 // nest_level
432 char dummy6[sizeof (int8_t)];
433
434 // "constant string"
435 // "integer"
436 // "constant hexstring"
437 // "option name"
438 // "ip address"
439 char dummy7[sizeof (std::string)];
440
441 // option_code
442 // sub_option_code
443 char dummy8[sizeof (uint16_t)];
444
445 // integer_expr
446 // enterprise_id
447 char dummy9[sizeof (uint32_t)];
448 };
449
451 enum { size = sizeof (union_type) };
452
454 union
455 {
457 long double yyalign_me;
459 char yyraw[size];
460 } yybuffer_;
461
463 const std::type_info *yytypeid_;
464 };
465
466#else
467 typedef EVALSTYPE semantic_type;
468#endif
470 typedef location location_type;
471
473 struct syntax_error : std::runtime_error
474 {
475 syntax_error (const location_type& l, const std::string& m)
476 : std::runtime_error (m)
477 , location (l)
478 {}
479
481 : std::runtime_error (s.what ())
482 , location (s.location)
483 {}
484
486
488 };
489
491 struct token
492 {
494 {
495 TOKEN_EVALEMPTY = -2,
496 TOKEN_END = 0, // "end of file"
497 TOKEN_EVALerror = 256, // error
498 TOKEN_EVALUNDEF = 257, // "invalid token"
499 TOKEN_LPAREN = 258, // "("
500 TOKEN_RPAREN = 259, // ")"
501 TOKEN_NOT = 260, // "not"
502 TOKEN_AND = 261, // "and"
503 TOKEN_OR = 262, // "or"
504 TOKEN_EQUAL = 263, // "=="
505 TOKEN_OPTION = 264, // "option"
506 TOKEN_RELAY4 = 265, // "relay4"
507 TOKEN_RELAY6 = 266, // "relay6"
508 TOKEN_MEMBER = 267, // "member"
509 TOKEN_PEERADDR = 268, // "peeraddr"
510 TOKEN_LINKADDR = 269, // "linkaddr"
511 TOKEN_LBRACKET = 270, // "["
512 TOKEN_RBRACKET = 271, // "]"
513 TOKEN_DOT = 272, // "."
514 TOKEN_TEXT = 273, // "text"
515 TOKEN_HEX = 274, // "hex"
516 TOKEN_EXISTS = 275, // "exists"
517 TOKEN_PKT = 276, // "pkt"
518 TOKEN_IFACE = 277, // "iface"
519 TOKEN_SRC = 278, // "src"
520 TOKEN_DST = 279, // "dst"
521 TOKEN_LEN = 280, // "len"
522 TOKEN_PKT4 = 281, // "pkt4"
523 TOKEN_CHADDR = 282, // "mac"
524 TOKEN_HLEN = 283, // "hlen"
525 TOKEN_HTYPE = 284, // "htype"
526 TOKEN_CIADDR = 285, // "ciaddr"
527 TOKEN_GIADDR = 286, // "giaddr"
528 TOKEN_YIADDR = 287, // "yiaddr"
529 TOKEN_SIADDR = 288, // "siaddr"
530 TOKEN_SUBSTRING = 289, // "substring"
531 TOKEN_ALL = 290, // "all"
532 TOKEN_COMA = 291, // ","
533 TOKEN_CONCAT = 292, // "concat"
534 TOKEN_PLUS = 293, // "+"
535 TOKEN_IFELSE = 294, // "ifelse"
536 TOKEN_TOHEXSTRING = 295, // "hexstring"
537 TOKEN_ADDRTOTEXT = 296, // "addrtotext"
538 TOKEN_INT8TOTEXT = 297, // "int8totext"
539 TOKEN_INT16TOTEXT = 298, // "int16totext"
540 TOKEN_INT32TOTEXT = 299, // "int32totext"
541 TOKEN_UINT8TOTEXT = 300, // "uint8totext"
542 TOKEN_UINT16TOTEXT = 301, // "uint16totext"
543 TOKEN_UINT32TOTEXT = 302, // "uint32totext"
544 TOKEN_PKT6 = 303, // "pkt6"
545 TOKEN_MSGTYPE = 304, // "msgtype"
546 TOKEN_TRANSID = 305, // "transid"
547 TOKEN_VENDOR_CLASS = 306, // "vendor-class"
548 TOKEN_VENDOR = 307, // "vendor"
549 TOKEN_ANY = 308, // "*"
550 TOKEN_DATA = 309, // "data"
551 TOKEN_ENTERPRISE = 310, // "enterprise"
552 TOKEN_TOPLEVEL_BOOL = 311, // "top-level bool"
553 TOKEN_TOPLEVEL_STRING = 312, // "top-level string"
554 TOKEN_STRING = 313, // "constant string"
555 TOKEN_INTEGER = 314, // "integer"
556 TOKEN_HEXSTRING = 315, // "constant hexstring"
557 TOKEN_OPTION_NAME = 316, // "option name"
558 TOKEN_IP_ADDRESS = 317 // "ip address"
559 };
562 };
563
566
569
572 {
574 {
576 S_YYEMPTY = -2,
577 S_YYEOF = 0, // "end of file"
578 S_YYerror = 1, // error
579 S_YYUNDEF = 2, // "invalid token"
580 S_LPAREN = 3, // "("
581 S_RPAREN = 4, // ")"
582 S_NOT = 5, // "not"
583 S_AND = 6, // "and"
584 S_OR = 7, // "or"
585 S_EQUAL = 8, // "=="
586 S_OPTION = 9, // "option"
587 S_RELAY4 = 10, // "relay4"
588 S_RELAY6 = 11, // "relay6"
589 S_MEMBER = 12, // "member"
590 S_PEERADDR = 13, // "peeraddr"
591 S_LINKADDR = 14, // "linkaddr"
592 S_LBRACKET = 15, // "["
593 S_RBRACKET = 16, // "]"
594 S_DOT = 17, // "."
595 S_TEXT = 18, // "text"
596 S_HEX = 19, // "hex"
597 S_EXISTS = 20, // "exists"
598 S_PKT = 21, // "pkt"
599 S_IFACE = 22, // "iface"
600 S_SRC = 23, // "src"
601 S_DST = 24, // "dst"
602 S_LEN = 25, // "len"
603 S_PKT4 = 26, // "pkt4"
604 S_CHADDR = 27, // "mac"
605 S_HLEN = 28, // "hlen"
606 S_HTYPE = 29, // "htype"
607 S_CIADDR = 30, // "ciaddr"
608 S_GIADDR = 31, // "giaddr"
609 S_YIADDR = 32, // "yiaddr"
610 S_SIADDR = 33, // "siaddr"
611 S_SUBSTRING = 34, // "substring"
612 S_ALL = 35, // "all"
613 S_COMA = 36, // ","
614 S_CONCAT = 37, // "concat"
615 S_PLUS = 38, // "+"
616 S_IFELSE = 39, // "ifelse"
617 S_TOHEXSTRING = 40, // "hexstring"
618 S_ADDRTOTEXT = 41, // "addrtotext"
619 S_INT8TOTEXT = 42, // "int8totext"
620 S_INT16TOTEXT = 43, // "int16totext"
621 S_INT32TOTEXT = 44, // "int32totext"
622 S_UINT8TOTEXT = 45, // "uint8totext"
623 S_UINT16TOTEXT = 46, // "uint16totext"
624 S_UINT32TOTEXT = 47, // "uint32totext"
625 S_PKT6 = 48, // "pkt6"
626 S_MSGTYPE = 49, // "msgtype"
627 S_TRANSID = 50, // "transid"
628 S_VENDOR_CLASS = 51, // "vendor-class"
629 S_VENDOR = 52, // "vendor"
630 S_ANY = 53, // "*"
631 S_DATA = 54, // "data"
632 S_ENTERPRISE = 55, // "enterprise"
633 S_TOPLEVEL_BOOL = 56, // "top-level bool"
634 S_TOPLEVEL_STRING = 57, // "top-level string"
635 S_STRING = 58, // "constant string"
636 S_INTEGER = 59, // "integer"
637 S_HEXSTRING = 60, // "constant hexstring"
638 S_OPTION_NAME = 61, // "option name"
639 S_IP_ADDRESS = 62, // "ip address"
640 S_YYACCEPT = 63, // $accept
641 S_start = 64, // start
642 S_expression = 65, // expression
643 S_bool_expr = 66, // bool_expr
644 S_string_expr = 67, // string_expr
645 S_integer_expr = 68, // integer_expr
646 S_option_code = 69, // option_code
647 S_sub_option_code = 70, // sub_option_code
648 S_option_repr_type = 71, // option_repr_type
649 S_nest_level = 72, // nest_level
650 S_pkt_metadata = 73, // pkt_metadata
651 S_enterprise_id = 74, // enterprise_id
652 S_pkt4_field = 75, // pkt4_field
653 S_pkt6_field = 76, // pkt6_field
654 S_relay6_field = 77, // relay6_field
655 S_start_expr = 78, // start_expr
656 S_length_expr = 79 // length_expr
657 };
658 };
659
662
665
672 template <typename Base>
673 struct basic_symbol : Base
674 {
676 typedef Base super_type;
677
680 : value ()
681 , location ()
682 {}
683
684#if 201103L <= YY_CPLUSPLUS
687 : Base (std::move (that))
688 , value ()
689 , location (std::move (that.location))
690 {
691 switch (this->kind ())
692 {
693 case symbol_kind::S_option_repr_type: // option_repr_type
694 value.move< TokenOption::RepresentationType > (std::move (that.value));
695 break;
696
697 case symbol_kind::S_pkt4_field: // pkt4_field
698 value.move< TokenPkt4::FieldType > (std::move (that.value));
699 break;
700
701 case symbol_kind::S_pkt6_field: // pkt6_field
702 value.move< TokenPkt6::FieldType > (std::move (that.value));
703 break;
704
705 case symbol_kind::S_pkt_metadata: // pkt_metadata
706 value.move< TokenPkt::MetadataType > (std::move (that.value));
707 break;
708
709 case symbol_kind::S_relay6_field: // relay6_field
710 value.move< TokenRelay6Field::FieldType > (std::move (that.value));
711 break;
712
713 case symbol_kind::S_nest_level: // nest_level
714 value.move< int8_t > (std::move (that.value));
715 break;
716
717 case symbol_kind::S_STRING: // "constant string"
718 case symbol_kind::S_INTEGER: // "integer"
719 case symbol_kind::S_HEXSTRING: // "constant hexstring"
720 case symbol_kind::S_OPTION_NAME: // "option name"
721 case symbol_kind::S_IP_ADDRESS: // "ip address"
722 value.move< std::string > (std::move (that.value));
723 break;
724
725 case symbol_kind::S_option_code: // option_code
726 case symbol_kind::S_sub_option_code: // sub_option_code
727 value.move< uint16_t > (std::move (that.value));
728 break;
729
730 case symbol_kind::S_integer_expr: // integer_expr
731 case symbol_kind::S_enterprise_id: // enterprise_id
732 value.move< uint32_t > (std::move (that.value));
733 break;
734
735 default:
736 break;
737 }
738
739 }
740#endif
741
743 basic_symbol (const basic_symbol& that);
744
746#if 201103L <= YY_CPLUSPLUS
747 basic_symbol (typename Base::kind_type t, location_type&& l)
748 : Base (t)
749 , location (std::move (l))
750 {}
751#else
752 basic_symbol (typename Base::kind_type t, const location_type& l)
753 : Base (t)
754 , location (l)
755 {}
756#endif
757
758#if 201103L <= YY_CPLUSPLUS
759 basic_symbol (typename Base::kind_type t, TokenOption::RepresentationType&& v, location_type&& l)
760 : Base (t)
761 , value (std::move (v))
762 , location (std::move (l))
763 {}
764#else
765 basic_symbol (typename Base::kind_type t, const TokenOption::RepresentationType& v, const location_type& l)
766 : Base (t)
767 , value (v)
768 , location (l)
769 {}
770#endif
771
772#if 201103L <= YY_CPLUSPLUS
773 basic_symbol (typename Base::kind_type t, TokenPkt4::FieldType&& v, location_type&& l)
774 : Base (t)
775 , value (std::move (v))
776 , location (std::move (l))
777 {}
778#else
779 basic_symbol (typename Base::kind_type t, const TokenPkt4::FieldType& v, const location_type& l)
780 : Base (t)
781 , value (v)
782 , location (l)
783 {}
784#endif
785
786#if 201103L <= YY_CPLUSPLUS
787 basic_symbol (typename Base::kind_type t, TokenPkt6::FieldType&& v, location_type&& l)
788 : Base (t)
789 , value (std::move (v))
790 , location (std::move (l))
791 {}
792#else
793 basic_symbol (typename Base::kind_type t, const TokenPkt6::FieldType& v, const location_type& l)
794 : Base (t)
795 , value (v)
796 , location (l)
797 {}
798#endif
799
800#if 201103L <= YY_CPLUSPLUS
801 basic_symbol (typename Base::kind_type t, TokenPkt::MetadataType&& v, location_type&& l)
802 : Base (t)
803 , value (std::move (v))
804 , location (std::move (l))
805 {}
806#else
807 basic_symbol (typename Base::kind_type t, const TokenPkt::MetadataType& v, const location_type& l)
808 : Base (t)
809 , value (v)
810 , location (l)
811 {}
812#endif
813
814#if 201103L <= YY_CPLUSPLUS
815 basic_symbol (typename Base::kind_type t, TokenRelay6Field::FieldType&& v, location_type&& l)
816 : Base (t)
817 , value (std::move (v))
818 , location (std::move (l))
819 {}
820#else
821 basic_symbol (typename Base::kind_type t, const TokenRelay6Field::FieldType& v, const location_type& l)
822 : Base (t)
823 , value (v)
824 , location (l)
825 {}
826#endif
827
828#if 201103L <= YY_CPLUSPLUS
829 basic_symbol (typename Base::kind_type t, int8_t&& v, location_type&& l)
830 : Base (t)
831 , value (std::move (v))
832 , location (std::move (l))
833 {}
834#else
835 basic_symbol (typename Base::kind_type t, const int8_t& v, const location_type& l)
836 : Base (t)
837 , value (v)
838 , location (l)
839 {}
840#endif
841
842#if 201103L <= YY_CPLUSPLUS
843 basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l)
844 : Base (t)
845 , value (std::move (v))
846 , location (std::move (l))
847 {}
848#else
849 basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
850 : Base (t)
851 , value (v)
852 , location (l)
853 {}
854#endif
855
856#if 201103L <= YY_CPLUSPLUS
857 basic_symbol (typename Base::kind_type t, uint16_t&& v, location_type&& l)
858 : Base (t)
859 , value (std::move (v))
860 , location (std::move (l))
861 {}
862#else
863 basic_symbol (typename Base::kind_type t, const uint16_t& v, const location_type& l)
864 : Base (t)
865 , value (v)
866 , location (l)
867 {}
868#endif
869
870#if 201103L <= YY_CPLUSPLUS
871 basic_symbol (typename Base::kind_type t, uint32_t&& v, location_type&& l)
872 : Base (t)
873 , value (std::move (v))
874 , location (std::move (l))
875 {}
876#else
877 basic_symbol (typename Base::kind_type t, const uint32_t& v, const location_type& l)
878 : Base (t)
879 , value (v)
880 , location (l)
881 {}
882#endif
883
886 {
887 clear ();
888 }
889
892 {
893 // User destructor.
894 symbol_kind_type yykind = this->kind ();
895 basic_symbol<Base>& yysym = *this;
896 (void) yysym;
897 switch (yykind)
898 {
899 default:
900 break;
901 }
902
903 // Value type destructor.
904switch (yykind)
905 {
906 case symbol_kind::S_option_repr_type: // option_repr_type
907 value.template destroy< TokenOption::RepresentationType > ();
908 break;
909
910 case symbol_kind::S_pkt4_field: // pkt4_field
911 value.template destroy< TokenPkt4::FieldType > ();
912 break;
913
914 case symbol_kind::S_pkt6_field: // pkt6_field
915 value.template destroy< TokenPkt6::FieldType > ();
916 break;
917
918 case symbol_kind::S_pkt_metadata: // pkt_metadata
919 value.template destroy< TokenPkt::MetadataType > ();
920 break;
921
922 case symbol_kind::S_relay6_field: // relay6_field
923 value.template destroy< TokenRelay6Field::FieldType > ();
924 break;
925
926 case symbol_kind::S_nest_level: // nest_level
927 value.template destroy< int8_t > ();
928 break;
929
930 case symbol_kind::S_STRING: // "constant string"
931 case symbol_kind::S_INTEGER: // "integer"
932 case symbol_kind::S_HEXSTRING: // "constant hexstring"
933 case symbol_kind::S_OPTION_NAME: // "option name"
934 case symbol_kind::S_IP_ADDRESS: // "ip address"
935 value.template destroy< std::string > ();
936 break;
937
938 case symbol_kind::S_option_code: // option_code
939 case symbol_kind::S_sub_option_code: // sub_option_code
940 value.template destroy< uint16_t > ();
941 break;
942
943 case symbol_kind::S_integer_expr: // integer_expr
944 case symbol_kind::S_enterprise_id: // enterprise_id
945 value.template destroy< uint32_t > ();
946 break;
947
948 default:
949 break;
950 }
951
952 Base::clear ();
953 }
954
956 std::string name () const YY_NOEXCEPT
957 {
958 return EvalParser::symbol_name (this->kind ());
959 }
960
962 symbol_kind_type type_get () const YY_NOEXCEPT;
963
965 bool empty () const YY_NOEXCEPT;
966
968 void move (basic_symbol& s);
969
972
975
976 private:
977#if YY_CPLUSPLUS < 201103L
979 basic_symbol& operator= (const basic_symbol& that);
980#endif
981 };
982
984 struct by_kind
985 {
987 by_kind ();
988
989#if 201103L <= YY_CPLUSPLUS
991 by_kind (by_kind&& that);
992#endif
993
995 by_kind (const by_kind& that);
996
999
1001 by_kind (kind_type t);
1002
1004 void clear () YY_NOEXCEPT;
1005
1007 void move (by_kind& that);
1008
1011 symbol_kind_type kind () const YY_NOEXCEPT;
1012
1014 symbol_kind_type type_get () const YY_NOEXCEPT;
1015
1019 };
1020
1023
1026 {
1029
1032
1034#if 201103L <= YY_CPLUSPLUS
1035 symbol_type (int tok, location_type l)
1036 : super_type(token_type (tok), std::move (l))
1037#else
1038 symbol_type (int tok, const location_type& l)
1039 : super_type(token_type (tok), l)
1040#endif
1041 {
1044 }
1045#if 201103L <= YY_CPLUSPLUS
1046 symbol_type (int tok, std::string v, location_type l)
1047 : super_type(token_type (tok), std::move (v), std::move (l))
1048#else
1049 symbol_type (int tok, const std::string& v, const location_type& l)
1050 : super_type(token_type (tok), v, l)
1051#endif
1052 {
1054 }
1055 };
1056
1058 EvalParser (EvalContext& ctx_yyarg);
1059 virtual ~EvalParser ();
1060
1061#if 201103L <= YY_CPLUSPLUS
1063 EvalParser (const EvalParser&) = delete;
1065 EvalParser& operator= (const EvalParser&) = delete;
1066#endif
1067
1070 int operator() ();
1071
1074 virtual int parse ();
1075
1076#if EVALDEBUG
1078 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
1080 void set_debug_stream (std::ostream &);
1081
1083 typedef int debug_level_type;
1088#endif
1089
1093 virtual void error (const location_type& loc, const std::string& msg);
1094
1096 void error (const syntax_error& err);
1097
1100 static std::string symbol_name (symbol_kind_type yysymbol);
1101
1102 // Implementation of make_symbol for each symbol type.
1103#if 201103L <= YY_CPLUSPLUS
1104 static
1107 {
1108 return symbol_type (token::TOKEN_END, std::move (l));
1109 }
1110#else
1111 static
1112 symbol_type
1114 {
1115 return symbol_type (token::TOKEN_END, l);
1116 }
1117#endif
1118#if 201103L <= YY_CPLUSPLUS
1119 static
1120 symbol_type
1122 {
1123 return symbol_type (token::TOKEN_EVALerror, std::move (l));
1124 }
1125#else
1126 static
1127 symbol_type
1129 {
1131 }
1132#endif
1133#if 201103L <= YY_CPLUSPLUS
1134 static
1135 symbol_type
1137 {
1138 return symbol_type (token::TOKEN_EVALUNDEF, std::move (l));
1139 }
1140#else
1141 static
1142 symbol_type
1144 {
1146 }
1147#endif
1148#if 201103L <= YY_CPLUSPLUS
1149 static
1150 symbol_type
1152 {
1153 return symbol_type (token::TOKEN_LPAREN, std::move (l));
1154 }
1155#else
1156 static
1157 symbol_type
1159 {
1160 return symbol_type (token::TOKEN_LPAREN, l);
1161 }
1162#endif
1163#if 201103L <= YY_CPLUSPLUS
1164 static
1165 symbol_type
1167 {
1168 return symbol_type (token::TOKEN_RPAREN, std::move (l));
1169 }
1170#else
1171 static
1172 symbol_type
1174 {
1175 return symbol_type (token::TOKEN_RPAREN, l);
1176 }
1177#endif
1178#if 201103L <= YY_CPLUSPLUS
1179 static
1180 symbol_type
1182 {
1183 return symbol_type (token::TOKEN_NOT, std::move (l));
1184 }
1185#else
1186 static
1187 symbol_type
1189 {
1190 return symbol_type (token::TOKEN_NOT, l);
1191 }
1192#endif
1193#if 201103L <= YY_CPLUSPLUS
1194 static
1195 symbol_type
1197 {
1198 return symbol_type (token::TOKEN_AND, std::move (l));
1199 }
1200#else
1201 static
1202 symbol_type
1204 {
1205 return symbol_type (token::TOKEN_AND, l);
1206 }
1207#endif
1208#if 201103L <= YY_CPLUSPLUS
1209 static
1210 symbol_type
1212 {
1213 return symbol_type (token::TOKEN_OR, std::move (l));
1214 }
1215#else
1216 static
1217 symbol_type
1219 {
1220 return symbol_type (token::TOKEN_OR, l);
1221 }
1222#endif
1223#if 201103L <= YY_CPLUSPLUS
1224 static
1225 symbol_type
1227 {
1228 return symbol_type (token::TOKEN_EQUAL, std::move (l));
1229 }
1230#else
1231 static
1232 symbol_type
1234 {
1235 return symbol_type (token::TOKEN_EQUAL, l);
1236 }
1237#endif
1238#if 201103L <= YY_CPLUSPLUS
1239 static
1240 symbol_type
1242 {
1243 return symbol_type (token::TOKEN_OPTION, std::move (l));
1244 }
1245#else
1246 static
1247 symbol_type
1249 {
1250 return symbol_type (token::TOKEN_OPTION, l);
1251 }
1252#endif
1253#if 201103L <= YY_CPLUSPLUS
1254 static
1255 symbol_type
1257 {
1258 return symbol_type (token::TOKEN_RELAY4, std::move (l));
1259 }
1260#else
1261 static
1262 symbol_type
1264 {
1265 return symbol_type (token::TOKEN_RELAY4, l);
1266 }
1267#endif
1268#if 201103L <= YY_CPLUSPLUS
1269 static
1270 symbol_type
1272 {
1273 return symbol_type (token::TOKEN_RELAY6, std::move (l));
1274 }
1275#else
1276 static
1277 symbol_type
1279 {
1280 return symbol_type (token::TOKEN_RELAY6, l);
1281 }
1282#endif
1283#if 201103L <= YY_CPLUSPLUS
1284 static
1285 symbol_type
1287 {
1288 return symbol_type (token::TOKEN_MEMBER, std::move (l));
1289 }
1290#else
1291 static
1292 symbol_type
1294 {
1295 return symbol_type (token::TOKEN_MEMBER, l);
1296 }
1297#endif
1298#if 201103L <= YY_CPLUSPLUS
1299 static
1300 symbol_type
1302 {
1303 return symbol_type (token::TOKEN_PEERADDR, std::move (l));
1304 }
1305#else
1306 static
1307 symbol_type
1309 {
1311 }
1312#endif
1313#if 201103L <= YY_CPLUSPLUS
1314 static
1315 symbol_type
1317 {
1318 return symbol_type (token::TOKEN_LINKADDR, std::move (l));
1319 }
1320#else
1321 static
1322 symbol_type
1324 {
1326 }
1327#endif
1328#if 201103L <= YY_CPLUSPLUS
1329 static
1330 symbol_type
1332 {
1333 return symbol_type (token::TOKEN_LBRACKET, std::move (l));
1334 }
1335#else
1336 static
1337 symbol_type
1339 {
1341 }
1342#endif
1343#if 201103L <= YY_CPLUSPLUS
1344 static
1345 symbol_type
1347 {
1348 return symbol_type (token::TOKEN_RBRACKET, std::move (l));
1349 }
1350#else
1351 static
1352 symbol_type
1354 {
1356 }
1357#endif
1358#if 201103L <= YY_CPLUSPLUS
1359 static
1360 symbol_type
1362 {
1363 return symbol_type (token::TOKEN_DOT, std::move (l));
1364 }
1365#else
1366 static
1367 symbol_type
1369 {
1370 return symbol_type (token::TOKEN_DOT, l);
1371 }
1372#endif
1373#if 201103L <= YY_CPLUSPLUS
1374 static
1375 symbol_type
1377 {
1378 return symbol_type (token::TOKEN_TEXT, std::move (l));
1379 }
1380#else
1381 static
1382 symbol_type
1384 {
1385 return symbol_type (token::TOKEN_TEXT, l);
1386 }
1387#endif
1388#if 201103L <= YY_CPLUSPLUS
1389 static
1390 symbol_type
1392 {
1393 return symbol_type (token::TOKEN_HEX, std::move (l));
1394 }
1395#else
1396 static
1397 symbol_type
1399 {
1400 return symbol_type (token::TOKEN_HEX, l);
1401 }
1402#endif
1403#if 201103L <= YY_CPLUSPLUS
1404 static
1405 symbol_type
1407 {
1408 return symbol_type (token::TOKEN_EXISTS, std::move (l));
1409 }
1410#else
1411 static
1412 symbol_type
1414 {
1415 return symbol_type (token::TOKEN_EXISTS, l);
1416 }
1417#endif
1418#if 201103L <= YY_CPLUSPLUS
1419 static
1420 symbol_type
1422 {
1423 return symbol_type (token::TOKEN_PKT, std::move (l));
1424 }
1425#else
1426 static
1427 symbol_type
1429 {
1430 return symbol_type (token::TOKEN_PKT, l);
1431 }
1432#endif
1433#if 201103L <= YY_CPLUSPLUS
1434 static
1435 symbol_type
1437 {
1438 return symbol_type (token::TOKEN_IFACE, std::move (l));
1439 }
1440#else
1441 static
1442 symbol_type
1444 {
1445 return symbol_type (token::TOKEN_IFACE, l);
1446 }
1447#endif
1448#if 201103L <= YY_CPLUSPLUS
1449 static
1450 symbol_type
1452 {
1453 return symbol_type (token::TOKEN_SRC, std::move (l));
1454 }
1455#else
1456 static
1457 symbol_type
1459 {
1460 return symbol_type (token::TOKEN_SRC, l);
1461 }
1462#endif
1463#if 201103L <= YY_CPLUSPLUS
1464 static
1465 symbol_type
1467 {
1468 return symbol_type (token::TOKEN_DST, std::move (l));
1469 }
1470#else
1471 static
1472 symbol_type
1474 {
1475 return symbol_type (token::TOKEN_DST, l);
1476 }
1477#endif
1478#if 201103L <= YY_CPLUSPLUS
1479 static
1480 symbol_type
1482 {
1483 return symbol_type (token::TOKEN_LEN, std::move (l));
1484 }
1485#else
1486 static
1487 symbol_type
1489 {
1490 return symbol_type (token::TOKEN_LEN, l);
1491 }
1492#endif
1493#if 201103L <= YY_CPLUSPLUS
1494 static
1495 symbol_type
1497 {
1498 return symbol_type (token::TOKEN_PKT4, std::move (l));
1499 }
1500#else
1501 static
1502 symbol_type
1504 {
1505 return symbol_type (token::TOKEN_PKT4, l);
1506 }
1507#endif
1508#if 201103L <= YY_CPLUSPLUS
1509 static
1510 symbol_type
1512 {
1513 return symbol_type (token::TOKEN_CHADDR, std::move (l));
1514 }
1515#else
1516 static
1517 symbol_type
1519 {
1520 return symbol_type (token::TOKEN_CHADDR, l);
1521 }
1522#endif
1523#if 201103L <= YY_CPLUSPLUS
1524 static
1525 symbol_type
1527 {
1528 return symbol_type (token::TOKEN_HLEN, std::move (l));
1529 }
1530#else
1531 static
1532 symbol_type
1534 {
1535 return symbol_type (token::TOKEN_HLEN, l);
1536 }
1537#endif
1538#if 201103L <= YY_CPLUSPLUS
1539 static
1540 symbol_type
1542 {
1543 return symbol_type (token::TOKEN_HTYPE, std::move (l));
1544 }
1545#else
1546 static
1547 symbol_type
1549 {
1550 return symbol_type (token::TOKEN_HTYPE, l);
1551 }
1552#endif
1553#if 201103L <= YY_CPLUSPLUS
1554 static
1555 symbol_type
1557 {
1558 return symbol_type (token::TOKEN_CIADDR, std::move (l));
1559 }
1560#else
1561 static
1562 symbol_type
1564 {
1565 return symbol_type (token::TOKEN_CIADDR, l);
1566 }
1567#endif
1568#if 201103L <= YY_CPLUSPLUS
1569 static
1570 symbol_type
1572 {
1573 return symbol_type (token::TOKEN_GIADDR, std::move (l));
1574 }
1575#else
1576 static
1577 symbol_type
1579 {
1580 return symbol_type (token::TOKEN_GIADDR, l);
1581 }
1582#endif
1583#if 201103L <= YY_CPLUSPLUS
1584 static
1585 symbol_type
1587 {
1588 return symbol_type (token::TOKEN_YIADDR, std::move (l));
1589 }
1590#else
1591 static
1592 symbol_type
1594 {
1595 return symbol_type (token::TOKEN_YIADDR, l);
1596 }
1597#endif
1598#if 201103L <= YY_CPLUSPLUS
1599 static
1600 symbol_type
1602 {
1603 return symbol_type (token::TOKEN_SIADDR, std::move (l));
1604 }
1605#else
1606 static
1607 symbol_type
1609 {
1610 return symbol_type (token::TOKEN_SIADDR, l);
1611 }
1612#endif
1613#if 201103L <= YY_CPLUSPLUS
1614 static
1615 symbol_type
1617 {
1618 return symbol_type (token::TOKEN_SUBSTRING, std::move (l));
1619 }
1620#else
1621 static
1622 symbol_type
1624 {
1626 }
1627#endif
1628#if 201103L <= YY_CPLUSPLUS
1629 static
1630 symbol_type
1632 {
1633 return symbol_type (token::TOKEN_ALL, std::move (l));
1634 }
1635#else
1636 static
1637 symbol_type
1639 {
1640 return symbol_type (token::TOKEN_ALL, l);
1641 }
1642#endif
1643#if 201103L <= YY_CPLUSPLUS
1644 static
1645 symbol_type
1647 {
1648 return symbol_type (token::TOKEN_COMA, std::move (l));
1649 }
1650#else
1651 static
1652 symbol_type
1654 {
1655 return symbol_type (token::TOKEN_COMA, l);
1656 }
1657#endif
1658#if 201103L <= YY_CPLUSPLUS
1659 static
1660 symbol_type
1662 {
1663 return symbol_type (token::TOKEN_CONCAT, std::move (l));
1664 }
1665#else
1666 static
1667 symbol_type
1669 {
1670 return symbol_type (token::TOKEN_CONCAT, l);
1671 }
1672#endif
1673#if 201103L <= YY_CPLUSPLUS
1674 static
1675 symbol_type
1677 {
1678 return symbol_type (token::TOKEN_PLUS, std::move (l));
1679 }
1680#else
1681 static
1682 symbol_type
1684 {
1685 return symbol_type (token::TOKEN_PLUS, l);
1686 }
1687#endif
1688#if 201103L <= YY_CPLUSPLUS
1689 static
1690 symbol_type
1692 {
1693 return symbol_type (token::TOKEN_IFELSE, std::move (l));
1694 }
1695#else
1696 static
1697 symbol_type
1699 {
1700 return symbol_type (token::TOKEN_IFELSE, l);
1701 }
1702#endif
1703#if 201103L <= YY_CPLUSPLUS
1704 static
1705 symbol_type
1707 {
1708 return symbol_type (token::TOKEN_TOHEXSTRING, std::move (l));
1709 }
1710#else
1711 static
1712 symbol_type
1714 {
1716 }
1717#endif
1718#if 201103L <= YY_CPLUSPLUS
1719 static
1720 symbol_type
1722 {
1723 return symbol_type (token::TOKEN_ADDRTOTEXT, std::move (l));
1724 }
1725#else
1726 static
1727 symbol_type
1729 {
1731 }
1732#endif
1733#if 201103L <= YY_CPLUSPLUS
1734 static
1735 symbol_type
1737 {
1738 return symbol_type (token::TOKEN_INT8TOTEXT, std::move (l));
1739 }
1740#else
1741 static
1742 symbol_type
1744 {
1746 }
1747#endif
1748#if 201103L <= YY_CPLUSPLUS
1749 static
1750 symbol_type
1752 {
1753 return symbol_type (token::TOKEN_INT16TOTEXT, std::move (l));
1754 }
1755#else
1756 static
1757 symbol_type
1759 {
1761 }
1762#endif
1763#if 201103L <= YY_CPLUSPLUS
1764 static
1765 symbol_type
1767 {
1768 return symbol_type (token::TOKEN_INT32TOTEXT, std::move (l));
1769 }
1770#else
1771 static
1772 symbol_type
1774 {
1776 }
1777#endif
1778#if 201103L <= YY_CPLUSPLUS
1779 static
1780 symbol_type
1782 {
1783 return symbol_type (token::TOKEN_UINT8TOTEXT, std::move (l));
1784 }
1785#else
1786 static
1787 symbol_type
1789 {
1791 }
1792#endif
1793#if 201103L <= YY_CPLUSPLUS
1794 static
1795 symbol_type
1797 {
1798 return symbol_type (token::TOKEN_UINT16TOTEXT, std::move (l));
1799 }
1800#else
1801 static
1802 symbol_type
1804 {
1806 }
1807#endif
1808#if 201103L <= YY_CPLUSPLUS
1809 static
1810 symbol_type
1812 {
1813 return symbol_type (token::TOKEN_UINT32TOTEXT, std::move (l));
1814 }
1815#else
1816 static
1817 symbol_type
1819 {
1821 }
1822#endif
1823#if 201103L <= YY_CPLUSPLUS
1824 static
1825 symbol_type
1827 {
1828 return symbol_type (token::TOKEN_PKT6, std::move (l));
1829 }
1830#else
1831 static
1832 symbol_type
1834 {
1835 return symbol_type (token::TOKEN_PKT6, l);
1836 }
1837#endif
1838#if 201103L <= YY_CPLUSPLUS
1839 static
1840 symbol_type
1842 {
1843 return symbol_type (token::TOKEN_MSGTYPE, std::move (l));
1844 }
1845#else
1846 static
1847 symbol_type
1849 {
1851 }
1852#endif
1853#if 201103L <= YY_CPLUSPLUS
1854 static
1855 symbol_type
1857 {
1858 return symbol_type (token::TOKEN_TRANSID, std::move (l));
1859 }
1860#else
1861 static
1862 symbol_type
1864 {
1866 }
1867#endif
1868#if 201103L <= YY_CPLUSPLUS
1869 static
1870 symbol_type
1872 {
1873 return symbol_type (token::TOKEN_VENDOR_CLASS, std::move (l));
1874 }
1875#else
1876 static
1877 symbol_type
1879 {
1881 }
1882#endif
1883#if 201103L <= YY_CPLUSPLUS
1884 static
1885 symbol_type
1887 {
1888 return symbol_type (token::TOKEN_VENDOR, std::move (l));
1889 }
1890#else
1891 static
1892 symbol_type
1894 {
1895 return symbol_type (token::TOKEN_VENDOR, l);
1896 }
1897#endif
1898#if 201103L <= YY_CPLUSPLUS
1899 static
1900 symbol_type
1902 {
1903 return symbol_type (token::TOKEN_ANY, std::move (l));
1904 }
1905#else
1906 static
1907 symbol_type
1909 {
1910 return symbol_type (token::TOKEN_ANY, l);
1911 }
1912#endif
1913#if 201103L <= YY_CPLUSPLUS
1914 static
1915 symbol_type
1917 {
1918 return symbol_type (token::TOKEN_DATA, std::move (l));
1919 }
1920#else
1921 static
1922 symbol_type
1924 {
1925 return symbol_type (token::TOKEN_DATA, l);
1926 }
1927#endif
1928#if 201103L <= YY_CPLUSPLUS
1929 static
1930 symbol_type
1932 {
1933 return symbol_type (token::TOKEN_ENTERPRISE, std::move (l));
1934 }
1935#else
1936 static
1937 symbol_type
1939 {
1941 }
1942#endif
1943#if 201103L <= YY_CPLUSPLUS
1944 static
1945 symbol_type
1947 {
1948 return symbol_type (token::TOKEN_TOPLEVEL_BOOL, std::move (l));
1949 }
1950#else
1951 static
1952 symbol_type
1954 {
1956 }
1957#endif
1958#if 201103L <= YY_CPLUSPLUS
1959 static
1960 symbol_type
1962 {
1963 return symbol_type (token::TOKEN_TOPLEVEL_STRING, std::move (l));
1964 }
1965#else
1966 static
1967 symbol_type
1969 {
1971 }
1972#endif
1973#if 201103L <= YY_CPLUSPLUS
1974 static
1975 symbol_type
1976 make_STRING (std::string v, location_type l)
1977 {
1978 return symbol_type (token::TOKEN_STRING, std::move (v), std::move (l));
1979 }
1980#else
1981 static
1982 symbol_type
1983 make_STRING (const std::string& v, const location_type& l)
1984 {
1985 return symbol_type (token::TOKEN_STRING, v, l);
1986 }
1987#endif
1988#if 201103L <= YY_CPLUSPLUS
1989 static
1990 symbol_type
1991 make_INTEGER (std::string v, location_type l)
1992 {
1993 return symbol_type (token::TOKEN_INTEGER, std::move (v), std::move (l));
1994 }
1995#else
1996 static
1997 symbol_type
1998 make_INTEGER (const std::string& v, const location_type& l)
1999 {
2000 return symbol_type (token::TOKEN_INTEGER, v, l);
2001 }
2002#endif
2003#if 201103L <= YY_CPLUSPLUS
2004 static
2005 symbol_type
2006 make_HEXSTRING (std::string v, location_type l)
2007 {
2008 return symbol_type (token::TOKEN_HEXSTRING, std::move (v), std::move (l));
2009 }
2010#else
2011 static
2012 symbol_type
2013 make_HEXSTRING (const std::string& v, const location_type& l)
2014 {
2015 return symbol_type (token::TOKEN_HEXSTRING, v, l);
2016 }
2017#endif
2018#if 201103L <= YY_CPLUSPLUS
2019 static
2020 symbol_type
2021 make_OPTION_NAME (std::string v, location_type l)
2022 {
2023 return symbol_type (token::TOKEN_OPTION_NAME, std::move (v), std::move (l));
2024 }
2025#else
2026 static
2027 symbol_type
2028 make_OPTION_NAME (const std::string& v, const location_type& l)
2029 {
2031 }
2032#endif
2033#if 201103L <= YY_CPLUSPLUS
2034 static
2035 symbol_type
2036 make_IP_ADDRESS (std::string v, location_type l)
2037 {
2038 return symbol_type (token::TOKEN_IP_ADDRESS, std::move (v), std::move (l));
2039 }
2040#else
2041 static
2042 symbol_type
2043 make_IP_ADDRESS (const std::string& v, const location_type& l)
2044 {
2045 return symbol_type (token::TOKEN_IP_ADDRESS, v, l);
2046 }
2047#endif
2048
2049
2051 {
2052 public:
2053 context (const EvalParser& yyparser, const symbol_type& yyla);
2054 const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; }
2055 symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); }
2056 const location_type& location () const YY_NOEXCEPT { return yyla_.location; }
2057
2061 int expected_tokens (symbol_kind_type yyarg[], int yyargn) const;
2062
2063 private:
2064 const EvalParser& yyparser_;
2065 const symbol_type& yyla_;
2066 };
2067
2068 private:
2069#if YY_CPLUSPLUS < 201103L
2071 EvalParser (const EvalParser&);
2073 EvalParser& operator= (const EvalParser&);
2074#endif
2075
2076
2078 typedef unsigned char state_type;
2079
2081 int yy_syntax_error_arguments_ (const context& yyctx,
2082 symbol_kind_type yyarg[], int yyargn) const;
2083
2086 virtual std::string yysyntax_error_ (const context& yyctx) const;
2090 static state_type yy_lr_goto_state_ (state_type yystate, int yysym);
2091
2094 static bool yy_pact_value_is_default_ (int yyvalue);
2095
2098 static bool yy_table_value_is_error_ (int yyvalue);
2099
2100 static const short yypact_ninf_;
2101 static const signed char yytable_ninf_;
2102
2106 static symbol_kind_type yytranslate_ (int t);
2107
2109 static std::string yytnamerr_ (const char *yystr);
2110
2112 static const char* const yytname_[];
2113
2114
2115 // Tables.
2116 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2117 // STATE-NUM.
2118 static const short yypact_[];
2119
2120 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
2121 // Performed when YYTABLE does not specify something else to do. Zero
2122 // means the default is an error.
2123 static const signed char yydefact_[];
2124
2125 // YYPGOTO[NTERM-NUM].
2126 static const short yypgoto_[];
2127
2128 // YYDEFGOTO[NTERM-NUM].
2129 static const unsigned char yydefgoto_[];
2130
2131 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
2132 // positive, shift that token. If negative, reduce the rule whose
2133 // number is the opposite. If YYTABLE_NINF, syntax error.
2134 static const unsigned char yytable_[];
2135
2136 static const unsigned char yycheck_[];
2137
2138 // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2139 // symbol of state STATE-NUM.
2140 static const signed char yystos_[];
2141
2142 // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
2143 static const signed char yyr1_[];
2144
2145 // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
2146 static const signed char yyr2_[];
2147
2148
2149#if EVALDEBUG
2150 // YYRLINE[YYN] -- Source line where rule number YYN was defined.
2151 static const short yyrline_[];
2153 virtual void yy_reduce_print_ (int r) const;
2155 virtual void yy_stack_print_ () const;
2156
2158 int yydebug_;
2160 std::ostream* yycdebug_;
2161
2165 template <typename Base>
2166 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
2167#endif
2168
2173 template <typename Base>
2174 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
2175
2176 private:
2178 struct by_state
2179 {
2181 by_state () YY_NOEXCEPT;
2182
2184 typedef state_type kind_type;
2185
2187 by_state (kind_type s) YY_NOEXCEPT;
2188
2190 by_state (const by_state& that) YY_NOEXCEPT;
2191
2193 void clear () YY_NOEXCEPT;
2194
2196 void move (by_state& that);
2197
2200 symbol_kind_type kind () const YY_NOEXCEPT;
2201
2204 enum { empty_state = 0 };
2205
2208 state_type state;
2209 };
2210
2212 struct stack_symbol_type : basic_symbol<by_state>
2213 {
2215 typedef basic_symbol<by_state> super_type;
2217 stack_symbol_type ();
2219 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
2221 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
2222#if YY_CPLUSPLUS < 201103L
2225 stack_symbol_type& operator= (stack_symbol_type& that);
2226
2229 stack_symbol_type& operator= (const stack_symbol_type& that);
2230#endif
2231 };
2232
2234 template <typename T, typename S = std::vector<T> >
2235 class stack
2236 {
2237 public:
2238 // Hide our reversed order.
2239 typedef typename S::iterator iterator;
2240 typedef typename S::const_iterator const_iterator;
2241 typedef typename S::size_type size_type;
2242 typedef typename std::ptrdiff_t index_type;
2243
2244 stack (size_type n = 200)
2245 : seq_ (n)
2246 {}
2247
2248#if 201103L <= YY_CPLUSPLUS
2250 stack (const stack&) = delete;
2252 stack& operator= (const stack&) = delete;
2253#endif
2254
2258 const T&
2259 operator[] (index_type i) const
2260 {
2261 return seq_[size_type (size () - 1 - i)];
2262 }
2263
2267 T&
2268 operator[] (index_type i)
2269 {
2270 return seq_[size_type (size () - 1 - i)];
2271 }
2272
2276 void
2277 push (YY_MOVE_REF (T) t)
2278 {
2279 seq_.push_back (T ());
2280 operator[] (0).move (t);
2281 }
2282
2284 void
2285 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
2286 {
2287 for (; 0 < n; --n)
2288 seq_.pop_back ();
2289 }
2290
2292 void
2293 clear () YY_NOEXCEPT
2294 {
2295 seq_.clear ();
2296 }
2297
2299 index_type
2300 size () const YY_NOEXCEPT
2301 {
2302 return index_type (seq_.size ());
2303 }
2304
2306 const_iterator
2307 begin () const YY_NOEXCEPT
2308 {
2309 return seq_.begin ();
2310 }
2311
2313 const_iterator
2314 end () const YY_NOEXCEPT
2315 {
2316 return seq_.end ();
2317 }
2318
2320 class slice
2321 {
2322 public:
2323 slice (const stack& stack, index_type range)
2324 : stack_ (stack)
2325 , range_ (range)
2326 {}
2327
2328 const T&
2329 operator[] (index_type i) const
2330 {
2331 return stack_[range_ - i];
2332 }
2333
2334 private:
2335 const stack& stack_;
2336 index_type range_;
2337 };
2338
2339 private:
2340#if YY_CPLUSPLUS < 201103L
2342 stack (const stack&);
2344 stack& operator= (const stack&);
2345#endif
2347 S seq_;
2348 };
2349
2350
2352 typedef stack<stack_symbol_type> stack_type;
2353
2355 stack_type yystack_;
2356
2362 void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
2363
2370 void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
2371
2373 void yypop_ (int n = 1);
2374
2376 enum
2377 {
2378 yylast_ = 274,
2379 yynnts_ = 17,
2380 yyfinal_ = 41
2381 };
2382
2383
2384 // User arguments.
2385 EvalContext& ctx;
2386
2387 };
2388
2389 inline
2391 EvalParser::yytranslate_ (int t)
2392 {
2393 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
2394 // TOKEN-NUM as returned by yylex.
2395 static
2396 const signed char
2397 translate_table[] =
2398 {
2399 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2424 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2425 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2426 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2427 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2428 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2429 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2430 55, 56, 57, 58, 59, 60, 61, 62
2431 };
2432 // Last valid token kind.
2433 const int code_max = 317;
2434
2435 if (t <= 0)
2436 return symbol_kind::S_YYEOF;
2437 else if (t <= code_max)
2438 return YY_CAST (symbol_kind_type, translate_table[t]);
2439 else
2441 }
2442
2443 // basic_symbol.
2444 template <typename Base>
2446 : Base (that)
2447 , value ()
2448 , location (that.location)
2449 {
2450 switch (this->kind ())
2451 {
2452 case symbol_kind::S_option_repr_type: // option_repr_type
2454 break;
2455
2456 case symbol_kind::S_pkt4_field: // pkt4_field
2458 break;
2459
2460 case symbol_kind::S_pkt6_field: // pkt6_field
2462 break;
2463
2464 case symbol_kind::S_pkt_metadata: // pkt_metadata
2466 break;
2467
2468 case symbol_kind::S_relay6_field: // relay6_field
2470 break;
2471
2472 case symbol_kind::S_nest_level: // nest_level
2473 value.copy< int8_t > (YY_MOVE (that.value));
2474 break;
2475
2476 case symbol_kind::S_STRING: // "constant string"
2477 case symbol_kind::S_INTEGER: // "integer"
2478 case symbol_kind::S_HEXSTRING: // "constant hexstring"
2479 case symbol_kind::S_OPTION_NAME: // "option name"
2480 case symbol_kind::S_IP_ADDRESS: // "ip address"
2481 value.copy< std::string > (YY_MOVE (that.value));
2482 break;
2483
2484 case symbol_kind::S_option_code: // option_code
2485 case symbol_kind::S_sub_option_code: // sub_option_code
2486 value.copy< uint16_t > (YY_MOVE (that.value));
2487 break;
2488
2489 case symbol_kind::S_integer_expr: // integer_expr
2490 case symbol_kind::S_enterprise_id: // enterprise_id
2491 value.copy< uint32_t > (YY_MOVE (that.value));
2492 break;
2493
2494 default:
2495 break;
2496 }
2497
2498 }
2499
2500
2501
2502 template <typename Base>
2505 {
2506 return this->kind ();
2507 }
2508
2509 template <typename Base>
2510 bool
2512 {
2513 return this->kind () == symbol_kind::S_YYEMPTY;
2514 }
2515
2516 template <typename Base>
2517 void
2519 {
2520 super_type::move (s);
2521 switch (this->kind ())
2522 {
2523 case symbol_kind::S_option_repr_type: // option_repr_type
2524 value.move< TokenOption::RepresentationType > (YY_MOVE (s.value));
2525 break;
2526
2527 case symbol_kind::S_pkt4_field: // pkt4_field
2528 value.move< TokenPkt4::FieldType > (YY_MOVE (s.value));
2529 break;
2530
2531 case symbol_kind::S_pkt6_field: // pkt6_field
2532 value.move< TokenPkt6::FieldType > (YY_MOVE (s.value));
2533 break;
2534
2535 case symbol_kind::S_pkt_metadata: // pkt_metadata
2536 value.move< TokenPkt::MetadataType > (YY_MOVE (s.value));
2537 break;
2538
2539 case symbol_kind::S_relay6_field: // relay6_field
2540 value.move< TokenRelay6Field::FieldType > (YY_MOVE (s.value));
2541 break;
2542
2543 case symbol_kind::S_nest_level: // nest_level
2544 value.move< int8_t > (YY_MOVE (s.value));
2545 break;
2546
2547 case symbol_kind::S_STRING: // "constant string"
2548 case symbol_kind::S_INTEGER: // "integer"
2549 case symbol_kind::S_HEXSTRING: // "constant hexstring"
2550 case symbol_kind::S_OPTION_NAME: // "option name"
2551 case symbol_kind::S_IP_ADDRESS: // "ip address"
2552 value.move< std::string > (YY_MOVE (s.value));
2553 break;
2554
2555 case symbol_kind::S_option_code: // option_code
2556 case symbol_kind::S_sub_option_code: // sub_option_code
2557 value.move< uint16_t > (YY_MOVE (s.value));
2558 break;
2559
2560 case symbol_kind::S_integer_expr: // integer_expr
2561 case symbol_kind::S_enterprise_id: // enterprise_id
2562 value.move< uint32_t > (YY_MOVE (s.value));
2563 break;
2564
2565 default:
2566 break;
2567 }
2568
2569 location = YY_MOVE (s.location);
2570 }
2571
2572 // by_kind.
2573 inline
2575 : kind_ (symbol_kind::S_YYEMPTY)
2576 {}
2577
2578#if 201103L <= YY_CPLUSPLUS
2579 inline
2581 : kind_ (that.kind_)
2582 {
2583 that.clear ();
2584 }
2585#endif
2586
2587 inline
2589 : kind_ (that.kind_)
2590 {}
2591
2592 inline
2594 : kind_ (yytranslate_ (t))
2595 {}
2596
2597 inline
2598 void
2600 {
2601 kind_ = symbol_kind::S_YYEMPTY;
2602 }
2603
2604 inline
2605 void
2607 {
2608 kind_ = that.kind_;
2609 that.clear ();
2610 }
2611
2612 inline
2615 {
2616 return kind_;
2617 }
2618
2619 inline
2622 {
2623 return this->kind ();
2624 }
2625
2626#line 14 "parser.yy"
2627} } // isc::eval
2628#line 2629 "parser.h"
2629
2630
2631
2632
2633#endif // !YY_EVAL_PARSER_H_INCLUDED
RepresentationType
Token representation type.
Definition: token.h:354
FieldType
enum value that determines the field.
Definition: token.h:563
FieldType
enum value that determines the field.
Definition: token.h:616
MetadataType
enum value that determines the field.
Definition: token.h:513
FieldType
enum value that determines the field.
Definition: token.h:668
Evaluation context, an interface to the expression evaluation.
Definition: eval_context.h:34
const location_type & location() const YY_NOEXCEPT
Definition: parser.h:2056
const symbol_type & lookahead() const YY_NOEXCEPT
Definition: parser.h:2054
symbol_kind_type token() const YY_NOEXCEPT
Definition: parser.h:2055
A buffer to store and retrieve objects.
Definition: parser.h:218
long double yyalign_me
Strongest alignment constraints.
Definition: parser.h:457
char yyraw[size]
A buffer large enough to store any of the semantic values.
Definition: parser.h:459
void swap(self_type &that) YY_NOEXCEPT
Swap the content with that, of same type.
Definition: parser.h:336
void move(self_type &that)
Move the content of that to this.
Definition: parser.h:348
T & emplace()
Instantiate an empty T in here.
Definition: parser.h:266
const T & as() const YY_NOEXCEPT
Const accessor to a built T (for printer).
Definition: parser.h:318
~semantic_type() YY_NOEXCEPT
Destruction, allowed only if empty.
Definition: parser.h:246
T & build(const T &t)
Instantiate a T in here from t.
Definition: parser.h:299
T & emplace(const T &t)
Instantiate a T in here from t.
Definition: parser.h:277
semantic_type self_type
Type of *this.
Definition: parser.h:221
void destroy()
Destroy the stored T.
Definition: parser.h:381
T & as() YY_NOEXCEPT
Accessor to a built T.
Definition: parser.h:307
semantic_type(YY_RVREF(T) t)
Construct and fill.
Definition: parser.h:231
T & build()
Instantiate an empty T in here.
Definition: parser.h:290
semantic_type() YY_NOEXCEPT
Empty construction.
Definition: parser.h:224
void copy(const self_type &that)
Copy the content of that to this.
Definition: parser.h:373
Present a slice of the top of a stack.
Definition: parser.h:2321
slice(const stack &stack, index_type range)
Definition: parser.h:2323
A Bison parser.
Definition: parser.h:209
static symbol_type make_RELAY6(const location_type &l)
Definition: parser.h:1278
static symbol_type make_INT8TOTEXT(const location_type &l)
Definition: parser.h:1743
static symbol_type make_CONCAT(const location_type &l)
Definition: parser.h:1668
static symbol_type make_TEXT(const location_type &l)
Definition: parser.h:1383
static symbol_type make_OPTION(const location_type &l)
Definition: parser.h:1248
static symbol_type make_AND(const location_type &l)
Definition: parser.h:1203
static symbol_type make_HTYPE(const location_type &l)
Definition: parser.h:1548
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
Definition: parser.h:661
static symbol_type make_MSGTYPE(const location_type &l)
Definition: parser.h:1848
static symbol_type make_LINKADDR(const location_type &l)
Definition: parser.h:1323
static symbol_type make_TOHEXSTRING(const location_type &l)
Definition: parser.h:1713
debug_level_type debug_level() const YY_ATTRIBUTE_PURE
The current debugging level.
Definition: parser.cc:598
static symbol_type make_EVALerror(const location_type &l)
Definition: parser.h:1128
static symbol_type make_PKT6(const location_type &l)
Definition: parser.h:1833
static symbol_type make_END(const location_type &l)
Definition: parser.h:1113
static symbol_type make_DST(const location_type &l)
Definition: parser.h:1473
static symbol_type make_OR(const location_type &l)
Definition: parser.h:1218
int operator()()
Parse.
Definition: parser.cc:633
static symbol_type make_PLUS(const location_type &l)
Definition: parser.h:1683
token::yytokentype token_kind_type
Token kind, as returned by yylex.
Definition: parser.h:565
static symbol_type make_RBRACKET(const location_type &l)
Definition: parser.h:1353
static symbol_type make_NOT(const location_type &l)
Definition: parser.h:1188
static symbol_type make_INT32TOTEXT(const location_type &l)
Definition: parser.h:1773
static symbol_type make_SIADDR(const location_type &l)
Definition: parser.h:1608
static symbol_type make_PKT4(const location_type &l)
Definition: parser.h:1503
virtual int parse()
Parse.
Definition: parser.cc:639
static symbol_type make_IP_ADDRESS(const std::string &v, const location_type &l)
Definition: parser.h:2043
static symbol_type make_UINT16TOTEXT(const location_type &l)
Definition: parser.h:1803
static symbol_type make_STRING(const std::string &v, const location_type &l)
Definition: parser.h:1983
static symbol_type make_TOPLEVEL_BOOL(const location_type &l)
Definition: parser.h:1953
int debug_level_type
Type for debugging levels.
Definition: parser.h:1083
static symbol_type make_LPAREN(const location_type &l)
Definition: parser.h:1158
static symbol_type make_TOPLEVEL_STRING(const location_type &l)
Definition: parser.h:1968
static symbol_type make_GIADDR(const location_type &l)
Definition: parser.h:1578
static symbol_type make_DATA(const location_type &l)
Definition: parser.h:1923
static symbol_type make_CHADDR(const location_type &l)
Definition: parser.h:1518
static symbol_type make_INT16TOTEXT(const location_type &l)
Definition: parser.h:1758
static symbol_type make_LBRACKET(const location_type &l)
Definition: parser.h:1338
static symbol_type make_LEN(const location_type &l)
Definition: parser.h:1488
static symbol_type make_IFACE(const location_type &l)
Definition: parser.h:1443
static symbol_type make_ANY(const location_type &l)
Definition: parser.h:1908
static symbol_type make_DOT(const location_type &l)
Definition: parser.h:1368
static symbol_type make_HLEN(const location_type &l)
Definition: parser.h:1533
static symbol_type make_ALL(const location_type &l)
Definition: parser.h:1638
static symbol_type make_COMA(const location_type &l)
Definition: parser.h:1653
static symbol_type make_IFELSE(const location_type &l)
Definition: parser.h:1698
location location_type
Symbol locations.
Definition: parser.h:470
static symbol_type make_YIADDR(const location_type &l)
Definition: parser.h:1593
static symbol_type make_SRC(const location_type &l)
Definition: parser.h:1458
static symbol_type make_INTEGER(const std::string &v, const location_type &l)
Definition: parser.h:1998
static symbol_type make_EQUAL(const location_type &l)
Definition: parser.h:1233
static symbol_type make_EXISTS(const location_type &l)
Definition: parser.h:1413
static symbol_type make_TRANSID(const location_type &l)
Definition: parser.h:1863
token_kind_type token_type
Backward compatibility alias (Bison 3.6).
Definition: parser.h:568
void set_debug_stream(std::ostream &)
Set the current debugging stream.
Definition: parser.cc:591
void set_debug_level(debug_level_type l)
Set the current debugging level.
Definition: parser.cc:604
std::ostream & debug_stream() const YY_ATTRIBUTE_PURE
The current debugging stream.
Definition: parser.cc:585
static symbol_type make_ADDRTOTEXT(const location_type &l)
Definition: parser.h:1728
static symbol_type make_RELAY4(const location_type &l)
Definition: parser.h:1263
static symbol_type make_PKT(const location_type &l)
Definition: parser.h:1428
static symbol_type make_CIADDR(const location_type &l)
Definition: parser.h:1563
virtual ~EvalParser()
Definition: parser.cc:157
static symbol_type make_HEXSTRING(const std::string &v, const location_type &l)
Definition: parser.h:2013
static symbol_type make_EVALUNDEF(const location_type &l)
Definition: parser.h:1143
static symbol_type make_OPTION_NAME(const std::string &v, const location_type &l)
Definition: parser.h:2028
static symbol_type make_MEMBER(const location_type &l)
Definition: parser.h:1293
static symbol_type make_UINT32TOTEXT(const location_type &l)
Definition: parser.h:1818
EvalParser(EvalContext &ctx_yyarg)
Build a parser object.
Definition: parser.cc:147
static symbol_type make_ENTERPRISE(const location_type &l)
Definition: parser.h:1938
static symbol_type make_VENDOR(const location_type &l)
Definition: parser.h:1893
static symbol_type make_RPAREN(const location_type &l)
Definition: parser.h:1173
static symbol_type make_PEERADDR(const location_type &l)
Definition: parser.h:1308
static const symbol_kind_type YYNTOKENS
The number of tokens.
Definition: parser.h:664
static symbol_type make_SUBSTRING(const location_type &l)
Definition: parser.h:1623
static symbol_type make_VENDOR_CLASS(const location_type &l)
Definition: parser.h:1878
static symbol_type make_HEX(const location_type &l)
Definition: parser.h:1398
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
Definition: parser.cc:2192
static symbol_type make_UINT8TOTEXT(const location_type &l)
Definition: parser.h:1788
static std::string symbol_name(symbol_kind_type yysymbol)
The user-facing name of the symbol whose (internal) number is YYSYMBOL.
Definition: parser.cc:1790
Forward declaration of the EvalContext class.
Defines the logger used by the top-level component of kea-lfc.
#define YY_RVREF(Type)
Definition: parser.h:85
#define EVAL_ASSERT
Definition: parser.h:108
#define YY_CAST(Type, Val)
Definition: parser.h:171
#define YY_MOVE_REF(Type)
Definition: parser.h:84
#define YY_NOEXCEPT
Definition: parser.h:94
#define YY_ATTRIBUTE_PURE
Definition: parser.h:116
#define YY_MOVE
Definition: parser.h:82
#define YY_NOTHROW
Definition: parser.h:95
basic_symbol()
Default constructor.
Definition: parser.h:679
void move(basic_symbol &s)
Destructive move, s is emptied into this.
Definition: parser.h:2518
semantic_type value
The semantic value.
Definition: parser.h:971
location_type location
The location.
Definition: parser.h:974
Base super_type
Alias to Base.
Definition: parser.h:676
basic_symbol(typename Base::kind_type t, const TokenPkt4::FieldType &v, const location_type &l)
Definition: parser.h:779
basic_symbol(typename Base::kind_type t, const uint32_t &v, const location_type &l)
Definition: parser.h:877
basic_symbol(typename Base::kind_type t, const TokenPkt6::FieldType &v, const location_type &l)
Definition: parser.h:793
~basic_symbol()
Destroy the symbol.
Definition: parser.h:885
bool empty() const YY_NOEXCEPT
Whether empty.
Definition: parser.h:2511
symbol_kind_type type_get() const YY_NOEXCEPT
Backward compatibility (Bison 3.6).
Definition: parser.h:2504
basic_symbol(typename Base::kind_type t, const uint16_t &v, const location_type &l)
Definition: parser.h:863
basic_symbol(typename Base::kind_type t, const TokenPkt::MetadataType &v, const location_type &l)
Definition: parser.h:807
std::string name() const YY_NOEXCEPT
The user-facing name of this symbol.
Definition: parser.h:956
basic_symbol(typename Base::kind_type t, const TokenOption::RepresentationType &v, const location_type &l)
Definition: parser.h:765
basic_symbol(typename Base::kind_type t, const std::string &v, const location_type &l)
Definition: parser.h:849
void clear() YY_NOEXCEPT
Destroy contents, and record that is empty.
Definition: parser.h:891
basic_symbol(typename Base::kind_type t, const TokenRelay6Field::FieldType &v, const location_type &l)
Definition: parser.h:821
basic_symbol(typename Base::kind_type t, const location_type &l)
Constructors for typed symbols.
Definition: parser.h:752
basic_symbol(typename Base::kind_type t, const int8_t &v, const location_type &l)
Definition: parser.h:835
Type access provider for token (enum) based symbols.
Definition: parser.h:985
symbol_kind_type type_get() const YY_NOEXCEPT
Backward compatibility (Bison 3.6).
Definition: parser.h:2621
by_kind()
Default constructor.
Definition: parser.h:2574
token_kind_type kind_type
The symbol kind as needed by the constructor.
Definition: parser.h:998
symbol_kind_type kind_
The symbol kind.
Definition: parser.h:1018
void clear() YY_NOEXCEPT
Record that this symbol is empty.
Definition: parser.h:2599
symbol_kind_type kind() const YY_NOEXCEPT
The (internal) type number (corresponding to type).
Definition: parser.h:2614
void move(by_kind &that)
Steal the symbol kind from that.
Definition: parser.h:2606
@ YYNTOKENS
Number of tokens.
Definition: parser.h:575
"External" symbols: returned by the scanner.
Definition: parser.h:1026
basic_symbol< by_kind > super_type
Superclass.
Definition: parser.h:1028
Syntax errors thrown from user actions.
Definition: parser.h:474
syntax_error(const location_type &l, const std::string &m)
Definition: parser.h:475
syntax_error(const syntax_error &s)
Definition: parser.h:480
~syntax_error() YY_NOEXCEPT YY_NOTHROW
Definition: parser.cc:160
token_kind_type yytokentype
Backward compatibility alias (Bison 3.6).
Definition: parser.h:561