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