Kea: agent_parser.cc Source File

| Kea 3.0.3-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// 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"
148 namespace isc { namespace agent {
149#line 150 "agent_parser.cc"
150
152 AgentParser::AgentParser (isc::agent::ParserContext& ctx_yyarg)
153#if AGENT_DEBUG
154 : yydebug_ (false),
155 yycdebug_ (&std::cerr),
156#else
157 :
158#endif
159 ctx (ctx_yyarg)
160 {}
161
162 AgentParser::~AgentParser ()
163 {}
164
165 AgentParser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
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
200 AgentParser::symbol_kind_type
201 AgentParser::by_state::kind () const YY_NOEXCEPT
202 {
203 if (state == empty_state)
204 return symbol_kind::S_YYEMPTY;
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 124 "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 124 "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 124 "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 124 "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 124 "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 124 "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 124 "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 124 "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
520 AgentParser::operator() ()
521 {
522 return parse ();
523 }
524
525 int
526 AgentParser::parse ()
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';
564 YY_STACK_PRINT ();
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. */
610 yyla.kind_ = symbol_kind::S_YYUNDEF;
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 135 "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 136 "agent_parser.yy"
715 { ctx.ctx_ = ctx.CONFIG; }
716#line 717 "agent_parser.cc"
717 break;
718
719 case 6: // $@3: %empty
720#line 137 "agent_parser.yy"
721 { ctx.ctx_ = ctx.AGENT; }
722#line 723 "agent_parser.cc"
723 break;
724
725 case 8: // $@4: %empty
726#line 145 "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 149 "agent_parser.yy"
737 {
738 // parsing completed
739}
740#line 741 "agent_parser.cc"
741 break;
742
743 case 10: // json: value
744#line 156 "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 162 "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 163 "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 164 "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 165 "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 166 "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 167 "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 168 "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 172 "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 177 "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 183 "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 197 "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 202 "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 208 "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 213 "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 216 "agent_parser.yy"
861 {
862}
863#line 864 "agent_parser.cc"
864 break;
865
866 case 30: // not_empty_list: value
867#line 223 "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 227 "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 231 "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 243 "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 251 "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 256 "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 263 "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 273 "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 282 "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 288 "agent_parser.yy"
961 {
962 ctx.warnAboutExtraCommas(yystack_[0].location);
963 }
964#line 965 "agent_parser.cc"
965 break;
966
967 case 57: // $@9: %empty
968#line 311 "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 58: // http_host: "http-host" $@9 ":" "constant string"
977#line 314 "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 59: // http_port: "http-port" ":" "integer"
987#line 320 "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 60: // $@10: %empty
997#line 326 "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 61: // trust_anchor: "trust-anchor" $@10 ":" "constant string"
1006#line 329 "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 62: // $@11: %empty
1016#line 335 "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 63: // cert_file: "cert-file" $@11 ":" "constant string"
1025#line 338 "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 64: // $@12: %empty
1035#line 344 "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 65: // key_file: "key-file" $@12 ":" "constant string"
1044#line 347 "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 66: // cert_required: "cert-required" ":" "boolean"
1054#line 353 "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 67: // $@13: %empty
1064#line 359 "agent_parser.yy"
1065 {
1066 ctx.enter(ctx.NO_KEYWORDS);
1067}
1068#line 1069 "agent_parser.cc"
1069 break;
1070
1071 case 68: // user_context: "user-context" $@13 ":" map_value
1072#line 361 "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 69: // $@14: %empty
1099#line 384 "agent_parser.yy"
1100 {
1101 ctx.enter(ctx.NO_KEYWORDS);
1102}
1103#line 1104 "agent_parser.cc"
1104 break;
1105
1106 case 70: // comment: "comment" $@14 ":" "constant string"
1107#line 386 "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 71: // $@15: %empty
1136#line 411 "agent_parser.yy"
1137 {
1138 ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location));
1139 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1140 ctx.stack_.back()->set("http-headers", l);
1141 ctx.stack_.push_back(l);
1142 ctx.enter(ctx.HTTP_HEADERS);
1143}
1144#line 1145 "agent_parser.cc"
1145 break;
1146
1147 case 72: // http_headers: "http-headers" $@15 ":" "[" http_header_list "]"
1148#line 417 "agent_parser.yy"
1149 {
1150 ctx.stack_.pop_back();
1151 ctx.leave();
1152}
1153#line 1154 "agent_parser.cc"
1154 break;
1155
1156 case 77: // not_empty_http_header_list: not_empty_http_header_list ","
1157#line 428 "agent_parser.yy"
1158 {
1159 ctx.warnAboutExtraCommas(yystack_[0].location);
1160 }
1161#line 1162 "agent_parser.cc"
1162 break;
1163
1164 case 78: // $@16: %empty
1165#line 433 "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 79: // http_header: "{" $@16 http_header_params "}"
1175#line 437 "agent_parser.yy"
1176 {
1177 ctx.stack_.pop_back();
1178}
1179#line 1180 "agent_parser.cc"
1180 break;
1181
1182 case 82: // http_header_params: http_header_params ","
1183#line 443 "agent_parser.yy"
1184 {
1185 ctx.warnAboutExtraCommas(yystack_[0].location);
1186 }
1187#line 1188 "agent_parser.cc"
1188 break;
1189
1190 case 88: // $@17: %empty
1191#line 455 "agent_parser.yy"
1192 {
1193 ctx.unique("name", ctx.loc2pos(yystack_[0].location));
1194 ctx.enter(ctx.NO_KEYWORDS);
1195}
1196#line 1197 "agent_parser.cc"
1197 break;
1198
1199 case 89: // name: "name" $@17 ":" "constant string"
1200#line 458 "agent_parser.yy"
1201 {
1202 ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1203 ctx.stack_.back()->set("name", name);
1204 ctx.leave();
1205}
1206#line 1207 "agent_parser.cc"
1207 break;
1208
1209 case 90: // $@18: %empty
1210#line 464 "agent_parser.yy"
1211 {
1212 ctx.unique("value", ctx.loc2pos(yystack_[0].location));
1213 ctx.enter(ctx.NO_KEYWORDS);
1214}
1215#line 1216 "agent_parser.cc"
1216 break;
1217
1218 case 91: // header_value: "value" $@18 ":" "constant string"
1219#line 467 "agent_parser.yy"
1220 {
1221 ElementPtr value(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1222 ctx.stack_.back()->set("value", value);
1223 ctx.leave();
1224}
1225#line 1226 "agent_parser.cc"
1226 break;
1227
1228 case 92: // $@19: %empty
1229#line 474 "agent_parser.yy"
1230 {
1231 ctx.unique("hooks-libraries", ctx.loc2pos(yystack_[0].location));
1232 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1233 ctx.stack_.back()->set("hooks-libraries", l);
1234 ctx.stack_.push_back(l);
1235 ctx.enter(ctx.HOOKS_LIBRARIES);
1236}
1237#line 1238 "agent_parser.cc"
1238 break;
1239
1240 case 93: // hooks_libraries: "hooks-libraries" $@19 ":" "[" hooks_libraries_list "]"
1241#line 480 "agent_parser.yy"
1242 {
1243 ctx.stack_.pop_back();
1244 ctx.leave();
1245}
1246#line 1247 "agent_parser.cc"
1247 break;
1248
1249 case 98: // not_empty_hooks_libraries_list: not_empty_hooks_libraries_list ","
1250#line 491 "agent_parser.yy"
1251 {
1252 ctx.warnAboutExtraCommas(yystack_[0].location);
1253 }
1254#line 1255 "agent_parser.cc"
1255 break;
1256
1257 case 99: // $@20: %empty
1258#line 496 "agent_parser.yy"
1259 {
1260 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1261 ctx.stack_.back()->add(m);
1262 ctx.stack_.push_back(m);
1263}
1264#line 1265 "agent_parser.cc"
1265 break;
1266
1267 case 100: // hooks_library: "{" $@20 hooks_params "}"
1268#line 500 "agent_parser.yy"
1269 {
1270 ctx.stack_.pop_back();
1271}
1272#line 1273 "agent_parser.cc"
1273 break;
1274
1275 case 103: // hooks_params: hooks_params ","
1276#line 506 "agent_parser.yy"
1277 {
1278 ctx.warnAboutExtraCommas(yystack_[0].location);
1279 }
1280#line 1281 "agent_parser.cc"
1281 break;
1282
1283 case 107: // $@21: %empty
1284#line 516 "agent_parser.yy"
1285 {
1286 ctx.unique("library", ctx.loc2pos(yystack_[0].location));
1287 ctx.enter(ctx.NO_KEYWORDS);
1288}
1289#line 1290 "agent_parser.cc"
1290 break;
1291
1292 case 108: // library: "library" $@21 ":" "constant string"
1293#line 519 "agent_parser.yy"
1294 {
1295 ElementPtr lib(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1296 ctx.stack_.back()->set("library", lib);
1297 ctx.leave();
1298}
1299#line 1300 "agent_parser.cc"
1300 break;
1301
1302 case 109: // $@22: %empty
1303#line 525 "agent_parser.yy"
1304 {
1305 ctx.unique("parameters", ctx.loc2pos(yystack_[0].location));
1306 ctx.enter(ctx.NO_KEYWORDS);
1307}
1308#line 1309 "agent_parser.cc"
1309 break;
1310
1311 case 110: // parameters: "parameters" $@22 ":" map_value
1312#line 528 "agent_parser.yy"
1313 {
1314 ctx.stack_.back()->set("parameters", yystack_[0].value.as < ElementPtr > ());
1315 ctx.leave();
1316}
1317#line 1318 "agent_parser.cc"
1318 break;
1319
1320 case 111: // $@23: %empty
1321#line 536 "agent_parser.yy"
1322 {
1323 ctx.unique("control-sockets", ctx.loc2pos(yystack_[2].location));
1324 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[2].location)));
1325 ctx.stack_.back()->set("control-sockets", m);
1326 ctx.stack_.push_back(m);
1327 ctx.enter(ctx.CONTROL_SOCKETS);
1328}
1329#line 1330 "agent_parser.cc"
1330 break;
1331
1332 case 112: // control_sockets: "control-sockets" ":" "{" $@23 control_sockets_params "}"
1333#line 542 "agent_parser.yy"
1334 {
1335 ctx.stack_.pop_back();
1336 ctx.leave();
1337}
1338#line 1339 "agent_parser.cc"
1339 break;
1340
1341 case 115: // control_sockets_params: control_sockets_params ","
1342#line 552 "agent_parser.yy"
1343 {
1344 ctx.warnAboutExtraCommas(yystack_[0].location);
1345 }
1346#line 1347 "agent_parser.cc"
1347 break;
1348
1349 case 120: // $@24: %empty
1350#line 566 "agent_parser.yy"
1351 {
1352 ctx.unique("dhcp4", ctx.loc2pos(yystack_[0].location));
1353 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1354 ctx.stack_.back()->set("dhcp4", m);
1355 ctx.stack_.push_back(m);
1356 ctx.enter(ctx.SERVER);
1357}
1358#line 1359 "agent_parser.cc"
1359 break;
1360
1361 case 121: // dhcp4_server_socket: "dhcp4" $@24 ":" "{" control_socket_params "}"
1362#line 572 "agent_parser.yy"
1363 {
1364 ctx.stack_.pop_back();
1365 ctx.leave();
1366}
1367#line 1368 "agent_parser.cc"
1368 break;
1369
1370 case 122: // $@25: %empty
1371#line 578 "agent_parser.yy"
1372 {
1373 ctx.unique("dhcp6", ctx.loc2pos(yystack_[0].location));
1374 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1375 ctx.stack_.back()->set("dhcp6", m);
1376 ctx.stack_.push_back(m);
1377 ctx.enter(ctx.SERVER);
1378}
1379#line 1380 "agent_parser.cc"
1380 break;
1381
1382 case 123: // dhcp6_server_socket: "dhcp6" $@25 ":" "{" control_socket_params "}"
1383#line 584 "agent_parser.yy"
1384 {
1385 ctx.stack_.pop_back();
1386 ctx.leave();
1387}
1388#line 1389 "agent_parser.cc"
1389 break;
1390
1391 case 124: // $@26: %empty
1392#line 590 "agent_parser.yy"
1393 {
1394 ctx.unique("d2", ctx.loc2pos(yystack_[0].location));
1395 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1396 ctx.stack_.back()->set("d2", m);
1397 ctx.stack_.push_back(m);
1398 ctx.enter(ctx.SERVER);
1399}
1400#line 1401 "agent_parser.cc"
1401 break;
1402
1403 case 125: // d2_server_socket: "d2" $@26 ":" "{" control_socket_params "}"
1404#line 596 "agent_parser.yy"
1405 {
1406 ctx.stack_.pop_back();
1407 ctx.leave();
1408}
1409#line 1410 "agent_parser.cc"
1410 break;
1411
1412 case 128: // control_socket_params: control_socket_params ","
1413#line 604 "agent_parser.yy"
1414 {
1415 ctx.warnAboutExtraCommas(yystack_[0].location);
1416 }
1417#line 1418 "agent_parser.cc"
1418 break;
1419
1420 case 134: // $@27: %empty
1421#line 618 "agent_parser.yy"
1422 {
1423 ctx.unique("socket-name", ctx.loc2pos(yystack_[0].location));
1424 ctx.enter(ctx.NO_KEYWORDS);
1425}
1426#line 1427 "agent_parser.cc"
1427 break;
1428
1429 case 135: // socket_name: "socket-name" $@27 ":" "constant string"
1430#line 621 "agent_parser.yy"
1431 {
1432 ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1433 ctx.stack_.back()->set("socket-name", name);
1434 ctx.leave();
1435}
1436#line 1437 "agent_parser.cc"
1437 break;
1438
1439 case 136: // $@28: %empty
1440#line 628 "agent_parser.yy"
1441 {
1442 ctx.unique("socket-type", ctx.loc2pos(yystack_[0].location));
1443 ctx.enter(ctx.SOCKET_TYPE);
1444}
1445#line 1446 "agent_parser.cc"
1446 break;
1447
1448 case 137: // socket_type: "socket-type" $@28 ":" socket_type_value
1449#line 631 "agent_parser.yy"
1450 {
1451 ctx.stack_.back()->set("socket-type", yystack_[0].value.as < ElementPtr > ());
1452 ctx.leave();
1453}
1454#line 1455 "agent_parser.cc"
1455 break;
1456
1457 case 138: // socket_type_value: "unix"
1458#line 637 "agent_parser.yy"
1459 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("unix", ctx.loc2pos(yystack_[0].location))); }
1460#line 1461 "agent_parser.cc"
1461 break;
1462
1463 case 139: // $@29: %empty
1464#line 644 "agent_parser.yy"
1465 {
1466 ctx.unique("authentication", ctx.loc2pos(yystack_[0].location));
1467 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1468 ctx.stack_.back()->set("authentication", m);
1469 ctx.stack_.push_back(m);
1470 ctx.enter(ctx.AUTHENTICATION);
1471}
1472#line 1473 "agent_parser.cc"
1473 break;
1474
1475 case 140: // authentication: "authentication" $@29 ":" "{" auth_params "}"
1476#line 650 "agent_parser.yy"
1477 {
1478 // The type parameter is required
1479 ctx.require("type", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
1480 ctx.stack_.pop_back();
1481 ctx.leave();
1482}
1483#line 1484 "agent_parser.cc"
1484 break;
1485
1486 case 143: // auth_params: auth_params ","
1487#line 659 "agent_parser.yy"
1488 {
1489 ctx.warnAboutExtraCommas(yystack_[0].location);
1490 }
1491#line 1492 "agent_parser.cc"
1492 break;
1493
1494 case 151: // $@30: %empty
1495#line 673 "agent_parser.yy"
1496 {
1497 ctx.unique("type", ctx.loc2pos(yystack_[0].location));
1498 ctx.enter(ctx.AUTH_TYPE);
1499}
1500#line 1501 "agent_parser.cc"
1501 break;
1502
1503 case 152: // auth_type: "type" $@30 ":" auth_type_value
1504#line 676 "agent_parser.yy"
1505 {
1506 ctx.stack_.back()->set("type", yystack_[0].value.as < ElementPtr > ());
1507 ctx.leave();
1508}
1509#line 1510 "agent_parser.cc"
1510 break;
1511
1512 case 153: // auth_type_value: "basic"
1513#line 681 "agent_parser.yy"
1514 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("basic", ctx.loc2pos(yystack_[0].location))); }
1515#line 1516 "agent_parser.cc"
1516 break;
1517
1518 case 154: // $@31: %empty
1519#line 684 "agent_parser.yy"
1520 {
1521 ctx.unique("realm", ctx.loc2pos(yystack_[0].location));
1522 ctx.enter(ctx.NO_KEYWORDS);
1523}
1524#line 1525 "agent_parser.cc"
1525 break;
1526
1527 case 155: // realm: "realm" $@31 ":" "constant string"
1528#line 687 "agent_parser.yy"
1529 {
1530 ElementPtr realm(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1531 ctx.stack_.back()->set("realm", realm);
1532 ctx.leave();
1533}
1534#line 1535 "agent_parser.cc"
1535 break;
1536
1537 case 156: // $@32: %empty
1538#line 693 "agent_parser.yy"
1539 {
1540 ctx.unique("directory", ctx.loc2pos(yystack_[0].location));
1541 ctx.enter(ctx.NO_KEYWORDS);
1542}
1543#line 1544 "agent_parser.cc"
1544 break;
1545
1546 case 157: // directory: "directory" $@32 ":" "constant string"
1547#line 696 "agent_parser.yy"
1548 {
1549 ElementPtr directory(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1550 ctx.stack_.back()->set("directory", directory);
1551 ctx.leave();
1552}
1553#line 1554 "agent_parser.cc"
1554 break;
1555
1556 case 158: // $@33: %empty
1557#line 702 "agent_parser.yy"
1558 {
1559 ctx.unique("clients", ctx.loc2pos(yystack_[0].location));
1560 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1561 ctx.stack_.back()->set("clients", l);
1562 ctx.stack_.push_back(l);
1563 ctx.enter(ctx.CLIENTS);
1564}
1565#line 1566 "agent_parser.cc"
1566 break;
1567
1568 case 159: // clients: "clients" $@33 ":" "[" clients_list "]"
1569#line 708 "agent_parser.yy"
1570 {
1571 ctx.stack_.pop_back();
1572 ctx.leave();
1573}
1574#line 1575 "agent_parser.cc"
1575 break;
1576
1577 case 164: // not_empty_clients_list: not_empty_clients_list ","
1578#line 719 "agent_parser.yy"
1579 {
1580 ctx.warnAboutExtraCommas(yystack_[0].location);
1581 }
1582#line 1583 "agent_parser.cc"
1583 break;
1584
1585 case 165: // $@34: %empty
1586#line 724 "agent_parser.yy"
1587 {
1588 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1589 ctx.stack_.back()->add(m);
1590 ctx.stack_.push_back(m);
1591}
1592#line 1593 "agent_parser.cc"
1593 break;
1594
1595 case 166: // basic_auth: "{" $@34 clients_params "}"
1596#line 728 "agent_parser.yy"
1597 {
1598 ctx.stack_.pop_back();
1599}
1600#line 1601 "agent_parser.cc"
1601 break;
1602
1603 case 169: // clients_params: clients_params ","
1604#line 734 "agent_parser.yy"
1605 {
1606 ctx.warnAboutExtraCommas(yystack_[0].location);
1607 }
1608#line 1609 "agent_parser.cc"
1609 break;
1610
1611 case 177: // $@35: %empty
1612#line 748 "agent_parser.yy"
1613 {
1614 ctx.unique("user", ctx.loc2pos(yystack_[0].location));
1615 ctx.enter(ctx.NO_KEYWORDS);
1616}
1617#line 1618 "agent_parser.cc"
1618 break;
1619
1620 case 178: // user: "user" $@35 ":" "constant string"
1621#line 751 "agent_parser.yy"
1622 {
1623 ElementPtr user(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1624 ctx.stack_.back()->set("user", user);
1625 ctx.leave();
1626}
1627#line 1628 "agent_parser.cc"
1628 break;
1629
1630 case 179: // $@36: %empty
1631#line 757 "agent_parser.yy"
1632 {
1633 ctx.unique("user-file", ctx.loc2pos(yystack_[0].location));
1634 ctx.enter(ctx.NO_KEYWORDS);
1635}
1636#line 1637 "agent_parser.cc"
1637 break;
1638
1639 case 180: // user_file: "user-file" $@36 ":" "constant string"
1640#line 760 "agent_parser.yy"
1641 {
1642 ElementPtr user(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1643 ctx.stack_.back()->set("user-file", user);
1644 ctx.leave();
1645}
1646#line 1647 "agent_parser.cc"
1647 break;
1648
1649 case 181: // $@37: %empty
1650#line 766 "agent_parser.yy"
1651 {
1652 ctx.unique("password", ctx.loc2pos(yystack_[0].location));
1653 ctx.enter(ctx.NO_KEYWORDS);
1654}
1655#line 1656 "agent_parser.cc"
1656 break;
1657
1658 case 182: // password: "password" $@37 ":" "constant string"
1659#line 769 "agent_parser.yy"
1660 {
1661 ElementPtr password(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1662 ctx.stack_.back()->set("password", password);
1663 ctx.leave();
1664}
1665#line 1666 "agent_parser.cc"
1666 break;
1667
1668 case 183: // $@38: %empty
1669#line 775 "agent_parser.yy"
1670 {
1671 ctx.unique("password-file", ctx.loc2pos(yystack_[0].location));
1672 ctx.enter(ctx.NO_KEYWORDS);
1673}
1674#line 1675 "agent_parser.cc"
1675 break;
1676
1677 case 184: // password_file: "password-file" $@38 ":" "constant string"
1678#line 778 "agent_parser.yy"
1679 {
1680 ElementPtr password(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1681 ctx.stack_.back()->set("password-file", password);
1682 ctx.leave();
1683}
1684#line 1685 "agent_parser.cc"
1685 break;
1686
1687 case 185: // $@39: %empty
1688#line 788 "agent_parser.yy"
1689 {
1690 ctx.unique("loggers", ctx.loc2pos(yystack_[0].location));
1691 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1692 ctx.stack_.back()->set("loggers", l);
1693 ctx.stack_.push_back(l);
1694 ctx.enter(ctx.LOGGERS);
1695}
1696#line 1697 "agent_parser.cc"
1697 break;
1698
1699 case 186: // loggers: "loggers" $@39 ":" "[" loggers_entries "]"
1700#line 794 "agent_parser.yy"
1701 {
1702 ctx.stack_.pop_back();
1703 ctx.leave();
1704}
1705#line 1706 "agent_parser.cc"
1706 break;
1707
1708 case 189: // loggers_entries: loggers_entries ","
1709#line 803 "agent_parser.yy"
1710 {
1711 ctx.warnAboutExtraCommas(yystack_[0].location);
1712 }
1713#line 1714 "agent_parser.cc"
1714 break;
1715
1716 case 190: // $@40: %empty
1717#line 809 "agent_parser.yy"
1718 {
1719 ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
1720 ctx.stack_.back()->add(l);
1721 ctx.stack_.push_back(l);
1722}
1723#line 1724 "agent_parser.cc"
1724 break;
1725
1726 case 191: // logger_entry: "{" $@40 logger_params "}"
1727#line 813 "agent_parser.yy"
1728 {
1729 ctx.stack_.pop_back();
1730}
1731#line 1732 "agent_parser.cc"
1732 break;
1733
1734 case 194: // logger_params: logger_params ","
1735#line 819 "agent_parser.yy"
1736 {
1737 ctx.warnAboutExtraCommas(yystack_[0].location);
1738 }
1739#line 1740 "agent_parser.cc"
1740 break;
1741
1742 case 202: // debuglevel: "debuglevel" ":" "integer"
1743#line 833 "agent_parser.yy"
1744 {
1745 ctx.unique("debuglevel", ctx.loc2pos(yystack_[2].location));
1746 ElementPtr dl(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1747 ctx.stack_.back()->set("debuglevel", dl);
1748}
1749#line 1750 "agent_parser.cc"
1750 break;
1751
1752 case 203: // $@41: %empty
1753#line 839 "agent_parser.yy"
1754 {
1755 ctx.unique("severity", ctx.loc2pos(yystack_[0].location));
1756 ctx.enter(ctx.NO_KEYWORDS);
1757}
1758#line 1759 "agent_parser.cc"
1759 break;
1760
1761 case 204: // severity: "severity" $@41 ":" "constant string"
1762#line 842 "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("severity", sev);
1766 ctx.leave();
1767}
1768#line 1769 "agent_parser.cc"
1769 break;
1770
1771 case 205: // $@42: %empty
1772#line 848 "agent_parser.yy"
1773 {
1774 ctx.unique("output-options", ctx.loc2pos(yystack_[0].location));
1775 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1776 ctx.stack_.back()->set("output-options", l);
1777 ctx.stack_.push_back(l);
1778 ctx.enter(ctx.OUTPUT_OPTIONS);
1779}
1780#line 1781 "agent_parser.cc"
1781 break;
1782
1783 case 206: // output_options_list: "output-options" $@42 ":" "[" output_options_list_content "]"
1784#line 854 "agent_parser.yy"
1785 {
1786 ctx.stack_.pop_back();
1787 ctx.leave();
1788}
1789#line 1790 "agent_parser.cc"
1790 break;
1791
1792 case 209: // output_options_list_content: output_options_list_content ","
1793#line 861 "agent_parser.yy"
1794 {
1795 ctx.warnAboutExtraCommas(yystack_[0].location);
1796 }
1797#line 1798 "agent_parser.cc"
1798 break;
1799
1800 case 210: // $@43: %empty
1801#line 866 "agent_parser.yy"
1802 {
1803 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1804 ctx.stack_.back()->add(m);
1805 ctx.stack_.push_back(m);
1806}
1807#line 1808 "agent_parser.cc"
1808 break;
1809
1810 case 211: // output_entry: "{" $@43 output_params_list "}"
1811#line 870 "agent_parser.yy"
1812 {
1813 ctx.stack_.pop_back();
1814}
1815#line 1816 "agent_parser.cc"
1816 break;
1817
1818 case 214: // output_params_list: output_params_list ","
1819#line 876 "agent_parser.yy"
1820 {
1821 ctx.warnAboutExtraCommas(yystack_[0].location);
1822 }
1823#line 1824 "agent_parser.cc"
1824 break;
1825
1826 case 220: // $@44: %empty
1827#line 888 "agent_parser.yy"
1828 {
1829 ctx.unique("output", ctx.loc2pos(yystack_[0].location));
1830 ctx.enter(ctx.NO_KEYWORDS);
1831}
1832#line 1833 "agent_parser.cc"
1833 break;
1834
1835 case 221: // output: "output" $@44 ":" "constant string"
1836#line 891 "agent_parser.yy"
1837 {
1838 ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1839 ctx.stack_.back()->set("output", sev);
1840 ctx.leave();
1841}
1842#line 1843 "agent_parser.cc"
1843 break;
1844
1845 case 222: // flush: "flush" ":" "boolean"
1846#line 897 "agent_parser.yy"
1847 {
1848 ctx.unique("flush", ctx.loc2pos(yystack_[2].location));
1849 ElementPtr flush(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1850 ctx.stack_.back()->set("flush", flush);
1851}
1852#line 1853 "agent_parser.cc"
1853 break;
1854
1855 case 223: // maxsize: "maxsize" ":" "integer"
1856#line 903 "agent_parser.yy"
1857 {
1858 ctx.unique("maxsize", ctx.loc2pos(yystack_[2].location));
1859 ElementPtr maxsize(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1860 ctx.stack_.back()->set("maxsize", maxsize);
1861}
1862#line 1863 "agent_parser.cc"
1863 break;
1864
1865 case 224: // maxver: "maxver" ":" "integer"
1866#line 909 "agent_parser.yy"
1867 {
1868 ctx.unique("maxver", ctx.loc2pos(yystack_[2].location));
1869 ElementPtr maxver(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1870 ctx.stack_.back()->set("maxver", maxver);
1871}
1872#line 1873 "agent_parser.cc"
1873 break;
1874
1875 case 225: // $@45: %empty
1876#line 915 "agent_parser.yy"
1877 {
1878 ctx.unique("pattern", ctx.loc2pos(yystack_[0].location));
1879 ctx.enter(ctx.NO_KEYWORDS);
1880}
1881#line 1882 "agent_parser.cc"
1882 break;
1883
1884 case 226: // pattern: "pattern" $@45 ":" "constant string"
1885#line 918 "agent_parser.yy"
1886 {
1887 ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1888 ctx.stack_.back()->set("pattern", sev);
1889 ctx.leave();
1890}
1891#line 1892 "agent_parser.cc"
1892 break;
1893
1894
1895#line 1896 "agent_parser.cc"
1896
1897 default:
1898 break;
1899 }
1900 }
1901#if YY_EXCEPTIONS
1902 catch (const syntax_error& yyexc)
1903 {
1904 YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
1905 error (yyexc);
1906 YYERROR;
1907 }
1908#endif // YY_EXCEPTIONS
1909 YY_SYMBOL_PRINT ("-> $$ =", yylhs);
1910 yypop_ (yylen);
1911 yylen = 0;
1912
1913 // Shift the result of the reduction.
1914 yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
1915 }
1916 goto yynewstate;
1917
1918
1919 /*--------------------------------------.
1920 | yyerrlab -- here on detecting error. |
1921 `--------------------------------------*/
1922 yyerrlab:
1923 // If not already recovering from an error, report this error.
1924 if (!yyerrstatus_)
1925 {
1926 ++yynerrs_;
1927 context yyctx (*this, yyla);
1928 std::string msg = yysyntax_error_ (yyctx);
1929 error (yyla.location, YY_MOVE (msg));
1930 }
1931
1932
1933 yyerror_range[1].location = yyla.location;
1934 if (yyerrstatus_ == 3)
1935 {
1936 /* If just tried and failed to reuse lookahead token after an
1937 error, discard it. */
1938
1939 // Return failure if at end of input.
1940 if (yyla.kind () == symbol_kind::S_YYEOF)
1941 YYABORT;
1942 else if (!yyla.empty ())
1943 {
1944 yy_destroy_ ("Error: discarding", yyla);
1945 yyla.clear ();
1946 }
1947 }
1948
1949 // Else will try to reuse lookahead token after shifting the error token.
1950 goto yyerrlab1;
1951
1952
1953 /*---------------------------------------------------.
1954 | yyerrorlab -- error raised explicitly by YYERROR. |
1955 `---------------------------------------------------*/
1956 yyerrorlab:
1957 /* Pacify compilers when the user code never invokes YYERROR and
1958 the label yyerrorlab therefore never appears in user code. */
1959 if (false)
1960 YYERROR;
1961
1962 /* Do not reclaim the symbols of the rule whose action triggered
1963 this YYERROR. */
1964 yypop_ (yylen);
1965 yylen = 0;
1966 YY_STACK_PRINT ();
1967 goto yyerrlab1;
1968
1969
1970 /*-------------------------------------------------------------.
1971 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1972 `-------------------------------------------------------------*/
1973 yyerrlab1:
1974 yyerrstatus_ = 3; // Each real token shifted decrements this.
1975 // Pop stack until we find a state that shifts the error token.
1976 for (;;)
1977 {
1978 yyn = yypact_[+yystack_[0].state];
1979 if (!yy_pact_value_is_default_ (yyn))
1980 {
1981 yyn += symbol_kind::S_YYerror;
1982 if (0 <= yyn && yyn <= yylast_
1983 && yycheck_[yyn] == symbol_kind::S_YYerror)
1984 {
1985 yyn = yytable_[yyn];
1986 if (0 < yyn)
1987 break;
1988 }
1989 }
1990
1991 // Pop the current state because it cannot handle the error token.
1992 if (yystack_.size () == 1)
1993 YYABORT;
1994
1995 yyerror_range[1].location = yystack_[0].location;
1996 yy_destroy_ ("Error: popping", yystack_[0]);
1997 yypop_ ();
1998 YY_STACK_PRINT ();
1999 }
2000 {
2001 stack_symbol_type error_token;
2002
2003 yyerror_range[2].location = yyla.location;
2004 YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
2005
2006 // Shift the error token.
2007 error_token.state = state_type (yyn);
2008 yypush_ ("Shifting", YY_MOVE (error_token));
2009 }
2010 goto yynewstate;
2011
2012
2013 /*-------------------------------------.
2014 | yyacceptlab -- YYACCEPT comes here. |
2015 `-------------------------------------*/
2016 yyacceptlab:
2017 yyresult = 0;
2018 goto yyreturn;
2019
2020
2021 /*-----------------------------------.
2022 | yyabortlab -- YYABORT comes here. |
2023 `-----------------------------------*/
2024 yyabortlab:
2025 yyresult = 1;
2026 goto yyreturn;
2027
2028
2029 /*-----------------------------------------------------.
2030 | yyreturn -- parsing is finished, return the result. |
2031 `-----------------------------------------------------*/
2032 yyreturn:
2033 if (!yyla.empty ())
2034 yy_destroy_ ("Cleanup: discarding lookahead", yyla);
2035
2036 /* Do not reclaim the symbols of the rule whose action triggered
2037 this YYABORT or YYACCEPT. */
2038 yypop_ (yylen);
2039 YY_STACK_PRINT ();
2040 while (1 < yystack_.size ())
2041 {
2042 yy_destroy_ ("Cleanup: popping", yystack_[0]);
2043 yypop_ ();
2044 }
2045
2046 return yyresult;
2047 }
2048#if YY_EXCEPTIONS
2049 catch (...)
2050 {
2051 YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
2052 // Do not try to display the values of the reclaimed symbols,
2053 // as their printers might throw an exception.
2054 if (!yyla.empty ())
2055 yy_destroy_ (YY_NULLPTR, yyla);
2056
2057 while (1 < yystack_.size ())
2058 {
2059 yy_destroy_ (YY_NULLPTR, yystack_[0]);
2060 yypop_ ();
2061 }
2062 throw;
2063 }
2064#endif // YY_EXCEPTIONS
2065 }
2066
2067 void
2068 AgentParser::error (const syntax_error& yyexc)
2069 {
2070 error (yyexc.location, yyexc.what ());
2071 }
2072
2073 /* Return YYSTR after stripping away unnecessary quotes and
2074 backslashes, so that it's suitable for yyerror. The heuristic is
2075 that double-quoting is unnecessary unless the string contains an
2076 apostrophe, a comma, or backslash (other than backslash-backslash).
2077 YYSTR is taken from yytname. */
2078 std::string
2079 AgentParser::yytnamerr_ (const char *yystr)
2080 {
2081 if (*yystr == '"')
2082 {
2083 std::string yyr;
2084 char const *yyp = yystr;
2085
2086 for (;;)
2087 switch (*++yyp)
2088 {
2089 case '\'':
2090 case ',':
2091 goto do_not_strip_quotes;
2092
2093 case '\\':
2094 if (*++yyp != '\\')
2095 goto do_not_strip_quotes;
2096 else
2097 goto append;
2098
2099 append:
2100 default:
2101 yyr += *yyp;
2102 break;
2103
2104 case '"':
2105 return yyr;
2106 }
2107 do_not_strip_quotes: ;
2108 }
2109
2110 return yystr;
2111 }
2112
2113 std::string
2114 AgentParser::symbol_name (symbol_kind_type yysymbol)
2115 {
2116 return yytnamerr_ (yytname_[yysymbol]);
2117 }
2118
2119
2120
2121 // AgentParser::context.
2122 AgentParser::context::context (const AgentParser& yyparser, const symbol_type& yyla)
2123 : yyparser_ (yyparser)
2124 , yyla_ (yyla)
2125 {}
2126
2127 int
2128 AgentParser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const
2129 {
2130 // Actual number of expected tokens
2131 int yycount = 0;
2132
2133 const int yyn = yypact_[+yyparser_.yystack_[0].state];
2134 if (!yy_pact_value_is_default_ (yyn))
2135 {
2136 /* Start YYX at -YYN if negative to avoid negative indexes in
2137 YYCHECK. In other words, skip the first -YYN actions for
2138 this state because they are default actions. */
2139 const int yyxbegin = yyn < 0 ? -yyn : 0;
2140 // Stay within bounds of both yycheck and yytname.
2141 const int yychecklim = yylast_ - yyn + 1;
2142 const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2143 for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
2144 if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror
2145 && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
2146 {
2147 if (!yyarg)
2148 ++yycount;
2149 else if (yycount == yyargn)
2150 return 0;
2151 else
2152 yyarg[yycount++] = YY_CAST (symbol_kind_type, yyx);
2153 }
2154 }
2155
2156 if (yyarg && yycount == 0 && 0 < yyargn)
2157 yyarg[0] = symbol_kind::S_YYEMPTY;
2158 return yycount;
2159 }
2160
2161
2162
2163
2164
2165
2166 int
2167 AgentParser::yy_syntax_error_arguments_ (const context& yyctx,
2168 symbol_kind_type yyarg[], int yyargn) const
2169 {
2170 /* There are many possibilities here to consider:
2171 - If this state is a consistent state with a default action, then
2172 the only way this function was invoked is if the default action
2173 is an error action. In that case, don't check for expected
2174 tokens because there are none.
2175 - The only way there can be no lookahead present (in yyla) is
2176 if this state is a consistent state with a default action.
2177 Thus, detecting the absence of a lookahead is sufficient to
2178 determine that there is no unexpected or expected token to
2179 report. In that case, just report a simple "syntax error".
2180 - Don't assume there isn't a lookahead just because this state is
2181 a consistent state with a default action. There might have
2182 been a previous inconsistent state, consistent state with a
2183 non-default action, or user semantic action that manipulated
2184 yyla. (However, yyla is currently not documented for users.)
2185 - Of course, the expected token list depends on states to have
2186 correct lookahead information, and it depends on the parser not
2187 to perform extra reductions after fetching a lookahead from the
2188 scanner and before detecting a syntax error. Thus, state merging
2189 (from LALR or IELR) and default reductions corrupt the expected
2190 token list. However, the list is correct for canonical LR with
2191 one exception: it will still contain any token that will not be
2192 accepted due to an error action in a later state.
2193 */
2194
2195 if (!yyctx.lookahead ().empty ())
2196 {
2197 if (yyarg)
2198 yyarg[0] = yyctx.token ();
2199 int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1);
2200 return yyn + 1;
2201 }
2202 return 0;
2203 }
2204
2205 // Generate an error message.
2206 std::string
2207 AgentParser::yysyntax_error_ (const context& yyctx) const
2208 {
2209 // Its maximum.
2210 enum { YYARGS_MAX = 5 };
2211 // Arguments of yyformat.
2212 symbol_kind_type yyarg[YYARGS_MAX];
2213 int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX);
2214
2215 char const* yyformat = YY_NULLPTR;
2216 switch (yycount)
2217 {
2218#define YYCASE_(N, S) \
2219 case N: \
2220 yyformat = S; \
2221 break
2222 default: // Avoid compiler warnings.
2223 YYCASE_ (0, YY_("syntax error"));
2224 YYCASE_ (1, YY_("syntax error, unexpected %s"));
2225 YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s"));
2226 YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s"));
2227 YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
2228 YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
2229#undef YYCASE_
2230 }
2231
2232 std::string yyres;
2233 // Argument number.
2234 std::ptrdiff_t yyi = 0;
2235 for (char const* yyp = yyformat; *yyp; ++yyp)
2236 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
2237 {
2238 yyres += symbol_name (yyarg[yyi++]);
2239 ++yyp;
2240 }
2241 else
2242 yyres += *yyp;
2243 return yyres;
2244 }
2245
2246
2247 const short AgentParser::yypact_ninf_ = -205;
2248
2249 const signed char AgentParser::yytable_ninf_ = -1;
2250
2251 const short
2252 AgentParser::yypact_[] =
2253 {
2254 76, -205, -205, -205, 5, 1, 2, 20, -205, -205,
2255 -205, -205, -205, -205, -205, -205, -205, -205, -205, -205,
2256 -205, -205, -205, -205, 1, -20, 25, 0, -205, 34,
2257 35, 63, 41, 85, -205, 79, -205, -205, 90, -205,
2258 -205, -205, -205, -205, -205, -205, 93, 131, -205, -205,
2259 132, -205, 102, -205, -205, -205, -205, -205, -205, -205,
2260 -205, -205, -205, -205, -205, -205, -205, -205, 1, 1,
2261 -205, 84, 139, -205, -205, 141, 53, 143, 144, 148,
2262 149, 150, 151, 152, 100, 153, 154, 155, -205, 0,
2263 -205, -205, -205, 157, 156, 108, -205, 160, 159, 117,
2264 161, 118, 119, 120, -205, -205, 162, 164, -205, 1,
2265 0, -205, 163, -205, -205, -205, 22, -205, -205, -205,
2266 46, 168, 169, -205, 103, -205, 171, 175, -205, -205,
2267 -205, -205, -205, -205, -205, -205, 104, -205, -205, -205,
2268 -205, -205, -205, -205, -205, -205, 106, -205, -205, -205,
2269 -205, -205, 173, 177, -205, -205, 47, -205, -205, 7,
2270 -205, 163, 178, 179, 180, 181, 22, -205, 182, 183,
2271 184, 46, -205, -21, -205, 168, 32, 169, -205, -205,
2272 -205, -205, -205, -205, 112, -205, -205, -205, -205, 170,
2273 127, 135, 186, -205, 185, 190, 191, -205, -205, -205,
2274 -205, 113, -205, -205, -205, -205, -205, 189, -205, -205,
2275 -205, -205, -205, 114, -205, -205, -205, -205, -205, 195,
2276 196, 7, -205, -205, -205, -205, -205, 194, 59, 59,
2277 59, 198, 199, -24, -205, 200, 165, 201, 32, -205,
2278 167, 172, -205, -205, 202, 203, -205, -205, -205, -205,
2279 -205, -205, 115, -205, -205, -205, 116, 122, 174, 159,
2280 -205, 204, -205, 176, -205, -205, -205, 45, -205, 194,
2281 206, 210, 59, -205, -205, -205, -205, -205, 208, -205,
2282 -205, -205, -205, -205, -205, -205, -205, 123, -205, -205,
2283 -205, -205, -205, -205, 192, 187, -205, -205, 62, -205,
2284 212, 213, 214, 215, 45, -205, -205, -205, -205, 54,
2285 208, -205, 193, 197, 205, 207, -205, -205, 218, 219,
2286 220, -205, 134, -205, -205, -205, -205, -205, -205, -205,
2287 -205, -205, -205, -205, 223, 188, 209, 211, 225, 54,
2288 -205, 216, -205, -205, -205, 217, -205, -205, -205
2289 };
2290
2291 const unsigned char
2292 AgentParser::yydefact_[] =
2293 {
2294 0, 2, 4, 6, 0, 0, 0, 0, 1, 26,
2295 18, 15, 14, 11, 12, 13, 3, 10, 16, 17,
2296 34, 5, 8, 7, 28, 21, 0, 0, 30, 0,
2297 29, 0, 0, 22, 36, 0, 38, 57, 0, 71,
2298 67, 69, 139, 60, 62, 64, 0, 0, 92, 185,
2299 0, 56, 0, 40, 43, 44, 46, 47, 48, 49,
2300 54, 55, 45, 52, 51, 50, 53, 27, 32, 0,
2301 19, 25, 0, 39, 35, 0, 0, 0, 0, 0,
2302 0, 0, 0, 0, 0, 0, 0, 0, 33, 42,
2303 9, 31, 23, 0, 0, 0, 59, 0, 0, 0,
2304 0, 0, 0, 0, 66, 111, 0, 0, 41, 0,
2305 0, 58, 73, 20, 68, 70, 0, 61, 63, 65,
2306 0, 94, 0, 24, 0, 78, 0, 74, 75, 151,
2307 154, 156, 158, 150, 149, 148, 0, 141, 144, 145,
2308 146, 147, 120, 122, 124, 119, 0, 113, 116, 117,
2309 118, 99, 0, 95, 96, 190, 0, 187, 37, 0,
2310 72, 77, 0, 0, 0, 0, 143, 140, 0, 0,
2311 0, 115, 112, 0, 93, 98, 0, 189, 186, 88,
2312 90, 87, 85, 86, 0, 80, 83, 84, 76, 0,
2313 0, 0, 0, 142, 0, 0, 0, 114, 107, 109,
2314 104, 0, 101, 105, 106, 97, 205, 0, 203, 201,
2315 199, 200, 195, 0, 192, 197, 198, 196, 188, 0,
2316 0, 82, 79, 153, 152, 155, 157, 160, 0, 0,
2317 0, 0, 0, 103, 100, 0, 0, 0, 194, 191,
2318 0, 0, 81, 165, 0, 161, 162, 134, 136, 133,
2319 131, 132, 0, 126, 129, 130, 0, 0, 0, 0,
2320 102, 0, 202, 0, 193, 89, 91, 0, 159, 164,
2321 0, 0, 128, 121, 123, 125, 108, 110, 0, 204,
2322 177, 179, 181, 183, 176, 174, 175, 0, 167, 170,
2323 171, 172, 173, 163, 0, 0, 127, 210, 0, 207,
2324 0, 0, 0, 0, 169, 166, 135, 138, 137, 0,
2325 209, 206, 0, 0, 0, 0, 168, 220, 0, 0,
2326 0, 225, 0, 212, 215, 216, 217, 218, 219, 208,
2327 178, 180, 182, 184, 0, 0, 0, 0, 0, 214,
2328 211, 0, 222, 223, 224, 0, 213, 221, 226
2329 };
2330
2331 const short
2332 AgentParser::yypgoto_[] =
2333 {
2334 -205, -205, -205, -205, -205, -205, -205, -205, -17, -95,
2335 -205, -52, -205, -205, -205, -205, -205, -205, -27, -205,
2336 -205, -205, -205, -205, 121, 145, -205, -205, -205, -205,
2337 -205, -205, -205, -205, -205, -205, -26, -205, -25, -205,
2338 -205, -205, -205, -205, 71, -205, -205, 12, -172, -205,
2339 -205, -205, -205, -205, -205, -205, 60, -205, -205, 3,
2340 -205, -205, -205, -205, -205, -205, -205, 66, -205, -205,
2341 -205, -205, -205, -205, -204, -34, -205, -205, -205, -205,
2342 -205, -205, -205, -205, 73, -205, -205, -205, -205, -205,
2343 -205, -205, -205, -205, -205, -205, -19, -205, -205, -61,
2344 -205, -205, -205, -205, -205, -205, -205, -205, -205, -205,
2345 -205, 67, -205, -205, 10, -205, -205, -205, -205, -205,
2346 -205, -58, -205, -205, -90, -205, -205, -205, -205, -205,
2347 -205, -205
2348 };
2349
2350 const short
2351 AgentParser::yydefgoto_[] =
2352 {
2353 0, 4, 5, 6, 7, 23, 27, 16, 17, 18,
2354 25, 114, 32, 33, 19, 24, 29, 30, 249, 21,
2355 26, 35, 72, 36, 52, 53, 54, 75, 55, 56,
2356 81, 57, 82, 58, 83, 59, 250, 78, 251, 79,
2357 62, 77, 126, 127, 128, 159, 184, 185, 186, 219,
2358 187, 220, 63, 86, 152, 153, 154, 173, 201, 202,
2359 203, 231, 204, 232, 64, 120, 146, 147, 148, 168,
2360 149, 169, 150, 170, 252, 253, 254, 270, 255, 271,
2361 308, 65, 80, 136, 137, 138, 162, 224, 139, 163,
2362 140, 164, 141, 165, 244, 245, 246, 267, 287, 288,
2363 289, 300, 290, 301, 291, 302, 292, 303, 66, 87,
2364 156, 157, 176, 213, 214, 215, 216, 237, 217, 235,
2365 298, 299, 309, 322, 323, 324, 334, 325, 326, 327,
2366 328, 338
2367 };
2368
2369 const short
2370 AgentParser::yytable_[] =
2371 {
2372 51, 60, 61, 113, 212, 8, 9, 28, 10, 20,
2373 11, 37, 38, 39, 40, 41, 198, 199, 42, 198,
2374 199, 40, 41, 179, 180, 256, 257, 22, 43, 44,
2375 45, 46, 47, 50, 31, 34, 40, 41, 68, 48,
2376 67, 129, 49, 130, 131, 132, 40, 41, 179, 70,
2377 177, 91, 92, 178, 50, 12, 13, 14, 15, 40,
2378 41, 50, 51, 60, 61, 310, 212, 69, 311, 280,
2379 281, 282, 283, 40, 41, 206, 50, 207, 208, 142,
2380 143, 144, 73, 51, 60, 61, 50, 74, 71, 133,
2381 134, 135, 123, 145, 76, 247, 248, 84, 317, 50,
2382 50, 318, 319, 320, 321, 89, 89, 166, 96, 171,
2383 90, 158, 167, 50, 172, 221, 233, 238, 272, 272,
2384 222, 234, 239, 273, 274, 272, 304, 1, 2, 3,
2385 275, 305, 181, 182, 183, 85, 88, 339, 93, 133,
2386 134, 135, 340, 94, 145, 95, 200, 97, 98, 209,
2387 210, 211, 99, 100, 101, 102, 103, 104, 106, 107,
2388 105, 109, 111, 110, 113, 112, 10, 121, 116, 122,
2389 125, 115, 117, 118, 119, 151, 155, 160, 161, 174,
2390 175, 225, 189, 190, 191, 192, 194, 195, 196, 226,
2391 223, 227, 228, 236, 181, 182, 183, 229, 230, 240,
2392 241, 243, 258, 259, 261, 263, 269, 277, 268, 278,
2393 294, 209, 210, 211, 295, 297, 312, 313, 314, 315,
2394 262, 265, 335, 336, 337, 307, 266, 341, 276, 345,
2395 279, 124, 188, 242, 108, 205, 260, 197, 296, 193,
2396 284, 285, 286, 316, 218, 342, 306, 330, 264, 346,
2397 293, 331, 329, 0, 0, 0, 0, 0, 0, 332,
2398 0, 333, 0, 0, 343, 0, 344, 0, 0, 0,
2399 347, 348, 0, 0, 0, 0, 0, 284, 285, 286
2400 };
2401
2402 const short
2403 AgentParser::yycheck_[] =
2404 {
2405 27, 27, 27, 98, 176, 0, 5, 24, 7, 7,
2406 9, 11, 12, 13, 14, 15, 40, 41, 18, 40,
2407 41, 14, 15, 16, 17, 229, 230, 7, 28, 29,
2408 30, 31, 32, 54, 54, 10, 14, 15, 3, 39,
2409 6, 19, 42, 21, 22, 23, 14, 15, 16, 8,
2410 3, 68, 69, 6, 54, 54, 55, 56, 57, 14,
2411 15, 54, 89, 89, 89, 3, 238, 4, 6, 24,
2412 25, 26, 27, 14, 15, 43, 54, 45, 46, 33,
2413 34, 35, 3, 110, 110, 110, 54, 8, 3, 116,
2414 116, 116, 109, 120, 4, 36, 37, 4, 44, 54,
2415 54, 47, 48, 49, 50, 3, 3, 3, 55, 3,
2416 8, 8, 8, 54, 8, 3, 3, 3, 3, 3,
2417 8, 8, 8, 8, 8, 3, 3, 51, 52, 53,
2418 8, 8, 159, 159, 159, 4, 4, 3, 54, 166,
2419 166, 166, 8, 4, 171, 4, 173, 4, 4, 176,
2420 176, 176, 4, 4, 4, 4, 4, 57, 4, 4,
2421 7, 4, 54, 7, 259, 5, 7, 5, 7, 5,
2422 7, 54, 54, 54, 54, 7, 7, 6, 3, 6,
2423 3, 54, 4, 4, 4, 4, 4, 4, 4, 54,
2424 20, 5, 7, 4, 221, 221, 221, 7, 7, 4,
2425 4, 7, 4, 4, 4, 4, 3, 259, 6, 5,
2426 4, 238, 238, 238, 4, 7, 4, 4, 4, 4,
2427 55, 54, 4, 4, 4, 38, 54, 4, 54, 4,
2428 54, 110, 161, 221, 89, 175, 233, 171, 272, 166,
2429 267, 267, 267, 304, 177, 57, 54, 54, 238, 339,
2430 269, 54, 310, -1, -1, -1, -1, -1, -1, 54,
2431 -1, 54, -1, -1, 55, -1, 55, -1, -1, -1,
2432 54, 54, -1, -1, -1, -1, -1, 304, 304, 304
2433 };
2434
2435 const unsigned char
2436 AgentParser::yystos_[] =
2437 {
2438 0, 51, 52, 53, 59, 60, 61, 62, 0, 5,
2439 7, 9, 54, 55, 56, 57, 65, 66, 67, 72,
2440 7, 77, 7, 63, 73, 68, 78, 64, 66, 74,
2441 75, 54, 70, 71, 10, 79, 81, 11, 12, 13,
2442 14, 15, 18, 28, 29, 30, 31, 32, 39, 42,
2443 54, 76, 82, 83, 84, 86, 87, 89, 91, 93,
2444 94, 96, 98, 110, 122, 139, 166, 6, 3, 4,
2445 8, 3, 80, 3, 8, 85, 4, 99, 95, 97,
2446 140, 88, 90, 92, 4, 4, 111, 167, 4, 3,
2447 8, 66, 66, 54, 4, 4, 55, 4, 4, 4,
2448 4, 4, 4, 4, 57, 7, 4, 4, 83, 4,
2449 7, 54, 5, 67, 69, 54, 7, 54, 54, 54,
2450 123, 5, 5, 66, 82, 7, 100, 101, 102, 19,
2451 21, 22, 23, 76, 94, 96, 141, 142, 143, 146,
2452 148, 150, 33, 34, 35, 76, 124, 125, 126, 128,
2453 130, 7, 112, 113, 114, 7, 168, 169, 8, 103,
2454 6, 3, 144, 147, 149, 151, 3, 8, 127, 129,
2455 131, 3, 8, 115, 6, 3, 170, 3, 6, 16,
2456 17, 76, 94, 96, 104, 105, 106, 108, 102, 4,
2457 4, 4, 4, 142, 4, 4, 4, 125, 40, 41,
2458 76, 116, 117, 118, 120, 114, 43, 45, 46, 76,
2459 94, 96, 106, 171, 172, 173, 174, 176, 169, 107,
2460 109, 3, 8, 20, 145, 54, 54, 5, 7, 7,
2461 7, 119, 121, 3, 8, 177, 4, 175, 3, 8,
2462 4, 4, 105, 7, 152, 153, 154, 36, 37, 76,
2463 94, 96, 132, 133, 134, 136, 132, 132, 4, 4,
2464 117, 4, 55, 4, 172, 54, 54, 155, 6, 3,
2465 135, 137, 3, 8, 8, 8, 54, 69, 5, 54,
2466 24, 25, 26, 27, 76, 94, 96, 156, 157, 158,
2467 160, 162, 164, 154, 4, 4, 133, 7, 178, 179,
2468 159, 161, 163, 165, 3, 8, 54, 38, 138, 180,
2469 3, 6, 4, 4, 4, 4, 157, 44, 47, 48,
2470 49, 50, 181, 182, 183, 185, 186, 187, 188, 179,
2471 54, 54, 54, 54, 184, 4, 4, 4, 189, 3,
2472 8, 4, 57, 55, 55, 4, 182, 54, 54
2473 };
2474
2475 const unsigned char
2476 AgentParser::yyr1_[] =
2477 {
2478 0, 58, 60, 59, 61, 59, 62, 59, 64, 63,
2479 65, 66, 66, 66, 66, 66, 66, 66, 68, 67,
2480 69, 70, 70, 71, 71, 71, 73, 72, 74, 74,
2481 75, 75, 75, 76, 78, 77, 80, 79, 79, 81,
2482 82, 82, 82, 83, 83, 83, 83, 83, 83, 83,
2483 83, 83, 83, 83, 83, 83, 83, 85, 84, 86,
2484 88, 87, 90, 89, 92, 91, 93, 95, 94, 97,
2485 96, 99, 98, 100, 100, 101, 101, 101, 103, 102,
2486 104, 104, 104, 105, 105, 105, 105, 105, 107, 106,
2487 109, 108, 111, 110, 112, 112, 113, 113, 113, 115,
2488 114, 116, 116, 116, 116, 117, 117, 119, 118, 121,
2489 120, 123, 122, 124, 124, 124, 125, 125, 125, 125,
2490 127, 126, 129, 128, 131, 130, 132, 132, 132, 133,
2491 133, 133, 133, 133, 135, 134, 137, 136, 138, 140,
2492 139, 141, 141, 141, 142, 142, 142, 142, 142, 142,
2493 142, 144, 143, 145, 147, 146, 149, 148, 151, 150,
2494 152, 152, 153, 153, 153, 155, 154, 156, 156, 156,
2495 157, 157, 157, 157, 157, 157, 157, 159, 158, 161,
2496 160, 163, 162, 165, 164, 167, 166, 168, 168, 168,
2497 170, 169, 171, 171, 171, 172, 172, 172, 172, 172,
2498 172, 172, 173, 175, 174, 177, 176, 178, 178, 178,
2499 180, 179, 181, 181, 181, 182, 182, 182, 182, 182,
2500 184, 183, 185, 186, 187, 189, 188
2501 };
2502
2503 const signed char
2504 AgentParser::yyr2_[] =
2505 {
2506 0, 2, 0, 3, 0, 3, 0, 3, 0, 4,
2507 1, 1, 1, 1, 1, 1, 1, 1, 0, 4,
2508 1, 0, 1, 3, 5, 2, 0, 4, 0, 1,
2509 1, 3, 2, 2, 0, 4, 0, 6, 1, 2,
2510 1, 3, 2, 1, 1, 1, 1, 1, 1, 1,
2511 1, 1, 1, 1, 1, 1, 1, 0, 4, 3,
2512 0, 4, 0, 4, 0, 4, 3, 0, 4, 0,
2513 4, 0, 6, 0, 1, 1, 3, 2, 0, 4,
2514 1, 3, 2, 1, 1, 1, 1, 1, 0, 4,
2515 0, 4, 0, 6, 0, 1, 1, 3, 2, 0,
2516 4, 1, 3, 2, 1, 1, 1, 0, 4, 0,
2517 4, 0, 6, 1, 3, 2, 1, 1, 1, 1,
2518 0, 6, 0, 6, 0, 6, 1, 3, 2, 1,
2519 1, 1, 1, 1, 0, 4, 0, 4, 1, 0,
2520 6, 1, 3, 2, 1, 1, 1, 1, 1, 1,
2521 1, 0, 4, 1, 0, 4, 0, 4, 0, 6,
2522 0, 1, 1, 3, 2, 0, 4, 1, 3, 2,
2523 1, 1, 1, 1, 1, 1, 1, 0, 4, 0,
2524 4, 0, 4, 0, 4, 0, 6, 1, 3, 2,
2525 0, 4, 1, 3, 2, 1, 1, 1, 1, 1,
2526 1, 1, 3, 0, 4, 0, 6, 1, 3, 2,
2527 0, 4, 1, 3, 2, 1, 1, 1, 1, 1,
2528 0, 4, 3, 3, 3, 0, 4
2529 };
2530
2531
2532#if AGENT_DEBUG || 1
2533 // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2534 // First, the terminals, then, starting at \a YYNTOKENS, nonterminals.
2535 const char*
2536 const AgentParser::yytname_[] =
2537 {
2538 "\"end of file\"", "error", "\"invalid token\"", "\",\"", "\":\"",
2539 "\"[\"", "\"]\"", "\"{\"", "\"}\"", "\"null\"", "\"Control-agent\"",
2540 "\"http-host\"", "\"http-port\"", "\"http-headers\"", "\"user-context\"",
2541 "\"comment\"", "\"name\"", "\"value\"", "\"authentication\"", "\"type\"",
2542 "\"basic\"", "\"realm\"", "\"directory\"", "\"clients\"", "\"user\"",
2543 "\"user-file\"", "\"password\"", "\"password-file\"", "\"trust-anchor\"",
2544 "\"cert-file\"", "\"key-file\"", "\"cert-required\"",
2545 "\"control-sockets\"", "\"dhcp4\"", "\"dhcp6\"", "\"d2\"",
2546 "\"socket-name\"", "\"socket-type\"", "\"unix\"", "\"hooks-libraries\"",
2547 "\"library\"", "\"parameters\"", "\"loggers\"", "\"output-options\"",
2548 "\"output\"", "\"debuglevel\"", "\"severity\"", "\"flush\"",
2549 "\"maxsize\"", "\"maxver\"", "\"pattern\"", "START_JSON", "START_AGENT",
2550 "START_SUB_AGENT", "\"constant string\"", "\"integer\"",
2551 "\"floating point\"", "\"boolean\"", "$accept", "start", "$@1", "$@2",
2552 "$@3", "sub_agent", "$@4", "json", "value", "map", "$@5", "map_value",
2553 "map_content", "not_empty_map", "list_generic", "$@6", "list_content",
2554 "not_empty_list", "unknown_map_entry", "agent_syntax_map", "$@7",
2555 "global_object", "$@8", "global_object_comma", "global_params",
2556 "global_param", "http_host", "$@9", "http_port", "trust_anchor", "$@10",
2557 "cert_file", "$@11", "key_file", "$@12", "cert_required", "user_context",
2558 "$@13", "comment", "$@14", "http_headers", "$@15", "http_header_list",
2559 "not_empty_http_header_list", "http_header", "$@16",
2560 "http_header_params", "http_header_param", "name", "$@17",
2561 "header_value", "$@18", "hooks_libraries", "$@19",
2562 "hooks_libraries_list", "not_empty_hooks_libraries_list",
2563 "hooks_library", "$@20", "hooks_params", "hooks_param", "library",
2564 "$@21", "parameters", "$@22", "control_sockets", "$@23",
2565 "control_sockets_params", "control_socket", "dhcp4_server_socket",
2566 "$@24", "dhcp6_server_socket", "$@25", "d2_server_socket", "$@26",
2567 "control_socket_params", "control_socket_param", "socket_name", "$@27",
2568 "socket_type", "$@28", "socket_type_value", "authentication", "$@29",
2569 "auth_params", "auth_param", "auth_type", "$@30", "auth_type_value",
2570 "realm", "$@31", "directory", "$@32", "clients", "$@33", "clients_list",
2571 "not_empty_clients_list", "basic_auth", "$@34", "clients_params",
2572 "clients_param", "user", "$@35", "user_file", "$@36", "password", "$@37",
2573 "password_file", "$@38", "loggers", "$@39", "loggers_entries",
2574 "logger_entry", "$@40", "logger_params", "logger_param", "debuglevel",
2575 "severity", "$@41", "output_options_list", "$@42",
2576 "output_options_list_content", "output_entry", "$@43",
2577 "output_params_list", "output_params", "output", "$@44", "flush",
2578 "maxsize", "maxver", "pattern", "$@45", YY_NULLPTR
2579 };
2580#endif
2581
2582
2583#if AGENT_DEBUG
2584 const short
2585 AgentParser::yyrline_[] =
2586 {
2587 0, 135, 135, 135, 136, 136, 137, 137, 145, 145,
2588 156, 162, 163, 164, 165, 166, 167, 168, 172, 172,
2589 183, 188, 189, 197, 202, 208, 213, 213, 219, 220,
2590 223, 227, 231, 243, 251, 251, 263, 263, 279, 282,
2591 286, 287, 288, 295, 296, 297, 298, 299, 300, 301,
2592 302, 303, 304, 305, 306, 307, 308, 311, 311, 320,
2593 326, 326, 335, 335, 344, 344, 353, 359, 359, 384,
2594 384, 411, 411, 422, 423, 426, 427, 428, 433, 433,
2595 441, 442, 443, 448, 449, 450, 451, 452, 455, 455,
2596 464, 464, 474, 474, 485, 486, 489, 490, 491, 496,
2597 496, 504, 505, 506, 509, 512, 513, 516, 516, 525,
2598 525, 536, 536, 550, 551, 552, 559, 560, 561, 562,
2599 566, 566, 578, 578, 590, 590, 602, 603, 604, 610,
2600 611, 612, 613, 614, 618, 618, 628, 628, 637, 644,
2601 644, 657, 658, 659, 664, 665, 666, 667, 668, 669,
2602 670, 673, 673, 681, 684, 684, 693, 693, 702, 702,
2603 713, 714, 717, 718, 719, 724, 724, 732, 733, 734,
2604 739, 740, 741, 742, 743, 744, 745, 748, 748, 757,
2605 757, 766, 766, 775, 775, 788, 788, 801, 802, 803,
2606 809, 809, 817, 818, 819, 824, 825, 826, 827, 828,
2607 829, 830, 833, 839, 839, 848, 848, 859, 860, 861,
2608 866, 866, 874, 875, 876, 881, 882, 883, 884, 885,
2609 888, 888, 897, 903, 909, 915, 915
2610 };
2611
2612 void
2613 AgentParser::yy_stack_print_ () const
2614 {
2615 *yycdebug_ << "Stack now";
2616 for (stack_type::const_iterator
2617 i = yystack_.begin (),
2618 i_end = yystack_.end ();
2619 i != i_end; ++i)
2620 *yycdebug_ << ' ' << int (i->state);
2621 *yycdebug_ << '\n';
2622 }
2623
2624 void
2625 AgentParser::yy_reduce_print_ (int yyrule) const
2626 {
2627 int yylno = yyrline_[yyrule];
2628 int yynrhs = yyr2_[yyrule];
2629 // Print the symbols being reduced, and their result.
2630 *yycdebug_ << "Reducing stack by rule " << yyrule - 1
2631 << " (line " << yylno << "):\n";
2632 // The symbols being reduced.
2633 for (int yyi = 0; yyi < yynrhs; yyi++)
2634 YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
2635 yystack_[(yynrhs) - (yyi + 1)]);
2636 }
2637#endif // AGENT_DEBUG
2638
2639
2640#line 14 "agent_parser.yy"
2641} } // isc::agent
2642#line 2643 "agent_parser.cc"
2643
2644#line 924 "agent_parser.yy"
2645
2646
2647void
2648isc::agent::AgentParser::error(const location_type& loc,
2649 const std::string& what)
2650{
2651 ctx.error(loc, what);
2652}
parser_context.h
yylex
#define yylex
Definition agent_lexer.cc:27
YYCDEBUG
#define YYCDEBUG
Definition agent_parser.cc:132
YYABORT
#define YYABORT
Definition agent_parser.cc:143
YYLLOC_DEFAULT
#define YYLLOC_DEFAULT(Current, Rhs, N)
Definition agent_parser.cc:87
YY_REDUCE_PRINT
#define YY_REDUCE_PRINT(Rule)
Definition agent_parser.cc:134
YY_SYMBOL_PRINT
#define YY_SYMBOL_PRINT(Title, Symbol)
Definition agent_parser.cc:133
YYCASE_
#define YYCASE_(N, S)
YY_STACK_PRINT
#define YY_STACK_PRINT()
Definition agent_parser.cc:135
YY_
#define YY_(msgid)
Definition agent_parser.cc:67
YYACCEPT
#define YYACCEPT
Definition agent_parser.cc:142
YYERROR
#define YYERROR
Definition agent_parser.cc:144
agent_parser.h
Define the isc::agent::parser class.
YY_RVREF
#define YY_RVREF(Type)
Definition agent_parser.h:85
YY_CPLUSPLUS
#define YY_CPLUSPLUS
Definition agent_parser.h:71
YY_CAST
#define YY_CAST(Type, Val)
Definition agent_parser.h:177
YY_MOVE_REF
#define YY_MOVE_REF(Type)
Definition agent_parser.h:84
YY_NOEXCEPT
#define YY_NOEXCEPT
Definition agent_parser.h:94
YY_MOVE
#define YY_MOVE
Definition agent_parser.h:82
YY_NOTHROW
#define YY_NOTHROW
Definition agent_parser.h:95
YY_USE
#define YY_USE(E)
Definition agent_parser.h:130
isc::agent::AgentParser::context
Definition agent_parser.h:2028
isc::agent::AgentParser::context::context
context(const AgentParser &yyparser, const symbol_type &yyla)
Definition agent_parser.cc:2122
isc::agent::AgentParser::context::lookahead
const symbol_type & lookahead() const YY_NOEXCEPT
Definition agent_parser.h:2031
isc::agent::AgentParser::context::token
symbol_kind_type token() const YY_NOEXCEPT
Definition agent_parser.h:2032
isc::agent::AgentParser::context::expected_tokens
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.
Definition agent_parser.cc:2128
isc::agent::AgentParser::value_type::emplace
T & emplace()
Instantiate an empty T in here.
Definition agent_parser.h:277
isc::agent::AgentParser::value_type::as
T & as() YY_NOEXCEPT
Accessor to a built T.
Definition agent_parser.h:318
isc::agent::AgentParser::error
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
Definition agent_parser.cc:2648
isc::agent::AgentParser::~AgentParser
virtual ~AgentParser()
Definition agent_parser.cc:162
isc::agent::AgentParser::AgentParser
AgentParser(isc::agent::ParserContext &ctx_yyarg)
Build a parser object.
Definition agent_parser.cc:152
isc::agent::AgentParser::symbol_name
static std::string symbol_name(symbol_kind_type yysymbol)
The user-facing name of the symbol whose (internal) number is YYSYMBOL.
Definition agent_parser.cc:2114
isc::agent::AgentParser::location_type
location location_type
Symbol locations.
Definition agent_parser.h:467
isc::agent::AgentParser::parse
virtual int parse()
Parse.
Definition agent_parser.cc:526
isc::agent::AgentParser::operator()
int operator()()
Parse.
Definition agent_parser.cc:520
isc::agent::AgentParser::symbol_kind_type
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
Definition agent_parser.h:763
isc::agent::AgentParser::YYNTOKENS
static const symbol_kind_type YYNTOKENS
The number of tokens.
Definition agent_parser.h:766
isc::agent::ParserContext
Parser context is a wrapper around flex/bison instances dedicated to Control-agent config file parser...
Definition agent/parser_context.h:37
isc::data::BoolElement
Definition data.h:858
isc::data::DoubleElement
Definition data.h:841
isc::data::IntElement
Notes: IntElement type is changed to int64_t.
Definition data.h:776
isc::data::ListElement
Definition data.h:902
isc::data::MapElement
Definition data.h:948
isc::data::NullElement
Definition data.h:875
isc::data::StringElement
Definition data.h:885
isc::agent
Definition agent_parser.cc:148
isc::data::merge
void merge(ElementPtr element, ConstElementPtr other)
Merges the data from other into element. (on the first level).
Definition data.cc:1276
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:30
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:29
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
isc::agent::AgentParser::basic_symbol
A complete symbol.
Definition agent_parser.h:776
isc::agent::AgentParser::basic_symbol::location
location_type location
The location.
Definition agent_parser.h:984
isc::agent::AgentParser::basic_symbol::move
void move(basic_symbol &s)
Destructive move, s is emptied into this.
Definition agent_parser.h:2478
isc::agent::AgentParser::basic_symbol::clear
void clear() YY_NOEXCEPT
Destroy contents, and record that is empty.
Definition agent_parser.h:920
isc::agent::AgentParser::basic_symbol::empty
bool empty() const YY_NOEXCEPT
Whether empty.
Definition agent_parser.h:2471
isc::agent::AgentParser::basic_symbol::value
value_type value
The semantic value.
Definition agent_parser.h:981
isc::agent::AgentParser::by_kind::kind
symbol_kind_type kind() const YY_NOEXCEPT
The (internal) type number (corresponding to type).
Definition agent_parser.h:2557
isc::agent::AgentParser::by_kind::kind_
symbol_kind_type kind_
The symbol kind.
Definition agent_parser.h:1030
isc::agent::AgentParser::symbol_kind::S_auth_type_value
@ S_auth_type_value
Definition agent_parser.h:714
isc::agent::AgentParser::symbol_kind::S_value
@ S_value
Definition agent_parser.h:635
isc::agent::AgentParser::symbol_kind::S_FLOAT
@ S_FLOAT
Definition agent_parser.h:625
isc::agent::AgentParser::symbol_kind::S_INTEGER
@ S_INTEGER
Definition agent_parser.h:624
isc::agent::AgentParser::symbol_kind::S_YYEMPTY
@ S_YYEMPTY
Definition agent_parser.h:568
isc::agent::AgentParser::symbol_kind::S_YYUNDEF
@ S_YYUNDEF
Definition agent_parser.h:571
isc::agent::AgentParser::symbol_kind::S_socket_type_value
@ S_socket_type_value
Definition agent_parser.h:707
isc::agent::AgentParser::symbol_kind::S_map_value
@ S_map_value
Definition agent_parser.h:638
isc::agent::AgentParser::symbol_kind::S_YYEOF
@ S_YYEOF
Definition agent_parser.h:569
isc::agent::AgentParser::symbol_kind::S_BOOLEAN
@ S_BOOLEAN
Definition agent_parser.h:626
isc::agent::AgentParser::symbol_kind::S_YYerror
@ S_YYerror
Definition agent_parser.h:570
isc::agent::AgentParser::symbol_kind::S_STRING
@ S_STRING
Definition agent_parser.h:623
isc::agent::AgentParser::symbol_type
"External" symbols: returned by the scanner.
Definition agent_parser.h:1038
isc::agent::AgentParser::syntax_error
Syntax errors thrown from user actions.
Definition agent_parser.h:471
isc::agent::AgentParser::syntax_error::~syntax_error
~syntax_error() YY_NOEXCEPT YY_NOTHROW
Definition agent_parser.cc:165
isc::agent::AgentParser::syntax_error::location
location_type location
Definition agent_parser.h:484