Kea  1.5.0
parser.h
Go to the documentation of this file.
1 // A Bison parser, made by GNU Bison 3.2.1.
2 
3 // Skeleton interface for Bison LALR(1) parsers in C++
4 
5 // Copyright (C) 2002-2015, 2018 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 <http://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 // Undocumented macros, especially those whose name start with YY_,
42 // are private implementation details. Do not rely on them.
43 
44 #ifndef YY_EVAL_PARSER_H_INCLUDED
45 # define YY_EVAL_PARSER_H_INCLUDED
46 // // "%code requires" blocks.
47 #line 17 "parser.yy" // lalr1.cc:404
48 
49 #include <string>
50 #include <eval/token.h>
51 #include <eval/eval_context_decl.h>
52 #include <dhcp/option.h>
53 #include <boost/lexical_cast.hpp>
54 
55 using namespace isc::dhcp;
56 using namespace isc::eval;
57 
58 #line 59 "parser.h" // lalr1.cc:404
59 
60 # include <cassert>
61 # include <cstdlib> // std::abort
62 # include <iostream>
63 # include <stdexcept>
64 # include <string>
65 # include <vector>
66 
67 #if defined __cplusplus
68 # define YY_CPLUSPLUS __cplusplus
69 #else
70 # define YY_CPLUSPLUS 199711L
71 #endif
72 
73 // Support move semantics when possible.
74 #if 201103L <= YY_CPLUSPLUS
75 # define YY_MOVE std::move
76 # define YY_MOVE_OR_COPY move
77 # define YY_MOVE_REF(Type) Type&&
78 # define YY_RVREF(Type) Type&&
79 # define YY_COPY(Type) Type
80 #else
81 # define YY_MOVE
82 # define YY_MOVE_OR_COPY copy
83 # define YY_MOVE_REF(Type) Type&
84 # define YY_RVREF(Type) const Type&
85 # define YY_COPY(Type) const Type&
86 #endif
87 # include "location.hh"
88 #include <typeinfo>
89 #ifndef YYASSERT
90 # include <cassert>
91 # define YYASSERT assert
92 #endif
93 
94 
95 #ifndef YY_ATTRIBUTE
96 # if (defined __GNUC__ \
97  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
98  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
99 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
100 # else
101 # define YY_ATTRIBUTE(Spec) /* empty */
102 # endif
103 #endif
104 
105 #ifndef YY_ATTRIBUTE_PURE
106 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
107 #endif
108 
109 #ifndef YY_ATTRIBUTE_UNUSED
110 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
111 #endif
112 
113 /* Suppress unused-variable warnings by "using" E. */
114 #if ! defined lint || defined __GNUC__
115 # define YYUSE(E) ((void) (E))
116 #else
117 # define YYUSE(E) /* empty */
118 #endif
119 
120 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
121 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
122 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
123  _Pragma ("GCC diagnostic push") \
124  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
125  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
126 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
127  _Pragma ("GCC diagnostic pop")
128 #else
129 # define YY_INITIAL_VALUE(Value) Value
130 #endif
131 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
132 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
133 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
134 #endif
135 #ifndef YY_INITIAL_VALUE
136 # define YY_INITIAL_VALUE(Value) /* Nothing. */
137 #endif
138 
139 # ifndef YY_NULLPTR
140 # if defined __cplusplus
141 # if 201103L <= __cplusplus
142 # define YY_NULLPTR nullptr
143 # else
144 # define YY_NULLPTR 0
145 # endif
146 # else
147 # define YY_NULLPTR ((void*)0)
148 # endif
149 # endif
150 
151 /* Debug traces. */
152 #ifndef EVALDEBUG
153 # if defined YYDEBUG
154 #if YYDEBUG
155 # define EVALDEBUG 1
156 # else
157 # define EVALDEBUG 0
158 # endif
159 # else /* ! defined YYDEBUG */
160 # define EVALDEBUG 1
161 # endif /* ! defined YYDEBUG */
162 #endif /* ! defined EVALDEBUG */
163 
164 #line 14 "parser.yy" // lalr1.cc:404
165 namespace isc { namespace eval {
166 #line 167 "parser.h" // lalr1.cc:404
167 
169  template <typename T, typename S = std::vector<T> >
170  class stack
171  {
172  public:
173  // Hide our reversed order.
174  typedef typename S::reverse_iterator iterator;
175  typedef typename S::const_reverse_iterator const_iterator;
176  typedef typename S::size_type size_type;
177 
178  stack (size_type n = 200)
179  : seq_ (n)
180  {}
181 
185  T&
186  operator[] (size_type i)
187  {
188  return seq_[size () - 1 - i];
189  }
190 
194  T&
195  operator[] (int i)
196  {
197  return operator[] (size_type (i));
198  }
199 
203  const T&
204  operator[] (size_type i) const
205  {
206  return seq_[size () - 1 - i];
207  }
208 
212  const T&
213  operator[] (int i) const
214  {
215  return operator[] (size_type (i));
216  }
217 
221  void
223  {
224  seq_.push_back (T ());
225  operator[](0).move (t);
226  }
227 
228  void
229  pop (int n = 1)
230  {
231  for (; 0 < n; --n)
232  seq_.pop_back ();
233  }
234 
235  void
236  clear ()
237  {
238  seq_.clear ();
239  }
240 
241  size_type
242  size () const
243  {
244  return seq_.size ();
245  }
246 
247  const_iterator
248  begin () const
249  {
250  return seq_.rbegin ();
251  }
252 
253  const_iterator
254  end () const
255  {
256  return seq_.rend ();
257  }
258 
259  private:
260  stack (const stack&);
261  stack& operator= (const stack&);
263  S seq_;
264  };
265 
267  template <typename T, typename S = stack<T> >
268  class slice
269  {
270  public:
271  slice (const S& stack, int range)
272  : stack_ (stack)
273  , range_ (range)
274  {}
275 
276  const T&
277  operator[] (int i) const
278  {
279  return stack_[range_ - i];
280  }
281 
282  private:
283  const S& stack_;
284  int range_;
285  };
286 
287 
288 
294  template <size_t S>
295  struct variant
296  {
299 
302  : yybuffer_ ()
303  , yytypeid_ (YY_NULLPTR)
304  {}
305 
307  template <typename T>
309  : yytypeid_ (&typeid (T))
310  {
311  YYASSERT (sizeof (T) <= S);
312  new (yyas_<T> ()) T (YY_MOVE (t));
313  }
314 
317  {
318  YYASSERT (!yytypeid_);
319  }
320 
322  template <typename T>
323  T&
325  {
326  YYASSERT (!yytypeid_);
327  YYASSERT (sizeof (T) <= S);
328  yytypeid_ = & typeid (T);
329  return *new (yyas_<T> ()) T ();
330  }
331 
332 # if 201103L <= YY_CPLUSPLUS
333  template <typename T, typename U>
335  T&
336  emplace (U&& u)
337  {
338  YYASSERT (!yytypeid_);
339  YYASSERT (sizeof (T) <= S);
340  yytypeid_ = & typeid (T);
341  return *new (yyas_<T> ()) T (std::forward <U>(u));
342  }
343 # else
344  template <typename T>
346  T&
347  emplace (const T& t)
348  {
349  YYASSERT (!yytypeid_);
350  YYASSERT (sizeof (T) <= S);
351  yytypeid_ = & typeid (T);
352  return *new (yyas_<T> ()) T (t);
353  }
354 # endif
355 
358  template <typename T>
359  T&
360  build ()
361  {
362  return emplace<T> ();
363  }
364 
367  template <typename T>
368  T&
369  build (const T& t)
370  {
371  return emplace<T> (t);
372  }
373 
375  template <typename T>
376  T&
377  as ()
378  {
379  YYASSERT (yytypeid_);
380  YYASSERT (*yytypeid_ == typeid (T));
381  YYASSERT (sizeof (T) <= S);
382  return *yyas_<T> ();
383  }
384 
386  template <typename T>
387  const T&
388  as () const
389  {
390  YYASSERT (yytypeid_);
391  YYASSERT (*yytypeid_ == typeid (T));
392  YYASSERT (sizeof (T) <= S);
393  return *yyas_<T> ();
394  }
395 
404  template <typename T>
405  void
406  swap (self_type& other)
407  {
408  YYASSERT (yytypeid_);
409  YYASSERT (*yytypeid_ == *other.yytypeid_);
410  std::swap (as<T> (), other.as<T> ());
411  }
412 
416  template <typename T>
417  void
418  move (self_type& other)
419  {
420 # if 201103L <= YY_CPLUSPLUS
421  emplace<T> (std::move (other.as<T> ()));
422 # else
423  emplace<T> ();
424  swap<T> (other);
425 # endif
426  other.destroy<T> ();
427  }
428 
429 # if 201103L <= YY_CPLUSPLUS
430  template <typename T>
432  void
433  move (self_type&& other)
434  {
435  emplace<T> (std::move (other.as<T> ()));
436  other.destroy<T> ();
437  }
438 #endif
439 
441  template <typename T>
442  void
443  copy (const self_type& other)
444  {
445  emplace<T> (other.as<T> ());
446  }
447 
449  template <typename T>
450  void
452  {
453  as<T> ().~T ();
454  yytypeid_ = YY_NULLPTR;
455  }
456 
457  private:
459  self_type& operator= (const self_type&);
460  variant (const self_type&);
461 
463  template <typename T>
464  T*
465  yyas_ ()
466  {
467  void *yyp = yybuffer_.yyraw;
468  return static_cast<T*> (yyp);
469  }
470 
472  template <typename T>
473  const T*
474  yyas_ () const
475  {
476  const void *yyp = yybuffer_.yyraw;
477  return static_cast<const T*> (yyp);
478  }
479 
480  union
481  {
483  long double yyalign_me;
485  char yyraw[S];
486  } yybuffer_;
487 
489  const std::type_info *yytypeid_;
490  };
491 
492 
495  {
496  public:
497 #ifndef EVALSTYPE
498  union union_type
500  {
501  // option_repr_type
502  char dummy1[sizeof (TokenOption::RepresentationType)];
503 
504  // pkt4_field
505  char dummy2[sizeof (TokenPkt4::FieldType)];
506 
507  // pkt6_field
508  char dummy3[sizeof (TokenPkt6::FieldType)];
509 
510  // pkt_metadata
511  char dummy4[sizeof (TokenPkt::MetadataType)];
512 
513  // relay6_field
514  char dummy5[sizeof (TokenRelay6Field::FieldType)];
515 
516  // nest_level
517  char dummy6[sizeof (int8_t)];
518 
519  // "constant string"
520  // "integer"
521  // "constant hexstring"
522  // "option name"
523  // "ip address"
524  char dummy7[sizeof (std::string)];
525 
526  // option_code
527  char dummy8[sizeof (uint16_t)];
528 
529  // integer_expr
530  // enterprise_id
531  char dummy9[sizeof (uint32_t)];
532 };
533 
535  typedef variant<sizeof (union_type)> semantic_type;
536 #else
537  typedef EVALSTYPE semantic_type;
538 #endif
539  typedef location location_type;
541 
543  struct syntax_error : std::runtime_error
544  {
545  syntax_error (const location_type& l, const std::string& m);
547  };
548 
550  struct token
551  {
553  {
554  TOKEN_END = 0,
555  TOKEN_LPAREN = 258,
556  TOKEN_RPAREN = 259,
557  TOKEN_NOT = 260,
558  TOKEN_AND = 261,
559  TOKEN_OR = 262,
560  TOKEN_EQUAL = 263,
561  TOKEN_OPTION = 264,
562  TOKEN_RELAY4 = 265,
563  TOKEN_RELAY6 = 266,
564  TOKEN_MEMBER = 267,
565  TOKEN_PEERADDR = 268,
566  TOKEN_LINKADDR = 269,
567  TOKEN_LBRACKET = 270,
568  TOKEN_RBRACKET = 271,
569  TOKEN_DOT = 272,
570  TOKEN_TEXT = 273,
571  TOKEN_HEX = 274,
572  TOKEN_EXISTS = 275,
573  TOKEN_PKT = 276,
574  TOKEN_IFACE = 277,
575  TOKEN_SRC = 278,
576  TOKEN_DST = 279,
577  TOKEN_LEN = 280,
578  TOKEN_PKT4 = 281,
579  TOKEN_CHADDR = 282,
580  TOKEN_HLEN = 283,
581  TOKEN_HTYPE = 284,
582  TOKEN_CIADDR = 285,
583  TOKEN_GIADDR = 286,
584  TOKEN_YIADDR = 287,
585  TOKEN_SIADDR = 288,
586  TOKEN_SUBSTRING = 289,
587  TOKEN_ALL = 290,
588  TOKEN_COMA = 291,
589  TOKEN_CONCAT = 292,
590  TOKEN_IFELSE = 293,
591  TOKEN_TOHEXSTRING = 294,
592  TOKEN_PKT6 = 295,
593  TOKEN_MSGTYPE = 296,
594  TOKEN_TRANSID = 297,
595  TOKEN_VENDOR_CLASS = 298,
596  TOKEN_VENDOR = 299,
597  TOKEN_ANY = 300,
598  TOKEN_DATA = 301,
599  TOKEN_ENTERPRISE = 302,
600  TOKEN_TOPLEVEL_BOOL = 303,
601  TOKEN_TOPLEVEL_STRING = 304,
602  TOKEN_STRING = 305,
603  TOKEN_INTEGER = 306,
604  TOKEN_HEXSTRING = 307,
605  TOKEN_OPTION_NAME = 308,
606  TOKEN_IP_ADDRESS = 309
607  };
608  };
609 
612 
614  typedef int symbol_number_type;
615 
617  enum { empty_symbol = -2 };
618 
620  typedef unsigned char token_number_type;
621 
628  template <typename Base>
629  struct basic_symbol : Base
630  {
632  typedef Base super_type;
633 
636 
639 
640 
642 # if 201103L <= YY_CPLUSPLUS
643  basic_symbol (typename Base::kind_type t, location_type&& l);
644 #else
645  basic_symbol (typename Base::kind_type t, const location_type& l);
646 #endif
647 # if 201103L <= YY_CPLUSPLUS
648  basic_symbol (typename Base::kind_type t, TokenOption::RepresentationType&& v, location_type&& l);
649 #else
650  basic_symbol (typename Base::kind_type t, const TokenOption::RepresentationType& v, const location_type& l);
651 #endif
652 # if 201103L <= YY_CPLUSPLUS
653  basic_symbol (typename Base::kind_type t, TokenPkt4::FieldType&& v, location_type&& l);
654 #else
655  basic_symbol (typename Base::kind_type t, const TokenPkt4::FieldType& v, const location_type& l);
656 #endif
657 # if 201103L <= YY_CPLUSPLUS
658  basic_symbol (typename Base::kind_type t, TokenPkt6::FieldType&& v, location_type&& l);
659 #else
660  basic_symbol (typename Base::kind_type t, const TokenPkt6::FieldType& v, const location_type& l);
661 #endif
662 # if 201103L <= YY_CPLUSPLUS
663  basic_symbol (typename Base::kind_type t, TokenPkt::MetadataType&& v, location_type&& l);
664 #else
665  basic_symbol (typename Base::kind_type t, const TokenPkt::MetadataType& v, const location_type& l);
666 #endif
667 # if 201103L <= YY_CPLUSPLUS
668  basic_symbol (typename Base::kind_type t, TokenRelay6Field::FieldType&& v, location_type&& l);
669 #else
670  basic_symbol (typename Base::kind_type t, const TokenRelay6Field::FieldType& v, const location_type& l);
671 #endif
672 # if 201103L <= YY_CPLUSPLUS
673  basic_symbol (typename Base::kind_type t, int8_t&& v, location_type&& l);
674 #else
675  basic_symbol (typename Base::kind_type t, const int8_t& v, const location_type& l);
676 #endif
677 # if 201103L <= YY_CPLUSPLUS
678  basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l);
679 #else
680  basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l);
681 #endif
682 # if 201103L <= YY_CPLUSPLUS
683  basic_symbol (typename Base::kind_type t, uint16_t&& v, location_type&& l);
684 #else
685  basic_symbol (typename Base::kind_type t, const uint16_t& v, const location_type& l);
686 #endif
687 # if 201103L <= YY_CPLUSPLUS
688  basic_symbol (typename Base::kind_type t, uint32_t&& v, location_type&& l);
689 #else
690  basic_symbol (typename Base::kind_type t, const uint32_t& v, const location_type& l);
691 #endif
692 
693 
696 
698  void clear ();
699 
701  bool empty () const;
702 
704  void move (basic_symbol& s);
705 
708 
711 
712  private:
713 #if YY_CPLUSPLUS < 201103L
714  basic_symbol& operator= (const basic_symbol& other);
716 #endif
717  };
718 
720  struct by_type
721  {
723  by_type ();
724 
726  by_type (const by_type& other);
727 
730 
732  by_type (kind_type t);
733 
735  void clear ();
736 
738  void move (by_type& that);
739 
742  symbol_number_type type_get () const;
743 
745  token_type token () const;
746 
750  int type;
751  };
752 
755 
757  EvalParser (EvalContext& ctx_yyarg);
758  virtual ~EvalParser ();
759 
762  int operator() ();
763 
766  virtual int parse ();
767 
768 #if EVALDEBUG
769  std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
772  void set_debug_stream (std::ostream &);
773 
775  typedef int debug_level_type;
777  debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
779  void set_debug_level (debug_level_type l);
780 #endif
781 
785  virtual void error (const location_type& loc, const std::string& msg);
786 
788  void error (const syntax_error& err);
789 
790  // Symbol constructors declarations.
791  static
793  make_END (YY_COPY (location_type) l);
794 
795  static
797  make_LPAREN (YY_COPY (location_type) l);
798 
799  static
801  make_RPAREN (YY_COPY (location_type) l);
802 
803  static
805  make_NOT (YY_COPY (location_type) l);
806 
807  static
809  make_AND (YY_COPY (location_type) l);
810 
811  static
813  make_OR (YY_COPY (location_type) l);
814 
815  static
817  make_EQUAL (YY_COPY (location_type) l);
818 
819  static
821  make_OPTION (YY_COPY (location_type) l);
822 
823  static
825  make_RELAY4 (YY_COPY (location_type) l);
826 
827  static
829  make_RELAY6 (YY_COPY (location_type) l);
830 
831  static
833  make_MEMBER (YY_COPY (location_type) l);
834 
835  static
837  make_PEERADDR (YY_COPY (location_type) l);
838 
839  static
841  make_LINKADDR (YY_COPY (location_type) l);
842 
843  static
845  make_LBRACKET (YY_COPY (location_type) l);
846 
847  static
849  make_RBRACKET (YY_COPY (location_type) l);
850 
851  static
853  make_DOT (YY_COPY (location_type) l);
854 
855  static
857  make_TEXT (YY_COPY (location_type) l);
858 
859  static
861  make_HEX (YY_COPY (location_type) l);
862 
863  static
865  make_EXISTS (YY_COPY (location_type) l);
866 
867  static
869  make_PKT (YY_COPY (location_type) l);
870 
871  static
873  make_IFACE (YY_COPY (location_type) l);
874 
875  static
877  make_SRC (YY_COPY (location_type) l);
878 
879  static
881  make_DST (YY_COPY (location_type) l);
882 
883  static
885  make_LEN (YY_COPY (location_type) l);
886 
887  static
889  make_PKT4 (YY_COPY (location_type) l);
890 
891  static
893  make_CHADDR (YY_COPY (location_type) l);
894 
895  static
897  make_HLEN (YY_COPY (location_type) l);
898 
899  static
901  make_HTYPE (YY_COPY (location_type) l);
902 
903  static
905  make_CIADDR (YY_COPY (location_type) l);
906 
907  static
909  make_GIADDR (YY_COPY (location_type) l);
910 
911  static
913  make_YIADDR (YY_COPY (location_type) l);
914 
915  static
917  make_SIADDR (YY_COPY (location_type) l);
918 
919  static
921  make_SUBSTRING (YY_COPY (location_type) l);
922 
923  static
925  make_ALL (YY_COPY (location_type) l);
926 
927  static
929  make_COMA (YY_COPY (location_type) l);
930 
931  static
933  make_CONCAT (YY_COPY (location_type) l);
934 
935  static
937  make_IFELSE (YY_COPY (location_type) l);
938 
939  static
941  make_TOHEXSTRING (YY_COPY (location_type) l);
942 
943  static
945  make_PKT6 (YY_COPY (location_type) l);
946 
947  static
949  make_MSGTYPE (YY_COPY (location_type) l);
950 
951  static
953  make_TRANSID (YY_COPY (location_type) l);
954 
955  static
957  make_VENDOR_CLASS (YY_COPY (location_type) l);
958 
959  static
961  make_VENDOR (YY_COPY (location_type) l);
962 
963  static
965  make_ANY (YY_COPY (location_type) l);
966 
967  static
969  make_DATA (YY_COPY (location_type) l);
970 
971  static
973  make_ENTERPRISE (YY_COPY (location_type) l);
974 
975  static
977  make_TOPLEVEL_BOOL (YY_COPY (location_type) l);
978 
979  static
981  make_TOPLEVEL_STRING (YY_COPY (location_type) l);
982 
983  static
985  make_STRING (YY_COPY (std::string) v, YY_COPY (location_type) l);
986 
987  static
989  make_INTEGER (YY_COPY (std::string) v, YY_COPY (location_type) l);
990 
991  static
993  make_HEXSTRING (YY_COPY (std::string) v, YY_COPY (location_type) l);
994 
995  static
997  make_OPTION_NAME (YY_COPY (std::string) v, YY_COPY (location_type) l);
998 
999  static
1000  symbol_type
1001  make_IP_ADDRESS (YY_COPY (std::string) v, YY_COPY (location_type) l);
1002 
1003 
1004 
1005  private:
1007  EvalParser (const EvalParser&);
1008  EvalParser& operator= (const EvalParser&);
1009 
1011  typedef int state_type;
1012 
1016  virtual std::string yysyntax_error_ (state_type yystate,
1017  const symbol_type& yyla) const;
1018 
1022  state_type yy_lr_goto_state_ (state_type yystate, int yysym);
1023 
1026  static bool yy_pact_value_is_default_ (int yyvalue);
1027 
1030  static bool yy_table_value_is_error_ (int yyvalue);
1031 
1032  static const signed char yypact_ninf_;
1033  static const signed char yytable_ninf_;
1034 
1036  static token_number_type yytranslate_ (token_type t);
1037 
1038  // Tables.
1039  // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1040  // STATE-NUM.
1041  static const short yypact_[];
1042 
1043  // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1044  // Performed when YYTABLE does not specify something else to do. Zero
1045  // means the default is an error.
1046  static const unsigned char yydefact_[];
1047 
1048  // YYPGOTO[NTERM-NUM].
1049  static const short yypgoto_[];
1050 
1051  // YYDEFGOTO[NTERM-NUM].
1052  static const short yydefgoto_[];
1053 
1054  // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1055  // positive, shift that token. If negative, reduce the rule whose
1056  // number is the opposite. If YYTABLE_NINF, syntax error.
1057  static const unsigned char yytable_[];
1058 
1059  static const unsigned char yycheck_[];
1060 
1061  // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1062  // symbol of state STATE-NUM.
1063  static const unsigned char yystos_[];
1064 
1065  // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
1066  static const unsigned char yyr1_[];
1067 
1068  // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
1069  static const unsigned char yyr2_[];
1070 
1071 
1073  static std::string yytnamerr_ (const char *n);
1074 
1075 
1077  static const char* const yytname_[];
1078 #if EVALDEBUG
1079  // YYRLINE[YYN] -- Source line where rule number YYN was defined.
1080  static const unsigned short yyrline_[];
1082  virtual void yy_reduce_print_ (int r);
1084  virtual void yystack_print_ ();
1085 
1087  int yydebug_;
1089  std::ostream* yycdebug_;
1090 
1094  template <typename Base>
1095  void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
1096 #endif
1097 
1102  template <typename Base>
1103  void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
1104 
1105  private:
1107  struct by_state
1108  {
1110  by_state ();
1111 
1113  typedef state_type kind_type;
1114 
1116  by_state (kind_type s);
1117 
1119  by_state (const by_state& other);
1120 
1122  void clear ();
1123 
1125  void move (by_state& that);
1126 
1129  symbol_number_type type_get () const;
1130 
1132  enum { empty_state = -1 };
1133 
1136  state_type state;
1137  };
1138 
1140  struct stack_symbol_type : basic_symbol<by_state>
1141  {
1143  typedef basic_symbol<by_state> super_type;
1145  stack_symbol_type ();
1147  stack_symbol_type (YY_RVREF (stack_symbol_type) that);
1149  stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
1150 #if YY_CPLUSPLUS < 201103L
1151  stack_symbol_type& operator= (stack_symbol_type& that);
1154 #endif
1155  };
1156 
1158  typedef stack<stack_symbol_type> stack_type;
1159 
1161  stack_type yystack_;
1162 
1168  void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
1169 
1176  void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
1177 
1179  void yypop_ (int n = 1);
1180 
1182  enum
1183  {
1184  yyeof_ = 0,
1185  yylast_ = 197,
1186  yynnts_ = 16,
1187  yyfinal_ = 33,
1188  yyterror_ = 1,
1189  yyerrcode_ = 256,
1190  yyntokens_ = 55
1191  };
1192 
1193 
1194  // User arguments.
1195  EvalContext& ctx;
1196  };
1197 
1198  // Symbol number corresponding to token number t.
1199  inline
1201  EvalParser::yytranslate_ (token_type t)
1202  {
1203  static
1204  const token_number_type
1205  translate_table[] =
1206  {
1207  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1208  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1209  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1210  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1211  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1212  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1213  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1214  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1215  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1216  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1217  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1218  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1219  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1220  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1221  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1222  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1223  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1224  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1225  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1226  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1227  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1228  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1229  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1230  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1231  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1232  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1233  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1234  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1235  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1236  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1237  45, 46, 47, 48, 49, 50, 51, 52, 53, 54
1238  };
1239  const unsigned user_token_number_max_ = 309;
1240  const token_number_type undef_token_ = 2;
1241 
1242  if (static_cast<int> (t) <= yyeof_)
1243  return yyeof_;
1244  else if (static_cast<unsigned> (t) <= user_token_number_max_)
1245  return translate_table[t];
1246  else
1247  return undef_token_;
1248  }
1249 
1250  inline
1251  EvalParser::syntax_error::syntax_error (const location_type& l, const std::string& m)
1252  : std::runtime_error (m)
1253  , location (l)
1254  {}
1255 
1256  // basic_symbol.
1257  template <typename Base>
1259  : value ()
1260  , location ()
1261  {}
1262 
1263  template <typename Base>
1265  : Base (YY_MOVE (other))
1266  , value ()
1267  , location (YY_MOVE (other.location))
1268  {
1269  switch (other.type_get ())
1270  {
1271  case 62: // option_repr_type
1272  value.YY_MOVE_OR_COPY< TokenOption::RepresentationType > (YY_MOVE (other.value));
1273  break;
1274 
1275  case 66: // pkt4_field
1276  value.YY_MOVE_OR_COPY< TokenPkt4::FieldType > (YY_MOVE (other.value));
1277  break;
1278 
1279  case 67: // pkt6_field
1280  value.YY_MOVE_OR_COPY< TokenPkt6::FieldType > (YY_MOVE (other.value));
1281  break;
1282 
1283  case 64: // pkt_metadata
1284  value.YY_MOVE_OR_COPY< TokenPkt::MetadataType > (YY_MOVE (other.value));
1285  break;
1286 
1287  case 68: // relay6_field
1288  value.YY_MOVE_OR_COPY< TokenRelay6Field::FieldType > (YY_MOVE (other.value));
1289  break;
1290 
1291  case 63: // nest_level
1292  value.YY_MOVE_OR_COPY< int8_t > (YY_MOVE (other.value));
1293  break;
1294 
1295  case 50: // "constant string"
1296  case 51: // "integer"
1297  case 52: // "constant hexstring"
1298  case 53: // "option name"
1299  case 54: // "ip address"
1300  value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (other.value));
1301  break;
1302 
1303  case 61: // option_code
1304  value.YY_MOVE_OR_COPY< uint16_t > (YY_MOVE (other.value));
1305  break;
1306 
1307  case 60: // integer_expr
1308  case 65: // enterprise_id
1309  value.YY_MOVE_OR_COPY< uint32_t > (YY_MOVE (other.value));
1310  break;
1311 
1312  default:
1313  break;
1314  }
1315 
1316  }
1317 
1318 
1319  // Implementation of basic_symbol constructor for each type.
1320 # if 201103L <= YY_CPLUSPLUS
1321  template <typename Base>
1322  EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, location_type&& l)
1323  : Base (t)
1324  , location (std::move (l))
1325  {}
1326 #else
1327  template <typename Base>
1328  EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
1329  : Base (t)
1330  , location (l)
1331  {}
1332 #endif
1333 # if 201103L <= YY_CPLUSPLUS
1334  template <typename Base>
1336  : Base (t)
1337  , value (std::move (v))
1338  , location (std::move (l))
1339  {}
1340 #else
1341  template <typename Base>
1343  : Base (t)
1344  , value (v)
1345  , location (l)
1346  {}
1347 #endif
1348 # if 201103L <= YY_CPLUSPLUS
1349  template <typename Base>
1351  : Base (t)
1352  , value (std::move (v))
1353  , location (std::move (l))
1354  {}
1355 #else
1356  template <typename Base>
1358  : Base (t)
1359  , value (v)
1360  , location (l)
1361  {}
1362 #endif
1363 # if 201103L <= YY_CPLUSPLUS
1364  template <typename Base>
1366  : Base (t)
1367  , value (std::move (v))
1368  , location (std::move (l))
1369  {}
1370 #else
1371  template <typename Base>
1373  : Base (t)
1374  , value (v)
1375  , location (l)
1376  {}
1377 #endif
1378 # if 201103L <= YY_CPLUSPLUS
1379  template <typename Base>
1381  : Base (t)
1382  , value (std::move (v))
1383  , location (std::move (l))
1384  {}
1385 #else
1386  template <typename Base>
1388  : Base (t)
1389  , value (v)
1390  , location (l)
1391  {}
1392 #endif
1393 # if 201103L <= YY_CPLUSPLUS
1394  template <typename Base>
1396  : Base (t)
1397  , value (std::move (v))
1398  , location (std::move (l))
1399  {}
1400 #else
1401  template <typename Base>
1403  : Base (t)
1404  , value (v)
1405  , location (l)
1406  {}
1407 #endif
1408 # if 201103L <= YY_CPLUSPLUS
1409  template <typename Base>
1410  EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, int8_t&& v, location_type&& l)
1411  : Base (t)
1412  , value (std::move (v))
1413  , location (std::move (l))
1414  {}
1415 #else
1416  template <typename Base>
1417  EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const int8_t& v, const location_type& l)
1418  : Base (t)
1419  , value (v)
1420  , location (l)
1421  {}
1422 #endif
1423 # if 201103L <= YY_CPLUSPLUS
1424  template <typename Base>
1425  EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l)
1426  : Base (t)
1427  , value (std::move (v))
1428  , location (std::move (l))
1429  {}
1430 #else
1431  template <typename Base>
1432  EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
1433  : Base (t)
1434  , value (v)
1435  , location (l)
1436  {}
1437 #endif
1438 # if 201103L <= YY_CPLUSPLUS
1439  template <typename Base>
1440  EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, uint16_t&& v, location_type&& l)
1441  : Base (t)
1442  , value (std::move (v))
1443  , location (std::move (l))
1444  {}
1445 #else
1446  template <typename Base>
1447  EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const uint16_t& v, const location_type& l)
1448  : Base (t)
1449  , value (v)
1450  , location (l)
1451  {}
1452 #endif
1453 # if 201103L <= YY_CPLUSPLUS
1454  template <typename Base>
1455  EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, uint32_t&& v, location_type&& l)
1456  : Base (t)
1457  , value (std::move (v))
1458  , location (std::move (l))
1459  {}
1460 #else
1461  template <typename Base>
1462  EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const uint32_t& v, const location_type& l)
1463  : Base (t)
1464  , value (v)
1465  , location (l)
1466  {}
1467 #endif
1468 
1469 
1470  template <typename Base>
1472  {
1473  clear ();
1474  }
1475 
1476  template <typename Base>
1477  void
1479  {
1480  // User destructor.
1481  symbol_number_type yytype = this->type_get ();
1482  basic_symbol<Base>& yysym = *this;
1483  (void) yysym;
1484  switch (yytype)
1485  {
1486  default:
1487  break;
1488  }
1489 
1490  // Type destructor.
1491  switch (yytype)
1492  {
1493  case 62: // option_repr_type
1494  value.template destroy< TokenOption::RepresentationType > ();
1495  break;
1496 
1497  case 66: // pkt4_field
1498  value.template destroy< TokenPkt4::FieldType > ();
1499  break;
1500 
1501  case 67: // pkt6_field
1502  value.template destroy< TokenPkt6::FieldType > ();
1503  break;
1504 
1505  case 64: // pkt_metadata
1506  value.template destroy< TokenPkt::MetadataType > ();
1507  break;
1508 
1509  case 68: // relay6_field
1510  value.template destroy< TokenRelay6Field::FieldType > ();
1511  break;
1512 
1513  case 63: // nest_level
1514  value.template destroy< int8_t > ();
1515  break;
1516 
1517  case 50: // "constant string"
1518  case 51: // "integer"
1519  case 52: // "constant hexstring"
1520  case 53: // "option name"
1521  case 54: // "ip address"
1522  value.template destroy< std::string > ();
1523  break;
1524 
1525  case 61: // option_code
1526  value.template destroy< uint16_t > ();
1527  break;
1528 
1529  case 60: // integer_expr
1530  case 65: // enterprise_id
1531  value.template destroy< uint32_t > ();
1532  break;
1533 
1534  default:
1535  break;
1536  }
1537 
1538  Base::clear ();
1539  }
1540 
1541  template <typename Base>
1542  bool
1544  {
1545  return Base::type_get () == empty_symbol;
1546  }
1547 
1548  template <typename Base>
1549  void
1551  {
1552  super_type::move (s);
1553  switch (this->type_get ())
1554  {
1555  case 62: // option_repr_type
1556  value.move< TokenOption::RepresentationType > (YY_MOVE (s.value));
1557  break;
1558 
1559  case 66: // pkt4_field
1560  value.move< TokenPkt4::FieldType > (YY_MOVE (s.value));
1561  break;
1562 
1563  case 67: // pkt6_field
1564  value.move< TokenPkt6::FieldType > (YY_MOVE (s.value));
1565  break;
1566 
1567  case 64: // pkt_metadata
1568  value.move< TokenPkt::MetadataType > (YY_MOVE (s.value));
1569  break;
1570 
1571  case 68: // relay6_field
1572  value.move< TokenRelay6Field::FieldType > (YY_MOVE (s.value));
1573  break;
1574 
1575  case 63: // nest_level
1576  value.move< int8_t > (YY_MOVE (s.value));
1577  break;
1578 
1579  case 50: // "constant string"
1580  case 51: // "integer"
1581  case 52: // "constant hexstring"
1582  case 53: // "option name"
1583  case 54: // "ip address"
1584  value.move< std::string > (YY_MOVE (s.value));
1585  break;
1586 
1587  case 61: // option_code
1588  value.move< uint16_t > (YY_MOVE (s.value));
1589  break;
1590 
1591  case 60: // integer_expr
1592  case 65: // enterprise_id
1593  value.move< uint32_t > (YY_MOVE (s.value));
1594  break;
1595 
1596  default:
1597  break;
1598  }
1599 
1600  location = YY_MOVE (s.location);
1601  }
1602 
1603  // by_type.
1604  inline
1606  : type (empty_symbol)
1607  {}
1608 
1609  inline
1611  : type (other.type)
1612  {}
1613 
1614  inline
1616  : type (yytranslate_ (t))
1617  {}
1618 
1619  inline
1620  void
1622  {
1623  type = empty_symbol;
1624  }
1625 
1626  inline
1627  void
1629  {
1630  type = that.type;
1631  that.clear ();
1632  }
1633 
1634  inline
1635  int
1637  {
1638  return type;
1639  }
1640 
1641  inline
1644  {
1645  // YYTOKNUM[NUM] -- (External) token number corresponding to the
1646  // (internal) symbol number NUM (which must be that of a token). */
1647  static
1648  const unsigned short
1649  yytoken_number_[] =
1650  {
1651  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1652  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1653  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1654  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1655  295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1656  305, 306, 307, 308, 309
1657  };
1658  return static_cast<token_type> (yytoken_number_[type]);
1659  }
1660 
1661  // Implementation of make_symbol for each symbol type.
1662  inline
1665  {
1666  return symbol_type (token::TOKEN_END, YY_MOVE (l));
1667  }
1668 
1669  inline
1672  {
1673  return symbol_type (token::TOKEN_LPAREN, YY_MOVE (l));
1674  }
1675 
1676  inline
1679  {
1680  return symbol_type (token::TOKEN_RPAREN, YY_MOVE (l));
1681  }
1682 
1683  inline
1686  {
1687  return symbol_type (token::TOKEN_NOT, YY_MOVE (l));
1688  }
1689 
1690  inline
1693  {
1694  return symbol_type (token::TOKEN_AND, YY_MOVE (l));
1695  }
1696 
1697  inline
1700  {
1701  return symbol_type (token::TOKEN_OR, YY_MOVE (l));
1702  }
1703 
1704  inline
1707  {
1708  return symbol_type (token::TOKEN_EQUAL, YY_MOVE (l));
1709  }
1710 
1711  inline
1714  {
1715  return symbol_type (token::TOKEN_OPTION, YY_MOVE (l));
1716  }
1717 
1718  inline
1721  {
1722  return symbol_type (token::TOKEN_RELAY4, YY_MOVE (l));
1723  }
1724 
1725  inline
1728  {
1729  return symbol_type (token::TOKEN_RELAY6, YY_MOVE (l));
1730  }
1731 
1732  inline
1735  {
1736  return symbol_type (token::TOKEN_MEMBER, YY_MOVE (l));
1737  }
1738 
1739  inline
1742  {
1744  }
1745 
1746  inline
1749  {
1751  }
1752 
1753  inline
1756  {
1758  }
1759 
1760  inline
1763  {
1765  }
1766 
1767  inline
1770  {
1771  return symbol_type (token::TOKEN_DOT, YY_MOVE (l));
1772  }
1773 
1774  inline
1777  {
1778  return symbol_type (token::TOKEN_TEXT, YY_MOVE (l));
1779  }
1780 
1781  inline
1784  {
1785  return symbol_type (token::TOKEN_HEX, YY_MOVE (l));
1786  }
1787 
1788  inline
1791  {
1792  return symbol_type (token::TOKEN_EXISTS, YY_MOVE (l));
1793  }
1794 
1795  inline
1798  {
1799  return symbol_type (token::TOKEN_PKT, YY_MOVE (l));
1800  }
1801 
1802  inline
1805  {
1806  return symbol_type (token::TOKEN_IFACE, YY_MOVE (l));
1807  }
1808 
1809  inline
1812  {
1813  return symbol_type (token::TOKEN_SRC, YY_MOVE (l));
1814  }
1815 
1816  inline
1819  {
1820  return symbol_type (token::TOKEN_DST, YY_MOVE (l));
1821  }
1822 
1823  inline
1826  {
1827  return symbol_type (token::TOKEN_LEN, YY_MOVE (l));
1828  }
1829 
1830  inline
1833  {
1834  return symbol_type (token::TOKEN_PKT4, YY_MOVE (l));
1835  }
1836 
1837  inline
1840  {
1841  return symbol_type (token::TOKEN_CHADDR, YY_MOVE (l));
1842  }
1843 
1844  inline
1847  {
1848  return symbol_type (token::TOKEN_HLEN, YY_MOVE (l));
1849  }
1850 
1851  inline
1854  {
1855  return symbol_type (token::TOKEN_HTYPE, YY_MOVE (l));
1856  }
1857 
1858  inline
1861  {
1862  return symbol_type (token::TOKEN_CIADDR, YY_MOVE (l));
1863  }
1864 
1865  inline
1868  {
1869  return symbol_type (token::TOKEN_GIADDR, YY_MOVE (l));
1870  }
1871 
1872  inline
1875  {
1876  return symbol_type (token::TOKEN_YIADDR, YY_MOVE (l));
1877  }
1878 
1879  inline
1882  {
1883  return symbol_type (token::TOKEN_SIADDR, YY_MOVE (l));
1884  }
1885 
1886  inline
1889  {
1891  }
1892 
1893  inline
1896  {
1897  return symbol_type (token::TOKEN_ALL, YY_MOVE (l));
1898  }
1899 
1900  inline
1903  {
1904  return symbol_type (token::TOKEN_COMA, YY_MOVE (l));
1905  }
1906 
1907  inline
1910  {
1911  return symbol_type (token::TOKEN_CONCAT, YY_MOVE (l));
1912  }
1913 
1914  inline
1917  {
1918  return symbol_type (token::TOKEN_IFELSE, YY_MOVE (l));
1919  }
1920 
1921  inline
1924  {
1926  }
1927 
1928  inline
1931  {
1932  return symbol_type (token::TOKEN_PKT6, YY_MOVE (l));
1933  }
1934 
1935  inline
1938  {
1940  }
1941 
1942  inline
1945  {
1947  }
1948 
1949  inline
1952  {
1954  }
1955 
1956  inline
1959  {
1960  return symbol_type (token::TOKEN_VENDOR, YY_MOVE (l));
1961  }
1962 
1963  inline
1966  {
1967  return symbol_type (token::TOKEN_ANY, YY_MOVE (l));
1968  }
1969 
1970  inline
1973  {
1974  return symbol_type (token::TOKEN_DATA, YY_MOVE (l));
1975  }
1976 
1977  inline
1980  {
1982  }
1983 
1984  inline
1987  {
1989  }
1990 
1991  inline
1994  {
1996  }
1997 
1998  inline
2001  {
2002  return symbol_type (token::TOKEN_STRING, YY_MOVE (v), YY_MOVE (l));
2003  }
2004 
2005  inline
2008  {
2009  return symbol_type (token::TOKEN_INTEGER, YY_MOVE (v), YY_MOVE (l));
2010  }
2011 
2012  inline
2015  {
2017  }
2018 
2019  inline
2022  {
2024  }
2025 
2026  inline
2029  {
2031  }
2032 
2033 
2034 #line 14 "parser.yy" // lalr1.cc:404
2035 } } // isc::eval
2036 #line 2037 "parser.h" // lalr1.cc:404
2037 
2038 
2039 
2040 
2041 #endif // !YY_EVAL_PARSER_H_INCLUDED
isc::eval::EvalParser::symbol_number_type
int symbol_number_type
Symbol type: an internal symbol number.
Definition: parser.h:614
isc::dhcp::TokenPkt::MetadataType
MetadataType
enum value that determines the field.
Definition: token.h:389
isc::eval::EvalParser::token::TOKEN_DST
@ TOKEN_DST
Definition: parser.h:576
isc::eval::EvalParser::token::TOKEN_CHADDR
@ TOKEN_CHADDR
Definition: parser.h:579
isc::eval::stack::const_iterator
S::const_reverse_iterator const_iterator
Definition: parser.h:175
isc::eval::variant::destroy
void destroy()
Destroy the stored T.
Definition: parser.h:451
YYASSERT
#define YYASSERT
Definition: parser.h:91
isc::eval::variant::self_type
variant< S > self_type
Type of *this.
Definition: parser.h:298
isc::eval::EvalParser::token::TOKEN_AND
@ TOKEN_AND
Definition: parser.h:558
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(typename Base::kind_type t, const location_type &l)
Constructor for valueless symbols, and symbols from each type.
Definition: parser.h:1328
isc::eval::EvalParser::token::TOKEN_PKT4
@ TOKEN_PKT4
Definition: parser.h:578
isc::eval::EvalParser::union_type
An auxiliary type to compute the largest semantic type.
Definition: parser.h:500
isc::eval::EvalParser::token::TOKEN_LEN
@ TOKEN_LEN
Definition: parser.h:577
isc::eval::EvalParser::make_SIADDR
static symbol_type make_SIADDR(YY_COPY(location_type) l)
Definition: parser.h:1881
isc::eval::EvalParser::token::TOKEN_SRC
@ TOKEN_SRC
Definition: parser.h:575
isc::eval::EvalParser::token::TOKEN_PEERADDR
@ TOKEN_PEERADDR
Definition: parser.h:565
isc::eval::EvalParser::by_type::clear
void clear()
Record that this symbol is empty.
Definition: parser.h:1621
isc::eval::EvalParser::make_RPAREN
static symbol_type make_RPAREN(YY_COPY(location_type) l)
Definition: parser.h:1678
isc::eval::EvalParser::token::TOKEN_OR
@ TOKEN_OR
Definition: parser.h:559
isc::eval::EvalParser::by_type::kind_type
token_type kind_type
The symbol type as needed by the constructor.
Definition: parser.h:729
isc::eval::EvalParser::make_END
static symbol_type make_END(YY_COPY(location_type) l)
Definition: parser.h:1664
isc::eval::EvalParser::make_IP_ADDRESS
static symbol_type make_IP_ADDRESS(YY_COPY(std::string) v, YY_COPY(location_type) l)
Definition: parser.h:2028
isc::eval
Definition: eval_context.h:23
isc::eval::EvalParser::by_type::by_type
by_type()
Default constructor.
Definition: parser.h:1605
isc::eval::EvalParser::token::TOKEN_GIADDR
@ TOKEN_GIADDR
Definition: parser.h:583
isc::eval::stack::stack
stack(size_type n=200)
Definition: parser.h:178
isc::eval::EvalParser::by_type::type_get
symbol_number_type type_get() const
The (internal) type number (corresponding to type).
Definition: parser.h:1636
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(typename Base::kind_type t, const uint16_t &v, const location_type &l)
Definition: parser.h:1447
isc::eval::EvalParser::make_DOT
static symbol_type make_DOT(YY_COPY(location_type) l)
Definition: parser.h:1769
isc::eval::EvalParser::token::TOKEN_CIADDR
@ TOKEN_CIADDR
Definition: parser.h:582
isc::eval::variant::build
T & build(const T &t)
Instantiate a T in here from t.
Definition: parser.h:369
isc::eval::EvalParser::token::TOKEN_HTYPE
@ TOKEN_HTYPE
Definition: parser.h:581
YY_RVREF
#define YY_RVREF(Type)
Definition: parser.h:84
isc::eval::EvalParser::make_LBRACKET
static symbol_type make_LBRACKET(YY_COPY(location_type) l)
Definition: parser.h:1755
isc::eval::EvalParser::token::TOKEN_LPAREN
@ TOKEN_LPAREN
Definition: parser.h:555
isc::dhcp::TokenPkt6::FieldType
FieldType
enum value that determines the field.
Definition: token.h:492
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(typename Base::kind_type t, const TokenOption::RepresentationType &v, const location_type &l)
Definition: parser.h:1342
isc::eval::EvalParser::token::TOKEN_DOT
@ TOKEN_DOT
Definition: parser.h:569
isc::eval::variant::variant
variant(YY_RVREF(T) t)
Construct and fill.
Definition: parser.h:308
isc::eval::EvalParser::make_ANY
static symbol_type make_ANY(YY_COPY(location_type) l)
Definition: parser.h:1965
isc::eval::EvalParser::token::TOKEN_TOPLEVEL_STRING
@ TOKEN_TOPLEVEL_STRING
Definition: parser.h:601
isc::dhcp::TokenRelay6Field::FieldType
FieldType
enum value that determines the field.
Definition: token.h:544
isc::eval::EvalParser::token::TOKEN_NOT
@ TOKEN_NOT
Definition: parser.h:557
isc::eval::EvalParser::make_TOPLEVEL_BOOL
static symbol_type make_TOPLEVEL_BOOL(YY_COPY(location_type) l)
Definition: parser.h:1986
isc::eval::EvalParser::make_DATA
static symbol_type make_DATA(YY_COPY(location_type) l)
Definition: parser.h:1972
isc::eval::EvalParser::syntax_error::location
location_type location
Definition: parser.h:546
isc::eval::EvalParser::token::TOKEN_YIADDR
@ TOKEN_YIADDR
Definition: parser.h:584
isc::eval::EvalParser::token::TOKEN_LINKADDR
@ TOKEN_LINKADDR
Definition: parser.h:566
isc::eval::EvalParser::basic_symbol::clear
void clear()
Destroy contents, and record that is empty.
Definition: parser.h:1478
isc::eval::stack::size
size_type size() const
Definition: parser.h:242
isc::eval::EvalParser::make_TOPLEVEL_STRING
static symbol_type make_TOPLEVEL_STRING(YY_COPY(location_type) l)
Definition: parser.h:1993
isc::eval::EvalParser::make_CIADDR
static symbol_type make_CIADDR(YY_COPY(location_type) l)
Definition: parser.h:1860
isc::eval::EvalParser::token::TOKEN_COMA
@ TOKEN_COMA
Definition: parser.h:588
isc::eval::EvalParser::make_RBRACKET
static symbol_type make_RBRACKET(YY_COPY(location_type) l)
Definition: parser.h:1762
isc::eval::EvalParser::debug_level_type
int debug_level_type
Type for debugging levels.
Definition: parser.h:775
isc::eval::variant::yyalign_me
long double yyalign_me
Strongest alignment constraints.
Definition: parser.h:483
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(typename Base::kind_type t, const TokenRelay6Field::FieldType &v, const location_type &l)
Definition: parser.h:1402
isc::eval::EvalParser::make_VENDOR
static symbol_type make_VENDOR(YY_COPY(location_type) l)
Definition: parser.h:1958
isc::eval::EvalParser::make_LEN
static symbol_type make_LEN(YY_COPY(location_type) l)
Definition: parser.h:1825
isc::eval::stack::begin
const_iterator begin() const
Definition: parser.h:248
isc::eval::EvalParser::empty_symbol
@ empty_symbol
Definition: parser.h:617
isc::eval::EvalParser::make_PKT
static symbol_type make_PKT(YY_COPY(location_type) l)
Definition: parser.h:1797
YY_COPY
#define YY_COPY(Type)
Definition: parser.h:85
isc::eval::EvalParser::make_MSGTYPE
static symbol_type make_MSGTYPE(YY_COPY(location_type) l)
Definition: parser.h:1937
isc::eval::EvalParser::make_VENDOR_CLASS
static symbol_type make_VENDOR_CLASS(YY_COPY(location_type) l)
Definition: parser.h:1951
isc::eval::EvalParser::make_CONCAT
static symbol_type make_CONCAT(YY_COPY(location_type) l)
Definition: parser.h:1909
isc::eval::EvalParser::make_RELAY4
static symbol_type make_RELAY4(YY_COPY(location_type) l)
Definition: parser.h:1720
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::eval::EvalParser::token::TOKEN_TOHEXSTRING
@ TOKEN_TOHEXSTRING
Definition: parser.h:591
isc::eval::EvalParser::token
Tokens.
Definition: parser.h:551
isc::dhcp::stack< stack_symbol_type >
isc::eval::EvalParser::by_type
Type access provider for token (enum) based symbols.
Definition: parser.h:721
isc::eval::EvalParser::basic_symbol::empty
bool empty() const
Whether empty.
Definition: parser.h:1543
isc::eval::EvalParser::location_type
location location_type
Symbol locations.
Definition: parser.h:540
isc::eval::EvalParser::make_LPAREN
static symbol_type make_LPAREN(YY_COPY(location_type) l)
Definition: parser.h:1671
isc::eval::EvalParser::make_NOT
static symbol_type make_NOT(YY_COPY(location_type) l)
Definition: parser.h:1685
isc::eval::stack::size_type
S::size_type size_type
Definition: parser.h:176
isc::eval::EvalParser::make_AND
static symbol_type make_AND(YY_COPY(location_type) l)
Definition: parser.h:1692
YY_MOVE_REF
#define YY_MOVE_REF(Type)
Definition: parser.h:83
isc::eval::variant
A char[S] buffer to store and retrieve objects.
Definition: parser.h:296
isc::eval::EvalParser::token::TOKEN_IP_ADDRESS
@ TOKEN_IP_ADDRESS
Definition: parser.h:606
isc::dhcp
Definition: ctrl_dhcp4_srv.cc:75
isc::eval::EvalParser::make_CHADDR
static symbol_type make_CHADDR(YY_COPY(location_type) l)
Definition: parser.h:1839
isc::eval::EvalParser::token::TOKEN_HEXSTRING
@ TOKEN_HEXSTRING
Definition: parser.h:604
eval_context_decl.h
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(typename Base::kind_type t, const TokenPkt::MetadataType &v, const location_type &l)
Definition: parser.h:1387
isc::eval::EvalParser::token::TOKEN_VENDOR
@ TOKEN_VENDOR
Definition: parser.h:596
isc::eval::EvalParser::make_COMA
static symbol_type make_COMA(YY_COPY(location_type) l)
Definition: parser.h:1902
isc::eval::EvalParser
A Bison parser.
Definition: parser.h:495
isc::eval::EvalParser::make_OPTION_NAME
static symbol_type make_OPTION_NAME(YY_COPY(std::string) v, YY_COPY(location_type) l)
Definition: parser.h:2021
isc::eval::slice::slice
slice(const S &stack, int range)
Definition: parser.h:271
isc::eval::EvalParser::token::TOKEN_ENTERPRISE
@ TOKEN_ENTERPRISE
Definition: parser.h:599
isc::eval::EvalParser::make_TRANSID
static symbol_type make_TRANSID(YY_COPY(location_type) l)
Definition: parser.h:1944
isc::eval::EvalParser::token::TOKEN_VENDOR_CLASS
@ TOKEN_VENDOR_CLASS
Definition: parser.h:595
isc::eval::EvalParser::token::TOKEN_PKT
@ TOKEN_PKT
Definition: parser.h:573
isc::eval::EvalParser::basic_symbol::location
location_type location
The location.
Definition: parser.h:710
isc::eval::EvalParser::make_YIADDR
static symbol_type make_YIADDR(YY_COPY(location_type) l)
Definition: parser.h:1874
isc::eval::EvalParser::make_IFACE
static symbol_type make_IFACE(YY_COPY(location_type) l)
Definition: parser.h:1804
isc::eval::EvalParser::make_DST
static symbol_type make_DST(YY_COPY(location_type) l)
Definition: parser.h:1818
isc::eval::EvalParser::token::TOKEN_SUBSTRING
@ TOKEN_SUBSTRING
Definition: parser.h:586
isc::eval::EvalParser::make_HEXSTRING
static symbol_type make_HEXSTRING(YY_COPY(std::string) v, YY_COPY(location_type) l)
Definition: parser.h:2014
isc::dhcp::TokenPkt4::FieldType
FieldType
enum value that determines the field.
Definition: token.h:439
isc::eval::EvalParser::make_STRING
static symbol_type make_STRING(YY_COPY(std::string) v, YY_COPY(location_type) l)
Definition: parser.h:2000
isc::eval::stack::clear
void clear()
Definition: parser.h:236
isc::eval::EvalParser::token::TOKEN_INTEGER
@ TOKEN_INTEGER
Definition: parser.h:603
isc::eval::EvalParser::token::TOKEN_DATA
@ TOKEN_DATA
Definition: parser.h:598
isc::eval::EvalParser::token::TOKEN_OPTION
@ TOKEN_OPTION
Definition: parser.h:561
isc::eval::EvalParser::make_INTEGER
static symbol_type make_INTEGER(YY_COPY(std::string) v, YY_COPY(location_type) l)
Definition: parser.h:2007
isc::eval::EvalParser::make_SUBSTRING
static symbol_type make_SUBSTRING(YY_COPY(location_type) l)
Definition: parser.h:1888
isc::eval::EvalParser::make_GIADDR
static symbol_type make_GIADDR(YY_COPY(location_type) l)
Definition: parser.h:1867
isc::eval::EvalParser::token::TOKEN_EQUAL
@ TOKEN_EQUAL
Definition: parser.h:560
YY_MOVE
#define YY_MOVE
Definition: parser.h:81
isc::eval::stack::pop
void pop(int n=1)
Definition: parser.h:229
isc::eval::EvalParser::make_TEXT
static symbol_type make_TEXT(YY_COPY(location_type) l)
Definition: parser.h:1776
isc::eval::EvalParser::token::yytokentype
yytokentype
Definition: parser.h:553
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(typename Base::kind_type t, const int8_t &v, const location_type &l)
Definition: parser.h:1417
isc::eval::EvalParser::symbol_type
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Definition: parser.h:754
isc::eval::EvalParser::token_type
token::yytokentype token_type
(External) token type, as returned by yylex.
Definition: parser.h:611
isc::eval::EvalParser::make_HTYPE
static symbol_type make_HTYPE(YY_COPY(location_type) l)
Definition: parser.h:1853
isc::eval::variant::copy
void copy(const self_type &other)
Copy the content of other to this.
Definition: parser.h:443
isc::eval::EvalParser::token::TOKEN_PKT6
@ TOKEN_PKT6
Definition: parser.h:592
isc::eval::stack::iterator
S::reverse_iterator iterator
Definition: parser.h:174
isc::eval::EvalParser::basic_symbol
A complete symbol.
Definition: parser.h:630
isc::eval::variant::swap
void swap(self_type &other)
Swap the content with other, of same type.
Definition: parser.h:406
isc::eval::EvalParser::token::TOKEN_MEMBER
@ TOKEN_MEMBER
Definition: parser.h:564
isc::eval::EvalParser::basic_symbol::~basic_symbol
~basic_symbol()
Destroy the symbol.
Definition: parser.h:1471
isc::eval::EvalParser::make_RELAY6
static symbol_type make_RELAY6(YY_COPY(location_type) l)
Definition: parser.h:1727
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol()
Default constructor.
Definition: parser.h:1258
isc::eval::EvalParser::make_ALL
static symbol_type make_ALL(YY_COPY(location_type) l)
Definition: parser.h:1895
isc::eval::EvalParser::token::TOKEN_IFELSE
@ TOKEN_IFELSE
Definition: parser.h:590
isc::eval::variant::build
T & build()
Instantiate an empty T in here.
Definition: parser.h:360
isc::eval::variant::as
T & as()
Accessor to a built T.
Definition: parser.h:377
isc::eval::variant::~variant
~variant()
Destruction, allowed only if empty.
Definition: parser.h:316
isc::eval::stack::push
void push(YY_MOVE_REF(T) t)
Steal the contents of t.
Definition: parser.h:222
isc::eval::EvalParser::token::TOKEN_TOPLEVEL_BOOL
@ TOKEN_TOPLEVEL_BOOL
Definition: parser.h:600
isc::eval::EvalParser::make_PEERADDR
static symbol_type make_PEERADDR(YY_COPY(location_type) l)
Definition: parser.h:1741
isc::eval::EvalParser::make_HEX
static symbol_type make_HEX(YY_COPY(location_type) l)
Definition: parser.h:1783
isc::eval::EvalContext
Evaluation context, an interface to the expression evaluation.
Definition: eval_context.h:35
isc::eval::EvalParser::make_ENTERPRISE
static symbol_type make_ENTERPRISE(YY_COPY(location_type) l)
Definition: parser.h:1979
isc::eval::EvalParser::token_number_type
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
Definition: parser.h:620
isc::eval::variant::move
void move(self_type &other)
Move the content of other to this.
Definition: parser.h:418
isc::eval::EvalParser::make_SRC
static symbol_type make_SRC(YY_COPY(location_type) l)
Definition: parser.h:1811
isc::eval::EvalParser::basic_symbol::value
semantic_type value
The semantic value.
Definition: parser.h:707
isc::eval::EvalParser::token::TOKEN_OPTION_NAME
@ TOKEN_OPTION_NAME
Definition: parser.h:605
isc::eval::EvalParser::make_OR
static symbol_type make_OR(YY_COPY(location_type) l)
Definition: parser.h:1699
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(typename Base::kind_type t, const std::string &v, const location_type &l)
Definition: parser.h:1432
isc::eval::EvalParser::by_type::token
token_type token() const
The token.
Definition: parser.h:1643
isc::eval::EvalParser::make_HLEN
static symbol_type make_HLEN(YY_COPY(location_type) l)
Definition: parser.h:1846
isc::eval::EvalParser::make_MEMBER
static symbol_type make_MEMBER(YY_COPY(location_type) l)
Definition: parser.h:1734
YY_ATTRIBUTE_PURE
#define YY_ATTRIBUTE_PURE
Definition: parser.h:106
isc::eval::EvalParser::token::TOKEN_TEXT
@ TOKEN_TEXT
Definition: parser.h:570
isc::eval::variant::emplace
T & emplace()
Instantiate an empty T in here.
Definition: parser.h:324
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(YY_RVREF(basic_symbol) other)
Move or copy constructor.
Definition: parser.h:1264
isc::eval::stack
A stack with random access from its top.
Definition: parser.h:171
isc::eval::EvalParser::make_IFELSE
static symbol_type make_IFELSE(YY_COPY(location_type) l)
Definition: parser.h:1916
isc::eval::EvalParser::token::TOKEN_MSGTYPE
@ TOKEN_MSGTYPE
Definition: parser.h:593
isc::eval::EvalParser::make_PKT6
static symbol_type make_PKT6(YY_COPY(location_type) l)
Definition: parser.h:1930
isc::eval::EvalParser::token::TOKEN_TRANSID
@ TOKEN_TRANSID
Definition: parser.h:594
isc::eval::EvalParser::token::TOKEN_IFACE
@ TOKEN_IFACE
Definition: parser.h:574
option.h
isc::eval::EvalParser::make_TOHEXSTRING
static symbol_type make_TOHEXSTRING(YY_COPY(location_type) l)
Definition: parser.h:1923
isc::eval::EvalParser::token::TOKEN_STRING
@ TOKEN_STRING
Definition: parser.h:602
isc::eval::EvalParser::token::TOKEN_EXISTS
@ TOKEN_EXISTS
Definition: parser.h:572
isc::eval::EvalParser::make_EQUAL
static symbol_type make_EQUAL(YY_COPY(location_type) l)
Definition: parser.h:1706
isc::eval::EvalParser::basic_symbol::move
void move(basic_symbol &s)
Destructive move, s is emptied into this.
Definition: parser.h:1550
isc::eval::EvalParser::token::TOKEN_ALL
@ TOKEN_ALL
Definition: parser.h:587
isc::eval::EvalParser::token::TOKEN_ANY
@ TOKEN_ANY
Definition: parser.h:597
isc::eval::EvalParser::token::TOKEN_LBRACKET
@ TOKEN_LBRACKET
Definition: parser.h:567
isc::eval::EvalParser::make_OPTION
static symbol_type make_OPTION(YY_COPY(location_type) l)
Definition: parser.h:1713
isc::eval::EvalParser::by_type::move
void move(by_type &that)
Steal the symbol type from that.
Definition: parser.h:1628
isc::eval::EvalParser::token::TOKEN_CONCAT
@ TOKEN_CONCAT
Definition: parser.h:589
isc::eval::EvalParser::make_EXISTS
static symbol_type make_EXISTS(YY_COPY(location_type) l)
Definition: parser.h:1790
token.h
isc::eval::EvalParser::make_PKT4
static symbol_type make_PKT4(YY_COPY(location_type) l)
Definition: parser.h:1832
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(typename Base::kind_type t, const uint32_t &v, const location_type &l)
Definition: parser.h:1462
isc::eval::EvalParser::token::TOKEN_SIADDR
@ TOKEN_SIADDR
Definition: parser.h:585
isc::eval::EvalParser::basic_symbol::super_type
Base super_type
Alias to Base.
Definition: parser.h:632
isc::dhcp::TokenOption::RepresentationType
RepresentationType
Token representation type.
Definition: token.h:229
isc::eval::EvalParser::syntax_error
Syntax errors thrown from user actions.
Definition: parser.h:544
isc::eval::EvalParser::token::TOKEN_RBRACKET
@ TOKEN_RBRACKET
Definition: parser.h:568
isc::eval::EvalParser::make_LINKADDR
static symbol_type make_LINKADDR(YY_COPY(location_type) l)
Definition: parser.h:1748
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(typename Base::kind_type t, const TokenPkt6::FieldType &v, const location_type &l)
Definition: parser.h:1372
isc::eval::variant::variant
variant()
Empty construction.
Definition: parser.h:301
isc::eval::EvalParser::token::TOKEN_HEX
@ TOKEN_HEX
Definition: parser.h:571
isc::eval::EvalParser::token::TOKEN_HLEN
@ TOKEN_HLEN
Definition: parser.h:580
isc::eval::EvalParser::token::TOKEN_RELAY6
@ TOKEN_RELAY6
Definition: parser.h:563
isc::eval::variant::emplace
T & emplace(const T &t)
Instantiate a T in here from t.
Definition: parser.h:347
isc::eval::stack::end
const_iterator end() const
Definition: parser.h:254
isc::eval::EvalParser::token::TOKEN_RELAY4
@ TOKEN_RELAY4
Definition: parser.h:562
isc::eval::slice
Present a slice of the top of a stack.
Definition: parser.h:269
isc::eval::EvalParser::token::TOKEN_RPAREN
@ TOKEN_RPAREN
Definition: parser.h:556
isc::eval::variant::as
const T & as() const
Const accessor to a built T (for printer).
Definition: parser.h:388
isc::eval::EvalParser::by_type::type
int type
The symbol type.
Definition: parser.h:750
isc::eval::EvalParser::token::TOKEN_END
@ TOKEN_END
Definition: parser.h:554
isc::eval::EvalParser::basic_symbol::basic_symbol
basic_symbol(typename Base::kind_type t, const TokenPkt4::FieldType &v, const location_type &l)
Definition: parser.h:1357