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