Kea  2.3.1-git
agent_parser.cc
Go to the documentation of this file.
1 // A Bison parser, made by GNU Bison 3.8.2.
2 
3 // Skeleton implementation for Bison LALR(1) parsers in C++
4 
5 // Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
6 
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <https://www.gnu.org/licenses/>.
19 
20 // As a special exception, you may create a larger work that contains
21 // part or all of the Bison parser skeleton and distribute that work
22 // under terms of your choice, so long as that work isn't itself a
23 // parser generator using the skeleton or a modified version thereof
24 // as a parser skeleton. Alternatively, if you modify or redistribute
25 // the parser skeleton itself, you may (at your option) remove this
26 // special exception, which will cause the skeleton and the resulting
27 // Bison output files to be licensed under the GNU General Public
28 // License without this special exception.
29 
30 // This special exception was added by the Free Software Foundation in
31 // version 2.2 of Bison.
32 
33 // DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
34 // especially those whose name start with YY_ or yy_. They are
35 // private implementation details that can be changed or removed.
36 
37 
38 // Take the name prefix into account.
39 #define yylex agent_lex
40 
41 
42 
43 #include "agent_parser.h"
44 
45 
46 // Unqualified %code blocks.
47 #line 33 "agent_parser.yy"
48 
49 #include <agent/parser_context.h>
50 
51 #line 52 "agent_parser.cc"
52 
53 
54 #ifndef YY_
55 # if defined YYENABLE_NLS && YYENABLE_NLS
56 # if ENABLE_NLS
57 # include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
58 # define YY_(msgid) dgettext ("bison-runtime", msgid)
59 # endif
60 # endif
61 # ifndef YY_
62 # define YY_(msgid) msgid
63 # endif
64 #endif
65 
66 
67 // Whether we are compiled with exception support.
68 #ifndef YY_EXCEPTIONS
69 # if defined __GNUC__ && !defined __EXCEPTIONS
70 # define YY_EXCEPTIONS 0
71 # else
72 # define YY_EXCEPTIONS 1
73 # endif
74 #endif
75 
76 #define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
77 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
78  If N is 0, then set CURRENT to the empty location which ends
79  the previous symbol: RHS[0] (always defined). */
80 
81 # ifndef YYLLOC_DEFAULT
82 # define YYLLOC_DEFAULT(Current, Rhs, N) \
83  do \
84  if (N) \
85  { \
86  (Current).begin = YYRHSLOC (Rhs, 1).begin; \
87  (Current).end = YYRHSLOC (Rhs, N).end; \
88  } \
89  else \
90  { \
91  (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
92  } \
93  while (false)
94 # endif
95 
96 
97 // Enable debugging if requested.
98 #if AGENT_DEBUG
99 
100 // A pseudo ostream that takes yydebug_ into account.
101 # define YYCDEBUG if (yydebug_) (*yycdebug_)
102 
103 # define YY_SYMBOL_PRINT(Title, Symbol) \
104  do { \
105  if (yydebug_) \
106  { \
107  *yycdebug_ << Title << ' '; \
108  yy_print_ (*yycdebug_, Symbol); \
109  *yycdebug_ << '\n'; \
110  } \
111  } while (false)
112 
113 # define YY_REDUCE_PRINT(Rule) \
114  do { \
115  if (yydebug_) \
116  yy_reduce_print_ (Rule); \
117  } while (false)
118 
119 # define YY_STACK_PRINT() \
120  do { \
121  if (yydebug_) \
122  yy_stack_print_ (); \
123  } while (false)
124 
125 #else // !AGENT_DEBUG
126 
127 # define YYCDEBUG if (false) std::cerr
128 # define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol)
129 # define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
130 # define YY_STACK_PRINT() static_cast<void> (0)
131 
132 #endif // !AGENT_DEBUG
133 
134 #define yyerrok (yyerrstatus_ = 0)
135 #define yyclearin (yyla.clear ())
136 
137 #define YYACCEPT goto yyacceptlab
138 #define YYABORT goto yyabortlab
139 #define YYERROR goto yyerrorlab
140 #define YYRECOVERING() (!!yyerrstatus_)
141 
142 #line 14 "agent_parser.yy"
143 namespace isc { namespace agent {
144 #line 145 "agent_parser.cc"
145 
148 #if AGENT_DEBUG
149  : yydebug_ (false),
150  yycdebug_ (&std::cerr),
151 #else
152  :
153 #endif
154  ctx (ctx_yyarg)
155  {}
156 
158  {}
159 
161  {}
162 
163  /*---------.
164  | symbol. |
165  `---------*/
166 
167 
168 
169  // by_state.
170  AgentParser::by_state::by_state () YY_NOEXCEPT
171  : state (empty_state)
172  {}
173 
174  AgentParser::by_state::by_state (const by_state& that) YY_NOEXCEPT
175  : state (that.state)
176  {}
177 
178  void
179  AgentParser::by_state::clear () YY_NOEXCEPT
180  {
181  state = empty_state;
182  }
183 
184  void
185  AgentParser::by_state::move (by_state& that)
186  {
187  state = that.state;
188  that.clear ();
189  }
190 
191  AgentParser::by_state::by_state (state_type s) YY_NOEXCEPT
192  : state (s)
193  {}
194 
196  AgentParser::by_state::kind () const YY_NOEXCEPT
197  {
198  if (state == empty_state)
199  return symbol_kind::S_YYEMPTY;
200  else
201  return YY_CAST (symbol_kind_type, yystos_[+state]);
202  }
203 
204  AgentParser::stack_symbol_type::stack_symbol_type ()
205  {}
206 
207  AgentParser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
208  : super_type (YY_MOVE (that.state), YY_MOVE (that.location))
209  {
210  switch (that.kind ())
211  {
212  case symbol_kind::S_value: // value
213  case symbol_kind::S_map_value: // map_value
214  case symbol_kind::S_socket_type_value: // socket_type_value
215  case symbol_kind::S_auth_type_value: // auth_type_value
216  value.YY_MOVE_OR_COPY< ElementPtr > (YY_MOVE (that.value));
217  break;
218 
219  case symbol_kind::S_BOOLEAN: // "boolean"
220  value.YY_MOVE_OR_COPY< bool > (YY_MOVE (that.value));
221  break;
222 
223  case symbol_kind::S_FLOAT: // "floating point"
224  value.YY_MOVE_OR_COPY< double > (YY_MOVE (that.value));
225  break;
226 
227  case symbol_kind::S_INTEGER: // "integer"
228  value.YY_MOVE_OR_COPY< int64_t > (YY_MOVE (that.value));
229  break;
230 
231  case symbol_kind::S_STRING: // "constant string"
232  value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value));
233  break;
234 
235  default:
236  break;
237  }
238 
239 #if 201103L <= YY_CPLUSPLUS
240  // that is emptied.
241  that.state = empty_state;
242 #endif
243  }
244 
245  AgentParser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
246  : super_type (s, YY_MOVE (that.location))
247  {
248  switch (that.kind ())
249  {
250  case symbol_kind::S_value: // value
251  case symbol_kind::S_map_value: // map_value
252  case symbol_kind::S_socket_type_value: // socket_type_value
253  case symbol_kind::S_auth_type_value: // auth_type_value
254  value.move< ElementPtr > (YY_MOVE (that.value));
255  break;
256 
257  case symbol_kind::S_BOOLEAN: // "boolean"
258  value.move< bool > (YY_MOVE (that.value));
259  break;
260 
261  case symbol_kind::S_FLOAT: // "floating point"
262  value.move< double > (YY_MOVE (that.value));
263  break;
264 
265  case symbol_kind::S_INTEGER: // "integer"
266  value.move< int64_t > (YY_MOVE (that.value));
267  break;
268 
269  case symbol_kind::S_STRING: // "constant string"
270  value.move< std::string > (YY_MOVE (that.value));
271  break;
272 
273  default:
274  break;
275  }
276 
277  // that is emptied.
279  }
280 
281 #if YY_CPLUSPLUS < 201103L
282  AgentParser::stack_symbol_type&
283  AgentParser::stack_symbol_type::operator= (const stack_symbol_type& that)
284  {
285  state = that.state;
286  switch (that.kind ())
287  {
288  case symbol_kind::S_value: // value
289  case symbol_kind::S_map_value: // map_value
290  case symbol_kind::S_socket_type_value: // socket_type_value
291  case symbol_kind::S_auth_type_value: // auth_type_value
292  value.copy< ElementPtr > (that.value);
293  break;
294 
295  case symbol_kind::S_BOOLEAN: // "boolean"
296  value.copy< bool > (that.value);
297  break;
298 
299  case symbol_kind::S_FLOAT: // "floating point"
300  value.copy< double > (that.value);
301  break;
302 
303  case symbol_kind::S_INTEGER: // "integer"
304  value.copy< int64_t > (that.value);
305  break;
306 
307  case symbol_kind::S_STRING: // "constant string"
308  value.copy< std::string > (that.value);
309  break;
310 
311  default:
312  break;
313  }
314 
315  location = that.location;
316  return *this;
317  }
318 
319  AgentParser::stack_symbol_type&
320  AgentParser::stack_symbol_type::operator= (stack_symbol_type& that)
321  {
322  state = that.state;
323  switch (that.kind ())
324  {
325  case symbol_kind::S_value: // value
326  case symbol_kind::S_map_value: // map_value
327  case symbol_kind::S_socket_type_value: // socket_type_value
328  case symbol_kind::S_auth_type_value: // auth_type_value
329  value.move< ElementPtr > (that.value);
330  break;
331 
332  case symbol_kind::S_BOOLEAN: // "boolean"
333  value.move< bool > (that.value);
334  break;
335 
336  case symbol_kind::S_FLOAT: // "floating point"
337  value.move< double > (that.value);
338  break;
339 
340  case symbol_kind::S_INTEGER: // "integer"
341  value.move< int64_t > (that.value);
342  break;
343 
344  case symbol_kind::S_STRING: // "constant string"
345  value.move< std::string > (that.value);
346  break;
347 
348  default:
349  break;
350  }
351 
352  location = that.location;
353  // that is emptied.
354  that.state = empty_state;
355  return *this;
356  }
357 #endif
358 
359  template <typename Base>
360  void
361  AgentParser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
362  {
363  if (yymsg)
364  YY_SYMBOL_PRINT (yymsg, yysym);
365  }
366 
367 #if AGENT_DEBUG
368  template <typename Base>
369  void
370  AgentParser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const
371  {
372  std::ostream& yyoutput = yyo;
373  YY_USE (yyoutput);
374  if (yysym.empty ())
375  yyo << "empty symbol";
376  else
377  {
378  symbol_kind_type yykind = yysym.kind ();
379  yyo << (yykind < YYNTOKENS ? "token" : "nterm")
380  << ' ' << yysym.name () << " ("
381  << yysym.location << ": ";
382  switch (yykind)
383  {
384  case symbol_kind::S_STRING: // "constant string"
385 #line 116 "agent_parser.yy"
386  { yyoutput << yysym.value.template as < std::string > (); }
387 #line 388 "agent_parser.cc"
388  break;
389 
390  case symbol_kind::S_INTEGER: // "integer"
391 #line 116 "agent_parser.yy"
392  { yyoutput << yysym.value.template as < int64_t > (); }
393 #line 394 "agent_parser.cc"
394  break;
395 
396  case symbol_kind::S_FLOAT: // "floating point"
397 #line 116 "agent_parser.yy"
398  { yyoutput << yysym.value.template as < double > (); }
399 #line 400 "agent_parser.cc"
400  break;
401 
402  case symbol_kind::S_BOOLEAN: // "boolean"
403 #line 116 "agent_parser.yy"
404  { yyoutput << yysym.value.template as < bool > (); }
405 #line 406 "agent_parser.cc"
406  break;
407 
408  case symbol_kind::S_value: // value
409 #line 116 "agent_parser.yy"
410  { yyoutput << yysym.value.template as < ElementPtr > (); }
411 #line 412 "agent_parser.cc"
412  break;
413 
414  case symbol_kind::S_map_value: // map_value
415 #line 116 "agent_parser.yy"
416  { yyoutput << yysym.value.template as < ElementPtr > (); }
417 #line 418 "agent_parser.cc"
418  break;
419 
420  case symbol_kind::S_socket_type_value: // socket_type_value
421 #line 116 "agent_parser.yy"
422  { yyoutput << yysym.value.template as < ElementPtr > (); }
423 #line 424 "agent_parser.cc"
424  break;
425 
426  case symbol_kind::S_auth_type_value: // auth_type_value
427 #line 116 "agent_parser.yy"
428  { yyoutput << yysym.value.template as < ElementPtr > (); }
429 #line 430 "agent_parser.cc"
430  break;
431 
432  default:
433  break;
434  }
435  yyo << ')';
436  }
437  }
438 #endif
439 
440  void
441  AgentParser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
442  {
443  if (m)
444  YY_SYMBOL_PRINT (m, sym);
445  yystack_.push (YY_MOVE (sym));
446  }
447 
448  void
449  AgentParser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
450  {
451 #if 201103L <= YY_CPLUSPLUS
452  yypush_ (m, stack_symbol_type (s, std::move (sym)));
453 #else
454  stack_symbol_type ss (s, sym);
455  yypush_ (m, ss);
456 #endif
457  }
458 
459  void
460  AgentParser::yypop_ (int n) YY_NOEXCEPT
461  {
462  yystack_.pop (n);
463  }
464 
465 #if AGENT_DEBUG
466  std::ostream&
468  {
469  return *yycdebug_;
470  }
471 
472  void
474  {
475  yycdebug_ = &o;
476  }
477 
478 
481  {
482  return yydebug_;
483  }
484 
485  void
487  {
488  yydebug_ = l;
489  }
490 #endif // AGENT_DEBUG
491 
492  AgentParser::state_type
493  AgentParser::yy_lr_goto_state_ (state_type yystate, int yysym)
494  {
495  int yyr = yypgoto_[yysym - YYNTOKENS] + yystate;
496  if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
497  return yytable_[yyr];
498  else
499  return yydefgoto_[yysym - YYNTOKENS];
500  }
501 
502  bool
503  AgentParser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT
504  {
505  return yyvalue == yypact_ninf_;
506  }
507 
508  bool
509  AgentParser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT
510  {
511  return yyvalue == yytable_ninf_;
512  }
513 
514  int
516  {
517  return parse ();
518  }
519 
520  int
522  {
523  int yyn;
525  int yylen = 0;
526 
527  // Error handling.
528  int yynerrs_ = 0;
529  int yyerrstatus_ = 0;
530 
532  symbol_type yyla;
533 
535  stack_symbol_type yyerror_range[3];
536 
538  int yyresult;
539 
540 #if YY_EXCEPTIONS
541  try
542 #endif // YY_EXCEPTIONS
543  {
544  YYCDEBUG << "Starting parse\n";
545 
546 
547  /* Initialize the stack. The initial state will be set in
548  yynewstate, since the latter expects the semantical and the
549  location values to have been already stored, initialize these
550  stacks with a primary value. */
551  yystack_.clear ();
552  yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
553 
554  /*-----------------------------------------------.
555  | yynewstate -- push a new symbol on the stack. |
556  `-----------------------------------------------*/
557  yynewstate:
558  YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n';
559  YY_STACK_PRINT ();
560 
561  // Accept?
562  if (yystack_[0].state == yyfinal_)
563  YYACCEPT;
564 
565  goto yybackup;
566 
567 
568  /*-----------.
569  | yybackup. |
570  `-----------*/
571  yybackup:
572  // Try to take a decision without lookahead.
573  yyn = yypact_[+yystack_[0].state];
574  if (yy_pact_value_is_default_ (yyn))
575  goto yydefault;
576 
577  // Read a lookahead token.
578  if (yyla.empty ())
579  {
580  YYCDEBUG << "Reading a token\n";
581 #if YY_EXCEPTIONS
582  try
583 #endif // YY_EXCEPTIONS
584  {
585  symbol_type yylookahead (yylex (ctx));
586  yyla.move (yylookahead);
587  }
588 #if YY_EXCEPTIONS
589  catch (const syntax_error& yyexc)
590  {
591  YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
592  error (yyexc);
593  goto yyerrlab1;
594  }
595 #endif // YY_EXCEPTIONS
596  }
597  YY_SYMBOL_PRINT ("Next token is", yyla);
598 
599  if (yyla.kind () == symbol_kind::S_YYerror)
600  {
601  // The scanner already issued an error message, process directly
602  // to error recovery. But do not keep the error token as
603  // lookahead, it is too special and may lead us to an endless
604  // loop in error recovery. */
606  goto yyerrlab1;
607  }
608 
609  /* If the proper action on seeing token YYLA.TYPE is to reduce or
610  to detect an error, take that action. */
611  yyn += yyla.kind ();
612  if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ())
613  {
614  goto yydefault;
615  }
616 
617  // Reduce or error.
618  yyn = yytable_[yyn];
619  if (yyn <= 0)
620  {
621  if (yy_table_value_is_error_ (yyn))
622  goto yyerrlab;
623  yyn = -yyn;
624  goto yyreduce;
625  }
626 
627  // Count tokens shifted since error; after three, turn off error status.
628  if (yyerrstatus_)
629  --yyerrstatus_;
630 
631  // Shift the lookahead token.
632  yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla));
633  goto yynewstate;
634 
635 
636  /*-----------------------------------------------------------.
637  | yydefault -- do the default action for the current state. |
638  `-----------------------------------------------------------*/
639  yydefault:
640  yyn = yydefact_[+yystack_[0].state];
641  if (yyn == 0)
642  goto yyerrlab;
643  goto yyreduce;
644 
645 
646  /*-----------------------------.
647  | yyreduce -- do a reduction. |
648  `-----------------------------*/
649  yyreduce:
650  yylen = yyr2_[yyn];
651  {
652  stack_symbol_type yylhs;
653  yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
654  /* Variants are always initialized to an empty instance of the
655  correct type. The default '$$ = $1' action is NOT applied
656  when using variants. */
657  switch (yyr1_[yyn])
658  {
659  case symbol_kind::S_value: // value
660  case symbol_kind::S_map_value: // map_value
661  case symbol_kind::S_socket_type_value: // socket_type_value
662  case symbol_kind::S_auth_type_value: // auth_type_value
663  yylhs.value.emplace< ElementPtr > ();
664  break;
665 
666  case symbol_kind::S_BOOLEAN: // "boolean"
667  yylhs.value.emplace< bool > ();
668  break;
669 
670  case symbol_kind::S_FLOAT: // "floating point"
671  yylhs.value.emplace< double > ();
672  break;
673 
674  case symbol_kind::S_INTEGER: // "integer"
675  yylhs.value.emplace< int64_t > ();
676  break;
677 
678  case symbol_kind::S_STRING: // "constant string"
679  yylhs.value.emplace< std::string > ();
680  break;
681 
682  default:
683  break;
684  }
685 
686 
687  // Default location.
688  {
689  stack_type::slice range (yystack_, yylen);
690  YYLLOC_DEFAULT (yylhs.location, range, yylen);
691  yyerror_range[1].location = yylhs.location;
692  }
693 
694  // Perform the reduction.
695  YY_REDUCE_PRINT (yyn);
696 #if YY_EXCEPTIONS
697  try
698 #endif // YY_EXCEPTIONS
699  {
700  switch (yyn)
701  {
702  case 2: // $@1: %empty
703 #line 127 "agent_parser.yy"
704  { ctx.ctx_ = ctx.NO_KEYWORDS; }
705 #line 706 "agent_parser.cc"
706  break;
707 
708  case 4: // $@2: %empty
709 #line 128 "agent_parser.yy"
710  { ctx.ctx_ = ctx.CONFIG; }
711 #line 712 "agent_parser.cc"
712  break;
713 
714  case 6: // $@3: %empty
715 #line 129 "agent_parser.yy"
716  { ctx.ctx_ = ctx.AGENT; }
717 #line 718 "agent_parser.cc"
718  break;
719 
720  case 8: // $@4: %empty
721 #line 137 "agent_parser.yy"
722  {
723  // Parse the Control-agent map
724  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
725  ctx.stack_.push_back(m);
726 }
727 #line 728 "agent_parser.cc"
728  break;
729 
730  case 9: // sub_agent: "{" $@4 global_params "}"
731 #line 141 "agent_parser.yy"
732  {
733  // parsing completed
734 }
735 #line 736 "agent_parser.cc"
736  break;
737 
738  case 10: // json: value
739 #line 148 "agent_parser.yy"
740  {
741  // Push back the JSON value on the stack
742  ctx.stack_.push_back(yystack_[0].value.as < ElementPtr > ());
743 }
744 #line 745 "agent_parser.cc"
745  break;
746 
747  case 11: // value: "integer"
748 #line 154 "agent_parser.yy"
749  { yylhs.value.as < ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location))); }
750 #line 751 "agent_parser.cc"
751  break;
752 
753  case 12: // value: "floating point"
754 #line 155 "agent_parser.yy"
755  { yylhs.value.as < ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as < double > (), ctx.loc2pos(yystack_[0].location))); }
756 #line 757 "agent_parser.cc"
757  break;
758 
759  case 13: // value: "boolean"
760 #line 156 "agent_parser.yy"
761  { yylhs.value.as < ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location))); }
762 #line 763 "agent_parser.cc"
763  break;
764 
765  case 14: // value: "constant string"
766 #line 157 "agent_parser.yy"
767  { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); }
768 #line 769 "agent_parser.cc"
769  break;
770 
771  case 15: // value: "null"
772 #line 158 "agent_parser.yy"
773  { yylhs.value.as < ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); }
774 #line 775 "agent_parser.cc"
775  break;
776 
777  case 16: // value: map
778 #line 159 "agent_parser.yy"
779  { yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
780 #line 781 "agent_parser.cc"
781  break;
782 
783  case 17: // value: list_generic
784 #line 160 "agent_parser.yy"
785  { yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
786 #line 787 "agent_parser.cc"
787  break;
788 
789  case 18: // $@5: %empty
790 #line 164 "agent_parser.yy"
791  {
792  // This code is executed when we're about to start parsing
793  // the content of the map
794  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
795  ctx.stack_.push_back(m);
796 }
797 #line 798 "agent_parser.cc"
798  break;
799 
800  case 19: // map: "{" $@5 map_content "}"
801 #line 169 "agent_parser.yy"
802  {
803  // map parsing completed. If we ever want to do any wrap up
804  // (maybe some sanity checking), this would be the best place
805  // for it.
806 }
807 #line 808 "agent_parser.cc"
808  break;
809 
810  case 20: // map_value: map
811 #line 175 "agent_parser.yy"
812  { yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
813 #line 814 "agent_parser.cc"
814  break;
815 
816  case 23: // not_empty_map: "constant string" ":" value
817 #line 189 "agent_parser.yy"
818  {
819  // map containing a single entry
820  ctx.unique(yystack_[2].value.as < std::string > (), ctx.loc2pos(yystack_[2].location));
821  ctx.stack_.back()->set(yystack_[2].value.as < std::string > (), yystack_[0].value.as < ElementPtr > ());
822  }
823 #line 824 "agent_parser.cc"
824  break;
825 
826  case 24: // not_empty_map: not_empty_map "," "constant string" ":" value
827 #line 194 "agent_parser.yy"
828  {
829  // map consisting of a shorter map followed by
830  // comma and string:value
831  ctx.unique(yystack_[2].value.as < std::string > (), ctx.loc2pos(yystack_[2].location));
832  ctx.stack_.back()->set(yystack_[2].value.as < std::string > (), yystack_[0].value.as < ElementPtr > ());
833  }
834 #line 835 "agent_parser.cc"
835  break;
836 
837  case 25: // not_empty_map: not_empty_map ","
838 #line 200 "agent_parser.yy"
839  {
840  ctx.warnAboutExtraCommas(yystack_[0].location);
841  }
842 #line 843 "agent_parser.cc"
843  break;
844 
845  case 26: // $@6: %empty
846 #line 205 "agent_parser.yy"
847  {
848  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
849  ctx.stack_.push_back(l);
850 }
851 #line 852 "agent_parser.cc"
852  break;
853 
854  case 27: // list_generic: "[" $@6 list_content "]"
855 #line 208 "agent_parser.yy"
856  {
857 }
858 #line 859 "agent_parser.cc"
859  break;
860 
861  case 30: // not_empty_list: value
862 #line 215 "agent_parser.yy"
863  {
864  // List consisting of a single element.
865  ctx.stack_.back()->add(yystack_[0].value.as < ElementPtr > ());
866  }
867 #line 868 "agent_parser.cc"
868  break;
869 
870  case 31: // not_empty_list: not_empty_list "," value
871 #line 219 "agent_parser.yy"
872  {
873  // List ending with , and a value.
874  ctx.stack_.back()->add(yystack_[0].value.as < ElementPtr > ());
875  }
876 #line 877 "agent_parser.cc"
877  break;
878 
879  case 32: // not_empty_list: not_empty_list ","
880 #line 223 "agent_parser.yy"
881  {
882  ctx.warnAboutExtraCommas(yystack_[0].location);
883  }
884 #line 885 "agent_parser.cc"
885  break;
886 
887  case 33: // unknown_map_entry: "constant string" ":"
888 #line 235 "agent_parser.yy"
889  {
890  const std::string& where = ctx.contextName();
891  const std::string& keyword = yystack_[1].value.as < std::string > ();
892  error(yystack_[1].location,
893  "got unexpected keyword \"" + keyword + "\" in " + where + " map.");
894 }
895 #line 896 "agent_parser.cc"
896  break;
897 
898  case 34: // $@7: %empty
899 #line 243 "agent_parser.yy"
900  {
901  // This code is executed when we're about to start parsing
902  // the content of the map
903  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
904  ctx.stack_.push_back(m);
905 }
906 #line 907 "agent_parser.cc"
907  break;
908 
909  case 35: // agent_syntax_map: "{" $@7 global_object "}"
910 #line 248 "agent_parser.yy"
911  {
912  // map parsing completed. If we ever want to do any wrap up
913  // (maybe some sanity checking), this would be the best place
914  // for it.
915 }
916 #line 917 "agent_parser.cc"
917  break;
918 
919  case 36: // $@8: %empty
920 #line 255 "agent_parser.yy"
921  {
922  // Let's create a MapElement that will represent it, add it to the
923  // top level map (that's already on the stack) and put the new map
924  // on the stack as well, so child elements will be able to add
925  // themselves to it.
926  ctx.unique("Control-agent", ctx.loc2pos(yystack_[0].location));
927  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
928  ctx.stack_.back()->set("Control-agent", m);
929  ctx.stack_.push_back(m);
930  ctx.enter(ctx.AGENT);
931 }
932 #line 933 "agent_parser.cc"
933  break;
934 
935  case 37: // global_object: "Control-agent" $@8 ":" "{" global_params "}"
936 #line 265 "agent_parser.yy"
937  {
938  // Ok, we're done with parsing control-agent. Let's take the map
939  // off the stack.
940  ctx.stack_.pop_back();
941  ctx.leave();
942 }
943 #line 944 "agent_parser.cc"
944  break;
945 
946  case 39: // global_object_comma: global_object ","
947 #line 274 "agent_parser.yy"
948  {
949  ctx.warnAboutExtraCommas(yystack_[0].location);
950 }
951 #line 952 "agent_parser.cc"
952  break;
953 
954  case 42: // global_params: global_params ","
955 #line 280 "agent_parser.yy"
956  {
957  ctx.warnAboutExtraCommas(yystack_[0].location);
958  }
959 #line 960 "agent_parser.cc"
960  break;
961 
962  case 56: // $@9: %empty
963 #line 302 "agent_parser.yy"
964  {
965  ctx.unique("http-host", ctx.loc2pos(yystack_[0].location));
966  ctx.enter(ctx.NO_KEYWORDS);
967 }
968 #line 969 "agent_parser.cc"
969  break;
970 
971  case 57: // http_host: "http-host" $@9 ":" "constant string"
972 #line 305 "agent_parser.yy"
973  {
974  ElementPtr host(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
975  ctx.stack_.back()->set("http-host", host);
976  ctx.leave();
977 }
978 #line 979 "agent_parser.cc"
979  break;
980 
981  case 58: // http_port: "http-port" ":" "integer"
982 #line 311 "agent_parser.yy"
983  {
984  ctx.unique("http-port", ctx.loc2pos(yystack_[2].location));
985  ElementPtr prf(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
986  ctx.stack_.back()->set("http-port", prf);
987 }
988 #line 989 "agent_parser.cc"
989  break;
990 
991  case 59: // $@10: %empty
992 #line 317 "agent_parser.yy"
993  {
994  ctx.unique("trust-anchor", ctx.loc2pos(yystack_[0].location));
995  ctx.enter(ctx.NO_KEYWORDS);
996 }
997 #line 998 "agent_parser.cc"
998  break;
999 
1000  case 60: // trust_anchor: "trust-anchor" $@10 ":" "constant string"
1001 #line 320 "agent_parser.yy"
1002  {
1003  ElementPtr ca(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1004  ctx.stack_.back()->set("trust-anchor", ca);
1005  ctx.leave();
1006 }
1007 #line 1008 "agent_parser.cc"
1008  break;
1009 
1010  case 61: // $@11: %empty
1011 #line 326 "agent_parser.yy"
1012  {
1013  ctx.unique("cert-file", ctx.loc2pos(yystack_[0].location));
1014  ctx.enter(ctx.NO_KEYWORDS);
1015 }
1016 #line 1017 "agent_parser.cc"
1017  break;
1018 
1019  case 62: // cert_file: "cert-file" $@11 ":" "constant string"
1020 #line 329 "agent_parser.yy"
1021  {
1022  ElementPtr cert(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1023  ctx.stack_.back()->set("cert-file", cert);
1024  ctx.leave();
1025 }
1026 #line 1027 "agent_parser.cc"
1027  break;
1028 
1029  case 63: // $@12: %empty
1030 #line 335 "agent_parser.yy"
1031  {
1032  ctx.unique("key-file", ctx.loc2pos(yystack_[0].location));
1033  ctx.enter(ctx.NO_KEYWORDS);
1034 }
1035 #line 1036 "agent_parser.cc"
1036  break;
1037 
1038  case 64: // key_file: "key-file" $@12 ":" "constant string"
1039 #line 338 "agent_parser.yy"
1040  {
1041  ElementPtr key(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1042  ctx.stack_.back()->set("key-file", key);
1043  ctx.leave();
1044 }
1045 #line 1046 "agent_parser.cc"
1046  break;
1047 
1048  case 65: // cert_required: "cert-required" ":" "boolean"
1049 #line 344 "agent_parser.yy"
1050  {
1051  ctx.unique("cert-required", ctx.loc2pos(yystack_[2].location));
1052  ElementPtr req(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1053  ctx.stack_.back()->set("cert-required", req);
1054 }
1055 #line 1056 "agent_parser.cc"
1056  break;
1057 
1058  case 66: // $@13: %empty
1059 #line 350 "agent_parser.yy"
1060  {
1061  ctx.enter(ctx.NO_KEYWORDS);
1062 }
1063 #line 1064 "agent_parser.cc"
1064  break;
1065 
1066  case 67: // user_context: "user-context" $@13 ":" map_value
1067 #line 352 "agent_parser.yy"
1068  {
1069  ElementPtr parent = ctx.stack_.back();
1070  ElementPtr user_context = yystack_[0].value.as < ElementPtr > ();
1071  ConstElementPtr old = parent->get("user-context");
1072 
1073  // Handle already existing user context
1074  if (old) {
1075  // Check if it was a comment or a duplicate
1076  if ((old->size() != 1) || !old->contains("comment")) {
1077  std::stringstream msg;
1078  msg << "duplicate user-context entries (previous at "
1079  << old->getPosition().str() << ")";
1080  error(yystack_[3].location, msg.str());
1081  }
1082  // Merge the comment
1083  user_context->set("comment", old->get("comment"));
1084  }
1085 
1086  // Set the user context
1087  parent->set("user-context", user_context);
1088  ctx.leave();
1089 }
1090 #line 1091 "agent_parser.cc"
1091  break;
1092 
1093  case 68: // $@14: %empty
1094 #line 375 "agent_parser.yy"
1095  {
1096  ctx.enter(ctx.NO_KEYWORDS);
1097 }
1098 #line 1099 "agent_parser.cc"
1099  break;
1100 
1101  case 69: // comment: "comment" $@14 ":" "constant string"
1102 #line 377 "agent_parser.yy"
1103  {
1104  ElementPtr parent = ctx.stack_.back();
1105  ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location)));
1106  ElementPtr comment(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1107  user_context->set("comment", comment);
1108 
1109  // Handle already existing user context
1110  ConstElementPtr old = parent->get("user-context");
1111  if (old) {
1112  // Check for duplicate comment
1113  if (old->contains("comment")) {
1114  std::stringstream msg;
1115  msg << "duplicate user-context/comment entries (previous at "
1116  << old->getPosition().str() << ")";
1117  error(yystack_[3].location, msg.str());
1118  }
1119  // Merge the user context in the comment
1120  merge(user_context, old);
1121  }
1122 
1123  // Set the user context
1124  parent->set("user-context", user_context);
1125  ctx.leave();
1126 }
1127 #line 1128 "agent_parser.cc"
1128  break;
1129 
1130  case 70: // $@15: %empty
1131 #line 403 "agent_parser.yy"
1132  {
1133  ctx.unique("hooks-libraries", ctx.loc2pos(yystack_[0].location));
1134  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1135  ctx.stack_.back()->set("hooks-libraries", l);
1136  ctx.stack_.push_back(l);
1137  ctx.enter(ctx.HOOKS_LIBRARIES);
1138 }
1139 #line 1140 "agent_parser.cc"
1140  break;
1141 
1142  case 71: // hooks_libraries: "hooks-libraries" $@15 ":" "[" hooks_libraries_list "]"
1143 #line 409 "agent_parser.yy"
1144  {
1145  ctx.stack_.pop_back();
1146  ctx.leave();
1147 }
1148 #line 1149 "agent_parser.cc"
1149  break;
1150 
1151  case 76: // not_empty_hooks_libraries_list: not_empty_hooks_libraries_list ","
1152 #line 420 "agent_parser.yy"
1153  {
1154  ctx.warnAboutExtraCommas(yystack_[0].location);
1155  }
1156 #line 1157 "agent_parser.cc"
1157  break;
1158 
1159  case 77: // $@16: %empty
1160 #line 425 "agent_parser.yy"
1161  {
1162  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1163  ctx.stack_.back()->add(m);
1164  ctx.stack_.push_back(m);
1165 }
1166 #line 1167 "agent_parser.cc"
1167  break;
1168 
1169  case 78: // hooks_library: "{" $@16 hooks_params "}"
1170 #line 429 "agent_parser.yy"
1171  {
1172  ctx.stack_.pop_back();
1173 }
1174 #line 1175 "agent_parser.cc"
1175  break;
1176 
1177  case 81: // hooks_params: hooks_params ","
1178 #line 435 "agent_parser.yy"
1179  {
1180  ctx.warnAboutExtraCommas(yystack_[0].location);
1181  }
1182 #line 1183 "agent_parser.cc"
1183  break;
1184 
1185  case 85: // $@17: %empty
1186 #line 445 "agent_parser.yy"
1187  {
1188  ctx.unique("library", ctx.loc2pos(yystack_[0].location));
1189  ctx.enter(ctx.NO_KEYWORDS);
1190 }
1191 #line 1192 "agent_parser.cc"
1192  break;
1193 
1194  case 86: // library: "library" $@17 ":" "constant string"
1195 #line 448 "agent_parser.yy"
1196  {
1197  ElementPtr lib(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1198  ctx.stack_.back()->set("library", lib);
1199  ctx.leave();
1200 }
1201 #line 1202 "agent_parser.cc"
1202  break;
1203 
1204  case 87: // $@18: %empty
1205 #line 454 "agent_parser.yy"
1206  {
1207  ctx.unique("parameters", ctx.loc2pos(yystack_[0].location));
1208  ctx.enter(ctx.NO_KEYWORDS);
1209 }
1210 #line 1211 "agent_parser.cc"
1211  break;
1212 
1213  case 88: // parameters: "parameters" $@18 ":" map_value
1214 #line 457 "agent_parser.yy"
1215  {
1216  ctx.stack_.back()->set("parameters", yystack_[0].value.as < ElementPtr > ());
1217  ctx.leave();
1218 }
1219 #line 1220 "agent_parser.cc"
1220  break;
1221 
1222  case 89: // $@19: %empty
1223 #line 465 "agent_parser.yy"
1224  {
1225  ctx.unique("control-sockets", ctx.loc2pos(yystack_[2].location));
1226  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[2].location)));
1227  ctx.stack_.back()->set("control-sockets", m);
1228  ctx.stack_.push_back(m);
1229  ctx.enter(ctx.CONTROL_SOCKETS);
1230 }
1231 #line 1232 "agent_parser.cc"
1232  break;
1233 
1234  case 90: // control_sockets: "control-sockets" ":" "{" $@19 control_sockets_params "}"
1235 #line 471 "agent_parser.yy"
1236  {
1237  ctx.stack_.pop_back();
1238  ctx.leave();
1239 }
1240 #line 1241 "agent_parser.cc"
1241  break;
1242 
1243  case 93: // control_sockets_params: control_sockets_params ","
1244 #line 481 "agent_parser.yy"
1245  {
1246  ctx.warnAboutExtraCommas(yystack_[0].location);
1247  }
1248 #line 1249 "agent_parser.cc"
1249  break;
1250 
1251  case 98: // $@20: %empty
1252 #line 495 "agent_parser.yy"
1253  {
1254  ctx.unique("dhcp4", ctx.loc2pos(yystack_[0].location));
1255  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1256  ctx.stack_.back()->set("dhcp4", m);
1257  ctx.stack_.push_back(m);
1258  ctx.enter(ctx.SERVER);
1259 }
1260 #line 1261 "agent_parser.cc"
1261  break;
1262 
1263  case 99: // dhcp4_server_socket: "dhcp4" $@20 ":" "{" control_socket_params "}"
1264 #line 501 "agent_parser.yy"
1265  {
1266  ctx.stack_.pop_back();
1267  ctx.leave();
1268 }
1269 #line 1270 "agent_parser.cc"
1270  break;
1271 
1272  case 100: // $@21: %empty
1273 #line 507 "agent_parser.yy"
1274  {
1275  ctx.unique("dhcp6", ctx.loc2pos(yystack_[0].location));
1276  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1277  ctx.stack_.back()->set("dhcp6", m);
1278  ctx.stack_.push_back(m);
1279  ctx.enter(ctx.SERVER);
1280 }
1281 #line 1282 "agent_parser.cc"
1282  break;
1283 
1284  case 101: // dhcp6_server_socket: "dhcp6" $@21 ":" "{" control_socket_params "}"
1285 #line 513 "agent_parser.yy"
1286  {
1287  ctx.stack_.pop_back();
1288  ctx.leave();
1289 }
1290 #line 1291 "agent_parser.cc"
1291  break;
1292 
1293  case 102: // $@22: %empty
1294 #line 519 "agent_parser.yy"
1295  {
1296  ctx.unique("d2", ctx.loc2pos(yystack_[0].location));
1297  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1298  ctx.stack_.back()->set("d2", m);
1299  ctx.stack_.push_back(m);
1300  ctx.enter(ctx.SERVER);
1301 }
1302 #line 1303 "agent_parser.cc"
1303  break;
1304 
1305  case 103: // d2_server_socket: "d2" $@22 ":" "{" control_socket_params "}"
1306 #line 525 "agent_parser.yy"
1307  {
1308  ctx.stack_.pop_back();
1309  ctx.leave();
1310 }
1311 #line 1312 "agent_parser.cc"
1312  break;
1313 
1314  case 106: // control_socket_params: control_socket_params ","
1315 #line 533 "agent_parser.yy"
1316  {
1317  ctx.warnAboutExtraCommas(yystack_[0].location);
1318  }
1319 #line 1320 "agent_parser.cc"
1320  break;
1321 
1322  case 112: // $@23: %empty
1323 #line 547 "agent_parser.yy"
1324  {
1325  ctx.unique("socket-name", ctx.loc2pos(yystack_[0].location));
1326  ctx.enter(ctx.NO_KEYWORDS);
1327 }
1328 #line 1329 "agent_parser.cc"
1329  break;
1330 
1331  case 113: // socket_name: "socket-name" $@23 ":" "constant string"
1332 #line 550 "agent_parser.yy"
1333  {
1334  ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1335  ctx.stack_.back()->set("socket-name", name);
1336  ctx.leave();
1337 }
1338 #line 1339 "agent_parser.cc"
1339  break;
1340 
1341  case 114: // $@24: %empty
1342 #line 557 "agent_parser.yy"
1343  {
1344  ctx.unique("socket-type", ctx.loc2pos(yystack_[0].location));
1345  ctx.enter(ctx.SOCKET_TYPE);
1346 }
1347 #line 1348 "agent_parser.cc"
1348  break;
1349 
1350  case 115: // socket_type: "socket-type" $@24 ":" socket_type_value
1351 #line 560 "agent_parser.yy"
1352  {
1353  ctx.stack_.back()->set("socket-type", yystack_[0].value.as < ElementPtr > ());
1354  ctx.leave();
1355 }
1356 #line 1357 "agent_parser.cc"
1357  break;
1358 
1359  case 116: // socket_type_value: "unix"
1360 #line 566 "agent_parser.yy"
1361  { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("unix", ctx.loc2pos(yystack_[0].location))); }
1362 #line 1363 "agent_parser.cc"
1363  break;
1364 
1365  case 117: // $@25: %empty
1366 #line 573 "agent_parser.yy"
1367  {
1368  ctx.unique("authentication", ctx.loc2pos(yystack_[0].location));
1369  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1370  ctx.stack_.back()->set("authentication", m);
1371  ctx.stack_.push_back(m);
1372  ctx.enter(ctx.AUTHENTICATION);
1373 }
1374 #line 1375 "agent_parser.cc"
1375  break;
1376 
1377  case 118: // authentication: "authentication" $@25 ":" "{" auth_params "}"
1378 #line 579 "agent_parser.yy"
1379  {
1380  // The type parameter is required
1381  ctx.require("type", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
1382  ctx.stack_.pop_back();
1383  ctx.leave();
1384 }
1385 #line 1386 "agent_parser.cc"
1386  break;
1387 
1388  case 121: // auth_params: auth_params ","
1389 #line 588 "agent_parser.yy"
1390  {
1391  ctx.warnAboutExtraCommas(yystack_[0].location);
1392  }
1393 #line 1394 "agent_parser.cc"
1394  break;
1395 
1396  case 129: // $@26: %empty
1397 #line 602 "agent_parser.yy"
1398  {
1399  ctx.unique("type", ctx.loc2pos(yystack_[0].location));
1400  ctx.enter(ctx.AUTH_TYPE);
1401 }
1402 #line 1403 "agent_parser.cc"
1403  break;
1404 
1405  case 130: // auth_type: "type" $@26 ":" auth_type_value
1406 #line 605 "agent_parser.yy"
1407  {
1408  ctx.stack_.back()->set("type", yystack_[0].value.as < ElementPtr > ());
1409  ctx.leave();
1410 }
1411 #line 1412 "agent_parser.cc"
1412  break;
1413 
1414  case 131: // auth_type_value: "basic"
1415 #line 610 "agent_parser.yy"
1416  { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("basic", ctx.loc2pos(yystack_[0].location))); }
1417 #line 1418 "agent_parser.cc"
1418  break;
1419 
1420  case 132: // $@27: %empty
1421 #line 613 "agent_parser.yy"
1422  {
1423  ctx.unique("realm", ctx.loc2pos(yystack_[0].location));
1424  ctx.enter(ctx.NO_KEYWORDS);
1425 }
1426 #line 1427 "agent_parser.cc"
1427  break;
1428 
1429  case 133: // realm: "realm" $@27 ":" "constant string"
1430 #line 616 "agent_parser.yy"
1431  {
1432  ElementPtr realm(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1433  ctx.stack_.back()->set("realm", realm);
1434  ctx.leave();
1435 }
1436 #line 1437 "agent_parser.cc"
1437  break;
1438 
1439  case 134: // $@28: %empty
1440 #line 622 "agent_parser.yy"
1441  {
1442  ctx.unique("directory", ctx.loc2pos(yystack_[0].location));
1443  ctx.enter(ctx.NO_KEYWORDS);
1444 }
1445 #line 1446 "agent_parser.cc"
1446  break;
1447 
1448  case 135: // directory: "directory" $@28 ":" "constant string"
1449 #line 625 "agent_parser.yy"
1450  {
1451  ElementPtr directory(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1452  ctx.stack_.back()->set("directory", directory);
1453  ctx.leave();
1454 }
1455 #line 1456 "agent_parser.cc"
1456  break;
1457 
1458  case 136: // $@29: %empty
1459 #line 631 "agent_parser.yy"
1460  {
1461  ctx.unique("clients", ctx.loc2pos(yystack_[0].location));
1462  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1463  ctx.stack_.back()->set("clients", l);
1464  ctx.stack_.push_back(l);
1465  ctx.enter(ctx.CLIENTS);
1466 }
1467 #line 1468 "agent_parser.cc"
1468  break;
1469 
1470  case 137: // clients: "clients" $@29 ":" "[" clients_list "]"
1471 #line 637 "agent_parser.yy"
1472  {
1473  ctx.stack_.pop_back();
1474  ctx.leave();
1475 }
1476 #line 1477 "agent_parser.cc"
1477  break;
1478 
1479  case 142: // not_empty_clients_list: not_empty_clients_list ","
1480 #line 648 "agent_parser.yy"
1481  {
1482  ctx.warnAboutExtraCommas(yystack_[0].location);
1483  }
1484 #line 1485 "agent_parser.cc"
1485  break;
1486 
1487  case 143: // $@30: %empty
1488 #line 653 "agent_parser.yy"
1489  {
1490  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1491  ctx.stack_.back()->add(m);
1492  ctx.stack_.push_back(m);
1493 }
1494 #line 1495 "agent_parser.cc"
1495  break;
1496 
1497  case 144: // basic_auth: "{" $@30 clients_params "}"
1498 #line 657 "agent_parser.yy"
1499  {
1500  ctx.stack_.pop_back();
1501 }
1502 #line 1503 "agent_parser.cc"
1503  break;
1504 
1505  case 147: // clients_params: clients_params ","
1506 #line 663 "agent_parser.yy"
1507  {
1508  ctx.warnAboutExtraCommas(yystack_[0].location);
1509  }
1510 #line 1511 "agent_parser.cc"
1511  break;
1512 
1513  case 155: // $@31: %empty
1514 #line 677 "agent_parser.yy"
1515  {
1516  ctx.unique("user", ctx.loc2pos(yystack_[0].location));
1517  ctx.enter(ctx.NO_KEYWORDS);
1518 }
1519 #line 1520 "agent_parser.cc"
1520  break;
1521 
1522  case 156: // user: "user" $@31 ":" "constant string"
1523 #line 680 "agent_parser.yy"
1524  {
1525  ElementPtr user(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1526  ctx.stack_.back()->set("user", user);
1527  ctx.leave();
1528 }
1529 #line 1530 "agent_parser.cc"
1530  break;
1531 
1532  case 157: // $@32: %empty
1533 #line 686 "agent_parser.yy"
1534  {
1535  ctx.unique("user-file", ctx.loc2pos(yystack_[0].location));
1536  ctx.enter(ctx.NO_KEYWORDS);
1537 }
1538 #line 1539 "agent_parser.cc"
1539  break;
1540 
1541  case 158: // user_file: "user-file" $@32 ":" "constant string"
1542 #line 689 "agent_parser.yy"
1543  {
1544  ElementPtr user(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1545  ctx.stack_.back()->set("user-file", user);
1546  ctx.leave();
1547 }
1548 #line 1549 "agent_parser.cc"
1549  break;
1550 
1551  case 159: // $@33: %empty
1552 #line 695 "agent_parser.yy"
1553  {
1554  ctx.unique("password", ctx.loc2pos(yystack_[0].location));
1555  ctx.enter(ctx.NO_KEYWORDS);
1556 }
1557 #line 1558 "agent_parser.cc"
1558  break;
1559 
1560  case 160: // password: "password" $@33 ":" "constant string"
1561 #line 698 "agent_parser.yy"
1562  {
1563  ElementPtr password(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1564  ctx.stack_.back()->set("password", password);
1565  ctx.leave();
1566 }
1567 #line 1568 "agent_parser.cc"
1568  break;
1569 
1570  case 161: // $@34: %empty
1571 #line 704 "agent_parser.yy"
1572  {
1573  ctx.unique("password-file", ctx.loc2pos(yystack_[0].location));
1574  ctx.enter(ctx.NO_KEYWORDS);
1575 }
1576 #line 1577 "agent_parser.cc"
1577  break;
1578 
1579  case 162: // password_file: "password-file" $@34 ":" "constant string"
1580 #line 707 "agent_parser.yy"
1581  {
1582  ElementPtr password(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1583  ctx.stack_.back()->set("password-file", password);
1584  ctx.leave();
1585 }
1586 #line 1587 "agent_parser.cc"
1587  break;
1588 
1589  case 163: // $@35: %empty
1590 #line 717 "agent_parser.yy"
1591  {
1592  ctx.unique("loggers", ctx.loc2pos(yystack_[0].location));
1593  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1594  ctx.stack_.back()->set("loggers", l);
1595  ctx.stack_.push_back(l);
1596  ctx.enter(ctx.LOGGERS);
1597 }
1598 #line 1599 "agent_parser.cc"
1599  break;
1600 
1601  case 164: // loggers: "loggers" $@35 ":" "[" loggers_entries "]"
1602 #line 723 "agent_parser.yy"
1603  {
1604  ctx.stack_.pop_back();
1605  ctx.leave();
1606 }
1607 #line 1608 "agent_parser.cc"
1608  break;
1609 
1610  case 167: // loggers_entries: loggers_entries ","
1611 #line 732 "agent_parser.yy"
1612  {
1613  ctx.warnAboutExtraCommas(yystack_[0].location);
1614  }
1615 #line 1616 "agent_parser.cc"
1616  break;
1617 
1618  case 168: // $@36: %empty
1619 #line 738 "agent_parser.yy"
1620  {
1621  ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
1622  ctx.stack_.back()->add(l);
1623  ctx.stack_.push_back(l);
1624 }
1625 #line 1626 "agent_parser.cc"
1626  break;
1627 
1628  case 169: // logger_entry: "{" $@36 logger_params "}"
1629 #line 742 "agent_parser.yy"
1630  {
1631  ctx.stack_.pop_back();
1632 }
1633 #line 1634 "agent_parser.cc"
1634  break;
1635 
1636  case 172: // logger_params: logger_params ","
1637 #line 748 "agent_parser.yy"
1638  {
1639  ctx.warnAboutExtraCommas(yystack_[0].location);
1640  }
1641 #line 1642 "agent_parser.cc"
1642  break;
1643 
1644  case 180: // $@37: %empty
1645 #line 762 "agent_parser.yy"
1646  {
1647  ctx.unique("name", ctx.loc2pos(yystack_[0].location));
1648  ctx.enter(ctx.NO_KEYWORDS);
1649 }
1650 #line 1651 "agent_parser.cc"
1651  break;
1652 
1653  case 181: // name: "name" $@37 ":" "constant string"
1654 #line 765 "agent_parser.yy"
1655  {
1656  ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1657  ctx.stack_.back()->set("name", name);
1658  ctx.leave();
1659 }
1660 #line 1661 "agent_parser.cc"
1661  break;
1662 
1663  case 182: // debuglevel: "debuglevel" ":" "integer"
1664 #line 771 "agent_parser.yy"
1665  {
1666  ctx.unique("debuglevel", ctx.loc2pos(yystack_[2].location));
1667  ElementPtr dl(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1668  ctx.stack_.back()->set("debuglevel", dl);
1669 }
1670 #line 1671 "agent_parser.cc"
1671  break;
1672 
1673  case 183: // $@38: %empty
1674 #line 777 "agent_parser.yy"
1675  {
1676  ctx.unique("severity", ctx.loc2pos(yystack_[0].location));
1677  ctx.enter(ctx.NO_KEYWORDS);
1678 }
1679 #line 1680 "agent_parser.cc"
1680  break;
1681 
1682  case 184: // severity: "severity" $@38 ":" "constant string"
1683 #line 780 "agent_parser.yy"
1684  {
1685  ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1686  ctx.stack_.back()->set("severity", sev);
1687  ctx.leave();
1688 }
1689 #line 1690 "agent_parser.cc"
1690  break;
1691 
1692  case 185: // $@39: %empty
1693 #line 786 "agent_parser.yy"
1694  {
1695  ctx.unique("output_options", ctx.loc2pos(yystack_[0].location));
1696  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1697  ctx.stack_.back()->set("output_options", l);
1698  ctx.stack_.push_back(l);
1699  ctx.enter(ctx.OUTPUT_OPTIONS);
1700 }
1701 #line 1702 "agent_parser.cc"
1702  break;
1703 
1704  case 186: // output_options_list: "output_options" $@39 ":" "[" output_options_list_content "]"
1705 #line 792 "agent_parser.yy"
1706  {
1707  ctx.stack_.pop_back();
1708  ctx.leave();
1709 }
1710 #line 1711 "agent_parser.cc"
1711  break;
1712 
1713  case 189: // output_options_list_content: output_options_list_content ","
1714 #line 799 "agent_parser.yy"
1715  {
1716  ctx.warnAboutExtraCommas(yystack_[0].location);
1717  }
1718 #line 1719 "agent_parser.cc"
1719  break;
1720 
1721  case 190: // $@40: %empty
1722 #line 804 "agent_parser.yy"
1723  {
1724  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1725  ctx.stack_.back()->add(m);
1726  ctx.stack_.push_back(m);
1727 }
1728 #line 1729 "agent_parser.cc"
1729  break;
1730 
1731  case 191: // output_entry: "{" $@40 output_params_list "}"
1732 #line 808 "agent_parser.yy"
1733  {
1734  ctx.stack_.pop_back();
1735 }
1736 #line 1737 "agent_parser.cc"
1737  break;
1738 
1739  case 194: // output_params_list: output_params_list ","
1740 #line 814 "agent_parser.yy"
1741  {
1742  ctx.warnAboutExtraCommas(yystack_[0].location);
1743  }
1744 #line 1745 "agent_parser.cc"
1745  break;
1746 
1747  case 200: // $@41: %empty
1748 #line 826 "agent_parser.yy"
1749  {
1750  ctx.unique("output", ctx.loc2pos(yystack_[0].location));
1751  ctx.enter(ctx.NO_KEYWORDS);
1752 }
1753 #line 1754 "agent_parser.cc"
1754  break;
1755 
1756  case 201: // output: "output" $@41 ":" "constant string"
1757 #line 829 "agent_parser.yy"
1758  {
1759  ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1760  ctx.stack_.back()->set("output", sev);
1761  ctx.leave();
1762 }
1763 #line 1764 "agent_parser.cc"
1764  break;
1765 
1766  case 202: // flush: "flush" ":" "boolean"
1767 #line 835 "agent_parser.yy"
1768  {
1769  ctx.unique("flush", ctx.loc2pos(yystack_[2].location));
1770  ElementPtr flush(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1771  ctx.stack_.back()->set("flush", flush);
1772 }
1773 #line 1774 "agent_parser.cc"
1774  break;
1775 
1776  case 203: // maxsize: "maxsize" ":" "integer"
1777 #line 841 "agent_parser.yy"
1778  {
1779  ctx.unique("maxsize", ctx.loc2pos(yystack_[2].location));
1780  ElementPtr maxsize(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1781  ctx.stack_.back()->set("maxsize", maxsize);
1782 }
1783 #line 1784 "agent_parser.cc"
1784  break;
1785 
1786  case 204: // maxver: "maxver" ":" "integer"
1787 #line 847 "agent_parser.yy"
1788  {
1789  ctx.unique("maxver", ctx.loc2pos(yystack_[2].location));
1790  ElementPtr maxver(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1791  ctx.stack_.back()->set("maxver", maxver);
1792 }
1793 #line 1794 "agent_parser.cc"
1794  break;
1795 
1796  case 205: // $@42: %empty
1797 #line 853 "agent_parser.yy"
1798  {
1799  ctx.unique("pattern", ctx.loc2pos(yystack_[0].location));
1800  ctx.enter(ctx.NO_KEYWORDS);
1801 }
1802 #line 1803 "agent_parser.cc"
1803  break;
1804 
1805  case 206: // pattern: "pattern" $@42 ":" "constant string"
1806 #line 856 "agent_parser.yy"
1807  {
1808  ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1809  ctx.stack_.back()->set("pattern", sev);
1810  ctx.leave();
1811 }
1812 #line 1813 "agent_parser.cc"
1813  break;
1814 
1815 
1816 #line 1817 "agent_parser.cc"
1817 
1818  default:
1819  break;
1820  }
1821  }
1822 #if YY_EXCEPTIONS
1823  catch (const syntax_error& yyexc)
1824  {
1825  YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
1826  error (yyexc);
1827  YYERROR;
1828  }
1829 #endif // YY_EXCEPTIONS
1830  YY_SYMBOL_PRINT ("-> $$ =", yylhs);
1831  yypop_ (yylen);
1832  yylen = 0;
1833 
1834  // Shift the result of the reduction.
1835  yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
1836  }
1837  goto yynewstate;
1838 
1839 
1840  /*--------------------------------------.
1841  | yyerrlab -- here on detecting error. |
1842  `--------------------------------------*/
1843  yyerrlab:
1844  // If not already recovering from an error, report this error.
1845  if (!yyerrstatus_)
1846  {
1847  ++yynerrs_;
1848  context yyctx (*this, yyla);
1849  std::string msg = yysyntax_error_ (yyctx);
1850  error (yyla.location, YY_MOVE (msg));
1851  }
1852 
1853 
1854  yyerror_range[1].location = yyla.location;
1855  if (yyerrstatus_ == 3)
1856  {
1857  /* If just tried and failed to reuse lookahead token after an
1858  error, discard it. */
1859 
1860  // Return failure if at end of input.
1861  if (yyla.kind () == symbol_kind::S_YYEOF)
1862  YYABORT;
1863  else if (!yyla.empty ())
1864  {
1865  yy_destroy_ ("Error: discarding", yyla);
1866  yyla.clear ();
1867  }
1868  }
1869 
1870  // Else will try to reuse lookahead token after shifting the error token.
1871  goto yyerrlab1;
1872 
1873 
1874  /*---------------------------------------------------.
1875  | yyerrorlab -- error raised explicitly by YYERROR. |
1876  `---------------------------------------------------*/
1877  yyerrorlab:
1878  /* Pacify compilers when the user code never invokes YYERROR and
1879  the label yyerrorlab therefore never appears in user code. */
1880  if (false)
1881  YYERROR;
1882 
1883  /* Do not reclaim the symbols of the rule whose action triggered
1884  this YYERROR. */
1885  yypop_ (yylen);
1886  yylen = 0;
1887  YY_STACK_PRINT ();
1888  goto yyerrlab1;
1889 
1890 
1891  /*-------------------------------------------------------------.
1892  | yyerrlab1 -- common code for both syntax error and YYERROR. |
1893  `-------------------------------------------------------------*/
1894  yyerrlab1:
1895  yyerrstatus_ = 3; // Each real token shifted decrements this.
1896  // Pop stack until we find a state that shifts the error token.
1897  for (;;)
1898  {
1899  yyn = yypact_[+yystack_[0].state];
1900  if (!yy_pact_value_is_default_ (yyn))
1901  {
1902  yyn += symbol_kind::S_YYerror;
1903  if (0 <= yyn && yyn <= yylast_
1904  && yycheck_[yyn] == symbol_kind::S_YYerror)
1905  {
1906  yyn = yytable_[yyn];
1907  if (0 < yyn)
1908  break;
1909  }
1910  }
1911 
1912  // Pop the current state because it cannot handle the error token.
1913  if (yystack_.size () == 1)
1914  YYABORT;
1915 
1916  yyerror_range[1].location = yystack_[0].location;
1917  yy_destroy_ ("Error: popping", yystack_[0]);
1918  yypop_ ();
1919  YY_STACK_PRINT ();
1920  }
1921  {
1922  stack_symbol_type error_token;
1923 
1924  yyerror_range[2].location = yyla.location;
1925  YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
1926 
1927  // Shift the error token.
1928  error_token.state = state_type (yyn);
1929  yypush_ ("Shifting", YY_MOVE (error_token));
1930  }
1931  goto yynewstate;
1932 
1933 
1934  /*-------------------------------------.
1935  | yyacceptlab -- YYACCEPT comes here. |
1936  `-------------------------------------*/
1937  yyacceptlab:
1938  yyresult = 0;
1939  goto yyreturn;
1940 
1941 
1942  /*-----------------------------------.
1943  | yyabortlab -- YYABORT comes here. |
1944  `-----------------------------------*/
1945  yyabortlab:
1946  yyresult = 1;
1947  goto yyreturn;
1948 
1949 
1950  /*-----------------------------------------------------.
1951  | yyreturn -- parsing is finished, return the result. |
1952  `-----------------------------------------------------*/
1953  yyreturn:
1954  if (!yyla.empty ())
1955  yy_destroy_ ("Cleanup: discarding lookahead", yyla);
1956 
1957  /* Do not reclaim the symbols of the rule whose action triggered
1958  this YYABORT or YYACCEPT. */
1959  yypop_ (yylen);
1960  YY_STACK_PRINT ();
1961  while (1 < yystack_.size ())
1962  {
1963  yy_destroy_ ("Cleanup: popping", yystack_[0]);
1964  yypop_ ();
1965  }
1966 
1967  return yyresult;
1968  }
1969 #if YY_EXCEPTIONS
1970  catch (...)
1971  {
1972  YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
1973  // Do not try to display the values of the reclaimed symbols,
1974  // as their printers might throw an exception.
1975  if (!yyla.empty ())
1976  yy_destroy_ (YY_NULLPTR, yyla);
1977 
1978  while (1 < yystack_.size ())
1979  {
1980  yy_destroy_ (YY_NULLPTR, yystack_[0]);
1981  yypop_ ();
1982  }
1983  throw;
1984  }
1985 #endif // YY_EXCEPTIONS
1986  }
1987 
1988  void
1990  {
1991  error (yyexc.location, yyexc.what ());
1992  }
1993 
1994  /* Return YYSTR after stripping away unnecessary quotes and
1995  backslashes, so that it's suitable for yyerror. The heuristic is
1996  that double-quoting is unnecessary unless the string contains an
1997  apostrophe, a comma, or backslash (other than backslash-backslash).
1998  YYSTR is taken from yytname. */
1999  std::string
2000  AgentParser::yytnamerr_ (const char *yystr)
2001  {
2002  if (*yystr == '"')
2003  {
2004  std::string yyr;
2005  char const *yyp = yystr;
2006 
2007  for (;;)
2008  switch (*++yyp)
2009  {
2010  case '\'':
2011  case ',':
2012  goto do_not_strip_quotes;
2013 
2014  case '\\':
2015  if (*++yyp != '\\')
2016  goto do_not_strip_quotes;
2017  else
2018  goto append;
2019 
2020  append:
2021  default:
2022  yyr += *yyp;
2023  break;
2024 
2025  case '"':
2026  return yyr;
2027  }
2028  do_not_strip_quotes: ;
2029  }
2030 
2031  return yystr;
2032  }
2033 
2034  std::string
2036  {
2037  return yytnamerr_ (yytname_[yysymbol]);
2038  }
2039 
2040 
2041 
2042  // AgentParser::context.
2044  : yyparser_ (yyparser)
2045  , yyla_ (yyla)
2046  {}
2047 
2048  int
2050  {
2051  // Actual number of expected tokens
2052  int yycount = 0;
2053 
2054  const int yyn = yypact_[+yyparser_.yystack_[0].state];
2055  if (!yy_pact_value_is_default_ (yyn))
2056  {
2057  /* Start YYX at -YYN if negative to avoid negative indexes in
2058  YYCHECK. In other words, skip the first -YYN actions for
2059  this state because they are default actions. */
2060  const int yyxbegin = yyn < 0 ? -yyn : 0;
2061  // Stay within bounds of both yycheck and yytname.
2062  const int yychecklim = yylast_ - yyn + 1;
2063  const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2064  for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
2065  if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror
2066  && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
2067  {
2068  if (!yyarg)
2069  ++yycount;
2070  else if (yycount == yyargn)
2071  return 0;
2072  else
2073  yyarg[yycount++] = YY_CAST (symbol_kind_type, yyx);
2074  }
2075  }
2076 
2077  if (yyarg && yycount == 0 && 0 < yyargn)
2078  yyarg[0] = symbol_kind::S_YYEMPTY;
2079  return yycount;
2080  }
2081 
2082 
2083 
2084 
2085 
2086 
2087  int
2088  AgentParser::yy_syntax_error_arguments_ (const context& yyctx,
2089  symbol_kind_type yyarg[], int yyargn) const
2090  {
2091  /* There are many possibilities here to consider:
2092  - If this state is a consistent state with a default action, then
2093  the only way this function was invoked is if the default action
2094  is an error action. In that case, don't check for expected
2095  tokens because there are none.
2096  - The only way there can be no lookahead present (in yyla) is
2097  if this state is a consistent state with a default action.
2098  Thus, detecting the absence of a lookahead is sufficient to
2099  determine that there is no unexpected or expected token to
2100  report. In that case, just report a simple "syntax error".
2101  - Don't assume there isn't a lookahead just because this state is
2102  a consistent state with a default action. There might have
2103  been a previous inconsistent state, consistent state with a
2104  non-default action, or user semantic action that manipulated
2105  yyla. (However, yyla is currently not documented for users.)
2106  - Of course, the expected token list depends on states to have
2107  correct lookahead information, and it depends on the parser not
2108  to perform extra reductions after fetching a lookahead from the
2109  scanner and before detecting a syntax error. Thus, state merging
2110  (from LALR or IELR) and default reductions corrupt the expected
2111  token list. However, the list is correct for canonical LR with
2112  one exception: it will still contain any token that will not be
2113  accepted due to an error action in a later state.
2114  */
2115 
2116  if (!yyctx.lookahead ().empty ())
2117  {
2118  if (yyarg)
2119  yyarg[0] = yyctx.token ();
2120  int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1);
2121  return yyn + 1;
2122  }
2123  return 0;
2124  }
2125 
2126  // Generate an error message.
2127  std::string
2128  AgentParser::yysyntax_error_ (const context& yyctx) const
2129  {
2130  // Its maximum.
2131  enum { YYARGS_MAX = 5 };
2132  // Arguments of yyformat.
2133  symbol_kind_type yyarg[YYARGS_MAX];
2134  int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX);
2135 
2136  char const* yyformat = YY_NULLPTR;
2137  switch (yycount)
2138  {
2139 #define YYCASE_(N, S) \
2140  case N: \
2141  yyformat = S; \
2142  break
2143  default: // Avoid compiler warnings.
2144  YYCASE_ (0, YY_("syntax error"));
2145  YYCASE_ (1, YY_("syntax error, unexpected %s"));
2146  YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s"));
2147  YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s"));
2148  YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
2149  YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
2150 #undef YYCASE_
2151  }
2152 
2153  std::string yyres;
2154  // Argument number.
2155  std::ptrdiff_t yyi = 0;
2156  for (char const* yyp = yyformat; *yyp; ++yyp)
2157  if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
2158  {
2159  yyres += symbol_name (yyarg[yyi++]);
2160  ++yyp;
2161  }
2162  else
2163  yyres += *yyp;
2164  return yyres;
2165  }
2166 
2167 
2168  const short AgentParser::yypact_ninf_ = -136;
2169 
2170  const signed char AgentParser::yytable_ninf_ = -1;
2171 
2172  const short
2173  AgentParser::yypact_[] =
2174  {
2175  71, -136, -136, -136, 4, 0, 1, 16, -136, -136,
2176  -136, -136, -136, -136, -136, -136, -136, -136, -136, -136,
2177  -136, -136, -136, -136, 0, -31, 19, -1, -136, 40,
2178  55, 78, 83, 107, -136, 14, -136, -136, 112, -136,
2179  -136, -136, -136, -136, -136, 114, 119, -136, -136, 120,
2180  -136, 42, -136, -136, -136, -136, -136, -136, -136, -136,
2181  -136, -136, -136, -136, -136, -136, 0, 0, -136, 73,
2182  122, -136, -136, 126, 80, 127, 131, 132, 136, 138,
2183  139, 89, 140, 141, 142, -136, -1, -136, -136, -136,
2184  144, 143, 100, -136, 146, 102, 148, 104, 106, 108,
2185  -136, -136, 152, 154, -136, 0, -1, -136, -136, -136,
2186  -136, 23, -136, -136, -136, -12, 155, 156, -136, 75,
2187  -136, -136, -136, -136, -136, -136, -136, 91, -136, -136,
2188  -136, -136, -136, -136, -136, -136, -136, 95, -136, -136,
2189  -136, -136, -136, 145, 158, -136, -136, 28, -136, -136,
2190  160, 161, 162, 163, 23, -136, 164, 165, 166, -12,
2191  -136, -22, -136, 155, 49, 156, -136, 157, 121, 123,
2192  167, -136, 169, 170, 171, -136, -136, -136, -136, 97,
2193  -136, -136, -136, -136, -136, -136, 175, -136, -136, -136,
2194  -136, 99, -136, -136, -136, -136, -136, -136, -136, -136,
2195  -136, -136, 173, 63, 63, 63, 177, 178, -5, -136,
2196  179, 180, 96, 181, 49, -136, -136, 184, 168, -136,
2197  -136, -136, -136, -136, -136, 101, -136, -136, -136, 103,
2198  105, 134, 146, -136, 147, 186, -136, 149, -136, 43,
2199  -136, 173, 188, 189, 63, -136, -136, -136, -136, -136,
2200  -136, 187, -136, -136, -136, -136, -136, -136, -136, -136,
2201  109, -136, -136, -136, -136, -136, -136, 150, 172, -136,
2202  -136, 41, -136, 191, 192, 193, 194, 43, -136, -136,
2203  -136, -136, 26, 187, -136, 151, 153, 159, 174, -136,
2204  -136, 196, 200, 202, -136, 111, -136, -136, -136, -136,
2205  -136, -136, -136, -136, -136, -136, -136, 204, 176, 182,
2206  183, 205, 26, -136, 185, -136, -136, -136, 190, -136,
2207  -136, -136
2208  };
2209 
2210  const unsigned char
2211  AgentParser::yydefact_[] =
2212  {
2213  0, 2, 4, 6, 0, 0, 0, 0, 1, 26,
2214  18, 15, 14, 11, 12, 13, 3, 10, 16, 17,
2215  34, 5, 8, 7, 28, 21, 0, 0, 30, 0,
2216  29, 0, 0, 22, 36, 0, 38, 56, 0, 66,
2217  68, 117, 59, 61, 63, 0, 0, 70, 163, 0,
2218  55, 0, 40, 43, 44, 45, 46, 47, 48, 53,
2219  54, 51, 50, 49, 52, 27, 32, 0, 19, 25,
2220  0, 39, 35, 0, 0, 0, 0, 0, 0, 0,
2221  0, 0, 0, 0, 0, 33, 42, 9, 31, 23,
2222  0, 0, 0, 58, 0, 0, 0, 0, 0, 0,
2223  65, 89, 0, 0, 41, 0, 0, 57, 20, 67,
2224  69, 0, 60, 62, 64, 0, 72, 0, 24, 0,
2225  129, 132, 134, 136, 128, 127, 126, 0, 119, 122,
2226  123, 124, 125, 98, 100, 102, 97, 0, 91, 94,
2227  95, 96, 77, 0, 73, 74, 168, 0, 165, 37,
2228  0, 0, 0, 0, 121, 118, 0, 0, 0, 93,
2229  90, 0, 71, 76, 0, 167, 164, 0, 0, 0,
2230  0, 120, 0, 0, 0, 92, 85, 87, 82, 0,
2231  79, 83, 84, 75, 180, 185, 0, 183, 179, 177,
2232  178, 0, 170, 173, 175, 176, 174, 166, 131, 130,
2233  133, 135, 138, 0, 0, 0, 0, 0, 81, 78,
2234  0, 0, 0, 0, 172, 169, 143, 0, 139, 140,
2235  112, 114, 111, 109, 110, 0, 104, 107, 108, 0,
2236  0, 0, 0, 80, 0, 0, 182, 0, 171, 0,
2237  137, 142, 0, 0, 106, 99, 101, 103, 86, 88,
2238  181, 0, 184, 155, 157, 159, 161, 154, 152, 153,
2239  0, 145, 148, 149, 150, 151, 141, 0, 0, 105,
2240  190, 0, 187, 0, 0, 0, 0, 147, 144, 113,
2241  116, 115, 0, 189, 186, 0, 0, 0, 0, 146,
2242  200, 0, 0, 0, 205, 0, 192, 195, 196, 197,
2243  198, 199, 188, 156, 158, 160, 162, 0, 0, 0,
2244  0, 0, 194, 191, 0, 202, 203, 204, 0, 193,
2245  201, 206
2246  };
2247 
2248  const short
2249  AgentParser::yypgoto_[] =
2250  {
2251  -136, -136, -136, -136, -136, -136, -136, -136, -18, -91,
2252  -136, -17, -136, -136, -136, -136, -136, -136, -27, -136,
2253  -136, -136, -136, -136, 110, 124, -136, -136, -136, -136,
2254  -136, -136, -136, -136, -136, -136, -26, -136, -25, -136,
2255  -136, -136, -136, -136, 54, -136, -136, 10, -136, -136,
2256  -136, -136, -136, -136, -136, 60, -136, -136, -136, -136,
2257  -136, -136, -135, -24, -136, -136, -136, -136, -136, -136,
2258  -136, -136, 67, -136, -136, -136, -136, -136, -136, -136,
2259  -136, -136, -136, -136, -19, -136, -136, -54, -136, -136,
2260  -136, -136, -136, -136, -136, -136, -136, -136, -136, 59,
2261  -136, -136, 11, -136, -136, -136, -136, -136, -136, -136,
2262  -136, -56, -136, -136, -84, -136, -136, -136, -136, -136,
2263  -136, -136
2264  };
2265 
2266  const short
2267  AgentParser::yydefgoto_[] =
2268  {
2269  0, 4, 5, 6, 7, 23, 27, 16, 17, 18,
2270  25, 109, 32, 33, 19, 24, 29, 30, 222, 21,
2271  26, 35, 70, 36, 51, 52, 53, 73, 54, 55,
2272  78, 56, 79, 57, 80, 58, 223, 75, 224, 76,
2273  61, 83, 143, 144, 145, 161, 179, 180, 181, 206,
2274  182, 207, 62, 115, 137, 138, 139, 156, 140, 157,
2275  141, 158, 225, 226, 227, 242, 228, 243, 281, 63,
2276  77, 127, 128, 129, 150, 199, 130, 151, 131, 152,
2277  132, 153, 217, 218, 219, 239, 260, 261, 262, 273,
2278  263, 274, 264, 275, 265, 276, 64, 84, 147, 148,
2279  164, 191, 192, 193, 210, 194, 195, 213, 196, 211,
2280  271, 272, 282, 295, 296, 297, 307, 298, 299, 300,
2281  301, 311
2282  };
2283 
2284  const short
2285  AgentParser::yytable_[] =
2286  {
2287  50, 59, 60, 108, 8, 9, 28, 10, 20, 11,
2288  37, 38, 39, 40, 41, 176, 177, 71, 133, 134,
2289  135, 31, 72, 22, 42, 43, 44, 45, 46, 34,
2290  49, 165, 176, 177, 166, 47, 39, 40, 48, 120,
2291  49, 121, 122, 123, 283, 86, 65, 284, 88, 89,
2292  87, 49, 12, 13, 14, 15, 39, 40, 66, 50,
2293  59, 60, 39, 40, 253, 254, 255, 256, 290, 229,
2294  230, 291, 292, 293, 294, 49, 39, 40, 86, 50,
2295  59, 60, 67, 149, 124, 125, 126, 118, 136, 184,
2296  185, 68, 186, 187, 154, 49, 220, 221, 159, 155,
2297  208, 49, 214, 160, 244, 209, 244, 215, 244, 245,
2298  69, 246, 277, 247, 312, 49, 74, 278, 81, 313,
2299  1, 2, 3, 82, 85, 90, 91, 124, 125, 126,
2300  92, 94, 136, 93, 178, 95, 96, 188, 189, 190,
2301  97, 108, 98, 99, 100, 102, 103, 101, 105, 236,
2302  106, 162, 107, 10, 110, 111, 112, 116, 113, 117,
2303  114, 163, 142, 146, 167, 168, 169, 170, 172, 173,
2304  174, 241, 202, 200, 198, 201, 203, 204, 205, 212,
2305  216, 231, 232, 234, 235, 237, 248, 188, 189, 190,
2306  240, 251, 267, 268, 270, 285, 286, 287, 288, 250,
2307  308, 252, 279, 303, 309, 304, 310, 280, 314, 318,
2308  104, 305, 257, 258, 259, 249, 119, 183, 233, 175,
2309  269, 171, 266, 289, 197, 238, 306, 302, 319, 0,
2310  0, 315, 0, 0, 0, 316, 317, 320, 0, 0,
2311  0, 0, 321, 0, 0, 0, 0, 0, 0, 0,
2312  257, 258, 259
2313  };
2314 
2315  const short
2316  AgentParser::yycheck_[] =
2317  {
2318  27, 27, 27, 94, 0, 5, 24, 7, 7, 9,
2319  11, 12, 13, 14, 15, 37, 38, 3, 30, 31,
2320  32, 52, 8, 7, 25, 26, 27, 28, 29, 10,
2321  52, 3, 37, 38, 6, 36, 13, 14, 39, 16,
2322  52, 18, 19, 20, 3, 3, 6, 6, 66, 67,
2323  8, 52, 52, 53, 54, 55, 13, 14, 3, 86,
2324  86, 86, 13, 14, 21, 22, 23, 24, 42, 204,
2325  205, 45, 46, 47, 48, 52, 13, 14, 3, 106,
2326  106, 106, 4, 8, 111, 111, 111, 105, 115, 40,
2327  41, 8, 43, 44, 3, 52, 33, 34, 3, 8,
2328  3, 52, 3, 8, 3, 8, 3, 8, 3, 8,
2329  3, 8, 3, 8, 3, 52, 4, 8, 4, 8,
2330  49, 50, 51, 4, 4, 52, 4, 154, 154, 154,
2331  4, 4, 159, 53, 161, 4, 4, 164, 164, 164,
2332  4, 232, 4, 4, 55, 4, 4, 7, 4, 53,
2333  7, 6, 52, 7, 52, 7, 52, 5, 52, 5,
2334  52, 3, 7, 7, 4, 4, 4, 4, 4, 4,
2335  4, 3, 5, 52, 17, 52, 7, 7, 7, 4,
2336  7, 4, 4, 4, 4, 4, 52, 214, 214, 214,
2337  6, 5, 4, 4, 7, 4, 4, 4, 4, 52,
2338  4, 52, 52, 52, 4, 52, 4, 35, 4, 4,
2339  86, 52, 239, 239, 239, 232, 106, 163, 208, 159,
2340  244, 154, 241, 277, 165, 214, 52, 283, 312, -1,
2341  -1, 55, -1, -1, -1, 53, 53, 52, -1, -1,
2342  -1, -1, 52, -1, -1, -1, -1, -1, -1, -1,
2343  277, 277, 277
2344  };
2345 
2346  const unsigned char
2347  AgentParser::yystos_[] =
2348  {
2349  0, 49, 50, 51, 57, 58, 59, 60, 0, 5,
2350  7, 9, 52, 53, 54, 55, 63, 64, 65, 70,
2351  7, 75, 7, 61, 71, 66, 76, 62, 64, 72,
2352  73, 52, 68, 69, 10, 77, 79, 11, 12, 13,
2353  14, 15, 25, 26, 27, 28, 29, 36, 39, 52,
2354  74, 80, 81, 82, 84, 85, 87, 89, 91, 92,
2355  94, 96, 108, 125, 152, 6, 3, 4, 8, 3,
2356  78, 3, 8, 83, 4, 93, 95, 126, 86, 88,
2357  90, 4, 4, 97, 153, 4, 3, 8, 64, 64,
2358  52, 4, 4, 53, 4, 4, 4, 4, 4, 4,
2359  55, 7, 4, 4, 81, 4, 7, 52, 65, 67,
2360  52, 7, 52, 52, 52, 109, 5, 5, 64, 80,
2361  16, 18, 19, 20, 74, 92, 94, 127, 128, 129,
2362  132, 134, 136, 30, 31, 32, 74, 110, 111, 112,
2363  114, 116, 7, 98, 99, 100, 7, 154, 155, 8,
2364  130, 133, 135, 137, 3, 8, 113, 115, 117, 3,
2365  8, 101, 6, 3, 156, 3, 6, 4, 4, 4,
2366  4, 128, 4, 4, 4, 111, 37, 38, 74, 102,
2367  103, 104, 106, 100, 40, 41, 43, 44, 74, 92,
2368  94, 157, 158, 159, 161, 162, 164, 155, 17, 131,
2369  52, 52, 5, 7, 7, 7, 105, 107, 3, 8,
2370  160, 165, 4, 163, 3, 8, 7, 138, 139, 140,
2371  33, 34, 74, 92, 94, 118, 119, 120, 122, 118,
2372  118, 4, 4, 103, 4, 4, 53, 4, 158, 141,
2373  6, 3, 121, 123, 3, 8, 8, 8, 52, 67,
2374  52, 5, 52, 21, 22, 23, 24, 74, 92, 94,
2375  142, 143, 144, 146, 148, 150, 140, 4, 4, 119,
2376  7, 166, 167, 145, 147, 149, 151, 3, 8, 52,
2377  35, 124, 168, 3, 6, 4, 4, 4, 4, 143,
2378  42, 45, 46, 47, 48, 169, 170, 171, 173, 174,
2379  175, 176, 167, 52, 52, 52, 52, 172, 4, 4,
2380  4, 177, 3, 8, 4, 55, 53, 53, 4, 170,
2381  52, 52
2382  };
2383 
2384  const unsigned char
2385  AgentParser::yyr1_[] =
2386  {
2387  0, 56, 58, 57, 59, 57, 60, 57, 62, 61,
2388  63, 64, 64, 64, 64, 64, 64, 64, 66, 65,
2389  67, 68, 68, 69, 69, 69, 71, 70, 72, 72,
2390  73, 73, 73, 74, 76, 75, 78, 77, 77, 79,
2391  80, 80, 80, 81, 81, 81, 81, 81, 81, 81,
2392  81, 81, 81, 81, 81, 81, 83, 82, 84, 86,
2393  85, 88, 87, 90, 89, 91, 93, 92, 95, 94,
2394  97, 96, 98, 98, 99, 99, 99, 101, 100, 102,
2395  102, 102, 102, 103, 103, 105, 104, 107, 106, 109,
2396  108, 110, 110, 110, 111, 111, 111, 111, 113, 112,
2397  115, 114, 117, 116, 118, 118, 118, 119, 119, 119,
2398  119, 119, 121, 120, 123, 122, 124, 126, 125, 127,
2399  127, 127, 128, 128, 128, 128, 128, 128, 128, 130,
2400  129, 131, 133, 132, 135, 134, 137, 136, 138, 138,
2401  139, 139, 139, 141, 140, 142, 142, 142, 143, 143,
2402  143, 143, 143, 143, 143, 145, 144, 147, 146, 149,
2403  148, 151, 150, 153, 152, 154, 154, 154, 156, 155,
2404  157, 157, 157, 158, 158, 158, 158, 158, 158, 158,
2405  160, 159, 161, 163, 162, 165, 164, 166, 166, 166,
2406  168, 167, 169, 169, 169, 170, 170, 170, 170, 170,
2407  172, 171, 173, 174, 175, 177, 176
2408  };
2409 
2410  const signed char
2411  AgentParser::yyr2_[] =
2412  {
2413  0, 2, 0, 3, 0, 3, 0, 3, 0, 4,
2414  1, 1, 1, 1, 1, 1, 1, 1, 0, 4,
2415  1, 0, 1, 3, 5, 2, 0, 4, 0, 1,
2416  1, 3, 2, 2, 0, 4, 0, 6, 1, 2,
2417  1, 3, 2, 1, 1, 1, 1, 1, 1, 1,
2418  1, 1, 1, 1, 1, 1, 0, 4, 3, 0,
2419  4, 0, 4, 0, 4, 3, 0, 4, 0, 4,
2420  0, 6, 0, 1, 1, 3, 2, 0, 4, 1,
2421  3, 2, 1, 1, 1, 0, 4, 0, 4, 0,
2422  6, 1, 3, 2, 1, 1, 1, 1, 0, 6,
2423  0, 6, 0, 6, 1, 3, 2, 1, 1, 1,
2424  1, 1, 0, 4, 0, 4, 1, 0, 6, 1,
2425  3, 2, 1, 1, 1, 1, 1, 1, 1, 0,
2426  4, 1, 0, 4, 0, 4, 0, 6, 0, 1,
2427  1, 3, 2, 0, 4, 1, 3, 2, 1, 1,
2428  1, 1, 1, 1, 1, 0, 4, 0, 4, 0,
2429  4, 0, 4, 0, 6, 1, 3, 2, 0, 4,
2430  1, 3, 2, 1, 1, 1, 1, 1, 1, 1,
2431  0, 4, 3, 0, 4, 0, 6, 1, 3, 2,
2432  0, 4, 1, 3, 2, 1, 1, 1, 1, 1,
2433  0, 4, 3, 3, 3, 0, 4
2434  };
2435 
2436 
2437 #if AGENT_DEBUG || 1
2438  // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2439  // First, the terminals, then, starting at \a YYNTOKENS, nonterminals.
2440  const char*
2441  const AgentParser::yytname_[] =
2442  {
2443  "\"end of file\"", "error", "\"invalid token\"", "\",\"", "\":\"",
2444  "\"[\"", "\"]\"", "\"{\"", "\"}\"", "\"null\"", "\"Control-agent\"",
2445  "\"http-host\"", "\"http-port\"", "\"user-context\"", "\"comment\"",
2446  "\"authentication\"", "\"type\"", "\"basic\"", "\"realm\"",
2447  "\"directory\"", "\"clients\"", "\"user\"", "\"user-file\"",
2448  "\"password\"", "\"password-file\"", "\"trust-anchor\"", "\"cert-file\"",
2449  "\"key-file\"", "\"cert-required\"", "\"control-sockets\"", "\"dhcp4\"",
2450  "\"dhcp6\"", "\"d2\"", "\"socket-name\"", "\"socket-type\"", "\"unix\"",
2451  "\"hooks-libraries\"", "\"library\"", "\"parameters\"", "\"loggers\"",
2452  "\"name\"", "\"output_options\"", "\"output\"", "\"debuglevel\"",
2453  "\"severity\"", "\"flush\"", "\"maxsize\"", "\"maxver\"", "\"pattern\"",
2454  "START_JSON", "START_AGENT", "START_SUB_AGENT", "\"constant string\"",
2455  "\"integer\"", "\"floating point\"", "\"boolean\"", "$accept", "start",
2456  "$@1", "$@2", "$@3", "sub_agent", "$@4", "json", "value", "map", "$@5",
2457  "map_value", "map_content", "not_empty_map", "list_generic", "$@6",
2458  "list_content", "not_empty_list", "unknown_map_entry",
2459  "agent_syntax_map", "$@7", "global_object", "$@8", "global_object_comma",
2460  "global_params", "global_param", "http_host", "$@9", "http_port",
2461  "trust_anchor", "$@10", "cert_file", "$@11", "key_file", "$@12",
2462  "cert_required", "user_context", "$@13", "comment", "$@14",
2463  "hooks_libraries", "$@15", "hooks_libraries_list",
2464  "not_empty_hooks_libraries_list", "hooks_library", "$@16",
2465  "hooks_params", "hooks_param", "library", "$@17", "parameters", "$@18",
2466  "control_sockets", "$@19", "control_sockets_params", "control_socket",
2467  "dhcp4_server_socket", "$@20", "dhcp6_server_socket", "$@21",
2468  "d2_server_socket", "$@22", "control_socket_params",
2469  "control_socket_param", "socket_name", "$@23", "socket_type", "$@24",
2470  "socket_type_value", "authentication", "$@25", "auth_params",
2471  "auth_param", "auth_type", "$@26", "auth_type_value", "realm", "$@27",
2472  "directory", "$@28", "clients", "$@29", "clients_list",
2473  "not_empty_clients_list", "basic_auth", "$@30", "clients_params",
2474  "clients_param", "user", "$@31", "user_file", "$@32", "password", "$@33",
2475  "password_file", "$@34", "loggers", "$@35", "loggers_entries",
2476  "logger_entry", "$@36", "logger_params", "logger_param", "name", "$@37",
2477  "debuglevel", "severity", "$@38", "output_options_list", "$@39",
2478  "output_options_list_content", "output_entry", "$@40",
2479  "output_params_list", "output_params", "output", "$@41", "flush",
2480  "maxsize", "maxver", "pattern", "$@42", YY_NULLPTR
2481  };
2482 #endif
2483 
2484 
2485 #if AGENT_DEBUG
2486  const short
2487  AgentParser::yyrline_[] =
2488  {
2489  0, 127, 127, 127, 128, 128, 129, 129, 137, 137,
2490  148, 154, 155, 156, 157, 158, 159, 160, 164, 164,
2491  175, 180, 181, 189, 194, 200, 205, 205, 211, 212,
2492  215, 219, 223, 235, 243, 243, 255, 255, 271, 274,
2493  278, 279, 280, 287, 288, 289, 290, 291, 292, 293,
2494  294, 295, 296, 297, 298, 299, 302, 302, 311, 317,
2495  317, 326, 326, 335, 335, 344, 350, 350, 375, 375,
2496  403, 403, 414, 415, 418, 419, 420, 425, 425, 433,
2497  434, 435, 438, 441, 442, 445, 445, 454, 454, 465,
2498  465, 479, 480, 481, 488, 489, 490, 491, 495, 495,
2499  507, 507, 519, 519, 531, 532, 533, 539, 540, 541,
2500  542, 543, 547, 547, 557, 557, 566, 573, 573, 586,
2501  587, 588, 593, 594, 595, 596, 597, 598, 599, 602,
2502  602, 610, 613, 613, 622, 622, 631, 631, 642, 643,
2503  646, 647, 648, 653, 653, 661, 662, 663, 668, 669,
2504  670, 671, 672, 673, 674, 677, 677, 686, 686, 695,
2505  695, 704, 704, 717, 717, 730, 731, 732, 738, 738,
2506  746, 747, 748, 753, 754, 755, 756, 757, 758, 759,
2507  762, 762, 771, 777, 777, 786, 786, 797, 798, 799,
2508  804, 804, 812, 813, 814, 819, 820, 821, 822, 823,
2509  826, 826, 835, 841, 847, 853, 853
2510  };
2511 
2512  void
2513  AgentParser::yy_stack_print_ () const
2514  {
2515  *yycdebug_ << "Stack now";
2516  for (stack_type::const_iterator
2517  i = yystack_.begin (),
2518  i_end = yystack_.end ();
2519  i != i_end; ++i)
2520  *yycdebug_ << ' ' << int (i->state);
2521  *yycdebug_ << '\n';
2522  }
2523 
2524  void
2525  AgentParser::yy_reduce_print_ (int yyrule) const
2526  {
2527  int yylno = yyrline_[yyrule];
2528  int yynrhs = yyr2_[yyrule];
2529  // Print the symbols being reduced, and their result.
2530  *yycdebug_ << "Reducing stack by rule " << yyrule - 1
2531  << " (line " << yylno << "):\n";
2532  // The symbols being reduced.
2533  for (int yyi = 0; yyi < yynrhs; yyi++)
2534  YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
2535  yystack_[(yynrhs) - (yyi + 1)]);
2536  }
2537 #endif // AGENT_DEBUG
2538 
2539 
2540 #line 14 "agent_parser.yy"
2541 } } // isc::agent
2542 #line 2543 "agent_parser.cc"
2543 
2544 #line 862 "agent_parser.yy"
2545 
2546 
2547 void
2549  const std::string& what)
2550 {
2551  ctx.error(loc, what);
2552 }
void move(basic_symbol &s)
Destructive move, s is emptied into this.
Used while parsing Control-agent/Authentication/type.
Used while parsing content of Agent.
void unique(const std::string &name, isc::data::Element::Position loc)
Check if a parameter is already present.
#define YYCDEBUG
void enter(const LexerContext &ctx)
Enter a new syntactic context.
#define YY_CAST(Type, Val)
Definition: agent_parser.h:177
LexerContext ctx_
Current syntactic context.
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
void warnAboutExtraCommas(const isc::agent::location &loc)
Warning for extra commas.
#define YY_REDUCE_PRINT(Rule)
Used while parsing Control-agent/control-socket/*-server/socket-type.
#define YY_MOVE_REF(Type)
Definition: agent_parser.h:84
#define YY_SYMBOL_PRINT(Title, Symbol)
boost::shared_ptr< Element > ElementPtr
Definition: data.h:24
Syntax errors thrown from user actions.
Definition: agent_parser.h:470
#define YY_RVREF(Type)
Definition: agent_parser.h:85
std::vector< isc::data::ElementPtr > stack_
JSON elements being parsed.
#define YY_MOVE
Definition: agent_parser.h:82
value_type value
The semantic value.
Definition: agent_parser.h:967
Used while parsing Control-agent/loggers structures.
#define YYACCEPT
void require(const std::string &name, isc::data::Element::Position open_loc, isc::data::Element::Position close_loc)
Check if a required parameter is present.
#define YYCASE_(N, S)
#define YY_(msgid)
Definition: agent_parser.cc:62
std::string name() const YY_NOEXCEPT
The user-facing name of this symbol.
Definition: agent_parser.h:952
location_type location
The location.
Definition: agent_parser.h:970
isc::data::Element::Position loc2pos(isc::agent::location &loc)
Converts bison&#39;s position to one understandable by isc::data::Element.
Notes: IntElement type is changed to int64_t.
Definition: data.h:590
const std::string contextName()
Get the syntactic context name.
symbol_kind_type kind() const YY_NOEXCEPT
The (internal) type number (corresponding to type).
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
debug_level_type debug_level() const YY_ATTRIBUTE_PURE
The current debugging level.
void set_debug_level(debug_level_type l)
Set the current debugging level.
void leave()
Leave a syntactic context.
symbol_kind_type kind_
The symbol kind.
static const symbol_kind_type YYNTOKENS
The number of tokens.
Definition: agent_parser.h:752
Used while parsing Control-agent/loggers/output_options structures.
#define YYERROR
virtual int parse()
Parse.
#define YYLLOC_DEFAULT(Current, Rhs, N)
Definition: agent_parser.cc:82
This one is used in pure JSON mode.
#define YY_NOTHROW
Definition: agent_parser.h:95
std::ostream & debug_stream() const YY_ATTRIBUTE_PURE
The current debugging stream.
Defines the logger used by the top-level component of kea-lfc.
void set_debug_stream(std::ostream &)
Set the current debugging stream.
#define YYABORT
static std::string symbol_name(symbol_kind_type yysymbol)
The user-facing name of the symbol whose (internal) number is YYSYMBOL.
~syntax_error() YY_NOEXCEPT YY_NOTHROW
const symbol_type & lookahead() const YY_NOEXCEPT
void merge(ElementPtr element, ConstElementPtr other)
Merges the data from other into element.
Definition: data.cc:1139
#define YY_USE(E)
Definition: agent_parser.h:130
Define the isc::agent::parser class.
void clear() YY_NOEXCEPT
Destroy contents, and record that is empty.
Definition: agent_parser.h:906
int debug_level_type
Type for debugging levels.
Used while parsing Control-agent/hooks-libraries.
#define YY_NOEXCEPT
Definition: agent_parser.h:94
location location_type
Symbol locations.
Definition: agent_parser.h:467
#define YY_STACK_PRINT()
#define yylex
Definition: agent_parser.cc:39
"External" symbols: returned by the scanner.
bool empty() const YY_NOEXCEPT
Whether empty.
Used while parsing Control-agent/control-sockets.
Used while parsing Control-agent/Authentication.
int expected_tokens(symbol_kind_type yyarg[], int yyargn) const
Put in YYARG at most YYARGN of the expected tokens, and return the number of tokens stored in YYARG...
A Bison parser.
Definition: agent_parser.h:214
AgentParser(isc::agent::ParserContext &ctx_yyarg)
Build a parser object.
Used while parsing Control-agent/Authentication/clients.
Parser context is a wrapper around flex/bison instances dedicated to Control-agent config file parser...
context(const AgentParser &yyparser, const symbol_type &yyla)
Used while parsing Control-agent/control-socket/*-server.
symbol_kind_type token() const YY_NOEXCEPT