Kea  1.5.0
netconf_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_NETCONF_NETCONF_PARSER_H_INCLUDED
45 # define YY_NETCONF_NETCONF_PARSER_H_INCLUDED
46 // // "%code requires" blocks.
47 #line 17 "netconf_parser.yy" // lalr1.cc:404
48 
49 #include <string>
50 #include <cc/data.h>
51 #include <boost/lexical_cast.hpp>
53 
54 using namespace isc::netconf;
55 using namespace isc::data;
56 using namespace std;
57 
58 #line 59 "netconf_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 NETCONF_DEBUG
153 # if defined YYDEBUG
154 #if YYDEBUG
155 # define NETCONF_DEBUG 1
156 # else
157 # define NETCONF_DEBUG 0
158 # endif
159 # else /* ! defined YYDEBUG */
160 # define NETCONF_DEBUG 1
161 # endif /* ! defined YYDEBUG */
162 #endif /* ! defined NETCONF_DEBUG */
163 
164 #line 14 "netconf_parser.yy" // lalr1.cc:404
165 namespace isc { namespace netconf {
166 #line 167 "netconf_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 NETCONF_STYPE
498  union union_type
500  {
501  // value
502  // map_value
503  // socket_type_value
504  char dummy1[sizeof (ElementPtr)];
505 
506  // "boolean"
507  char dummy2[sizeof (bool)];
508 
509  // "floating point"
510  char dummy3[sizeof (double)];
511 
512  // "integer"
513  char dummy4[sizeof (int64_t)];
514 
515  // "constant string"
516  char dummy5[sizeof (std::string)];
517 };
518 
520  typedef variant<sizeof (union_type)> semantic_type;
521 #else
522  typedef NETCONF_STYPE semantic_type;
523 #endif
524  typedef location location_type;
526 
528  struct syntax_error : std::runtime_error
529  {
530  syntax_error (const location_type& l, const std::string& m);
532  };
533 
535  struct token
536  {
538  {
539  TOKEN_END = 0,
540  TOKEN_COMMA = 258,
541  TOKEN_COLON = 259,
542  TOKEN_LSQUARE_BRACKET = 260,
543  TOKEN_RSQUARE_BRACKET = 261,
544  TOKEN_LCURLY_BRACKET = 262,
545  TOKEN_RCURLY_BRACKET = 263,
546  TOKEN_NULL_TYPE = 264,
547  TOKEN_NETCONF = 265,
548  TOKEN_USER_CONTEXT = 266,
549  TOKEN_COMMENT = 267,
550  TOKEN_BOOT_UPDATE = 268,
551  TOKEN_SUBSCRIBE_CHANGES = 269,
552  TOKEN_VALIDATE_CHANGES = 270,
553  TOKEN_MANAGED_SERVERS = 271,
554  TOKEN_DHCP4_SERVER = 272,
555  TOKEN_DHCP6_SERVER = 273,
556  TOKEN_D2_SERVER = 274,
557  TOKEN_CA_SERVER = 275,
558  TOKEN_MODEL = 276,
559  TOKEN_CONTROL_SOCKET = 277,
560  TOKEN_SOCKET_TYPE = 278,
561  TOKEN_UNIX = 279,
562  TOKEN_HTTP = 280,
563  TOKEN_STDOUT = 281,
564  TOKEN_SOCKET_NAME = 282,
565  TOKEN_SOCKET_URL = 283,
566  TOKEN_HOOKS_LIBRARIES = 284,
567  TOKEN_LIBRARY = 285,
568  TOKEN_PARAMETERS = 286,
569  TOKEN_LOGGING = 287,
570  TOKEN_LOGGERS = 288,
571  TOKEN_NAME = 289,
572  TOKEN_OUTPUT_OPTIONS = 290,
573  TOKEN_OUTPUT = 291,
574  TOKEN_DEBUGLEVEL = 292,
575  TOKEN_SEVERITY = 293,
576  TOKEN_FLUSH = 294,
577  TOKEN_MAXSIZE = 295,
578  TOKEN_MAXVER = 296,
579  TOKEN_START_JSON = 297,
580  TOKEN_START_NETCONF = 298,
581  TOKEN_START_SUB_NETCONF = 299,
582  TOKEN_STRING = 300,
583  TOKEN_INTEGER = 301,
584  TOKEN_FLOAT = 302,
585  TOKEN_BOOLEAN = 303
586  };
587  };
588 
591 
593  typedef int symbol_number_type;
594 
596  enum { empty_symbol = -2 };
597 
599  typedef unsigned char token_number_type;
600 
607  template <typename Base>
608  struct basic_symbol : Base
609  {
611  typedef Base super_type;
612 
614  basic_symbol ();
615 
618 
619 
621 # if 201103L <= YY_CPLUSPLUS
622  basic_symbol (typename Base::kind_type t, location_type&& l);
623 #else
624  basic_symbol (typename Base::kind_type t, const location_type& l);
625 #endif
626 # if 201103L <= YY_CPLUSPLUS
627  basic_symbol (typename Base::kind_type t, ElementPtr&& v, location_type&& l);
628 #else
629  basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l);
630 #endif
631 # if 201103L <= YY_CPLUSPLUS
632  basic_symbol (typename Base::kind_type t, bool&& v, location_type&& l);
633 #else
634  basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l);
635 #endif
636 # if 201103L <= YY_CPLUSPLUS
637  basic_symbol (typename Base::kind_type t, double&& v, location_type&& l);
638 #else
639  basic_symbol (typename Base::kind_type t, const double& v, const location_type& l);
640 #endif
641 # if 201103L <= YY_CPLUSPLUS
642  basic_symbol (typename Base::kind_type t, int64_t&& v, location_type&& l);
643 #else
644  basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l);
645 #endif
646 # if 201103L <= YY_CPLUSPLUS
647  basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l);
648 #else
649  basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l);
650 #endif
651 
652 
654  ~basic_symbol ();
655 
657  void clear ();
658 
660  bool empty () const;
661 
663  void move (basic_symbol& s);
664 
667 
670 
671  private:
672 #if YY_CPLUSPLUS < 201103L
673  basic_symbol& operator= (const basic_symbol& other);
675 #endif
676  };
677 
679  struct by_type
680  {
682  by_type ();
683 
685  by_type (const by_type& other);
686 
689 
691  by_type (kind_type t);
692 
694  void clear ();
695 
697  void move (by_type& that);
698 
701  symbol_number_type type_get () const;
702 
704  token_type token () const;
705 
709  int type;
710  };
711 
714 
717  virtual ~NetconfParser ();
718 
721  int operator() ();
722 
725  virtual int parse ();
726 
727 #if NETCONF_DEBUG
728  std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
731  void set_debug_stream (std::ostream &);
732 
734  typedef int debug_level_type;
736  debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
738  void set_debug_level (debug_level_type l);
739 #endif
740 
744  virtual void error (const location_type& loc, const std::string& msg);
745 
747  void error (const syntax_error& err);
748 
749  // Symbol constructors declarations.
750  static
752  make_END (YY_COPY (location_type) l);
753 
754  static
756  make_COMMA (YY_COPY (location_type) l);
757 
758  static
760  make_COLON (YY_COPY (location_type) l);
761 
762  static
764  make_LSQUARE_BRACKET (YY_COPY (location_type) l);
765 
766  static
768  make_RSQUARE_BRACKET (YY_COPY (location_type) l);
769 
770  static
772  make_LCURLY_BRACKET (YY_COPY (location_type) l);
773 
774  static
776  make_RCURLY_BRACKET (YY_COPY (location_type) l);
777 
778  static
780  make_NULL_TYPE (YY_COPY (location_type) l);
781 
782  static
784  make_NETCONF (YY_COPY (location_type) l);
785 
786  static
788  make_USER_CONTEXT (YY_COPY (location_type) l);
789 
790  static
792  make_COMMENT (YY_COPY (location_type) l);
793 
794  static
796  make_BOOT_UPDATE (YY_COPY (location_type) l);
797 
798  static
800  make_SUBSCRIBE_CHANGES (YY_COPY (location_type) l);
801 
802  static
804  make_VALIDATE_CHANGES (YY_COPY (location_type) l);
805 
806  static
808  make_MANAGED_SERVERS (YY_COPY (location_type) l);
809 
810  static
812  make_DHCP4_SERVER (YY_COPY (location_type) l);
813 
814  static
816  make_DHCP6_SERVER (YY_COPY (location_type) l);
817 
818  static
820  make_D2_SERVER (YY_COPY (location_type) l);
821 
822  static
824  make_CA_SERVER (YY_COPY (location_type) l);
825 
826  static
828  make_MODEL (YY_COPY (location_type) l);
829 
830  static
832  make_CONTROL_SOCKET (YY_COPY (location_type) l);
833 
834  static
836  make_SOCKET_TYPE (YY_COPY (location_type) l);
837 
838  static
840  make_UNIX (YY_COPY (location_type) l);
841 
842  static
844  make_HTTP (YY_COPY (location_type) l);
845 
846  static
848  make_STDOUT (YY_COPY (location_type) l);
849 
850  static
852  make_SOCKET_NAME (YY_COPY (location_type) l);
853 
854  static
856  make_SOCKET_URL (YY_COPY (location_type) l);
857 
858  static
860  make_HOOKS_LIBRARIES (YY_COPY (location_type) l);
861 
862  static
864  make_LIBRARY (YY_COPY (location_type) l);
865 
866  static
868  make_PARAMETERS (YY_COPY (location_type) l);
869 
870  static
872  make_LOGGING (YY_COPY (location_type) l);
873 
874  static
876  make_LOGGERS (YY_COPY (location_type) l);
877 
878  static
880  make_NAME (YY_COPY (location_type) l);
881 
882  static
884  make_OUTPUT_OPTIONS (YY_COPY (location_type) l);
885 
886  static
888  make_OUTPUT (YY_COPY (location_type) l);
889 
890  static
892  make_DEBUGLEVEL (YY_COPY (location_type) l);
893 
894  static
896  make_SEVERITY (YY_COPY (location_type) l);
897 
898  static
900  make_FLUSH (YY_COPY (location_type) l);
901 
902  static
904  make_MAXSIZE (YY_COPY (location_type) l);
905 
906  static
908  make_MAXVER (YY_COPY (location_type) l);
909 
910  static
912  make_START_JSON (YY_COPY (location_type) l);
913 
914  static
916  make_START_NETCONF (YY_COPY (location_type) l);
917 
918  static
920  make_START_SUB_NETCONF (YY_COPY (location_type) l);
921 
922  static
924  make_STRING (YY_COPY (std::string) v, YY_COPY (location_type) l);
925 
926  static
928  make_INTEGER (YY_COPY (int64_t) v, YY_COPY (location_type) l);
929 
930  static
932  make_FLOAT (YY_COPY (double) v, YY_COPY (location_type) l);
933 
934  static
936  make_BOOLEAN (YY_COPY (bool) v, YY_COPY (location_type) l);
937 
938 
939 
940  private:
942  NetconfParser (const NetconfParser&);
943  NetconfParser& operator= (const NetconfParser&);
944 
946  typedef int state_type;
947 
951  virtual std::string yysyntax_error_ (state_type yystate,
952  const symbol_type& yyla) const;
953 
957  state_type yy_lr_goto_state_ (state_type yystate, int yysym);
958 
961  static bool yy_pact_value_is_default_ (int yyvalue);
962 
965  static bool yy_table_value_is_error_ (int yyvalue);
966 
967  static const signed char yypact_ninf_;
968  static const signed char yytable_ninf_;
969 
971  static token_number_type yytranslate_ (token_type t);
972 
973  // Tables.
974  // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
975  // STATE-NUM.
976  static const short yypact_[];
977 
978  // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
979  // Performed when YYTABLE does not specify something else to do. Zero
980  // means the default is an error.
981  static const unsigned char yydefact_[];
982 
983  // YYPGOTO[NTERM-NUM].
984  static const short yypgoto_[];
985 
986  // YYDEFGOTO[NTERM-NUM].
987  static const short yydefgoto_[];
988 
989  // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
990  // positive, shift that token. If negative, reduce the rule whose
991  // number is the opposite. If YYTABLE_NINF, syntax error.
992  static const unsigned short yytable_[];
993 
994  static const short yycheck_[];
995 
996  // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
997  // symbol of state STATE-NUM.
998  static const unsigned char yystos_[];
999 
1000  // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
1001  static const unsigned char yyr1_[];
1002 
1003  // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
1004  static const unsigned char yyr2_[];
1005 
1006 
1008  static std::string yytnamerr_ (const char *n);
1009 
1010 
1012  static const char* const yytname_[];
1013 #if NETCONF_DEBUG
1014  // YYRLINE[YYN] -- Source line where rule number YYN was defined.
1015  static const unsigned short yyrline_[];
1017  virtual void yy_reduce_print_ (int r);
1019  virtual void yystack_print_ ();
1020 
1022  int yydebug_;
1024  std::ostream* yycdebug_;
1025 
1029  template <typename Base>
1030  void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
1031 #endif
1032 
1037  template <typename Base>
1038  void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
1039 
1040  private:
1042  struct by_state
1043  {
1045  by_state ();
1046 
1048  typedef state_type kind_type;
1049 
1051  by_state (kind_type s);
1052 
1054  by_state (const by_state& other);
1055 
1057  void clear ();
1058 
1060  void move (by_state& that);
1061 
1064  symbol_number_type type_get () const;
1065 
1067  enum { empty_state = -1 };
1068 
1071  state_type state;
1072  };
1073 
1075  struct stack_symbol_type : basic_symbol<by_state>
1076  {
1078  typedef basic_symbol<by_state> super_type;
1080  stack_symbol_type ();
1082  stack_symbol_type (YY_RVREF (stack_symbol_type) that);
1084  stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
1085 #if YY_CPLUSPLUS < 201103L
1086  stack_symbol_type& operator= (stack_symbol_type& that);
1089 #endif
1090  };
1091 
1093  typedef stack<stack_symbol_type> stack_type;
1094 
1096  stack_type yystack_;
1097 
1103  void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
1104 
1111  void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
1112 
1114  void yypop_ (int n = 1);
1115 
1117  enum
1118  {
1119  yyeof_ = 0,
1120  yylast_ = 238,
1121  yynnts_ = 103,
1122  yyfinal_ = 8,
1123  yyterror_ = 1,
1124  yyerrcode_ = 256,
1125  yyntokens_ = 49
1126  };
1127 
1128 
1129  // User arguments.
1131  };
1132 
1133  // Symbol number corresponding to token number t.
1134  inline
1136  NetconfParser::yytranslate_ (token_type t)
1137  {
1138  static
1139  const token_number_type
1140  translate_table[] =
1141  {
1142  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1143  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1144  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1145  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1146  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1147  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1148  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1149  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1150  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1151  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1152  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1153  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1154  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1155  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1156  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1157  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1158  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1159  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1160  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1161  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1162  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1163  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1164  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1165  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1166  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1167  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1168  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1169  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1170  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1171  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1172  45, 46, 47, 48
1173  };
1174  const unsigned user_token_number_max_ = 303;
1175  const token_number_type undef_token_ = 2;
1176 
1177  if (static_cast<int> (t) <= yyeof_)
1178  return yyeof_;
1179  else if (static_cast<unsigned> (t) <= user_token_number_max_)
1180  return translate_table[t];
1181  else
1182  return undef_token_;
1183  }
1184 
1185  inline
1187  : std::runtime_error (m)
1188  , location (l)
1189  {}
1190 
1191  // basic_symbol.
1192  template <typename Base>
1194  : value ()
1195  , location ()
1196  {}
1197 
1198  template <typename Base>
1200  : Base (YY_MOVE (other))
1201  , value ()
1202  , location (YY_MOVE (other.location))
1203  {
1204  switch (other.type_get ())
1205  {
1206  case 57: // value
1207  case 60: // map_value
1208  case 119: // socket_type_value
1209  value.YY_MOVE_OR_COPY< ElementPtr > (YY_MOVE (other.value));
1210  break;
1211 
1212  case 48: // "boolean"
1213  value.YY_MOVE_OR_COPY< bool > (YY_MOVE (other.value));
1214  break;
1215 
1216  case 47: // "floating point"
1217  value.YY_MOVE_OR_COPY< double > (YY_MOVE (other.value));
1218  break;
1219 
1220  case 46: // "integer"
1221  value.YY_MOVE_OR_COPY< int64_t > (YY_MOVE (other.value));
1222  break;
1223 
1224  case 45: // "constant string"
1225  value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (other.value));
1226  break;
1227 
1228  default:
1229  break;
1230  }
1231 
1232  }
1233 
1234 
1235  // Implementation of basic_symbol constructor for each type.
1236 # if 201103L <= YY_CPLUSPLUS
1237  template <typename Base>
1238  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, location_type&& l)
1239  : Base (t)
1240  , location (std::move (l))
1241  {}
1242 #else
1243  template <typename Base>
1245  : Base (t)
1246  , location (l)
1247  {}
1248 #endif
1249 # if 201103L <= YY_CPLUSPLUS
1250  template <typename Base>
1251  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, ElementPtr&& v, location_type&& l)
1252  : Base (t)
1253  , value (std::move (v))
1254  , location (std::move (l))
1255  {}
1256 #else
1257  template <typename Base>
1258  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l)
1259  : Base (t)
1260  , value (v)
1261  , location (l)
1262  {}
1263 #endif
1264 # if 201103L <= YY_CPLUSPLUS
1265  template <typename Base>
1266  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, bool&& v, location_type&& l)
1267  : Base (t)
1268  , value (std::move (v))
1269  , location (std::move (l))
1270  {}
1271 #else
1272  template <typename Base>
1273  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l)
1274  : Base (t)
1275  , value (v)
1276  , location (l)
1277  {}
1278 #endif
1279 # if 201103L <= YY_CPLUSPLUS
1280  template <typename Base>
1281  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, double&& v, location_type&& l)
1282  : Base (t)
1283  , value (std::move (v))
1284  , location (std::move (l))
1285  {}
1286 #else
1287  template <typename Base>
1288  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const double& v, const location_type& l)
1289  : Base (t)
1290  , value (v)
1291  , location (l)
1292  {}
1293 #endif
1294 # if 201103L <= YY_CPLUSPLUS
1295  template <typename Base>
1296  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, int64_t&& v, location_type&& l)
1297  : Base (t)
1298  , value (std::move (v))
1299  , location (std::move (l))
1300  {}
1301 #else
1302  template <typename Base>
1303  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l)
1304  : Base (t)
1305  , value (v)
1306  , location (l)
1307  {}
1308 #endif
1309 # if 201103L <= YY_CPLUSPLUS
1310  template <typename Base>
1311  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l)
1312  : Base (t)
1313  , value (std::move (v))
1314  , location (std::move (l))
1315  {}
1316 #else
1317  template <typename Base>
1318  NetconfParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
1319  : Base (t)
1320  , value (v)
1321  , location (l)
1322  {}
1323 #endif
1324 
1325 
1326  template <typename Base>
1328  {
1329  clear ();
1330  }
1331 
1332  template <typename Base>
1333  void
1335  {
1336  // User destructor.
1337  symbol_number_type yytype = this->type_get ();
1338  basic_symbol<Base>& yysym = *this;
1339  (void) yysym;
1340  switch (yytype)
1341  {
1342  default:
1343  break;
1344  }
1345 
1346  // Type destructor.
1347  switch (yytype)
1348  {
1349  case 57: // value
1350  case 60: // map_value
1351  case 119: // socket_type_value
1352  value.template destroy< ElementPtr > ();
1353  break;
1354 
1355  case 48: // "boolean"
1356  value.template destroy< bool > ();
1357  break;
1358 
1359  case 47: // "floating point"
1360  value.template destroy< double > ();
1361  break;
1362 
1363  case 46: // "integer"
1364  value.template destroy< int64_t > ();
1365  break;
1366 
1367  case 45: // "constant string"
1368  value.template destroy< std::string > ();
1369  break;
1370 
1371  default:
1372  break;
1373  }
1374 
1375  Base::clear ();
1376  }
1377 
1378  template <typename Base>
1379  bool
1381  {
1382  return Base::type_get () == empty_symbol;
1383  }
1384 
1385  template <typename Base>
1386  void
1388  {
1389  super_type::move (s);
1390  switch (this->type_get ())
1391  {
1392  case 57: // value
1393  case 60: // map_value
1394  case 119: // socket_type_value
1395  value.move< ElementPtr > (YY_MOVE (s.value));
1396  break;
1397 
1398  case 48: // "boolean"
1399  value.move< bool > (YY_MOVE (s.value));
1400  break;
1401 
1402  case 47: // "floating point"
1403  value.move< double > (YY_MOVE (s.value));
1404  break;
1405 
1406  case 46: // "integer"
1407  value.move< int64_t > (YY_MOVE (s.value));
1408  break;
1409 
1410  case 45: // "constant string"
1411  value.move< std::string > (YY_MOVE (s.value));
1412  break;
1413 
1414  default:
1415  break;
1416  }
1417 
1418  location = YY_MOVE (s.location);
1419  }
1420 
1421  // by_type.
1422  inline
1423  NetconfParser::by_type::by_type ()
1424  : type (empty_symbol)
1425  {}
1426 
1427  inline
1429  : type (other.type)
1430  {}
1431 
1432  inline
1434  : type (yytranslate_ (t))
1435  {}
1436 
1437  inline
1438  void
1440  {
1441  type = empty_symbol;
1442  }
1443 
1444  inline
1445  void
1447  {
1448  type = that.type;
1449  that.clear ();
1450  }
1451 
1452  inline
1453  int
1455  {
1456  return type;
1457  }
1458 
1459  inline
1462  {
1463  // YYTOKNUM[NUM] -- (External) token number corresponding to the
1464  // (internal) symbol number NUM (which must be that of a token). */
1465  static
1466  const unsigned short
1467  yytoken_number_[] =
1468  {
1469  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1470  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1471  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1472  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1473  295, 296, 297, 298, 299, 300, 301, 302, 303
1474  };
1475  return static_cast<token_type> (yytoken_number_[type]);
1476  }
1477 
1478  // Implementation of make_symbol for each symbol type.
1479  inline
1482  {
1483  return symbol_type (token::TOKEN_END, YY_MOVE (l));
1484  }
1485 
1486  inline
1489  {
1490  return symbol_type (token::TOKEN_COMMA, YY_MOVE (l));
1491  }
1492 
1493  inline
1496  {
1497  return symbol_type (token::TOKEN_COLON, YY_MOVE (l));
1498  }
1499 
1500  inline
1503  {
1505  }
1506 
1507  inline
1510  {
1512  }
1513 
1514  inline
1517  {
1519  }
1520 
1521  inline
1524  {
1526  }
1527 
1528  inline
1531  {
1533  }
1534 
1535  inline
1538  {
1540  }
1541 
1542  inline
1545  {
1547  }
1548 
1549  inline
1552  {
1554  }
1555 
1556  inline
1559  {
1561  }
1562 
1563  inline
1566  {
1568  }
1569 
1570  inline
1573  {
1575  }
1576 
1577  inline
1580  {
1582  }
1583 
1584  inline
1587  {
1589  }
1590 
1591  inline
1594  {
1596  }
1597 
1598  inline
1601  {
1603  }
1604 
1605  inline
1608  {
1610  }
1611 
1612  inline
1615  {
1616  return symbol_type (token::TOKEN_MODEL, YY_MOVE (l));
1617  }
1618 
1619  inline
1622  {
1624  }
1625 
1626  inline
1629  {
1631  }
1632 
1633  inline
1636  {
1637  return symbol_type (token::TOKEN_UNIX, YY_MOVE (l));
1638  }
1639 
1640  inline
1643  {
1644  return symbol_type (token::TOKEN_HTTP, YY_MOVE (l));
1645  }
1646 
1647  inline
1650  {
1651  return symbol_type (token::TOKEN_STDOUT, YY_MOVE (l));
1652  }
1653 
1654  inline
1657  {
1659  }
1660 
1661  inline
1664  {
1666  }
1667 
1668  inline
1671  {
1673  }
1674 
1675  inline
1678  {
1680  }
1681 
1682  inline
1685  {
1687  }
1688 
1689  inline
1692  {
1694  }
1695 
1696  inline
1699  {
1701  }
1702 
1703  inline
1706  {
1707  return symbol_type (token::TOKEN_NAME, YY_MOVE (l));
1708  }
1709 
1710  inline
1713  {
1715  }
1716 
1717  inline
1720  {
1721  return symbol_type (token::TOKEN_OUTPUT, YY_MOVE (l));
1722  }
1723 
1724  inline
1727  {
1729  }
1730 
1731  inline
1734  {
1736  }
1737 
1738  inline
1741  {
1742  return symbol_type (token::TOKEN_FLUSH, YY_MOVE (l));
1743  }
1744 
1745  inline
1748  {
1750  }
1751 
1752  inline
1755  {
1756  return symbol_type (token::TOKEN_MAXVER, YY_MOVE (l));
1757  }
1758 
1759  inline
1762  {
1764  }
1765 
1766  inline
1769  {
1771  }
1772 
1773  inline
1776  {
1778  }
1779 
1780  inline
1783  {
1784  return symbol_type (token::TOKEN_STRING, YY_MOVE (v), YY_MOVE (l));
1785  }
1786 
1787  inline
1790  {
1791  return symbol_type (token::TOKEN_INTEGER, YY_MOVE (v), YY_MOVE (l));
1792  }
1793 
1794  inline
1797  {
1798  return symbol_type (token::TOKEN_FLOAT, YY_MOVE (v), YY_MOVE (l));
1799  }
1800 
1801  inline
1804  {
1805  return symbol_type (token::TOKEN_BOOLEAN, YY_MOVE (v), YY_MOVE (l));
1806  }
1807 
1808 
1809 #line 14 "netconf_parser.yy" // lalr1.cc:404
1810 } } // isc::netconf
1811 #line 1812 "netconf_parser.h" // lalr1.cc:404
1812 
1813 
1814 
1815 
1816 #endif // !YY_NETCONF_NETCONF_PARSER_H_INCLUDED
void clear()
Record that this symbol is empty.
variant< S > self_type
Type of *this.
void copy(const self_type &other)
Copy the content of other to this.
static symbol_type make_UNIX(YY_COPY(location_type) l)
void move(by_type &that)
Steal the symbol type from that.
static symbol_type make_BOOT_UPDATE(YY_COPY(location_type) l)
Present a slice of the top of a stack.
static symbol_type make_LOGGING(YY_COPY(location_type) l)
#define YY_RVREF(Type)
const_iterator begin() const
static symbol_type make_FLOAT(YY_COPY(double) v, YY_COPY(location_type) l)
location location_type
Symbol locations.
T & emplace()
Instantiate an empty T in here.
static symbol_type make_BOOLEAN(YY_COPY(bool) v, YY_COPY(location_type) l)
static symbol_type make_INTEGER(YY_COPY(int64_t) v, YY_COPY(location_type) l)
semantic_type value
The semantic value.
static symbol_type make_DHCP6_SERVER(YY_COPY(location_type) l)
#define YY_COPY(Type)
static symbol_type make_LOGGERS(YY_COPY(location_type) l)
static symbol_type make_DHCP4_SERVER(YY_COPY(location_type) l)
static symbol_type make_COMMENT(YY_COPY(location_type) l)
#define YYASSERT
T & build()
Instantiate an empty T in here.
#define YY_ATTRIBUTE_PURE
static symbol_type make_COMMA(YY_COPY(location_type) l)
#define YY_MOVE
static symbol_type make_MAXVER(YY_COPY(location_type) l)
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
S::size_type size_type
static symbol_type make_NETCONF(YY_COPY(location_type) l)
token_type token() const
The token.
S::const_reverse_iterator const_iterator
Forward declaration of the ParserContext class.
static symbol_type make_END(YY_COPY(location_type) l)
static symbol_type make_RSQUARE_BRACKET(YY_COPY(location_type) l)
static symbol_type make_SOCKET_NAME(YY_COPY(location_type) l)
static symbol_type make_MAXSIZE(YY_COPY(location_type) l)
static symbol_type make_DEBUGLEVEL(YY_COPY(location_type) l)
static symbol_type make_FLUSH(YY_COPY(location_type) l)
static symbol_type make_HOOKS_LIBRARIES(YY_COPY(location_type) l)
void push(YY_MOVE_REF(T) t)
Steal the contents of t.
size_type size() const
T & as()
Accessor to a built T.
~variant()
Destruction, allowed only if empty.
stack(size_type n=200)
static symbol_type make_VALIDATE_CHANGES(YY_COPY(location_type) l)
static symbol_type make_NULL_TYPE(YY_COPY(location_type) l)
static symbol_type make_CONTROL_SOCKET(YY_COPY(location_type) l)
static symbol_type make_START_JSON(YY_COPY(location_type) l)
static symbol_type make_OUTPUT(YY_COPY(location_type) l)
static symbol_type make_STDOUT(YY_COPY(location_type) l)
static symbol_type make_RCURLY_BRACKET(YY_COPY(location_type) l)
token::yytokentype token_type
(External) token type, as returned by yylex.
int symbol_number_type
Symbol type: an internal symbol number.
Type access provider for token (enum) based symbols.
T & emplace(const T &t)
Instantiate a T in here from t.
token_type kind_type
The symbol type as needed by the constructor.
#define YY_MOVE_REF(Type)
static symbol_type make_NAME(YY_COPY(location_type) l)
const T & as() const
Const accessor to a built T (for printer).
Defines the logger used by the top-level component of kea-dhcp-ddns.
A char[S] buffer to store and retrieve objects.
static symbol_type make_SOCKET_TYPE(YY_COPY(location_type) l)
void move(self_type &other)
Move the content of other to this.
An auxiliary type to compute the largest semantic type.
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
static symbol_type make_D2_SERVER(YY_COPY(location_type) l)
static symbol_type make_START_NETCONF(YY_COPY(location_type) l)
static symbol_type make_SEVERITY(YY_COPY(location_type) l)
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Parser context is a wrapper around flex/bison instances dedicated to Netconf-agent config file parser...
static symbol_type make_HTTP(YY_COPY(location_type) l)
A stack with random access from its top.
static symbol_type make_SUBSCRIBE_CHANGES(YY_COPY(location_type) l)
int debug_level_type
Type for debugging levels.
static symbol_type make_LIBRARY(YY_COPY(location_type) l)
static symbol_type make_OUTPUT_OPTIONS(YY_COPY(location_type) l)
void swap(self_type &other)
Swap the content with other, of same type.
void destroy()
Destroy the stored T.
slice(const S &stack, int range)
Syntax errors thrown from user actions.
static symbol_type make_SOCKET_URL(YY_COPY(location_type) l)
static symbol_type make_LSQUARE_BRACKET(YY_COPY(location_type) l)
static symbol_type make_COLON(YY_COPY(location_type) l)
static symbol_type make_MANAGED_SERVERS(YY_COPY(location_type) l)
S::reverse_iterator iterator
variant(YY_RVREF(T) t)
Construct and fill.
static symbol_type make_START_SUB_NETCONF(YY_COPY(location_type) l)
long double yyalign_me
Strongest alignment constraints.
const_iterator end() const
static symbol_type make_MODEL(YY_COPY(location_type) l)
T & build(const T &t)
Instantiate a T in here from t.
symbol_number_type type_get() const
The (internal) type number (corresponding to type).
static symbol_type make_CA_SERVER(YY_COPY(location_type) l)
static symbol_type make_PARAMETERS(YY_COPY(location_type) l)
variant()
Empty construction.
static symbol_type make_USER_CONTEXT(YY_COPY(location_type) l)
static symbol_type make_LCURLY_BRACKET(YY_COPY(location_type) l)
static symbol_type make_STRING(YY_COPY(std::string) v, YY_COPY(location_type) l)
syntax_error(const location_type &l, const std::string &m)