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