Kea 1.5.0
agent_parser.cc
Go to the documentation of this file.
1// A Bison parser, made by GNU Bison 3.2.1.
2
3// Skeleton implementation for Bison LALR(1) parsers in C++
4
5// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
6
7// This program is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20// As a special exception, you may create a larger work that contains
21// part or all of the Bison parser skeleton and distribute that work
22// under terms of your choice, so long as that work isn't itself a
23// parser generator using the skeleton or a modified version thereof
24// as a parser skeleton. Alternatively, if you modify or redistribute
25// the parser skeleton itself, you may (at your option) remove this
26// special exception, which will cause the skeleton and the resulting
27// Bison output files to be licensed under the GNU General Public
28// License without this special exception.
29
30// This special exception was added by the Free Software Foundation in
31// version 2.2 of Bison.
32
33// Undocumented macros, especially those whose name start with YY_,
34// are private implementation details. Do not rely on them.
35
36
37// Take the name prefix into account.
38#define yylex agent_lex
39
40
41
42#include "agent_parser.h"
43
44
45// Unqualified %code blocks.
46#line 33 "agent_parser.yy" // lalr1.cc:438
47
49
50#line 51 "agent_parser.cc" // lalr1.cc:438
51
52
53#ifndef YY_
54# if defined YYENABLE_NLS && YYENABLE_NLS
55# if ENABLE_NLS
56# include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
57# define YY_(msgid) dgettext ("bison-runtime", msgid)
58# endif
59# endif
60# ifndef YY_
61# define YY_(msgid) msgid
62# endif
63#endif
64
65// Whether we are compiled with exception support.
66#ifndef YY_EXCEPTIONS
67# if defined __GNUC__ && !defined __EXCEPTIONS
68# define YY_EXCEPTIONS 0
69# else
70# define YY_EXCEPTIONS 1
71# endif
72#endif
73
74#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
75/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
76 If N is 0, then set CURRENT to the empty location which ends
77 the previous symbol: RHS[0] (always defined). */
78
79# ifndef YYLLOC_DEFAULT
80# define YYLLOC_DEFAULT(Current, Rhs, N) \
81 do \
82 if (N) \
83 { \
84 (Current).begin = YYRHSLOC (Rhs, 1).begin; \
85 (Current).end = YYRHSLOC (Rhs, N).end; \
86 } \
87 else \
88 { \
89 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
90 } \
91 while (/*CONSTCOND*/ false)
92# endif
93
94
95// Suppress unused-variable warnings by "using" E.
96#define YYUSE(E) ((void) (E))
97
98// Enable debugging if requested.
99#if AGENT_DEBUG
100
101// A pseudo ostream that takes yydebug_ into account.
102# define YYCDEBUG if (yydebug_) (*yycdebug_)
103
104# define YY_SYMBOL_PRINT(Title, Symbol) \
105 do { \
106 if (yydebug_) \
107 { \
108 *yycdebug_ << Title << ' '; \
109 yy_print_ (*yycdebug_, Symbol); \
110 *yycdebug_ << '\n'; \
111 } \
112 } while (false)
113
114# define YY_REDUCE_PRINT(Rule) \
115 do { \
116 if (yydebug_) \
117 yy_reduce_print_ (Rule); \
118 } while (false)
119
120# define YY_STACK_PRINT() \
121 do { \
122 if (yydebug_) \
123 yystack_print_ (); \
124 } while (false)
125
126#else // !AGENT_DEBUG
127
128# define YYCDEBUG if (false) std::cerr
129# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol)
130# define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
131# define YY_STACK_PRINT() static_cast<void> (0)
132
133#endif // !AGENT_DEBUG
134
135#define yyerrok (yyerrstatus_ = 0)
136#define yyclearin (yyla.clear ())
137
138#define YYACCEPT goto yyacceptlab
139#define YYABORT goto yyabortlab
140#define YYERROR goto yyerrorlab
141#define YYRECOVERING() (!!yyerrstatus_)
142
143#line 14 "agent_parser.yy" // lalr1.cc:513
144namespace isc { namespace agent {
145#line 146 "agent_parser.cc" // lalr1.cc:513
146
147 /* Return YYSTR after stripping away unnecessary quotes and
148 backslashes, so that it's suitable for yyerror. The heuristic is
149 that double-quoting is unnecessary unless the string contains an
150 apostrophe, a comma, or backslash (other than backslash-backslash).
151 YYSTR is taken from yytname. */
152 std::string
153 AgentParser::yytnamerr_ (const char *yystr)
154 {
155 if (*yystr == '"')
156 {
157 std::string yyr = "";
158 char const *yyp = yystr;
159
160 for (;;)
161 switch (*++yyp)
162 {
163 case '\'':
164 case ',':
165 goto do_not_strip_quotes;
166
167 case '\\':
168 if (*++yyp != '\\')
169 goto do_not_strip_quotes;
170 // Fall through.
171 default:
172 yyr += *yyp;
173 break;
174
175 case '"':
176 return yyr;
177 }
178 do_not_strip_quotes: ;
179 }
180
181 return yystr;
182 }
183
184
187 :
189 yydebug_ (false),
190 yycdebug_ (&std::cerr),
191#endif
192 ctx (ctx_yyarg)
193 {}
194
196 {}
197
198
199 /*---------------.
200 | Symbol types. |
201 `---------------*/
202
203
204
205 // by_state.
206 AgentParser::by_state::by_state ()
207 : state (empty_state)
208 {}
209
210 AgentParser::by_state::by_state (const by_state& other)
211 : state (other.state)
212 {}
213
214 void
215 AgentParser::by_state::clear ()
216 {
217 state = empty_state;
218 }
219
220 void
221 AgentParser::by_state::move (by_state& that)
222 {
223 state = that.state;
224 that.clear ();
225 }
226
227 AgentParser::by_state::by_state (state_type s)
228 : state (s)
229 {}
230
232 AgentParser::by_state::type_get () const
233 {
234 if (state == empty_state)
235 return empty_symbol;
236 else
237 return yystos_[state];
238 }
239
240 AgentParser::stack_symbol_type::stack_symbol_type ()
241 {}
242
243 AgentParser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
244 : super_type (YY_MOVE (that.state), YY_MOVE (that.location))
245 {
246 switch (that.type_get ())
247 {
248 case 53: // value
249 case 56: // map_value
250 case 107: // socket_type_value
251 value.YY_MOVE_OR_COPY< ElementPtr > (YY_MOVE (that.value));
252 break;
253
254 case 44: // "boolean"
255 value.YY_MOVE_OR_COPY< bool > (YY_MOVE (that.value));
256 break;
257
258 case 43: // "floating point"
259 value.YY_MOVE_OR_COPY< double > (YY_MOVE (that.value));
260 break;
261
262 case 42: // "integer"
263 value.YY_MOVE_OR_COPY< int64_t > (YY_MOVE (that.value));
264 break;
265
266 case 41: // "constant string"
267 value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value));
268 break;
269
270 default:
271 break;
272 }
273
274#if 201103L <= YY_CPLUSPLUS
275 // that is emptied.
276 that.state = empty_state;
277#endif
278 }
279
280 AgentParser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
281 : super_type (s, YY_MOVE (that.location))
282 {
283 switch (that.type_get ())
284 {
285 case 53: // value
286 case 56: // map_value
287 case 107: // socket_type_value
288 value.move< ElementPtr > (YY_MOVE (that.value));
289 break;
290
291 case 44: // "boolean"
292 value.move< bool > (YY_MOVE (that.value));
293 break;
294
295 case 43: // "floating point"
296 value.move< double > (YY_MOVE (that.value));
297 break;
298
299 case 42: // "integer"
300 value.move< int64_t > (YY_MOVE (that.value));
301 break;
302
303 case 41: // "constant string"
304 value.move< std::string > (YY_MOVE (that.value));
305 break;
306
307 default:
308 break;
309 }
310
311 // that is emptied.
312 that.type = empty_symbol;
313 }
314
315#if YY_CPLUSPLUS < 201103L
316 AgentParser::stack_symbol_type&
317 AgentParser::stack_symbol_type::operator= (stack_symbol_type& that)
318 {
319 state = that.state;
320 switch (that.type_get ())
321 {
322 case 53: // value
323 case 56: // map_value
324 case 107: // socket_type_value
325 value.move< ElementPtr > (that.value);
326 break;
327
328 case 44: // "boolean"
329 value.move< bool > (that.value);
330 break;
331
332 case 43: // "floating point"
333 value.move< double > (that.value);
334 break;
335
336 case 42: // "integer"
337 value.move< int64_t > (that.value);
338 break;
339
340 case 41: // "constant string"
341 value.move< std::string > (that.value);
342 break;
343
344 default:
345 break;
346 }
347
348 location = that.location;
349 // that is emptied.
350 that.state = empty_state;
351 return *this;
352 }
353#endif
354
355 template <typename Base>
356 void
357 AgentParser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
358 {
359 if (yymsg)
360 YY_SYMBOL_PRINT (yymsg, yysym);
361 }
362
363#if AGENT_DEBUG
364 template <typename Base>
365 void
366 AgentParser::yy_print_ (std::ostream& yyo,
367 const basic_symbol<Base>& yysym) const
368 {
369 std::ostream& yyoutput = yyo;
370 YYUSE (yyoutput);
371 symbol_number_type yytype = yysym.type_get ();
372 // Avoid a (spurious) G++ 4.8 warning about "array subscript is
373 // below array bounds".
374 if (yysym.empty ())
375 std::abort ();
376 yyo << (yytype < yyntokens_ ? "token" : "nterm")
377 << ' ' << yytname_[yytype] << " ("
378 << yysym.location << ": ";
379 switch (yytype)
380 {
381 case 41: // "constant string"
382
383#line 103 "agent_parser.yy" // lalr1.cc:672
384 { yyoutput << yysym.value.template as< std::string > (); }
385#line 386 "agent_parser.cc" // lalr1.cc:672
386 break;
387
388 case 42: // "integer"
389
390#line 103 "agent_parser.yy" // lalr1.cc:672
391 { yyoutput << yysym.value.template as< int64_t > (); }
392#line 393 "agent_parser.cc" // lalr1.cc:672
393 break;
394
395 case 43: // "floating point"
396
397#line 103 "agent_parser.yy" // lalr1.cc:672
398 { yyoutput << yysym.value.template as< double > (); }
399#line 400 "agent_parser.cc" // lalr1.cc:672
400 break;
401
402 case 44: // "boolean"
403
404#line 103 "agent_parser.yy" // lalr1.cc:672
405 { yyoutput << yysym.value.template as< bool > (); }
406#line 407 "agent_parser.cc" // lalr1.cc:672
407 break;
408
409 case 53: // value
410
411#line 103 "agent_parser.yy" // lalr1.cc:672
412 { yyoutput << yysym.value.template as< ElementPtr > (); }
413#line 414 "agent_parser.cc" // lalr1.cc:672
414 break;
415
416 case 56: // map_value
417
418#line 103 "agent_parser.yy" // lalr1.cc:672
419 { yyoutput << yysym.value.template as< ElementPtr > (); }
420#line 421 "agent_parser.cc" // lalr1.cc:672
421 break;
422
423 case 107: // socket_type_value
424
425#line 103 "agent_parser.yy" // lalr1.cc:672
426 { yyoutput << yysym.value.template as< ElementPtr > (); }
427#line 428 "agent_parser.cc" // lalr1.cc:672
428 break;
429
430
431 default:
432 break;
433 }
434 yyo << ')';
435 }
436#endif
437
438 void
439 AgentParser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
440 {
441 if (m)
442 YY_SYMBOL_PRINT (m, sym);
443 yystack_.push (YY_MOVE (sym));
444 }
445
446 void
447 AgentParser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
448 {
449#if 201103L <= YY_CPLUSPLUS
450 yypush_ (m, stack_symbol_type (s, std::move (sym)));
451#else
452 stack_symbol_type ss (s, sym);
453 yypush_ (m, ss);
454#endif
455 }
456
457 void
458 AgentParser::yypop_ (int n)
459 {
460 yystack_.pop (n);
461 }
462
463#if AGENT_DEBUG
464 std::ostream&
465 AgentParser::debug_stream () const
466 {
467 return *yycdebug_;
468 }
469
470 void
471 AgentParser::set_debug_stream (std::ostream& o)
472 {
473 yycdebug_ = &o;
474 }
475
476
477 AgentParser::debug_level_type
478 AgentParser::debug_level () const
479 {
480 return yydebug_;
481 }
482
483 void
484 AgentParser::set_debug_level (debug_level_type l)
485 {
486 yydebug_ = l;
487 }
488#endif // AGENT_DEBUG
489
490 AgentParser::state_type
491 AgentParser::yy_lr_goto_state_ (state_type yystate, int yysym)
492 {
493 int yyr = yypgoto_[yysym - yyntokens_] + yystate;
494 if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
495 return yytable_[yyr];
496 else
497 return yydefgoto_[yysym - yyntokens_];
498 }
499
500 bool
501 AgentParser::yy_pact_value_is_default_ (int yyvalue)
502 {
503 return yyvalue == yypact_ninf_;
504 }
505
506 bool
507 AgentParser::yy_table_value_is_error_ (int yyvalue)
508 {
509 return yyvalue == yytable_ninf_;
510 }
511
512 int
514 {
515 return parse ();
516 }
517
518 int
520 {
521 // State.
522 int yyn;
524 int yylen = 0;
525
526 // Error handling.
527 int yynerrs_ = 0;
528 int yyerrstatus_ = 0;
529
531 symbol_type yyla;
532
534 stack_symbol_type yyerror_range[3];
535
537 int yyresult;
538
539#if YY_EXCEPTIONS
540 try
541#endif // YY_EXCEPTIONS
542 {
543 YYCDEBUG << "Starting parse\n";
544
545
546 /* Initialize the stack. The initial state will be set in
547 yynewstate, since the latter expects the semantical and the
548 location values to have been already stored, initialize these
549 stacks with a primary value. */
550 yystack_.clear ();
551 yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
552
553 // A new symbol was pushed on the stack.
554 yynewstate:
555 YYCDEBUG << "Entering state " << yystack_[0].state << '\n';
556
557 // Accept?
558 if (yystack_[0].state == yyfinal_)
559 goto yyacceptlab;
560
561 goto yybackup;
562
563 // Backup.
564 yybackup:
565 // Try to take a decision without lookahead.
566 yyn = yypact_[yystack_[0].state];
567 if (yy_pact_value_is_default_ (yyn))
568 goto yydefault;
569
570 // Read a lookahead token.
571 if (yyla.empty ())
572 {
573 YYCDEBUG << "Reading a token: ";
574#if YY_EXCEPTIONS
575 try
576#endif // YY_EXCEPTIONS
577 {
578 symbol_type yylookahead (yylex (ctx));
579 yyla.move (yylookahead);
580 }
581#if YY_EXCEPTIONS
582 catch (const syntax_error& yyexc)
583 {
584 error (yyexc);
585 goto yyerrlab1;
586 }
587#endif // YY_EXCEPTIONS
588 }
589 YY_SYMBOL_PRINT ("Next token is", yyla);
590
591 /* If the proper action on seeing token YYLA.TYPE is to reduce or
592 to detect an error, take that action. */
593 yyn += yyla.type_get ();
594 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ())
595 goto yydefault;
596
597 // Reduce or error.
598 yyn = yytable_[yyn];
599 if (yyn <= 0)
600 {
601 if (yy_table_value_is_error_ (yyn))
602 goto yyerrlab;
603 yyn = -yyn;
604 goto yyreduce;
605 }
606
607 // Count tokens shifted since error; after three, turn off error status.
608 if (yyerrstatus_)
609 --yyerrstatus_;
610
611 // Shift the lookahead token.
612 yypush_ ("Shifting", yyn, YY_MOVE (yyla));
613 goto yynewstate;
614
615 /*-----------------------------------------------------------.
616 | yydefault -- do the default action for the current state. |
617 `-----------------------------------------------------------*/
618 yydefault:
619 yyn = yydefact_[yystack_[0].state];
620 if (yyn == 0)
621 goto yyerrlab;
622 goto yyreduce;
623
624 /*-----------------------------.
625 | yyreduce -- Do a reduction. |
626 `-----------------------------*/
627 yyreduce:
628 yylen = yyr2_[yyn];
629 {
630 stack_symbol_type yylhs;
631 yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
632 /* Variants are always initialized to an empty instance of the
633 correct type. The default '$$ = $1' action is NOT applied
634 when using variants. */
635 switch (yyr1_[yyn])
636 {
637 case 53: // value
638 case 56: // map_value
639 case 107: // socket_type_value
640 yylhs.value.emplace< ElementPtr > ();
641 break;
642
643 case 44: // "boolean"
644 yylhs.value.emplace< bool > ();
645 break;
646
647 case 43: // "floating point"
648 yylhs.value.emplace< double > ();
649 break;
650
651 case 42: // "integer"
652 yylhs.value.emplace< int64_t > ();
653 break;
654
655 case 41: // "constant string"
656 yylhs.value.emplace< std::string > ();
657 break;
658
659 default:
660 break;
661 }
662
663
664 // Default location.
665 {
667 YYLLOC_DEFAULT (yylhs.location, slice, yylen);
668 yyerror_range[1].location = yylhs.location;
669 }
670
671 // Perform the reduction.
672 YY_REDUCE_PRINT (yyn);
673#if YY_EXCEPTIONS
674 try
675#endif // YY_EXCEPTIONS
676 {
677 switch (yyn)
678 {
679 case 2:
680#line 114 "agent_parser.yy" // lalr1.cc:907
681 { ctx.ctx_ = ctx.NO_KEYWORDS; }
682#line 683 "agent_parser.cc" // lalr1.cc:907
683 break;
684
685 case 4:
686#line 115 "agent_parser.yy" // lalr1.cc:907
687 { ctx.ctx_ = ctx.CONFIG; }
688#line 689 "agent_parser.cc" // lalr1.cc:907
689 break;
690
691 case 6:
692#line 116 "agent_parser.yy" // lalr1.cc:907
693 { ctx.ctx_ = ctx.AGENT; }
694#line 695 "agent_parser.cc" // lalr1.cc:907
695 break;
696
697 case 8:
698#line 124 "agent_parser.yy" // lalr1.cc:907
699 {
700 // Parse the Control-agent map
701 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
702 ctx.stack_.push_back(m);
703}
704#line 705 "agent_parser.cc" // lalr1.cc:907
705 break;
706
707 case 9:
708#line 128 "agent_parser.yy" // lalr1.cc:907
709 {
710 // parsing completed
711}
712#line 713 "agent_parser.cc" // lalr1.cc:907
713 break;
714
715 case 10:
716#line 135 "agent_parser.yy" // lalr1.cc:907
717 {
718 // Push back the JSON value on the stack
719 ctx.stack_.push_back(yystack_[0].value.as< ElementPtr > ());
720}
721#line 722 "agent_parser.cc" // lalr1.cc:907
722 break;
723
724 case 11:
725#line 141 "agent_parser.yy" // lalr1.cc:907
726 { yylhs.value.as< ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); }
727#line 728 "agent_parser.cc" // lalr1.cc:907
728 break;
729
730 case 12:
731#line 142 "agent_parser.yy" // lalr1.cc:907
732 { yylhs.value.as< ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as< double > (), ctx.loc2pos(yystack_[0].location))); }
733#line 734 "agent_parser.cc" // lalr1.cc:907
734 break;
735
736 case 13:
737#line 143 "agent_parser.yy" // lalr1.cc:907
738 { yylhs.value.as< ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); }
739#line 740 "agent_parser.cc" // lalr1.cc:907
740 break;
741
742 case 14:
743#line 144 "agent_parser.yy" // lalr1.cc:907
744 { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); }
745#line 746 "agent_parser.cc" // lalr1.cc:907
746 break;
747
748 case 15:
749#line 145 "agent_parser.yy" // lalr1.cc:907
750 { yylhs.value.as< ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); }
751#line 752 "agent_parser.cc" // lalr1.cc:907
752 break;
753
754 case 16:
755#line 146 "agent_parser.yy" // lalr1.cc:907
756 { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
757#line 758 "agent_parser.cc" // lalr1.cc:907
758 break;
759
760 case 17:
761#line 147 "agent_parser.yy" // lalr1.cc:907
762 { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
763#line 764 "agent_parser.cc" // lalr1.cc:907
764 break;
765
766 case 18:
767#line 151 "agent_parser.yy" // lalr1.cc:907
768 {
769 // This code is executed when we're about to start parsing
770 // the content of the map
771 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
772 ctx.stack_.push_back(m);
773}
774#line 775 "agent_parser.cc" // lalr1.cc:907
775 break;
776
777 case 19:
778#line 156 "agent_parser.yy" // lalr1.cc:907
779 {
780 // map parsing completed. If we ever want to do any wrap up
781 // (maybe some sanity checking), this would be the best place
782 // for it.
783}
784#line 785 "agent_parser.cc" // lalr1.cc:907
785 break;
786
787 case 20:
788#line 162 "agent_parser.yy" // lalr1.cc:907
789 { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
790#line 791 "agent_parser.cc" // lalr1.cc:907
791 break;
792
793 case 23:
794#line 176 "agent_parser.yy" // lalr1.cc:907
795 {
796 // map containing a single entry
797 ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ());
798 }
799#line 800 "agent_parser.cc" // lalr1.cc:907
800 break;
801
802 case 24:
803#line 180 "agent_parser.yy" // lalr1.cc:907
804 {
805 // map consisting of a shorter map followed by
806 // comma and string:value
807 ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ());
808 }
809#line 810 "agent_parser.cc" // lalr1.cc:907
810 break;
811
812 case 25:
813#line 187 "agent_parser.yy" // lalr1.cc:907
814 {
815 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
816 ctx.stack_.push_back(l);
817}
818#line 819 "agent_parser.cc" // lalr1.cc:907
819 break;
820
821 case 26:
822#line 190 "agent_parser.yy" // lalr1.cc:907
823 {
824}
825#line 826 "agent_parser.cc" // lalr1.cc:907
826 break;
827
828 case 29:
829#line 197 "agent_parser.yy" // lalr1.cc:907
830 {
831 // List consisting of a single element.
832 ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ());
833 }
834#line 835 "agent_parser.cc" // lalr1.cc:907
835 break;
836
837 case 30:
838#line 201 "agent_parser.yy" // lalr1.cc:907
839 {
840 // List ending with , and a value.
841 ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ());
842 }
843#line 844 "agent_parser.cc" // lalr1.cc:907
844 break;
845
846 case 31:
847#line 214 "agent_parser.yy" // lalr1.cc:907
848 {
849 const std::string& where = ctx.contextName();
850 const std::string& keyword = yystack_[1].value.as< std::string > ();
851 error(yystack_[1].location,
852 "got unexpected keyword \"" + keyword + "\" in " + where + " map.");
853}
854#line 855 "agent_parser.cc" // lalr1.cc:907
855 break;
856
857 case 32:
858#line 223 "agent_parser.yy" // lalr1.cc:907
859 {
860 // This code is executed when we're about to start parsing
861 // the content of the map
862 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
863 ctx.stack_.push_back(m);
864}
865#line 866 "agent_parser.cc" // lalr1.cc:907
866 break;
867
868 case 33:
869#line 228 "agent_parser.yy" // lalr1.cc:907
870 {
871 // map parsing completed. If we ever want to do any wrap up
872 // (maybe some sanity checking), this would be the best place
873 // for it.
874}
875#line 876 "agent_parser.cc" // lalr1.cc:907
876 break;
877
878 case 42:
879#line 249 "agent_parser.yy" // lalr1.cc:907
880 {
881
882 // Let's create a MapElement that will represent it, add it to the
883 // top level map (that's already on the stack) and put the new map
884 // on the stack as well, so child elements will be able to add
885 // themselves to it.
886 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
887 ctx.stack_.back()->set("Control-agent", m);
888 ctx.stack_.push_back(m);
889 ctx.enter(ctx.AGENT);
890}
891#line 892 "agent_parser.cc" // lalr1.cc:907
892 break;
893
894 case 43:
895#line 259 "agent_parser.yy" // lalr1.cc:907
896 {
897 // Ok, we're done with parsing control-agent. Let's take the map
898 // off the stack.
899 ctx.stack_.pop_back();
900 ctx.leave();
901}
902#line 903 "agent_parser.cc" // lalr1.cc:907
903 break;
904
905 case 53:
906#line 281 "agent_parser.yy" // lalr1.cc:907
907 {
908 ctx.enter(ctx.NO_KEYWORDS);
909}
910#line 911 "agent_parser.cc" // lalr1.cc:907
911 break;
912
913 case 54:
914#line 283 "agent_parser.yy" // lalr1.cc:907
915 {
916 ElementPtr host(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
917 ctx.stack_.back()->set("http-host", host);
918 ctx.leave();
919}
920#line 921 "agent_parser.cc" // lalr1.cc:907
921 break;
922
923 case 55:
924#line 289 "agent_parser.yy" // lalr1.cc:907
925 {
926 ElementPtr prf(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
927 ctx.stack_.back()->set("http-port", prf);
928}
929#line 930 "agent_parser.cc" // lalr1.cc:907
930 break;
931
932 case 56:
933#line 294 "agent_parser.yy" // lalr1.cc:907
934 {
935 ctx.enter(ctx.NO_KEYWORDS);
936}
937#line 938 "agent_parser.cc" // lalr1.cc:907
938 break;
939
940 case 57:
941#line 296 "agent_parser.yy" // lalr1.cc:907
942 {
943 ElementPtr parent = ctx.stack_.back();
944 ElementPtr user_context = yystack_[0].value.as< ElementPtr > ();
945 ConstElementPtr old = parent->get("user-context");
946
947 // Handle already existing user context
948 if (old) {
949 // Check if it was a comment or a duplicate
950 if ((old->size() != 1) || !old->contains("comment")) {
951 std::stringstream msg;
952 msg << "duplicate user-context entries (previous at "
953 << old->getPosition().str() << ")";
954 error(yystack_[3].location, msg.str());
955 }
956 // Merge the comment
957 user_context->set("comment", old->get("comment"));
958 }
959
960 // Set the user context
961 parent->set("user-context", user_context);
962 ctx.leave();
963}
964#line 965 "agent_parser.cc" // lalr1.cc:907
965 break;
966
967 case 58:
968#line 319 "agent_parser.yy" // lalr1.cc:907
969 {
970 ctx.enter(ctx.NO_KEYWORDS);
971}
972#line 973 "agent_parser.cc" // lalr1.cc:907
973 break;
974
975 case 59:
976#line 321 "agent_parser.yy" // lalr1.cc:907
977 {
978 ElementPtr parent = ctx.stack_.back();
979 ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location)));
980 ElementPtr comment(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
981 user_context->set("comment", comment);
982
983 // Handle already existing user context
984 ConstElementPtr old = parent->get("user-context");
985 if (old) {
986 // Check for duplicate comment
987 if (old->contains("comment")) {
988 std::stringstream msg;
989 msg << "duplicate user-context/comment entries (previous at "
990 << old->getPosition().str() << ")";
991 error(yystack_[3].location, msg.str());
992 }
993 // Merge the user context in the comment
994 merge(user_context, old);
995 }
996
997 // Set the user context
998 parent->set("user-context", user_context);
999 ctx.leave();
1000}
1001#line 1002 "agent_parser.cc" // lalr1.cc:907
1002 break;
1003
1004 case 60:
1005#line 347 "agent_parser.yy" // lalr1.cc:907
1006 {
1007 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1008 ctx.stack_.back()->set("hooks-libraries", l);
1009 ctx.stack_.push_back(l);
1010 ctx.enter(ctx.HOOKS_LIBRARIES);
1011}
1012#line 1013 "agent_parser.cc" // lalr1.cc:907
1013 break;
1014
1015 case 61:
1016#line 352 "agent_parser.yy" // lalr1.cc:907
1017 {
1018 ctx.stack_.pop_back();
1019 ctx.leave();
1020}
1021#line 1022 "agent_parser.cc" // lalr1.cc:907
1022 break;
1023
1024 case 66:
1025#line 365 "agent_parser.yy" // lalr1.cc:907
1026 {
1027 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1028 ctx.stack_.back()->add(m);
1029 ctx.stack_.push_back(m);
1030}
1031#line 1032 "agent_parser.cc" // lalr1.cc:907
1032 break;
1033
1034 case 67:
1035#line 369 "agent_parser.yy" // lalr1.cc:907
1036 {
1037 ctx.stack_.pop_back();
1038}
1039#line 1040 "agent_parser.cc" // lalr1.cc:907
1040 break;
1041
1042 case 73:
1043#line 382 "agent_parser.yy" // lalr1.cc:907
1044 {
1045 ctx.enter(ctx.NO_KEYWORDS);
1046}
1047#line 1048 "agent_parser.cc" // lalr1.cc:907
1048 break;
1049
1050 case 74:
1051#line 384 "agent_parser.yy" // lalr1.cc:907
1052 {
1053 ElementPtr lib(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1054 ctx.stack_.back()->set("library", lib);
1055 ctx.leave();
1056}
1057#line 1058 "agent_parser.cc" // lalr1.cc:907
1058 break;
1059
1060 case 75:
1061#line 390 "agent_parser.yy" // lalr1.cc:907
1062 {
1063 ctx.enter(ctx.NO_KEYWORDS);
1064}
1065#line 1066 "agent_parser.cc" // lalr1.cc:907
1066 break;
1067
1068 case 76:
1069#line 392 "agent_parser.yy" // lalr1.cc:907
1070 {
1071 ctx.stack_.back()->set("parameters", yystack_[0].value.as< ElementPtr > ());
1072 ctx.leave();
1073}
1074#line 1075 "agent_parser.cc" // lalr1.cc:907
1075 break;
1076
1077 case 77:
1078#line 400 "agent_parser.yy" // lalr1.cc:907
1079 {
1080 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[2].location)));
1081 ctx.stack_.back()->set("control-sockets", m);
1082 ctx.stack_.push_back(m);
1083 ctx.enter(ctx.CONTROL_SOCKETS);
1084}
1085#line 1086 "agent_parser.cc" // lalr1.cc:907
1086 break;
1087
1088 case 78:
1089#line 405 "agent_parser.yy" // lalr1.cc:907
1090 {
1091 ctx.stack_.pop_back();
1092 ctx.leave();
1093}
1094#line 1095 "agent_parser.cc" // lalr1.cc:907
1095 break;
1096
1097 case 85:
1098#line 426 "agent_parser.yy" // lalr1.cc:907
1099 {
1100 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1101 ctx.stack_.back()->set("dhcp4", m);
1102 ctx.stack_.push_back(m);
1103 ctx.enter(ctx.SERVER);
1104}
1105#line 1106 "agent_parser.cc" // lalr1.cc:907
1106 break;
1107
1108 case 86:
1109#line 431 "agent_parser.yy" // lalr1.cc:907
1110 {
1111 ctx.stack_.pop_back();
1112 ctx.leave();
1113}
1114#line 1115 "agent_parser.cc" // lalr1.cc:907
1115 break;
1116
1117 case 87:
1118#line 437 "agent_parser.yy" // lalr1.cc:907
1119 {
1120 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1121 ctx.stack_.back()->set("dhcp6", m);
1122 ctx.stack_.push_back(m);
1123 ctx.enter(ctx.SERVER);
1124}
1125#line 1126 "agent_parser.cc" // lalr1.cc:907
1126 break;
1127
1128 case 88:
1129#line 442 "agent_parser.yy" // lalr1.cc:907
1130 {
1131 ctx.stack_.pop_back();
1132 ctx.leave();
1133}
1134#line 1135 "agent_parser.cc" // lalr1.cc:907
1135 break;
1136
1137 case 89:
1138#line 448 "agent_parser.yy" // lalr1.cc:907
1139 {
1140 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1141 ctx.stack_.back()->set("d2", m);
1142 ctx.stack_.push_back(m);
1143 ctx.enter(ctx.SERVER);
1144}
1145#line 1146 "agent_parser.cc" // lalr1.cc:907
1146 break;
1147
1148 case 90:
1149#line 453 "agent_parser.yy" // lalr1.cc:907
1150 {
1151 ctx.stack_.pop_back();
1152 ctx.leave();
1153}
1154#line 1155 "agent_parser.cc" // lalr1.cc:907
1155 break;
1156
1157 case 98:
1158#line 472 "agent_parser.yy" // lalr1.cc:907
1159 {
1160 ctx.enter(ctx.NO_KEYWORDS);
1161}
1162#line 1163 "agent_parser.cc" // lalr1.cc:907
1163 break;
1164
1165 case 99:
1166#line 474 "agent_parser.yy" // lalr1.cc:907
1167 {
1168 ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1169 ctx.stack_.back()->set("socket-name", name);
1170 ctx.leave();
1171}
1172#line 1173 "agent_parser.cc" // lalr1.cc:907
1173 break;
1174
1175 case 100:
1176#line 481 "agent_parser.yy" // lalr1.cc:907
1177 {
1178 ctx.enter(ctx.SOCKET_TYPE);
1179}
1180#line 1181 "agent_parser.cc" // lalr1.cc:907
1181 break;
1182
1183 case 101:
1184#line 483 "agent_parser.yy" // lalr1.cc:907
1185 {
1186 ctx.stack_.back()->set("socket-type", yystack_[0].value.as< ElementPtr > ());
1187 ctx.leave();
1188}
1189#line 1190 "agent_parser.cc" // lalr1.cc:907
1190 break;
1191
1192 case 102:
1193#line 489 "agent_parser.yy" // lalr1.cc:907
1194 { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("unix", ctx.loc2pos(yystack_[0].location))); }
1195#line 1196 "agent_parser.cc" // lalr1.cc:907
1196 break;
1197
1198 case 103:
1199#line 495 "agent_parser.yy" // lalr1.cc:907
1200 {
1201 ctx.enter(ctx.NO_KEYWORDS);
1202}
1203#line 1204 "agent_parser.cc" // lalr1.cc:907
1204 break;
1205
1206 case 104:
1207#line 497 "agent_parser.yy" // lalr1.cc:907
1208 {
1209 ctx.stack_.back()->set("Dhcp4", yystack_[0].value.as< ElementPtr > ());
1210 ctx.leave();
1211}
1212#line 1213 "agent_parser.cc" // lalr1.cc:907
1213 break;
1214
1215 case 105:
1216#line 502 "agent_parser.yy" // lalr1.cc:907
1217 {
1218 ctx.enter(ctx.NO_KEYWORDS);
1219}
1220#line 1221 "agent_parser.cc" // lalr1.cc:907
1221 break;
1222
1223 case 106:
1224#line 504 "agent_parser.yy" // lalr1.cc:907
1225 {
1226 ctx.stack_.back()->set("Dhcp6", yystack_[0].value.as< ElementPtr > ());
1227 ctx.leave();
1228}
1229#line 1230 "agent_parser.cc" // lalr1.cc:907
1230 break;
1231
1232 case 107:
1233#line 509 "agent_parser.yy" // lalr1.cc:907
1234 {
1235 ctx.enter(ctx.NO_KEYWORDS);
1236}
1237#line 1238 "agent_parser.cc" // lalr1.cc:907
1238 break;
1239
1240 case 108:
1241#line 511 "agent_parser.yy" // lalr1.cc:907
1242 {
1243 ctx.stack_.back()->set("DhcpDdns", yystack_[0].value.as< ElementPtr > ());
1244 ctx.leave();
1245}
1246#line 1247 "agent_parser.cc" // lalr1.cc:907
1247 break;
1248
1249 case 109:
1250#line 521 "agent_parser.yy" // lalr1.cc:907
1251 {
1252 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1253 ctx.stack_.back()->set("Logging", m);
1254 ctx.stack_.push_back(m);
1255 ctx.enter(ctx.LOGGING);
1256}
1257#line 1258 "agent_parser.cc" // lalr1.cc:907
1258 break;
1259
1260 case 110:
1261#line 526 "agent_parser.yy" // lalr1.cc:907
1262 {
1263 ctx.stack_.pop_back();
1264 ctx.leave();
1265}
1266#line 1267 "agent_parser.cc" // lalr1.cc:907
1267 break;
1268
1269 case 114:
1270#line 543 "agent_parser.yy" // lalr1.cc:907
1271 {
1272 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1273 ctx.stack_.back()->set("loggers", l);
1274 ctx.stack_.push_back(l);
1275 ctx.enter(ctx.LOGGERS);
1276}
1277#line 1278 "agent_parser.cc" // lalr1.cc:907
1278 break;
1279
1280 case 115:
1281#line 548 "agent_parser.yy" // lalr1.cc:907
1282 {
1283 ctx.stack_.pop_back();
1284 ctx.leave();
1285}
1286#line 1287 "agent_parser.cc" // lalr1.cc:907
1287 break;
1288
1289 case 118:
1290#line 560 "agent_parser.yy" // lalr1.cc:907
1291 {
1292 ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
1293 ctx.stack_.back()->add(l);
1294 ctx.stack_.push_back(l);
1295}
1296#line 1297 "agent_parser.cc" // lalr1.cc:907
1297 break;
1298
1299 case 119:
1300#line 564 "agent_parser.yy" // lalr1.cc:907
1301 {
1302 ctx.stack_.pop_back();
1303}
1304#line 1305 "agent_parser.cc" // lalr1.cc:907
1305 break;
1306
1307 case 129:
1308#line 581 "agent_parser.yy" // lalr1.cc:907
1309 {
1310 ctx.enter(ctx.NO_KEYWORDS);
1311}
1312#line 1313 "agent_parser.cc" // lalr1.cc:907
1313 break;
1314
1315 case 130:
1316#line 583 "agent_parser.yy" // lalr1.cc:907
1317 {
1318 ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1319 ctx.stack_.back()->set("name", name);
1320 ctx.leave();
1321}
1322#line 1323 "agent_parser.cc" // lalr1.cc:907
1323 break;
1324
1325 case 131:
1326#line 589 "agent_parser.yy" // lalr1.cc:907
1327 {
1328 ElementPtr dl(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1329 ctx.stack_.back()->set("debuglevel", dl);
1330}
1331#line 1332 "agent_parser.cc" // lalr1.cc:907
1332 break;
1333
1334 case 132:
1335#line 594 "agent_parser.yy" // lalr1.cc:907
1336 {
1337 ctx.enter(ctx.NO_KEYWORDS);
1338}
1339#line 1340 "agent_parser.cc" // lalr1.cc:907
1340 break;
1341
1342 case 133:
1343#line 596 "agent_parser.yy" // lalr1.cc:907
1344 {
1345 ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1346 ctx.stack_.back()->set("severity", sev);
1347 ctx.leave();
1348}
1349#line 1350 "agent_parser.cc" // lalr1.cc:907
1350 break;
1351
1352 case 134:
1353#line 602 "agent_parser.yy" // lalr1.cc:907
1354 {
1355 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1356 ctx.stack_.back()->set("output_options", l);
1357 ctx.stack_.push_back(l);
1358 ctx.enter(ctx.OUTPUT_OPTIONS);
1359}
1360#line 1361 "agent_parser.cc" // lalr1.cc:907
1361 break;
1362
1363 case 135:
1364#line 607 "agent_parser.yy" // lalr1.cc:907
1365 {
1366 ctx.stack_.pop_back();
1367 ctx.leave();
1368}
1369#line 1370 "agent_parser.cc" // lalr1.cc:907
1370 break;
1371
1372 case 138:
1373#line 616 "agent_parser.yy" // lalr1.cc:907
1374 {
1375 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1376 ctx.stack_.back()->add(m);
1377 ctx.stack_.push_back(m);
1378}
1379#line 1380 "agent_parser.cc" // lalr1.cc:907
1380 break;
1381
1382 case 139:
1383#line 620 "agent_parser.yy" // lalr1.cc:907
1384 {
1385 ctx.stack_.pop_back();
1386}
1387#line 1388 "agent_parser.cc" // lalr1.cc:907
1388 break;
1389
1390 case 146:
1391#line 634 "agent_parser.yy" // lalr1.cc:907
1392 {
1393 ctx.enter(ctx.NO_KEYWORDS);
1394}
1395#line 1396 "agent_parser.cc" // lalr1.cc:907
1396 break;
1397
1398 case 147:
1399#line 636 "agent_parser.yy" // lalr1.cc:907
1400 {
1401 ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1402 ctx.stack_.back()->set("output", sev);
1403 ctx.leave();
1404}
1405#line 1406 "agent_parser.cc" // lalr1.cc:907
1406 break;
1407
1408 case 148:
1409#line 642 "agent_parser.yy" // lalr1.cc:907
1410 {
1411 ElementPtr flush(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
1412 ctx.stack_.back()->set("flush", flush);
1413}
1414#line 1415 "agent_parser.cc" // lalr1.cc:907
1415 break;
1416
1417 case 149:
1418#line 647 "agent_parser.yy" // lalr1.cc:907
1419 {
1420 ElementPtr maxsize(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1421 ctx.stack_.back()->set("maxsize", maxsize);
1422}
1423#line 1424 "agent_parser.cc" // lalr1.cc:907
1424 break;
1425
1426 case 150:
1427#line 652 "agent_parser.yy" // lalr1.cc:907
1428 {
1429 ElementPtr maxver(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1430 ctx.stack_.back()->set("maxver", maxver);
1431}
1432#line 1433 "agent_parser.cc" // lalr1.cc:907
1433 break;
1434
1435
1436#line 1437 "agent_parser.cc" // lalr1.cc:907
1437 default:
1438 break;
1439 }
1440 }
1441#if YY_EXCEPTIONS
1442 catch (const syntax_error& yyexc)
1443 {
1444 error (yyexc);
1445 YYERROR;
1446 }
1447#endif // YY_EXCEPTIONS
1448 YY_SYMBOL_PRINT ("-> $$ =", yylhs);
1449 yypop_ (yylen);
1450 yylen = 0;
1451 YY_STACK_PRINT ();
1452
1453 // Shift the result of the reduction.
1454 yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
1455 }
1456 goto yynewstate;
1457
1458 /*--------------------------------------.
1459 | yyerrlab -- here on detecting error. |
1460 `--------------------------------------*/
1461 yyerrlab:
1462 // If not already recovering from an error, report this error.
1463 if (!yyerrstatus_)
1464 {
1465 ++yynerrs_;
1466 error (yyla.location, yysyntax_error_ (yystack_[0].state, yyla));
1467 }
1468
1469
1470 yyerror_range[1].location = yyla.location;
1471 if (yyerrstatus_ == 3)
1472 {
1473 /* If just tried and failed to reuse lookahead token after an
1474 error, discard it. */
1475
1476 // Return failure if at end of input.
1477 if (yyla.type_get () == yyeof_)
1478 YYABORT;
1479 else if (!yyla.empty ())
1480 {
1481 yy_destroy_ ("Error: discarding", yyla);
1482 yyla.clear ();
1483 }
1484 }
1485
1486 // Else will try to reuse lookahead token after shifting the error token.
1487 goto yyerrlab1;
1488
1489
1490 /*---------------------------------------------------.
1491 | yyerrorlab -- error raised explicitly by YYERROR. |
1492 `---------------------------------------------------*/
1493 yyerrorlab:
1494
1495 /* Pacify compilers like GCC when the user code never invokes
1496 YYERROR and the label yyerrorlab therefore never appears in user
1497 code. */
1498 if (false)
1499 goto yyerrorlab;
1500 /* Do not reclaim the symbols of the rule whose action triggered
1501 this YYERROR. */
1502 yypop_ (yylen);
1503 yylen = 0;
1504 goto yyerrlab1;
1505
1506 /*-------------------------------------------------------------.
1507 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1508 `-------------------------------------------------------------*/
1509 yyerrlab1:
1510 yyerrstatus_ = 3; // Each real token shifted decrements this.
1511 {
1512 stack_symbol_type error_token;
1513 for (;;)
1514 {
1515 yyn = yypact_[yystack_[0].state];
1516 if (!yy_pact_value_is_default_ (yyn))
1517 {
1518 yyn += yyterror_;
1519 if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
1520 {
1521 yyn = yytable_[yyn];
1522 if (0 < yyn)
1523 break;
1524 }
1525 }
1526
1527 // Pop the current state because it cannot handle the error token.
1528 if (yystack_.size () == 1)
1529 YYABORT;
1530
1531 yyerror_range[1].location = yystack_[0].location;
1532 yy_destroy_ ("Error: popping", yystack_[0]);
1533 yypop_ ();
1534 YY_STACK_PRINT ();
1535 }
1536
1537 yyerror_range[2].location = yyla.location;
1538 YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
1539
1540 // Shift the error token.
1541 error_token.state = yyn;
1542 yypush_ ("Shifting", YY_MOVE (error_token));
1543 }
1544 goto yynewstate;
1545
1546 // Accept.
1547 yyacceptlab:
1548 yyresult = 0;
1549 goto yyreturn;
1550
1551 // Abort.
1552 yyabortlab:
1553 yyresult = 1;
1554 goto yyreturn;
1555
1556 yyreturn:
1557 if (!yyla.empty ())
1558 yy_destroy_ ("Cleanup: discarding lookahead", yyla);
1559
1560 /* Do not reclaim the symbols of the rule whose action triggered
1561 this YYABORT or YYACCEPT. */
1562 yypop_ (yylen);
1563 while (1 < yystack_.size ())
1564 {
1565 yy_destroy_ ("Cleanup: popping", yystack_[0]);
1566 yypop_ ();
1567 }
1568
1569 return yyresult;
1570 }
1571#if YY_EXCEPTIONS
1572 catch (...)
1573 {
1574 YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
1575 // Do not try to display the values of the reclaimed symbols,
1576 // as their printers might throw an exception.
1577 if (!yyla.empty ())
1578 yy_destroy_ (YY_NULLPTR, yyla);
1579
1580 while (1 < yystack_.size ())
1581 {
1582 yy_destroy_ (YY_NULLPTR, yystack_[0]);
1583 yypop_ ();
1584 }
1585 throw;
1586 }
1587#endif // YY_EXCEPTIONS
1588 }
1589
1590 void
1592 {
1593 error (yyexc.location, yyexc.what ());
1594 }
1595
1596 // Generate an error message.
1597 std::string
1598 AgentParser::yysyntax_error_ (state_type yystate, const symbol_type& yyla) const
1599 {
1600 // Number of reported tokens (one for the "unexpected", one per
1601 // "expected").
1602 size_t yycount = 0;
1603 // Its maximum.
1604 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1605 // Arguments of yyformat.
1606 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1607
1608 /* There are many possibilities here to consider:
1609 - If this state is a consistent state with a default action, then
1610 the only way this function was invoked is if the default action
1611 is an error action. In that case, don't check for expected
1612 tokens because there are none.
1613 - The only way there can be no lookahead present (in yyla) is
1614 if this state is a consistent state with a default action.
1615 Thus, detecting the absence of a lookahead is sufficient to
1616 determine that there is no unexpected or expected token to
1617 report. In that case, just report a simple "syntax error".
1618 - Don't assume there isn't a lookahead just because this state is
1619 a consistent state with a default action. There might have
1620 been a previous inconsistent state, consistent state with a
1621 non-default action, or user semantic action that manipulated
1622 yyla. (However, yyla is currently not documented for users.)
1623 - Of course, the expected token list depends on states to have
1624 correct lookahead information, and it depends on the parser not
1625 to perform extra reductions after fetching a lookahead from the
1626 scanner and before detecting a syntax error. Thus, state
1627 merging (from LALR or IELR) and default reductions corrupt the
1628 expected token list. However, the list is correct for
1629 canonical LR with one exception: it will still contain any
1630 token that will not be accepted due to an error action in a
1631 later state.
1632 */
1633 if (!yyla.empty ())
1634 {
1635 int yytoken = yyla.type_get ();
1636 yyarg[yycount++] = yytname_[yytoken];
1637 int yyn = yypact_[yystate];
1638 if (!yy_pact_value_is_default_ (yyn))
1639 {
1640 /* Start YYX at -YYN if negative to avoid negative indexes in
1641 YYCHECK. In other words, skip the first -YYN actions for
1642 this state because they are default actions. */
1643 int yyxbegin = yyn < 0 ? -yyn : 0;
1644 // Stay within bounds of both yycheck and yytname.
1645 int yychecklim = yylast_ - yyn + 1;
1646 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
1647 for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
1648 if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
1649 && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
1650 {
1651 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1652 {
1653 yycount = 1;
1654 break;
1655 }
1656 else
1657 yyarg[yycount++] = yytname_[yyx];
1658 }
1659 }
1660 }
1661
1662 char const* yyformat = YY_NULLPTR;
1663 switch (yycount)
1664 {
1665#define YYCASE_(N, S) \
1666 case N: \
1667 yyformat = S; \
1668 break
1669 default: // Avoid compiler warnings.
1670 YYCASE_ (0, YY_("syntax error"));
1671 YYCASE_ (1, YY_("syntax error, unexpected %s"));
1672 YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s"));
1673 YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1674 YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1675 YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1676#undef YYCASE_
1677 }
1678
1679 std::string yyres;
1680 // Argument number.
1681 size_t yyi = 0;
1682 for (char const* yyp = yyformat; *yyp; ++yyp)
1683 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
1684 {
1685 yyres += yytnamerr_ (yyarg[yyi++]);
1686 ++yyp;
1687 }
1688 else
1689 yyres += *yyp;
1690 return yyres;
1691 }
1692
1693
1694 const signed char AgentParser::yypact_ninf_ = -68;
1695
1696 const signed char AgentParser::yytable_ninf_ = -1;
1697
1698 const short
1699 AgentParser::yypact_[] =
1700 {
1701 59, -68, -68, -68, 6, 8, 9, 34, -68, -68,
1702 -68, -68, -68, -68, -68, -68, -68, -68, -68, -68,
1703 -68, -68, -68, -68, 8, -29, -5, -4, -68, 41,
1704 51, 98, 85, 100, -68, -68, -68, -68, -68, 101,
1705 -68, 11, -68, -68, -68, -68, -68, -68, -68, 102,
1706 -68, -68, 103, -68, -68, 21, -68, -68, -68, -68,
1707 -68, -68, -68, -68, 8, 8, -68, 63, 104, 105,
1708 106, 107, 109, -68, -5, -68, 111, 74, 113, 114,
1709 112, 116, -4, -68, -68, -68, 117, 115, 118, 8,
1710 8, 8, -68, 83, -68, 119, 87, -68, 122, -68,
1711 8, -4, 97, -68, -68, -68, -68, -68, -68, -68,
1712 5, 123, -68, 64, -68, 65, -68, -68, -68, -68,
1713 -68, -68, 71, -68, -68, -68, -68, -68, 125, 126,
1714 -68, -68, 128, 97, -68, 129, 130, 131, 5, -68,
1715 37, -68, 123, 132, -68, 133, 134, 135, -68, -68,
1716 -68, -68, 78, -68, -68, -68, -68, 136, 14, 14,
1717 14, 140, 141, 42, -68, -68, 32, -68, -68, -68,
1718 -68, -68, -68, 79, -68, -68, -68, 80, 82, 95,
1719 8, -68, 12, 136, -68, 142, 143, 14, -68, -68,
1720 -68, -68, -68, -68, -68, 144, -68, -68, -68, -68,
1721 86, -68, -68, -68, -68, -68, -68, 108, 138, -68,
1722 146, 147, 96, 148, 12, -68, -68, -68, -68, 120,
1723 149, -68, 121, -68, -68, 156, -68, -68, 89, -68,
1724 30, 156, -68, -68, 151, 160, 161, 88, -68, -68,
1725 -68, -68, -68, -68, 162, 124, 127, 137, 30, -68,
1726 139, -68, -68, -68, -68, -68
1727 };
1728
1729 const unsigned char
1730 AgentParser::yydefact_[] =
1731 {
1732 0, 2, 4, 6, 0, 0, 0, 0, 1, 25,
1733 18, 15, 14, 11, 12, 13, 3, 10, 16, 17,
1734 32, 5, 8, 7, 27, 21, 0, 0, 29, 0,
1735 28, 0, 0, 22, 42, 109, 103, 105, 107, 0,
1736 41, 0, 34, 36, 38, 39, 40, 37, 53, 0,
1737 56, 58, 0, 60, 52, 0, 44, 46, 47, 50,
1738 51, 49, 48, 26, 0, 0, 19, 0, 0, 0,
1739 0, 0, 0, 31, 0, 33, 0, 0, 0, 0,
1740 0, 0, 0, 9, 30, 23, 0, 0, 0, 0,
1741 0, 0, 35, 0, 55, 0, 0, 77, 0, 45,
1742 0, 0, 0, 104, 106, 108, 54, 20, 57, 59,
1743 0, 62, 24, 0, 114, 0, 111, 113, 85, 87,
1744 89, 84, 0, 79, 81, 82, 83, 66, 0, 63,
1745 64, 43, 0, 0, 110, 0, 0, 0, 0, 78,
1746 0, 61, 0, 0, 112, 0, 0, 0, 80, 73,
1747 75, 70, 0, 68, 71, 72, 65, 0, 0, 0,
1748 0, 0, 0, 0, 67, 118, 0, 116, 98, 100,
1749 97, 95, 96, 0, 91, 93, 94, 0, 0, 0,
1750 0, 69, 0, 0, 115, 0, 0, 0, 86, 88,
1751 90, 74, 76, 129, 134, 0, 132, 128, 126, 127,
1752 0, 120, 122, 124, 125, 123, 117, 0, 0, 92,
1753 0, 0, 0, 0, 0, 119, 99, 102, 101, 0,
1754 0, 131, 0, 121, 130, 0, 133, 138, 0, 136,
1755 0, 0, 135, 146, 0, 0, 0, 0, 140, 142,
1756 143, 144, 145, 137, 0, 0, 0, 0, 0, 139,
1757 0, 148, 149, 150, 141, 147
1758 };
1759
1760 const signed char
1761 AgentParser::yypgoto_[] =
1762 {
1763 -68, -68, -68, -68, -68, -68, -68, -68, -20, 44,
1764 -68, -68, -68, -68, -68, -68, -68, -68, -26, -68,
1765 -68, -68, 93, -68, -68, 52, 90, -68, -68, -68,
1766 -25, -68, -24, -68, -68, -68, -68, -68, 28, -68,
1767 -68, 10, -68, -68, -68, -68, -68, -68, -68, 33,
1768 -68, -68, -68, -68, -68, -68, -59, -13, -68, -68,
1769 -68, -68, -68, -68, -68, -68, -68, -68, -68, -68,
1770 -68, -68, 43, -68, -68, -68, -8, -68, -68, -37,
1771 -68, -68, -68, -68, -68, -68, -68, -68, -53, -68,
1772 -68, -67, -68, -68, -68, -68, -68
1773 };
1774
1775 const short
1776 AgentParser::yydefgoto_[] =
1777 {
1778 -1, 4, 5, 6, 7, 23, 27, 16, 17, 18,
1779 25, 108, 32, 33, 19, 24, 29, 30, 170, 21,
1780 26, 41, 42, 43, 68, 55, 56, 57, 76, 58,
1781 171, 78, 172, 79, 61, 81, 128, 129, 130, 140,
1782 152, 153, 154, 161, 155, 162, 62, 110, 122, 123,
1783 124, 135, 125, 136, 126, 137, 173, 174, 175, 185,
1784 176, 186, 218, 44, 70, 45, 71, 46, 72, 47,
1785 69, 115, 116, 117, 132, 166, 167, 182, 200, 201,
1786 202, 210, 203, 204, 213, 205, 211, 228, 229, 230,
1787 237, 238, 239, 244, 240, 241, 242
1788 };
1789
1790 const unsigned char
1791 AgentParser::yytable_[] =
1792 {
1793 40, 54, 59, 60, 28, 34, 8, 48, 49, 50,
1794 51, 52, 31, 9, 74, 10, 20, 11, 53, 75,
1795 35, 118, 119, 120, 82, 50, 51, 50, 51, 83,
1796 36, 37, 38, 168, 169, 183, 39, 39, 184, 193,
1797 194, 22, 195, 196, 84, 85, 39, 63, 40, 12,
1798 13, 14, 15, 39, 64, 39, 54, 59, 60, 233,
1799 149, 150, 234, 235, 236, 149, 150, 82, 133, 103,
1800 104, 105, 131, 134, 138, 54, 59, 60, 39, 139,
1801 112, 163, 187, 187, 121, 187, 164, 188, 189, 214,
1802 190, 248, 231, 66, 215, 232, 249, 1, 2, 3,
1803 177, 178, 65, 67, 86, 73, 77, 80, 87, 88,
1804 89, 90, 121, 91, 151, 93, 94, 95, 96, 97,
1805 98, 100, 101, 114, 106, 102, 10, 111, 109, 142,
1806 127, 141, 143, 145, 146, 147, 191, 157, 221, 107,
1807 158, 159, 160, 165, 179, 180, 207, 208, 212, 216,
1808 219, 220, 222, 113, 225, 245, 197, 198, 199, 217,
1809 192, 224, 226, 227, 246, 247, 250, 92, 251, 252,
1810 156, 148, 99, 181, 209, 206, 144, 223, 243, 253,
1811 255, 254, 0, 0, 0, 0, 0, 0, 197, 198,
1812 199
1813 };
1814
1815 const short
1816 AgentParser::yycheck_[] =
1817 {
1818 26, 27, 27, 27, 24, 10, 0, 11, 12, 13,
1819 14, 15, 41, 5, 3, 7, 7, 9, 22, 8,
1820 25, 16, 17, 18, 3, 13, 14, 13, 14, 8,
1821 35, 36, 37, 19, 20, 3, 41, 41, 6, 27,
1822 28, 7, 30, 31, 64, 65, 41, 6, 74, 41,
1823 42, 43, 44, 41, 3, 41, 82, 82, 82, 29,
1824 23, 24, 32, 33, 34, 23, 24, 3, 3, 89,
1825 90, 91, 8, 8, 3, 101, 101, 101, 41, 8,
1826 100, 3, 3, 3, 110, 3, 8, 8, 8, 3,
1827 8, 3, 3, 8, 8, 6, 8, 38, 39, 40,
1828 159, 160, 4, 3, 41, 4, 4, 4, 4, 4,
1829 4, 4, 138, 4, 140, 4, 42, 4, 4, 7,
1830 4, 4, 7, 26, 41, 7, 7, 5, 41, 3,
1831 7, 6, 4, 4, 4, 4, 41, 5, 42, 95,
1832 7, 7, 7, 7, 4, 4, 4, 4, 4, 41,
1833 4, 4, 4, 101, 5, 4, 182, 182, 182, 21,
1834 180, 41, 41, 7, 4, 4, 4, 74, 44, 42,
1835 142, 138, 82, 163, 187, 183, 133, 214, 231, 42,
1836 41, 248, -1, -1, -1, -1, -1, -1, 214, 214,
1837 214
1838 };
1839
1840 const unsigned char
1841 AgentParser::yystos_[] =
1842 {
1843 0, 38, 39, 40, 46, 47, 48, 49, 0, 5,
1844 7, 9, 41, 42, 43, 44, 52, 53, 54, 59,
1845 7, 64, 7, 50, 60, 55, 65, 51, 53, 61,
1846 62, 41, 57, 58, 10, 25, 35, 36, 37, 41,
1847 63, 66, 67, 68, 108, 110, 112, 114, 11, 12,
1848 13, 14, 15, 22, 63, 70, 71, 72, 74, 75,
1849 77, 79, 91, 6, 3, 4, 8, 3, 69, 115,
1850 109, 111, 113, 4, 3, 8, 73, 4, 76, 78,
1851 4, 80, 3, 8, 53, 53, 41, 4, 4, 4,
1852 4, 4, 67, 4, 42, 4, 4, 7, 4, 71,
1853 4, 7, 7, 53, 53, 53, 41, 54, 56, 41,
1854 92, 5, 53, 70, 26, 116, 117, 118, 16, 17,
1855 18, 63, 93, 94, 95, 97, 99, 7, 81, 82,
1856 83, 8, 119, 3, 8, 96, 98, 100, 3, 8,
1857 84, 6, 3, 4, 117, 4, 4, 4, 94, 23,
1858 24, 63, 85, 86, 87, 89, 83, 5, 7, 7,
1859 7, 88, 90, 3, 8, 7, 120, 121, 19, 20,
1860 63, 75, 77, 101, 102, 103, 105, 101, 101, 4,
1861 4, 86, 122, 3, 6, 104, 106, 3, 8, 8,
1862 8, 41, 53, 27, 28, 30, 31, 63, 75, 77,
1863 123, 124, 125, 127, 128, 130, 121, 4, 4, 102,
1864 126, 131, 4, 129, 3, 8, 41, 21, 107, 4,
1865 4, 42, 4, 124, 41, 5, 41, 7, 132, 133,
1866 134, 3, 6, 29, 32, 33, 34, 135, 136, 137,
1867 139, 140, 141, 133, 138, 4, 4, 4, 3, 8,
1868 4, 44, 42, 42, 136, 41
1869 };
1870
1871 const unsigned char
1872 AgentParser::yyr1_[] =
1873 {
1874 0, 45, 47, 46, 48, 46, 49, 46, 51, 50,
1875 52, 53, 53, 53, 53, 53, 53, 53, 55, 54,
1876 56, 57, 57, 58, 58, 60, 59, 61, 61, 62,
1877 62, 63, 65, 64, 66, 66, 67, 67, 67, 67,
1878 67, 67, 69, 68, 70, 70, 71, 71, 71, 71,
1879 71, 71, 71, 73, 72, 74, 76, 75, 78, 77,
1880 80, 79, 81, 81, 82, 82, 84, 83, 85, 85,
1881 85, 86, 86, 88, 87, 90, 89, 92, 91, 93,
1882 93, 94, 94, 94, 94, 96, 95, 98, 97, 100,
1883 99, 101, 101, 102, 102, 102, 102, 102, 104, 103,
1884 106, 105, 107, 109, 108, 111, 110, 113, 112, 115,
1885 114, 116, 116, 117, 119, 118, 120, 120, 122, 121,
1886 123, 123, 124, 124, 124, 124, 124, 124, 124, 126,
1887 125, 127, 129, 128, 131, 130, 132, 132, 134, 133,
1888 135, 135, 136, 136, 136, 136, 138, 137, 139, 140,
1889 141
1890 };
1891
1892 const unsigned char
1893 AgentParser::yyr2_[] =
1894 {
1895 0, 2, 0, 3, 0, 3, 0, 3, 0, 4,
1896 1, 1, 1, 1, 1, 1, 1, 1, 0, 4,
1897 1, 0, 1, 3, 5, 0, 4, 0, 1, 1,
1898 3, 2, 0, 4, 1, 3, 1, 1, 1, 1,
1899 1, 1, 0, 6, 1, 3, 1, 1, 1, 1,
1900 1, 1, 1, 0, 4, 3, 0, 4, 0, 4,
1901 0, 6, 0, 1, 1, 3, 0, 4, 1, 3,
1902 1, 1, 1, 0, 4, 0, 4, 0, 6, 1,
1903 3, 1, 1, 1, 1, 0, 6, 0, 6, 0,
1904 6, 1, 3, 1, 1, 1, 1, 1, 0, 4,
1905 0, 4, 1, 0, 4, 0, 4, 0, 4, 0,
1906 6, 1, 3, 1, 0, 6, 1, 3, 0, 4,
1907 1, 3, 1, 1, 1, 1, 1, 1, 1, 0,
1908 4, 3, 0, 4, 0, 6, 1, 3, 0, 4,
1909 1, 3, 1, 1, 1, 1, 0, 4, 3, 3,
1910 3
1911 };
1912
1913
1914
1915 // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1916 // First, the terminals, then, starting at \a yyntokens_, nonterminals.
1917 const char*
1918 const AgentParser::yytname_[] =
1919 {
1920 "\"end of file\"", "error", "$undefined", "\",\"", "\":\"", "\"[\"",
1921 "\"]\"", "\"{\"", "\"}\"", "\"null\"", "\"Control-agent\"",
1922 "\"http-host\"", "\"http-port\"", "\"user-context\"", "\"comment\"",
1923 "\"control-sockets\"", "\"dhcp4\"", "\"dhcp6\"", "\"d2\"",
1924 "\"socket-name\"", "\"socket-type\"", "\"unix\"", "\"hooks-libraries\"",
1925 "\"library\"", "\"parameters\"", "\"Logging\"", "\"loggers\"",
1926 "\"name\"", "\"output_options\"", "\"output\"", "\"debuglevel\"",
1927 "\"severity\"", "\"flush\"", "\"maxsize\"", "\"maxver\"", "\"Dhcp4\"",
1928 "\"Dhcp6\"", "\"DhcpDdns\"", "START_JSON", "START_AGENT",
1929 "START_SUB_AGENT", "\"constant string\"", "\"integer\"",
1930 "\"floating point\"", "\"boolean\"", "$accept", "start", "$@1", "$@2",
1931 "$@3", "sub_agent", "$@4", "json", "value", "map", "$@5", "map_value",
1932 "map_content", "not_empty_map", "list_generic", "$@6", "list_content",
1933 "not_empty_list", "unknown_map_entry", "agent_syntax_map", "$@7",
1934 "global_objects", "global_object", "agent_object", "$@8",
1935 "global_params", "global_param", "http_host", "$@9", "http_port",
1936 "user_context", "$@10", "comment", "$@11", "hooks_libraries", "$@12",
1937 "hooks_libraries_list", "not_empty_hooks_libraries_list",
1938 "hooks_library", "$@13", "hooks_params", "hooks_param", "library",
1939 "$@14", "parameters", "$@15", "control_sockets", "$@16",
1940 "control_sockets_params", "control_socket", "dhcp4_server_socket",
1941 "$@17", "dhcp6_server_socket", "$@18", "d2_server_socket", "$@19",
1942 "control_socket_params", "control_socket_param", "socket_name", "$@20",
1943 "socket_type", "$@21", "socket_type_value", "dhcp4_json_object", "$@22",
1944 "dhcp6_json_object", "$@23", "dhcpddns_json_object", "$@24",
1945 "logging_object", "$@25", "logging_params", "logging_param", "loggers",
1946 "$@26", "loggers_entries", "logger_entry", "$@27", "logger_params",
1947 "logger_param", "name", "$@28", "debuglevel", "severity", "$@29",
1948 "output_options_list", "$@30", "output_options_list_content",
1949 "output_entry", "$@31", "output_params_list", "output_params", "output",
1950 "$@32", "flush", "maxsize", "maxver", YY_NULLPTR
1951 };
1952
1953#if AGENT_DEBUG
1954 const unsigned short
1955 AgentParser::yyrline_[] =
1956 {
1957 0, 114, 114, 114, 115, 115, 116, 116, 124, 124,
1958 135, 141, 142, 143, 144, 145, 146, 147, 151, 151,
1959 162, 167, 168, 176, 180, 187, 187, 193, 194, 197,
1960 201, 214, 223, 223, 235, 236, 240, 241, 242, 243,
1961 244, 245, 249, 249, 266, 267, 272, 273, 274, 275,
1962 276, 277, 278, 281, 281, 289, 294, 294, 319, 319,
1963 347, 347, 357, 358, 361, 362, 365, 365, 373, 374,
1964 375, 378, 379, 382, 382, 390, 390, 400, 400, 413,
1965 414, 419, 420, 421, 422, 426, 426, 437, 437, 448,
1966 448, 459, 460, 464, 465, 466, 467, 468, 472, 472,
1967 481, 481, 489, 495, 495, 502, 502, 509, 509, 521,
1968 521, 534, 535, 539, 543, 543, 555, 556, 560, 560,
1969 568, 569, 572, 573, 574, 575, 576, 577, 578, 581,
1970 581, 589, 594, 594, 602, 602, 612, 613, 616, 616,
1971 624, 625, 628, 629, 630, 631, 634, 634, 642, 647,
1972 652
1973 };
1974
1975 // Print the state stack on the debug stream.
1976 void
1977 AgentParser::yystack_print_ ()
1978 {
1979 *yycdebug_ << "Stack now";
1981 i = yystack_.begin (),
1982 i_end = yystack_.end ();
1983 i != i_end; ++i)
1984 *yycdebug_ << ' ' << i->state;
1985 *yycdebug_ << '\n';
1986 }
1987
1988 // Report on the debug stream that the rule \a yyrule is going to be reduced.
1989 void
1990 AgentParser::yy_reduce_print_ (int yyrule)
1991 {
1992 unsigned yylno = yyrline_[yyrule];
1993 int yynrhs = yyr2_[yyrule];
1994 // Print the symbols being reduced, and their result.
1995 *yycdebug_ << "Reducing stack by rule " << yyrule - 1
1996 << " (line " << yylno << "):\n";
1997 // The symbols being reduced.
1998 for (int yyi = 0; yyi < yynrhs; yyi++)
1999 YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
2000 yystack_[(yynrhs) - (yyi + 1)]);
2001 }
2002#endif // AGENT_DEBUG
2003
2004
2005#line 14 "agent_parser.yy" // lalr1.cc:1218
2006} } // isc::agent
2007#line 2008 "agent_parser.cc" // lalr1.cc:1218
2008#line 657 "agent_parser.yy" // lalr1.cc:1219
2009
2010
2011void
2013 const std::string& what)
2014{
2015 ctx.error(loc, what);
2016}
#define yylex
Definition: agent_lexer.cc:27
if(!(yy_init))
#define YYUSE(E)
Definition: agent_parser.cc:96
#define YYCDEBUG
#define YYABORT
#define YYLLOC_DEFAULT(Current, Rhs, N)
Definition: agent_parser.cc:80
#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:61
#define YYERROR
Define the isc::agent::parser class.
#define YY_RVREF(Type)
Definition: agent_parser.h:84
#define YY_MOVE_REF(Type)
Definition: agent_parser.h:83
#define YY_MOVE
Definition: agent_parser.h:81
#define AGENT_DEBUG
Definition: agent_parser.h:160
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.
location location_type
Symbol locations.
Definition: agent_parser.h:525
virtual int parse()
Parse.
int symbol_number_type
Symbol type: an internal symbol number.
Definition: agent_parser.h:589
Parser context is a wrapper around flex/bison instances dedicated to Control-agent config file parser...
void error(const isc::agent::location &loc, const std::string &what)
Error handler.
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 Logging/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 content of Logging.
@ LOGGING
Used while parsing Control-agent/control-sockets.
@ LOGGERS
Used while parsing Logging/loggers/output_options structures.
void enter(const LexerContext &ctx)
Enter a new syntactic context.
Present a slice of the top of a stack.
Definition: agent_parser.h:269
void pop(int n=1)
Definition: agent_parser.h:229
const_iterator begin() const
Definition: agent_parser.h:248
S::const_reverse_iterator const_iterator
Definition: agent_parser.h:175
const_iterator end() const
Definition: agent_parser.h:254
size_type size() const
Definition: agent_parser.h:242
void push(YY_MOVE_REF(T) t)
Steal the contents of t.
Definition: agent_parser.h:222
Notes: IntElement type is changed to int64_t.
Definition: data.h:544
void merge(ElementPtr element, ConstElementPtr other)
Merges the data from other into element.
Definition: data.cc:1096
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
boost::shared_ptr< Element > ElementPtr
Definition: data.h:22
Defines the logger used by the top-level component of kea-dhcp-ddns.
location_type location
The location.
Definition: agent_parser.h:665
void move(basic_symbol &s)
Destructive move, s is emptied into this.
void clear()
Destroy contents, and record that is empty.
bool empty() const
Whether empty.
Syntax errors thrown from user actions.
Definition: agent_parser.h:529